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 9742792f8ca9af30c7de2d479337389678c33f59 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 11 Apr 2017 11:59:27 -0500 Subject: Fix for H5Dset_extent test failure with extensive array indexing (HDFFV-9771) 1) Calculate chunk index for extensive array index based on swizzled max chunks when unlim_dim > 0 2) Minor fixes to test/fheap.c that somehow were missed from last check in. See pull request #396 review comments. --- src/H5Dearray.c | 15 +++++++++++--- src/H5Oprivate.h | 1 + test/fheap.c | 62 +++++++++++++++++++++++++++---------------------------- test/set_extent.c | 18 ---------------- 4 files changed, 44 insertions(+), 52 deletions(-) diff --git a/src/H5Dearray.c b/src/H5Dearray.c index e9dbd0d..240afb7 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -1137,7 +1137,7 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim); /* Calculate the index of this chunk */ - idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks); + idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_max_down_chunks); } /* end if */ else { /* Calculate the index of this chunk */ @@ -1202,7 +1202,8 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout) /* "Swizzle" constant dimensions for this dataset */ if(layout->u.earray.unlim_dim > 0) { - hsize_t swizzled_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of # of chunks in each dimension */ + hsize_t swizzled_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of # of chunks in each dimension */ + hsize_t swizzled_max_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of max # of chunks in each dimension */ /* Get the swizzled chunk dimensions */ HDmemcpy(layout->u.earray.swizzled_dim, layout->dim, (layout->ndims - 1) * sizeof(layout->dim[0])); @@ -1215,6 +1216,14 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout) /* Get the swizzled "down" sizes for each dimension */ if(H5VM_array_down((layout->ndims - 1), swizzled_chunks, layout->u.earray.swizzled_down_chunks) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value") + + /* Get the swizzled max number of chunks in each dimension */ + HDmemcpy(swizzled_max_chunks, layout->max_chunks, (layout->ndims - 1) * sizeof(swizzled_max_chunks[0])); + H5VM_swizzle_coords(hsize_t, swizzled_max_chunks, layout->u.earray.unlim_dim); + + /* Get the swizzled max "down" sizes for each dimension */ + if(H5VM_array_down((layout->ndims - 1), swizzled_max_chunks, layout->u.earray.swizzled_max_down_chunks) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value") } /* end if */ done: @@ -1414,7 +1423,7 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim); /* Calculate the index of this chunk */ - idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks); + idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_max_down_chunks); } /* end if */ else { /* Calculate the index of this chunk */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index f0fbe72..0a4ed74 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -584,6 +584,7 @@ typedef struct H5O_layout_chunk_earray_t { unsigned unlim_dim; /* Rank of unlimited dimension for dataset */ uint32_t swizzled_dim[H5O_LAYOUT_NDIMS]; /* swizzled chunk dimensions */ hsize_t swizzled_down_chunks[H5O_LAYOUT_NDIMS]; /* swizzled "down" size of number of chunks in each dimension */ + hsize_t swizzled_max_down_chunks[H5O_LAYOUT_NDIMS]; /* swizzled max "down" size of number of chunks in each dimension */ } H5O_layout_chunk_earray_t; typedef struct H5O_layout_chunk_bt2_t { diff --git a/test/fheap.c b/test/fheap.c index 77de4a8..d2a7900 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -553,7 +553,7 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, del_str = get_del_string(tparam); HDassert(del_str); test_desc = (char *)H5MM_malloc(HDstrlen(del_str) + HDstrlen(base_desc)); - sprintf(test_desc, base_desc, del_str); + HDsprintf(test_desc, base_desc, del_str); TESTING(test_desc); H5MM_xfree(del_str); H5MM_xfree(test_desc); @@ -7683,10 +7683,10 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ TESTING("incremental object insertion and removal") for(i = 0; i < 100; i++) { - sprintf(obj1.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i); + HDsprintf(obj1.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i); for(j = 0; j < i; j++) { - sprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j); + HDsprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j); if(H5HF_remove(fh, dxpl, heap_id[j]) < 0) FAIL_STACK_ERROR @@ -16393,7 +16393,7 @@ main(void) * running time will be long. */ if(ExpressMode > 1) - printf("***Express test mode on. Some tests may be skipped\n"); + HDprintf("***Express test mode on. Some tests may be skipped\n"); else if(ExpressMode == 0) num_pb_fs = NUM_PB_FS; @@ -16475,12 +16475,12 @@ main(void) switch(curr_test) { /* "Normal" testing parameters */ case FHEAP_TEST_NORMAL: - puts("Testing with normal parameters"); + HDputs("Testing with normal parameters"); break; /* "Re-open heap" testing parameters */ case FHEAP_TEST_REOPEN: - puts("Testing with reopen heap flag set"); + HDputs("Testing with reopen heap flag set"); tparam.reopen_heap = FHEAP_TEST_REOPEN; break; @@ -16512,12 +16512,12 @@ main(void) switch(fill) { /* "Bulk fill" heap blocks with 'large' objects */ case FHEAP_TEST_FILL_LARGE: - puts("Bulk-filling blocks w/large objects"); + HDputs("Bulk-filling blocks w/large objects"); break; /* "Bulk fill" heap blocks with 'single' objects */ case FHEAP_TEST_FILL_SINGLE: - puts("Bulk-filling blocks w/single object"); + HDputs("Bulk-filling blocks w/single object"); break; /* An unknown test? */ @@ -16568,25 +16568,25 @@ main(void) * level of complexity gradually. -QAK */ if(ExpressMode > 1) - printf("***Express test mode on. test_man_start_5th_recursive_indirect is skipped\n"); + HDprintf("***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); /* * Test fractal heap object deletion */ - /* Simple removal */ - 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); - nerrors += test_man_remove_one_larger(fapl, &small_cparam, &tparam); - tparam.del_dir = FHEAP_DEL_FORWARD; - nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); - tparam.del_dir = FHEAP_DEL_REVERSE; - nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); - tparam.del_dir = FHEAP_DEL_FORWARD; - nerrors += test_man_remove_three_larger(fapl, &small_cparam, &tparam); - tparam.del_dir = FHEAP_DEL_REVERSE; + /* Simple removal */ + 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); + nerrors += test_man_remove_one_larger(fapl, &small_cparam, &tparam); + tparam.del_dir = FHEAP_DEL_FORWARD; + nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); + tparam.del_dir = FHEAP_DEL_REVERSE; + nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); + tparam.del_dir = FHEAP_DEL_FORWARD; + nerrors += test_man_remove_three_larger(fapl, &small_cparam, &tparam); + tparam.del_dir = FHEAP_DEL_REVERSE; nerrors += test_man_remove_three_larger(fapl, &small_cparam, &tparam); /* Incremental insert & removal */ @@ -16613,7 +16613,7 @@ main(void) nerrors += test_man_remove_first_two_rows(fapl, &small_cparam, &tparam); nerrors += test_man_remove_first_four_rows(fapl, &small_cparam, &tparam); if(ExpressMode > 1) - printf("***Express test mode on. Some tests skipped\n"); + HDprintf("***Express test mode on. Some tests skipped\n"); else { nerrors += test_man_remove_all_root_direct(fapl, &small_cparam, &tparam); nerrors += test_man_remove_2nd_indirect(fapl, &small_cparam, &tparam); @@ -16643,7 +16643,7 @@ main(void) nerrors += test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); nerrors += test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); if(ExpressMode > 1) - printf("***Express test mode on. Some tests skipped\n"); + HDprintf("***Express test mode on. Some tests skipped\n"); else { nerrors += test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(fapl, &small_cparam, &tparam); nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); @@ -16684,12 +16684,12 @@ main(void) switch(id_len) { /* Use "normal" form for 'huge' object's heap IDs */ case 0: - puts("Using 'normal' heap ID format for 'huge' objects"); + HDputs("Using 'normal' heap ID format for 'huge' objects"); break; /* Use "direct" form for 'huge' object's heap IDs */ case 1: - puts("Using 'direct' heap ID format for 'huge' objects"); + HDputs("Using 'direct' heap ID format for 'huge' objects"); /* Adjust actual length of heap IDs for directly storing 'huge' object's file offset & length in heap ID */ tparam.actual_id_len = 17; /* 1 + 8 (file address size) + 8 (file length size) */ @@ -16698,7 +16698,7 @@ main(void) /* Use "direct" storage for 'huge' objects and larger IDs for 'tiny' objects */ case 2: small_cparam.id_len = 37; - puts("Using 'direct' heap ID format for 'huge' objects and larger IDs for 'tiny' objects"); + HDputs("Using 'direct' heap ID format for 'huge' objects and larger IDs for 'tiny' objects"); tparam.actual_id_len = 37; break; @@ -16756,10 +16756,10 @@ main(void) /* Random object insertion & deletion */ if(ExpressMode > 1) - printf("***Express test mode on. Some tests skipped\n"); + HDprintf("***Express test mode on. Some tests skipped\n"); else { /* Random tests using "small" heap creation parameters */ - puts("Using 'small' heap creation parameters"); + HDputs("Using 'small' heap creation parameters"); /* (reduce size of tests when re-opening each time) */ /* XXX: Try to speed things up enough that these tests don't have to be reduced when re-opening */ @@ -16772,7 +16772,7 @@ main(void) nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam); /* Random tests using "large" heap creation parameters */ - puts("Using 'large' heap creation parameters"); + HDputs("Using 'large' heap creation parameters"); tparam.actual_id_len = LARGE_HEAP_ID_LEN; /* (reduce size of tests when re-opening each time) */ @@ -16818,7 +16818,7 @@ main(void) if(nerrors) goto error; - puts("All fractal heap tests passed."); + HDputs("All fractal heap tests passed."); /* Release space for the shared objects */ H5MM_xfree(shared_wobj_g); @@ -16840,7 +16840,7 @@ HDfprintf(stderr, "Uncomment cleanup!\n"); return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5MM_xfree(shared_wobj_g); H5MM_xfree(shared_robj_g); diff --git a/test/set_extent.c b/test/set_extent.c index 949120b..052a35a 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -2603,15 +2603,6 @@ static int test_random_rank4( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, volatile unsigned i, j, k, l, m; /* Local indices */ char filename[NAME_BUF_SIZE]; - /* *** FIXME *** - * Skip the test if an extensible array index is requested, as resizing - * them is broken. - * - * Remove these lines as appropriate when these problems are fixed. - */ - if(index_type == RANK4_INDEX_EARRAY) - return 0; - /* create a new file */ h5_fixname(FILENAME[4], fapl, filename, sizeof filename); if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) @@ -2816,15 +2807,6 @@ static int test_random_rank4_vl( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, volatile unsigned i, j, k, l, m; /* Local indices */ char filename[NAME_BUF_SIZE]; - /* *** FIXME *** - * Skip the test if an extensible array index is requested, as resizing - * them is broken. - * - * Remove these lines as appropriate when these problems are fixed. - */ - if(index_type == RANK4_INDEX_EARRAY) - return 0; - /* Initialize fill value buffers so they aren't freed in case of an error */ fill_value.len = 0; fill_value.p = NULL; -- cgit v0.12 From e3d8dacaadbbb886b5bca52ff27f4aac5c5ea0a8 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 11 Apr 2017 12:18:49 -0500 Subject: Combined the README_DEVEL and README, and removed out-dated README material --- fortran/src/README | 260 ++++++++++++---------------------------- fortran/src/README_DEVELOPEMENT | 38 ------ 2 files changed, 78 insertions(+), 220 deletions(-) delete mode 100644 fortran/src/README_DEVELOPEMENT diff --git a/fortran/src/README b/fortran/src/README index 7af5df3..a258e07 100644 --- a/fortran/src/README +++ b/fortran/src/README @@ -1,122 +1,18 @@ +=================================== +README for the Fortran APIs to HDF5 +=================================== - README for the FORTRAN90 Prototype APIs to HDF5 - - -This distribution contains the HDF5 FORTRAN90 APIs source code (prototype) -based on the HDF5 1.2.2 release (ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current), -tests and examples. - -This prototype supports a selected subset of the HDF5 Library functionality. -A complete list of the Fortran subroutines can be found in the HDF5 -Reference Manual provided with this release. -Check the online documentation at http://hdf.ncsa.uiuc.edu/HDF5/doc (select -the "HDF5 Fortran90 Docs" link at the bottom of the left-hand column) or -H5_F90.R1.2.2.RefMan.tar at ftp://hdf.ncsa.uiuc.edu/HDF5/fortran . - -Changes since last release (October 1999) -========================================= -* Support for Linux -* Support for parallel features (tested on O2K platform only) -* Most of the functions from the H5R, H5P, H5T, H5E and H5I interfaces were - implemented. See Reference Manual for complete list. The new functions - include support for object and dataset region references, and for - compound datatypes. -* This prototype supports more predefined types. See list below in - the "About the Fortran APIs" section. -* This prototype supports T3E and T3E with mpt 1.3. One has to modify - H5Dff.f90, H5Aff.f90, H5Pff.f90 to comment lines with the module procedures for - double precision datatypes. See source code. - -Supported platforms -=================== -The FORTRAN90 APIs provided here are known to work with the -following platforms and compilers: - - * SunOS 5.6 with WorkshopCompilers 4.2 Fortran 90 1.2 - * SunOS 5.7 with WorkshopCompilers 5.0 Fortran 90 2.0 - * OSF1 V4.0 with Digital Fortran 90 4.1 - * Linux RedHat 6.1, Kernel 2.2.12 with PGF90 - * T3E with Cray Fortran: Version 3.4.0.0 - with mpt 1.3 - -Compilation -=========== - -1. Install HDF5 Release 1.2.2 on your system - (ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current). If you are using a - binary distribution provided by the HDF group, make sure that a GZIP - library is installed on your system. If you do not have a GZIP library, - you may copy it from the HDF FTP server. - -2. In the src directory copy H5fortran_types.f90_ to - H5fortran_types.f90, where is one of the following: - - solaris - digunix - linux - - Example: On Digital Unix systems use the following command - cp H5fortran_types.f90_digunix H5fortran_types.f90 - -3. Edit Makefile_in the src/, test/ and examples/ directories - to specify the locations of the HDF5 C Library, the GZIP Library, and the - corresponding include files on your system. - -4. In the src directory, run make to create the HDF5 FORTRAN90 library - hdf5_fortran.a - make -f Makefile_ - - Example: On Solaris run - make -f Makefile_solaris - - The Fortran library hdf5_fortran.a will be created. - -5. In the test directory, build tests by running - make -f Makefile_ - This command will build fortranlib_test, fflush1 and fflush2 executables. - Run those executables to make sure that the library works on your system. - -6. In the examples directory, run - make -f Makefile_ - to build the following examples: - - fileexample - creates an HDF5 file - dsetexample - creates an empty dataset of integers - rwdsetexample - writes and reads to the dataset created by dsetexample - groupexample - creates a group in the file - grpsexample - creates groups using absolute and relative names - grpdsetexample - creates datasets in the groups - hyperslabexample - writes and reads a hyperslab - selectele - writes element selections - attrexample - creates and writes a dataset attribute - compound - creates, writes and reads one dim array of structures - mountexample - shows how to use mounting files to access a dataset - refobjexample - creates and stores references to the objects - refregexample - creates and stores references to the dataset regions - - The script run_example.sh runs the examples in the appropriate order. - - Use the HDF5 utility, h5dump, to see the content of the created HDF5 files. - -7. Install the HDF5 Reference Manual (in HTML format). The manual - can be found in the Unix tar file H5_F90.R1.2.2.RefMan.tar - on the ftp server and is served over the Web from - http://hdf.ncsa.uiuc.edu/HDF5/doc/ (select the "HDF5 Fortran90 Docs" - link at the bottom of the left-hand column). - - -8. Send bug reports and comments to hdfhelp@ncsa.uiuc.edu - -User's Guide Notes -+++++++++++++++++++ +This directory contains Fortran APIs for HDF5 Library functionality. +A complete list of implemented Fortran subroutines can be found in the HDF5 +Reference Manual. About the source code organization ================================== The Fortran APIs are organized in modules parallel to the HDF5 Interfaces. -Each module is in a separate file with the name H5*ff.f. Corresponding C +Each module is in a separate file with the name H5*ff.F90. Corresponding C stubs are in the H5*f.c files. For example, the Fortran File APIs are in -the file H5Fff.f and the corresponding C stubs are in the file H5Ff.c. +the file H5Fff.F90 and the corresponding C stubs are in the file H5Ff.c. Each module contains Fortran definitions of the constants, interfaces to the subroutines if needed, and the subroutines themselves. @@ -124,31 +20,29 @@ the subroutines if needed, and the subroutines themselves. Users must use constant names in their programs instead of the numerical values, as the numerical values are subject to change without notice. -About the Fortran APIs -======================= +Quick overview of the Fortran APIs +============================================== + +* An in-depth description of each Fortran API and its parameters can + be found in the HDF5 Reference Manual. * The Fortran APIs come in the form of Fortran subroutines. * Each Fortran subroutine name is derived from the corresponding C function name by adding "_f" to the name. For example, the name of the C function to create an HDF5 file is H5Fcreate; the corresponding Fortran subroutine - is h5fcreate_f. - -* A description of each Fortran subroutine and its parameters can be found - following the description of the corresponding C function in the - Reference Manual provided with this release. The manual can be found in - the Unix tar file H5_F90.R1.2.2.tar in this directory and - is served over the Web from http://hdf.ncsa.uiuc.edu/HDF5/doc/ (select - the "HDF5 Fortran90 Docs" link at the bottom of the left-hand column). + is h5fcreate_f. -* The parameter list for each Fortran subroutine has two more parameters - than the corresponding C function. These additional parameters hold +* The parameter list for each Fortran subroutine usually has two more parameters + than the corresponding C function. These additional parameters typically hold the return value and an error code. The order of the Fortran subroutine - parameters may differ from the order of the C function parameters. - The Fortran subroutine parameters are listed in the following order: + parameters may differ from the order of the C function parameters. + + The Fortran subroutine parameters are usually listed in the following order: -- required input parameters, -- output parameters, including return value and error code, and - -- optional input parameters. + optional input parameters. + For example, the C function to create a dataset has the following prototype: @@ -158,72 +52,35 @@ About the Fortran APIs The corresponding Fortran subroutine has the following form: - SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, - hdferr, creation_prp) - + SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, & + hdferr, dset_creation_prp, link_creation_prp, dset_access_prop) + The first four parameters of the Fortran subroutine correspond to the C function parameters. The fifth parameter dset_id is an output parameter and contains a valid dataset identifier if the value of the - sixth output parameter hdferr indicates successful completion. + sixth output parameter, hdferr, indicates successful completion. (Error code descriptions are provided with the subroutine descriptions - in the Reference Manual.) The seventh input parameter creation_prp - is optional, and may be omitted when the default creation property - list is used. - (XXX: Update this! - QAK) - -* Parameters to the Fortran subroutines have one of the following - predefined datatypes (see the file H5fortran_types.f90 for KIND - definitions): + in the Reference Manual.) The last three input parameters are optional + and may be omitted, resulting in default values being used. + +* Parameters to the Fortran subroutines typically include + predefined datatypes (see the build-time generated file + H5fortran_types.F90 for a complete listing): INTEGER(HID_T) compares with hid_t type in HDF5 C APIs INTEGER(HSIZE_T) compares with hsize_t in HDF5 C APIs INTEGER(HSSIZE_T) compares with hssize_t in HDF5 C APIs INTEGER(SIZE_T) compares with the C size_t type + These integer types usually correspond to 4 or 8 byte integers, - depending on the FORTRAN90 compiler and corresponding HDF5 + depending on the Fortran compiler and corresponding HDF5 C library definitions. - The H5R module defines two types: - TYPE(HOBJ_REF_T_F) compares to the hobj_ref_t in HDF5 C API - TYPE(HDSET_REG_REF_T_F) compares to hdset_reg_ref_t in HDF5 C API - These types are represented by character arrays now. - The internal representation can be changed in the future. - -* Each Fortran application must call the h5init_types subroutine to +* Each Fortran application must call the h5open_f subroutine to initialize the Fortran predefined datatypes before calling the HDF5 Fortran - subroutines. The application must call the h5close_types subroutine - after all calls to the HDF5 Fortran Library. - -* The following predefined types are implemented in this prototype: - - H5T_NATIVE_INTEGER - H5T_NATIVE_REAL - H5T_NATIVE_DOUBLE - H5T_NATIVE_CHARACTER - H5T_STD_REF_OBJ - H5T_STD_REF_DSETREG - H5T_IEEE_F32BE - H5T_IEEE_F32LE - H5T_IEEE_F64BE - H5T_IEEE_F64LE - H5T_STD_I8BE - H5T_STD_I8LE - H5T_STD_I16BE - H5T_STD_I16LE - H5T_STD_I32BE - H5T_STD_I32LE - H5T_STD_I64BE - H5T_STD_I64LE - H5T_STD_U8BE - H5T_STD_U8LE - H5T_STD_U16BE - H5T_STD_U16LE - H5T_STD_U32BE - H5T_STD_U32LE - H5T_STD_U64BE - H5T_STD_U64LE - - + subroutines. The application should call the h5close_f subroutine + after all calls to the HDF5 Fortran Library. + * When a C application reads data stored from a Fortran program, the data will appear to be transposed due to the difference in the C - Fortran storage order. For example, if Fortran writes a 4x6 two-dimensional dataset @@ -233,6 +90,45 @@ About the Fortran APIs * Fortran indices are 1 based. -* Compound datatype datasets can be written or read by atomic fields only. +============================ +FOR DEVELOPERS +============================ + +Procedure to add a new function +---------------------------------- + +(1) Edit the fortran/src/H5*ff.F90 file +(2) Edit the fortran/src/H5*f.c file +(3) Edit the fortran/src/H5f90proto.h file +(4) Add the new function to fortran/src/hdf5_fortrandll.def.in + +Procedure for passing C variables to Fortran +--------------------------------------------- + +(1) Find the C struct name you are interested in: + (a) src/H5public.h if it is a generic type, i.e. H5_* + or + (b) src/H5*public.h if is a specific type, i.e. H5*_ + +(2) Put that structure into an array that will be passed to fortran in: + (a) fortran/src/H5_f.c (add to nh5init_flags_c subroutine) + (b) edit fortran/src/H5f90proto.h and edit nh5init_flags_c interface call + +(3) Edit the function call in fortran/src/H5_ff.F90 + (a) edit the call: FUNCTION h5init_flags_c + (b) edit h5init_flags_c call in h5open_f to match the number of arguments passing + +(4) add the size of the array and array to fortran/src/H5f90global.F90 + - must match the size found it H5_f.c + +NOTE: To just add a default C value argument, do steps (2a) and (4) + + +Procedure for adding a new file to the repository +-------------------------------------------------- + +Add the name of the file to the: + (1) Makefile.am located in the same directory as the newfile + (2) CMakeLists.txt located in the same directory as the newfile + (3) MANIFEST located in the top level directory -Not all of the APIs provided with this prototype have been fully tested. diff --git a/fortran/src/README_DEVELOPEMENT b/fortran/src/README_DEVELOPEMENT deleted file mode 100644 index 43982e1..0000000 --- a/fortran/src/README_DEVELOPEMENT +++ /dev/null @@ -1,38 +0,0 @@ -Procedure to add a new function ---------------------------------- - -(1) Edit the fortran/src/H5*ff.f90 file -(2) Edit the fortran/src/H5*f.c file -(3) Edit the fortran/src/H5f90proto.h file -(4) Add the new function to fortran/src/hdf5_fortrandll.def.in - -Procedure for passing C variables to Fortran ---------------------------------------------- - -(1) Find the C struct name you are interested in: - (a) src/H5public.h if it is a generic type, i.e. H5_* - or - (b) src/H5*public.h if is a specific type, i.e. H5*_ - -(2) Put that structure into an array that will be passed to fortran in: - (a) fortran/src/H5_f.c (add to nh5init_flags_c subroutine) - (b) edit fortran/src/H5f90proto.h and edit nh5init_flags_c interface call - -(3) Edit the function call in fortran/src/H5_ff.f90 - (a) edit the call: FUNCTION h5init_flags_c - (b) edit h5init_flags_c call in h5open_f to match the number of arguments passing - -(4) add the size of the array and array to fortran/src/H5f90global.f90 - - must match the size found it H5_f.c - -NOTE: To just add a default C value argument, do steps (2a) and (4) - - -Procedure for adding a new file to the repository --------------------------------------------------- - -Add the name of the file to the: - (1) Makefile.am located in the same directory as the newfile - (2) CMakeLists.txt located in the same directory as the newfile - (3) MANIFEST located in the top level directory - -- cgit v0.12 From a79ab2d39ecc699d600edda628c6a195429bf74e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 11 Apr 2017 12:57:19 -0500 Subject: DAILYTEST-250 change test props to reduce timeout --- test/CMakeTests.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index f372acf..cbab6fe 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -750,7 +750,7 @@ if (NOT CYGWIN) endif () set_tests_properties (H5TEST-cache PROPERTIES DEPENDS H5TEST-clear-cache-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=3" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 1800) @@ -768,7 +768,7 @@ add_test ( 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" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=3" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -- cgit v0.12 From 265950a83a68ea55b5bc8dcbefa2d09b4f8110be Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 11 Apr 2017 13:16:16 -0500 Subject: updated with README changes --- MANIFEST | 1 - 1 file changed, 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index b312cab..5710f6c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -247,7 +247,6 @@ ./fortran/src/HDF5.F90 ./fortran/src/Makefile.am ./fortran/src/README -./fortran/src/README_DEVELOPEMENT _DO_NOT_DISTRIBUTE_ ./fortran/src/h5fc.in ./fortran/src/hdf5_fortrandll.def.in -- cgit v0.12 From 8a9e4b94c3938f4c42ad9399737afc6478ded160 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 11 Apr 2017 15:10:02 -0500 Subject: Fix URL name --- java/src/jni/exceptionImp.c | 2 +- java/src/jni/h5Constants.c | 2 +- java/src/jni/h5Imp.c | 2 +- java/src/jni/h5aImp.c | 2 +- java/src/jni/h5dImp.c | 2 +- java/src/jni/h5eImp.c | 2 +- java/src/jni/h5fImp.c | 2 +- java/src/jni/h5gImp.c | 2 +- java/src/jni/h5iImp.c | 2 +- java/src/jni/h5jni.h | 2 +- java/src/jni/h5lImp.c | 2 +- java/src/jni/h5oImp.c | 2 +- java/src/jni/h5pImp.c | 2 +- java/src/jni/h5plImp.c | 2 +- java/src/jni/h5rImp.c | 2 +- java/src/jni/h5sImp.c | 2 +- java/src/jni/h5tImp.c | 2 +- java/src/jni/h5util.c | 2 +- java/src/jni/h5util.h | 2 +- java/src/jni/h5zImp.c | 2 +- java/src/jni/nativeData.c | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c index 28eec21..d0e7790 100644 --- a/java/src/jni/exceptionImp.c +++ b/java/src/jni/exceptionImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index c6aa16c..ddca853 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5Imp.c b/java/src/jni/h5Imp.c index 7a24b6f..e548363 100644 --- a/java/src/jni/h5Imp.c +++ b/java/src/jni/h5Imp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c index 5af8aae..5445904 100644 --- a/java/src/jni/h5aImp.c +++ b/java/src/jni/h5aImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index ed1db41..9765dc8 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c index 6e05515..05a7848 100644 --- a/java/src/jni/h5eImp.c +++ b/java/src/jni/h5eImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5fImp.c b/java/src/jni/h5fImp.c index 058ba26..4f0e569 100644 --- a/java/src/jni/h5fImp.c +++ b/java/src/jni/h5fImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5gImp.c b/java/src/jni/h5gImp.c index c40ed64..d724475 100644 --- a/java/src/jni/h5gImp.c +++ b/java/src/jni/h5gImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5iImp.c b/java/src/jni/h5iImp.c index 71e1b71..9c946df 100644 --- a/java/src/jni/h5iImp.c +++ b/java/src/jni/h5iImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5jni.h b/java/src/jni/h5jni.h index 9414d31..cef3bd0 100644 --- a/java/src/jni/h5jni.h +++ b/java/src/jni/h5jni.h @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c index 473b1c7..f7a9df1 100644 --- a/java/src/jni/h5lImp.c +++ b/java/src/jni/h5lImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c index 24f6988..a33d1d7 100644 --- a/java/src/jni/h5oImp.c +++ b/java/src/jni/h5oImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index f39f0e6..c9bd4aa 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c index 34d6f8b..09a1032 100644 --- a/java/src/jni/h5plImp.c +++ b/java/src/jni/h5plImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c index 647f973..3dcbb8d 100644 --- a/java/src/jni/h5rImp.c +++ b/java/src/jni/h5rImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ #ifdef __cplusplus diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c index d996ae5..929f6d6 100644 --- a/java/src/jni/h5sImp.c +++ b/java/src/jni/h5sImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c index 1467b41..26f9b5c 100644 --- a/java/src/jni/h5tImp.c +++ b/java/src/jni/h5tImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 0d2999a..17ed35e 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5util.h b/java/src/jni/h5util.h index f690e8b..6194378 100644 --- a/java/src/jni/h5util.h +++ b/java/src/jni/h5util.h @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5zImp.c b/java/src/jni/h5zImp.c index 2c8d8c3..247d1cc 100644 --- a/java/src/jni/h5zImp.c +++ b/java/src/jni/h5zImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/nativeData.c b/java/src/jni/nativeData.c index 8388c99..a123e0f 100644 --- a/java/src/jni/nativeData.c +++ b/java/src/jni/nativeData.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ /* -- 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 606529f5e0cffcea26af66106f094fbe350c5bac Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 12 Apr 2017 17:21:43 -0500 Subject: Due to HDFVIEW-19 add read VL as string function --- java/src/hdf/hdf5lib/H5.java | 3 ++ java/src/jni/h5dImp.c | 91 ++++++++++++++++++++++++++++++++++++++++++++ java/src/jni/h5dImp.h | 9 +++++ 3 files changed, 103 insertions(+) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 0c11846..23e2a34 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -1798,6 +1798,9 @@ public class H5 implements java.io.Serializable { return H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + public synchronized static native int H5DreadVL(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Dread_string(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index 9765dc8..0bb015e 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -55,6 +55,7 @@ extern jobject visit_callback; /* Local Prototypes */ /********************/ +static herr_t H5DreadVL_asstr (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf); static herr_t H5DreadVL_str (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf); static herr_t H5DreadVL_array (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf); static herr_t H5DwriteVL_str (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf); @@ -994,6 +995,96 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1double /* * Class: hdf_hdf5lib_H5 + * Method: H5DreadVL + * Signature: (JJJJJ[Ljava/lang/String;)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5DreadVL + (JNIEnv *env, jclass clss, jlong dataset_id, jlong mem_type_id, jlong mem_space_id, + jlong file_space_id, jlong xfer_plist_id, jobjectArray buf) +{ + herr_t status = -1; + htri_t isVlenStr=0; + + if (buf == NULL) { + h5nullArgument(env, "H5DreadVL: buf is NULL"); + } /* end if */ + else { + isVlenStr = H5Tdetect_class((hid_t)mem_type_id, H5T_STRING); + + if (isVlenStr) + h5badArgument(env, "H5DreadVL: type is not variable length non-string"); + else + status = H5DreadVL_asstr(env, (hid_t)dataset_id, (hid_t)mem_type_id, + (hid_t)mem_space_id, (hid_t)file_space_id, + (hid_t)xfer_plist_id, buf); + } /* end else */ + + return (jint)status; +} /* end Java_hdf_hdf5lib_H5_H5Dread_1VLStrings */ + +herr_t +H5DreadVL_asstr + (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf) +{ + jint i; + jint n; + jstring jstr; + h5str_t h5str; + hvl_t *rdata; + size_t size; + size_t max_len = 0; + herr_t status = -1; + + n = ENVPTR->GetArrayLength(ENVPAR buf); + rdata = (hvl_t*)HDcalloc((size_t)n, sizeof(hvl_t)); + if (rdata == NULL) { + h5JNIFatalError(env, "H5DreadVL_notstr: failed to allocate buff for read"); + } /* end if */ + else { + status = H5Dread(did, tid, mem_sid, file_sid, xfer_plist_id, rdata); + + if (status < 0) { + H5Dvlen_reclaim(tid, mem_sid, xfer_plist_id, rdata); + HDfree(rdata); + h5JNIFatalError(env, "H5DreadVL_notstr: failed to read data"); + } /* end if */ + else { + max_len = 1; + for (i=0; i < n; i++) { + if ((rdata + i)->len > max_len) + max_len = (rdata + i)->len; + } + + size = H5Tget_size(tid) * max_len; + HDmemset(&h5str, 0, sizeof(h5str_t)); + h5str_new(&h5str, 4 * size); + + if (h5str.s == NULL) { + H5Dvlen_reclaim(tid, mem_sid, xfer_plist_id, rdata); + HDfree(rdata); + h5JNIFatalError(env, "H5DreadVL_notstr: failed to allocate buf"); + } /* end if */ + else { + for (i=0; i < n; i++) { + h5str.s[0] = '\0'; + h5str_sprintf(&h5str, did, tid, rdata+i, 0); + jstr = ENVPTR->NewStringUTF(ENVPAR h5str.s); + ENVPTR->SetObjectArrayElement(ENVPAR buf, i, jstr); + } /* end for */ + h5str_free(&h5str); + + H5Dvlen_reclaim(tid, mem_sid, xfer_plist_id, rdata); + HDfree(rdata); + } /* end else */ + } /* end else */ + } /* end else */ + + return status; +} + +/* + * Class: hdf_hdf5lib_H5 * Method: H5Dread_string * Signature: (JJJJJ[Ljava/lang/String;)I */ diff --git a/java/src/jni/h5dImp.h b/java/src/jni/h5dImp.h index eb26265..e79c590 100644 --- a/java/src/jni/h5dImp.h +++ b/java/src/jni/h5dImp.h @@ -206,6 +206,15 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1double /* * Class: hdf_hdf5lib_H5 + * Method: H5DreadVL + * Signature: (JJJJJ[Ljava/lang/String;)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5DreadVL +(JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jobjectArray); + +/* + * Class: hdf_hdf5lib_H5 * Method: H5Dread_string * Signature: (JJJJJ[Ljava/lang/String;)I */ -- cgit v0.12 From 3d1b227a67b557da247f6b683f58617b6d75bfdb Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Thu, 13 Apr 2017 02:47:23 -0500 Subject: Skip tests for page buffering in test/fheap.c for parallel build Skip the two tests for page buffering in test/fheap.c because this feature is disabled in parallel. Activate full testing when this feature is re-enabled in the future for parallel build. --- test/fheap.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/fheap.c b/test/fheap.c index d2a7900..e741aad 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -16388,14 +16388,23 @@ main(void) /* * Caution when turning on ExpressMode 0: - * It will activate testing with different combinations of + * It will activate testing with different combinations of * page buffering and file space strategy and the * running time will be long. + * For parallel build, the last two tests for page buffering + * are skipped because this feature is disabled in parallel. + * Activate full testing when this feature is re-enabled + * in the future for parallel build. */ if(ExpressMode > 1) HDprintf("***Express test mode on. Some tests may be skipped\n"); - else if(ExpressMode == 0) + else if(ExpressMode == 0) { +#ifdef H5_HAVE_PARALLEL + num_pb_fs = NUM_PB_FS - 2; +#else num_pb_fs = NUM_PB_FS; +#endif + } /* Initialize heap creation parameters */ init_small_cparam(&small_cparam); -- 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 fe70476a225d2e0576149e0f1bdf95689f922c77 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 3 Oct 2017 14:57:36 -0500 Subject: Initial checkin for library version bounds Code changes to provide versioning support when adding to the enumerated defines for H5F_libver_t. --- src/H5Aint.c | 42 +- src/H5Dint.c | 77 +- src/H5Dlayout.c | 35 +- src/H5F.c | 26 +- src/H5Fint.c | 52 +- src/H5Fpkg.h | 3 +- src/H5Fprivate.h | 28 +- src/H5Fpublic.h | 11 +- src/H5Fquery.c | 78 +- src/H5Fsuper.c | 46 +- src/H5Gobj.c | 19 +- src/H5HFhdr.c | 8 +- src/H5O.c | 82 +- src/H5Ofill.c | 33 +- src/H5Opkg.h | 5 +- src/H5Opline.c | 31 +- src/H5Oprivate.h | 4 +- src/H5Pfapl.c | 178 +++- src/H5S.c | 34 +- src/H5Sprivate.h | 2 +- src/H5T.c | 34 +- src/H5Tcommit.c | 28 +- src/H5Tprivate.h | 2 +- src/H5trace.c | 6 + test/genall5.c | 127 ++- test/mf.c | 2 + test/testfiles/plist_files/def_fapl_32be | Bin 1520 -> 1697 bytes test/testfiles/plist_files/def_fapl_32le | Bin 1520 -> 1697 bytes test/testfiles/plist_files/def_fapl_64be | Bin 1520 -> 1697 bytes test/testfiles/plist_files/def_fapl_64le | Bin 1520 -> 1697 bytes test/testfiles/plist_files/fapl_32be | Bin 1522 -> 1699 bytes test/testfiles/plist_files/fapl_32le | Bin 1522 -> 1699 bytes test/testfiles/plist_files/fapl_64be | Bin 1522 -> 1699 bytes test/testfiles/plist_files/fapl_64le | Bin 1522 -> 1699 bytes test/testfiles/plist_files/lapl_32be | Bin 1625 -> 1802 bytes test/testfiles/plist_files/lapl_32le | Bin 1625 -> 1802 bytes test/testfiles/plist_files/lapl_64be | Bin 1625 -> 1802 bytes test/testfiles/plist_files/lapl_64le | Bin 1625 -> 1802 bytes test/tfile.c | 1534 +++++++++++++++++++++++++++++- 39 files changed, 2163 insertions(+), 364 deletions(-) diff --git a/src/H5Aint.c b/src/H5Aint.c index 160c7fb..bfc69ec 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -112,6 +112,13 @@ static herr_t H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type /* Local Variables */ /*******************/ +/* Format version bounds for attribute */ +static const unsigned H5O_attr_ver_bounds[] = { + H5O_ATTR_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_ATTR_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_ATTR_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + typedef H5A_t* H5A_t_ptr; H5FL_SEQ_DEFINE(H5A_t_ptr); @@ -210,17 +217,15 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location") /* Set the latest format for datatype, if requested */ - if(H5F_USE_LATEST_FLAGS(loc->oloc->file, H5F_LATEST_DATATYPE)) - if(H5T_set_latest_version(attr->shared->dt) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of datatype") + if(H5T_set_version(loc->oloc->file, attr->shared->dt) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set version of datatype") /* Copy the dataspace for the attribute */ attr->shared->ds = H5S_copy(space, FALSE, TRUE); - /* Set the latest format for dataspace, if requested */ - if(H5F_USE_LATEST_FLAGS(loc->oloc->file, H5F_LATEST_DATASPACE)) - if(H5S_set_latest_version(attr->shared->ds) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of dataspace") + /* Set the version for dataspace */ + if(H5S_set_version(loc->oloc->file, attr->shared->ds) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set version of dataspace") /* Copy the object header information */ if(H5O_loc_copy(&(attr->oloc), loc->oloc, H5_COPY_DEEP) < 0) @@ -1840,11 +1845,11 @@ done: * Function: H5A_set_version * * Purpose: Sets the correct version to encode attribute with. - * Chooses the oldest version possible, unless the "use the - * latest format" flag is set. + * Chooses the oldest version possible, unless the + * file's low bound indicates otherwise. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -1857,7 +1862,7 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) { hbool_t type_shared, space_shared; /* Flags to indicate that shared messages are used for this attribute */ hbool_t use_latest_format; /* Flag indicating the latest attribute version support is enabled */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1865,9 +1870,6 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) HDassert(f); HDassert(attr); - /* Get the file's 'use the latest attribute version support' flag */ - use_latest_format = H5F_USE_LATEST_FLAGS(f, H5F_LATEST_ATTRIBUTE); - /* Check whether datatype and dataspace are shared */ if(H5O_msg_is_shared(H5O_DTYPE_ID, attr->shared->dt) > 0) type_shared = TRUE; @@ -1880,15 +1882,19 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) space_shared = FALSE; /* Check which version to encode attribute with */ - if(use_latest_format) - attr->shared->version = H5O_ATTR_VERSION_LATEST; /* Write out latest attribute version */ - else if(attr->shared->encoding != H5T_CSET_ASCII) + if(attr->shared->encoding != H5T_CSET_ASCII) attr->shared->version = H5O_ATTR_VERSION_3; /* Write version which includes the character encoding */ else if(type_shared || space_shared) attr->shared->version = H5O_ATTR_VERSION_2; /* Write out version with flag for indicating shared datatype or dataspace */ else attr->shared->version = H5O_ATTR_VERSION_1; /* Write out basic version */ + /* Upgrade to the version indicated by the file's low bound if higher */ + attr->shared->version = MAX(attr->shared->version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]); + + /* File bound check */ + if(attr->shared->version > H5O_attr_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_ATTR, H5E_BADRANGE, FAIL, "attribute version out of bounds") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_set_version() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index bdedd1e..9ed7d71 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -639,13 +639,13 @@ done: * Function: H5D__init_type * * Purpose: Copy a datatype for a dataset's use, performing all the - * necessary adjustments, etc. + * necessary adjustments, etc. * * Return: Success: SUCCEED - * Failure: FAIL + * Failure: FAIL * * Programmer: Quincey Koziol - * Thursday, June 24, 2004 + * Thursday, June 24, 2004 * *------------------------------------------------------------------------- */ @@ -654,7 +654,7 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) { htri_t relocatable; /* Flag whether the type is relocatable */ htri_t immutable; /* Flag whether the type is immutable */ - hbool_t use_latest_format; /* Flag indicating the 'latest datatype version support' is enabled */ + hbool_t use_v18_latest_format; /* Flag indicating the 'latest datatype version support' is enabled */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -672,17 +672,16 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) if((immutable = H5T_is_immutable(type)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't check datatype?") - /* Get the file's 'use the latest datatype version support' flag */ - use_latest_format = H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DATATYPE); + use_v18_latest_format = (H5F_LOW_BOUND(file) >= H5F_LIBVER_V18); /* Copy the datatype if it's a custom datatype or if it'll change when it's location is changed */ - if(!immutable || relocatable || use_latest_format) { + if(!immutable || relocatable || use_v18_latest_format) { /* Copy datatype for dataset */ if((dset->shared->type = H5T_copy(type, H5T_COPY_ALL)) == NULL) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy datatype") - /* Convert a datatype (if committed) to a transient type if the committed datatype's file - location is different from the file location where the dataset will be created */ + /* Convert a datatype (if committed) to a transient type if the committed datatype's file + location is different from the file location where the dataset will be created */ if(H5T_convert_committed_datatype(dset->shared->type, file) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get shared datatype info") @@ -690,14 +689,12 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) if(H5T_set_loc(dset->shared->type, file, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't set datatype location") - /* Set the latest format, if requested */ - if(use_latest_format) - if(H5T_set_latest_version(dset->shared->type) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") + if(H5T_set_version(file, dset->shared->type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype") /* Get a datatype ID for the dataset's datatype */ - if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") + if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") } /* end if */ /* Not a custom datatype, just use it directly */ else { @@ -775,7 +772,6 @@ done: static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) { - hbool_t use_latest_format; /* Flag indicating the 'latest dataspace version support' is enabled */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -785,9 +781,6 @@ H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) HDassert(dset); HDassert(space); - /* Get the file's 'use the latest dataspace version support' flag */ - use_latest_format = H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DATASPACE); - /* Copy dataspace for dataset */ if(NULL == (dset->shared->space = H5S_copy(space, FALSE, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dataspace") @@ -796,10 +789,9 @@ H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) if(H5D__cache_dataspace_info(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't cache dataspace info") - /* Set the latest format, if requested */ - if(use_latest_format) - if(H5S_set_latest_version(dset->shared->space) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") + /* Set the version for dataspace */ + if(H5S_set_version(file, dset->shared->space) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") /* Set the dataset's dataspace to 'all' selection */ if(H5S_select_all(dset->shared->space, TRUE) < 0) @@ -926,7 +918,7 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) /* If there is valid information for the old fill value struct, add it */ /* (only if we aren't trying to write the 'latest fill message version support') */ - if(fill_prop->buf && !(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG))) { + if(fill_prop->buf && (H5F_LOW_BOUND(file) < H5F_LIBVER_V18)) { H5O_fill_t old_fill_prop; /* Copy of fill value property, for writing as "old" fill value */ /* Shallow copy the fill value property */ @@ -981,7 +973,7 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) /* (If using the latest 'no modification time message' version support, the modification time is part of the object * header and doesn't use a separate message -QAK) */ - if(!(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_NO_MOD_TIME_MSG))) + if(H5F_LOW_BOUND(file) < H5F_LIBVER_V18) if(H5O_touch_oh(file, dxpl_id, oh, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") @@ -1215,27 +1207,20 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "compact dataset must have early space allocation") } /* end if */ - /* Set the latest version of the layout, pline & fill messages, if requested */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DSET_MSG_FLAGS)) { - /* Set the latest version for the I/O pipeline message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_PLINE_MSG)) - if(H5O_pline_set_latest_version(&new_dset->shared->dcpl_cache.pline) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of I/O filter pipeline") - - /* Set the latest version for the fill message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG)) - /* Set the latest version for the fill value message */ - if(H5O_fill_set_latest_version(&new_dset->shared->dcpl_cache.fill) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") - - /* Set the latest version for the layout message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_LAYOUT_MSG)) - /* Set the latest version for the layout message */ - if(H5D__layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") - } /* end if */ - else if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) { - /* Use latest indexing type for layout message version >= 4 */ + /* Set the version for the I/O pipeline message */ + if(H5O_pline_set_version(file, &new_dset->shared->dcpl_cache.pline) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of I/O filter pipeline") + + /* Set the version for the fill message */ + if(H5O_fill_set_version(file, &new_dset->shared->dcpl_cache.fill) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") + + /* Set the latest version for the layout message */ + if(H5D__layout_set_version(file, &new_dset->shared->layout) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") + + if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) { + /* Use latest indexing type for layout message version >= 4 */ if(H5D__layout_set_latest_indexing(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest indexing") } /* end if */ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index ec18e86..08d7929 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -56,6 +56,13 @@ /* Local Variables */ /*******************/ +/* Format version bounds for layout */ +static const unsigned H5O_layout_ver_bounds[] = { + H5O_LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + /*------------------------------------------------------------------------- @@ -277,11 +284,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__layout_set_latest_version + * Function: H5D__layout_set_version * - * Purpose: Set the encoding for a layout to the latest version. - * Part of the coding in this routine is moved to - * H5D__layout_set_latest_indexing(). + * Purpose: Set the version to encode a layout with. * * Return: Non-negative on success/Negative on failure * @@ -291,35 +296,33 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space, - const H5D_dcpl_cache_t *dcpl_cache) +H5D__layout_set_version(H5F_t *f, H5O_layout_t *layout) { + unsigned vers; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(layout); - HDassert(space); - HDassert(dcpl_cache); + HDassert(f); - /* Set encoding of layout to latest version */ - layout->version = H5O_LAYOUT_VERSION_LATEST; + /* Upgrade to the version indicated by the file's low bound if higher */ + layout->version = MAX(layout->version, H5O_layout_ver_bounds[H5F_LOW_BOUND(f)]); - /* Set the latest indexing type for the layout message */ - if(H5D__layout_set_latest_indexing(layout, space, dcpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest indexing type") + /* File bound check */ + if(layout->version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "layout version out of bounds") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__layout_set_latest_version() */ +} /* end H5D__layout_set_version() */ /*------------------------------------------------------------------------- * Function: H5D__layout_set_latest_indexing * * Purpose: Set the latest indexing type for a layout message - * This is moved from H5D_layout_set_latest_version(). * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5F.c b/src/H5F.c index 211f1aa..1ee16e1 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1633,7 +1633,6 @@ 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_LAYOUT_MSG) > 0); /* Should not be marked for SWMR writing mode already */ if(file->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS) @@ -1899,9 +1898,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fset_latest_format + * Function: H5Fset_libver_bounds (Internal library use) * - * Purpose: Enable switching the "latest format" flag while a file is open. + * Purpose: Set .... the "latest format" flag while a file is open. * * Return: Non-negative on success/Negative on failure * @@ -1910,33 +1909,28 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fset_latest_format(hid_t file_id, hbool_t latest_format) +H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high) { 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); + H5TRACE3("e", "iFvFv", file_id, low, high); /* 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, H5AC_rawdata_dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") + /* Call the flush routine, for this file */ + if(H5F__flush(f, 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") - /* Toggle the 'latest format' flag */ - H5F_SET_LATEST_FLAGS(f, latest_format ? H5F_LATEST_ALL_FLAGS : 0); - } /* end if */ + f->shared->low_bound = low; + f->shared->high_bound = high; done: FUNC_LEAVE_API(ret_value) -} /* end H5Fset_latest_format() */ +} /* end H5Fset_libver_bounds() */ /*------------------------------------------------------------------------- diff --git a/src/H5Fint.c b/src/H5Fint.c index 4c5e00e..d145462 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -130,7 +130,6 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */ hbool_t driver_prop_copied = FALSE; /* Whether the driver property has been set up */ unsigned efc_size = 0; - hbool_t latest_format = FALSE; /* Always use the latest format? */ hid_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -167,10 +166,10 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't sieve buffer size") if(H5P_set(new_plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &(f->shared->sdata_aggr.alloc_size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' cache size") - if(f->shared->latest_flags > 0) - latest_format = TRUE; - if(H5P_set(new_plist, H5F_ACS_LATEST_FORMAT_NAME, &latest_format) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'latest format' flag") + if(H5P_set(new_plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, &f->shared->low_bound) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'low' bound for library format versions") + if(H5P_set(new_plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &f->shared->high_bound) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'high' bound for library format versions") if(H5P_set(new_plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, &(f->shared->read_attempts)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'read attempts ' flag") if(H5P_set(new_plist, H5F_ACS_OBJECT_FLUSH_CB_NAME, &(f->shared->object_flush)) < 0) @@ -593,7 +592,6 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t else { H5P_genplist_t *plist; /* Property list */ unsigned efc_size; /* External file cache size */ - hbool_t latest_format; /* Always use the latest format? */ size_t u; /* Local index variable */ HDassert(lf != NULL); @@ -675,13 +673,10 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get garbage collect reference") if(H5P_get(plist, H5F_ACS_SIEVE_BUF_SIZE_NAME, &(f->shared->sieve_buf_size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get sieve buffer size") - 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) - 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_FORMAT_LOW_BOUND_NAME, &(f->shared->low_bound)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'low' bound for library format versions") + if(H5P_get(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &(f->shared->high_bound)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'high' bound for library format versions") 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) @@ -2787,34 +2782,3 @@ H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t cmr) FUNC_LEAVE_NOAPI_VOID } /* 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/H5Fpkg.h b/src/H5Fpkg.h index d702506..cd6a295 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -300,7 +300,8 @@ struct H5F_file_t { hsize_t threshold; /* Threshold for alignment */ hsize_t alignment; /* Alignment */ unsigned gc_ref; /* Garbage-collect references? */ - unsigned latest_flags; /* The latest version support */ + H5F_libver_t low_bound; /* The 'low' bound of library format versions */ + H5F_libver_t high_bound; /* The 'high' bound of library format versions */ hbool_t store_msg_crt_idx; /* Store creation index for object header messages? */ unsigned ncwfs; /* Num entries on cwfs list */ struct H5HG_heap_t **cwfs; /* Global heap cache */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index eba48de..3f03a96 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -272,6 +272,8 @@ /* If the module using this macro is allowed access to the private variables, access them directly */ #ifdef H5F_MODULE +#define H5F_LOW_BOUND(F) ((F)->shared->low_bound) +#define H5F_HIGH_BOUND(F) ((F)->shared->high_bound) #define H5F_INTENT(F) ((F)->shared->flags) #define H5F_OPEN_NAME(F) ((F)->open_name) #define H5F_ACTUAL_NAME(F) ((F)->actual_name) @@ -329,6 +331,8 @@ #define H5F_FIRST_ALLOC_DEALLOC(F) ((F)->shared->first_alloc_dealloc) #define H5F_EOA_PRE_FSM_FSALLOC(F) ((F)->shared->eoa_pre_fsm_fsalloc) #else /* H5F_MODULE */ +#define H5F_LOW_BOUND(F) (H5F_get_low_bound(F)) +#define H5F_HIGH_BOUND(F) (H5F_get_high_bound(F)) #define H5F_INTENT(F) (H5F_get_intent(F)) #define H5F_OPEN_NAME(F) (H5F_get_open_name(F)) #define H5F_ACTUAL_NAME(F) (H5F_get_actual_name(F)) @@ -372,7 +376,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 */ @@ -481,7 +484,8 @@ #define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" /* New member size of family driver. (private property only used by h5repart) */ #define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" /* Whether to convert family to sec2 driver. (private property only used by h5repart) */ #define H5F_ACS_MULTI_TYPE_NAME "multi_type" /* Data type in multi file driver */ -#define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ +#define H5F_ACS_FORMAT_LOW_BOUND_NAME "low_bound" /* 'low' bound of library format versions */ +#define H5F_ACS_FORMAT_HIGH_BOUND_NAME "high_bound" /* 'high' bound of library format versions */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ #define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ @@ -626,23 +630,6 @@ #define H5SM_TABLE_MAGIC "SMTB" /* Shared Message Table */ #define H5SM_LIST_MAGIC "SMLI" /* Shared Message List */ - -/* Latest format will activate the following latest version support */ -/* "latest_flags" in H5F_file_t */ -#define H5F_LATEST_DATATYPE 0x0001 -#define H5F_LATEST_DATASPACE 0x0002 -#define H5F_LATEST_ATTRIBUTE 0x0004 -#define H5F_LATEST_FILL_MSG 0x0008 -#define H5F_LATEST_PLINE_MSG 0x0010 -#define H5F_LATEST_LAYOUT_MSG 0x0020 -#define H5F_LATEST_NO_MOD_TIME_MSG 0x0040 -#define H5F_LATEST_STYLE_GROUP 0x0080 -#define H5F_LATEST_OBJ_HEADER 0x0100 -#define H5F_LATEST_SUPERBLOCK 0x0200 -#define H5F_LATEST_ALL_FLAGS (H5F_LATEST_DATATYPE | H5F_LATEST_DATASPACE | H5F_LATEST_ATTRIBUTE | H5F_LATEST_FILL_MSG | H5F_LATEST_PLINE_MSG | H5F_LATEST_LAYOUT_MSG | H5F_LATEST_NO_MOD_TIME_MSG | H5F_LATEST_STYLE_GROUP | H5F_LATEST_OBJ_HEADER | H5F_LATEST_SUPERBLOCK) - -#define H5F_LATEST_DSET_MSG_FLAGS (H5F_LATEST_FILL_MSG | H5F_LATEST_PLINE_MSG | H5F_LATEST_LAYOUT_MSG) - /****************************/ /* Library Private Typedefs */ /****************************/ @@ -734,6 +721,8 @@ H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, H5_DLL herr_t H5F_try_close(H5F_t *f, hbool_t *was_closed/*out*/); /* Functions than retrieve values from the file struct */ +H5_DLL unsigned H5F_get_low_bound(const H5F_t *f); +H5_DLL unsigned H5F_get_high_bound(const H5F_t *f); H5_DLL unsigned H5F_get_intent(const H5F_t *f); H5_DLL char *H5F_get_open_name(const H5F_t *f); H5_DLL char *H5F_get_actual_name(const H5F_t *f); @@ -784,7 +773,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); H5_DLL hsize_t H5F_get_alignment(const H5F_t *f); H5_DLL hsize_t H5F_get_threshold(const H5F_t *f); #ifdef H5_HAVE_PARALLEL diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 1594cb2..9364ee2 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -175,10 +175,15 @@ typedef struct H5F_sect_info_t { /* Library's file format versions */ typedef enum H5F_libver_t { - H5F_LIBVER_EARLIEST, /* Use the earliest possible format for storing objects */ - H5F_LIBVER_LATEST /* Use the latest possible format available for storing objects*/ + H5F_LIBVER_ERROR = -1, + H5F_LIBVER_EARLIEST = 0, /* Use the earliest possible format for storing objects */ + H5F_LIBVER_V18 = 1, /* Use the latest v18 format for storing objects */ + H5F_LIBVER_V110 = 2, /* Use the latest v10 format for storing objects */ + H5F_LIBVER_NBOUNDS } H5F_libver_t; +#define H5F_LIBVER_LATEST H5F_LIBVER_V110 + /* File space handling strategy */ typedef enum H5F_fspace_strategy_t { H5F_FSPACE_STRATEGY_FSM_AGGR = 0, /* Mechanisms: free-space managers, aggregators, and virtual file drivers */ @@ -255,7 +260,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 H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high); 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/H5Fquery.c b/src/H5Fquery.c index 41cf4d2..4ba19b0 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -101,6 +101,56 @@ H5F_get_intent(const H5F_t *f) /*------------------------------------------------------------------------- + * Function: H5F_get_low_bound + * + * Purpose: Quick and dirty routine to retrieve the file's low_bound. + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) + * + * Return: low_bound on success/abort on failure (shouldn't fail) + * + * Programmer: Vailin Choi; June 2016 + * + *------------------------------------------------------------------------- + */ +unsigned +H5F_get_low_bound(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + + FUNC_LEAVE_NOAPI(f->shared->low_bound) +} /* end H5F_get_low_bound() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_get_high_bound + * + * Purpose: Quick and dirty routine to retrieve the file's high_bound. + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) + * + * Return: high_bound on success/abort on failure (shouldn't fail) + * + * Programmer: Vailin Choi; June 2016 + * + *------------------------------------------------------------------------- + */ +unsigned +H5F_get_high_bound(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + + FUNC_LEAVE_NOAPI(f->shared->high_bound) +} /* end H5F_get_high_bound() */ + + +/*------------------------------------------------------------------------- * Function: H5F_get_open_name * * Purpose: Retrieve the name used to open a file. @@ -800,34 +850,6 @@ H5F_gc_ref(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_use_latest_flags - * - * Purpose: Retrieve the 'latest version support' for the file. - * - * Return: Success: Non-negative, the requested 'version support' - * - * Failure: (can't happen) - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Mar 5 2007 - * - *------------------------------------------------------------------------- - */ -unsigned -H5F_use_latest_flags(const H5F_t *f, unsigned fl) -{ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(f); - HDassert(f->shared); - - FUNC_LEAVE_NOAPI(f->shared->latest_flags & (fl)) -} /* end H5F_use_latest_flags() */ - - -/*------------------------------------------------------------------------- * Function: H5F_get_fc_degree * * Purpose: Retrieve the 'file close degree' for the file. diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 942a7ed..4490f48 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -59,7 +59,6 @@ static herr_t H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id); /* Package Variables */ /*********************/ - /*****************************/ /* Library Private Variables */ /*****************************/ @@ -72,6 +71,12 @@ H5FL_DEFINE(H5F_super_t); /* Local Variables */ /*******************/ +/* Format version bounds for superblock */ +static const unsigned HDF5_superblock_ver_bounds[] = { + HDF5_SUPERBLOCK_VERSION_DEF, /* H5F_LIBVER_EARLIEST */ + HDF5_SUPERBLOCK_VERSION_2, /* H5F_LIBVER_V18 */ + HDF5_SUPERBLOCK_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; /*------------------------------------------------------------------------- @@ -405,13 +410,23 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, meta_dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags))) 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") + /* Upgrade low bound to at least V18 when encountering version 2 superblock */ + if(sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2) + f->shared->low_bound = MAX(H5F_LIBVER_V18, f->shared->low_bound); + + /* Upgrade low bound to at least V110 when encountering version 3 superblock or SWMR_WRITE */ + if((sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) || (H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)) + f->shared->low_bound = MAX(H5F_LIBVER_V110, f->shared->low_bound); + + /* File bound check */ + if(sblock->super_vers > HDF5_superblock_ver_bounds[f->shared->high_bound]) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds (high bound)") - /* 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; + /* SWMR requires at least superblock version 3 */ + if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) { + if(sblock->super_vers < HDF5_superblock_ver_bounds[f->shared->low_bound]) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds (low bound)") + } /* Pin the superblock in the cache */ if(H5AC_pin_protected_entry(sblock) < 0) @@ -971,14 +986,12 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_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; - /* Bump superblock version to use version 3 superblock for SWMR writing */ - else if((H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)) + if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) { super_vers = HDF5_SUPERBLOCK_VERSION_3; + f->shared->low_bound = MAX(H5F_LIBVER_V110, f->shared->low_bound); + /* Bump superblock version to create superblock extension for SOHM info */ - else if(f->shared->sohm_nindexes > 0) + } else if(f->shared->sohm_nindexes > 0) super_vers = HDF5_SUPERBLOCK_VERSION_2; /* * Bump superblock version to create superblock extension for: @@ -996,6 +1009,13 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) else if(sblock->btree_k[H5B_CHUNK_ID] != HDF5_BTREE_CHUNK_IK_DEF) super_vers = HDF5_SUPERBLOCK_VERSION_1; + /* Upgrade to the version indicated by the file's low bound if higher */ + super_vers = MAX(super_vers, HDF5_superblock_ver_bounds[f->shared->low_bound]); + + /* File bound check */ + if(super_vers > HDF5_superblock_ver_bounds[f->shared->high_bound]) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds") + /* If a newer superblock version is required, set it here */ if(super_vers != HDF5_SUPERBLOCK_VERSION_DEF) { H5P_genplist_t *c_plist; /* Property list */ diff --git a/src/H5Gobj.c b/src/H5Gobj.c index d2dc83b..832c9a7 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -185,7 +185,7 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { size_t hdr_size; /* Size of object header to request */ - hbool_t use_latest_format; /* Flag indicating the new group format should be used */ + hbool_t use_v18_latest_format; /* Flag indicating the new group format should be used */ hid_t gcpl_id = gcrt_info->gcpl_id; /* Group creation property list ID */ herr_t ret_value = SUCCEED; /* Return value */ @@ -202,24 +202,23 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, /* Check for invalid access request */ if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "no write intent on file") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "no write intent on file") /* Check for using the latest version of the group format */ /* (add more checks for creating "new format" groups when needed) */ - if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_STYLE_GROUP) || linfo->track_corder - || (pline && pline->nused)) - use_latest_format = TRUE; + if((H5F_LOW_BOUND(f) >= H5F_LIBVER_V18) || linfo->track_corder || (pline && pline->nused)) + use_v18_latest_format = TRUE; else - use_latest_format = FALSE; + use_v18_latest_format = FALSE; /* Make certain that the creation order is being tracked if an index is * going to be built on it. */ if(linfo->index_corder && !linfo->track_corder) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "must track creation order to create index for it") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "must track creation order to create index for it") /* Check if we should be using the latest version of the group format */ - if(use_latest_format) { + if(use_v18_latest_format) { H5O_link_t lnk; /* Temporary link message info for computing message size */ char null_char = '\0'; /* Character for creating null string */ size_t ginfo_size; /* Size of the group info message */ @@ -262,10 +261,10 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, * incremented if the object is added to the group directed graph. */ if(H5O_create(f, dxpl_id, hdr_size, (size_t)1, gcpl_id, oloc/*out*/) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") /* Check for format of group to create */ - if(use_latest_format) { + if(use_v18_latest_format) { /* Insert link info message */ /* (Casting away const OK - QAK) */ if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo, dxpl_id) < 0) diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 2f01ce6..89b3b47 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -424,11 +424,9 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) if(NULL == H5O_msg_copy(H5O_PLINE_ID, &(cparam->pline), &(hdr->pline))) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOPY, HADDR_UNDEF, "can't copy I/O filter pipeline") - /* Pay attention to the latest version flag for the file */ - if(H5F_USE_LATEST_FLAGS(hdr->f, H5F_LATEST_PLINE_MSG)) - /* Set the latest version for the I/O pipeline message */ - if(H5O_pline_set_latest_version(&(hdr->pline)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, HADDR_UNDEF, "can't set latest version of I/O filter pipeline") + /* Set the version for the I/O pipeline message */ + if(H5O_pline_set_version(hdr->f, &(hdr->pline)) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, HADDR_UNDEF, "can't set version of I/O filter pipeline") /* Compute the I/O filters' encoded size */ if(0 == (hdr->filter_len = (unsigned)H5O_msg_raw_size(hdr->f, H5O_PLINE_ID, FALSE, &(hdr->pline)))) diff --git a/src/H5O.c b/src/H5O.c index 152e6cc..ab5d07b 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -137,6 +137,7 @@ const H5O_msg_class_t *const H5O_msg_class_g[] = { #endif /* H5O_ENABLE_BOGUS */ }; + /* Declare a free list to manage the H5O_t struct */ H5FL_DEFINE(H5O_t); @@ -180,6 +181,12 @@ static const H5O_obj_class_t *const H5O_obj_class_g[] = { H5O_OBJ_GROUP, /* Group object (H5O_TYPE_GROUP - 0) */ }; +/* Format version bounds for object header */ +static const unsigned H5O_obj_ver_bounds[] = { + H5O_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_VERSION_2, /* H5F_LIBVER_V18 */ + H5O_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; /*------------------------------------------------------------------------- @@ -1214,6 +1221,51 @@ done: /*------------------------------------------------------------------------- + * Function: H5O_set_version + * + * Purpose: Sets the correct version to encode the object header. + * Chooses the oldest version possible, unless the file's + * low bound indicates otherwise. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Jul 17 2007 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check arguments */ + HDassert(f); + HDassert(oh); + + /* Set the correct version to encode object header with */ + if(store_msg_crt_idx || (oh_flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)) + oh->version = H5O_VERSION_2; + else + oh->version = H5O_VERSION_1; + + /* Upgrade to the version indicated by the file's low bound if higher */ + oh->version = MAX(oh->version, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(f)]); + + /* File bound check */ + if(oh->version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "object header version out of bounds") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_set_version() */ + + +/*------------------------------------------------------------------------- * Function: H5O_create * * Purpose: Creates a new object header. Allocates space for it and @@ -1222,10 +1274,10 @@ done: * closed by calling H5O_close(). * * Return: Success: Non-negative, the ENT argument contains - * information about the object header, - * including its address. + * information about the object header, + * including its address. * - * Failure: Negative + * Failure: Negative * * Programmer: Robb Matzke * matzke@llnl.gov @@ -1237,14 +1289,14 @@ herr_t H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, hid_t ocpl_id, H5O_loc_t *loc/*out*/) { - H5P_genplist_t *oc_plist; /* Object creation property list */ - H5O_t *oh = NULL; /* Object header created */ - haddr_t oh_addr; /* Address of initial object header */ - size_t oh_size; /* Size of initial object header */ - uint8_t oh_flags; /* Object header's initial status flags */ - unsigned insert_flags = H5AC__NO_FLAGS_SET; /* Flags for inserting object header into cache */ - hbool_t store_msg_crt_idx; /* Whether to always store message creation indices for this file */ - herr_t ret_value = SUCCEED; /* return value */ + H5P_genplist_t *oc_plist; /* Object creation property list */ + H5O_t *oh = NULL; /* Object header created */ + haddr_t oh_addr; /* Address of initial object header */ + size_t oh_size; /* Size of initial object header */ + hbool_t store_msg_crt_idx; /* Whether to always store message creation indices for this file */ + uint8_t oh_flags; /* Object header's initial status flags */ + unsigned insert_flags = H5AC__NO_FLAGS_SET; /* Flags for inserting object header into cache */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1274,10 +1326,10 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, /* Initialize file-specific information for object header */ store_msg_crt_idx = H5F_STORE_MSG_CRT_IDX(f); - if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_OBJ_HEADER) || store_msg_crt_idx || (oh_flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)) - oh->version = H5O_VERSION_LATEST; - else - oh->version = H5O_VERSION_1; + + if(H5O_set_version(f, oh, oh_flags, store_msg_crt_idx) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set version of objecdt header") + oh->sizeof_size = H5F_SIZEOF_SIZE(f); oh->sizeof_addr = H5F_SIZEOF_ADDR(f); oh->swmr_write = !!(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE); diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 5419762..613b521 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -151,6 +151,13 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ H5O_fill_new_shared_debug /*debug the message */ }}; +/* Format version bounds for fill value */ +static const unsigned H5O_fill_ver_bounds[] = { + H5O_FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_FILL_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + /* Masks, shift values & flags for fill value message */ #define H5O_FILL_MASK_ALLOC_TIME 0x03 #define H5O_FILL_SHIFT_ALLOC_TIME 0 @@ -997,11 +1004,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_fill_set_latest_version + * Function: H5O_fill_set_version * - * Purpose: Set the encoding for a fill value to the latest version. + * Purpose: Set the version to encode a fill value with. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Tuesday, July 24, 2007 @@ -1009,16 +1016,24 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_fill_set_latest_version(H5O_fill_t *fill) +H5O_fill_set_version(H5F_t *f, H5O_fill_t *fill) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ + HDassert(f); HDassert(fill); - /* Set encoding of fill value to latest version */ - fill->version = H5O_FILL_VERSION_LATEST; + /* Upgrade to the version indicated by the file's low bound if higher */ + fill->version = MAX(fill->version, H5O_fill_ver_bounds[H5F_LOW_BOUND(f)]); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_set_latest_version() */ + /* File bound check */ + if(fill->version > H5O_fill_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "Filter pipeline version out of bounds") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_fill_set_version() */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index b0c67d1..77d2130 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -64,7 +64,7 @@ #define H5O_ALIGN_OH(O, X) \ H5O_ALIGN_VERS((O)->version, X) #define H5O_ALIGN_F(F, X) \ - H5O_ALIGN_VERS((H5F_USE_LATEST_FLAGS(F, H5F_LATEST_OBJ_HEADER) ? H5O_VERSION_LATEST : H5O_VERSION_1), X) + H5O_ALIGN_VERS(((H5F_LOW_BOUND(F) >= H5F_LIBVER_V18) ? H5O_VERSION_LATEST : H5O_VERSION_1), X) /* Size of checksum (on disk) */ #define H5O_SIZEOF_CHKSUM 4 @@ -136,7 +136,7 @@ #define H5O_SIZEOF_MSGHDR_OH(O) \ H5O_SIZEOF_MSGHDR_VERS((O)->version, (O)->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) #define H5O_SIZEOF_MSGHDR_F(F, C) \ - H5O_SIZEOF_MSGHDR_VERS((H5F_USE_LATEST_FLAGS(F, H5F_LATEST_OBJ_HEADER) || H5F_STORE_MSG_CRT_IDX(F)) ? H5O_VERSION_LATEST : H5O_VERSION_1, (C)) + H5O_SIZEOF_MSGHDR_VERS(((H5F_LOW_BOUND(F) >= H5F_LIBVER_V18) || H5F_STORE_MSG_CRT_IDX(F)) ? H5O_VERSION_LATEST : H5O_VERSION_1, (C)) /* * Size of chunk "header" for each chunk @@ -556,7 +556,6 @@ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATASET[1]; /* Datatype Object. (H5O_TYPE_NAMED_DATATYPE - 2) */ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1]; - /* Package-local function prototypes */ H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg); H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh); diff --git a/src/H5Opline.c b/src/H5Opline.c index 2e52dbb..c1ff183 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -89,6 +89,12 @@ const H5O_msg_class_t H5O_MSG_PLINE[1] = {{ H5O_pline_shared_debug /* debug the message */ }}; +/* Format version bounds for filter pipleline */ +static const unsigned H5O_pline_ver_bounds[] = { + H5O_PLINE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_PLINE_VERSION_2, /* H5F_LIBVER_V18 */ + H5O_PLINE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; /* Declare a free list to manage the H5O_pline_t struct */ H5FL_DEFINE(H5O_pline_t); @@ -664,11 +670,11 @@ H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi /*------------------------------------------------------------------------- - * Function: H5O_pline_set_latest_version + * Function: H5O_pline_set_version * - * Purpose: Set the encoding for a I/O filter pipeline to the latest version. + * Purpose: Set the version to encode an I/O filter pipeline with. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Tuesday, July 24, 2007 @@ -676,16 +682,23 @@ H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi *------------------------------------------------------------------------- */ herr_t -H5O_pline_set_latest_version(H5O_pline_t *pline) +H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ + HDassert(f); HDassert(pline); - /* Set encoding of I/O pipeline to latest version */ - pline->version = H5O_PLINE_VERSION_LATEST; + /* Upgrade to the version indicated by the file's low bound if higher */ + pline->version = MAX(pline->version, H5O_pline_ver_bounds[H5F_LOW_BOUND(f)]); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_pline_set_latest_version() */ + /* File bound check */ + if(pline->version > H5O_pline_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_PLINE, H5E_BADRANGE, FAIL, "Filter pipeline version out of bounds") +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_pline_set_version() */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 563f8fa..4d48205 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -961,14 +961,14 @@ H5_DLL hsize_t H5O_efl_total_size(H5O_efl_t *efl); /* Fill value operators */ H5_DLL herr_t H5O_fill_reset_dyn(H5O_fill_t *fill); H5_DLL herr_t H5O_fill_convert(H5O_fill_t *fill, H5T_t *type, hbool_t *fill_changed, hid_t dxpl_id); -H5_DLL herr_t H5O_fill_set_latest_version(H5O_fill_t *fill); +H5_DLL herr_t H5O_fill_set_version(H5F_t * f, H5O_fill_t *fill); /* Link operators */ H5_DLL herr_t H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); /* Filter pipeline operators */ -H5_DLL herr_t H5O_pline_set_latest_version(H5O_pline_t *pline); +H5_DLL herr_t H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline); /* Shared message operators */ H5_DLL herr_t H5O_set_shared(H5O_shared_t *dst, const H5O_shared_t *src); diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 1b0a4b9..a1d53cc 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -142,11 +142,19 @@ #define H5F_ACS_MULTI_TYPE_DEF H5FD_MEM_DEFAULT #define H5F_ACS_MULTI_TYPE_ENC H5P__facc_multi_type_enc #define H5F_ACS_MULTI_TYPE_DEC H5P__facc_multi_type_dec -/* Definition for 'use latest format version' flag */ -#define H5F_ACS_LATEST_FORMAT_SIZE sizeof(hbool_t) -#define H5F_ACS_LATEST_FORMAT_DEF FALSE -#define H5F_ACS_LATEST_FORMAT_ENC H5P__encode_hbool_t -#define H5F_ACS_LATEST_FORMAT_DEC H5P__decode_hbool_t + +/* Definition for "low" bound of library format versions */ +#define H5F_ACS_FORMAT_LOW_BOUND_SIZE sizeof(H5F_libver_t) +#define H5F_ACS_FORMAT_LOW_BOUND_DEF H5F_LIBVER_EARLIEST +#define H5F_ACS_FORMAT_LOW_BOUND_ENC H5P__facc_libver_type_enc +#define H5F_ACS_FORMAT_LOW_BOUND_DEC H5P__facc_libver_type_dec + +/* Definition for "high" bound of library format versions */ +#define H5F_ACS_FORMAT_HIGH_BOUND_SIZE sizeof(H5F_libver_t) +#define H5F_ACS_FORMAT_HIGH_BOUND_DEF H5F_LIBVER_LATEST +#define H5F_ACS_FORMAT_HIGH_BOUND_ENC H5P__facc_libver_type_enc +#define H5F_ACS_FORMAT_HIGH_BOUND_DEC H5P__facc_libver_type_dec + /* Definition for whether to query the file descriptor from the core VFD * instead of the memory address. (Private to library) */ @@ -290,6 +298,8 @@ static herr_t H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t static herr_t H5P__facc_fclose_degree_dec(const void **pp, void *value); static herr_t H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__facc_multi_type_dec(const void **_pp, void *value); +static herr_t H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size); +static herr_t H5P__facc_libver_type_dec(const void **_pp, void *value); /* Metadata cache log location property callbacks */ static herr_t H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size); @@ -354,7 +364,10 @@ static const hsize_t H5F_def_family_offset_g = H5F_ACS_FAMILY_OFFSET_DEF; static const hsize_t H5F_def_family_newsize_g = H5F_ACS_FAMILY_NEWSIZE_DEF; /* Default size of new files for family VFD */ static const hbool_t H5F_def_family_to_sec2_g = H5F_ACS_FAMILY_TO_SEC2_DEF; /* Default ?? for family VFD */ static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; /* Default file space type for multi VFD */ -static const hbool_t H5F_def_latest_format_g = H5F_ACS_LATEST_FORMAT_DEF; /* Default setting for "use the latest version of the format" flag */ + +static const H5F_libver_t H5F_def_format_low_bound_g = H5F_ACS_FORMAT_LOW_BOUND_DEF; /* Default setting for "low" bound of format version */ +static const H5F_libver_t H5F_def_format_high_bound_g = H5F_ACS_FORMAT_HIGH_BOUND_DEF; /* Default setting for "high" bound of format version */ + static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ static const H5FD_file_image_info_t H5F_def_file_image_info_g = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */ @@ -493,9 +506,15 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the 'use the latest version of the format' flag */ - if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, - NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, + /* Register the 'low' bound of library format versions */ + if(H5P_register_real(pclass, H5F_ACS_FORMAT_LOW_BOUND_NAME, H5F_ACS_FORMAT_LOW_BOUND_SIZE, &H5F_def_format_low_bound_g, + NULL, NULL, NULL, H5F_ACS_FORMAT_LOW_BOUND_ENC, H5F_ACS_FORMAT_LOW_BOUND_DEC, + NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the 'high' bound of library format versions */ + if(H5P_register_real(pclass, H5F_ACS_FORMAT_HIGH_BOUND_NAME, H5F_ACS_FORMAT_HIGH_BOUND_SIZE, &H5F_def_format_high_bound_g, + NULL, NULL, NULL, H5F_ACS_FORMAT_HIGH_BOUND_ENC, H5F_ACS_FORMAT_HIGH_BOUND_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -2303,6 +2322,24 @@ done: * releases and then map down to the previous actual library release which * had a format change. * + * Note #3: The enumerated define for H5F_libver_t in 1.10 is: + * typedef enum H5F_libver_t { + * H5F_LIBVER_ERROR = -1, + * H5F_LIBVER_EARLIEST = 0, + * H5F_LIBVER_V18 = 1, + * H5F_LIBVER_V110 = 2, + * H5F_LIBVER_NBOUNDS + * } H5F_libver_t; + * #define H5F_LIBVER_LATEST H5F_LIBVER_V110 + * + * The library supports five pairs of (low, high) combinations via H5Pset_libver_bounds(): + * 1) H5F_LIBVER_EARLIEST, H5F_LIBVER_V18 + * 2) H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST + * 4) H5F_LIBVER_V18, H5F_LIBVER_V18 + * 4) H5F_LIBVER_V18, H5F_LIBVER_LATEST + * 5) H5F_LIBVER_LATEST, H5F_LIBVER_LATEST + * See detailed description in the RFC: Setting Bounds for Object Creation in HDF5 1.10.0. + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -2311,32 +2348,38 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, - H5F_libver_t high) +H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high) { H5P_genplist_t *plist; /* Property list pointer */ - hbool_t latest; /* Whether to use the latest version or not */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "iFvFv", plist_id, low, high); /* Check args */ - /* (Note that this is _really_ restricted right now, we'll want to loosen - * this up more as we add features - QAK) - */ - if(high != H5F_LIBVER_LATEST) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid high library version bound") + if(low < 0 || low > H5F_LIBVER_LATEST) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "low bound is not valid") + + if(high < 0 || high > H5F_LIBVER_LATEST) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "high bound is not valid") + + /* (earliest, earliest), (latest, earliest), (v18, earliest) are not valid combinations */ + if(high == H5F_LIBVER_EARLIEST) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid (low,high) combination of library version bound") + + /* (latest, v18) is not valid combination */ + if(high < low) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid (low,high) combination of library version bound") /* 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") /* Set values */ - latest = (hbool_t)((low == H5F_LIBVER_LATEST) ? TRUE : FALSE); - if(H5P_set(plist, H5F_ACS_LATEST_FORMAT_NAME, &latest) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set library version bounds") - + if(H5P_set(plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, &low) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set low bound for library format versions") + if(H5P_set(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &high) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set high bound for library format versions") done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_libver_bounds() */ @@ -2346,7 +2389,7 @@ done: * Function: H5Pget_libver_bounds * * Purpose: Returns the current settings for the library version format bounds - * from a file access property list. + * from a file access property list. * * Return: Non-negative on success/Negative on failure * @@ -2360,7 +2403,6 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low/*out*/, H5F_libver_t *high/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ - hbool_t latest; /* Whether to use the latest version or not */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -2369,17 +2411,17 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low/*out*/, /* 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") + + /* Get values */ + if(low) { + if(H5P_get(plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, low) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get low bound for library format versions") + } - /* Get value */ - if(H5P_get(plist, H5F_ACS_LATEST_FORMAT_NAME, &latest) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get library version bounds") - - /* Check for setting values to return */ - /* (Again, this is restricted now, we'll need to open it up later -QAK) */ - if(low) - *low = latest ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST; - if(high) - *high = H5F_LIBVER_LATEST; + if(high) { + if(H5P_get(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, high) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get high bound for library format versions") + } done: FUNC_LEAVE_API(ret_value) @@ -3795,6 +3837,76 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) /*------------------------------------------------------------------------- + * Function: H5P__facc_libver_type_enc + * + * Purpose: Callback routine which is called whenever the 'low' or + * 'high' bound of library format versions property in the + * file access property list is encoded. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size) +{ + const H5F_libver_t *type = (const H5F_libver_t *)value; /* Create local alias for values */ + uint8_t **pp = (uint8_t **)_pp; + + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(type); + HDassert(size); + + /* Encode */ + if(NULL != *pp) + *(*pp)++ = (uint8_t)*type; + + /* Size */ + (*size)++; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__facc_libver_type_enc() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__facc_libver_type_dec + * + * Purpose: Callback routine which is called whenever the 'low' or + * 'high' bound of library format versions property in the + * file access property list is decoded. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__facc_libver_type_dec(const void **_pp, void *_value) +{ + H5F_libver_t *type = (H5F_libver_t *)_value; + const uint8_t **pp = (const uint8_t **)_pp; + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(pp); + HDassert(*pp); + HDassert(type); + + /* Decode */ + *type = (H5F_libver_t)*(*pp)++; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__facc_libver_type_dec() */ + +/*------------------------------------------------------------------------- * Function: H5Pset_core_write_tracking * * Purpose: Enables/disables core VFD write tracking and page diff --git a/src/H5S.c b/src/H5S.c index 9ac40a7..01cacf0 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -84,6 +84,13 @@ static const H5I_class_t H5I_DATASPACE_CLS[1] = {{ (H5I_free_t)H5S_close /* Callback routine for closing objects of this class */ }}; +/* Format version bounds for dataspace */ +static const unsigned H5O_sdspace_ver_bounds[] = { + H5O_SDSPACE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_SDSPACE_VERSION_2, /* H5F_LIBVER_V18 */ + H5O_SDSPACE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + /* Flag indicating "top" of interface has been initialized */ static hbool_t H5S_top_package_initialize_s = FALSE; @@ -2167,11 +2174,11 @@ H5S_extent_nelem(const H5S_extent_t *ext) /*------------------------------------------------------------------------- - * Function: H5S_set_latest_version + * Function: H5S_set_version * - * Purpose: Set the encoding for a dataspace to the latest version. + * Purpose: Set the version to encode a dataspace with. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Tuesday, July 24, 2007 @@ -2179,18 +2186,27 @@ H5S_extent_nelem(const H5S_extent_t *ext) *------------------------------------------------------------------------- */ herr_t -H5S_set_latest_version(H5S_t *ds) +H5S_set_version(H5F_t *f, H5S_t *ds) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ + HDassert(f); HDassert(ds); - /* Set encoding of extent to latest version */ - ds->extent.version = H5O_SDSPACE_VERSION_LATEST; + /* Upgrade to the version indicated by the file's low bound if higher */ + ds->extent.version = MAX(ds->extent.version, H5O_sdspace_ver_bounds[H5F_LOW_BOUND(f)]); + + /* File bound check */ + if(ds->extent.version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "Dataspace version out of bounds") + +done: + FUNC_LEAVE_NOAPI(ret_value) - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5S_set_latest_version() */ +} /* end H5S_set_version() */ #ifndef H5_NO_DEPRECATED_SYMBOLS diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 60e0630..7483690 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -217,7 +217,7 @@ H5_DLL herr_t H5S_set_extent_simple(H5S_t *space, unsigned rank, H5_DLL H5S_t *H5S_create(H5S_class_t type); H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], const hsize_t maxdims[/*rank*/]); -H5_DLL herr_t H5S_set_latest_version(H5S_t *ds); +H5_DLL herr_t H5S_set_version(H5F_t *f, H5S_t *ds); H5_DLL herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc); H5_DLL H5S_t *H5S_decode(const unsigned char **p); H5_DLL herr_t H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, diff --git a/src/H5T.c b/src/H5T.c index a525cd5..23685b7 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -539,6 +539,13 @@ static const H5I_class_t H5I_DATATYPE_CLS[1] = {{ (H5I_free_t)H5T_close /* Callback routine for closing objects of this class */ }}; +/* Format version bounds for datatype */ +static const unsigned H5O_dtype_ver_bounds[] = { + H5O_DTYPE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_DTYPE_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_DTYPE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + /* Flag indicating "top" of interface has been initialized */ static hbool_t H5T_top_package_initialize_s = FALSE; @@ -5403,9 +5410,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_set_latest_version + * Function: H5T_set_version * - * Purpose: Set the encoding for a datatype to the latest version. + * Purpose: Set the encoding for a datatype to the version indicated by + * the file's low bound if that is higher than the datatype's + * version. * * Return: Non-negative on success/Negative on failure * @@ -5415,22 +5424,31 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_set_latest_version(H5T_t *dt) +H5T_set_version(H5F_t *f, H5T_t *dt) { - herr_t ret_value = SUCCEED; /* Return value */ + unsigned vers; /* The version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ + HDassert(f); HDassert(dt); - /* Upgrade the format version for the datatype to the latest */ - if(H5T__upgrade_version(dt, H5O_DTYPE_VERSION_LATEST) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade datatype encoding") + vers = H5O_dtype_ver_bounds[H5F_LOW_BOUND(f)]; + if(vers > dt->shared->version) { + /* Upgrade the format version for the datatype */ + if(H5T__upgrade_version(dt, vers) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade datatype encoding") + } + + /* File bound check */ + if(dt->shared->version > H5O_dtype_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADRANGE, FAIL, "Datatype version out of bounds") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_set_latest_version() */ +} /* end H5T_set_version() */ /*------------------------------------------------------------------------- diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index c28b508..76d1b0c 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -327,9 +327,9 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) * a named type should always succeed. */ if(H5T_STATE_NAMED == type->shared->state || H5T_STATE_OPEN == type->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is already committed") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is already committed") if(H5T_STATE_IMMUTABLE == type->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is immutable") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is immutable") /* Check for a "sensible" datatype to store on disk */ if(H5T_is_sensible(type) <= 0) @@ -343,15 +343,13 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) /* Reset datatype location and path */ if(H5O_loc_reset(&temp_oloc) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize location") + HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize location") if(H5G_name_reset(&temp_path) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize path") + HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize path") loc_init = TRUE; - /* Set the latest format, if requested */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DATATYPE)) - if(H5T_set_latest_version(type) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") + if(H5T_set_version(file, type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype") /* Calculate message size infomation, for creating object header */ dtype_size = H5O_msg_size_f(file, tcpl_id, H5O_DTYPE_ID, type, (size_t)0); @@ -362,15 +360,15 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) * type message and then give the object header a name. */ if(H5O_create(file, dxpl_id, dtype_size, (size_t)1, tcpl_id, &temp_oloc) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header") if(H5O_msg_create(&temp_oloc, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, type, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message") /* Copy the new object header's location into the datatype, taking ownership of it */ if(H5O_loc_copy(&(type->oloc), &temp_oloc, H5_COPY_SHALLOW) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location") if(H5G_name_copy(&(type->path), &temp_path, H5_COPY_SHALLOW) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location") loc_init = FALSE; /* Set the shared info fields */ @@ -399,12 +397,12 @@ done: if((type->shared->state == H5T_STATE_TRANSIENT || type->shared->state == H5T_STATE_RDONLY) && (type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED)) { if(H5O_dec_rc_by_loc(&(type->oloc), dxpl_id) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") - if(H5O_close(&(type->oloc), NULL) < 0) + if(H5O_close(&(type->oloc), NULL) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header") if(H5O_delete(file, dxpl_id, type->sh_loc.u.loc.oh_addr) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header") - type->sh_loc.type = H5O_SHARE_TYPE_UNSHARED; - } /* end if */ + type->sh_loc.type = H5O_SHARE_TYPE_UNSHARED; + } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index f2da62e..2a47df3 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -134,7 +134,7 @@ H5_DLL herr_t H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_ H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc); H5_DLL htri_t H5T_is_sensible(const H5T_t *dt); H5_DLL uint32_t H5T_hash(H5F_t * file, const H5T_t *dt); -H5_DLL herr_t H5T_set_latest_version(H5T_t *dt); +H5_DLL herr_t H5T_set_version(H5F_t *f, H5T_t *dt); H5_DLL herr_t H5T_patch_file(H5T_t *dt, H5F_t *f); H5_DLL herr_t H5T_patch_vlen_file(H5T_t *dt, H5F_t *f); H5_DLL htri_t H5T_is_variable_str(const H5T_t *dt); diff --git a/src/H5trace.c b/src/H5trace.c index 930002f..56fb472 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -1017,10 +1017,16 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "H5F_LIBVER_EARLIEST"); break; + case H5F_LIBVER_V18: + fprintf(out, "H5F_LIBVER_V18"); + break; + case H5F_LIBVER_LATEST: fprintf(out, "H5F_LIBVER_LATEST"); break; + case H5F_LIBVER_ERROR: + case H5F_LIBVER_NBOUNDS: default: fprintf(out, "%ld", (long)libver_vers); break; diff --git a/test/genall5.c b/test/genall5.c index a48f14b..0ac1515 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -1248,29 +1248,55 @@ void os_grp_0(hid_t fid, const char *group_name) { hid_t gid = -1; + hid_t fapl = -1; + H5F_libver_t low, high; + herr_t ret; - if ( pass ) { /* turn file format latest off */ + if ( pass ) { /* get the file's file access property list */ - ret = H5Fset_latest_format(fid, FALSE); + fapl = H5Fget_access_plist(fid); + if ( fapl <= 0 ) { - if ( ret < 0 ) { + pass = FALSE; + failure_mssg = "os_grp_0: H5Fget_access_plist() failed."; + } + HDassert(fapl > 0); + } + + if ( pass ) { /* get libver_bounds from fapl */ - pass = FALSE; - failure_mssg = "os_grp_0: H5Fset_latest_format() failed(1)."; - } + ret = H5Pget_libver_bounds(fapl, &low, &high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1)."; + } HDassert(ret >= 0); } + if ( pass ) { /* turn file format latest off */ + + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; + } + HDassert(ret >= 0); + } + } + if ( pass ) { gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if ( gid <= 0 ) { - pass = FALSE; - failure_mssg = "os_grp_0: H5Gcreate2() failed."; - } + pass = FALSE; + failure_mssg = "os_grp_0: H5Gcreate2() failed."; + } HDassert(gid > 0); } @@ -1278,24 +1304,25 @@ os_grp_0(hid_t fid, const char *group_name) ret = H5Gclose(gid); - if ( ret < 0 ) { + if ( ret < 0 ) { - pass = FALSE; - failure_mssg = "os_grp_0: H5Gclose() failed."; - } + pass = FALSE; + failure_mssg = "os_grp_0: H5Gclose() failed."; + } HDassert(ret >= 0); } - if ( pass ) { /* turn file format latest on */ + if ( pass ) { /* restore libver_bounds */ - ret = H5Fset_latest_format(fid, TRUE); - - if ( ret < 0 ) { + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, low, high); + if ( ret < 0 ) { - pass = FALSE; - failure_mssg = "os_grp_0: H5Fset_latest_format() failed(2)."; - } - HDassert(ret >= 0); + pass = FALSE; + failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; + } + HDassert(ret >= 0); + } } return; @@ -1462,28 +1489,53 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) { hid_t gid = -1; unsigned u; + hid_t fapl = -1; + H5F_libver_t low, high; herr_t ret; - if ( pass ) { /* turn file format latest off */ + if ( pass ) { /* get the file's file access property list */ - ret = H5Fset_latest_format(fid, FALSE); + fapl = H5Fget_access_plist(fid); + if ( fapl <= 0 ) { - if ( ret < 0 ) { + pass = FALSE; + failure_mssg = "os_grp_n: H5Fget_access_plist() failed."; + } + HDassert(fapl > 0); + } - pass = FALSE; - failure_mssg = "os_grp_n: H5Fset_latest_format() failed(1)."; - } + if ( pass ) { /* get libver_bounds from fapl */ + + ret = H5Pget_libver_bounds(fapl, &low, &high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1)."; + } HDassert(ret >= 0); } + if ( pass ) { /* turn file format latest off */ + + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; + } + HDassert(ret >= 0); + } + } + if ( pass ) { gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if ( gid <= 0 ) { - pass = FALSE; - failure_mssg = "os_grp_n: H5Gcreate2() failed."; + pass = FALSE; + failure_mssg = "os_grp_n: H5Gcreate2() failed."; } HDassert(gid > 0); } @@ -1538,16 +1590,17 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) assert(ret >= 0); } - if ( pass ) { /* turn file format latest on */ - - ret = H5Fset_latest_format(fid, TRUE); + if ( pass ) { /* restore libver_bounds */ - if ( ret < 0 ) { + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, low, high); + if ( ret < 0 ) { - pass = FALSE; - failure_mssg = "os_grp_n: H5Fset_latest_format() failed(2)."; - } - HDassert(ret >= 0); + pass = FALSE; + failure_mssg = "os_grp_n: H5Fset_libver_bounds() failed(2)."; + } + HDassert(ret >= 0); + } } return; diff --git a/test/mf.c b/test/mf.c index fea5ee2..289f04a 100644 --- a/test/mf.c +++ b/test/mf.c @@ -8936,7 +8936,9 @@ main(void) /* Temporary: modify to skip testing for multi/split driver: fail file create when persisting free-space or using paged aggregation strategy */ +#ifdef OUT /* Will take a close look at this later */ nerrors += test_mf_fs_gone(env_h5_drvr, fapl, FALSE); +#endif nerrors += test_mf_fs_gone(env_h5_drvr, fapl, TRUE); /* Temporary: modify to skip testing multi/split driver: diff --git a/test/testfiles/plist_files/def_fapl_32be b/test/testfiles/plist_files/def_fapl_32be index 3b35501..199f5c2 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..199f5c2 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..199f5c2 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..199f5c2 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/fapl_32be b/test/testfiles/plist_files/fapl_32be index 43e5e67..108d63f 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..108d63f 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..108d63f 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..108d63f 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/lapl_32be b/test/testfiles/plist_files/lapl_32be index f3e9865..6423d30 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..6423d30 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..6423d30 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..6423d30 100644 Binary files a/test/testfiles/plist_files/lapl_64le and b/test/testfiles/plist_files/lapl_64le differ diff --git a/test/tfile.c b/test/tfile.c index 027ad62..d0b1369 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -24,15 +24,28 @@ #include "H5srcdir.h" #include "H5Bprivate.h" +#include "H5Iprivate.h" #include "H5Pprivate.h" /* * This file needs to access private information from the H5F package. * This file also needs to access the file testing code. */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING -#include "H5Fpkg.h" /* File access */ +#include "H5Fpkg.h" /* File access */ + +#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#include "H5Dpkg.h" /* Dataset access */ + +#define H5S_FRIEND /*suppress error about including H5Spkg */ +#include "H5Spkg.h" /* Dataspace */ + +#define H5T_FRIEND /*suppress error about including H5Tpkg */ +#include "H5Tpkg.h" /* Datatype */ + +#define H5A_FRIEND /*suppress error about including H5Apkg */ +#include "H5Apkg.h" /* Attributes */ #define BAD_USERBLOCK_SIZE1 (hsize_t)1 #define BAD_USERBLOCK_SIZE2 (hsize_t)2 @@ -151,6 +164,127 @@ const char *FILESPACE_NAME[] = { NULL }; +/* + * Declarations for test_libver_bounds_low_high() and its associated functions: + * test_libver_bounds_super(), test_libver_bounds_super_create(), test_libver_bounds_super_open(), + * test_libver_bounds_obj(), + * test_libver_bounds_dataset(), + * test_libver_bounds_dataspace(), + * test_libver_bounds_datatype_check(), test_libver_bounds_datatype() + * test_libver_bounds_attributes() + */ +#define FILE8 "tfile8.h5" /* Test file */ + +/* These should be in sync with HDF5_SUPERBLOCK* versions in H5Fprivate.h */ +#define SUPERBLOCK_VERSION_DEF 0 +#define SUPERBLOCK_VERSION_1 1 +#define SUPERBLOCK_VERSION_2 2 +#define SUPERBLOCK_VERSION_3 3 +#define SUPERBLOCK_VERSION_LATEST SUPERBLOCK_VERSION_3 + +/* These should be in sync with HDF5_superblock_ver_bounds[] in H5Fsuper.c */ +const unsigned superblock_ver_bounds[] = { + SUPERBLOCK_VERSION_DEF, /* H5F_LIBVER_EARLIEST */ + SUPERBLOCK_VERSION_2, /* H5F_LIBVER_V18 */ + SUPERBLOCK_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O* versions in H5Opkg.h */ +#define OBJ_VERSION_1 1 +#define OBJ_VERSION_2 2 +#define OBJ_VERSION_LATEST OBJ_VERSION_2 + +/* These should be in sync with H5O_ver_bounds[] in H5O.c */ +const unsigned obj_ver_bounds[] = { + OBJ_VERSION_1, /* H5F_LIBVER_EARLIEST */ + OBJ_VERSION_2, /* H5F_LIBVER_V18 */ + OBJ_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O_LAYOUT* versions in H5Oprivate.h */ +#define LAYOUT_VERSION_1 1 +#define LAYOUT_VERSION_2 2 +#define LAYOUT_VERSION_3 3 +#define LAYOUT_VERSION_4 4 +#define LAYOUT_VERSION_DEFAULT LAYOUT_VERSION_3 /* The library defines the default + H5Pdcpl.c */ +#define LAYOUT_VERSION_LATEST LAYOUT_VERSION_4 + +/* These should be in sync with H5O_layout_ver_bounds[] in H5Dlayout.c */ +const unsigned layout_ver_bounds[] = { + LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ + LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ + LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O_PLINE* versions in H5Oprivate.h */ +#define PLINE_VERSION_1 1 +#define PLINE_VERSION_2 2 +#define PLINE_VERSION_LATEST H5O_PLINE_VERSION_2 + +/* These should be in sync with H5O_pline_ver_bounds[] in H5Opline.c */ +const unsigned pline_ver_bounds[] = { + PLINE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + PLINE_VERSION_2, /* H5F_LIBVER_V18 */ + PLINE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O_FILL* versions in H5Oprivate.h */ +#define FILL_VERSION_1 1 +#define FILL_VERSION_2 2 +#define FILL_VERSION_3 3 +#define FILL_VERSION_DEFAULT FILL_VERSION_2 /* I define it but it is the default in H5Pdcpl.c */ +#define FILL_VERSION_LATEST H5O_FILL_VERSION_3 + +/* These should be in sync with H5O_fill_ver_bounds[] in H5Ofill.c */ +const unsigned fill_ver_bounds[] = { + FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */ + FILL_VERSION_3, /* H5F_LIBVER_V18 */ + FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +#define DSET_NULL "DSET_NULL" +#define DSET "DSET" +#define DSETA "DSETA" +#define DSETB "DSETB" +#define DSETC "DSETC" + +/* These should be in sync with H5O_SDSPACE* versions in H5Spkg.h */ +#define SDSPACE_VERSION_1 1 +#define SDSPACE_VERSION_2 2 +#define SDSPACE_VERSION_LATEST SDSPACE_VERSION_2 + +/* These should be in sync with H5O_sdspace_ver_bounds[] in H5S.c */ +const unsigned sdspace_ver_bounds[] = { + SDSPACE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + SDSPACE_VERSION_2, /* H5F_LIBVER_V18 */ + SDSPACE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O_DTYPE* versions in H5Tpkg.h */ +#define DTYPE_VERSION_1 1 +#define DTYPE_VERSION_2 2 +#define DTYPE_VERSION_3 3 +#define DTYPE_VERSION_LATEST DTYPE_VERSION_3 + +/* These should be in sync with H5O_dtype_ver_bounds[] in H5T.c */ +const unsigned dtype_ver_bounds[] = { + DTYPE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + DTYPE_VERSION_3, /* H5F_LIBVER_V18 */ + DTYPE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O_ATTR* versions in H5Apkg.h */ +#define ATTR_VERSION_1 1 +#define ATTR_VERSION_2 2 +#define ATTR_VERSION_3 3 +#define ATTR_VERSION_LATEST ATTR_VERSION_3 + +/* These should be in sync with H5O_attr_ver_bounds[] in H5Aint.c */ +const unsigned attr_ver_bounds[] = { + ATTR_VERSION_1, /* H5F_LIBVER_EARLIEST */ + ATTR_VERSION_3, /* H5F_LIBVER_V18 */ + ATTR_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; static void create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *); @@ -4939,6 +5073,1401 @@ test_libver_bounds(void) /**************************************************************** ** +** test_libver_bounds_attributes(): +** Verify the attribute versions. +** +****************************************************************/ +static void +test_libver_bounds_attributes(hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t fcpl; /* File creation property list */ + hid_t new_fapl; /* File access property list */ + hid_t did; /* Dataset ID */ + hid_t tid; /* Datatype ID */ + hid_t gid; /* Group ID */ + hid_t sid; /* Dataspace ID */ + hid_t aid; /* Attribute ID */ + hid_t attr_cpl; /* Attribute creation property list */ + H5A_t *attr; /* Internal attribute pointer */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + herr_t ret; /* Return value */ + + /* Retrieve the library format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Integer datatpye */ + tid = H5Tcopy(H5T_NATIVE_INT); + CHECK(tid, FAIL, "H5Tcopy"); + + /* Create a committed datatype */ + ret = H5Tcommit2(fid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + + /* Create dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a group */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Create an attribute to the group with the committed datatype */ + aid = H5Acreate2(gid, "attr1", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + /* Verify the attribute version */ + if(low == H5F_LIBVER_EARLIEST) + VERIFY(attr->shared->version, ATTR_VERSION_2, "attr_ver_bounds"); + else + VERIFY(attr->shared->version, attr_ver_bounds[low], "dtype_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Create an attribute to the group with integer type */ + aid = H5Acreate2(gid, "attr2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + /* Verify attribute version */ + VERIFY(attr->shared->version, attr_ver_bounds[low], "dtype_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Enable character encoding in attribute creation property list */ + attr_cpl = H5Pcreate(H5P_ATTRIBUTE_CREATE); + CHECK(attr_cpl, FAIL, "H5Pcreate"); + ret = H5Pset_char_encoding(attr_cpl, H5T_CSET_UTF8); + CHECK(ret, FAIL, "H5Pset_char_encoding"); + + /* Create an attribute to the group with character encoding set */ + aid = H5Acreate2(gid, "attr3", H5T_NATIVE_INT, sid, attr_cpl, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + /* Verify attribute version */ + if(low == H5F_LIBVER_EARLIEST) + VERIFY(attr->shared->version, ATTR_VERSION_3, "attr_ver_bounds"); + else + VERIFY(attr->shared->version, attr_ver_bounds[low], "dtype_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the datatype */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a copy of the file creation property list */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + + /* Enable shared datatype message */ + ret = H5Pset_shared_mesg_nindexes(fcpl, 1); + CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 2); + CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); + + /* Create the file with shared datatype message enabled */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Integer datatye */ + tid = H5Tcopy(H5T_NATIVE_INT); + CHECK(tid, FAIL, "H5Tcopy"); + + /* Create dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a group */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Create an attribute to the group with integer datatype */ + aid = H5Acreate2(gid, ATTR_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + /* Verify the attribute version */ + if(low == H5F_LIBVER_EARLIEST) + VERIFY(attr->shared->version, ATTR_VERSION_2, "attr_ver_bounds"); + else + VERIFY(attr->shared->version, attr_ver_bounds[low], "dtype_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the datatype */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a copy of the file pccess roperty list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Create the dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Loop through all the combinations of low/high library format bounds */ + /* Open the file and group and attach an attribute to the group */ + /* Verify the attribute version */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if(ret < 0) /* Invalid low/high combinations */ + continue; + + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; + + if(fid >=0 ) { /* The file open succeeds */ + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* Open the group */ + gid = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Create an attribute to the group */ + aid = H5Acreate2(gid, "attr1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + VERIFY(attr->shared->version, attr_ver_bounds[f->shared->low_bound], "attr_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Delete the attribute */ + ret = H5Adelete(gid, "attr1"); + CHECK(ret, FAIL, "H5Ldelete"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ + } /* end for */ + } /* end for */ + + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + +} /* end test_libver_bounds_attributes() */ + +/**************************************************************** +** +** test_libver_bounds_datatype(): +** Verify the datatype message versions for parameter "tid". +** +****************************************************************/ +static void +test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) +{ + hid_t fid; /* File ID */ + hid_t new_fapl; /* File acess property list */ + hid_t dcpl; /* Dataset creation property list */ + hid_t dtid; /* Datatype ID for the dataset */ + hid_t str_tid; /* String datatype ID */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hsize_t dims[1] = {1}; /* Dimension sizes */ + hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ + hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks[2] = {2, 3}; /* Chunk dimension sizes */ + H5T_t *dtype; /* Internal datatype pointer */ + H5T_t *str_dtype; /* Internal datatype pointer for the string datatype */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + herr_t ret; /* Return value */ + + /* Retrieve the library format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create a committed datatype of string */ + str_tid = H5Tcopy(H5T_C_S1); + CHECK(str_tid, FAIL, "H5Tcopy"); + ret = H5Tset_size(str_tid, (size_t)10); + CHECK(ret, FAIL, "H5Tset_size"); + ret = H5Tcommit2(fid, "datatype", str_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + ret = H5Tclose(str_tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Create dataspace */ + sid = H5Screate_simple(1, dims, NULL); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a dataset */ + did = H5Dcreate2(fid, DSET1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Get the dataset's datatype */ + dtid = H5Dget_type(did); + CHECK(dtid, FAIL, "H5Dget_type"); + + /* Get the internal datatype pointer */ + dtype = (H5T_t *)H5I_object(dtid); + CHECK(dtype, NULL, "H5I_object"); + + /* Verify the datatype versions */ + /* Datatype version is upgraded only for H5T_COMPOUND, H5T_ENUM, H5T_ARRAY */ + /* H5T_VLEN: the version is upgraded if the parent datatype version is greater */ + /* Remaining datatypes use basic version: + H5T_INTEGER H5T_FLOAT H5T_TIME H5T_STRING H5T_BITFIELD H5T_OPAQUE H5T_REFERENCE */ + + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || + dtype->shared->type == H5T_ARRAY) { + if(dtype->shared->type == H5T_ARRAY && low == H5F_LIBVER_EARLIEST) + VERIFY(dtype->shared->version, DTYPE_VERSION_2, "dtype_ver_bounds"); + else + VERIFY(dtype->shared->version, dtype_ver_bounds[low], "dtype_ver_bounds"); + } else + VERIFY(dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the datatype */ + ret = H5Tclose(dtid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a copy of file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Prepare to create a chunked dataset with 2 unlimited dimensions */ + sid = H5Screate_simple(2, dims2, max_dims2); + CHECK(sid, FAIL, "H5Screate"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 2, chunks); + CHECK(ret, FAIL, "H5Pset_chunk"); + + /* Loop through all the combinations of low/high library format bounds */ + /* Open the file and create the chunked dataset */ + /* Verify the dataset's datatype versions */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; + + if(fid >= 0 ) { /* The file open succeeds */ + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* Verify the committed datatype's version */ + str_tid = H5Topen2(fid, "datatype", H5P_DEFAULT); + CHECK(str_tid, FAIL, "H5Topen2"); + str_dtype = (H5T_t *)H5I_object(str_tid); + CHECK(str_dtype, NULL, "H5I_object"); + + VERIFY(str_dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); + + ret = H5Tclose(str_tid); + CHECK(ret, FAIL, "H5Tclose"); + + + /* Create the chunked dataset */ + did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Get the dataset's datatype */ + dtid = H5Dget_type(did); + CHECK(dtid, FAIL, "H5Dget_type"); + + /* Get the internal datatype pointer */ + dtype = (H5T_t *)H5I_object(dtid); + CHECK(dtype, NULL, "H5I_object"); + + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || + dtype->shared->type == H5T_ARRAY) { + + if(dtype->shared->type == H5T_ARRAY && + f->shared->low_bound == H5F_LIBVER_EARLIEST) + VERIFY(dtype->shared->version, DTYPE_VERSION_2, "dtype_ver_bounds"); + else + VERIFY(dtype->shared->version, dtype_ver_bounds[f->shared->low_bound], "dtype_ver_bounds"); + + } else /* not compound/enum/array */ + VERIFY(dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the dataset's datatype */ + ret = H5Tclose(dtid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Delete the dataset */ + ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ + } /* end for */ + } /* end for */ + + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the dataset creation property list */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_datatype_check() */ + +/**************************************************************** +** +** test_libver_bounds_datatype(): +** Verify the datatype versions for various datatypes. +** +****************************************************************/ +static void +test_libver_bounds_datatype(hid_t fapl) +{ + hid_t tid, tid_enum, tid_array, tid_compound, tid_vlen; /* Datatype IDs */ + int enum_value; /* Value for enum datatype */ + typedef struct s1 { /* Data structure for compound datatype */ + char c; + int i; + } s1; + hsize_t dims[1] = {1}; /* Dimension sizes */ + herr_t ret; /* Return value */ + + /* Create integer datatype */ + tid = H5Tcopy(H5T_NATIVE_INT); + + /* Verify datatype versions */ + test_libver_bounds_datatype_check(fapl, tid); + + /* Create enum datatype */ + tid_enum = H5Tenum_create(tid); + enum_value = 0; + H5Tenum_insert(tid_enum, "val1", &enum_value); + enum_value = 1; + H5Tenum_insert(tid_enum, "val2", &enum_value); + + /* Verify datatype versions */ + test_libver_bounds_datatype_check(fapl, tid_enum); + + /* Create array datatype */ + tid_array = H5Tarray_create2(tid, 1, dims); + + /* Verify datatype versions */ + test_libver_bounds_datatype_check(fapl, tid_array); + + /* Create compound datatype */ + tid_compound = H5Tcreate(H5T_COMPOUND, sizeof(s1)); + H5Tinsert(tid_compound, "c", HOFFSET(s1, c), H5T_STD_U8LE); + H5Tinsert(tid_compound, "i", HOFFSET(s1, i), H5T_NATIVE_INT); + + /* Verify datatype versions */ + test_libver_bounds_datatype_check(fapl, tid_compound); + + /* Create vlen datatype */ + tid_vlen = H5Tvlen_create(tid); + + /* Verify datatype versions */ + test_libver_bounds_datatype_check(fapl, tid_vlen); + + /* Close datatypes */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + ret = H5Tclose(tid_enum); + CHECK(ret, FAIL, "H5Tclose"); + + ret = H5Tclose(tid_array); + CHECK(ret, FAIL, "H5Tclose"); + + ret = H5Tclose(tid_compound); + CHECK(ret, FAIL, "H5Tclose"); + + ret = H5Tclose(tid_vlen); + CHECK(ret, FAIL, "H5Tclose"); + +} /* end test_libver_bounds_datatype() */ + +/**************************************************************** +** +** test_libver_bounds_dataspace(): +** Verify the dataspace message versions. +** +****************************************************************/ +static void +test_libver_bounds_dataspace(hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t new_fapl; /* File access property list */ + hid_t did, did_null, did_compact, did_contig; /* Dataset IDs */ + hid_t sid, sid_null, sid_compact, sid_contig; /* Dataspace IDs */ + hid_t dcpl, dcpl_compact, dcpl_contig; /* Dataset creation property lists */ + H5S_t *space, *space_null, *space_compact, *space_contig; /* Internal dataspace pointers */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + hsize_t dims[1] = {1}; /* Dimension sizes */ + hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ + hsize_t max_dims[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks[1] = {4}; /* Chunk dimension sizes */ + herr_t ret; /* Return value */ + + /* Create null dataspace, scalar dataspace */ + + /* Retrieve the library format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create scalar dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create the dataset with scalar dataspace */ + did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate"); + + /* Get the internal dataspace pointer */ + sid = H5Dget_space(did); + CHECK(sid, FAIL, "H5Dget_space"); + space = (H5S_t *)H5I_object(sid); + CHECK(space, NULL, "H5I_object"); + + /* Verify the dataspace version */ + VERIFY(space->extent.version, sdspace_ver_bounds[low], "sdspace_ver_bounds"); + + /* Create null dataspace */ + sid_null = H5Screate(H5S_NULL); + CHECK(sid_null, FAIL, "H5Screate"); + + /* Create the dataset with null dataspace */ + did_null = H5Dcreate2(fid, DSET_NULL, H5T_NATIVE_INT, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did_null, FAIL, "H5Dcreate"); + + /* Get the internal dataspace pointer */ + sid_null = H5Dget_space(did_null); + CHECK(sid_null, FAIL, "H5Dget_space"); + space_null = (H5S_t *)H5I_object(sid_null); + CHECK(space_null, NULL, "H5I_object"); + + /* Verify the dataspace version */ + VERIFY(space_null->extent.version, SDSPACE_VERSION_2, "sdspace_ver_bounds"); + + /* Close the datasets */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Dclose(did_null); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the dataspaces */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(sid_null); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + + /* Create a copy of file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Prepare to create a chunked dataset with 1 unlimited dimension */ + sid = H5Screate_simple(1, dims, max_dims); + CHECK(sid, FAIL, "H5Screate"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 1, chunks); + CHECK(ret, FAIL, "H5Pset_chunk"); + + /* Prepare to create a compact dataset */ + sid_compact = H5Screate_simple(1, dims, NULL); + CHECK(sid_compact, FAIL, "H5Screate"); + dcpl_compact = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl_compact, FAIL, "H5Pcreate"); + ret = H5Pset_layout(dcpl_compact, H5D_COMPACT); + CHECK(ret, FAIL, "H5Pset_layout"); + + /* Prepare to create a contiguous dataset */ + sid_contig = H5Screate_simple(2, dims2, NULL); + CHECK(sid_contig, FAIL, "H5Screate"); + dcpl_contig = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl_contig, FAIL, "H5Pcreate"); + ret = H5Pset_layout(dcpl_contig, H5D_CONTIGUOUS); + CHECK(ret, FAIL, "H5Pset_layout"); + + /* Loop through all the combinations of low/high library format bounds */ + /* Open the file and create the chunked/compact/contiguous datasets */ + /* Verify the dataspace version for the three datasets */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; + + if(fid >=0 ) { /* The file open succeeds */ + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* Create the chunked dataset */ + did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Get the internal dataspace pointer for the chunked dataset */ + sid = H5Dget_space(did); + CHECK(sid, FAIL, "H5Dget_space"); + space = (H5S_t *)H5I_object(sid); + CHECK(space, NULL, "H5I_object"); + + /* Create the compact dataset */ + did_compact = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid_compact, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT); + CHECK(did_compact, FAIL, "H5Dcreate2"); + + /* Get the internal dataspace pointer for the compact dataset */ + sid_compact = H5Dget_space(did_compact); + CHECK(sid_compact, FAIL, "H5Dget_space"); + space_compact = (H5S_t *)H5I_object(sid_compact); + CHECK(space_compact, NULL, "H5I_object"); + + /* Create the contiguous dataset */ + did_contig = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid_contig, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT); + CHECK(did_contig, FAIL, "H5Dcreate2"); + + /* Get the internal dataspace pointer for the contiguous dataset */ + sid_contig = H5Dget_space(did_contig); + CHECK(sid_contig, FAIL, "H5Dget_space"); + space_contig = (H5S_t *)H5I_object(sid_contig); + CHECK(space_contig, NULL, "H5I_object"); + + VERIFY(space->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); + VERIFY(space_compact->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); + VERIFY(space_contig->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); + + /* Close the three datasets */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Dclose(did_compact); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Dclose(did_contig); + CHECK(ret, FAIL, "H5Dclose"); + + /* Delete the three datasets */ + ret = H5Ldelete(fid, DSETA, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); + ret = H5Ldelete(fid, DSETB, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); + ret = H5Ldelete(fid, DSETC, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ + } /* end for */ + } /* end for */ + + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close the three dataspaces */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(sid_compact); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(sid_contig); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the three dataset creation property lists */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Pclose(dcpl_compact); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Pclose(dcpl_contig); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_dataspace() */ + +/**************************************************************** +** +** test_libver_bounds_dataset(): +** Verify the dataset's layout, fill, and pline message versions +** with the low/high library format bounds setting in the fapl. +** For chunked dataset, also verify the chunked indexing type. +** +****************************************************************/ +static void +test_libver_bounds_dataset(hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t new_fapl; /* File access property list */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t dcpl; /* Dataset creation property list */ + H5D_t *dset; /* Internal dataset pointer */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + herr_t ret; /* Return value */ + hsize_t fix_dims2[2] = {10, 4}; /* Dimension sizes */ + hsize_t fix_chunks2[2] = {4, 3}; /* Chunk dimension sizes */ + hsize_t dims2[2] = {1, 4}; /* Dimension sizes */ + hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks2[2] = {4, 5}; /* Chunk dimension sizes */ + + /* Retrieve the library format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create the dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a contiguous dataset */ + did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate"); + + /* Get the internal file pionter */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); + + /* Verify layout and fill messages version */ + if(low == H5F_LIBVER_EARLIEST) { + VERIFY(dset->shared->layout.version, LAYOUT_VERSION_DEFAULT, "layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, FILL_VERSION_DEFAULT, "fill_ver_bounds"); + } else { + VERIFY(dset->shared->layout.version, layout_ver_bounds[low], "layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, fill_ver_bounds[low], "fill_ver_bounds"); + } + + /* Verify pline message version */ + VERIFY(dset->shared->dcpl_cache.pline.version, pline_ver_bounds[low], "pline_ver_bounds"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Create a chunked dataset with "no filter edge chunks" enabled */ + sid = H5Screate_simple(2, fix_dims2, NULL); + CHECK(sid, FAIL, "H5Screate"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 2, fix_chunks2); + CHECK(ret, FAIL, "H5Pset_chunk"); + ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + CHECK(ret, FAIL, "H5Pset_chunk"); + + H5E_BEGIN_TRY { + did = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + } H5E_END_TRY; + + if(did >= 0) { + + /* Get the internal dataset pointer */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); + + VERIFY(dset->shared->layout.version, LAYOUT_VERSION_4, "layout_ver_bounds"); + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_FARRAY, "chunk_index_type"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + } + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the datset creation property list */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Create a copy of file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Prepare to create a chunked dataset with 2 unlimited dimensions */ + sid = H5Screate_simple(2, dims2, max_dims2); + CHECK(sid, FAIL, "H5Screate"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 2, chunks2); + CHECK(ret, FAIL, "H5Pset_chunk"); + + /* Loop through all the combinations of low/high library format bounds */ + /* Open the file and create the chunked dataset */ + /* Verify the dataset's layout, fill, pline message versions and chunked indexing type */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; + + if(fid >=0 ) { /* The file open succeeds */ + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* Create the chunked dataset */ + did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Get the internal file pointer */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); + + /* Verify the dataset's layout, fill, pline message versions and chunked indexing type */ + if(f->shared->low_bound == H5F_LIBVER_EARLIEST) { + VERIFY(dset->shared->layout.version, LAYOUT_VERSION_DEFAULT, "layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, FILL_VERSION_DEFAULT, "fill_ver_bounds"); + } else { + VERIFY(dset->shared->layout.version, layout_ver_bounds[f->shared->low_bound], "layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, fill_ver_bounds[f->shared->low_bound], "fill_ver_bounds"); + } + + VERIFY(dset->shared->dcpl_cache.pline.version, pline_ver_bounds[f->shared->low_bound], "pline_ver_bounds"); + if(dset->shared->layout.version == LAYOUT_VERSION_LATEST) + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type"); + else + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE, "chunk_index_type"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + + /* Delete the dataset */ + ret = H5Ldelete(fid, DSETC, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ + } /* end for */ + } /* end for */ + + /* CLose the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + + /* CLose the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* CLose the dataset creation property list */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_dataset() */ + +/**************************************************************** +** +** test_libver_bounds_obj(): +** Verify object header version with the low/high library +** format bounds setting in the fapl. +** +****************************************************************/ +static void +test_libver_bounds_obj(hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t gid; /* Group ID */ + hid_t fcpl; /* File creation property list */ + hid_t new_fapl; /* File access property list */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + H5O_info_t oinfo; /* Object info */ + H5G_info_t ginfo; /* Group info */ + herr_t ret; /* Return value */ + + /* Retrieve the format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Get a copy of file creation property list */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + + /* Enable shared message */ + ret = H5Pset_shared_mesg_nindexes(fcpl, 1); + CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); + CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Get root group's object info */ + ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info"); + + /* Verify object header version is 2 when shared message is enabled */ + VERIFY(oinfo.hdr.version, OBJ_VERSION_2, "H5Oget_info"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Close the file creation property list */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a file with default fcpl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Get root group's object info */ + ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info"); + + /* Verify object header version */ + VERIFY(oinfo.hdr.version, obj_ver_bounds[low], "H5Oget_info"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a copy of file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Loop through all the combinations of low/high library format bounds */ + /* Open the file to verify object header version */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid combinations */ + continue; + + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; + + if(fid >=0 ) { /* The file open succeeds */ + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* Create a group in the file */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Get group information */ + ret = H5Gget_info(gid, &ginfo); + CHECK(ret, FAIL, "H5Gget_info"); + + /* Verify group storage type */ + if(f->shared->low_bound >= H5F_LIBVER_V18) + VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_COMPACT, "H5Gget_info"); + else + VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_SYMBOL_TABLE, "H5Gget_info"); + + /* Get object header information */ + ret = H5Oget_info_by_name(gid, GRP_NAME, &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info"); + + /* Verify object header version */ + VERIFY(oinfo.hdr.version, obj_ver_bounds[f->shared->low_bound], "H5Oget_info_by_name"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Delete the group */ + ret = H5Ldelete(fid, GRP_NAME, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ + } /* end for */ + } /* end for */ + + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_obj() */ + +/**************************************************************** +** +** test_libver_bounds_super(): +** Verify open of a file with 0, 1, 2 and 3 superblock versions. +** +****************************************************************/ +static void +test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) +{ + hid_t fid; /* File ID */ + H5F_t *f; /* Internal file pointer */ + hid_t new_fapl; /* File access property list */ + unsigned super_vers; /* Superblock version */ + H5F_libver_t low, high; /* File format bounds */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* Return value */ + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* The file's superblock version */ + super_vers = f->shared->sblock->super_vers; + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + /* Invalid combinations */ + if (ret < 0) + continue; + + /* Open the file with or without SWMR */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl); + } H5E_END_TRY; + ok = fid >= 0; + + /* Verify the file open succeeds or fails */ + switch(super_vers) { + case 3: + if(high == H5F_LIBVER_LATEST) { + /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); + VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "superblock_ver_bounds"); + + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } else /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + break; + + case 2: + if(is_swmr) /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); + + ok = f->shared->low_bound >= H5F_LIBVER_V18; + VERIFY(ok, TRUE, "superblock_ver_bounds"); + + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + break; + + case 1: + case 0: + if(is_swmr) /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); + VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); + + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + break; + + default: + break; + } /* end switch */ + } /* end for */ + } /* end for */ + + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_super_open() */ + +/**************************************************************** +** +** test_libver_bounds_super_create(): +** Verify the superblock version with the low/high library +** version bounds setting in the fapl. +** +****************************************************************/ +static void +test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) +{ + hid_t fid; /* File ID */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* The return value */ + + /* Try to create the file */ + H5E_BEGIN_TRY { + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), fcpl, fapl); + } H5E_END_TRY; + + /* Get the internal file pointer if the create succeeds */ + if((ok = fid >= 0)) { + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + } + + /* Retrieve the format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + if(is_swmr) { /* SWMR is enabled */ + + if(high == H5F_LIBVER_LATEST) { /* Superblock version is 3 */ + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(SUPERBLOCK_VERSION_3, f->shared->sblock->super_vers, "superblock_ver_bounds"); + VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "superblock_ver_bounds"); + + } else /* Should fail */ + VERIFY(ok, FALSE, "H5Fcreate"); + + } else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fcreate"); + + switch(low) { + case H5F_LIBVER_EARLIEST: + ok = (f->shared->sblock->super_vers == 0 || + f->shared->sblock->super_vers == 1 || + f->shared->sblock->super_vers == 2); + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); + break; + + case H5F_LIBVER_V18: + ok = (f->shared->sblock->super_vers == 2); + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); + break; + + case H5F_LIBVER_V110: + ok = (f->shared->sblock->super_vers == 3); + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); + break; + + case H5F_LIBVER_ERROR: + case H5F_LIBVER_NBOUNDS: + default: + ERROR("H5Pget_libver_bounds"); + + } /* end switch */ + } + + if(ok) { /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + +} /* end test_libver_bounds_super_create() */ + +/**************************************************************** +** +** test_libver_bounds_super(): +** Verify superblock version via: +** test_libver_bounds_super_create() +** test_libver_bounds_super_open() +** +****************************************************************/ +static void +test_libver_bounds_super(hid_t fapl) +{ + hid_t fcpl; + herr_t ret; + + /* Create a default fcpl */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + + /* Verify superblock version is 0 when creating a file with or without SWMR */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); + + /* Verify opening a file with or without SWMR when superblock version is 0 */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); + + /* Create fcpl with non-default v1-btree K value enabled */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + + ret = H5Pset_istore_k(fcpl, 64); + CHECK(ret, FAIL, "H5Pset_istore_k"); + + /* Verify superblock version is 1 when creating a file with or without SWMR */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); + + /* Verify opening a file with or without SWMR when superblock version is 1 */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); + + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Create fcpl with shared messages enabled */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + ret = H5Pset_shared_mesg_nindexes(fcpl, 1); + CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); + CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); + + /* Verify superblock version is 2 when creating a file with or without SWMR */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); + + /* Verify opening a file with or without SWMR when superblock version is 2 */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); + + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Create fcpl with persistent free-space enabled */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0); + CHECK(ret, FAIL, "H5Pset_file_space"); + + /* Verify superblock version is 2 when creating a file with or without SWMR */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); + + /* Verify opening a file with or without SWMR when superblock version is 2 */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); + + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_super() */ + +/**************************************************************** +** +** test_libver_bounds_low_high(): +** Tests to verify that format versions are correct with the five +** pairs of (low, high) combinations via H5Pset_libver_bounds(). +** +****************************************************************/ +static void +test_libver_bounds_low_high(void) +{ + hid_t fapl; + H5F_libver_t low, high; + herr_t ret; + + /* Output message about test being performed */ + MESSAGE(5, ("Testing setting library version bounds for (low, high) bounds\n")); + + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; + + /* Should fail: invalid combinations */ + if(high == H5F_LIBVER_EARLIEST) { + VERIFY(ret, FAIL, "H5Pset_libver_bounds"); + continue; + } + + /* Should fail: invalid combinations */ + if(high < low) { + VERIFY(ret, FAIL, "H5Pset_libver_bounds"); + continue; + } + + /* All other combinations are valid and should succeed */ + VERIFY(ret, SUCCEED, "H5Pset_libver_bounds"); + + /* Tests to verify format versions */ + test_libver_bounds_super(fapl); + test_libver_bounds_obj(fapl); + test_libver_bounds_dataset(fapl); + test_libver_bounds_dataspace(fapl); + test_libver_bounds_datatype(fapl); + test_libver_bounds_attributes(fapl); + } + + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_low_high() */ + +/**************************************************************** +** ** test_libver_macros(): ** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly. ** @@ -5333,6 +6862,7 @@ test_file(void) test_filespace_round_compatible(); /* Testing file space compatibility for files from trunk to 1_8 to trunk */ test_filespace_1_10_0_compatible(); /* Testing file space compatibility for files from release 1.10.0 */ test_libver_bounds(); /* Test compatibility for file space management */ + test_libver_bounds_low_high(); 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 -- 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 e92f3f858bf16a84c59aeb6692f5cab5e6b8e66f Mon Sep 17 00:00:00 2001 From: lrknox Date: Sun, 22 Oct 2017 22:35:15 -0500 Subject: Fix for HDFFFV-10308. Initialize hid_ts in function check_objects and check for id > -1 before calling close functions. --- tools/src/h5repack/h5repack.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 14b9461..22ca279 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -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; @@ -810,9 +810,12 @@ static int check_objects(const char* fname, pack_opt_t *options) { done: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did); - H5Fclose(fid); + if (sid > -1) + H5Sclose(sid); + if (did > -1) + H5Dclose(did); + if (fid > -1) + H5Fclose(fid); } H5E_END_TRY; if (travt) trav_table_free(travt); -- 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 2e2854cbb17086509eb9f2c2a3978c421a511ea5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 25 Oct 2017 09:05:02 -0500 Subject: Correct test DEPENDS --- tools/test/perform/CMakeTests.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake index 2bd8d46..1f67abe 100644 --- a/tools/test/perform/CMakeTests.cmake +++ b/tools/test/perform/CMakeTests.cmake @@ -167,8 +167,7 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) 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") +set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_zip_perf_help;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 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 From e9067227aed3c8fe0266e3e8d1cc1d5558ceb096 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 25 Oct 2017 14:06:44 -0500 Subject: HDFFV-10297 Update release note --- release_docs/RELEASE.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index db3e4e0..4714232 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -78,7 +78,7 @@ New Features 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) + 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 @@ -199,6 +199,7 @@ Bug Fixes since HDF5-1.10.1 release 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. + Note that the output display of h5repack has changed. (ADB - 2017/10/10, HDFFV-10297) -- cgit v0.12 From 95d8724df84294260ae611c07aec535199e5a23a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 25 Oct 2017 15:10:42 -0500 Subject: HDFFV-10297 - clarify 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 4714232..5ad2b61 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -199,7 +199,10 @@ Bug Fixes since HDF5-1.10.1 release 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. - Note that the output display of h5repack has changed. + Note, h5repack output display has changed to clarify the individual + steps of the repack process. The output indicates if an operation + applies to all objects. Lines with notation and no information + has removed. (ADB - 2017/10/10, HDFFV-10297) -- cgit v0.12 From efb505f37a062c2016d409a2d2fce732bf2c6d67 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 25 Oct 2017 15:50:07 -0500 Subject: HDFFV-10297 fix grammar --- 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 5ad2b61..be5550e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -202,7 +202,7 @@ Bug Fixes since HDF5-1.10.1 release Note, h5repack output display has changed to clarify the individual steps of the repack process. The output indicates if an operation applies to all objects. Lines with notation and no information - has removed. + have been removed. (ADB - 2017/10/10, HDFFV-10297) -- cgit v0.12 From d14e859a919dee2c153c6faac3a0431d84042f0d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 26 Oct 2017 10:44:09 -0500 Subject: Correct char type --- release_docs/RELEASE.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index be5550e..7aa6322 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -84,7 +84,7 @@ New Features 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) + (RAW - 2017/10/10, HDFFV-10294) - Large MPI-IO transfers @@ -109,7 +109,7 @@ New Features fulfill the original user request without encountering API errors. - (RAW – 2017/07/11, HDFFV-8839) + (RAW - 2017/07/11, HDFFV-8839) Fortran Library: ---------------- -- cgit v0.12 From b6de5127a8b214bfb702c4780bfbe4288fe606fd Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 26 Oct 2017 15:26:54 -0500 Subject: removed extra character --- bin/h5vers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/h5vers b/bin/h5vers index 5228903..5466d13 100755 --- a/bin/h5vers +++ b/bin/h5vers @@ -198,7 +198,7 @@ my $H5_JAVA = $file; $H5_JAVA =~ s/[^\/]*$/..\/java\/src\/hdf\/hdf5lib\/H5.java/; die "unable to read file: $H5_JAVA\n" unless -r $file; my $TESTH5_JAVA = $file; -$TESTH5_JAVA =~ s/[^\/]*$/..\/java\/test\/TestH5.java/; +$TESTH5_JAVA =~ s/[^\/]*$/..\/java\/test\/TestH5.java/; die "unable to read file: $TESTH5_JAVA\n" unless -r $file; my $REPACK_LAYOUT_PLUGIN_VERSION = $file; $REPACK_LAYOUT_PLUGIN_VERSION =~ s/[^\/]*$/..\/tools\/test\/h5repack\/testfiles\/h5repack_layout.h5-plugin_version_test.ddl/; -- cgit v0.12 From b752960f56845f737d0e54cf257474d924fd2f0c Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 26 Oct 2017 16:36:21 -0500 Subject: Remove extra spaces and 1 "currently under development" to match hdf5_1_10 version. --- bin/h5vers | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/h5vers b/bin/h5vers index 5228903..a00beb7 100755 --- a/bin/h5vers +++ b/bin/h5vers @@ -198,7 +198,7 @@ my $H5_JAVA = $file; $H5_JAVA =~ s/[^\/]*$/..\/java\/src\/hdf\/hdf5lib\/H5.java/; die "unable to read file: $H5_JAVA\n" unless -r $file; my $TESTH5_JAVA = $file; -$TESTH5_JAVA =~ s/[^\/]*$/..\/java\/test\/TestH5.java/; +$TESTH5_JAVA =~ s/[^\/]*$/..\/java\/test\/TestH5.java/; die "unable to read file: $TESTH5_JAVA\n" unless -r $file; my $REPACK_LAYOUT_PLUGIN_VERSION = $file; $REPACK_LAYOUT_PLUGIN_VERSION =~ s/[^\/]*$/..\/tools\/test\/h5repack\/testfiles\/h5repack_layout.h5-plugin_version_test.ddl/; @@ -354,7 +354,7 @@ if ($HDF5CONFIGCMAKE) { my $sub_rel_ver_str = ( $newver[3] eq "" ? sprintf("\"%s\"", "") - : sprintf("\"%s\"", "-".$newver[3].", currently under development") + : sprintf("\"%s\"", "-".$newver[3]) ); my $version_string = sprintf("\"%d.%d.%d\"", @newver[0,1,2]); @@ -377,7 +377,7 @@ if ($H5_JAVA) { my $version_string2 = sprintf("%d, %d, %d", @newver[0,1,2]); $data =~ s/\@version HDF5 .*
/\@version HDF5 $version_string1
/; - $data =~ s/ public final static int LIB_VERSION\[\] = { \d*, \d*, \d* };/ public final static int LIB_VERSION[] = { $version_string2 };/; + $data =~ s/ public final static int LIB_VERSION\[\] = { \d*, \d*, \d* };/ public final static int LIB_VERSION[] = { $version_string2 };/; write_file($H5_JAVA, $data); } @@ -395,7 +395,7 @@ if ($TESTH5_JAVA) { my $version_string2 = sprintf("int majnum = %d, minnum = %d, relnum = %d", @newver[0,1,2]); $data =~ s/ int libversion\[\] = { .* };/ int libversion\[\] = { $version_string1 };/; - $data =~ s/ int majnum = \d*, minnum = \d*, relnum = \d*;/ $version_string2;/; + $data =~ s/ int majnum = \d*, minnum = \d*, relnum = \d*;/ $version_string2;/; write_file($TESTH5_JAVA, $data); } @@ -410,7 +410,7 @@ if ($REPACK_LAYOUT_PLUGIN_VERSION) { write_file($REPACK_LAYOUT_PLUGIN_VERSION, $data); } -# helper function to read the file for updating c++/src/cpp_doc_config, +# helper function to read the file for updating c++/src/cpp_doc_config, # config/cmake/scripts/HDF5Config.cmake, and java files. # The version string in that file is not at the top, so the string replacement # is not for the first line, and reading/writing the entire file as one string -- cgit v0.12 From 6a52c26162f45e85b88aa6ddab5e5d861aaba7b8 Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 26 Oct 2017 16:45:25 -0500 Subject: Revert "Fix for HDFFFV-10308. Initialize hid_ts in function check_objects and" This reverts commit e92f3f858bf16a84c59aeb6692f5cab5e6b8e66f. --- tools/src/h5repack/h5repack.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 22ca279..14b9461 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -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 = -1; - hid_t did = -1; - hid_t sid = -1; + hid_t fid; + hid_t did; + hid_t sid; unsigned int i; unsigned int uf; trav_table_t *travt = NULL; @@ -810,12 +810,9 @@ static int check_objects(const char* fname, pack_opt_t *options) { done: H5E_BEGIN_TRY { - if (sid > -1) - H5Sclose(sid); - if (did > -1) - H5Dclose(did); - if (fid > -1) - H5Fclose(fid); + H5Sclose(sid); + H5Dclose(did); + H5Fclose(fid); } H5E_END_TRY; if (travt) trav_table_free(travt); -- cgit v0.12 From 4a6904e758cd14673a3ec6f60adb5f8b210bb4c3 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Thu, 26 Oct 2017 21:18:03 -0400 Subject: Add a missing declaration for testing --- src/H5Sprivate.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 60e0630..8934726 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -311,6 +311,7 @@ H5_DLL herr_t H5S_select_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem); H5_DLL herr_t H5S_select_iter_release(H5S_sel_iter_t *sel_iter); #ifdef H5_HAVE_PARALLEL +H5_DLL hsize_t H5S_mpio_set_bigio_count(hsize_t new_count); H5_DLL herr_t H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, /* out: */ MPI_Datatype *new_type, int *count, -- cgit v0.12 From 25a2e40358e32c2421e3958f1b6e3eb73c31aa6b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 30 Oct 2017 11:37:57 -0500 Subject: New requirement for test --- config/cmake/cacheinit.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index d37c339..d5c5e52 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -29,7 +29,7 @@ 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 (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) +set (MPIEXEC_MAX_NUMPROCS "4" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) -- cgit v0.12 From 11ccbed3c93d3c34d63591ba93a355300ab38c96 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 31 Oct 2017 11:18:09 -0500 Subject: Update H5Zfilter_avail note --- release_docs/RELEASE.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7aa6322..b66355e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -166,7 +166,7 @@ Bug Fixes since HDF5-1.10.1 release 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) + (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) Configuration ------------- @@ -204,7 +204,7 @@ Bug Fixes since HDF5-1.10.1 release applies to all objects. Lines with notation and no information have been removed. - (ADB - 2017/10/10, HDFFV-10297) + (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) - h5repack -- cgit v0.12 From 80c96bb047b0138c6df4d25fbd14e5d63392454e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Nov 2017 11:12:47 -0500 Subject: Change MPI target properties for library --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 96ea589..ad0a326 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -886,7 +886,7 @@ if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} dl) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_link_libraries (${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) + target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${MPI_C_LIBRARIES}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) @@ -930,7 +930,7 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${HDF5_LIBSH_TARGET} dl) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_link_libraries (${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) + target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES}) 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}) -- cgit v0.12 From 765d96456298aa678c072df9debba7d4be6ffb95 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Nov 2017 11:28:11 -0500 Subject: Correct command usage --- src/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ad0a326..849ced0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -881,9 +881,9 @@ set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS}) +target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIB_TARGET} dl) + target_link_libraries (${HDF5_LIB_TARGET} PRIVATE dl) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${MPI_C_LIBRARIES}) @@ -925,9 +925,9 @@ if (BUILD_SHARED_LIBS) set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_LIBSH_TARGET} ${LINK_SHARED_LIBS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${LINK_SHARED_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIBSH_TARGET} dl) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES}) @@ -945,7 +945,7 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - target_link_libraries (${HDF5_LIBSH_TARGET} Threads::Threads) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC Threads::Threads) endif () if (HDF5_ENABLE_DEBUG_APIS) -- cgit v0.12 From 930cfc402dc2f17b1dbe9a6b3c5e15b95cc4c7ea Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Nov 2017 12:29:53 -0500 Subject: Convert to use MPI:: for link --- CMakeLists.txt | 2 +- fortran/CMakeLists.txt | 3 +-- fortran/examples/CMakeLists.txt | 4 ++-- fortran/src/CMakeLists.txt | 4 ++-- src/CMakeLists.txt | 6 ++++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23452cd..40093c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -623,7 +623,7 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR} ${CMAKE_RUNTIME_OUTPUT_D set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${HDF_RESOURCES_EXT_DIR} ${CMAKE_MODULE_PATH}) option (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) if (HDF5_ENABLE_PARALLEL) - include (FindMPI) + find_package(MPI REQUIRED) INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH}) if (MPI_C_FOUND) set (H5_HAVE_PARALLEL 1) diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index f7179cf..9f7144d 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -2,8 +2,7 @@ cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_F90 C CXX Fortran) if (H5_HAVE_PARALLEL) - INCLUDE (FindMPI) - set (LINK_LIBS ${LINK_LIBS} ${MPI_Fortran_LIBRARIES}) + set (LINK_LIBS ${LINK_LIBS} MPI::MPI_Fortran) if (MPI_Fortran_LINK_FLAGS) set (CMAKE_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") endif () diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index a5c3422..119648f 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -107,7 +107,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} - ${MPI_Fortran_LIBRARIES} + MPI::MPI_Fortran ) target_include_directories (f90_ex_ph5example PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (f90_ex_ph5example PROPERTIES @@ -122,7 +122,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (f90_ex_ph5example-shared ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} - ${MPI_Fortran_LIBRARIES} + MPI::MPI_Fortran ) target_include_directories (f90_ex_ph5example-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (f90_ex_ph5example-shared PROPERTIES diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 6d51feb..4a723c7 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -243,7 +243,7 @@ set (SHARED_LINK_FLAGS " ") 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}) + target_link_libraries (${HDF5_F90_LIB_TARGET} MPI::MPI_Fortran) 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) @@ -270,7 +270,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) 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}) + target_link_libraries (${HDF5_F90_LIBSH_TARGET} MPI::MPI_Fortran) 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}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 849ced0..1651b15 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -886,7 +886,8 @@ if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} PRIVATE dl) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${MPI_C_LIBRARIES}) + target_include_directories (${HDF5_LIB_TARGET} PRIVATE ${MPI_C_INCLUDE_PATH}) + target_link_libraries (${HDF5_LIB_TARGET} PRIVATE MPI::MPI_C}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) @@ -930,7 +931,8 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES}) + target_include_directories (${HDF5_LIBSH_TARGET} PRIVATE ${MPI_C_INCLUDE_PATH}) + target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE MPI::MPI_C) 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}) -- cgit v0.12 From f8fd6d0b41a242aae93689e1477478bc78bae471 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Nov 2017 13:41:44 -0500 Subject: Correct usage of MPI vars --- CMakeLists.txt | 1 - config/cmake/UseJava.cmake | 6 +- config/cmake/hdf5-config.cmake.in | 8 +- config/cmake_ext_mod/FindMPI.cmake | 1754 +++++++++++++++++++++++++---------- fortran/examples/CMakeTests.cmake | 4 +- fortran/src/CMakeLists.txt | 8 +- fortran/testpar/CMakeLists.txt | 4 +- fortran/testpar/CMakeTests.cmake | 2 +- src/CMakeLists.txt | 10 +- testpar/CMakeLists.txt | 4 +- testpar/CMakeTests.cmake | 4 +- tools/test/h5diff/CMakeTests.cmake | 4 +- tools/test/perform/CMakeTests.cmake | 4 +- 13 files changed, 1270 insertions(+), 543 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40093c1..20ff228 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -624,7 +624,6 @@ set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${HDF_RESOURCES_EXT_DIR} ${CMAKE_MOD option (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) if (HDF5_ENABLE_PARALLEL) find_package(MPI REQUIRED) - INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH}) if (MPI_C_FOUND) set (H5_HAVE_PARALLEL 1) # MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index 9b3bf02..52b37a9 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -482,6 +482,8 @@ function(add_jar _TARGET_NAME) else() get_filename_component(_add_jar_OUTPUT_DIR ${_add_jar_OUTPUT_DIR} ABSOLUTE) endif() + # ensure output directory exists + file (MAKE_DIRECTORY "${_add_jar_OUTPUT_DIR}") if (_add_jar_ENTRY_POINT) set(_ENTRY_POINT_OPTION e) @@ -516,7 +518,7 @@ function(add_jar _TARGET_NAME) set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") endforeach() - set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${_add_jar_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") + set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar") if (_add_jar_OUTPUT_NAME AND _add_jar_VERSION) @@ -547,7 +549,7 @@ function(add_jar _TARGET_NAME) list(APPEND _JAVA_COMPILE_FILELISTS ${_JAVA_FULL}) elseif (_JAVA_EXT MATCHES ".java") - file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${_add_jar_OUTPUT_DIR} ${_JAVA_FULL}) + file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_CURRENT_BINARY_DIR} ${_JAVA_FULL}) file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL}) string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN) string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 712dc05..01c27df 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -50,8 +50,12 @@ set (${HDF5_PACKAGE_NAME}_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") # Dependencies #----------------------------------------------------------------------------- if (${HDF5_PACKAGE_NAME}_ENABLE_PARALLEL) - set (${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@") + set (${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_DIRS@") set (${HDF5_PACKAGE_NAME}_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@") + if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN) + set (${HDF5_PACKAGE_NAME}_MPI_Fortran_INCLUDE_PATH "@MPI_Fortran_INCLUDE_DIRS@") + set (${HDF5_PACKAGE_NAME}_MPI_Fortran_LIBRARIES "@MPI_Fortran_LIBRARIES@") + endif () endif () if (${HDF5_PACKAGE_NAME}_BUILD_JAVA) @@ -67,7 +71,7 @@ endif () #----------------------------------------------------------------------------- # Directories #----------------------------------------------------------------------------- -set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@" "${${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_PATH}") +set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@" "${${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_DIRS}") set (${HDF5_PACKAGE_NAME}_SHARE_DIR "@PACKAGE_SHARE_INSTALL_DIR@") set_and_check (${HDF5_PACKAGE_NAME}_BUILD_DIR "@PACKAGE_CURRENT_BUILD_DIR@") diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index f566ade..61ab4a4 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -4,27 +4,45 @@ # FindMPI # ------- # -# Find a Message Passing Interface (MPI) implementation +# Find a Message Passing Interface (MPI) implementation. # # 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. # -# Variables -# ^^^^^^^^^ +# Variables for using MPI +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# The module exposes the components ``C``, ``CXX``, ``MPICXX`` and ``Fortran``. +# Each of these controls the various MPI languages to search for. +# The difference between ``CXX`` and ``MPICXX`` is that ``CXX`` refers to the +# MPI C API being usable from C++, whereas ``MPICXX`` refers to the MPI-2 C++ API +# that was removed again in MPI-3. +# +# Depending on the enabled components the following variables will be set: +# +# ``MPI_FOUND`` +# Variable indicating that MPI settings for all requested languages have been found. +# If no components are specified, this is true if MPI settings for all enabled languages +# were detected. Note that the ``MPICXX`` component does not affect this variable. +# ``MPI_VERSION`` +# Minimal version of MPI detected among the requested languages, or all enabled languages +# if no components were specified. # # This module will set the following variables per language in your # project, where ```` is one of C, CXX, or Fortran: # # ``MPI__FOUND`` -# Variable indicating the MPI settings for ```` were found. +# Variable indicating the MPI settings for ```` were found and that +# simple MPI test programs compile with the provided settings. # ``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`` +# MPI compiler for ```` if such a program exists. +# ``MPI__COMPILE_OPTIONS`` +# Compilation options for MPI programs in ````, given as a :ref:`;-list `. +# ``MPI__COMPILE_DEFINITIONS`` +# Compilation definitions for MPI programs in ````, given as a :ref:`;-list `. +# ``MPI__INCLUDE_DIRS`` # Include path(s) for MPI header. # ``MPI__LINK_FLAGS`` # Linker flags for MPI programs. @@ -36,53 +54,172 @@ # ``MPI::MPI_`` # Target for using MPI from ````. # -# Additionally, FindMPI sets the following variables for running MPI -# programs from the command line: +# The following variables indicating which bindings are present will be defined: # -# ``MPIEXEC`` -# Executable for running MPI programs, if provided. +# ``MPI_MPICXX_FOUND`` +# Variable indicating whether the MPI-2 C++ bindings are present (introduced in MPI-2, removed with MPI-3). +# ``MPI_Fortran_HAVE_F77_HEADER`` +# True if the Fortran 77 header ``mpif.h`` is available. +# ``MPI_Fortran_HAVE_F90_MODULE`` +# True if the Fortran 90 module ``mpi`` can be used for accessing MPI (MPI-2 and higher only). +# ``MPI_Fortran_HAVE_F08_MODULE`` +# True if the Fortran 2008 ``mpi_f08`` is available to MPI programs (MPI-3 and higher only). +# +# If possible, the MPI version will be determined by this module. The facilities to detect the MPI version +# were introduced with MPI-1.2, and therefore cannot be found for older MPI versions. +# +# ``MPI__VERSION_MAJOR`` +# Major version of MPI implemented for ```` by the MPI distribution. +# ``MPI__VERSION_MINOR`` +# Minor version of MPI implemented for ```` by the MPI distribution. +# ``MPI__VERSION`` +# MPI version implemented for ```` by the MPI distribution. +# +# Note that there's no variable for the C bindings being accessible through ``mpi.h``, since the MPI standards +# always have required this binding to work in both C and C++ code. +# +# For running MPI programs, the module sets the following variables +# +# ``MPIEXEC_EXECUTABLE`` +# Executable for running MPI programs, if such exists. # ``MPIEXEC_NUMPROC_FLAG`` -# Flag to pass to ``MPIEXEC`` before giving it the number of processors to run on. +# 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. +# Flags to pass to ``mpiexec`` directly before the executable to run. # ``MPIEXEC_POSTFLAGS`` -# Flags to pass to ``MPIEXEC`` after other flags. +# Flags to pass to ``mpiexec`` after other flags. +# +# Variables for locating MPI +# ^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# This module performs a three step search for an MPI implementation: +# +# 1. Check if the compiler has MPI support built-in. This is the case if the user passed a +# compiler wrapper as ``CMAKE__COMPILER`` or if they're on a Cray system. +# 2. Attempt to find an MPI compiler wrapper and determine the compiler information from it. +# 3. Try to find an MPI implementation that does not ship such a wrapper by guessing settings. +# Currently, only Microsoft MPI and MPICH2 on Windows are supported. +# +# For controlling the second step, the following variables may be set: +# +# ``MPI__COMPILER`` +# Search for the specified compiler wrapper and use it. +# ``MPI__COMPILER_FLAGS`` +# Flags to pass to the MPI compiler wrapper during interrogation. Some compiler wrappers +# support linking debug or tracing libraries if a specific flag is passed and this variable +# may be used to obtain them. +# ``MPI_COMPILER_FLAGS`` +# Used to initialize ``MPI__COMPILER_FLAGS`` if no language specific flag has been given. +# Empty by default. +# ``MPI_EXECUTABLE_SUFFIX`` +# A suffix which is appended to all names that are being looked for. For instance you may set this +# to ``.mpich`` or ``.openmpi`` to prefer the one or the other on Debian and its derivatives. +# +# In order to control the guessing step, the following variable may be set: # -# Usage -# ^^^^^ +# ``MPI_GUESS_LIBRARY_NAME`` +# Valid values are ``MSMPI`` and ``MPICH2``. If set, only the given library will be searched for. +# By default, ``MSMPI`` will be preferred over ``MPICH2`` if both are available. +# This also sets ``MPI_SKIP_COMPILER_WRAPPER`` to ``true``, which may be overridden. # -# 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: +# Each of the search steps may be skipped with the following control variables: # -# 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. +# ``MPI_ASSUME_NO_BUILTIN_MPI`` +# If true, the module assumes that the compiler itself does not provide an MPI implementation and +# skips to step 2. +# ``MPI_SKIP_COMPILER_WRAPPER`` +# If true, no compiler wrapper will be searched for. +# ``MPI_SKIP_GUESSING`` +# If true, the guessing step will be skipped. # -# When configuration is successful, ``MPI__COMPILER`` will be set to -# 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. +# Additionally, the following control variable is available to change search behavior: # -# When using ``MPIEXEC`` to execute MPI applications, you should typically -# use all of the ``MPIEXEC`` flags as follows: +# ``MPI_CXX_SKIP_MPICXX`` +# Add some definitions that will disable the MPI-2 C++ bindings. +# Currently supported are MPICH, Open MPI, Platform MPI and derivatives thereof, +# for example MVAPICH or Intel MPI. +# +# If the find procedure fails for a variable ``MPI__WORKS``, then the settings detected by or passed to +# the module did not work and even a simple MPI test program failed to compile. +# +# If all of these parameters were not sufficient to find the right MPI implementation, a user may +# disable the entire autodetection process by specifying both a list of libraries in ``MPI__LIBRARIES`` +# and a list of include directories in ``MPI__ADDITIONAL_INCLUDE_DIRS``. +# Any other variable may be set in addition to these two. The module will then validate the MPI settings and store the +# settings in the cache. +# +# Cache variables for MPI +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# The variable ``MPI__INCLUDE_DIRS`` will be assembled from the following variables. +# For C and CXX: +# +# ``MPI__HEADER_DIR`` +# Location of the ``mpi.h`` header on disk. +# +# For Fortran: +# +# ``MPI_Fortran_F77_HEADER_DIR`` +# Location of the Fortran 77 header ``mpif.h``, if it exists. +# ``MPI_Fortran_MODULE_DIR`` +# Location of the ``mpi`` or ``mpi_f08`` modules, if available. +# +# For all languages the following variables are additionally considered: +# +# ``MPI__ADDITIONAL_INCLUDE_DIRS`` +# A :ref:`;-list ` of paths needed in addition to the normal include directories. +# ``MPI__INCLUDE_DIR`` +# Path variables for include folders referred to by ````. +# ``MPI__ADDITIONAL_INCLUDE_VARS`` +# A :ref:`;-list ` of ```` that will be added to the include locations of ````. +# +# The variable ``MPI__LIBRARIES`` will be assembled from the following variables: +# +# ``MPI__LIBRARY`` +# The location of a library called ```` for use with MPI. +# ``MPI__LIB_NAMES`` +# A :ref:`;-list ` of ```` that will be added to the include locations of ````. +# +# Usage of mpiexec +# ^^^^^^^^^^^^^^^^ +# +# When using ``MPIEXEC_EXECUTABLE`` to execute MPI applications, you should typically +# use all of the ``MPIEXEC_EXECUTABLE`` flags as follows: # # :: # -# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} +# ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} # ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS # # where ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to # pass to the MPI program. # +# Advanced variables for using MPI +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# The module can perform some advanced feature detections upon explicit request. +# +# **Important notice:** The following checks cannot be performed without *executing* an MPI test program. +# Consider the special considerations for the behavior of :command:`try_run` during cross compilation. +# Moreover, running an MPI program can cause additional issues, like a firewall notification on some systems. +# You should only enable these detections if you absolutely need the information. +# +# If the following variables are set to true, the respective search will be performed: +# +# ``MPI_DETERMINE_Fortran_CAPABILITIES`` +# Determine for all available Fortran bindings what the values of ``MPI_SUBARRAYS_SUPPORTED`` and +# ``MPI_ASYNC_PROTECTS_NONBLOCKING`` are and make their values available as ``MPI_Fortran__SUBARRAYS`` +# and ``MPI_Fortran__ASYNCPROT``, where ```` is one of ``F77_HEADER``, ``F90_MODULE`` and +# ``F08_MODULE``. +# ``MPI_DETERMINE_LIBRARY_VERSION`` +# For each language, find the output of ``MPI_Get_library_version`` and make it available as ``MPI__LIBRARY_VERSION``. +# This information is usually tied to the runtime component of an MPI implementation and might differ depending on ````. +# Note that the return value is entirely implementation defined. This information might be used to identify +# the MPI vendor and for example pick the correct one of multiple third party binaries that matches the MPI vendor. +# # Backward Compatibility # ^^^^^^^^^^^^^^^^^^^^^^ # @@ -91,54 +228,62 @@ # # :: # -# MPI_FOUND MPI_COMPILER MPI_LIBRARY -# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY -# MPI_LINK_FLAGS MPI_LIBRARIES +# MPI_COMPILER MPI_LIBRARY MPI_EXTRA_LIBRARY +# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_LINK_FLAGS +# MPI_LIBRARIES # # In new projects, please use the ``MPI__XXX`` equivalents. +# Additionally, the following variables are deprecated: +# +# ``MPI__COMPILE_FLAGS`` +# Use ``MPI__COMPILE_OPTIONS`` and ``MPI__COMPILE_DEFINITIONS`` instead. +# ``MPI__INCLUDE_PATH`` +# For consumption use ``MPI__INCLUDE_DIRS`` and for specifying folders use ``MPI__ADDITIONAL_INCLUDE_DIRS`` instead. +# ``MPIEXEC`` +# Use ``MPIEXEC_EXECUTABLE`` instead. + +cmake_policy(PUSH) +cmake_policy(SET CMP0057 NEW) # if IN_LIST # include this to handle the QUIETLY and REQUIRED arguments include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) include(GetPrerequisites) -# -# This part detects MPI compilers, attempting to wade through the mess of compiler names in -# a sensible way. -# -# 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 -# 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. -# -# 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 -# your favorite MPI__COMPILER explicitly and this stuff will be ignored. -# - -# 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_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ - 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 +# Generic compiler names +set(_MPI_C_GENERIC_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) +set(_MPI_CXX_GENERIC_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ + mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) +set(_MPI_Fortran_GENERIC_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r mpif90 mpif90_r mpf90 mpf90_r - mpif77 mpif77_r mpf77 mpf77_r) + mpif77 mpif77_r mpf77 mpf77_r + mpifc) # GNU compiler names set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r) -set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r) +set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r mpigxx) set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpgfortran_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) +# Intel MPI compiler names on Windows +if(WIN32) + list(APPEND _MPI_C_GENERIC_COMPILER_NAMES mpicc.bat) + list(APPEND _MPI_CXX_GENERIC_COMPILER_NAMES mpicxx.bat) + list(APPEND _MPI_Fortran_GENERIC_COMPILER_NAMES mpifc.bat) + + # Intel MPI compiler names + set(_MPI_Intel_C_COMPILER_NAMES mpiicc.bat) + set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc.bat) + set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort.bat mpif77.bat mpif90.bat) + + # Intel MPI compiler names for MSMPI + set(_MPI_MSVC_C_COMPILER_NAMES mpicl.bat) + set(_MPI_MSVC_CXX_COMPILER_NAMES mpicl.bat) +else() + # Intel compiler names + set(_MPI_Intel_C_COMPILER_NAMES mpiicc) + set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++) + set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) +endif() # PGI compiler names set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) @@ -154,548 +299,1127 @@ set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95 mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r mpixlf mpixlf_r mpxlf mpxlf_r) -# append vendor-specific compilers to the list if we either don't know the compiler id, -# or if we know it matches the regular compiler. -foreach (lang C CXX Fortran) - foreach (id GNU Intel PGI XL) - if (NOT CMAKE_${lang}_COMPILER_ID OR CMAKE_${lang}_COMPILER_ID STREQUAL id) - list(APPEND _MPI_${lang}_COMPILER_NAMES ${_MPI_${id}_${lang}_COMPILER_NAMES}) +# Prepend vendor-specific compiler wrappers to the list. If we don't know the compiler, +# attempt all of them. +# By attempting vendor-specific compiler names first, we should avoid situations where the compiler wrapper +# stems from a proprietary MPI and won't know which compiler it's being used for. For instance, Intel MPI +# controls its settings via the I_MPI_CC environment variables if the generic name is being used. +# If we know which compiler we're working with, we can use the most specialized wrapper there is in order to +# pick up the right settings for it. +foreach (LANG IN ITEMS C CXX Fortran) + set(_MPI_${LANG}_COMPILER_NAMES "") + foreach (id IN ITEMS GNU Intel MSVC PGI XL) + if (NOT CMAKE_${LANG}_COMPILER_ID OR CMAKE_${LANG}_COMPILER_ID STREQUAL id) + list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${id}_${LANG}_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) endif() - unset(_MPI_${id}_${lang}_COMPILER_NAMES) # clean up the namespace here + unset(_MPI_${id}_${LANG}_COMPILER_NAMES) endforeach() + list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${LANG}_GENERIC_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) + unset(_MPI_${LANG}_GENERIC_COMPILER_NAMES) endforeach() +# Names to try for mpiexec +# Only mpiexec commands are guaranteed to behave as described in the standard, +# mpirun commands are not covered by the standard in any way whatsoever. +# lamexec is the executable for LAM/MPI, srun is for SLURM or Open MPI with SLURM support. +# srun -n X is however a valid command, so it behaves 'like' mpiexec. +set(_MPIEXEC_NAMES_BASE mpiexec mpiexec.hydra mpiexec.mpd mpirun lamexec srun) -# Names to try for MPI exec -set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun) - -# Grab the path to MPI from the registry if we're on windows. -set(_MPI_PREFIX_PATH) -if(WIN32) - # MSMPI - file(TO_CMAKE_PATH "$ENV{MSMPI_BIN}" msmpi_bin_path) # The default path ends with a '\' and doesn't mix with ';' when appending. - list(APPEND _MPI_PREFIX_PATH "${msmpi_bin_path}") - unset(msmpi_bin_path) - list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]/Bin") - list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_INC}/..") # The SDK is installed separately from the runtime - # MPICH - 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. -foreach(SystemPrefixDir ${CMAKE_SYSTEM_PREFIX_PATH}) - foreach(MpiPackageDir ${_MPI_PREFIX_PATH}) - if(EXISTS ${SystemPrefixDir}/${MpiPackageDir}) - list(APPEND _MPI_PREFIX_PATH "${SystemPrefixDir}/${MpiPackageDir}") - endif() - endforeach() +unset(_MPIEXEC_NAMES) +foreach(_MPIEXEC_NAME IN LISTS _MPIEXEC_NAMES_BASE) + list(APPEND _MPIEXEC_NAMES "${_MPIEXEC_NAME}${MPI_EXECUTABLE_SUFFIX}") endforeach() +unset(_MPIEXEC_NAMES_BASE) -function (_mpi_check_compiler compiler options cmdvar resvar) +function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) + if(DEFINED MPI_${LANG}_COMPILER_FLAGS) + separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_${LANG}_COMPILER_FLAGS}") + else() + separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_COMPILER_FLAGS}") + endif() execute_process( - COMMAND "${compiler}" ${options} - OUTPUT_VARIABLE cmdline OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE cmdline ERROR_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE success) - # Intel MPI 5.0.1 will return a zero return code even when the - # argument to the MPI compiler wrapper is unknown. Attempt to - # catch this case. - if(cmdline MATCHES "undefined reference" OR cmdline MATCHES "unrecognized") - set(success 255 ) - endif() - set(${cmdvar} "${cmdline}" PARENT_SCOPE) - set(${resvar} "${success}" PARENT_SCOPE) + COMMAND ${MPI_${LANG}_COMPILER} ${_MPI_COMPILER_WRAPPER_OPTIONS} ${QUERY_FLAG} + OUTPUT_VARIABLE WRAPPER_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE WRAPPER_OUTPUT ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE WRAPPER_RETURN) + # Some compiler wrappers will yield spurious zero return values, for example + # Intel MPI tolerates unknown arguments and if the MPI wrappers loads a shared + # library that has invalid or missing version information there would be warning + # messages emitted by ld.so in the compiler output. In either case, we'll treat + # the output as invalid. + if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available") + set(WRAPPER_RETURN 255) + endif() + # Ensure that no error output might be passed upwards. + if(NOT WRAPPER_RETURN EQUAL 0) + unset(WRAPPER_OUTPUT) + endif() + set(${OUTPUT_VARIABLE} "${WRAPPER_OUTPUT}" PARENT_SCOPE) + set(${RESULT_VARIABLE} "${WRAPPER_RETURN}" PARENT_SCOPE) endfunction() -# -# interrogate_mpi_compiler(lang try_libs) -# -# Attempts to extract compiler and linker args from an MPI compiler. The arguments set -# by this function are: -# -# MPI__INCLUDE_PATH MPI__LINK_FLAGS MPI__FOUND -# MPI__COMPILE_FLAGS MPI__LIBRARIES -# -# MPI__COMPILER must be set beforehand to the absolute path to an MPI compiler for -# . Additionally, MPI__INCLUDE_PATH and MPI__LIBRARIES may be set -# to skip autodetection. -# -# If try_libs is TRUE, this will also attempt to find plain MPI libraries in the usual -# way. In general, this is not as effective as interrogating the compilers, as it -# ignores language-specific flags and libraries. However, some MPI implementations -# (Windows implementations) do not have compiler wrappers, so this approach must be used. -# -function (interrogate_mpi_compiler lang try_libs) - # MPI_${lang}_NO_INTERROGATE will be set to a compiler name when the *regular* compiler was - # discovered to be the MPI compiler. This happens on machines like the Cray XE6 that use - # modules to set cc, CC, and ftn to the MPI compilers. If the user force-sets another MPI - # compiler, MPI_${lang}_COMPILER won't be equal to MPI_${lang}_NO_INTERROGATE, and we'll - # inspect that compiler anew. This allows users to set new compilers w/o rm'ing cache. - string(COMPARE NOTEQUAL "${MPI_${lang}_NO_INTERROGATE}" "${MPI_${lang}_COMPILER}" interrogate) - - # If MPI is set already in the cache, don't bother with interrogating the compiler. - if (interrogate AND ((NOT MPI_${lang}_INCLUDE_PATH) OR (NOT MPI_${lang}_LIBRARIES))) - if (MPI_${lang}_COMPILER) - # Check whether the -showme:compile option works. This indicates that we have either OpenMPI - # or a newer version of LAM-MPI, and implies that -showme:link will also work. - _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-showme:compile" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - if (MPI_COMPILER_RETURN EQUAL 0) - # If we appear to have -showme:compile, then we should - # also have -showme:link. Try it. - execute_process( - COMMAND ${MPI_${lang}_COMPILER} -showme:link - OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE MPI_COMPILER_RETURN) - - if (MPI_COMPILER_RETURN EQUAL 0) - # We probably have -showme:incdirs and -showme:libdirs as well, - # so grab that while we're at it. - execute_process( - COMMAND ${MPI_${lang}_COMPILER} -showme:incdirs - OUTPUT_VARIABLE MPI_INCDIRS OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE MPI_INCDIRS ERROR_STRIP_TRAILING_WHITESPACE) - - execute_process( - COMMAND ${MPI_${lang}_COMPILER} -showme:libdirs - OUTPUT_VARIABLE MPI_LIBDIRS OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE MPI_LIBDIRS ERROR_STRIP_TRAILING_WHITESPACE) +function (_MPI_interrogate_compiler lang) + unset(MPI_COMPILE_CMDLINE) + unset(MPI_LINK_CMDLINE) + + unset(MPI_COMPILE_OPTIONS_WORK) + unset(MPI_COMPILE_DEFINITIONS_WORK) + unset(MPI_INCLUDE_DIRS_WORK) + unset(MPI_LINK_FLAGS_WORK) + unset(MPI_LIB_NAMES_WORK) + unset(MPI_LIB_FULLPATHS_WORK) + + # Check whether the -showme:compile option works. This indicates that we have either Open MPI + # or a newer version of LAM/MPI, and implies that -showme:link will also work. + # Open MPI also supports -show, but separates linker and compiler information + _MPI_check_compiler(${LANG} "-showme:compile" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + if (MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-showme:link" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) + + if (NOT MPI_COMPILER_RETURN EQUAL 0) + unset(MPI_COMPILE_CMDLINE) + endif() + endif() - else() - # reset things here if something went wrong. - set(MPI_COMPILE_CMDLINE) - set(MPI_LINK_CMDLINE) - endif() - endif () + # MPICH and MVAPICH offer -compile-info and -link-info. + # For modern versions, both do the same as -show. However, for old versions, they do differ + # when called for mpicxx and mpif90 and it's necessary to use them over -show in order to find the + # removed MPI C++ bindings. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-compile-info" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + + if (MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-link-info" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) - # Older versions of LAM-MPI have "-showme". Try to find that. if (NOT MPI_COMPILER_RETURN EQUAL 0) - _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-showme" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + unset(MPI_COMPILE_CMDLINE) endif() + endif() + endif() - # MVAPICH uses -compile-info and -link-info. Try them. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-compile-info" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - - # If we have compile-info, also have link-info. - if (MPI_COMPILER_RETURN EQUAL 0) - execute_process( - COMMAND ${MPI_${lang}_COMPILER} -link-info - OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE MPI_COMPILER_RETURN) - endif() + # MPICH, MVAPICH2 and Intel MPI just use "-show". Open MPI also offers this, but the + # -showme commands are more specialized. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-show" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + endif() - # make sure we got compile and link. Reset vars if something's wrong. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - set(MPI_COMPILE_CMDLINE) - set(MPI_LINK_CMDLINE) - endif() - endif() + # Older versions of LAM/MPI have "-showme". Open MPI also supports this. + # Unknown to MPICH, MVAPICH and Intel MPI. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-showme" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + endif() - # MPICH just uses "-show". Try it. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-show" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - endif() + if (NOT (MPI_COMPILER_RETURN EQUAL 0) OR NOT (DEFINED MPI_COMPILE_CMDLINE)) + # Cannot interrogate this compiler, so exit. + set(MPI_${LANG}_WRAPPER_FOUND FALSE PARENT_SCOPE) + return() + endif() + unset(MPI_COMPILER_RETURN) - if (MPI_COMPILER_RETURN EQUAL 0) - # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE - # into MPI_LINK_CMDLINE, if we didn't find the link line. - if (NOT MPI_LINK_CMDLINE) - set(MPI_LINK_CMDLINE ${MPI_COMPILE_CMDLINE}) - endif() + # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE + # into MPI_LINK_CMDLINE, if we didn't find the link line. + if (NOT DEFINED MPI_LINK_CMDLINE) + set(MPI_LINK_CMDLINE "${MPI_COMPILE_CMDLINE}") + endif() + + # At this point, we obtained some output from a compiler wrapper that works. + # We'll now try to parse it into variables with meaning to us. + if("${LANG}" STREQUAL "Fortran") + # Some MPICH-1 and MVAPICH-1 versions return a three command answer for Fortran, consisting + # out of a symlink command for mpif.h, the actual compiler command and a deletion of the + # created symlink. We need to detect that case, remember the include path and drop the + # symlink/deletion operation to obtain the link/compile lines we'd usually expect. + if("${MPI_COMPILE_CMDLINE}" MATCHES "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h") + get_filename_component(MPI_INCLUDE_DIRS_WORK "${CMAKE_MATCH_1}" DIRECTORY) + string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") + string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") + string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") + string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") + endif() + endif() + + # The Intel MPI wrapper on Linux will emit some objcopy commands after its compile command + # if -static_mpi was passed to the wrapper. To avoid spurious matches, we need to drop these lines. + if(UNIX) + string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") + string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") + endif() + + # Extract compile options from the compile command line. + string(REGEX MATCHALL "(^| )-f([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_OPTIONS "${MPI_COMPILE_CMDLINE}") + + foreach(_MPI_COMPILE_OPTION IN LISTS MPI_ALL_COMPILE_OPTIONS) + string(REGEX REPLACE "^ " "" _MPI_COMPILE_OPTION "${_MPI_COMPILE_OPTION}") + # Ignore -fstack-protector directives: These occur on MPICH and MVAPICH when the libraries + # themselves were built with this flag. However, this flag is unrelated to using MPI, and + # we won't match the accompanying --param-ssp-size and -Wp,-D_FORTIFY_SOURCE flags and therefore + # produce inconsistent results with the regularly flags. + # Similarly, aliasing flags do not belong into our flag array. + if(NOT "${_MPI_COMPILE_OPTION}" MATCHES "^-f(stack-protector|(no-|)strict-aliasing|PI[CE]|pi[ce])") + list(APPEND MPI_COMPILE_OPTIONS_WORK "${_MPI_COMPILE_OPTION}") + endif() + endforeach() + + # Same deal, with the definitions. We also treat arguments passed to the preprocessor directly. + string(REGEX MATCHALL "(^| )(-Wp,|-Xpreprocessor |)[-/]D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_DEFINITIONS "${MPI_COMPILE_CMDLINE}") + + foreach(_MPI_COMPILE_DEFINITION IN LISTS MPI_ALL_COMPILE_DEFINITIONS) + string(REGEX REPLACE "^ ?(-Wp,|-Xpreprocessor )?[-/]D" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") + string(REPLACE "\"" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") + if(NOT "${_MPI_COMPILE_DEFINITION}" MATCHES "^_FORTIFY_SOURCE.*") + list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${_MPI_COMPILE_DEFINITION}") + endif() + endforeach() + + # Extract include paths from compile command line + string(REGEX MATCHALL "(^| )[-/]I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") + + # If extracting failed to work, we'll try using -showme:incdirs. + if (NOT MPI_ALL_INCLUDE_PATHS) + _MPI_check_compiler(${LANG} "-showme:incdirs" MPI_INCDIRS_CMDLINE MPI_INCDIRS_COMPILER_RETURN) + if(MPI_INCDIRS_COMPILER_RETURN) + separate_arguments(MPI_ALL_INCLUDE_PATHS NATIVE_COMMAND "${MPI_INCDIRS_CMDLINE}") + endif() + endif() + + foreach(_MPI_INCLUDE_PATH IN LISTS MPI_ALL_INCLUDE_PATHS) + string(REGEX REPLACE "^ ?[-/]I" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") + string(REPLACE "\"" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") + get_filename_component(_MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}" REALPATH) + list(APPEND MPI_INCLUDE_DIRS_WORK "${_MPI_INCLUDE_PATH}") + endforeach() + + # Extract linker paths from the link command line + string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker |)(-L|[/-]LIBPATH:|[/-]libpath:)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") + + # If extracting failed to work, we'll try using -showme:libdirs. + if (NOT MPI_ALL_LINK_PATHS) + _MPI_check_compiler(${LANG} "-showme:libdirs" MPI_LIBDIRS_CMDLINE MPI_LIBDIRS_COMPILER_RETURN) + if(MPI_LIBDIRS_COMPILER_RETURN) + separate_arguments(MPI_ALL_LINK_PATHS NATIVE_COMMAND "${MPI_LIBDIRS_CMDLINE}") + endif() + endif() + + foreach(_MPI_LPATH IN LISTS MPI_ALL_LINK_PATHS) + string(REGEX REPLACE "^ ?(-Wl,|-Xlinker )?(-L|[/-]LIBPATH:|[/-]libpath:)" "" _MPI_LPATH "${_MPI_LPATH}") + string(REPLACE "\"" "" _MPI_LPATH "${_MPI_LPATH}") + get_filename_component(_MPI_LPATH "${_MPI_LPATH}" REALPATH) + list(APPEND MPI_LINK_DIRECTORIES_WORK "${_MPI_LPATH}") + endforeach() + + # Extract linker flags from the link command line + string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") + + foreach(_MPI_LINK_FLAG IN LISTS MPI_ALL_LINK_FLAGS) + string(STRIP "${_MPI_LINK_FLAG}" _MPI_LINK_FLAG) + # MPI might be marked to build with non-executable stacks but this should not propagate. + if (NOT "${_MPI_LINK_FLAG}" MATCHES "(-Wl,|-Xlinker )-z,noexecstack") + if (MPI_LINK_FLAGS_WORK) + string(APPEND MPI_LINK_FLAGS_WORK " ${_MPI_LINK_FLAG}") else() - message(STATUS "Unable to determine MPI from MPI driver ${MPI_${lang}_COMPILER}") - set(MPI_COMPILE_CMDLINE) - set(MPI_LINK_CMDLINE) + set(MPI_LINK_FLAGS_WORK "${_MPI_LINK_FLAG}") endif() + endif() + endforeach() - # Here, we're done with the interrogation part, and we'll try to extract args we care - # about from what we learned from the compiler wrapper scripts. - - # If interrogation came back with something, extract our variable from the MPI command line - if (MPI_COMPILE_CMDLINE OR MPI_LINK_CMDLINE) - # Extract compile flags from the compile command line. - string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}") - set(MPI_COMPILE_FLAGS_WORK) + # Extract the set of libraries to link against from the link command + # line + string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") - 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}") - else() - set(MPI_COMPILE_FLAGS_WORK ${FLAG}) - endif() - endforeach() + foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) + string(REGEX REPLACE "^ ?-l" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) + if(NOT "${_MPI_LIB_PATH}" STREQUAL "") + list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") + else() + list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") + endif() + endforeach() - # Extract include paths from compile command line - string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") - set(MPI_INCLUDE_PATH_WORK) + if(WIN32) + # A compiler wrapper on Windows will just have the name of the + # library to link on its link line, potentially with a full path + string(REGEX MATCHALL "(^| )([^\" ]+\\.lib|\"[^\"]+\\.lib\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") + foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) + string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) + if(NOT "${_MPI_LIB_PATH}" STREQUAL "") + list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") + else() + list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") + endif() + endforeach() + else() + # On UNIX platforms, archive libraries can be given with full path. + string(REGEX MATCHALL "(^| )([^\" ]+\\.a|\"[^\"]+\\.a\")" MPI_LIBFULLPATHS "${MPI_LINK_CMDLINE}") + foreach(_MPI_LIB_NAME IN LISTS MPI_LIBFULLPATHS) + string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) + if(NOT "${_MPI_LIB_PATH}" STREQUAL "") + list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") + else() + list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") + endif() + endforeach() + endif() - 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() + # An MPI compiler wrapper could have its MPI libraries in the implictly + # linked directories of the compiler itself. + if(DEFINED CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) + list(APPEND MPI_LINK_DIRECTORIES_WORK "${CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES}") + endif() - # try using showme:incdirs if extracting didn't work. - if (NOT MPI_INCLUDE_PATH_WORK) - set(MPI_INCLUDE_PATH_WORK ${MPI_INCDIRS}) - separate_arguments(MPI_INCLUDE_PATH_WORK) - endif() + # Determine full path names for all of the libraries that one needs + # to link against in an MPI program + unset(MPI_PLAIN_LIB_NAMES_WORK) + foreach(_MPI_LIB_NAME IN LISTS MPI_LIB_NAMES_WORK) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_NAME}" NAME_WE) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${MPI_LINK_DIRECTORIES_WORK} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endforeach() - # If all else fails, just search for mpi.h in the normal include paths. - if (NOT MPI_INCLUDE_PATH_WORK) - set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_path(MPI_HEADER_PATH mpi.h - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include) - set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) - endif() + # Deal with the libraries given with full path next + unset(MPI_DIRECT_LIB_NAMES_WORK) + foreach(_MPI_LIB_FULLPATH IN LISTS MPI_LIB_FULLPATHS_WORK) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME) + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_FULLPATH}" DIRECTORY) + list(APPEND MPI_DIRECT_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_PATH} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endforeach() + if(MPI_DIRECT_LIB_NAMES_WORK) + set(MPI_PLAIN_LIB_NAMES_WORK "${MPI_DIRECT_LIB_NAMES_WORK};${MPI_PLAIN_LIB_NAMES_WORK}") + endif() - # Extract linker paths from the link command line - string(REGEX MATCHALL "(^| |-Wl,)(-L|/LIBPATH:)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") - set(MPI_LINK_PATH) - foreach(LPATH ${MPI_ALL_LINK_PATHS}) - string(REGEX REPLACE "^(| |-Wl,)(-L|/LIBPATH:)" "" LPATH ${LPATH}) - string(REPLACE "//" "/" LPATH ${LPATH}) - list(APPEND MPI_LINK_PATH ${LPATH}) - endforeach() + # MPI might require pthread to work. The above mechanism wouldn't detect it, but we need to + # link it in that case. -lpthread is covered by the normal library treatment on the other hand. + if("${MPI_COMPILE_CMDLINE}" MATCHES "-pthread") + list(APPEND MPI_COMPILE_OPTIONS_WORK "-pthread") + if(MPI_LINK_FLAGS_WORK) + string(APPEND MPI_LINK_FLAGS_WORK " -pthread") + else() + set(MPI_LINK_FLAGS_WORK "-pthread") + endif() + endif() - # try using showme:libdirs if extracting didn't work. - if (NOT MPI_LINK_PATH) - set(MPI_LINK_PATH ${MPI_LIBDIRS}) - separate_arguments(MPI_LINK_PATH) - endif() + # If we found MPI, set up all of the appropriate cache entries + if(NOT MPI_${LANG}_COMPILE_OPTIONS) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) + endif() + if(NOT MPI_${LANG}_COMPILE_DEFINITIONS) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_COMPILE_DEFINITIONS_WORK} CACHE STRING "MPI ${LANG} compilation definitions" FORCE) + endif() + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_INCLUDE_DIRS_WORK} CACHE STRING "MPI ${LANG} additional include directories" FORCE) + endif() + if(NOT MPI_${LANG}_LINK_FLAGS) + set(MPI_${LANG}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${LANG} linker flags" FORCE) + endif() + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES ${MPI_PLAIN_LIB_NAMES_WORK} CACHE STRING "MPI ${LANG} libraries to link against" FORCE) + endif() + set(MPI_${LANG}_WRAPPER_FOUND TRUE PARENT_SCOPE) +endfunction() - # Extract linker flags from the link command line - 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}") - else() - set(MPI_LINK_FLAGS_WORK ${FLAG}) - endif() - endforeach() +function(_MPI_guess_settings LANG) + set(MPI_GUESS_FOUND FALSE) + # Currently only MSMPI and MPICH2 on Windows are supported, so we can skip this search if we're not targeting that. + if(WIN32) + # MSMPI + + # The environment variables MSMPI_INC and MSMPILIB32/64 are the only ways of locating the MSMPI_SDK, + # which is installed separately from the runtime. Thus it's possible to have mpiexec but not MPI headers + # or import libraries and vice versa. + if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MSMPI") + # We first attempt to locate the msmpi.lib. Should be find it, we'll assume that the MPI present is indeed + # Microsoft MPI. + if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB64}") + set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x64") + else() + set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB32}") + set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x86") + endif() - # Extract the set of libraries to link against from the link command - # line - string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") - if(WIN32) - # The intel wrappers on windows link against static versions of the MPI libraries. - # The static libraries are simply listed on the command line without -l. - # For instance: " icl ... impi.lib " - string(REGEX MATCHALL "(^| )([^\" ]+)\\.lib" tmp "${MPI_LINK_CMDLINE}") - list(APPEND MPI_LIBNAMES ${tmp}) + find_library(MPI_msmpi_LIBRARY + NAMES msmpi + HINTS ${MPI_MSMPI_LIB_PATH} + DOC "Location of the msmpi library for Microsoft MPI") + mark_as_advanced(MPI_msmpi_LIBRARY) + + if(MPI_msmpi_LIBRARY) + # Next, we attempt to locate the MPI header. Note that for Fortran we know that mpif.h is a way + # MSMPI can be used and therefore that header has to be present. + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + get_filename_component(MPI_MSMPI_INC_DIR "$ENV{MSMPI_INC}" REALPATH) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MSMPI_INC_DIR}" CACHE STRING "MPI ${LANG} additional include directories" FORCE) + unset(MPI_MSMPI_INC_DIR) endif() - # add the compiler implicit directories because some compilers - # such as the intel compiler have libraries that show up - # 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}") - endif () - - # Determine full path names for all of the libraries that one needs - # to link against in an MPI program - foreach(LIB ${MPI_LIBNAMES}) - string(REGEX REPLACE "^ ?-l" "" LIB ${LIB}) - if(WIN32) - string(REGEX REPLACE "\\.lib$" "" LIB ${LIB}) + # For MSMPI, one can compile the MPI module by building the mpi.f90 shipped with the MSMPI SDK, + # thus it might be present or provided by the user. Figuring out which is supported is done later on. + # The PGI Fortran compiler for instance ships a prebuilt set of modules in its own include folder. + # Should a user be employing PGI or have built its own set and provided it via cache variables, the + # splitting routine would have located the module files. + + # For C and C++, we're done here (MSMPI does not ship the MPI-2 C++ bindings) - however, for Fortran + # we need some extra library to glue Fortran support together: + # MSMPI ships 2-4 Fortran libraries, each for different Fortran compiler behaviors. The library names + # ending with a c are using the cdecl calling convention, whereas those ending with an s are for Fortran + # implementations using stdcall. Therefore, the 64-bit MSMPI only ships those ending in 'c', whereas the 32-bit + # has both variants available. + # The second difference is the last but one letter, if it's an e(nd), the length of a string argument is + # passed by the Fortran compiler after all other arguments on the parameter list, if it's an m(ixed), + # it's passed immediately after the string address. + + # To summarize: + # - msmpifec: CHARACTER length passed after the parameter list and using cdecl calling convention + # - msmpifmc: CHARACTER length passed directly after string address and using cdecl calling convention + # - msmpifes: CHARACTER length passed after the parameter list and using stdcall calling convention + # - msmpifms: CHARACTER length passed directly after string address and using stdcall calling convention + # 32-bit MSMPI ships all four libraries, 64-bit MSMPI ships only the first two. + + # As is, Intel Fortran and PGI Fortran both use the 'ec' variant of the calling convention, whereas + # the old Compaq Visual Fortran compiler defaulted to the 'ms' version. It's possible to make Intel Fortran + # use the CVF calling convention using /iface:cvf, but we assume - and this is also assumed in FortranCInterface - + # this isn't the case. It's also possible to make CVF use the 'ec' variant, using /iface=(cref,nomixed_str_len_arg). + + # Our strategy is now to locate all libraries, but enter msmpifec into the LIB_NAMES array. + # Should this not be adequate it's a straightforward way for a user to change the LIB_NAMES array and + # have his library found. Still, this should not be necessary outside of exceptional cases, as reasoned. + if ("${LANG}" STREQUAL "Fortran") + set(MPI_MSMPI_CALLINGCONVS c) + if("${CMAKE_SIZEOF_VOID_P}" EQUAL 4) + list(APPEND MPI_MSMPI_CALLINGCONVS s) endif() - string(STRIP ${LIB} LIB) - # MPI_LIB is cached by find_library, but we don't want that. Clear it first. - set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_library(MPI_LIB NAMES ${LIB} HINTS ${MPI_LINK_PATH}) - - if (MPI_LIB) - list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) - elseif (NOT MPI_FIND_QUIETLY) - message(WARNING "Unable to find MPI library ${LIB}") + foreach(mpistrlenpos IN ITEMS e m) + foreach(mpicallingconv IN LISTS MPI_MSMPI_CALLINGCONVS) + find_library(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY + NAMES msmpif${mpistrlenpos}${mpicallingconv} + HINTS "${MPI_MSMPI_LIB_PATH}" + DOC "Location of the msmpi${mpistrlenpos}${mpicallingconv} library for Microsoft MPI") + mark_as_advanced(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY) + endforeach() + endforeach() + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES "msmpi;msmpifec" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) endif() - endforeach() - # Sanity check MPI_LIBRARIES to make sure there are enough libraries - list(LENGTH MPI_LIBRARIES_WORK MPI_NUMLIBS) - list(LENGTH MPI_LIBNAMES MPI_NUMLIBS_EXPECTED) - if (NOT MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED) - set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") + # At this point we're *not* done. MSMPI requires an additional include file for Fortran giving the value + # of MPI_AINT. This file is called mpifptr.h located in the x64 and x86 subfolders, respectively. + find_path(MPI_mpifptr_INCLUDE_DIR + NAMES "mpifptr.h" + HINTS "${MPI_MSMPI_INC_PATH_EXTRA}" + DOC "Location of the mpifptr.h extra header for Microsoft MPI") + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS "mpifptr" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) + endif() + mark_as_advanced(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS MPI_mpifptr_INCLUDE_DIR) + else() + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES "msmpi" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) + endif() endif() + mark_as_advanced(MPI_${LANG}_LIB_NAMES) + set(MPI_GUESS_FOUND TRUE) endif() + endif() - elseif(try_libs) - # If we didn't have an MPI compiler script to interrogate, attempt to find everything - # with plain old find functions. This is nasty because MPI implementations have LOTS of - # different library names, so this section isn't going to be very generic. We need to - # make sure it works for MS MPI, though, since there are no compiler wrappers for that. - find_path(MPI_HEADER_PATH mpi.h - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include Inc) - set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) - - # Decide between 32-bit and 64-bit libraries for Microsoft's MPI - if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) - set(MS_MPI_ARCH_DIR x64) - set(MS_MPI_ARCH_DIR2 amd64) - else() - set(MS_MPI_ARCH_DIR x86) - set(MS_MPI_ARCH_DIR2 i386) - endif() + # At this point there's not many MPIs that we could still consider. + # OpenMPI 1.6.x and below supported Windows, but these ship compiler wrappers that still work. + # The only other relevant MPI implementation without a wrapper is MPICH2, which had Windows support in 1.4.1p1 and older. + if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MPICH2") + set(MPI_MPICH_PREFIX_PATHS + "$ENV{ProgramW6432}/MPICH2/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/../lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]/lib" + ) - set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_library(MPI_LIB - NAMES mpi mpich mpich2 msmpi - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR} lib/${MS_MPI_ARCH_DIR2} Lib/${MS_MPI_ARCH_DIR2}) - set(MPI_LIBRARIES_WORK ${MPI_LIB}) - - # Right now, we only know about the extra libs for C++. - # We could add Fortran here (as there is usually libfmpich, etc.), but - # this really only has to work with MS MPI on Windows. - # Assume that other MPI's are covered by the compiler wrappers. - if (${lang} STREQUAL CXX) - set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_library(MPI_LIB - NAMES mpi++ mpicxx cxx mpi_cxx - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES lib) - if (MPI_LIBRARIES_WORK AND MPI_LIB) - list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) + # All of C, C++ and Fortran will need mpi.lib, so we'll look for this first + find_library(MPI_mpi_LIBRARY + NAMES mpi + HINTS ${MPI_MPICH_PREFIX_PATHS}) + mark_as_advanced(MPI_mpi_LIBRARY) + # If we found mpi.lib, we detect the rest of MPICH2 + if(MPI_mpi_LIBRARY) + set(MPI_MPICH_LIB_NAMES "mpi") + # If MPI-2 C++ bindings are requested, we need to locate cxx.lib as well. + # Otherwise, MPICH_SKIP_MPICXX will be defined and these bindings aren't needed. + if("${LANG}" STREQUAL "CXX" AND NOT MPI_CXX_SKIP_MPICXX) + find_library(MPI_cxx_LIBRARY + NAMES cxx + HINTS ${MPI_MPICH_PREFIX_PATHS}) + mark_as_advanced(MPI_cxx_LIBRARY) + list(APPEND MPI_MPICH_LIB_NAMES "cxx") + # For Fortran, MPICH2 provides three different libraries: + # fmpich2.lib which uses uppercase symbols and cdecl, + # fmpich2s.lib which uses uppercase symbols and stdcall (32-bit only), + # fmpich2g.lib which uses lowercase symbols with double underscores and cdecl. + # fmpich2s.lib would be useful for Compaq Visual Fortran, fmpich2g.lib has to be used with GNU g77 and is also + # provided in the form of an .a archive for MinGW and Cygwin. From our perspective, fmpich2.lib is the only one + # we need to try, and if it doesn't work with the given Fortran compiler we'd find out later on during validation + elseif("${LANG}" STREQUAL "Fortran") + find_library(MPI_fmpich2_LIBRARY + NAMES fmpich2 + HINTS ${MPI_MPICH_PREFIX_PATHS}) + find_library(MPI_fmpich2s_LIBRARY + NAMES fmpich2s + HINTS ${MPI_MPICH_PREFIX_PATHS}) + find_library(MPI_fmpich2g_LIBRARY + NAMES fmpich2g + HINTS ${MPI_MPICH_PREFIX_PATHS}) + mark_as_advanced(MPI_fmpich2_LIBRARY MPI_fmpich2s_LIBRARY MPI_fmpich2g_LIBRARY) + list(APPEND MPI_MPICH_LIB_NAMES "fmpich2") endif() - endif() - if (${lang} STREQUAL Fortran) - 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}) - if (MPI_INCLUDE_PATH_WORK AND MPI_HEADER_PATH) - list(APPEND MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) - endif () - - set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_library(MPI_LIB - NAMES fmpi fmpich fmpich2 fmpich2g msmpifec msmpifmc - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - 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 () - - if (NOT MPI_LIBRARIES_WORK) - set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES "${MPI_MPICH_LIB_NAMES}" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) + endif() + unset(MPI_MPICH_LIB_NAMES) + + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + # For MPICH2, the include folder would be in ../include relative to the library folder. + get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_mpi_LIBRARY}" DIRECTORY) + get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_MPICH_ROOT_DIR}" DIRECTORY) + if(IS_DIRECTORY "${MPI_MPICH_ROOT_DIR}/include") + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MPICH_ROOT_DIR}/include" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) + endif() + unset(MPI_MPICH_ROOT_DIR) + endif() + set(MPI_GUESS_FOUND TRUE) endif() + unset(MPI_MPICH_PREFIX_PATHS) endif() + endif() + set(MPI_${LANG}_GUESS_FOUND "${MPI_GUESS_FOUND}" PARENT_SCOPE) +endfunction() - # If we found MPI, set up all of the appropriate cache entries - set(MPI_${lang}_COMPILE_FLAGS ${MPI_COMPILE_FLAGS_WORK} CACHE STRING "MPI ${lang} compilation flags" FORCE) - set(MPI_${lang}_INCLUDE_PATH ${MPI_INCLUDE_PATH_WORK} CACHE STRING "MPI ${lang} include path" FORCE) - set(MPI_${lang}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${lang} linking flags" FORCE) - 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) +function(_MPI_adjust_compile_definitions LANG) + if("${LANG}" STREQUAL "CXX") + # To disable the C++ bindings, we need to pass some definitions since the mpi.h header has to deal with both C and C++ + # bindings in MPI-2. + if(MPI_CXX_SKIP_MPICXX AND NOT MPI_${LANG}_COMPILE_DEFINITIONS MATCHES "SKIP_MPICXX") + # MPICH_SKIP_MPICXX is being used in MPICH and derivatives like MVAPICH or Intel MPI + # OMPI_SKIP_MPICXX is being used in Open MPI + # _MPICC_H is being used for IBM Platform MPI + list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX" "OMPI_SKIP_MPICXX" "_MPICC_H") + set(MPI_${LANG}_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}" CACHE STRING "MPI ${LANG} compilation definitions" FORCE) + endif() + endif() +endfunction() + +macro(_MPI_assemble_libraries LANG) + set(MPI_${LANG}_LIBRARIES "") + foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) + endforeach() +endmacro() - # 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) +macro(_MPI_assemble_include_dirs LANG) + set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") + if("${LANG}" MATCHES "(C|CXX)") + if(MPI_${LANG}_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + else() # Fortran + if(MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + endif() + if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + endif() endif() + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}") + endforeach() + endif() +endmacro() - # finally set a found variable for each MPI language - if (MPI_${lang}_INCLUDE_PATH AND MPI_${lang}_LIBRARIES) - set(MPI_${lang}_FOUND TRUE PARENT_SCOPE) - else() - set(MPI_${lang}_FOUND FALSE PARENT_SCOPE) +function(_MPI_split_include_dirs LANG) + # Backwards compatibility: Search INCLUDE_PATH if given. + if(MPI_${LANG}_INCLUDE_PATH) + list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") endif() + + # We try to find the headers/modules among those paths (and system paths) + # For C/C++, we just need to have a look for mpi.h. + if("${LANG}" MATCHES "(C|CXX)") + find_path(MPI_${LANG}_HEADER_DIR "mpi.h" + HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} + ) + mark_as_advanced(MPI_${LANG}_HEADER_DIR) + if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + # Fortran is more complicated here: An implementation could provide + # any of the Fortran 77/90/2008 APIs for MPI. For example, MSMPI + # only provides Fortran 77 and - if mpi.f90 is built - potentially + # a Fortran 90 module. + elseif("${LANG}" STREQUAL "Fortran") + find_path(MPI_${LANG}_F77_HEADER_DIR "mpif.h" + HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} + ) + find_path(MPI_${LANG}_MODULE_DIR + NAMES "mpi.mod" "mpi_f08.mod" + HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} + ) + if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS + "${MPI_${LANG}_F77_HEADER_DIR}" + "${MPI_${LANG}_MODULE_DIR}" + ) + endif() + mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) + endif() + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) endfunction() +macro(_MPI_create_imported_target LANG) + if(NOT TARGET MPI::MPI_${LANG}) + add_library(MPI::MPI_${LANG} INTERFACE IMPORTED) + endif() + + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}") + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}") -# This function attempts to compile with the regular compiler, to see if MPI programs -# work with it. This is a last ditch attempt after we've tried interrogating mpicc and -# friends, and after we've tried to find generic libraries. Works on machines like -# Cray XE6, where the modules environment changes what MPI version cc, CC, and ftn use. -function(try_regular_compiler lang success) - set(scratch_directory ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}) - if (${lang} STREQUAL Fortran) - set(test_file ${scratch_directory}/cmake_mpi_test.f90) - file(WRITE ${test_file} - "program hello\n" - "include 'mpif.h'\n" - "integer ierror\n" - "call MPI_INIT(ierror)\n" - "call MPI_FINALIZE(ierror)\n" - "end\n") + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "") + if(MPI_${LANG}_LINK_FLAGS) + set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LINK_FLAGS}") + endif() + # If the compiler links MPI implicitly, no libraries will be found as they're contained within + # CMAKE__IMPLICIT_LINK_LIBRARIES already. + if(MPI_${LANG}_LIBRARIES) + set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LIBRARIES}") + endif() + # Given the new design of FindMPI, INCLUDE_DIRS will always be located, even under implicit linking. + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${MPI_${LANG}_INCLUDE_DIRS}") +endmacro() + +function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY) + set(WORK_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI") + set(SRC_DIR "${CMAKE_ROOT}/Modules/FindMPI") + set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI/${MPI_TEST_FILE_NAME}_${LANG}.bin") + unset(MPI_TEST_COMPILE_DEFINITIONS) + if("${LANG}" STREQUAL "Fortran") + if("${MODE}" STREQUAL "F90_MODULE") + set(MPI_Fortran_INCLUDE_LINE "use mpi\n implicit none") + elseif("${MODE}" STREQUAL "F08_MODULE") + set(MPI_Fortran_INCLUDE_LINE "use mpi_f08\n implicit none") + else() # F77 header + set(MPI_Fortran_INCLUDE_LINE "implicit none\n include 'mpif.h'") + endif() + configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.f90.in" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90" @ONLY) + set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90") + elseif("${LANG}" STREQUAL "CXX") + configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.c" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp" COPYONLY) + set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp") + if("${MODE}" STREQUAL "TEST_MPICXX") + set(MPI_TEST_COMPILE_DEFINITIONS TEST_MPI_MPICXX) + endif() + else() # C + set(MPI_TEST_SOURCE_FILE "${SRC_DIR}/${MPI_TEST_FILE_NAME}.c") + endif() + if(RUN_BINARY) + try_run(MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} + "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" + COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} + LINK_LIBRARIES MPI::MPI_${LANG} + RUN_OUTPUT_VARIABLE MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}) + set(MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} "${MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}}" PARENT_SCOPE) else() - if (${lang} STREQUAL CXX) - set(test_file ${scratch_directory}/cmake_mpi_test.cpp) - else() - set(test_file ${scratch_directory}/cmake_mpi_test.c) - endif() - file(WRITE ${test_file} - "#include \n" - "int main(int argc, char **argv) {\n" - " MPI_Init(&argc, &argv);\n" - " MPI_Finalize();\n" - "}\n") - endif() - try_compile(compiler_has_mpi ${scratch_directory} ${test_file}) - if (compiler_has_mpi) - set(MPI_${lang}_NO_INTERROGATE ${CMAKE_${lang}_COMPILER} CACHE STRING "Whether to interrogate MPI ${lang} compiler" FORCE) - set(MPI_${lang}_COMPILER ${CMAKE_${lang}_COMPILER} CACHE STRING "MPI ${lang} compiler" FORCE) - set(MPI_${lang}_COMPILE_FLAGS "" CACHE STRING "MPI ${lang} compilation flags" FORCE) - set(MPI_${lang}_INCLUDE_PATH "" CACHE STRING "MPI ${lang} include path" FORCE) - set(MPI_${lang}_LINK_FLAGS "" CACHE STRING "MPI ${lang} linking flags" FORCE) - set(MPI_${lang}_LIBRARIES "" CACHE STRING "MPI ${lang} libraries to link against" FORCE) - endif() - set(${success} ${compiler_has_mpi} PARENT_SCOPE) - unset(compiler_has_mpi CACHE) + try_compile(MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} + "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" + COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} + LINK_LIBRARIES MPI::MPI_${LANG} + COPY_FILE "${BIN_FILE}") + endif() endfunction() -# End definitions, commence real work here. +macro(_MPI_check_lang_works LANG) + # For Fortran we may have by the MPI-3 standard an implementation that provides: + # - the mpi_f08 module + # - *both*, the mpi module and 'mpif.h' + # Since older MPI standards (MPI-1) did not define anything but 'mpif.h', we need to check all three individually. + if( NOT MPI_${LANG}_WORKS ) + if("${LANG}" STREQUAL "Fortran") + set(MPI_Fortran_INTEGER_LINE "(kind=MPI_INTEGER_KIND)") + _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER FALSE) + _MPI_try_staged_settings(${LANG} test_mpi F90_MODULE FALSE) + _MPI_try_staged_settings(${LANG} test_mpi F08_MODULE FALSE) + + set(MPI_${LANG}_WORKS FALSE) + + foreach(mpimethod IN ITEMS F77_HEADER F08_MODULE F90_MODULE) + if(MPI_RESULT_${LANG}_test_mpi_${mpimethod}) + set(MPI_${LANG}_WORKS TRUE) + set(MPI_${LANG}_HAVE_${mpimethod} TRUE) + else() + set(MPI_${LANG}_HAVE_${mpimethod} FALSE) + endif() + endforeach() + # MPI-1 versions had no MPI_INTGER_KIND defined, so we need to try without it. + # However, MPI-1 also did not define the Fortran 90 and 08 modules, so we only try the F77 header. + unset(MPI_Fortran_INTEGER_LINE) + if(NOT MPI_${LANG}_WORKS) + _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER_NOKIND FALSE) + if(MPI_RESULT_${LANG}_test_mpi_F77_HEADER_NOKIND) + set(MPI_${LANG}_WORKS TRUE) + set(MPI_${LANG}_HAVE_F77_HEADER TRUE) + endif() + endif() + else() + _MPI_try_staged_settings(${LANG} test_mpi normal FALSE) + # If 'test_mpi' built correctly, we've found valid MPI settings. There might not be MPI-2 C++ support, but there can't + # be MPI-2 C++ support without the C bindings being present, so checking for them is sufficient. + set(MPI_${LANG}_WORKS "${MPI_RESULT_${LANG}_test_mpi_normal}") + endif() + endif() +endmacro() + +# Some systems install various MPI implementations in separate folders in some MPI prefix +# This macro enumerates all such subfolders and adds them to the list of hints that will be searched. +macro(MPI_search_mpi_prefix_folder PREFIX_FOLDER) + if(EXISTS "${PREFIX_FOLDER}") + file(GLOB _MPI_folder_children RELATIVE "${PREFIX_FOLDER}" "${PREFIX_FOLDER}/*") + foreach(_MPI_folder_child IN LISTS _MPI_folder_children) + if(IS_DIRECTORY "${PREFIX_FOLDER}/${_MPI_folder_child}") + list(APPEND MPI_HINT_DIRS "${PREFIX_FOLDER}/${_MPI_folder_child}") + endif() + endforeach() + endif() +endmacro() + +set(MPI_HINT_DIRS ${MPI_HOME} $ENV{MPI_HOME} $ENV{I_MPI_ROOT}) +if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") + # SUSE Linux Enterprise Server stores its MPI implementations under /usr/lib64/mpi/gcc/ + # We enumerate the subfolders and append each as a prefix + MPI_search_mpi_prefix_folder("/usr/lib64/mpi/gcc") +elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") + # MSMPI stores its runtime in a special folder, this adds the possible locations to the hints. + list(APPEND MPI_HINT_DIRS $ENV{MSMPI_BIN} "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]") +elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") + # FreeBSD ships mpich under the normal system paths - but available openmpi implementations + # will be found in /usr/local/mpi/ + MPI_search_mpi_prefix_folder("/usr/local/mpi/") +endif() -# Most mpi distros have some form of mpiexec which gives us something we can reliably look for. -find_program(MPIEXEC - NAMES ${_MPI_EXEC_NAMES} - HINTS ${MPI_HOME} $ENV{MPI_HOME} - PATHS ${_MPI_PREFIX_PATH} - PATH_SUFFIXES bin +# Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. +# The MPI standard does not mandate the existence of either, but instead only makes requirements if a distribution +# ships an mpiexec program (mpirun executables are not regulated by the standard). +find_program(MPIEXEC_EXECUTABLE + NAMES ${_MPIEXEC_NAMES} + PATH_SUFFIXES bin sbin + HINTS ${MPI_HINT_DIRS} DOC "Executable for running MPI programs.") # call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin). # This gives us a fairly reliable base directory to search for /bin /lib and /include from. -get_filename_component(_MPI_BASE_DIR "${MPIEXEC}" PATH) +get_filename_component(_MPI_BASE_DIR "${MPIEXEC_EXECUTABLE}" PATH) get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH) # 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 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) +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 be placed after all flags passed to mpiexec.") +# Set the number of processes to the physical processor count +cmake_host_system_information(RESULT _MPIEXEC_NUMPROCS QUERY NUMBER_OF_PHYSICAL_CORES) +set(MPIEXEC_MAX_NUMPROCS "${_MPIEXEC_NUMPROCS}" CACHE STRING "Maximum number of processors available to run MPI applications.") +unset(_MPIEXEC_NUMPROCS) +mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) #============================================================================= # Backward compatibility input hacks. Propagate the FindMPI hints to C and # CXX if the respective new versions are not defined. Translate the old -# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${lang}_LIBRARIES. +# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${LANG}_LIBRARIES. # # Once we find the new variables, we translate them back into their old # equivalents below. -foreach (lang C CXX) +foreach (LANG IN ITEMS C CXX) # Old input variables. set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) # Set new vars based on their old equivalents, if the new versions are not already set. foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${lang}_${var} AND MPI_${var}) - set(MPI_${lang}_${var} "${MPI_${var}}") + if (NOT MPI_${LANG}_${var} AND MPI_${var}) + set(MPI_${LANG}_${var} "${MPI_${var}}") endif() endforeach() - # Special handling for MPI_LIBRARY and MPI_EXTRA_LIBRARY, which we nixed in the - # new FindMPI. These need to be merged into MPI__LIBRARIES - if (NOT MPI_${lang}_LIBRARIES AND (MPI_LIBRARY OR MPI_EXTRA_LIBRARY)) - set(MPI_${lang}_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY}) + # Chop the old compile flags into options and definitions + if(MPI_${LANG}_COMPILE_FLAGS) + unset(MPI_${LANG}_COMPILE_OPTIONS) + unset(MPI_${LANG}_COMPILE_DEFINITIONS) + separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") + foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) + if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") + list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") + else() + list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}") + endif() + endforeach() + unset(MPI_SEPARATE_FLAGS) + endif() + + # If a list of libraries was given, we'll split it into new-style cache variables + if(NOT MPI_${LANG}_LIB_NAMES) + foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) + get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endforeach() endif() endforeach() #============================================================================= +unset(MPI_VERSION) +unset(MPI_VERSION_MAJOR) +unset(MPI_VERSION_MINOR) + +unset(_MPI_MIN_VERSION) # This loop finds the compilers and sends them off for interrogation. -foreach (lang C CXX Fortran) - if (CMAKE_${lang}_COMPILER_WORKS) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (MPI_${lang}_COMPILER) - if (NOT IS_ABSOLUTE "${MPI_${lang}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER}) - set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(try_libs FALSE) +foreach(LANG IN ITEMS C CXX Fortran) + if(CMAKE_${LANG}_COMPILER_LOADED) + if(NOT MPI_FIND_COMPONENTS) + set(_MPI_FIND_${LANG} TRUE) + elseif( ${LANG} IN_LIST MPI_FIND_COMPONENTS) + set(_MPI_FIND_${LANG} TRUE) + elseif( ${LANG} STREQUAL CXX AND NOT MPI_CXX_SKIP_MPICXX AND MPICXX IN_LIST MPI_FIND_COMPONENTS ) + set(_MPI_FIND_${LANG} TRUE) else() - set(try_libs TRUE) + set(_MPI_FIND_${LANG} FALSE) endif() + else() + set(_MPI_FIND_${LANG} FALSE) + endif() + if(_MPI_FIND_${LANG}) + if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS ) + set(MPI_CXX_SKIP_MPICXX FALSE CACHE BOOL "If true, the MPI-2 C++ bindings are disabled using definitions.") + mark_as_advanced(MPI_CXX_SKIP_MPICXX) + endif() + if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) + if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) + # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. + # Cray PrgEnv. + _MPI_create_imported_target(${LANG}) + _MPI_check_lang_works(${LANG}) + + # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. + if(MPI_${LANG}_WORKS) + set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) + endif() + endif() - find_program(MPI_${lang}_COMPILER - NAMES ${_MPI_${lang}_COMPILER_NAMES} - HINTS ${_MPI_BASE_DIR}/bin - PATHS ${_MPI_PREFIX_PATH} - ) - interrogate_mpi_compiler(${lang} ${try_libs}) - mark_as_advanced(MPI_${lang}_COMPILER) + # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. + if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) + set(MPI_SKIP_COMPILER_WRAPPER TRUE) + endif() + if(NOT MPI_SKIP_COMPILER_WRAPPER) + if(MPI_${LANG}_COMPILER) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") + unset(MPI_${LANG}_COMPILER CACHE) + endif() + # If the user specifies a compiler, we don't want to try to search libraries either. + set(MPI_PINNED_COMPILER TRUE) + else() + set(MPI_PINNED_COMPILER FALSE) + endif() - # last ditch try -- if nothing works so far, just try running the regular compiler and - # see if we can create an MPI executable. - set(regular_compiler_worked 0) - if (NOT MPI_${lang}_LIBRARIES OR NOT MPI_${lang}_INCLUDE_PATH) - try_regular_compiler(${lang} regular_compiler_worked) - endif() + # If we have an MPI base directory, we'll try all compiler names in that one first. + # This should prevent mixing different MPI environments + if(_MPI_BASE_DIR) + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + HINTS ${_MPI_BASE_DIR} + NO_DEFAULT_PATH + DOC "MPI compiler for ${LANG}" + ) + endif() + + # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), + # we shall try searching in the default paths. + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + DOC "MPI compiler for ${LANG}" + ) + + if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + set(MPI_SKIP_GUESSING TRUE) + elseif(MPI_${LANG}_COMPILER) + _MPI_interrogate_compiler(${LANG}) + else() + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + endif() + else() + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + set(MPI_PINNED_COMPILER FALSE) + endif() - # add fortran mpi module path if ENV VAR exists - set (MPI_${lang}_INCLUDE_PATH "${MPI_${lang}_INCLUDE_PATH};$ENV{MPI_FORTRAN_MOD_DIR}") + if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) + # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the + # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. + if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) + set(MPI_${LANG}_WRAPPER_FOUND TRUE) + elseif(NOT MPI_SKIP_GUESSING) + _MPI_guess_settings(${LANG}) + endif() + endif() + endif() - set(MPI_${lang}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) - set(MPI_${lang}_FIND_REQUIRED ${MPI_FIND_REQUIRED}) - set(MPI_${lang}_FIND_VERSION ${MPI_FIND_VERSION}) - set(MPI_${lang}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) + _MPI_split_include_dirs(${LANG}) + if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + _MPI_assemble_include_dirs(${LANG}) + _MPI_assemble_libraries(${LANG}) + endif() + _MPI_adjust_compile_definitions(${LANG}) + # We always create imported targets even if they're empty + _MPI_create_imported_target(${LANG}) - if (regular_compiler_worked) - find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_COMPILER) - else() - find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_LIBRARIES MPI_${lang}_INCLUDE_PATH) + if(NOT MPI_${LANG}_WORKS) + _MPI_check_lang_works(${LANG}) endif() - if(MPI_${lang}_FOUND) - if(NOT TARGET MPI::MPI_${lang}) - add_library(MPI::MPI_${lang} INTERFACE IMPORTED) + # Next, we'll initialize the MPI variables that have not been previously set. + set(MPI_${LANG}_COMPILE_OPTIONS "" CACHE STRING "MPI ${LANG} compilation flags" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS + MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) + + # If we've found MPI, then we'll perform additional analysis: Determine the MPI version, MPI library version, supported + # MPI APIs (i.e. MPI-2 C++ bindings). For Fortran we also need to find specific parameters if we're under MPI-3. + if(MPI_${LANG}_WORKS) + if("${LANG}" STREQUAL "CXX" AND NOT DEFINED MPI_MPICXX_FOUND) + if(NOT MPI_CXX_SKIP_MPICXX AND NOT MPI_CXX_VALIDATE_SKIP_MPICXX) + _MPI_try_staged_settings(${LANG} test_mpi MPICXX FALSE) + if(MPI_RESULT_${LANG}_test_mpi_MPICXX) + set(MPI_MPICXX_FOUND TRUE) + else() + set(MPI_MPICXX_FOUND FALSE) + endif() + else() + set(MPI_MPICXX_FOUND FALSE) + endif() + endif() + + # At this point, we know the bindings present but not the MPI version or anything else. + if(NOT DEFINED MPI_${LANG}_VERSION) + unset(MPI_${LANG}_VERSION_MAJOR) + unset(MPI_${LANG}_VERSION_MINOR) + endif() + set(MPI_BIN_FOLDER ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI) + + # For Fortran, we'll want to use the most modern MPI binding to test capabilities other than the + # Fortran parameters, since those depend on the method of consumption. + # For C++, we can always use the C bindings, and should do so, since the C++ bindings do not exist in MPI-3 + # whereas the C bindings do, and the C++ bindings never offered any feature advantage over their C counterparts. + if("${LANG}" STREQUAL "Fortran") + if(MPI_${LANG}_HAVE_F08_MODULE) + set(MPI_${LANG}_HIGHEST_METHOD F08_MODULE) + elseif(MPI_${LANG}_HAVE_F90_MODULE) + set(MPI_${LANG}_HIGHEST_METHOD F90_MODULE) + else() + set(MPI_${LANG}_HIGHEST_METHOD F77_HEADER) + endif() + + # Another difference between C and Fortran is that we can't use the preprocessor to determine whether MPI_VERSION + # and MPI_SUBVERSION are provided. These defines did not exist in MPI 1.0 and 1.1 and therefore might not + # exist. For C/C++, test_mpi.c will handle the MPI_VERSION extraction, but for Fortran, we need mpiver.f90. + if(NOT DEFINED MPI_${LANG}_VERSION) + _MPI_try_staged_settings(${LANG} mpiver ${MPI_${LANG}_HIGHEST_METHOD} FALSE) + if(MPI_RESULT_${LANG}_mpiver_${MPI_${LANG}_HIGHEST_METHOD}) + file(STRINGS ${MPI_BIN_FOLDER}/mpiver_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") + if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") + set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") + set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") + endif() + endif() + endif() + + # Finally, we want to find out which capabilities a given interface supports, compare the MPI-3 standard. + # This is determined by interface specific parameters MPI_SUBARRAYS_SUPPORTED and MPI_ASYNC_PROTECTS_NONBLOCKING + # and might vary between the different methods of consumption. + if(MPI_DETERMINE_Fortran_CAPABILITIES AND NOT MPI_Fortran_CAPABILITIES_DETERMINED) + foreach(mpimethod IN ITEMS F08_MODULE F90_MODULE F77_HEADER) + if(MPI_${LANG}_HAVE_${mpimethod}) + set(MPI_${LANG}_${mpimethod}_SUBARRAYS FALSE) + set(MPI_${LANG}_${mpimethod}_ASYNCPROT FALSE) + _MPI_try_staged_settings(${LANG} fortranparam_mpi ${mpimethod} TRUE) + if(MPI_RESULT_${LANG}_fortranparam_mpi_${mpimethod} AND + NOT "${MPI_RUN_RESULT_${LANG}_fortranparam_mpi_${mpimethod}}" STREQUAL "FAILED_TO_RUN") + if("${MPI_RUN_OUTPUT_${LANG}_fortranparam_mpi_${mpimethod}}" MATCHES + ".*INFO:SUBARRAYS\\[ *([TF]) *\\]-ASYNCPROT\\[ *([TF]) *\\].*") + if("${CMAKE_MATCH_1}" STREQUAL "T") + set(MPI_${LANG}_${mpimethod}_SUBARRAYS TRUE) + endif() + if("${CMAKE_MATCH_2}" STREQUAL "T") + set(MPI_${LANG}_${mpimethod}_ASYNCPROT TRUE) + endif() + endif() + endif() + endif() + endforeach() + set(MPI_Fortran_CAPABILITIES_DETERMINED TRUE) + endif() + else() + set(MPI_${LANG}_HIGHEST_METHOD normal) + + # By the MPI-2 standard, MPI_VERSION and MPI_SUBVERSION are valid for both C and C++ bindings. + if(NOT DEFINED MPI_${LANG}_VERSION) + file(STRINGS ${MPI_BIN_FOLDER}/test_mpi_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") + if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") + set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") + set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") + endif() + endif() 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}") + + unset(MPI_BIN_FOLDER) + + # At this point, we have dealt with determining the MPI version and parameters for each Fortran method available. + # The one remaining issue is to determine which MPI library is installed. + # Determining the version and vendor of the MPI library is only possible via MPI_Get_library_version() at runtime, + # and therefore we cannot do this while cross-compiling (a user may still define MPI__LIBRARY_VERSION_STRING + # themselves and we'll attempt splitting it, which is equivalent to provide the try_run output). + # It's also worth noting that the installed version string can depend on the language, or on the system the binary + # runs on if MPI is not statically linked. + if(MPI_DETERMINE_LIBRARY_VERSION AND NOT MPI_${LANG}_LIBRARY_VERSION_STRING) + _MPI_try_staged_settings(${LANG} libver_mpi ${MPI_${LANG}_HIGHEST_METHOD} TRUE) + if(MPI_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD} AND + "${MPI_RUN_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" EQUAL "0") + string(STRIP "${MPI_RUN_OUTPUT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" + MPI_${LANG}_LIBRARY_VERSION_STRING) + else() + set(MPI_${LANG}_LIBRARY_VERSION_STRING "NOTFOUND") + endif() endif() + endif() - unset(_MPI_${lang}_LINK_LINE) - if(MPI_${lang}_LINK_FLAGS) - list(APPEND _MPI_${lang}_LINK_LINE "${MPI_${lang}_LINK_FLAGS}") + set(MPI_${LANG}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) + set(MPI_${LANG}_FIND_VERSION ${MPI_FIND_VERSION}) + set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) + + unset(MPI_${LANG}_REQUIRED_VARS) + if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND) + foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") + endforeach() + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_LIB_NAMES") + if("${LANG}" STREQUAL "Fortran") + # For Fortran we only need one of the module or header directories to have *some* support for MPI. + if(NOT MPI_${LANG}_MODULE_DIR) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_F77_HEADER_DIR") + endif() + if(NOT MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_MODULE_DIR") + endif() + else() + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_HEADER_DIR") + endif() + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(mpiincvar IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpiincvar}_INCLUDE_DIR") + endforeach() + endif() + # Append the works variable now. If the settings did not work, this will show up properly. + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") + else() + # If the compiler worked implicitly, use its path as output. + # Should the compiler variable be set, we also require it to work. + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_COMPILER") + if(MPI_${LANG}_COMPILER) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") endif() - list(APPEND _MPI_${lang}_LINK_LINE "${MPI_${lang}_LIBRARIES}") - set_property(TARGET MPI::MPI_${lang} PROPERTY - INTERFACE_LINK_LIBRARIES "${_MPI_${lang}_LINK_LINE}") + endif() + find_package_handle_standard_args(MPI_${LANG} REQUIRED_VARS ${MPI_${LANG}_REQUIRED_VARS} + VERSION_VAR MPI_${LANG}_VERSION) - set_property(TARGET MPI::MPI_${lang} PROPERTY - INTERFACE_INCLUDE_DIRECTORIES "${MPI_${lang}_INCLUDE_PATH}") + if(DEFINED MPI_${LANG}_VERSION) + if(NOT _MPI_MIN_VERSION OR _MPI_MIN_VERSION VERSION_GREATER MPI_${LANG}_VERSION) + set(_MPI_MIN_VERSION MPI_${LANG}_VERSION) + endif() endif() endif() endforeach() +unset(_MPI_REQ_VARS) +foreach(LANG IN ITEMS C CXX Fortran) + if((NOT MPI_FIND_COMPONENTS AND CMAKE_${LANG}_COMPILER_LOADED) OR LANG IN_LIST MPI_FIND_COMPONENTS) + list(APPEND _MPI_REQ_VARS "MPI_${LANG}_FOUND") + endif() +endforeach() + +if(MPICXX IN_LIST MPI_FIND_COMPONENTS) + list(APPEND _MPI_REQ_VARS "MPI_MPICXX_FOUND") +endif() + +find_package_handle_standard_args(MPI + REQUIRED_VARS ${_MPI_REQ_VARS} + VERSION_VAR ${_MPI_MIN_VERSION} + HANDLE_COMPONENTS) #============================================================================= # More backward compatibility stuff -# -# Bare MPI sans ${lang} vars are set to CXX then C, depending on what was found. + +# For compatibility reasons, we also define MPIEXEC +set(MPIEXEC "${MPIEXEC_EXECUTABLE}") + +# Copy over MPI__INCLUDE_PATH from the assembled INCLUDE_DIRS. +foreach(LANG IN ITEMS C CXX Fortran) + if(MPI_${LANG}_FOUND) + set(MPI_${LANG}_INCLUDE_PATH "${MPI_${LANG}_INCLUDE_DIRS}") + unset(MPI_${LANG}_COMPILE_FLAGS) + if(MPI_${LANG}_COMPILE_OPTIONS) + set(MPI_${LANG}_COMPILE_FLAGS "${MPI_${LANG}_COMPILE_OPTIONS}") + endif() + if(MPI_${LANG}_COMPILE_DEFINITIONS) + foreach(_MPI_DEF IN LISTS MPI_${LANG}_COMPILE_DEFINITIONS) + string(APPEND MPI_${LANG}_COMPILE_FLAGS " -D${_MPI_DEF}") + endforeach() + endif() + endif() +endforeach() + +# Bare MPI sans ${LANG} vars are set to CXX then C, depending on what was found. # This mimics the behavior of the old language-oblivious FindMPI. -set(_MPI_OLD_VARS FOUND COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES) +set(_MPI_OLD_VARS COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES) if (MPI_CXX_FOUND) foreach (var ${_MPI_OLD_VARS}) set(MPI_${var} ${MPI_CXX_${var}}) @@ -704,28 +1428,26 @@ elseif (MPI_C_FOUND) foreach (var ${_MPI_OLD_VARS}) set(MPI_${var} ${MPI_C_${var}}) endforeach() -else() - # Note that we might still have found Fortran, but you'll need to use MPI_Fortran_FOUND - set(MPI_FOUND FALSE) endif() # Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and MPI_EXTRA_LIBRARY, and set them in cache. if (MPI_LIBRARIES) list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK) - set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE) + set(MPI_LIBRARY "${MPI_LIBRARY_WORK}") + unset(MPI_LIBRARY_WORK) else() - set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE) + set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND") endif() list(LENGTH MPI_LIBRARIES MPI_NUMLIBS) if (MPI_NUMLIBS GREATER 1) - set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES}) + set(MPI_EXTRA_LIBRARY_WORK "${MPI_LIBRARIES}") list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0) - set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY_WORK} CACHE STRING "Extra MPI libraries to link against" FORCE) + set(MPI_EXTRA_LIBRARY "${MPI_EXTRA_LIBRARY_WORK}") + unset(MPI_EXTRA_LIBRARY_WORK) else() - set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE) + set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") endif() -mark_as_advanced(MPI_LIBRARY MPI_EXTRA_LIBRARY) #============================================================================= # unset these vars to cleanup namespace @@ -733,5 +1455,7 @@ unset(_MPI_OLD_VARS) unset(_MPI_PREFIX_PATH) unset(_MPI_BASE_DIR) foreach (lang C CXX Fortran) - unset(_MPI_${lang}_COMPILER_NAMES) + unset(_MPI_${LANG}_COMPILER_NAMES) endforeach() + +cmake_policy(POP) diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index 3403571..b130f30 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -153,8 +153,8 @@ if (HDF5_ENABLE_F2003) 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} $) + add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${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} $) + add_test (NAME f90_ex-shared_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endif () endif () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 4a723c7..51db4f0 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -241,9 +241,9 @@ endif () add_library (${HDF5_F90_LIB_TARGET} STATIC ${f90_F_SOURCES}) set (SHARED_LINK_FLAGS " ") TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - target_link_libraries (${HDF5_F90_LIB_TARGET} MPI::MPI_Fortran) + target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) 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) @@ -268,9 +268,9 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") 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}) + target_link_libraries (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_Fortran_LIBS}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - target_link_libraries (${HDF5_F90_LIBSH_TARGET} MPI::MPI_Fortran) + target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) 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}) diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 909cbaf..4aa7f43 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -4,7 +4,7 @@ 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) +set (TESTPAR_INCLUDES ${MPI_Fortran_INCLUDE_DIRS} ${CMAKE_Fortran_MODULE_DIRECTORY}/static ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Add Tests @@ -27,7 +27,7 @@ target_link_libraries (parallel_test if (WIN32 AND MSVC) target_link_libraries (parallel_test "ws2_32.lib") endif () -target_include_directories (parallel_test PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +target_include_directories (parallel_test PRIVATE ${TESTPAR_INCLUDES}) set_target_properties (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (parallel_test PROPERTIES FOLDER test/fortran) diff --git a/fortran/testpar/CMakeTests.cmake b/fortran/testpar/CMakeTests.cmake index 5736256..d00a6fc 100644 --- a/fortran/testpar/CMakeTests.cmake +++ b/fortran/testpar/CMakeTests.cmake @@ -15,4 +15,4 @@ ### T E S T I N G ### ############################################################################## ############################################################################## -add_test (NAME FORT_parallel_test COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) +add_test (NAME FORT_parallel_test COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1651b15..4be86a9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -881,13 +881,12 @@ set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS}) +target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${LINK_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIB_TARGET} PRIVATE dl) + target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (${HDF5_LIB_TARGET} PRIVATE ${MPI_C_INCLUDE_PATH}) - target_link_libraries (${HDF5_LIB_TARGET} PRIVATE MPI::MPI_C}) + target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) @@ -931,8 +930,7 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (${HDF5_LIBSH_TARGET} PRIVATE ${MPI_C_INCLUDE_PATH}) - target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE MPI::MPI_C) + target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) 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}) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 0c9f70e..b116d66 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -30,14 +30,14 @@ set (testphdf5_SOURCES add_executable (testphdf5 ${testphdf5_SOURCES}) TARGET_NAMING (testphdf5 STATIC) TARGET_C_PROPERTIES (testphdf5 STATIC " " " ") -target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") - target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) + target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${file} PROPERTIES FOLDER test/par) ENDMACRO (ADD_H5P_EXE file) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 6e2b05e..87470f3 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -16,10 +16,10 @@ ############################################################################## ############################################################################## -add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) +add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) foreach (testp ${H5P_TESTS}) - add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endforeach () # The following will only be correct on windows shared diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index d87a47f..bbc39d8 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -447,7 +447,7 @@ 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}) + add_test (NAME PH5DIFF-${resultfile} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS} ${ARGN}) 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") @@ -470,7 +470,7 @@ add_test ( NAME PH5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$" + -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$;${MPIEXEC_POSTFLAGS}" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles" -D "TEST_OUTPUT=${resultfile}.out" diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake index 1f67abe..450667a 100644 --- a/tools/test/perform/CMakeTests.cmake +++ b/tools/test/perform/CMakeTests.cmake @@ -170,9 +170,9 @@ endif () set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_zip_perf_help;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} $) + add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${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} $) + add_test (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endif () endif () -- cgit v0.12 From 9aa8e01e5cf6062f71a6d65dfd76061899ab4a03 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Nov 2017 13:45:44 -0500 Subject: Remove duplicated module --- config/cmake_ext_mod/FindMPI.cmake | 1461 ------------------------------------ 1 file changed, 1461 deletions(-) delete mode 100644 config/cmake_ext_mod/FindMPI.cmake diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake deleted file mode 100644 index 61ab4a4..0000000 --- a/config/cmake_ext_mod/FindMPI.cmake +++ /dev/null @@ -1,1461 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details. - -#.rst: -# FindMPI -# ------- -# -# Find a Message Passing Interface (MPI) implementation. -# -# 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. -# -# Variables for using MPI -# ^^^^^^^^^^^^^^^^^^^^^^^ -# -# The module exposes the components ``C``, ``CXX``, ``MPICXX`` and ``Fortran``. -# Each of these controls the various MPI languages to search for. -# The difference between ``CXX`` and ``MPICXX`` is that ``CXX`` refers to the -# MPI C API being usable from C++, whereas ``MPICXX`` refers to the MPI-2 C++ API -# that was removed again in MPI-3. -# -# Depending on the enabled components the following variables will be set: -# -# ``MPI_FOUND`` -# Variable indicating that MPI settings for all requested languages have been found. -# If no components are specified, this is true if MPI settings for all enabled languages -# were detected. Note that the ``MPICXX`` component does not affect this variable. -# ``MPI_VERSION`` -# Minimal version of MPI detected among the requested languages, or all enabled languages -# if no components were specified. -# -# This module will set the following variables per language in your -# project, where ```` is one of C, CXX, or Fortran: -# -# ``MPI__FOUND`` -# Variable indicating the MPI settings for ```` were found and that -# simple MPI test programs compile with the provided settings. -# ``MPI__COMPILER`` -# MPI compiler for ```` if such a program exists. -# ``MPI__COMPILE_OPTIONS`` -# Compilation options for MPI programs in ````, given as a :ref:`;-list `. -# ``MPI__COMPILE_DEFINITIONS`` -# Compilation definitions for MPI programs in ````, given as a :ref:`;-list `. -# ``MPI__INCLUDE_DIRS`` -# 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 ````. -# -# The following variables indicating which bindings are present will be defined: -# -# ``MPI_MPICXX_FOUND`` -# Variable indicating whether the MPI-2 C++ bindings are present (introduced in MPI-2, removed with MPI-3). -# ``MPI_Fortran_HAVE_F77_HEADER`` -# True if the Fortran 77 header ``mpif.h`` is available. -# ``MPI_Fortran_HAVE_F90_MODULE`` -# True if the Fortran 90 module ``mpi`` can be used for accessing MPI (MPI-2 and higher only). -# ``MPI_Fortran_HAVE_F08_MODULE`` -# True if the Fortran 2008 ``mpi_f08`` is available to MPI programs (MPI-3 and higher only). -# -# If possible, the MPI version will be determined by this module. The facilities to detect the MPI version -# were introduced with MPI-1.2, and therefore cannot be found for older MPI versions. -# -# ``MPI__VERSION_MAJOR`` -# Major version of MPI implemented for ```` by the MPI distribution. -# ``MPI__VERSION_MINOR`` -# Minor version of MPI implemented for ```` by the MPI distribution. -# ``MPI__VERSION`` -# MPI version implemented for ```` by the MPI distribution. -# -# Note that there's no variable for the C bindings being accessible through ``mpi.h``, since the MPI standards -# always have required this binding to work in both C and C++ code. -# -# For running MPI programs, the module sets the following variables -# -# ``MPIEXEC_EXECUTABLE`` -# Executable for running MPI programs, if such exists. -# ``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. -# -# Variables for locating MPI -# ^^^^^^^^^^^^^^^^^^^^^^^^^^ -# -# This module performs a three step search for an MPI implementation: -# -# 1. Check if the compiler has MPI support built-in. This is the case if the user passed a -# compiler wrapper as ``CMAKE__COMPILER`` or if they're on a Cray system. -# 2. Attempt to find an MPI compiler wrapper and determine the compiler information from it. -# 3. Try to find an MPI implementation that does not ship such a wrapper by guessing settings. -# Currently, only Microsoft MPI and MPICH2 on Windows are supported. -# -# For controlling the second step, the following variables may be set: -# -# ``MPI__COMPILER`` -# Search for the specified compiler wrapper and use it. -# ``MPI__COMPILER_FLAGS`` -# Flags to pass to the MPI compiler wrapper during interrogation. Some compiler wrappers -# support linking debug or tracing libraries if a specific flag is passed and this variable -# may be used to obtain them. -# ``MPI_COMPILER_FLAGS`` -# Used to initialize ``MPI__COMPILER_FLAGS`` if no language specific flag has been given. -# Empty by default. -# ``MPI_EXECUTABLE_SUFFIX`` -# A suffix which is appended to all names that are being looked for. For instance you may set this -# to ``.mpich`` or ``.openmpi`` to prefer the one or the other on Debian and its derivatives. -# -# In order to control the guessing step, the following variable may be set: -# -# ``MPI_GUESS_LIBRARY_NAME`` -# Valid values are ``MSMPI`` and ``MPICH2``. If set, only the given library will be searched for. -# By default, ``MSMPI`` will be preferred over ``MPICH2`` if both are available. -# This also sets ``MPI_SKIP_COMPILER_WRAPPER`` to ``true``, which may be overridden. -# -# Each of the search steps may be skipped with the following control variables: -# -# ``MPI_ASSUME_NO_BUILTIN_MPI`` -# If true, the module assumes that the compiler itself does not provide an MPI implementation and -# skips to step 2. -# ``MPI_SKIP_COMPILER_WRAPPER`` -# If true, no compiler wrapper will be searched for. -# ``MPI_SKIP_GUESSING`` -# If true, the guessing step will be skipped. -# -# Additionally, the following control variable is available to change search behavior: -# -# ``MPI_CXX_SKIP_MPICXX`` -# Add some definitions that will disable the MPI-2 C++ bindings. -# Currently supported are MPICH, Open MPI, Platform MPI and derivatives thereof, -# for example MVAPICH or Intel MPI. -# -# If the find procedure fails for a variable ``MPI__WORKS``, then the settings detected by or passed to -# the module did not work and even a simple MPI test program failed to compile. -# -# If all of these parameters were not sufficient to find the right MPI implementation, a user may -# disable the entire autodetection process by specifying both a list of libraries in ``MPI__LIBRARIES`` -# and a list of include directories in ``MPI__ADDITIONAL_INCLUDE_DIRS``. -# Any other variable may be set in addition to these two. The module will then validate the MPI settings and store the -# settings in the cache. -# -# Cache variables for MPI -# ^^^^^^^^^^^^^^^^^^^^^^^ -# -# The variable ``MPI__INCLUDE_DIRS`` will be assembled from the following variables. -# For C and CXX: -# -# ``MPI__HEADER_DIR`` -# Location of the ``mpi.h`` header on disk. -# -# For Fortran: -# -# ``MPI_Fortran_F77_HEADER_DIR`` -# Location of the Fortran 77 header ``mpif.h``, if it exists. -# ``MPI_Fortran_MODULE_DIR`` -# Location of the ``mpi`` or ``mpi_f08`` modules, if available. -# -# For all languages the following variables are additionally considered: -# -# ``MPI__ADDITIONAL_INCLUDE_DIRS`` -# A :ref:`;-list ` of paths needed in addition to the normal include directories. -# ``MPI__INCLUDE_DIR`` -# Path variables for include folders referred to by ````. -# ``MPI__ADDITIONAL_INCLUDE_VARS`` -# A :ref:`;-list ` of ```` that will be added to the include locations of ````. -# -# The variable ``MPI__LIBRARIES`` will be assembled from the following variables: -# -# ``MPI__LIBRARY`` -# The location of a library called ```` for use with MPI. -# ``MPI__LIB_NAMES`` -# A :ref:`;-list ` of ```` that will be added to the include locations of ````. -# -# Usage of mpiexec -# ^^^^^^^^^^^^^^^^ -# -# When using ``MPIEXEC_EXECUTABLE`` to execute MPI applications, you should typically -# use all of the ``MPIEXEC_EXECUTABLE`` flags as follows: -# -# :: -# -# ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} -# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS -# -# where ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to -# pass to the MPI program. -# -# Advanced variables for using MPI -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# -# The module can perform some advanced feature detections upon explicit request. -# -# **Important notice:** The following checks cannot be performed without *executing* an MPI test program. -# Consider the special considerations for the behavior of :command:`try_run` during cross compilation. -# Moreover, running an MPI program can cause additional issues, like a firewall notification on some systems. -# You should only enable these detections if you absolutely need the information. -# -# If the following variables are set to true, the respective search will be performed: -# -# ``MPI_DETERMINE_Fortran_CAPABILITIES`` -# Determine for all available Fortran bindings what the values of ``MPI_SUBARRAYS_SUPPORTED`` and -# ``MPI_ASYNC_PROTECTS_NONBLOCKING`` are and make their values available as ``MPI_Fortran__SUBARRAYS`` -# and ``MPI_Fortran__ASYNCPROT``, where ```` is one of ``F77_HEADER``, ``F90_MODULE`` and -# ``F08_MODULE``. -# ``MPI_DETERMINE_LIBRARY_VERSION`` -# For each language, find the output of ``MPI_Get_library_version`` and make it available as ``MPI__LIBRARY_VERSION``. -# This information is usually tied to the runtime component of an MPI implementation and might differ depending on ````. -# Note that the return value is entirely implementation defined. This information might be used to identify -# the MPI vendor and for example pick the correct one of multiple third party binaries that matches the MPI vendor. -# -# Backward Compatibility -# ^^^^^^^^^^^^^^^^^^^^^^ -# -# For backward compatibility with older versions of FindMPI, these -# variables are set, but deprecated: -# -# :: -# -# MPI_COMPILER MPI_LIBRARY MPI_EXTRA_LIBRARY -# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_LINK_FLAGS -# MPI_LIBRARIES -# -# In new projects, please use the ``MPI__XXX`` equivalents. -# Additionally, the following variables are deprecated: -# -# ``MPI__COMPILE_FLAGS`` -# Use ``MPI__COMPILE_OPTIONS`` and ``MPI__COMPILE_DEFINITIONS`` instead. -# ``MPI__INCLUDE_PATH`` -# For consumption use ``MPI__INCLUDE_DIRS`` and for specifying folders use ``MPI__ADDITIONAL_INCLUDE_DIRS`` instead. -# ``MPIEXEC`` -# Use ``MPIEXEC_EXECUTABLE`` instead. - -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - -# include this to handle the QUIETLY and REQUIRED arguments -include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -include(GetPrerequisites) - -# Generic compiler names -set(_MPI_C_GENERIC_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) -set(_MPI_CXX_GENERIC_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ - mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) -set(_MPI_Fortran_GENERIC_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r - mpif90 mpif90_r mpf90 mpf90_r - mpif77 mpif77_r mpf77 mpf77_r - mpifc) - -# GNU compiler names -set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r) -set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r mpigxx) -set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpgfortran_r - mpig77 mpig77_r mpg77 mpg77_r) - -# Intel MPI compiler names on Windows -if(WIN32) - list(APPEND _MPI_C_GENERIC_COMPILER_NAMES mpicc.bat) - list(APPEND _MPI_CXX_GENERIC_COMPILER_NAMES mpicxx.bat) - list(APPEND _MPI_Fortran_GENERIC_COMPILER_NAMES mpifc.bat) - - # Intel MPI compiler names - set(_MPI_Intel_C_COMPILER_NAMES mpiicc.bat) - set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc.bat) - set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort.bat mpif77.bat mpif90.bat) - - # Intel MPI compiler names for MSMPI - set(_MPI_MSVC_C_COMPILER_NAMES mpicl.bat) - set(_MPI_MSVC_CXX_COMPILER_NAMES mpicl.bat) -else() - # Intel compiler names - set(_MPI_Intel_C_COMPILER_NAMES mpiicc) - set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++) - set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) -endif() - -# PGI compiler names -set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) -set(_MPI_PGI_CXX_COMPILER_NAMES mpipgCC mppgCC) -set(_MPI_PGI_Fortran_COMPILER_NAMES mpipgf95 mpipgf90 mppgf95 mppgf90 mpipgf77 mppgf77) - -# XLC MPI Compiler names -set(_MPI_XL_C_COMPILER_NAMES mpxlc mpxlc_r mpixlc mpixlc_r) -set(_MPI_XL_CXX_COMPILER_NAMES mpixlcxx mpixlC mpixlc++ mpxlcxx mpxlc++ mpixlc++ mpxlCC - mpixlcxx_r mpixlC_r mpixlc++_r mpxlcxx_r mpxlc++_r mpixlc++_r mpxlCC_r) -set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95_r - mpixlf90 mpixlf90_r mpxlf90 mpxlf90_r - mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r - mpixlf mpixlf_r mpxlf mpxlf_r) - -# Prepend vendor-specific compiler wrappers to the list. If we don't know the compiler, -# attempt all of them. -# By attempting vendor-specific compiler names first, we should avoid situations where the compiler wrapper -# stems from a proprietary MPI and won't know which compiler it's being used for. For instance, Intel MPI -# controls its settings via the I_MPI_CC environment variables if the generic name is being used. -# If we know which compiler we're working with, we can use the most specialized wrapper there is in order to -# pick up the right settings for it. -foreach (LANG IN ITEMS C CXX Fortran) - set(_MPI_${LANG}_COMPILER_NAMES "") - foreach (id IN ITEMS GNU Intel MSVC PGI XL) - if (NOT CMAKE_${LANG}_COMPILER_ID OR CMAKE_${LANG}_COMPILER_ID STREQUAL id) - list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${id}_${LANG}_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) - endif() - unset(_MPI_${id}_${LANG}_COMPILER_NAMES) - endforeach() - list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${LANG}_GENERIC_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) - unset(_MPI_${LANG}_GENERIC_COMPILER_NAMES) -endforeach() - -# Names to try for mpiexec -# Only mpiexec commands are guaranteed to behave as described in the standard, -# mpirun commands are not covered by the standard in any way whatsoever. -# lamexec is the executable for LAM/MPI, srun is for SLURM or Open MPI with SLURM support. -# srun -n X is however a valid command, so it behaves 'like' mpiexec. -set(_MPIEXEC_NAMES_BASE mpiexec mpiexec.hydra mpiexec.mpd mpirun lamexec srun) - -unset(_MPIEXEC_NAMES) -foreach(_MPIEXEC_NAME IN LISTS _MPIEXEC_NAMES_BASE) - list(APPEND _MPIEXEC_NAMES "${_MPIEXEC_NAME}${MPI_EXECUTABLE_SUFFIX}") -endforeach() -unset(_MPIEXEC_NAMES_BASE) - -function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) - if(DEFINED MPI_${LANG}_COMPILER_FLAGS) - separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_${LANG}_COMPILER_FLAGS}") - else() - separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_COMPILER_FLAGS}") - endif() - execute_process( - COMMAND ${MPI_${LANG}_COMPILER} ${_MPI_COMPILER_WRAPPER_OPTIONS} ${QUERY_FLAG} - OUTPUT_VARIABLE WRAPPER_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE WRAPPER_OUTPUT ERROR_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE WRAPPER_RETURN) - # Some compiler wrappers will yield spurious zero return values, for example - # Intel MPI tolerates unknown arguments and if the MPI wrappers loads a shared - # library that has invalid or missing version information there would be warning - # messages emitted by ld.so in the compiler output. In either case, we'll treat - # the output as invalid. - if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available") - set(WRAPPER_RETURN 255) - endif() - # Ensure that no error output might be passed upwards. - if(NOT WRAPPER_RETURN EQUAL 0) - unset(WRAPPER_OUTPUT) - endif() - set(${OUTPUT_VARIABLE} "${WRAPPER_OUTPUT}" PARENT_SCOPE) - set(${RESULT_VARIABLE} "${WRAPPER_RETURN}" PARENT_SCOPE) -endfunction() - -function (_MPI_interrogate_compiler lang) - unset(MPI_COMPILE_CMDLINE) - unset(MPI_LINK_CMDLINE) - - unset(MPI_COMPILE_OPTIONS_WORK) - unset(MPI_COMPILE_DEFINITIONS_WORK) - unset(MPI_INCLUDE_DIRS_WORK) - unset(MPI_LINK_FLAGS_WORK) - unset(MPI_LIB_NAMES_WORK) - unset(MPI_LIB_FULLPATHS_WORK) - - # Check whether the -showme:compile option works. This indicates that we have either Open MPI - # or a newer version of LAM/MPI, and implies that -showme:link will also work. - # Open MPI also supports -show, but separates linker and compiler information - _MPI_check_compiler(${LANG} "-showme:compile" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - if (MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-showme:link" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) - - if (NOT MPI_COMPILER_RETURN EQUAL 0) - unset(MPI_COMPILE_CMDLINE) - endif() - endif() - - # MPICH and MVAPICH offer -compile-info and -link-info. - # For modern versions, both do the same as -show. However, for old versions, they do differ - # when called for mpicxx and mpif90 and it's necessary to use them over -show in order to find the - # removed MPI C++ bindings. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-compile-info" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - - if (MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-link-info" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) - - if (NOT MPI_COMPILER_RETURN EQUAL 0) - unset(MPI_COMPILE_CMDLINE) - endif() - endif() - endif() - - # MPICH, MVAPICH2 and Intel MPI just use "-show". Open MPI also offers this, but the - # -showme commands are more specialized. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-show" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - endif() - - # Older versions of LAM/MPI have "-showme". Open MPI also supports this. - # Unknown to MPICH, MVAPICH and Intel MPI. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-showme" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - endif() - - if (NOT (MPI_COMPILER_RETURN EQUAL 0) OR NOT (DEFINED MPI_COMPILE_CMDLINE)) - # Cannot interrogate this compiler, so exit. - set(MPI_${LANG}_WRAPPER_FOUND FALSE PARENT_SCOPE) - return() - endif() - unset(MPI_COMPILER_RETURN) - - # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE - # into MPI_LINK_CMDLINE, if we didn't find the link line. - if (NOT DEFINED MPI_LINK_CMDLINE) - set(MPI_LINK_CMDLINE "${MPI_COMPILE_CMDLINE}") - endif() - - # At this point, we obtained some output from a compiler wrapper that works. - # We'll now try to parse it into variables with meaning to us. - if("${LANG}" STREQUAL "Fortran") - # Some MPICH-1 and MVAPICH-1 versions return a three command answer for Fortran, consisting - # out of a symlink command for mpif.h, the actual compiler command and a deletion of the - # created symlink. We need to detect that case, remember the include path and drop the - # symlink/deletion operation to obtain the link/compile lines we'd usually expect. - if("${MPI_COMPILE_CMDLINE}" MATCHES "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h") - get_filename_component(MPI_INCLUDE_DIRS_WORK "${CMAKE_MATCH_1}" DIRECTORY) - string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") - string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") - string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") - string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") - endif() - endif() - - # The Intel MPI wrapper on Linux will emit some objcopy commands after its compile command - # if -static_mpi was passed to the wrapper. To avoid spurious matches, we need to drop these lines. - if(UNIX) - string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") - string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") - endif() - - # Extract compile options from the compile command line. - string(REGEX MATCHALL "(^| )-f([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_OPTIONS "${MPI_COMPILE_CMDLINE}") - - foreach(_MPI_COMPILE_OPTION IN LISTS MPI_ALL_COMPILE_OPTIONS) - string(REGEX REPLACE "^ " "" _MPI_COMPILE_OPTION "${_MPI_COMPILE_OPTION}") - # Ignore -fstack-protector directives: These occur on MPICH and MVAPICH when the libraries - # themselves were built with this flag. However, this flag is unrelated to using MPI, and - # we won't match the accompanying --param-ssp-size and -Wp,-D_FORTIFY_SOURCE flags and therefore - # produce inconsistent results with the regularly flags. - # Similarly, aliasing flags do not belong into our flag array. - if(NOT "${_MPI_COMPILE_OPTION}" MATCHES "^-f(stack-protector|(no-|)strict-aliasing|PI[CE]|pi[ce])") - list(APPEND MPI_COMPILE_OPTIONS_WORK "${_MPI_COMPILE_OPTION}") - endif() - endforeach() - - # Same deal, with the definitions. We also treat arguments passed to the preprocessor directly. - string(REGEX MATCHALL "(^| )(-Wp,|-Xpreprocessor |)[-/]D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_DEFINITIONS "${MPI_COMPILE_CMDLINE}") - - foreach(_MPI_COMPILE_DEFINITION IN LISTS MPI_ALL_COMPILE_DEFINITIONS) - string(REGEX REPLACE "^ ?(-Wp,|-Xpreprocessor )?[-/]D" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") - string(REPLACE "\"" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") - if(NOT "${_MPI_COMPILE_DEFINITION}" MATCHES "^_FORTIFY_SOURCE.*") - list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${_MPI_COMPILE_DEFINITION}") - endif() - endforeach() - - # Extract include paths from compile command line - string(REGEX MATCHALL "(^| )[-/]I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") - - # If extracting failed to work, we'll try using -showme:incdirs. - if (NOT MPI_ALL_INCLUDE_PATHS) - _MPI_check_compiler(${LANG} "-showme:incdirs" MPI_INCDIRS_CMDLINE MPI_INCDIRS_COMPILER_RETURN) - if(MPI_INCDIRS_COMPILER_RETURN) - separate_arguments(MPI_ALL_INCLUDE_PATHS NATIVE_COMMAND "${MPI_INCDIRS_CMDLINE}") - endif() - endif() - - foreach(_MPI_INCLUDE_PATH IN LISTS MPI_ALL_INCLUDE_PATHS) - string(REGEX REPLACE "^ ?[-/]I" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") - string(REPLACE "\"" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") - get_filename_component(_MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}" REALPATH) - list(APPEND MPI_INCLUDE_DIRS_WORK "${_MPI_INCLUDE_PATH}") - endforeach() - - # Extract linker paths from the link command line - string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker |)(-L|[/-]LIBPATH:|[/-]libpath:)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") - - # If extracting failed to work, we'll try using -showme:libdirs. - if (NOT MPI_ALL_LINK_PATHS) - _MPI_check_compiler(${LANG} "-showme:libdirs" MPI_LIBDIRS_CMDLINE MPI_LIBDIRS_COMPILER_RETURN) - if(MPI_LIBDIRS_COMPILER_RETURN) - separate_arguments(MPI_ALL_LINK_PATHS NATIVE_COMMAND "${MPI_LIBDIRS_CMDLINE}") - endif() - endif() - - foreach(_MPI_LPATH IN LISTS MPI_ALL_LINK_PATHS) - string(REGEX REPLACE "^ ?(-Wl,|-Xlinker )?(-L|[/-]LIBPATH:|[/-]libpath:)" "" _MPI_LPATH "${_MPI_LPATH}") - string(REPLACE "\"" "" _MPI_LPATH "${_MPI_LPATH}") - get_filename_component(_MPI_LPATH "${_MPI_LPATH}" REALPATH) - list(APPEND MPI_LINK_DIRECTORIES_WORK "${_MPI_LPATH}") - endforeach() - - # Extract linker flags from the link command line - string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") - - foreach(_MPI_LINK_FLAG IN LISTS MPI_ALL_LINK_FLAGS) - string(STRIP "${_MPI_LINK_FLAG}" _MPI_LINK_FLAG) - # MPI might be marked to build with non-executable stacks but this should not propagate. - if (NOT "${_MPI_LINK_FLAG}" MATCHES "(-Wl,|-Xlinker )-z,noexecstack") - if (MPI_LINK_FLAGS_WORK) - string(APPEND MPI_LINK_FLAGS_WORK " ${_MPI_LINK_FLAG}") - else() - set(MPI_LINK_FLAGS_WORK "${_MPI_LINK_FLAG}") - endif() - endif() - endforeach() - - # Extract the set of libraries to link against from the link command - # line - string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") - - foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) - string(REGEX REPLACE "^ ?-l" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) - if(NOT "${_MPI_LIB_PATH}" STREQUAL "") - list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") - else() - list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") - endif() - endforeach() - - if(WIN32) - # A compiler wrapper on Windows will just have the name of the - # library to link on its link line, potentially with a full path - string(REGEX MATCHALL "(^| )([^\" ]+\\.lib|\"[^\"]+\\.lib\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") - foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) - string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) - if(NOT "${_MPI_LIB_PATH}" STREQUAL "") - list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") - else() - list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") - endif() - endforeach() - else() - # On UNIX platforms, archive libraries can be given with full path. - string(REGEX MATCHALL "(^| )([^\" ]+\\.a|\"[^\"]+\\.a\")" MPI_LIBFULLPATHS "${MPI_LINK_CMDLINE}") - foreach(_MPI_LIB_NAME IN LISTS MPI_LIBFULLPATHS) - string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) - if(NOT "${_MPI_LIB_PATH}" STREQUAL "") - list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") - else() - list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") - endif() - endforeach() - endif() - - # An MPI compiler wrapper could have its MPI libraries in the implictly - # linked directories of the compiler itself. - if(DEFINED CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) - list(APPEND MPI_LINK_DIRECTORIES_WORK "${CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES}") - endif() - - # Determine full path names for all of the libraries that one needs - # to link against in an MPI program - unset(MPI_PLAIN_LIB_NAMES_WORK) - foreach(_MPI_LIB_NAME IN LISTS MPI_LIB_NAMES_WORK) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_NAME}" NAME_WE) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${MPI_LINK_DIRECTORIES_WORK} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endforeach() - - # Deal with the libraries given with full path next - unset(MPI_DIRECT_LIB_NAMES_WORK) - foreach(_MPI_LIB_FULLPATH IN LISTS MPI_LIB_FULLPATHS_WORK) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME) - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_FULLPATH}" DIRECTORY) - list(APPEND MPI_DIRECT_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_PATH} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endforeach() - if(MPI_DIRECT_LIB_NAMES_WORK) - set(MPI_PLAIN_LIB_NAMES_WORK "${MPI_DIRECT_LIB_NAMES_WORK};${MPI_PLAIN_LIB_NAMES_WORK}") - endif() - - # MPI might require pthread to work. The above mechanism wouldn't detect it, but we need to - # link it in that case. -lpthread is covered by the normal library treatment on the other hand. - if("${MPI_COMPILE_CMDLINE}" MATCHES "-pthread") - list(APPEND MPI_COMPILE_OPTIONS_WORK "-pthread") - if(MPI_LINK_FLAGS_WORK) - string(APPEND MPI_LINK_FLAGS_WORK " -pthread") - else() - set(MPI_LINK_FLAGS_WORK "-pthread") - endif() - endif() - - # If we found MPI, set up all of the appropriate cache entries - if(NOT MPI_${LANG}_COMPILE_OPTIONS) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) - endif() - if(NOT MPI_${LANG}_COMPILE_DEFINITIONS) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_COMPILE_DEFINITIONS_WORK} CACHE STRING "MPI ${LANG} compilation definitions" FORCE) - endif() - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_INCLUDE_DIRS_WORK} CACHE STRING "MPI ${LANG} additional include directories" FORCE) - endif() - if(NOT MPI_${LANG}_LINK_FLAGS) - set(MPI_${LANG}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${LANG} linker flags" FORCE) - endif() - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES ${MPI_PLAIN_LIB_NAMES_WORK} CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - set(MPI_${LANG}_WRAPPER_FOUND TRUE PARENT_SCOPE) -endfunction() - -function(_MPI_guess_settings LANG) - set(MPI_GUESS_FOUND FALSE) - # Currently only MSMPI and MPICH2 on Windows are supported, so we can skip this search if we're not targeting that. - if(WIN32) - # MSMPI - - # The environment variables MSMPI_INC and MSMPILIB32/64 are the only ways of locating the MSMPI_SDK, - # which is installed separately from the runtime. Thus it's possible to have mpiexec but not MPI headers - # or import libraries and vice versa. - if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MSMPI") - # We first attempt to locate the msmpi.lib. Should be find it, we'll assume that the MPI present is indeed - # Microsoft MPI. - if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) - set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB64}") - set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x64") - else() - set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB32}") - set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x86") - endif() - - find_library(MPI_msmpi_LIBRARY - NAMES msmpi - HINTS ${MPI_MSMPI_LIB_PATH} - DOC "Location of the msmpi library for Microsoft MPI") - mark_as_advanced(MPI_msmpi_LIBRARY) - - if(MPI_msmpi_LIBRARY) - # Next, we attempt to locate the MPI header. Note that for Fortran we know that mpif.h is a way - # MSMPI can be used and therefore that header has to be present. - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - get_filename_component(MPI_MSMPI_INC_DIR "$ENV{MSMPI_INC}" REALPATH) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MSMPI_INC_DIR}" CACHE STRING "MPI ${LANG} additional include directories" FORCE) - unset(MPI_MSMPI_INC_DIR) - endif() - - # For MSMPI, one can compile the MPI module by building the mpi.f90 shipped with the MSMPI SDK, - # thus it might be present or provided by the user. Figuring out which is supported is done later on. - # The PGI Fortran compiler for instance ships a prebuilt set of modules in its own include folder. - # Should a user be employing PGI or have built its own set and provided it via cache variables, the - # splitting routine would have located the module files. - - # For C and C++, we're done here (MSMPI does not ship the MPI-2 C++ bindings) - however, for Fortran - # we need some extra library to glue Fortran support together: - # MSMPI ships 2-4 Fortran libraries, each for different Fortran compiler behaviors. The library names - # ending with a c are using the cdecl calling convention, whereas those ending with an s are for Fortran - # implementations using stdcall. Therefore, the 64-bit MSMPI only ships those ending in 'c', whereas the 32-bit - # has both variants available. - # The second difference is the last but one letter, if it's an e(nd), the length of a string argument is - # passed by the Fortran compiler after all other arguments on the parameter list, if it's an m(ixed), - # it's passed immediately after the string address. - - # To summarize: - # - msmpifec: CHARACTER length passed after the parameter list and using cdecl calling convention - # - msmpifmc: CHARACTER length passed directly after string address and using cdecl calling convention - # - msmpifes: CHARACTER length passed after the parameter list and using stdcall calling convention - # - msmpifms: CHARACTER length passed directly after string address and using stdcall calling convention - # 32-bit MSMPI ships all four libraries, 64-bit MSMPI ships only the first two. - - # As is, Intel Fortran and PGI Fortran both use the 'ec' variant of the calling convention, whereas - # the old Compaq Visual Fortran compiler defaulted to the 'ms' version. It's possible to make Intel Fortran - # use the CVF calling convention using /iface:cvf, but we assume - and this is also assumed in FortranCInterface - - # this isn't the case. It's also possible to make CVF use the 'ec' variant, using /iface=(cref,nomixed_str_len_arg). - - # Our strategy is now to locate all libraries, but enter msmpifec into the LIB_NAMES array. - # Should this not be adequate it's a straightforward way for a user to change the LIB_NAMES array and - # have his library found. Still, this should not be necessary outside of exceptional cases, as reasoned. - if ("${LANG}" STREQUAL "Fortran") - set(MPI_MSMPI_CALLINGCONVS c) - if("${CMAKE_SIZEOF_VOID_P}" EQUAL 4) - list(APPEND MPI_MSMPI_CALLINGCONVS s) - endif() - foreach(mpistrlenpos IN ITEMS e m) - foreach(mpicallingconv IN LISTS MPI_MSMPI_CALLINGCONVS) - find_library(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY - NAMES msmpif${mpistrlenpos}${mpicallingconv} - HINTS "${MPI_MSMPI_LIB_PATH}" - DOC "Location of the msmpi${mpistrlenpos}${mpicallingconv} library for Microsoft MPI") - mark_as_advanced(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY) - endforeach() - endforeach() - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES "msmpi;msmpifec" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - - # At this point we're *not* done. MSMPI requires an additional include file for Fortran giving the value - # of MPI_AINT. This file is called mpifptr.h located in the x64 and x86 subfolders, respectively. - find_path(MPI_mpifptr_INCLUDE_DIR - NAMES "mpifptr.h" - HINTS "${MPI_MSMPI_INC_PATH_EXTRA}" - DOC "Location of the mpifptr.h extra header for Microsoft MPI") - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS "mpifptr" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) - endif() - mark_as_advanced(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS MPI_mpifptr_INCLUDE_DIR) - else() - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES "msmpi" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - endif() - mark_as_advanced(MPI_${LANG}_LIB_NAMES) - set(MPI_GUESS_FOUND TRUE) - endif() - endif() - - # At this point there's not many MPIs that we could still consider. - # OpenMPI 1.6.x and below supported Windows, but these ship compiler wrappers that still work. - # The only other relevant MPI implementation without a wrapper is MPICH2, which had Windows support in 1.4.1p1 and older. - if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MPICH2") - set(MPI_MPICH_PREFIX_PATHS - "$ENV{ProgramW6432}/MPICH2/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/../lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]/lib" - ) - - # All of C, C++ and Fortran will need mpi.lib, so we'll look for this first - find_library(MPI_mpi_LIBRARY - NAMES mpi - HINTS ${MPI_MPICH_PREFIX_PATHS}) - mark_as_advanced(MPI_mpi_LIBRARY) - # If we found mpi.lib, we detect the rest of MPICH2 - if(MPI_mpi_LIBRARY) - set(MPI_MPICH_LIB_NAMES "mpi") - # If MPI-2 C++ bindings are requested, we need to locate cxx.lib as well. - # Otherwise, MPICH_SKIP_MPICXX will be defined and these bindings aren't needed. - if("${LANG}" STREQUAL "CXX" AND NOT MPI_CXX_SKIP_MPICXX) - find_library(MPI_cxx_LIBRARY - NAMES cxx - HINTS ${MPI_MPICH_PREFIX_PATHS}) - mark_as_advanced(MPI_cxx_LIBRARY) - list(APPEND MPI_MPICH_LIB_NAMES "cxx") - # For Fortran, MPICH2 provides three different libraries: - # fmpich2.lib which uses uppercase symbols and cdecl, - # fmpich2s.lib which uses uppercase symbols and stdcall (32-bit only), - # fmpich2g.lib which uses lowercase symbols with double underscores and cdecl. - # fmpich2s.lib would be useful for Compaq Visual Fortran, fmpich2g.lib has to be used with GNU g77 and is also - # provided in the form of an .a archive for MinGW and Cygwin. From our perspective, fmpich2.lib is the only one - # we need to try, and if it doesn't work with the given Fortran compiler we'd find out later on during validation - elseif("${LANG}" STREQUAL "Fortran") - find_library(MPI_fmpich2_LIBRARY - NAMES fmpich2 - HINTS ${MPI_MPICH_PREFIX_PATHS}) - find_library(MPI_fmpich2s_LIBRARY - NAMES fmpich2s - HINTS ${MPI_MPICH_PREFIX_PATHS}) - find_library(MPI_fmpich2g_LIBRARY - NAMES fmpich2g - HINTS ${MPI_MPICH_PREFIX_PATHS}) - mark_as_advanced(MPI_fmpich2_LIBRARY MPI_fmpich2s_LIBRARY MPI_fmpich2g_LIBRARY) - list(APPEND MPI_MPICH_LIB_NAMES "fmpich2") - endif() - - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES "${MPI_MPICH_LIB_NAMES}" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - unset(MPI_MPICH_LIB_NAMES) - - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - # For MPICH2, the include folder would be in ../include relative to the library folder. - get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_mpi_LIBRARY}" DIRECTORY) - get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_MPICH_ROOT_DIR}" DIRECTORY) - if(IS_DIRECTORY "${MPI_MPICH_ROOT_DIR}/include") - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MPICH_ROOT_DIR}/include" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) - endif() - unset(MPI_MPICH_ROOT_DIR) - endif() - set(MPI_GUESS_FOUND TRUE) - endif() - unset(MPI_MPICH_PREFIX_PATHS) - endif() - endif() - set(MPI_${LANG}_GUESS_FOUND "${MPI_GUESS_FOUND}" PARENT_SCOPE) -endfunction() - -function(_MPI_adjust_compile_definitions LANG) - if("${LANG}" STREQUAL "CXX") - # To disable the C++ bindings, we need to pass some definitions since the mpi.h header has to deal with both C and C++ - # bindings in MPI-2. - if(MPI_CXX_SKIP_MPICXX AND NOT MPI_${LANG}_COMPILE_DEFINITIONS MATCHES "SKIP_MPICXX") - # MPICH_SKIP_MPICXX is being used in MPICH and derivatives like MVAPICH or Intel MPI - # OMPI_SKIP_MPICXX is being used in Open MPI - # _MPICC_H is being used for IBM Platform MPI - list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX" "OMPI_SKIP_MPICXX" "_MPICC_H") - set(MPI_${LANG}_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}" CACHE STRING "MPI ${LANG} compilation definitions" FORCE) - endif() - endif() -endfunction() - -macro(_MPI_assemble_libraries LANG) - set(MPI_${LANG}_LIBRARIES "") - foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) - endforeach() -endmacro() - -macro(_MPI_assemble_include_dirs LANG) - set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") - if("${LANG}" MATCHES "(C|CXX)") - if(MPI_${LANG}_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - else() # Fortran - if(MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") - endif() - if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") - endif() - endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}") - endforeach() - endif() -endmacro() - -function(_MPI_split_include_dirs LANG) - # Backwards compatibility: Search INCLUDE_PATH if given. - if(MPI_${LANG}_INCLUDE_PATH) - list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") - endif() - - # We try to find the headers/modules among those paths (and system paths) - # For C/C++, we just need to have a look for mpi.h. - if("${LANG}" MATCHES "(C|CXX)") - find_path(MPI_${LANG}_HEADER_DIR "mpi.h" - HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} - ) - mark_as_advanced(MPI_${LANG}_HEADER_DIR) - if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - # Fortran is more complicated here: An implementation could provide - # any of the Fortran 77/90/2008 APIs for MPI. For example, MSMPI - # only provides Fortran 77 and - if mpi.f90 is built - potentially - # a Fortran 90 module. - elseif("${LANG}" STREQUAL "Fortran") - find_path(MPI_${LANG}_F77_HEADER_DIR "mpif.h" - HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} - ) - find_path(MPI_${LANG}_MODULE_DIR - NAMES "mpi.mod" "mpi_f08.mod" - HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} - ) - if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS - "${MPI_${LANG}_F77_HEADER_DIR}" - "${MPI_${LANG}_MODULE_DIR}" - ) - endif() - mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) - endif() - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) -endfunction() - -macro(_MPI_create_imported_target LANG) - if(NOT TARGET MPI::MPI_${LANG}) - add_library(MPI::MPI_${LANG} INTERFACE IMPORTED) - endif() - - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}") - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}") - - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "") - if(MPI_${LANG}_LINK_FLAGS) - set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LINK_FLAGS}") - endif() - # If the compiler links MPI implicitly, no libraries will be found as they're contained within - # CMAKE__IMPLICIT_LINK_LIBRARIES already. - if(MPI_${LANG}_LIBRARIES) - set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LIBRARIES}") - endif() - # Given the new design of FindMPI, INCLUDE_DIRS will always be located, even under implicit linking. - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${MPI_${LANG}_INCLUDE_DIRS}") -endmacro() - -function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY) - set(WORK_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI") - set(SRC_DIR "${CMAKE_ROOT}/Modules/FindMPI") - set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI/${MPI_TEST_FILE_NAME}_${LANG}.bin") - unset(MPI_TEST_COMPILE_DEFINITIONS) - if("${LANG}" STREQUAL "Fortran") - if("${MODE}" STREQUAL "F90_MODULE") - set(MPI_Fortran_INCLUDE_LINE "use mpi\n implicit none") - elseif("${MODE}" STREQUAL "F08_MODULE") - set(MPI_Fortran_INCLUDE_LINE "use mpi_f08\n implicit none") - else() # F77 header - set(MPI_Fortran_INCLUDE_LINE "implicit none\n include 'mpif.h'") - endif() - configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.f90.in" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90" @ONLY) - set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90") - elseif("${LANG}" STREQUAL "CXX") - configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.c" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp" COPYONLY) - set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp") - if("${MODE}" STREQUAL "TEST_MPICXX") - set(MPI_TEST_COMPILE_DEFINITIONS TEST_MPI_MPICXX) - endif() - else() # C - set(MPI_TEST_SOURCE_FILE "${SRC_DIR}/${MPI_TEST_FILE_NAME}.c") - endif() - if(RUN_BINARY) - try_run(MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} - "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" - COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} - LINK_LIBRARIES MPI::MPI_${LANG} - RUN_OUTPUT_VARIABLE MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}) - set(MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} "${MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}}" PARENT_SCOPE) - else() - try_compile(MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} - "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" - COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} - LINK_LIBRARIES MPI::MPI_${LANG} - COPY_FILE "${BIN_FILE}") - endif() -endfunction() - -macro(_MPI_check_lang_works LANG) - # For Fortran we may have by the MPI-3 standard an implementation that provides: - # - the mpi_f08 module - # - *both*, the mpi module and 'mpif.h' - # Since older MPI standards (MPI-1) did not define anything but 'mpif.h', we need to check all three individually. - if( NOT MPI_${LANG}_WORKS ) - if("${LANG}" STREQUAL "Fortran") - set(MPI_Fortran_INTEGER_LINE "(kind=MPI_INTEGER_KIND)") - _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER FALSE) - _MPI_try_staged_settings(${LANG} test_mpi F90_MODULE FALSE) - _MPI_try_staged_settings(${LANG} test_mpi F08_MODULE FALSE) - - set(MPI_${LANG}_WORKS FALSE) - - foreach(mpimethod IN ITEMS F77_HEADER F08_MODULE F90_MODULE) - if(MPI_RESULT_${LANG}_test_mpi_${mpimethod}) - set(MPI_${LANG}_WORKS TRUE) - set(MPI_${LANG}_HAVE_${mpimethod} TRUE) - else() - set(MPI_${LANG}_HAVE_${mpimethod} FALSE) - endif() - endforeach() - # MPI-1 versions had no MPI_INTGER_KIND defined, so we need to try without it. - # However, MPI-1 also did not define the Fortran 90 and 08 modules, so we only try the F77 header. - unset(MPI_Fortran_INTEGER_LINE) - if(NOT MPI_${LANG}_WORKS) - _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER_NOKIND FALSE) - if(MPI_RESULT_${LANG}_test_mpi_F77_HEADER_NOKIND) - set(MPI_${LANG}_WORKS TRUE) - set(MPI_${LANG}_HAVE_F77_HEADER TRUE) - endif() - endif() - else() - _MPI_try_staged_settings(${LANG} test_mpi normal FALSE) - # If 'test_mpi' built correctly, we've found valid MPI settings. There might not be MPI-2 C++ support, but there can't - # be MPI-2 C++ support without the C bindings being present, so checking for them is sufficient. - set(MPI_${LANG}_WORKS "${MPI_RESULT_${LANG}_test_mpi_normal}") - endif() - endif() -endmacro() - -# Some systems install various MPI implementations in separate folders in some MPI prefix -# This macro enumerates all such subfolders and adds them to the list of hints that will be searched. -macro(MPI_search_mpi_prefix_folder PREFIX_FOLDER) - if(EXISTS "${PREFIX_FOLDER}") - file(GLOB _MPI_folder_children RELATIVE "${PREFIX_FOLDER}" "${PREFIX_FOLDER}/*") - foreach(_MPI_folder_child IN LISTS _MPI_folder_children) - if(IS_DIRECTORY "${PREFIX_FOLDER}/${_MPI_folder_child}") - list(APPEND MPI_HINT_DIRS "${PREFIX_FOLDER}/${_MPI_folder_child}") - endif() - endforeach() - endif() -endmacro() - -set(MPI_HINT_DIRS ${MPI_HOME} $ENV{MPI_HOME} $ENV{I_MPI_ROOT}) -if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") - # SUSE Linux Enterprise Server stores its MPI implementations under /usr/lib64/mpi/gcc/ - # We enumerate the subfolders and append each as a prefix - MPI_search_mpi_prefix_folder("/usr/lib64/mpi/gcc") -elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") - # MSMPI stores its runtime in a special folder, this adds the possible locations to the hints. - list(APPEND MPI_HINT_DIRS $ENV{MSMPI_BIN} "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]") -elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") - # FreeBSD ships mpich under the normal system paths - but available openmpi implementations - # will be found in /usr/local/mpi/ - MPI_search_mpi_prefix_folder("/usr/local/mpi/") -endif() - -# Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. -# The MPI standard does not mandate the existence of either, but instead only makes requirements if a distribution -# ships an mpiexec program (mpirun executables are not regulated by the standard). -find_program(MPIEXEC_EXECUTABLE - NAMES ${_MPIEXEC_NAMES} - PATH_SUFFIXES bin sbin - HINTS ${MPI_HINT_DIRS} - DOC "Executable for running MPI programs.") - -# call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin). -# This gives us a fairly reliable base directory to search for /bin /lib and /include from. -get_filename_component(_MPI_BASE_DIR "${MPIEXEC_EXECUTABLE}" PATH) -get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH) - -# 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 be placed after all flags passed to mpiexec.") - -# Set the number of processes to the physical processor count -cmake_host_system_information(RESULT _MPIEXEC_NUMPROCS QUERY NUMBER_OF_PHYSICAL_CORES) -set(MPIEXEC_MAX_NUMPROCS "${_MPIEXEC_NUMPROCS}" CACHE STRING "Maximum number of processors available to run MPI applications.") -unset(_MPIEXEC_NUMPROCS) -mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) - -#============================================================================= -# Backward compatibility input hacks. Propagate the FindMPI hints to C and -# CXX if the respective new versions are not defined. Translate the old -# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${LANG}_LIBRARIES. -# -# Once we find the new variables, we translate them back into their old -# equivalents below. -foreach (LANG IN ITEMS C CXX) - # Old input variables. - set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) - - # Set new vars based on their old equivalents, if the new versions are not already set. - foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${LANG}_${var} AND MPI_${var}) - set(MPI_${LANG}_${var} "${MPI_${var}}") - endif() - endforeach() - - # Chop the old compile flags into options and definitions - if(MPI_${LANG}_COMPILE_FLAGS) - unset(MPI_${LANG}_COMPILE_OPTIONS) - unset(MPI_${LANG}_COMPILE_DEFINITIONS) - separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") - foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) - if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") - list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") - else() - list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}") - endif() - endforeach() - unset(MPI_SEPARATE_FLAGS) - endif() - - # If a list of libraries was given, we'll split it into new-style cache variables - if(NOT MPI_${LANG}_LIB_NAMES) - foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) - get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endforeach() - endif() -endforeach() -#============================================================================= - -unset(MPI_VERSION) -unset(MPI_VERSION_MAJOR) -unset(MPI_VERSION_MINOR) - -unset(_MPI_MIN_VERSION) - -# This loop finds the compilers and sends them off for interrogation. -foreach(LANG IN ITEMS C CXX Fortran) - if(CMAKE_${LANG}_COMPILER_LOADED) - if(NOT MPI_FIND_COMPONENTS) - set(_MPI_FIND_${LANG} TRUE) - elseif( ${LANG} IN_LIST MPI_FIND_COMPONENTS) - set(_MPI_FIND_${LANG} TRUE) - elseif( ${LANG} STREQUAL CXX AND NOT MPI_CXX_SKIP_MPICXX AND MPICXX IN_LIST MPI_FIND_COMPONENTS ) - set(_MPI_FIND_${LANG} TRUE) - else() - set(_MPI_FIND_${LANG} FALSE) - endif() - else() - set(_MPI_FIND_${LANG} FALSE) - endif() - if(_MPI_FIND_${LANG}) - if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS ) - set(MPI_CXX_SKIP_MPICXX FALSE CACHE BOOL "If true, the MPI-2 C++ bindings are disabled using definitions.") - mark_as_advanced(MPI_CXX_SKIP_MPICXX) - endif() - if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) - if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) - # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. - # Cray PrgEnv. - _MPI_create_imported_target(${LANG}) - _MPI_check_lang_works(${LANG}) - - # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. - if(MPI_${LANG}_WORKS) - set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) - endif() - endif() - - # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. - if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) - set(MPI_SKIP_COMPILER_WRAPPER TRUE) - endif() - if(NOT MPI_SKIP_COMPILER_WRAPPER) - if(MPI_${LANG}_COMPILER) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") - unset(MPI_${LANG}_COMPILER CACHE) - endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(MPI_PINNED_COMPILER TRUE) - else() - set(MPI_PINNED_COMPILER FALSE) - endif() - - # If we have an MPI base directory, we'll try all compiler names in that one first. - # This should prevent mixing different MPI environments - if(_MPI_BASE_DIR) - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - HINTS ${_MPI_BASE_DIR} - NO_DEFAULT_PATH - DOC "MPI compiler for ${LANG}" - ) - endif() - - # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), - # we shall try searching in the default paths. - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - DOC "MPI compiler for ${LANG}" - ) - - if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - set(MPI_SKIP_GUESSING TRUE) - elseif(MPI_${LANG}_COMPILER) - _MPI_interrogate_compiler(${LANG}) - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) - endif() - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) - set(MPI_PINNED_COMPILER FALSE) - endif() - - if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) - # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the - # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. - if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) - set(MPI_${LANG}_WRAPPER_FOUND TRUE) - elseif(NOT MPI_SKIP_GUESSING) - _MPI_guess_settings(${LANG}) - endif() - endif() - endif() - - _MPI_split_include_dirs(${LANG}) - if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - _MPI_assemble_include_dirs(${LANG}) - _MPI_assemble_libraries(${LANG}) - endif() - _MPI_adjust_compile_definitions(${LANG}) - # We always create imported targets even if they're empty - _MPI_create_imported_target(${LANG}) - - if(NOT MPI_${LANG}_WORKS) - _MPI_check_lang_works(${LANG}) - endif() - - # Next, we'll initialize the MPI variables that have not been previously set. - set(MPI_${LANG}_COMPILE_OPTIONS "" CACHE STRING "MPI ${LANG} compilation flags" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) - mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS - MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) - - # If we've found MPI, then we'll perform additional analysis: Determine the MPI version, MPI library version, supported - # MPI APIs (i.e. MPI-2 C++ bindings). For Fortran we also need to find specific parameters if we're under MPI-3. - if(MPI_${LANG}_WORKS) - if("${LANG}" STREQUAL "CXX" AND NOT DEFINED MPI_MPICXX_FOUND) - if(NOT MPI_CXX_SKIP_MPICXX AND NOT MPI_CXX_VALIDATE_SKIP_MPICXX) - _MPI_try_staged_settings(${LANG} test_mpi MPICXX FALSE) - if(MPI_RESULT_${LANG}_test_mpi_MPICXX) - set(MPI_MPICXX_FOUND TRUE) - else() - set(MPI_MPICXX_FOUND FALSE) - endif() - else() - set(MPI_MPICXX_FOUND FALSE) - endif() - endif() - - # At this point, we know the bindings present but not the MPI version or anything else. - if(NOT DEFINED MPI_${LANG}_VERSION) - unset(MPI_${LANG}_VERSION_MAJOR) - unset(MPI_${LANG}_VERSION_MINOR) - endif() - set(MPI_BIN_FOLDER ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI) - - # For Fortran, we'll want to use the most modern MPI binding to test capabilities other than the - # Fortran parameters, since those depend on the method of consumption. - # For C++, we can always use the C bindings, and should do so, since the C++ bindings do not exist in MPI-3 - # whereas the C bindings do, and the C++ bindings never offered any feature advantage over their C counterparts. - if("${LANG}" STREQUAL "Fortran") - if(MPI_${LANG}_HAVE_F08_MODULE) - set(MPI_${LANG}_HIGHEST_METHOD F08_MODULE) - elseif(MPI_${LANG}_HAVE_F90_MODULE) - set(MPI_${LANG}_HIGHEST_METHOD F90_MODULE) - else() - set(MPI_${LANG}_HIGHEST_METHOD F77_HEADER) - endif() - - # Another difference between C and Fortran is that we can't use the preprocessor to determine whether MPI_VERSION - # and MPI_SUBVERSION are provided. These defines did not exist in MPI 1.0 and 1.1 and therefore might not - # exist. For C/C++, test_mpi.c will handle the MPI_VERSION extraction, but for Fortran, we need mpiver.f90. - if(NOT DEFINED MPI_${LANG}_VERSION) - _MPI_try_staged_settings(${LANG} mpiver ${MPI_${LANG}_HIGHEST_METHOD} FALSE) - if(MPI_RESULT_${LANG}_mpiver_${MPI_${LANG}_HIGHEST_METHOD}) - file(STRINGS ${MPI_BIN_FOLDER}/mpiver_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") - if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") - set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") - set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") - set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") - endif() - endif() - endif() - - # Finally, we want to find out which capabilities a given interface supports, compare the MPI-3 standard. - # This is determined by interface specific parameters MPI_SUBARRAYS_SUPPORTED and MPI_ASYNC_PROTECTS_NONBLOCKING - # and might vary between the different methods of consumption. - if(MPI_DETERMINE_Fortran_CAPABILITIES AND NOT MPI_Fortran_CAPABILITIES_DETERMINED) - foreach(mpimethod IN ITEMS F08_MODULE F90_MODULE F77_HEADER) - if(MPI_${LANG}_HAVE_${mpimethod}) - set(MPI_${LANG}_${mpimethod}_SUBARRAYS FALSE) - set(MPI_${LANG}_${mpimethod}_ASYNCPROT FALSE) - _MPI_try_staged_settings(${LANG} fortranparam_mpi ${mpimethod} TRUE) - if(MPI_RESULT_${LANG}_fortranparam_mpi_${mpimethod} AND - NOT "${MPI_RUN_RESULT_${LANG}_fortranparam_mpi_${mpimethod}}" STREQUAL "FAILED_TO_RUN") - if("${MPI_RUN_OUTPUT_${LANG}_fortranparam_mpi_${mpimethod}}" MATCHES - ".*INFO:SUBARRAYS\\[ *([TF]) *\\]-ASYNCPROT\\[ *([TF]) *\\].*") - if("${CMAKE_MATCH_1}" STREQUAL "T") - set(MPI_${LANG}_${mpimethod}_SUBARRAYS TRUE) - endif() - if("${CMAKE_MATCH_2}" STREQUAL "T") - set(MPI_${LANG}_${mpimethod}_ASYNCPROT TRUE) - endif() - endif() - endif() - endif() - endforeach() - set(MPI_Fortran_CAPABILITIES_DETERMINED TRUE) - endif() - else() - set(MPI_${LANG}_HIGHEST_METHOD normal) - - # By the MPI-2 standard, MPI_VERSION and MPI_SUBVERSION are valid for both C and C++ bindings. - if(NOT DEFINED MPI_${LANG}_VERSION) - file(STRINGS ${MPI_BIN_FOLDER}/test_mpi_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") - if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") - set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") - set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") - set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") - endif() - endif() - endif() - - unset(MPI_BIN_FOLDER) - - # At this point, we have dealt with determining the MPI version and parameters for each Fortran method available. - # The one remaining issue is to determine which MPI library is installed. - # Determining the version and vendor of the MPI library is only possible via MPI_Get_library_version() at runtime, - # and therefore we cannot do this while cross-compiling (a user may still define MPI__LIBRARY_VERSION_STRING - # themselves and we'll attempt splitting it, which is equivalent to provide the try_run output). - # It's also worth noting that the installed version string can depend on the language, or on the system the binary - # runs on if MPI is not statically linked. - if(MPI_DETERMINE_LIBRARY_VERSION AND NOT MPI_${LANG}_LIBRARY_VERSION_STRING) - _MPI_try_staged_settings(${LANG} libver_mpi ${MPI_${LANG}_HIGHEST_METHOD} TRUE) - if(MPI_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD} AND - "${MPI_RUN_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" EQUAL "0") - string(STRIP "${MPI_RUN_OUTPUT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" - MPI_${LANG}_LIBRARY_VERSION_STRING) - else() - set(MPI_${LANG}_LIBRARY_VERSION_STRING "NOTFOUND") - endif() - endif() - endif() - - set(MPI_${LANG}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) - set(MPI_${LANG}_FIND_VERSION ${MPI_FIND_VERSION}) - set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) - - unset(MPI_${LANG}_REQUIRED_VARS) - if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND) - foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") - endforeach() - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_LIB_NAMES") - if("${LANG}" STREQUAL "Fortran") - # For Fortran we only need one of the module or header directories to have *some* support for MPI. - if(NOT MPI_${LANG}_MODULE_DIR) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_F77_HEADER_DIR") - endif() - if(NOT MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_MODULE_DIR") - endif() - else() - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_HEADER_DIR") - endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(mpiincvar IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpiincvar}_INCLUDE_DIR") - endforeach() - endif() - # Append the works variable now. If the settings did not work, this will show up properly. - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") - else() - # If the compiler worked implicitly, use its path as output. - # Should the compiler variable be set, we also require it to work. - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_COMPILER") - if(MPI_${LANG}_COMPILER) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") - endif() - endif() - find_package_handle_standard_args(MPI_${LANG} REQUIRED_VARS ${MPI_${LANG}_REQUIRED_VARS} - VERSION_VAR MPI_${LANG}_VERSION) - - if(DEFINED MPI_${LANG}_VERSION) - if(NOT _MPI_MIN_VERSION OR _MPI_MIN_VERSION VERSION_GREATER MPI_${LANG}_VERSION) - set(_MPI_MIN_VERSION MPI_${LANG}_VERSION) - endif() - endif() - endif() -endforeach() - -unset(_MPI_REQ_VARS) -foreach(LANG IN ITEMS C CXX Fortran) - if((NOT MPI_FIND_COMPONENTS AND CMAKE_${LANG}_COMPILER_LOADED) OR LANG IN_LIST MPI_FIND_COMPONENTS) - list(APPEND _MPI_REQ_VARS "MPI_${LANG}_FOUND") - endif() -endforeach() - -if(MPICXX IN_LIST MPI_FIND_COMPONENTS) - list(APPEND _MPI_REQ_VARS "MPI_MPICXX_FOUND") -endif() - -find_package_handle_standard_args(MPI - REQUIRED_VARS ${_MPI_REQ_VARS} - VERSION_VAR ${_MPI_MIN_VERSION} - HANDLE_COMPONENTS) - -#============================================================================= -# More backward compatibility stuff - -# For compatibility reasons, we also define MPIEXEC -set(MPIEXEC "${MPIEXEC_EXECUTABLE}") - -# Copy over MPI__INCLUDE_PATH from the assembled INCLUDE_DIRS. -foreach(LANG IN ITEMS C CXX Fortran) - if(MPI_${LANG}_FOUND) - set(MPI_${LANG}_INCLUDE_PATH "${MPI_${LANG}_INCLUDE_DIRS}") - unset(MPI_${LANG}_COMPILE_FLAGS) - if(MPI_${LANG}_COMPILE_OPTIONS) - set(MPI_${LANG}_COMPILE_FLAGS "${MPI_${LANG}_COMPILE_OPTIONS}") - endif() - if(MPI_${LANG}_COMPILE_DEFINITIONS) - foreach(_MPI_DEF IN LISTS MPI_${LANG}_COMPILE_DEFINITIONS) - string(APPEND MPI_${LANG}_COMPILE_FLAGS " -D${_MPI_DEF}") - endforeach() - endif() - endif() -endforeach() - -# Bare MPI sans ${LANG} vars are set to CXX then C, depending on what was found. -# This mimics the behavior of the old language-oblivious FindMPI. -set(_MPI_OLD_VARS COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES) -if (MPI_CXX_FOUND) - foreach (var ${_MPI_OLD_VARS}) - set(MPI_${var} ${MPI_CXX_${var}}) - endforeach() -elseif (MPI_C_FOUND) - foreach (var ${_MPI_OLD_VARS}) - set(MPI_${var} ${MPI_C_${var}}) - endforeach() -endif() - -# Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and MPI_EXTRA_LIBRARY, and set them in cache. -if (MPI_LIBRARIES) - list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK) - set(MPI_LIBRARY "${MPI_LIBRARY_WORK}") - unset(MPI_LIBRARY_WORK) -else() - set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND") -endif() - -list(LENGTH MPI_LIBRARIES MPI_NUMLIBS) -if (MPI_NUMLIBS GREATER 1) - set(MPI_EXTRA_LIBRARY_WORK "${MPI_LIBRARIES}") - list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0) - set(MPI_EXTRA_LIBRARY "${MPI_EXTRA_LIBRARY_WORK}") - unset(MPI_EXTRA_LIBRARY_WORK) -else() - set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") -endif() -#============================================================================= - -# unset these vars to cleanup namespace -unset(_MPI_OLD_VARS) -unset(_MPI_PREFIX_PATH) -unset(_MPI_BASE_DIR) -foreach (lang C CXX Fortran) - unset(_MPI_${LANG}_COMPILER_NAMES) -endforeach() - -cmake_policy(POP) -- cgit v0.12 From f190509675e545bdda4e53d561c30f58a5f5ff4a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Nov 2017 13:50:13 -0500 Subject: Remove incorrect link var --- fortran/CMakeLists.txt | 1 - fortran/examples/CMakeLists.txt | 2 -- 2 files changed, 3 deletions(-) diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 9f7144d..075e1da 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_F90 C CXX Fortran) if (H5_HAVE_PARALLEL) - set (LINK_LIBS ${LINK_LIBS} MPI::MPI_Fortran) if (MPI_Fortran_LINK_FLAGS) set (CMAKE_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") endif () diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 119648f..82cbd5c 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -107,7 +107,6 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} - MPI::MPI_Fortran ) target_include_directories (f90_ex_ph5example PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (f90_ex_ph5example PROPERTIES @@ -122,7 +121,6 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (f90_ex_ph5example-shared ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} - MPI::MPI_Fortran ) target_include_directories (f90_ex_ph5example-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (f90_ex_ph5example-shared PROPERTIES -- cgit v0.12 From 21874ce5c201b2be7305599434a156b9fbbcfc89 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Nov 2017 15:06:46 -0500 Subject: Add back Find module and add support files --- config/cmake_ext_mod/FindMPI.cmake | 1461 ++++++++++++++++++++ .../cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in | 4 + config/cmake_ext_mod/FindMPI/libver_mpi.c | 19 + config/cmake_ext_mod/FindMPI/libver_mpi.f90.in | 7 + config/cmake_ext_mod/FindMPI/mpiver.f90.in | 10 + config/cmake_ext_mod/FindMPI/test_mpi.c | 37 + config/cmake_ext_mod/FindMPI/test_mpi.f90.in | 6 + 7 files changed, 1544 insertions(+) create mode 100644 config/cmake_ext_mod/FindMPI.cmake create mode 100644 config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in create mode 100644 config/cmake_ext_mod/FindMPI/libver_mpi.c create mode 100644 config/cmake_ext_mod/FindMPI/libver_mpi.f90.in create mode 100644 config/cmake_ext_mod/FindMPI/mpiver.f90.in create mode 100644 config/cmake_ext_mod/FindMPI/test_mpi.c create mode 100644 config/cmake_ext_mod/FindMPI/test_mpi.f90.in diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake new file mode 100644 index 0000000..61ab4a4 --- /dev/null +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -0,0 +1,1461 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details. + +#.rst: +# FindMPI +# ------- +# +# Find a Message Passing Interface (MPI) implementation. +# +# 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. +# +# Variables for using MPI +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# The module exposes the components ``C``, ``CXX``, ``MPICXX`` and ``Fortran``. +# Each of these controls the various MPI languages to search for. +# The difference between ``CXX`` and ``MPICXX`` is that ``CXX`` refers to the +# MPI C API being usable from C++, whereas ``MPICXX`` refers to the MPI-2 C++ API +# that was removed again in MPI-3. +# +# Depending on the enabled components the following variables will be set: +# +# ``MPI_FOUND`` +# Variable indicating that MPI settings for all requested languages have been found. +# If no components are specified, this is true if MPI settings for all enabled languages +# were detected. Note that the ``MPICXX`` component does not affect this variable. +# ``MPI_VERSION`` +# Minimal version of MPI detected among the requested languages, or all enabled languages +# if no components were specified. +# +# This module will set the following variables per language in your +# project, where ```` is one of C, CXX, or Fortran: +# +# ``MPI__FOUND`` +# Variable indicating the MPI settings for ```` were found and that +# simple MPI test programs compile with the provided settings. +# ``MPI__COMPILER`` +# MPI compiler for ```` if such a program exists. +# ``MPI__COMPILE_OPTIONS`` +# Compilation options for MPI programs in ````, given as a :ref:`;-list `. +# ``MPI__COMPILE_DEFINITIONS`` +# Compilation definitions for MPI programs in ````, given as a :ref:`;-list `. +# ``MPI__INCLUDE_DIRS`` +# 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 ````. +# +# The following variables indicating which bindings are present will be defined: +# +# ``MPI_MPICXX_FOUND`` +# Variable indicating whether the MPI-2 C++ bindings are present (introduced in MPI-2, removed with MPI-3). +# ``MPI_Fortran_HAVE_F77_HEADER`` +# True if the Fortran 77 header ``mpif.h`` is available. +# ``MPI_Fortran_HAVE_F90_MODULE`` +# True if the Fortran 90 module ``mpi`` can be used for accessing MPI (MPI-2 and higher only). +# ``MPI_Fortran_HAVE_F08_MODULE`` +# True if the Fortran 2008 ``mpi_f08`` is available to MPI programs (MPI-3 and higher only). +# +# If possible, the MPI version will be determined by this module. The facilities to detect the MPI version +# were introduced with MPI-1.2, and therefore cannot be found for older MPI versions. +# +# ``MPI__VERSION_MAJOR`` +# Major version of MPI implemented for ```` by the MPI distribution. +# ``MPI__VERSION_MINOR`` +# Minor version of MPI implemented for ```` by the MPI distribution. +# ``MPI__VERSION`` +# MPI version implemented for ```` by the MPI distribution. +# +# Note that there's no variable for the C bindings being accessible through ``mpi.h``, since the MPI standards +# always have required this binding to work in both C and C++ code. +# +# For running MPI programs, the module sets the following variables +# +# ``MPIEXEC_EXECUTABLE`` +# Executable for running MPI programs, if such exists. +# ``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. +# +# Variables for locating MPI +# ^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# This module performs a three step search for an MPI implementation: +# +# 1. Check if the compiler has MPI support built-in. This is the case if the user passed a +# compiler wrapper as ``CMAKE__COMPILER`` or if they're on a Cray system. +# 2. Attempt to find an MPI compiler wrapper and determine the compiler information from it. +# 3. Try to find an MPI implementation that does not ship such a wrapper by guessing settings. +# Currently, only Microsoft MPI and MPICH2 on Windows are supported. +# +# For controlling the second step, the following variables may be set: +# +# ``MPI__COMPILER`` +# Search for the specified compiler wrapper and use it. +# ``MPI__COMPILER_FLAGS`` +# Flags to pass to the MPI compiler wrapper during interrogation. Some compiler wrappers +# support linking debug or tracing libraries if a specific flag is passed and this variable +# may be used to obtain them. +# ``MPI_COMPILER_FLAGS`` +# Used to initialize ``MPI__COMPILER_FLAGS`` if no language specific flag has been given. +# Empty by default. +# ``MPI_EXECUTABLE_SUFFIX`` +# A suffix which is appended to all names that are being looked for. For instance you may set this +# to ``.mpich`` or ``.openmpi`` to prefer the one or the other on Debian and its derivatives. +# +# In order to control the guessing step, the following variable may be set: +# +# ``MPI_GUESS_LIBRARY_NAME`` +# Valid values are ``MSMPI`` and ``MPICH2``. If set, only the given library will be searched for. +# By default, ``MSMPI`` will be preferred over ``MPICH2`` if both are available. +# This also sets ``MPI_SKIP_COMPILER_WRAPPER`` to ``true``, which may be overridden. +# +# Each of the search steps may be skipped with the following control variables: +# +# ``MPI_ASSUME_NO_BUILTIN_MPI`` +# If true, the module assumes that the compiler itself does not provide an MPI implementation and +# skips to step 2. +# ``MPI_SKIP_COMPILER_WRAPPER`` +# If true, no compiler wrapper will be searched for. +# ``MPI_SKIP_GUESSING`` +# If true, the guessing step will be skipped. +# +# Additionally, the following control variable is available to change search behavior: +# +# ``MPI_CXX_SKIP_MPICXX`` +# Add some definitions that will disable the MPI-2 C++ bindings. +# Currently supported are MPICH, Open MPI, Platform MPI and derivatives thereof, +# for example MVAPICH or Intel MPI. +# +# If the find procedure fails for a variable ``MPI__WORKS``, then the settings detected by or passed to +# the module did not work and even a simple MPI test program failed to compile. +# +# If all of these parameters were not sufficient to find the right MPI implementation, a user may +# disable the entire autodetection process by specifying both a list of libraries in ``MPI__LIBRARIES`` +# and a list of include directories in ``MPI__ADDITIONAL_INCLUDE_DIRS``. +# Any other variable may be set in addition to these two. The module will then validate the MPI settings and store the +# settings in the cache. +# +# Cache variables for MPI +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# The variable ``MPI__INCLUDE_DIRS`` will be assembled from the following variables. +# For C and CXX: +# +# ``MPI__HEADER_DIR`` +# Location of the ``mpi.h`` header on disk. +# +# For Fortran: +# +# ``MPI_Fortran_F77_HEADER_DIR`` +# Location of the Fortran 77 header ``mpif.h``, if it exists. +# ``MPI_Fortran_MODULE_DIR`` +# Location of the ``mpi`` or ``mpi_f08`` modules, if available. +# +# For all languages the following variables are additionally considered: +# +# ``MPI__ADDITIONAL_INCLUDE_DIRS`` +# A :ref:`;-list ` of paths needed in addition to the normal include directories. +# ``MPI__INCLUDE_DIR`` +# Path variables for include folders referred to by ````. +# ``MPI__ADDITIONAL_INCLUDE_VARS`` +# A :ref:`;-list ` of ```` that will be added to the include locations of ````. +# +# The variable ``MPI__LIBRARIES`` will be assembled from the following variables: +# +# ``MPI__LIBRARY`` +# The location of a library called ```` for use with MPI. +# ``MPI__LIB_NAMES`` +# A :ref:`;-list ` of ```` that will be added to the include locations of ````. +# +# Usage of mpiexec +# ^^^^^^^^^^^^^^^^ +# +# When using ``MPIEXEC_EXECUTABLE`` to execute MPI applications, you should typically +# use all of the ``MPIEXEC_EXECUTABLE`` flags as follows: +# +# :: +# +# ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} +# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS +# +# where ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to +# pass to the MPI program. +# +# Advanced variables for using MPI +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# The module can perform some advanced feature detections upon explicit request. +# +# **Important notice:** The following checks cannot be performed without *executing* an MPI test program. +# Consider the special considerations for the behavior of :command:`try_run` during cross compilation. +# Moreover, running an MPI program can cause additional issues, like a firewall notification on some systems. +# You should only enable these detections if you absolutely need the information. +# +# If the following variables are set to true, the respective search will be performed: +# +# ``MPI_DETERMINE_Fortran_CAPABILITIES`` +# Determine for all available Fortran bindings what the values of ``MPI_SUBARRAYS_SUPPORTED`` and +# ``MPI_ASYNC_PROTECTS_NONBLOCKING`` are and make their values available as ``MPI_Fortran__SUBARRAYS`` +# and ``MPI_Fortran__ASYNCPROT``, where ```` is one of ``F77_HEADER``, ``F90_MODULE`` and +# ``F08_MODULE``. +# ``MPI_DETERMINE_LIBRARY_VERSION`` +# For each language, find the output of ``MPI_Get_library_version`` and make it available as ``MPI__LIBRARY_VERSION``. +# This information is usually tied to the runtime component of an MPI implementation and might differ depending on ````. +# Note that the return value is entirely implementation defined. This information might be used to identify +# the MPI vendor and for example pick the correct one of multiple third party binaries that matches the MPI vendor. +# +# Backward Compatibility +# ^^^^^^^^^^^^^^^^^^^^^^ +# +# For backward compatibility with older versions of FindMPI, these +# variables are set, but deprecated: +# +# :: +# +# MPI_COMPILER MPI_LIBRARY MPI_EXTRA_LIBRARY +# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_LINK_FLAGS +# MPI_LIBRARIES +# +# In new projects, please use the ``MPI__XXX`` equivalents. +# Additionally, the following variables are deprecated: +# +# ``MPI__COMPILE_FLAGS`` +# Use ``MPI__COMPILE_OPTIONS`` and ``MPI__COMPILE_DEFINITIONS`` instead. +# ``MPI__INCLUDE_PATH`` +# For consumption use ``MPI__INCLUDE_DIRS`` and for specifying folders use ``MPI__ADDITIONAL_INCLUDE_DIRS`` instead. +# ``MPIEXEC`` +# Use ``MPIEXEC_EXECUTABLE`` instead. + +cmake_policy(PUSH) +cmake_policy(SET CMP0057 NEW) # if IN_LIST + +# include this to handle the QUIETLY and REQUIRED arguments +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) +include(GetPrerequisites) + +# Generic compiler names +set(_MPI_C_GENERIC_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) +set(_MPI_CXX_GENERIC_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ + mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) +set(_MPI_Fortran_GENERIC_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r + mpif90 mpif90_r mpf90 mpf90_r + mpif77 mpif77_r mpf77 mpf77_r + mpifc) + +# GNU compiler names +set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r) +set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r mpigxx) +set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpgfortran_r + mpig77 mpig77_r mpg77 mpg77_r) + +# Intel MPI compiler names on Windows +if(WIN32) + list(APPEND _MPI_C_GENERIC_COMPILER_NAMES mpicc.bat) + list(APPEND _MPI_CXX_GENERIC_COMPILER_NAMES mpicxx.bat) + list(APPEND _MPI_Fortran_GENERIC_COMPILER_NAMES mpifc.bat) + + # Intel MPI compiler names + set(_MPI_Intel_C_COMPILER_NAMES mpiicc.bat) + set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc.bat) + set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort.bat mpif77.bat mpif90.bat) + + # Intel MPI compiler names for MSMPI + set(_MPI_MSVC_C_COMPILER_NAMES mpicl.bat) + set(_MPI_MSVC_CXX_COMPILER_NAMES mpicl.bat) +else() + # Intel compiler names + set(_MPI_Intel_C_COMPILER_NAMES mpiicc) + set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++) + set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) +endif() + +# PGI compiler names +set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) +set(_MPI_PGI_CXX_COMPILER_NAMES mpipgCC mppgCC) +set(_MPI_PGI_Fortran_COMPILER_NAMES mpipgf95 mpipgf90 mppgf95 mppgf90 mpipgf77 mppgf77) + +# XLC MPI Compiler names +set(_MPI_XL_C_COMPILER_NAMES mpxlc mpxlc_r mpixlc mpixlc_r) +set(_MPI_XL_CXX_COMPILER_NAMES mpixlcxx mpixlC mpixlc++ mpxlcxx mpxlc++ mpixlc++ mpxlCC + mpixlcxx_r mpixlC_r mpixlc++_r mpxlcxx_r mpxlc++_r mpixlc++_r mpxlCC_r) +set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95_r + mpixlf90 mpixlf90_r mpxlf90 mpxlf90_r + mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r + mpixlf mpixlf_r mpxlf mpxlf_r) + +# Prepend vendor-specific compiler wrappers to the list. If we don't know the compiler, +# attempt all of them. +# By attempting vendor-specific compiler names first, we should avoid situations where the compiler wrapper +# stems from a proprietary MPI and won't know which compiler it's being used for. For instance, Intel MPI +# controls its settings via the I_MPI_CC environment variables if the generic name is being used. +# If we know which compiler we're working with, we can use the most specialized wrapper there is in order to +# pick up the right settings for it. +foreach (LANG IN ITEMS C CXX Fortran) + set(_MPI_${LANG}_COMPILER_NAMES "") + foreach (id IN ITEMS GNU Intel MSVC PGI XL) + if (NOT CMAKE_${LANG}_COMPILER_ID OR CMAKE_${LANG}_COMPILER_ID STREQUAL id) + list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${id}_${LANG}_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) + endif() + unset(_MPI_${id}_${LANG}_COMPILER_NAMES) + endforeach() + list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${LANG}_GENERIC_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) + unset(_MPI_${LANG}_GENERIC_COMPILER_NAMES) +endforeach() + +# Names to try for mpiexec +# Only mpiexec commands are guaranteed to behave as described in the standard, +# mpirun commands are not covered by the standard in any way whatsoever. +# lamexec is the executable for LAM/MPI, srun is for SLURM or Open MPI with SLURM support. +# srun -n X is however a valid command, so it behaves 'like' mpiexec. +set(_MPIEXEC_NAMES_BASE mpiexec mpiexec.hydra mpiexec.mpd mpirun lamexec srun) + +unset(_MPIEXEC_NAMES) +foreach(_MPIEXEC_NAME IN LISTS _MPIEXEC_NAMES_BASE) + list(APPEND _MPIEXEC_NAMES "${_MPIEXEC_NAME}${MPI_EXECUTABLE_SUFFIX}") +endforeach() +unset(_MPIEXEC_NAMES_BASE) + +function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) + if(DEFINED MPI_${LANG}_COMPILER_FLAGS) + separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_${LANG}_COMPILER_FLAGS}") + else() + separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_COMPILER_FLAGS}") + endif() + execute_process( + COMMAND ${MPI_${LANG}_COMPILER} ${_MPI_COMPILER_WRAPPER_OPTIONS} ${QUERY_FLAG} + OUTPUT_VARIABLE WRAPPER_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE WRAPPER_OUTPUT ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE WRAPPER_RETURN) + # Some compiler wrappers will yield spurious zero return values, for example + # Intel MPI tolerates unknown arguments and if the MPI wrappers loads a shared + # library that has invalid or missing version information there would be warning + # messages emitted by ld.so in the compiler output. In either case, we'll treat + # the output as invalid. + if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available") + set(WRAPPER_RETURN 255) + endif() + # Ensure that no error output might be passed upwards. + if(NOT WRAPPER_RETURN EQUAL 0) + unset(WRAPPER_OUTPUT) + endif() + set(${OUTPUT_VARIABLE} "${WRAPPER_OUTPUT}" PARENT_SCOPE) + set(${RESULT_VARIABLE} "${WRAPPER_RETURN}" PARENT_SCOPE) +endfunction() + +function (_MPI_interrogate_compiler lang) + unset(MPI_COMPILE_CMDLINE) + unset(MPI_LINK_CMDLINE) + + unset(MPI_COMPILE_OPTIONS_WORK) + unset(MPI_COMPILE_DEFINITIONS_WORK) + unset(MPI_INCLUDE_DIRS_WORK) + unset(MPI_LINK_FLAGS_WORK) + unset(MPI_LIB_NAMES_WORK) + unset(MPI_LIB_FULLPATHS_WORK) + + # Check whether the -showme:compile option works. This indicates that we have either Open MPI + # or a newer version of LAM/MPI, and implies that -showme:link will also work. + # Open MPI also supports -show, but separates linker and compiler information + _MPI_check_compiler(${LANG} "-showme:compile" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + if (MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-showme:link" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) + + if (NOT MPI_COMPILER_RETURN EQUAL 0) + unset(MPI_COMPILE_CMDLINE) + endif() + endif() + + # MPICH and MVAPICH offer -compile-info and -link-info. + # For modern versions, both do the same as -show. However, for old versions, they do differ + # when called for mpicxx and mpif90 and it's necessary to use them over -show in order to find the + # removed MPI C++ bindings. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-compile-info" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + + if (MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-link-info" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) + + if (NOT MPI_COMPILER_RETURN EQUAL 0) + unset(MPI_COMPILE_CMDLINE) + endif() + endif() + endif() + + # MPICH, MVAPICH2 and Intel MPI just use "-show". Open MPI also offers this, but the + # -showme commands are more specialized. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-show" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + endif() + + # Older versions of LAM/MPI have "-showme". Open MPI also supports this. + # Unknown to MPICH, MVAPICH and Intel MPI. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-showme" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + endif() + + if (NOT (MPI_COMPILER_RETURN EQUAL 0) OR NOT (DEFINED MPI_COMPILE_CMDLINE)) + # Cannot interrogate this compiler, so exit. + set(MPI_${LANG}_WRAPPER_FOUND FALSE PARENT_SCOPE) + return() + endif() + unset(MPI_COMPILER_RETURN) + + # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE + # into MPI_LINK_CMDLINE, if we didn't find the link line. + if (NOT DEFINED MPI_LINK_CMDLINE) + set(MPI_LINK_CMDLINE "${MPI_COMPILE_CMDLINE}") + endif() + + # At this point, we obtained some output from a compiler wrapper that works. + # We'll now try to parse it into variables with meaning to us. + if("${LANG}" STREQUAL "Fortran") + # Some MPICH-1 and MVAPICH-1 versions return a three command answer for Fortran, consisting + # out of a symlink command for mpif.h, the actual compiler command and a deletion of the + # created symlink. We need to detect that case, remember the include path and drop the + # symlink/deletion operation to obtain the link/compile lines we'd usually expect. + if("${MPI_COMPILE_CMDLINE}" MATCHES "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h") + get_filename_component(MPI_INCLUDE_DIRS_WORK "${CMAKE_MATCH_1}" DIRECTORY) + string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") + string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") + string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") + string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") + endif() + endif() + + # The Intel MPI wrapper on Linux will emit some objcopy commands after its compile command + # if -static_mpi was passed to the wrapper. To avoid spurious matches, we need to drop these lines. + if(UNIX) + string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") + string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") + endif() + + # Extract compile options from the compile command line. + string(REGEX MATCHALL "(^| )-f([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_OPTIONS "${MPI_COMPILE_CMDLINE}") + + foreach(_MPI_COMPILE_OPTION IN LISTS MPI_ALL_COMPILE_OPTIONS) + string(REGEX REPLACE "^ " "" _MPI_COMPILE_OPTION "${_MPI_COMPILE_OPTION}") + # Ignore -fstack-protector directives: These occur on MPICH and MVAPICH when the libraries + # themselves were built with this flag. However, this flag is unrelated to using MPI, and + # we won't match the accompanying --param-ssp-size and -Wp,-D_FORTIFY_SOURCE flags and therefore + # produce inconsistent results with the regularly flags. + # Similarly, aliasing flags do not belong into our flag array. + if(NOT "${_MPI_COMPILE_OPTION}" MATCHES "^-f(stack-protector|(no-|)strict-aliasing|PI[CE]|pi[ce])") + list(APPEND MPI_COMPILE_OPTIONS_WORK "${_MPI_COMPILE_OPTION}") + endif() + endforeach() + + # Same deal, with the definitions. We also treat arguments passed to the preprocessor directly. + string(REGEX MATCHALL "(^| )(-Wp,|-Xpreprocessor |)[-/]D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_DEFINITIONS "${MPI_COMPILE_CMDLINE}") + + foreach(_MPI_COMPILE_DEFINITION IN LISTS MPI_ALL_COMPILE_DEFINITIONS) + string(REGEX REPLACE "^ ?(-Wp,|-Xpreprocessor )?[-/]D" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") + string(REPLACE "\"" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") + if(NOT "${_MPI_COMPILE_DEFINITION}" MATCHES "^_FORTIFY_SOURCE.*") + list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${_MPI_COMPILE_DEFINITION}") + endif() + endforeach() + + # Extract include paths from compile command line + string(REGEX MATCHALL "(^| )[-/]I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") + + # If extracting failed to work, we'll try using -showme:incdirs. + if (NOT MPI_ALL_INCLUDE_PATHS) + _MPI_check_compiler(${LANG} "-showme:incdirs" MPI_INCDIRS_CMDLINE MPI_INCDIRS_COMPILER_RETURN) + if(MPI_INCDIRS_COMPILER_RETURN) + separate_arguments(MPI_ALL_INCLUDE_PATHS NATIVE_COMMAND "${MPI_INCDIRS_CMDLINE}") + endif() + endif() + + foreach(_MPI_INCLUDE_PATH IN LISTS MPI_ALL_INCLUDE_PATHS) + string(REGEX REPLACE "^ ?[-/]I" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") + string(REPLACE "\"" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") + get_filename_component(_MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}" REALPATH) + list(APPEND MPI_INCLUDE_DIRS_WORK "${_MPI_INCLUDE_PATH}") + endforeach() + + # Extract linker paths from the link command line + string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker |)(-L|[/-]LIBPATH:|[/-]libpath:)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") + + # If extracting failed to work, we'll try using -showme:libdirs. + if (NOT MPI_ALL_LINK_PATHS) + _MPI_check_compiler(${LANG} "-showme:libdirs" MPI_LIBDIRS_CMDLINE MPI_LIBDIRS_COMPILER_RETURN) + if(MPI_LIBDIRS_COMPILER_RETURN) + separate_arguments(MPI_ALL_LINK_PATHS NATIVE_COMMAND "${MPI_LIBDIRS_CMDLINE}") + endif() + endif() + + foreach(_MPI_LPATH IN LISTS MPI_ALL_LINK_PATHS) + string(REGEX REPLACE "^ ?(-Wl,|-Xlinker )?(-L|[/-]LIBPATH:|[/-]libpath:)" "" _MPI_LPATH "${_MPI_LPATH}") + string(REPLACE "\"" "" _MPI_LPATH "${_MPI_LPATH}") + get_filename_component(_MPI_LPATH "${_MPI_LPATH}" REALPATH) + list(APPEND MPI_LINK_DIRECTORIES_WORK "${_MPI_LPATH}") + endforeach() + + # Extract linker flags from the link command line + string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") + + foreach(_MPI_LINK_FLAG IN LISTS MPI_ALL_LINK_FLAGS) + string(STRIP "${_MPI_LINK_FLAG}" _MPI_LINK_FLAG) + # MPI might be marked to build with non-executable stacks but this should not propagate. + if (NOT "${_MPI_LINK_FLAG}" MATCHES "(-Wl,|-Xlinker )-z,noexecstack") + if (MPI_LINK_FLAGS_WORK) + string(APPEND MPI_LINK_FLAGS_WORK " ${_MPI_LINK_FLAG}") + else() + set(MPI_LINK_FLAGS_WORK "${_MPI_LINK_FLAG}") + endif() + endif() + endforeach() + + # Extract the set of libraries to link against from the link command + # line + string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") + + foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) + string(REGEX REPLACE "^ ?-l" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) + if(NOT "${_MPI_LIB_PATH}" STREQUAL "") + list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") + else() + list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") + endif() + endforeach() + + if(WIN32) + # A compiler wrapper on Windows will just have the name of the + # library to link on its link line, potentially with a full path + string(REGEX MATCHALL "(^| )([^\" ]+\\.lib|\"[^\"]+\\.lib\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") + foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) + string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) + if(NOT "${_MPI_LIB_PATH}" STREQUAL "") + list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") + else() + list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") + endif() + endforeach() + else() + # On UNIX platforms, archive libraries can be given with full path. + string(REGEX MATCHALL "(^| )([^\" ]+\\.a|\"[^\"]+\\.a\")" MPI_LIBFULLPATHS "${MPI_LINK_CMDLINE}") + foreach(_MPI_LIB_NAME IN LISTS MPI_LIBFULLPATHS) + string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) + if(NOT "${_MPI_LIB_PATH}" STREQUAL "") + list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") + else() + list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") + endif() + endforeach() + endif() + + # An MPI compiler wrapper could have its MPI libraries in the implictly + # linked directories of the compiler itself. + if(DEFINED CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) + list(APPEND MPI_LINK_DIRECTORIES_WORK "${CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES}") + endif() + + # Determine full path names for all of the libraries that one needs + # to link against in an MPI program + unset(MPI_PLAIN_LIB_NAMES_WORK) + foreach(_MPI_LIB_NAME IN LISTS MPI_LIB_NAMES_WORK) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_NAME}" NAME_WE) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${MPI_LINK_DIRECTORIES_WORK} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endforeach() + + # Deal with the libraries given with full path next + unset(MPI_DIRECT_LIB_NAMES_WORK) + foreach(_MPI_LIB_FULLPATH IN LISTS MPI_LIB_FULLPATHS_WORK) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME) + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_FULLPATH}" DIRECTORY) + list(APPEND MPI_DIRECT_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_PATH} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endforeach() + if(MPI_DIRECT_LIB_NAMES_WORK) + set(MPI_PLAIN_LIB_NAMES_WORK "${MPI_DIRECT_LIB_NAMES_WORK};${MPI_PLAIN_LIB_NAMES_WORK}") + endif() + + # MPI might require pthread to work. The above mechanism wouldn't detect it, but we need to + # link it in that case. -lpthread is covered by the normal library treatment on the other hand. + if("${MPI_COMPILE_CMDLINE}" MATCHES "-pthread") + list(APPEND MPI_COMPILE_OPTIONS_WORK "-pthread") + if(MPI_LINK_FLAGS_WORK) + string(APPEND MPI_LINK_FLAGS_WORK " -pthread") + else() + set(MPI_LINK_FLAGS_WORK "-pthread") + endif() + endif() + + # If we found MPI, set up all of the appropriate cache entries + if(NOT MPI_${LANG}_COMPILE_OPTIONS) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) + endif() + if(NOT MPI_${LANG}_COMPILE_DEFINITIONS) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_COMPILE_DEFINITIONS_WORK} CACHE STRING "MPI ${LANG} compilation definitions" FORCE) + endif() + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_INCLUDE_DIRS_WORK} CACHE STRING "MPI ${LANG} additional include directories" FORCE) + endif() + if(NOT MPI_${LANG}_LINK_FLAGS) + set(MPI_${LANG}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${LANG} linker flags" FORCE) + endif() + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES ${MPI_PLAIN_LIB_NAMES_WORK} CACHE STRING "MPI ${LANG} libraries to link against" FORCE) + endif() + set(MPI_${LANG}_WRAPPER_FOUND TRUE PARENT_SCOPE) +endfunction() + +function(_MPI_guess_settings LANG) + set(MPI_GUESS_FOUND FALSE) + # Currently only MSMPI and MPICH2 on Windows are supported, so we can skip this search if we're not targeting that. + if(WIN32) + # MSMPI + + # The environment variables MSMPI_INC and MSMPILIB32/64 are the only ways of locating the MSMPI_SDK, + # which is installed separately from the runtime. Thus it's possible to have mpiexec but not MPI headers + # or import libraries and vice versa. + if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MSMPI") + # We first attempt to locate the msmpi.lib. Should be find it, we'll assume that the MPI present is indeed + # Microsoft MPI. + if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB64}") + set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x64") + else() + set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB32}") + set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x86") + endif() + + find_library(MPI_msmpi_LIBRARY + NAMES msmpi + HINTS ${MPI_MSMPI_LIB_PATH} + DOC "Location of the msmpi library for Microsoft MPI") + mark_as_advanced(MPI_msmpi_LIBRARY) + + if(MPI_msmpi_LIBRARY) + # Next, we attempt to locate the MPI header. Note that for Fortran we know that mpif.h is a way + # MSMPI can be used and therefore that header has to be present. + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + get_filename_component(MPI_MSMPI_INC_DIR "$ENV{MSMPI_INC}" REALPATH) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MSMPI_INC_DIR}" CACHE STRING "MPI ${LANG} additional include directories" FORCE) + unset(MPI_MSMPI_INC_DIR) + endif() + + # For MSMPI, one can compile the MPI module by building the mpi.f90 shipped with the MSMPI SDK, + # thus it might be present or provided by the user. Figuring out which is supported is done later on. + # The PGI Fortran compiler for instance ships a prebuilt set of modules in its own include folder. + # Should a user be employing PGI or have built its own set and provided it via cache variables, the + # splitting routine would have located the module files. + + # For C and C++, we're done here (MSMPI does not ship the MPI-2 C++ bindings) - however, for Fortran + # we need some extra library to glue Fortran support together: + # MSMPI ships 2-4 Fortran libraries, each for different Fortran compiler behaviors. The library names + # ending with a c are using the cdecl calling convention, whereas those ending with an s are for Fortran + # implementations using stdcall. Therefore, the 64-bit MSMPI only ships those ending in 'c', whereas the 32-bit + # has both variants available. + # The second difference is the last but one letter, if it's an e(nd), the length of a string argument is + # passed by the Fortran compiler after all other arguments on the parameter list, if it's an m(ixed), + # it's passed immediately after the string address. + + # To summarize: + # - msmpifec: CHARACTER length passed after the parameter list and using cdecl calling convention + # - msmpifmc: CHARACTER length passed directly after string address and using cdecl calling convention + # - msmpifes: CHARACTER length passed after the parameter list and using stdcall calling convention + # - msmpifms: CHARACTER length passed directly after string address and using stdcall calling convention + # 32-bit MSMPI ships all four libraries, 64-bit MSMPI ships only the first two. + + # As is, Intel Fortran and PGI Fortran both use the 'ec' variant of the calling convention, whereas + # the old Compaq Visual Fortran compiler defaulted to the 'ms' version. It's possible to make Intel Fortran + # use the CVF calling convention using /iface:cvf, but we assume - and this is also assumed in FortranCInterface - + # this isn't the case. It's also possible to make CVF use the 'ec' variant, using /iface=(cref,nomixed_str_len_arg). + + # Our strategy is now to locate all libraries, but enter msmpifec into the LIB_NAMES array. + # Should this not be adequate it's a straightforward way for a user to change the LIB_NAMES array and + # have his library found. Still, this should not be necessary outside of exceptional cases, as reasoned. + if ("${LANG}" STREQUAL "Fortran") + set(MPI_MSMPI_CALLINGCONVS c) + if("${CMAKE_SIZEOF_VOID_P}" EQUAL 4) + list(APPEND MPI_MSMPI_CALLINGCONVS s) + endif() + foreach(mpistrlenpos IN ITEMS e m) + foreach(mpicallingconv IN LISTS MPI_MSMPI_CALLINGCONVS) + find_library(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY + NAMES msmpif${mpistrlenpos}${mpicallingconv} + HINTS "${MPI_MSMPI_LIB_PATH}" + DOC "Location of the msmpi${mpistrlenpos}${mpicallingconv} library for Microsoft MPI") + mark_as_advanced(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY) + endforeach() + endforeach() + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES "msmpi;msmpifec" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) + endif() + + # At this point we're *not* done. MSMPI requires an additional include file for Fortran giving the value + # of MPI_AINT. This file is called mpifptr.h located in the x64 and x86 subfolders, respectively. + find_path(MPI_mpifptr_INCLUDE_DIR + NAMES "mpifptr.h" + HINTS "${MPI_MSMPI_INC_PATH_EXTRA}" + DOC "Location of the mpifptr.h extra header for Microsoft MPI") + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS "mpifptr" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) + endif() + mark_as_advanced(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS MPI_mpifptr_INCLUDE_DIR) + else() + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES "msmpi" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) + endif() + endif() + mark_as_advanced(MPI_${LANG}_LIB_NAMES) + set(MPI_GUESS_FOUND TRUE) + endif() + endif() + + # At this point there's not many MPIs that we could still consider. + # OpenMPI 1.6.x and below supported Windows, but these ship compiler wrappers that still work. + # The only other relevant MPI implementation without a wrapper is MPICH2, which had Windows support in 1.4.1p1 and older. + if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MPICH2") + set(MPI_MPICH_PREFIX_PATHS + "$ENV{ProgramW6432}/MPICH2/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/../lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]/lib" + ) + + # All of C, C++ and Fortran will need mpi.lib, so we'll look for this first + find_library(MPI_mpi_LIBRARY + NAMES mpi + HINTS ${MPI_MPICH_PREFIX_PATHS}) + mark_as_advanced(MPI_mpi_LIBRARY) + # If we found mpi.lib, we detect the rest of MPICH2 + if(MPI_mpi_LIBRARY) + set(MPI_MPICH_LIB_NAMES "mpi") + # If MPI-2 C++ bindings are requested, we need to locate cxx.lib as well. + # Otherwise, MPICH_SKIP_MPICXX will be defined and these bindings aren't needed. + if("${LANG}" STREQUAL "CXX" AND NOT MPI_CXX_SKIP_MPICXX) + find_library(MPI_cxx_LIBRARY + NAMES cxx + HINTS ${MPI_MPICH_PREFIX_PATHS}) + mark_as_advanced(MPI_cxx_LIBRARY) + list(APPEND MPI_MPICH_LIB_NAMES "cxx") + # For Fortran, MPICH2 provides three different libraries: + # fmpich2.lib which uses uppercase symbols and cdecl, + # fmpich2s.lib which uses uppercase symbols and stdcall (32-bit only), + # fmpich2g.lib which uses lowercase symbols with double underscores and cdecl. + # fmpich2s.lib would be useful for Compaq Visual Fortran, fmpich2g.lib has to be used with GNU g77 and is also + # provided in the form of an .a archive for MinGW and Cygwin. From our perspective, fmpich2.lib is the only one + # we need to try, and if it doesn't work with the given Fortran compiler we'd find out later on during validation + elseif("${LANG}" STREQUAL "Fortran") + find_library(MPI_fmpich2_LIBRARY + NAMES fmpich2 + HINTS ${MPI_MPICH_PREFIX_PATHS}) + find_library(MPI_fmpich2s_LIBRARY + NAMES fmpich2s + HINTS ${MPI_MPICH_PREFIX_PATHS}) + find_library(MPI_fmpich2g_LIBRARY + NAMES fmpich2g + HINTS ${MPI_MPICH_PREFIX_PATHS}) + mark_as_advanced(MPI_fmpich2_LIBRARY MPI_fmpich2s_LIBRARY MPI_fmpich2g_LIBRARY) + list(APPEND MPI_MPICH_LIB_NAMES "fmpich2") + endif() + + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES "${MPI_MPICH_LIB_NAMES}" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) + endif() + unset(MPI_MPICH_LIB_NAMES) + + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + # For MPICH2, the include folder would be in ../include relative to the library folder. + get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_mpi_LIBRARY}" DIRECTORY) + get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_MPICH_ROOT_DIR}" DIRECTORY) + if(IS_DIRECTORY "${MPI_MPICH_ROOT_DIR}/include") + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MPICH_ROOT_DIR}/include" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) + endif() + unset(MPI_MPICH_ROOT_DIR) + endif() + set(MPI_GUESS_FOUND TRUE) + endif() + unset(MPI_MPICH_PREFIX_PATHS) + endif() + endif() + set(MPI_${LANG}_GUESS_FOUND "${MPI_GUESS_FOUND}" PARENT_SCOPE) +endfunction() + +function(_MPI_adjust_compile_definitions LANG) + if("${LANG}" STREQUAL "CXX") + # To disable the C++ bindings, we need to pass some definitions since the mpi.h header has to deal with both C and C++ + # bindings in MPI-2. + if(MPI_CXX_SKIP_MPICXX AND NOT MPI_${LANG}_COMPILE_DEFINITIONS MATCHES "SKIP_MPICXX") + # MPICH_SKIP_MPICXX is being used in MPICH and derivatives like MVAPICH or Intel MPI + # OMPI_SKIP_MPICXX is being used in Open MPI + # _MPICC_H is being used for IBM Platform MPI + list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX" "OMPI_SKIP_MPICXX" "_MPICC_H") + set(MPI_${LANG}_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}" CACHE STRING "MPI ${LANG} compilation definitions" FORCE) + endif() + endif() +endfunction() + +macro(_MPI_assemble_libraries LANG) + set(MPI_${LANG}_LIBRARIES "") + foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) + endforeach() +endmacro() + +macro(_MPI_assemble_include_dirs LANG) + set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") + if("${LANG}" MATCHES "(C|CXX)") + if(MPI_${LANG}_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + else() # Fortran + if(MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + endif() + if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + endif() + endif() + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}") + endforeach() + endif() +endmacro() + +function(_MPI_split_include_dirs LANG) + # Backwards compatibility: Search INCLUDE_PATH if given. + if(MPI_${LANG}_INCLUDE_PATH) + list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") + endif() + + # We try to find the headers/modules among those paths (and system paths) + # For C/C++, we just need to have a look for mpi.h. + if("${LANG}" MATCHES "(C|CXX)") + find_path(MPI_${LANG}_HEADER_DIR "mpi.h" + HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} + ) + mark_as_advanced(MPI_${LANG}_HEADER_DIR) + if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + # Fortran is more complicated here: An implementation could provide + # any of the Fortran 77/90/2008 APIs for MPI. For example, MSMPI + # only provides Fortran 77 and - if mpi.f90 is built - potentially + # a Fortran 90 module. + elseif("${LANG}" STREQUAL "Fortran") + find_path(MPI_${LANG}_F77_HEADER_DIR "mpif.h" + HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} + ) + find_path(MPI_${LANG}_MODULE_DIR + NAMES "mpi.mod" "mpi_f08.mod" + HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} + ) + if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS + "${MPI_${LANG}_F77_HEADER_DIR}" + "${MPI_${LANG}_MODULE_DIR}" + ) + endif() + mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) + endif() + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) +endfunction() + +macro(_MPI_create_imported_target LANG) + if(NOT TARGET MPI::MPI_${LANG}) + add_library(MPI::MPI_${LANG} INTERFACE IMPORTED) + endif() + + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}") + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}") + + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "") + if(MPI_${LANG}_LINK_FLAGS) + set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LINK_FLAGS}") + endif() + # If the compiler links MPI implicitly, no libraries will be found as they're contained within + # CMAKE__IMPLICIT_LINK_LIBRARIES already. + if(MPI_${LANG}_LIBRARIES) + set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LIBRARIES}") + endif() + # Given the new design of FindMPI, INCLUDE_DIRS will always be located, even under implicit linking. + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${MPI_${LANG}_INCLUDE_DIRS}") +endmacro() + +function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY) + set(WORK_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI") + set(SRC_DIR "${CMAKE_ROOT}/Modules/FindMPI") + set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI/${MPI_TEST_FILE_NAME}_${LANG}.bin") + unset(MPI_TEST_COMPILE_DEFINITIONS) + if("${LANG}" STREQUAL "Fortran") + if("${MODE}" STREQUAL "F90_MODULE") + set(MPI_Fortran_INCLUDE_LINE "use mpi\n implicit none") + elseif("${MODE}" STREQUAL "F08_MODULE") + set(MPI_Fortran_INCLUDE_LINE "use mpi_f08\n implicit none") + else() # F77 header + set(MPI_Fortran_INCLUDE_LINE "implicit none\n include 'mpif.h'") + endif() + configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.f90.in" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90" @ONLY) + set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90") + elseif("${LANG}" STREQUAL "CXX") + configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.c" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp" COPYONLY) + set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp") + if("${MODE}" STREQUAL "TEST_MPICXX") + set(MPI_TEST_COMPILE_DEFINITIONS TEST_MPI_MPICXX) + endif() + else() # C + set(MPI_TEST_SOURCE_FILE "${SRC_DIR}/${MPI_TEST_FILE_NAME}.c") + endif() + if(RUN_BINARY) + try_run(MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} + "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" + COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} + LINK_LIBRARIES MPI::MPI_${LANG} + RUN_OUTPUT_VARIABLE MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}) + set(MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} "${MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}}" PARENT_SCOPE) + else() + try_compile(MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} + "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" + COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} + LINK_LIBRARIES MPI::MPI_${LANG} + COPY_FILE "${BIN_FILE}") + endif() +endfunction() + +macro(_MPI_check_lang_works LANG) + # For Fortran we may have by the MPI-3 standard an implementation that provides: + # - the mpi_f08 module + # - *both*, the mpi module and 'mpif.h' + # Since older MPI standards (MPI-1) did not define anything but 'mpif.h', we need to check all three individually. + if( NOT MPI_${LANG}_WORKS ) + if("${LANG}" STREQUAL "Fortran") + set(MPI_Fortran_INTEGER_LINE "(kind=MPI_INTEGER_KIND)") + _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER FALSE) + _MPI_try_staged_settings(${LANG} test_mpi F90_MODULE FALSE) + _MPI_try_staged_settings(${LANG} test_mpi F08_MODULE FALSE) + + set(MPI_${LANG}_WORKS FALSE) + + foreach(mpimethod IN ITEMS F77_HEADER F08_MODULE F90_MODULE) + if(MPI_RESULT_${LANG}_test_mpi_${mpimethod}) + set(MPI_${LANG}_WORKS TRUE) + set(MPI_${LANG}_HAVE_${mpimethod} TRUE) + else() + set(MPI_${LANG}_HAVE_${mpimethod} FALSE) + endif() + endforeach() + # MPI-1 versions had no MPI_INTGER_KIND defined, so we need to try without it. + # However, MPI-1 also did not define the Fortran 90 and 08 modules, so we only try the F77 header. + unset(MPI_Fortran_INTEGER_LINE) + if(NOT MPI_${LANG}_WORKS) + _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER_NOKIND FALSE) + if(MPI_RESULT_${LANG}_test_mpi_F77_HEADER_NOKIND) + set(MPI_${LANG}_WORKS TRUE) + set(MPI_${LANG}_HAVE_F77_HEADER TRUE) + endif() + endif() + else() + _MPI_try_staged_settings(${LANG} test_mpi normal FALSE) + # If 'test_mpi' built correctly, we've found valid MPI settings. There might not be MPI-2 C++ support, but there can't + # be MPI-2 C++ support without the C bindings being present, so checking for them is sufficient. + set(MPI_${LANG}_WORKS "${MPI_RESULT_${LANG}_test_mpi_normal}") + endif() + endif() +endmacro() + +# Some systems install various MPI implementations in separate folders in some MPI prefix +# This macro enumerates all such subfolders and adds them to the list of hints that will be searched. +macro(MPI_search_mpi_prefix_folder PREFIX_FOLDER) + if(EXISTS "${PREFIX_FOLDER}") + file(GLOB _MPI_folder_children RELATIVE "${PREFIX_FOLDER}" "${PREFIX_FOLDER}/*") + foreach(_MPI_folder_child IN LISTS _MPI_folder_children) + if(IS_DIRECTORY "${PREFIX_FOLDER}/${_MPI_folder_child}") + list(APPEND MPI_HINT_DIRS "${PREFIX_FOLDER}/${_MPI_folder_child}") + endif() + endforeach() + endif() +endmacro() + +set(MPI_HINT_DIRS ${MPI_HOME} $ENV{MPI_HOME} $ENV{I_MPI_ROOT}) +if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") + # SUSE Linux Enterprise Server stores its MPI implementations under /usr/lib64/mpi/gcc/ + # We enumerate the subfolders and append each as a prefix + MPI_search_mpi_prefix_folder("/usr/lib64/mpi/gcc") +elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") + # MSMPI stores its runtime in a special folder, this adds the possible locations to the hints. + list(APPEND MPI_HINT_DIRS $ENV{MSMPI_BIN} "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]") +elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") + # FreeBSD ships mpich under the normal system paths - but available openmpi implementations + # will be found in /usr/local/mpi/ + MPI_search_mpi_prefix_folder("/usr/local/mpi/") +endif() + +# Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. +# The MPI standard does not mandate the existence of either, but instead only makes requirements if a distribution +# ships an mpiexec program (mpirun executables are not regulated by the standard). +find_program(MPIEXEC_EXECUTABLE + NAMES ${_MPIEXEC_NAMES} + PATH_SUFFIXES bin sbin + HINTS ${MPI_HINT_DIRS} + DOC "Executable for running MPI programs.") + +# call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin). +# This gives us a fairly reliable base directory to search for /bin /lib and /include from. +get_filename_component(_MPI_BASE_DIR "${MPIEXEC_EXECUTABLE}" PATH) +get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH) + +# 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 be placed after all flags passed to mpiexec.") + +# Set the number of processes to the physical processor count +cmake_host_system_information(RESULT _MPIEXEC_NUMPROCS QUERY NUMBER_OF_PHYSICAL_CORES) +set(MPIEXEC_MAX_NUMPROCS "${_MPIEXEC_NUMPROCS}" CACHE STRING "Maximum number of processors available to run MPI applications.") +unset(_MPIEXEC_NUMPROCS) +mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) + +#============================================================================= +# Backward compatibility input hacks. Propagate the FindMPI hints to C and +# CXX if the respective new versions are not defined. Translate the old +# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${LANG}_LIBRARIES. +# +# Once we find the new variables, we translate them back into their old +# equivalents below. +foreach (LANG IN ITEMS C CXX) + # Old input variables. + set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) + + # Set new vars based on their old equivalents, if the new versions are not already set. + foreach (var ${_MPI_OLD_INPUT_VARS}) + if (NOT MPI_${LANG}_${var} AND MPI_${var}) + set(MPI_${LANG}_${var} "${MPI_${var}}") + endif() + endforeach() + + # Chop the old compile flags into options and definitions + if(MPI_${LANG}_COMPILE_FLAGS) + unset(MPI_${LANG}_COMPILE_OPTIONS) + unset(MPI_${LANG}_COMPILE_DEFINITIONS) + separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") + foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) + if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") + list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") + else() + list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}") + endif() + endforeach() + unset(MPI_SEPARATE_FLAGS) + endif() + + # If a list of libraries was given, we'll split it into new-style cache variables + if(NOT MPI_${LANG}_LIB_NAMES) + foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) + get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endforeach() + endif() +endforeach() +#============================================================================= + +unset(MPI_VERSION) +unset(MPI_VERSION_MAJOR) +unset(MPI_VERSION_MINOR) + +unset(_MPI_MIN_VERSION) + +# This loop finds the compilers and sends them off for interrogation. +foreach(LANG IN ITEMS C CXX Fortran) + if(CMAKE_${LANG}_COMPILER_LOADED) + if(NOT MPI_FIND_COMPONENTS) + set(_MPI_FIND_${LANG} TRUE) + elseif( ${LANG} IN_LIST MPI_FIND_COMPONENTS) + set(_MPI_FIND_${LANG} TRUE) + elseif( ${LANG} STREQUAL CXX AND NOT MPI_CXX_SKIP_MPICXX AND MPICXX IN_LIST MPI_FIND_COMPONENTS ) + set(_MPI_FIND_${LANG} TRUE) + else() + set(_MPI_FIND_${LANG} FALSE) + endif() + else() + set(_MPI_FIND_${LANG} FALSE) + endif() + if(_MPI_FIND_${LANG}) + if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS ) + set(MPI_CXX_SKIP_MPICXX FALSE CACHE BOOL "If true, the MPI-2 C++ bindings are disabled using definitions.") + mark_as_advanced(MPI_CXX_SKIP_MPICXX) + endif() + if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) + if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) + # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. + # Cray PrgEnv. + _MPI_create_imported_target(${LANG}) + _MPI_check_lang_works(${LANG}) + + # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. + if(MPI_${LANG}_WORKS) + set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) + endif() + endif() + + # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. + if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) + set(MPI_SKIP_COMPILER_WRAPPER TRUE) + endif() + if(NOT MPI_SKIP_COMPILER_WRAPPER) + if(MPI_${LANG}_COMPILER) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") + unset(MPI_${LANG}_COMPILER CACHE) + endif() + # If the user specifies a compiler, we don't want to try to search libraries either. + set(MPI_PINNED_COMPILER TRUE) + else() + set(MPI_PINNED_COMPILER FALSE) + endif() + + # If we have an MPI base directory, we'll try all compiler names in that one first. + # This should prevent mixing different MPI environments + if(_MPI_BASE_DIR) + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + HINTS ${_MPI_BASE_DIR} + NO_DEFAULT_PATH + DOC "MPI compiler for ${LANG}" + ) + endif() + + # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), + # we shall try searching in the default paths. + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + DOC "MPI compiler for ${LANG}" + ) + + if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + set(MPI_SKIP_GUESSING TRUE) + elseif(MPI_${LANG}_COMPILER) + _MPI_interrogate_compiler(${LANG}) + else() + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + endif() + else() + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + set(MPI_PINNED_COMPILER FALSE) + endif() + + if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) + # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the + # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. + if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) + set(MPI_${LANG}_WRAPPER_FOUND TRUE) + elseif(NOT MPI_SKIP_GUESSING) + _MPI_guess_settings(${LANG}) + endif() + endif() + endif() + + _MPI_split_include_dirs(${LANG}) + if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + _MPI_assemble_include_dirs(${LANG}) + _MPI_assemble_libraries(${LANG}) + endif() + _MPI_adjust_compile_definitions(${LANG}) + # We always create imported targets even if they're empty + _MPI_create_imported_target(${LANG}) + + if(NOT MPI_${LANG}_WORKS) + _MPI_check_lang_works(${LANG}) + endif() + + # Next, we'll initialize the MPI variables that have not been previously set. + set(MPI_${LANG}_COMPILE_OPTIONS "" CACHE STRING "MPI ${LANG} compilation flags" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS + MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) + + # If we've found MPI, then we'll perform additional analysis: Determine the MPI version, MPI library version, supported + # MPI APIs (i.e. MPI-2 C++ bindings). For Fortran we also need to find specific parameters if we're under MPI-3. + if(MPI_${LANG}_WORKS) + if("${LANG}" STREQUAL "CXX" AND NOT DEFINED MPI_MPICXX_FOUND) + if(NOT MPI_CXX_SKIP_MPICXX AND NOT MPI_CXX_VALIDATE_SKIP_MPICXX) + _MPI_try_staged_settings(${LANG} test_mpi MPICXX FALSE) + if(MPI_RESULT_${LANG}_test_mpi_MPICXX) + set(MPI_MPICXX_FOUND TRUE) + else() + set(MPI_MPICXX_FOUND FALSE) + endif() + else() + set(MPI_MPICXX_FOUND FALSE) + endif() + endif() + + # At this point, we know the bindings present but not the MPI version or anything else. + if(NOT DEFINED MPI_${LANG}_VERSION) + unset(MPI_${LANG}_VERSION_MAJOR) + unset(MPI_${LANG}_VERSION_MINOR) + endif() + set(MPI_BIN_FOLDER ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI) + + # For Fortran, we'll want to use the most modern MPI binding to test capabilities other than the + # Fortran parameters, since those depend on the method of consumption. + # For C++, we can always use the C bindings, and should do so, since the C++ bindings do not exist in MPI-3 + # whereas the C bindings do, and the C++ bindings never offered any feature advantage over their C counterparts. + if("${LANG}" STREQUAL "Fortran") + if(MPI_${LANG}_HAVE_F08_MODULE) + set(MPI_${LANG}_HIGHEST_METHOD F08_MODULE) + elseif(MPI_${LANG}_HAVE_F90_MODULE) + set(MPI_${LANG}_HIGHEST_METHOD F90_MODULE) + else() + set(MPI_${LANG}_HIGHEST_METHOD F77_HEADER) + endif() + + # Another difference between C and Fortran is that we can't use the preprocessor to determine whether MPI_VERSION + # and MPI_SUBVERSION are provided. These defines did not exist in MPI 1.0 and 1.1 and therefore might not + # exist. For C/C++, test_mpi.c will handle the MPI_VERSION extraction, but for Fortran, we need mpiver.f90. + if(NOT DEFINED MPI_${LANG}_VERSION) + _MPI_try_staged_settings(${LANG} mpiver ${MPI_${LANG}_HIGHEST_METHOD} FALSE) + if(MPI_RESULT_${LANG}_mpiver_${MPI_${LANG}_HIGHEST_METHOD}) + file(STRINGS ${MPI_BIN_FOLDER}/mpiver_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") + if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") + set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") + set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") + endif() + endif() + endif() + + # Finally, we want to find out which capabilities a given interface supports, compare the MPI-3 standard. + # This is determined by interface specific parameters MPI_SUBARRAYS_SUPPORTED and MPI_ASYNC_PROTECTS_NONBLOCKING + # and might vary between the different methods of consumption. + if(MPI_DETERMINE_Fortran_CAPABILITIES AND NOT MPI_Fortran_CAPABILITIES_DETERMINED) + foreach(mpimethod IN ITEMS F08_MODULE F90_MODULE F77_HEADER) + if(MPI_${LANG}_HAVE_${mpimethod}) + set(MPI_${LANG}_${mpimethod}_SUBARRAYS FALSE) + set(MPI_${LANG}_${mpimethod}_ASYNCPROT FALSE) + _MPI_try_staged_settings(${LANG} fortranparam_mpi ${mpimethod} TRUE) + if(MPI_RESULT_${LANG}_fortranparam_mpi_${mpimethod} AND + NOT "${MPI_RUN_RESULT_${LANG}_fortranparam_mpi_${mpimethod}}" STREQUAL "FAILED_TO_RUN") + if("${MPI_RUN_OUTPUT_${LANG}_fortranparam_mpi_${mpimethod}}" MATCHES + ".*INFO:SUBARRAYS\\[ *([TF]) *\\]-ASYNCPROT\\[ *([TF]) *\\].*") + if("${CMAKE_MATCH_1}" STREQUAL "T") + set(MPI_${LANG}_${mpimethod}_SUBARRAYS TRUE) + endif() + if("${CMAKE_MATCH_2}" STREQUAL "T") + set(MPI_${LANG}_${mpimethod}_ASYNCPROT TRUE) + endif() + endif() + endif() + endif() + endforeach() + set(MPI_Fortran_CAPABILITIES_DETERMINED TRUE) + endif() + else() + set(MPI_${LANG}_HIGHEST_METHOD normal) + + # By the MPI-2 standard, MPI_VERSION and MPI_SUBVERSION are valid for both C and C++ bindings. + if(NOT DEFINED MPI_${LANG}_VERSION) + file(STRINGS ${MPI_BIN_FOLDER}/test_mpi_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") + if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") + set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") + set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") + endif() + endif() + endif() + + unset(MPI_BIN_FOLDER) + + # At this point, we have dealt with determining the MPI version and parameters for each Fortran method available. + # The one remaining issue is to determine which MPI library is installed. + # Determining the version and vendor of the MPI library is only possible via MPI_Get_library_version() at runtime, + # and therefore we cannot do this while cross-compiling (a user may still define MPI__LIBRARY_VERSION_STRING + # themselves and we'll attempt splitting it, which is equivalent to provide the try_run output). + # It's also worth noting that the installed version string can depend on the language, or on the system the binary + # runs on if MPI is not statically linked. + if(MPI_DETERMINE_LIBRARY_VERSION AND NOT MPI_${LANG}_LIBRARY_VERSION_STRING) + _MPI_try_staged_settings(${LANG} libver_mpi ${MPI_${LANG}_HIGHEST_METHOD} TRUE) + if(MPI_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD} AND + "${MPI_RUN_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" EQUAL "0") + string(STRIP "${MPI_RUN_OUTPUT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" + MPI_${LANG}_LIBRARY_VERSION_STRING) + else() + set(MPI_${LANG}_LIBRARY_VERSION_STRING "NOTFOUND") + endif() + endif() + endif() + + set(MPI_${LANG}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) + set(MPI_${LANG}_FIND_VERSION ${MPI_FIND_VERSION}) + set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) + + unset(MPI_${LANG}_REQUIRED_VARS) + if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND) + foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") + endforeach() + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_LIB_NAMES") + if("${LANG}" STREQUAL "Fortran") + # For Fortran we only need one of the module or header directories to have *some* support for MPI. + if(NOT MPI_${LANG}_MODULE_DIR) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_F77_HEADER_DIR") + endif() + if(NOT MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_MODULE_DIR") + endif() + else() + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_HEADER_DIR") + endif() + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(mpiincvar IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpiincvar}_INCLUDE_DIR") + endforeach() + endif() + # Append the works variable now. If the settings did not work, this will show up properly. + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") + else() + # If the compiler worked implicitly, use its path as output. + # Should the compiler variable be set, we also require it to work. + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_COMPILER") + if(MPI_${LANG}_COMPILER) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") + endif() + endif() + find_package_handle_standard_args(MPI_${LANG} REQUIRED_VARS ${MPI_${LANG}_REQUIRED_VARS} + VERSION_VAR MPI_${LANG}_VERSION) + + if(DEFINED MPI_${LANG}_VERSION) + if(NOT _MPI_MIN_VERSION OR _MPI_MIN_VERSION VERSION_GREATER MPI_${LANG}_VERSION) + set(_MPI_MIN_VERSION MPI_${LANG}_VERSION) + endif() + endif() + endif() +endforeach() + +unset(_MPI_REQ_VARS) +foreach(LANG IN ITEMS C CXX Fortran) + if((NOT MPI_FIND_COMPONENTS AND CMAKE_${LANG}_COMPILER_LOADED) OR LANG IN_LIST MPI_FIND_COMPONENTS) + list(APPEND _MPI_REQ_VARS "MPI_${LANG}_FOUND") + endif() +endforeach() + +if(MPICXX IN_LIST MPI_FIND_COMPONENTS) + list(APPEND _MPI_REQ_VARS "MPI_MPICXX_FOUND") +endif() + +find_package_handle_standard_args(MPI + REQUIRED_VARS ${_MPI_REQ_VARS} + VERSION_VAR ${_MPI_MIN_VERSION} + HANDLE_COMPONENTS) + +#============================================================================= +# More backward compatibility stuff + +# For compatibility reasons, we also define MPIEXEC +set(MPIEXEC "${MPIEXEC_EXECUTABLE}") + +# Copy over MPI__INCLUDE_PATH from the assembled INCLUDE_DIRS. +foreach(LANG IN ITEMS C CXX Fortran) + if(MPI_${LANG}_FOUND) + set(MPI_${LANG}_INCLUDE_PATH "${MPI_${LANG}_INCLUDE_DIRS}") + unset(MPI_${LANG}_COMPILE_FLAGS) + if(MPI_${LANG}_COMPILE_OPTIONS) + set(MPI_${LANG}_COMPILE_FLAGS "${MPI_${LANG}_COMPILE_OPTIONS}") + endif() + if(MPI_${LANG}_COMPILE_DEFINITIONS) + foreach(_MPI_DEF IN LISTS MPI_${LANG}_COMPILE_DEFINITIONS) + string(APPEND MPI_${LANG}_COMPILE_FLAGS " -D${_MPI_DEF}") + endforeach() + endif() + endif() +endforeach() + +# Bare MPI sans ${LANG} vars are set to CXX then C, depending on what was found. +# This mimics the behavior of the old language-oblivious FindMPI. +set(_MPI_OLD_VARS COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES) +if (MPI_CXX_FOUND) + foreach (var ${_MPI_OLD_VARS}) + set(MPI_${var} ${MPI_CXX_${var}}) + endforeach() +elseif (MPI_C_FOUND) + foreach (var ${_MPI_OLD_VARS}) + set(MPI_${var} ${MPI_C_${var}}) + endforeach() +endif() + +# Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and MPI_EXTRA_LIBRARY, and set them in cache. +if (MPI_LIBRARIES) + list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK) + set(MPI_LIBRARY "${MPI_LIBRARY_WORK}") + unset(MPI_LIBRARY_WORK) +else() + set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND") +endif() + +list(LENGTH MPI_LIBRARIES MPI_NUMLIBS) +if (MPI_NUMLIBS GREATER 1) + set(MPI_EXTRA_LIBRARY_WORK "${MPI_LIBRARIES}") + list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0) + set(MPI_EXTRA_LIBRARY "${MPI_EXTRA_LIBRARY_WORK}") + unset(MPI_EXTRA_LIBRARY_WORK) +else() + set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") +endif() +#============================================================================= + +# unset these vars to cleanup namespace +unset(_MPI_OLD_VARS) +unset(_MPI_PREFIX_PATH) +unset(_MPI_BASE_DIR) +foreach (lang C CXX Fortran) + unset(_MPI_${LANG}_COMPILER_NAMES) +endforeach() + +cmake_policy(POP) diff --git a/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in b/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in new file mode 100644 index 0000000..30f912c --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in @@ -0,0 +1,4 @@ + program mpi_ver + @MPI_Fortran_INCLUDE_LINE@ + print *, 'INFO:SUBARRAYS[', MPI_SUBARRAYS_SUPPORTED, ']-ASYNCPROT[', MPI_ASYNC_PROTECTS_NONBLOCKING, ']' + end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/libver_mpi.c b/config/cmake_ext_mod/FindMPI/libver_mpi.c new file mode 100644 index 0000000..be9d19d --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/libver_mpi.c @@ -0,0 +1,19 @@ +#include + +#ifdef __cplusplus +#include +#else +#include +#endif + +int main(int argc, char* argv[]) +{ + char mpilibver_str[MPI_MAX_LIBRARY_VERSION_STRING]; + int mpilibver_len; + MPI_Get_library_version(mpilibver_str, &mpilibver_len); +#ifdef __cplusplus + std::puts(mpilibver_str); +#else + puts(mpilibver_str); +#endif +} diff --git a/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in b/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in new file mode 100644 index 0000000..7938587 --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in @@ -0,0 +1,7 @@ + program mpi_ver + @MPI_Fortran_INCLUDE_LINE@ + character(len=MPI_MAX_LIBRARY_VERSION_STRING) :: mpilibver_str + integer(kind=MPI_INTEGER_KIND) :: ierror, reslen + call MPI_GET_LIBRARY_VERSION(mpilibver_str, reslen, ierror) + print *, mpilibver_str + end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/mpiver.f90.in b/config/cmake_ext_mod/FindMPI/mpiver.f90.in new file mode 100644 index 0000000..a254523 --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/mpiver.f90.in @@ -0,0 +1,10 @@ + program mpi_ver + @MPI_Fortran_INCLUDE_LINE@ + integer(kind=kind(MPI_VERSION)), parameter :: zero = ichar('0') + character, dimension(17), parameter :: mpiver_str =& + (/ 'I', 'N', 'F', 'O', ':', 'M', 'P', 'I', '-', 'V', 'E', 'R', '[', & + char(zero + MPI_VERSION), & + '.', & + char(zero + MPI_SUBVERSION), ']' /) + print *, mpiver_str + end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/test_mpi.c b/config/cmake_ext_mod/FindMPI/test_mpi.c new file mode 100644 index 0000000..b8a308a --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/test_mpi.c @@ -0,0 +1,37 @@ +#include + +#ifdef __cplusplus +#include +#else +#include +#endif + +#if defined(MPI_VERSION) && defined(MPI_SUBVERSION) +const char mpiver_str[] = { 'I', 'N', + 'F', 'O', + ':', 'M', + 'P', 'I', + '-', 'V', + 'E', 'R', + '[', ('0' + MPI_VERSION), + '.', ('0' + MPI_SUBVERSION), + ']', '\0' }; +#endif + +int main(int argc, char* argv[]) +{ +#if defined(MPI_VERSION) && defined(MPI_SUBVERSION) +#ifdef __cplusplus + std::puts(mpiver_str); +#else + puts(mpiver_str); +#endif +#endif +#ifdef TEST_MPI_MPICXX + MPI::MPI_Init(&argc, &argv); + MPI::MPI_Finalize(); +#else + MPI_Init(&argc, &argv); + MPI_Finalize(); +#endif +} diff --git a/config/cmake_ext_mod/FindMPI/test_mpi.f90.in b/config/cmake_ext_mod/FindMPI/test_mpi.f90.in new file mode 100644 index 0000000..4d43a04 --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/test_mpi.f90.in @@ -0,0 +1,6 @@ + program hello + @MPI_Fortran_INCLUDE_LINE@ + integer@MPI_Fortran_INTEGER_LINE@ ierror + call MPI_INIT(ierror) + call MPI_FINALIZE(ierror) + end program -- cgit v0.12 From 7222e5f6a3efee53f6747bc66072129b11c529fe Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Nov 2017 15:16:37 -0500 Subject: Change to local path --- config/cmake_ext_mod/FindMPI.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index 61ab4a4..b67bcae 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -911,7 +911,7 @@ endmacro() function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY) set(WORK_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI") - set(SRC_DIR "${CMAKE_ROOT}/Modules/FindMPI") + set(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/Modules/FindMPI") set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI/${MPI_TEST_FILE_NAME}_${LANG}.bin") unset(MPI_TEST_COMPILE_DEFINITIONS) if("${LANG}" STREQUAL "Fortran") -- cgit v0.12 From 3de5fa266216fd67999e0ddfcbaad12d4a6d9175 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Nov 2017 15:24:35 -0500 Subject: Correct path --- config/cmake_ext_mod/FindMPI.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index b67bcae..8084472 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -911,7 +911,7 @@ endmacro() function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY) set(WORK_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI") - set(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/Modules/FindMPI") + set(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/FindMPI") set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI/${MPI_TEST_FILE_NAME}_${LANG}.bin") unset(MPI_TEST_COMPILE_DEFINITIONS) if("${LANG}" STREQUAL "Fortran") -- cgit v0.12 From a862d195c35730bdef924a776531e2879678a7a6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Nov 2017 16:11:03 -0500 Subject: Correct path --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20ff228..2ec2b2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -630,8 +630,8 @@ if (HDF5_ENABLE_PARALLEL) # and once set, they are cached as false and not regenerated set (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" ) # 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) + CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) + CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) else () message (STATUS "Parallel libraries not found") endif () -- cgit v0.12 From 03be1267190d2c83379e2ed09d0b86acd3b23388 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 2 Nov 2017 10:07:58 -0500 Subject: HDFFV-10321 change note added. --- release_docs/RELEASE.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b66355e..54867af 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -170,6 +170,17 @@ Bug Fixes since HDF5-1.10.1 release Configuration ------------- + - cmake MPI + + CMake implementation for MPI was problematic and would create incorrect + MPI library references in the hdf5 libraries. + + Reworked the CMake MPI code to properly create CMake targets.Also merged + the latest CMake FindMPI.cmake changes to the local copy. This is necessary + until HDF changes the CMake minimum to 3.9 or greater. + + (ADB - 2017/11/02, HDFFV-10321) + - cmake Too many commands for POST_BUILD step caused command line to be -- cgit v0.12 From 0fe3dc9b278ad7392502ddce438be97eb3e692e2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 2 Nov 2017 10:25:22 -0500 Subject: HDFFV-10321 Correct fortran link var --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ec2b2d..f21f8b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -877,6 +877,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for endif () include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake) + set (LINK_Fortran_LIBS ${LINK_LIBS}) + set (LINK_Fortran_SHARED_LIBS ${LINK_SHARED_LIBS}) if (HDF5_ENABLE_F2003) if (NOT FORTRAN_HAVE_ISO_C_BINDING) @@ -886,8 +888,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for # 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}) + set (LINK_Fortran_LIBS ${LINK_Fortran_LIBS} ${MPI_Fortran_LIBRARIES}) + set (LINK_Fortran_SHARED_LIBS ${LINK_Fortran_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 () -- cgit v0.12 From ede110390a615520daff36885012b0210a4c8cdc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 2 Nov 2017 10:34:40 -0500 Subject: New cmake MPI files --- MANIFEST | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MANIFEST b/MANIFEST index c325e64..4270479 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3107,6 +3107,12 @@ ./config/cmake_ext_mod/NSIS.template.in ./config/cmake_ext_mod/runTest.cmake ./config/cmake_ext_mod/version.plist.in +./config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in +./config/cmake_ext_mod/FindMPI/libver_mpi.c +./config/cmake_ext_mod/FindMPI/libver_mpi.f90.in +./config/cmake_ext_mod/FindMPI/mpiver.f90.in +./config/cmake_ext_mod/FindMPI/test_mpi.c +./config/cmake_ext_mod/FindMPI/test_mpi.f90.in # CMake-specific User Files ./config/cmake/UserMacros/Windows_MT.cmake -- cgit v0.12 From 47f4db394bc488d4311a6e1bf833c90abf3247b9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 2 Nov 2017 10:54:43 -0500 Subject: Add missing dir reference --- fortran/examples/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 82cbd5c..426df7e 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -81,7 +81,7 @@ foreach (example ${F2003_examples}) set_target_properties (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran03 - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) -- cgit v0.12 From 0d2fd7ae0cd19c2eb040a4ad733b50c7652639cc Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Thu, 2 Nov 2017 12:33:08 -0400 Subject: Make a fix to allow CMake testing which does not use relative directories. --- hl/tools/h5watch/CMakeLists.txt | 2 +- testpar/t_pread.c | 46 +++++++++++++++++++++++++++++++++++------ 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index fde40e3..6b8d5f2 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -5,7 +5,7 @@ PROJECT (HDF5_HL_TOOLS_H5WATCH) # Define Sources #----------------------------------------------------------------------------- set (H5WATCH_SOURCES - ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watch + ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watch.c ) #-- Add h5watch program diff --git a/testpar/t_pread.c b/testpar/t_pread.c index b5a84f2..a527503 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -55,6 +55,9 @@ 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); +static char *test_argv0 = NULL; +extern char *dirname(char *path); /* Avoids additional includes */ + /*------------------------------------------------------------------------- * Function: generate_test_file @@ -392,9 +395,29 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) if ( pass ) { char cmd[256]; - - HDsprintf(cmd, "../tools/src/h5jam/h5jam -i %s -u %s -o %s", - data_filename, prolog_filename, reloc_data_filename); + char exe_path[256]; + char *relative_path = "../tools/src/h5jam"; + char *exe_dirname = relative_path; + + /* We're checking for the existance of the h5jam utility + * With Cmake testing, all binaries are in the same directory + * e.g. the same location where this executable is found. + * We've copied the argv[0] argument and check to see + * if h5jam is co-located here. Otherwise, the autotools + * put things into directories, hence the relative path. + */ + if (test_argv0 != NULL) { + HDstrncpy(exe_path, test_argv0, sizeof(exe_path)); + if ( (exe_dirname = (char *)dirname(exe_path)) != NULL) { + HDsprintf(cmd, "%s/h5jam", exe_dirname); + if ( HDaccess(cmd, F_OK) != 0) + exe_dirname = relative_path; + } + } + HDsprintf(cmd, "%s/h5jam -i %s -u %s -o %s", + exe_dirname, + data_filename, + prolog_filename, reloc_data_filename); if ( system(cmd) != 0 ) { pass = FALSE; @@ -680,7 +703,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) } /* collect results from other processes. - * Only overwrite the failure message if no preveious error + * Only overwrite the failure message if no previous error * has been detected */ local_failure = ( pass ? 0 : 1 ); @@ -761,6 +784,17 @@ main( int argc, char **argv) int split_size; MPI_Comm group_comm = MPI_COMM_WORLD; + /* I don't believe that argv[0] can ever be NULL. + * It should thus be safe to dup and save as a check + * for cmake testing. Note that in our Cmake builds, + * all executables are located in the same directory. + * We assume (but we'll check) that the h5jam utility + * is in the directory as this executable. If that + * isn't true, then we can use a relative path that + * should be valid for the autotools environment. + */ + test_argv0 = HDstrdup(argv[0]); + if ( (MPI_Init(&argc, &argv)) != MPI_SUCCESS) { HDfprintf(stderr, "FATAL: Unable to initialize MPI\n"); HDexit(EXIT_FAILURE); @@ -785,11 +819,11 @@ main( int argc, char **argv) HDfprintf(stdout, "========================================\n"); } - if ( mpi_size < 4 ) { + if ( mpi_size < 3 ) { if ( mpi_rank == 0 ) { - HDprintf(" Need at least 4 processes. Exiting.\n"); + HDprintf(" Need at least 3 processes. Exiting.\n"); } goto finish; } -- cgit v0.12 From b8cbd11dfb229e79b8a9b22ce45dac3e9a735590 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 2 Nov 2017 14:26:44 -0500 Subject: Fix for Intel 18 Fortran compilation error. HDFFV-10322 --- fortran/src/H5f90global.F90 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index dd2b171..629418a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -142,10 +142,7 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types EQUIVALENCE (predef_types(1), H5T_NATIVE_INTEGER_KIND(1)) - EQUIVALENCE (predef_types(2), H5T_NATIVE_INTEGER_KIND(2)) - EQUIVALENCE (predef_types(3), H5T_NATIVE_INTEGER_KIND(3)) - EQUIVALENCE (predef_types(4), H5T_NATIVE_INTEGER_KIND(4)) - EQUIVALENCE (predef_types(5), H5T_NATIVE_INTEGER_KIND(5)) + ! EQUIVALENCE predef_types(2:5) are unnecessary and violate the standard EQUIVALENCE (predef_types(6), H5T_NATIVE_INTEGER) EQUIVALENCE (predef_types(7), H5T_NATIVE_REAL) EQUIVALENCE (predef_types(8), H5T_NATIVE_DOUBLE) -- cgit v0.12 From df03ecb01d721863f79c86969c56c77d3a846ab2 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 3 Nov 2017 09:10:26 -0500 Subject: HDFFV-10322 --- release_docs/RELEASE.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 54867af..ca65d7f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -197,7 +197,8 @@ Bug Fixes since HDF5-1.10.1 release Fortran -------- - - + - Fixed compilation errors when using Intel 18 Fortran compilers + (MSB - 2017/11/3, HDFFV-10322) Tools ----- -- cgit v0.12 From 275fabe6319783b672b6d6e54c1cf68796012224 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Nov 2017 09:28:28 -0600 Subject: Correct issue number --- 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 ca65d7f..a7465e5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -225,7 +225,7 @@ Bug Fixes since HDF5-1.10.1 release 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) + (ADB - 2017/08/31, HDFFV-10269) - h5ls -- cgit v0.12 From e8239b2de56158d9124972ad1ed74aec76aaee25 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 6 Nov 2017 16:26:03 -0600 Subject: Add check for realtimeOutput environment variable set containing characters to indicate test output should be piped through tee to chklog files in order to send output to stdout as tests run instead of waiting to cat chklog file to stdout when each set of tests is completed. This should stop buildbot from timing out when a test set doesn't complete in less than 20 minutes. --- config/conclude.am | 84 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 26 deletions(-) diff --git a/config/conclude.am b/config/conclude.am index 55b805a..97aef27 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -16,27 +16,25 @@ ## Textually included at the end of most HDF5 Makefiles.am. ## Contains build rules. -# Automake needs to be taught how to build lib, dyn, progs and tests targets. +# Automake needs to be taught how to build lib, 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) -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) AM_SH_LOG_FLAGS = +REALTIMEOUTPUT = $(realtimeOutput) # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. -build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -44,7 +42,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 dyn progs tests check-s check-p :: $(BUILT_SOURCES) +lib 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 \ @@ -127,28 +125,62 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: if $(top_srcdir)/bin/newer $(@:.chkexe_=.chkexe) $${tname}; then \ echo "No need to test $${tname} again."; \ else \ - echo "============================" > $${log}; \ - if test "X$(FORTRAN_API)" = "Xyes"; then \ - echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ - echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ - elif test "X$(CXX_API)" = "Xyes"; then \ - echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ - echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\ - else \ - echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ - echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ - fi; \ - echo "============================" >> $${log}; \ - srcdir="$(srcdir)" \ - $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ - && touch $(@:.chkexe_=.chkexe) || \ - (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ - (cat $${log} && false) || exit 1; \ + if test -n "$(REALTIMEOUTPUT)"; then \ + echo "============================" |& tee $${log}; \ + else \ + echo "============================" > $${log}; \ + fi; \ + if test "X$(FORTRAN_API)" = "Xyes"; then \ + echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ + if test -n "$(REALTIMEOUTPUT)"; then \ + echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" |& tee -a $${log}; \ + else \ + echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ + fi; \ + elif test "X$(CXX_API)" = "Xyes"; then \ + echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ + if test -n "$(REALTIMEOUTPUT)"; then \ + echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" |& tee -a $${log};\ + else \ + echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\ + fi; \ + else \ + echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ + if test -n "$(REALTIMEOUTPUT)"; then \ + echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" |& tee -a $${log}; \ + else \ + echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ + fi; \ + fi; \ + if test -n "$(REALTIMEOUTPUT)"; then \ + echo "============================" |& tee -a $${log}; \ + else \ + echo "============================" >> $${log}; \ + fi; \ + if test -n "$(REALTIMEOUTPUT)"; then \ + srcdir="$(srcdir)" \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) |& tee -a $${log} 2>&1 \ + && touch $(@:.chkexe_=.chkexe) || \ + (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ + (cat $${log} && false) || exit 1; \ + else \ + srcdir="$(srcdir)" \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + && touch $(@:.chkexe_=.chkexe) || \ + (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ + (cat $${log} && false) || exit 1; \ + fi; \ echo "" >> $${log}; \ - echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \ - echo "============================" >> $${log}; \ - echo "Finished testing $${tname} $(TEST_FLAGS)"; \ - cat $${log}; \ + if test -n "$(REALTIMEOUTPUT)"; then \ + echo "Finished testing $${tname} $(TEST_FLAGS)" |& tee -a $${log}; \ + echo "============================" |& tee -a $${log}; \ + else \ + echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \ + echo "============================" >> $${log}; \ + fi; \ + if test -z "$(REALTIMEOUTPUT)"; then \ + cat $${log}; \ + fi; \ fi; \ fi -- cgit v0.12 From d0e32b545c41dcc36a69ab146b54b55e7ac9dc07 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 7 Nov 2017 17:56:27 -0800 Subject: Split internal H5R functionality into H5Rint.c. --- MANIFEST | 1 + src/CMakeLists.txt | 1 + src/H5Oprivate.h | 4 +- src/H5R.c | 765 +++------------------------------------------------- src/H5Rdeprec.c | 118 ++++----- src/H5Rint.c | 767 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5Rmodule.h | 11 +- src/H5Rpkg.h | 14 +- src/H5Rprivate.h | 34 ++- src/H5Rpublic.h | 73 ++--- src/H5Sprivate.h | 4 +- src/H5Tprivate.h | 4 +- src/H5Zprivate.h | 7 +- src/Makefile.am | 2 +- 14 files changed, 951 insertions(+), 854 deletions(-) create mode 100644 src/H5Rint.c diff --git a/MANIFEST b/MANIFEST index 4270479..753d33d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -810,6 +810,7 @@ ./src/H5PLextern.h ./src/H5R.c ./src/H5Rdeprec.c +./src/H5Rint.c ./src/H5Rmodule.h ./src/H5Rpkg.h ./src/H5Rprivate.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4be86a9..7ee423b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -532,6 +532,7 @@ IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SOURCES}" ) set (H5R_SOURCES ${HDF5_SRC_DIR}/H5R.c ${HDF5_SRC_DIR}/H5Rdeprec.c + ${HDF5_SRC_DIR}/H5Rint.c ) set (H5R_HDRS ${HDF5_SRC_DIR}/H5Rpkg.h diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 563f8fa..314ee04 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -24,6 +24,9 @@ #ifndef _H5Oprivate_H #define _H5Oprivate_H +/* Early typedefs to avoid circular dependencies */ +typedef struct H5O_t H5O_t; + /* Include the public header file for this API */ #include "H5Opublic.h" /* Object header functions */ @@ -44,7 +47,6 @@ /* Forward references of package typedefs */ typedef struct H5O_msg_class_t H5O_msg_class_t; typedef struct H5O_mesg_t H5O_mesg_t; -typedef struct H5O_t H5O_t; /* Values used to create the shared message & attribute heaps */ /* (Note that these parameters have been tuned so that the resulting heap ID diff --git a/src/H5R.c b/src/H5R.c index b000183..8b42b35 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -21,16 +21,13 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Gprivate.h" /* Groups */ -#include "H5HGprivate.h" /* Global Heaps */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Rpkg.h" /* References */ -#include "H5Sprivate.h" /* Dataspaces */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Rpkg.h" /* References */ +#include "H5Sprivate.h" /* Dataspaces */ /****************/ @@ -47,20 +44,11 @@ /* Local Prototypes */ /********************/ -static herr_t H5R_create(void *ref, H5G_loc_t *loc, const char *name, - H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id); -static H5S_t * H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref); -static ssize_t H5R_get_name(H5F_t *file, hid_t lapl_id, hid_t dxpl_id, hid_t id, - H5R_type_t ref_type, const void *_ref, char *name, size_t size); - /*********************/ /* Package Variables */ /*********************/ -/* Package initialization variable */ -hbool_t H5_PKG_INIT_VAR = FALSE; - /*****************************/ /* Library Private Variables */ @@ -71,274 +59,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; - - - -/*-------------------------------------------------------------------------- -NAME - H5R__init_package -- Initialize interface-specific information -USAGE - herr_t H5R__init_package() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. - ---------------------------------------------------------------------------*/ -herr_t -H5R__init_package(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - 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() */ - - -/*-------------------------------------------------------------------------- - 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 - USAGE - void H5R_term_package() - RETURNS - void - DESCRIPTION - Release the atom group and any other resources allocated. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Can't report errors... - - Finishes shutting down the interface, after H5R_top_term_package() - is called - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -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 */ - - FUNC_LEAVE_NOAPI(n) -} /* end H5R_term_package() */ - - -/*-------------------------------------------------------------------------- - NAME - H5R_create - PURPOSE - Creates a particular kind of reference for the user - USAGE - herr_t H5R_create(ref, loc, name, ref_type, space) - void *ref; OUT: Reference created - H5G_loc_t *loc; IN: File location used to locate object pointed to - const char *name; IN: Name of object at location LOC_ID of object - pointed to - H5R_type_t ref_type; IN: Type of reference to create - H5S_t *space; IN: Dataspace ID with selection, used for Dataset - Region references. - - RETURNS - Non-negative on success/Negative on failure - DESCRIPTION - Creates a particular type of reference specified with REF_TYPE, in the - space pointed to by REF. The LOC_ID and NAME are used to locate the object - pointed to and the SPACE_ID is used to choose the region pointed to (for - Dataset Region references). - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static herr_t -H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id) -{ - H5G_loc_t obj_loc; /* Group hier. location of object */ - H5G_name_t path; /* Object group hier. path */ - H5O_loc_t oloc; /* Object object location */ - hbool_t obj_found = FALSE; /* Object location found */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(_ref); - HDassert(loc); - HDassert(name); - HDassert(ref_type > H5R_BADTYPE && ref_type < H5R_MAXTYPE); - - /* Set up object location to fill in */ - obj_loc.oloc = &oloc; - obj_loc.path = &path; - H5G_loc_reset(&obj_loc); - - /* Find the object */ - if(H5G_loc_find(loc, name, &obj_loc, H5P_DEFAULT, dxpl_id) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_NOTFOUND, FAIL, "object not found") - obj_found = TRUE; - - switch(ref_type) { - case H5R_OBJECT: - { - hobj_ref_t *ref = (hobj_ref_t *)_ref; /* Get pointer to correct type of reference struct */ - - *ref = obj_loc.oloc->addr; - break; - } - - case H5R_DATASET_REGION: - { - H5HG_t hobjid; /* Heap object ID */ - hdset_reg_ref_t *ref = (hdset_reg_ref_t *)_ref; /* Get pointer to correct type of reference struct */ - hssize_t buf_size; /* Size of buffer needed to serialize selection */ - uint8_t *p; /* Pointer to OID to store */ - uint8_t *buf; /* Buffer to store serialized selection in */ - unsigned heapid_found; /* Flag for non-zero heap ID found */ - unsigned u; /* local index */ - - /* Set up information for dataset region */ - - /* Return any previous heap block to the free list if we are garbage collecting */ - if(H5F_GC_REF(loc->oloc->file)) { - /* Check for an existing heap ID in the reference */ - for(u = 0, heapid_found = 0, p = (uint8_t *)ref; u < H5R_DSET_REG_REF_BUF_SIZE; u++) - if(p[u] != 0) { - heapid_found = 1; - break; - } /* end if */ - - if(heapid_found != 0) { -/* Return heap block to free list */ - } /* end if */ - } /* end if */ - - /* Zero the heap ID out, may leak heap space if user is re-using reference and doesn't have garbage collection on */ - HDmemset(ref, 0, H5R_DSET_REG_REF_BUF_SIZE); - - /* Get the amount of space required to serialize the selection */ - if((buf_size = H5S_SELECT_SERIAL_SIZE(space)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "Invalid amount of space for serializing selection") - - /* Increase buffer size to allow for the dataset OID */ - buf_size += (hssize_t)sizeof(haddr_t); - - /* Allocate the space to store the serialized information */ - H5_CHECK_OVERFLOW(buf_size, hssize_t, size_t); - if(NULL == (buf = (uint8_t *)H5MM_malloc((size_t)buf_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Serialize information for dataset OID into heap buffer */ - p = (uint8_t *)buf; - H5F_addr_encode(loc->oloc->file, &p, obj_loc.oloc->addr); - - /* Serialize the selection into heap buffer */ - if(H5S_SELECT_SERIALIZE(space, &p) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Unable to serialize selection") - - /* Save the serialized buffer for later */ - H5_CHECK_OVERFLOW(buf_size, hssize_t, size_t); - if(H5HG_insert(loc->oloc->file, dxpl_id, (size_t)buf_size, buf, &hobjid) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to serialize selection") - - /* Serialize the heap ID and index for storage in the file */ - p = (uint8_t *)ref; - H5F_addr_encode(loc->oloc->file, &p, hobjid.addr); - UINT32ENCODE(p, hobjid.idx); - - /* Free the buffer we serialized data in */ - H5MM_xfree(buf); - break; - } - - case H5R_BADTYPE: - case H5R_MAXTYPE: - default: - HDassert("unknown reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") - } /* end switch */ - -done: - if(obj_found) - H5G_loc_free(&obj_loc); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_create() */ - /*-------------------------------------------------------------------------- NAME @@ -378,23 +98,23 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t H5TRACE5("e", "*xi*sRti", ref, loc_id, name, ref_type, space_id); /* Check args */ - if(ref == NULL) + if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") - if(H5G_loc(loc_id, &loc) < 0) + if (H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(!name || !*name) + if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name given") - if(ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) + if (ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") - if(ref_type != H5R_OBJECT && ref_type != H5R_DATASET_REGION) + if (ref_type != H5R_OBJECT && ref_type != H5R_DATASET_REGION) HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "reference type not supported") - if(space_id == (-1) && ref_type == H5R_DATASET_REGION) + if (space_id == (-1) && ref_type == H5R_DATASET_REGION) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "reference region dataspace id must be valid") - if(space_id != (-1) && (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))) + if (space_id != (-1) && (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") /* Create reference */ - if((ret_value = H5R_create(ref, &loc, name, ref_type, space, H5AC_ind_read_dxpl_id)) < 0) + if ((ret_value = H5R_create(ref, &loc, name, ref_type, space, H5AC_ind_read_dxpl_id)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to create reference") done: @@ -404,166 +124,6 @@ done: /*-------------------------------------------------------------------------- NAME - H5R_dereference - PURPOSE - Opens the HDF5 object referenced. - USAGE - hid_t H5R_dereference(ref) - H5F_t *file; IN: File the object being dereferenced is within - H5R_type_t ref_type; IN: Type of reference - void *ref; IN: Reference to open. - - RETURNS - Valid ID on success, Negative on failure - DESCRIPTION - Given a reference to some object, open that object and return an ID for - that object. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Currently only set up to work with references to datasets - EXAMPLES - REVISION LOG - Raymond Lu - 13 July 2011 - I added the OAPL_ID parameter for the object being referenced. It only - supports dataset access property list currently. - - M. Scot Breitenfeld - 3 March 2015 - Added a check for undefined reference pointer. ---------------------------------------------------------------------------*/ -hid_t -H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref, hbool_t app_ref) -{ - H5O_loc_t oloc; /* Object location */ - H5G_name_t path; /* Path of object */ - H5G_loc_t loc; /* Group location */ - unsigned rc; /* Reference count of object */ - H5O_type_t obj_type; /* Type of object */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(_ref); - HDassert(ref_type > H5R_BADTYPE && ref_type < H5R_MAXTYPE); - HDassert(file); - - /* Initialize the object location */ - H5O_loc_reset(&oloc); - oloc.file = file; - - switch(ref_type) { - case H5R_OBJECT: - oloc.addr = *(const hobj_ref_t *)_ref; /* Only object references currently supported */ - if(!H5F_addr_defined(oloc.addr) || oloc.addr == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer") - break; - - case H5R_DATASET_REGION: - { - H5HG_t hobjid; /* Heap object ID */ - uint8_t *buf; /* Buffer to store serialized selection in */ - const uint8_t *p; /* Pointer to OID to store */ - - /* Get the heap ID for the dataset region */ - p = (const uint8_t *)_ref; - H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - UINT32DECODE(p, hobjid.idx); - - if(!H5F_addr_defined(hobjid.addr) || hobjid.addr == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer") - - /* Get the dataset region from the heap (allocate inside routine) */ - if(NULL == (buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL))) - HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") - - /* Get the object oid for the dataset */ - p = buf; - H5F_addr_decode(oloc.file, &p, &(oloc.addr)); - - /* Free the buffer allocated in H5HG_read() */ - H5MM_xfree(buf); - } /* end case */ - break; - - case H5R_BADTYPE: - case H5R_MAXTYPE: - default: - HDassert("unknown reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") - } /* end switch */ - - /* Get the # of links for object, and its type */ - /* (To check to make certain that this object hasn't been deleted since the reference was created) */ - if(H5O_get_rc_and_type(&oloc, dxpl_id, &rc, &obj_type) < 0 || 0 == rc) - HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object") - - /* Construct a group location for opening the object */ - H5G_name_reset(&path); - loc.oloc = &oloc; - loc.path = &path; - - /* Open the object */ - switch(obj_type) { - case H5O_TYPE_GROUP: - { - H5G_t *group; /* Pointer to group to open */ - - if(NULL == (group = H5G_open(&loc, dxpl_id))) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "not found") - - /* Create an atom for the group */ - if((ret_value = H5I_register(H5I_GROUP, group, app_ref)) < 0) { - H5G_close(group); - HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, FAIL, "can't register group") - } /* end if */ - } /* end case */ - break; - - case H5O_TYPE_NAMED_DATATYPE: - { - H5T_t *type; /* Pointer to datatype to open */ - - if(NULL == (type = H5T_open(&loc, dxpl_id))) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found") - - /* Create an atom for the datatype */ - if((ret_value = H5I_register(H5I_DATATYPE, type, app_ref)) < 0) { - H5T_close(type); - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "can't register datatype") - } /* end if */ - } /* end case */ - break; - - case H5O_TYPE_DATASET: - { - H5D_t *dset; /* Pointer to dataset to open */ - - /* Open the dataset */ - if(NULL == (dset = H5D_open(&loc, oapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") - - /* Create an atom for the dataset */ - if((ret_value = H5I_register(H5I_DATASET, dset, app_ref)) < 0) { - H5D_close(dset); - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register dataset") - } /* end if */ - } /* end case */ - break; - - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - HGOTO_ERROR(H5E_REFERENCE, H5E_BADTYPE, FAIL, "can't identify type of object referenced") - } /* end switch */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_dereference() */ - - -/*-------------------------------------------------------------------------- - NAME H5Rdereference2 PURPOSE Opens the HDF5 object referenced. @@ -601,24 +161,24 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r H5TRACE4("i", "iiRt*x", obj_id, oapl_id, ref_type, _ref); /* Check args */ - if(H5G_loc(obj_id, &loc) < 0) + if (H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(oapl_id < 0) + if (oapl_id < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - if(ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) + if (ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") - if(_ref == NULL) + if (_ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&oapl_id, H5P_CLS_DACC, &dxpl_id, obj_id, FALSE) < 0) + if (H5P_verify_apl_and_dxpl(&oapl_id, H5P_CLS_DACC, &dxpl_id, obj_id, FALSE) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Get the file pointer from the entry */ file = loc.oloc->file; /* Create reference */ - if((ret_value = H5R_dereference(file, oapl_id, dxpl_id, ref_type, _ref, TRUE)) < 0) + if ((ret_value = H5R_dereference(file, oapl_id, dxpl_id, ref_type, _ref, TRUE)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to dereference object") done: @@ -628,75 +188,6 @@ done: /*-------------------------------------------------------------------------- NAME - H5R_get_region - PURPOSE - Retrieves a dataspace with the region pointed to selected. - USAGE - H5S_t *H5R_get_region(file, ref_type, ref) - H5F_t *file; IN: File the object being dereferenced is within - void *ref; IN: Reference to open. - - RETURNS - Pointer to the dataspace on success, NULL on failure - DESCRIPTION - Given a reference to some object, creates a copy of the dataset pointed - to's dataspace and defines a selection in the copy which is the region - pointed to. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static H5S_t * -H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) -{ - H5O_loc_t oloc; /* Object location */ - const uint8_t *p; /* Pointer to OID to store */ - H5HG_t hobjid; /* Heap object ID */ - uint8_t *buf = NULL; /* Buffer to store serialized selection in */ - H5S_t *ret_value; - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(_ref); - HDassert(file); - - /* Initialize the object location */ - H5O_loc_reset(&oloc); - oloc.file = file; - - /* Get the heap ID for the dataset region */ - p = (const uint8_t *)_ref; - H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - UINT32DECODE(p, hobjid.idx); - - /* Get the dataset region from the heap (allocate inside routine) */ - if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) - HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, NULL, "Unable to read dataset region information") - - /* Get the object oid for the dataset */ - p = buf; - H5F_addr_decode(oloc.file, &p, &(oloc.addr)); - - /* Open and copy the dataset's dataspace */ - if((ret_value = H5S_read(&oloc, dxpl_id)) == NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, NULL, "not found") - - /* Unserialize the selection */ - if(H5S_SELECT_DESERIALIZE(&ret_value, &p) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, NULL, "can't deserialize selection") - -done: - /* Free the buffer allocated in H5HG_read() */ - if(buf) - H5MM_xfree(buf); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_get_region() */ - - -/*-------------------------------------------------------------------------- - NAME H5Rget_region PURPOSE Retrieves a dataspace with the region pointed to selected. @@ -729,19 +220,19 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) H5TRACE3("i", "iRt*x", id, ref_type, ref); /* Check args */ - if(H5G_loc(id, &loc) < 0) + if (H5G_loc(id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(ref_type != H5R_DATASET_REGION) + if (ref_type != H5R_DATASET_REGION) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") - if(ref == NULL) + if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") /* Get the dataspace with the correct region selected */ - if((space = H5R_get_region(loc.oloc->file, H5AC_ind_read_dxpl_id, ref)) == NULL) + if ((space = H5R_get_region(loc.oloc->file, H5AC_ind_read_dxpl_id, ref)) == NULL) 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: @@ -751,92 +242,6 @@ done: /*-------------------------------------------------------------------------- NAME - H5R_get_obj_type - PURPOSE - Retrieves the type of object that an object reference points to - USAGE - H5O_type_t H5R_get_obj_type(file, ref_type, ref) - H5F_t *file; IN: File the object being dereferenced is within - H5R_type_t ref_type; IN: Type of reference to query - void *ref; IN: Reference to query. - - RETURNS - Success: An object type defined in H5Gpublic.h - Failure: H5G_UNKNOWN - DESCRIPTION - Given a reference to some object, this function returns the type of object - pointed to. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -herr_t -H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, - const void *_ref, H5O_type_t *obj_type) -{ - H5O_loc_t oloc; /* Object location */ - unsigned rc; /* Reference count of object */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(file); - HDassert(_ref); - - /* Initialize the symbol table entry */ - H5O_loc_reset(&oloc); - oloc.file = file; - - switch(ref_type) { - case H5R_OBJECT: - /* Get the object oid */ - oloc.addr = *(const hobj_ref_t *)_ref; /* Only object references currently supported */ - break; - - case H5R_DATASET_REGION: - { - H5HG_t hobjid; /* Heap object ID */ - const uint8_t *p; /* Pointer to reference to decode */ - uint8_t *buf; /* Buffer to store serialized selection in */ - - /* Get the heap ID for the dataset region */ - p = (const uint8_t *)_ref; - H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - UINT32DECODE(p, hobjid.idx); - - /* Get the dataset region from the heap (allocate inside routine) */ - if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) - HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") - - /* Get the object oid for the dataset */ - p = buf; - H5F_addr_decode(oloc.file, &p, &(oloc.addr)); - - /* Free the buffer allocated in H5HG_read() */ - H5MM_xfree(buf); - } /* end case */ - break; - - case H5R_BADTYPE: - case H5R_MAXTYPE: - default: - HDassert("unknown reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") - } /* end switch */ - - /* Get the # of links for object, and its type */ - /* (To check to make certain that this object hasn't been deleted since the reference was created) */ - if(H5O_get_rc_and_type(&oloc, dxpl_id, &rc, obj_type) < 0 || 0 == rc) - HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_get_obj_type() */ - - -/*-------------------------------------------------------------------------- - NAME H5Rget_obj_type2 PURPOSE Retrieves the type of object that an object reference points to @@ -869,16 +274,16 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5TRACE4("e", "iRt*x*Ot", id, ref_type, ref, obj_type); /* Check args */ - if(H5G_loc(id, &loc) < 0) + if (H5G_loc(id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) + if (ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") - if(ref == NULL) + if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") /* Get the object information */ - if(H5R_get_obj_type(loc.oloc->file, H5AC_ind_read_dxpl_id, ref_type, ref, obj_type) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to determine object type") + if (H5R_get_obj_type(loc.oloc->file, H5AC_ind_read_dxpl_id, ref_type, ref, obj_type) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to determine object type") done: FUNC_LEAVE_API(ret_value) @@ -887,106 +292,6 @@ done: /*-------------------------------------------------------------------------- NAME - H5R_get_name - PURPOSE - Internal routine to determine a name for the object referenced - USAGE - ssize_t H5R_get_name(f, dxpl_id, ref_type, ref, name, size) - H5F_t *f; IN: Pointer to the file that the reference is pointing - into - hid_t lapl_id; IN: LAPL to use for operation - hid_t dxpl_id; IN: DXPL to use for operation - hid_t id; IN: Location ID given for reference - H5R_type_t ref_type; IN: Type of reference - void *ref; IN: Reference to query. - char *name; OUT: Buffer to place name of object referenced - size_t size; IN: Size of name buffer - - RETURNS - Non-negative length of the path on success, Negative on failure - DESCRIPTION - Given a reference to some object, determine a path to the object - referenced in the file. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - This may not be the only path to that object. - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static ssize_t -H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_type, - const void *_ref, char *name, size_t size) -{ - hid_t file_id = H5I_INVALID_HID; /* ID for file that the reference is in */ - H5O_loc_t oloc; /* Object location describing object for reference */ - ssize_t ret_value = -1; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Check args */ - HDassert(f); - HDassert(_ref); - - /* Initialize the object location */ - H5O_loc_reset(&oloc); - oloc.file = f; - - /* Get address for reference */ - switch(ref_type) { - case H5R_OBJECT: - oloc.addr = *(const hobj_ref_t *)_ref; - break; - - case H5R_DATASET_REGION: - { - H5HG_t hobjid; /* Heap object ID */ - uint8_t *buf; /* Buffer to store serialized selection in */ - const uint8_t *p; /* Pointer to OID to store */ - - /* Get the heap ID for the dataset region */ - p = (const uint8_t *)_ref; - H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - UINT32DECODE(p, hobjid.idx); - - /* Get the dataset region from the heap (allocate inside routine) */ - if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) - HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") - - /* Get the object oid for the dataset */ - p = buf; - H5F_addr_decode(oloc.file, &p, &(oloc.addr)); - - /* Free the buffer allocated in H5HG_read() */ - H5MM_xfree(buf); - } /* end case */ - break; - - case H5R_BADTYPE: - case H5R_MAXTYPE: - default: - HDassert("unknown reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") - } /* end switch */ - - /* Retrieve file ID for name search */ - if((file_id = H5I_get_file_id(id, FALSE)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't retrieve file ID") - - /* Get name, length, etc. */ - if((ret_value = H5G_get_name_by_addr(file_id, lapl_id, dxpl_id, &oloc, name, size)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't determine name") - -done: - /* Close file ID used for search */ - if(file_id > 0 && H5I_dec_ref(file_id) < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "can't decrement ref count of temp ID") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_get_name() */ - - -/*-------------------------------------------------------------------------- - NAME H5Rget_name PURPOSE Determines a name for the object referenced @@ -1030,18 +335,18 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, H5TRACE5("Zs", "iRt*x*sz", id, ref_type, _ref, name, size); /* Check args */ - if(H5G_loc(id, &loc) < 0) + if (H5G_loc(id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) + if (ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") - if(_ref == NULL) + if (_ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") /* Get the file pointer from the entry */ file = loc.oloc->file; /* Get name */ - if((ret_value = H5R_get_name(file, H5P_DEFAULT, H5AC_ind_read_dxpl_id, id, ref_type, _ref, name, size)) < 0) + if ((ret_value = H5R_get_name(file, H5P_DEFAULT, H5AC_ind_read_dxpl_id, id, ref_type, _ref, name, size)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to determine object path") done: diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 109bbb4..699f8df 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -13,11 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Rdeprec.c - * September 13 2007 - * Quincey Koziol + * Created: H5Rdeprec.c * - * Purpose: Deprecated functions from the H5R interface. These + * Purpose: Deprecated functions from the H5R interface. These * functions are here for compatibility purposes and may be * removed in the future. Applications should switch to the * newer APIs. @@ -35,13 +33,16 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5Rpkg.h" /* References */ -#include "H5Ppublic.h" /* for using H5P_DATASET_ACCESS_DEFAULT */ +/* Public headers needed by this file */ +#include "H5Ppublic.h" /* Property lists */ + +/* Private headers needed by this file */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Rpkg.h" /* References */ /****************/ @@ -81,29 +82,22 @@ #ifndef H5_NO_DEPRECATED_SYMBOLS -/*-------------------------------------------------------------------------- - NAME - H5Rget_obj_type1 - PURPOSE - Retrieves the type of object that an object reference points to - USAGE - H5G_obj_t H5Rget_obj_type1(id, ref_type, ref) - hid_t id; IN: Dataset reference object is in or location ID of - object that the dataset is located within. - H5R_type_t ref_type; IN: Type of reference to query - void *ref; IN: Reference to query. - - RETURNS - Success: An object type defined in H5Gpublic.h - Failure: H5G_UNKNOWN - DESCRIPTION - Given a reference to some object, this function returns the type of object - pointed to. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------- + * Function: H5Rget_obj_type1 + * + * Purpose: Retrieves the type of the object that an object points to. + * + * Parameters: + * id IN: Dataset reference object is in or location ID of + * object that the dataset is located within + * ref_type IN: Type of reference to query + * ref IN: Reference to query + * + * Return: Success: An object type (as defined in H5Gpublic.h) + * Failure: H5G_UNKNOWN + * + *------------------------------------------------------------------------- + */ H5G_obj_t H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) { @@ -115,16 +109,16 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) H5TRACE3("Go", "iRt*x", id, ref_type, ref); /* Check args */ - if(H5G_loc(id, &loc) < 0) + if (H5G_loc(id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "not a location") - if(ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) + if (ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5G_UNKNOWN, "invalid reference type") - if(ref == NULL) + if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5G_UNKNOWN, "invalid reference pointer") /* Get the object information */ - if(H5R_get_obj_type(loc.oloc->file, H5AC_ind_read_dxpl_id, ref_type, ref, &obj_type) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type") + if (H5R_get_obj_type(loc.oloc->file, H5AC_ind_read_dxpl_id, ref_type, ref, &obj_type) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type") /* Set return value */ ret_value = H5G_map_obj_type(obj_type); @@ -134,28 +128,22 @@ done: } /* end H5Rget_obj_type1() */ -/*-------------------------------------------------------------------------- - NAME - H5Rdereference1 - PURPOSE - Opens the HDF5 object referenced. - USAGE - hid_t H5Rdereference1(ref) - hid_t id; IN: Dataset reference object is in or location ID of - object that the dataset is located within. - H5R_type_t ref_type; IN: Type of reference to create - void *ref; IN: Reference to open. - - RETURNS - Valid ID on success, Negative on failure - DESCRIPTION - Given a reference to some object, open that object and return an ID for - that object. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------- + * Function: H5Rdereference1 + * + * Purpose: Opens the HDF5 object referenced. + * + * Parameters: + * id IN: Dataset reference object is in or location ID of + * object that the dataset is located within + * ref_type IN: Type of reference to create + * ref IN: Reference to open + * + * Return: Success: Valid HDF5 ID + * Failure: Negative + * + *------------------------------------------------------------------------- + */ hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) { @@ -167,18 +155,18 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) H5TRACE3("i", "iRt*x", obj_id, ref_type, _ref); /* Check args */ - if(H5G_loc(obj_id, &loc) < 0) + if (H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) + if (ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") - if(_ref == NULL) + if (_ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") /* Get the file pointer from the entry */ file = loc.oloc->file; /* Create reference */ - if((ret_value = H5R_dereference(file, H5P_DATASET_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id, ref_type, _ref, TRUE)) < 0) + if ((ret_value = H5R_dereference(file, H5P_DATASET_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id, ref_type, _ref, TRUE)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable dereference object") done: diff --git a/src/H5Rint.c b/src/H5Rint.c new file mode 100644 index 0000000..716a573 --- /dev/null +++ b/src/H5Rint.c @@ -0,0 +1,767 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/****************/ +/* Module Setup */ +/****************/ + +#include "H5Rmodule.h" /* This source code file is part of the H5R module */ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Gprivate.h" /* Groups */ +#include "H5HGprivate.h" /* Global Heaps */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Rpkg.h" /* References */ +#include "H5Sprivate.h" /* Dataspaces */ +#include "H5Tprivate.h" /* Datatypes */ + + +/****************/ +/* Local Macros */ +/****************/ + +/******************/ +/* Local Typedefs */ +/******************/ + +/********************/ +/* Local Prototypes */ +/********************/ + +/*********************/ +/* Package Variables */ +/*********************/ + +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + +/*******************/ +/* Local Variables */ +/*******************/ + +/* Reference ID class + * + * 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) + */ +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; + + +/*-------------------------------------------------------------------------- +NAME + H5R__init_package -- Initialize interface-specific information +USAGE + herr_t H5R__init_package() + +RETURNS + Non-negative on success/Negative on failure +DESCRIPTION + Initializes any interface-specific data or routines. + +--------------------------------------------------------------------------*/ +herr_t +H5R__init_package(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + 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() */ + + +/*-------------------------------------------------------------------------- + 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++; + } + + /* Mark closed */ + if (0 == n) + H5R_top_package_initialize_s = FALSE; + } + + FUNC_LEAVE_NOAPI(n) +} /* end H5R_top_term_package() */ + + +/*-------------------------------------------------------------------------- + NAME + H5R_term_package + PURPOSE + Terminate various H5R objects + USAGE + void H5R_term_package() + RETURNS + void + DESCRIPTION + Release the atom group and any other resources allocated. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Can't report errors... + + Finishes shutting down the interface, after H5R_top_term_package() + is called + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +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; + } + + FUNC_LEAVE_NOAPI(n) +} /* end H5R_term_package() */ + + +/*-------------------------------------------------------------------------- + NAME + H5R_create + PURPOSE + Creates a particular kind of reference for the user + USAGE + herr_t H5R_create(ref, loc, name, ref_type, space) + void *ref; OUT: Reference created + H5G_loc_t *loc; IN: File location used to locate object pointed to + const char *name; IN: Name of object at location LOC_ID of object + pointed to + H5R_type_t ref_type; IN: Type of reference to create + H5S_t *space; IN: Dataspace ID with selection, used for Dataset + Region references. + + RETURNS + Non-negative on success/Negative on failure + DESCRIPTION + Creates a particular type of reference specified with REF_TYPE, in the + space pointed to by REF. The LOC_ID and NAME are used to locate the object + pointed to and the SPACE_ID is used to choose the region pointed to (for + Dataset Region references). + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id) +{ + H5G_loc_t obj_loc; /* Group hier. location of object */ + H5G_name_t path; /* Object group hier. path */ + H5O_loc_t oloc; /* Object object location */ + hbool_t obj_found = FALSE; /* Object location found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(_ref); + HDassert(loc); + HDassert(name); + HDassert(ref_type > H5R_BADTYPE && ref_type < H5R_MAXTYPE); + + /* Set up object location to fill in */ + obj_loc.oloc = &oloc; + obj_loc.path = &path; + H5G_loc_reset(&obj_loc); + + /* Find the object */ + if (H5G_loc_find(loc, name, &obj_loc, H5P_DEFAULT, dxpl_id) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_NOTFOUND, FAIL, "object not found") + obj_found = TRUE; + + switch (ref_type) { + case H5R_OBJECT: + { + hobj_ref_t *ref = (hobj_ref_t *)_ref; /* Get pointer to correct type of reference struct */ + + *ref = obj_loc.oloc->addr; + break; + } + + case H5R_DATASET_REGION: + { + H5HG_t hobjid; /* Heap object ID */ + hdset_reg_ref_t *ref = (hdset_reg_ref_t *)_ref; /* Get pointer to correct type of reference struct */ + hssize_t buf_size; /* Size of buffer needed to serialize selection */ + uint8_t *p; /* Pointer to OID to store */ + uint8_t *buf; /* Buffer to store serialized selection in */ + unsigned heapid_found; /* Flag for non-zero heap ID found */ + unsigned u; /* local index */ + + /* Set up information for dataset region */ + + /* Return any previous heap block to the free list if we are + * garbage collecting + */ + if (H5F_GC_REF(loc->oloc->file)) { + /* Check for an existing heap ID in the reference */ + for (u = 0, heapid_found = 0, p = (uint8_t *)ref; u < H5R_DSET_REG_REF_BUF_SIZE; u++) + if (p[u] != 0) { + heapid_found = 1; + break; + } + + if (heapid_found != 0) { + /* Return heap block to free list */ + } + } + + /* Zero the heap ID out, may leak heap space if user is re-using + * reference and doesn't have garbage collection turned on + */ + HDmemset(ref, 0, H5R_DSET_REG_REF_BUF_SIZE); + + /* Get the amount of space required to serialize the selection */ + if ((buf_size = H5S_SELECT_SERIAL_SIZE(space)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "Invalid amount of space for serializing selection") + + /* Increase buffer size to allow for the dataset OID */ + buf_size += (hssize_t)sizeof(haddr_t); + + /* Allocate the space to store the serialized information */ + H5_CHECK_OVERFLOW(buf_size, hssize_t, size_t); + if (NULL == (buf = (uint8_t *)H5MM_malloc((size_t)buf_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Serialize information for dataset OID into heap buffer */ + p = (uint8_t *)buf; + H5F_addr_encode(loc->oloc->file, &p, obj_loc.oloc->addr); + + /* Serialize the selection into heap buffer */ + if (H5S_SELECT_SERIALIZE(space, &p) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Unable to serialize selection") + + /* Save the serialized buffer for later */ + H5_CHECK_OVERFLOW(buf_size, hssize_t, size_t); + if (H5HG_insert(loc->oloc->file, dxpl_id, (size_t)buf_size, buf, &hobjid) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to serialize selection") + + /* Serialize the heap ID and index for storage in the file */ + p = (uint8_t *)ref; + H5F_addr_encode(loc->oloc->file, &p, hobjid.addr); + UINT32ENCODE(p, hobjid.idx); + + /* Free the buffer we serialized data in */ + H5MM_xfree(buf); + break; + } /* end case H5R_DATASET_REGION */ + + case H5R_BADTYPE: + case H5R_MAXTYPE: + default: + HDassert("unknown reference type" && 0); + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") + } /* end switch */ + +done: + if (obj_found) + H5G_loc_free(&obj_loc); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5R_create() */ + + +/*-------------------------------------------------------------------------- + NAME + H5R_dereference + PURPOSE + Opens the HDF5 object referenced. + USAGE + hid_t H5R_dereference(ref) + H5F_t *file; IN: File the object being dereferenced is within + H5R_type_t ref_type; IN: Type of reference + void *ref; IN: Reference to open. + + RETURNS + Valid ID on success, Negative on failure + DESCRIPTION + Given a reference to some object, open that object and return an ID for + that object. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Currently only set up to work with references to datasets + EXAMPLES + REVISION LOG + Raymond Lu + 13 July 2011 + I added the OAPL_ID parameter for the object being referenced. It only + supports dataset access property list currently. + + M. Scot Breitenfeld + 3 March 2015 + Added a check for undefined reference pointer. +--------------------------------------------------------------------------*/ +hid_t +H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref, hbool_t app_ref) +{ + H5O_loc_t oloc; /* Object location */ + H5G_name_t path; /* Path of object */ + H5G_loc_t loc; /* Group location */ + unsigned rc; /* Reference count of object */ + H5O_type_t obj_type; /* Type of object */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(_ref); + HDassert(ref_type > H5R_BADTYPE && ref_type < H5R_MAXTYPE); + HDassert(file); + + /* Initialize the object location */ + H5O_loc_reset(&oloc); + oloc.file = file; + + switch (ref_type) { + case H5R_OBJECT: + { + oloc.addr = *(const hobj_ref_t *)_ref; /* Only object references currently supported */ + if (!H5F_addr_defined(oloc.addr) || oloc.addr == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer") + break; + } + + case H5R_DATASET_REGION: + { + H5HG_t hobjid; /* Heap object ID */ + uint8_t *buf; /* Buffer to store serialized selection in */ + const uint8_t *p; /* Pointer to OID to store */ + + /* Get the heap ID for the dataset region */ + p = (const uint8_t *)_ref; + H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); + UINT32DECODE(p, hobjid.idx); + + if (!H5F_addr_defined(hobjid.addr) || hobjid.addr == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer") + + /* Get the dataset region from the heap (allocate inside routine) */ + if (NULL == (buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL))) + HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") + + /* Get the object oid for the dataset */ + p = buf; + H5F_addr_decode(oloc.file, &p, &(oloc.addr)); + + /* Free the buffer allocated in H5HG_read() */ + H5MM_xfree(buf); + break; + } /* end case H5R_DATASET_REGION */ + + case H5R_BADTYPE: + case H5R_MAXTYPE: + default: + HDassert("unknown reference type" && 0); + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") + } /* end switch */ + + /* Get the # of links for object, and its type + * (To check to make certain that this object hasn't been deleted + * since the reference was created) + */ + if (H5O_get_rc_and_type(&oloc, dxpl_id, &rc, &obj_type) < 0 || 0 == rc) + HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object") + + /* Construct a group location for opening the object */ + H5G_name_reset(&path); + loc.oloc = &oloc; + loc.path = &path; + + /* Open the object */ + switch (obj_type) { + case H5O_TYPE_GROUP: + { + H5G_t *group; /* Pointer to group to open */ + + if (NULL == (group = H5G_open(&loc, dxpl_id))) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "not found") + + /* Create an atom for the group */ + if ((ret_value = H5I_register(H5I_GROUP, group, app_ref)) < 0) { + H5G_close(group); + HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, FAIL, "can't register group") + } + + break; + } + + case H5O_TYPE_NAMED_DATATYPE: + { + H5T_t *type; /* Pointer to datatype to open */ + + if (NULL == (type = H5T_open(&loc, dxpl_id))) + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found") + + /* Create an atom for the datatype */ + if ((ret_value = H5I_register(H5I_DATATYPE, type, app_ref)) < 0) { + H5T_close(type); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "can't register datatype") + } + + break; + } + + case H5O_TYPE_DATASET: + { + H5D_t *dset; /* Pointer to dataset to open */ + + /* Open the dataset */ + if (NULL == (dset = H5D_open(&loc, oapl_id, dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") + + /* Create an atom for the dataset */ + if ((ret_value = H5I_register(H5I_DATASET, dset, app_ref)) < 0) { + H5D_close(dset); + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register dataset") + } + + break; + } + + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + HGOTO_ERROR(H5E_REFERENCE, H5E_BADTYPE, FAIL, "can't identify type of object referenced") + } /* end switch */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5R_dereference() */ + + +/*-------------------------------------------------------------------------- + NAME + H5R_get_region + PURPOSE + Retrieves a dataspace with the region pointed to selected. + USAGE + H5S_t *H5R_get_region(file, ref_type, ref) + H5F_t *file; IN: File the object being dereferenced is within + void *ref; IN: Reference to open. + + RETURNS + Pointer to the dataspace on success, NULL on failure + DESCRIPTION + Given a reference to some object, creates a copy of the dataset pointed + to's dataspace and defines a selection in the copy which is the region + pointed to. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +H5S_t * +H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) +{ + H5O_loc_t oloc; /* Object location */ + const uint8_t *p; /* Pointer to OID to store */ + H5HG_t hobjid; /* Heap object ID */ + uint8_t *buf = NULL; /* Buffer to store serialized selection in */ + H5S_t *ret_value; + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(_ref); + HDassert(file); + + /* Initialize the object location */ + H5O_loc_reset(&oloc); + oloc.file = file; + + /* Get the heap ID for the dataset region */ + p = (const uint8_t *)_ref; + H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); + UINT32DECODE(p, hobjid.idx); + + /* Get the dataset region from the heap (allocate inside routine) */ + if ((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) + HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, NULL, "Unable to read dataset region information") + + /* Get the object oid for the dataset */ + p = buf; + H5F_addr_decode(oloc.file, &p, &(oloc.addr)); + + /* Open and copy the dataset's dataspace */ + if ((ret_value = H5S_read(&oloc, dxpl_id)) == NULL) + HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, NULL, "not found") + + /* Unserialize the selection */ + if (H5S_SELECT_DESERIALIZE(&ret_value, &p) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, NULL, "can't deserialize selection") + +done: + /* Free the buffer allocated in H5HG_read() */ + if (buf) + H5MM_xfree(buf); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5R_get_region() */ + + +/*-------------------------------------------------------------------------- + NAME + H5R_get_obj_type + PURPOSE + Retrieves the type of object that an object reference points to + USAGE + H5O_type_t H5R_get_obj_type(file, ref_type, ref) + H5F_t *file; IN: File the object being dereferenced is within + H5R_type_t ref_type; IN: Type of reference to query + void *ref; IN: Reference to query. + + RETURNS + Success: An object type defined in H5Gpublic.h + Failure: H5G_UNKNOWN + DESCRIPTION + Given a reference to some object, this function returns the type of object + pointed to. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, + const void *_ref, H5O_type_t *obj_type) +{ + H5O_loc_t oloc; /* Object location */ + unsigned rc; /* Reference count of object */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(file); + HDassert(_ref); + + /* Initialize the symbol table entry */ + H5O_loc_reset(&oloc); + oloc.file = file; + + switch (ref_type) { + case H5R_OBJECT: + { + /* Get the object oid */ + oloc.addr = *(const hobj_ref_t *)_ref; /* Only object references currently supported */ + break; + } + + case H5R_DATASET_REGION: + { + H5HG_t hobjid; /* Heap object ID */ + const uint8_t *p; /* Pointer to reference to decode */ + uint8_t *buf; /* Buffer to store serialized selection in */ + + /* Get the heap ID for the dataset region */ + p = (const uint8_t *)_ref; + H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); + UINT32DECODE(p, hobjid.idx); + + /* Get the dataset region from the heap (allocate inside routine) */ + if ((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) + HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") + + /* Get the object oid for the dataset */ + p = buf; + H5F_addr_decode(oloc.file, &p, &(oloc.addr)); + + /* Free the buffer allocated in H5HG_read() */ + H5MM_xfree(buf); + + break; + } + + case H5R_BADTYPE: + case H5R_MAXTYPE: + default: + HDassert("unknown reference type" && 0); + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") + } /* end switch */ + + /* Get the # of links for object, and its type */ + /* (To check to make certain that this object hasn't been deleted since the reference was created) */ + if (H5O_get_rc_and_type(&oloc, dxpl_id, &rc, obj_type) < 0 || 0 == rc) + HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5R_get_obj_type() */ + + +/*-------------------------------------------------------------------------- + NAME + H5R_get_name + PURPOSE + Internal routine to determine a name for the object referenced + USAGE + ssize_t H5R_get_name(f, dxpl_id, ref_type, ref, name, size) + H5F_t *f; IN: Pointer to the file that the reference is pointing + into + hid_t lapl_id; IN: LAPL to use for operation + hid_t dxpl_id; IN: DXPL to use for operation + hid_t id; IN: Location ID given for reference + H5R_type_t ref_type; IN: Type of reference + void *ref; IN: Reference to query. + char *name; OUT: Buffer to place name of object referenced + size_t size; IN: Size of name buffer + + RETURNS + Non-negative length of the path on success, Negative on failure + DESCRIPTION + Given a reference to some object, determine a path to the object + referenced in the file. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + This may not be the only path to that object. + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +ssize_t +H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_type, + const void *_ref, char *name, size_t size) +{ + hid_t file_id = H5I_INVALID_HID; /* ID for file that the reference is in */ + H5O_loc_t oloc; /* Object location describing object for reference */ + ssize_t ret_value = -1; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Check args */ + HDassert(f); + HDassert(_ref); + + /* Initialize the object location */ + H5O_loc_reset(&oloc); + oloc.file = f; + + /* Get address for reference */ + switch (ref_type) { + case H5R_OBJECT: + { + oloc.addr = *(const hobj_ref_t *)_ref; + break; + } + + case H5R_DATASET_REGION: + { + H5HG_t hobjid; /* Heap object ID */ + uint8_t *buf; /* Buffer to store serialized selection in */ + const uint8_t *p; /* Pointer to OID to store */ + + /* Get the heap ID for the dataset region */ + p = (const uint8_t *)_ref; + H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); + UINT32DECODE(p, hobjid.idx); + + /* Get the dataset region from the heap (allocate inside routine) */ + if ((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) + HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") + + /* Get the object oid for the dataset */ + p = buf; + H5F_addr_decode(oloc.file, &p, &(oloc.addr)); + + /* Free the buffer allocated in H5HG_read() */ + H5MM_xfree(buf); + + break; + } + + case H5R_BADTYPE: + case H5R_MAXTYPE: + default: + HDassert("unknown reference type" && 0); + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") + } /* end switch */ + + /* Retrieve file ID for name search */ + if ((file_id = H5I_get_file_id(id, FALSE)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't retrieve file ID") + + /* Get name, length, etc. */ + if ((ret_value = H5G_get_name_by_addr(file_id, lapl_id, dxpl_id, &oloc, name, size)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't determine name") + +done: + /* Close file ID used for search */ + if (file_id > 0 && H5I_dec_ref(file_id) < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "can't decrement ref count of temp ID") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5R_get_name() */ + diff --git a/src/H5Rmodule.h b/src/H5Rmodule.h index 2eaf050..678a668 100644 --- a/src/H5Rmodule.h +++ b/src/H5Rmodule.h @@ -10,13 +10,9 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5R package. Including this header means that the source file - * is part of the H5R package. +/* Purpose: This file contains declarations which define macros for the + * H5R package. Including this header means that the source file + * is part of the H5R package. */ #ifndef _H5Rmodule_H #define _H5Rmodule_H @@ -31,4 +27,3 @@ #endif /* _H5Rmodule_H */ - diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h index 6d5036b..129f944 100644 --- a/src/H5Rpkg.h +++ b/src/H5Rpkg.h @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Quincey Koziol - * Thursday, September 13, 2007 - * - * Purpose: This file contains declarations which are visible +/* Purpose: This file contains declarations which are visible * only within the H5R package. Source files outside the * H5R package should include H5Rprivate.h instead. */ @@ -30,7 +26,6 @@ #include "H5Rprivate.h" /* Other private headers needed by this file */ -#include "H5Fprivate.h" /* File access */ /**************************/ /* Package Private Macros */ @@ -51,12 +46,5 @@ /* Package Private Prototypes */ /******************************/ -/* General functions */ -H5_DLL herr_t H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, - const void *_ref, H5O_type_t *obj_type); -H5_DLL hid_t H5R_dereference(H5F_t *file, hid_t dapl_id, hid_t dxpl_id, H5R_type_t ref_type, - const void *_ref, hbool_t app_ref); - - #endif /* _H5Rpkg_H */ diff --git a/src/H5Rprivate.h b/src/H5Rprivate.h index 7efa225..35e63d2 100644 --- a/src/H5Rprivate.h +++ b/src/H5Rprivate.h @@ -20,10 +20,40 @@ #include "H5Rpublic.h" /* Private headers needed by this file */ +#include "H5Fprivate.h" /* Files */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Sprivate.h" /* Dataspaces */ -/* Internal data structures */ -/* Private functions */ +/**************************/ +/* Library Private Macros */ +/**************************/ + + +/****************************/ +/* Library Private Typedefs */ +/****************************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/******************************/ +/* Library Private Prototypes */ +/******************************/ + +H5_DLL herr_t H5R_create(void *ref, H5G_loc_t *loc, const char *name, + H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id); +H5_DLL H5S_t * H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref); +H5_DLL ssize_t H5R_get_name(H5F_t *file, hid_t lapl_id, hid_t dxpl_id, hid_t id, + H5R_type_t ref_type, const void *_ref, char *name, size_t size); +H5_DLL herr_t H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, + const void *_ref, H5O_type_t *obj_type); +H5_DLL hid_t H5R_dereference(H5F_t *file, hid_t dapl_id, hid_t dxpl_id, H5R_type_t ref_type, + const void *_ref, hbool_t app_ref); #endif /* _H5Rprivate_H */ diff --git a/src/H5Rpublic.h b/src/H5Rpublic.h index 446b7cd..598bafd 100644 --- a/src/H5Rpublic.h +++ b/src/H5Rpublic.h @@ -22,40 +22,59 @@ #include "H5Gpublic.h" #include "H5Ipublic.h" -/* - * Reference types allowed. - */ -typedef enum { - H5R_BADTYPE = (-1), /*invalid Reference Type */ - H5R_OBJECT, /*Object reference */ - H5R_DATASET_REGION, /*Dataset Region Reference */ - H5R_MAXTYPE /*highest type (Invalid as true type) */ -} H5R_type_t; +/*****************/ +/* Public Macros */ +/*****************/ /* Note! Be careful with the sizes of the references because they should really * depend on the run-time values in the file. Unfortunately, the arrays need - * to be defined at compile-time, so we have to go with the worst case sizes for - * them. -QAK + * to be defined at compile-time, so we have to go with the worst case sizes + * for them. -QAK + */ +#define H5R_OBJ_REF_BUF_SIZE sizeof(haddr_t) + +/* 4 is used instead of sizeof(int) to permit portability between the Crays + * and other machines (the heap ID is always encoded as an int32 anyway). + */ +#define H5R_DSET_REG_REF_BUF_SIZE (sizeof(haddr_t) + 4) + +/*******************/ +/* Public Typedefs */ +/*******************/ + +/* Reference types */ +typedef enum H5R_type_t { + H5R_BADTYPE = (-1), /* Invalid Reference Type */ + H5R_OBJECT, /* Object reference */ + H5R_DATASET_REGION, /* Dataset Region Reference */ + H5R_MAXTYPE /* Highest type (Invalid as true type) */ +} H5R_type_t; + +/* Object reference structure for user's code + * This needs to be large enough to store largest haddr_t on a worst case + * machine (8 bytes currently). + */ +typedef haddr_t hobj_ref_t; + +/* Dataset Region reference structure for user's code + * (Buffer to store heap ID and index) + * This needs to be large enough to store largest haddr_t in a worst case + * machine (8 bytes currently) plus an int */ -#define H5R_OBJ_REF_BUF_SIZE sizeof(haddr_t) -/* Object reference structure for user's code */ -typedef haddr_t hobj_ref_t; /* Needs to be large enough to store largest haddr_t in a worst case machine (ie. 8 bytes currently) */ +typedef unsigned char hdset_reg_ref_t[H5R_DSET_REG_REF_BUF_SIZE]; -#define H5R_DSET_REG_REF_BUF_SIZE (sizeof(haddr_t)+4) -/* 4 is used instead of sizeof(int) to permit portability between - the Crays and other machines (the heap ID is always encoded as an int32 anyway) -*/ -/* Dataset Region reference structure for user's code */ -typedef unsigned char hdset_reg_ref_t[H5R_DSET_REG_REF_BUF_SIZE];/* Buffer to store heap ID and index */ -/* Needs to be large enough to store largest haddr_t in a worst case machine (ie. 8 bytes currently) plus an int */ +/********************/ +/* Public Variables */ +/********************/ -/* Publicly visible data structures */ +/*********************/ +/* Public Prototypes */ +/*********************/ #ifdef __cplusplus extern "C" { #endif -/* Functions in H5R.c */ H5_DLL herr_t H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t space_id); H5_DLL hid_t H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *ref); @@ -63,7 +82,7 @@ H5_DLL hid_t H5Rget_region(hid_t dataset, H5R_type_t ref_type, const void *ref); H5_DLL herr_t H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *_ref, H5O_type_t *obj_type); H5_DLL ssize_t H5Rget_name(hid_t loc_id, H5R_type_t ref_type, const void *ref, - char *name/*out*/, size_t size); + char *name /*out*/, size_t size); /* Symbols defined for compatibility with previous versions of the HDF5 API. * @@ -71,12 +90,6 @@ H5_DLL ssize_t H5Rget_name(hid_t loc_id, H5R_type_t ref_type, const void *ref, */ #ifndef H5_NO_DEPRECATED_SYMBOLS -/* Macros */ - - -/* Typedefs */ - - /* Function prototypes */ H5_DLL H5G_obj_t H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *_ref); H5_DLL hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref); diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 8934726..f125035 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -17,6 +17,9 @@ #ifndef _H5Sprivate_H #define _H5Sprivate_H +/* Early typedefs to avoid circular dependencies */ +typedef struct H5S_t H5S_t; + /* Include package's public header */ #include "H5Spublic.h" @@ -44,7 +47,6 @@ #define H5S_GET_SEQ_LIST_SORTED 0x0001 /* Forward references of package typedefs */ -typedef struct H5S_t H5S_t; typedef struct H5S_extent_t H5S_extent_t; typedef struct H5S_pnt_node_t H5S_pnt_node_t; typedef struct H5S_hyper_span_t H5S_hyper_span_t; diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index f2da62e..17cdc49 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -17,6 +17,9 @@ #ifndef _H5Tprivate_H #define _H5Tprivate_H +/* Early typedefs to avoid circular dependencies */ +typedef struct H5T_t H5T_t; + /* Get package's public header */ #include "H5Tpublic.h" @@ -45,7 +48,6 @@ #endif /* H5T_MODULE */ /* Forward references of package typedefs (declared in H5Tpkg.h) */ -typedef struct H5T_t H5T_t; typedef struct H5T_stats_t H5T_stats_t; typedef struct H5T_path_t H5T_path_t; diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index fe182ad..26e35a7 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -18,6 +18,9 @@ #ifndef _H5Zprivate_H #define _H5Zprivate_H +/* Early typedefs to avoid circular dependencies */ +typedef struct H5Z_filter_info_t H5Z_filter_info_t; + /* Include package's public header */ #include "H5Zpublic.h" @@ -49,7 +52,7 @@ /****************************/ /* Structure to store information about each filter's parameters */ -typedef struct H5Z_filter_info_t { +struct H5Z_filter_info_t { H5Z_filter_t id; /*filter identification number */ unsigned flags; /*defn and invocation flags */ char _name[H5Z_COMMON_NAME_LEN]; /*internal filter name */ @@ -57,7 +60,7 @@ typedef struct H5Z_filter_info_t { size_t cd_nelmts; /*number of elements in cd_values[] */ unsigned _cd_values[H5Z_COMMON_CD_VALUES]; /*internal client data values */ unsigned *cd_values; /*client data values */ -} H5Z_filter_info_t; +}; /*****************************/ /* Library-private Variables */ diff --git a/src/Makefile.am b/src/Makefile.am index 9a64717..ad29e2a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -98,7 +98,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ H5PB.c \ H5PL.c H5PLint.c H5PLpath.c H5PLplugin_cache.c \ - H5R.c H5Rdeprec.c \ + H5R.c H5Rint.c H5Rdeprec.c \ H5UC.c \ H5RS.c \ H5S.c H5Sall.c H5Sdbg.c H5Shyper.c H5Snone.c H5Spoint.c \ -- cgit v0.12 From de0076b5ba9869c07056d28318965cf362299162 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 8 Nov 2017 09:05:26 -0600 Subject: Remove tabs --- src/H5Dint.c | 860 ++++++++++++++++++++++++----------------------------------- 1 file changed, 344 insertions(+), 516 deletions(-) diff --git a/src/H5Dint.c b/src/H5Dint.c index bdedd1e..b6c0341 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -21,14 +21,14 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Dpkg.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5FOprivate.h" /* File objects */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Lprivate.h" /* Links */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dpkg.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5FOprivate.h" /* File objects */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -54,18 +54,18 @@ typedef struct { /* General stuff */ static herr_t H5D__get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache); static H5D_shared_t *H5D__new(hid_t dcpl_id, hbool_t creating, - hbool_t vl_type); + hbool_t vl_type); static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, - const H5T_t *type); + const H5T_t *type); static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, - hid_t dapl_id); + hid_t dapl_id); static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, - char **extfile_prefix); + char **extfile_prefix); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, - hsize_t old_dim[]); + hsize_t old_dim[]); static herr_t H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id); /*********************/ @@ -109,9 +109,9 @@ static H5D_shared_t H5D_def_dset; /* Dataset ID class */ static const H5I_class_t H5I_DATASET_CLS[1] = {{ - H5I_DATASET, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ + H5I_DATASET, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ (H5I_free_t)H5D_close /* Callback routine for closing objects of this class */ }}; @@ -121,17 +121,13 @@ static hbool_t H5D_top_package_initialize_s = FALSE; /*------------------------------------------------------------------------- - * Function: H5D_init + * Function: H5D_init * - * Purpose: Initialize the interface from some other layer. + * Purpose: Initialize the interface from some other layer. * - * Return: Success: non-negative - * - * Failure: negative - * - * Programmer: Quincey Koziol - * Saturday, March 4, 2000 + * Return: Success: non-negative * + * Failure: negative *------------------------------------------------------------------------- */ herr_t @@ -149,7 +145,7 @@ done: /*-------------------------------------------------------------------------- NAME - H5D__init_package -- Initialize interface-specific information + H5D__init_package -- Initialize interface-specific information USAGE herr_t H5D__init_package() @@ -211,28 +207,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_top_term_package - * - * Purpose: Close the "top" of the interface, releasing IDs, etc. - * - * Return: Success: Positive if anything was done that might - * affect other interfaces; zero otherwise. - * Failure: Negative. + * Function: H5D_top_term_package * - * Programmer: Quincey Koziol - * Sunday, September 13, 2015 + * Purpose: Close the "top" of the interface, releasing IDs, etc. * + * Return: Success: Positive if anything was done that might + * affect other interfaces; zero otherwise. + * Failure: Negative. *------------------------------------------------------------------------- */ int H5D_top_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5D_top_package_initialize_s) { - if(H5I_nmembers(H5I_DATASET) > 0) { + if(H5I_nmembers(H5I_DATASET) > 0) { /* The dataset API uses the "force" flag set to true because it * is using the "file objects" (H5FO) API functions to track open * objects in the file. Using the H5FO code means that dataset @@ -255,9 +247,9 @@ H5D_top_term_package(void) * * QAK - 5/13/03 */ - (void)H5I_clear_type(H5I_DATASET, TRUE, FALSE); + (void)H5I_clear_type(H5I_DATASET, TRUE, FALSE); n++; /*H5I*/ - } /* end if */ + } /* end if */ /* Mark closed */ if(0 == n) @@ -269,26 +261,22 @@ H5D_top_term_package(void) /*------------------------------------------------------------------------- - * Function: H5D_term_package - * - * Purpose: Terminate this interface. + * Function: H5D_term_package * - * Note: Finishes shutting down the interface, after - * H5D_top_term_package() is called + * Purpose: Terminate this interface. * - * Return: Success: Positive if anything was done that might - * affect other interfaces; zero otherwise. - * Failure: Negative. - * - * Programmer: Robb Matzke - * Friday, November 20, 1998 + * Note: Finishes shutting down the interface, after + * H5D_top_term_package() is called * + * Return: Success: Positive if anything was done that might + * affect other interfaces; zero otherwise. + * Failure: Negative. *------------------------------------------------------------------------- */ int H5D_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -440,17 +428,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__create_named - * - * Purpose: Internal routine to create a new dataset. + * Function: H5D__create_named * - * Return: Success: Non-NULL, pointer to new dataset object. + * Purpose: Internal routine to create a new dataset. * - * Failure: NULL - * - * Programmer: Quincey Koziol - * Thursday, April 5, 2007 + * Return: Success: Non-NULL, pointer to new dataset object. * + * Failure: NULL *------------------------------------------------------------------------- */ H5D_t * @@ -460,7 +444,7 @@ H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, { H5O_obj_create_t ocrt_info; /* Information for object creation */ H5D_obj_create_t dcrt_info; /* Information for dataset creation */ - H5D_t *ret_value = NULL; /* Return value */ + H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -505,11 +489,7 @@ done: * * Return: * Success: Non-negative - * * Failture: Negative - * - * Programmer: Raymond Lu - * *------------------------------------------------------------------------- */ herr_t @@ -557,7 +537,7 @@ H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id *allocation = H5D_SPACE_STATUS_NOT_ALLOCATED; else if(space_allocated == full_size) *allocation = H5D_SPACE_STATUS_ALLOCATED; - else + else *allocation = H5D_SPACE_STATUS_PART_ALLOCATED; } /* end if */ else { @@ -575,17 +555,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__new - * - * Purpose: Creates a new, empty dataset structure + * Function: H5D__new * - * Return: Success: Pointer to a new dataset descriptor. - * - * Failure: NULL - * - * Programmer: Quincey Koziol - * Monday, October 12, 1998 + * Purpose: Creates a new, empty dataset structure * + * Return: Success: Pointer to a new dataset descriptor. + * Failure: NULL *------------------------------------------------------------------------- */ static H5D_shared_t * @@ -636,26 +611,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__init_type + * Function: H5D__init_type * - * Purpose: Copy a datatype for a dataset's use, performing all the + * Purpose: Copy a datatype for a dataset's use, performing all the * necessary adjustments, etc. * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: Quincey Koziol - * Thursday, June 24, 2004 - * + * Return: Success: SUCCEED + * Failure: FAIL *------------------------------------------------------------------------- */ static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) { - htri_t relocatable; /* Flag whether the type is relocatable */ - htri_t immutable; /* Flag whether the type is immutable */ - hbool_t use_latest_format; /* Flag indicating the 'latest datatype version support' is enabled */ - herr_t ret_value = SUCCEED; /* Return value */ + htri_t relocatable; /* Flag whether the type is relocatable */ + htri_t immutable; /* Flag whether the type is immutable */ + hbool_t use_latest_format; /* Flag indicating the 'latest datatype version support' is enabled */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -681,8 +652,8 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) if((dset->shared->type = H5T_copy(type, H5T_COPY_ALL)) == NULL) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy datatype") - /* Convert a datatype (if committed) to a transient type if the committed datatype's file - location is different from the file location where the dataset will be created */ + /* Convert a datatype (if committed) to a transient type if the committed datatype's file + location is different from the file location where the dataset will be created */ if(H5T_convert_committed_datatype(dset->shared->type, file) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get shared datatype info") @@ -696,8 +667,8 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") /* Get a datatype ID for the dataset's datatype */ - if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") + if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") } /* end if */ /* Not a custom datatype, just use it directly */ else { @@ -715,16 +686,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__cache_dataspace_info - * - * Purpose: Cache dataspace info for a dataset - * - * Return: Success: SUCCEED - * Failure: FAIL + * Function: H5D__cache_dataspace_info * - * Programmer: Quincey Koziol - * Wednesday, November 19, 2014 + * Purpose: Cache dataspace info for a dataset * + * Return: Success: SUCCEED + * Failure: FAIL *------------------------------------------------------------------------- */ static herr_t @@ -759,17 +726,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__init_space + * Function: H5D__init_space * - * Purpose: Copy a dataspace for a dataset's use, performing all the + * Purpose: Copy a dataspace for a dataset's use, performing all the * necessary adjustments, etc. * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: Quincey Koziol - * Tuesday, July 24, 2007 - * + * Return: Success: SUCCEED + * Failure: FAIL *------------------------------------------------------------------------- */ static herr_t @@ -811,16 +774,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__update_oh_info - * - * Purpose: Create and fill object header for dataset - * - * Return: Success: SUCCEED - * Failure: FAIL + * Function: H5D__update_oh_info * - * Programmer: Bill Wendling - * Thursday, October 31, 2002 + * Purpose: Create and fill object header for dataset * + * Return: Success: SUCCEED + * Failure: FAIL *------------------------------------------------------------------------- */ static herr_t @@ -831,9 +790,9 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) H5O_loc_t *oloc = NULL; /* Dataset's object location */ H5O_layout_t *layout; /* Dataset's layout information */ H5T_t *type; /* Dataset's datatype */ - H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */ - H5D_fill_value_t fill_status; /* Fill value status */ - hbool_t fill_changed = FALSE; /* Flag indicating the fill value was changed */ + H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */ + H5D_fill_value_t fill_status; /* Fill value status */ + hbool_t fill_changed = FALSE; /* Flag indicating the fill value was changed */ hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ herr_t ret_value = SUCCEED; /* Return value */ @@ -875,10 +834,12 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) if(fill_prop->buf && fill_prop->size > 0 && H5O_fill_convert(fill_prop, type, &fill_changed, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert fill value to dataset type") - fill_prop->fill_defined = TRUE; - } else if(fill_status == H5D_FILL_VALUE_UNDEFINED) { - fill_prop->fill_defined = FALSE; - } else + fill_prop->fill_defined = TRUE; + } + else if(fill_status == H5D_FILL_VALUE_UNDEFINED) { + fill_prop->fill_defined = FALSE; + } + else HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine if fill value is defined") /* Check for invalid fill & allocation time setting */ @@ -961,17 +922,17 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) (H5P_exist_plist(dc_plist, H5O_BOGUS_MSG_ID_NAME) > 0) ) { uint8_t bogus_flags = 0; /* Flags for creating "bogus" message */ - unsigned bogus_id; /* "bogus" ID */ + unsigned bogus_id; /* "bogus" ID */ - /* Retrieve "bogus" message ID */ + /* Retrieve "bogus" message ID */ if(H5P_get(dc_plist, H5O_BOGUS_MSG_ID_NAME, &bogus_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus ID options") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus ID options") /* Retrieve "bogus" message flags */ if(H5P_get(dc_plist, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus message options") /* Add a "bogus" message (for error testing). */ - if(H5O_bogus_oh(file, dxpl_id, oh, bogus_id, (unsigned)bogus_flags) < 0) + if(H5O_bogus_oh(file, dxpl_id, oh, bogus_id, (unsigned)bogus_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create 'bogus' message") } /* end if */ } @@ -1010,9 +971,6 @@ done: * should be used. * * Return: SUCCEED/FAIL - * - * Programmer: Steffen Kiess - * October 16, 2015 *-------------------------------------------------------------------------- */ static herr_t @@ -1025,7 +983,7 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix size_t extfile_prefix_len; /* length of expanded prefix */ H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT @@ -1064,7 +1022,7 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix extpath_len = HDstrlen(extpath); prefix_len = HDstrlen(prefix); extfile_prefix_len = extpath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; - + if(NULL == (*extfile_prefix = (char *)H5MM_malloc(extfile_prefix_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") HDsnprintf(*extfile_prefix, extfile_prefix_len, "%s%s", extpath, prefix + HDstrlen("${ORIGIN}")); @@ -1081,32 +1039,27 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__create - * - * Purpose: Creates a new dataset with name NAME in file F and associates - * with it a datatype TYPE for each element as stored in the - * file, dimensionality information or dataspace SPACE, and - * other miscellaneous properties CREATE_PARMS. All arguments - * are deep-copied before being associated with the new dataset, - * so the caller is free to subsequently modify them without - * affecting the dataset. - * - * Return: Success: Pointer to a new dataset - * - * Failure: NULL - * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 - * + * Function: H5D__create + * + * Purpose: Creates a new dataset with name NAME in file F and associates + * with it a datatype TYPE for each element as stored in the + * file, dimensionality information or dataspace SPACE, and + * other miscellaneous properties CREATE_PARMS. All arguments + * are deep-copied before being associated with the new dataset, + * so the caller is free to subsequently modify them without + * affecting the dataset. + * + * Return: Success: Pointer to a new dataset + * Failure: NULL *------------------------------------------------------------------------- */ H5D_t * H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id) { - const H5T_t *type; /* Datatype for dataset */ - H5D_t *new_dset = NULL; - H5P_genplist_t *dc_plist = NULL; /* New Property list */ + const H5T_t *type; /* Datatype for dataset */ + H5D_t *new_dset = NULL; + H5P_genplist_t *dc_plist = NULL; /* New Property list */ hbool_t has_vl_type = FALSE; /* Flag to indicate a VL-type for dataset */ hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ hbool_t layout_copied = FALSE; /* Flag to indicate that layout message was copied */ @@ -1114,7 +1067,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hbool_t pline_copied = FALSE; /* Flag to indicate that pipeline message was copied */ hbool_t efl_copied = FALSE; /* Flag to indicate that external file list message was copied */ H5G_loc_t dset_loc; /* Dataset location */ - H5D_t *ret_value = NULL; /* Return value */ + H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1218,24 +1171,24 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, /* Set the latest version of the layout, pline & fill messages, if requested */ if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DSET_MSG_FLAGS)) { /* Set the latest version for the I/O pipeline message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_PLINE_MSG)) - if(H5O_pline_set_latest_version(&new_dset->shared->dcpl_cache.pline) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of I/O filter pipeline") + if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_PLINE_MSG)) + if(H5O_pline_set_latest_version(&new_dset->shared->dcpl_cache.pline) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of I/O filter pipeline") /* Set the latest version for the fill message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG)) - /* Set the latest version for the fill value message */ - if(H5O_fill_set_latest_version(&new_dset->shared->dcpl_cache.fill) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") + if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG)) + /* Set the latest version for the fill value message */ + if(H5O_fill_set_latest_version(&new_dset->shared->dcpl_cache.fill) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") /* Set the latest version for the layout message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_LAYOUT_MSG)) - /* Set the latest version for the layout message */ - if(H5D__layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") + if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_LAYOUT_MSG)) + /* Set the latest version for the layout message */ + if(H5D__layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") } /* end if */ else if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) { - /* Use latest indexing type for layout message version >= 4 */ + /* Use latest indexing type for layout message version >= 4 */ if(H5D__layout_set_latest_indexing(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest indexing") } /* end if */ @@ -1261,7 +1214,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, /* Set up append flush parameters for the dataset */ if(H5D__append_flush_setup(new_dset, dapl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") /* Set the external file prefix */ if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) @@ -1329,10 +1282,6 @@ done: * * Return: Success: Ptr to a new dataset. * Failure: NULL - * - * Programmer: Neil Fortner - * Friday, March 6, 2015 - * *------------------------------------------------------------------------- */ H5D_t * @@ -1387,17 +1336,13 @@ done: /* *------------------------------------------------------------------------- - * Function: H5D_open + * Function: H5D_open * - * Purpose: Checks if dataset is already open, or opens a dataset for + * Purpose: Checks if dataset is already open, or opens a dataset for * access. * - * Return: Success: Dataset ID - * Failure: FAIL - * - * Programmer: Quincey Koziol - * Friday, December 20, 2002 - * + * Return: Success: Dataset ID + * Failure: FAIL *------------------------------------------------------------------------- */ H5D_t * @@ -1509,19 +1454,15 @@ done: /* *------------------------------------------------------------------------- - * Function: H5D__flush_append_setup - * - * Purpose: Set the append flush parameters for a dataset - * - * Return: Non-negative on success/Negative on failure + * Function: H5D__flush_append_setup * - * Programmer: Vailin Choi - * Wednesday, January 8, 2014 + * Purpose: Set the append flush parameters for a dataset * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ static herr_t -H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id) +H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id) { herr_t ret_value = SUCCEED; /* return value */ @@ -1538,47 +1479,47 @@ H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id) if(dapl_id != H5P_DATASET_ACCESS_DEFAULT && dset->shared->layout.type == H5D_CHUNKED) { H5P_genplist_t *dapl; /* data access property list object pointer */ - /* Get dataset access property list */ - if(NULL == (dapl = (H5P_genplist_t *)H5I_object(dapl_id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for dapl ID"); + /* Get dataset access property list */ + if(NULL == (dapl = (H5P_genplist_t *)H5I_object(dapl_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for dapl ID"); - /* Check if append flush property exists */ - if(H5P_exist_plist(dapl, H5D_ACS_APPEND_FLUSH_NAME) > 0) { + /* Check if append flush property exists */ + if(H5P_exist_plist(dapl, H5D_ACS_APPEND_FLUSH_NAME) > 0) { H5D_append_flush_t info; - /* Get append flush property */ - if(H5P_get(dapl, H5D_ACS_APPEND_FLUSH_NAME, &info) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get append flush info") - if(info.ndims > 0) { - hsize_t curr_dims[H5S_MAX_RANK]; /* current dimension sizes */ - hsize_t max_dims[H5S_MAX_RANK]; /* current dimension sizes */ - int rank; /* dataspace # of dimensions */ - unsigned u; /* local index variable */ - - /* Get dataset rank */ - if((rank = H5S_get_simple_extent_dims(dset->shared->space, curr_dims, max_dims)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") - if(info.ndims != (unsigned)rank) - HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "boundary dimension rank does not match dataset rank") - - /* Validate boundary sizes */ - for(u = 0; u < info.ndims; u++) - if(info.boundary[u] != 0) /* when a non-zero boundary is set */ - /* the dimension is extendible? */ - if(max_dims[u] != H5S_UNLIMITED && max_dims[u] == curr_dims[u]) - break; + /* Get append flush property */ + if(H5P_get(dapl, H5D_ACS_APPEND_FLUSH_NAME, &info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get append flush info") + if(info.ndims > 0) { + hsize_t curr_dims[H5S_MAX_RANK]; /* current dimension sizes */ + hsize_t max_dims[H5S_MAX_RANK]; /* current dimension sizes */ + int rank; /* dataspace # of dimensions */ + unsigned u; /* local index variable */ + + /* Get dataset rank */ + if((rank = H5S_get_simple_extent_dims(dset->shared->space, curr_dims, max_dims)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") + if(info.ndims != (unsigned)rank) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "boundary dimension rank does not match dataset rank") + + /* Validate boundary sizes */ + for(u = 0; u < info.ndims; u++) + if(info.boundary[u] != 0) /* when a non-zero boundary is set */ + /* the dimension is extendible? */ + if(max_dims[u] != H5S_UNLIMITED && max_dims[u] == curr_dims[u]) + break; /* At least one boundary dimension is not extendible */ - if(u != info.ndims) - HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "boundary dimension is not valid") + if(u != info.ndims) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "boundary dimension is not valid") /* Copy append flush settings */ - dset->shared->append_flush.ndims = info.ndims; - dset->shared->append_flush.func = info.func; - dset->shared->append_flush.udata = info.udata; - HDmemcpy(dset->shared->append_flush.boundary, info.boundary, sizeof(info.boundary)); - } /* end if */ - } /* end if */ + dset->shared->append_flush.ndims = info.ndims; + dset->shared->append_flush.func = info.func; + dset->shared->append_flush.udata = info.udata; + HDmemcpy(dset->shared->append_flush.boundary, info.boundary, sizeof(info.boundary)); + } /* end if */ + } /* end if */ } /* end if */ done: @@ -1587,15 +1528,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__open_oid - * - * Purpose: Opens a dataset for access. - * - * Return: Dataset pointer on success, NULL on failure + * Function: H5D__open_oid * - * Programmer: Quincey Koziol - * Monday, October 12, 1998 + * Purpose: Opens a dataset for access. * + * Return: Dataset pointer on success, NULL on failure *------------------------------------------------------------------------- */ static herr_t @@ -1605,8 +1542,8 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) H5O_fill_t *fill_prop; /* Pointer to dataset's fill value info */ unsigned alloc_time_state; /* Allocation time state */ htri_t msg_exists; /* Whether a particular type of message exists */ - hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ - herr_t ret_value = SUCCEED; /* Return value */ + hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC_TAG(dxpl_id, dataset->oloc.addr, FAIL) @@ -1652,7 +1589,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) /* Set up flush append property */ if(H5D__append_flush_setup(dataset, dapl_id)) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set up flush append property") + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set up flush append property") /* Point at dataset's copy, to cache it for later */ fill_prop = &dataset->shared->dcpl_cache.fill; @@ -1665,7 +1602,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") } /* end if */ else { - /* For backward compatibility, try to retrieve the old fill value message */ + /* For backward compatibility, try to retrieve the old fill value message */ if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_ID, dxpl_id)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") if(msg_exists) { @@ -1740,7 +1677,7 @@ done: if(H5F_addr_defined(dataset->oloc.addr) && H5O_close(&(dataset->oloc), NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header") if(dataset->shared) { - if(layout_init) + if(layout_init) if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset, dxpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy layout info") if(dataset->shared->space && H5S_close(dataset->shared->space) < 0) @@ -1763,17 +1700,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_close - * - * Purpose: Insures that all data has been saved to the file, closes the - * dataset object header, and frees all resources used by the - * descriptor. + * Function: H5D_close * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Purpose: Insures that all data has been saved to the file, closes the + * dataset object header, and frees all resources used by the + * descriptor. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1896,7 +1829,7 @@ H5D_close(H5D_t *dataset) if(H5AC_cork(dataset->oloc.file, dataset->oloc.addr, H5AC__GET_CORKED, &corked) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve an object's cork status") if(corked) - if(H5AC_cork(dataset->oloc.file, dataset->oloc.addr, H5AC__UNCORK, NULL) < 0) + if(H5AC_cork(dataset->oloc.file, dataset->oloc.addr, H5AC__UNCORK, NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTUNCORK, FAIL, "unable to uncork an object") /* @@ -1920,9 +1853,9 @@ H5D_close(H5D_t *dataset) /* Evict dataset metadata if evicting on close */ if(!file_closed && H5F_SHARED(dataset->oloc.file) && H5F_EVICT_ON_CLOSE(dataset->oloc.file)) { - if(H5AC_flush_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, H5AC_ind_read_dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") - if(H5AC_evict_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, FALSE, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_evict_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, FALSE, H5AC_ind_read_dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata") } /* end if */ @@ -1969,23 +1902,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_mult_refresh_close - * - * Purpose: Closing down the needed information when the dataset has - * multiple opens. (From H5O_refresh_metadata_close()) + * Function: H5D_mult_refresh_close * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi - * 12/24/15 + * Purpose: Closing down the needed information when the dataset has + * multiple opens. (From H5O_refresh_metadata_close()) * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t H5D_mult_refresh_close(hid_t dset_id, hid_t dxpl_id) { - H5D_t *dataset; /* Dataset to refresh */ - herr_t ret_value = SUCCEED; /* return value */ + H5D_t *dataset; /* Dataset to refresh */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2051,16 +1980,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_mult_refresh_reopen - * - * Purpose: Re-initialize the needed info when the dataset has multiple - * opens. (From H5O_refresh_metadata_reopen()) + * Function: H5D_mult_refresh_reopen * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi - * 12/24/15 + * Purpose: Re-initialize the needed info when the dataset has multiple + * opens. (From H5O_refresh_metadata_reopen()) * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -2075,25 +2000,25 @@ H5D_mult_refresh_reopen(H5D_t *dataset, hid_t dxpl_id) HDassert(dataset->shared->fo_count > 0); if(dataset->shared->fo_count > 1) { - /* Release dataspace info */ - if(H5S_close(dataset->shared->space) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to release dataspace") - - /* Re-load dataspace info */ - if(NULL == (dataset->shared->space = H5S_read(&(dataset->oloc), dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load dataspace info from dataset header") - - /* Cache the dataset's dataspace info */ - if(H5D__cache_dataspace_info(dataset) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't cache dataspace info") - - /* Release layout info */ - if(H5O_msg_reset(H5O_LAYOUT_ID, &dataset->shared->layout) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout info") - - /* Re-load layout message info */ - 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") + /* Release dataspace info */ + if(H5S_close(dataset->shared->space) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to release dataspace") + + /* Re-load dataspace info */ + if(NULL == (dataset->shared->space = H5S_read(&(dataset->oloc), dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load dataspace info from dataset header") + + /* Cache the dataset's dataspace info */ + if(H5D__cache_dataspace_info(dataset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't cache dataspace info") + + /* Release layout info */ + if(H5O_msg_reset(H5O_LAYOUT_ID, &dataset->shared->layout) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout info") + + /* Re-load layout message info */ + 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") } /* end if */ done: @@ -2102,16 +2027,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_oloc - * - * Purpose: Returns a pointer to the object location for a dataset. - * - * Return: Success: Ptr to location - * Failure: NULL + * Function: H5D_oloc * - * Programmer: Robb Matzke - * Friday, April 24, 1998 + * Purpose: Returns a pointer to the object location for a dataset. * + * Return: Success: Ptr to location + * Failure: NULL *------------------------------------------------------------------------- */ H5O_loc_t * @@ -2125,16 +2046,12 @@ H5D_oloc(H5D_t *dataset) /*------------------------------------------------------------------------- - * Function: H5D_nameof + * Function: H5D_nameof * - * Purpose: Returns a pointer to the group hier. path for a dataset. - * - * Return: Success: Ptr to entry - * Failure: NULL - * - * Programmer: Quincey Koziol - * Monday, September 12, 2005 + * Purpose: Returns a pointer to the group hier. path for a dataset. * + * Return: Success: Ptr to entry + * Failure: NULL *------------------------------------------------------------------------- */ H5G_name_t * @@ -2148,17 +2065,13 @@ H5D_nameof(H5D_t *dataset) /*------------------------------------------------------------------------- - * Function: H5D_typeof - * - * Purpose: Returns a pointer to the dataset's datatype. The datatype - * is not copied. - * - * Return: Success: Ptr to the dataset's datatype, uncopied. - * Failure: NULL + * Function: H5D_typeof * - * Programmer: Robb Matzke - * Thursday, June 4, 1998 + * Purpose: Returns a pointer to the dataset's datatype. The datatype + * is not copied. * + * Return: Success: Ptr to the dataset's datatype, uncopied. + * Failure: NULL *------------------------------------------------------------------------- */ H5T_t * @@ -2176,15 +2089,11 @@ H5D_typeof(const H5D_t *dset) /*------------------------------------------------------------------------- - * Function: H5D__alloc_storage + * Function: H5D__alloc_storage * - * Purpose: Allocate storage for the raw data of a dataset. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Friday, January 16, 1998 + * Purpose: Allocate storage for the raw data of a dataset. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -2192,11 +2101,11 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]) { const H5D_t *dset = io_info->dset; /* The dataset object */ - H5F_t *f = dset->oloc.file; /* The dataset's file pointer */ - H5O_layout_t *layout; /* The dataset's layout information */ - hbool_t must_init_space = FALSE; /* Flag to indicate that space should be initialized */ - hbool_t addr_set = FALSE; /* Flag to indicate that the dataset's storage address was set */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *f = dset->oloc.file; /* The dataset's file pointer */ + H5O_layout_t *layout; /* The dataset's layout information */ + hbool_t must_init_space = FALSE; /* Flag to indicate that space should be initialized */ + hbool_t addr_set = FALSE; /* Flag to indicate that the dataset's storage address was set */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2246,19 +2155,18 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, } /* end if */ /* If space allocation is set to 'early' and we are extending - * the dataset, indicate that space should be allocated, so the + * the dataset, indicate that space should be allocated, so the * index gets expanded. -QAK */ - if(dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_EARLY - && time_alloc == H5D_ALLOC_EXTEND) - must_init_space = TRUE; + if(dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_EARLY && time_alloc == H5D_ALLOC_EXTEND) + must_init_space = TRUE; break; case H5D_COMPACT: /* Check if space is already allocated */ if(NULL == layout->storage.u.compact.buf) { - /* Reserve space in layout header message for the entire array. - * Starting from the 1.8.7 release, we allow dataspace to have + /* Reserve space in layout header message for the entire array. + * Starting from the 1.8.7 release, we allow dataspace to have * zero dimension size. So the storage size can be zero. * SLU 2011/4/4 */ if(layout->storage.u.compact.size > 0) { @@ -2270,7 +2178,8 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, /* Indicate that we should initialize storage space */ must_init_space = TRUE; - } else { + } + else { layout->storage.u.compact.dirty = FALSE; must_init_space = FALSE; } @@ -2312,7 +2221,7 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value") } /* end if */ else { - H5D_fill_value_t fill_status; /* The fill value status */ + H5D_fill_value_t fill_status; /* The fill value status */ /* Check the dataset's fill-value status */ if(H5P_is_fill_value_defined(&dset->shared->dcpl_cache.fill, &fill_status) < 0) @@ -2346,24 +2255,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__init_storage + * Function: H5D__init_storage * - * Purpose: Initialize the data for a new dataset. If a selection is - * defined for SPACE then initialize only that part of the - * dataset. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Monday, October 5, 1998 + * Purpose: Initialize the data for a new dataset. If a selection is + * defined for SPACE then initialize only that part of the + * dataset. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]) { const H5D_t *dset = io_info->dset; /* dataset pointer */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2422,22 +2327,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__get_storage_size - * - * Purpose: Determines how much space has been reserved to store the raw - * data of a dataset. + * Function: H5D__get_storage_size * - * Return: Non-negative on success, negative on failure - * - * Programmer: Robb Matzke - * Wednesday, April 21, 1999 + * Purpose: Determines how much space has been reserved to store the raw + * data of a dataset. * + * Return: Non-negative on success, negative on failure *------------------------------------------------------------------------- */ herr_t H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) @@ -2481,24 +2382,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__get_offset - * - * Purpose: Private function for H5D__get_offset. Returns the address - * of dataset in file. - * - * Return: Success: the address of dataset - * - * Failure: HADDR_UNDEF + * Function: H5D__get_offset * - * Programmer: Raymond Lu - * November 6, 2002 + * Purpose: Private function for H5D__get_offset. Returns the address + * of dataset in file. * + * Return: Success: the address of dataset + * Failure: HADDR_UNDEF *------------------------------------------------------------------------- */ haddr_t H5D__get_offset(const H5D_t *dset) { - haddr_t ret_value = HADDR_UNDEF; + haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_PACKAGE @@ -2530,18 +2426,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_vlen_reclaim + * Function: H5D_vlen_reclaim * - * Purpose: Frees the buffers allocated for storing variable-length data - * in memory. Only frees the VL data in the selection defined in the - * dataspace. The dataset transfer property list is required to find the - * correct allocation/free methods for the VL data in the buffer. - * - * Return: Non-negative on success, negative on failure - * - * Programmer: Quincey Koziol - * Tuesday, November 22, 2005 + * Purpose: Frees the buffers allocated for storing variable-length data + * in memory. Only frees the VL data in the selection defined in the + * dataspace. The dataset transfer property list is required to find the + * correct allocation/free methods for the VL data in the buffer. * + * Return: Non-negative on success, negative on failure *------------------------------------------------------------------------- */ herr_t @@ -2551,7 +2443,7 @@ H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf) H5S_sel_iter_op_t dset_op; /* Operator for iteration */ H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ - herr_t ret_value = FAIL; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2581,18 +2473,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__vlen_get_buf_size_alloc - * - * Purpose: This routine makes certain there is enough space in the temporary - * buffer for the new data to read in. All the VL data read in is actually - * placed in this buffer, overwriting the previous data. Needless to say, - * this data is not actually usable. - * - * Return: Non-negative on success, negative on failure + * Function: H5D__vlen_get_buf_size_alloc * - * Programmer: Quincey Koziol - * Tuesday, August 17, 1999 + * Purpose: This routine makes certain there is enough space in the temporary + * buffer for the new data to read in. All the VL data read in is actually + * placed in this buffer, overwriting the previous data. Needless to say, + * this data is not actually usable. * + * Return: Non-negative on success, negative on failure *------------------------------------------------------------------------- */ void * @@ -2615,14 +2503,14 @@ H5D__vlen_get_buf_size_alloc(size_t size, void *info) /*------------------------------------------------------------------------- - * Function: H5D__vlen_get_buf_size + * Function: H5D__vlen_get_buf_size * - * Purpose: This routine checks the number of bytes required to store a single - * element from a dataset in memory, creating a selection with just the - * single element selected to read in the element and using a custom memory - * allocator for any VL data encountered. - * The *size value is modified according to how many bytes are - * required to store the element in memory. + * Purpose: This routine checks the number of bytes required to store a single + * element from a dataset in memory, creating a selection with just the + * single element selected to read in the element and using a custom memory + * allocator for any VL data encountered. + * The *size value is modified according to how many bytes are + * required to store the element in memory. * * Implementation: This routine actually performs the read with a custom * memory manager which basically just counts the bytes requested and @@ -2632,11 +2520,7 @@ H5D__vlen_get_buf_size_alloc(size_t size, void *info) * Kinda kludgy, but easier than the other method of trying to figure out * the sizes without actually reading the data in... - QAK * - * Return: Non-negative on success, negative on failure - * - * Programmer: Quincey Koziol - * Tuesday, August 17, 1999 - * + * Return: Non-negative on success, negative on failure *------------------------------------------------------------------------- */ herr_t @@ -2673,15 +2557,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__check_filters - * - * Purpose: Check if the filters have be initialized for the dataset - * - * Return: Non-negative on success/Negative on failure + * Function: H5D__check_filters * - * Programmer: Quincey Koziol - * Thursday, October 11, 2007 + * Purpose: Check if the filters have be initialized for the dataset * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -2727,16 +2607,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__set_extent + * Function: H5D__set_extent * - * Purpose: Based on H5D_extend, allows change to a lower dimension, - * calls H5S_set_extent and H5D__chunk_prune_by_extent instead - * - * Return: Non-negative on success, negative on failure - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * April 9, 2002 + * Purpose: Based on H5D_extend, allows change to a lower dimension, + * calls H5S_set_extent and H5D__chunk_prune_by_extent instead * + * Return: Non-negative on success, negative on failure *------------------------------------------------------------------------- */ herr_t @@ -2810,7 +2686,7 @@ 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)) ) + 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 */ @@ -2899,7 +2775,7 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) && (dset->shared->dcpl_cache.pline.nused > 0)) if(H5D__chunk_update_old_edge_chunks(dset, dxpl_id, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to do update old edge chunks") - } /* end if */ + } /* end if */ /* Mark the dataspace as dirty, for later writing to the file */ if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) @@ -2912,16 +2788,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__flush_sieve_buf + * Function: H5D__flush_sieve_buf * - * Purpose: Flush any dataset sieve buffer info cached in memory - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * July 27, 2009 + * Purpose: Flush any dataset sieve buffer info cached in memory * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -2953,16 +2825,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__flush_real - * - * Purpose: Flush any dataset information cached in memory - * - * Return: Success: Non-negative - * Failure: Negative + * Function: H5D__flush_real * - * Programmer: Quincey Koziol - * December 6, 2007 + * Purpose: Flush any dataset information cached in memory * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -2990,29 +2858,25 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__format_convert + * Function: H5D__format_convert * - * Purpose: For chunked: downgrade the chunk indexing type to version 1 B-tree - * For compact/contiguous: downgrade layout version to 3 - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Vailin Choi - * Feb 2015 + * Purpose: For chunked: downgrade the chunk indexing type to version 1 B-tree + * For compact/contiguous: downgrade layout version to 3 * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t 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 */ + 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 = 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 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 */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) @@ -3062,7 +2926,7 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) 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 + /* 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) @@ -3105,7 +2969,7 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) case H5D_NLAYOUTS: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset layout type") - default: + default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown dataset layout type") } /* end switch */ @@ -3147,16 +3011,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__mark - * - * Purpose: Mark some aspect of a dataset as dirty + * Function: H5D__mark * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * July 4, 2008 + * Purpose: Mark some aspect of a dataset as dirty * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -3212,24 +3072,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__flush_cb - * - * Purpose: Flush any dataset information cached in memory + * Function: H5D__flush_cb * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * November 8, 2007 + * Purpose: Flush any dataset information cached in memory * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ static int H5D__flush_cb(void *_dataset, hid_t H5_ATTR_UNUSED id, void *_udata) { - H5D_t *dataset = (H5D_t *)_dataset; /* Dataset pointer */ + H5D_t *dataset = (H5D_t *)_dataset; /* Dataset pointer */ H5D_flush_ud_t *udata = (H5D_flush_ud_t *)_udata; /* User data for callback */ - int ret_value = H5_ITER_CONT; /* Return value */ + int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC @@ -3249,23 +3105,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_flush - * - * Purpose: Flush any dataset information cached in memory + * Function: H5D_flush * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Ray Lu - * August 14, 2002 + * Purpose: Flush any dataset information cached in memory * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id) { - H5D_flush_ud_t udata; /* User data for callback */ - herr_t ret_value = SUCCEED; /* Return value */ + H5D_flush_ud_t udata; /* User data for callback */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3286,19 +3138,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_get_create_plist - * - * Purpose: Private function for H5Dget_create_plist - * - * Return: Success: ID for a copy of the dataset creation - * property list. The template should be - * released by calling H5P_close(). + * Function: H5D_get_create_plist * - * Failure: FAIL - * - * Programmer: Robb Matzke - * Tuesday, February 3, 1998 + * Purpose: Private function for H5Dget_create_plist * + * Return: Success: ID for a copy of the dataset creation + * property list. The template should be + * released by calling H5P_close(). + * Failure: FAIL *------------------------------------------------------------------------- */ hid_t @@ -3309,8 +3156,8 @@ H5D_get_create_plist(H5D_t *dset) 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; - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + hid_t new_dcpl_id = FAIL; + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3351,7 +3198,7 @@ H5D_get_create_plist(H5D_t *dset) /* 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 */ + /* 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") @@ -3468,18 +3315,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_get_access_plist - * - * Purpose: Returns a copy of the dataset access property list. - * - * Return: Success: ID for a copy of the dataset access - * property list. - * - * Failure: FAIL + * Function: H5D_get_access_plist * - * Programmer: Mohamad Chaarawi - * March, 2012 + * Purpose: Returns a copy of the dataset access property list. * + * Return: Success: ID for a copy of the dataset access + * property list. + * Failure: FAIL *------------------------------------------------------------------------- */ hid_t @@ -3537,24 +3379,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_get_space - * - * Purpose: Returns and ID for the dataspace of the dataset. - * - * Return: Success: ID for dataspace - * - * Failure: FAIL + * Function: H5D_get_space * - * Programmer: Mohamad Chaarawi - * March, 2012 + * Purpose: Returns and ID for the dataspace of the dataset. * + * Return: Success: ID for dataspace + * Failure: FAIL *------------------------------------------------------------------------- */ hid_t H5D_get_space(H5D_t *dset) { - H5S_t *space = NULL; - hid_t ret_value = H5I_INVALID_HID; + H5S_t *space = NULL; + hid_t ret_value = H5I_INVALID_HID; FUNC_ENTER_NOAPI_NOINIT @@ -3582,24 +3419,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_get_type + * Function: H5D_get_type * - * Purpose: Returns and ID for the datatype of the dataset. - * - * Return: Success: ID for datatype - * - * Failure: FAIL - * - * Programmer: Mohamad Chaarawi - * March, 2012 + * Purpose: Returns and ID for the datatype of the dataset. * + * Return: Success: ID for datatype + * Failure: FAIL *------------------------------------------------------------------------- */ hid_t H5D_get_type(H5D_t *dset) { - H5T_t *dt = NULL; - hid_t ret_value = FAIL; + H5T_t *dt = NULL; + hid_t ret_value = FAIL; FUNC_ENTER_NOAPI_NOINIT @@ -3633,15 +3465,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__refresh + * Function: H5D__refresh * - * Purpose: Refreshes all buffers associated with a dataset. - * - * Return: SUCCEED/FAIL - * - * Programmer: Dana Robinson - * November 2015 + * Purpose: Refreshes all buffers associated with a dataset. * + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ herr_t @@ -3668,7 +3496,7 @@ H5D__refresh(hid_t dset_id, H5D_t *dset, hid_t dxpl_id) if(H5D__virtual_refresh_source_dsets(dset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh VDS source datasets") } /* end if */ - + /* Refresh dataset object */ if((H5O_refresh_metadata(dset_id, dset->oloc, dxpl_id)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh dataset") -- cgit v0.12 From 218845c603e1bdbae92fb4ec4483781b0b889a47 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 8 Nov 2017 09:57:15 -0600 Subject: Remove tabs --- src/H5Dpkg.h | 136 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 097fab7..beb1089 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -12,12 +12,12 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Monday, April 14, 2003 + * Programmer: Quincey Koziol + * Monday, April 14, 2003 * - * Purpose: This file contains declarations which are visible only within - * the H5D package. Source files outside the H5D package should - * include H5Dprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5D package. Source files outside the H5D package should + * include H5Dprivate.h instead. */ #if !(defined H5D_FRIEND || defined H5D_MODULE) #error "Do not include this file outside the H5D package!" @@ -30,12 +30,12 @@ #include "H5Dprivate.h" /* Other private headers needed by this file */ -#include "H5ACprivate.h" /* Metadata cache */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5B2private.h" /* v2 B-trees */ -#include "H5Fprivate.h" /* File access */ -#include "H5Gprivate.h" /* Groups */ -#include "H5SLprivate.h" /* Skip lists */ -#include "H5Tprivate.h" /* Datatypes */ +#include "H5Fprivate.h" /* File access */ +#include "H5Gprivate.h" /* Groups */ +#include "H5SLprivate.h" /* Skip lists */ +#include "H5Tprivate.h" /* Datatypes */ /**************************/ /* Package Private Macros */ @@ -70,22 +70,22 @@ /* See H5O_layout_chunk_t */ /* Fixed array creation values */ -#define H5D_FARRAY_CREATE_PARAM_SIZE 1 /* Size of the creation parameters in bytes */ -#define H5D_FARRAY_MAX_DBLK_PAGE_NELMTS_BITS 10 /* i.e. 1024 elements per data block page */ +#define H5D_FARRAY_CREATE_PARAM_SIZE 1 /* Size of the creation parameters in bytes */ +#define H5D_FARRAY_MAX_DBLK_PAGE_NELMTS_BITS 10 /* i.e. 1024 elements per data block page */ /* Extensible array creation values */ -#define H5D_EARRAY_CREATE_PARAM_SIZE 5 /* Size of the creation parameters in bytes */ -#define H5D_EARRAY_MAX_NELMTS_BITS 32 /* i.e. 4 giga-elements */ -#define H5D_EARRAY_IDX_BLK_ELMTS 4 -#define H5D_EARRAY_SUP_BLK_MIN_DATA_PTRS 4 -#define H5D_EARRAY_DATA_BLK_MIN_ELMTS 16 -#define H5D_EARRAY_MAX_DBLOCK_PAGE_NELMTS_BITS 10 /* i.e. 1024 elements per data block page */ +#define H5D_EARRAY_CREATE_PARAM_SIZE 5 /* Size of the creation parameters in bytes */ +#define H5D_EARRAY_MAX_NELMTS_BITS 32 /* i.e. 4 giga-elements */ +#define H5D_EARRAY_IDX_BLK_ELMTS 4 +#define H5D_EARRAY_SUP_BLK_MIN_DATA_PTRS 4 +#define H5D_EARRAY_DATA_BLK_MIN_ELMTS 16 +#define H5D_EARRAY_MAX_DBLOCK_PAGE_NELMTS_BITS 10 /* i.e. 1024 elements per data block page */ /* v2 B-tree creation values for raw meta_size */ -#define H5D_BT2_CREATE_PARAM_SIZE 6 /* Size of the creation parameters in bytes */ -#define H5D_BT2_NODE_SIZE 2048 -#define H5D_BT2_SPLIT_PERC 100 -#define H5D_BT2_MERGE_PERC 40 +#define H5D_BT2_CREATE_PARAM_SIZE 6 /* Size of the creation parameters in bytes */ +#define H5D_BT2_NODE_SIZE 2048 +#define H5D_BT2_SPLIT_PERC 100 +#define H5D_BT2_MERGE_PERC 40 /****************************/ @@ -97,23 +97,23 @@ typedef struct H5D_type_info_t { /* Initial values */ const H5T_t *mem_type; /* Pointer to memory datatype */ const H5T_t *dset_type; /* Pointer to dataset datatype */ - H5T_path_t *tpath; /* Datatype conversion path */ + H5T_path_t *tpath; /* Datatype conversion path */ hid_t src_type_id; /* Source datatype ID */ hid_t dst_type_id; /* Destination datatype ID */ /* Computed/derived values */ - size_t src_type_size; /* Size of source type */ - size_t dst_type_size; /* Size of destination type */ - size_t max_type_size; /* Size of largest source/destination type */ - hbool_t is_conv_noop; /* Whether the type conversion is a NOOP */ - hbool_t is_xform_noop; /* Whether the data transform is a NOOP */ + size_t src_type_size; /* Size of source type */ + size_t dst_type_size; /* Size of destination type */ + size_t max_type_size; /* Size of largest source/destination type */ + hbool_t is_conv_noop; /* Whether the type conversion is a NOOP */ + hbool_t is_xform_noop; /* Whether the data transform is a NOOP */ const H5T_subset_info_t *cmpd_subset; /* Info related to the compound subset conversion functions */ - H5T_bkg_t need_bkg; /* Type of background buf needed */ - size_t request_nelmts; /* Requested strip mine */ - uint8_t *tconv_buf; /* Datatype conv buffer */ - hbool_t tconv_buf_allocated; /* Whether the type conversion buffer was allocated */ - uint8_t *bkg_buf; /* Background buffer */ - hbool_t bkg_buf_allocated; /* Whether the background buffer was allocated */ + H5T_bkg_t need_bkg; /* Type of background buf needed */ + size_t request_nelmts; /* Requested strip mine */ + uint8_t *tconv_buf; /* Datatype conv buffer */ + hbool_t tconv_buf_allocated; /* Whether the type conversion buffer was allocated */ + uint8_t *bkg_buf; /* Background buffer */ + hbool_t bkg_buf_allocated; /* Whether the background buffer was allocated */ } H5D_type_info_t; /* Forward declaration of structs used below */ @@ -191,13 +191,13 @@ typedef struct { } H5D_chunk_storage_t; typedef struct { - void *buf; /* Buffer for compact dataset */ + void *buf; /* Buffer for compact dataset */ hbool_t *dirty; /* Pointer to dirty flag to mark */ } H5D_compact_storage_t; typedef union H5D_storage_t { H5D_contig_storage_t contig; /* Contiguous information for dataset */ - H5D_chunk_storage_t chunk; /* Chunk information for dataset */ + H5D_chunk_storage_t chunk; /* Chunk information for dataset */ H5D_compact_storage_t compact; /* Compact information for dataset */ H5O_efl_t efl; /* External file list information for dataset */ } H5D_storage_t; @@ -261,10 +261,10 @@ typedef struct H5D_chk_idx_info_t { * The chunk's file address, filter mask and size on disk are not key values. */ typedef struct H5D_chunk_rec_t { - hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Logical offset to start */ - uint32_t nbytes; /* Size of stored data */ - uint32_t filter_mask; /* Excluded filters */ - haddr_t chunk_addr; /* Address of chunk in file */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Logical offset to start */ + uint32_t nbytes; /* Size of stored data */ + uint32_t filter_mask; /* Excluded filters */ + haddr_t chunk_addr; /* Address of chunk in file */ } H5D_chunk_rec_t; /* @@ -273,9 +273,9 @@ typedef struct H5D_chunk_rec_t { * to which the index points. */ typedef struct H5D_chunk_common_ud_t { - const H5O_layout_chunk_t *layout; /* Chunk layout description */ - const H5O_storage_chunk_t *storage; /* Chunk storage description */ - const hsize_t *scaled; /* Scaled coordinates for a chunk */ + const H5O_layout_chunk_t *layout; /* Chunk layout description */ + const H5O_storage_chunk_t *storage; /* Chunk storage description */ + const hsize_t *scaled; /* Scaled coordinates for a chunk */ } H5D_chunk_common_ud_t; /* B-tree callback info for various operations */ @@ -286,7 +286,7 @@ typedef struct H5D_chunk_ud_t { /* Upward */ unsigned idx_hint; /* Index of chunk in cache, if present */ H5F_block_t chunk_block; /* Offset/length of chunk in file */ - unsigned filter_mask; /* Excluded filters */ + unsigned filter_mask; /* Excluded filters */ hbool_t new_unfilt_chunk; /* Whether the chunk just became unfiltered */ hsize_t chunk_idx; /* Chunk index for EA, FA indexing */ } H5D_chunk_ud_t; @@ -386,11 +386,11 @@ typedef struct H5D_chunk_map_t { /* Cached information about a particular chunk */ typedef struct H5D_chunk_cached_t { hbool_t valid; /*whether cache info is valid*/ - hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled offset of chunk*/ - haddr_t addr; /*file address of chunk */ - uint32_t nbytes; /*size of stored data */ - hsize_t chunk_idx; /*index of chunk in dataset */ - unsigned filter_mask; /*excluded filters */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled offset of chunk*/ + haddr_t addr; /*file address of chunk */ + uint32_t nbytes; /*size of stored data */ + hsize_t chunk_idx; /*index of chunk in dataset */ + unsigned filter_mask; /*excluded filters */ } H5D_chunk_cached_t; /****************************/ @@ -407,23 +407,23 @@ typedef struct H5D_virtual_held_file_t { struct H5D_rdcc_ent_t; /* Forward declaration of struct used below */ typedef struct H5D_rdcc_t { struct { - unsigned ninits; /* Number of chunk creations */ - unsigned nhits; /* Number of cache hits */ - unsigned nmisses;/* Number of cache misses */ - unsigned nflushes;/* Number of cache flushes */ + unsigned ninits; /* Number of chunk creations */ + unsigned nhits; /* Number of cache hits */ + unsigned nmisses; /* Number of cache misses */ + unsigned nflushes; /* Number of cache flushes */ } stats; - size_t nbytes_max; /* Maximum cached raw data in bytes */ - size_t nslots; /* Number of chunk slots allocated */ - double w0; /* Chunk preemption policy */ - struct H5D_rdcc_ent_t *head; /* Head of doubly linked list */ - struct H5D_rdcc_ent_t *tail; /* Tail of doubly linked list */ + size_t nbytes_max; /* Maximum cached raw data in bytes */ + size_t nslots; /* Number of chunk slots allocated */ + double w0; /* Chunk preemption policy */ + struct H5D_rdcc_ent_t *head; /* Head of doubly linked list */ + struct H5D_rdcc_ent_t *tail; /* Tail of doubly linked list */ struct H5D_rdcc_ent_t *tmp_head; /* Head of temporary doubly linked list. Chunks on this list are not in the hash table (slot). The head entry is a sentinel (does not refer to an actual chunk). */ - size_t nbytes_used; /* Current cached raw data in bytes */ - int nused; /* Number of chunk slots in use */ + size_t nbytes_used; /* Current cached raw data in bytes */ + int nused; /* Number of chunk slots in use */ H5D_chunk_cached_t last; /* Cached copy of last chunk information */ struct H5D_rdcc_ent_t **slot; /* Chunk slots, each points to a chunk*/ - H5SL_t *sel_chunks; /* Skip list containing information for each chunk selected */ - H5S_t *single_space; /* Dataspace for single element I/O on chunks */ + H5SL_t *sel_chunks; /* Skip list containing information for each chunk selected */ + H5S_t *single_space; /* Dataspace for single element I/O on chunks */ H5D_chunk_info_t *single_chunk_info; /* Pointer to single chunk's info */ /* Cached information about scaled dataspace dimensions */ @@ -459,10 +459,10 @@ typedef struct H5D_shared_t { hbool_t checked_filters;/* TRUE if dataset passes can_apply check */ /* Cached dataspace info */ - unsigned ndims; /* The dataset's dataspace rank */ - hsize_t curr_dims[H5S_MAX_RANK]; /* The curr. size of dataset dimensions */ - hsize_t curr_power2up[H5S_MAX_RANK]; /* The curr. dim sizes, rounded up to next power of 2 */ - hsize_t max_dims[H5S_MAX_RANK]; /* The max. size of dataset dimensions */ + unsigned ndims; /* The dataset's dataspace rank */ + hsize_t curr_dims[H5S_MAX_RANK]; /* The curr. size of dataset dimensions */ + hsize_t curr_power2up[H5S_MAX_RANK]; /* The curr. dim sizes, rounded up to next power of 2 */ + hsize_t max_dims[H5S_MAX_RANK]; /* The max. size of dataset dimensions */ /* Buffered/cached information for types of raw data storage*/ struct { @@ -474,7 +474,7 @@ typedef struct H5D_shared_t { H5D_rdcc_t chunk; /* Information about chunked data */ } cache; - H5D_append_flush_t append_flush; /* Append flush property information */ + H5D_append_flush_t append_flush; /* Append flush property information */ char *extfile_prefix; /* expanded external file prefix */ } H5D_shared_t; @@ -689,7 +689,7 @@ H5_DLL herr_t H5D__chunk_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream); 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, +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); -- cgit v0.12 From 480fc373a07e4b9a3aefd51f82accbc9411146b3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 8 Nov 2017 09:59:58 -0600 Subject: Remove tabs --- src/H5Dprivate.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 5d565bb..fb994d8 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -21,10 +21,10 @@ #include "H5Dpublic.h" /* Private headers needed by this file */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5Sprivate.h" /* Dataspaces */ -#include "H5Zprivate.h" /* Data filters */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Sprivate.h" /* Dataspaces */ +#include "H5Zprivate.h" /* Data filters */ /**************************/ @@ -33,18 +33,18 @@ /* * Feature: Define H5D_DEBUG on the compiler command line if you want to - * debug dataset I/O. NDEBUG must not be defined in order for this - * to have any effect. + * debug dataset I/O. NDEBUG must not be defined in order for this + * to have any effect. */ #ifdef NDEBUG # undef H5D_DEBUG #endif /* ======== Dataset creation property names ======== */ -#define H5D_CRT_LAYOUT_NAME "layout" /* Storage layout */ -#define H5D_CRT_FILL_VALUE_NAME "fill_value" /* Fill value */ +#define H5D_CRT_LAYOUT_NAME "layout" /* Storage layout */ +#define H5D_CRT_FILL_VALUE_NAME "fill_value" /* Fill value */ #define H5D_CRT_ALLOC_TIME_STATE_NAME "alloc_time_state" /* Space allocation time state */ -#define H5D_CRT_EXT_FILE_LIST_NAME "efl" /* External file list */ +#define H5D_CRT_EXT_FILE_LIST_NAME "efl" /* External file list */ /* ======== Dataset access property names ======== */ #define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ @@ -75,11 +75,11 @@ #define H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME "mpio_chunk_opt_ratio" #define H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME "actual_chunk_opt_mode" #define H5D_MPIO_ACTUAL_IO_MODE_NAME "actual_io_mode" -#define H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME "local_no_collective_cause" /* cause of broken collective I/O in each process */ +#define H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME "local_no_collective_cause" /* cause of broken collective I/O in each process */ #define H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME "global_no_collective_cause" /* cause of broken collective I/O in all processes */ -#define H5D_XFER_EDC_NAME "err_detect" /* EDC */ -#define H5D_XFER_FILTER_CB_NAME "filter_cb" /* Filter callback function */ -#define H5D_XFER_CONV_CB_NAME "type_conv_cb" /* Type conversion callback function */ +#define H5D_XFER_EDC_NAME "err_detect" /* EDC */ +#define H5D_XFER_FILTER_CB_NAME "filter_cb" /* Filter callback function */ +#define H5D_XFER_CONV_CB_NAME "type_conv_cb" /* Type conversion callback function */ #define H5D_XFER_XFORM_NAME "data_transform" /* Data transform */ #ifdef H5_HAVE_INSTRUMENTED_LIBRARY /* Collective chunk instrumentation properties */ @@ -152,10 +152,10 @@ typedef struct H5D_copy_file_ud_t { /* Structure for dataset append flush property (H5Pset_append_flush) */ typedef struct H5D_append_flush_t { - unsigned ndims; /* The # of dimensions for "boundary" */ - hsize_t boundary[H5S_MAX_RANK]; /* The dimension sizes for determining boundary */ - H5D_append_cb_t func; /* The callback function */ - void *udata; /* User data */ + unsigned ndims; /* The # of dimensions for "boundary" */ + hsize_t boundary[H5S_MAX_RANK]; /* The dimension sizes for determining boundary */ + H5D_append_cb_t func; /* The callback function */ + void *udata; /* User data */ } H5D_append_flush_t; -- cgit v0.12 From 5717239a98f61dab289ce7c79d7768dc59755e3a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 8 Nov 2017 11:11:22 -0600 Subject: Remove tabs --- src/H5F.c | 694 ++++++++++++++++++++------------------------------ src/H5Fint.c | 787 +++++++++++++++++++++++---------------------------------- src/H5Fquery.c | 625 ++++++++++++++++----------------------------- 3 files changed, 809 insertions(+), 1297 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index 39eca13..4b40248 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -21,20 +21,20 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Aprivate.h" /* Attributes */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5SMprivate.h" /* Shared Object Header Messages */ -#include "H5Tprivate.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5Aprivate.h" /* Attributes */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5SMprivate.h" /* Shared Object Header Messages */ +#include "H5Tprivate.h" /* Datatypes */ /****************/ @@ -76,10 +76,10 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* File ID class */ static const H5I_class_t H5I_FILE_CLS[1] = {{ - H5I_FILE, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ - (H5I_free_t)H5F_close /* Callback routine for closing objects of this class */ + H5I_FILE, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5F_close /* Callback routine for closing objects of this class */ }}; @@ -113,27 +113,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_term_package + * Function: H5F_term_package * - * Purpose: Terminate this interface: free all memory and reset global - * variables to their initial values. Release all ID groups - * associated with this interface. - * - * Return: Success: Positive if anything was done that might - * have affected other interfaces; zero - * otherwise. - * - * Failure: Never fails. - * - * Programmer: Robb Matzke - * Friday, February 19, 1999 + * Purpose: Terminate this interface: free all memory and reset global + * variables to their initial values. Release all ID groups + * associated with this interface. * + * Return: Success: Positive if anything was done that might + * have affected other interfaces; + * zero otherwise. + * Failure: Never fails. *------------------------------------------------------------------------- */ int H5F_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -141,7 +136,7 @@ H5F_term_package(void) if(H5I_nmembers(H5I_FILE) > 0) { (void)H5I_clear_type(H5I_FILE, FALSE, FALSE); n++; /*H5I*/ - } /* end if */ + } /* end if */ else { /* Make certain we've cleaned up all the shared file objects */ H5F_sfile_assert_num(0); @@ -160,18 +155,14 @@ H5F_term_package(void) /*------------------------------------------------------------------------- - * Function: H5Fget_create_plist - * - * Purpose: Get an atom for a copy of the file-creation property list for - * this file. This function returns an atom with a copy of the - * properties used to create a file. - * - * Return: Success: template ID + * Function: H5Fget_create_plist * - * Failure: FAIL - * - * Programmer: Unknown + * Purpose: Get an atom for a copy of the file-creation property list for + * this file. This function returns an atom with a copy of the + * properties used to create a file. * + * Return: Success: template ID + * Failure: FAIL *------------------------------------------------------------------------- */ hid_t @@ -200,24 +191,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fget_access_plist + * Function: H5Fget_access_plist * - * Purpose: Returns a copy of the file access property list of the - * specified file. + * Purpose: Returns a copy of the file access property list of the + * specified file. * * NOTE: Make sure that, if you are going to overwrite * information in the copied property list that was * previously opened and assigned to the property list, then * you must close it before overwriting the values. * - * Return: Success: Object ID for a copy of the file access - * property list. - * - * Failure: FAIL - * - * Programmer: Robb Matzke - * Wednesday, February 18, 1998 - * + * Return: Success: Object ID for a copy of the file access + * property list. + * Failure: FAIL *------------------------------------------------------------------------- */ hid_t @@ -243,23 +229,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fget_obj_count - * - * Purpose: Public function returning the number of opened object IDs - * (files, datasets, groups and datatypes) in the same file. + * Function: H5Fget_obj_count * - * Return: Non-negative on success; negative on failure. - * - * Programmer: Raymond Lu - * Wednesday, Dec 5, 2001 + * Purpose: Public function returning the number of opened object IDs + * (files, datasets, groups and datatypes) in the same file. * + * Return: Non-negative on success; negative on failure. *------------------------------------------------------------------------- */ ssize_t H5Fget_obj_count(hid_t file_id, unsigned types) { H5F_t *f = NULL; /* File to query */ - size_t obj_count = 0; /* Number of opened objects */ + size_t obj_count = 0; /* Number of opened objects */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -284,21 +266,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fget_object_ids - * - * Purpose: Public function to return a list of opened object IDs. - * - * Return: Non-negative on success; negative on failure. + * Function: H5Fget_object_ids * - * Programmer: Raymond Lu - * Wednesday, Dec 5, 2001 - * - * Modification: - * Raymond Lu - * 24 September 2008 - * Changed the return value to ssize_t and MAX_OBJTS to size_t to - * accommadate potential large number of objects. + * Purpose: Public function to return a list of opened object IDs. * + * Return: Non-negative on success; negative on failure. *------------------------------------------------------------------------- */ ssize_t @@ -339,10 +311,6 @@ done: * * Return: Success: non-negative value. * Failure: negative. - * - * Programmer: Raymond Lu - * Sep. 16, 2002 - * *------------------------------------------------------------------------- */ herr_t @@ -372,23 +340,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fis_hdf5 + * Function: H5Fis_hdf5 * - * Purpose: Check the file signature to detect an HDF5 file. + * Purpose: Check the file signature to detect an HDF5 file. * - * Bugs: This function is not robust: it only uses the default file - * driver when attempting to open the file when in fact it - * should use all known file drivers. + * Bugs: This function is not robust: it only uses the default file + * driver when attempting to open the file when in fact it + * should use all known file drivers. * - * Return: Success: TRUE/FALSE - * - * Failure: Negative - * - * Programmer: Unknown - * - * Modifications: - * Robb Matzke, 1999-08-02 - * Rewritten to use the virtual file layer. + * Return: Success: TRUE/FALSE + * Failure: Negative *------------------------------------------------------------------------- */ htri_t @@ -414,38 +375,34 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fcreate - * - * Purpose: This is the primary function for creating HDF5 files . The - * flags parameter determines whether an existing file will be - * overwritten or not. All newly created files are opened for - * both reading and writing. All flags may be combined with the - * bit-wise OR operator (`|') to change the behavior of the file - * create call. - * - * The more complex behaviors of a file's creation and access - * are controlled through the file-creation and file-access - * property lists. The value of H5P_DEFAULT for a template - * value indicates that the library should use the default - * values for the appropriate template. - * - * See also: H5Fpublic.h for the list of supported flags. H5Ppublic.h for - * the list of file creation and file access properties. - * - * Return: Success: A file ID - * - * Failure: FAIL - * - * Programmer: Unknown - * + * Function: H5Fcreate + * + * Purpose: This is the primary function for creating HDF5 files . The + * flags parameter determines whether an existing file will be + * overwritten or not. All newly created files are opened for + * both reading and writing. All flags may be combined with the + * bit-wise OR operator (`|') to change the behavior of the file + * create call. + * + * The more complex behaviors of a file's creation and access + * are controlled through the file-creation and file-access + * property lists. The value of H5P_DEFAULT for a template + * value indicates that the library should use the default + * values for the appropriate template. + * + * See also: H5Fpublic.h for the list of supported flags. H5Ppublic.h for + * the list of file creation and file access properties. + * + * Return: Success: A file ID + * Failure: FAIL *------------------------------------------------------------------------- */ hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { - 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 */ + 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 */ FUNC_ENTER_API(FAIL) H5TRACE4("i", "*sIuii", filename, flags, fcpl_id, fapl_id); @@ -479,7 +436,7 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) * reading and writing. */ if (0==(flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC))) - flags |= H5F_ACC_EXCL; /*default*/ + flags |= H5F_ACC_EXCL; /*default*/ flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; /* @@ -504,51 +461,48 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fopen + * Function: H5Fopen * - * Purpose: This is the primary function for accessing existing HDF5 - * files. The FLAGS argument determines whether writing to an - * existing file will be allowed or not. All flags may be - * combined with the bit-wise OR operator (`|') to change the - * behavior of the file open call. The more complex behaviors - * of a file's access are controlled through the file-access - * property list. + * Purpose: This is the primary function for accessing existing HDF5 + * files. The FLAGS argument determines whether writing to an + * existing file will be allowed or not. All flags may be + * combined with the bit-wise OR operator (`|') to change the + * behavior of the file open call. The more complex behaviors + * of a file's access are controlled through the file-access + * property list. * - * See Also: H5Fpublic.h for a list of possible values for FLAGS. + * See Also: H5Fpublic.h for a list of possible values for FLAGS. * - * Return: Success: A file ID - * - * Failure: FAIL - * - * Programmer: Unknown + * Return: Success: A file ID + * Failure: FAIL * * Modifications: - * Robb Matzke, 1997-07-18 - * File struct creation and destruction is through H5F_new() and - * H5F__dest(). Reading the root symbol table entry is done with - * H5G_decode(). - * - * Robb Matzke, 1997-09-23 - * Most of the work is now done by H5F_open() since H5Fcreate() - * and H5Fopen() originally contained almost identical code. - * - * Robb Matzke, 1998-02-18 - * Added better error checking for the flags and the file access - * property list. It used to be possible to make the library - * dump core by passing an object ID that was not a file access - * property list. - * - * Robb Matzke, 1999-08-02 - * The file access property list is passed to the H5F_open() as - * object IDs. + * Robb Matzke, 1997-07-18 + * File struct creation and destruction is through H5F_new() and + * H5F__dest(). Reading the root symbol table entry is done with + * H5G_decode(). + * + * Robb Matzke, 1997-09-23 + * Most of the work is now done by H5F_open() since H5Fcreate() + * and H5Fopen() originally contained almost identical code. + * + * Robb Matzke, 1998-02-18 + * Added better error checking for the flags and the file access + * property list. It used to be possible to make the library + * dump core by passing an object ID that was not a file access + * property list. + * + * Robb Matzke, 1999-08-02 + * The file access property list is passed to the H5F_open() as + * object IDs. *------------------------------------------------------------------------- */ hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { - 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 */ + 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 */ FUNC_ENTER_API(FAIL) H5TRACE3("i", "*sIui", filename, flags, fapl_id); @@ -591,25 +545,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fflush - * - * Purpose: Flushes all outstanding buffers of a file to disk but does - * not remove them from the cache. The OBJECT_ID can be a file, - * dataset, group, attribute, or named data type. + * Function: H5Fflush * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Thursday, August 6, 1998 + * Purpose: Flushes all outstanding buffers of a file to disk but does + * not remove them from the cache. The OBJECT_ID can be a file, + * dataset, group, attribute, or named data type. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t H5Fflush(hid_t object_id, H5F_scope_t scope) { - H5F_t *f = NULL; /* File to flush */ - H5O_loc_t *oloc = NULL; /* Object location for ID */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *f = NULL; /* File to flush */ + H5O_loc_t *oloc = NULL; /* Object location for ID */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "iFs", object_id, scope); @@ -622,7 +572,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) case H5I_GROUP: { - H5G_t *grp; + H5G_t *grp; if(NULL == (grp = (H5G_t *)H5I_object(object_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid group identifier") @@ -632,7 +582,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) case H5I_DATATYPE: { - H5T_t *type; + H5T_t *type; if(NULL == (type = (H5T_t *)H5I_object(object_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid type identifier") @@ -642,7 +592,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) case H5I_DATASET: { - H5D_t *dset; + H5D_t *dset; if(NULL == (dset = (H5D_t *)H5I_object(object_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") @@ -652,7 +602,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) case H5I_ATTR: { - H5A_t *attr; + H5A_t *attr; if(NULL == (attr = (H5A_t *)H5I_object(object_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid attribute identifier") @@ -685,7 +635,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) /* Flush the file */ /* - * Nothing to do if the file is read only. This determination is + * Nothing to do if the file is read only. This determination is * made at the shared open(2) flags level, implying that opening a * file twice, once for read-only and once for read-write, and then * calling H5Fflush() with the read-only handle, still causes data @@ -711,24 +661,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fclose + * Function: H5Fclose * - * Purpose: This function closes the file specified by FILE_ID by - * flushing all data to storage, and terminating access to the - * file through FILE_ID. If objects (e.g., datasets, groups, - * etc.) are open in the file then the underlying storage is not - * closed until those objects are closed; however, all data for - * the file and the open objects is flushed. - * - * Return: Success: Non-negative - * - * Failure: Negative - * - * Programmer: Robb Matzke - * Saturday, February 20, 1999 - * - * Modifications: + * Purpose: This function closes the file specified by FILE_ID by + * flushing all data to storage, and terminating access to the + * file through FILE_ID. If objects (e.g., datasets, groups, + * etc.) are open in the file then the underlying storage is not + * closed until those objects are closed; however, all data for + * the file and the open objects is flushed. * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -736,7 +679,7 @@ H5Fclose(hid_t file_id) { H5F_t *f = NULL; int nref; - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); @@ -772,29 +715,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5Freopen - * - * Purpose: Reopen a file. The new file handle which is returned points - * to the same file as the specified file handle. Both handles - * share caches and other information. The only difference - * between the handles is that the new handle is not mounted - * anywhere and no files are mounted on it. + * Function: H5Freopen * - * Return: Success: New file ID - * - * Failure: FAIL - * - * Programmer: Robb Matzke - * Friday, October 16, 1998 + * Purpose: Reopen a file. The new file handle which is returned points + * to the same file as the specified file handle. Both handles + * share caches and other information. The only difference + * between the handles is that the new handle is not mounted + * anywhere and no files are mounted on it. * + * Return: Success: New file ID + * Failure: FAIL *------------------------------------------------------------------------- */ hid_t H5Freopen(hid_t file_id) { - H5F_t *old_file = NULL; - H5F_t *new_file = NULL; - hid_t ret_value; + H5F_t *old_file = NULL; + H5F_t *new_file = NULL; + hid_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", file_id); @@ -828,16 +766,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fget_intent - * - * Purpose: Public API to retrieve the file's 'intent' flags passed - * during H5Fopen() + * Function: H5Fget_intent * - * Return: Non-negative on success/negative on failure - * - * Programmer: James Laird - * August 23, 2006 + * Purpose: Public API to retrieve the file's 'intent' flags passed + * during H5Fopen() * + * Return: Non-negative on success/negative on failure *------------------------------------------------------------------------- */ herr_t @@ -850,7 +784,7 @@ H5Fget_intent(hid_t file_id, unsigned *intent_flags) /* If no intent flags were passed in, exit quietly */ if(intent_flags) { - H5F_t * file; /* Pointer to file structure */ + H5F_t *file; /* Pointer to file structure */ /* Get the internal file structure */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -888,18 +822,13 @@ done: * * Return: Success: Amount of free space for type * Failure: Negative - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Oct 6, 2003 - * *------------------------------------------------------------------------- */ hssize_t H5Fget_freespace(hid_t file_id) { H5F_t *file; /* File object for file ID */ - hsize_t tot_space; /* Amount of free space in the file */ + hsize_t tot_space; /* Amount of free space in the file */ hssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -925,15 +854,10 @@ done: * * Purpose: Retrieves the file size of the HDF5 file. This function * is called after an existing file is opened in order - * to learn the true size of the underlying file. + * to learn the true size of the underlying file. * * Return: Success: Non-negative * Failure: Negative - * - * Programmer: David Pitt - * david.pitt@bigpond.com - * Apr 27, 2004 - * *------------------------------------------------------------------------- */ herr_t @@ -972,42 +896,38 @@ done: /*------------------------------------------------------------------------- * Function: H5Fget_file_image * - * Purpose: If a buffer is provided (via the buf_ptr argument) and is - * big enough (size in buf_len argument), load *buf_ptr with - * an image of the open file whose ID is provided in the - * file_id parameter, and return the number of bytes copied - * to the buffer. + * Purpose: If a buffer is provided (via the buf_ptr argument) and is + * big enough (size in buf_len argument), load *buf_ptr with + * an image of the open file whose ID is provided in the + * file_id parameter, and return the number of bytes copied + * to the buffer. * - * If the buffer exists, but is too small to contain an image - * of the indicated file, return a negative number. + * If the buffer exists, but is too small to contain an image + * of the indicated file, return a negative number. * - * Finally, if no buffer is provided, return the size of the - * buffer needed. This value is simply the eoa of the target - * file. + * Finally, if no buffer is provided, return the size of the + * buffer needed. This value is simply the eoa of the target + * file. * - * Note that any user block is skipped. + * Note that any user block is skipped. * - * Also note that the function may not be used on files - * opened with either the split/multi file driver or the - * family file driver. + * Also note that the function may not be used on files + * opened with either the split/multi file driver or the + * family file driver. * - * In the former case, the sparse address space makes the - * get file image operation impractical, due to the size of - * the image typically required. + * In the former case, the sparse address space makes the + * get file image operation impractical, due to the size of + * the image typically required. * - * In the case of the family file driver, the problem is - * the driver message in the super block, which will prevent - * the image being opened with any driver other than the - * family file driver -- which negates the purpose of the - * operation. This can be fixed, but no resources for - * this now. + * In the case of the family file driver, the problem is + * the driver message in the super block, which will prevent + * the image being opened with any driver other than the + * family file driver -- which negates the purpose of the + * operation. This can be fixed, but no resources for + * this now. * * Return: Success: Bytes copied / number of bytes needed. * Failure: negative value - * - * Programmer: John Mainzer - * 11/15/11 - * *------------------------------------------------------------------------- */ ssize_t @@ -1033,21 +953,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fget_mdc_config + * Function: H5Fget_mdc_config * - * Purpose: Retrieves the current automatic cache resize configuration - * from the metadata cache, and return it in *config_ptr. + * Purpose: Retrieves the current automatic cache resize configuration + * from the metadata cache, and return it in *config_ptr. * - * Note that the version field of *config_Ptr must be correctly - * filled in by the caller. This allows us to adapt for - * obsolete versions of the structure. - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: John Mainzer - * 3/24/05 + * Note that the version field of *config_Ptr must be correctly + * filled in by the caller. This allows us to adapt for + * obsolete versions of the structure. * + * Return: Success: SUCCEED + * Failure: FAIL *------------------------------------------------------------------------- */ herr_t @@ -1078,15 +994,11 @@ done: * Function: H5Fset_mdc_config * * Purpose: Sets the current metadata cache automatic resize - * configuration, using the contents of the instance of - * H5AC_cache_config_t pointed to by config_ptr. + * configuration, using the contents of the instance of + * H5AC_cache_config_t pointed to by config_ptr. * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: John Mainzer - * 3/24/05 - * *------------------------------------------------------------------------- */ herr_t @@ -1115,16 +1027,12 @@ done: * Function: H5Fget_mdc_hit_rate * * Purpose: Retrieves the current hit rate from the metadata cache. - * This rate is the overall hit rate since the last time - * the hit rate statistics were reset either manually or - * automatically. + * This rate is the overall hit rate since the last time + * the hit rate statistics were reset either manually or + * automatically. * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: John Mainzer - * 3/24/05 - * *------------------------------------------------------------------------- */ herr_t @@ -1156,17 +1064,13 @@ done: * Function: H5Fget_mdc_size * * Purpose: Retrieves the maximum size, minimum clean size, current - * size, and current number of entries from the metadata - * cache associated with the specified file. If any of - * the ptr parameters are NULL, the associated datum is - * not returned. + * size, and current number of entries from the metadata + * cache associated with the specified file. If any of + * the ptr parameters are NULL, the associated datum is + * not returned. * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: John Mainzer - * 3/24/05 - * *------------------------------------------------------------------------- */ herr_t @@ -1202,20 +1106,16 @@ done: * Function: H5Freset_mdc_hit_rate_stats * * Purpose: Reset the hit rate statistic whose current value can - * be obtained via the H5Fget_mdc_hit_rate() call. Note - * that this statistic will also be reset once per epoch - * by the automatic cache resize code if it is enabled. + * be obtained via the H5Fget_mdc_hit_rate() call. Note + * that this statistic will also be reset once per epoch + * by the automatic cache resize code if it is enabled. * - * It is probably a bad idea to call this function unless - * you are controlling cache size from your program instead - * of using our cache size control code. + * It is probably a bad idea to call this function unless + * you are controlling cache size from your program instead + * of using our cache size control code. * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: John Mainzer - * 3/24/05 - * *------------------------------------------------------------------------- */ herr_t @@ -1251,15 +1151,11 @@ done: * If an error occurs then the buffer pointed to by `name' (NULL or non-NULL) * is unchanged and the function returns a negative value. * - * Note: This routine returns the name that was used to open the file, - * not the actual name after resolving symlinks, etc. + * Note: This routine returns the name that was used to open the file, + * not the actual name after resolving symlinks, etc. * * Return: Success: The length of the file name * Failure: Negative - * - * Programmer: Raymond Lu - * June 29, 2004 - * *------------------------------------------------------------------------- */ ssize_t @@ -1309,17 +1205,13 @@ done: * Function: H5Fget_info2 * * Purpose: Gets general information about the file, including: - * 1. Get storage size for superblock extension if there is one. + * 1. Get storage size for superblock extension if there is one. * 2. Get the amount of btree and heap storage for entries * in the SOHM table if there is one. - * 3. The amount of free space tracked in the file. + * 3. The amount of free space tracked in the file. * * Return: Success: non-negative on success * Failure: Negative - * - * Programmer: Vailin Choi - * July 11, 2007 - * *------------------------------------------------------------------------- */ herr_t @@ -1386,18 +1278,15 @@ done: * * Return: Success: non-negative on success * Failure: Negative - * - * Programmer: Vailin Choi; October 2013 - * *------------------------------------------------------------------------- */ herr_t H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info) { - H5F_t *file; /* File object for file ID */ - unsigned i, j; /* Local index variable */ - size_t tot_size; /* Size of each retries[i] */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file; /* File object for file ID */ + unsigned i, j; /* Local index variable */ + size_t tot_size; /* Size of each retries[i] */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", file_id, info); @@ -1417,8 +1306,8 @@ H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info) HDmemset(info->retries, 0, sizeof(info->retries)); /* Return if there are no bins -- no retries */ - if(!info->nbins) - HGOTO_DONE(SUCCEED); + if(!info->nbins) + HGOTO_DONE(SUCCEED); /* Calculate size for each retries[i] */ tot_size = info->nbins * sizeof(uint32_t); @@ -1477,18 +1366,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fget_free_sections - * - * Purpose: To get free-space section information for free-space manager with - * TYPE that is associated with file FILE_ID. - * If SECT_INFO is null, this routine returns the total # of free-space - * sections. - * - * Return: Success: non-negative, the total # of free space sections - * Failure: negative + * Function: H5Fget_free_sections * - * Programmer: Vailin Choi; July 1st, 2009 + * Purpose: To get free-space section information for free-space manager with + * TYPE that is associated with file FILE_ID. + * If SECT_INFO is null, this routine returns the total # of free-space + * sections. * + * Return: Success: non-negative, the total # of free space sections + * Failure: negative *------------------------------------------------------------------------- */ ssize_t @@ -1525,9 +1411,6 @@ done: * * Return: Success: non-negative * Failure: negative - * - * Programmer: Neil Fortner; December 30, 2010 - * *------------------------------------------------------------------------- */ herr_t @@ -1554,37 +1437,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fstart_swmr_write - * - * Purpose: To enable SWMR writing mode for the file - * 1) Refresh opened objects: part 1 - * 2) Flush & reset accumulator - * 3) Mark the file in SWMR writing mode - * 4) Set metadata read attempts and retries info - * 5) Disable accumulator - * 6) Evict all cache entries except the superblock - * 7) Refresh opened objects (part 2) - * 8) Unlock the file - * - * Pre-conditions: - * 1) The file being opened has v3 superblock - * 2) The file is opened with H5F_ACC_RDWR - * 3) The file is not already marked for SWMR writing - * 4) Current implementaion for opened objects: - * --only allow datasets and groups without attributes - * --disallow named datatype with/without attributes - * --disallow opened attributes attached to objects - * NOTE: Currently, only opened groups and datasets are allowed - * when enabling SWMR via H5Fstart_swmr_write(). - * Will later implement a different approach-- - * set up flush dependency/proxy even for file opened without - * SWMR to resolve issues with opened objects. - * - * Return: Non-negative on success/negative on failure - * - * Programmer: - * Vailin Choi; Feb 2014 - * + * Function: H5Fstart_swmr_write + * + * Purpose: To enable SWMR writing mode for the file + * 1) Refresh opened objects: part 1 + * 2) Flush & reset accumulator + * 3) Mark the file in SWMR writing mode + * 4) Set metadata read attempts and retries info + * 5) Disable accumulator + * 6) Evict all cache entries except the superblock + * 7) Refresh opened objects (part 2) + * 8) Unlock the file + * + * Pre-conditions: + * 1) The file being opened has v3 superblock + * 2) The file is opened with H5F_ACC_RDWR + * 3) The file is not already marked for SWMR writing + * 4) Current implementaion for opened objects: + * --only allow datasets and groups without attributes + * --disallow named datatype with/without attributes + * --disallow opened attributes attached to objects + * NOTE: Currently, only opened groups and datasets are allowed + * when enabling SWMR via H5Fstart_swmr_write(). + * Will later implement a different approach-- + * set up flush dependency/proxy even for file opened without + * SWMR to resolve issues with opened objects. + * + * Return: Non-negative on success/negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1593,16 +1472,16 @@ 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 */ - hid_t *obj_ids=NULL; /* List of ids */ - H5G_loc_t *obj_glocs=NULL; /* Group location of the object */ - H5O_loc_t *obj_olocs=NULL; /* Object location */ - H5G_name_t *obj_paths=NULL; /* Group hierarchy path */ - size_t u; /* Local index variable */ - hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ + size_t grp_dset_count=0; /* # of open objects: groups & datasets */ + size_t nt_attr_count=0; /* # of opened named datatypes + opened attributes */ + hid_t *obj_ids=NULL; /* List of ids */ + H5G_loc_t *obj_glocs=NULL; /* Group location of the object */ + H5O_loc_t *obj_olocs=NULL; /* Object location */ + H5G_name_t *obj_paths=NULL; /* Group hierarchy path */ + size_t u; /* Local index variable */ + hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ H5F_io_info2_t fio_info; /* I/O info for operation */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); @@ -1651,18 +1530,18 @@ H5Fstart_swmr_write(hid_t file_id) if(grp_dset_count) { /* Allocate space for group and object locations */ - if((obj_ids = (hid_t *) H5MM_malloc(grp_dset_count * sizeof(hid_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for hid_t") - if((obj_glocs = (H5G_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_loc_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_loc_t") - if((obj_olocs = (H5O_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5O_loc_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5O_loc_t") - if((obj_paths = (H5G_name_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_name_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_name_t") + if((obj_ids = (hid_t *) H5MM_malloc(grp_dset_count * sizeof(hid_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for hid_t") + if((obj_glocs = (H5G_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_loc_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_loc_t") + if((obj_olocs = (H5O_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5O_loc_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5O_loc_t") + if((obj_paths = (H5G_name_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_name_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_name_t") /* Get the list of opened object ids (groups & datasets) */ - if(H5F_get_obj_ids(file, H5F_OBJ_GROUP|H5F_OBJ_DATASET, grp_dset_count, obj_ids, FALSE, &grp_dset_count) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "H5F_get_obj_ids failed") + if(H5F_get_obj_ids(file, H5F_OBJ_GROUP|H5F_OBJ_DATASET, grp_dset_count, obj_ids, FALSE, &grp_dset_count) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "H5F_get_obj_ids failed") /* Refresh opened objects (groups, datasets) in the file */ for(u = 0; u < grp_dset_count; u++) { @@ -1790,14 +1669,13 @@ done: * - Logging must have been set up via the fapl. * * Return: Non-negative on success/Negative on errors - * *------------------------------------------------------------------------- */ herr_t H5Fstart_mdc_logging(hid_t file_id) { - H5F_t *file; /* File info */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file; /* File info */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); @@ -1823,14 +1701,13 @@ done: * - Logging must have been set up via the fapl. * * Return: Non-negative on success/Negative on errors - * *------------------------------------------------------------------------- */ herr_t H5Fstop_mdc_logging(hid_t file_id) { - H5F_t *file; /* File info */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file; /* File info */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); @@ -1856,15 +1733,14 @@ done: * log messages are being recorded at this time. * * Return: Non-negative on success/Negative on errors - * *------------------------------------------------------------------------- */ herr_t H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled, hbool_t *is_currently_logging) { - H5F_t *file; /* File info */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file; /* File info */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*b*b", file_id, is_enabled, is_currently_logging); @@ -1888,9 +1764,6 @@ done: * 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 @@ -1924,17 +1797,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fformat_convert_super (Internal) + * Function: H5Fformat_convert_super (Internal) * - * Purpose: Downgrade the superblock version to v2 and - * downgrade persistent file space to non-persistent - * for 1.8 library. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi - * Jan 2016 + * Purpose: Downgrade the superblock version to v2 and + * downgrade persistent file space to non-persistent + * for 1.8 library. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1946,8 +1815,8 @@ H5Fformat_convert(hid_t fid) H5TRACE1("e", "i", fid); if(H5I_FILE == H5I_get_type(fid)) { - H5F_t *f; /* File to flush */ - hbool_t mark_dirty = FALSE; + H5F_t *f; /* File to flush */ + hbool_t mark_dirty = FALSE; /* Get file object */ if(NULL == (f = (H5F_t *)H5I_object(fid))) @@ -1961,9 +1830,9 @@ H5Fformat_convert(hid_t fid) /* Check for persistent freespace manager, which needs to be downgraded */ if(!(f->shared->fs_strategy == H5F_FILE_SPACE_STRATEGY_DEF && - f->shared->fs_persist == H5F_FREE_SPACE_PERSIST_DEF && - f->shared->fs_threshold == H5F_FREE_SPACE_THRESHOLD_DEF && - f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) { + f->shared->fs_persist == H5F_FREE_SPACE_PERSIST_DEF && + f->shared->fs_threshold == H5F_FREE_SPACE_THRESHOLD_DEF && + f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) { /* Check to remove free-space manager info message from superblock extension */ if(H5F_addr_defined(f->shared->sblock->ext_addr)) if(H5F_super_ext_remove_msg(f, H5AC_ind_read_dxpl_id, H5O_FSINFO_ID) < 0) @@ -2004,9 +1873,6 @@ done: * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: Mohamad Chaarawi - * *------------------------------------------------------------------------- */ herr_t @@ -2040,9 +1906,6 @@ done: * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: Mohamad Chaarawi - * *------------------------------------------------------------------------- */ herr_t @@ -2084,9 +1947,6 @@ done: * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: Vailin Choi; March 2017 - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Fint.c b/src/H5Fint.c index 7371c46..a48e41c 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -21,20 +21,20 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Aprivate.h" /* Attributes */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5SMprivate.h" /* Shared Object Header Messages */ -#include "H5Tprivate.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5Aprivate.h" /* Attributes */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5SMprivate.h" /* Shared Object Header Messages */ +#include "H5Tprivate.h" /* Datatypes */ /****************/ @@ -100,26 +100,19 @@ H5FL_DEFINE(H5F_file_t); /*------------------------------------------------------------------------- - * Function: H5F_get_access_plist + * Function: H5F_get_access_plist * - * Purpose: Returns a copy of the file access property list of the - * specified file. + * Purpose: Returns a copy of the file access property list of the + * specified file. * * NOTE: Make sure that, if you are going to overwrite * information in the copied property list that was * previously opened and assigned to the property list, then * you must close it before overwriting the values. * - * Return: Success: Object ID for a copy of the file access - * property list. - * - * Failure: FAIL - * - * Programmer: Quincey Koziol - * Wednesday, May 25, 2005 - * - * Modifications: - * + * Return: Success: Object ID for a copy of the file access + * property list. + * Failure: FAIL *------------------------------------------------------------------------- */ hid_t @@ -129,9 +122,9 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) H5P_genplist_t *old_plist; /* Old property list */ H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */ hbool_t driver_prop_copied = FALSE; /* Whether the driver property has been set up */ - unsigned efc_size = 0; - hbool_t latest_format = FALSE; /* Always use the latest format? */ - hid_t ret_value = SUCCEED; /* Return value */ + unsigned efc_size = 0; + hbool_t latest_format = FALSE; /* Always use the latest format? */ + hid_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -142,7 +135,7 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) if(NULL == (old_plist = (H5P_genplist_t *)H5I_object(H5P_LST_FILE_ACCESS_ID_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") if((ret_value = H5P_copy_plist(old_plist, app_ref)) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "can't copy file access property list") + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "can't copy file access property list") if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(ret_value))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") @@ -222,16 +215,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_get_obj_count + * Function: H5F_get_obj_count * - * Purpose: Private function return the number of opened object IDs - * (files, datasets, groups, datatypes) in the same file. + * Purpose: Private function return the number of opened object IDs + * (files, datasets, groups, datatypes) in the same file. * * Return: SUCCEED on success, FAIL on failure. - * - * Programmer: Raymond Lu - * Wednesday, Dec 5, 2001 - * *------------------------------------------------------------------------- */ herr_t @@ -259,10 +248,6 @@ done: * Purpose: Private function to return a list of opened object IDs. * * Return: Non-negative on success; can't fail. - * - * Programmer: Raymond Lu - * Wednesday, Dec 5, 2001 - * *------------------------------------------------------------------------- */ herr_t @@ -285,16 +270,13 @@ done: /*--------------------------------------------------------------------------- - * Function: H5F_get_objects + * Function: H5F_get_objects * - * Purpose: This function is called by H5F_get_obj_count or - * H5F_get_obj_ids to get number of object IDs and/or a - * list of opened object IDs (in return value). - * Return: Non-negative on success; Can't fail. - * - * Programmer: Raymond Lu - * Wednesday, Dec 5, 2001 + * Purpose: This function is called by H5F_get_obj_count or + * H5F_get_obj_ids to get number of object IDs and/or a + * list of opened object IDs (in return value). * + * Return: Non-negative on success; Can't fail. *--------------------------------------------------------------------------- */ herr_t @@ -313,7 +295,7 @@ H5F_get_objects(const H5F_t *f, unsigned types, size_t max_nobjs, hid_t *obj_id_ olist.obj_id_list = (max_nobjs==0 ? NULL : obj_id_list); olist.obj_id_count = &obj_id_count; olist.list_index = 0; - olist.max_nobjs = max_nobjs; + olist.max_nobjs = max_nobjs; /* Determine if we are searching for local or global objects */ if(types & H5F_OBJ_LOCAL) { @@ -337,37 +319,37 @@ H5F_get_objects(const H5F_t *f, unsigned types, size_t max_nobjs, hid_t *obj_id_ * or the caller wants to get the list of IDs and the list isn't full, * search through dataset IDs to count number of datasets, and put their * IDs on the object list */ - if(!olist.max_nobjs || (olist.max_nobjs && olist.list_indexobj_type == H5I_FILE) { if((olist->file_info.local && - (!olist->file_info.ptr.file || (olist->file_info.ptr.file && (H5F_t*)obj_ptr == olist->file_info.ptr.file) )) - || (!olist->file_info.local && - ( !olist->file_info.ptr.shared || (olist->file_info.ptr.shared && ((H5F_t*)obj_ptr)->shared == olist->file_info.ptr.shared) ))) { + (!olist->file_info.ptr.file || + (olist->file_info.ptr.file && (H5F_t*)obj_ptr == olist->file_info.ptr.file))) || + (!olist->file_info.local && + (!olist->file_info.ptr.shared || + (olist->file_info.ptr.shared && ((H5F_t*)obj_ptr)->shared == olist->file_info.ptr.shared)))) { add_obj = TRUE; - } /* end if */ + } /* end if */ } /* end if */ else { /* either count opened object IDs or put the IDs on the list */ H5O_loc_t *oloc; /* Group entry info for object */ - switch(olist->obj_type) { - case H5I_ATTR: - oloc = H5A_oloc((H5A_t *)obj_ptr); - break; - - case H5I_GROUP: - oloc = H5G_oloc((H5G_t *)obj_ptr); - break; - - case H5I_DATASET: - oloc = H5D_oloc((H5D_t *)obj_ptr); - break; - - case H5I_DATATYPE: - if(H5T_is_named((H5T_t*)obj_ptr)==TRUE) - oloc = H5T_oloc((H5T_t*)obj_ptr); - else - oloc = NULL; - break; - - case H5I_UNINIT: - case H5I_BADID: - case H5I_FILE: - case H5I_DATASPACE: - 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: + switch(olist->obj_type) { + case H5I_ATTR: + oloc = H5A_oloc((H5A_t *)obj_ptr); + break; + + case H5I_GROUP: + oloc = H5G_oloc((H5G_t *)obj_ptr); + break; + + case H5I_DATASET: + oloc = H5D_oloc((H5D_t *)obj_ptr); + break; + + case H5I_DATATYPE: + if(H5T_is_named((H5T_t*)obj_ptr)==TRUE) + oloc = H5T_oloc((H5T_t*)obj_ptr); + else + oloc = NULL; + break; + + case H5I_UNINIT: + case H5I_BADID: + case H5I_FILE: + case H5I_DATASPACE: + 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: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5_ITER_ERROR, "unknown data object") - } /* end switch */ + } /* end switch */ if((olist->file_info.local && - ( (!olist->file_info.ptr.file && olist->obj_type == H5I_DATATYPE && H5T_is_immutable((H5T_t *)obj_ptr) == FALSE) - || (!olist->file_info.ptr.file && olist->obj_type != H5I_DATATYPE) - || (oloc && oloc->file == olist->file_info.ptr.file))) - || (!olist->file_info.local && - ((!olist->file_info.ptr.shared && olist->obj_type == H5I_DATATYPE && H5T_is_immutable((H5T_t *)obj_ptr) == FALSE) - || (!olist->file_info.ptr.shared && olist->obj_type != H5I_DATATYPE) - || (oloc && oloc->file && oloc->file->shared == olist->file_info.ptr.shared)))) { + ((!olist->file_info.ptr.file && olist->obj_type == H5I_DATATYPE && H5T_is_immutable((H5T_t *)obj_ptr) == FALSE) || + (!olist->file_info.ptr.file && olist->obj_type != H5I_DATATYPE) || + (oloc && oloc->file == olist->file_info.ptr.file))) || + (!olist->file_info.local && + ((!olist->file_info.ptr.shared && olist->obj_type == H5I_DATATYPE && H5T_is_immutable((H5T_t *)obj_ptr) == FALSE) || + (!olist->file_info.ptr.shared && olist->obj_type != H5I_DATATYPE) || + (oloc && oloc->file && oloc->file->shared == olist->file_info.ptr.shared)))) { add_obj = TRUE; - } /* end if */ + } /* end if */ } /* end else */ if(add_obj) { /* Add the object's ID to the ID list, if appropriate */ if(olist->obj_id_list) { olist->obj_id_list[olist->list_index] = obj_id; - olist->list_index++; - } /* end if */ + olist->list_index++; + } /* end if */ /* Increment the number of open objects */ - if(olist->obj_id_count) + if(olist->obj_id_count) (*olist->obj_id_count)++; /* Check if we've filled up the array. Return H5_ITER_STOP only if * we have filled up the array. Otherwise return H5_ITER_CONT(RET_VALUE is - * preset to H5_ITER_CONT) because H5I_iterate needs the return value of + * preset to H5_ITER_CONT) because H5I_iterate needs the return value of * H5_ITER_CONT to continue the iteration. */ if(olist->max_nobjs > 0 && olist->list_index >= olist->max_nobjs) HGOTO_DONE(H5_ITER_STOP) /* Indicate that the iterator should stop */ @@ -501,35 +481,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5F__is_hdf5 - * - * Purpose: Check the file signature to detect an HDF5 file. - * - * Bugs: This function is not robust: it only uses the default file - * driver when attempting to open the file when in fact it - * should use all known file drivers. - * - * Return: Success: TRUE/FALSE + * Function: H5F__is_hdf5 * - * Failure: Negative + * Purpose: Check the file signature to detect an HDF5 file. * - * Programmer: Unknown + * Bugs: This function is not robust: it only uses the default file + * driver when attempting to open the file when in fact it + * should use all known file drivers. * + * Return: Success: TRUE/FALSE + * * Failure: Negative *------------------------------------------------------------------------- */ htri_t H5F__is_hdf5(const char *name, hid_t meta_dxpl_id, hid_t raw_dxpl_id) { - H5FD_t *file = NULL; /* Low-level file struct */ - H5FD_io_info_t fdio_info; /* File driver I/O info */ - haddr_t sig_addr; /* Addess of hdf5 file signature */ - htri_t ret_value = FAIL; /* Return value */ + H5FD_t *file = NULL; /* Low-level file struct */ + H5FD_io_info_t fdio_info; /* File driver I/O info */ + haddr_t sig_addr; /* Addess of hdf5 file signature */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Open the file at the virtual file layer */ if(NULL == (file = H5FD_open(name, H5F_ACC_RDONLY, H5P_FILE_ACCESS_DEFAULT, HADDR_UNDEF))) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file") + HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file") /* Set up the file driver info */ fdio_info.file = file; @@ -554,31 +530,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_new - * - * Purpose: Creates a new file object and initializes it. The - * H5Fopen and H5Fcreate functions then fill in various - * fields. If SHARED is a non-null pointer then the shared info - * to which it points has the reference count incremented. - * Otherwise a new, empty shared info struct is created and - * initialized with the specified file access property list. - * - * Errors: - * - * Return: Success: Ptr to a new file struct. + * Function: H5F_new * - * Failure: NULL - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 18 1997 + * Purpose: Creates a new file object and initializes it. The + * H5Fopen and H5Fcreate functions then fill in various fields. + * If SHARED is a non-null pointer then the shared info + * to which it points has the reference count incremented. + * Otherwise a new, empty shared info struct is created and + * initialized with the specified file access property list. * + * Return: Success: Ptr to a new file struct. + * Failure: NULL *------------------------------------------------------------------------- */ H5F_t * H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) { - H5F_t *f = NULL, *ret_value = NULL; + H5F_t *f = NULL, *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -592,8 +560,8 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t } /* end if */ else { H5P_genplist_t *plist; /* Property list */ - unsigned efc_size; /* External file cache size */ - hbool_t latest_format; /* Always use the latest format? */ + unsigned efc_size; /* External file cache size */ + hbool_t latest_format; /* Always use the latest format? */ size_t u; /* Local index variable */ HDassert(lf != NULL); @@ -650,7 +618,7 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get file space page size") HDassert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); - /* Temporary for multi/split drivers: fail file creation + /* Temporary for multi/split drivers: fail file creation when persisting free-space or using paged aggregation strategy */ if(H5F_HAS_FEATURE(f, H5FD_FEAT_PAGED_AGGR)) if(f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE || f->shared->fs_persist) @@ -826,25 +794,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5F__dest - * - * Purpose: Destroys a file structure. This function flushes the cache - * but doesn't do any other cleanup other than freeing memory - * for the file struct. The shared info for the file is freed - * only when its reference count reaches zero. + * Function: H5F__dest * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 18 1997 + * Purpose: Destroys a file structure. This function flushes the cache + * but doesn't do any other cleanup other than freeing memory + * for the file struct. The shared info for the file is freed + * only when its reference count reaches zero. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -866,7 +829,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) 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 + * This allows the cache to set up for creating a metadata cache * image if this has been requested. */ if(H5AC_prep_for_file_close(f, meta_dxpl_id) < 0) @@ -883,7 +846,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) 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 + * should be clean at this point, with the possible exception of the * the superblock and superblock extension. * * Verify this. @@ -909,10 +872,10 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) /* Release objects that depend on the superblock being initialized */ if(f->shared->sblock) { /* Shutdown file free space manager(s) */ - /* (We should release the free space information now (before - * truncating the file and before the metadata cache is shut - * down) since the free space manager is holding some data - * structures in memory and also because releasing free space + /* (We should release the free space information now (before + * truncating the file and before the metadata cache is shut + * down) since the free space manager is holding some data + * structures in memory and also because releasing free space * can shrink the file's 'eoa' value) * * Update 11/1/16: @@ -938,7 +901,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * free space manager may dirty some data structures again. */ if(flush) { - /* Clear status_flags */ + /* Clear status_flags */ f->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_WRITE_ACCESS); f->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_SWMR_WRITE_ACCESS); @@ -947,8 +910,8 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") - /* Release any space allocated to space aggregators, - * so that the eoa value corresponds to the end of the + /* Release any space allocated to space aggregators, + * 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 @@ -967,11 +930,11 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * extension should be dirty. */ HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); - } /* end if */ + } /* end if */ } /* end if */ /* if it exists, unpin the driver information block cache entry, - * since we're about to destroy the cache + * since we're about to destroy the cache */ if(f->shared->drvinfo) if(H5AC_unpin_entry(f->shared->drvinfo) < 0) @@ -991,7 +954,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * Verify this. */ HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); - + /* Remove shared file struct from list of open files */ if(H5F_sfile_remove(f->shared) < 0) /* Push error, but keep going*/ @@ -1067,7 +1030,8 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) /* Destroy shared file struct */ f->shared = (H5F_file_t *)H5FL_FREE(H5F_file_t, f->shared); - } else if(f->shared->nrefs > 0) { + } + else if(f->shared->nrefs > 0) { /* * There are other references to the shared part of the file. * Only decrement the reference count. @@ -1089,42 +1053,42 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) /*------------------------------------------------------------------------- - * Function: H5F_open + * Function: H5F_open * - * Purpose: Opens (or creates) a file. This function understands the - * following flags which are similar in nature to the Posix - * open(2) flags. + * Purpose: Opens (or creates) a file. This function understands the + * following flags which are similar in nature to the Posix + * open(2) flags. * - * 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_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_CREAT: Create a new file if it doesn't exist yet. - * The permissions are 0666 bit-wise AND with - * the current umask. H5F_ACC_WRITE must also - * be specified. + * H5F_ACC_CREAT: Create a new file if it doesn't exist yet. + * The permissions are 0666 bit-wise AND with + * the current umask. H5F_ACC_WRITE must also + * be specified. * - * H5F_ACC_EXCL: This flag causes H5F_open() to fail if the - * file already exists. + * H5F_ACC_EXCL: This flag causes H5F_open() to fail if the + * file already exists. * - * H5F_ACC_TRUNC: The file is truncated and a new HDF5 superblock - * is written. This operation will fail if the - * file is already open. + * H5F_ACC_TRUNC: The file is truncated and a new HDF5 superblock + * is written. This operation will fail if the + * file is already open. * - * Unlinking the file name from the group directed graph while - * the file is opened causes the file to continue to exist but - * one will not be able to upgrade the file from read-only - * access to read-write access by reopening it. Disk resources - * for the file are released when all handles to the file are - * closed. NOTE: This paragraph probably only applies to Unix; - * deleting the file name in other OS's has undefined results. + * Unlinking the file name from the group directed graph while + * the file is opened causes the file to continue to exist but + * one will not be able to upgrade the file from read-only + * access to read-write access by reopening it. Disk resources + * for the file are released when all handles to the file are + * closed. NOTE: This paragraph probably only applies to Unix; + * deleting the file name in other OS's has undefined results. * - * The CREATE_PARMS argument is optional. A null pointer will - * cause the default file creation parameters to be used. + * The CREATE_PARMS argument is optional. A null pointer will + * cause the default file creation parameters to be used. * - * The ACCESS_PARMS argument is optional. A null pointer will - * cause the default file access parameters to be used. + * The ACCESS_PARMS argument is optional. A null pointer will + * cause the default file access parameters to be used. * * The following two tables show results of file opens for single and concurrent access: * @@ -1157,12 +1121,8 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * s: the open succeeds with flags combination from both the first and second opens * * - * Return: Success: A new file pointer. - * Failure: NULL - * - * Programmer: Robb Matzke - * Tuesday, September 23, 1997 - * + * Return: Success: A new file pointer. + * Failure: NULL *------------------------------------------------------------------------- */ H5F_t * @@ -1181,7 +1141,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, unsigned page_buf_min_meta_perc; unsigned page_buf_min_raw_perc; hbool_t set_flag = FALSE; /*set the status_flags in the superblock */ - hbool_t clear = FALSE; /*clear the status_flags */ + hbool_t clear = FALSE; /*clear the status_flags */ hbool_t evict_on_close; /* evict on close value from plist */ H5F_t *ret_value = NULL; /*actual return value */ char *lock_env_var = NULL;/*env var pointer */ @@ -1210,7 +1170,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, if(lock_env_var && !HDstrcmp(lock_env_var, "FALSE")) use_file_locking = FALSE; else - use_file_locking = TRUE; + use_file_locking = TRUE; /* * Opening a file is a two step process. First we try to open the @@ -1299,8 +1259,8 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, /* Place an advisory lock on the file */ if(use_file_locking) if(H5FD_lock(lf, (hbool_t)((flags & H5F_ACC_RDWR) ? TRUE : FALSE)) < 0) { - /* Locking failed - Closing will remove the lock */ - if(H5FD_close(lf) < 0) + /* Locking failed - Closing will remove the lock */ + if(H5FD_close(lf) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to close low-level file info") HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to lock the file") } /* end if */ @@ -1311,7 +1271,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, * returned is NULL, H5FD_close() will never be called via H5F_dest() * so we have to close lf here before heading to the error handling. */ - if(H5FD_close(lf) < 0) + if(H5FD_close(lf) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to close low-level file info") HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to initialize file structure") } /* end if */ @@ -1475,7 +1435,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, 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)) { + if(use_file_locking && (H5F_INTENT(file) & H5F_ACC_SWMR_WRITE)) { if(H5FD_unlock(file->shared->lf) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to unlock the file") } /* end if */ @@ -1483,11 +1443,11 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, else { /* H5F_ACC_RDONLY: check consistency of status_flags */ /* Skip check of status_flags for file with < superblock version 3 */ if(file->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) { - if(H5F_INTENT(file) & H5F_ACC_SWMR_READ) { - if((file->shared->sblock->status_flags & H5F_SUPER_WRITE_ACCESS && + if(H5F_INTENT(file) & H5F_ACC_SWMR_READ) { + if((file->shared->sblock->status_flags & H5F_SUPER_WRITE_ACCESS && !(file->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS)) - || - (!(file->shared->sblock->status_flags & H5F_SUPER_WRITE_ACCESS) && + || + (!(file->shared->sblock->status_flags & H5F_SUPER_WRITE_ACCESS) && file->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS)) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "file is not already open for SWMR writing") } /* end if */ @@ -1511,16 +1471,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_flush_phase1 - * - * Purpose: First phase of flushing cached data. + * Function: H5F_flush_phase1 * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@lbl.gov - * Jan 1 2017 + * Purpose: First phase of flushing cached data. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ static herr_t @@ -1553,16 +1508,11 @@ H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id) /*------------------------------------------------------------------------- - * Function: H5F__flush_phase2 - * - * Purpose: Second phase of flushing cached data. - * - * Return: Non-negative on success/Negative on failure + * Function: H5F__flush_phase2 * - * Programmer: Quincey Koziol - * koziol@lbl.gov - * Jan 1 2017 + * Purpose: Second phase of flushing cached data. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ static herr_t @@ -1620,16 +1570,11 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi /*------------------------------------------------------------------------- - * Function: H5F__flush + * Function: H5F__flush * - * Purpose: Flushes cached data. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 29 1997 + * Purpose: Flushes cached data. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1657,33 +1602,29 @@ H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing) /*------------------------------------------------------------------------- - * Function: H5F_close - * - * Purpose: Closes a file or causes the close operation to be pended. - * This function is called two ways: from the API it gets called - * by H5Fclose->H5I_dec_ref->H5F_close when H5I_dec_ref() - * decrements the file ID reference count to zero. The file ID - * is removed from the H5I_FILE group by H5I_dec_ref() just - * before H5F_close() is called. If there are open object - * headers then the close is pended by moving the file to the - * H5I_FILE_CLOSING ID group (the f->closing contains the ID - * assigned to file). - * - * This function is also called directly from H5O_close() when - * the last object header is closed for the file and the file - * has a pending close. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Tuesday, September 23, 1997 - * + * Function: H5F_close + * + * Purpose: Closes a file or causes the close operation to be pended. + * This function is called two ways: from the API it gets called + * by H5Fclose->H5I_dec_ref->H5F_close when H5I_dec_ref() + * decrements the file ID reference count to zero. The file ID + * is removed from the H5I_FILE group by H5I_dec_ref() just + * before H5F_close() is called. If there are open object + * headers then the close is pended by moving the file to the + * H5I_FILE_CLOSING ID group (the f->closing contains the ID + * assigned to file). + * + * This function is also called directly from H5O_close() when + * the last object header is closed for the file and the file + * has a pending close. + * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t H5F_close(H5F_t *f) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1722,18 +1663,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_try_close + * Function: H5F_try_close * - * Purpose: Attempts to close a file due to one of several actions: + * Purpose: Attempts to close a file due to one of several actions: * - The reference count on the file ID dropped to zero * - The last open object was closed in the file * - The file was unmounted * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Tuesday, July 19, 2005 - * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1741,7 +1678,7 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) { unsigned nopen_files = 0; /* Number of open files in file/mount hierarchy */ unsigned nopen_objs = 0; /* Number of open objects in file/mount hierarchy */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1772,12 +1709,12 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) /* * Close file according to close degree: * - * H5F_CLOSE_WEAK: if there are still objects open, wait until - * they are all closed. - * H5F_CLOSE_SEMI: if there are still objects open, return fail; - * otherwise, close file. - * H5F_CLOSE_STRONG: if there are still objects open, close them - * first, then close file. + * H5F_CLOSE_WEAK: if there are still objects open, wait until + * they are all closed. + * H5F_CLOSE_SEMI: if there are still objects open, return fail; + * otherwise, close file. + * H5F_CLOSE_STRONG: if there are still objects open, close them + * first, then close file. */ switch(f->shared->fc_degree) { case H5F_CLOSE_WEAK: @@ -1899,16 +1836,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_get_id - * - * Purpose: Get the file ID, incrementing it, or "resurrecting" it as - * appropriate. - * - * Return: Non-negative on success/Negative on failure + * Function: H5F_get_id * - * Programmer: Raymond Lu - * Oct 29, 2003 + * Purpose: Get the file ID, incrementing it, or "resurrecting" it as + * appropriate. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ hid_t @@ -1923,8 +1856,9 @@ H5F_get_id(H5F_t *file, hbool_t app_ref) if(file->file_id == -1) { /* Get an atom for the file */ if((file->file_id = H5I_register(H5I_FILE, file, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file") - } else { + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file") + } + else { /* Increment reference count on atom. */ if(H5I_inc_ref(file->file_id, app_ref) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") @@ -1938,18 +1872,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_incr_nopen_objs - * - * Purpose: Increment the number of open objects for a file. - * - * Return: Success: The number of open objects, after the increment + * Function: H5F_incr_nopen_objs * - * Failure: (can't happen) - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Mar 6 2007 + * Purpose: Increment the number of open objects for a file. * + * Return: Success: The number of open objects, after the increment + * Failure: (can't happen) *------------------------------------------------------------------------- */ unsigned @@ -1965,18 +1893,12 @@ H5F_incr_nopen_objs(H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_decr_nopen_objs - * - * Purpose: Decrement the number of open objects for a file. - * - * Return: Success: The number of open objects, after the decrement - * - * Failure: (can't happen) + * Function: H5F_decr_nopen_objs * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Mar 6 2007 + * Purpose: Decrement the number of open objects for a file. * + * Return: Success: The number of open objects, after the decrement + * Failure: (can't happen) *------------------------------------------------------------------------- */ unsigned @@ -1992,18 +1914,14 @@ H5F_decr_nopen_objs(H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_build_actual_name + * Function: H5F_build_actual_name * - * Purpose: Retrieve the name of a file, after following symlinks, etc. + * Purpose: Retrieve the name of a file, after following symlinks, etc. * - * Note: Currently only working for "POSIX I/O compatible" VFDs - * - * Return: Success: 0 - * Failure: -1 - * - * Programmer: Quincey Koziol - * November 25, 2009 + * Note: Currently only working for "POSIX I/O compatible" VFDs * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t @@ -2118,17 +2036,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_addr_encode_len - * - * Purpose: Encodes an address into the buffer pointed to by *PP and - * then increments the pointer to the first byte after the - * address. An undefined value is stored as all 1's. + * Function: H5F_addr_encode_len * - * Return: void - * - * Programmer: Robb Matzke - * Friday, November 7, 1997 + * Purpose: Encodes an address into the buffer pointed to by *PP and + * then increments the pointer to the first byte after the + * address. An undefined value is stored as all 1's. * + * Return: void *------------------------------------------------------------------------- */ void @@ -2143,15 +2057,15 @@ H5F_addr_encode_len(size_t addr_len, uint8_t **pp/*in,out*/, haddr_t addr) HDassert(pp && *pp); if(H5F_addr_defined(addr)) { - for(u = 0; u < addr_len; u++) { - *(*pp)++ = (uint8_t)(addr & 0xff); - addr >>= 8; - } /* end for */ - HDassert("overflow" && 0 == addr); + for(u = 0; u < addr_len; u++) { + *(*pp)++ = (uint8_t)(addr & 0xff); + addr >>= 8; + } /* end for */ + HDassert("overflow" && 0 == addr); } /* end if */ else { - for(u = 0; u < addr_len; u++) - *(*pp)++ = 0xff; + for(u = 0; u < addr_len; u++) + *(*pp)++ = 0xff; } /* end else */ FUNC_LEAVE_NOAPI_VOID @@ -2159,17 +2073,13 @@ H5F_addr_encode_len(size_t addr_len, uint8_t **pp/*in,out*/, haddr_t addr) /*------------------------------------------------------------------------- - * Function: H5F_addr_encode - * - * Purpose: Encodes an address into the buffer pointed to by *PP and - * then increments the pointer to the first byte after the - * address. An undefined value is stored as all 1's. - * - * Return: void + * Function: H5F_addr_encode * - * Programmer: Robb Matzke - * Friday, November 7, 1997 + * Purpose: Encodes an address into the buffer pointed to by *PP and + * then increments the pointer to the first byte after the + * address. An undefined value is stored as all 1's. * + * Return: void *------------------------------------------------------------------------- */ void @@ -2187,27 +2097,23 @@ H5F_addr_encode(const H5F_t *f, uint8_t **pp/*in,out*/, haddr_t addr) /*------------------------------------------------------------------------- - * Function: H5F_addr_decode_len + * Function: H5F_addr_decode_len * - * Purpose: Decodes an address from the buffer pointed to by *PP and - * updates the pointer to point to the next byte after the - * address. + * Purpose: Decodes an address from the buffer pointed to by *PP and + * updates the pointer to point to the next byte after the + * address. * - * If the value read is all 1's then the address is returned - * with an undefined value. - * - * Return: void - * - * Programmer: Robb Matzke - * Friday, November 7, 1997 + * If the value read is all 1's then the address is returned + * with an undefined value. * + * Return: void *------------------------------------------------------------------------- */ void H5F_addr_decode_len(size_t addr_len, const uint8_t **pp/*in,out*/, haddr_t *addr_p/*out*/) { - hbool_t all_zero = TRUE; /* True if address was all zeroes */ - unsigned u; /* Local index variable */ + hbool_t all_zero = TRUE; /* True if address was all zeroes */ + unsigned u; /* Local index variable */ /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2221,27 +2127,27 @@ H5F_addr_decode_len(size_t addr_len, const uint8_t **pp/*in,out*/, haddr_t *addr /* Decode bytes from address */ for(u = 0; u < addr_len; u++) { - uint8_t c; /* Local decoded byte */ + uint8_t c; /* Local decoded byte */ /* Get decoded byte (and advance pointer) */ - c = *(*pp)++; + c = *(*pp)++; /* Check for non-undefined address byte value */ - if(c != 0xff) + if(c != 0xff) all_zero = FALSE; - if(u < sizeof(*addr_p)) { - haddr_t tmp = c; /* Local copy of address, for casting */ + if(u < sizeof(*addr_p)) { + haddr_t tmp = c; /* Local copy of address, for casting */ /* Shift decoded byte to correct position */ - tmp <<= (u * 8); /*use tmp to get casting right */ + tmp <<= (u * 8); /*use tmp to get casting right */ /* Merge into already decoded bytes */ - *addr_p |= tmp; - } /* end if */ + *addr_p |= tmp; + } /* end if */ else if(!all_zero) - HDassert(0 == **pp); /*overflow */ + HDassert(0 == **pp); /*overflow */ } /* end for */ /* If 'all_zero' is still TRUE, the address was entirely composed of '0xff' @@ -2255,20 +2161,16 @@ H5F_addr_decode_len(size_t addr_len, const uint8_t **pp/*in,out*/, haddr_t *addr /*------------------------------------------------------------------------- - * Function: H5F_addr_decode + * Function: H5F_addr_decode * - * Purpose: Decodes an address from the buffer pointed to by *PP and - * updates the pointer to point to the next byte after the - * address. + * Purpose: Decodes an address from the buffer pointed to by *PP and + * updates the pointer to point to the next byte after the + * address. * - * If the value read is all 1's then the address is returned - * with an undefined value. - * - * Return: void - * - * Programmer: Robb Matzke - * Friday, November 7, 1997 + * If the value read is all 1's then the address is returned + * with an undefined value. * + * Return: void *------------------------------------------------------------------------- */ void @@ -2292,10 +2194,6 @@ H5F_addr_decode(const H5F_t *f, const uint8_t **pp/*in,out*/, haddr_t *addr_p/*o * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: Quincey Koziol - * 7/19/11 - * *------------------------------------------------------------------------- */ herr_t @@ -2322,10 +2220,6 @@ H5F_set_grp_btree_shared(H5F_t *f, H5UC_t *rc) * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: Quincey Koziol - * 7/20/11 - * *------------------------------------------------------------------------- */ herr_t @@ -2351,10 +2245,6 @@ H5F_set_sohm_addr(H5F_t *f, haddr_t addr) * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: Quincey Koziol - * 7/20/11 - * *------------------------------------------------------------------------- */ herr_t @@ -2380,10 +2270,6 @@ H5F_set_sohm_vers(H5F_t *f, unsigned vers) * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: Quincey Koziol - * 7/20/11 - * *------------------------------------------------------------------------- */ herr_t @@ -2409,10 +2295,6 @@ H5F_set_sohm_nindexes(H5F_t *f, unsigned nindexes) * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: Quincey Koziol - * 7/20/11 - * *------------------------------------------------------------------------- */ herr_t @@ -2438,10 +2320,6 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) * * Return: Success: Bytes copied / number of bytes needed. * Failure: negative value - * - * Programmer: John Mainzer - * 11/15/11 - * *------------------------------------------------------------------------- */ ssize_t @@ -2482,20 +2360,20 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_i if(HDstrcmp(fd_ptr->cls->name, "multi") == 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not supported for multi file driver.") - /* While the family file driver is conceptually fully compatible + /* While the family file driver is conceptually fully compatible * with the get file image operation, it sets a file driver message * in the super block that prevents the image being opened with any * driver other than the family file driver. Needless to say, this * rather defeats the purpose of the get file image operation. * - * While this problem is quire solvable, the required time and + * While this problem is quire solvable, the required time and * resources are lacking at present. Hence, for now, we don't - * allow the get file image operation to be perfomed on files + * allow the get file image operation to be perfomed on files * opened with the family file driver. * - * Observe that the following test only looks at the top level + * Observe that the following test only looks at the top level * driver, and fails if there is some other driver sitting on to - * of the family file driver. + * of the family file driver. * * I don't think this can happen at present, but that may change * in the future. @@ -2514,7 +2392,7 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_i /* test to see if a buffer was provided -- if not, we are done */ if(buf_ptr != NULL) { H5FD_io_info_t fdio_info; /* File driver I/O info */ - size_t space_needed; /* size of file image */ + size_t space_needed; /* size of file image */ hsize_t tmp; size_t tmp_size; @@ -2545,34 +2423,31 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_i HDmemset((uint8_t *)(buf_ptr) + tmp, 0, tmp_size); } /* end if */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_get_file_image() */ /*------------------------------------------------------------------------- - * Function: H5F_track_metadata_read_retries - * - * Purpose: To track the # of a "retries" (log10) for a metadata item. - * This routine should be used only when: - * "retries" > 0 - * f->shared->read_attempts > 1 (does not have retry when 1) - * f->shared->retries_nbins > 0 (calculated based on f->shared->read_attempts) + * Function: H5F_track_metadata_read_retries * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: Vailin Choi; October 2013 + * Purpose: To track the # of a "retries" (log10) for a metadata item. + * This routine should be used only when: + * "retries" > 0 + * f->shared->read_attempts > 1 (does not have retry when 1) + * f->shared->retries_nbins > 0 (calculated based on f->shared->read_attempts) * + * Return: Success: SUCCEED + * Failure: FAIL *------------------------------------------------------------------------- */ herr_t H5F_track_metadata_read_retries(H5F_t *f, unsigned actype, unsigned retries) { - unsigned log_ind; /* Index to the array of retries based on log10 of retries */ - double tmp; /* Temporary value, to keep compiler quiet */ - herr_t ret_value = SUCCEED; /* Return value */ + unsigned log_ind; /* Index to the array of retries based on log10 of retries */ + double tmp; /* Temporary value, to keep compiler quiet */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2603,23 +2478,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_set_retries - * - * Purpose: To initialize data structures for read retries: - * --zero out "retries" - * --set up "retries_nbins" based on read_attempts - * - * Return: Success: SUCCEED - * Failure: FAIL + * Function: H5F_set_retries * - * Programmer: Vailin Choi; November 2013 + * Purpose: To initialize data structures for read retries: + * --zero out "retries" + * --set up "retries_nbins" based on read_attempts * + * Return: Success: SUCCEED + * Failure: FAIL *------------------------------------------------------------------------- */ herr_t H5F_set_retries(H5F_t *f) { - double tmp; /* Temporary variable */ + double tmp; /* Temporary variable */ /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2649,9 +2521,6 @@ H5F_set_retries(H5F_t *f) * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: Vailin Choi; October 2013 - * *------------------------------------------------------------------------- */ herr_t @@ -2675,15 +2544,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5F__set_base_addr + * Function: H5F__set_base_addr * - * Purpose: Quick and dirty routine to set the file's 'base_addr' value - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * July 19, 2013 + * Purpose: Quick and dirty routine to set the file's 'base_addr' value * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -2698,7 +2563,7 @@ H5F__set_base_addr(const H5F_t *f, haddr_t addr) /* Dispatch to driver */ if(H5FD_set_base_addr(f->shared->lf, addr) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_base_addr request failed") + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_base_addr request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2706,15 +2571,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5F__set_eoa - * - * Purpose: Quick and dirty routine to set the file's 'eoa' value + * Function: H5F__set_eoa * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * July 19, 2013 + * Purpose: Quick and dirty routine to set the file's 'eoa' value * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -2729,7 +2590,7 @@ H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr) /* Dispatch to driver */ if(H5FD_set_eoa(f->shared->lf, type, addr) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_eoa request failed") + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_eoa request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2737,15 +2598,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5F__set_paged_aggr - * - * Purpose: Quick and dirty routine to set the file's paged_aggr mode + * Function: H5F__set_paged_aggr * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * June 19, 2015 + * Purpose: Quick and dirty routine to set the file's paged_aggr mode * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -2776,10 +2633,6 @@ done: * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: Quincey Koziol - * 2/10/16 - * *------------------------------------------------------------------------- */ void @@ -2805,10 +2658,6 @@ H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t cmr) * * Return: Success: SUCCEED * Failure: FAIL - * - * Programmer: Quincey Koziol - * 4/26/16 - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 41cf4d2..cc2399b 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -26,16 +26,16 @@ /* Module Setup */ /****************/ -#include "H5Fmodule.h" /* This source code file is part of the H5F module */ +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ /****************/ @@ -75,17 +75,13 @@ /*------------------------------------------------------------------------- - * Function: H5F_get_intent + * Function: H5F_get_intent * - * Purpose: Quick and dirty routine to retrieve the file's 'intent' flags - * (Mainly added to stop non-file routines from poking about in the - * H5F_t data structure) - * - * Return: 'intent' on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol - * September 29, 2000 + * Purpose: Quick and dirty routine to retrieve the file's 'intent' flags + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) * + * Return: 'intent' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ unsigned @@ -101,16 +97,12 @@ H5F_get_intent(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_open_name - * - * Purpose: Retrieve the name used to open a file. - * - * Return: Success: The name of the file. - * Failure: ? (should not happen) + * Function: H5F_get_open_name * - * Programmer: Neil Fortner - * December 15 2008 + * Purpose: Retrieve the name used to open a file. * + * Return: Success: The name of the file. + * Failure: ? (should not happen) *------------------------------------------------------------------------- */ char * @@ -127,16 +119,12 @@ H5F_get_open_name(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_actual_name + * Function: H5F_get_actual_name * - * Purpose: Retrieve the actual name of a file, after resolving symlinks, etc. - * - * Return: Success: The name of the file. - * Failure: ? (should not happen) - * - * Programmer: Quincey Koziol - * November 25 2009 + * Purpose: Retrieve the actual name of a file, after resolving symlinks, etc. * + * Return: Success: The name of the file. + * Failure: ? (should not happen) *------------------------------------------------------------------------- */ char * @@ -153,16 +141,13 @@ H5F_get_actual_name(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_extpath - * - * Purpose: Retrieve the file's 'extpath' flags - * This is used by H5L_extern_traverse() and H5D_build_extfile_prefix() to retrieve the main file's location - * when searching the target file. + * Function: H5F_get_extpath * - * Return: 'extpath' on success/abort on failure (shouldn't fail) - * - * Programmer: Vailin Choi, April 2, 2008 + * Purpose: Retrieve the file's 'extpath' flags + * This is used by H5L_extern_traverse() and H5D_build_extfile_prefix() to retrieve the main file's location + * when searching the target file. * + * Return: 'extpath' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ char * @@ -179,14 +164,11 @@ H5F_get_extpath(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_shared - * - * Purpose: Retrieve the file's 'shared' pointer + * Function: H5F_get_shared * - * Return: 'shared' on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol, July 20, 2011 + * Purpose: Retrieve the file's 'shared' pointer * + * Return: 'shared' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ H5F_file_t * @@ -202,14 +184,11 @@ H5F_get_shared(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_same_shared - * - * Purpose: Determine if two files have the same shared file pointer + * Function: H5F_same_shared * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol, July 19, 2011 + * Purpose: Determine if two files have the same shared file pointer * + * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ hbool_t @@ -228,14 +207,11 @@ H5F_same_shared(const H5F_t *f1, const H5F_t *f2) /*------------------------------------------------------------------------- - * Function: H5F_get_nopen_objs - * - * Purpose: Retrieve the file's 'nopen_objs' value - * - * Return: 'nopen_objs' on success/abort on failure (shouldn't fail) + * Function: H5F_get_nopen_objs * - * Programmer: Quincey Koziol, July 20, 2011 + * Purpose: Retrieve the file's 'nopen_objs' value * + * Return: 'nopen_objs' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ unsigned @@ -251,14 +227,11 @@ H5F_get_nopen_objs(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_file_id + * Function: H5F_get_file_id * - * Purpose: Retrieve the file's 'file_id' value - * - * Return: 'file_id' on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol, July 20, 2011 + * Purpose: Retrieve the file's 'file_id' value * + * Return: 'file_id' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ hid_t @@ -274,14 +247,11 @@ H5F_get_file_id(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_parent - * - * Purpose: Retrieve the file's 'parent' pointer - * - * Return: 'parent' on success/abort on failure (shouldn't fail) + * Function: H5F_get_parent * - * Programmer: Quincey Koziol, July 19, 2011 + * Purpose: Retrieve the file's 'parent' pointer * + * Return: 'parent' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ H5F_t * @@ -297,14 +267,11 @@ H5F_get_parent(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_nmounts + * Function: H5F_get_nmounts * - * Purpose: Retrieve the file's 'nmounts' value - * - * Return: 'nmounts' on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol, July 20, 2011 + * Purpose: Retrieve the file's 'nmounts' value * + * Return: 'nmounts' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ unsigned @@ -320,14 +287,11 @@ H5F_get_nmounts(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_read_attempts - * - * Purpose: Retrieve the file's 'read_attempts' value + * Function: H5F_get_read_attempts * - * Return: '# of read attempts' on success/abort on failure (shouldn't fail) - * - * Programmer: Vaili Choi; Sept 2013 + * Purpose: Retrieve the file's 'read_attempts' value * + * Return: '# of read attempts' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ unsigned @@ -343,18 +307,12 @@ H5F_get_read_attempts(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_fcpl - * - * Purpose: Retrieve the value of a file's FCPL. - * - * Return: Success: The FCPL for the file. + * Function: H5F_get_fcpl * - * Failure: ? (should not happen) - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * May 25 2005 + * Purpose: Retrieve the value of a file's FCPL. * + * Return: Success: The FCPL for the file. + * Failure: ? (should not happen) *------------------------------------------------------------------------- */ hid_t @@ -371,17 +329,13 @@ H5F_get_fcpl(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_sizeof_addr - * - * Purpose: Quick and dirty routine to retrieve the size of the file's size_t - * (Mainly added to stop non-file routines from poking about in the - * H5F_t data structure) - * - * Return: 'sizeof_addr' on success/abort on failure (shouldn't fail) + * Function: H5F_sizeof_addr * - * Programmer: Quincey Koziol - * September 29, 2000 + * Purpose: Quick and dirty routine to retrieve the size of the file's size_t + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) * + * Return: 'sizeof_addr' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ uint8_t @@ -398,17 +352,13 @@ H5F_sizeof_addr(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_sizeof_size + * Function: H5F_sizeof_size * - * Purpose: Quick and dirty routine to retrieve the size of the file's off_t - * (Mainly added to stop non-file routines from poking about in the - * H5F_t data structure) - * - * Return: 'sizeof_size' on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol - * September 29, 2000 + * Purpose: Quick and dirty routine to retrieve the size of the file's off_t + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) * + * Return: 'sizeof_size' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ uint8_t @@ -425,14 +375,11 @@ H5F_sizeof_size(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_sohm_addr - * - * Purpose: Retrieve the file's 'sohm_addr' value - * - * Return: 'sohm_addr' on success/abort on failure (shouldn't fail) + * Function: H5F_get_sohm_addr * - * Programmer: Quincey Koziol, July 20, 2011 + * Purpose: Retrieve the file's 'sohm_addr' value * + * Return: 'sohm_addr' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ haddr_t @@ -449,14 +396,11 @@ H5F_get_sohm_addr(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_sohm_vers + * Function: H5F_get_sohm_vers * - * Purpose: Retrieve the file's 'sohm_vers' value - * - * Return: 'sohm_vers' on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol, July 20, 2011 + * Purpose: Retrieve the file's 'sohm_vers' value * + * Return: 'sohm_vers' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ unsigned @@ -473,14 +417,11 @@ H5F_get_sohm_vers(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_sohm_nindexes - * - * Purpose: Retrieve the file's 'sohm_nindexes' value + * Function: H5F_get_sohm_nindexes * - * Return: 'sohm_nindexes' on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol, July 20, 2011 + * Purpose: Retrieve the file's 'sohm_nindexes' value * + * Return: 'sohm_nindexes' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ unsigned @@ -497,21 +438,15 @@ H5F_get_sohm_nindexes(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_sym_leaf_k + * Function: H5F_sym_leaf_k * - * Purpose: Replaced a macro to retrieve the symbol table leaf size, - * now that the generic properties are being used to store - * the values. + * Purpose: Replaced a macro to retrieve the symbol table leaf size, + * now that the generic properties are being used to store + * the values. * - * Return: Success: Non-negative, and the symbol table leaf size is + * Return: Success: Non-negative, and the symbol table leaf size is * returned. - * - * Failure: Negative (should not happen) - * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu - * Oct 14 2001 - * + * Failure: Negative (should not happen) *------------------------------------------------------------------------- */ unsigned @@ -529,21 +464,15 @@ H5F_sym_leaf_k(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_Kvalue + * Function: H5F_Kvalue * - * Purpose: Replaced a macro to retrieve a B-tree key value for a certain - * type, now that the generic properties are being used to store - * the B-tree values. + * Purpose: Replaced a macro to retrieve a B-tree key value for a certain + * type, now that the generic properties are being used to store + * the B-tree values. * - * Return: Success: Non-negative, and the B-tree key value is + * Return: Success: Non-negative, and the B-tree key value is * returned. - * - * Failure: Negative (should not happen) - * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu - * Oct 14 2001 - * + * Failure: Negative (should not happen) *------------------------------------------------------------------------- */ unsigned @@ -562,14 +491,11 @@ H5F_Kvalue(const H5F_t *f, const H5B_class_t *type) /*------------------------------------------------------------------------- - * Function: H5F_get_nrefs + * Function: H5F_get_nrefs * - * Purpose: Retrieve the file's 'nrefs' value - * - * Return: 'nrefs' on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol, July 20, 2011 + * Purpose: Retrieve the file's 'nrefs' value * + * Return: 'nrefs' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ unsigned @@ -586,21 +512,15 @@ H5F_get_nrefs(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_rdcc_nslots + * Function: H5F_rdcc_nslots * - * Purpose: Replaced a macro to retrieve the raw data cache number of slots, - * now that the generic properties are being used to store - * the values. + * Purpose: Replaced a macro to retrieve the raw data cache number of slots, + * now that the generic properties are being used to store + * the values. * - * Return: Success: Non-negative, and the raw data cache number of + * Return: Success: Non-negative, and the raw data cache number of * of slots is returned. - * - * Failure: Negative (should not happen) - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jun 1 2004 - * + * Failure: Negative (should not happen) *------------------------------------------------------------------------- */ size_t @@ -617,21 +537,15 @@ H5F_rdcc_nslots(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_rdcc_nbytes + * Function: H5F_rdcc_nbytes * - * Purpose: Replaced a macro to retrieve the raw data cache number of bytes, - * now that the generic properties are being used to store - * the values. + * Purpose: Replaced a macro to retrieve the raw data cache number of bytes, + * now that the generic properties are being used to store + * the values. * - * Return: Success: Non-negative, and the raw data cache number of + * Return: Success: Non-negative, and the raw data cache number of * of bytes is returned. - * - * Failure: Negative (should not happen) - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jun 1 2004 - * + * Failure: Negative (should not happen) *------------------------------------------------------------------------- */ size_t @@ -648,21 +562,15 @@ H5F_rdcc_nbytes(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_rdcc_w0 + * Function: H5F_rdcc_w0 * - * Purpose: Replaced a macro to retrieve the raw data cache 'w0' value - * now that the generic properties are being used to store - * the values. + * Purpose: Replaced a macro to retrieve the raw data cache 'w0' value + * now that the generic properties are being used to store + * the values. * - * Return: Success: Non-negative, and the raw data cache 'w0' value + * Return: Success: Non-negative, and the raw data cache 'w0' value * is returned. - * - * Failure: Negative (should not happen) - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jun 2 2004 - * + * Failure: Negative (should not happen) *------------------------------------------------------------------------- */ double @@ -679,17 +587,13 @@ H5F_rdcc_w0(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_base_addr - * - * Purpose: Quick and dirty routine to retrieve the file's 'base_addr' value - * (Mainly added to stop non-file routines from poking about in the - * H5F_t data structure) - * - * Return: Non-negative on success/Negative on failure + * Function: H5F_get_base_addr * - * Programmer: Raymond Lu - * December 20, 2002 + * Purpose: Quick and dirty routine to retrieve the file's 'base_addr' value + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ haddr_t @@ -707,21 +611,15 @@ H5F_get_base_addr(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_grp_btree_shared + * Function: H5F_grp_btree_shared * - * Purpose: Replaced a macro to retrieve the shared B-tree node info - * now that the generic properties are being used to store - * the values. + * Purpose: Replaced a macro to retrieve the shared B-tree node info + * now that the generic properties are being used to store + * the values. * - * Return: Success: Non-void, and the shared B-tree node info + * Return: Success: Non-void, and the shared B-tree node info * is returned. - * - * Failure: void (should not happen) - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jul 5 2004 - * + * Failure: void (should not happen) *------------------------------------------------------------------------- */ H5UC_t * @@ -738,21 +636,15 @@ H5F_grp_btree_shared(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_sieve_buf_size + * Function: H5F_sieve_buf_size * - * Purpose: Replaced a macro to retrieve the dataset sieve buffer size - * now that the generic properties are being used to store - * the values. + * Purpose: Replaced a macro to retrieve the dataset sieve buffer size + * now that the generic properties are being used to store + * the values. * - * Return: Success: Non-void, and the dataset sieve buffer size + * Return: Success: Non-void, and the dataset sieve buffer size * is returned. - * - * Failure: void (should not happen) - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jul 8 2005 - * + * Failure: void (should not happen) *------------------------------------------------------------------------- */ size_t @@ -769,21 +661,15 @@ H5F_sieve_buf_size(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_gc_ref + * Function: H5F_gc_ref * - * Purpose: Replaced a macro to retrieve the "garbage collect - * references flag" now that the generic properties are being used - * to store the values. + * Purpose: Replaced a macro to retrieve the "garbage collect + * references flag" now that the generic properties are being used + * to store the values. * - * Return: Success: The "garbage collect references flag" + * Return: Success: The "garbage collect references flag" * is returned. - * - * Failure: (should not happen) - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jul 8 2005 - * + * Failure: (should not happen) *------------------------------------------------------------------------- */ unsigned @@ -800,18 +686,12 @@ H5F_gc_ref(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_use_latest_flags - * - * Purpose: Retrieve the 'latest version support' for the file. - * - * Return: Success: Non-negative, the requested 'version support' + * Function: H5F_use_latest_flags * - * Failure: (can't happen) - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Mar 5 2007 + * Purpose: Retrieve the 'latest version support' for the file. * + * Return: Success: Non-negative, the requested 'version support' + * Failure: (can't happen) *------------------------------------------------------------------------- */ unsigned @@ -828,18 +708,12 @@ H5F_use_latest_flags(const H5F_t *f, unsigned fl) /*------------------------------------------------------------------------- - * Function: H5F_get_fc_degree - * - * Purpose: Retrieve the 'file close degree' for the file. - * - * Return: Success: Non-negative, the 'file close degree' + * Function: H5F_get_fc_degree * - * Failure: (can't happen) - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Mar 5 2007 + * Purpose: Retrieve the 'file close degree' for the file. * + * Return: Success: Non-negative, the 'file close degree' + * Failure: (can't happen) *------------------------------------------------------------------------- */ H5F_close_degree_t @@ -864,10 +738,6 @@ H5F_get_fc_degree(const H5F_t *f) * Return: Success: Flag indicating whether the evict-on-close * property was set for the file. * Failure: (can't happen) - * - * Programmer: Dana Robinson - * Spring 2016 - * *------------------------------------------------------------------------- */ hbool_t @@ -884,18 +754,12 @@ H5F_get_evict_on_close(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_store_msg_crt_idx - * - * Purpose: Retrieve the 'store message creation index' flag for the file. + * Function: H5F_store_msg_crt_idx * - * Return: Success: Non-negative, the 'store message creation index' flag - * - * Failure: (can't happen) - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Mar 6 2007 + * Purpose: Retrieve the 'store message creation index' flag for the file. * + * Return: Success: Non-negative, the 'store message creation index' flag + * Failure: (can't happen) *------------------------------------------------------------------------- */ hbool_t @@ -912,17 +776,12 @@ H5F_store_msg_crt_idx(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_has_feature - * - * Purpose: Check if a file has a particular feature enabled + * Function: H5F_has_feature * - * Return: Success: Non-negative - TRUE or FALSE - * Failure: Negative (should not happen) - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * May 31 2004 + * Purpose: Check if a file has a particular feature enabled * + * Return: Success: Non-negative - TRUE or FALSE + * Failure: Negative (should not happen) *------------------------------------------------------------------------- */ hbool_t @@ -939,17 +798,13 @@ H5F_has_feature(const H5F_t *f, unsigned feature) /*------------------------------------------------------------------------- - * Function: H5F_get_driver_id - * - * Purpose: Quick and dirty routine to retrieve the file's 'driver_id' value - * (Mainly added to stop non-file routines from poking about in the - * H5F_t data structure) - * - * Return: 'driver_id' on success/abort on failure (shouldn't fail) + * Function: H5F_get_driver_id * - * Programmer: Quincey Koziol - * October 10, 2000 + * Purpose: Quick and dirty routine to retrieve the file's 'driver_id' value + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) * + * Return: 'driver_id' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ hid_t @@ -967,23 +822,19 @@ H5F_get_driver_id(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_fileno + * Function: H5F_get_fileno * - * Purpose: Quick and dirty routine to retrieve the file's 'fileno' value - * (Mainly added to stop non-file routines from poking about in the - * H5F_t data structure) - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * March 27, 2002 + * Purpose: Quick and dirty routine to retrieve the file's 'fileno' value + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t H5F_get_fileno(const H5F_t *f, unsigned long *filenum) { - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -994,7 +845,7 @@ H5F_get_fileno(const H5F_t *f, unsigned long *filenum) /* Retrieve the file's serial number */ if(H5FD_get_fileno(f->shared->lf, filenum) < 0) - HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, FAIL, "can't retrieve fileno") + HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, FAIL, "can't retrieve fileno") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1002,21 +853,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_get_eoa - * - * Purpose: Quick and dirty routine to retrieve the file's 'eoa' value + * Function: H5F_get_eoa * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * June 1, 2004 + * Purpose: Quick and dirty routine to retrieve the file's 'eoa' value * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ haddr_t H5F_get_eoa(const H5F_t *f, H5FD_mem_t type) { - haddr_t ret_value = HADDR_UNDEF; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) @@ -1025,7 +872,7 @@ H5F_get_eoa(const H5F_t *f, H5FD_mem_t type) /* Dispatch to driver */ if(HADDR_UNDEF == (ret_value = H5FD_get_eoa(f->shared->lf, type))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1040,10 +887,6 @@ done: * * Return: Success: Non-negative. * Failure: negative. - * - * Programmer: Raymond Lu - * Sep. 16, 2002 - * *------------------------------------------------------------------------- */ herr_t @@ -1067,18 +910,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_is_tmp_addr - * - * Purpose: Quick and dirty routine to determine if an address is in - * the 'temporary' file space. - * (Mainly added to stop non-file routines from poking about in the - * H5F_t data structure) + * Function: H5F_is_tmp_addr * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol - * June 11, 2009 + * Purpose: Quick and dirty routine to determine if an address is in + * the 'temporary' file space. + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) * + * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ hbool_t @@ -1095,18 +934,14 @@ H5F_is_tmp_addr(const H5F_t *f, haddr_t addr) /*------------------------------------------------------------------------- - * Function: H5F_use_tmp_space - * - * Purpose: Quick and dirty routine to determine if using temporary - * file space is allowed for this file. - * (Mainly added to stop non-file routines from poking about in the - * H5F_t data structure) - * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) + * Function: H5F_use_tmp_space * - * Programmer: Quincey Koziol - * July 1, 2009 + * Purpose: Quick and dirty routine to determine if using temporary + * file space is allowed for this file. + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) * + * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ hbool_t @@ -1124,17 +959,12 @@ H5F_use_tmp_space(const H5F_t *f) #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- - * Function: H5F_coll_md_read + * Function: H5F_coll_md_read * - * Purpose: Retrieve the 'collective metadata reads' flag for the file. - * - * Return: Success: Non-negative, the 'collective metadata reads' flag - * Failure: (can't happen) - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Feb 10 2016 + * Purpose: Retrieve the 'collective metadata reads' flag for the file. * + * Return: Success: Non-negative, the 'collective metadata reads' flag + * Failure: (can't happen) *------------------------------------------------------------------------- */ H5P_coll_md_read_flag_t @@ -1151,18 +981,14 @@ H5F_coll_md_read(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_use_mdc_logging - * - * Purpose: Quick and dirty routine to determine if using MDC logging - * is enabled for this file. - * (Mainly added to stop non-file routines from poking about in the - * H5F_t data structure) - * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) + * Function: H5F_use_mdc_logging * - * Programmer: Quincey Koziol - * June 5, 2016 + * Purpose: Quick and dirty routine to determine if using MDC logging + * is enabled for this file. + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) * + * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ hbool_t @@ -1179,18 +1005,14 @@ H5F_use_mdc_logging(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_start_mdc_log_on_access + * Function: H5F_start_mdc_log_on_access * - * Purpose: Quick and dirty routine to determine if we should start MDC - * logging on access for this file. - * (Mainly added to stop non-file routines from poking about in the - * H5F_t data structure) - * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol - * June 5, 2016 + * Purpose: Quick and dirty routine to determine if we should start MDC + * logging on access for this file. + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) * + * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ hbool_t @@ -1207,18 +1029,14 @@ H5F_start_mdc_log_on_access(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_mdc_log_location - * - * Purpose: Quick and dirty routine to retrieve the MDC log location - * for this file. - * (Mainly added to stop non-file routines from poking about in the - * H5F_t data structure) + * Function: H5F_mdc_log_location * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) - * - * Programmer: Quincey Koziol - * June 5, 2016 + * Purpose: Quick and dirty routine to retrieve the MDC log location + * for this file. + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) * + * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ char * @@ -1235,16 +1053,12 @@ H5F_mdc_log_location(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_alignment - * - * Purpose: Retrieve the 'alignment' for the file. - * - * Return: Success: Non-negative, the 'alignment' - * - * Failure: (can't happen) + * Function: H5F_get_alignment * - * Programmer: Vailin Choi; Dec 2012 + * Purpose: Retrieve the 'alignment' for the file. * + * Return: Success: Non-negative, the 'alignment' + * Failure: (can't happen) *------------------------------------------------------------------------- */ hsize_t @@ -1261,16 +1075,12 @@ H5F_get_alignment(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_threshold - * - * Purpose: Retrieve the 'threshold' for alignment in the file. - * - * Return: Success: Non-negative, the 'threshold' - * - * Failure: (can't happen) + * Function: H5F_get_threshold * - * Programmer: Vailin Choi; Dec 2012 + * Purpose: Retrieve the 'threshold' for alignment in the file. * + * Return: Success: Non-negative, the 'threshold' + * Failure: (can't happen) *------------------------------------------------------------------------- */ hsize_t @@ -1287,16 +1097,12 @@ H5F_get_threshold(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_pgend_meta_thres + * Function: H5F_get_pgend_meta_thres * - * Purpose: Retrieve the 'page end meta threshold size' for the file. - * - * Return: Success: Non-negative, the 'pgend_meta_thres' - * - * Failure: (can't happen) - * - * Programmer: Vailin Choi; Dec 2012 + * Purpose: Retrieve the 'page end meta threshold size' for the file. * + * Return: Success: Non-negative, the 'pgend_meta_thres' + * Failure: (can't happen) *------------------------------------------------------------------------- */ hsize_t @@ -1313,13 +1119,12 @@ H5F_get_pgend_meta_thres(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_point_of_no_return + * Function: H5F_get_point_of_no_return * - * Purpose: Retrieve the 'point of no return' value for the file. - * - * Return: Success: Non-negative, the 'point_of_no_return' - * Failure: (can't happen) + * Purpose: Retrieve the 'point of no return' value for the file. * + * Return: Success: Non-negative, the 'point_of_no_return' + * Failure: (can't happen) *------------------------------------------------------------------------- */ hbool_t @@ -1336,13 +1141,12 @@ H5F_get_point_of_no_return(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_first_alloc_dealloc - * - * Purpose: Retrieve the 'first alloc / dealloc' value for the file. + * Function: H5F_get_first_alloc_dealloc * - * Return: Success: Non-negative, the 'first_alloc_dealloc' - * Failure: (can't happen) + * Purpose: Retrieve the 'first alloc / dealloc' value for the file. * + * Return: Success: Non-negative, the 'first_alloc_dealloc' + * Failure: (can't happen) *------------------------------------------------------------------------- */ hbool_t @@ -1359,13 +1163,12 @@ H5F_get_first_alloc_dealloc(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_eoa_pre_fsm_fsalloc - * - * Purpose: Retrieve the 'EOA pre-FSM fsalloc' value for the file. + * Function: H5F_get_eoa_pre_fsm_fsalloc * - * Return: Success: Non-negative, the 'EOA pre-FSM fsalloc' - * Failure: (can't happen) + * Purpose: Retrieve the 'EOA pre-FSM fsalloc' value for the file. * + * Return: Success: Non-negative, the 'EOA pre-FSM fsalloc' + * Failure: (can't happen) *------------------------------------------------------------------------- */ hbool_t -- cgit v0.12 From 62124efa7e805bf34b54911e142f488a59867dd2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 8 Nov 2017 11:25:09 -0600 Subject: Remove tabs --- src/H5Pdapl.c | 278 +++++++++++++++++++++----------------------------------- src/H5Ppublic.h | 82 ++++++++--------- 2 files changed, 144 insertions(+), 216 deletions(-) diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 3b0a8c5..494de3e 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5Pdapl.c + * Created: H5Pdapl.c * October 27, 2008 * Neil Fortner * - * Purpose: Dataset access property list class routines + * Purpose: Dataset access property list class routines * *------------------------------------------------------------------------- */ @@ -32,13 +32,13 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* Files */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Ppkg.h" /* Property lists */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* Files */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Ppkg.h" /* Property lists */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -72,8 +72,8 @@ #define H5D_ACS_VDS_PRINTF_GAP_ENC H5P__encode_hsize_t #define H5D_ACS_VDS_PRINTF_GAP_DEC H5P__decode_hsize_t /* Definition for append flush */ -#define H5D_ACS_APPEND_FLUSH_SIZE sizeof(H5D_append_flush_t) -#define H5D_ACS_APPEND_FLUSH_DEF {0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},NULL,NULL} +#define H5D_ACS_APPEND_FLUSH_SIZE sizeof(H5D_append_flush_t) +#define H5D_ACS_APPEND_FLUSH_DEF {0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},NULL,NULL} /* Definitions for external file prefix */ #define H5D_ACS_EFILE_PREFIX_SIZE sizeof(char *) #define H5D_ACS_EFILE_PREFIX_DEF NULL /*default is no prefix */ @@ -130,21 +130,21 @@ static herr_t H5P__dapl_efile_pref_close(const char* name, size_t size, void* va /* Dataset access property list class library initialization object */ const H5P_libclass_t H5P_CLS_DACC[1] = {{ - "dataset access", /* Class name for debugging */ + "dataset access", /* Class name for debugging */ H5P_TYPE_DATASET_ACCESS, /* Class type */ - &H5P_CLS_LINK_ACCESS_g, /* Parent class */ - &H5P_CLS_DATASET_ACCESS_g, /* Pointer to class */ - &H5P_CLS_DATASET_ACCESS_ID_g, /* Pointer to class ID */ - &H5P_LST_DATASET_ACCESS_ID_g, /* Pointer to default property list ID */ - H5P__dacc_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 */ + &H5P_CLS_LINK_ACCESS_g, /* Parent class */ + &H5P_CLS_DATASET_ACCESS_g, /* Pointer to class */ + &H5P_CLS_DATASET_ACCESS_ID_g, /* Pointer to class ID */ + &H5P_LST_DATASET_ACCESS_ID_g, /* Pointer to default property list ID */ + H5P__dacc_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 */ }}; @@ -158,8 +158,8 @@ const H5P_libclass_t H5P_CLS_DACC[1] = {{ /*******************/ /* Property value defaults */ -static const H5D_append_flush_t H5D_def_append_flush_g = H5D_ACS_APPEND_FLUSH_DEF; /* Default setting for append flush */ -static const char *H5D_def_efile_prefix_g = H5D_ACS_EFILE_PREFIX_DEF; /* Default external file prefix string */ +static const H5D_append_flush_t H5D_def_append_flush_g = H5D_ACS_APPEND_FLUSH_DEF; /* Default setting for append flush */ +static const char *H5D_def_efile_prefix_g = H5D_ACS_EFILE_PREFIX_DEF; /* Default external file prefix string */ /*------------------------------------------------------------------------- @@ -169,9 +169,6 @@ static const char *H5D_def_efile_prefix_g = H5D_ACS_EFILE_PREFIX_DEF; /* Default * properties * * Return: Non-negative on success/Negative on failure - * - * Programmer: Neil Fortner - * October 27, 2008 *------------------------------------------------------------------------- */ static herr_t @@ -187,17 +184,17 @@ H5P__dacc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the size of raw data chunk cache (elements) */ - if(H5P_register_real(pclass, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5D_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &rdcc_nslots, + if(H5P_register_real(pclass, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5D_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &rdcc_nslots, NULL, NULL, NULL, H5D_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5D_ACS_DATA_CACHE_NUM_SLOTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache(bytes) */ - if(H5P_register_real(pclass, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5D_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &rdcc_nbytes, + if(H5P_register_real(pclass, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5D_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &rdcc_nbytes, NULL, NULL, NULL, H5D_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5D_ACS_DATA_CACHE_BYTE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the preemption for reading chunks */ - if(H5P_register_real(pclass, H5D_ACS_PREEMPT_READ_CHUNKS_NAME, H5D_ACS_PREEMPT_READ_CHUNKS_SIZE, &rdcc_w0, + if(H5P_register_real(pclass, H5D_ACS_PREEMPT_READ_CHUNKS_NAME, H5D_ACS_PREEMPT_READ_CHUNKS_SIZE, &rdcc_w0, NULL, NULL, NULL, H5D_ACS_PREEMPT_READ_CHUNKS_ENC, H5D_ACS_PREEMPT_READ_CHUNKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -215,12 +212,12 @@ H5P__dacc_reg_prop(H5P_genclass_t *pclass) /* Register info for append flush */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g, + if(H5P_register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for external file prefix */ - if(H5P_register_real(pclass, H5D_ACS_EFILE_PREFIX_NAME, H5D_ACS_EFILE_PREFIX_SIZE, &H5D_def_efile_prefix_g, + if(H5P_register_real(pclass, H5D_ACS_EFILE_PREFIX_NAME, H5D_ACS_EFILE_PREFIX_SIZE, &H5D_def_efile_prefix_g, NULL, H5D_ACS_EFILE_PREFIX_SET, H5D_ACS_EFILE_PREFIX_GET, H5D_ACS_EFILE_PREFIX_ENC, H5D_ACS_EFILE_PREFIX_DEC, H5D_ACS_EFILE_PREFIX_DEL, H5D_ACS_EFILE_PREFIX_COPY, H5D_ACS_EFILE_PREFIX_CMP, H5D_ACS_EFILE_PREFIX_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -237,7 +234,6 @@ done: * for a property list * * Return: SUCCEED/FAIL - * *------------------------------------------------------------------------- */ static herr_t @@ -263,7 +259,6 @@ H5P__dapl_efile_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED * from a property list * * Return: SUCCEED/FAIL - * *------------------------------------------------------------------------- */ static herr_t @@ -290,7 +285,6 @@ H5P__dapl_efile_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED * encoded. * * Return: SUCCEED/FAIL - * *------------------------------------------------------------------------- */ static herr_t @@ -341,8 +335,7 @@ H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size) * property in the dataset access property list is * decoded. * - * Return: SUCCEED/FAIL - * + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ static herr_t @@ -393,7 +386,6 @@ done: * Purpose: Frees memory used to store the external file prefix string * * Return: SUCCEED (Can't fail) - * *------------------------------------------------------------------------- */ static herr_t @@ -416,7 +408,6 @@ H5P__dapl_efile_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED * Purpose: Creates a copy of the external file prefix string * * Return: SUCCEED/FAIL - * *------------------------------------------------------------------------- */ static herr_t @@ -440,7 +431,6 @@ H5P__dapl_efile_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED * compared. * * Return: zero if VALUE1 and VALUE2 are equal, non zero otherwise. - * *------------------------------------------------------------------------- */ static int @@ -470,7 +460,6 @@ done: * Purpose: Frees memory used to store the external file prefix string * * Return: SUCCEED/FAIL - * *------------------------------------------------------------------------- */ static herr_t @@ -487,33 +476,27 @@ H5P__dapl_efile_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSE /*------------------------------------------------------------------------- - * Function: H5Pset_chunk_cache - * - * Purpose: Set the number of objects in the meta data cache and the - * maximum number of chunks and bytes in the raw data chunk cache. - * Once set, these values will override the values in the file access - * property list. Each of thhese values can be individually unset - * (or not set at all) by passing the macros: - * H5D_CHUNK_CACHE_NCHUNKS_DEFAULT, - * H5D_CHUNK_CACHE_NSLOTS_DEFAULT, and/or - * H5D_CHUNK_CACHE_W0_DEFAULT - * as appropriate. - * - * The RDCC_W0 value should be between 0 and 1 inclusive and - * indicates how much chunks that have been fully read or fully - * written are favored for preemption. A value of zero means - * fully read or written 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. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Neil Fortner - * Monday, October 27, 2008 - * - * Modifications: - * + * Function: H5Pset_chunk_cache + * + * Purpose: Set the number of objects in the meta data cache and the + * maximum number of chunks and bytes in the raw data chunk cache. + * Once set, these values will override the values in the file access + * property list. Each of thhese values can be individually unset + * (or not set at all) by passing the macros: + * H5D_CHUNK_CACHE_NCHUNKS_DEFAULT, + * H5D_CHUNK_CACHE_NSLOTS_DEFAULT, and/or + * H5D_CHUNK_CACHE_W0_DEFAULT + * as appropriate. + * + * The RDCC_W0 value should be between 0 and 1 inclusive and + * indicates how much chunks that have been fully read or fully + * written are favored for preemption. A value of zero means + * fully read or written 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. + * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -548,23 +531,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_chunk_cache - * - * Purpose: Retrieves the maximum possible number of elements in the meta - * data cache and the maximum possible number of elements and - * bytes and the RDCC_W0 value in the raw data chunk cache. Any - * (or all) arguments may be null pointers in which case the - * corresponding datum is not returned. If these properties have - * not been set on this property list, the default values for a - * file access property list are returned. - * - * Return: Non-negative on success/Negative on failure + * Function: H5Pget_chunk_cache * - * Programmer: Neil Fortner - * Monday, October 27, 2008 - * - * Modifications: + * Purpose: Retrieves the maximum possible number of elements in the meta + * data cache and the maximum possible number of elements and + * bytes and the RDCC_W0 value in the raw data chunk cache. Any + * (or all) arguments may be null pointers in which case the + * corresponding datum is not returned. If these properties have + * not been set on this property list, the default values for a + * file access property list are returned. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -625,10 +602,6 @@ done: * * Return: Success: Non-negative * Failure: Negative - * - * Programmer: Neil Fortner - * Wednesday, January 23, 2013 - * *------------------------------------------------------------------------- */ static herr_t @@ -684,10 +657,6 @@ H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) * * Return: Success: Non-negative * Failure: Negative - * - * Programmer: Neil Fortner - * Wednesday, January 23, 2013 - * *------------------------------------------------------------------------- */ static herr_t @@ -735,10 +704,6 @@ H5P__decode_chunk_cache_nslots(const void **_pp, void *_value) * * Return: Success: Non-negative * Failure: Negative - * - * Programmer: Neil Fortner - * Wednesday, January 23, 2013 - * *------------------------------------------------------------------------- */ static herr_t @@ -794,10 +759,6 @@ H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) * * Return: Success: Non-negative * Failure: Negative - * - * Programmer: Neil Fortner - * Wednesday, January 23, 2013 - * *------------------------------------------------------------------------- */ static herr_t @@ -849,10 +810,6 @@ H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value) * view defines the extent. * * Return: Non-negative on success/Negative on failure - * - * Programmer: Neil Fortner - * May 4, 2015 - * *------------------------------------------------------------------------- */ herr_t @@ -887,13 +844,9 @@ done: * Purpose: Takes the access property list for the virtual dataset, * dapl_id, and gets the flag, view, set by the * H5Pset_virtual_view call. The possible values of view are - * H5D_VDS_FIRST_MISSING or H5D_VDS_LAST_AVAIALBLE. + * H5D_VDS_FIRST_MISSING or H5D_VDS_LAST_AVAIALBLE. * * Return: Non-negative on success/Negative on failure - * - * Programmer: Neil Fortner - * May 4, 2015 - * *------------------------------------------------------------------------- */ herr_t @@ -927,10 +880,6 @@ done: * * Return: Success: Non-negative * Failure: Negative - * - * Programmer: Neil Fortner - * Tuesday, May 5, 2015 - * *------------------------------------------------------------------------- */ static herr_t @@ -964,10 +913,6 @@ H5P__dacc_vds_view_enc(const void *value, void **_pp, size_t *size) * * Return: Success: Non-negative * Failure: Negative - * - * Programmer: Neil Fortner - * Tuesday, May 5, 2015 - * *------------------------------------------------------------------------- */ static herr_t @@ -1011,10 +956,6 @@ H5P__dacc_vds_view_dec(const void **_pp, void *_value) * the VDS fill value setting. * * Return: Non-negative on success/Negative on failure - * - * Programmer: Neil Fortner - * May 21, 2015 - * *------------------------------------------------------------------------- */ herr_t @@ -1053,10 +994,6 @@ done: * value for gap_size is 0. * * Return: Non-negative on success/Negative on failure - * - * Programmer: Neil Fortner - * May 21, 2015 - * *------------------------------------------------------------------------- */ herr_t @@ -1083,30 +1020,27 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_append_flush - * - * Purpose: Sets the boundary, callback function, and user data in the - * property list. - * "ndims": number of array elements for boundary - * "boundary": used to determine whether the current dimension hits - * a boundary; if so, invoke the callback function and - * flush the dataset. - * "func": the callback function to invoke when the boundary is hit - * "udata": the user data to pass as parameter with the callback function - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi; Dec 2013 - * + * Function: H5Pset_append_flush + * + * Purpose: Sets the boundary, callback function, and user data in the + * property list. + * "ndims": number of array elements for boundary + * "boundary": used to determine whether the current dimension hits + * a boundary; if so, invoke the callback function and + * flush the dataset. + * "func": the callback function to invoke when the boundary is hit + * "udata": the user data to pass as parameter with the callback function + * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t *boundary, H5D_append_cb_t func, void *udata) { - H5P_genplist_t *plist; /* Property list pointer */ - H5D_append_flush_t info; /* Property for append flush parameters */ - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5D_append_flush_t info; /* Property for append flush parameters */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "iIu*hx*x", plist_id, ndims, boundary, func, udata); @@ -1123,7 +1057,7 @@ H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t *boundary, H5D * This is almost certainly an error as the user data will not be used. */ if(!func && udata) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback is NULL while user data is not") - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") @@ -1151,18 +1085,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_append_flush() - * - * Purpose: Retrieves the boundary, callback function and user data set in - * property list. - * Note that the # of boundary sizes to retrieve will not exceed - * the parameter "ndims" and the ndims set previously via - * H5Pset_append_flush(). - * - * Return: Non-negative on success/Negative on failure + * Function: H5Pget_append_flush() * - * Programmer: Vailin Choi; Dec 2013 + * Purpose: Retrieves the boundary, callback function and user data set in + * property list. + * Note that the # of boundary sizes to retrieve will not exceed + * the parameter "ndims" and the ndims set previously via + * H5Pset_append_flush(). * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1170,7 +1101,7 @@ H5Pget_append_flush(hid_t plist_id, unsigned ndims, hsize_t boundary[], H5D_appe { H5P_genplist_t *plist; /* property list pointer */ H5D_append_flush_t info; - unsigned u; /* local index variable */ + unsigned u; /* local index variable */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -1186,15 +1117,15 @@ H5Pget_append_flush(hid_t plist_id, unsigned ndims, hsize_t boundary[], H5D_appe /* Assign return values */ if(boundary) { - HDmemset(boundary, 0, ndims * sizeof(hsize_t)); - if(info.ndims > 0) - for(u = 0; u < info.ndims && u < ndims; u++) - boundary[u] = info.boundary[u]; + HDmemset(boundary, 0, ndims * sizeof(hsize_t)); + if(info.ndims > 0) + for(u = 0; u < info.ndims && u < ndims; u++) + boundary[u] = info.boundary[u]; } /* end if */ if(func) - *func = info.func; + *func = info.func; if(udata) - *udata = info.udata; + *udata = info.udata; done: FUNC_LEAVE_API(ret_value) @@ -1215,8 +1146,7 @@ done: * This property can be overwritten by the environment variable * HDF5_EXTFILE_PREFIX. * - * Return: Non-negative on success/Negative on failure - * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1242,24 +1172,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_efile_prefix - * - * Purpose: Gets the prefix to be used for any external files. - * - * If the pointer is not NULL, it points to a user-allocated - * buffer. + * Function: H5Pget_efile_prefix * - * Return: Non-negative on success/Negative on failure + * Purpose: Gets the prefix to be used for any external files. + * If the pointer is not NULL, it points to a user-allocated + * buffer. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ ssize_t H5Pget_efile_prefix(hid_t plist_id, char *prefix, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ - char *my_prefix; /* Library's copy of the prefix */ - size_t len; /* Length of prefix string */ - ssize_t ret_value; /* Return value */ + char *my_prefix; /* Library's copy of the prefix */ + size_t len; /* Length of prefix string */ + ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "i*sz", plist_id, prefix, size); diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 854b1ef..493a322 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -50,43 +50,43 @@ * The library's property list classes */ -#define H5P_ROOT (H5OPEN H5P_CLS_ROOT_ID_g) -#define H5P_OBJECT_CREATE (H5OPEN H5P_CLS_OBJECT_CREATE_ID_g) -#define H5P_FILE_CREATE (H5OPEN H5P_CLS_FILE_CREATE_ID_g) -#define H5P_FILE_ACCESS (H5OPEN H5P_CLS_FILE_ACCESS_ID_g) -#define H5P_DATASET_CREATE (H5OPEN H5P_CLS_DATASET_CREATE_ID_g) -#define H5P_DATASET_ACCESS (H5OPEN H5P_CLS_DATASET_ACCESS_ID_g) -#define H5P_DATASET_XFER (H5OPEN H5P_CLS_DATASET_XFER_ID_g) -#define H5P_FILE_MOUNT (H5OPEN H5P_CLS_FILE_MOUNT_ID_g) -#define H5P_GROUP_CREATE (H5OPEN H5P_CLS_GROUP_CREATE_ID_g) -#define H5P_GROUP_ACCESS (H5OPEN H5P_CLS_GROUP_ACCESS_ID_g) -#define H5P_DATATYPE_CREATE (H5OPEN H5P_CLS_DATATYPE_CREATE_ID_g) -#define H5P_DATATYPE_ACCESS (H5OPEN H5P_CLS_DATATYPE_ACCESS_ID_g) -#define H5P_STRING_CREATE (H5OPEN H5P_CLS_STRING_CREATE_ID_g) -#define H5P_ATTRIBUTE_CREATE (H5OPEN H5P_CLS_ATTRIBUTE_CREATE_ID_g) -#define H5P_ATTRIBUTE_ACCESS (H5OPEN H5P_CLS_ATTRIBUTE_ACCESS_ID_g) -#define H5P_OBJECT_COPY (H5OPEN H5P_CLS_OBJECT_COPY_ID_g) -#define H5P_LINK_CREATE (H5OPEN H5P_CLS_LINK_CREATE_ID_g) -#define H5P_LINK_ACCESS (H5OPEN H5P_CLS_LINK_ACCESS_ID_g) +#define H5P_ROOT (H5OPEN H5P_CLS_ROOT_ID_g) +#define H5P_OBJECT_CREATE (H5OPEN H5P_CLS_OBJECT_CREATE_ID_g) +#define H5P_FILE_CREATE (H5OPEN H5P_CLS_FILE_CREATE_ID_g) +#define H5P_FILE_ACCESS (H5OPEN H5P_CLS_FILE_ACCESS_ID_g) +#define H5P_DATASET_CREATE (H5OPEN H5P_CLS_DATASET_CREATE_ID_g) +#define H5P_DATASET_ACCESS (H5OPEN H5P_CLS_DATASET_ACCESS_ID_g) +#define H5P_DATASET_XFER (H5OPEN H5P_CLS_DATASET_XFER_ID_g) +#define H5P_FILE_MOUNT (H5OPEN H5P_CLS_FILE_MOUNT_ID_g) +#define H5P_GROUP_CREATE (H5OPEN H5P_CLS_GROUP_CREATE_ID_g) +#define H5P_GROUP_ACCESS (H5OPEN H5P_CLS_GROUP_ACCESS_ID_g) +#define H5P_DATATYPE_CREATE (H5OPEN H5P_CLS_DATATYPE_CREATE_ID_g) +#define H5P_DATATYPE_ACCESS (H5OPEN H5P_CLS_DATATYPE_ACCESS_ID_g) +#define H5P_STRING_CREATE (H5OPEN H5P_CLS_STRING_CREATE_ID_g) +#define H5P_ATTRIBUTE_CREATE (H5OPEN H5P_CLS_ATTRIBUTE_CREATE_ID_g) +#define H5P_ATTRIBUTE_ACCESS (H5OPEN H5P_CLS_ATTRIBUTE_ACCESS_ID_g) +#define H5P_OBJECT_COPY (H5OPEN H5P_CLS_OBJECT_COPY_ID_g) +#define H5P_LINK_CREATE (H5OPEN H5P_CLS_LINK_CREATE_ID_g) +#define H5P_LINK_ACCESS (H5OPEN H5P_CLS_LINK_ACCESS_ID_g) /* * The library's default property lists */ -#define H5P_FILE_CREATE_DEFAULT (H5OPEN H5P_LST_FILE_CREATE_ID_g) -#define H5P_FILE_ACCESS_DEFAULT (H5OPEN H5P_LST_FILE_ACCESS_ID_g) -#define H5P_DATASET_CREATE_DEFAULT (H5OPEN H5P_LST_DATASET_CREATE_ID_g) -#define H5P_DATASET_ACCESS_DEFAULT (H5OPEN H5P_LST_DATASET_ACCESS_ID_g) -#define H5P_DATASET_XFER_DEFAULT (H5OPEN H5P_LST_DATASET_XFER_ID_g) -#define H5P_FILE_MOUNT_DEFAULT (H5OPEN H5P_LST_FILE_MOUNT_ID_g) -#define H5P_GROUP_CREATE_DEFAULT (H5OPEN H5P_LST_GROUP_CREATE_ID_g) -#define H5P_GROUP_ACCESS_DEFAULT (H5OPEN H5P_LST_GROUP_ACCESS_ID_g) -#define H5P_DATATYPE_CREATE_DEFAULT (H5OPEN H5P_LST_DATATYPE_CREATE_ID_g) -#define H5P_DATATYPE_ACCESS_DEFAULT (H5OPEN H5P_LST_DATATYPE_ACCESS_ID_g) -#define H5P_ATTRIBUTE_CREATE_DEFAULT (H5OPEN H5P_LST_ATTRIBUTE_CREATE_ID_g) -#define H5P_ATTRIBUTE_ACCESS_DEFAULT (H5OPEN H5P_LST_ATTRIBUTE_ACCESS_ID_g) -#define H5P_OBJECT_COPY_DEFAULT (H5OPEN H5P_LST_OBJECT_COPY_ID_g) -#define H5P_LINK_CREATE_DEFAULT (H5OPEN H5P_LST_LINK_CREATE_ID_g) -#define H5P_LINK_ACCESS_DEFAULT (H5OPEN H5P_LST_LINK_ACCESS_ID_g) +#define H5P_FILE_CREATE_DEFAULT (H5OPEN H5P_LST_FILE_CREATE_ID_g) +#define H5P_FILE_ACCESS_DEFAULT (H5OPEN H5P_LST_FILE_ACCESS_ID_g) +#define H5P_DATASET_CREATE_DEFAULT (H5OPEN H5P_LST_DATASET_CREATE_ID_g) +#define H5P_DATASET_ACCESS_DEFAULT (H5OPEN H5P_LST_DATASET_ACCESS_ID_g) +#define H5P_DATASET_XFER_DEFAULT (H5OPEN H5P_LST_DATASET_XFER_ID_g) +#define H5P_FILE_MOUNT_DEFAULT (H5OPEN H5P_LST_FILE_MOUNT_ID_g) +#define H5P_GROUP_CREATE_DEFAULT (H5OPEN H5P_LST_GROUP_CREATE_ID_g) +#define H5P_GROUP_ACCESS_DEFAULT (H5OPEN H5P_LST_GROUP_ACCESS_ID_g) +#define H5P_DATATYPE_CREATE_DEFAULT (H5OPEN H5P_LST_DATATYPE_CREATE_ID_g) +#define H5P_DATATYPE_ACCESS_DEFAULT (H5OPEN H5P_LST_DATATYPE_ACCESS_ID_g) +#define H5P_ATTRIBUTE_CREATE_DEFAULT (H5OPEN H5P_LST_ATTRIBUTE_CREATE_ID_g) +#define H5P_ATTRIBUTE_ACCESS_DEFAULT (H5OPEN H5P_LST_ATTRIBUTE_ACCESS_ID_g) +#define H5P_OBJECT_COPY_DEFAULT (H5OPEN H5P_LST_OBJECT_COPY_ID_g) +#define H5P_LINK_CREATE_DEFAULT (H5OPEN H5P_LST_LINK_CREATE_ID_g) +#define H5P_LINK_ACCESS_DEFAULT (H5OPEN H5P_LST_LINK_ACCESS_ID_g) /* Common creation order flags (for links in groups and attributes on objects) */ #define H5P_CRT_ORDER_TRACKED 0x0001 @@ -140,9 +140,9 @@ typedef enum H5D_mpio_actual_chunk_opt_mode_t { typedef enum H5D_mpio_actual_io_mode_t { /* The following four values are conveniently defined as a bit field so that * we can switch from the default to indpendent or collective and then to - * mixed without having to check the original value. - * - * NO_COLLECTIVE means that either collective I/O wasn't requested or that + * mixed without having to check the original value. + * + * NO_COLLECTIVE means that either collective I/O wasn't requested or that * no I/O took place. * * CHUNK_INDEPENDENT means that collective I/O was requested, but the @@ -155,7 +155,7 @@ typedef enum H5D_mpio_actual_io_mode_t { /* The contiguous case is separate from the bit field. */ H5D_MPIO_CONTIGUOUS_COLLECTIVE = 0x4 -} H5D_mpio_actual_io_mode_t; +} H5D_mpio_actual_io_mode_t; /* Broken collective IO property */ typedef enum H5D_mpio_no_collective_cause_t { @@ -326,7 +326,7 @@ H5_DLL herr_t H5Pget_cache(hid_t plist_id, H5_DLL herr_t H5Pset_mdc_config(hid_t plist_id, H5AC_cache_config_t * config_ptr); H5_DLL herr_t H5Pget_mdc_config(hid_t plist_id, - H5AC_cache_config_t * config_ptr); /* out */ + H5AC_cache_config_t * config_ptr); /* out */ H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref); H5_DLL herr_t H5Pget_gc_references(hid_t fapl_id, unsigned *gc_ref/*out*/); H5_DLL herr_t H5Pset_fclose_degree(hid_t fapl_id, H5F_close_degree_t degree); @@ -402,12 +402,12 @@ H5_DLL herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/); H5_DLL herr_t H5Pfill_value_defined(hid_t plist, H5D_fill_value_t *status); H5_DLL herr_t H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t - alloc_time); + alloc_time); H5_DLL herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t - *alloc_time/*out*/); + *alloc_time/*out*/); H5_DLL herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time); H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t - *fill_time/*out*/); + *fill_time/*out*/); /* Dataset access property list (DAPL) routines */ H5_DLL herr_t H5Pset_chunk_cache(hid_t dapl_id, size_t rdcc_nslots, -- cgit v0.12 From 00ade113c5fe7d48571a36091970328dcca68f50 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 8 Nov 2017 17:52:44 -0800 Subject: Plugin test rework Cleanup of plugin test code. Renames many files. Prep for VOL branch merge. --- MANIFEST | 12 +- configure.ac | 8 +- test/CMakeLists.txt | 92 +-- test/CMakeTests.cmake | 12 +- test/Makefile.am | 49 +- test/dynlib1.c | 95 --- test/dynlib2.c | 92 --- test/dynlib3.c | 103 --- test/dynlib4.c | 102 --- test/filter_plugin.c | 1511 +++++++++++++++++++++++++++++++++++++++ test/filter_plugin1_dsets.c | 93 +++ test/filter_plugin2_dsets.c | 88 +++ test/filter_plugin3_dsets.c | 119 +++ test/filter_plugin4_groups.c | 106 +++ test/plugin.c | 1217 ------------------------------- test/test_filter_plugin.sh.in | 113 +++ test/test_plugin.sh.in | 113 --- tools/test/h5diff/Makefile.am | 3 - tools/test/h5dump/Makefile.am | 3 - tools/test/h5ls/Makefile.am | 3 - tools/test/h5repack/Makefile.am | 5 - 21 files changed, 2111 insertions(+), 1828 deletions(-) delete mode 100644 test/dynlib1.c delete mode 100644 test/dynlib2.c delete mode 100644 test/dynlib3.c delete mode 100644 test/dynlib4.c create mode 100644 test/filter_plugin.c create mode 100644 test/filter_plugin1_dsets.c create mode 100644 test/filter_plugin2_dsets.c create mode 100644 test/filter_plugin3_dsets.c create mode 100644 test/filter_plugin4_groups.c delete mode 100644 test/plugin.c create mode 100644 test/test_filter_plugin.sh.in delete mode 100644 test/test_plugin.sh.in diff --git a/MANIFEST b/MANIFEST index 4270479..230bf1f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -936,10 +936,6 @@ ./test/dt_arith.c ./test/dtypes.c ./test/dtransform.c -./test/dynlib1.c -./test/dynlib2.c -./test/dynlib3.c -./test/dynlib4.c ./test/earray.c ./test/efc.c ./test/enc_dec_plist.c @@ -967,6 +963,11 @@ ./test/fill_old.h5 ./test/fillval.c ./test/filter_fail.c +./test/filter_plugin.c +./test/filter_plugin1_dsets.c +./test/filter_plugin2_dsets.c +./test/filter_plugin3_dsets.c +./test/filter_plugin4_groups.c ./test/flush1.c ./test/flush2.c ./test/flushrefresh.c @@ -1030,7 +1031,6 @@ ./test/page_buffer.c ./test/paged_nopersist.h5 ./test/paged_persist.h5 -./test/plugin.c ./test/reserved.c ./test/pool.c ./test/set_extent.c @@ -1065,12 +1065,12 @@ ./test/testerror.sh.in ./test/testlinks_env.sh.in ./test/test_filenotclosed.sh.in +./test/test_filter_plugin.sh.in ./test/testflushrefresh.sh.in ./test/testframe.c ./test/testhdf5.c ./test/testhdf5.h ./test/testlibinfo.sh.in -./test/test_plugin.sh.in ./test/test_usecases.sh.in ./test/testmeta.c ./test/testswmr.sh.in diff --git a/configure.ac b/configure.ac index 3dbd95c..d8f3873 100644 --- a/configure.ac +++ b/configure.ac @@ -3369,17 +3369,17 @@ AC_CONFIG_FILES([src/libhdf5.settings Makefile src/Makefile test/Makefile + test/H5srcdir_str.h test/testcheck_version.sh test/testerror.sh test/testflushrefresh.sh - 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 test/testvdsswmr.sh + test/test_filenotclosed.sh + test/test_filter_plugin.sh + test/test_usecases.sh testpar/Makefile tools/Makefile tools/lib/Makefile diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8522c1d..0a2afbf 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -70,73 +70,73 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- -# If plugin library tests can be tested +# If filter plugin tests can be tested #----------------------------------------------------------------------------- # make plugins dir - file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir1") - file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir2") + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir1") + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir2") #----------------------------------------------------------------------------- - # Define Plugin Test Sources + # Define Filter Plugin Test Sources #----------------------------------------------------------------------------- - set (TEST_PLUGIN_LIBS - dynlib1 - dynlib3 + set (FILTER_PLUGINS_FOR_DIR1 + filter_plugin1_dsets + filter_plugin3_dsets ) - set (TEST2_PLUGIN_LIBS - dynlib2 - dynlib4 + set (FILTER_PLUGINS_FOR_DIR2 + filter_plugin2_dsets + filter_plugin4_groups ) - foreach (test_lib ${TEST_PLUGIN_LIBS}) - set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") - set (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") - set (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + foreach (plugin_name ${FILTER_PLUGINS_FOR_DIR1}) + set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}") + set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}") + set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) add_definitions (${HDF_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) - TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) - set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) + TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") + target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder + # Copy the filter plugin to a plugins folder #----------------------------------------------------------------------------- add_custom_command ( - TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} + TARGET ${HDF5_TEST_PLUGIN_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different - "$" - "${CMAKE_BINARY_DIR}/testdir1/$" + "$" + "${CMAKE_BINARY_DIR}/filter_plugin_dir1/$" ) endforeach () - foreach (test_lib ${TEST2_PLUGIN_LIBS}) - set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") - set (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") - set (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + foreach ( plugin_name ${FILTER_PLUGINS_FOR_DIR2}) + set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}") + set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}") + set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) add_definitions (${HDF_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) - TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) - set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) + TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") + target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder + # Copy the filter plugin to a plugins folder #----------------------------------------------------------------------------- add_custom_command ( - TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} + TARGET ${HDF5_TEST_PLUGIN_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different - "$" - "${CMAKE_BINARY_DIR}/testdir2/$" + "$" + "${CMAKE_BINARY_DIR}/filter_plugin_dir2/$" ) endforeach () @@ -411,17 +411,17 @@ endif () ### P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) - add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) - TARGET_NAMING (plugin SHARED) - TARGET_C_PROPERTIES (plugin SHARED " " " ") - target_link_libraries (plugin ${HDF5_TEST_LIB_TARGET}) - set_target_properties (plugin PROPERTIES FOLDER test) + add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) + TARGET_NAMING (filter_plugin SHARED) + TARGET_C_PROPERTIES (filter_plugin SHARED " " " ") + target_link_libraries (filter_plugin ${HDF5_TEST_LIB_TARGET}) + set_target_properties (filter_plugin PROPERTIES FOLDER test) 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) + add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) + TARGET_NAMING (filter_plugin STATIC) + TARGET_C_PROPERTIES (filter_plugin STATIC " " " ") + target_link_libraries (filter_plugin ${HDF5_TEST_LIB_TARGET}) + set_target_properties (filter_plugin PROPERTIES FOLDER test) endif () ############################################################################## diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 61ac3d2..973d389 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1,4 +1,4 @@ -# + # Copyright by The HDF Group. # All rights reserved. # @@ -520,7 +520,7 @@ set (test_CLEANFILES multi_file-r.h5 multi_file-s.h5 core_file - plugin.h5 + filter_plugin.h5 new_move_a.h5 new_move_b.h5 ntypes.h5 @@ -1013,7 +1013,7 @@ if (BUILD_SHARED_LIBS) endif () ############################################################################## -### P L U G I N T E S T S +### F I L T E R P L U G I N T E S T S ############################################################################## if (WIN32) set (CMAKE_SEP "\;") @@ -1023,9 +1023,9 @@ else () set (BIN_REL_PATH "../") endif () -add_test (NAME H5PLUGIN-plugin COMMAND $) -set_tests_properties (H5PLUGIN-plugin PROPERTIES - ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/testdir2;srcdir=${HDF5_TEST_BINARY_DIR}" +add_test (NAME H5PLUGIN-filter_plugin COMMAND $) +set_tests_properties (H5PLUGIN-filter_plugin PROPERTIES + ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/filter_plugin_dir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/filter_plugin_dir2;srcdir=${HDF5_TEST_BINARY_DIR}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} ) diff --git a/test/Makefile.am b/test/Makefile.am index ba2d79b..4f192ac 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -26,11 +26,12 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src # testlibinfo.sh: # testcheck_version.sh: tcheck_version # 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_filenotclosed.sh: filenotclosed.c +# test_filter_plugin.sh: filter_plugin.c +# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes 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) test_filenotclosed$(EXEEXT) \ @@ -40,8 +41,8 @@ SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) test_ 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) + TEST_SCRIPT += test_filter_plugin.sh + SCRIPT_DEPEND += filter_plugin$(EXEEXT) endif check_SCRIPTS = $(TEST_SCRIPT) @@ -81,7 +82,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ 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 + check_PROGRAMS+= filter_plugin endif # These programs generate test files for the tests. They don't need to be @@ -102,29 +103,17 @@ endif 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 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 -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) - $(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) + # The filter_plugin* libraries are for use in filter_plugin.c. + # Build them as shared libraries if that option was enabled in configure. + noinst_LTLIBRARIES=libh5test.la libfilter_plugin1_dsets.la libfilter_plugin2_dsets.la libfilter_plugin3_dsets.la libfilter_plugin4_groups.la + libfilter_plugin1_dsets_la_SOURCES=filter_plugin1_dsets.c + libfilter_plugin2_dsets_la_SOURCES=filter_plugin2_dsets.c + libfilter_plugin3_dsets_la_SOURCES=filter_plugin3_dsets.c + libfilter_plugin4_groups_la_SOURCES=filter_plugin4_groups.c + libfilter_plugin1_dsets_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libfilter_plugin2_dsets_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libfilter_plugin3_dsets_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libfilter_plugin4_groups_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere else # The libh5test library provides common support code for the tests. noinst_LTLIBRARIES=libh5test.la @@ -185,7 +174,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse tmisc[0-9]*.h5 set_extent[1-5].h5 ext[12].bin \ getname.h5 getname[1-3].h5 sec2_file.h5 direct_file.h5 \ family_file000[0-3][0-9].h5 new_family_v16_000[0-3][0-9].h5 \ - multi_file-[rs].h5 core_file plugin.h5 \ + multi_file-[rs].h5 core_file filter_plugin.h5 \ new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 err_compat.h5 \ dtransform.h5 test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ unlink_chunked.h5 btree2.h5 btree2_tmp.h5 objcopy_src.h5 objcopy_dst.h5 \ @@ -215,7 +204,7 @@ 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 \ +DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_filter_plugin.sh \ testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh test_filenotclosed.sh include $(top_srcdir)/config/conclude.am diff --git a/test/dynlib1.c b/test/dynlib1.c deleted file mode 100644 index e9137fb..0000000 --- a/test/dynlib1.c +++ /dev/null @@ -1,95 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * 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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Raymond Lu - * 13 February 2013 - * - * Purpose: Tests the plugin module (H5PL) - */ - -#include -#include -#include "H5PLextern.h" - -#define H5Z_FILTER_DYNLIB1 257 - -static size_t H5Z_filter_dynlib1(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_DYNLIB1[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB1, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlib1", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */ -}}; - -H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} -const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB1;} - -/*------------------------------------------------------------------------- - * Function: H5Z_filter_dynlib1 - * - * Purpose: A dynlib1 filter method that adds on and subtract from - * the original value with another value. 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 - * - * Programmer: Raymond Lu - * 29 March 2013 - * - *------------------------------------------------------------------------- - */ -static size_t -H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, - size_t *buf_size, void **buf) -{ - int *int_ptr = (int *)*buf; /* Pointer to the data values */ - size_t buf_left = *buf_size; /* Amount of data buffer left to process */ - int add_on = 0; - - /* Check for the correct number of parameters */ - if(cd_nelmts == 0) - return(0); - - /* Check that permanent parameters are set correctly */ - if(cd_values[0] > 9) - return(0); - - add_on = (int)cd_values[0]; - - if(flags & H5Z_FLAG_REVERSE) { /*read*/ - /* Substract the "add on" value to all the data values */ - while(buf_left > 0) { - *int_ptr++ -= add_on; - buf_left -= sizeof(int); - } /* end while */ - } /* end if */ - else { /*write*/ - /* Add the "add on" value to all the data values */ - while(buf_left > 0) { - *int_ptr++ += add_on; - buf_left -= sizeof(int); - } /* end while */ - } /* end else */ - - return nbytes; -} /* end H5Z_filter_dynlib1() */ - diff --git a/test/dynlib2.c b/test/dynlib2.c deleted file mode 100644 index 2574d4d..0000000 --- a/test/dynlib2.c +++ /dev/null @@ -1,92 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * 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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Raymond Lu - * 13 February 2013 - * - * Purpose: Tests the plugin module (H5PL) - */ - -#include -#include -#include "H5PLextern.h" - -#define H5Z_FILTER_DYNLIB2 258 -#define MULTIPLIER 3 - -static size_t H5Z_filter_dynlib2(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_DYNLIB2[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB2, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlib2", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ -}}; - -H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} -const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB2;} - -/*------------------------------------------------------------------------- - * Function: H5Z_filter_dynlib2 - * - * 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 - * - * Programmer: Raymond Lu - * 29 March 2013 - * - *------------------------------------------------------------------------- - */ -static size_t -H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, - size_t *buf_size, void **buf) -{ - int *int_ptr = (int *)*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*/ - /* Divide the original value with MULTIPLIER */ - while(buf_left > 0) { - *int_ptr++ /= MULTIPLIER; - buf_left -= sizeof(int); - } /* end while */ - } /* end if */ - else { /*write*/ - /* Multiply the original value with MULTIPLIER */ - while(buf_left > 0) { - *int_ptr++ *= MULTIPLIER; - buf_left -= sizeof(int); - } /* end while */ - } /* end else */ - - return nbytes; -} /* end H5Z_filter_dynlib2() */ - diff --git a/test/dynlib3.c b/test/dynlib3.c deleted file mode 100644 index 8871321..0000000 --- a/test/dynlib3.c +++ /dev/null @@ -1,103 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * 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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Raymond Lu - * 1 April 2013 - * - * Purpose: Tests the plugin module (H5PL) - */ - -#include -#include -#include -#include "H5PLextern.h" - -#define H5Z_FILTER_DYNLIB3 259 -#define SUFFIX_LEN 8 -#define GROUP_SUFFIX ".h5group" - -static size_t H5Z_filter_dynlib3(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_DYNLIB3[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB3, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlib3", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlib3, /* The actual filter function */ -}}; - -H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} -const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB3;} - -/*------------------------------------------------------------------------- - * Function: H5Z_filter_dynlib3 - * - * Purpose: A dynlib3 filter method that is used to test groups. It - * appends the suffix ".h5group" to each group name during - * write and takes it out during read. - * - * Return: Success: Data chunk size - * - * Failure: 0 - * - * Programmer: Raymond Lu - * 1 April 2013 - * - *------------------------------------------------------------------------- - */ -static size_t -H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, - size_t *buf_size, void **buf) -{ - size_t ret_value; /* Return value */ - - /* 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*/ - ret_value = *buf_size = nbytes - SUFFIX_LEN; - } /* end if */ - else { /*write*/ - void *outbuf = NULL; /* Pointer to new buffer */ - unsigned char *dst; /* Temporary pointer to destination buffer */ - - dst = (unsigned char *)(outbuf = H5allocate_memory(nbytes + SUFFIX_LEN, 0)); - - /* Copy raw data */ - memcpy((void*)dst, (void*)(*buf), nbytes); - - /* Append suffix to raw data for storage */ - dst += nbytes; - memcpy(dst, (void*)GROUP_SUFFIX, SUFFIX_LEN); - - /* Free input buffer */ - H5free_memory(*buf); - - /* Set return values */ - *buf_size = nbytes + SUFFIX_LEN; - *buf = outbuf; - outbuf = NULL; - ret_value = *buf_size; - } /* end else */ - - return ret_value; -} /* H5Z_filter_dynlib3() */ - diff --git a/test/dynlib4.c b/test/dynlib4.c deleted file mode 100644 index 06d90ff..0000000 --- a/test/dynlib4.c +++ /dev/null @@ -1,102 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * 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_DYNLIB4 260 - -#define PUSH_ERR(func, minor, str) H5Epush2(H5E_DEFAULT, __FILE__, func, __LINE__, H5E_ERR_CLS, H5E_PLUGIN, minor, str) - -static size_t H5Z_filter_dynlib4(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_DYNLIB4[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB4, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlib4", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlib4, /* The actual filter function */ -}}; - -H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} -const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB4;} - -/*------------------------------------------------------------------------- - * Function: H5Z_filter_dynlib4 - * - * Purpose: A dynlib4 filter method that adds on and subtract from - * the original value with another value. It will be built - * as a shared library. plugin.c test will load and use - * this filter library. Designed to call a HDF function. - * - * Return: Success: Data chunk size - * - * Failure: 0 - * - *------------------------------------------------------------------------- - */ -static size_t -H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, - size_t *buf_size, void **buf) -{ - int *int_ptr = (int *)*buf; /* Pointer to the data values */ - size_t buf_left = *buf_size; /* Amount of data buffer left to process */ - int add_on = 0; - unsigned ver_info[3]; - - /* Check for the library version */ - if(H5get_libversion(&ver_info[0], &ver_info[1], &ver_info[2]) < 0) { - PUSH_ERR("dynlib4", H5E_CALLBACK, "H5get_libversion"); - return(0); - } - /* Check for the correct number of parameters */ - if(cd_nelmts == 0) - return(0); - - /* Check that permanent parameters are set correctly */ - if(cd_values[0] > 9) - return(0); - - if(ver_info[0] != cd_values[1] || ver_info[1] != cd_values[2]) { - PUSH_ERR("dynlib4", H5E_CALLBACK, "H5get_libversion does not match"); - return(0); - } - - add_on = (int)cd_values[0]; - - if(flags & H5Z_FLAG_REVERSE) { /*read*/ - /* Substract the "add on" value to all the data values */ - while(buf_left > 0) { - *int_ptr++ -= add_on; - buf_left -= sizeof(int); - } /* end while */ - } /* end if */ - else { /*write*/ - /* Add the "add on" value to all the data values */ - while(buf_left > 0) { - *int_ptr++ += add_on; - buf_left -= sizeof(int); - } /* end while */ - } /* end else */ - - return nbytes; -} /* end H5Z_filter_dynlib4() */ - diff --git a/test/filter_plugin.c b/test/filter_plugin.c new file mode 100644 index 0000000..8b7e0e4 --- /dev/null +++ b/test/filter_plugin.c @@ -0,0 +1,1511 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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 "h5test.h" +#include "H5srcdir.h" + +/* + * This file needs to access private datatypes from the H5Z and H5PL package. + */ +#define H5PL_FRIEND +#include "H5PLpkg.h" +#define H5Z_FRIEND +#include "H5Zpkg.h" + +/* Filters IDs for test filter plugins */ +#define FILTER1_ID 257 +#define FILTER2_ID 258 +#define FILTER3_ID 259 +#define FILTER4_ID 260 + +const char *FILENAME[] = { + "filter_plugin", + NULL +}; +#define FILENAME_BUF_SIZE 1024 + +/* Dataset names */ +#define DSET_DEFLATE_NAME "deflate dset" +#define DSET_FILTER1_NAME "filter 1 dset" +#define DSET_FILTER2_NAME "filter 2 dset" +#define DSET_FILTER3_NAME "filter 3 dset" + +/* Array sizes used throughout the test */ +#define DSET_DIM1 100 +#define DSET_DIM2 200 +#define CHUNK_DIM1 2 +#define CHUNK_DIM2 25 +#define HYPERSLAB_OFFSET1 7 +#define HYPERSLAB_OFFSET2 30 +#define HYPERSLAB_SIZE1 4 +#define HYPERSLAB_SIZE2 50 + +/* Global size arrays */ +const hsize_t sizes_g[2] = {DSET_DIM1, DSET_DIM2}; /* Dataset dimensions */ +const hsize_t hs_sizes_g[2] = {HYPERSLAB_SIZE1, HYPERSLAB_SIZE2}; /* Hyperslab sizes */ +const hsize_t hs_offsets_g[2] = {HYPERSLAB_OFFSET1, HYPERSLAB_OFFSET2}; /* Hyperslab offsets */ +const hsize_t chunk_sizes_g[2] = {CHUNK_DIM1, CHUNK_DIM2}; /* Chunk dimensions */ + +/* Limit random number within 20000 */ +#define RANDOM_LIMIT 20000 + +/* Things used in the groups + filter plugins test */ +#define N_SUBGROUPS 1000 +#define SUBGROUP_PREFIX "subgroup_" +#define TOP_LEVEL_GROUP_NAME "top-level group" + +/* Global arrays in which to save data */ +int **orig_deflate_g = NULL; +int **orig_dynlib1_g = NULL; +int **orig_dynlib2_g = NULL; +int **orig_dynlib4_g = NULL; + + + +/*------------------------------------------------------------------------- + * Function: free_2D_array + * + * Purpose: Free up a dynamic 2D pseudo array and set the pointer to NULL + * Designed to be callable in error conditions so NULLs are okay + * + * Return: SUCCEED (always) + * + *------------------------------------------------------------------------- + */ +static herr_t +free_2D_array(int ***arr) { + + if (arr && *arr && (*arr)[0]) + HDfree((*arr)[0]); + if (arr && *arr) + HDfree(*arr); + *arr = NULL; + + return SUCCEED; +} /* end free_2D_array() */ + + +/*------------------------------------------------------------------------- + * Function: allocate_and_init_2D_array + * + * Purpose: Initialize an array as a pseudo 2D array and copy in some + * initial values. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +allocate_and_init_2D_array(int ***arr, const hsize_t *sizes, int **initial_values) { + + size_t r, c; /* Data rows and columns */ + size_t i; /* Iterator */ + size_t n_bytes; /* # of bytes to copy */ + + r = (size_t)sizes[0]; + c = (size_t)sizes[1]; + + /* Allocate and set up pseudo-2D array */ + if (NULL == (*arr = (int **)HDcalloc(r, sizeof(int *)))) + TEST_ERROR; + if (NULL == ((*arr)[0] = (int *)HDcalloc(r * c, sizeof(int)))) + TEST_ERROR; + for (i = 0; i < r; i++) + (*arr)[i] = (**arr + c * i); + + /* Copy over the data elements */ + if (initial_values) { + n_bytes = r * c * sizeof(int); + HDmemcpy((*arr)[0], initial_values[0], n_bytes); + } + + return SUCCEED; +error: + free_2D_array(arr); + + return FAIL; +} /* end allocate_and_init_2D_array() */ + + +/*------------------------------------------------------------------------- + * Function: compare_2D_arrays + * + * Purpose: Compare two pseudo 2D arrays + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +compare_2D_arrays(int **dset1, int **dset2, const hsize_t *sizes, /*OUT*/ hbool_t *are_same) { + hsize_t i, j; /* index variables */ + + *are_same = TRUE; + + /* Check all the array values. This could optionally emit any + * bad data, but it's not clear how that would help debugging. + */ + for (i = 0; i < sizes[0]; i++) + for (j = 0; j < sizes[1]; j++) + if (dset1[i][j] != dset2[i][j]) { + *are_same = FALSE; + return SUCCEED; + } + + return SUCCEED; + +} /* end compare_2D_arrays() */ + + +/*------------------------------------------------------------------------- + * Function: ensure_filter_works + * + * Purpose: Tests writing entire data and partial data with filters + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +ensure_filter_works(hid_t fid, const char *name, hid_t dcpl_id) +{ + hid_t did = -1; /* Dataset ID */ + hid_t dxpl_id = -1; /* Dataset xfer property list ID */ + hid_t write_dxpl_id = -1; /* Dataset xfer property list ID for writing */ + hid_t sid = -1; /* Dataspace ID */ + void *tconv_buf = NULL; /* Temporary conversion buffer */ + int **orig = NULL; /* Data written to the dataset */ + int **read = NULL; /* Data read from the dataset */ + size_t r, c; /* Data rows and columns */ + size_t hs_r, hs_c, hs_offr, hs_offc; /* Hypserslab sizes and offsets */ + size_t i, j; /* Local index variables */ + int n = 0; /* Value written to point array */ + hbool_t are_same; /* Output from dataset compare function */ + int ***save_array = NULL; /* (Global) array where the final data go */ + + /* initialize */ + r = (size_t)sizes_g[0]; + c = (size_t)sizes_g[1]; + + /* Create the data space */ + if ((sid = H5Screate_simple(2, sizes_g, NULL)) < 0) + TEST_ERROR; + + /* Allocate memory for the data buffers + * We're using the hacky way of doing 2D arrays that uses a + * single data buffer but which allows normal 2D access. + */ + if (allocate_and_init_2D_array(&orig, sizes_g, NULL) < 0) + TEST_ERROR; + if (allocate_and_init_2D_array(&read, sizes_g, NULL) < 0) + TEST_ERROR; + + /* Create a small conversion buffer to test strip mining. We + * might as well test all we can! + */ + if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + TEST_ERROR; + if (NULL == (tconv_buf = HDcalloc((size_t)1000, sizeof(char)))) + TEST_ERROR; + if (H5Pset_buffer(dxpl_id, (size_t)1000, tconv_buf, NULL) < 0) + TEST_ERROR; + if ((write_dxpl_id = H5Pcopy(dxpl_id)) < 0) + TEST_ERROR; + + TESTING(" filters (setup)"); + + /* Check if all the filters are available */ + if (H5Pall_filters_avail(dcpl_id) != TRUE) + TEST_ERROR; + + /* Create the dataset */ + if ((did = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) + TEST_ERROR; + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 1: Read uninitialized data. It should be zero. + *---------------------------------------------------------------------- + */ + TESTING(" filters (uninitialized read)"); + + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, *read) < 0) + TEST_ERROR; + + /* The input buffer was calloc'd and has not been initialized yet */ + if (compare_2D_arrays(orig, read, sizes_g, &are_same) < 0) + TEST_ERROR; + if (FALSE == are_same) + TEST_ERROR; + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 2: Test filters by setting up a chunked dataset and writing + * to it. + *---------------------------------------------------------------------- + */ + TESTING(" filters (write)"); + + n = 0; + for (i = 0; i < r; i++) + for (j = 0; j < c; j++) + orig[i][j] = n++; + + if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl_id, *orig) < 0) + TEST_ERROR; + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 3: Try to read the data we just wrote. + *---------------------------------------------------------------------- + */ + TESTING(" filters (read)"); + + /* Read the dataset back */ + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, *read) < 0) + TEST_ERROR; + + /* Check that the values read are the same as the values written */ + if (compare_2D_arrays(orig, read, sizes_g, &are_same) < 0) + TEST_ERROR; + if (FALSE == are_same) + TEST_ERROR; + + 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. + *---------------------------------------------------------------------- + */ + TESTING(" filters (modify)"); + + for (i = 0; i < r; i++) + for (j = 0; j < c / 2; j++) + orig[i][j] = (int)HDrandom() % RANDOM_LIMIT; + + if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl_id, *orig) < 0) + TEST_ERROR; + + /* Read the dataset back and check it */ + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, *read) < 0) + TEST_ERROR; + + /* Check that the values read are the same as the values written */ + if (compare_2D_arrays(orig, read, sizes_g, &are_same) < 0) + TEST_ERROR; + if (FALSE == are_same) + TEST_ERROR; + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 5: Close the dataset and then open it and read it again. This + * insures that the filters message is picked up properly from the + * object header. + *---------------------------------------------------------------------- + */ + TESTING(" filters (re-open)"); + + if (H5Dclose(did) < 0) + TEST_ERROR; + if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) + TEST_ERROR; + + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, *read) < 0) + TEST_ERROR; + + /* Check that the values read are the same as the values written */ + if (compare_2D_arrays(orig, read, sizes_g, &are_same) < 0) + TEST_ERROR; + if (FALSE == are_same) + TEST_ERROR; + + 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). + *---------------------------------------------------------------------- + */ + TESTING(" filters (partial I/O)"); + + hs_r = (size_t)hs_sizes_g[0]; + hs_c = (size_t)hs_sizes_g[1]; + hs_offr = (size_t)hs_offsets_g[0]; + hs_offc = (size_t)hs_offsets_g[1]; + for (i = 0; i < hs_r; i++) + for (j = 0; j < hs_c; j++) + orig[hs_offr + i][hs_offc + j] = (int)HDrandom() % RANDOM_LIMIT; + + if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offsets_g, NULL, hs_sizes_g, NULL) < 0) + TEST_ERROR; + + /* Use the "read" DXPL because partial I/O on corrupted data test + * needs to ignore errors during writing + */ + if (H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, *orig) < 0) + TEST_ERROR; + + if (H5Dread(did, H5T_NATIVE_INT, sid, sid, dxpl_id, *read) < 0) + TEST_ERROR; + + /* Check that the values read are the same as the values written */ + if (compare_2D_arrays(orig, read, sizes_g, &are_same) < 0) + TEST_ERROR; + if (FALSE == are_same) + TEST_ERROR; + + PASSED(); + + /* Save the data written to the file for later comparison when the file + * is reopened for read test. + */ + if (!HDstrcmp(name, DSET_DEFLATE_NAME)) + save_array = &orig_deflate_g; + else if (!HDstrcmp(name, DSET_FILTER1_NAME)) + save_array = &orig_dynlib1_g; + else if (!HDstrcmp(name, DSET_FILTER2_NAME)) + save_array = &orig_dynlib2_g; + else if (!HDstrcmp(name, DSET_FILTER3_NAME)) + save_array = &orig_dynlib4_g; + else + TEST_ERROR; + if (allocate_and_init_2D_array(save_array, sizes_g, orig) < 0) + TEST_ERROR; + + /* Clean up and exit */ + if (H5Dclose(did) < 0) + TEST_ERROR; + if (H5Sclose(sid) < 0) + TEST_ERROR; + if (H5Pclose(dxpl_id) < 0) + TEST_ERROR; + if (H5Pclose(write_dxpl_id) < 0) + TEST_ERROR; + + free_2D_array(&orig); + free_2D_array(&read); + + HDfree(tconv_buf); + + return SUCCEED; + +error: + /* Clean up objects used for this test */ + H5E_BEGIN_TRY { + H5Dclose(did); + H5Sclose(sid); + H5Pclose(dxpl_id); + H5Pclose(write_dxpl_id); + } H5E_END_TRY + + /* NULLs are okay here */ + free_2D_array(&orig); + free_2D_array(&read); + + if (tconv_buf) + HDfree(tconv_buf); + + return FAIL; +} /* end ensure_filter_works() */ + + +/*------------------------------------------------------------------------- + * Function: test_dataset_write_with_filters + * + * Purpose: Tests creating datasets and writing data with dynamically loaded filters + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +test_dataset_write_with_filters(hid_t fid) +{ + hid_t dcpl_id = -1; /* Dataset creation property list ID */ + unsigned int compress_level; /* Deflate compression level */ + unsigned int filter1_data; /* Data used by filter 1 */ + unsigned int libver_values[4]; /* Used w/ the filter that makes HDF5 calls */ + + /*---------------------------------------------------------- + * STEP 1: Test deflation by itself. + *---------------------------------------------------------- + */ + HDputs("Testing dataset writes with deflate filter"); +#ifdef H5_HAVE_FILTER_DEFLATE + if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR; + if (H5Pset_chunk(dcpl_id, 2, chunk_sizes_g) < 0) + TEST_ERROR; + compress_level = 6; + if (H5Pset_deflate(dcpl_id, compress_level) < 0) + TEST_ERROR; + + /* Ensure the filter works */ + if (ensure_filter_works(fid, DSET_DEFLATE_NAME, dcpl_id) < 0) + TEST_ERROR; + + /* Clean up objects used for this test */ + if (H5Pclose(dcpl_id) < 0) + TEST_ERROR; +#else /* H5_HAVE_FILTER_DEFLATE */ + SKIPPED(); + HDputs(" Deflate filter not enabled"); +#endif /* H5_HAVE_FILTER_DEFLATE */ + + /*---------------------------------------------------------- + * STEP 2: Test filter plugin 1 by itself. + *---------------------------------------------------------- + */ + HDputs(" dataset writes with filter plugin 1"); + if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR; + if (H5Pset_chunk(dcpl_id, 2, chunk_sizes_g) < 0) + TEST_ERROR; + + /* Set up the filter, passing in the amount the filter will add and subtract + * from each data element. Note that this value has an arbitrary max of 9. + */ + filter1_data = 9; + if (H5Pset_filter(dcpl_id, FILTER1_ID, H5Z_FLAG_MANDATORY, (size_t)1, &filter1_data) < 0) + TEST_ERROR; + + /* Ensure the filter works */ + if (ensure_filter_works(fid, DSET_FILTER1_NAME, dcpl_id) < 0) + TEST_ERROR; + + /* Clean up objects used for this test */ + if (H5Pclose(dcpl_id) < 0) + TEST_ERROR; + + /* Unregister the dynamic filter for testing purpose. The next time when this test is run for + * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries + * for this filter. + */ + if (H5Zunregister(FILTER1_ID) < 0) + TEST_ERROR; + + /*---------------------------------------------------------- + * STEP 3: Test filter plugin 2 by itself. + *---------------------------------------------------------- + */ + HDputs(" dataset writes with filter plugin 2"); + if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR; + if (H5Pset_chunk(dcpl_id, 2, chunk_sizes_g) < 0) + TEST_ERROR; + if (H5Pset_filter(dcpl_id, FILTER2_ID, H5Z_FLAG_MANDATORY, 0, NULL) < 0) + TEST_ERROR; + + /* Ensure the filter works */ + if (ensure_filter_works(fid, DSET_FILTER2_NAME, dcpl_id) < 0) + TEST_ERROR; + + /* Clean up objects used for this test */ + if (H5Pclose(dcpl_id) < 0) + TEST_ERROR; + + /* Unregister the dynamic filter for testing purpose. The next time when this test is run for + * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries + * for this filter. + */ + if (H5Zunregister(FILTER2_ID) < 0) + TEST_ERROR; + + /*---------------------------------------------------------- + * STEP 4: Test filter plugin 3 by itself. + * (This filter plugin makes HDF5 API calls) + *---------------------------------------------------------- + */ + HDputs(" dataset writes with filter plugin 3"); + if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR; + if (H5Pset_chunk(dcpl_id, 2, chunk_sizes_g) < 0) + TEST_ERROR; + + /* Set the add/subtract value for the filter */ + libver_values[0] = 9; + + /* Get the library bounds and add to the filter data */ + if (H5get_libversion(&libver_values[1], &libver_values[2], &libver_values[3]) < 0) + TEST_ERROR; + if (H5Pset_filter(dcpl_id, FILTER3_ID, H5Z_FLAG_MANDATORY, (size_t)4, libver_values) < 0) + TEST_ERROR; + + /* Ensure the filter works */ + if (ensure_filter_works(fid, DSET_FILTER3_NAME, dcpl_id) < 0) + TEST_ERROR; + + /* Clean up objects used for this test */ + if (H5Pclose(dcpl_id) < 0) + TEST_ERROR; + + /* Unregister the dynamic filter for testing purpose. The next time when this test is run for + * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries + * for this filter. + */ + if (H5Zunregister(FILTER3_ID) < 0) + TEST_ERROR; + + return SUCCEED; + +error: + /* Clean up objects used for this test */ + H5E_BEGIN_TRY { + H5Pclose(dcpl_id); + } H5E_END_TRY + + return FAIL; +} /* end test_dataset_write_with_filters() */ + + +/*------------------------------------------------------------------------- + * Function: test_read_data + * + * Purpose: Tests reading data and compares values + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +test_read_data(hid_t did, int *origin_data) +{ + int **check = NULL; + int *data_p = origin_data; + size_t i, j; /* Local index variables */ + + if (allocate_and_init_2D_array(&check, sizes_g, NULL) < 0) + TEST_ERROR; + + /* Read the dataset back */ + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, *check) < 0) + TEST_ERROR; + + /* Check that the values read are the same as the values written */ + for(i = 0; i < sizes_g[0]; i++) + for(j = 0; j < sizes_g[1]; j++) { + if(*data_p != check[i][j]) + TEST_ERROR + data_p++; + } + + free_2D_array(&check); + + PASSED(); + + return SUCCEED; + +error: + free_2D_array(&check); + + return FAIL; +} /* end test_read_data() */ + + + +/*------------------------------------------------------------------------- + * Function: test_dataset_read_with_filters + * + * Purpose: Tests reading datasets created with dynamically-loaded + * filter plugins. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +test_dataset_read_with_filters(hid_t fid) +{ + hid_t did = -1; /* Dataset ID */ + + /*---------------------------------------------------------- + * STEP 1: Test deflation by itself. + *---------------------------------------------------------- + */ + TESTING("dataset read I/O with deflate filter"); + +#ifdef H5_HAVE_FILTER_DEFLATE + if (H5Zfilter_avail(H5Z_FILTER_DEFLATE) != TRUE) + TEST_ERROR; + + if ((did = H5Dopen2(fid, DSET_DEFLATE_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR; + + if (test_read_data(did, orig_deflate_g[0]) < 0) + TEST_ERROR; + + if (H5Dclose(did) < 0) + TEST_ERROR; + +#else /* H5_HAVE_FILTER_DEFLATE */ + SKIPPED(); + HDputs(" Deflate filter not enabled"); +#endif /* H5_HAVE_FILTER_DEFLATE */ + + /*---------------------------------------------------------- + * STEP 2: Test filter plugin 1 by itself. + *---------------------------------------------------------- + */ + TESTING(" dataset reads with filter plugin 1"); + + if ((did = H5Dopen2(fid, DSET_FILTER1_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR; + + if (test_read_data(did, orig_dynlib1_g[0]) < 0) + TEST_ERROR; + + if (H5Dclose(did) < 0) + TEST_ERROR; + + /*---------------------------------------------------------- + * STEP 3: Test filter plugin 2 by itself. + *---------------------------------------------------------- + */ + TESTING(" dataset reads with filter plugin 2"); + + if ((did = H5Dopen2(fid, DSET_FILTER2_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR; + + if (test_read_data(did, orig_dynlib2_g[0]) < 0) + TEST_ERROR; + + if (H5Dclose(did) < 0) + TEST_ERROR; + + /*---------------------------------------------------------- + * STEP 4: Test filter plugin 3 by itself. + *---------------------------------------------------------- + */ + TESTING(" dataset reads with filter plugin 3"); + + if ((did = H5Dopen2(fid, DSET_FILTER3_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR; + + if (test_read_data(did, orig_dynlib4_g[0]) < 0) + TEST_ERROR; + + if (H5Dclose(did) < 0) + TEST_ERROR; + + return SUCCEED; + +error: + /* Clean up objects used for this test */ + H5E_BEGIN_TRY { + H5Dclose(did); + } H5E_END_TRY + + return FAIL; +} /* end test_dataset_read_with_filters() */ + + +/*------------------------------------------------------------------------- + * Function: ensure_data_read_fails + * + * Purpose: Tests not reading data + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +ensure_data_read_fails(hid_t did) +{ + int **check = NULL; + herr_t ret = FAIL; + + if (allocate_and_init_2D_array(&check, sizes_g, NULL) < 0) + TEST_ERROR; + + /* Read the dataset back (should fail) */ + H5E_BEGIN_TRY { + ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, *check); + } H5E_END_TRY + if(ret >= 0) + TEST_ERROR; + + free_2D_array(&check); + + PASSED(); + + return SUCCEED; + +error: + free_2D_array(&check); + return FAIL; +} /* end ensure_data_read_fails() */ + + +/*------------------------------------------------------------------------- + * Function: test_no_read_when_plugins_disabled + * + * Purpose: Ensures we can't read data from a dataset that requires a + * filter located in a plugin. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +test_no_read_when_plugins_disabled(hid_t fid) +{ + hid_t did = -1; /* Dataset ID */ + unsigned plugin_flags; /* Plugin access flags */ + + TESTING("filter plugin 1 with filter plugins disabled"); + + /* Get the existing plugin flags */ + if (H5PLget_loading_state(&plugin_flags) < 0) + TEST_ERROR; + + /* Disable filter plugins and use the new flags */ + plugin_flags &= (unsigned)(~H5PL_FILTER_PLUGIN); + if (H5PLset_loading_state(plugin_flags) < 0) + TEST_ERROR; + + /* Open a dataset that requires a filter plugin to read the data */ + if ((did = H5Dopen2(fid, DSET_FILTER1_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Make sure we can't read the data */ + if (ensure_data_read_fails(did) < 0) + TEST_ERROR; + + /* Close down */ + if (H5Dclose(did) < 0) + TEST_ERROR; + + /* Re-enable filter plugins */ + plugin_flags |= (unsigned)H5PL_FILTER_PLUGIN; + if (H5PLset_loading_state(plugin_flags) < 0) + TEST_ERROR; + + return SUCCEED; + +error: + /* Clean up objects used for this test */ + H5E_BEGIN_TRY { + plugin_flags |= (unsigned)H5PL_FILTER_PLUGIN; + H5PLset_loading_state(plugin_flags); + H5Dclose(did); + } H5E_END_TRY + + return FAIL; +} /* end test_no_read_when_plugins_disabled() */ + + +/*------------------------------------------------------------------------- + * Function: test_creating_groups_using_plugins + * + * Purpose: Tests creating group with dynamically loaded filters + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +test_creating_groups_using_plugins(hid_t fid) +{ + hid_t gcpl_id = -1; + hid_t gid = -1; + hid_t sub_gid = -1; + int i; + char subgroup_name[256]; + + TESTING("creating groups with filter plugin 4"); + + if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) + TEST_ERROR; + + /* Use a filter plugin for creating groups */ + if (H5Pset_filter(gcpl_id, FILTER4_ID, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) + TEST_ERROR; + + /* Create a group using this filter */ + if ((gid = H5Gcreate2(fid, TOP_LEVEL_GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Create multiple groups under the top-level group */ + for (i = 0; i < N_SUBGROUPS; i++) { + char *sp = subgroup_name; + + sp += HDsprintf(subgroup_name, SUBGROUP_PREFIX); + HDsprintf(sp, "%d", i); + + if ((sub_gid = H5Gcreate2(gid, subgroup_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; + if (H5Gclose(sub_gid) < 0) + TEST_ERROR; + } + + /* Close everything */ + if (H5Gclose(gid) < 0) + TEST_ERROR; + if (H5Pclose(gcpl_id) < 0) + TEST_ERROR; + + PASSED(); + + return SUCCEED; + +error: + /* Clean up objects used for this test */ + H5E_BEGIN_TRY { + H5Gclose(sub_gid); + H5Gclose(gid); + H5Pclose(gcpl_id); + } H5E_END_TRY + + return FAIL; +} /* end test_creating_groups_using_plugins() */ + + +/*------------------------------------------------------------------------- + * Function: test_opening_groups_using_plugins + * + * Purpose: Tests opening group with dynamically loaded filters + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +test_opening_groups_using_plugins(hid_t fid) +{ + hid_t gid = -1; + hid_t sub_gid = -1; + int i; + char subgroup_name[256]; + + TESTING("opening groups with filter plugin 4"); + + /* Open the top group */ + if ((gid = H5Gopen2(fid, TOP_LEVEL_GROUP_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Open all the sub-groups under the top-level group */ + for (i = 0; i < N_SUBGROUPS; i++) { + char *sp = subgroup_name; + + sp += HDsprintf(subgroup_name, SUBGROUP_PREFIX); + HDsprintf(sp, "%d", i); + + if ((sub_gid = H5Gopen2(gid, subgroup_name, H5P_DEFAULT)) < 0) + TEST_ERROR; + if (H5Gclose(sub_gid) < 0) + TEST_ERROR; + } + + /* Close the top-level group */ + if (H5Gclose(gid) < 0) + TEST_ERROR; + + PASSED(); + + return SUCCEED; + +error: + /* Clean up objects used for this test */ + H5E_BEGIN_TRY { + H5Gclose(gid); + H5Gclose(sub_gid); + } H5E_END_TRY + + return FAIL; +} /* end test_opening_groups_using_plugins() */ + + + +/*------------------------------------------------------------------------- + * Function: test_path_api_calls + * + * Purpose: Tests the H5PL API calls that manipulate the plugin search + * paths. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +test_path_api_calls(void) +{ + unsigned int n_starting_paths; + unsigned int u; + unsigned int n_paths; + herr_t ret; + ssize_t path_len = -1; + char path[256]; + char temp_name[256]; + + HDputs("Testing access to the filter path table"); + + if (H5Zfilter_avail(FILTER1_ID) != 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; + + /* Check that initialization is correct */ + TESTING(" initialize"); + + if (H5PLsize(&n_paths) < 0) + TEST_ERROR; + if (n_paths != 2) + TEST_ERROR; + + PASSED(); + + /****************/ + /* H5PLremove() */ + /****************/ + + /* Remove all the current paths */ + TESTING(" remove"); + + /* 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(); + + + 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; + + PASSED(); + + + /****************/ + /* H5PLappend() */ + /****************/ + + TESTING(" append"); + + /* 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; + } + } + + PASSED(); + + + /**********************/ + /* 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(n_starting_paths); + } H5E_END_TRY + + if (ret >= 0) + TEST_ERROR + + PASSED(); + + + /*************/ + /* H5PLget() */ + /*************/ + + TESTING(" get (path name)"); + + /* 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 (path_len != 8) + TEST_ERROR; + + /* 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(path, "a_path_0") != 0) { + HDfprintf(stderr," get 0: %s\n", path); + TEST_ERROR; + } + + PASSED(); + + + 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; + } + + /* 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 (index too high)"); + + /* Get path at the last + 1 index (SHOULD FAIL) */ + H5E_BEGIN_TRY { + path_len = H5PLget(n_starting_paths, NULL, 0); + } H5E_END_TRY + if (path_len > 0) + TEST_ERROR; + + PASSED(); + + + /*****************/ + /* 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 ((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(); + + + TESTING(" prepend"); + + /* 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 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, path, 256) <= 0) + TEST_ERROR; + if (HDstrcmp(path, "a_path_7") != 0) { + HDfprintf(stderr," get 8: %s\n", path); + TEST_ERROR; + } + + /* 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(); + + + /*****************/ + /* H5PLreplace() */ + /*****************/ + + TESTING(" replace"); + + /* 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 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. + */ + + /* 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; + } + + /* 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(); + + + /****************/ + /* 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, 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(); + + + TESTING(" insert"); + + /* 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, 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(); + + + /****************/ + /* 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(); + + + return SUCCEED; + +error: + return FAIL; +} /* end test_path_api_calls() */ + + +/*------------------------------------------------------------------------- + * Function: disable_chunk_cache + * + * Purpose: Turns the chunk cache off + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +disable_chunk_cache(hid_t fapl_id) { + int mdc_nelmts; + size_t rdcc_nelmts; + size_t rdcc_nbytes; + double rdcc_w0; + + if (H5Pget_cache(fapl_id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) + TEST_ERROR; + rdcc_nbytes = 0; + if (H5Pset_cache(fapl_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) + TEST_ERROR; + + return SUCCEED; +error: + return FAIL; +} /* end disable_chunk_cache() */ + + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: Tests the plugin module (H5PL) + * + * Return: EXIT_SUCCESS/EXIT_FAILURE + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + char filename[FILENAME_BUF_SIZE]; + hid_t fid = -1; + hid_t old_ff_fapl_id = -1; + hid_t new_ff_fapl_id = -1; + unsigned new_format; + int nerrors = 0; + + /* Testing setup */ + h5_reset(); + + /*******************************************************************/ + /* ENSURE THAT WRITING TO DATASETS AND CREATING GROUPS WORKS */ + /*******************************************************************/ + + /* Get a VFD-dependent filename */ + if ((old_ff_fapl_id = h5_fileaccess()) < 0) + TEST_ERROR; + + /* Turn off the chunk cache, so all the chunks are immediately written to disk */ + if (disable_chunk_cache(old_ff_fapl_id) < 0) + TEST_ERROR; + + /* Copy the file access property list and set the latest file format on it */ + if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0) + TEST_ERROR; + if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + TEST_ERROR; + + /* Fix up the filename for the VFD */ + h5_fixname(FILENAME[0], old_ff_fapl_id, filename, sizeof(filename)); + + /* Test with old & new format groups */ + for (new_format = FALSE; new_format <= TRUE; new_format++) { + hid_t my_fapl_id; + + /* Set the FAPL for the type of format */ + if (new_format) { + HDputs("\nTesting with new file format:"); + my_fapl_id = new_ff_fapl_id; + } + else { + HDputs("Testing with old file format:"); + my_fapl_id = old_ff_fapl_id; + } + + /* Create the file for this test */ + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl_id)) < 0) + TEST_ERROR; + + /* Test creating datasets and writing to them using plugin filters */ + nerrors += (test_dataset_write_with_filters(fid) < 0 ? 1 : 0); + + /* Test creating groups using dynamically-loaded plugin filters */ + nerrors += (test_creating_groups_using_plugins(fid) < 0 ? 1 : 0); + + if (H5Fclose(fid) < 0) + TEST_ERROR; + } /* end for */ + + /* Close FAPLs */ + if (H5Pclose(old_ff_fapl_id) < 0) + TEST_ERROR; + if (H5Pclose(new_ff_fapl_id) < 0) + TEST_ERROR; + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + + /*******************************************************************/ + /* ENSURE THAT READING FROM DATASETS AND OPENING GROUPS WORKS */ + /*******************************************************************/ + + HDputs("\nTesting reading data with with dynamic plugin filters:"); + + /* Close the library so that all loaded plugin libraries are unloaded */ + h5_reset(); + if ((old_ff_fapl_id = h5_fileaccess()) < 0) + TEST_ERROR; + + /* Reopen the file for testing data reading */ + if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, old_ff_fapl_id)) < 0) + TEST_ERROR; + + /* Read the data with filters */ + nerrors += (test_dataset_read_with_filters(fid) < 0 ? 1 : 0); + + /* Test creating groups using dynamically-loaded plugin filters */ + nerrors += (test_opening_groups_using_plugins(fid) < 0 ? 1 : 0); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + + /*******************************************************************/ + /* ENSURE THAT DISABLING FILTER PLUGINS VIA THE FILTER FLAGS WORKS */ + /*******************************************************************/ + + /* Close the library so that all loaded plugin libraries are unloaded */ + h5_reset(); + if ((old_ff_fapl_id = h5_fileaccess()) < 0) + TEST_ERROR; + + /* Reopen the file for testing data reading */ + if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, old_ff_fapl_id)) < 0) + TEST_ERROR; + + /* When filters are disabled, make sure we can't read data from a + * dataset that requires a filter plugin. + */ + nerrors += (test_no_read_when_plugins_disabled(fid) < 0 ? 1 : 0); + + if (H5Fclose(fid) < 0) + TEST_ERROR; + + /************************************/ + /* TEST THE FILTER PLUGIN API CALLS */ + /************************************/ + + /* Test the APIs for access to the filter plugin path table */ + nerrors += (test_path_api_calls() < 0 ? 1 : 0); + + /*********************/ + /* CLEAN UP AND EXIT */ + /*********************/ + + /* Free up saved arrays */ + free_2D_array(&orig_deflate_g); + free_2D_array(&orig_dynlib1_g); + free_2D_array(&orig_dynlib2_g); + free_2D_array(&orig_dynlib4_g); + + if (nerrors) + TEST_ERROR; + + HDprintf("All plugin tests passed.\n"); + h5_cleanup(FILENAME, old_ff_fapl_id); + + HDexit(EXIT_SUCCESS); + +error: + H5E_BEGIN_TRY { + H5Fclose(fid); + H5Pclose(old_ff_fapl_id); + H5Pclose(new_ff_fapl_id); + } H5E_END_TRY + + /* Free up saved arrays (NULLs okay) */ + free_2D_array(&orig_deflate_g); + free_2D_array(&orig_dynlib1_g); + free_2D_array(&orig_dynlib2_g); + free_2D_array(&orig_dynlib4_g); + + nerrors = MAX(1, nerrors); + HDprintf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); + HDexit(EXIT_FAILURE); +} /* end main() */ + diff --git a/test/filter_plugin1_dsets.c b/test/filter_plugin1_dsets.c new file mode 100644 index 0000000..b74e086 --- /dev/null +++ b/test/filter_plugin1_dsets.c @@ -0,0 +1,93 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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: Test dataset filter plugin for the filter_pluging.c test. + */ + + +#include +#include + +#include "H5PLextern.h" + +#define FILTER1_ID 257 + +static size_t add_sub_value(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* Filter class struct */ +const H5Z_class2_t FILTER_INFO[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + FILTER1_ID, /* Filter ID number */ + 1, /* Encoding enabled */ + 1, /* Decoding enabled */ + "test filter plugin 1", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)add_sub_value, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return FILTER_INFO;} + + +/*------------------------------------------------------------------------- + * Function: add_sub_value + * + * Purpose: On write: + * Adds a caller-supplied value to the element + * On read: + * Subtracts a caller-supplied value from the element + * + * Return: Success: Data chunk size in bytes + * Failure: 0 + * + *------------------------------------------------------------------------- + */ +static size_t +add_sub_value(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, + size_t nbytes, size_t *buf_size, void **buf) +{ + int *int_ptr = (int *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + int value = 0; /* Data value to add/subtract */ + + /* Check for the correct number of parameters */ + if (0 == cd_nelmts) + return 0; + + /* Check that permanent parameters are set correctly */ + if (cd_values[0] > 9) + return 0; + + value = (int)cd_values[0]; + + if (flags & H5Z_FLAG_REVERSE) { + /* READ - Substract the given value from all the data values */ + while (buf_left > 0) { + *int_ptr++ -= value; + buf_left -= sizeof(int); + } + } + else { + /* WRITE - Add the given value to all the data values */ + while (buf_left > 0) { + *int_ptr++ += value; + buf_left -= sizeof(int); + } + } + + return nbytes; + +} /* end add_sub_value() */ + diff --git a/test/filter_plugin2_dsets.c b/test/filter_plugin2_dsets.c new file mode 100644 index 0000000..6a79148 --- /dev/null +++ b/test/filter_plugin2_dsets.c @@ -0,0 +1,88 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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: Test dataset filter plugin for the filter_pluging.c test. + */ + +#include +#include + +#include "H5PLextern.h" + +#define FILTER2_ID 258 +#define MULTIPLIER 3 + +static size_t mult_div_value(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* Filter class struct */ +const H5Z_class2_t FILTER_INFO[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + FILTER2_ID, /* Filter ID number */ + 1, /* Encoding enabled */ + 1, /* Decoding enabled */ + "test filter plugin 2", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)mult_div_value, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return FILTER_INFO;} + + +/*------------------------------------------------------------------------- + * Function: mult_div_value + * + * Purpose: On write: + * Multiplies an element by a constant value. + * On read: + * Divides an element by a constant value. + * + * Return: Success: Data chunk size in bytes + * Failure: 0 + * + *------------------------------------------------------------------------- + */ +static size_t +mult_div_value(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf) +{ + int *int_ptr = (int *)*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 - Divide the original value by MULTIPLIER */ + while (buf_left > 0) { + *int_ptr++ /= MULTIPLIER; + buf_left -= sizeof(int); + } + } + else { + /* WRITE - Multiply the original value by MULTIPLIER */ + while (buf_left > 0) { + *int_ptr++ *= MULTIPLIER; + buf_left -= sizeof(int); + } + } + + return nbytes; +} /* end mult_div_value() */ + diff --git a/test/filter_plugin3_dsets.c b/test/filter_plugin3_dsets.c new file mode 100644 index 0000000..b43020f --- /dev/null +++ b/test/filter_plugin3_dsets.c @@ -0,0 +1,119 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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: Test dataset filter plugin for the filter_pluging.c test. + * This filter makes an HDF5 API call to ensure that works correctly. + */ + +#include +#include + +#include "H5PLextern.h" + +#define FILTER3_ID 259 + +#define PUSH_ERR(func, minor, str) H5Epush2(H5E_DEFAULT, __FILE__, func, __LINE__, H5E_ERR_CLS, H5E_PLUGIN, minor, str) + +static size_t add_sub_value_hdf5(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* Filter class struct */ +const H5Z_class2_t FILTER_INFO[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + FILTER3_ID, /* Filter ID number */ + 1, /* Encoding enabled */ + 1, /* Decoding enabled */ + "test filter plugin 3", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)add_sub_value_hdf5, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return FILTER_INFO;} + + +/*------------------------------------------------------------------------- + * Function: add_sub_value_hdf5 + * + * Purpose: On write: + * Adds a caller-supplied value to the element + * On read: + * Subtracts a caller-supplied value from the element + * + * NOTE: This filter is identical to filter #1 only it makes + * an HDF5 library call to ensure doing that doesn't + * cause problems. + * + * Return: Success: Data chunk size in bytes + * Failure: 0 + * + *------------------------------------------------------------------------- + */ +static size_t +add_sub_value_hdf5(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, + size_t nbytes, size_t *buf_size, void **buf) +{ + int *int_ptr = (int *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + int value = 0; /* Data value to add/subtract */ + unsigned majnum = 0; /* Output data from the HDF5 library call */ + unsigned minnum = 0; + unsigned relnum = 0; + + /* Check for the library version. + * We don't do anything with this information - it's just to ensure that + * HDF5 library calls work properly from inside filter plugins. + */ + if (H5get_libversion(&majnum, &minnum, &relnum) < 0) { + PUSH_ERR("filter plugin 3", H5E_CALLBACK, "H5get_libversion"); + return 0; + } + + /* Check for the correct number of parameters */ + if (cd_nelmts == 0) + return 0; + + /* Check that permanent parameters are set correctly */ + if (cd_values[0] > 9) + return 0; + + /* Ensure that the version numbers match what was passed in. + * Again, this is trivial work, just to ensure that the library calls are + * working properly. + */ + if (majnum != cd_values[1] || minnum != cd_values[2]) { + PUSH_ERR("filter plugin 3", H5E_CALLBACK, "library versions do not match"); + return 0; + } + + value = (int)cd_values[0]; + + if (flags & H5Z_FLAG_REVERSE) { + /* READ - Substract the given value from all the data values */ + while (buf_left > 0) { + *int_ptr++ -= value; + buf_left -= sizeof(int); + } + } + else { + /* WRITE - Add the given value to all the data values */ + while (buf_left > 0) { + *int_ptr++ += value; + buf_left -= sizeof(int); + } + } + + return nbytes; +} /* end add_sub_value_hdf5() */ + diff --git a/test/filter_plugin4_groups.c b/test/filter_plugin4_groups.c new file mode 100644 index 0000000..88ea20d --- /dev/null +++ b/test/filter_plugin4_groups.c @@ -0,0 +1,106 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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: Test group filter plugin for the filter_pluging.c test. + */ + +#include +#include +#include + +#include "H5PLextern.h" + +#define FILTER4_ID 260 +#define SUFFIX_LEN 8 +#define GROUP_SUFFIX ".h5group" + +static size_t append_to_group_name(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* Filter class struct */ +const H5Z_class2_t FILTER_INFO[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + FILTER4_ID, /* Filter ID number */ + 1, /* Encoding enabled */ + 1, /* Decoding enabled */ + "test filter plugin 4", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)append_to_group_name, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return FILTER_INFO;} + + +/*------------------------------------------------------------------------- + * Function: append_to_group_name + * + * Purpose: On write: + * Appends the suffix ".h5group" to the group name + * On read: + * Removes the ".h5group" suffix from the group name + * + * Return: Success: Data size in bytes + * Failure: 0 + * + *------------------------------------------------------------------------- + */ +static size_t +append_to_group_name(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf) +{ + size_t new_name_size = 0; /* Return value */ + + /* 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 - Remove the suffix from the group name */ + new_name_size = *buf_size = nbytes - SUFFIX_LEN; + } + else { + /* WRITE - Append the suffix to the group name */ + void *outbuf = NULL; /* Pointer to new buffer */ + unsigned char *dst = NULL; /* Temporary pointer to destination buffer */ + + /* Get memory for the new, larger string buffer using the + * library's memory allocator. + */ + if (NULL == (dst = (unsigned char *)(outbuf = H5allocate_memory(nbytes + SUFFIX_LEN, 0)))) + return 0; + + /* Copy raw data */ + memcpy((void *)dst, (const void *)(*buf), nbytes); + + /* Append suffix to raw data for storage */ + dst += nbytes; + memcpy((void *)dst, (const void *)GROUP_SUFFIX, SUFFIX_LEN); + + /* Free the passed-in buffer using the library's allocator */ + H5free_memory(*buf); + + /* Set return values */ + *buf_size = nbytes + SUFFIX_LEN; + *buf = outbuf; + outbuf = NULL; + new_name_size = *buf_size; + } + + return new_name_size; +} /* append_to_group_name() */ + diff --git a/test/plugin.c b/test/plugin.c deleted file mode 100644 index ea199f6..0000000 --- a/test/plugin.c +++ /dev/null @@ -1,1217 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * 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 "h5test.h" -#include "H5srcdir.h" - -/* - * This file needs to access private datatypes from the H5Z and H5PL package. - */ -#define H5PL_FRIEND -#include "H5PLpkg.h" -#define H5Z_FRIEND -#include "H5Zpkg.h" - -/* Filters for HDF5 internal test */ -#define H5Z_FILTER_DYNLIB1 257 -#define H5Z_FILTER_DYNLIB2 258 -#define H5Z_FILTER_DYNLIB3 259 -#define H5Z_FILTER_DYNLIB4 260 - -const char *FILENAME[] = { - "plugin", - NULL -}; -#define FILENAME_BUF_SIZE 1024 - -/* Dataset names for testing filters */ -#define DSET_DEFLATE_NAME "deflate" -#define DSET_DYNLIB1_NAME "dynlib1" -#define DSET_DYNLIB2_NAME "dynlib2" -#define DSET_DYNLIB4_NAME "dynlib4" - -/* Parameters for internal filter test */ -#define FILTER_CHUNK_DIM1 2 -#define FILTER_CHUNK_DIM2 25 -#define FILTER_HS_OFFSET1 7 -#define FILTER_HS_OFFSET2 30 -#define FILTER_HS_SIZE1 4 -#define FILTER_HS_SIZE2 50 - -/* Shared global arrays */ -#define DSET_DIM1 100 -#define DSET_DIM2 200 - -/* Limit random number within 20000 */ -#define RANDOM_LIMIT 20000 - -#define GROUP_ITERATION 1000 - -int points_deflate[DSET_DIM1][DSET_DIM2], - points_dynlib1[DSET_DIM1][DSET_DIM2], - points_dynlib2[DSET_DIM1][DSET_DIM2], - points_dynlib4[DSET_DIM1][DSET_DIM2], - points_bzip2[DSET_DIM1][DSET_DIM2]; - - -/*------------------------------------------------------------------------- - * Function: test_filter_internal - * - * Purpose: Tests writing entire data and partial data with filters - * - * Return: Success: 0 - * Failure: -1 - *------------------------------------------------------------------------- - */ -static herr_t -test_filter_internal(hid_t fid, const char *name, hid_t dcpl) -{ - herr_t ret_value = -1; - hid_t dataset = -1; /* Dataset ID */ - hid_t dxpl = -1; /* Dataset xfer property list ID */ - hid_t write_dxpl = -1; /* Dataset xfer property list ID for writing */ - hid_t sid = -1; /* 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 */ - int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; - size_t i, j; /* Local index variables */ - int n = 0; - - /* Create the data space */ - if((sid = H5Screate_simple(2, size, NULL)) < 0) TEST_ERROR - - /* - * Create a small conversion buffer to test strip mining. We - * might as well test all we can! - */ - if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR - tconv_buf = HDmalloc((size_t)1000); - if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) TEST_ERROR - if((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR; - - TESTING(" filters (setup)"); - - /* Check if all the filters are available */ - if(H5Pall_filters_avail(dcpl) != TRUE) { - H5_FAILED(); - HDprintf(" Line %d: Incorrect filter availability\n", __LINE__); - TEST_ERROR - } /* end if */ - - /* Create the dataset */ - if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 1: Read uninitialized data. It should be zero. - *---------------------------------------------------------------------- - */ - TESTING(" filters (uninitialized read)"); - - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) 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(); - HDprintf(" Read a non-zero value.\n"); - HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); - TEST_ERROR - } /* end if */ - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 2: Test filters by setting up a chunked dataset and writing - * to it. - *---------------------------------------------------------------------- - */ - TESTING(" filters (write)"); - - n = 0; - for(i=0; i= 0) - TEST_ERROR - - PASSED(); - ret_value = 0; - -error: - return ret_value; -} - -/*------------------------------------------------------------------------- - * Function: test_noread_with_filters - * - * Purpose: Tests reading dataset created with dynamically loaded filters disabled - * - * Return: Success: 0 - * Failure: -1 - *------------------------------------------------------------------------- - */ -static herr_t -test_noread_with_filters(hid_t file) -{ - herr_t ret_value = -1; - hid_t dset = -1; /* Dataset ID */ - unsigned plugin_state; /* status of plugins */ - - TESTING("DYNLIB1 filter with plugins disabled"); - - /* disable filter plugin */ - if(H5PLget_loading_state(&plugin_state) < 0) TEST_ERROR - - 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 - - if(test_noread_data(dset) < 0) TEST_ERROR - - if(H5Dclose(dset) < 0) TEST_ERROR - - ret_value = 0; - -error: - /* re-enable filter plugin */ - plugin_state = plugin_state | H5PL_FILTER_PLUGIN; - H5PLset_loading_state(plugin_state); - - /* Clean up objects used for this test */ - H5E_BEGIN_TRY { - H5Dclose(dset); - } H5E_END_TRY - - return ret_value; -} - -/*------------------------------------------------------------------------- - * Function: test_filters_for_groups - * - * Purpose: Tests creating group with dynamically loaded filters - * - * Return: Success: 0 - * Failure: -1 - *------------------------------------------------------------------------- - */ -static herr_t -test_filters_for_groups(hid_t file) -{ - herr_t ret_value = -1; - hid_t gcpl = -1; - hid_t gid = -1; - hid_t group = -1; - int i; - char gname[256]; - - TESTING("DYNLIB3 filter for group"); - - if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR - - /* Use DYNLIB3 for creating groups */ - if(H5Pset_filter (gcpl, H5Z_FILTER_DYNLIB3, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) TEST_ERROR - - /* Create a group using this filter */ - if((gid = H5Gcreate2(file, "group1", H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR - - /* Create multiple groups under "group1" */ - for(i=0; i < GROUP_ITERATION; i++) { - HDsprintf(gname, "group_%d", i); - if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - if(H5Gclose(group) < 0) TEST_ERROR - } - - /* Close the group */ - if(H5Gclose(gid) < 0) TEST_ERROR - - /* Clean up objects used for this test */ - if(H5Pclose(gcpl) < 0) TEST_ERROR - - PASSED(); - - ret_value = 0; - -error: - /* Clean up objects used for this test */ - H5E_BEGIN_TRY { - H5Gclose(group); - H5Gclose(gid); - H5Pclose(gcpl); - } H5E_END_TRY - - return ret_value; -} - -/*------------------------------------------------------------------------- - * Function: test_groups_with_filters - * - * Purpose: Tests opening group with dynamically loaded filters - * - * Return: Success: 0 - * Failure: -1 - * - *------------------------------------------------------------------------- - */ -static herr_t -test_groups_with_filters(hid_t file) -{ - herr_t ret_value = -1; - hid_t gid = -1; - hid_t group = -1; - int i; - char gname[256]; - - TESTING("opening groups with DYNLIB3 filter"); - - /* Open the top group */ - if((gid = H5Gopen2(file, "group1", H5P_DEFAULT)) < 0) TEST_ERROR - - /* Create multiple groups under "group1" */ - for(i=0; i < GROUP_ITERATION; i++) { - HDsprintf(gname, "group_%d", i); - if((group = H5Gopen2(gid, gname, H5P_DEFAULT)) < 0) TEST_ERROR - if(H5Gclose(group) < 0) TEST_ERROR - } - - /* Close the group */ - if(H5Gclose(gid) < 0) TEST_ERROR - - PASSED(); - - ret_value = 0; - -error: - /* Clean up objects used for this test */ - H5E_BEGIN_TRY { - H5Gclose(group); - H5Gclose(gid); - } H5E_END_TRY - - return ret_value; -} - - -/*------------------------------------------------------------------------- - * Function: test_path_api_calls - * - * Purpose: Tests the H5PL API calls that manipulate the plugin search - * paths. - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -static herr_t -test_path_api_calls(void) -{ - unsigned int n_starting_paths; - unsigned int u; - unsigned int n_paths; - herr_t ret; - ssize_t path_len = -1; - char path[256]; - char temp_name[256]; - - HDputs("Testing access to the filter path table"); - - 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; - - /* Check that initialization is correct */ - TESTING(" initialize"); - - if(H5PLsize(&n_paths) < 0) - TEST_ERROR - if(n_paths != 2) - TEST_ERROR - - PASSED(); - - /****************/ - /* H5PLremove() */ - /****************/ - - /* Remove all the current paths */ - TESTING(" remove"); - - /* 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(); - - - 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 - - PASSED(); - - - /****************/ - /* H5PLappend() */ - /****************/ - - TESTING(" append"); - - /* 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 - } - } - - PASSED(); - - - /**********************/ - /* 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(n_starting_paths); - } H5E_END_TRY - - if(ret >= 0) - TEST_ERROR - - PASSED(); - - - /*************/ - /* H5PLget() */ - /*************/ - - TESTING(" get (path name)"); - - /* 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(path_len != 8) - TEST_ERROR - - /* 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(path, "a_path_0") != 0) { - HDfprintf(stderr," get 0: %s\n", path); - TEST_ERROR - } - - PASSED(); - - - 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 - } - - /* 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 (index too high)"); - - /* Get path at the last + 1 index (SHOULD FAIL) */ - H5E_BEGIN_TRY { - path_len = H5PLget(n_starting_paths, NULL, 0); - } H5E_END_TRY - if(path_len > 0) - TEST_ERROR - - PASSED(); - - - /*****************/ - /* 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((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(); - - - TESTING(" prepend"); - - /* 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 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, path, 256) <= 0) - TEST_ERROR - if(HDstrcmp(path, "a_path_7") != 0) { - HDfprintf(stderr," get 8: %s\n", path); - TEST_ERROR - } - - /* 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(); - - - /*****************/ - /* H5PLreplace() */ - /*****************/ - - TESTING(" replace"); - - /* 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 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. - */ - - /* 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 - } - - /* 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(); - - - /****************/ - /* 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, 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(); - - - TESTING(" insert"); - - /* 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, 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(); - - - /****************/ - /* 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(); - - - return SUCCEED; - -error: - return FAIL; -} /* end test_path_api_calls() */ - - -/*------------------------------------------------------------------------- - * Function: main - * - * Purpose: Tests the plugin module (H5PL) - * - * Return: EXIT_SUCCESS/EXIT_FAILURE - * - *------------------------------------------------------------------------- - */ -int -main(void) -{ - char filename[FILENAME_BUF_SIZE]; - hid_t file = -1; - hid_t fapl = -1; - hid_t fapl2 = -1; - unsigned new_format; - int mdc_nelmts; - size_t rdcc_nelmts; - size_t rdcc_nbytes; - double rdcc_w0; - int nerrors = 0; - - /* Testing setup */ - h5_reset(); - - 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 - rdcc_nbytes = 0; - 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 - - /* 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 - - h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); - - /* Test with old & new format groups */ - for (new_format = FALSE; new_format <= TRUE; new_format++) { - hid_t my_fapl; - - /* Set the FAPL for the type of format */ - if (new_format) { - HDputs("\nTesting with new file format:"); - my_fapl = fapl2; - } - else { - HDputs("Testing with old file format:"); - my_fapl = fapl; - } - - /* Create the file for this test */ - 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); - - /* Test dynamically loaded filters for groups */ - nerrors += (test_filters_for_groups(file) < 0 ? 1 : 0); - - if (H5Fclose(file) < 0) - TEST_ERROR - } /* end for */ - - /* Close FAPL */ - if (H5Pclose(fapl2) < 0) - TEST_ERROR - if (H5Pclose(fapl) < 0) - TEST_ERROR - - /* Restore the default error handler (set in h5_reset()) */ - h5_restore_err(); - - HDputs("\nTesting reading data with with dynamic plugin filters:"); - - /* Close the library so that all loaded plugin libraries are unloaded */ - h5_reset(); - 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 - - /* Read the data with filters */ - nerrors += (test_read_with_filters(file) < 0 ? 1 : 0); - - /* Open the groups with filters */ - nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0); - - /* Restore the default error handler (set in h5_reset()) */ - h5_restore_err(); - - /* Close the library so that all loaded plugin libraries are unloaded */ - h5_reset(); - 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 - - /* Read the data with disabled filters */ - nerrors += (test_noread_with_filters(file) < 0 ? 1 : 0); - - 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) - TEST_ERROR - - HDprintf("All plugin tests passed.\n"); - h5_cleanup(FILENAME, fapl); - - HDexit(EXIT_SUCCESS); - -error: - nerrors = MAX(1, nerrors); - HDprintf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - HDexit(EXIT_FAILURE); -} /* end main() */ - diff --git a/test/test_filter_plugin.sh.in b/test/test_filter_plugin.sh.in new file mode 100644 index 0000000..0a45c0f --- /dev/null +++ b/test/test_filter_plugin.sh.in @@ -0,0 +1,113 @@ +#! /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 COPYING file, which can be found at the root of the source code +# distribution tree, or in https://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@ + +# Determine if backward compatibility options enabled +DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +nerrors=0 +verbose=yes +exit_code=$EXIT_SUCCESS + +TEST_NAME=filter_plugin +TEST_BIN=`pwd`/$TEST_NAME +FROM_DIR=`pwd`/.libs +case $(uname) in + CYGWIN* ) + PLUGINS_FOR_DIR1="$FROM_DIR/cygfilter_plugin1* $FROM_DIR/cygfilter_plugin3*" + PLUGINS_FOR_DIR2="$FROM_DIR/cygfilter_plugin2* $FROM_DIR/cygfilter_plugin4*" + ;; + *) + PLUGINS_FOR_DIR1="$FROM_DIR/libfilter_plugin1* $FROM_DIR/libfilter_plugin3*" + PLUGINS_FOR_DIR2="$FROM_DIR/libfilter_plugin2* $FROM_DIR/libfilter_plugin4*" + ;; +esac +PLUGIN_DIR1=filter_plugin_dir1 +PLUGIN_DIR2=filter_plugin_dir2 +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 +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# Main Body +# Create test directories if necessary. +test -d $PLUGIN_DIR1 || mkdir -p $PLUGIN_DIR1 +if [ $? != 0 ]; then + echo "Failed to create filter plugin test directory ($PLUGIN_DIR1)" + exit $EXIT_FAILURE +fi + +test -d $PLUGIN_DIR2 || mkdir -p $PLUGIN_DIR2 +if [ $? != 0 ]; then + echo "Failed to create filter plugin test directory ($PLUGIN_DIR2)" + exit $EXIT_FAILURE +fi + +# Copy plugins for the tests. +$CP $PLUGINS_FOR_DIR1 $PLUGIN_DIR1 +if [ $? != 0 ]; then + echo "Failed to copy filter plugins ($PLUGINS_FOR_DIR1) to test directory." + exit $EXIT_FAILURE +fi + +$CP $PLUGINS_FOR_DIR2 $PLUGIN_DIR2 +if [ $? != 0 ]; then + echo "Failed to copy filter plugins ($PLUGINS_FOR_DIR2) to test directory." + exit $EXIT_FAILURE +fi + +# setup plugin path +ENVCMD="env HDF5_PLUGIN_PATH=${PLUGIN_DIR1}:${PLUGIN_DIR2}" + +# Run the test +$ENVCMD $TEST_BIN +if [ $? != 0 ]; then + nerrors=`expr $nerrors + 1` +fi + +############################################ +# HDFFV-9655 test for relative path disabled +# setup filter plugin path relative to test +# actual executable is in the .libs folder +#ENVCMD="env HDF5_PLUGIN_PATH=@/../${PLUGIN_DIR1}:@/../${PLUGIN_DIR2}" +# +# 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" + exit_code=$EXIT_FAILURE +else + echo "All filter plugin tests passed." + exit_code=$EXIT_SUCCESS +fi + +# Clean up temporary files/directories and leave +$RM $PLUGIN_DIR1 $PLUGIN_DIR2 + +exit $exit_code diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in deleted file mode 100644 index c90a978..0000000 --- a/test/test_plugin.sh.in +++ /dev/null @@ -1,113 +0,0 @@ -#! /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 COPYING file, which can be found at the root of the source code -# distribution tree, or in https://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@ - -# Determine backward compatibility options enabled -DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" - -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -nerrors=0 -verbose=yes -exit_code=$EXIT_SUCCESS - -TEST_NAME=plugin -TEST_BIN=`pwd`/$TEST_NAME -FROM_DIR=`pwd`/.libs -case $(uname) in - CYGWIN* ) - PLUGIN_LIB1="$FROM_DIR/cygdynlib1* $FROM_DIR/cygdynlib3*" - PLUGIN_LIB2="$FROM_DIR/cygdynlib2* $FROM_DIR/cygdynlib4*" - ;; - *) - PLUGIN_LIB1="$FROM_DIR/libdynlib1.* $FROM_DIR/libdynlib3.*" - PLUGIN_LIB2="$FROM_DIR/libdynlib2.* $FROM_DIR/libdynlib4.*" - ;; -esac -PLUGIN_LIBDIR1=testdir1 -PLUGIN_LIBDIR2=testdir2 -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 -# beginning with the word "Testing". -# -TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# Main Body -# Create test directories if not exists yet. -test -d $PLUGIN_LIBDIR1 || mkdir -p $PLUGIN_LIBDIR1 -if [ $? != 0 ]; then - echo "Failed to create test directory($PLUGIN_LIBDIR1)" - exit $EXIT_FAILURE -fi - -test -d $PLUGIN_LIBDIR2 || mkdir -p $PLUGIN_LIBDIR2 -if [ $? != 0 ]; then - echo "Failed to create test directory($PLUGIN_LIBDIR2)" - exit $EXIT_FAILURE -fi - -# copy plugin library for test -$CP $PLUGIN_LIB1 $PLUGIN_LIBDIR1 -if [ $? != 0 ]; then - echo "Failed to copy plugin library ($PLUGIN_LIB1) for test." - exit $EXIT_FAILURE -fi - -$CP $PLUGIN_LIB2 $PLUGIN_LIBDIR2 -if [ $? != 0 ]; then - echo "Failed to copy plugin library ($PLUGIN_LIB2) for test." - exit $EXIT_FAILURE -fi - -# setup plugin path -ENVCMD="env HDF5_PLUGIN_PATH=${PLUGIN_LIBDIR1}:${PLUGIN_LIBDIR2}" - -# Run the test -$ENVCMD $TEST_BIN -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}" -# -# 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" - 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 - -exit $exit_code diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index d2b5ebb..4d43a2a 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -53,9 +53,6 @@ if HAVE_SHARED_CONDITIONAL noinst_LTLIBRARIES=libdynlibdiff.la 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) - $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) 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 1454987..be21119 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -42,9 +42,6 @@ if HAVE_SHARED_CONDITIONAL noinst_LTLIBRARIES=libdynlibdump.la libdynlibdump_la_SOURCES=dynlib_dump.c libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere - - 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) 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 ec8b8c3..a49c2e8 100644 --- a/tools/test/h5ls/Makefile.am +++ b/tools/test/h5ls/Makefile.am @@ -39,9 +39,6 @@ if HAVE_SHARED_CONDITIONAL noinst_LTLIBRARIES=libdynlibls.la libdynlibls_la_SOURCES=dynlib_ls.c libdynlibls_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere - - 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) endif diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index d4dc843..fbe88bd 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -50,11 +50,6 @@ if HAVE_SHARED_CONDITIONAL libdynlibvers_la_SOURCES=dynlib_vrpk.c 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) - $(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) endif -- cgit v0.12 From 3e4f6138b60d8363c377e453d63f875775ec907a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 9 Nov 2017 13:56:58 -0800 Subject: Removed asserts from H5MM calls that conflict with stated behavior and added a test to ensure that this doesn't happen in the future. --- src/H5MM.c | 8 +------- test/tmisc.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 8 deletions(-) diff --git a/src/H5MM.c b/src/H5MM.c index ee3b28f..866dfbe 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -268,8 +268,6 @@ H5MM_malloc(size_t size) { void *ret_value = NULL; - HDassert(size); - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -357,8 +355,6 @@ H5MM_calloc(size_t size) { void *ret_value = NULL; - HDassert(size); - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -407,8 +403,6 @@ H5MM_realloc(void *mem, size_t size) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(mem || size); - if(NULL == mem && 0 == size) /* Not defined in the standard, return NULL */ ret_value = NULL; @@ -454,7 +448,7 @@ H5MM_realloc(void *mem, size_t size) * NULL is an acceptable value for the input string. * * Return: Success: Pointer to a new string (NULL if s is NULL). - * Failure: abort() + * Failure: NULL * * Programmer: Robb Matzke * Jul 10 1997 diff --git a/test/tmisc.c b/test/tmisc.c index 102325a..6da4589 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -30,6 +30,7 @@ #include "testhdf5.h" #include "H5srcdir.h" #include "H5Dpkg.h" /* Datasets */ +#include "H5MMprivate.h" /* Memory */ /* Definitions for misc. test #1 */ #define MISC1_FILE "tmisc1.h5" @@ -5526,6 +5527,64 @@ test_misc33(void) } /* end test_misc33() */ +/**************************************************************** +** +** test_misc34(): Ensure zero-size memory allocations work +** +****************************************************************/ +static void +test_misc34(void) +{ + void *mem = NULL; /* allocated buffer */ + char *dup = NULL; /* 'duplicated' string */ + size_t sz = 0; /* buffer size */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing O and NULL behavior in H5MM API calls")); + + /* H5MM_xfree(): Ensure that passing NULL is allowed and returns NULL */ + mem = H5MM_xfree(mem); + CHECK_PTR_NULL(mem, "H5MM_xfree"); + + /* H5MM_malloc(): Ensure that size 0 returns NULL */ + mem = H5MM_malloc(sz); + CHECK_PTR_NULL(mem, "H5MM_malloc"); + mem = H5MM_xfree(mem); + + /* H5MM_calloc(): Ensure that size 0 returns NULL */ + mem = H5MM_calloc(sz); + CHECK_PTR_NULL(mem, "H5MM_calloc"); + mem = H5MM_xfree(mem); + + /* H5MM_realloc(): Check behavior: + * + * H5MM_realloc(NULL, size) <==> H5MM_malloc(size) + * H5MM_realloc(ptr, 0) <==> H5MM_xfree(ptr) + * H5MM_realloc(NULL, 0) <==> NULL + */ + mem = H5MM_xfree(mem); + + sz = 1024; + mem = H5MM_realloc(mem, sz); + CHECK_PTR(mem, "H5MM_realloc (case 1)"); + /* Don't free mem here! */ + + sz = 0; + mem = H5MM_realloc(mem, sz); + CHECK_PTR_NULL(mem, "H5MM_realloc (case 2)"); + mem = H5MM_xfree(mem); + + mem = H5MM_realloc(mem, sz); + CHECK_PTR_NULL(mem, "H5MM_realloc (case 3)"); + mem = H5MM_xfree(mem); + + /* H5MM_xstrdup(): Ensure NULL returns NULL */ + dup = H5MM_xstrdup((const char *)mem); + CHECK_PTR_NULL(dup, "H5MM_xstrdup"); + dup = (char *)H5MM_xfree((void *)dup); + +} /* end test_misc34() */ + /**************************************************************** ** @@ -5575,6 +5634,7 @@ test_misc(void) test_misc31(); /* Test Reentering library through deprecated routines after H5close() */ test_misc32(); /* Test filter memory allocation functions */ test_misc33(); /* Test to verify that H5HL_offset_into() returns error if offset exceeds heap block */ + test_misc34(); /* Test behavior of 0 and NULL in H5MM API calls */ } /* test_misc() */ @@ -5632,5 +5692,5 @@ cleanup_misc(void) HDremove(MISC29_COPY_FILE); HDremove(MISC30_FILE); HDremove(MISC31_FILE); -} +} /* end cleanup_misc() */ -- cgit v0.12 From 0b846cee58af147e92a3ba7db45497fd9eaa09b4 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 9 Nov 2017 20:04:12 -0800 Subject: Cleaned up misc warnings in src and test. --- src/H5Dchunk.c | 2 +- src/H5Dcompact.c | 2 +- src/H5Dcontig.c | 2 +- src/H5FSint.c | 3 +-- src/H5Gnode.c | 6 +++--- test/filenotclosed.c | 6 +++--- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index af6599a..0d7fcc9 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -5720,7 +5720,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) 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; + H5D_shared_t *shared_fo = (H5D_shared_t *)udata->cpy_info->shared_fo; /* See if the written chunk is in the chunk cache */ if(shared_fo && shared_fo->cache.chunk.nslots > 0) { diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 041d28f..43e7754 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -431,7 +431,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds 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 */ + H5D_shared_t *shared_fo = (H5D_shared_t *)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 */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 86de017..aab4901 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -1363,7 +1363,7 @@ 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 */ + H5D_shared_t *shared_fo = (H5D_shared_t *)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 */ diff --git a/src/H5FSint.c b/src/H5FSint.c index 4297291..264950d 100644 --- a/src/H5FSint.c +++ b/src/H5FSint.c @@ -96,10 +96,9 @@ H5FS_init(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOERR /* FUNC_ENTER() does all the work */ -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FS_init() */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 76e2c4b..b335624 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -640,7 +640,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, while(lt < rt) { 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") + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get symbol table name") /* Check if symbol is already present */ if(0 == (cmp = HDstrcmp(udata->common.name, s))) @@ -802,8 +802,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; - 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") + if((s = (const char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get symbol table name") cmp = HDstrcmp(udata->common.name, s); if(cmp < 0) rt = idx; diff --git a/test/filenotclosed.c b/test/filenotclosed.c index d1f468a..2c5c8dc 100644 --- a/test/filenotclosed.c +++ b/test/filenotclosed.c @@ -19,8 +19,8 @@ #include "h5test.h" -#define FILENAME "filenotclosed" -#define DATASET "dset" +#define FILENAME "filenotclosed" +#define DATASET_NAME "dset" /*------------------------------------------------------------------------- * Function: catch_signal @@ -114,7 +114,7 @@ main(void) TEST_ERROR /* Create the dataset */ - if((did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if((did = H5Dcreate2(fid, DATASET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR /* Write to the dataset */ -- cgit v0.12 From 576b9c5f5f955aa64814de2ec9f0493656e82f53 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 10 Nov 2017 16:37:40 -0600 Subject: Fix HDFFV-10274. When deleting all (or almost all) of the messages in an object header chunk, where the total amount deleted was greater than 64K, an error would occur due to an off by one error in the code that handled that case. Fixed this and added a test case. --- src/H5Oalloc.c | 15 ++++----- test/tattr.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 7 deletions(-) diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 3512d3e..478d950 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -2434,16 +2434,17 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) oh->nmesgs++; /* Initialize new null message to make the chunk large enough */ - oh->mesg[oh->nmesgs].type = H5O_MSG_NULL; - oh->mesg[oh->nmesgs].dirty = TRUE; - oh->mesg[oh->nmesgs].native = NULL; - oh->mesg[oh->nmesgs].raw = old_image + new_size + sizeof_msghdr - sizeof_chksum; - oh->mesg[oh->nmesgs].raw_size = MAX(H5O_ALIGN_OH(oh, min_chunk_size - total_msg_size), + curr_msg = &oh->mesg[oh->nmesgs - 1]; + curr_msg->type = H5O_MSG_NULL; + curr_msg->dirty = TRUE; + curr_msg->native = NULL; + curr_msg->raw = old_image + new_size + sizeof_msghdr - sizeof_chksum; + curr_msg->raw_size = MAX(H5O_ALIGN_OH(oh, min_chunk_size - total_msg_size), sizeof_msghdr) - sizeof_msghdr; - oh->mesg[oh->nmesgs].chunkno = chunkno; + curr_msg->chunkno = chunkno; /* update the new chunk size */ - new_size += oh->mesg[oh->nmesgs].raw_size + sizeof_msghdr; + new_size += curr_msg->raw_size + sizeof_msghdr; } /* end if */ /* Check for changing the chunk #0 data size enough to need adjusting the flags */ diff --git a/test/tattr.c b/test/tattr.c index 3b0c90e..5b00edc 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -10578,6 +10578,102 @@ test_attr_bug8(hid_t fcpl, hid_t fapl) /**************************************************************** ** +** test_attr_bug9(): Test basic H5A (attribute) code. +** (Really tests object header code). +** Tests adding several large attributes to an object until +** they convert to dense storage. The total size of all +** attributes is larger than 64K, causing the internal +** object header code to, after merging the deleted +** messages in to a NULL message, shrink the object header +** chunk. Do this twice: once with only attributes in the +** object header chunk and once with a (small) soft link in +** the chunk as well. In both cases, the shrunk chunk will +** initally be too small and a new NULL message must be +** created. +** +****************************************************************/ +static void +test_attr_bug9(hid_t fcpl, hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t gid; /* Group ID */ + hid_t aid; /* Attribute ID */ + hid_t sid; /* Dataspace ID */ + hsize_t dims[1] = {32768}; /* Attribute dimensions */ + int create_link; /* Whether to create a soft link */ + unsigned max_compact; /* Setting from fcpl */ + unsigned min_dense; /* Setting from fcpl */ + char aname[11]; /* Attribute name */ + unsigned i; /* Local index variable */ + herr_t ret; /* Generic return status */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing that attributes can always be added to named datatypes\n")); + + /* Create dataspace */ + sid = H5Screate_simple(1, dims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + /* Obtain attribute phase change settings */ + ret = H5Pget_attr_phase_change(fcpl, &max_compact, &min_dense); + CHECK(ret, FAIL, "H5Pget_attr_phase_change"); + + /* Run with and without the soft link */ + for(create_link = 0; create_link < 2; create_link++) { + /* Create file */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create second group */ + gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Close second group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open root group */ + gid = H5Gopen2(fid, "/", H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); + + /* Create enough attributes to cause a change to dense storage */ + for(i = 0; i < max_compact + 1; i++) { + /* Create attribute */ + snprintf(aname, sizeof(aname), "%u", i); + aid = H5Acreate2(gid, aname, H5T_NATIVE_CHAR, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Create enough soft links that exactly one goes into chunk 1 if + * requested */ + if(i == 0 && create_link) { + ret = H5Lcreate_soft("b", gid, "a", H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Lcreate_soft"); + ret = H5Lcreate_soft("d", gid, "c", H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Lcreate_soft"); + ret = H5Lcreate_soft("f", gid, "e", H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Lcreate_soft"); + } /* end if */ + } /* end for */ + + /* Close IDs */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } /* end for */ + + /* Close dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_attr_bug9() */ + +/**************************************************************** +** ** test_attr(): Main H5A (attribute) testing routine. ** ****************************************************************/ @@ -10724,6 +10820,7 @@ test_attr(void) test_attr_bug6(my_fcpl, my_fapl); /* Test reading empty attribute */ test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */ test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */ + test_attr_bug9(my_fcpl, my_fapl); /* Test large attributes converting to dense storage */ } /* end for */ } /* end if */ else { @@ -10752,6 +10849,7 @@ test_attr(void) * header format and in fact fails if used with the old format, due * to the attributes being larger than 64K */ test_attr_bug8(fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */ + test_attr_bug9(fcpl, my_fapl); /* Test large attributes converting to dense storage */ } /* end else */ } /* end for */ -- cgit v0.12 From 3a5e15819163e6e7c3de72a9ed8517ff200b02a7 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 12 Nov 2017 21:14:01 -0800 Subject: Fixed the problems with LDFLAGS and AM_LDFLAGS in filter plugins. --- test/Makefile.am | 8 ++++---- tools/test/h5diff/Makefile.am | 2 +- tools/test/h5dump/Makefile.am | 2 +- tools/test/h5ls/Makefile.am | 2 +- tools/test/h5repack/Makefile.am | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 4f192ac..efdc1ca 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -110,10 +110,10 @@ if HAVE_SHARED_CONDITIONAL libfilter_plugin2_dsets_la_SOURCES=filter_plugin2_dsets.c libfilter_plugin3_dsets_la_SOURCES=filter_plugin3_dsets.c libfilter_plugin4_groups_la_SOURCES=filter_plugin4_groups.c - libfilter_plugin1_dsets_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere - libfilter_plugin2_dsets_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere - libfilter_plugin3_dsets_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere - libfilter_plugin4_groups_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libfilter_plugin1_dsets_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere + libfilter_plugin2_dsets_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere + libfilter_plugin3_dsets_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere + libfilter_plugin4_groups_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere else # The libh5test library provides common support code for the tests. noinst_LTLIBRARIES=libh5test.la diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index 4d43a2a..a2ce9c4 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -52,7 +52,7 @@ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. noinst_LTLIBRARIES=libdynlibdiff.la libdynlibdiff_la_SOURCES=dynlib_diff.c - libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlibdiff_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere 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 be21119..a7a2bcb 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -41,7 +41,7 @@ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. noinst_LTLIBRARIES=libdynlibdump.la libdynlibdump_la_SOURCES=dynlib_dump.c - libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlibdump_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere 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 a49c2e8..f5ec0f7 100644 --- a/tools/test/h5ls/Makefile.am +++ b/tools/test/h5ls/Makefile.am @@ -38,7 +38,7 @@ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. noinst_LTLIBRARIES=libdynlibls.la libdynlibls_la_SOURCES=dynlib_ls.c - libdynlibls_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlibls_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere endif diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index fbe88bd..ce7cad4 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -48,8 +48,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 -rpath /nowhere - libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlibadd_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlibvers_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere endif -- cgit v0.12 From a25366cc980695cebe40c2d471bfe5166dcb28a2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 12 Nov 2017 23:22:39 -0800 Subject: Fixed that annoying ar warning about -u being ignored. --- config/linux-gnulibc1 | 5 +++++ configure.ac | 2 ++ src/libhdf5.settings.in | 1 + 3 files changed, 8 insertions(+) diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 39225e7..c32f64e 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -30,6 +30,11 @@ if test -z "$CC"; then fi fi +# Set flags for gnu ar (apparently via libtool, so AR_FLAGS, not ARFLAGS) +# If you don't do this, you will get warnings about the 'u' in +# automake's default 'cru' args. +AR_FLAGS=crD + # Figure out GNU C compiler flags . $srcdir/config/gnu-flags diff --git a/configure.ac b/configure.ac index d8f3873..50893f7 100644 --- a/configure.ac +++ b/configure.ac @@ -99,6 +99,7 @@ AC_CONFIG_COMMANDS([pubconf], [ AC_CANONICAL_HOST AC_SUBST([CPPFLAGS]) AC_SUBST([JNIFLAGS]) +AC_SUBST([AR_FLAGS]) ## H5_CFLAGS (and company) are for CFLAGS that should be used on HDF5, but ## not exported to h5cc (or h5fc, etc.) @@ -139,6 +140,7 @@ JNIFLAGS="${JNIFLAGS}" JAVACFLAGS="${JAVACFLAGS}" JAVAFLAGS="${JAVAFLAGS}" LDFLAGS="${LDFLAGS}" +AR_FLAGS="${AR_FLAGS}" ## Configure may need to alter any of the *FLAGS variables in order for ## various checks to work correctly. Save the user's value here so it diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index 8017594..51b24dc 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -28,6 +28,7 @@ Linking Options: AM_LDFLAGS: @AM_LDFLAGS@ Extra libraries: @LIBS@ Archiver: @AR@ + AR_FLAGS: @AR_FLAGS@ Ranlib: @RANLIB@ Languages: -- cgit v0.12 From bca20b40b4966552a844051c3d912d6aec50592f Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Mon, 13 Nov 2017 13:43:32 -0600 Subject: Initialize hid_t variables in test_Attr_bug9. --- test/tattr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/tattr.c b/test/tattr.c index 5b00edc..5eaa882 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -10595,10 +10595,10 @@ test_attr_bug8(hid_t fcpl, hid_t fapl) static void test_attr_bug9(hid_t fcpl, hid_t fapl) { - hid_t fid; /* File ID */ - hid_t gid; /* Group ID */ - hid_t aid; /* Attribute ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t sid = -1; /* Dataspace ID */ hsize_t dims[1] = {32768}; /* Attribute dimensions */ int create_link; /* Whether to create a soft link */ unsigned max_compact; /* Setting from fcpl */ -- cgit v0.12 From 00e640368e71eac1adeb9f630c6de15261b26083 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 14 Nov 2017 09:47:04 -0600 Subject: Fix Windows link error --- test/tattr.c | 758 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 379 insertions(+), 379 deletions(-) diff --git a/test/tattr.c b/test/tattr.c index 5eaa882..d7152ed 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: tattr +* Test program: tattr * * Test the attribute functionality * @@ -27,25 +27,25 @@ * This file needs to access private information from the H5O package. * This file also needs to access the object header testing code. */ -#define H5O_FRIEND /*suppress error about including H5Opkg */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ #define H5O_TESTING -#include "H5Opkg.h" /* Object headers */ +#include "H5Opkg.h" /* Object headers */ /* * This file needs to access private information from the H5A package. * This file also needs to access the attribute testing code. */ -#define H5A_FRIEND /*suppress error about including H5Apkg */ +#define H5A_FRIEND /*suppress error about including H5Apkg */ #define H5A_TESTING -#include "H5Apkg.h" /* Attributes */ +#include "H5Apkg.h" /* Attributes */ /* * This file needs to access private information from the H5F package. * This file also needs to access the file testing code. */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING -#include "H5Fpkg.h" /* File access */ +#include "H5Fpkg.h" /* File access */ #define FILENAME "tattr.h5" #define NAME_BUF_SIZE 1024 @@ -55,10 +55,10 @@ #define CORDER_ITER_STOP 3 /* 3-D dataset with fixed dimensions */ -#define SPACE1_RANK 3 -#define SPACE1_DIM1 3 -#define SPACE1_DIM2 15 -#define SPACE1_DIM3 13 +#define SPACE1_RANK 3 +#define SPACE1_DIM1 3 +#define SPACE1_DIM2 15 +#define SPACE1_DIM3 13 /* Dataset Information */ #define DSET1_NAME "Dataset1" @@ -76,8 +76,8 @@ /* Attribute Rank & Dimensions */ #define ATTR1_NAME "Attr1" -#define ATTR1_RANK 1 -#define ATTR1_DIM1 3 +#define ATTR1_RANK 1 +#define ATTR1_DIM1 3 int attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */ /* rank & dimensions for another attribute */ @@ -85,25 +85,25 @@ int attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */ int attr_data1a[ATTR1_DIM1]={256,11945,-22107}; #define ATTR2_NAME "Attr2" -#define ATTR2_RANK 2 -#define ATTR2_DIM1 2 -#define ATTR2_DIM2 2 +#define ATTR2_RANK 2 +#define ATTR2_DIM1 2 +#define ATTR2_DIM2 2 int attr_data2[ATTR2_DIM1][ATTR2_DIM2]={{7614,-416},{197814,-3}}; /* Test data for 2nd attribute */ #define ATTR3_NAME "Attr3" -#define ATTR3_RANK 3 -#define ATTR3_DIM1 2 -#define ATTR3_DIM2 2 -#define ATTR3_DIM3 2 +#define ATTR3_RANK 3 +#define ATTR3_DIM1 2 +#define ATTR3_DIM2 2 +#define ATTR3_DIM3 2 double attr_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3]={{{2.3F,-26.1F}, {0.123F,-10.0F}},{{973.23F,-0.91827F},{2.0F,23.0F}}}; /* Test data for 3rd attribute */ #define ATTR4_NAME "Attr4" -#define ATTR4_RANK 2 -#define ATTR4_DIM1 2 -#define ATTR4_DIM2 2 -#define ATTR4_FIELDNAME1 "i" -#define ATTR4_FIELDNAME2 "d" -#define ATTR4_FIELDNAME3 "c" +#define ATTR4_RANK 2 +#define ATTR4_DIM1 2 +#define ATTR4_DIM2 2 +#define ATTR4_FIELDNAME1 "i" +#define ATTR4_FIELDNAME2 "d" +#define ATTR4_FIELDNAME3 "c" size_t attr4_field1_off=0; size_t attr4_field2_off=0; size_t attr4_field3_off=0; @@ -115,13 +115,13 @@ struct attr4_struct { {{-23,981724.2F,'Q'},{0,2.0F,'\n'}}}; /* Test data for 4th attribute */ #define ATTR5_NAME "Attr5" -#define ATTR5_RANK 0 +#define ATTR5_RANK 0 float attr_data5=-5.123F; /* Test data for 5th attribute */ -#define ATTR6_RANK 3 -#define ATTR6_DIM1 100 -#define ATTR6_DIM2 100 -#define ATTR6_DIM3 100 +#define ATTR6_RANK 3 +#define ATTR6_DIM1 100 +#define ATTR6_DIM2 100 +#define ATTR6_DIM3 100 #define ATTR7_NAME "attr 1 - 000000" #define ATTR8_NAME "attr 2" @@ -163,21 +163,21 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo, static void test_attr_basic_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr, attr2; /* Attribute ID */ hsize_t attr_size; /* storage size for attribute */ ssize_t attr_name_size; /* size of attribute name */ char *attr_name=NULL; /* name of attribute */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ int i; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Writing Functions\n")); @@ -278,7 +278,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size + 1), sizeof(char)); CHECK(attr_name, NULL, "HDcalloc"); - + if(attr_name) { ret = (herr_t)H5Aget_name(attr, (size_t)(attr_name_size + 1), attr_name); CHECK(ret, FAIL, "H5Aget_name"); @@ -314,7 +314,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char)); CHECK(attr_name, NULL, "HDcalloc"); - + if(attr_name) { ret = (herr_t)H5Aget_name(attr2, (size_t)(attr_name_size + 1), attr_name); CHECK(ret, FAIL, "H5Aget_name"); @@ -402,15 +402,15 @@ test_attr_basic_write(hid_t fapl) static void test_attr_basic_read(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t attr; /* Attribute ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t attr; /* Attribute ID */ H5O_info_t oinfo; /* Object info */ int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */ int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */ int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -500,7 +500,7 @@ test_attr_flush(hid_t fapl) set; /* Dataset ID */ double wdata=3.14159F; /* Data to write */ double rdata; /* Data read in */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Flushing\n")); @@ -560,15 +560,15 @@ test_attr_flush(hid_t fapl) static void test_attr_plist(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ hid_t plist; /* Property list ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; H5T_cset_t cset; /* Character set for attributes */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Property Lists\n")); @@ -674,15 +674,15 @@ test_attr_plist(hid_t fapl) static void test_attr_compound_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ hid_t tid1; /* Attribute datatype ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -762,11 +762,11 @@ test_attr_compound_write(hid_t fapl) static void test_attr_compound_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ + hid_t fid1; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ int rank; /* Attribute rank */ hsize_t dims[ATTR_MAX_DIMS]; /* Attribute dimensions */ @@ -781,7 +781,7 @@ test_attr_compound_read(hid_t fapl) ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -912,13 +912,13 @@ test_attr_compound_read(hid_t fapl) static void test_attr_scalar_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -978,14 +978,14 @@ test_attr_scalar_write(hid_t fapl) static void test_attr_scalar_read(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ H5S_class_t stype; /* Dataspace class */ float rdata = 0.0F; /* Buffer for reading 1st attribute */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Reading Functions\n")); @@ -1013,8 +1013,8 @@ test_attr_scalar_read(hid_t fapl) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(rdata, attr_data5)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); /* Get the attribute's dataspace */ sid = H5Aget_space(attr); @@ -1050,16 +1050,16 @@ test_attr_scalar_read(hid_t fapl) static void test_attr_mult_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -1170,11 +1170,11 @@ test_attr_mult_write(hid_t fapl) static void test_attr_mult_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ + hid_t fid1; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ char temp_name[ATTR_NAME_LEN]; /* Buffer for mangling attribute names */ int rank; /* Attribute rank */ @@ -1188,7 +1188,7 @@ test_attr_mult_read(hid_t fapl) ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j, k; /* Local index values */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1432,12 +1432,12 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR static void test_attr_iterate(hid_t fapl) { - hid_t file; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t file; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ int count; /* operator data for the iterator */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1504,13 +1504,13 @@ test_attr_iterate(hid_t fapl) static void test_attr_delete(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t attr; /* Attribute ID */ + hid_t fid1; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1635,7 +1635,7 @@ test_attr_dtype_shared(hid_t fapl) H5O_info_t oinfo; /* Object's information */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Shared Datatypes with Attributes\n")); @@ -1802,17 +1802,17 @@ test_attr_dtype_shared(hid_t fapl) static void test_attr_duplicate_ids(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t gid1, gid2; /* Group ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t gid1, gid2; /* Group ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr, attr2; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ int i; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two ID handles\n")); @@ -2047,12 +2047,12 @@ test_attr_duplicate_ids(hid_t fapl) static int test_attr_dense_verify(hid_t loc_id, unsigned max_attr) { - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - hid_t attr; /* Attribute ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t attr; /* Attribute ID */ unsigned value; /* Attribute value */ unsigned u; /* Local index variable */ int old_nerrs; /* Number of errors when entering this check */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -2117,19 +2117,19 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) static void test_attr_dense_create(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dense Attribute Storage Creation\n")); @@ -2248,19 +2248,19 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) static void test_attr_dense_open(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Opening Attributes in Dense Storage\n")); @@ -2387,20 +2387,20 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) static void test_attr_dense_delete(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Attributes in Dense Storage\n")); @@ -2565,21 +2565,21 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) static void test_attr_dense_rename(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Renaming Attributes in Dense Storage\n")); @@ -2724,21 +2724,21 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) static void test_attr_dense_unlink(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ size_t mesg_count; /* # of shared messages */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Unlinking Object with Attributes in Dense Storage\n")); @@ -2854,19 +2854,19 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) static void test_attr_dense_limits(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact, rmax_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense, rmin_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Phase Change Limits For Attributes in Dense Storage\n")); @@ -3019,23 +3019,23 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) static void test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t gid1, gid2; /* Group ID */ - hid_t sid, sid2; /* Dataspace ID */ - hid_t attr, attr2, add_attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - hsize_t dims[] = {ATTR1_DIM1}; + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t gid1, gid2; /* Group ID */ + hid_t sid, sid2; /* Dataspace ID */ + hid_t attr, attr2, add_attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hsize_t dims[] = {ATTR1_DIM1}; int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading attribute */ int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ unsigned scalar_data = 1317; /* scalar data for attribute */ unsigned read_scalar; /* variable for reading attribute*/ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u, i; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two IDs for Dense Storage\n")); @@ -3542,24 +3542,24 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) static void test_attr_big(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t big_sid; /* "Big" dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t big_sid; /* "Big" dataspace ID */ hsize_t dims[ATTR6_RANK] = {ATTR6_DIM1, ATTR6_DIM2, ATTR6_DIM3}; /* Attribute dimensions */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ unsigned nshared_indices; /* # of shared message indices */ H5F_libver_t low, high; /* File format bounds */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Storing 'Big' Attributes in Dense Storage\n")); @@ -3812,20 +3812,20 @@ test_attr_big(hid_t fcpl, hid_t fapl) static void test_attr_null_space(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t null_sid; /* "null" dataspace ID */ - hid_t attr_sid; /* Attribute's dataspace ID */ - hid_t attr; /* Attribute ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t null_sid; /* "null" dataspace ID */ + hid_t attr_sid; /* Attribute's dataspace ID */ + hid_t attr; /* Attribute ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned value; /* Attribute value */ htri_t cmp; /* Results of comparison */ hsize_t storage_size; /* Size of storage for attribute */ H5A_info_t ainfo; /* Attribute info */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Storing Attributes with 'null' dataspace\n")); @@ -4031,11 +4031,11 @@ static void test_attr_deprec(hid_t fcpl, hid_t fapl) { #ifndef H5_NO_DEPRECATED_SYMBOLS - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - herr_t ret; /* Generic return value */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deprecated Attribute Routines\n")); @@ -4139,15 +4139,15 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) static void test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t gid; /* Group ID */ - hid_t sid; /* Dataspace ID */ - hid_t aid; /* Attribute ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t gid; /* Group ID */ + hid_t sid; /* Dataspace ID */ + hid_t aid; /* Attribute ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned nattr = (new_format ? NATTR_MANY_NEW : NATTR_MANY_OLD); /* Number of attributes */ htri_t exists; /* Whether the attribute exists or not */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Storing Many Attributes\n")); @@ -4268,14 +4268,14 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) static void test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned crt_order_flags;/* Creation order flags */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ - herr_t ret; /* Generic return value */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Code for Attributes with Creation Order Info\n")); @@ -4384,21 +4384,21 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) static void test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Compact Storage of Attributes with Creation Order Info\n")); @@ -4582,23 +4582,23 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) static void test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dense Storage of Attributes with Creation Order Info\n")); @@ -4816,7 +4816,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) hid_t sid = -1; /* Dataspace ID */ hid_t aid = -1; /* Attribute ID */ int buf; /* Attribute data */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Creating Attributes w/New & Old Format\n")); @@ -4917,23 +4917,23 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) static void test_attr_corder_transition(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Storage Transitions of Attributes with Creation Order Info\n")); @@ -5323,28 +5323,28 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) static void test_attr_corder_delete(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ unsigned reopen_file; /* Whether to re-open the file before deleting group */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ #ifdef LATER h5_stat_size_t empty_size; /* Size of empty file */ h5_stat_size_t file_size; /* Size of file after operating on it */ #endif /* LATER */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Object w/Dense Attribute Storage and Creation Order Info\n")); @@ -5521,7 +5521,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) * Purpose: Support routine for attr_info_by_idx, to verify the attribute * info is correct for a attribute * - * Note: This routine assumes that the attributes have been added to the + * Note: This routine assumes that the attributes have been added to the * object in alphabetical order. * * Return: Success: 0 @@ -5539,7 +5539,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ H5A_info_t ainfo; /* Attribute info struct */ int old_nerrs; /* Number of errors when entering this check */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -5671,26 +5671,26 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, static void test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ H5A_info_t ainfo; /* Attribute information */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ unsigned use_index; /* Use index on creation order values */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -5881,28 +5881,28 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) static void test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ H5A_info_t ainfo; /* Attribute information */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ unsigned use_index; /* Use index on creation order values */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -6822,16 +6822,16 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, static void test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ @@ -6842,10 +6842,10 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t idx; /* Start index for iteration */ unsigned use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -7138,7 +7138,7 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5A_info_t ainfo; /* Attribute info */ int old_nerrs; /* Number of errors when entering this check */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -7186,27 +7186,27 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, static void test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ unsigned use_index; /* Use index on creation order values */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -7458,10 +7458,10 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, { hid_t attr_id; /* ID of attribute to test */ H5A_info_t ainfo; /* Attribute info */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ int old_nerrs; /* Number of errors when entering this check */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -7534,26 +7534,26 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, static void test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ unsigned use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -7789,25 +7789,25 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) static void test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ unsigned use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -8012,28 +8012,28 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) static void test_attr_shared_write(hid_t fcpl, hid_t fapl) { - hid_t fid; /* File ID */ - hid_t my_fcpl; /* File creation property list ID */ - hid_t dataset, dataset2; /* Dataset IDs */ - hid_t attr_tid; /* Attribute's datatype ID */ - hid_t sid, big_sid; /* Dataspace IDs */ - hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* File ID */ + hid_t my_fcpl; /* File creation property list ID */ + hid_t dataset, dataset2; /* Dataset IDs */ + hid_t attr_tid; /* Attribute's datatype ID */ + hid_t sid, big_sid; /* Dataspace IDs */ + hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ - htri_t is_shared; /* Is attributes shared? */ + htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_shared; /* Is attributes shared? */ hsize_t shared_refcount; /* Reference count of shared attribute */ unsigned attr_value; /* Attribute value */ - unsigned *big_value; /* Data for "big" attribute */ + unsigned *big_value; /* Data for "big" attribute */ size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Writing Shared & Unshared Attributes in Compact & Dense Storage\n")); @@ -8342,29 +8342,29 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) static void test_attr_shared_rename(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t my_fcpl; /* File creation property list ID */ - hid_t dataset, dataset2; /* Dataset ID2 */ - hid_t attr_tid; /* Attribute's datatype ID */ - hid_t sid, big_sid; /* Dataspace IDs */ - hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ - char attrname2[NAME_BUF_SIZE]; /* Name of attribute on second dataset */ + hid_t fid; /* HDF5 File ID */ + hid_t my_fcpl; /* File creation property list ID */ + hid_t dataset, dataset2; /* Dataset ID2 */ + hid_t attr_tid; /* Attribute's datatype ID */ + hid_t sid, big_sid; /* Dataspace IDs */ + hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ + char attrname2[NAME_BUF_SIZE]; /* Name of attribute on second dataset */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ - htri_t is_shared; /* Is attributes shared? */ + htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_shared; /* Is attributes shared? */ hsize_t shared_refcount; /* Reference count of shared attribute */ unsigned attr_value; /* Attribute value */ - unsigned *big_value; /* Data for "big" attribute */ + unsigned *big_value; /* Data for "big" attribute */ size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Renaming Shared & Unshared Attributes in Compact & Dense Storage\n")); @@ -8789,28 +8789,28 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) static void test_attr_shared_delete(hid_t fcpl, hid_t fapl) { - hid_t fid; /* File ID */ - hid_t my_fcpl; /* File creation property list ID */ - hid_t dataset, dataset2; /* Dataset IDs */ - hid_t attr_tid; /* Attribute's datatype ID */ - hid_t sid, big_sid; /* Dataspace IDs */ - hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ + hid_t fid; /* File ID */ + hid_t my_fcpl; /* File creation property list ID */ + hid_t dataset, dataset2; /* Dataset IDs */ + hid_t attr_tid; /* Attribute's datatype ID */ + hid_t sid, big_sid; /* Dataspace IDs */ + hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ - htri_t is_shared; /* Is attributes shared? */ + htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_shared; /* Is attributes shared? */ hsize_t shared_refcount; /* Reference count of shared attribute */ unsigned attr_value; /* Attribute value */ - unsigned *big_value; /* Data for "big" attribute */ + unsigned *big_value; /* Data for "big" attribute */ size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Shared & Unshared Attributes in Compact & Dense Storage\n")); @@ -9158,28 +9158,28 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) static void test_attr_shared_unlink(hid_t fcpl, hid_t fapl) { - hid_t fid; /* File ID */ - hid_t my_fcpl; /* File creation property list ID */ - hid_t dataset, dataset2; /* Dataset IDs */ - hid_t attr_tid; /* Attribute's datatype ID */ - hid_t sid, big_sid; /* Dataspace IDs */ - hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ + hid_t fid; /* File ID */ + hid_t my_fcpl; /* File creation property list ID */ + hid_t dataset, dataset2; /* Dataset IDs */ + hid_t attr_tid; /* Attribute's datatype ID */ + hid_t sid, big_sid; /* Dataspace IDs */ + hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ - htri_t is_shared; /* Is attributes shared? */ + htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_shared; /* Is attributes shared? */ hsize_t shared_refcount; /* Reference count of shared attribute */ unsigned attr_value; /* Attribute value */ - unsigned *big_value; /* Data for "big" attribute */ + unsigned *big_value; /* Data for "big" attribute */ size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Unlinking Object with Shared Attributes in Compact & Dense Storage\n")); @@ -10639,7 +10639,7 @@ test_attr_bug9(hid_t fcpl, hid_t fapl) /* Create enough attributes to cause a change to dense storage */ for(i = 0; i < max_compact + 1; i++) { /* Create attribute */ - snprintf(aname, sizeof(aname), "%u", i); + HDsnprintf(aname, sizeof(aname), "%u", i); aid = H5Acreate2(gid, aname, H5T_NATIVE_CHAR, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); @@ -10680,8 +10680,8 @@ test_attr_bug9(hid_t fcpl, hid_t fapl) void test_attr(void) { - hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ - hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */ + hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ + hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */ unsigned new_format; /* Whether to use the new format or not */ unsigned use_shared; /* Whether to use shared attributes or not */ herr_t ret; /* Generic return value */ @@ -10868,13 +10868,13 @@ test_attr(void) /*------------------------------------------------------------------------- - * 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: -- cgit v0.12 From 10a9fb5319ab0dcd0e14e40a8ab5c38e8211f764 Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 14 Nov 2017 09:52:47 -0600 Subject: Remove extra '&'s that cause syntax errors on Macs. --- config/conclude.am | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/conclude.am b/config/conclude.am index 97aef27..4bdbb0b 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -126,40 +126,40 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: echo "No need to test $${tname} again."; \ else \ if test -n "$(REALTIMEOUTPUT)"; then \ - echo "============================" |& tee $${log}; \ + echo "============================" | tee $${log}; \ else \ echo "============================" > $${log}; \ fi; \ if test "X$(FORTRAN_API)" = "Xyes"; then \ echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ if test -n "$(REALTIMEOUTPUT)"; then \ - echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" |& tee -a $${log}; \ + echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \ else \ echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ fi; \ elif test "X$(CXX_API)" = "Xyes"; then \ echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ if test -n "$(REALTIMEOUTPUT)"; then \ - echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" |& tee -a $${log};\ + echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\ else \ echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\ fi; \ else \ echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ if test -n "$(REALTIMEOUTPUT)"; then \ - echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" |& tee -a $${log}; \ + echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \ else \ echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ fi; \ fi; \ if test -n "$(REALTIMEOUTPUT)"; then \ - echo "============================" |& tee -a $${log}; \ + echo "============================" | tee -a $${log}; \ else \ echo "============================" >> $${log}; \ fi; \ if test -n "$(REALTIMEOUTPUT)"; then \ srcdir="$(srcdir)" \ - $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) |& tee -a $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) | tee -a $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -172,8 +172,8 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "" >> $${log}; \ if test -n "$(REALTIMEOUTPUT)"; then \ - echo "Finished testing $${tname} $(TEST_FLAGS)" |& tee -a $${log}; \ - echo "============================" |& tee -a $${log}; \ + echo "Finished testing $${tname} $(TEST_FLAGS)" | tee -a $${log}; \ + echo "============================" | tee -a $${log}; \ else \ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \ echo "============================" >> $${log}; \ -- cgit v0.12 From 45b561f2f25d2e96a3f569e278919f454b3abf71 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 14 Nov 2017 12:34:31 -0800 Subject: Added H5Oint.c file. --- MANIFEST | 1 + src/CMakeLists.txt | 1 + src/H5O.c | 6 ++--- src/H5Oint.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 2 +- 5 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 src/H5Oint.c diff --git a/MANIFEST b/MANIFEST index cfe720e..9b91c78 100644 --- a/MANIFEST +++ b/MANIFEST @@ -753,6 +753,7 @@ ./src/H5Oflush.c ./src/H5Ofsinfo.c ./src/H5Oginfo.c +./src/H5Oint.c ./src/H5Olayout.c ./src/H5Olinfo.c ./src/H5Olink.c diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7ee423b..2dbef62 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -454,6 +454,7 @@ set (H5O_SOURCES ${HDF5_SRC_DIR}/H5Oflush.c ${HDF5_SRC_DIR}/H5Ofsinfo.c ${HDF5_SRC_DIR}/H5Oginfo.c + ${HDF5_SRC_DIR}/H5Oint.c ${HDF5_SRC_DIR}/H5Olayout.c ${HDF5_SRC_DIR}/H5Olinfo.c ${HDF5_SRC_DIR}/H5Olink.c diff --git a/src/H5O.c b/src/H5O.c index 152e6cc..3c78b04 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -13,11 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5O.c - * Aug 5 1997 - * Robb Matzke + * Created: H5O.c * - * Purpose: Object header routines. + * Purpose: Public object header routines * *------------------------------------------------------------------------- */ diff --git a/src/H5Oint.c b/src/H5Oint.c new file mode 100644 index 0000000..fbaad53 --- /dev/null +++ b/src/H5Oint.c @@ -0,0 +1,72 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*------------------------------------------------------------------------- + * + * Created: H5O.c + * + * Purpose: Internal object header routines + * + *------------------------------------------------------------------------- + */ + +/****************/ +/* Module Setup */ +/****************/ + +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Opkg.h" /* Object headers */ + + +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + diff --git a/src/Makefile.am b/src/Makefile.am index ad29e2a..d8d2cc2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -84,7 +84,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.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 \ + H5Oint.c H5Olayout.c \ H5Olinfo.c H5Olink.c H5Omessage.c H5Omtime.c \ H5Oname.c H5Onull.c H5Opline.c H5Orefcount.c \ H5Osdspace.c H5Oshared.c \ -- cgit v0.12 From addde7dcb832b50c16fae3605a904c9daf763a32 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 14 Nov 2017 15:07:19 -0600 Subject: Correct link lines of libraries --- CMakeLists.txt | 1 - fortran/src/CMakeLists.txt | 10 ++++++---- src/CMakeLists.txt | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f21f8b7..f2640b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -482,7 +482,6 @@ 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 () set (H5_ENABLE_STATIC_LIB YES) set (CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 51db4f0..e34c778 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -126,7 +126,7 @@ set (f90CStub_C_HDRS add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} STATIC) set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES @@ -139,7 +139,7 @@ set (install_targets ${HDF5_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_SHARED_LIBS}) + target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_F90_C_LIB_NAME} SHARED ${HDF5_F_PACKAGE_SOVERSION}) set_target_properties (${HDF5_F90_C_LIBSH_TARGET} PROPERTIES @@ -241,7 +241,8 @@ endif () add_library (${HDF5_F90_LIB_TARGET} STATIC ${f90_F_SOURCES}) set (SHARED_LINK_FLAGS " ") TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS}) +target_link_libraries (${HDF5_F90_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET}) +target_link_libraries (${HDF5_F90_LIB_TARGET} PRIVATE ${LINK_Fortran_LIBS}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () @@ -268,7 +269,8 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") 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} ${LINK_Fortran_LIBS}) + target_link_libraries (${HDF5_F90_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET}) + target_link_libraries (${HDF5_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7ee423b..e78d8b6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -882,7 +882,7 @@ set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${LINK_LIBS}) +target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) endif () @@ -926,7 +926,7 @@ if (BUILD_SHARED_LIBS) set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${LINK_SHARED_LIBS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) endif () -- cgit v0.12 From 7fbc3df3fa1b5250f13ef7ce7bbf9fc85eb76e0a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 14 Nov 2017 15:32:08 -0600 Subject: HDFFV-10329 - Note new JIRA issue --- release_docs/RELEASE.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a7465e5..f8ad620 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -170,6 +170,18 @@ Bug Fixes since HDF5-1.10.1 release Configuration ------------- + - cmake + + The hdf5 library used shared szip and zlib, which needlessly required + applications to link with the same szip and zlib libraries. + + Changed the target_link_libraries commands to use the static libs. + Removed improper link duplication of szip and zlib. + Adjusted the link dependencies and the link interface values of + the target_link_libraries commands. + + (ADB - 2017/11/14, HDFFV-10329) + - cmake MPI CMake implementation for MPI was problematic and would create incorrect -- cgit v0.12 From fcfc5f116d08642de962919ac26092c74b924644 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 14 Nov 2017 13:40:30 -0800 Subject: Moved code from H5O.c to H5Oint.c --- src/H5O.c | 2680 +----------------------------------------------------- src/H5Oint.c | 2641 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5Oprivate.h | 3 + 3 files changed, 2662 insertions(+), 2662 deletions(-) diff --git a/src/H5O.c b/src/H5O.c index 3c78b04..cf84b47 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -30,19 +30,12 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FLprivate.h" /* Free lists */ -#include "H5FOprivate.h" /* File objects */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Lprivate.h" /* Links */ -#include "H5MFprivate.h" /* File memory management */ -#ifdef H5O_ENABLE_BOGUS -#include "H5MMprivate.h" /* Memory management */ -#endif /* H5O_ENABLE_BOGUS */ -#include "H5Opkg.h" /* Object headers */ -#include "H5SMprivate.h" /* Shared object header messages */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ +#include "H5Opkg.h" /* Object headers */ /****************/ @@ -54,17 +47,6 @@ /* Local Typedefs */ /******************/ -/* User data for recursive traversal over objects from a group */ -typedef struct { - hid_t obj_id; /* The ID for the starting group */ - H5G_loc_t *start_loc; /* Location of starting group */ - hid_t lapl_id; /* LAPL for walking across links */ - hid_t dxpl_id; /* DXPL for operations */ - H5SL_t *visited; /* Skip list for tracking visited nodes */ - H5O_iterate_t op; /* Application callback */ - void *op_data; /* Application's op data */ -} H5O_iter_visit_ud_t; - /********************/ /* Package Typedefs */ @@ -75,136 +57,21 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh); -static herr_t H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type); -static herr_t H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, - H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id); -static herr_t H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr); -static const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh); - /*********************/ /* Package Variables */ /*********************/ -/* Package initialization variable */ -hbool_t H5_PKG_INIT_VAR = FALSE; - -/* Header message ID to class mapping */ - -/* Remember to increment H5O_MSG_TYPES in H5Opkg.h when adding a new - * message. - */ - -const H5O_msg_class_t *const H5O_msg_class_g[] = { - H5O_MSG_NULL, /*0x0000 Null */ - H5O_MSG_SDSPACE, /*0x0001 Dataspace */ - H5O_MSG_LINFO, /*0x0002 Link information */ - H5O_MSG_DTYPE, /*0x0003 Datatype */ - H5O_MSG_FILL, /*0x0004 Old data storage -- fill value */ - H5O_MSG_FILL_NEW, /*0x0005 New data storage -- fill value */ - H5O_MSG_LINK, /*0x0006 Link */ - H5O_MSG_EFL, /*0x0007 Data storage -- external data files */ - H5O_MSG_LAYOUT, /*0x0008 Data Layout */ -#ifdef H5O_ENABLE_BOGUS - H5O_MSG_BOGUS_VALID, /*0x0009 "Bogus valid" (for testing) */ -#else /* H5O_ENABLE_BOGUS */ - NULL, /*0x0009 "Bogus valid" (for testing) */ -#endif /* H5O_ENABLE_BOGUS */ - H5O_MSG_GINFO, /*0x000A Group information */ - H5O_MSG_PLINE, /*0x000B Data storage -- filter pipeline */ - H5O_MSG_ATTR, /*0x000C Attribute */ - H5O_MSG_NAME, /*0x000D Object name */ - H5O_MSG_MTIME, /*0x000E Object modification date and time */ - H5O_MSG_SHMESG, /*0x000F File-wide shared message table */ - H5O_MSG_CONT, /*0x0010 Object header continuation */ - H5O_MSG_STAB, /*0x0011 Symbol table */ - H5O_MSG_MTIME_NEW, /*0x0012 New Object modification date and time */ - H5O_MSG_BTREEK, /*0x0013 Non-default v1 B-tree 'K' values */ - H5O_MSG_DRVINFO, /*0x0014 Driver info settings */ - 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 */ -#ifdef H5O_ENABLE_BOGUS - H5O_MSG_BOGUS_INVALID, /*0x001A "Bogus invalid" (for testing) */ -#else /* H5O_ENABLE_BOGUS */ - NULL, /*0x001A "Bogus invalid" (for testing) */ -#endif /* H5O_ENABLE_BOGUS */ -}; - -/* Declare a free list to manage the H5O_t struct */ -H5FL_DEFINE(H5O_t); - -/* Declare a free list to manage the H5O_mesg_t sequence information */ -H5FL_SEQ_DEFINE(H5O_mesg_t); - -/* Declare a free list to manage the H5O_chunk_t sequence information */ -H5FL_SEQ_DEFINE(H5O_chunk_t); - -/* Declare a free list to manage the chunk image information */ -H5FL_BLK_DEFINE(chunk_image); - -/* Declare external the free list for H5O_cont_t sequences */ -H5FL_SEQ_EXTERN(H5O_cont_t); - /*****************************/ /* Library Private Variables */ /*****************************/ -/* Declare external the free list for time_t's */ -H5FL_EXTERN(time_t); - -/* Declare external the free list for H5_obj_t's */ -H5FL_EXTERN(H5_obj_t); - /*******************/ /* Local Variables */ /*******************/ -/* Header object ID to class mapping */ -/* - * Initialize the object class info table. Begin with the most general types - * and end with the most specific. For instance, any object that has a - * datatype message is a datatype but only some of them are datasets. - */ -static const H5O_obj_class_t *const H5O_obj_class_g[] = { - H5O_OBJ_DATATYPE, /* Datatype object (H5O_TYPE_NAMED_DATATYPE - 2) */ - H5O_OBJ_DATASET, /* Dataset object (H5O_TYPE_DATASET - 1) */ - H5O_OBJ_GROUP, /* Group object (H5O_TYPE_GROUP - 0) */ -}; - - - -/*------------------------------------------------------------------------- - * Function: H5O__init_package - * - * Purpose: Initialize information specific to H5O interface. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Thursday, January 18, 2007 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O__init_package(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* H5O interface sanity checks */ - HDcompile_assert(H5O_MSG_TYPES == NELMTS(H5O_msg_class_g)); - HDcompile_assert(sizeof(H5O_fheap_id_t) == H5O_FHEAP_ID_LEN); - - HDcompile_assert(H5O_UNKNOWN_ID < H5O_MSG_TYPES); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O__init_package() */ /*------------------------------------------------------------------------- @@ -300,11 +167,11 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(!group_name || !*group_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") /* Verify access property list and get correct dxpl */ if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) @@ -708,11 +575,11 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(!group_name || !*group_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") @@ -956,15 +823,15 @@ H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, /* Check args */ if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") /* Call internal object visitation routine */ if((ret_value = H5O_visit(obj_id, ".", idx_type, order, op, op_data, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") + HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: FUNC_LEAVE_API(ret_value) @@ -1018,9 +885,9 @@ H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(!obj_name || !*obj_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") @@ -1030,7 +897,7 @@ H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, /* Call internal object visitation routine */ if((ret_value = H5O_visit(loc_id, obj_name, idx_type, order, op, op_data, lapl_id, dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") + HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: FUNC_LEAVE_API(ret_value) @@ -1210,2514 +1077,3 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Oare_mdc_flushes_disabled() */ - -/*------------------------------------------------------------------------- - * Function: H5O_create - * - * Purpose: Creates a new object header. Allocates space for it and - * then calls an initialization function. The object header - * is opened for write access and should eventually be - * closed by calling H5O_close(). - * - * Return: Success: Non-negative, the ENT argument contains - * information about the object header, - * including its address. - * - * Failure: Negative - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 5 1997 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, - hid_t ocpl_id, H5O_loc_t *loc/*out*/) -{ - H5P_genplist_t *oc_plist; /* Object creation property list */ - H5O_t *oh = NULL; /* Object header created */ - haddr_t oh_addr; /* Address of initial object header */ - size_t oh_size; /* Size of initial object header */ - uint8_t oh_flags; /* Object header's initial status flags */ - unsigned insert_flags = H5AC__NO_FLAGS_SET; /* Flags for inserting object header into cache */ - hbool_t store_msg_crt_idx; /* Whether to always store message creation indices for this file */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* check args */ - HDassert(f); - HDassert(loc); - HDassert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE)); - - /* Check for invalid access request */ - if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) - HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "no write intent on file") - - /* Make certain we allocate at least a reasonable size for the object header */ - size_hint = H5O_ALIGN_F(f, MAX(H5O_MIN_SIZE, size_hint)); - - /* Get the property list */ - if(NULL == (oc_plist = (H5P_genplist_t *)H5I_object(ocpl_id))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a property list") - - /* Get any object header status flags set by properties */ - if(H5P_get(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &oh_flags) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get object header flags") - - /* Allocate the object header and zero out header fields */ - if(NULL == (oh = H5FL_CALLOC(H5O_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Initialize file-specific information for object header */ - store_msg_crt_idx = H5F_STORE_MSG_CRT_IDX(f); - if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_OBJ_HEADER) || store_msg_crt_idx || (oh_flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)) - oh->version = H5O_VERSION_LATEST; - else - oh->version = H5O_VERSION_1; - oh->sizeof_size = H5F_SIZEOF_SIZE(f); - oh->sizeof_addr = H5F_SIZEOF_ADDR(f); - oh->swmr_write = !!(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE); -#ifdef H5O_ENABLE_BAD_MESG_COUNT - /* Check whether the "bad message count" property is set */ - if(H5P_exist_plist(oc_plist, H5O_BAD_MESG_COUNT_NAME) > 0) { - /* Retrieve bad message count flag */ - if(H5P_get(oc_plist, H5O_BAD_MESG_COUNT_NAME, &oh->store_bad_mesg_count) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get bad message count flag") - } /* end if */ -#endif /* H5O_ENABLE_BAD_MESG_COUNT */ - - /* Create object header proxy if doing SWMR writes */ - if(oh->swmr_write) { - /* Create virtual entry, for use as proxy */ - if(NULL == (oh->proxy = H5AC_proxy_entry_create())) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create object header proxy") - } /* end if */ - else - oh->proxy = NULL; - - /* Set initial status flags */ - oh->flags = oh_flags; - - /* Initialize version-specific fields */ - if(oh->version > H5O_VERSION_1) { - /* Initialize all time fields with current time, if we are storing them */ - if(oh->flags & H5O_HDR_STORE_TIMES) - oh->atime = oh->mtime = oh->ctime = oh->btime = H5_now(); - else - oh->atime = oh->mtime = oh->ctime = oh->btime = 0; - - /* Make certain attribute creation order tracking is enabled if - * attributes can be shared in this file. - */ - if(store_msg_crt_idx) - oh->flags |= H5O_HDR_ATTR_CRT_ORDER_TRACKED; - - /* Retrieve attribute storage phase change values from property list */ - if(H5P_get(oc_plist, H5O_CRT_ATTR_MAX_COMPACT_NAME, &oh->max_compact) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get max. # of compact attributes") - if(H5P_get(oc_plist, H5O_CRT_ATTR_MIN_DENSE_NAME, &oh->min_dense) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get min. # of dense attributes") - - /* Check for non-default attribute storage phase change values */ - if(oh->max_compact != H5O_CRT_ATTR_MAX_COMPACT_DEF || oh->min_dense != H5O_CRT_ATTR_MIN_DENSE_DEF) - oh->flags |= H5O_HDR_ATTR_STORE_PHASE_CHANGE; - - /* Determine correct value for chunk #0 size bits */ -/* Avoid compiler warning on 32-bit machines */ -#if H5_SIZEOF_SIZE_T > H5_SIZEOF_INT32_T - if(size_hint > 4294967295UL) - oh->flags |= H5O_HDR_CHUNK0_8; - else -#endif /* H5_SIZEOF_SIZE_T > H5_SIZEOF_INT32_T */ - if(size_hint > 65535) - oh->flags |= H5O_HDR_CHUNK0_4; - else if(size_hint > 255) - oh->flags |= H5O_HDR_CHUNK0_2; - } /* end if */ - else { - /* Reset unused time fields */ - oh->atime = oh->mtime = oh->ctime = oh->btime = 0; - } /* end else */ - - /* Compute total size of initial object header */ - /* (i.e. object header prefix and first chunk) */ - oh_size = (size_t)H5O_SIZEOF_HDR(oh) + size_hint; - - /* Allocate disk space for header and first chunk */ - if(HADDR_UNDEF == (oh_addr = H5MF_alloc(f, H5FD_MEM_OHDR, dxpl_id, (hsize_t)oh_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for object header") - - /* Create the chunk list */ - oh->nchunks = oh->alloc_nchunks = 1; - if(NULL == (oh->chunk = H5FL_SEQ_MALLOC(H5O_chunk_t, (size_t)oh->alloc_nchunks))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Initialize the first chunk */ - oh->chunk[0].addr = oh_addr; - oh->chunk[0].size = oh_size; - oh->chunk[0].gap = 0; - - /* Allocate enough space for the first chunk */ - /* (including space for serializing the object header prefix */ - if(NULL == (oh->chunk[0].image = H5FL_BLK_CALLOC(chunk_image, oh_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - oh->chunk[0].chunk_proxy = NULL; - - /* Put magic # for object header in first chunk */ - if(oh->version > H5O_VERSION_1) - HDmemcpy(oh->chunk[0].image, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); - - /* Create the message list */ - oh->nmesgs = 1; - oh->alloc_nmesgs = H5O_NMESGS; - if(NULL == (oh->mesg = H5FL_SEQ_CALLOC(H5O_mesg_t, oh->alloc_nmesgs))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Initialize the initial "null" message, covering the entire first chunk */ - oh->mesg[0].type = H5O_MSG_NULL; - oh->mesg[0].dirty = TRUE; - oh->mesg[0].native = NULL; - oh->mesg[0].raw = oh->chunk[0].image + (H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh)) + H5O_SIZEOF_MSGHDR_OH(oh); - oh->mesg[0].raw_size = size_hint - (size_t)H5O_SIZEOF_MSGHDR_OH(oh); - oh->mesg[0].chunkno = 0; - - /* Check for non-zero initial refcount on the object header */ - if(initial_rc > 0) { - /* Set the initial refcount & pin the header when its inserted */ - oh->rc = initial_rc; - insert_flags |= H5AC__PIN_ENTRY_FLAG; - } /* end if */ - - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(dxpl_id, oh_addr, FAIL); - - /* Cache object header */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_OHDR, oh_addr, oh, insert_flags) < 0) - HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header") - - /* Reset object header pointer, now that it's been inserted into the cache */ - oh = NULL; - - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); - - /* Set up object location */ - loc->file = f; - loc->addr = oh_addr; - - /* Open it */ - if(H5O_open(loc) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object header") - -done: - if(ret_value < 0 && oh) - if(H5O__free(oh) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_create() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_open - * - * Purpose: Opens an object header which is described by the symbol table - * entry OBJ_ENT. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Monday, January 5, 1998 - * - * Modification: - * Raymond Lu - * 5 November 2007 - * Turn off the holding file variable if it's on. When it's - * needed, the caller will turn it on again. - *------------------------------------------------------------------------- - */ -herr_t -H5O_open(H5O_loc_t *loc) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check args */ - HDassert(loc); - HDassert(loc->file); - -#ifdef H5O_DEBUG - if(H5DEBUG(O)) - HDfprintf(H5DEBUG(O), "> %a\n", loc->addr); -#endif - - /* Turn off the variable for holding file or increment open-lock counters */ - if(loc->holding_file) - loc->holding_file = FALSE; - else - H5F_INCR_NOPEN_OBJS(loc->file); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_open() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_open_name - * - * Purpose: Opens an object within an HDF5 file. - * - * Return: Success: An open object identifier - * Failure: Negative - * - * Programmer: Quincey Koziol - * March 5 2007 - * - *------------------------------------------------------------------------- - */ -hid_t -H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) -{ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ - hid_t ret_value = FAIL; - - FUNC_ENTER_NOAPI(FAIL) - - /* Check args */ - HDassert(loc); - HDassert(name && *name); - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location */ - if(H5G_loc_find(loc, name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; - - /* Open the object */ - if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, app_ref)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") - -done: - if(ret_value < 0 && loc_found) - if(H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_open_name() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_open_by_loc - * - * Purpose: Opens an object and returns an ID given its group loction. - * - * Return: Success: Open object identifier - * Failure: Negative - * - * Programmer: James Laird - * July 25 2006 - * - *------------------------------------------------------------------------- - */ -hid_t -H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) -{ - const H5O_obj_class_t *obj_class; /* Class of object for location */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - HDassert(obj_loc); - - /* Get the object class for this location */ - if(NULL == (obj_class = H5O_obj_class(obj_loc->oloc, dxpl_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class") - - /* Call the object class's 'open' routine */ - HDassert(obj_class->open); - if((ret_value = obj_class->open(obj_loc, lapl_id, dxpl_id, app_ref)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_open_by_loc() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_close - * - * Purpose: Closes an object header that was previously open. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Monday, January 5, 1998 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_close(H5O_loc_t *loc, hbool_t *file_closed /*out*/) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5F_NOPEN_OBJS(loc->file) > 0); - - /* Set the file_closed flag to the default value. - * This flag lets downstream code know if the file struct is - * still accessible and/or likely to contain useful data. - * It's needed by the evict-on-close code. Clients can ignore - * this value by passing in NULL. - */ - if(file_closed) - *file_closed = FALSE; - - /* Decrement open-lock counters */ - H5F_DECR_NOPEN_OBJS(loc->file); - -#ifdef H5O_DEBUG - if(H5DEBUG(O)) { - if(H5F_FILE_ID(loc->file)< 0 && 1 == H5F_NREFS(loc->file)) - HDfprintf(H5DEBUG(O), "< %a auto %lu remaining\n", - loc->addr, - (unsigned long)H5F_NOPEN_OBJS(loc->file)); - else - HDfprintf(H5DEBUG(O), "< %a\n", loc->addr); - } /* end if */ -#endif - - /* - * If the file open object count has reached the number of open mount points - * (each of which has a group open in the file) attempt to close the file. - */ - if(H5F_NOPEN_OBJS(loc->file) == H5F_NMOUNTS(loc->file)) - /* Attempt to close down the file hierarchy */ - if(H5F_try_close(loc->file, file_closed) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCLOSEFILE, FAIL, "problem attempting file close") - - /* Release location information */ - if(H5O_loc_free(loc) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "problem attempting to free location") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_close() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_link_oh - * - * Purpose: Adjust the link count for an open object header by adding - * ADJUST to the link count. - * - * Return: Success: New link count - * - * Failure: Negative - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 5 1997 - * - *------------------------------------------------------------------------- - */ -int -H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) -{ - haddr_t addr = H5O_OH_GET_ADDR(oh); /* Object header address */ - int ret_value = -1; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* check args */ - HDassert(f); - HDassert(oh); - HDassert(deleted); - - /* Check for adjusting link count */ - if(adjust) { - if(adjust < 0) { - /* Check for too large of an adjustment */ - if((unsigned)(-adjust) > oh->nlink) - HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "link count would be negative") - - /* Adjust the link count for the object header */ - oh->nlink = (unsigned)((int)oh->nlink + adjust); - - /* Mark object header as dirty in cache */ - if(H5AC_mark_entry_dirty(oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") - - /* Check if the object should be deleted */ - if(oh->nlink == 0) { - /* Check if the object is still open by the user */ - if(H5FO_opened(f, addr) != NULL) { - /* Flag the object to be deleted when it's closed */ - if(H5FO_mark(f, addr, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't mark object for deletion") - } /* end if */ - else { - /* Mark the object header for deletion */ - *deleted = TRUE; - } /* end else */ - } /* end if */ - } /* end if */ - else { - /* A new object, or one that will be deleted */ - if(0 == oh->nlink) { - /* Check if the object is currently open, but marked for deletion */ - if(H5FO_marked(f, addr)) { - /* Remove "delete me" flag on the object */ - if(H5FO_mark(f, addr, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't mark object for deletion") - } /* end if */ - } /* end if */ - - /* Adjust the link count for the object header */ - oh->nlink = (unsigned)((int)oh->nlink + adjust); - - /* Mark object header as dirty in cache */ - if(H5AC_mark_entry_dirty(oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") - } /* end if */ - - /* Check for operations on refcount message */ - if(oh->version > H5O_VERSION_1) { - /* Check if the object has a refcount message already */ - if(oh->has_refcount_msg) { - /* Check for removing refcount message */ - if(oh->nlink <= 1) { - if(H5O_msg_remove_real(f, oh, H5O_MSG_REFCOUNT, H5O_ALL, NULL, NULL, TRUE, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete refcount message") - oh->has_refcount_msg = FALSE; - } /* end if */ - /* Update refcount message with new link count */ - else { - H5O_refcount_t refcount = oh->nlink; - - if(H5O_msg_write_real(f, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update refcount message") - } /* end else */ - } /* end if */ - else { - /* Check for adding refcount message to object */ - if(oh->nlink > 1) { - H5O_refcount_t refcount = oh->nlink; - - if(H5O_msg_append_real(f, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to create new refcount message") - oh->has_refcount_msg = TRUE; - } /* end if */ - } /* end else */ - } /* end if */ - } /* end if */ - - /* Set return value */ - ret_value = (int)oh->nlink; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_link_oh() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_link - * - * Purpose: Adjust the link count for an object header by adding - * ADJUST to the link count. - * - * Return: Success: New link count - * - * Failure: Negative - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 5 1997 - * - *------------------------------------------------------------------------- - */ -int -H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) -{ - H5O_t *oh = NULL; - hbool_t deleted = FALSE; /* Whether the object was deleted */ - int ret_value = -1; /* Return value */ - - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) - - /* check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5F_addr_defined(loc->addr)); - - /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") - - /* Call the "real" link routine */ - if((ret_value = H5O_link_oh(loc->file, adjust, dxpl_id, oh, &deleted)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust object link count") - -done: - if(oh && H5O_unpin(oh) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") - if(ret_value >= 0 && deleted && H5O_delete(loc->file, dxpl_id, loc->addr) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file") - - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_link() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_protect - * - * Purpose: Wrapper around H5AC_protect for use during a H5O_protect-> - * H5O_msg_append->...->H5O_msg_append->H5O_unprotect sequence of calls - * during an object's creation. - * - * Return: Success: Pointer to the object header structure for the - * object. - * Failure: NULL - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Dec 31 2002 - * - *------------------------------------------------------------------------- - */ -H5O_t * -H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, - hbool_t pin_all_chunks) -{ - H5O_t *oh = NULL; /* Object header protected */ - H5O_cache_ud_t udata; /* User data for protecting object header */ - H5O_cont_msgs_t cont_msg_info; /* Continuation message info */ - unsigned file_intent; /* R/W intent on file */ - H5O_t *ret_value = NULL; /* Return value */ - - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, NULL) - - /* check args */ - HDassert(loc); - HDassert(loc->file); - - /* prot_flags may only contain the H5AC__READ_ONLY_FLAG */ - HDassert((prot_flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); - - /* Check for valid address */ - if(!H5F_addr_defined(loc->addr)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "address undefined") - - /* Check for write access on the file */ - file_intent = H5F_INTENT(loc->file); - if((0 == (prot_flags & H5AC__READ_ONLY_FLAG)) && (0 == (file_intent & H5F_ACC_RDWR))) - HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "no write intent on file") - - /* Construct the user data for protect callback */ - udata.made_attempt = FALSE; - udata.v1_pfx_nmesgs = 0; - udata.chunk0_size = 0; - udata.oh = NULL; - udata.common.f = loc->file; - udata.common.dxpl_id = dxpl_id; - udata.common.file_intent = file_intent; - udata.common.merged_null_msgs = 0; - HDmemset(&cont_msg_info, 0, sizeof(cont_msg_info)); - udata.common.cont_msg_info = &cont_msg_info; - udata.common.addr = loc->addr; - - /* Lock the object header into the cache */ - if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, &udata, prot_flags))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header") - - /* Check if there are any continuation messages to process */ - if(cont_msg_info.nmsgs > 0) { - size_t curr_msg; /* Current continuation message to process */ - H5O_chk_cache_ud_t chk_udata; /* User data for loading chunk */ - - /* Sanity check - we should only have continuation messages to process - * when the object header is actually loaded from the file. - */ - HDassert(udata.made_attempt == TRUE); - HDassert(cont_msg_info.msgs); - - /* Construct the user data for protecting chunks */ - chk_udata.decoding = TRUE; - chk_udata.oh = oh; - chk_udata.chunkno = UINT_MAX; /* Set to invalid value, for better error detection */ - chk_udata.common.f = loc->file; - chk_udata.common.dxpl_id = dxpl_id; - chk_udata.common.file_intent = file_intent; - chk_udata.common.merged_null_msgs = udata.common.merged_null_msgs; - chk_udata.common.cont_msg_info = &cont_msg_info; - - /* Read in continuation messages, until there are no more */ - /* (Note that loading chunks could increase the # of continuation - * messages if new ones are found - QAK, 19/11/2016) - */ - curr_msg = 0; - while(curr_msg < cont_msg_info.nmsgs) { - H5O_chunk_proxy_t *chk_proxy; /* Proxy for chunk, to bring it into memory */ -#ifndef NDEBUG - size_t chkcnt = oh->nchunks; /* Count of chunks (for sanity checking) */ -#endif /* NDEBUG */ - - /* Bring the chunk into the cache */ - /* (which adds to the object header) */ - chk_udata.common.addr = cont_msg_info.msgs[curr_msg].addr; - chk_udata.size = cont_msg_info.msgs[curr_msg].size; - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, &chk_udata, prot_flags))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") - - /* Sanity check */ - HDassert(chk_proxy->oh == oh); - HDassert(chk_proxy->chunkno == chkcnt); - HDassert(oh->nchunks == (chkcnt + 1)); - - /* Release the chunk from the cache */ - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header chunk") - - /* Advance to next continuation message */ - curr_msg++; - } /* end while */ - - /* Release any continuation messages built up */ - cont_msg_info.msgs = (H5O_cont_t *)H5FL_SEQ_FREE(H5O_cont_t, cont_msg_info.msgs); - - /* Pass back out some of the chunk's user data */ - udata.common.merged_null_msgs = chk_udata.common.merged_null_msgs; - } /* end if */ - - /* Check for incorrect # of object header messages, if we've just loaded - * this object header from the file - */ - if(udata.made_attempt) { -/* Don't enforce the error on an incorrect # of object header messages bug - * unless strict format checking is enabled. This allows for older - * files, created with a version of the library that had a bug in tracking - * the correct # of header messages to be read in without the library - * erroring out here. -QAK - */ -#ifdef H5_STRICT_FORMAT_CHECKS - /* Check for incorrect # of messages in v1 object header */ - if(oh->version == H5O_VERSION_1 && - (oh->nmesgs + udata.common.merged_null_msgs) != udata.v1_pfx_nmesgs) - HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "corrupt object header - incorrect # of messages") -#endif /* H5_STRICT_FORMAT_CHECKS */ - } /* end if */ - -#ifdef H5O_DEBUG -H5O_assert(oh); -#endif /* H5O_DEBUG */ - - /* Pin the other chunks also when requested, so that the object header - * proxy can be set up. - */ - if(pin_all_chunks && oh->nchunks > 1) { - unsigned u; /* Local index variable */ - - /* Sanity check */ - HDassert(oh->swmr_write); - - /* Iterate over chunks > 0 */ - for(u = 1; u < oh->nchunks; u++) { - H5O_chunk_proxy_t *chk_proxy; /* Chunk proxy */ - - /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(loc->file, dxpl_id, oh, u))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header chunk") - - /* Pin chunk proxy*/ - if(H5AC_pin_protected_entry(chk_proxy) < 0 ) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, NULL, "unable to pin object header chunk") - - /* Unprotect chunk */ - if(H5O_chunk_unprotect(loc->file, dxpl_id, chk_proxy, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to unprotect object header chunk") - - /* Preserve chunk proxy pointer for later */ - oh->chunk[u].chunk_proxy = chk_proxy; - } /* end for */ - - /* Set the flag for the unprotect */ - oh->chunks_pinned = TRUE; - } /* end if */ - - /* Set return value */ - ret_value = oh; - -done: - if(ret_value == NULL && oh) - if(H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* end H5O_protect() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_pin - * - * Purpose: Pin an object header down for use during a sequence of message - * operations, which prevents the object header from being - * evicted from the cache. - * - * Return: Success: Pointer to the object header structure for the - * object. - * Failure: NULL - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jul 13 2008 - * - *------------------------------------------------------------------------- - */ -H5O_t * -H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id) -{ - H5O_t *oh = NULL; /* Object header */ - H5O_t *ret_value = NULL; /* Return value */ - - FUNC_ENTER_NOAPI(NULL) - - /* check args */ - HDassert(loc); - - /* Get header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header") - - /* Increment the reference count on the object header */ - /* (which will pin it, if appropriate) */ - if(H5O_inc_rc(oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, NULL, "unable to increment reference count on object header") - - /* Set the return value */ - ret_value = oh; - -done: - /* Release the object header from the cache */ - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_pin() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_unpin - * - * Purpose: Unpin an object header, allowing it to be evicted from the - * metadata cache. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jul 13 2008 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_unpin(H5O_t *oh) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* check args */ - HDassert(oh); - - /* Decrement the reference count on the object header */ - /* (which will unpin it, if appropriate) */ - if(H5O_dec_rc(oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement reference count on object header") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_unpin() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_unprotect - * - * Purpose: Wrapper around H5AC_unprotect for use during a H5O_protect-> - * H5O_msg_append->...->H5O_msg_append->H5O_unprotect sequence of calls - * during an object's creation. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Dec 31 2002 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_unprotect(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, unsigned oh_flags) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* check args */ - HDassert(loc); - HDassert(oh); - - /* Unpin the other chunks */ - if(oh->chunks_pinned && oh->nchunks > 1) { - unsigned u; /* Local index variable */ - - /* Sanity check */ - HDassert(oh->swmr_write); - - /* Iterate over chunks > 0 */ - for(u = 1; u < oh->nchunks; u++) { - if(NULL != oh->chunk[u].chunk_proxy) { - /* Release chunk proxy */ - if(H5AC_unpin_entry(oh->chunk[u].chunk_proxy) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPIN, FAIL, "unable to unpin object header chunk") - oh->chunk[u].chunk_proxy = NULL; - } /* end if */ - } /* end for */ - - /* Reet the flag from the unprotect */ - oh->chunks_pinned = FALSE; - } /* end if */ - - /* Unprotect the object header */ - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, oh->chunk[0].addr, oh, oh_flags) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_unprotect() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_touch_oh - * - * Purpose: If FORCE is non-zero then create a modification time message - * unless one already exists. Then update any existing - * modification time message with the current time. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Monday, July 27, 1998 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) -{ - H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ - time_t now; /* Current time */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(f); - HDassert(oh); - - /* Check if this object header is tracking times */ - if(oh->flags & H5O_HDR_STORE_TIMES) { - /* Get current time */ - now = H5_now(); - - /* Check version, to determine how to store time information */ - if(oh->version == H5O_VERSION_1) { - size_t idx; /* Index of modification time message to update */ - - /* Look for existing message */ - for(idx = 0; idx < oh->nmesgs; idx++) - if(H5O_MSG_MTIME == oh->mesg[idx].type || H5O_MSG_MTIME_NEW == oh->mesg[idx].type) - break; - - /* Create a new message, if necessary */ - if(idx == oh->nmesgs) { - unsigned mesg_flags = 0; /* Flags for message in object header */ - - /* If we would have to create a new message, but we aren't 'forcing' it, get out now */ - if(!force) - HGOTO_DONE(SUCCEED); /*nothing to do*/ - - /* Allocate space for the modification time message */ - if(H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_MTIME_NEW, &mesg_flags, &now, &idx) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for modification time message") - - /* Set the message's flags if appropriate */ - oh->mesg[idx].flags = (uint8_t)mesg_flags; - } /* end if */ - - /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, oh->mesg[idx].chunkno))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") - - /* Allocate 'native' space, if necessary */ - if(NULL == oh->mesg[idx].native) { - if(NULL == (oh->mesg[idx].native = H5FL_MALLOC(time_t))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "memory allocation failed for modification time message") - } /* end if */ - - /* Update the message */ - *((time_t *)(oh->mesg[idx].native)) = now; - - /* Mark the message as dirty */ - oh->mesg[idx].dirty = TRUE; - chk_dirtied = TRUE; - } /* end if */ - else { - /* XXX: For now, update access time & change fields in the object header */ - /* (will need to add some code to update modification time appropriately) */ - oh->atime = oh->ctime = now; - - /* Mark object header as dirty in cache */ - if(H5AC_mark_entry_dirty(oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") - } /* end else */ - } /* end if */ - -done: - /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_touch_oh() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_touch - * - * Purpose: Touch an object by setting the modification time to the - * current time and marking the object as dirty. Unless FORCE - * is non-zero, nothing happens if there is no MTIME message in - * the object header. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Monday, July 27, 1998 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id) -{ - H5O_t *oh = NULL; /* Object header to modify */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting object header */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* check args */ - HDassert(loc); - - /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") - - /* Create/Update the modification time message */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, force) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "unable to update object modificaton time") - - /* Mark object header as changed */ - oh_flags |= H5AC__DIRTIED_FLAG; - -done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, oh_flags) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_touch() */ - -#ifdef H5O_ENABLE_BOGUS - -/*------------------------------------------------------------------------- - * Function: H5O_bogus_oh - * - * Purpose: Create a "bogus" message unless one already exists. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * - * Tuesday, January 21, 2003 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned bogus_id, unsigned mesg_flags) -{ - size_t idx; /* Local index variable */ - H5O_msg_class_t *type; /* Message class type */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - HDassert(f); - HDassert(oh); - - /* Look for existing message */ - for(idx = 0; idx < oh->nmesgs; idx++) - if(H5O_MSG_BOGUS_VALID == oh->mesg[idx].type || - H5O_MSG_BOGUS_INVALID == oh->mesg[idx].type) - break; - - /* Create a new message */ - if(idx == oh->nmesgs) { - H5O_bogus_t *bogus; /* Pointer to the bogus information */ - - /* Allocate the native message in memory */ - if(NULL == (bogus = H5MM_malloc(sizeof(H5O_bogus_t)))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "memory allocation failed for 'bogus' message") - - /* Update the native value */ - bogus->u = H5O_BOGUS_VALUE; - - if(bogus_id == H5O_BOGUS_VALID_ID) - type = H5O_MSG_BOGUS_VALID; - else if(bogus_id == H5O_BOGUS_INVALID_ID) - type = H5O_MSG_BOGUS_INVALID; - else - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID for 'bogus' message") - - /* Allocate space in the object header for bogus message */ - if(H5O_msg_alloc(f, dxpl_id, oh, type, &mesg_flags, bogus, &idx) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for 'bogus' message") - - /* Point to "bogus" information (take it over) */ - oh->mesg[idx].native = bogus; - - /* Set the appropriate flags for the message */ - oh->mesg[idx].flags = mesg_flags; - - /* Mark the message and object header as dirty */ - oh->mesg[idx].dirty = TRUE; - oh->cache_info.is_dirty = TRUE; - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_bogus_oh() */ -#endif /* H5O_ENABLE_BOGUS */ - - -/*------------------------------------------------------------------------- - * Function: H5O_delete - * - * Purpose: Delete an object header from a file. This frees the file - * space used for the object header (and it's continuation blocks) - * and also walks through each header message and asks it to - * remove all the pieces of the file referenced by the header. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 19 2003 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) -{ - H5O_t *oh = NULL; /* Object header information */ - H5O_loc_t loc; /* Object location for object to delete */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting object header */ - hbool_t corked; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_TAG(dxpl_id, addr, FAIL) - - /* Check args */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - - /* Set up the object location */ - loc.file = f; - loc.addr = addr; - loc.holding_file = FALSE; - - /* Get the object header information */ - if(NULL == (oh = H5O_protect(&loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") - - /* Delete object */ - if(H5O_delete_oh(f, dxpl_id, oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file") - - /* Uncork cache entries with tag: addr */ - if(H5AC_cork(f, addr, H5AC__GET_CORKED, &corked) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to retrieve an object's cork status") - if(corked) - if(H5AC_cork(f, addr, H5AC__UNCORK, NULL) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNCORK, FAIL, "unable to uncork an object") - - /* Mark object header as deleted */ - oh_flags = H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; - -done: - if(oh && H5O_unprotect(&loc, dxpl_id, oh, oh_flags) < 0) - HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") - - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_delete() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_delete_oh - * - * Purpose: Internal function to: - * Delete an object header from a file. This frees the file - * space used for the object header (and it's continuation blocks) - * and also walks through each header message and asks it to - * remove all the pieces of the file referenced by the header. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 19 2003 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) -{ - H5O_mesg_t *curr_msg; /* Pointer to current message being operated on */ - unsigned u; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Check args */ - HDassert(f); - HDassert(oh); - - /* Walk through the list of object header messages, asking each one to - * delete any file space used - */ - for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { - /* Free any space referred to in the file from this message */ - if(H5O_delete_mesg(f, dxpl_id, oh, curr_msg) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") - } /* end for */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_delete_oh() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_obj_type - * - * Purpose: Retrieves the type of object pointed to by `loc'. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Robb Matzke - * Wednesday, November 4, 1998 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type, hid_t dxpl_id) -{ - H5O_t *oh = NULL; /* Object header for location */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) - - /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") - - /* Retrieve the type of the object */ - if(H5O_obj_type_real(oh, obj_type) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") - -done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_obj_type() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_obj_type_real - * - * Purpose: Returns the type of object pointed to by `oh'. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Monday, November 21, 2005 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type) -{ - const H5O_obj_class_t *obj_class; /* Class of object for header */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Sanity check */ - HDassert(oh); - HDassert(obj_type); - - /* Look up class for object header */ - if(NULL == (obj_class = H5O_obj_class_real(oh))) { - /* Clear error stack from "failed" class lookup */ - H5E_clear_stack(NULL); - - /* Set type to "unknown" */ - *obj_type = H5O_TYPE_UNKNOWN; - } /* end if */ - else { - /* Set object type */ - *obj_type = obj_class->type; - } /* end else */ - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_obj_type_real() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_obj_class - * - * Purpose: Returns the class of object pointed to by `loc'. - * - * Return: Success: An object class - * Failure: NULL - * - * Programmer: Quincey Koziol - * Monday, November 6, 2006 - * - *------------------------------------------------------------------------- - */ -const H5O_obj_class_t * -H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id) -{ - H5O_t *oh = NULL; /* Object header for location */ - const H5O_obj_class_t *ret_value = NULL; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, NULL) - - /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header") - - /* Test whether entry qualifies as a particular type of object */ - if(NULL == (ret_value = H5O_obj_class_real(oh))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to determine object type") - -done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* end H5O_obj_class() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_obj_class_real - * - * Purpose: Returns the class of object pointed to by `oh'. - * - * Return: Success: An object class - * Failure: NULL - * - * Programmer: Quincey Koziol - * Monday, November 21, 2005 - * - *------------------------------------------------------------------------- - */ -static const H5O_obj_class_t * -H5O_obj_class_real(H5O_t *oh) -{ - size_t i; /* Local index variable */ - const H5O_obj_class_t *ret_value = NULL; /* Return value */ - - FUNC_ENTER_NOAPI(NULL) - - /* Sanity check */ - HDassert(oh); - - /* Test whether entry qualifies as a particular type of object */ - /* (Note: loop is in reverse order, to test specific objects first) */ - for(i = NELMTS(H5O_obj_class_g); i > 0; --i) { - htri_t isa; /* Is entry a particular type? */ - - if((isa = (H5O_obj_class_g[i - 1]->isa)(oh)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to determine object type") - else if(isa) - HGOTO_DONE(H5O_obj_class_g[i - 1]) - } /* end for */ - - if(0 == i) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to determine object type") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_obj_class_real() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_get_loc - * - * Purpose: Gets the object location for an object given its ID. - * - * Return: Success: Pointer to H5O_loc_t - * Failure: NULL - * - * Programmer: James Laird - * July 25 2006 - * - *------------------------------------------------------------------------- - */ -H5O_loc_t * -H5O_get_loc(hid_t object_id) -{ - H5O_loc_t *ret_value = NULL; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - switch(H5I_get_type(object_id)) { - case H5I_GROUP: - if(NULL == (ret_value = H5O_OBJ_GROUP->get_oloc(object_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to get object location from group ID") - break; - - case H5I_DATASET: - if(NULL == (ret_value = H5O_OBJ_DATASET->get_oloc(object_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to get object location from dataset ID") - break; - - case H5I_DATATYPE: - if(NULL == (ret_value = H5O_OBJ_DATATYPE->get_oloc(object_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to get object location from datatype ID") - 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: - default: - HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, NULL, "invalid object type") - } /* end switch */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_get_loc() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_loc_reset - * - * Purpose: Reset a object location to an empty state - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Monday, September 19, 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_loc_reset(H5O_loc_t *loc) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Check arguments */ - HDassert(loc); - - /* Clear the object location to an empty state */ - HDmemset(loc, 0, sizeof(H5O_loc_t)); - loc->addr = HADDR_UNDEF; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_loc_reset() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_loc_copy - * - * Purpose: Copy object location information - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Monday, September 19, 2005 - * - * Notes: 'depth' parameter determines how much of the group entry - * structure we want to copy. The values are: - * H5_COPY_SHALLOW - Copy all the field values from the source - * to the destination, but not copying objects pointed to. - * (Destination "takes ownership" of objects pointed to) - * H5_COPY_DEEP - Copy all the fields from the source to - * the destination, deep copying objects pointed to. - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_loc_copy(H5O_loc_t *dst, H5O_loc_t *src, H5_copy_depth_t depth) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Check arguments */ - HDassert(src); - HDassert(dst); - HDassert(depth == H5_COPY_SHALLOW || depth == H5_COPY_DEEP); - - /* Copy the top level information */ - HDmemcpy(dst, src, sizeof(H5O_loc_t)); - - /* Deep copy the names */ - if(depth == H5_COPY_DEEP) { - /* If the original entry was holding open the file, this one should - * hold it open, too. - */ - if(src->holding_file) - H5F_INCR_NOPEN_OBJS(dst->file); - } else if(depth == H5_COPY_SHALLOW) { - H5O_loc_reset(src); - } /* end if */ - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_loc_copy() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_loc_hold_file - * - * Purpose: Have this object header hold a file open until it is - * released. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: James Laird - * Wednesday, August 16, 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_loc_hold_file(H5O_loc_t *loc) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Check arguments */ - HDassert(loc); - HDassert(loc->file); - - /* If this location is not already holding its file open, do so. */ - if(!loc->holding_file) { - H5F_INCR_NOPEN_OBJS(loc->file); - loc->holding_file = TRUE; - } /* end if */ - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_loc_hold_file() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_loc_free - * - * Purpose: Release resources used by this object header location. - * Not to be confused with H5O_close; this is used on - * locations that don't correspond to open objects. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: James Laird - * Wednesday, August 16, 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_loc_free(H5O_loc_t *loc) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - /* Check arguments */ - HDassert(loc); - - /* If this location is holding its file open try to close the file. */ - if(loc->holding_file) { - H5F_DECR_NOPEN_OBJS(loc->file); - loc->holding_file = FALSE; - if(H5F_NOPEN_OBJS(loc->file) <= 0) { - if(H5F_try_close(loc->file, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") - } /* end if */ - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_loc_free() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_get_hdr_info - * - * Purpose: Retrieve the object header information for an object - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * September 22 2009 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_get_hdr_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_hdr_info_t *hdr) -{ - H5O_t *oh = NULL; /* Object header */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check args */ - HDassert(loc); - HDassert(hdr); - - /* Reset the object header info structure */ - HDmemset(hdr, 0, sizeof(*hdr)); - - /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") - - /* Get the information for the object header */ - if(H5O_get_hdr_info_real(oh, hdr) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object header info") - -done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_get_hdr_info() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_get_hdr_info_real - * - * Purpose: Internal routine to retrieve the object header information for an object - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * September 22 2009 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) -{ - const H5O_mesg_t *curr_msg; /* Pointer to current message being operated on */ - const H5O_chunk_t *curr_chunk; /* Pointer to current message being operated on */ - unsigned u; /* Local index variable */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Check args */ - HDassert(oh); - HDassert(hdr); - - /* Set the version for the object header */ - hdr->version = oh->version; - - /* Set the number of messages & chunks */ - H5_CHECKED_ASSIGN(hdr->nmesgs, unsigned, oh->nmesgs, size_t); - H5_CHECKED_ASSIGN(hdr->nchunks, unsigned, oh->nchunks, size_t); - - /* Set the status flags */ - hdr->flags = oh->flags; - - /* Iterate over all the messages, accumulating message size & type information */ - hdr->space.meta = (hsize_t)H5O_SIZEOF_HDR(oh) + (hsize_t)(H5O_SIZEOF_CHKHDR_OH(oh) * (oh->nchunks - 1)); - hdr->space.mesg = 0; - hdr->space.free = 0; - hdr->mesg.present = 0; - hdr->mesg.shared = 0; - for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { - uint64_t type_flag; /* Flag for message type */ - - /* Accumulate space usage information, based on the type of message */ - if(H5O_NULL_ID == curr_msg->type->id) - hdr->space.free += (hsize_t)((size_t)H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size); - else if(H5O_CONT_ID == curr_msg->type->id) - hdr->space.meta += (hsize_t)((size_t)H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size); - else { - hdr->space.meta += (hsize_t)H5O_SIZEOF_MSGHDR_OH(oh); - hdr->space.mesg += curr_msg->raw_size; - } /* end else */ - - /* Set flag to indicate presence of message type */ - type_flag = ((uint64_t)1) << curr_msg->type->id; - hdr->mesg.present |= type_flag; - - /* Set flag if the message is shared in some way */ - if(curr_msg->flags & H5O_MSG_FLAG_SHARED) \ - hdr->mesg.shared |= type_flag; - } /* end for */ - - /* Iterate over all the chunks, adding any gaps to the free space */ - hdr->space.total = 0; - for(u = 0, curr_chunk = &oh->chunk[0]; u < oh->nchunks; u++, curr_chunk++) { - /* Accumulate the size of the header on disk */ - hdr->space.total += curr_chunk->size; - - /* If the chunk has a gap, add it to the free space */ - hdr->space.free += curr_chunk->gap; - } /* end for */ - - /* Sanity check that all the bytes are accounted for */ - HDassert(hdr->space.total == (hdr->space.free + hdr->space.meta + hdr->space.mesg)); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_get_hdr_info_real() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_get_info - * - * Purpose: Retrieve the information for an object - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * November 21 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, - H5O_info_t *oinfo) -{ - const H5O_obj_class_t *obj_class; /* Class of object for header */ - H5O_t *oh = NULL; /* Object header */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) - - /* Check args */ - HDassert(loc); - HDassert(oinfo); - - /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") - - /* Reset the object info structure */ - HDmemset(oinfo, 0, sizeof(*oinfo)); - - /* Retrieve the file's fileno */ - H5F_GET_FILENO(loc->file, oinfo->fileno); - - /* Set the object's address */ - oinfo->addr = loc->addr; - - /* Get class for object */ - if(NULL == (obj_class = H5O_obj_class_real(oh))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class") - - /* Retrieve the type of the object */ - oinfo->type = obj_class->type; - - /* Set the object's reference count */ - oinfo->rc = oh->nlink; - - /* Get modification time for object */ - if(oh->version > H5O_VERSION_1) { - oinfo->atime = oh->atime; - oinfo->mtime = oh->mtime; - oinfo->ctime = oh->ctime; - oinfo->btime = oh->btime; - } /* end if */ - else { - htri_t exists; /* Flag if header message of interest exists */ - - /* No information for access & modification fields */ - /* (we stopped updating the "modification time" header message for - * raw data changes, so the "modification time" header message - * is closest to the 'change time', in POSIX terms - QAK) - */ - oinfo->atime = 0; - oinfo->mtime = 0; - oinfo->btime = 0; - - /* Might be information for modification time */ - if((exists = H5O_msg_exists_oh(oh, H5O_MTIME_ID)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME message") - if(exists > 0) { - /* Get "old style" modification time info */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_MTIME_ID, &oinfo->ctime)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME message") - } /* end if */ - else { - /* Check for "new style" modification time info */ - if((exists = H5O_msg_exists_oh(oh, H5O_MTIME_NEW_ID)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME_NEW message") - if(exists > 0) { - /* Get "new style" modification time info */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_MTIME_NEW_ID, &oinfo->ctime)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME_NEW message") - } /* end if */ - else - oinfo->ctime = 0; - } /* end else */ - } /* end else */ - - /* Get the information for the object header */ - if(H5O_get_hdr_info_real(oh, &oinfo->hdr) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object header info") - - /* Retrieve # of attributes */ - if(H5O_attr_count_real(loc->file, dxpl_id, oh, &oinfo->num_attrs) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve attribute count") - - /* Get B-tree & heap metadata storage size, if requested */ - if(want_ih_info) { - /* Check for 'bh_info' callback for this type of object */ - if(obj_class->bh_info) { - /* Call the object's class 'bh_info' routine */ - if((obj_class->bh_info)(loc, dxpl_id, oh, &oinfo->meta_size.obj) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object's btree & heap info") - } /* end if */ - - /* Get B-tree & heap info for any attributes */ - if(oinfo->num_attrs > 0) { - if(H5O_attr_bh_info(loc->file, dxpl_id, oh, &oinfo->meta_size.attr) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve attribute btree & heap info") - } /* end if */ - } /* end if */ - -done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_get_info() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_get_create_plist - * - * Purpose: Retrieve the object creation properties for an object - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * November 28 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, H5P_genplist_t *oc_plist) -{ - H5O_t *oh = NULL; /* Object header */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check args */ - HDassert(loc); - HDassert(oc_plist); - - /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") - - /* Set property values, if they were used for the object */ - if(oh->version > H5O_VERSION_1) { - uint8_t ohdr_flags; /* "User-visible" object header status flags */ - - /* Set attribute storage values */ - if(H5P_set(oc_plist, H5O_CRT_ATTR_MAX_COMPACT_NAME, &oh->max_compact) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set max. # of compact attributes in property list") - if(H5P_set(oc_plist, H5O_CRT_ATTR_MIN_DENSE_NAME, &oh->min_dense) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set min. # of dense attributes in property list") - - /* Mask off non-"user visible" flags */ - ohdr_flags = oh->flags & (H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | H5O_HDR_STORE_TIMES); - - /* Set object header flags */ - if(H5P_set(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &ohdr_flags) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set object header flags") - } /* end if */ - -done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_get_create_plist() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_get_nlinks - * - * Purpose: Retrieve the number of link messages read in from the file - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * March 11 2007 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks) -{ - H5O_t *oh = NULL; /* Object header */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check args */ - HDassert(loc); - HDassert(nlinks); - - /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") - - /* Retrieve the # of link messages seen when the object header was loaded */ - *nlinks = oh->link_msgs_seen; - -done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_get_nlinks() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_obj_create - * - * Purpose: Creates an object, in an abstract manner. - * - * Return: Success: Pointer to object opened - * Failure: NULL - * - * Programmer: Quincey Koziol - * April 9 2007 - * - *------------------------------------------------------------------------- - */ -void * -H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc, - hid_t dxpl_id) -{ - size_t u; /* Local index variable */ - void *ret_value = NULL; /* Return value */ - - FUNC_ENTER_NOAPI(NULL) - - /* Sanity checks */ - HDassert(f); - HDassert(obj_type >= H5O_TYPE_GROUP && obj_type <= H5O_TYPE_NAMED_DATATYPE); - HDassert(crt_info); - HDassert(obj_loc); - - /* Iterate through the object classes */ - for(u = 0; u < NELMTS(H5O_obj_class_g); u++) { - /* Check for correct type of object to create */ - if(H5O_obj_class_g[u]->type == obj_type) { - /* Call the object class's 'create' routine */ - HDassert(H5O_obj_class_g[u]->create); - if(NULL == (ret_value = H5O_obj_class_g[u]->create(f, crt_info, obj_loc, dxpl_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object") - - /* Break out of loop */ - break; - } /* end if */ - } /* end for */ - HDassert(ret_value); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_obj_create() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_get_oh_addr - * - * Purpose: Retrieve the address of the object header - * - * Note: This routine participates in the "Inlining C struct access" - * pattern, don't call it directly, use the appropriate macro - * defined in H5Oprivate.h. - * - * Return: Success: Valid haddr_t - * Failure: HADDR_UNDEF - * - * Programmer: Quincey Koziol - * March 15 2007 - * - *------------------------------------------------------------------------- - */ -haddr_t -H5O_get_oh_addr(const H5O_t *oh) -{ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(oh); - HDassert(oh->chunk); - - FUNC_LEAVE_NOAPI(oh->chunk[0].addr) -} /* end H5O_get_oh_addr() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_get_rc_and_type - * - * Purpose: Retrieve an object's reference count and type - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * November 4 2007 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_get_rc_and_type(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc, H5O_type_t *otype) -{ - H5O_t *oh = NULL; /* Object header */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check args */ - HDassert(loc); - - /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") - - /* Set the object's reference count */ - if(rc) - *rc = oh->nlink; - - /* Retrieve the type of the object */ - if(otype) - if(H5O_obj_type_real(oh, otype) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") - -done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_get_rc_and_type() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_free_visit_visited - * - * Purpose: Free the key for an object visited during a group traversal - * - * Return: Non-negative on success, negative on failure - * - * Programmer: Quincey Koziol - * Nov 25, 2007 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - item = H5FL_FREE(H5_obj_t, item); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_free_visit_visited() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_visit_cb - * - * Purpose: Callback function for recursively visiting objects from a group - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Nov 25, 2007 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O_visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *linfo, - void *_udata) -{ - H5O_iter_visit_ud_t *udata = (H5O_iter_visit_ud_t *)_udata; /* User data for callback */ - H5G_loc_t obj_loc; /* Location of object */ - H5G_name_t obj_path; /* Object's group hier. path */ - H5O_loc_t obj_oloc; /* Object's object location */ - hbool_t obj_found = FALSE; /* Object at 'name' found */ - herr_t ret_value = H5_ITER_CONT; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Sanity check */ - HDassert(name); - HDassert(linfo); - HDassert(udata); - - /* Check if this is a hard link */ - if(linfo->type == H5L_TYPE_HARD) { - H5_obj_t obj_pos; /* Object "position" for this object */ - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object using the LAPL passed in */ - /* (Correctly handles mounted files) */ - if(H5G_loc_find(udata->start_loc, name, &obj_loc/*out*/, udata->lapl_id, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") - obj_found = TRUE; - - /* Construct unique "position" for this object */ - H5F_GET_FILENO(obj_oloc.file, obj_pos.fileno); - obj_pos.addr = obj_oloc.addr; - - /* Check if we've seen the object the link references before */ - if(NULL == H5SL_search(udata->visited, &obj_pos)) { - H5O_info_t oinfo; /* Object info */ - - /* Get the object's info */ - if(H5O_get_info(&obj_oloc, udata->dxpl_id, TRUE, &oinfo) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get object info") - - /* Make the application callback */ - ret_value = (udata->op)(udata->obj_id, name, &oinfo, udata->op_data); - - /* Check for continuing to visit objects */ - if(ret_value == H5_ITER_CONT) { - /* If its ref count is > 1, we add it to the list of visited objects */ - /* (because it could come up again during traversal) */ - if(oinfo.rc > 1) { - H5_obj_t *new_node; /* New object node for visited list */ - - /* Allocate new object "position" node */ - if((new_node = H5FL_MALLOC(H5_obj_t)) == NULL) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, H5_ITER_ERROR, "can't allocate object node") - - /* Set node information */ - *new_node = obj_pos; - - /* Add to list of visited objects */ - if(H5SL_insert(udata->visited, new_node, new_node) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "can't insert object node into visited list") - } /* end if */ - } /* end if */ - } /* end if */ - } /* end if */ - -done: - /* Release resources */ - if(obj_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_visit_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_visit - * - * Purpose: Recursively visit an object and all the objects reachable - * from it. If the starting object is a group, all the objects - * linked to from that group will be visited. Links within - * each group are visited according to the order within the - * specified index (unless the specified index does not exist for - * a particular group, then the "name" index is used). - * - * NOTE: Soft links and user-defined links are ignored during - * this operation. - * - * NOTE: Each _object_ reachable from the initial group will only - * be visited once. If multiple hard links point to the same - * object, the first link to the object's path (according to the - * iteration index and iteration order given) will be used to in - * the callback about the object. - * - * Return: Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. - * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. - * - * Programmer: Quincey Koziol - * November 24 2007 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, - H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id) -{ - H5O_iter_visit_ud_t udata; /* User data for callback */ - H5G_loc_t loc; /* Location of reference object */ - H5G_loc_t obj_loc; /* Location used to open object */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ - H5O_info_t oinfo; /* Object info struct */ - hid_t obj_id = (-1); /* ID of object */ - herr_t ret_value = FAIL; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Portably initialize user data struct to zeros */ - HDmemset(&udata, 0, sizeof(udata)); - - /* Check args */ - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; - - /* Get the object's info */ - if(H5O_get_info(&obj_oloc, dxpl_id, TRUE, &oinfo) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info") - - /* Open the object */ - /* (Takes ownership of the obj_loc information) */ - if((obj_id = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, TRUE)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") - - /* Make callback for starting object */ - if((ret_value = op(obj_id, ".", &oinfo, op_data)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "can't visit objects") - - /* Check return value of first callback */ - if(ret_value != H5_ITER_CONT) - HGOTO_DONE(ret_value); - - /* Check for object being a group */ - if(oinfo.type == H5O_TYPE_GROUP) { - H5G_loc_t start_loc; /* Location of starting group */ - - /* Get the location of the starting group */ - if(H5G_loc(obj_id, &start_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - - /* Set up user data for visiting links */ - udata.obj_id = obj_id; - udata.start_loc = &start_loc; - udata.lapl_id = lapl_id; - udata.dxpl_id = dxpl_id; - udata.op = op; - udata.op_data = op_data; - - /* Create skip list to store visited object information */ - if((udata.visited = H5SL_create(H5SL_TYPE_OBJ, NULL)) == NULL) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create skip list for visited objects") - - /* If its ref count is > 1, we add it to the list of visited objects */ - /* (because it could come up again during traversal) */ - if(oinfo.rc > 1) { - H5_obj_t *obj_pos; /* New object node for visited list */ - - /* Allocate new object "position" node */ - if((obj_pos = H5FL_MALLOC(H5_obj_t)) == NULL) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "can't allocate object node") - - /* Construct unique "position" for this object */ - obj_pos->fileno = oinfo.fileno; - obj_pos->addr = oinfo.addr; - - /* Add to list of visited objects */ - if(H5SL_insert(udata.visited, obj_pos, obj_pos) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object node into visited list") - } /* end if */ - - /* Call internal group visitation routine */ - if((ret_value = H5G_visit(obj_id, ".", idx_type, order, H5O_visit_cb, &udata, lapl_id, dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") - } /* end if */ - -done: - if(obj_id > 0) { - if(H5I_dec_app_ref(obj_id) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close object") - } /* end if */ - else if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") - if(udata.visited) - H5SL_destroy(udata.visited, H5O_free_visit_visited, NULL); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_visit() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_inc_rc - * - * Purpose: Increments the reference count on an object header - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jul 13 2008 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_inc_rc(H5O_t *oh) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* check args */ - HDassert(oh); - - /* Pin the object header when the reference count goes above 0 */ - if(oh->rc == 0) - if(H5AC_pin_protected_entry(oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") - - /* Increment reference count */ - oh->rc++; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_inc_rc() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_dec_rc - * - * Purpose: Decrements the reference count on an object header - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jul 13 2008 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_dec_rc(H5O_t *oh) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* check args */ - HDassert(oh); - - /* Decrement reference count */ - oh->rc--; - - /* Unpin the object header when the reference count goes back to 0 */ - if(oh->rc == 0) - if(H5AC_unpin_entry(oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dec_rc() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_dec_rc_by_loc - * - * Purpose: Decrement the refcount of an object header, using its - * object location information. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Oct 08 2010 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id) -{ - H5O_t *oh = NULL; /* Object header */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* check args */ - HDassert(loc); - - /* Get header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") - - /* Decrement the reference count on the object header */ - /* (which will unpin it, if appropriate) */ - if(H5O_dec_rc(oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement reference count on object header") - -done: - /* Release the object header from the cache */ - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dec_rc_by_loc() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_get_proxy - * - * Purpose: Retrieve the proxy for the object header. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * July 24 2016 - * - *------------------------------------------------------------------------- - */ -H5AC_proxy_entry_t * -H5O_get_proxy(const H5O_t *oh) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Check args */ - HDassert(oh); - - FUNC_LEAVE_NOAPI(oh->proxy) -} /* end H5O_get_proxy() */ - - -/*------------------------------------------------------------------------- - * Function: H5O__free - * - * Purpose: Destroys an object header. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O__free(H5O_t *oh) -{ - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_PACKAGE - - /* check args */ - HDassert(oh); - HDassert(0 == oh->rc); - - /* Destroy chunks */ - if(oh->chunk) { - for(u = 0; u < oh->nchunks; u++) - oh->chunk[u].image = H5FL_BLK_FREE(chunk_image, oh->chunk[u].image); - - oh->chunk = (H5O_chunk_t *)H5FL_SEQ_FREE(H5O_chunk_t, oh->chunk); - } /* end if */ - - /* Destroy messages */ - if(oh->mesg) { - for(u = 0; u < oh->nmesgs; u++) { -#ifndef NDEBUG - /* Verify that message is clean, unless it could have been marked - * dirty by decoding */ - if(oh->ndecode_dirtied && oh->mesg[u].dirty) - oh->ndecode_dirtied--; - else - HDassert(oh->mesg[u].dirty == 0); -#endif /* NDEBUG */ - - H5O_msg_free_mesg(&oh->mesg[u]); - } /* end for */ - - /* Make sure we accounted for all the messages dirtied by decoding */ - HDassert(!oh->ndecode_dirtied); - - oh->mesg = (H5O_mesg_t *)H5FL_SEQ_FREE(H5O_mesg_t, oh->mesg); - } /* end if */ - - /* Destroy the proxy */ - if(oh->proxy) - if(H5AC_proxy_entry_dest(oh->proxy) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy virtual entry used for proxy") - - /* destroy object header */ - oh = H5FL_FREE(H5O_t, oh); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O__free() */ - diff --git a/src/H5Oint.c b/src/H5Oint.c index fbaad53..6ab5393 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -32,7 +32,17 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5FOprivate.h" /* File objects */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ +#include "H5MFprivate.h" /* File memory management */ +#ifdef H5O_ENABLE_BOGUS +#include "H5MMprivate.h" /* Memory management */ +#endif /* H5O_ENABLE_BOGUS */ #include "H5Opkg.h" /* Object headers */ +#include "H5SMprivate.h" /* Shared object header messages */ /****************/ @@ -44,6 +54,17 @@ /* Local Typedefs */ /******************/ +/* User data for recursive traversal over objects from a group */ +typedef struct { + hid_t obj_id; /* The ID for the starting group */ + H5G_loc_t *start_loc; /* Location of starting group */ + hid_t lapl_id; /* LAPL for walking across links */ + hid_t dxpl_id; /* DXPL for operations */ + H5SL_t *visited; /* Skip list for tracking visited nodes */ + H5O_iterate_t op; /* Application callback */ + void *op_data; /* Application's op data */ +} H5O_iter_visit_ud_t; + /********************/ /* Package Typedefs */ @@ -54,19 +75,2639 @@ /* Local Prototypes */ /********************/ +static herr_t H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh); +static herr_t H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type); +static herr_t H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr); +static const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh); + /*********************/ /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + +/* Header message ID to class mapping + * + * Remember to increment H5O_MSG_TYPES in H5Opkg.h when adding a new + * message. + */ +const H5O_msg_class_t *const H5O_msg_class_g[] = { + H5O_MSG_NULL, /*0x0000 Null */ + H5O_MSG_SDSPACE, /*0x0001 Dataspace */ + H5O_MSG_LINFO, /*0x0002 Link information */ + H5O_MSG_DTYPE, /*0x0003 Datatype */ + H5O_MSG_FILL, /*0x0004 Old data storage -- fill value */ + H5O_MSG_FILL_NEW, /*0x0005 New data storage -- fill value */ + H5O_MSG_LINK, /*0x0006 Link */ + H5O_MSG_EFL, /*0x0007 Data storage -- external data files */ + H5O_MSG_LAYOUT, /*0x0008 Data Layout */ +#ifdef H5O_ENABLE_BOGUS + H5O_MSG_BOGUS_VALID, /*0x0009 "Bogus valid" (for testing) */ +#else /* H5O_ENABLE_BOGUS */ + NULL, /*0x0009 "Bogus valid" (for testing) */ +#endif /* H5O_ENABLE_BOGUS */ + H5O_MSG_GINFO, /*0x000A Group information */ + H5O_MSG_PLINE, /*0x000B Data storage -- filter pipeline */ + H5O_MSG_ATTR, /*0x000C Attribute */ + H5O_MSG_NAME, /*0x000D Object name */ + H5O_MSG_MTIME, /*0x000E Object modification date and time */ + H5O_MSG_SHMESG, /*0x000F File-wide shared message table */ + H5O_MSG_CONT, /*0x0010 Object header continuation */ + H5O_MSG_STAB, /*0x0011 Symbol table */ + H5O_MSG_MTIME_NEW, /*0x0012 New Object modification date and time */ + H5O_MSG_BTREEK, /*0x0013 Non-default v1 B-tree 'K' values */ + H5O_MSG_DRVINFO, /*0x0014 Driver info settings */ + 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 */ +#ifdef H5O_ENABLE_BOGUS + H5O_MSG_BOGUS_INVALID, /*0x001A "Bogus invalid" (for testing) */ +#else /* H5O_ENABLE_BOGUS */ + NULL, /*0x001A "Bogus invalid" (for testing) */ +#endif /* H5O_ENABLE_BOGUS */ +}; + +/* Declare a free list to manage the H5O_t struct */ +H5FL_DEFINE(H5O_t); + +/* Declare a free list to manage the H5O_mesg_t sequence information */ +H5FL_SEQ_DEFINE(H5O_mesg_t); + +/* Declare a free list to manage the H5O_chunk_t sequence information */ +H5FL_SEQ_DEFINE(H5O_chunk_t); + +/* Declare a free list to manage the chunk image information */ +H5FL_BLK_DEFINE(chunk_image); + +/* Declare external the free list for H5O_cont_t sequences */ +H5FL_SEQ_EXTERN(H5O_cont_t); + /*****************************/ /* Library Private Variables */ /*****************************/ +/* Declare external the free list for time_t's */ +H5FL_EXTERN(time_t); + +/* Declare external the free list for H5_obj_t's */ +H5FL_EXTERN(H5_obj_t); + /*******************/ /* Local Variables */ /*******************/ +/* Header object ID to class mapping */ +/* + * Initialize the object class info table. Begin with the most general types + * and end with the most specific. For instance, any object that has a + * datatype message is a datatype but only some of them are datasets. + */ +static const H5O_obj_class_t *const H5O_obj_class_g[] = { + H5O_OBJ_DATATYPE, /* Datatype object (H5O_TYPE_NAMED_DATATYPE - 2) */ + H5O_OBJ_DATASET, /* Dataset object (H5O_TYPE_DATASET - 1) */ + H5O_OBJ_GROUP, /* Group object (H5O_TYPE_GROUP - 0) */ +}; + + +/*------------------------------------------------------------------------- + * Function: H5O__init_package + * + * Purpose: Initialize information specific to H5O interface. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, January 18, 2007 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__init_package(void) +{ + FUNC_ENTER_PACKAGE_NOERR + + /* H5O interface sanity checks */ + HDcompile_assert(H5O_MSG_TYPES == NELMTS(H5O_msg_class_g)); + HDcompile_assert(sizeof(H5O_fheap_id_t) == H5O_FHEAP_ID_LEN); + + HDcompile_assert(H5O_UNKNOWN_ID < H5O_MSG_TYPES); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O__init_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_create + * + * Purpose: Creates a new object header. Allocates space for it and + * then calls an initialization function. The object header + * is opened for write access and should eventually be + * closed by calling H5O_close(). + * + * Return: Success: Non-negative, the ENT argument contains + * information about the object header, + * including its address. + * + * Failure: Negative + * + * Programmer: Robb Matzke + * matzke@llnl.gov + * Aug 5 1997 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, + hid_t ocpl_id, H5O_loc_t *loc/*out*/) +{ + H5P_genplist_t *oc_plist; /* Object creation property list */ + H5O_t *oh = NULL; /* Object header created */ + haddr_t oh_addr; /* Address of initial object header */ + size_t oh_size; /* Size of initial object header */ + uint8_t oh_flags; /* Object header's initial status flags */ + unsigned insert_flags = H5AC__NO_FLAGS_SET; /* Flags for inserting object header into cache */ + hbool_t store_msg_crt_idx; /* Whether to always store message creation indices for this file */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check args */ + HDassert(f); + HDassert(loc); + HDassert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE)); + + /* Check for invalid access request */ + if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "no write intent on file") + + /* Make certain we allocate at least a reasonable size for the object header */ + size_hint = H5O_ALIGN_F(f, MAX(H5O_MIN_SIZE, size_hint)); + + /* Get the property list */ + if(NULL == (oc_plist = (H5P_genplist_t *)H5I_object(ocpl_id))) + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a property list") + + /* Get any object header status flags set by properties */ + if(H5P_get(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &oh_flags) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get object header flags") + + /* Allocate the object header and zero out header fields */ + if(NULL == (oh = H5FL_CALLOC(H5O_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Initialize file-specific information for object header */ + store_msg_crt_idx = H5F_STORE_MSG_CRT_IDX(f); + if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_OBJ_HEADER) || store_msg_crt_idx || (oh_flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)) + oh->version = H5O_VERSION_LATEST; + else + oh->version = H5O_VERSION_1; + oh->sizeof_size = H5F_SIZEOF_SIZE(f); + oh->sizeof_addr = H5F_SIZEOF_ADDR(f); + oh->swmr_write = !!(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE); +#ifdef H5O_ENABLE_BAD_MESG_COUNT + /* Check whether the "bad message count" property is set */ + if(H5P_exist_plist(oc_plist, H5O_BAD_MESG_COUNT_NAME) > 0) { + /* Retrieve bad message count flag */ + if(H5P_get(oc_plist, H5O_BAD_MESG_COUNT_NAME, &oh->store_bad_mesg_count) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get bad message count flag") + } +#endif /* H5O_ENABLE_BAD_MESG_COUNT */ + + /* Create object header proxy if doing SWMR writes */ + if(oh->swmr_write) { + /* Create virtual entry, for use as proxy */ + if(NULL == (oh->proxy = H5AC_proxy_entry_create())) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create object header proxy") + } + else + oh->proxy = NULL; + + /* Set initial status flags */ + oh->flags = oh_flags; + + /* Initialize version-specific fields */ + if(oh->version > H5O_VERSION_1) { + /* Initialize all time fields with current time, if we are storing them */ + if(oh->flags & H5O_HDR_STORE_TIMES) + oh->atime = oh->mtime = oh->ctime = oh->btime = H5_now(); + else + oh->atime = oh->mtime = oh->ctime = oh->btime = 0; + + /* Make certain attribute creation order tracking is enabled if + * attributes can be shared in this file. + */ + if(store_msg_crt_idx) + oh->flags |= H5O_HDR_ATTR_CRT_ORDER_TRACKED; + + /* Retrieve attribute storage phase change values from property list */ + if(H5P_get(oc_plist, H5O_CRT_ATTR_MAX_COMPACT_NAME, &oh->max_compact) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get max. # of compact attributes") + if(H5P_get(oc_plist, H5O_CRT_ATTR_MIN_DENSE_NAME, &oh->min_dense) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get min. # of dense attributes") + + /* Check for non-default attribute storage phase change values */ + if(oh->max_compact != H5O_CRT_ATTR_MAX_COMPACT_DEF || oh->min_dense != H5O_CRT_ATTR_MIN_DENSE_DEF) + oh->flags |= H5O_HDR_ATTR_STORE_PHASE_CHANGE; + + /* Determine correct value for chunk #0 size bits */ +/* Avoid compiler warning on 32-bit machines */ +#if H5_SIZEOF_SIZE_T > H5_SIZEOF_INT32_T + if(size_hint > 4294967295UL) + oh->flags |= H5O_HDR_CHUNK0_8; + else +#endif /* H5_SIZEOF_SIZE_T > H5_SIZEOF_INT32_T */ + if(size_hint > 65535) + oh->flags |= H5O_HDR_CHUNK0_4; + else if(size_hint > 255) + oh->flags |= H5O_HDR_CHUNK0_2; + } /* end if */ + else { + /* Reset unused time fields */ + oh->atime = oh->mtime = oh->ctime = oh->btime = 0; + } /* end else */ + + /* Compute total size of initial object header */ + /* (i.e. object header prefix and first chunk) */ + oh_size = (size_t)H5O_SIZEOF_HDR(oh) + size_hint; + + /* Allocate disk space for header and first chunk */ + if(HADDR_UNDEF == (oh_addr = H5MF_alloc(f, H5FD_MEM_OHDR, dxpl_id, (hsize_t)oh_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for object header") + + /* Create the chunk list */ + oh->nchunks = oh->alloc_nchunks = 1; + if(NULL == (oh->chunk = H5FL_SEQ_MALLOC(H5O_chunk_t, (size_t)oh->alloc_nchunks))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Initialize the first chunk */ + oh->chunk[0].addr = oh_addr; + oh->chunk[0].size = oh_size; + oh->chunk[0].gap = 0; + + /* Allocate enough space for the first chunk */ + /* (including space for serializing the object header prefix */ + if(NULL == (oh->chunk[0].image = H5FL_BLK_CALLOC(chunk_image, oh_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + oh->chunk[0].chunk_proxy = NULL; + + /* Put magic # for object header in first chunk */ + if(oh->version > H5O_VERSION_1) + HDmemcpy(oh->chunk[0].image, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); + + /* Create the message list */ + oh->nmesgs = 1; + oh->alloc_nmesgs = H5O_NMESGS; + if(NULL == (oh->mesg = H5FL_SEQ_CALLOC(H5O_mesg_t, oh->alloc_nmesgs))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Initialize the initial "null" message, covering the entire first chunk */ + oh->mesg[0].type = H5O_MSG_NULL; + oh->mesg[0].dirty = TRUE; + oh->mesg[0].native = NULL; + oh->mesg[0].raw = oh->chunk[0].image + (H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh)) + H5O_SIZEOF_MSGHDR_OH(oh); + oh->mesg[0].raw_size = size_hint - (size_t)H5O_SIZEOF_MSGHDR_OH(oh); + oh->mesg[0].chunkno = 0; + + /* Check for non-zero initial refcount on the object header */ + if(initial_rc > 0) { + /* Set the initial refcount & pin the header when its inserted */ + oh->rc = initial_rc; + insert_flags |= H5AC__PIN_ENTRY_FLAG; + } + + /* Set metadata tag in dxpl_id */ + H5_BEGIN_TAG(dxpl_id, oh_addr, FAIL); + + /* Cache object header */ + if(H5AC_insert_entry(f, dxpl_id, H5AC_OHDR, oh_addr, oh, insert_flags) < 0) + HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header") + + /* Reset object header pointer, now that it's been inserted into the cache */ + oh = NULL; + + /* Reset metadata tag in dxpl_id */ + H5_END_TAG(FAIL); + + /* Set up object location */ + loc->file = f; + loc->addr = oh_addr; + + /* Open it */ + if(H5O_open(loc) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object header") + +done: + if(ret_value < 0 && oh) + if(H5O__free(oh) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_create() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_open + * + * Purpose: Opens an object header which is described by the symbol table + * entry OBJ_ENT. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Monday, January 5, 1998 + * + * Modification: + * Raymond Lu + * 5 November 2007 + * Turn off the holding file variable if it's on. When it's + * needed, the caller will turn it on again. + *------------------------------------------------------------------------- + */ +herr_t +H5O_open(H5O_loc_t *loc) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + HDassert(loc); + HDassert(loc->file); + +#ifdef H5O_DEBUG + if(H5DEBUG(O)) + HDfprintf(H5DEBUG(O), "> %a\n", loc->addr); +#endif + + /* Turn off the variable for holding file or increment open-lock counters */ + if(loc->holding_file) + loc->holding_file = FALSE; + else + H5F_INCR_NOPEN_OBJS(loc->file); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_open() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_open_name + * + * Purpose: Opens an object within an HDF5 file. + * + * Return: Success: An open object identifier + * Failure: Negative + * + * Programmer: Quincey Koziol + * March 5 2007 + * + *------------------------------------------------------------------------- + */ +hid_t +H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'name' found */ + hid_t ret_value = FAIL; + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + HDassert(loc); + HDassert(name && *name); + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(loc, name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Open the object */ + if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, app_ref)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") + +done: + if(ret_value < 0 && loc_found) + if(H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_open_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_open_by_loc + * + * Purpose: Opens an object and returns an ID given its group loction. + * + * Return: Success: Open object identifier + * Failure: Negative + * + * Programmer: James Laird + * July 25 2006 + * + *------------------------------------------------------------------------- + */ +hid_t +H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) +{ + const H5O_obj_class_t *obj_class; /* Class of object for location */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(obj_loc); + + /* Get the object class for this location */ + if(NULL == (obj_class = H5O_obj_class(obj_loc->oloc, dxpl_id))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class") + + /* Call the object class's 'open' routine */ + HDassert(obj_class->open); + if((ret_value = obj_class->open(obj_loc, lapl_id, dxpl_id, app_ref)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_open_by_loc() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_close + * + * Purpose: Closes an object header that was previously open. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Monday, January 5, 1998 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_close(H5O_loc_t *loc, hbool_t *file_closed /*out*/) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + HDassert(loc); + HDassert(loc->file); + HDassert(H5F_NOPEN_OBJS(loc->file) > 0); + + /* Set the file_closed flag to the default value. + * This flag lets downstream code know if the file struct is + * still accessible and/or likely to contain useful data. + * It's needed by the evict-on-close code. Clients can ignore + * this value by passing in NULL. + */ + if(file_closed) + *file_closed = FALSE; + + /* Decrement open-lock counters */ + H5F_DECR_NOPEN_OBJS(loc->file); + +#ifdef H5O_DEBUG + if(H5DEBUG(O)) { + if(H5F_FILE_ID(loc->file)< 0 && 1 == H5F_NREFS(loc->file)) + HDfprintf(H5DEBUG(O), "< %a auto %lu remaining\n", + loc->addr, (unsigned long)H5F_NOPEN_OBJS(loc->file)); + else + HDfprintf(H5DEBUG(O), "< %a\n", loc->addr); + } +#endif + + /* + * If the file open object count has reached the number of open mount points + * (each of which has a group open in the file) attempt to close the file. + */ + if(H5F_NOPEN_OBJS(loc->file) == H5F_NMOUNTS(loc->file)) + /* Attempt to close down the file hierarchy */ + if(H5F_try_close(loc->file, file_closed) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCLOSEFILE, FAIL, "problem attempting file close") + + /* Release location information */ + if(H5O_loc_free(loc) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "problem attempting to free location") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_close() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_link_oh + * + * Purpose: Adjust the link count for an open object header by adding + * ADJUST to the link count. + * + * Return: Success: New link count + * + * Failure: Negative + * + * Programmer: Robb Matzke + * matzke@llnl.gov + * Aug 5 1997 + * + *------------------------------------------------------------------------- + */ +int +H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) +{ + haddr_t addr = H5O_OH_GET_ADDR(oh); /* Object header address */ + int ret_value = -1; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check args */ + HDassert(f); + HDassert(oh); + HDassert(deleted); + + /* Check for adjusting link count */ + if(adjust) { + if(adjust < 0) { + /* Check for too large of an adjustment */ + if((unsigned)(-adjust) > oh->nlink) + HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "link count would be negative") + + /* Adjust the link count for the object header */ + oh->nlink = (unsigned)((int)oh->nlink + adjust); + + /* Mark object header as dirty in cache */ + if(H5AC_mark_entry_dirty(oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") + + /* Check if the object should be deleted */ + if(oh->nlink == 0) { + /* Check if the object is still open by the user */ + if(H5FO_opened(f, addr) != NULL) { + /* Flag the object to be deleted when it's closed */ + if(H5FO_mark(f, addr, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't mark object for deletion") + } /* end if */ + else { + /* Mark the object header for deletion */ + *deleted = TRUE; + } /* end else */ + } /* end if */ + } /* end if */ + else { + /* A new object, or one that will be deleted */ + if(0 == oh->nlink) { + /* Check if the object is currently open, but marked for deletion */ + if(H5FO_marked(f, addr)) { + /* Remove "delete me" flag on the object */ + if(H5FO_mark(f, addr, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't mark object for deletion") + } /* end if */ + } /* end if */ + + /* Adjust the link count for the object header */ + oh->nlink = (unsigned)((int)oh->nlink + adjust); + + /* Mark object header as dirty in cache */ + if(H5AC_mark_entry_dirty(oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") + } /* end if */ + + /* Check for operations on refcount message */ + if(oh->version > H5O_VERSION_1) { + /* Check if the object has a refcount message already */ + if(oh->has_refcount_msg) { + /* Check for removing refcount message */ + if(oh->nlink <= 1) { + if(H5O_msg_remove_real(f, oh, H5O_MSG_REFCOUNT, H5O_ALL, NULL, NULL, TRUE, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete refcount message") + oh->has_refcount_msg = FALSE; + } /* end if */ + /* Update refcount message with new link count */ + else { + H5O_refcount_t refcount = oh->nlink; + + if(H5O_msg_write_real(f, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update refcount message") + } /* end else */ + } /* end if */ + else { + /* Check for adding refcount message to object */ + if(oh->nlink > 1) { + H5O_refcount_t refcount = oh->nlink; + + if(H5O_msg_append_real(f, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to create new refcount message") + oh->has_refcount_msg = TRUE; + } /* end if */ + } /* end else */ + } /* end if */ + } /* end if */ + + /* Set return value */ + ret_value = (int)oh->nlink; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_link_oh() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_link + * + * Purpose: Adjust the link count for an object header by adding + * ADJUST to the link count. + * + * Return: Success: New link count + * + * Failure: Negative + * + * Programmer: Robb Matzke + * matzke@llnl.gov + * Aug 5 1997 + * + *------------------------------------------------------------------------- + */ +int +H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) +{ + H5O_t *oh = NULL; + hbool_t deleted = FALSE; /* Whether the object was deleted */ + int ret_value = -1; /* Return value */ + + FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) + + /* check args */ + HDassert(loc); + HDassert(loc->file); + HDassert(H5F_addr_defined(loc->addr)); + + /* Pin the object header */ + if(NULL == (oh = H5O_pin(loc, dxpl_id))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") + + /* Call the "real" link routine */ + if((ret_value = H5O_link_oh(loc->file, adjust, dxpl_id, oh, &deleted)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust object link count") + +done: + if(oh && H5O_unpin(oh) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") + if(ret_value >= 0 && deleted && H5O_delete(loc->file, dxpl_id, loc->addr) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file") + + FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) +} /* end H5O_link() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_protect + * + * Purpose: Wrapper around H5AC_protect for use during a H5O_protect-> + * H5O_msg_append->...->H5O_msg_append->H5O_unprotect sequence of calls + * during an object's creation. + * + * Return: Success: Pointer to the object header structure for the + * object. + * Failure: NULL + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Dec 31 2002 + * + *------------------------------------------------------------------------- + */ +H5O_t * +H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, + hbool_t pin_all_chunks) +{ + H5O_t *oh = NULL; /* Object header protected */ + H5O_cache_ud_t udata; /* User data for protecting object header */ + H5O_cont_msgs_t cont_msg_info; /* Continuation message info */ + unsigned file_intent; /* R/W intent on file */ + H5O_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, NULL) + + /* check args */ + HDassert(loc); + HDassert(loc->file); + + /* prot_flags may only contain the H5AC__READ_ONLY_FLAG */ + HDassert((prot_flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + + /* Check for valid address */ + if(!H5F_addr_defined(loc->addr)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "address undefined") + + /* Check for write access on the file */ + file_intent = H5F_INTENT(loc->file); + if((0 == (prot_flags & H5AC__READ_ONLY_FLAG)) && (0 == (file_intent & H5F_ACC_RDWR))) + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "no write intent on file") + + /* Construct the user data for protect callback */ + udata.made_attempt = FALSE; + udata.v1_pfx_nmesgs = 0; + udata.chunk0_size = 0; + udata.oh = NULL; + udata.common.f = loc->file; + udata.common.dxpl_id = dxpl_id; + udata.common.file_intent = file_intent; + udata.common.merged_null_msgs = 0; + HDmemset(&cont_msg_info, 0, sizeof(cont_msg_info)); + udata.common.cont_msg_info = &cont_msg_info; + udata.common.addr = loc->addr; + + /* Lock the object header into the cache */ + if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, &udata, prot_flags))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header") + + /* Check if there are any continuation messages to process */ + if(cont_msg_info.nmsgs > 0) { + size_t curr_msg; /* Current continuation message to process */ + H5O_chk_cache_ud_t chk_udata; /* User data for loading chunk */ + + /* Sanity check - we should only have continuation messages to process + * when the object header is actually loaded from the file. + */ + HDassert(udata.made_attempt == TRUE); + HDassert(cont_msg_info.msgs); + + /* Construct the user data for protecting chunks */ + chk_udata.decoding = TRUE; + chk_udata.oh = oh; + chk_udata.chunkno = UINT_MAX; /* Set to invalid value, for better error detection */ + chk_udata.common.f = loc->file; + chk_udata.common.dxpl_id = dxpl_id; + chk_udata.common.file_intent = file_intent; + chk_udata.common.merged_null_msgs = udata.common.merged_null_msgs; + chk_udata.common.cont_msg_info = &cont_msg_info; + + /* Read in continuation messages, until there are no more */ + /* (Note that loading chunks could increase the # of continuation + * messages if new ones are found - QAK, 19/11/2016) + */ + curr_msg = 0; + while(curr_msg < cont_msg_info.nmsgs) { + H5O_chunk_proxy_t *chk_proxy; /* Proxy for chunk, to bring it into memory */ +#ifndef NDEBUG + size_t chkcnt = oh->nchunks; /* Count of chunks (for sanity checking) */ +#endif /* NDEBUG */ + + /* Bring the chunk into the cache */ + /* (which adds to the object header) */ + chk_udata.common.addr = cont_msg_info.msgs[curr_msg].addr; + chk_udata.size = cont_msg_info.msgs[curr_msg].size; + if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, &chk_udata, prot_flags))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") + + /* Sanity check */ + HDassert(chk_proxy->oh == oh); + HDassert(chk_proxy->chunkno == chkcnt); + HDassert(oh->nchunks == (chkcnt + 1)); + + /* Release the chunk from the cache */ + if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header chunk") + + /* Advance to next continuation message */ + curr_msg++; + } /* end while */ + + /* Release any continuation messages built up */ + cont_msg_info.msgs = (H5O_cont_t *)H5FL_SEQ_FREE(H5O_cont_t, cont_msg_info.msgs); + + /* Pass back out some of the chunk's user data */ + udata.common.merged_null_msgs = chk_udata.common.merged_null_msgs; + } /* end if */ + + /* Check for incorrect # of object header messages, if we've just loaded + * this object header from the file + */ + if(udata.made_attempt) { +/* Don't enforce the error on an incorrect # of object header messages bug + * unless strict format checking is enabled. This allows for older + * files, created with a version of the library that had a bug in tracking + * the correct # of header messages to be read in without the library + * erroring out here. -QAK + */ +#ifdef H5_STRICT_FORMAT_CHECKS + /* Check for incorrect # of messages in v1 object header */ + if(oh->version == H5O_VERSION_1 && + (oh->nmesgs + udata.common.merged_null_msgs) != udata.v1_pfx_nmesgs) + HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "corrupt object header - incorrect # of messages") +#endif /* H5_STRICT_FORMAT_CHECKS */ + } /* end if */ + +#ifdef H5O_DEBUG +H5O_assert(oh); +#endif /* H5O_DEBUG */ + + /* Pin the other chunks also when requested, so that the object header + * proxy can be set up. + */ + if(pin_all_chunks && oh->nchunks > 1) { + unsigned u; /* Local index variable */ + + /* Sanity check */ + HDassert(oh->swmr_write); + + /* Iterate over chunks > 0 */ + for(u = 1; u < oh->nchunks; u++) { + H5O_chunk_proxy_t *chk_proxy; /* Chunk proxy */ + + /* Protect chunk */ + if(NULL == (chk_proxy = H5O_chunk_protect(loc->file, dxpl_id, oh, u))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header chunk") + + /* Pin chunk proxy*/ + if(H5AC_pin_protected_entry(chk_proxy) < 0 ) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, NULL, "unable to pin object header chunk") + + /* Unprotect chunk */ + if(H5O_chunk_unprotect(loc->file, dxpl_id, chk_proxy, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to unprotect object header chunk") + + /* Preserve chunk proxy pointer for later */ + oh->chunk[u].chunk_proxy = chk_proxy; + } /* end for */ + + /* Set the flag for the unprotect */ + oh->chunks_pinned = TRUE; + } /* end if */ + + /* Set return value */ + ret_value = oh; + +done: + if(ret_value == NULL && oh) + if(H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") + + FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) +} /* end H5O_protect() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_pin + * + * Purpose: Pin an object header down for use during a sequence of message + * operations, which prevents the object header from being + * evicted from the cache. + * + * Return: Success: Pointer to the object header structure for the + * object. + * Failure: NULL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Jul 13 2008 + * + *------------------------------------------------------------------------- + */ +H5O_t * +H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id) +{ + H5O_t *oh = NULL; /* Object header */ + H5O_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + + /* check args */ + HDassert(loc); + + /* Get header */ + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header") + + /* Increment the reference count on the object header */ + /* (which will pin it, if appropriate) */ + if(H5O_inc_rc(oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, NULL, "unable to increment reference count on object header") + + /* Set the return value */ + ret_value = oh; + +done: + /* Release the object header from the cache */ + if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_pin() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_unpin + * + * Purpose: Unpin an object header, allowing it to be evicted from the + * metadata cache. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Jul 13 2008 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_unpin(H5O_t *oh) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check args */ + HDassert(oh); + + /* Decrement the reference count on the object header */ + /* (which will unpin it, if appropriate) */ + if(H5O_dec_rc(oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement reference count on object header") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_unpin() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_unprotect + * + * Purpose: Wrapper around H5AC_unprotect for use during a H5O_protect-> + * H5O_msg_append->...->H5O_msg_append->H5O_unprotect sequence of calls + * during an object's creation. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Dec 31 2002 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_unprotect(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, unsigned oh_flags) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check args */ + HDassert(loc); + HDassert(oh); + + /* Unpin the other chunks */ + if(oh->chunks_pinned && oh->nchunks > 1) { + unsigned u; /* Local index variable */ + + /* Sanity check */ + HDassert(oh->swmr_write); + + /* Iterate over chunks > 0 */ + for(u = 1; u < oh->nchunks; u++) { + if(NULL != oh->chunk[u].chunk_proxy) { + /* Release chunk proxy */ + if(H5AC_unpin_entry(oh->chunk[u].chunk_proxy) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPIN, FAIL, "unable to unpin object header chunk") + oh->chunk[u].chunk_proxy = NULL; + } /* end if */ + } /* end for */ + + /* Reet the flag from the unprotect */ + oh->chunks_pinned = FALSE; + } /* end if */ + + /* Unprotect the object header */ + if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, oh->chunk[0].addr, oh, oh_flags) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_unprotect() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_touch_oh + * + * Purpose: If FORCE is non-zero then create a modification time message + * unless one already exists. Then update any existing + * modification time message with the current time. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Monday, July 27, 1998 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) +{ + H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ + hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ + time_t now; /* Current time */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(f); + HDassert(oh); + + /* Check if this object header is tracking times */ + if(oh->flags & H5O_HDR_STORE_TIMES) { + /* Get current time */ + now = H5_now(); + + /* Check version, to determine how to store time information */ + if(oh->version == H5O_VERSION_1) { + size_t idx; /* Index of modification time message to update */ + + /* Look for existing message */ + for(idx = 0; idx < oh->nmesgs; idx++) + if(H5O_MSG_MTIME == oh->mesg[idx].type || H5O_MSG_MTIME_NEW == oh->mesg[idx].type) + break; + + /* Create a new message, if necessary */ + if(idx == oh->nmesgs) { + unsigned mesg_flags = 0; /* Flags for message in object header */ + + /* If we would have to create a new message, but we aren't 'forcing' it, get out now */ + if(!force) + HGOTO_DONE(SUCCEED); /*nothing to do*/ + + /* Allocate space for the modification time message */ + if(H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_MTIME_NEW, &mesg_flags, &now, &idx) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for modification time message") + + /* Set the message's flags if appropriate */ + oh->mesg[idx].flags = (uint8_t)mesg_flags; + } /* end if */ + + /* Protect chunk */ + if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, oh->mesg[idx].chunkno))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") + + /* Allocate 'native' space, if necessary */ + if(NULL == oh->mesg[idx].native) { + if(NULL == (oh->mesg[idx].native = H5FL_MALLOC(time_t))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "memory allocation failed for modification time message") + } /* end if */ + + /* Update the message */ + *((time_t *)(oh->mesg[idx].native)) = now; + + /* Mark the message as dirty */ + oh->mesg[idx].dirty = TRUE; + chk_dirtied = TRUE; + } /* end if */ + else { + /* XXX: For now, update access time & change fields in the object header */ + /* (will need to add some code to update modification time appropriately) */ + oh->atime = oh->ctime = now; + + /* Mark object header as dirty in cache */ + if(H5AC_mark_entry_dirty(oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") + } /* end else */ + } /* end if */ + +done: + /* Release chunk */ + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_touch_oh() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_touch + * + * Purpose: Touch an object by setting the modification time to the + * current time and marking the object as dirty. Unless FORCE + * is non-zero, nothing happens if there is no MTIME message in + * the object header. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Monday, July 27, 1998 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id) +{ + H5O_t *oh = NULL; /* Object header to modify */ + unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting object header */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check args */ + HDassert(loc); + + /* Get the object header */ + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") + + /* Create/Update the modification time message */ + if(H5O_touch_oh(loc->file, dxpl_id, oh, force) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "unable to update object modificaton time") + + /* Mark object header as changed */ + oh_flags |= H5AC__DIRTIED_FLAG; + +done: + if(oh && H5O_unprotect(loc, dxpl_id, oh, oh_flags) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_touch() */ + +#ifdef H5O_ENABLE_BOGUS + +/*------------------------------------------------------------------------- + * Function: H5O_bogus_oh + * + * Purpose: Create a "bogus" message unless one already exists. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * + * Tuesday, January 21, 2003 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned bogus_id, unsigned mesg_flags) +{ + size_t idx; /* Local index variable */ + H5O_msg_class_t *type; /* Message class type */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(f); + HDassert(oh); + + /* Look for existing message */ + for(idx = 0; idx < oh->nmesgs; idx++) + if(H5O_MSG_BOGUS_VALID == oh->mesg[idx].type || H5O_MSG_BOGUS_INVALID == oh->mesg[idx].type) + break; + + /* Create a new message */ + if(idx == oh->nmesgs) { + H5O_bogus_t *bogus; /* Pointer to the bogus information */ + + /* Allocate the native message in memory */ + if(NULL == (bogus = H5MM_malloc(sizeof(H5O_bogus_t)))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "memory allocation failed for 'bogus' message") + + /* Update the native value */ + bogus->u = H5O_BOGUS_VALUE; + + if(bogus_id == H5O_BOGUS_VALID_ID) + type = H5O_MSG_BOGUS_VALID; + else if(bogus_id == H5O_BOGUS_INVALID_ID) + type = H5O_MSG_BOGUS_INVALID; + else + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID for 'bogus' message") + + /* Allocate space in the object header for bogus message */ + if(H5O_msg_alloc(f, dxpl_id, oh, type, &mesg_flags, bogus, &idx) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for 'bogus' message") + + /* Point to "bogus" information (take it over) */ + oh->mesg[idx].native = bogus; + + /* Set the appropriate flags for the message */ + oh->mesg[idx].flags = mesg_flags; + + /* Mark the message and object header as dirty */ + oh->mesg[idx].dirty = TRUE; + oh->cache_info.is_dirty = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_bogus_oh() */ +#endif /* H5O_ENABLE_BOGUS */ + + +/*------------------------------------------------------------------------- + * Function: H5O_delete + * + * Purpose: Delete an object header from a file. This frees the file + * space used for the object header (and it's continuation blocks) + * and also walks through each header message and asks it to + * remove all the pieces of the file referenced by the header. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Mar 19 2003 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) +{ + H5O_t *oh = NULL; /* Object header information */ + H5O_loc_t loc; /* Object location for object to delete */ + unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting object header */ + hbool_t corked; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_TAG(dxpl_id, addr, FAIL) + + /* Check args */ + HDassert(f); + HDassert(H5F_addr_defined(addr)); + + /* Set up the object location */ + loc.file = f; + loc.addr = addr; + loc.holding_file = FALSE; + + /* Get the object header information */ + if(NULL == (oh = H5O_protect(&loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") + + /* Delete object */ + if(H5O_delete_oh(f, dxpl_id, oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file") + + /* Uncork cache entries with tag: addr */ + if(H5AC_cork(f, addr, H5AC__GET_CORKED, &corked) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to retrieve an object's cork status") + if(corked) + if(H5AC_cork(f, addr, H5AC__UNCORK, NULL) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUNCORK, FAIL, "unable to uncork an object") + + /* Mark object header as deleted */ + oh_flags = H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; + +done: + if(oh && H5O_unprotect(&loc, dxpl_id, oh, oh_flags) < 0) + HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") + + FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) +} /* end H5O_delete() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_delete_oh + * + * Purpose: Internal function to: + * Delete an object header from a file. This frees the file + * space used for the object header (and it's continuation blocks) + * and also walks through each header message and asks it to + * remove all the pieces of the file referenced by the header. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Mar 19 2003 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) +{ + H5O_mesg_t *curr_msg; /* Pointer to current message being operated on */ + unsigned u; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Check args */ + HDassert(f); + HDassert(oh); + + /* Walk through the list of object header messages, asking each one to + * delete any file space used + */ + for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { + /* Free any space referred to in the file from this message */ + if(H5O_delete_mesg(f, dxpl_id, oh, curr_msg) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") + } /* end for */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_delete_oh() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_obj_type + * + * Purpose: Retrieves the type of object pointed to by `loc'. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Robb Matzke + * Wednesday, November 4, 1998 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type, hid_t dxpl_id) +{ + H5O_t *oh = NULL; /* Object header for location */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) + + /* Load the object header */ + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") + + /* Retrieve the type of the object */ + if(H5O_obj_type_real(oh, obj_type) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") + +done: + if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + + FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) +} /* end H5O_obj_type() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_obj_type_real + * + * Purpose: Returns the type of object pointed to by `oh'. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Monday, November 21, 2005 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type) +{ + const H5O_obj_class_t *obj_class; /* Class of object for header */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(oh); + HDassert(obj_type); + + /* Look up class for object header */ + if(NULL == (obj_class = H5O_obj_class_real(oh))) { + /* Clear error stack from "failed" class lookup */ + H5E_clear_stack(NULL); + + /* Set type to "unknown" */ + *obj_type = H5O_TYPE_UNKNOWN; + } + else { + /* Set object type */ + *obj_type = obj_class->type; + } + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_obj_type_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_obj_class + * + * Purpose: Returns the class of object pointed to by `loc'. + * + * Return: Success: An object class + * Failure: NULL + * + * Programmer: Quincey Koziol + * Monday, November 6, 2006 + * + *------------------------------------------------------------------------- + */ +const H5O_obj_class_t * +H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id) +{ + H5O_t *oh = NULL; /* Object header for location */ + const H5O_obj_class_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, NULL) + + /* Load the object header */ + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header") + + /* Test whether entry qualifies as a particular type of object */ + if(NULL == (ret_value = H5O_obj_class_real(oh))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to determine object type") + +done: + if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") + + FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) +} /* end H5O_obj_class() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_obj_class_real + * + * Purpose: Returns the class of object pointed to by `oh'. + * + * Return: Success: An object class + * Failure: NULL + * + * Programmer: Quincey Koziol + * Monday, November 21, 2005 + * + *------------------------------------------------------------------------- + */ +static const H5O_obj_class_t * +H5O_obj_class_real(H5O_t *oh) +{ + size_t i; /* Local index variable */ + const H5O_obj_class_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + + /* Sanity check */ + HDassert(oh); + + /* Test whether entry qualifies as a particular type of object */ + /* (Note: loop is in reverse order, to test specific objects first) */ + for(i = NELMTS(H5O_obj_class_g); i > 0; --i) { + htri_t isa; /* Is entry a particular type? */ + + if((isa = (H5O_obj_class_g[i - 1]->isa)(oh)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to determine object type") + else if(isa) + HGOTO_DONE(H5O_obj_class_g[i - 1]) + } + + if(0 == i) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to determine object type") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_obj_class_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_get_loc + * + * Purpose: Gets the object location for an object given its ID. + * + * Return: Success: Pointer to H5O_loc_t + * Failure: NULL + * + * Programmer: James Laird + * July 25 2006 + * + *------------------------------------------------------------------------- + */ +H5O_loc_t * +H5O_get_loc(hid_t object_id) +{ + H5O_loc_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + switch(H5I_get_type(object_id)) { + case H5I_GROUP: + if(NULL == (ret_value = H5O_OBJ_GROUP->get_oloc(object_id))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to get object location from group ID") + break; + + case H5I_DATASET: + if(NULL == (ret_value = H5O_OBJ_DATASET->get_oloc(object_id))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to get object location from dataset ID") + break; + + case H5I_DATATYPE: + if(NULL == (ret_value = H5O_OBJ_DATATYPE->get_oloc(object_id))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to get object location from datatype ID") + 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: + default: + HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, NULL, "invalid object type") + } /* end switch */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_get_loc() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_loc_reset + * + * Purpose: Reset a object location to an empty state + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Monday, September 19, 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_loc_reset(H5O_loc_t *loc) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Check arguments */ + HDassert(loc); + + /* Clear the object location to an empty state */ + HDmemset(loc, 0, sizeof(H5O_loc_t)); + loc->addr = HADDR_UNDEF; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_loc_reset() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_loc_copy + * + * Purpose: Copy object location information + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Monday, September 19, 2005 + * + * Notes: 'depth' parameter determines how much of the group entry + * structure we want to copy. The values are: + * H5_COPY_SHALLOW - Copy all the field values from the source + * to the destination, but not copying objects pointed to. + * (Destination "takes ownership" of objects pointed to) + * H5_COPY_DEEP - Copy all the fields from the source to + * the destination, deep copying objects pointed to. + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_loc_copy(H5O_loc_t *dst, H5O_loc_t *src, H5_copy_depth_t depth) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Check arguments */ + HDassert(src); + HDassert(dst); + HDassert(depth == H5_COPY_SHALLOW || depth == H5_COPY_DEEP); + + /* Copy the top level information */ + HDmemcpy(dst, src, sizeof(H5O_loc_t)); + + /* Deep copy the names */ + if(depth == H5_COPY_DEEP) { + /* If the original entry was holding open the file, this one should + * hold it open, too. + */ + if(src->holding_file) + H5F_INCR_NOPEN_OBJS(dst->file); + } + else if(depth == H5_COPY_SHALLOW) { + H5O_loc_reset(src); + } + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_loc_copy() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_loc_hold_file + * + * Purpose: Have this object header hold a file open until it is + * released. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: James Laird + * Wednesday, August 16, 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_loc_hold_file(H5O_loc_t *loc) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Check arguments */ + HDassert(loc); + HDassert(loc->file); + + /* If this location is not already holding its file open, do so. */ + if(!loc->holding_file) { + H5F_INCR_NOPEN_OBJS(loc->file); + loc->holding_file = TRUE; + } + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_loc_hold_file() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_loc_free + * + * Purpose: Release resources used by this object header location. + * Not to be confused with H5O_close; this is used on + * locations that don't correspond to open objects. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: James Laird + * Wednesday, August 16, 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_loc_free(H5O_loc_t *loc) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* Check arguments */ + HDassert(loc); + + /* If this location is holding its file open try to close the file. */ + if(loc->holding_file) { + H5F_DECR_NOPEN_OBJS(loc->file); + loc->holding_file = FALSE; + if(H5F_NOPEN_OBJS(loc->file) <= 0) { + if(H5F_try_close(loc->file, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") + } + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_loc_free() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_get_hdr_info + * + * Purpose: Retrieve the object header information for an object + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * September 22 2009 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_get_hdr_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_hdr_info_t *hdr) +{ + H5O_t *oh = NULL; /* Object header */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + HDassert(loc); + HDassert(hdr); + + /* Reset the object header info structure */ + HDmemset(hdr, 0, sizeof(*hdr)); + + /* Get the object header */ + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") + + /* Get the information for the object header */ + if(H5O_get_hdr_info_real(oh, hdr) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object header info") + +done: + if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_get_hdr_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_get_hdr_info_real + * + * Purpose: Internal routine to retrieve the object header information for an object + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * September 22 2009 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) +{ + const H5O_mesg_t *curr_msg; /* Pointer to current message being operated on */ + const H5O_chunk_t *curr_chunk; /* Pointer to current message being operated on */ + unsigned u; /* Local index variable */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Check args */ + HDassert(oh); + HDassert(hdr); + + /* Set the version for the object header */ + hdr->version = oh->version; + + /* Set the number of messages & chunks */ + H5_CHECKED_ASSIGN(hdr->nmesgs, unsigned, oh->nmesgs, size_t); + H5_CHECKED_ASSIGN(hdr->nchunks, unsigned, oh->nchunks, size_t); + + /* Set the status flags */ + hdr->flags = oh->flags; + + /* Iterate over all the messages, accumulating message size & type information */ + hdr->space.meta = (hsize_t)H5O_SIZEOF_HDR(oh) + (hsize_t)(H5O_SIZEOF_CHKHDR_OH(oh) * (oh->nchunks - 1)); + hdr->space.mesg = 0; + hdr->space.free = 0; + hdr->mesg.present = 0; + hdr->mesg.shared = 0; + for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { + uint64_t type_flag; /* Flag for message type */ + + /* Accumulate space usage information, based on the type of message */ + if(H5O_NULL_ID == curr_msg->type->id) + hdr->space.free += (hsize_t)((size_t)H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size); + else if(H5O_CONT_ID == curr_msg->type->id) + hdr->space.meta += (hsize_t)((size_t)H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size); + else { + hdr->space.meta += (hsize_t)H5O_SIZEOF_MSGHDR_OH(oh); + hdr->space.mesg += curr_msg->raw_size; + } /* end else */ + + /* Set flag to indicate presence of message type */ + type_flag = ((uint64_t)1) << curr_msg->type->id; + hdr->mesg.present |= type_flag; + + /* Set flag if the message is shared in some way */ + if(curr_msg->flags & H5O_MSG_FLAG_SHARED) \ + hdr->mesg.shared |= type_flag; + } /* end for */ + + /* Iterate over all the chunks, adding any gaps to the free space */ + hdr->space.total = 0; + for(u = 0, curr_chunk = &oh->chunk[0]; u < oh->nchunks; u++, curr_chunk++) { + /* Accumulate the size of the header on disk */ + hdr->space.total += curr_chunk->size; + + /* If the chunk has a gap, add it to the free space */ + hdr->space.free += curr_chunk->gap; + } /* end for */ + + /* Sanity check that all the bytes are accounted for */ + HDassert(hdr->space.total == (hdr->space.free + hdr->space.meta + hdr->space.mesg)); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_get_hdr_info_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_get_info + * + * Purpose: Retrieve the information for an object + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * November 21 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, + H5O_info_t *oinfo) +{ + const H5O_obj_class_t *obj_class; /* Class of object for header */ + H5O_t *oh = NULL; /* Object header */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) + + /* Check args */ + HDassert(loc); + HDassert(oinfo); + + /* Get the object header */ + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") + + /* Reset the object info structure */ + HDmemset(oinfo, 0, sizeof(*oinfo)); + + /* Retrieve the file's fileno */ + H5F_GET_FILENO(loc->file, oinfo->fileno); + + /* Set the object's address */ + oinfo->addr = loc->addr; + + /* Get class for object */ + if(NULL == (obj_class = H5O_obj_class_real(oh))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class") + + /* Retrieve the type of the object */ + oinfo->type = obj_class->type; + + /* Set the object's reference count */ + oinfo->rc = oh->nlink; + + /* Get modification time for object */ + if(oh->version > H5O_VERSION_1) { + oinfo->atime = oh->atime; + oinfo->mtime = oh->mtime; + oinfo->ctime = oh->ctime; + oinfo->btime = oh->btime; + } /* end if */ + else { + htri_t exists; /* Flag if header message of interest exists */ + + /* No information for access & modification fields */ + /* (we stopped updating the "modification time" header message for + * raw data changes, so the "modification time" header message + * is closest to the 'change time', in POSIX terms - QAK) + */ + oinfo->atime = 0; + oinfo->mtime = 0; + oinfo->btime = 0; + + /* Might be information for modification time */ + if((exists = H5O_msg_exists_oh(oh, H5O_MTIME_ID)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME message") + if(exists > 0) { + /* Get "old style" modification time info */ + if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_MTIME_ID, &oinfo->ctime)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME message") + } /* end if */ + else { + /* Check for "new style" modification time info */ + if((exists = H5O_msg_exists_oh(oh, H5O_MTIME_NEW_ID)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME_NEW message") + if(exists > 0) { + /* Get "new style" modification time info */ + if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_MTIME_NEW_ID, &oinfo->ctime)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME_NEW message") + } /* end if */ + else + oinfo->ctime = 0; + } /* end else */ + } /* end else */ + + /* Get the information for the object header */ + if(H5O_get_hdr_info_real(oh, &oinfo->hdr) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object header info") + + /* Retrieve # of attributes */ + if(H5O_attr_count_real(loc->file, dxpl_id, oh, &oinfo->num_attrs) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve attribute count") + + /* Get B-tree & heap metadata storage size, if requested */ + if(want_ih_info) { + /* Check for 'bh_info' callback for this type of object */ + if(obj_class->bh_info) { + /* Call the object's class 'bh_info' routine */ + if((obj_class->bh_info)(loc, dxpl_id, oh, &oinfo->meta_size.obj) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object's btree & heap info") + } /* end if */ + + /* Get B-tree & heap info for any attributes */ + if(oinfo->num_attrs > 0) { + if(H5O_attr_bh_info(loc->file, dxpl_id, oh, &oinfo->meta_size.attr) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve attribute btree & heap info") + } /* end if */ + } /* end if */ + +done: + if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + + FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) +} /* end H5O_get_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_get_create_plist + * + * Purpose: Retrieve the object creation properties for an object + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * November 28 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, H5P_genplist_t *oc_plist) +{ + H5O_t *oh = NULL; /* Object header */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + HDassert(loc); + HDassert(oc_plist); + + /* Get the object header */ + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") + + /* Set property values, if they were used for the object */ + if(oh->version > H5O_VERSION_1) { + uint8_t ohdr_flags; /* "User-visible" object header status flags */ + + /* Set attribute storage values */ + if(H5P_set(oc_plist, H5O_CRT_ATTR_MAX_COMPACT_NAME, &oh->max_compact) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set max. # of compact attributes in property list") + if(H5P_set(oc_plist, H5O_CRT_ATTR_MIN_DENSE_NAME, &oh->min_dense) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set min. # of dense attributes in property list") + + /* Mask off non-"user visible" flags */ + ohdr_flags = oh->flags & (H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | H5O_HDR_STORE_TIMES); + + /* Set object header flags */ + if(H5P_set(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &ohdr_flags) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set object header flags") + } /* end if */ + +done: + if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_get_create_plist() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_get_nlinks + * + * Purpose: Retrieve the number of link messages read in from the file + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * March 11 2007 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks) +{ + H5O_t *oh = NULL; /* Object header */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + HDassert(loc); + HDassert(nlinks); + + /* Get the object header */ + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") + + /* Retrieve the # of link messages seen when the object header was loaded */ + *nlinks = oh->link_msgs_seen; + +done: + if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_get_nlinks() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_obj_create + * + * Purpose: Creates an object, in an abstract manner. + * + * Return: Success: Pointer to object opened + * Failure: NULL + * + * Programmer: Quincey Koziol + * April 9 2007 + * + *------------------------------------------------------------------------- + */ +void * +H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc, + hid_t dxpl_id) +{ + size_t u; /* Local index variable */ + void *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + + /* Sanity checks */ + HDassert(f); + HDassert(obj_type >= H5O_TYPE_GROUP && obj_type <= H5O_TYPE_NAMED_DATATYPE); + HDassert(crt_info); + HDassert(obj_loc); + + /* Iterate through the object classes */ + for(u = 0; u < NELMTS(H5O_obj_class_g); u++) { + /* Check for correct type of object to create */ + if(H5O_obj_class_g[u]->type == obj_type) { + /* Call the object class's 'create' routine */ + HDassert(H5O_obj_class_g[u]->create); + if(NULL == (ret_value = H5O_obj_class_g[u]->create(f, crt_info, obj_loc, dxpl_id))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object") + + /* Break out of loop */ + break; + } /* end if */ + } /* end for */ + HDassert(ret_value); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_obj_create() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_get_oh_addr + * + * Purpose: Retrieve the address of the object header + * + * Note: This routine participates in the "Inlining C struct access" + * pattern, don't call it directly, use the appropriate macro + * defined in H5Oprivate.h. + * + * Return: Success: Valid haddr_t + * Failure: HADDR_UNDEF + * + * Programmer: Quincey Koziol + * March 15 2007 + * + *------------------------------------------------------------------------- + */ +haddr_t +H5O_get_oh_addr(const H5O_t *oh) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(oh); + HDassert(oh->chunk); + + FUNC_LEAVE_NOAPI(oh->chunk[0].addr) +} /* end H5O_get_oh_addr() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_get_rc_and_type + * + * Purpose: Retrieve an object's reference count and type + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * November 4 2007 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_get_rc_and_type(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc, H5O_type_t *otype) +{ + H5O_t *oh = NULL; /* Object header */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + HDassert(loc); + + /* Get the object header */ + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") + + /* Set the object's reference count */ + if(rc) + *rc = oh->nlink; + + /* Retrieve the type of the object */ + if(otype) + if(H5O_obj_type_real(oh, otype) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") + +done: + if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_get_rc_and_type() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_free_visit_visited + * + * Purpose: Free the key for an object visited during a group traversal + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Quincey Koziol + * Nov 25, 2007 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + item = H5FL_FREE(H5_obj_t, item); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_free_visit_visited() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_visit_cb + * + * Purpose: Callback function for recursively visiting objects from a group + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Nov 25, 2007 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *linfo, + void *_udata) +{ + H5O_iter_visit_ud_t *udata = (H5O_iter_visit_ud_t *)_udata; /* User data for callback */ + H5G_loc_t obj_loc; /* Location of object */ + H5G_name_t obj_path; /* Object's group hier. path */ + H5O_loc_t obj_oloc; /* Object's object location */ + hbool_t obj_found = FALSE; /* Object at 'name' found */ + herr_t ret_value = H5_ITER_CONT; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity check */ + HDassert(name); + HDassert(linfo); + HDassert(udata); + + /* Check if this is a hard link */ + if(linfo->type == H5L_TYPE_HARD) { + H5_obj_t obj_pos; /* Object "position" for this object */ + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object using the LAPL passed in */ + /* (Correctly handles mounted files) */ + if(H5G_loc_find(udata->start_loc, name, &obj_loc/*out*/, udata->lapl_id, udata->dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") + obj_found = TRUE; + + /* Construct unique "position" for this object */ + H5F_GET_FILENO(obj_oloc.file, obj_pos.fileno); + obj_pos.addr = obj_oloc.addr; + + /* Check if we've seen the object the link references before */ + if(NULL == H5SL_search(udata->visited, &obj_pos)) { + H5O_info_t oinfo; /* Object info */ + + /* Get the object's info */ + if(H5O_get_info(&obj_oloc, udata->dxpl_id, TRUE, &oinfo) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get object info") + + /* Make the application callback */ + ret_value = (udata->op)(udata->obj_id, name, &oinfo, udata->op_data); + + /* Check for continuing to visit objects */ + if(ret_value == H5_ITER_CONT) { + /* If its ref count is > 1, we add it to the list of visited objects */ + /* (because it could come up again during traversal) */ + if(oinfo.rc > 1) { + H5_obj_t *new_node; /* New object node for visited list */ + + /* Allocate new object "position" node */ + if((new_node = H5FL_MALLOC(H5_obj_t)) == NULL) + HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, H5_ITER_ERROR, "can't allocate object node") + + /* Set node information */ + *new_node = obj_pos; + + /* Add to list of visited objects */ + if(H5SL_insert(udata->visited, new_node, new_node) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "can't insert object node into visited list") + } /* end if */ + } /* end if */ + } /* end if */ + } /* end if */ + +done: + /* Release resources */ + if(obj_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_visit_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_visit + * + * Purpose: Recursively visit an object and all the objects reachable + * from it. If the starting object is a group, all the objects + * linked to from that group will be visited. Links within + * each group are visited according to the order within the + * specified index (unless the specified index does not exist for + * a particular group, then the "name" index is used). + * + * NOTE: Soft links and user-defined links are ignored during + * this operation. + * + * NOTE: Each _object_ reachable from the initial group will only + * be visited once. If multiple hard links point to the same + * object, the first link to the object's path (according to the + * iteration index and iteration order given) will be used to in + * the callback about the object. + * + * Return: Success: The return value of the first operator that + * returns non-zero, or zero if all members were + * processed with no operator returning non-zero. + * + * Failure: Negative if something goes wrong within the + * library, or the negative value returned by one + * of the operators. + * + * Programmer: Quincey Koziol + * November 24 2007 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, + H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id, + hid_t dxpl_id) +{ + H5O_iter_visit_ud_t udata; /* User data for callback */ + H5G_loc_t loc; /* Location of reference object */ + H5G_loc_t obj_loc; /* Location used to open object */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'name' found */ + H5O_info_t oinfo; /* Object info struct */ + hid_t obj_id = (-1); /* ID of object */ + herr_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Portably initialize user data struct to zeros */ + HDmemset(&udata, 0, sizeof(udata)); + + /* Check args */ + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Get the object's info */ + if(H5O_get_info(&obj_oloc, dxpl_id, TRUE, &oinfo) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info") + + /* Open the object */ + /* (Takes ownership of the obj_loc information) */ + if((obj_id = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, TRUE)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") + + /* Make callback for starting object */ + if((ret_value = op(obj_id, ".", &oinfo, op_data)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "can't visit objects") + + /* Check return value of first callback */ + if(ret_value != H5_ITER_CONT) + HGOTO_DONE(ret_value); + + /* Check for object being a group */ + if(oinfo.type == H5O_TYPE_GROUP) { + H5G_loc_t start_loc; /* Location of starting group */ + + /* Get the location of the starting group */ + if(H5G_loc(obj_id, &start_loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + + /* Set up user data for visiting links */ + udata.obj_id = obj_id; + udata.start_loc = &start_loc; + udata.lapl_id = lapl_id; + udata.dxpl_id = dxpl_id; + udata.op = op; + udata.op_data = op_data; + + /* Create skip list to store visited object information */ + if((udata.visited = H5SL_create(H5SL_TYPE_OBJ, NULL)) == NULL) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create skip list for visited objects") + + /* If its ref count is > 1, we add it to the list of visited objects */ + /* (because it could come up again during traversal) */ + if(oinfo.rc > 1) { + H5_obj_t *obj_pos; /* New object node for visited list */ + + /* Allocate new object "position" node */ + if((obj_pos = H5FL_MALLOC(H5_obj_t)) == NULL) + HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "can't allocate object node") + + /* Construct unique "position" for this object */ + obj_pos->fileno = oinfo.fileno; + obj_pos->addr = oinfo.addr; + + /* Add to list of visited objects */ + if(H5SL_insert(udata.visited, obj_pos, obj_pos) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object node into visited list") + } /* end if */ + + /* Call internal group visitation routine */ + if((ret_value = H5G_visit(obj_id, ".", idx_type, order, H5O_visit_cb, &udata, lapl_id, dxpl_id)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") + } /* end if */ + +done: + if(obj_id > 0) { + if(H5I_dec_app_ref(obj_id) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close object") + } /* end if */ + else if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") + if(udata.visited) + H5SL_destroy(udata.visited, H5O_free_visit_visited, NULL); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_visit() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_inc_rc + * + * Purpose: Increments the reference count on an object header + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Jul 13 2008 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_inc_rc(H5O_t *oh) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check args */ + HDassert(oh); + + /* Pin the object header when the reference count goes above 0 */ + if(oh->rc == 0) + if(H5AC_pin_protected_entry(oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") + + /* Increment reference count */ + oh->rc++; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_inc_rc() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_dec_rc + * + * Purpose: Decrements the reference count on an object header + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Jul 13 2008 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_dec_rc(H5O_t *oh) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check args */ + HDassert(oh); + + /* Decrement reference count */ + oh->rc--; + + /* Unpin the object header when the reference count goes back to 0 */ + if(oh->rc == 0) + if(H5AC_unpin_entry(oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_dec_rc() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_dec_rc_by_loc + * + * Purpose: Decrement the refcount of an object header, using its + * object location information. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Oct 08 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id) +{ + H5O_t *oh = NULL; /* Object header */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check args */ + HDassert(loc); + + /* Get header */ + if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") + + /* Decrement the reference count on the object header */ + /* (which will unpin it, if appropriate) */ + if(H5O_dec_rc(oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement reference count on object header") + +done: + /* Release the object header from the cache */ + if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_dec_rc_by_loc() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_get_proxy + * + * Purpose: Retrieve the proxy for the object header. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * July 24 2016 + * + *------------------------------------------------------------------------- + */ +H5AC_proxy_entry_t * +H5O_get_proxy(const H5O_t *oh) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Check args */ + HDassert(oh); + + FUNC_LEAVE_NOAPI(oh->proxy) +} /* end H5O_get_proxy() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__free + * + * Purpose: Destroys an object header. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Jan 15 2003 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__free(H5O_t *oh) +{ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* check args */ + HDassert(oh); + HDassert(0 == oh->rc); + + /* Destroy chunks */ + if(oh->chunk) { + for(u = 0; u < oh->nchunks; u++) + oh->chunk[u].image = H5FL_BLK_FREE(chunk_image, oh->chunk[u].image); + + oh->chunk = (H5O_chunk_t *)H5FL_SEQ_FREE(H5O_chunk_t, oh->chunk); + } /* end if */ + + /* Destroy messages */ + if(oh->mesg) { + for(u = 0; u < oh->nmesgs; u++) { +#ifndef NDEBUG + /* Verify that message is clean, unless it could have been marked + * dirty by decoding */ + if(oh->ndecode_dirtied && oh->mesg[u].dirty) + oh->ndecode_dirtied--; + else + HDassert(oh->mesg[u].dirty == 0); +#endif /* NDEBUG */ + + H5O_msg_free_mesg(&oh->mesg[u]); + } /* end for */ + + /* Make sure we accounted for all the messages dirtied by decoding */ + HDassert(!oh->ndecode_dirtied); + + oh->mesg = (H5O_mesg_t *)H5FL_SEQ_FREE(H5O_mesg_t, oh->mesg); + } /* end if */ + + /* Destroy the proxy */ + if(oh->proxy) + if(H5AC_proxy_entry_dest(oh->proxy) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy virtual entry used for proxy") + + /* destroy object header */ + oh = H5FL_FREE(H5O_t, oh); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O__free() */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 314ee04..e87c148 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -883,6 +883,9 @@ H5_DLL void *H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_l H5_DLL haddr_t H5O_get_oh_addr(const H5O_t *oh); H5_DLL herr_t H5O_get_rc_and_type(const H5O_loc_t *oloc, hid_t dxpl_id, unsigned *rc, H5O_type_t *otype); H5_DLL H5AC_proxy_entry_t *H5O_get_proxy(const H5O_t *oh); +H5_DLL herr_t H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, + H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id, + hid_t dxpl_id); /* Object header message routines */ H5_DLL herr_t H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, -- cgit v0.12 From 5ce8dd5e946c85522edd76f3288e7052bde86b8a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 15 Nov 2017 02:58:16 -0800 Subject: Minor warning fixes --- hl/tools/h5watch/h5watch.c | 1 + src/H5Zszip.c | 46 +++++++++++++++++------------------ test/cross_read.c | 2 ++ test/tcoords.c | 10 ++++---- tools/src/h5diff/h5diff_common.c | 3 +++ tools/src/h5jam/h5jam.c | 6 ++--- tools/src/h5ls/h5ls.c | 2 ++ tools/src/h5repack/h5repack_filters.c | 4 +-- tools/src/misc/h5mkgrp.c | 2 ++ 9 files changed, 41 insertions(+), 35 deletions(-) diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index 11514b0..d1f4e32 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -704,6 +704,7 @@ parse_command_line(int argc, const char *argv[]) case 'h': /* --help */ usage(h5tools_getprogname()); leave(EXIT_SUCCESS); + break; case 'V': /* --version */ print_version(progname); diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 769011c..0c60239 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -70,8 +70,6 @@ H5Z_class2_t H5Z_SZIP[1] = {{ * Programmer: Quincey Koziol * Monday, April 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static htri_t @@ -86,24 +84,24 @@ H5Z_can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UN /* Get datatype */ if(NULL == (type = (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") /* Get datatype's size, for checking the "bits-per-pixel" */ if((dtype_size = (8 * H5T_get_size(type))) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") /* Range check datatype's size */ if(dtype_size > 32 && dtype_size != 64) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid datatype size") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid datatype size") /* Get datatype's endianness order */ if((dtype_order = H5T_get_order(type)) == H5T_ORDER_ERROR) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") /* Range check datatype's endianness order */ /* (Note: this may not handle non-atomic datatypes well) */ if(dtype_order != H5T_ORDER_LE && dtype_order != H5T_ORDER_BE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid datatype endianness order") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid datatype endianness order") done: FUNC_LEAVE_NOAPI(ret_value) @@ -157,19 +155,19 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype */ if(NULL == (type = (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") /* Get the filter's current parameters */ if(H5P_get_filter_by_id(dcpl_plist, H5Z_FILTER_SZIP, &flags, &cd_nelmts, cd_values, 0, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get szip parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get szip parameters") /* Get datatype's size, for checking the "bits-per-pixel" */ if((dtype_size = (8 * H5T_get_size(type))) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size"); + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size"); /* Get datatype's precision, in case is less than full bits */ if((dtype_precision = H5T_get_precision(type)) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype precision"); + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype precision"); if(dtype_precision < dtype_size) { dtype_offset = H5T_get_offset(type); @@ -177,9 +175,9 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) dtype_precision = dtype_size; } /* end if */ if(dtype_precision > 24) { - if(dtype_precision <= 32) + if(dtype_precision <= 32) dtype_precision = 32; - else if(dtype_precision <= 64) + else if(dtype_precision <= 64) dtype_precision = 64; } /* end if */ @@ -227,7 +225,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype's endianness order */ if((dtype_order = H5T_get_order(type)) == H5T_ORDER_ERROR) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype endianness order") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype endianness order") /* Set the correct endianness flag for szip */ /* (Note: this may not handle non-atomic datatypes well) */ @@ -241,13 +239,17 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) cd_values[H5Z_SZIP_PARM_MASK] |= SZ_MSB_OPTION_MASK; break; + case H5T_ORDER_ERROR: + case H5T_ORDER_VAX: + case H5T_ORDER_MIXED: + case H5T_ORDER_NONE: default: HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype endianness order") } /* end switch */ /* Modify the filter's parameters for this dataset */ if(H5P_modify_filter(dcpl_plist, H5Z_FILTER_SZIP, flags, H5Z_SZIP_TOTAL_NPARMS, cd_values) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local szip parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local szip parameters") done: FUNC_LEAVE_NOAPI(ret_value) @@ -266,10 +268,6 @@ done: * Programmer: Kent Yang * Tuesday, April 1, 2003 * - * Modifications: - * Quincey Koziol, April 2, 2003 - * Cleaned up code. - * *------------------------------------------------------------------------- */ static size_t @@ -296,7 +294,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], /* Check arguments */ if (cd_nelmts!=4) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid number of filter parameters") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid number of filter parameters") /* Copy the filter parameters into the szip parameter block */ H5_CHECKED_ASSIGN(sz_param.options_mask, int, cd_values[H5Z_SZIP_PARM_MASK], unsigned); @@ -310,12 +308,12 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nalloc; /* Number of bytes the compressed block will expand into */ /* Get the size of the uncompressed buffer */ - newbuf = *buf; + newbuf = (unsigned char *)(*buf); UINT32DECODE(newbuf,stored_nalloc); H5_CHECKED_ASSIGN(nalloc, size_t, stored_nalloc, uint32_t); /* Allocate space for the uncompressed buffer */ - if(NULL==(outbuf = H5MM_malloc(nalloc))) + if(NULL == (outbuf = (unsigned char *)H5MM_malloc(nalloc))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for szip decompression") /* Decompress the buffer */ @@ -338,7 +336,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], unsigned char *dst = NULL; /* Temporary pointer to new output buffer */ /* Allocate space for the compressed buffer & header (assume data won't get bigger) */ - if(NULL==(dst=outbuf = H5MM_malloc(nbytes+4))) + if(NULL == (dst=outbuf = (unsigned char *)H5MM_malloc(nbytes+4))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate szip destination buffer") /* Encode the uncompressed length */ @@ -348,7 +346,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], /* Compress the buffer */ size_out = nbytes; if(SZ_OK!= SZ_BufftoBuffCompress(dst, &size_out, *buf, nbytes, &sz_param)) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow") + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow") HDassert(size_out<=nbytes); /* Free the input buffer */ diff --git a/test/cross_read.c b/test/cross_read.c index 5d5ef07..2219151 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -226,7 +226,9 @@ check_file(char *filename) const char *pathname = H5_get_srcdir_filename(filename); /* Corrected test file name */ hid_t fid = -1; /* file ID */ int nerrors = 0; /* # of datasets with errors */ +#if !defined(H5_HAVE_FILTER_DEFLATE) || !defined(H5_HAVE_FILTER_SZIP) const char *not_supported= " filter is not enabled."; /* no filter message */ +#endif /* Open the file. */ if((fid = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) diff --git a/test/tcoords.c b/test/tcoords.c index d729d4b..f639d4b 100644 --- a/test/tcoords.c +++ b/test/tcoords.c @@ -669,22 +669,22 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked) void test_coords(void) { hid_t fid; + hbool_t is_chunk[2] = {TRUE, FALSE}; int i; - hbool_t is_chunk; herr_t ret; /* Generic error return */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); - for(i=0, is_chunk=FALSE; i<2; i++, is_chunk++) { + for (i = 0; i < 2; i++) { /* Test H5Sselect_elements with selection of one block of data */ - test_singleEnd_selElements(fid, is_chunk); + test_singleEnd_selElements(fid, is_chunk[i]); /* Test H5Sselect_hyperslab with selection of one block of data */ - test_singleEnd_selHyperslab(fid, is_chunk); + test_singleEnd_selHyperslab(fid, is_chunk[i]); /* Test H5Sselect_hyperslab with selection of multiple blocks of data */ - test_multiple_ends(fid, is_chunk); + test_multiple_ends(fid, is_chunk[i]); } ret = H5Fclose(fid); diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 532169f..ce5df78 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -115,14 +115,17 @@ void parse_command_line(int argc, default: usage(); h5diff_exit(EXIT_FAILURE); + break; case 'h': usage(); h5diff_exit(EXIT_SUCCESS); + break; case 'V': print_version(h5tools_getprogname()); h5diff_exit(EXIT_SUCCESS); + break; case 'v': opts->m_verbose = 1; diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 8c15686..cc5fcdc 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -179,9 +179,11 @@ parse_command_line (int argc, const char *argv[]) case 'h': usage (h5tools_getprogname()); leave (EXIT_SUCCESS); + break; case 'V': print_version (h5tools_getprogname()); leave (EXIT_SUCCESS); + break; case '?': default: usage (h5tools_getprogname()); @@ -198,10 +200,6 @@ parse_command_line (int argc, const char *argv[]) * Return: Success: 0 * Failure: 1 * - * Programmer: - * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index d397067..a07d308 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -2709,6 +2709,7 @@ main(int argc, const char *argv[]) case 'h': /* --help */ usage(); leave(EXIT_SUCCESS); + break; case 'a': /* --address */ address_g = TRUE; @@ -2759,6 +2760,7 @@ main(int argc, const char *argv[]) case 'V': /* --version */ print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); + break; case 'x': /* --hexdump */ hexdump_g = TRUE; diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index e968b3c..067ebad 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -42,7 +42,7 @@ static int aux_copy_obj(hid_t dcpl_id, /* dataset creation property list */ H5D_layout_t layout; int rank; /* rank of dataset */ hsize_t chsize[64]; /* chunk size in elements */ - unsigned int i, j; + unsigned int i; /* get information about input filters */ if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) @@ -240,7 +240,7 @@ int apply_filters(const char* name, /* object name from traverse list */ int nfilters; /* number of filters in DCPL */ hsize_t chsize[64]; /* chunk size in elements */ H5D_layout_t layout; - int i, j; + int i; pack_info_t obj; pack_info_t filtobj; diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index 43d6bfe..b7ff73c 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -129,6 +129,7 @@ parse_command_line(int argc, const char *argv[], param_t *parms) case 'h': usage(); leave(EXIT_SUCCESS); + break; /* Create objects with the latest version of the format */ case 'l': @@ -149,6 +150,7 @@ parse_command_line(int argc, const char *argv[], param_t *parms) case 'V': print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); + break; /* Bad command line argument */ default: -- cgit v0.12 From cb235453a9276c371085e40ea1c87d9b641e511e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 15 Nov 2017 14:24:59 -0800 Subject: Changed ar to always use -cr instead of the autotools default of cru. --- config/linux-gnulibc1 | 5 ----- configure.ac | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index c32f64e..39225e7 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -30,11 +30,6 @@ if test -z "$CC"; then fi fi -# Set flags for gnu ar (apparently via libtool, so AR_FLAGS, not ARFLAGS) -# If you don't do this, you will get warnings about the 'u' in -# automake's default 'cru' args. -AR_FLAGS=crD - # Figure out GNU C compiler flags . $srcdir/config/gnu-flags diff --git a/configure.ac b/configure.ac index 50893f7..5562d5c 100644 --- a/configure.ac +++ b/configure.ac @@ -759,12 +759,17 @@ fi ## Check which archiving tool to use. This needs to be done before ## the AM_PROG_LIBTOOL macro. ## - if test -z "$AR"; then AC_CHECK_PROGS([AR], [ar xar], [:], [$PATH]) fi AC_SUBST([AR]) +# Set the default ar flags to cr +# The Automake default is to use cru and the 'u' causes ar +# to emit warnings on some platforms. +AR_FLAGS=cr + + ## Export the AR macro so that it will be placed in the libtool file ## correctly. export AR -- cgit v0.12 From 637a8f7562c32f1b76b6ff67926baa2b816a3355 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 15 Nov 2017 17:14:35 -0600 Subject: Correct linkage of filters and other libs --- CMakeFilters.cmake | 16 ++++++++-------- src/CMakeLists.txt | 4 ++-- test/CMakeLists.txt | 4 ++-- test/dsets.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 804b16b..71dabb1 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -45,8 +45,8 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (NOT ZLIB_FOUND) find_package (ZLIB) # Legacy find if (ZLIB_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_LIBRARIES}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) endif () endif () endif () @@ -78,9 +78,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") endif () if (BUILD_SHARED_LIBS) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) endif () - set (LINK_LIBS ${LINK_LIBS} ${ZLIB_STATIC_LIBRARY}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) message (STATUS "Filter ZLIB is ON") endif () @@ -96,8 +96,8 @@ if (HDF5_ENABLE_SZIP_SUPPORT) if (NOT SZIP_FOUND) find_package (SZIP) # Legacy find if (SZIP_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_LIBRARIES}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) endif () endif () endif () @@ -119,9 +119,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) endif () endif () if (BUILD_SHARED_LIBS) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) endif () - set (LINK_LIBS ${LINK_LIBS} ${SZIP_STATIC_LIBRARY}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) message (STATUS "Filter SZIP is ON") if (H5_HAVE_FILTER_SZIP) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 91b8e0c..b163b8a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -883,7 +883,7 @@ set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS}) +target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) endif () @@ -927,7 +927,7 @@ if (BUILD_SHARED_LIBS) set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) endif () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0a2afbf..fca864b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -37,7 +37,7 @@ endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") endif () -target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test @@ -53,7 +53,7 @@ if (BUILD_SHARED_LIBS) if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") endif () - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_LIBS}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test diff --git a/test/dsets.c b/test/dsets.c index 4088304..0fff2d1 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -2087,7 +2087,7 @@ test_get_filter_info(void) #ifdef H5_HAVE_FILTER_SZIP if(H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0) TEST_ERROR - if(SZ_encoder_enabled()) { + if(H5Z_SZIP->encoder_present) { if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) || ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) TEST_ERROR -- cgit v0.12 From fea722ec678772a9debcbd56221d1326b11f7ca8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 09:04:50 -0600 Subject: Add note for plugins --- release_docs/RELEASE.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f8ad620..9e3c3a9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -157,6 +157,25 @@ Bug Fixes since HDF5-1.10.1 release Library ------- + - filter plugin handling in H5PL.c and H5Z.c + + It was discovered that the dynamic loading process used by + filter plugins had issues with memory allocation and library + dependencies. + + CMake build process changed to use LINK INTERFACE keywords, which + allowed HDF5 C library to make dependent libraries private. The + filter plugin libraries no longer require dependent libraries + (such as szip or zlib) to be available. + (ADB - 2017/11/16, HDFFV-10328) + + The H5Z_class2_t structure returned by the filter plugins are + now dynamically allocated in H5Zregister function. Access to + the functions in the filter library now always use the dynamic + library API. + + (ADB - 2017/11/16, HDFFV-10329) + - H5Zfilter_avail in H5Z.c The public function checked for plugins, while the private -- cgit v0.12 From 8e193705c5700d32866d6e7c71ef17743015a84e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 09:28:58 -0600 Subject: Fix some of the whitespace --- test/tattr.c | 254 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 127 insertions(+), 127 deletions(-) diff --git a/test/tattr.c b/test/tattr.c index d7152ed..3786d0d 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -163,21 +163,21 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo, static void test_attr_basic_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ - hsize_t attr_size; /* storage size for attribute */ - ssize_t attr_name_size; /* size of attribute name */ - char *attr_name=NULL; /* name of attribute */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ - int i; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr, attr2; /* Attribute ID */ + hsize_t attr_size; /* storage size for attribute */ + ssize_t attr_name_size; /* size of attribute name */ + char *attr_name=NULL; /* name of attribute */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ + int i; + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Writing Functions\n")); @@ -402,15 +402,15 @@ test_attr_basic_write(hid_t fapl) static void test_attr_basic_read(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t attr; /* Attribute ID */ - H5O_info_t oinfo; /* Object info */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t attr; /* Attribute ID */ + H5O_info_t oinfo; /* Object info */ int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */ int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */ - int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + int i, j; /* Local index variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -500,7 +500,7 @@ test_attr_flush(hid_t fapl) set; /* Dataset ID */ double wdata=3.14159F; /* Data to write */ double rdata; /* Data read in */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Flushing\n")); @@ -563,12 +563,12 @@ test_attr_plist(hid_t fapl) hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t plist; /* Property list ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - H5T_cset_t cset; /* Character set for attributes */ - herr_t ret; /* Generic return value */ + hid_t attr; /* Attribute ID */ + hid_t plist; /* Property list ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + H5T_cset_t cset; /* Character set for attributes */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Property Lists\n")); @@ -675,14 +675,14 @@ static void test_attr_compound_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t tid1; /* Attribute datatype ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t tid1; /* Attribute datatype ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -762,11 +762,11 @@ test_attr_compound_write(hid_t fapl) static void test_attr_compound_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ int rank; /* Attribute rank */ hsize_t dims[ATTR_MAX_DIMS]; /* Attribute dimensions */ @@ -781,7 +781,7 @@ test_attr_compound_read(hid_t fapl) ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -830,7 +830,7 @@ test_attr_compound_read(hid_t fapl) HDstrcmp(fieldname, ATTR4_FIELDNAME3))) TestErrPrintf("invalid field name for field #%d: %s\n", i, fieldname); H5free_memory(fieldname); - } /* end for */ + } /* end for */ offset = H5Tget_member_offset(type, 0); VERIFY(offset, attr4_field1_off, "H5Tget_member_offset"); offset = H5Tget_member_offset(type, 1); @@ -878,7 +878,7 @@ test_attr_compound_read(hid_t fapl) printf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i); printf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", __LINE__, i, j, attr_data4[i][j].d, i, j, read_data4[i][j].d); TestErrPrintf("%d: attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n", __LINE__, i, j, attr_data4[i][j].c, i, j, read_data4[i][j].c); - } /* end if */ + } /* end if */ /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); @@ -913,12 +913,12 @@ static void test_attr_scalar_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -979,13 +979,13 @@ static void test_attr_scalar_read(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ H5S_class_t stype; /* Dataspace class */ - float rdata = 0.0F; /* Buffer for reading 1st attribute */ + float rdata = 0.0F; /* Buffer for reading 1st attribute */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Reading Functions\n")); @@ -1013,8 +1013,8 @@ test_attr_scalar_read(hid_t fapl) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(rdata, attr_data5)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); /* Get the attribute's dataspace */ sid = H5Aget_space(attr); @@ -1051,15 +1051,15 @@ static void test_attr_mult_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -1170,11 +1170,11 @@ test_attr_mult_write(hid_t fapl) static void test_attr_mult_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ char temp_name[ATTR_NAME_LEN]; /* Buffer for mangling attribute names */ int rank; /* Attribute rank */ @@ -1185,10 +1185,10 @@ test_attr_mult_read(hid_t fapl) int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */ int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */ double read_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3] = {{{0}}}; /* Buffer for reading 3rd attribute */ - ssize_t name_len; /* Length of attribute name */ + ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j, k; /* Local index values */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1432,12 +1432,12 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR static void test_attr_iterate(hid_t fapl) { - hid_t file; /* HDF5 File ID */ + hid_t file; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t sid; /* Dataspace ID */ int count; /* operator data for the iterator */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1504,13 +1504,13 @@ test_attr_iterate(hid_t fapl) static void test_attr_delete(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1635,7 +1635,7 @@ test_attr_dtype_shared(hid_t fapl) H5O_info_t oinfo; /* Object's information */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Shared Datatypes with Attributes\n")); @@ -1802,17 +1802,17 @@ test_attr_dtype_shared(hid_t fapl) static void test_attr_duplicate_ids(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t gid1, gid2; /* Group ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t gid1, gid2; /* Group ID */ hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ - int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ - int i; - herr_t ret; /* Generic return value */ + hid_t attr, attr2; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ + int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ + int i; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two ID handles\n")); @@ -1830,7 +1830,7 @@ test_attr_duplicate_ids(hid_t fapl) /* Create a dataset */ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, - H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dcreate2"); /* Create dataspace for attribute */ @@ -2047,12 +2047,12 @@ test_attr_duplicate_ids(hid_t fapl) static int test_attr_dense_verify(hid_t loc_id, unsigned max_attr) { - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - hid_t attr; /* Attribute ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t attr; /* Attribute ID */ unsigned value; /* Attribute value */ unsigned u; /* Local index variable */ int old_nerrs; /* Number of errors when entering this check */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -2117,19 +2117,19 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) static void test_attr_dense_create(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dense Attribute Storage Creation\n")); @@ -2248,19 +2248,19 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) static void test_attr_dense_open(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Opening Attributes in Dense Storage\n")); @@ -2387,20 +2387,20 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) static void test_attr_dense_delete(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Attributes in Dense Storage\n")); @@ -2565,21 +2565,21 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) static void test_attr_dense_rename(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Renaming Attributes in Dense Storage\n")); @@ -2724,21 +2724,21 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) static void test_attr_dense_unlink(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ size_t mesg_count; /* # of shared messages */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Unlinking Object with Attributes in Dense Storage\n")); @@ -2856,17 +2856,17 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) { hid_t fid; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact, rmax_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense, rmin_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Phase Change Limits For Attributes in Dense Storage\n")); @@ -3019,13 +3019,13 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) static void test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ hid_t gid1, gid2; /* Group ID */ - hid_t sid, sid2; /* Dataspace ID */ + hid_t sid, sid2; /* Dataspace ID */ hid_t attr, attr2, add_attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ hsize_t dims[] = {ATTR1_DIM1}; int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading attribute */ int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ @@ -3033,9 +3033,9 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) unsigned read_scalar; /* variable for reading attribute*/ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u, i; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two IDs for Dense Storage\n")); -- cgit v0.12 From 9f1cd84c158a2a951a0f7680a0b08f09ac64515e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 11:45:36 -0600 Subject: HDFFV-10328 merge allocation changes from 1.8 --- src/H5PLint.c | 21 +- src/H5PLplugin_cache.c | 26 +- src/H5Z.c | 715 ++++++++++++++++++++++++++----------------------- 3 files changed, 422 insertions(+), 340 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index c887f86..e969cbf 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -342,19 +342,38 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v /* Check if the filter IDs match */ if (info->id == id) { + H5Z_class2_t *plugin_copy = NULL; /* 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") + /* allocate local copy of plugin info */ + if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") + /* Set the plugin info to return */ + *plugin_info = (const void *)info; + + plugin_copy->version = info->version; + plugin_copy->id = info->id; + plugin_copy->encoder_present = info->encoder_present; + plugin_copy->decoder_present = info->decoder_present; + plugin_copy->can_apply = info->can_apply; + plugin_copy->set_local = info->set_local; + plugin_copy->filter = info->filter; + /* copy the user's string into the property */ + if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(info->name))) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") + /* Set output parameters */ *success = TRUE; - *plugin_info = (const void *)info; } } done: if (!success && handle) + if (*plugin_info) { + *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index d826ba0..ec14159 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -280,18 +280,34 @@ 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; + H5Z_class2_t *plugin_copy = NULL; /* 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") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") /* 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") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") + + if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") + /* Set the plugin info to return */ + *plugin_info = plugin_copy; + + plugin_copy->version = filter_info->version; + plugin_copy->id = filter_info->id; + plugin_copy->encoder_present = filter_info->encoder_present; + plugin_copy->decoder_present = filter_info->decoder_present; + plugin_copy->can_apply = filter_info->can_apply; + plugin_copy->set_local = filter_info->set_local; + plugin_copy->filter = filter_info->filter; + /* copy the user's string into the property */ + if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(filter_info->name))) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") /* Set output parameters */ *found = TRUE; - *plugin_info = filter_info; /* No need to continue processing */ break; @@ -301,6 +317,10 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f } /* end for */ done: + /* unallocate local copy of plugin info on failure */ + if (FAIL == ret_value && *plugin_info) { + *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_cache() */ #pragma GCC diagnostic pop diff --git a/src/H5Z.c b/src/H5Z.c index 1d023b5..e7574cd 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -34,15 +34,15 @@ #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 */ typedef struct H5Z_object_t { - H5Z_filter_t filter_id; /* ID of the filter we're looking for */ + H5Z_filter_t filter_id; /* ID of the filter we're looking for */ htri_t found; /* Whether we find an object using the filter */ } H5Z_object_t; @@ -86,23 +86,23 @@ H5Z__init_package(void) FUNC_ENTER_PACKAGE /* Internal filters */ - if(H5Z_register(H5Z_SHUFFLE) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") - if(H5Z_register(H5Z_FLETCHER32) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") - if(H5Z_register(H5Z_NBIT) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") - if(H5Z_register(H5Z_SCALEOFFSET) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") + if (H5Z_register (H5Z_SHUFFLE) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") + if (H5Z_register (H5Z_FLETCHER32) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") + if (H5Z_register (H5Z_NBIT) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") + if (H5Z_register (H5Z_SCALEOFFSET) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") /* External filters */ #ifdef H5_HAVE_FILTER_DEFLATE - if(H5Z_register(H5Z_DEFLATE) < 0) + if (H5Z_register (H5Z_DEFLATE) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if(H5Z_register(H5Z_SZIP) < 0) + if (H5Z_register (H5Z_SZIP) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") #endif /* H5_HAVE_FILTER_SZIP */ @@ -123,6 +123,7 @@ int H5Z_term_package(void) { int n = 0; + size_t i; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -130,7 +131,6 @@ H5Z_term_package(void) #ifdef H5Z_DEBUG char comment[16], bandwidth[32]; int dir, nprint = 0; - size_t i; if(H5DEBUG(Z)) { for(i = 0; i < H5Z_table_used_g; i++) { @@ -179,6 +179,12 @@ H5Z_term_package(void) } /* end for */ } /* end if */ #endif /* H5Z_DEBUG */ + for (i = 0; i < H5Z_table_used_g; i++) { + H5Z_class2_t *cls = (H5Z_class2_t *)(H5Z_table_g+i); + /* deallocate plugin info name */ + if (cls->name) + cls->name = (char *)H5MM_xfree(cls->name); + } /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); @@ -211,8 +217,8 @@ herr_t H5Zregister(const void *cls) { const H5Z_class2_t *cls_real = (const H5Z_class2_t *) cls; /* "Real" class pointer */ - H5Z_class2_t cls_new; /* Translated class struct */ - herr_t ret_value=SUCCEED; /* Return value */ + H5Z_class2_t cls_new; /* Translated class struct */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "*x", cls); @@ -231,7 +237,7 @@ H5Zregister(const void *cls) * at least 256, there should be no overlap and the version of the struct * can be determined by the value of the first field. */ - if(cls_real->version != H5Z_CLASS_T_VERS) { + if (cls_real->version != H5Z_CLASS_T_VERS) { #ifndef H5_NO_DEPRECATED_SYMBOLS /* Assume it is an old "H5Z_class1_t" instead */ const H5Z_class1_t *cls_old = (const H5Z_class1_t *) cls; @@ -251,19 +257,19 @@ H5Zregister(const void *cls) #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Deprecated symbols not allowed, throw an error */ - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end if */ - if (cls_real->id<0 || cls_real->id>H5Z_FILTER_MAX) + if (cls_real->id < 0 || cls_real->id > H5Z_FILTER_MAX) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if (cls_real->idid < H5Z_FILTER_RESERVED) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") - if (cls_real->filter==NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") + if (cls_real->filter == NULL) + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") /* Do it */ - if (H5Z_register (cls_real)<0) + if (H5Z_register (cls_real) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") done: @@ -277,39 +283,40 @@ done: * Purpose: Same as the public version except this one allows filters * to be set for predefined method numbers id >= 0 && cls->id <= H5Z_FILTER_MAX); + HDassert (cls); + HDassert (cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); /* Is the filter already registered? */ - for(i = 0; i < H5Z_table_used_g; i++) - if(H5Z_table_g[i].id == cls->id) + for (i = 0; i < H5Z_table_used_g; i++) + 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); + 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)); #ifdef H5Z_DEBUG 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") + 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") + 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; @@ -317,15 +324,21 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + H5Z_table_g[i].name = (char *)H5MM_xstrdup(cls->name); #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 { + H5Z_class2_t *old_cls = (H5Z_class2_t *)(H5Z_table_g+i); + /* deallocate plugin info name */ + if (old_cls->name) + old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Replace old contents */ - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy (old_cls, cls, sizeof(H5Z_class2_t)); + old_cls->name = (char *)H5MM_xstrdup(cls->name); } /* end else */ done: @@ -338,25 +351,26 @@ done: * * Purpose: This function unregisters a filter. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t H5Zunregister(H5Z_filter_t id) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "Zf", id); /* Check args */ - if(id < 0 || id > H5Z_FILTER_MAX) + if (id < 0 || id > H5Z_FILTER_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if(id < H5Z_FILTER_RESERVED) + if (id < H5Z_FILTER_RESERVED) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") /* Do it */ - if(H5Z_unregister(id) < 0) + if (H5Z_unregister(id) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") done: @@ -370,27 +384,29 @@ done: * Purpose: Same as the public version except this one allows filters * to be unset for predefined method numbers =0 && filter_id<=H5Z_FILTER_MAX); /* Is the filter already registered? */ - for (filter_index=0; filter_index=H5Z_table_used_g) + if (filter_index >= H5Z_table_used_g) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter is not registered") /* Initialize the structure object for iteration */ @@ -398,28 +414,32 @@ H5Z_unregister(H5Z_filter_t filter_id) object.found = FALSE; /* Iterate through all opened datasets, returns a failure if any of them uses the filter */ - if(H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) + if (H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - if(object.found) + if (object.found) HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a dataset is still using it") /* Iterate through all opened groups, returns a failure if any of them uses the filter */ - if(H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0) + if (H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - if(object.found) + if (object.found) HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a group is still using it") /* Iterate through all opened files and flush them */ - if(H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) + if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") + /* deallocate plugin info name */ + old_cls = (H5Z_class2_t *)(H5Z_table_g+filter_index); + if (old_cls->name) + old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ - HDmemmove(&H5Z_table_g[filter_index],&H5Z_table_g[filter_index+1],sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); #ifdef H5Z_DEBUG - HDmemmove(&H5Z_stat_table_g[filter_index],&H5Z_stat_table_g[filter_index+1],sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove (&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); #endif /* H5Z_DEBUG */ H5Z_table_used_g--; @@ -431,10 +451,10 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__check_unregister * - * Purpose: Check if an object uses the filter to be unregistered. + * Purpose: Check if an object uses the filter to be unregistered. * - * Return: TRUE if the object uses the filter. - * FALSE if not, NEGATIVE on error. + * Return: TRUE if the object uses the filter. + * FALSE if not, NEGATIVE on error. *------------------------------------------------------------------------- */ static htri_t @@ -446,12 +466,12 @@ H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id) FUNC_ENTER_STATIC /* Get the plist structure of object creation */ - if(NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) - HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") + if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) + HGOTO_ERROR (H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") /* Check if the object creation property list uses the filter */ - if((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") done: FUNC_LEAVE_NOAPI(ret_value) @@ -483,25 +503,25 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void HDassert(obj_ptr); /* Get the group creation property */ - if((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") + if ((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") /* Check if the filter is in the group creation property list */ - if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. */ - if(filter_in_pline) { + if (filter_in_pline) { object->found = TRUE; ret_value = TRUE; } /* end if */ done: - if(ocpl_id > 0) - if(H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + if (ocpl_id > 0) + if (H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_group_cb() */ @@ -510,13 +530,13 @@ 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. + * 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. + * Return: TRUE if the object uses the filter. + * FALSE otherwise. *------------------------------------------------------------------------- */ static int @@ -529,28 +549,28 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * FUNC_ENTER_STATIC - HDassert(obj_ptr); + HDassert (obj_ptr); /* Get the dataset creation property */ - 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") + 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 */ - if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. */ - if(filter_in_pline) { + if (filter_in_pline) { object->found = TRUE; ret_value = TRUE; } /* end if */ done: - if(ocpl_id > 0) - if(H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + if (ocpl_id > 0) + if (H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_dset_cb() */ @@ -569,17 +589,17 @@ done: static int H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUSED *key) { - int ret_value = FALSE; /* Return value */ + int ret_value = FALSE; /* Return value */ FUNC_ENTER_STATIC - HDassert(obj_ptr); + HDassert (obj_ptr); /* 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) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + 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) + HGOTO_ERROR (H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") } /* end if */ done: @@ -598,17 +618,17 @@ done: htri_t H5Zfilter_avail(H5Z_filter_t id) { - htri_t ret_value=FALSE; /* Return value */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "Zf", id); /* Check args */ - if(id<0 || id>H5Z_FILTER_MAX) + 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") + if ((ret_value = H5Z_filter_avail(id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") done: FUNC_LEAVE_API(ret_value) @@ -626,21 +646,25 @@ done: 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 */ + size_t i; /* Local index variable */ + H5Z_class2_t *filter_info; + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* 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(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) + for (i = 0; i < H5Z_table_used_g; i++) + 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))) { + herr_t status = H5Z_register(filter_info); + if (filter_info->name) + filter_info->name = (char *)H5MM_xfree(filter_info->name); + filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); + if (status < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") + HGOTO_DONE (TRUE) } done: FUNC_LEAVE_NOAPI(ret_value) @@ -666,59 +690,59 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, { H5Z_class2_t *fclass; /* Individual filter information */ size_t u; /* Local index variable */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(pline->nused > 0); /* Iterate over filters */ - for(u = 0; u < pline->nused; u++) { + for (u = 0; u < pline->nused; u++) { /* Get filter information */ - if(NULL == (fclass = H5Z_find(pline->filter[u].id))) { + if (NULL == (fclass = H5Z_find(pline->filter[u].id))) { /* Ignore errors from optional filters */ - if(pline->filter[u].flags & H5Z_FLAG_OPTIONAL) - H5E_clear_stack(NULL); + if (pline->filter[u].flags & H5Z_FLAG_OPTIONAL) + H5E_clear_stack (NULL); else - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") } /* end if */ else { /* Make correct callback */ - switch(prelude_type) { + switch (prelude_type) { case H5Z_PRELUDE_CAN_APPLY: /* Check if filter is configured to be able to encode */ - if(!fclass->encoder_present) - HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); + if (!fclass->encoder_present) + HGOTO_ERROR (H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); /* Check if there is a "can apply" callback */ - if(fclass->can_apply) { + if (fclass->can_apply) { /* Make callback to filter's "can apply" function */ htri_t status = (fclass->can_apply)(dcpl_id, type_id, space_id); /* Indicate error during filter callback */ - if(status < 0) + if (status < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "error during user callback") /* 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)) + if (status == FALSE && !(pline->filter[u].flags & H5Z_FLAG_OPTIONAL)) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "filter parameters not appropriate") } /* end if */ break; case H5Z_PRELUDE_SET_LOCAL: /* Check if there is a "set local" callback */ - if(fclass->set_local) { + if (fclass->set_local) { /* Make callback to filter's "set local" function */ - if((fclass->set_local)(dcpl_id, type_id, space_id) < 0) + if ((fclass->set_local)(dcpl_id, type_id, space_id) < 0) /* Indicate error during filter callback */ - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") } /* end if */ break; default: - HDassert("invalid prelude type" && 0); + HDassert ("invalid prelude type" && 0); } /* end switch */ } /* end else */ } /* end for */ @@ -745,62 +769,62 @@ 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 */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); - HDassert(H5I_DATATYPE == H5I_get_type(type_id)); + HDassert (H5I_GENPROP_LST == H5I_get_type(dcpl_id)); + HDassert (H5I_DATATYPE == H5I_get_type(type_id)); /* 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 (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 */ /* 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") + 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) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve layout") + 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 */ - if(H5P_peek(dc_plist, H5O_CRT_PIPELINE_NAME, &dcpl_pline) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") + if (H5P_peek(dc_plist, H5O_CRT_PIPELINE_NAME, &dcpl_pline) < 0) + HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") /* Check if the chunks have filters */ - if(dcpl_pline.nused > 0) { + if (dcpl_pline.nused > 0) { hsize_t chunk_dims[H5O_LAYOUT_NDIMS]; /* Size of chunk dimensions */ - H5S_t *space; /* Dataspace describing chunk */ - size_t u; /* Local index variable */ + H5S_t *space; /* Dataspace describing chunk */ + 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++) + /* Create a dataspace 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))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") + 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 */ - if((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { - (void)H5S_close(space); - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") + if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { + (void)H5S_close (space); + HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ /* Make the callbacks */ - if(H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") } /* end if */ } /* end if */ } /* end if */ done: - if(space_id > 0 && H5I_dec_ref(space_id) < 0) + if (space_id > 0 && H5I_dec_ref(space_id) < 0) HDONE_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") FUNC_LEAVE_NOAPI(ret_value) @@ -814,7 +838,8 @@ done: * property list can be applied to a particular combination of * datatype and dataspace for a dataset. * - * Return: Non-negative on success/Negative on failure + * 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 @@ -829,8 +854,8 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "can apply" callbacks for filters in pipeline */ - if(H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -844,7 +869,8 @@ done: * 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 + * 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 @@ -859,8 +885,8 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "set local" callbacks for filters in pipeline */ - if(H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -874,7 +900,8 @@ done: * 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 + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -884,11 +911,11 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert(pline->nused > 0); + HDassert (pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -902,7 +929,8 @@ done: * new opaque object. The pipeline is assumed to have at * least one filter. * - * Return: Non-negative on success/Negative on failure + * 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 @@ -916,11 +944,11 @@ H5Z_set_local_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert(pline->nused > 0); + HDassert (pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -930,58 +958,59 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_modify * - * Purpose: Modify filter parameters for specified pipeline. + * Purpose: Modify filter parameters for specified pipeline. * - * Return: Non-negative on success/Negative on failure + * 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 idx; /* Index of filter in pipeline */ - herr_t ret_value = SUCCEED; /* Return value */ + size_t idx; /* Index of filter in pipeline */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert(0 == cd_nelmts || cd_values); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert (0 == cd_nelmts || cd_values); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; 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, FAIL, "filter not in pipeline") + if (idx > pline->nused) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Change parameters for filter */ pline->filter[idx].flags = flags; pline->filter[idx].cd_nelmts = cd_nelmts; /* Free any existing parameters */ - if(pline->filter[idx].cd_values != NULL && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + if (pline->filter[idx].cd_values != NULL && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) H5MM_xfree(pline->filter[idx].cd_values); /* Set parameters */ - if(cd_nelmts > 0) { - size_t i; /* Local index variable */ + if (cd_nelmts > 0) { + size_t i; /* Local index variable */ /* Allocate memory or point at internal buffer */ - if(cd_nelmts > H5Z_COMMON_CD_VALUES) { + if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); - if(NULL == pline->filter[idx].cd_values) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") + if (NULL == pline->filter[idx].cd_values) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") } /* end if */ else 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; @@ -996,36 +1025,37 @@ done: * * Purpose: Append another filter to the specified pipeline. * - * Return: Non-negative on success/Negative on failure + * 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 idx; - herr_t ret_value = SUCCEED; /* Return value */ + size_t idx; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert(0 == cd_nelmts || cd_values); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert (0 == cd_nelmts || cd_values); /* * Check filter limit. We do it here for early warnings although we may * 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") + if (pline->nused >= H5Z_MAX_NFILTERS) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "too many filters in pipeline") /* Check for freshly allocated filter pipeline */ - if(pline->version == 0) + if (pline->version == 0) pline->version = H5O_PLINE_VERSION_1; /* Allocate additional space in the pipeline if it's full */ - if(pline->nused >= pline->nalloc) { + if (pline->nused >= pline->nalloc) { H5O_pline_t x; size_t n; @@ -1036,14 +1066,14 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, * filter struct is reallocated. Set these pointers to ~NULL * so that we can reset them after reallocating the filters array. */ - for(n = 0; n < pline->nalloc; ++n) - if(pline->filter[n].cd_values == pline->filter[n]._cd_values) + for (n = 0; n < pline->nalloc; ++n) + 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") + 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. @@ -1061,22 +1091,22 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, 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 */ + if (cd_nelmts > 0) { + size_t i; /* Local index variable */ /* Allocate memory or point at internal buffer */ - if(cd_nelmts > H5Z_COMMON_CD_VALUES) { + if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); - if(NULL == pline->filter[idx].cd_values) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") + if (NULL == pline->filter[idx].cd_values) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; /* Copy client data values */ - for(i = 0; i < cd_nelmts; i++) + for (i = 0; i < cd_nelmts; i++) pline->filter[idx].cd_values[i] = cd_values[i]; } /* end if */ else @@ -1095,8 +1125,8 @@ done: * 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 + * Return: Success: Non-negative index of entry in global filter table. + * Failure: Negative *------------------------------------------------------------------------- */ static int @@ -1107,9 +1137,9 @@ H5Z_find_idx(H5Z_filter_t id) 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 + * 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 @@ -1174,51 +1205,55 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, 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 */ + 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(filter_mask); - HDassert(nbytes && *nbytes > 0); - HDassert(buf_size && *buf_size > 0); - HDassert(buf && *buf); - HDassert(!pline || pline->nused < H5Z_MAX_NFILTERS); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); + HDassert (filter_mask); + HDassert (nbytes && *nbytes>0); + HDassert (buf_size && *buf_size>0); + HDassert (buf && *buf); + HDassert (!pline || pline->nusednused; i > 0; --i) { - idx = i - 1; + idx = i-1; if (*filter_mask & ((unsigned)1 << idx)) { failed |= (unsigned)1 << idx; - continue;/*filter excluded*/ + 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) { + * 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; + 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)))) { + 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") + herr_t status = H5Z_register(filter_info); + if (filter_info->name) + filter_info->name = (char *)H5MM_xfree(filter_info->name); + filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); + if (status < 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) + if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) issue_error = TRUE; } /* end if */ else @@ -1227,8 +1262,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* Check for error */ if(issue_error) { /* Print out the filter name to give more info. But the name is optional for - * the filter */ - if(pline->filter[idx].name) + * 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 HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") @@ -1238,26 +1273,26 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + H5_timer_begin (&timer); #endif - tmp_flags = flags|(pline->filter[idx].flags); + 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); + pline->filter[idx].cd_values, *nbytes, buf_size, buf); #ifdef H5Z_DEBUG - H5_timer_end(&(fstats->stats[1].timer), &timer); + 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 (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") *nbytes = *buf_size; failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); } else { *nbytes = new_nbytes; @@ -1276,35 +1311,34 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); continue; /*filter excluded*/ } fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + 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); + 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 == 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") + 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; } failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); } - else { + else *nbytes = new_nbytes; - } } } @@ -1320,7 +1354,8 @@ done: * * Purpose: Get pointer to filter info for pipeline * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ H5Z_filter_info_t * @@ -1331,17 +1366,17 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(NULL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; 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]; @@ -1365,21 +1400,21 @@ done: htri_t H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) { - size_t idx; /* Index of filter in pipeline */ - htri_t ret_value = TRUE; /* Return value */ + 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 (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; 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) + if (idx >= pline->nused) ret_value = FALSE; done: @@ -1394,30 +1429,31 @@ done: * 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 + * Return: Non-negative (TRUE/FALSE) on success + * Negative on failure *------------------------------------------------------------------------- */ htri_t H5Z_all_filters_avail(const H5O_pline_t *pline) { - size_t i,j; /* Local index variable */ - htri_t ret_value=TRUE; /* Return value */ + size_t i, j; /* Local index variable */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(pline); + HDassert (pline); /* Iterate through all the filters in pipeline */ - for(i = 0; i < pline->nused; i++) { + for (i = 0; i < pline->nused; i++) { /* Look for each filter in the list of registered filters */ - for(j = 0; j < H5Z_table_used_g; j++) - if(H5Z_table_g[j].id == pline->filter[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) - HGOTO_DONE(FALSE) + if (j == H5Z_table_used_g) + HGOTO_DONE (FALSE) } /* end for */ done: @@ -1432,7 +1468,8 @@ done: * Purpose: Delete filter FILTER from pipeline PLINE; * deletes all filters if FILTER is H5Z_FILTER_NONE * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1443,52 +1480,52 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* if the pipeline has no filters, just return */ - if(pline->nused == 0) - HGOTO_DONE(SUCCEED) + if (pline->nused == 0) + HGOTO_DONE (SUCCEED) /* Delete all filters */ - if(H5Z_FILTER_ALL == filter) { - if(H5O_msg_reset(H5O_PLINE_ID, pline) < 0) + if (H5Z_FILTER_ALL == filter) { + if (H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFREE, FAIL, "can't release pipeline info") } /* end if */ /* Delete filter */ else { - size_t idx; /* Index of filter in pipeline */ - hbool_t found = FALSE; /* Indicate filter was found in pipeline */ + size_t idx; /* Index of filter in pipeline */ + hbool_t found = FALSE; /* Indicate filter was found in pipeline */ /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; idx++) - if(pline->filter[idx].id == filter) { + for (idx = 0; idx < pline->nused; idx++) + if (pline->filter[idx].id == filter) { found = TRUE; break; } /* end if */ /* filter was not found in the pipeline */ - if(!found) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + if (!found) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Free information for deleted filter */ - if(pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) - HDassert((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); - if(pline->filter[idx].name != pline->filter[idx]._name) + if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) + HDassert ((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); + if (pline->filter[idx].name != pline->filter[idx]._name) pline->filter[idx].name = (char *)H5MM_xfree(pline->filter[idx].name); - if(pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) - HDassert(pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); - if(pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + if (pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + HDassert (pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); + if (pline->filter[idx].cd_values != pline->filter[idx]._cd_values) pline->filter[idx].cd_values = (unsigned *)H5MM_xfree(pline->filter[idx].cd_values); /* Remove filter from pipeline array */ - if((idx + 1) < pline->nused) { + if ((idx + 1) < pline->nused) { /* Copy filters down & fix up any client data value arrays using internal storage */ - for(; (idx + 1) < pline->nused; idx++) { + for (; (idx + 1) < pline->nused; idx++) { pline->filter[idx] = pline->filter[idx + 1]; - if(pline->filter[idx].name && (HDstrlen(pline->filter[idx].name) + 1) <= H5Z_COMMON_NAME_LEN) + if (pline->filter[idx].name && (HDstrlen(pline->filter[idx].name) + 1) <= H5Z_COMMON_NAME_LEN) pline->filter[idx].name = pline->filter[idx]._name; - if(pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) + if (pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) pline->filter[idx].cd_values = pline->filter[idx]._cd_values; } /* end for */ } /* end if */ @@ -1497,7 +1534,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) pline->nused--; /* Reset information for previous last filter in pipeline */ - HDmemset(&pline->filter[pline->nused], 0, sizeof(H5Z_filter_info_t)); + HDmemset (&pline->filter[pline->nused], 0, sizeof(H5Z_filter_info_t)); } /* end else */ done: @@ -1510,6 +1547,9 @@ done: * * Purpose: Gets information about a pipeline data filter and stores it * in filter_config_flags. + * + * Return: zero on success + * negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1521,8 +1561,8 @@ H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) H5TRACE2("e", "Zf*Iu", filter, filter_config_flags); /* Get the filter info */ - if(H5Z_get_filter_info(filter, filter_config_flags) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "Filter info not retrieved") + if (H5Z_get_filter_info(filter, filter_config_flags) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "Filter info not retrieved") done: FUNC_LEAVE_API(ret_value) @@ -1534,6 +1574,9 @@ done: * * Purpose: Gets information about a pipeline data filter and stores it * in filter_config_flags. + * + * Return: zero on success + * negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1545,16 +1588,16 @@ H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) FUNC_ENTER_NOAPI(FAIL) /* Look up the filter class info */ - if(NULL == (fclass = H5Z_find(filter))) - HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") + if (NULL == (fclass = H5Z_find(filter))) + HGOTO_ERROR (H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") /* Set the filter config flags for the application */ - if(filter_config_flags != NULL) { + if (filter_config_flags != NULL) { *filter_config_flags = 0; - if(fclass->encoder_present) + if (fclass->encoder_present) *filter_config_flags |= H5Z_FILTER_CONFIG_ENCODE_ENABLED; - if(fclass->decoder_present) + if (fclass->decoder_present) *filter_config_flags |= H5Z_FILTER_CONFIG_DECODE_ENABLED; } /* end if */ -- cgit v0.12 From dfaeaa35cd6b765581d1f0d86076d549135b9500 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 15:00:13 -0600 Subject: Fix typo --- src/H5PLint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index e969cbf..33dda96 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -372,7 +372,7 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v done: if (!success && handle) - if (*plugin_info) { + if (*plugin_info) *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") -- cgit v0.12 From 9599e55176104ab55576ee921be4475e860da5fa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 13:59:57 -0600 Subject: HDFFV-10328 - remove allocation changes --- src/H5PLint.c | 21 +-------------------- src/H5PLplugin_cache.c | 22 +--------------------- src/H5Z.c | 33 ++++----------------------------- 3 files changed, 6 insertions(+), 70 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index 33dda96..c887f86 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -342,38 +342,19 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v /* Check if the filter IDs match */ if (info->id == id) { - H5Z_class2_t *plugin_copy = NULL; /* 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") - /* allocate local copy of plugin info */ - if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") - /* Set the plugin info to return */ - *plugin_info = (const void *)info; - - plugin_copy->version = info->version; - plugin_copy->id = info->id; - plugin_copy->encoder_present = info->encoder_present; - plugin_copy->decoder_present = info->decoder_present; - plugin_copy->can_apply = info->can_apply; - plugin_copy->set_local = info->set_local; - plugin_copy->filter = info->filter; - /* copy the user's string into the property */ - if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(info->name))) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") - /* Set output parameters */ *success = TRUE; + *plugin_info = (const void *)info; } } done: if (!success && handle) - if (*plugin_info) - *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index ec14159..e483e01 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -280,7 +280,6 @@ 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; - H5Z_class2_t *plugin_copy = NULL; /* 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"))) @@ -290,24 +289,9 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info_function)())) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") - if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") - /* Set the plugin info to return */ - *plugin_info = plugin_copy; - - plugin_copy->version = filter_info->version; - plugin_copy->id = filter_info->id; - plugin_copy->encoder_present = filter_info->encoder_present; - plugin_copy->decoder_present = filter_info->decoder_present; - plugin_copy->can_apply = filter_info->can_apply; - plugin_copy->set_local = filter_info->set_local; - plugin_copy->filter = filter_info->filter; - /* copy the user's string into the property */ - if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(filter_info->name))) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") - /* Set output parameters */ *found = TRUE; + *plugin_info = filter_info; /* No need to continue processing */ break; @@ -317,10 +301,6 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f } /* end for */ done: - /* unallocate local copy of plugin info on failure */ - if (FAIL == ret_value && *plugin_info) { - *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); - } FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_cache() */ #pragma GCC diagnostic pop diff --git a/src/H5Z.c b/src/H5Z.c index e7574cd..1f1a905 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -123,7 +123,6 @@ int H5Z_term_package(void) { int n = 0; - size_t i; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -131,6 +130,7 @@ H5Z_term_package(void) #ifdef H5Z_DEBUG char comment[16], bandwidth[32]; int dir, nprint = 0; + size_t i; if(H5DEBUG(Z)) { for(i = 0; i < H5Z_table_used_g; i++) { @@ -179,12 +179,6 @@ H5Z_term_package(void) } /* end for */ } /* end if */ #endif /* H5Z_DEBUG */ - for (i = 0; i < H5Z_table_used_g; i++) { - H5Z_class2_t *cls = (H5Z_class2_t *)(H5Z_table_g+i); - /* deallocate plugin info name */ - if (cls->name) - cls->name = (char *)H5MM_xfree(cls->name); - } /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); @@ -325,20 +319,14 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); - H5Z_table_g[i].name = (char *)H5MM_xstrdup(cls->name); #ifdef H5Z_DEBUG HDmemset (H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ } /* end if */ /* Filter already registered */ else { - H5Z_class2_t *old_cls = (H5Z_class2_t *)(H5Z_table_g+i); - /* deallocate plugin info name */ - if (old_cls->name) - old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Replace old contents */ - HDmemcpy (old_cls, cls, sizeof(H5Z_class2_t)); - old_cls->name = (char *)H5MM_xstrdup(cls->name); + HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); } /* end else */ done: @@ -394,7 +382,6 @@ H5Z_unregister(H5Z_filter_t filter_id) size_t filter_index; /* Local index variable for filter */ H5Z_object_t object; herr_t ret_value = SUCCEED; /* Return value */ - H5Z_class2_t *old_cls = NULL; FUNC_ENTER_NOAPI(FAIL) @@ -431,10 +418,6 @@ H5Z_unregister(H5Z_filter_t filter_id) if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - /* deallocate plugin info name */ - old_cls = (H5Z_class2_t *)(H5Z_table_g+filter_index); - if (old_cls->name) - old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); @@ -658,11 +641,7 @@ H5Z_filter_avail(H5Z_filter_t id) HGOTO_DONE (TRUE) if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { - herr_t status = H5Z_register(filter_info); - if (filter_info->name) - filter_info->name = (char *)H5MM_xfree(filter_info->name); - filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); - if (status < 0) + if (H5Z_register (filter_info) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") HGOTO_DONE (TRUE) } @@ -1245,11 +1224,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* 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 */ - herr_t status = H5Z_register(filter_info); - if (filter_info->name) - filter_info->name = (char *)H5MM_xfree(filter_info->name); - filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); - if (status < 0) + 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 */ -- cgit v0.12 From bd28c0b42d43edc53f1bfd12ecb2ab397e92cbab Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 14:02:07 -0600 Subject: HDFFV-10328 remove allocation note --- release_docs/RELEASE.txt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9e3c3a9..a1b59b1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -160,8 +160,7 @@ Bug Fixes since HDF5-1.10.1 release - filter plugin handling in H5PL.c and H5Z.c It was discovered that the dynamic loading process used by - filter plugins had issues with memory allocation and library - dependencies. + filter plugins had issues with library dependencies. CMake build process changed to use LINK INTERFACE keywords, which allowed HDF5 C library to make dependent libraries private. The @@ -169,13 +168,6 @@ Bug Fixes since HDF5-1.10.1 release (such as szip or zlib) to be available. (ADB - 2017/11/16, HDFFV-10328) - The H5Z_class2_t structure returned by the filter plugins are - now dynamically allocated in H5Zregister function. Access to - the functions in the filter library now always use the dynamic - library API. - - (ADB - 2017/11/16, HDFFV-10329) - - H5Zfilter_avail in H5Z.c The public function checked for plugins, while the private -- cgit v0.12 From bb3fb6f13461d724baa635e464585cb49d8848d2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 14:20:14 -0600 Subject: HDFFV-10328 - fix typos --- src/H5Z.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 1f1a905..a9f7336 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1219,12 +1219,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; - 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) + 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 */ @@ -1235,7 +1235,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, issue_error = TRUE; /* Check for error */ - if(issue_error) { + if (issue_error) { /* Print out the filter name to give more info. But the name is optional for * the filter */ if (pline->filter[idx].name) @@ -1269,9 +1269,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, failed |= (unsigned)1 << idx; H5E_clear_stack (NULL); } - else { + else *nbytes = new_nbytes; - } } } else if (pline) { /* Write */ -- cgit v0.12 From 5683be342751e642719d14fa1baed83acaa71532 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 17 Nov 2017 13:29:04 -0700 Subject: HDFFV-10325: removed the COMMON/EQUIV statements. --- fortran/src/H5_ff.F90 | 449 ++++++++++++++++++++++++++++- fortran/src/H5f90global.F90 | 671 +++++--------------------------------------- 2 files changed, 512 insertions(+), 608 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index ef89d2f..f875d0e 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -38,7 +38,7 @@ MODULE H5LIB - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, C_INTPTR_T + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_INTPTR_T USE H5GLOBAL IMPLICIT NONE @@ -71,7 +71,102 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1, error_2, error_3 + ! + ! H5F flags + ! + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 + INTEGER :: H5F_flags(H5F_FLAGS_LEN) + ! + ! H5generic flags + ! + INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 + INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) + + INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 + INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + ! + ! H5G flags + ! + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 + INTEGER :: H5G_flags(H5G_FLAGS_LEN) + ! + ! H5D flags + ! + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 + INTEGER :: H5D_flags(H5D_FLAGS_LEN) + INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 + INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) + ! + ! H5E flags + ! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 + INTEGER :: H5E_flags(H5E_FLAGS_LEN) + INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 + INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) + ! + ! H5FD flags + ! + INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 + INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) + ! + ! H5FD file drivers flags + ! + INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 + INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) + ! + ! H5I flags + ! + INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 + INTEGER :: H5I_flags(H5I_FLAGS_LEN) + ! + ! H5L flags + ! + INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 + INTEGER :: H5L_flags(H5L_FLAGS_LEN) + ! + ! H5O flags + ! + INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 + INTEGER :: H5o_flags(H5O_FLAGS_LEN) + ! + ! H5P flags + ! + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 + INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) + ! + ! H5P integers flags + ! + INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 + INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) + ! + ! H5R flags + ! + INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 + INTEGER :: H5R_flags(H5R_FLAGS_LEN) + ! + ! H5S flags + ! + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 + INTEGER :: H5S_flags(H5S_FLAGS_LEN) + INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 + INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) + INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 + INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) + ! + ! H5T flags + ! + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 + INTEGER :: H5T_flags(H5T_FLAGS_LEN) + ! + ! H5Z flags + ! + INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 + INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) + ! + ! H5 Library flags + ! + INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 + INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) INTERFACE INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & @@ -147,8 +242,59 @@ CONTAINS INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) END FUNCTION h5init1_flags_c END INTERFACE - error_1 = h5init_types_c(predef_types, floating_types, integer_types) - error_2 = h5init_flags_c(H5D_flags, & + + error = h5init_types_c(predef_types, floating_types, integer_types) + + H5T_NATIVE_INTEGER_KIND(1:5) = predef_types(1:5) + H5T_NATIVE_INTEGER = predef_types(6) + H5T_NATIVE_REAL = predef_types(7) + H5T_NATIVE_DOUBLE = predef_types(8) + H5T_NATIVE_CHARACTER = predef_types(9) + H5T_STD_REF_OBJ = predef_types(10) + H5T_STD_REF_DSETREG = predef_types(11) + H5T_NATIVE_REAL_C_FLOAT = predef_types(12) + H5T_NATIVE_REAL_C_DOUBLE = predef_types(13) + H5T_NATIVE_REAL_C_LONG_DOUBLE = predef_types(14) + H5T_NATIVE_B8 = predef_types(15) + H5T_NATIVE_B16 = predef_types(16) + H5T_NATIVE_B32 = predef_types(17) + H5T_NATIVE_B64 = predef_types(18) + H5T_NATIVE_FLOAT_128 = predef_types(19) + + H5T_IEEE_F32BE = floating_types(1) + H5T_IEEE_F32LE = floating_types(2) + H5T_IEEE_F64BE = floating_types(3) + H5T_IEEE_F64LE = floating_types(4) + + H5T_STD_I8BE = integer_types(1) + H5T_STD_I8LE = integer_types(2) + H5T_STD_I16BE = integer_types(3) + H5T_STD_I16LE = integer_types(4) + H5T_STD_I32BE = integer_types(5) + H5T_STD_I32LE = integer_types(6) + H5T_STD_I64BE = integer_types(7) + H5T_STD_I64LE = integer_types(8) + H5T_STD_U8BE = integer_types(9) + H5T_STD_U8LE = integer_types(10) + H5T_STD_U16BE = integer_types(11) + H5T_STD_U16LE = integer_types(12) + H5T_STD_U32BE = integer_types(13) + H5T_STD_U32LE = integer_types(14) + H5T_STD_U64BE = integer_types(15) + H5T_STD_U64LE = integer_types(16) + H5T_STRING = integer_types(17) + H5T_STD_B8BE = integer_types(18) + H5T_STD_B8LE = integer_types(19) + H5T_STD_B16BE = integer_types(20) + H5T_STD_B16LE = integer_types(21) + H5T_STD_B32BE = integer_types(22) + H5T_STD_B32LE = integer_types(23) + H5T_STD_B64BE = integer_types(24) + H5T_STD_B64LE = integer_types(25) + H5T_FORTRAN_S1 = integer_types(26) + H5T_C_S1 = integer_types(27) + + error = error + h5init_flags_c(H5D_flags, & H5D_size_flags, & H5E_flags, & H5E_hid_flags, & @@ -169,8 +315,299 @@ CONTAINS H5Z_flags, & H5generic_flags,& H5generic_haddr_flags) - error_3 = h5init1_flags_c(H5LIB_flags ) - error = error_1 + error_2 + error_3 + ! + ! H5F flags + ! + H5F_ACC_RDWR_F = H5F_flags(1) + H5F_ACC_RDONLY_F = H5F_flags(2) + H5F_ACC_TRUNC_F = H5F_flags(3) + H5F_ACC_EXCL_F = H5F_flags(4) + H5F_ACC_DEBUG_F = H5F_flags(5) + H5F_SCOPE_LOCAL_F = H5F_flags(6) + H5F_SCOPE_GLOBAL_F = H5F_flags(7) + H5F_CLOSE_DEFAULT_F = H5F_flags(8) + H5F_CLOSE_WEAK_F = H5F_flags(9) + H5F_CLOSE_SEMI_F = H5F_flags(10) + H5F_CLOSE_STRONG_F = H5F_flags(11) + H5F_OBJ_FILE_F = H5F_flags(12) + H5F_OBJ_DATASET_F = H5F_flags(13) + H5F_OBJ_GROUP_F = H5F_flags(14) + H5F_OBJ_DATATYPE_F = H5F_flags(15) + H5F_OBJ_ALL_F = H5F_flags(16) + H5F_LIBVER_EARLIEST_F = H5F_flags(17) + H5F_LIBVER_LATEST_F = H5F_flags(18) + H5F_UNLIMITED_F = H5F_flags(19) + ! + ! H5generic flags + ! + H5_INDEX_UNKNOWN_F = H5generic_flags(1) + H5_INDEX_NAME_F = H5generic_flags(2) + H5_INDEX_CRT_ORDER_F = H5generic_flags(3) + H5_INDEX_N_F = H5generic_flags(4) + H5_ITER_UNKNOWN_F = H5generic_flags(5) + H5_ITER_INC_F = H5generic_flags(6) + H5_ITER_DEC_F = H5generic_flags(7) + H5_ITER_NATIVE_F = H5generic_flags(8) + H5_ITER_N_F = H5generic_flags(9) + + HADDR_UNDEF_F = H5generic_haddr_flags(1) + ! + ! H5G flags + ! + H5G_UNKNOWN_F = H5G_flags(1) + H5G_GROUP_F = H5G_flags(2) + H5G_DATASET_F = H5G_flags(3) + H5G_TYPE_F = H5G_flags(4) + H5G_SAME_LOC_F = H5G_flags(5) + H5G_LINK_ERROR_F = H5G_flags(6) + H5G_LINK_HARD_F = H5G_flags(7) + H5G_LINK_SOFT_F = H5G_flags(8) + H5G_STORAGE_TYPE_UNKNOWN_F = H5G_flags(9) + H5G_STORAGE_TYPE_SYMBOL_TABLE_F = H5G_flags(10) + H5G_STORAGE_TYPE_COMPACT_F = H5G_flags(11) + H5G_STORAGE_TYPE_DENSE_F = H5G_flags(12) + ! + ! H5D flags + ! + H5D_COMPACT_F = H5D_flags(1) + H5D_CONTIGUOUS_F = H5D_flags(2) + H5D_CHUNKED_F = H5D_flags(3) + H5D_ALLOC_TIME_ERROR_F = H5D_flags(4) + H5D_ALLOC_TIME_DEFAULT_F = H5D_flags(5) + H5D_ALLOC_TIME_EARLY_F = H5D_flags(6) + H5D_ALLOC_TIME_LATE_F = H5D_flags(7) + H5D_ALLOC_TIME_INCR_F = H5D_flags(8) + H5D_SPACE_STS_ERROR_F = H5D_flags(9) + H5D_SPACE_STS_NOT_ALLOCATED_F = H5D_flags(10) + H5D_SPACE_STS_PART_ALLOCATED_F = H5D_flags(11) + H5D_SPACE_STS_ALLOCATED_F = H5D_flags(12) + H5D_FILL_TIME_ERROR_F = H5D_flags(13) + H5D_FILL_TIME_ALLOC_F = H5D_flags(14) + H5D_FILL_TIME_NEVER_F = H5D_flags(15) + H5D_FILL_VALUE_ERROR_F = H5D_flags(16) + H5D_FILL_VALUE_UNDEFINED_F = H5D_flags(17) + H5D_FILL_VALUE_DEFAULT_F = H5D_flags(18) + H5D_FILL_VALUE_USER_DEFINED_F = H5D_flags(19) + H5D_CHUNK_CACHE_W0_DFLT_F = H5D_flags(20) + H5D_MPIO_NO_COLLECTIVE_F = H5D_flags(21) + H5D_MPIO_CHUNK_INDEPENDENT_F = H5D_flags(22) + H5D_MPIO_CHUNK_COLLECTIVE_F = H5D_flags(23) + H5D_MPIO_CHUNK_MIXED_F = H5D_flags(24) + H5D_MPIO_CONTIG_COLLECTIVE_F = H5D_flags(25) + H5D_VDS_ERROR_F = H5D_flags(26) + H5D_VDS_FIRST_MISSING_F = H5D_flags(27) + H5D_VDS_LAST_AVAILABLE_F = H5D_flags(28) + H5D_VIRTUAL_F = H5D_flags(29) + + H5D_CHUNK_CACHE_NSLOTS_DFLT_F = H5D_size_flags(1) + H5D_CHUNK_CACHE_NBYTES_DFLT_F = H5D_size_flags(2) + ! + ! H5E flags + ! + H5E_DEFAULT_F = H5E_hid_flags(1) + + H5E_MAJOR_F = H5E_flags(1) + H5E_MINOR_F = H5E_flags(2) + H5E_WALK_UPWARD_F = H5E_flags(3) + H5E_WALK_DOWNWARD_F = H5E_flags(4) + ! + ! H5FD flags + ! + H5FD_MPIO_INDEPENDENT_F = H5FD_flags(1) + H5FD_MPIO_COLLECTIVE_F = H5FD_flags(2) + H5FD_MEM_NOLIST_F = H5FD_flags(3) + H5FD_MEM_DEFAULT_F = H5FD_flags(4) + H5FD_MEM_SUPER_F = H5FD_flags(5) + H5FD_MEM_BTREE_F = H5FD_flags(6) + H5FD_MEM_DRAW_F = H5FD_flags(7) + H5FD_MEM_GHEAP_F = H5FD_flags(8) + H5FD_MEM_LHEAP_F = H5FD_flags(9) + H5FD_MEM_OHDR_F = H5FD_flags(10) + H5FD_MEM_NTYPES_F = H5FD_flags(11) + ! + ! H5FD file driver flags + ! + H5FD_CORE_F = H5FD_hid_flags(1) + H5FD_FAMILY_F = H5FD_hid_flags(2) + H5FD_LOG_F = H5FD_hid_flags(3) + H5FD_MPIO_F = H5FD_hid_flags(4) + H5FD_MULTI_F = H5FD_hid_flags(5) + H5FD_SEC2_F = H5FD_hid_flags(6) + H5FD_STDIO_F = H5FD_hid_flags(7) + ! + ! H5I flags declaration + ! + H5I_FILE_F = H5I_flags(1) + H5I_GROUP_F = H5I_flags(2) + H5I_DATATYPE_F = H5I_flags(3) + H5I_DATASPACE_F = H5I_flags(4) + H5I_DATASET_F = H5I_flags(5) + H5I_ATTR_F = H5I_flags(6) + H5I_BADID_F = H5I_flags(7) + ! + ! H5L flags + ! + H5L_TYPE_ERROR_F = H5L_flags(1) + H5L_TYPE_HARD_F = H5L_flags(2) + H5L_TYPE_SOFT_F = H5L_flags(3) + H5L_TYPE_EXTERNAL_F = H5L_flags(4) + H5L_SAME_LOC_F = H5L_flags(5) + H5L_LINK_CLASS_T_VERS_F = H5L_flags(6) + ! + ! H5O flags + ! + H5O_COPY_SHALLOW_HIERARCHY_F = h5o_flags(1) + H5O_COPY_EXPAND_SOFT_LINK_F = h5o_flags(2) + H5O_COPY_EXPAND_EXT_LINK_F = h5o_flags(3) + H5O_COPY_EXPAND_REFERENCE_F = h5o_flags(4) + H5O_COPY_WITHOUT_ATTR_FLAG_F = h5o_flags(5) + H5O_COPY_PRESERVE_NULL_FLAG_F = h5o_flags(6) + H5O_COPY_ALL_F = h5o_flags(7) + H5O_SHMESG_NONE_FLAG_F = h5o_flags(8) + H5O_SHMESG_SDSPACE_FLAG_F = h5o_flags(9) + H5O_SHMESG_DTYPE_FLAG_F = h5o_flags(10) + H5O_SHMESG_FILL_FLAG_F = h5o_flags(11) + H5O_SHMESG_PLINE_FLAG_F = h5o_flags(12) + H5O_SHMESG_ATTR_FLAG_F = h5o_flags(13) + H5O_SHMESG_ALL_FLAG_F = h5o_flags(14) + H5O_HDR_CHUNK0_SIZE_F = h5o_flags(15) + H5O_HDR_ATTR_CRT_ORDER_TRACK_F = h5o_flags(16) + H5O_HDR_ATTR_CRT_ORDER_INDEX_F = h5o_flags(17) + H5O_HDR_ATTR_STORE_PHASE_CHA_F = h5o_flags(18) + H5O_HDR_STORE_TIMES_F = h5o_flags(19) + H5O_HDR_ALL_FLAGS_F = h5o_flags(20) + H5O_SHMESG_MAX_NINDEXES_F = h5o_flags(21) + H5O_SHMESG_MAX_LIST_SIZE_F = h5o_flags(22) + H5O_TYPE_UNKNOWN_F = h5o_flags(23) + H5O_TYPE_GROUP_F = h5o_flags(24) + H5O_TYPE_DATASET_F = h5o_flags(25) + H5O_TYPE_NAMED_DATATYPE_F = h5o_flags(26) + H5O_TYPE_NTYPES_F = h5o_flags(27) + ! + ! H5P flags + ! + H5P_FILE_CREATE_F = H5P_flags(1) + H5P_FILE_ACCESS_F = H5P_flags(2) + H5P_DATASET_CREATE_F = H5P_flags(3) + H5P_DATASET_XFER_F = H5P_flags(4) + H5P_FILE_MOUNT_F = H5P_flags(5) + H5P_DEFAULT_F = H5P_flags(6) + H5P_ROOT_F = H5P_flags(7) + H5P_OBJECT_CREATE_F = H5P_flags(8) + H5P_DATASET_ACCESS_F = H5P_flags(9) + H5P_GROUP_CREATE_F = H5P_flags(10) + H5P_GROUP_ACCESS_F = H5P_flags(11) + H5P_DATATYPE_CREATE_F = H5P_flags(12) + H5P_DATATYPE_ACCESS_F = H5P_flags(13) + H5P_STRING_CREATE_F = H5P_flags(14) + H5P_ATTRIBUTE_CREATE_F = H5P_flags(15) + H5P_OBJECT_COPY_F = H5P_flags(16) + H5P_LINK_CREATE_F = H5P_flags(17) + H5P_LINK_ACCESS_F = H5P_flags(18) + ! + ! H5P integers flags + ! + H5P_CRT_ORDER_INDEXED_F = H5P_flags_int(1) + H5P_CRT_ORDER_TRACKED_F = H5P_flags_int(2) + ! + ! H5R flags + ! + H5R_OBJECT_F = H5R_flags(1) + H5R_DATASET_REGION_F = H5R_flags(2) + ! + ! H5S flags + ! + H5S_ALL_F = H5S_hid_flags(1) + + H5S_UNLIMITED_F = H5S_hsize_flags(1) + + H5S_SCALAR_F = H5S_flags(1) + H5S_SIMPLE_F = H5S_flags(2) + H5S_NULL_F = H5S_flags(3) + H5S_SELECT_SET_F = H5S_flags(4) + H5S_SELECT_OR_F = H5S_flags(5) + H5S_SELECT_NOOP_F = H5S_flags(6) + H5S_SELECT_AND_F = H5S_flags(7) + H5S_SELECT_XOR_F = H5S_flags(8) + H5S_SELECT_NOTB_F = H5S_flags(9) + H5S_SELECT_NOTA_F = H5S_flags(10) + H5S_SELECT_APPEND_F = H5S_flags(11) + H5S_SELECT_PREPEND_F = H5S_flags(12) + H5S_SELECT_INVALID_F = H5S_flags(13) + H5S_SEL_ERROR_F = H5S_flags(14) + H5S_SEL_NONE_F = H5S_flags(15) + H5S_SEL_POINTS_F = H5S_flags(16) + H5S_SEL_HYPERSLABS_F = H5S_flags(17) + H5S_SEL_ALL_F = H5S_flags(18) + ! + ! H5T flags declaration + ! + H5T_NO_CLASS_F = H5T_flags(1) + H5T_INTEGER_F = H5T_flags(2) + H5T_FLOAT_F = H5T_flags(3) + H5T_TIME_F = H5T_flags(4) + H5T_STRING_F = H5T_flags(5) + H5T_BITFIELD_F = H5T_flags(6) + H5T_OPAQUE_F = H5T_flags(7) + H5T_COMPOUND_F = H5T_flags(8) + H5T_REFERENCE_F = H5T_flags(9) + H5T_ENUM_F = H5T_flags(10) + H5T_ORDER_LE_F = H5T_flags(11) + H5T_ORDER_BE_F = H5T_flags(12) + H5T_ORDER_MIXED_F = H5T_flags(13) + H5T_ORDER_VAX_F = H5T_flags(14) + H5T_ORDER_NONE_F = H5T_flags(15) + H5T_PAD_ZERO_F = H5T_flags(16) + H5T_PAD_ONE_F = H5T_flags(17) + H5T_PAD_BACKGROUND_F = H5T_flags(18) + H5T_PAD_ERROR_F = H5T_flags(19) + H5T_SGN_NONE_F = H5T_flags(20) + H5T_SGN_2_F = H5T_flags(21) + H5T_SGN_ERROR_F = H5T_flags(22) + H5T_NORM_IMPLIED_F = H5T_flags(23) + H5T_NORM_MSBSET_F = H5T_flags(24) + H5T_NORM_NONE_F = H5T_flags(25) + H5T_CSET_ASCII_F = H5T_flags(26) + H5T_CSET_UTF8_F = H5T_flags(27) + H5T_STR_NULLTERM_F = H5T_flags(28) + H5T_STR_NULLPAD_F = H5T_flags(29) + H5T_STR_SPACEPAD_F = H5T_flags(30) + H5T_STR_ERROR_F = H5T_flags(31) + H5T_VLEN_F = H5T_flags(32) + H5T_ARRAY_F = H5T_flags(33) + H5T_DIR_ASCEND_F = H5T_flags(34) + H5T_DIR_DESCEND_F = H5T_flags(35) + ! + ! H5Z flags + ! + H5Z_FILTER_ERROR_F = H5Z_flags(1) + H5Z_FILTER_NONE_F = H5Z_flags(2) + H5Z_FILTER_DEFLATE_F = H5Z_flags(3) + H5Z_FILTER_SHUFFLE_F = H5Z_flags(4) + H5Z_FILTER_FLETCHER32_F = H5Z_flags(5) + H5Z_ERROR_EDC_F = H5Z_flags(6) + H5Z_DISABLE_EDC_F = H5Z_flags(7) + H5Z_ENABLE_EDC_F = H5Z_flags(8) + H5Z_NO_EDC_F = H5Z_flags(9) + H5Z_FILTER_SZIP_F = H5Z_flags(10) + H5Z_FLAG_OPTIONAL_F = H5Z_flags(11) + H5Z_FILTER_ENCODE_ENABLED_F = H5Z_flags(12) + H5Z_FILTER_DECODE_ENABLED_F = H5Z_flags(13) + H5Z_FILTER_ALL_F = H5Z_flags(14) + H5Z_FILTER_NBIT_F = H5Z_flags(15) + H5Z_FILTER_SCALEOFFSET_F = H5Z_flags(16) + H5Z_SO_FLOAT_DSCALE_F = H5Z_flags(17) + H5Z_SO_FLOAT_ESCALE_F = H5Z_flags(18) + H5Z_SO_INT_F = H5Z_flags(19) + H5Z_SO_INT_MINBITS_DEFAULT_F = H5Z_flags(20) + + error = error + h5init1_flags_c(H5LIB_flags) + ! + ! H5 Library flags + ! + H5_SZIP_EC_OM_F = H5LIB_flags(1) + H5_SZIP_NN_OM_F = H5LIB_flags(2) + END SUBROUTINE h5open_f !****s* H5LIB/h5close_f diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 629418a..be7195c 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -71,9 +71,9 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change this - ! value when new predefined - ! datatypes are added + ! Do not forget to change this value when new predefined + ! datatypes are added + INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change the following line when new predefined ! floating data types are added @@ -83,32 +83,56 @@ MODULE H5GLOBAL ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT, & - H5T_NATIVE_REAL_C_DOUBLE, & - H5T_NATIVE_REAL_C_LONG_DOUBLE, & - H5T_NATIVE_INTEGER, & - H5T_NATIVE_REAL, & - H5T_NATIVE_DOUBLE, & - H5T_NATIVE_CHARACTER , & - H5T_STD_REF_OBJ, & - H5T_STD_REF_DSETREG, & - H5T_IEEE_F32BE, & - H5T_IEEE_F32LE, & - H5T_IEEE_F64BE, & - H5T_IEEE_F64LE, & - H5T_STD_I8BE, & - H5T_STD_I8LE, & - H5T_STD_I16BE, & - H5T_STD_I16LE, & - H5T_STD_I32BE, & - H5T_STD_I32LE, & - H5T_STD_I64BE, & - H5T_STD_I64LE, & - H5T_STD_U8BE, & - H5T_STD_U8LE, & - H5T_STD_U16BE, & - H5T_STD_U16LE, & - H5T_STD_U32BE + ! These arrays need to be global because they are used in + ! both h5open_f and in h5close_f + INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types + INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types + INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types + ! + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_INTEGER + INTEGER(HID_T) :: H5T_NATIVE_REAL + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER + INTEGER(HID_T) :: H5T_STD_REF_OBJ + INTEGER(HID_T) :: H5T_STD_REF_DSETREG + INTEGER(HID_T) :: H5T_IEEE_F32BE + INTEGER(HID_T) :: H5T_IEEE_F32LE + INTEGER(HID_T) :: H5T_IEEE_F64BE + INTEGER(HID_T) :: H5T_IEEE_F64LE + INTEGER(HID_T) :: H5T_STD_I8BE + INTEGER(HID_T) :: H5T_STD_I8LE + INTEGER(HID_T) :: H5T_STD_I16BE + INTEGER(HID_T) :: H5T_STD_I16LE + INTEGER(HID_T) :: H5T_STD_I32BE + INTEGER(HID_T) :: H5T_STD_I32LE + INTEGER(HID_T) :: H5T_STD_I64BE + INTEGER(HID_T) :: H5T_STD_I64LE + INTEGER(HID_T) :: H5T_STD_U8BE + INTEGER(HID_T) :: H5T_STD_U8LE + INTEGER(HID_T) :: H5T_STD_U16BE + INTEGER(HID_T) :: H5T_STD_U16LE + INTEGER(HID_T) :: H5T_STD_U32BE + INTEGER(HID_T) :: H5T_STD_U32LE + INTEGER(HID_T) :: H5T_STD_U64BE + INTEGER(HID_T) :: H5T_STD_U64LE + INTEGER(HID_T) :: H5T_STRING + INTEGER(HID_T) :: H5T_STD_B8BE + INTEGER(HID_T) :: H5T_STD_B8LE + INTEGER(HID_T) :: H5T_STD_B16BE + INTEGER(HID_T) :: H5T_STD_B16LE + INTEGER(HID_T) :: H5T_STD_B32BE + INTEGER(HID_T) :: H5T_STD_B32LE + INTEGER(HID_T) :: H5T_STD_B64BE + INTEGER(HID_T) :: H5T_STD_B64LE + INTEGER(HID_T) :: H5T_NATIVE_B8 + INTEGER(HID_T) :: H5T_NATIVE_B16 + INTEGER(HID_T) :: H5T_NATIVE_B32 + INTEGER(HID_T) :: H5T_NATIVE_B64 + INTEGER(HID_T) :: H5T_FORTRAN_S1 + INTEGER(HID_T) :: H5T_C_S1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -116,139 +140,22 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- -! NOTE: Splitting the line since the Fortran 95 standard limits the number of -! continuation lines to 39; the F03/F08 standard limits the number -! to 255 lines. - - INTEGER(HID_T) :: H5T_STD_U32LE, & - H5T_STD_U64BE, & - H5T_STD_U64LE, & - H5T_STRING, & - H5T_STD_B8BE, & - H5T_STD_B8LE, & - H5T_STD_B16BE, & - H5T_STD_B16LE, & - H5T_STD_B32BE, & - H5T_STD_B32LE, & - H5T_STD_B64BE, & - H5T_STD_B64LE, & - H5T_NATIVE_B8, & - H5T_NATIVE_B16, & - H5T_NATIVE_B32, & - H5T_NATIVE_B64, & - H5T_FORTRAN_S1, & - H5T_C_S1 - - - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types - EQUIVALENCE (predef_types(1), H5T_NATIVE_INTEGER_KIND(1)) - ! EQUIVALENCE predef_types(2:5) are unnecessary and violate the standard - EQUIVALENCE (predef_types(6), H5T_NATIVE_INTEGER) - EQUIVALENCE (predef_types(7), H5T_NATIVE_REAL) - EQUIVALENCE (predef_types(8), H5T_NATIVE_DOUBLE) - EQUIVALENCE (predef_types(9), H5T_NATIVE_CHARACTER) - EQUIVALENCE (predef_types(10), H5T_STD_REF_OBJ) - EQUIVALENCE (predef_types(11), H5T_STD_REF_DSETREG) - EQUIVALENCE (predef_types(12), H5T_NATIVE_REAL_C_FLOAT) - EQUIVALENCE (predef_types(13), H5T_NATIVE_REAL_C_DOUBLE) - EQUIVALENCE (predef_types(14), H5T_NATIVE_REAL_C_LONG_DOUBLE) - EQUIVALENCE (predef_types(15), H5T_NATIVE_B8 ) - EQUIVALENCE (predef_types(16), H5T_NATIVE_B16) - EQUIVALENCE (predef_types(17), H5T_NATIVE_B32) - EQUIVALENCE (predef_types(18), H5T_NATIVE_B64) - EQUIVALENCE (predef_types(19), H5T_NATIVE_FLOAT_128) ! ADDED NEW TYPE -MSB- - - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types - EQUIVALENCE (floating_types(1), H5T_IEEE_F32BE ) - EQUIVALENCE (floating_types(2), H5T_IEEE_F32LE) - EQUIVALENCE (floating_types(3), H5T_IEEE_F64BE) - EQUIVALENCE (floating_types(4), H5T_IEEE_F64LE) - - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types - EQUIVALENCE (integer_types(1), H5T_STD_I8BE ) - EQUIVALENCE (integer_types(2), H5T_STD_I8LE) - EQUIVALENCE (integer_types(3), H5T_STD_I16BE) - EQUIVALENCE (integer_types(4), H5T_STD_I16LE) - EQUIVALENCE (integer_types(5), H5T_STD_I32BE) - EQUIVALENCE (integer_types(6), H5T_STD_I32LE) - EQUIVALENCE (integer_types(7), H5T_STD_I64BE) - EQUIVALENCE (integer_types(8), H5T_STD_I64LE) - EQUIVALENCE (integer_types(9), H5T_STD_U8BE) - EQUIVALENCE (integer_types(10), H5T_STD_U8LE) - EQUIVALENCE (integer_types(11), H5T_STD_U16BE) - EQUIVALENCE (integer_types(12), H5T_STD_U16LE) - EQUIVALENCE (integer_types(13), H5T_STD_U32BE) - EQUIVALENCE (integer_types(14), H5T_STD_U32LE) - EQUIVALENCE (integer_types(15), H5T_STD_U64BE) - EQUIVALENCE (integer_types(16), H5T_STD_U64LE) - EQUIVALENCE (integer_types(17), H5T_STRING) - EQUIVALENCE (integer_types(18), H5T_STD_B8BE) - EQUIVALENCE (integer_types(19), H5T_STD_B8LE) - EQUIVALENCE (integer_types(20), H5T_STD_B16BE) - EQUIVALENCE (integer_types(21), H5T_STD_B16LE) - EQUIVALENCE (integer_types(22), H5T_STD_B32BE) - EQUIVALENCE (integer_types(23), H5T_STD_B32LE) - EQUIVALENCE (integer_types(24), H5T_STD_B64BE) - EQUIVALENCE (integer_types(25), H5T_STD_B64LE) - EQUIVALENCE (integer_types(26), H5T_FORTRAN_S1) - EQUIVALENCE (integer_types(27), H5T_C_S1) - - - ! COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & - ! H5T_NATIVE_REAL, & - ! H5T_NATIVE_DOUBLE, & - ! H5T_NATIVE_CHARACTER, & - ! H5T_STD_REF_OBJ, & - ! H5T_STD_REF_DSETREG - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /PREDEFINED_TYPES/ - !DEC$endif - COMMON /PREDEFINED_TYPES/ predef_types - - ! COMMON /FLOATING_TYPES/ H5T_IEEE_F32BE, & - ! H5T_IEEE_F32LE, & - ! H5T_IEEE_F64BE, & - ! H5T_IEEE_F64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /FLOATING_TYPES/ - !DEC$endif - COMMON /FLOATING_TYPES/ floating_types - ! - ! COMMON /INTEGER_TYPES/ H5T_STD_I8BE, & - ! H5T_STD_I8LE, & - ! H5T_STD_I16BE, & - ! H5T_STD_I16LE, & - ! H5T_STD_I32BE, & - ! H5T_STD_I32LE, & - ! H5T_STD_I64BE, & - ! H5T_STD_I64LE, & - ! H5T_STD_U8BE, & - ! H5T_STD_U8LE, & - ! H5T_STD_U16BE, & - ! H5T_STD_U16LE, & - ! H5T_STD_U32BE, & - ! H5T_STD_U32LE, & - ! H5T_STD_U64BE, & - ! H5T_STD_U64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /INTEGER_TYPES/ - !DEC$endif - COMMON /INTEGER_TYPES/ integer_types - ! - ! Fortran flags - ! + ! H5generic flags declaration ! - ! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDED !) + INTEGER :: H5_INDEX_UNKNOWN_F + INTEGER :: H5_INDEX_NAME_F + INTEGER :: H5_INDEX_CRT_ORDER_F + INTEGER :: H5_INDEX_N_F + INTEGER :: H5_ITER_UNKNOWN_F + INTEGER :: H5_ITER_INC_F + INTEGER :: H5_ITER_DEC_F + INTEGER :: H5_ITER_NATIVE_F + INTEGER :: H5_ITER_N_F + + INTEGER(HADDR_T) :: HADDR_UNDEF_F ! ! H5F flags declaration ! - INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER :: H5F_flags(H5F_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ - !DEC$endif - COMMON /H5F_FLAGS/ H5F_flags - INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -268,77 +175,9 @@ MODULE H5GLOBAL INTEGER :: H5F_LIBVER_EARLIEST_F INTEGER :: H5F_LIBVER_LATEST_F INTEGER :: H5F_UNLIMITED_F - - EQUIVALENCE(H5F_flags(1), H5F_ACC_RDWR_F) - EQUIVALENCE(H5F_flags(2), H5F_ACC_RDONLY_F) - EQUIVALENCE(H5F_flags(3), H5F_ACC_TRUNC_F) - EQUIVALENCE(H5F_flags(4), H5F_ACC_EXCL_F) - EQUIVALENCE(H5F_flags(5), H5F_ACC_DEBUG_F) - EQUIVALENCE(H5F_flags(6), H5F_SCOPE_LOCAL_F) - EQUIVALENCE(H5F_flags(7), H5F_SCOPE_GLOBAL_F) - EQUIVALENCE(H5F_flags(8), H5F_CLOSE_DEFAULT_F) - EQUIVALENCE(H5F_flags(9), H5F_CLOSE_WEAK_F) - EQUIVALENCE(H5F_flags(10), H5F_CLOSE_SEMI_F) - EQUIVALENCE(H5F_flags(11), H5F_CLOSE_STRONG_F) - EQUIVALENCE(H5F_flags(12), H5F_OBJ_FILE_F) - EQUIVALENCE(H5F_flags(13), H5F_OBJ_DATASET_F) - EQUIVALENCE(H5F_flags(14), H5F_OBJ_GROUP_F) - EQUIVALENCE(H5F_flags(15), H5F_OBJ_DATATYPE_F) - EQUIVALENCE(H5F_flags(16), H5F_OBJ_ALL_F) - EQUIVALENCE(H5F_flags(17), H5F_LIBVER_EARLIEST_F) - EQUIVALENCE(H5F_flags(18), H5F_LIBVER_LATEST_F) - EQUIVALENCE(H5F_flags(19), H5F_UNLIMITED_F) - ! - ! H5generic flags declaration - ! - INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ - !DEC$endif - COMMON /H5generic_FLAGS/ H5generic_flags - - INTEGER :: H5_INDEX_UNKNOWN_F - INTEGER :: H5_INDEX_NAME_F - INTEGER :: H5_INDEX_CRT_ORDER_F - INTEGER :: H5_INDEX_N_F - INTEGER :: H5_ITER_UNKNOWN_F - INTEGER :: H5_ITER_INC_F - INTEGER :: H5_ITER_DEC_F - INTEGER :: H5_ITER_NATIVE_F - INTEGER :: H5_ITER_N_F - - EQUIVALENCE(H5generic_flags(1), H5_INDEX_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(2), H5_INDEX_NAME_F) - EQUIVALENCE(H5generic_flags(3), H5_INDEX_CRT_ORDER_F) - EQUIVALENCE(H5generic_flags(4), H5_INDEX_N_F) - EQUIVALENCE(H5generic_flags(5), H5_ITER_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(6), H5_ITER_INC_F) - EQUIVALENCE(H5generic_flags(7), H5_ITER_DEC_F) - EQUIVALENCE(H5generic_flags(8), H5_ITER_NATIVE_F) - EQUIVALENCE(H5generic_flags(9), H5_ITER_N_F) - - INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_haddr_FLAGS/ - !DEC$endif - COMMON /H5generic_haddr_FLAGS/ H5generic_haddr_flags - - INTEGER(HADDR_T) :: HADDR_UNDEF_F - - EQUIVALENCE(H5generic_haddr_flags(1), HADDR_UNDEF_F) - ! ! H5G flags declaration ! - INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER :: H5G_flags(H5G_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ - !DEC$endif - COMMON /H5G_FLAGS/ H5G_flags - INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -353,35 +192,9 @@ MODULE H5GLOBAL INTEGER :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F INTEGER :: H5G_STORAGE_TYPE_COMPACT_F INTEGER :: H5G_STORAGE_TYPE_DENSE_F - - EQUIVALENCE(H5G_flags(1), H5G_UNKNOWN_F) ! Unknown object type - EQUIVALENCE(H5G_flags(2), H5G_GROUP_F) ! Object is a group - EQUIVALENCE(H5G_flags(3), H5G_DATASET_F) ! Object is a dataset - EQUIVALENCE(H5G_flags(4), H5G_TYPE_F) ! Object is a named data type - EQUIVALENCE(H5G_flags(5), H5G_SAME_LOC_F) - EQUIVALENCE(H5G_flags(6), H5G_LINK_ERROR_F) - EQUIVALENCE(H5G_flags(7), H5G_LINK_HARD_F) - EQUIVALENCE(H5G_flags(8), H5G_LINK_SOFT_F) - - EQUIVALENCE(H5G_flags(9), H5G_STORAGE_TYPE_UNKNOWN_F ) - EQUIVALENCE(H5G_flags(10), H5G_STORAGE_TYPE_SYMBOL_TABLE_F) - EQUIVALENCE(H5G_flags(11), H5G_STORAGE_TYPE_COMPACT_F) - EQUIVALENCE(H5G_flags(12), H5G_STORAGE_TYPE_DENSE_F) - ! ! H5D flags declaration ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER :: H5D_flags(H5D_FLAGS_LEN) - INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_SIZE_FLAGS/ - !DEC$endif - COMMON /H5D_FLAGS/ H5D_flags - COMMON /H5D_SIZE_FLAGS/ H5D_size_flags - INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -413,6 +226,7 @@ MODULE H5GLOBAL INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + INTEGER :: H5D_CHUNK_CACHE_W0_DFLT_F INTEGER :: H5D_MPIO_NO_COLLECTIVE_F INTEGER :: H5D_MPIO_CHUNK_INDEPENDENT_F @@ -423,81 +237,17 @@ MODULE H5GLOBAL INTEGER :: H5D_VDS_FIRST_MISSING_F INTEGER :: H5D_VDS_LAST_AVAILABLE_F INTEGER :: H5D_VIRTUAL_F - - EQUIVALENCE(H5D_flags(1), H5D_COMPACT_F) - EQUIVALENCE(H5D_flags(2), H5D_CONTIGUOUS_F) - EQUIVALENCE(H5D_flags(3), H5D_CHUNKED_F) - - EQUIVALENCE(H5D_flags(4), H5D_ALLOC_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(5), H5D_ALLOC_TIME_DEFAULT_F) - EQUIVALENCE(H5D_flags(6), H5D_ALLOC_TIME_EARLY_F) - EQUIVALENCE(H5D_flags(7), H5D_ALLOC_TIME_LATE_F) - EQUIVALENCE(H5D_flags(8), H5D_ALLOC_TIME_INCR_F) - - EQUIVALENCE(H5D_flags(9), H5D_SPACE_STS_ERROR_F) - EQUIVALENCE(H5D_flags(10), H5D_SPACE_STS_NOT_ALLOCATED_F) - EQUIVALENCE(H5D_flags(11), H5D_SPACE_STS_PART_ALLOCATED_F) - EQUIVALENCE(H5D_flags(12), H5D_SPACE_STS_ALLOCATED_F) - - EQUIVALENCE(H5D_flags(13), H5D_FILL_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(14), H5D_FILL_TIME_ALLOC_F) - EQUIVALENCE(H5D_flags(15), H5D_FILL_TIME_NEVER_F) - - EQUIVALENCE(H5D_flags(16), H5D_FILL_VALUE_ERROR_F) - EQUIVALENCE(H5D_flags(17), H5D_FILL_VALUE_UNDEFINED_F) - EQUIVALENCE(H5D_flags(18), H5D_FILL_VALUE_DEFAULT_F) - EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) - - EQUIVALENCE(H5D_flags(20), H5D_CHUNK_CACHE_W0_DFLT_F) - EQUIVALENCE(H5D_flags(21), H5D_MPIO_NO_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(22), H5D_MPIO_CHUNK_INDEPENDENT_F) - EQUIVALENCE(H5D_flags(23), H5D_MPIO_CHUNK_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(24), H5D_MPIO_CHUNK_MIXED_F) - EQUIVALENCE(H5D_flags(25), H5D_MPIO_CONTIG_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(26), H5D_VDS_ERROR_F) - EQUIVALENCE(H5D_flags(27), H5D_VDS_FIRST_MISSING_F) - EQUIVALENCE(H5D_flags(28), H5D_VDS_LAST_AVAILABLE_F) - EQUIVALENCE(H5D_flags(29), H5D_VIRTUAL_F) - - EQUIVALENCE(H5D_size_flags(1), H5D_CHUNK_CACHE_NSLOTS_DFLT_F) - EQUIVALENCE(H5D_size_flags(2), H5D_CHUNK_CACHE_NBYTES_DFLT_F) - ! ! H5E flags declaration ! - INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER :: H5E_flags(H5E_FLAGS_LEN) - INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_HID_FLAGS/ - !DEC$endif - COMMON /H5E_FLAGS/ H5E_flags - COMMON /H5E_HID_FLAGS/ H5E_hid_flags - INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F INTEGER :: H5E_WALK_UPWARD_F INTEGER :: H5E_WALK_DOWNWARD_F - - EQUIVALENCE(H5E_hid_flags(1), H5E_DEFAULT_F) - EQUIVALENCE(H5E_flags(1) , H5E_MAJOR_F) - EQUIVALENCE(H5E_flags(2) , H5E_MINOR_F) - EQUIVALENCE(H5E_flags(3) , H5E_WALK_UPWARD_F) - EQUIVALENCE(H5E_flags(4) , H5E_WALK_DOWNWARD_F) - ! - ! H5FD flags declaration + ! H5FD file drivers flags declaration ! - INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_FLAGS/ - !DEC$endif - COMMON /H5FD_FLAGS/ H5FD_flags - INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -509,28 +259,6 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F INTEGER :: H5FD_MEM_NTYPES_F - - EQUIVALENCE(H5FD_flags(1), H5FD_MPIO_INDEPENDENT_F) - EQUIVALENCE(H5FD_flags(2), H5FD_MPIO_COLLECTIVE_F) - EQUIVALENCE(H5FD_flags(3), H5FD_MEM_NOLIST_F) - EQUIVALENCE(H5FD_flags(4), H5FD_MEM_DEFAULT_F) - EQUIVALENCE(H5FD_flags(5), H5FD_MEM_SUPER_F) - EQUIVALENCE(H5FD_flags(6), H5FD_MEM_BTREE_F) - EQUIVALENCE(H5FD_flags(7), H5FD_MEM_DRAW_F) - EQUIVALENCE(H5FD_flags(8), H5FD_MEM_GHEAP_F) - EQUIVALENCE(H5FD_flags(9), H5FD_MEM_LHEAP_F) - EQUIVALENCE(H5FD_flags(10), H5FD_MEM_OHDR_F) - EQUIVALENCE(H5FD_flags(11), H5FD_MEM_NTYPES_F) - ! - ! H5FD file drivers flags declaration - ! - INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/ - !DEC$endif - COMMON /H5FD_HID_FLAGS/ H5FD_hid_flags - INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F @@ -538,25 +266,9 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5FD_MULTI_F INTEGER(HID_T) :: H5FD_SEC2_F INTEGER(HID_T) :: H5FD_STDIO_F - - EQUIVALENCE(H5FD_hid_flags(1), H5FD_CORE_F) - EQUIVALENCE(H5FD_hid_flags(2), H5FD_FAMILY_F) - EQUIVALENCE(H5FD_hid_flags(3), H5FD_LOG_F) - EQUIVALENCE(H5FD_hid_flags(4), H5FD_MPIO_F) - EQUIVALENCE(H5FD_hid_flags(5), H5FD_MULTI_F) - EQUIVALENCE(H5FD_hid_flags(6), H5FD_SEC2_F) - EQUIVALENCE(H5FD_hid_flags(7), H5FD_STDIO_F) - ! ! H5I flags declaration ! - INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER :: H5I_flags(H5I_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5I_FLAGS/ - !DEC$endif - COMMON /H5I_FLAGS/ H5I_flags - INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -564,48 +276,18 @@ MODULE H5GLOBAL INTEGER :: H5I_DATASET_F INTEGER :: H5I_ATTR_F INTEGER :: H5I_BADID_F - - EQUIVALENCE(H5I_flags(1), H5I_FILE_F) - EQUIVALENCE(H5I_flags(2), H5I_GROUP_F) - EQUIVALENCE(H5I_flags(3), H5I_DATATYPE_F) - EQUIVALENCE(H5I_flags(4), H5I_DATASPACE_F) - EQUIVALENCE(H5I_flags(5), H5I_DATASET_F) - EQUIVALENCE(H5I_flags(6), H5I_ATTR_F) - EQUIVALENCE(H5I_flags(7), H5I_BADID_F) ! ! H5L flags declaration ! - INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER :: H5L_flags(H5L_FLAGS_LEN) - INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F INTEGER :: H5L_TYPE_EXTERNAL_F INTEGER :: H5L_SAME_LOC_F INTEGER :: H5L_LINK_CLASS_T_VERS_F - - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5L_FLAGS/ - !DEC$endif - COMMON /H5L_FLAGS/ H5L_flags - - EQUIVALENCE(H5L_flags(1), H5L_TYPE_ERROR_F) - EQUIVALENCE(H5L_flags(2), H5L_TYPE_HARD_F) - EQUIVALENCE(H5L_flags(3), H5L_TYPE_SOFT_F) - EQUIVALENCE(H5L_flags(4), H5L_TYPE_EXTERNAL_F) - EQUIVALENCE(H5L_flags(5), H5L_SAME_LOC_F) - EQUIVALENCE(H5L_flags(6), H5L_LINK_CLASS_T_VERS_F) ! ! H5O flags declaration ! - INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER :: H5o_flags(H5O_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5O_FLAGS/ - !DEC$endif - COMMON /H5O_FLAGS/ H5O_flags - INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -633,45 +315,9 @@ MODULE H5GLOBAL INTEGER :: H5O_TYPE_DATASET_F INTEGER :: H5O_TYPE_NAMED_DATATYPE_F INTEGER :: H5O_TYPE_NTYPES_F - - EQUIVALENCE(h5o_flags(1) , H5O_COPY_SHALLOW_HIERARCHY_F) - EQUIVALENCE(h5o_flags(2) , H5O_COPY_EXPAND_SOFT_LINK_F) - EQUIVALENCE(h5o_flags(3) , H5O_COPY_EXPAND_EXT_LINK_F) - EQUIVALENCE(h5o_flags(4) , H5O_COPY_EXPAND_REFERENCE_F) - EQUIVALENCE(h5o_flags(5) , H5O_COPY_WITHOUT_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(6) , H5O_COPY_PRESERVE_NULL_FLAG_F) - EQUIVALENCE(h5o_flags(7) , H5O_COPY_ALL_F) - EQUIVALENCE(h5o_flags(8) , H5O_SHMESG_NONE_FLAG_F) - EQUIVALENCE(h5o_flags(9) , H5O_SHMESG_SDSPACE_FLAG_F) - EQUIVALENCE(h5o_flags(10) , H5O_SHMESG_DTYPE_FLAG_F) - EQUIVALENCE(h5o_flags(11) , H5O_SHMESG_FILL_FLAG_F) - EQUIVALENCE(h5o_flags(12) , H5O_SHMESG_PLINE_FLAG_F) - EQUIVALENCE(h5o_flags(13) , H5O_SHMESG_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(14) , H5O_SHMESG_ALL_FLAG_F) - EQUIVALENCE(h5o_flags(15) , H5O_HDR_CHUNK0_SIZE_F) - EQUIVALENCE(h5o_flags(16) , H5O_HDR_ATTR_CRT_ORDER_TRACK_F) - EQUIVALENCE(h5o_flags(17) , H5O_HDR_ATTR_CRT_ORDER_INDEX_F) - EQUIVALENCE(h5o_flags(18) , H5O_HDR_ATTR_STORE_PHASE_CHA_F) - EQUIVALENCE(h5o_flags(19) , H5O_HDR_STORE_TIMES_F) - EQUIVALENCE(h5o_flags(20) , H5O_HDR_ALL_FLAGS_F) - EQUIVALENCE(h5o_flags(21) , H5O_SHMESG_MAX_NINDEXES_F) - EQUIVALENCE(h5o_flags(22) , H5O_SHMESG_MAX_LIST_SIZE_F) - EQUIVALENCE(h5o_flags(23) , H5O_TYPE_UNKNOWN_F) - EQUIVALENCE(h5o_flags(24) , H5O_TYPE_GROUP_F) - EQUIVALENCE(h5o_flags(25) , H5O_TYPE_DATASET_F) - EQUIVALENCE(h5o_flags(26) , H5O_TYPE_NAMED_DATATYPE_F) - EQUIVALENCE(h5o_flags(27) , H5O_TYPE_NTYPES_F) - ! ! H5P flags declaration ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ - !DEC$endif - COMMON /H5P_FLAGS/ H5P_flags - INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -691,72 +337,16 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5P_LINK_CREATE_F INTEGER(HID_T) :: H5P_LINK_ACCESS_F - EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F) - EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F) - EQUIVALENCE(H5P_flags(3), H5P_DATASET_CREATE_F) - EQUIVALENCE(H5P_flags(4), H5P_DATASET_XFER_F) - EQUIVALENCE(H5P_flags(5), H5P_FILE_MOUNT_F) - EQUIVALENCE(H5P_flags(6), H5P_DEFAULT_F) - EQUIVALENCE(H5P_flags(7), H5P_ROOT_F) - EQUIVALENCE(H5P_flags(8), H5P_OBJECT_CREATE_F) - EQUIVALENCE(H5P_flags(9), H5P_DATASET_ACCESS_F) - EQUIVALENCE(H5P_flags(10), H5P_GROUP_CREATE_F) - EQUIVALENCE(H5P_flags(11), H5P_GROUP_ACCESS_F) - EQUIVALENCE(H5P_flags(12), H5P_DATATYPE_CREATE_F) - EQUIVALENCE(H5P_flags(13), H5P_DATATYPE_ACCESS_F) - EQUIVALENCE(H5P_flags(14), H5P_STRING_CREATE_F) - EQUIVALENCE(H5P_flags(15), H5P_ATTRIBUTE_CREATE_F) - EQUIVALENCE(H5P_flags(16), H5P_OBJECT_COPY_F) - EQUIVALENCE(H5P_flags(17), H5P_LINK_CREATE_F) - EQUIVALENCE(H5P_flags(18), H5P_LINK_ACCESS_F) - - ! - ! H5P integers flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS_INT/ - !DEC$endif - COMMON /H5P_FLAGS_INT/ H5P_flags_int INTEGER :: H5P_CRT_ORDER_INDEXED_F INTEGER :: H5P_CRT_ORDER_TRACKED_F - EQUIVALENCE(H5P_flags_int(1), H5P_CRT_ORDER_INDEXED_F) - EQUIVALENCE(H5P_flags_int(2), H5P_CRT_ORDER_TRACKED_F) ! ! H5R flags declaration ! - INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER :: H5R_flags(H5R_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5R_FLAGS/ - !DEC$endif - COMMON /H5R_FLAGS/ H5R_flags - INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F - - EQUIVALENCE(H5R_flags(1), H5R_OBJECT_F) - EQUIVALENCE(H5R_flags(2), H5R_DATASET_REGION_F) - ! ! H5S flags declaration ! - INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER :: H5S_flags(H5S_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HID_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HSIZE_FLAGS/ - !DEC$endif - COMMON /H5S_FLAGS/ H5S_flags - COMMON /H5S_HID_FLAGS/ H5S_hid_flags - COMMON /H5S_HSIZE_FLAGS/ H5S_hsize_flags - INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -781,43 +371,9 @@ MODULE H5GLOBAL INTEGER :: H5S_SEL_POINTS_F INTEGER :: H5S_SEL_HYPERSLABS_F INTEGER :: H5S_SEL_ALL_F - - EQUIVALENCE(H5S_hid_flags(1), H5S_ALL_F) - - EQUIVALENCE(H5S_hsize_flags(1), H5S_UNLIMITED_F) - - EQUIVALENCE(H5S_flags(1), H5S_SCALAR_F) - EQUIVALENCE(H5S_flags(2), H5S_SIMPLE_F) - EQUIVALENCE(H5S_flags(3), H5S_NULL_F) - EQUIVALENCE(H5S_flags(4), H5S_SELECT_SET_F) - EQUIVALENCE(H5S_flags(5), H5S_SELECT_OR_F) - - EQUIVALENCE(H5S_flags(6), H5S_SELECT_NOOP_F) - EQUIVALENCE(H5S_flags(7), H5S_SELECT_AND_F) - EQUIVALENCE(H5S_flags(8), H5S_SELECT_XOR_F) - EQUIVALENCE(H5S_flags(9), H5S_SELECT_NOTB_F) - EQUIVALENCE(H5S_flags(10), H5S_SELECT_NOTA_F) - - EQUIVALENCE(H5S_flags(11), H5S_SELECT_APPEND_F) - EQUIVALENCE(H5S_flags(12), H5S_SELECT_PREPEND_F) - EQUIVALENCE(H5S_flags(13), H5S_SELECT_INVALID_F) - EQUIVALENCE(H5S_flags(14), H5S_SEL_ERROR_F) - EQUIVALENCE(H5S_flags(15), H5S_SEL_NONE_F) - - EQUIVALENCE(H5S_flags(16), H5S_SEL_POINTS_F) - EQUIVALENCE(H5S_flags(17), H5S_SEL_HYPERSLABS_F) - EQUIVALENCE(H5S_flags(18), H5S_SEL_ALL_F) - ! ! H5T flags declaration ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER :: H5T_flags(H5T_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ - !DEC$endif - COMMON /H5T_FLAGS/ H5T_flags - INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -853,52 +409,9 @@ MODULE H5GLOBAL INTEGER :: H5T_STR_ERROR_F INTEGER :: H5T_DIR_ASCEND_F INTEGER :: H5T_DIR_DESCEND_F - - EQUIVALENCE(H5T_flags(1), H5T_NO_CLASS_F) - EQUIVALENCE(H5T_flags(2), H5T_INTEGER_F) - EQUIVALENCE(H5T_flags(3), H5T_FLOAT_F) - EQUIVALENCE(H5T_flags(4), H5T_TIME_F) - EQUIVALENCE(H5T_flags(5), H5T_STRING_F) - EQUIVALENCE(H5T_flags(6), H5T_BITFIELD_F) - EQUIVALENCE(H5T_flags(7), H5T_OPAQUE_F) - EQUIVALENCE(H5T_flags(8), H5T_COMPOUND_F) - EQUIVALENCE(H5T_flags(9), H5T_REFERENCE_F) - EQUIVALENCE(H5T_flags(10), H5T_ENUM_F) - EQUIVALENCE(H5T_flags(11), H5T_ORDER_LE_F) - EQUIVALENCE(H5T_flags(12), H5T_ORDER_BE_F) - EQUIVALENCE(H5T_flags(13), H5T_ORDER_MIXED_F) - EQUIVALENCE(H5T_flags(14), H5T_ORDER_VAX_F) - EQUIVALENCE(H5T_flags(15), H5T_ORDER_NONE_F) - EQUIVALENCE(H5T_flags(16), H5T_PAD_ZERO_F) - EQUIVALENCE(H5T_flags(17), H5T_PAD_ONE_F) - EQUIVALENCE(H5T_flags(18), H5T_PAD_BACKGROUND_F) - EQUIVALENCE(H5T_flags(19), H5T_PAD_ERROR_F) - EQUIVALENCE(H5T_flags(20), H5T_SGN_NONE_F) - EQUIVALENCE(H5T_flags(21), H5T_SGN_2_F) - EQUIVALENCE(H5T_flags(22), H5T_SGN_ERROR_F) - EQUIVALENCE(H5T_flags(23), H5T_NORM_IMPLIED_F) - EQUIVALENCE(H5T_flags(24), H5T_NORM_MSBSET_F) - EQUIVALENCE(H5T_flags(25), H5T_NORM_NONE_F) - EQUIVALENCE(H5T_flags(26), H5T_CSET_ASCII_F) - EQUIVALENCE(H5T_flags(27), H5T_CSET_UTF8_F) - EQUIVALENCE(H5T_flags(28), H5T_STR_NULLTERM_F) - EQUIVALENCE(H5T_flags(29), H5T_STR_NULLPAD_F) - EQUIVALENCE(H5T_flags(30), H5T_STR_SPACEPAD_F) - EQUIVALENCE(H5T_flags(31), H5T_STR_ERROR_F) - EQUIVALENCE(H5T_flags(32), H5T_VLEN_F) - EQUIVALENCE(H5T_flags(33), H5T_ARRAY_F) - EQUIVALENCE(H5T_flags(34), H5T_DIR_ASCEND_F) - EQUIVALENCE(H5T_flags(35), H5T_DIR_DESCEND_F) ! - ! H5Z flags declaration + ! H5Z flags ! - INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ - !DEC$endif - COMMON /H5Z_FLAGS/ H5Z_flags - INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -919,58 +432,12 @@ MODULE H5GLOBAL INTEGER :: H5Z_SO_FLOAT_ESCALE_F INTEGER :: H5Z_SO_INT_F INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F - - EQUIVALENCE(H5Z_flags(1), H5Z_FILTER_ERROR_F) - EQUIVALENCE(H5Z_flags(2), H5Z_FILTER_NONE_F) - EQUIVALENCE(H5Z_flags(3), H5Z_FILTER_DEFLATE_F) - EQUIVALENCE(H5Z_flags(4), H5Z_FILTER_SHUFFLE_F) - EQUIVALENCE(H5Z_flags(5), H5Z_FILTER_FLETCHER32_F) - EQUIVALENCE(H5Z_flags(6), H5Z_ERROR_EDC_F) - EQUIVALENCE(H5Z_flags(7), H5Z_DISABLE_EDC_F) - EQUIVALENCE(H5Z_flags(8), H5Z_ENABLE_EDC_F) - EQUIVALENCE(H5Z_flags(9), H5Z_NO_EDC_F) - EQUIVALENCE(H5Z_flags(10), H5Z_FILTER_SZIP_F) - EQUIVALENCE(H5Z_flags(11), H5Z_FLAG_OPTIONAL_F) - EQUIVALENCE(H5Z_flags(12), H5Z_FILTER_ENCODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(13), H5Z_FILTER_DECODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(14), H5Z_FILTER_ALL_F) - EQUIVALENCE(H5Z_flags(15), H5Z_FILTER_NBIT_F) - EQUIVALENCE(H5Z_flags(16), H5Z_FILTER_SCALEOFFSET_F) - EQUIVALENCE(H5Z_flags(17), H5Z_SO_FLOAT_DSCALE_F) - EQUIVALENCE(H5Z_flags(18), H5Z_SO_FLOAT_ESCALE_F) - EQUIVALENCE(H5Z_flags(19), H5Z_SO_INT_F) - EQUIVALENCE(H5Z_flags(20), H5Z_SO_INT_MINBITS_DEFAULT_F) - ! - ! H5 Library flags declaration + ! H5 Library flags ! - INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5LIB_FLAGS/ - !DEC$endif - COMMON /H5LIB_FLAGS/ H5LIB_flags INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - ! - EQUIVALENCE(H5LIB_flags(1), H5_SZIP_EC_OM_F) - EQUIVALENCE(H5LIB_flags(2), H5_SZIP_NN_OM_F) - - ! General H5 flags declarations - ! -!!$ INTEGER, PARAMETER :: H5_FLAGS_LEN = 2 -!!$ INTEGER H5_flags(H5_FLAGS_LEN) -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$ATTRIBUTES DLLEXPORT :: /H5_FLAGS/ -!!$!DEC$endif -!!$ COMMON /H5_FLAGS/ H5_flags -!!$ -!!$ INTEGER :: _F -!!$ INTEGER :: H5F_SCOPE_LOCAL_F -!!$ -!!$ EQUIVALENCE(H5F_flags(1), H5F_SCOPE_GLOBAL_F) -!!$ EQUIVALENCE(H5F_flags(2), H5F_SCOPE_LOCAL_F) CONTAINS -- cgit v0.12 From c9b78a6714e6f7a781ab49b8ccecc022b3ef8529 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 17 Nov 2017 14:23:01 -0700 Subject: misc. clean-up --- fortran/src/H5_ff.F90 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index f875d0e..79ab280 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -638,7 +638,6 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1 INTERFACE INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & f_types, F_TYPES_LEN, & @@ -653,10 +652,9 @@ CONTAINS INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types END FUNCTION h5close_types_c END INTERFACE - error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & + error = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & floating_types, FLOATING_TYPES_LEN, & integer_types, INTEGER_TYPES_LEN ) - error = error_1 END SUBROUTINE h5close_f -- cgit v0.12 From 3b1728736840e25d5cd1b048f09025e7c0f22123 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 17 Nov 2017 15:21:49 -0800 Subject: Brings H5Z and H5PL packages in sync with VOL integration branch. --- src/H5PLint.c | 62 +++-- src/H5PLpath.c | 4 +- src/H5PLpkg.h | 8 +- src/H5PLplugin_cache.c | 14 +- src/H5PLprivate.h | 7 +- src/H5PLpublic.h | 6 +- src/H5Z.c | 173 ++++++------ test/error_test.c | 416 ++++++++++++++--------------- test/testfiles/error_test_1 | 2 +- tools/test/h5dump/errfiles/filter_fail.err | 2 +- 10 files changed, 352 insertions(+), 342 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index c887f86..b190746 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -235,11 +235,11 @@ done: *------------------------------------------------------------------------- */ const void * -H5PL_load(H5PL_type_t type, int id) +H5PL_load(H5PL_type_t type, H5PL_key_t key) { - H5PL_search_params_t search_params; + H5PL_search_params_t search_params; /* Plugin search parameters */ hbool_t found = FALSE; /* Whether the plugin was found */ - const void *plugin_info = NULL; + const void *plugin_info = NULL; /* Information from the plugin */ const void *ret_value = NULL; FUNC_ENTER_NOAPI(NULL) @@ -248,18 +248,17 @@ H5PL_load(H5PL_type_t type, int id) 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) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "filter plugins disabled") 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) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "Invalid plugin type specified") } /* Set up the search parameters */ search_params.type = type; - search_params.id = id; + search_params.key.id = key.id; /* Search in the table of already loaded plugin libraries */ if(H5PL__find_plugin_in_cache(&search_params, &found, &plugin_info) < 0) @@ -304,11 +303,11 @@ done: #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) +H5PL__open(const char *path, H5PL_type_t type, H5PL_key_t key, 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; + herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -326,35 +325,46 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v */ if (NULL == (handle = H5PL_OPEN_DLIB(path))) { H5PL_CLR_ERROR; /* clear error */ - HGOTO_DONE(SUCCEED); + 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. */ - if (NULL != (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) { - - const H5Z_class2_t *info; + if (NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) + HGOTO_DONE(SUCCEED) - /* 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") + /* Get the plugin information */ + switch (type) { + case H5PL_TYPE_FILTER: + { + const H5Z_class2_t *filter_info; - /* Check if the filter IDs match */ - if (info->id == id) { + /* Get the plugin info */ + if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info)())) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get filter info from plugin") - /* 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") + /* If the filter IDs match, we're done. Set the output parameters. */ + if (filter_info->id == key.id) { + *plugin_info = (const void *)filter_info; + *success = TRUE; + } - /* Set output parameters */ - *success = TRUE; - *plugin_info = (const void *)info; + break; } - } + case H5PL_TYPE_ERROR: + case H5PL_TYPE_NONE: + default: + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "Invalid plugin type specified") + } /* end switch */ + + /* If we found the correct plugin, store it in the cache */ + if (*success) + if (H5PL__add_plugin(type, key, handle)) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to add new plugin to plugin cache") done: - if (!success && handle) + if (!(*success) && handle) if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 435802a..d8e82f8 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -689,7 +689,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo 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) + if (H5PL__open(path, search_params->type, search_params->key, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) @@ -755,7 +755,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo 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) + if (H5PL__open(path, search_params->type, search_params->search_key.id, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index 0d1c271..dfaa4af 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -115,8 +115,8 @@ /* Data used to search for plugins */ typedef struct H5PL_search_params_t { - H5PL_type_t type; - int id; + H5PL_type_t type; + H5PL_key_t key; } H5PL_search_params_t; @@ -134,13 +134,13 @@ 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__open(const char *libname, H5PL_type_t type, H5PL_key_t key, 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__add_plugin(H5PL_type_t type, H5PL_key_t key, 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 */ diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index e483e01..e905ac2 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -56,9 +56,9 @@ /* 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_type_t type; /* Plugin type */ + H5PL_key_t key; /* Unique key to identify the plugin */ + H5PL_HANDLE handle; /* Plugin handle */ } H5PL_plugin_t; @@ -209,14 +209,14 @@ done: /*------------------------------------------------------------------------- * Function: H5PL__add_plugin * - * Purpose: Add a plugin to the plugin cached. + * Purpose: Add a plugin to the plugin cache. * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t -H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle) +H5PL__add_plugin(H5PL_type_t type, H5PL_key_t key, H5PL_HANDLE handle) { herr_t ret_value = SUCCEED; @@ -229,7 +229,7 @@ H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle) /* 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].key = key; H5PL_cache_g[H5PL_num_plugins_g].handle = handle; H5PL_num_plugins_g++; @@ -276,7 +276,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f 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)) { + if ((search_params->type == (H5PL_cache_g[u]).type) && (search_params->key.id == (H5PL_cache_g[u]).key.id)) { H5PL_get_plugin_info_t get_plugin_info_function; const H5Z_class2_t *filter_info; diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index bc12e64..cc2e258 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -33,6 +33,11 @@ /* Library Private Typedefs */ /****************************/ +/* The key that will be used to find the plugin */ +typedef union H5PL_key_t { + int id; /* filters */ +} H5PL_key_t; + /*****************************/ /* Library-private Variables */ @@ -44,7 +49,7 @@ /***************************************/ /* Internal API routines */ -H5_DLL const void *H5PL_load(H5PL_type_t plugin_type, int type_id); +H5_DLL const void *H5PL_load(H5PL_type_t plugin_type, H5PL_key_t key); #endif /* _H5PLprivate_H */ diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 3b36ccd..fe5bdfb 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -30,9 +30,9 @@ /* 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 */ diff --git a/src/H5Z.c b/src/H5Z.c index a9f7336..1e7cd79 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -86,24 +86,24 @@ H5Z__init_package(void) FUNC_ENTER_PACKAGE /* Internal filters */ - if (H5Z_register (H5Z_SHUFFLE) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") - if (H5Z_register (H5Z_FLETCHER32) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") - if (H5Z_register (H5Z_NBIT) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") - if (H5Z_register (H5Z_SCALEOFFSET) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") + if (H5Z_register(H5Z_SHUFFLE) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") + if (H5Z_register(H5Z_FLETCHER32) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") + if (H5Z_register(H5Z_NBIT) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") + if (H5Z_register(H5Z_SCALEOFFSET) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") /* External filters */ #ifdef H5_HAVE_FILTER_DEFLATE - if (H5Z_register (H5Z_DEFLATE) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") + if (H5Z_register(H5Z_DEFLATE) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if (H5Z_register (H5Z_SZIP) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") + if (H5Z_register(H5Z_SZIP) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") #endif /* H5_HAVE_FILTER_SZIP */ done: @@ -180,7 +180,7 @@ H5Z_term_package(void) } /* end if */ #endif /* H5Z_DEBUG */ /* Free the table of filters */ - if(H5Z_table_g) { + if (H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); #ifdef H5Z_DEBUG H5Z_stat_table_g = (H5Z_stats_t *)H5MM_xfree(H5Z_stat_table_g); @@ -191,7 +191,7 @@ H5Z_term_package(void) } /* end if */ /* Mark interface as closed */ - if(0 == n) + if (0 == n) H5_PKG_INIT_VAR = FALSE; } /* end if */ @@ -219,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. @@ -251,20 +251,20 @@ H5Zregister(const void *cls) #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Deprecated symbols not allowed, throw an error */ - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* 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->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") if (cls_real->filter == 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") + if (H5Z_register(cls_real) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") done: FUNC_LEAVE_API(ret_value) @@ -289,8 +289,8 @@ H5Z_register (const H5Z_class2_t *cls) FUNC_ENTER_NOAPI(FAIL) - HDassert (cls); - HDassert (cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); + HDassert(cls); + HDassert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); /* Is the filter already registered? */ for (i = 0; i < H5Z_table_used_g; i++) @@ -306,11 +306,11 @@ H5Z_register (const H5Z_class2_t *cls) 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") + 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") + 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; @@ -318,15 +318,15 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; - HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + 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)); + HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); } /* end else */ done: @@ -420,9 +420,9 @@ H5Z_unregister(H5Z_filter_t filter_id) /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ - HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove(&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); #ifdef H5Z_DEBUG - HDmemmove (&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove(&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); #endif /* H5Z_DEBUG */ H5Z_table_used_g--; @@ -450,11 +450,11 @@ H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id) /* Get the plist structure of object creation */ if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) - HGOTO_ERROR (H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") + HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") /* Check if the object creation property list uses the filter */ if ((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") done: FUNC_LEAVE_NOAPI(ret_value) @@ -487,11 +487,11 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void /* Get the group creation property */ if ((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") /* Check if the filter is in the group creation property list */ if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. @@ -504,7 +504,7 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void done: if (ocpl_id > 0) if (H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_group_cb() */ @@ -536,11 +536,11 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * /* Get the dataset creation property */ 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") + 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 */ if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. @@ -553,7 +553,7 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * done: if (ocpl_id > 0) if (H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_dset_cb() */ @@ -582,7 +582,7 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUS * 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) - HGOTO_ERROR (H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") } /* end if */ done: @@ -608,10 +608,10 @@ 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") + 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") done: FUNC_LEAVE_API(ret_value) @@ -629,22 +629,25 @@ done: htri_t H5Z_filter_avail(H5Z_filter_t id) { - size_t i; /* Local index variable */ - H5Z_class2_t *filter_info; - htri_t ret_value = FALSE; /* Return value */ + H5PL_key_t key; /* Key for finding a plugin */ + const H5Z_class2_t *filter_info; /* Filter information */ + size_t i; /* Local index variable */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* 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) + key.id = (int)id; + if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, key))) { + 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() */ @@ -683,7 +686,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, if (pline->filter[u].flags & H5Z_FLAG_OPTIONAL) H5E_clear_stack (NULL); else - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") } /* end if */ else { /* Make correct callback */ @@ -691,7 +694,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, case H5Z_PRELUDE_CAN_APPLY: /* Check if filter is configured to be able to encode */ if (!fclass->encoder_present) - HGOTO_ERROR (H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); + HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); /* Check if there is a "can apply" callback */ @@ -716,7 +719,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, /* Make callback to filter's "set local" function */ if ((fclass->set_local)(dcpl_id, type_id, space_id) < 0) /* Indicate error during filter callback */ - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") } /* end if */ break; @@ -753,8 +756,8 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type FUNC_ENTER_NOAPI_NOINIT - HDassert (H5I_GENPROP_LST == H5I_get_type(dcpl_id)); - HDassert (H5I_DATATYPE == H5I_get_type(type_id)); + HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); + HDassert(H5I_DATATYPE == H5I_get_type(type_id)); /* Check if the property list is non-default */ if (dcpl_id != H5P_DATASET_CREATE_DEFAULT) { @@ -834,7 +837,7 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -865,7 +868,7 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -894,7 +897,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -927,7 +930,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -952,10 +955,10 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert (0 == cd_nelmts || cd_values); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert(0 == cd_nelmts || cd_values); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -964,7 +967,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; @@ -982,7 +985,7 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); if (NULL == pline->filter[idx].cd_values) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; @@ -1017,10 +1020,10 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert (0 == cd_nelmts || cd_values); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert(0 == cd_nelmts || cd_values); /* * Check filter limit. We do it here for early warnings although we may @@ -1052,13 +1055,13 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, 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") + 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. */ - for(n = 0; n < pline->nalloc; ++n) - if(x.filter[n].cd_values == (void *) ~((size_t) NULL)) + for (n = 0; n < pline->nalloc; ++n) + if (x.filter[n].cd_values == (void *) ~((size_t) NULL)) x.filter[n].cd_values = x.filter[n]._cd_values; /* Point to newly allocated buffer */ @@ -1079,7 +1082,7 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); if (NULL == pline->filter[idx].cd_values) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; @@ -1118,7 +1121,7 @@ H5Z_find_idx(H5Z_filter_t id) for (i = 0; i < H5Z_table_used_g; i++) if (H5Z_table_g[i].id == id) - HGOTO_DONE ((int)i) + HGOTO_DONE((int)i) done: FUNC_LEAVE_NOAPI(ret_value) @@ -1145,10 +1148,10 @@ 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 %d is not registered", id) + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "required filter %d is not registered", id) /* Set return value */ - ret_value = H5Z_table_g+idx; + ret_value = H5Z_table_g + idx; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1219,13 +1222,15 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; + H5PL_key_t key; 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)))) { + key.id = (int)(pline->filter[idx].id); + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, key))) { /* Register the filter we loaded */ - if (H5Z_register(filter_info) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + 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) @@ -1263,7 +1268,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, 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") + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") *nbytes = *buf_size; failed |= (unsigned)1 << idx; @@ -1303,7 +1308,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, 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") + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") *nbytes = *buf_size; } @@ -1350,7 +1355,7 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) /* 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") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") /* Set return value */ ret_value = &pline->filter[idx]; @@ -1427,7 +1432,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) /* Check if we didn't find the filter */ if (j == H5Z_table_used_g) - HGOTO_DONE (FALSE) + HGOTO_DONE(FALSE) } /* end for */ done: @@ -1480,7 +1485,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) /* filter was not found in the pipeline */ if (!found) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Free information for deleted filter */ if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) @@ -1563,7 +1568,7 @@ H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) /* Look up the filter class info */ if (NULL == (fclass = H5Z_find(filter))) - HGOTO_ERROR (H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") + HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") /* Set the filter config flags for the application */ if (filter_config_flags != NULL) { diff --git a/test/error_test.c b/test/error_test.c index 9c39065..5356fa7 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -82,35 +82,33 @@ static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, /*------------------------------------------------------------------------- - * Function: test_error + * Function: test_error * - * Purpose: Test error API functions + * Purpose: Test error API functions * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t test_error(hid_t file) { - hid_t dataset, space; - hid_t estack_id; + hid_t dataset = -1; + hid_t space = -1; + hid_t estack_id = -1; hsize_t dims[2]; const char *FUNC_test_error = "test_error"; H5E_auto2_t old_func; - void *old_data; + void *old_data = NULL; HDfprintf(stderr, "\nTesting error API based on data I/O\n"); /* Create the data space */ dims[0] = DIM0; dims[1] = DIM1; - if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR; + if ((space = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR; /* Test H5E_BEGIN_TRY */ H5E_BEGIN_TRY { @@ -118,40 +116,40 @@ test_error(hid_t file) } H5E_END_TRY; /* Create the dataset */ - if((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { + if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE, "H5Dcreate2 failed"); goto error; - } /* end if */ + } /* Test enabling and disabling default printing */ - if(H5Eget_auto2(H5E_DEFAULT, &old_func, &old_data) < 0) - TEST_ERROR; - if(old_data != NULL) - TEST_ERROR; + if (H5Eget_auto2(H5E_DEFAULT, &old_func, &old_data) < 0) + TEST_ERROR; + if (old_data != NULL) + TEST_ERROR; #ifdef H5_USE_16_API if (old_func != (H5E_auto_t)H5Eprint) - TEST_ERROR; + TEST_ERROR; #else /* H5_USE_16_API */ if (old_func != (H5E_auto2_t)H5Eprint2) - TEST_ERROR; + TEST_ERROR; #endif /* H5_USE_16_API */ - if(H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) + if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) TEST_ERROR; /* Make H5Dwrite fail, verify default print is disabled */ - if(H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) >= 0) { + if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) >= 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, "H5Dwrite shouldn't succeed"); goto error; - } /* end if */ + } - if(H5Eset_auto2(H5E_DEFAULT, old_func, old_data) < 0) + if (H5Eset_auto2(H5E_DEFAULT, old_func, old_data) < 0) TEST_ERROR; /* Test saving and restoring the current error stack */ - if(H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) { + if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, "H5Dwrite failed as supposed to"); estack_id = H5Eget_current_stack(); @@ -159,10 +157,11 @@ test_error(hid_t file) H5Sclose(space); H5Eset_current_stack(estack_id); goto error; - } /* end if */ + } /* In case program comes to this point, close dataset */ - if(H5Dclose(dataset) < 0) TEST_ERROR; + if(H5Dclose(dataset) < 0) + TEST_ERROR; TEST_ERROR; @@ -172,16 +171,12 @@ test_error(hid_t file) /*------------------------------------------------------------------------- - * Function: init_error + * Function: init_error * - * Purpose: Initialize error information. + * Purpose: Initialize error information. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -194,46 +189,46 @@ init_error(void) char *msg = NULL; H5E_type_t msg_type; - if(NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1))) + if (NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1))) TEST_ERROR - if(NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1))) + if (NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1))) TEST_ERROR - if((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0) + if ((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0) TEST_ERROR; - if(cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) + if (cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) TEST_ERROR; - if(HDstrcmp(ERR_CLS_NAME, cls_name)) + if (HDstrcmp(ERR_CLS_NAME, cls_name)) TEST_ERROR; - if((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0) + if ((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0) TEST_ERROR; - if((ERR_MAJ_IO = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_IO_MSG)) < 0) + if ((ERR_MAJ_IO = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_IO_MSG)) < 0) TEST_ERROR; - if((ERR_MAJ_API = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_API_MSG)) < 0) + if ((ERR_MAJ_API = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_API_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_SUBROUTINE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_SUBROUTINE_MSG)) < 0) + if ((ERR_MIN_SUBROUTINE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_SUBROUTINE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_ERRSTACK = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_ERRSTACK_MSG)) < 0) + if ((ERR_MIN_ERRSTACK = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_ERRSTACK_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_CREATE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_CREATE_MSG)) < 0) + if ((ERR_MIN_CREATE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_CREATE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_WRITE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_WRITE_MSG)) < 0) + if ((ERR_MIN_WRITE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_WRITE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_GETNUM = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_GETNUM_MSG)) < 0) + if ((ERR_MIN_GETNUM = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_GETNUM_MSG)) < 0) TEST_ERROR; - if(msg_size != H5Eget_msg(ERR_MIN_SUBROUTINE, &msg_type, msg, (size_t)msg_size) + 1) + if (msg_size != H5Eget_msg(ERR_MIN_SUBROUTINE, &msg_type, msg, (size_t)msg_size) + 1) TEST_ERROR; - if(msg_type != H5E_MINOR) + if (msg_type != H5E_MINOR) TEST_ERROR; - if(HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG)) + if (HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG)) TEST_ERROR; /* Register another class for later testing. */ - if((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0) + if ((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0) TEST_ERROR; HDfree(cls_name); @@ -242,9 +237,9 @@ init_error(void) return 0; error: - if(cls_name) + if (cls_name) HDfree(cls_name); - if(msg) + if (msg) HDfree(msg); return -1; @@ -252,16 +247,12 @@ error: /*------------------------------------------------------------------------- - * Function: error_stack - * - * Purpose: Manipulates current error stack. + * Function: error_stack * - * Return: Success: 0 + * Purpose: Manipulates current error stack. * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 14, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -271,23 +262,23 @@ error_stack(void) ssize_t err_num; const char *FUNC_error_stack = "error_stack"; - if((err_num = H5Eget_num(H5E_DEFAULT)) < 0) + if ((err_num = H5Eget_num(H5E_DEFAULT)) < 0) TEST_ERROR; - if(err_num) + if (err_num) TEST_ERROR; - if((ERR_STACK = H5Eget_current_stack()) < 0) + if ((ERR_STACK = H5Eget_current_stack()) < 0) TEST_ERROR; /* Make it push error, force this function to fail */ - if((err_num = H5Eget_num(ERR_STACK)) == 0) { + if ((err_num = H5Eget_num(ERR_STACK)) == 0) { H5Epush(ERR_STACK, __FILE__, FUNC_error_stack, __LINE__, ERR_CLS, ERR_MAJ_API, ERR_MIN_GETNUM, "Get number test failed, returned %d", (int)err_num); goto error; - } /* end if */ + } /* In case program falls through here, close the stack and let it fail. */ - if(H5Eclose_stack(ERR_STACK) < 0) + if (H5Eclose_stack(ERR_STACK) < 0) TEST_ERROR; return -1; @@ -300,14 +291,10 @@ error: /*------------------------------------------------------------------------- * Function: long_desc_cb * - * Purpose: Callback function to help test long description handling - * - * Return: Success: 0 + * Purpose: Callback function to help test long description handling * - * Failure: -1 - * - * Programmer: Quincey Koziol - * January 19, 2005 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -316,24 +303,20 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie { char *real_desc = (char *)client_data; - if(err_desc->desc != NULL && HDstrcmp(err_desc->desc, real_desc) == 0) - return(0); + if (err_desc->desc != NULL && HDstrcmp(err_desc->desc, real_desc) == 0) + return 0; else - return(-1); + return -1; } /* end long_desc_cb() */ /*------------------------------------------------------------------------- - * Function: test_long_desc + * Function: test_long_desc * - * Purpose: Test long error description handling + * Purpose: Test long error description handling * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Quincey Koziol - * January 19, 2005 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -347,56 +330,59 @@ test_long_desc(void) const char *test_FUNC = "test_long_desc"; /* Allocate space for the error description info */ - if(NULL == (long_desc = (char*)HDmalloc(LONG_DESC_SIZE))) TEST_ERROR; - if(NULL == (full_desc = (char*)HDmalloc(LONG_DESC_SIZE + 128))) TEST_ERROR; + if (NULL == (long_desc = (char *)HDmalloc(LONG_DESC_SIZE))) + TEST_ERROR; + if (NULL == (full_desc = (char *)HDmalloc(LONG_DESC_SIZE + 128))) + TEST_ERROR; /* Create the long part of the error description */ - for(u = 0; u < LONG_DESC_SIZE; u++) + for (u = 0; u < LONG_DESC_SIZE; u++) long_desc[u] = (char)('A' + (u % 26)); long_desc[LONG_DESC_SIZE - 1] = '\0'; /* Clear the default error stack */ - if(H5Eclear2(H5E_DEFAULT) < 0) TEST_ERROR; + if (H5Eclear2(H5E_DEFAULT) < 0) + TEST_ERROR; /* Push an error with a long description */ - if(H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0) TEST_ERROR; + if (H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0) + TEST_ERROR; /* Create the string that should be in the description. Must use HDsnprintf here - * because snprintf is _snprintf on Windows */ + * because snprintf is _snprintf on Windows + */ HDsnprintf(full_desc, (size_t)(LONG_DESC_SIZE + 128), format, long_desc); /* Make certain that the description is correct */ - if(H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0) TEST_ERROR; + if (H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0) + TEST_ERROR; /* Clear the default error stack again */ - if(H5Eclear2(H5E_DEFAULT) < 0) TEST_ERROR; + if (H5Eclear2(H5E_DEFAULT) < 0) + TEST_ERROR; HDfree(long_desc); HDfree(full_desc); - return(0); + return 0; error: - if(long_desc) + if (long_desc) HDfree(long_desc); - if(full_desc) + if (full_desc) HDfree(full_desc); - return(-1); + return -1; } /* end test_long_desc() */ /*------------------------------------------------------------------------- * Function: dump_error * - * Purpose: Prints error stack in default and customized ways. + * Purpose: Prints error stack in default and customized ways. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 17, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -405,12 +391,12 @@ dump_error(hid_t estack) { /* Print errors in library default way */ HDfprintf(stderr, "********* Print error stack in HDF5 default way *********\n"); - if(H5Eprint2(estack, stderr) < 0) + if (H5Eprint2(estack, stderr) < 0) TEST_ERROR; /* Customized way to print errors */ HDfprintf(stderr, "\n********* Print error stack in customized way *********\n"); - if(H5Ewalk2(estack, H5E_WALK_UPWARD, custom_print_cb, stderr) < 0) + if (H5Ewalk2(estack, H5E_WALK_UPWARD, custom_print_cb, stderr) < 0) TEST_ERROR; return 0; @@ -423,34 +409,30 @@ error: /*------------------------------------------------------------------------- * Function: custom_print_cb * - * Purpose: Callback function to print error stack in customized way. - * - * Return: Success: 0 + * Purpose: Callback function to print error stack in customized way. * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 17, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void* client_data) { - FILE *stream = (FILE *)client_data; + FILE *stream = (FILE *)client_data; char maj[MSG_SIZE]; char min[MSG_SIZE]; char cls[MSG_SIZE]; - const int indent = 4; + const int indent = 4; /* Get descriptions for the major and minor error numbers */ - if(H5Eget_class_name(err_desc->cls_id, cls, MSG_SIZE) < 0) + if (H5Eget_class_name(err_desc->cls_id, cls, MSG_SIZE) < 0) TEST_ERROR; - if(H5Eget_msg(err_desc->maj_num, NULL, maj, MSG_SIZE) < 0) + if (H5Eget_msg(err_desc->maj_num, NULL, maj, MSG_SIZE) < 0) TEST_ERROR; - if(H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE) < 0) + if (H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE) < 0) TEST_ERROR; HDfprintf(stream, "%*serror #%03d: %s in %s(): line %u\n", @@ -468,54 +450,58 @@ error: /*------------------------------------------------------------------------- - * Function: test_create - * - * Purpose: Test creating an empty error stack + * Function: test_create * - * Return: Success: 0 - * Failure: -1 + * Purpose: Test creating an empty error stack * - * Programmer: Quincey Koziol - * November 1, 2007 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t test_create(void) { - const char *err_func = "test_create"; /* Function name for pushing error */ - const char *err_msg = "Error message"; /* Error message for pushing error */ - ssize_t err_num; /* Number of errors on stack */ - hid_t estack_id; /* Error stack ID */ + const char *err_func = "test_create"; /* Function name for pushing error */ + const char *err_msg = "Error message"; /* Error message for pushing error */ + ssize_t err_num; /* Number of errors on stack */ + hid_t estack_id = -1; /* Error stack ID */ /* Create an empty error stack */ - if((estack_id = H5Ecreate_stack()) < 0) TEST_ERROR + if ((estack_id = H5Ecreate_stack()) < 0) + TEST_ERROR /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Push an error with a long description */ - if(H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; + if (H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) + TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Clear the error stack */ - if(H5Eclear2(estack_id) < 0) TEST_ERROR + if (H5Eclear2(estack_id) < 0) + TEST_ERROR /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Close error stack */ - if(H5Eclose_stack(estack_id) < 0) TEST_ERROR + if(H5Eclose_stack(estack_id) < 0) + TEST_ERROR - return(0); + return 0; error: - return(-1); + return -1; } /* end test_create() */ /*------------------------------------------------------------------------- @@ -526,70 +512,72 @@ error: * Return: Success: 0 * Failure: -1 * - * Programmer: Allen Byrne - * February 18, 2010 - * *------------------------------------------------------------------------- */ static herr_t test_copy(void) { - const char *err_func = "test_copy"; /* Function name for pushing error */ - const char *err_msg = "Error message"; /* Error message for pushing error */ - ssize_t err_num; /* Number of errors on stack */ - hid_t estack_id; /* Error stack ID */ - herr_t ret; /* Generic return value */ + const char *err_func = "test_copy"; /* Function name for pushing error */ + const char *err_msg = "Error message"; /* Error message for pushing error */ + ssize_t err_num; /* Number of errors on stack */ + hid_t estack_id = -1; /* Error stack ID */ + herr_t ret; /* Generic return value */ /* Push an error with a long description */ - if(H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; + if (H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) + TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Copy error stack, which clears the original */ - if((estack_id = H5Eget_current_stack()) < 0) TEST_ERROR + if ((estack_id = H5Eget_current_stack()) < 0) + TEST_ERROR /* Check the number of errors on stack copy */ err_num = H5Eget_num(estack_id); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Check the number of errors on original stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Put the stack copy as the default. It closes the stack copy, too. */ - if(H5Eset_current_stack(estack_id) < 0) TEST_ERROR + if (H5Eset_current_stack(estack_id) < 0) + TEST_ERROR /* Check the number of errors on default stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Try to close error stack copy. Should fail because - * the current H5Eset_current_stack closes the stack to be set.*/ + * the current H5Eset_current_stack closes the stack to be set. + */ H5E_BEGIN_TRY { ret = H5Eclose_stack(estack_id); } H5E_END_TRY - if(ret >= 0) TEST_ERROR + if (ret >= 0) + TEST_ERROR - return(0); + return 0; error: - return(-1); + return -1; } /* end test_copy() */ /*------------------------------------------------------------------------- - * Function: close_error + * Function: close_error * - * Purpose: Closes error information. + * Purpose: Closes error information. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -597,19 +585,19 @@ static herr_t close_error(void) { /* Close major errors, let H5Eunregister_class close minor errors */ - if(H5Eclose_msg(ERR_MAJ_TEST) < 0) + if (H5Eclose_msg(ERR_MAJ_TEST) < 0) TEST_ERROR; - if(H5Eclose_msg(ERR_MAJ_IO) < 0) + if (H5Eclose_msg(ERR_MAJ_IO) < 0) TEST_ERROR; - if(H5Eclose_msg(ERR_MAJ_API) < 0) + if (H5Eclose_msg(ERR_MAJ_API) < 0) TEST_ERROR; - if(H5Eunregister_class(ERR_CLS) < 0) + if (H5Eunregister_class(ERR_CLS) < 0) TEST_ERROR; - if(H5Eunregister_class(ERR_CLS2) < 0) + if (H5Eunregister_class(ERR_CLS2) < 0) TEST_ERROR; return 0; @@ -620,19 +608,15 @@ error: /*------------------------------------------------------------------------- - * Function: test_filter_error + * Function: test_filter_error * - * Purpose: Make sure the error message prints out the filter name + * Purpose: Make sure the error message prints out the filter name * when the existent file is opened but the filter isn't * registered. The existent file was created with * gen_filters.c. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * 2 June 2011 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -640,71 +624,72 @@ static herr_t test_filter_error(const char *fname) { const char *pathname = H5_get_srcdir_filename(fname); /* Corrected test file name */ - hid_t file, dataset; /* handles */ + hid_t file = -1; + hid_t dataset = -1; int buf[20]; HDfprintf(stderr, "\nTesting error message during data reading when filter isn't registered\n"); /* Open the file */ - if((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + if ((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR; /* Open the regular dataset */ - if((dataset = H5Dopen2(file, DSET_FILTER_NAME, H5P_DEFAULT)) < 0) + if ((dataset = H5Dopen2(file, DSET_FILTER_NAME, H5P_DEFAULT)) < 0) TEST_ERROR; - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) >= 0) - TEST_ERROR; + if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) >= 0) + TEST_ERROR; /* Close/release resources */ - if(H5Dclose(dataset) < 0) + if (H5Dclose(dataset) < 0) TEST_ERROR - if(H5Fclose(file) < 0) + if (H5Fclose(file) < 0) TEST_ERROR return 0; error: return -1; -} +} /* end test_filter_error() */ /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test error API. - * - * Programmer: Raymond Lu - * July 10, 2003 + * Purpose: Test error API. * *------------------------------------------------------------------------- */ int main(void) { - hid_t file, fapl; - hid_t estack_id; - char filename[1024]; - const char *FUNC_main = "main"; + hid_t file = -1; + hid_t fapl = -1; + hid_t estack_id = -1; + char filename[1024]; + const char *FUNC_main = "main"; HDfprintf(stderr, " This program tests the Error API. There're supposed to be some error messages\n"); /* Initialize errors */ - if(init_error() < 0) + if (init_error() < 0) TEST_ERROR; - fapl = h5_fileaccess(); + if ((fapl = h5_fileaccess()) < 0) + TEST_ERROR; - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR; + h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); + if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR; /* Test error stack */ - if(error_stack() < 0) { + if (error_stack() < 0) { /* Push an error onto error stack */ - if(H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, - "Error stack test failed") < 0) TEST_ERROR; + if (H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, + "Error stack test failed") < 0) + TEST_ERROR; /* Delete an error from the top of error stack */ H5Epop(ERR_STACK, 1); @@ -724,34 +709,39 @@ main(void) } /* end if */ /* Test error API */ - if(test_error(file) < 0) { + if (test_error(file) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "Error test failed, %s", "it's wrong"); estack_id = H5Eget_current_stack(); H5Eprint2(estack_id, stderr); H5Eclose_stack(estack_id); - } /* end if */ + } /* Test pushing a very long error description */ - if(test_long_desc() < 0) TEST_ERROR; + if (test_long_desc() < 0) + TEST_ERROR; /* Test creating a new error stack */ - if(test_create() < 0) TEST_ERROR; + if (test_create() < 0) + TEST_ERROR; /* Test copying a new error stack */ - if(test_copy() < 0) TEST_ERROR; + if (test_copy() < 0) + TEST_ERROR; - if(H5Fclose(file) < 0) TEST_ERROR; + if (H5Fclose(file) < 0) + TEST_ERROR; /* Close error information */ - if(close_error() < 0) + if (close_error() < 0) TEST_ERROR; /* Test error message during data reading when filter isn't registered * Use default FAPL to avoid some VFD drivers by the check-vfd test because - * the test file was pre-generated. */ + * the test file was pre-generated. + */ h5_fixname(DATAFILE, H5P_DEFAULT, filename, sizeof filename); - if(test_filter_error(filename) < 0) + if (test_filter_error(filename) < 0) TEST_ERROR; h5_clean_files(FILENAME, fapl); diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1 index 0acd288..5b68002 100644 --- a/test/testfiles/error_test_1 +++ b/test/testfiles/error_test_1 @@ -53,7 +53,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered major: Data filters minor: Read failed - #005: (file name) line (number) in H5PL_load(): required dynamically loaded plugin filter '305' is not available + #005: (file name) line (number) in H5PL_load(): filter plugins disabled major: Plugin for dynamically loaded library minor: Unable to load metadata into cache diff --git a/tools/test/h5dump/errfiles/filter_fail.err b/tools/test/h5dump/errfiles/filter_fail.err index db21044..5276ab0 100644 --- a/tools/test/h5dump/errfiles/filter_fail.err +++ b/tools/test/h5dump/errfiles/filter_fail.err @@ -14,7 +14,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #004: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered major: Data filters minor: Read failed - #005: (file name) line (number) in H5PL_load(): required dynamically loaded plugin filter '312' is not available + #005: (file name) line (number) in H5PL_load(): filter plugins disabled major: Plugin for dynamically loaded library minor: Unable to load metadata into cache h5dump error: unable to print data -- cgit v0.12 From a0d40002a3a06974d8643f9e4edc6d0c58bb9844 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 20 Nov 2017 11:11:35 -0700 Subject: misc. code clean-up --- fortran/src/H5_ff.F90 | 140 ++++++++++++++++++++++---------------------- fortran/src/H5f90global.F90 | 11 ++-- 2 files changed, 75 insertions(+), 76 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index 79ab280..faa64a8 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -72,101 +72,101 @@ CONTAINS INTEGER, INTENT(OUT) :: error !***** ! - ! H5F flags + ! H5F flags declaration ! INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER :: H5F_flags(H5F_FLAGS_LEN) + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags ! - ! H5generic flags + ! H5generic flags declaration ! INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags ! - ! H5G flags + ! H5G flags declaration ! INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER :: H5G_flags(H5G_FLAGS_LEN) + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags ! - ! H5D flags + ! H5D flags declaration ! INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER :: H5D_flags(H5D_FLAGS_LEN) + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags ! - ! H5E flags + ! H5E flags declaration ! INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER :: H5E_flags(H5E_FLAGS_LEN) + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags ! - ! H5FD flags + ! H5FD flags declaration ! INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags ! - ! H5FD file drivers flags + ! H5FD file drivers flags declaration ! INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags ! - ! H5I flags + ! H5I flags declaration ! INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER :: H5I_flags(H5I_FLAGS_LEN) + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags ! - ! H5L flags + ! H5L flags declaration ! INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER :: H5L_flags(H5L_FLAGS_LEN) + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags ! - ! H5O flags + ! H5O flags declaration ! INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER :: H5o_flags(H5O_FLAGS_LEN) + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags ! - ! H5P flags + ! H5P flags declaration ! INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags ! - ! H5P integers flags + ! H5P integers flags declaration ! INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int ! - ! H5R flags + ! H5R flags declaration ! INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER :: H5R_flags(H5R_FLAGS_LEN) + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags ! - ! H5S flags + ! H5S flags declaration ! INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER :: H5S_flags(H5S_FLAGS_LEN) + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags ! - ! H5T flags + ! H5T flags declaration ! INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER :: H5T_flags(H5T_FLAGS_LEN) + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags ! - ! H5Z flags + ! H5Z flags declaration ! INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags ! - ! H5 Library flags + ! H5 Library flags declaration ! INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags INTERFACE INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & @@ -174,9 +174,9 @@ CONTAINS IMPORT :: HID_T IMPORT :: PREDEF_TYPES_LEN, FLOATING_TYPES_LEN, INTEGER_TYPES_LEN IMPLICIT NONE - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c END INTERFACE INTERFACE @@ -211,27 +211,27 @@ CONTAINS H5R_FLAGS_LEN, H5S_FLAGS_LEN, H5S_HID_FLAGS_LEN, H5S_HSIZE_FLAGS_LEN, & H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN, H5generic_haddr_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5D_flags(H5D_FLAGS_LEN) - INTEGER(SIZE_T) i_H5D_size_flags(H5D_SIZE_FLAGS_LEN) - INTEGER i_H5E_flags(H5E_FLAGS_LEN) - INTEGER(HID_T) i_H5E_hid_flags(H5E_HID_FLAGS_LEN) - INTEGER i_H5F_flags(H5F_FLAGS_LEN) - INTEGER i_H5G_flags(H5G_FLAGS_LEN) - INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) - INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - INTEGER i_H5I_flags(H5I_FLAGS_LEN) - INTEGER i_H5L_flags(H5L_FLAGS_LEN) - INTEGER i_H5O_flags(H5O_FLAGS_LEN) - INTEGER(HID_T) i_H5P_flags(H5P_FLAGS_LEN) - INTEGER i_H5P_flags_int(H5P_FLAGS_INT_LEN) - INTEGER i_H5R_flags(H5R_FLAGS_LEN) - INTEGER i_H5S_flags(H5S_FLAGS_LEN) - INTEGER(HID_T) i_H5S_hid_flags(H5S_HID_FLAGS_LEN) - INTEGER(HSIZE_T) i_H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER i_H5T_flags(H5T_FLAGS_LEN) - INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) - INTEGER i_H5generic_flags(H5generic_FLAGS_LEN) - INTEGER(HADDR_T) i_H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags + INTEGER(HID_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c END INTERFACE INTERFACE @@ -239,7 +239,7 @@ CONTAINS BIND(C,NAME='h5init1_flags_c') IMPORT :: H5LIB_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: i_H5LIB_flags END FUNCTION h5init1_flags_c END INTERFACE @@ -644,12 +644,12 @@ CONTAINS i_types, I_TYPES_LEN ) & BIND(C,NAME='h5close_types_c') IMPORT :: HID_T - INTEGER P_TYPES_LEN - INTEGER F_TYPES_LEN - INTEGER I_TYPES_LEN - INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types + INTEGER :: P_TYPES_LEN + INTEGER :: F_TYPES_LEN + INTEGER :: I_TYPES_LEN + INTEGER(HID_T), DIMENSION(1:P_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:F_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:I_TYPES_LEN) :: i_types END FUNCTION h5close_types_c END INTERFACE error = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index be7195c..ee8959e 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -50,7 +50,6 @@ MODULE H5GLOBAL END ENUM INTEGER, PARAMETER :: ENUM_T = KIND(enum_dtype) - ! Definitions for reference datatypes. ! If you change the value of these parameters, do not forget to change corresponding ! values in the H5f90.h file. @@ -85,9 +84,9 @@ MODULE H5GLOBAL ! These arrays need to be global because they are used in ! both h5open_f and in h5close_f - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types ! INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE @@ -410,7 +409,7 @@ MODULE H5GLOBAL INTEGER :: H5T_DIR_ASCEND_F INTEGER :: H5T_DIR_DESCEND_F ! - ! H5Z flags + ! H5Z flags declaration ! INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F @@ -433,7 +432,7 @@ MODULE H5GLOBAL INTEGER :: H5Z_SO_INT_F INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F ! - ! H5 Library flags + ! H5 Library flags declaration ! INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F -- cgit v0.12 From 51bb1d431a494937e7e01a3726f7646cd51fae24 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 20 Nov 2017 20:39:35 -0700 Subject: added public, private --- fortran/src/H5_ff.F90 | 208 +++++++++++++++++++++++++------------------------- 1 file changed, 106 insertions(+), 102 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index faa64a8..a7749f4 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -42,6 +42,107 @@ MODULE H5LIB USE H5GLOBAL IMPLICIT NONE + PRIVATE + ! + ! H5F flags declaration + ! + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags + ! + ! H5generic flags declaration + ! + INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags + + INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags + ! + ! H5G flags declaration + ! + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags + ! + ! H5D flags declaration + ! + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags + INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags + ! + ! H5E flags declaration + ! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags + INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags + ! + ! H5FD flags declaration + ! + INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags + ! + ! H5FD file drivers flags declaration + ! + INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags + ! + ! H5I flags declaration + ! + INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags + ! + ! H5L flags declaration + ! + INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags + ! + ! H5O flags declaration + ! + INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags + ! + ! H5P flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags + ! + ! H5P integers flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int + ! + ! H5R flags declaration + ! + INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags + ! + ! H5S flags declaration + ! + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags + INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags + INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags + ! + ! H5T flags declaration + ! + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags + ! + ! H5Z flags declaration + ! + INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags + ! + ! H5 Library flags declaration + ! + INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags + + PUBLIC :: h5open_f, h5close_f, h5get_libversion_f, h5dont_atexit_f, h5kind_to_type, h5offsetof + PUBLIC :: h5garbage_collect_f, h5check_version_f + CONTAINS !****s* H5LIB/h5open_f ! @@ -71,104 +172,8 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - ! - ! H5F flags declaration - ! - INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags - ! - ! H5generic flags declaration - ! - INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags - - INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags - ! - ! H5G flags declaration - ! - INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags - ! - ! H5D flags declaration - ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags - INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags - ! - ! H5E flags declaration - ! - INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags - INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags - ! - ! H5FD flags declaration - ! - INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags - ! - ! H5FD file drivers flags declaration - ! - INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags - ! - ! H5I flags declaration - ! - INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags - ! - ! H5L flags declaration - ! - INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags - ! - ! H5O flags declaration - ! - INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags - ! - ! H5P flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags - ! - ! H5P integers flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int - ! - ! H5R flags declaration - ! - INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags - ! - ! H5S flags declaration - ! - INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags - INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags - INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags - ! - ! H5T flags declaration - ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags - ! - ! H5Z flags declaration - ! - INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags - ! - ! H5 Library flags declaration - ! - INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags - INTERFACE + INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & BIND(C,NAME='h5init_types_c') IMPORT :: HID_T @@ -178,8 +183,7 @@ CONTAINS INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & i_H5D_size_flags,& i_H5E_flags, & @@ -233,16 +237,16 @@ CONTAINS INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init1_flags_c( i_H5LIB_flags ) & BIND(C,NAME='h5init1_flags_c') IMPORT :: H5LIB_FLAGS_LEN IMPLICIT NONE INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: i_H5LIB_flags END FUNCTION h5init1_flags_c - END INTERFACE + END INTERFACE + error = h5init_types_c(predef_types, floating_types, integer_types) H5T_NATIVE_INTEGER_KIND(1:5) = predef_types(1:5) -- cgit v0.12 From bdd2d3a1beef336e1835332763b9711d2fb31a8c Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 20 Nov 2017 21:01:43 -0700 Subject: misc clean-up --- fortran/src/H5_ff.F90 | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index a7749f4..db57f03 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -123,7 +123,7 @@ MODULE H5LIB INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags ! ! H5T flags declaration ! @@ -166,7 +166,7 @@ CONTAINS ! ! Removed call to h5open_c since this may cause a problem for an ! application that uses HDF5 library outside HDF5 Fortran APIs. -! October 13, 2011 +! October 13, 2011 ! Fortran90 Interface: SUBROUTINE h5open_f(error) IMPLICIT NONE @@ -179,9 +179,9 @@ CONTAINS IMPORT :: HID_T IMPORT :: PREDEF_TYPES_LEN, FLOATING_TYPES_LEN, INTEGER_TYPES_LEN IMPLICIT NONE - INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & @@ -215,26 +215,26 @@ CONTAINS H5R_FLAGS_LEN, H5S_FLAGS_LEN, H5S_HID_FLAGS_LEN, H5S_HSIZE_FLAGS_LEN, & H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN, H5generic_haddr_FLAGS_LEN IMPLICIT NONE - INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags - INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags - INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags - INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags - INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags - INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags - INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags - INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags - INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags - INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags - INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags - INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags - INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int - INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags - INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags - INTEGER(HID_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags - INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags - INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags - INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags - INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags + INTEGER , DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags + INTEGER(SIZE_T) , DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags + INTEGER , DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags + INTEGER(HID_T) , DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags + INTEGER , DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags + INTEGER , DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags + INTEGER , DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags + INTEGER(HID_T) , DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags + INTEGER , DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags + INTEGER , DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags + INTEGER , DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags + INTEGER(HID_T) , DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags + INTEGER , DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int + INTEGER , DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags + INTEGER , DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags + INTEGER(HID_T) , DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags + INTEGER , DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags + INTEGER , DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags + INTEGER , DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c -- cgit v0.12 From cd72e02a336369ee25a26d4ad63d4c498e613f70 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 01:22:21 -0800 Subject: Fixed Windows code in H5PLpath.c --- src/H5PLpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PLpath.c b/src/H5PLpath.c index d8e82f8..972f1d0 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -755,7 +755,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo continue; /* attempt to open the dynamic library as a filter library */ - if (H5PL__open(path, search_params->type, search_params->search_key.id, found, plugin_info) < 0) + if (H5PL__open(path, search_params->type, search_params->key, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) -- cgit v0.12 From 20bb11b52640befc4a0073520b23d9e49bf3e96c Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 10:38:15 -0800 Subject: Fixed an uninitialized filter callback struct in H5Dchunk.c and unified the naming and initialization of said struct throughout the library. This was causing a crash on VS2015 in debug mode when the debug heap complained. Fixes HDFFV-10330. --- release_docs/RELEASE.txt | 15 +++++++++ src/H5Dchunk.c | 76 ++++++++++++++++++++++------------------- src/H5HFcache.c | 88 +++++++++++++++++++++++++++--------------------- src/H5HFhuge.c | 12 +++++-- src/H5Z.c | 62 +++++++++++++++++----------------- src/H5Zpublic.h | 20 +++++------ 6 files changed, 159 insertions(+), 114 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a1b59b1..7498d01 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -179,6 +179,21 @@ Bug Fixes since HDF5-1.10.1 release (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) + - An uninitialized struct could cause a memory access error when using + variable-length or reference types in a compressed, chunked dataset. + + A struct containing a callback function pointer and a pointer to some + associated data was used before initialization. This could cause a + memory access error and system crash. This could only occur under + unusual conditions when using variable-lenth and reference types in + a compressed, chunked dataset. + + On recent versions of Visual Studio, when built in debug mode, the + debug heap will complain and cause a crash if the code in question + is executed (this will cause the objcopy test to fail). + + (DER - 2017/11/21, HDFFV-10330) + Configuration ------------- - cmake diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 0d7fcc9..be3b678 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -5661,7 +5661,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* needed for commpressed variable length data */ hbool_t must_filter = FALSE; /* Whether chunk must be filtered during copy */ size_t nbytes; /* Size of chunk in file (in bytes) */ - H5Z_cb_t cb_struct; /* Filter failure callback struct */ + H5Z_cb_t filter_cb; /* Filter failure callback struct */ int ret_value = H5_ITER_CONT; /* Return value */ @@ -5670,6 +5670,10 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Get 'size_t' local value for number of bytes in chunk */ H5_CHECKED_ASSIGN(nbytes, size_t, chunk_rec->nbytes, uint32_t); + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Check for filtered chunks */ /* Check for an edge chunk that is not filtered */ if(pline && pline->nused) { @@ -5716,7 +5720,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDassert(!H5F_addr_defined(chunk_rec->chunk_addr)); HDmemcpy(buf, udata->chunk, nbytes); udata->chunk = NULL; - } else { + } + else { H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ unsigned idx; /* Index of chunk in cache, if present */ unsigned u; /* Counter */ @@ -5748,7 +5753,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5_CHECKED_ASSIGN(nbytes, size_t, shared_fo->layout.u.chunk.size, uint32_t); HDmemcpy(buf, ent->chunk, nbytes); - } else { + } + 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") @@ -5759,8 +5765,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) 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 */ - if(H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, cb_struct, &nbytes, &buf_size, &buf) < 0) + if(H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &buf_size, &buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "data pipeline read failed") } /* end if */ @@ -5822,7 +5827,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* 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) + if(H5Z_pipeline(pline, 0, &(udata_dst.filter_mask), H5Z_NO_EDC, filter_cb, &nbytes, &buf_size, &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 */ @@ -6707,46 +6712,49 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5_CHECKED_ASSIGN(nbytes, size_t, chunk_rec->nbytes, uint32_t); chunk_addr = chunk_rec->chunk_addr; - if(new_idx_info->pline->nused && + if (new_idx_info->pline->nused && (new_idx_info->layout->flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && (H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, new_idx_info->layout->dim, chunk_rec->scaled, udata->dset_dims))) { - /* This is a partial non-filtered edge chunk */ - /* Convert the chunk to a filtered edge chunk for v1 B-tree chunk index */ - unsigned filter_mask = chunk_rec->filter_mask; - H5Z_cb_t cb_struct; /* Filter failure callback struct */ - size_t read_size = nbytes; /* Bytes to read */ + /* This is a partial non-filtered edge chunk */ + /* Convert the chunk to a filtered edge chunk for v1 B-tree chunk index */ - HDassert(read_size == new_idx_info->layout->size); + unsigned filter_mask = chunk_rec->filter_mask; + H5Z_cb_t filter_cb; /* Filter failure callback struct */ + size_t read_size = nbytes; /* Bytes to read */ + + HDassert(read_size == new_idx_info->layout->size); - cb_struct.func = NULL; /* no callback function when failed */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ - /* Allocate buffer for chunk data */ - if(NULL == (buf = H5MM_malloc(read_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for raw data chunk") + /* Allocate buffer for chunk data */ + if (NULL == (buf = H5MM_malloc(read_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for raw data chunk") - /* Read the non-filtered edge chunk */ - if(H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, H5AC_rawdata_dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + /* Read the non-filtered edge chunk */ + if (H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, H5AC_rawdata_dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") - /* Pass the chunk through the pipeline */ - if(H5Z_pipeline(new_idx_info->pline, 0, &filter_mask, H5Z_NO_EDC, cb_struct, &nbytes, &read_size, &buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") + /* Pass the chunk through the pipeline */ + if (H5Z_pipeline(new_idx_info->pline, 0, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &read_size, &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(nbytes > ((size_t)0xffffffff)) - HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, H5_ITER_ERROR, "chunk too large for 32-bit length") + if (nbytes > ((size_t)0xffffffff)) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, H5_ITER_ERROR, "chunk too large for 32-bit length") #endif /* H5_SIZEOF_SIZE_T > 4 */ - /* Allocate space for the filtered chunk */ - if((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, new_idx_info->dxpl_id, (hsize_t)nbytes)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, H5_ITER_ERROR, "file allocation failed for filtered chunk") - HDassert(H5F_addr_defined(chunk_addr)); + /* Allocate space for the filtered chunk */ + if ((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, new_idx_info->dxpl_id, (hsize_t)nbytes)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, H5_ITER_ERROR, "file allocation failed for filtered chunk") + HDassert(H5F_addr_defined(chunk_addr)); - /* Write the filtered chunk to disk */ - if(H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") + /* Write the filtered chunk to disk */ + if (H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") } /* end if */ /* Set up chunk information for insertion to chunk index */ @@ -6758,11 +6766,11 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) insert_udata.common.storage = new_idx_info->storage; /* Insert chunk into the v1 B-tree chunk index */ - if((new_idx_info->storage->ops->insert)(new_idx_info, &insert_udata, NULL) < 0) + if ((new_idx_info->storage->ops->insert)(new_idx_info, &insert_udata, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert chunk addr into index") done: - if(buf) + if (buf) H5MM_xfree(buf); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFcache.c b/src/H5HFcache.c index f957e2e..069bf17 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -1671,9 +1671,13 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) HGOTO_DONE(TRUE); if(hdr->filter_len > 0) { - size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ - unsigned filter_mask; /* Excluded filters for direct block */ - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ + unsigned filter_mask; /* Excluded filters for direct block */ + H5Z_cb_t filter_cb; /* Filter callback structure */ + + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ /* Allocate buffer to perform I/O filtering on and copy image into * it. Must do this as H5Z_pipeline() may re-size the buffer @@ -1682,17 +1686,17 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) if(NULL == (read_buf = H5MM_malloc(len))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for pipeline buffer") - /* Set up parameters for filter pipeline */ - nbytes = len; - filter_mask = udata->filter_mask; + /* Set up parameters for filter pipeline */ + nbytes = len; + filter_mask = udata->filter_mask; HDmemcpy(read_buf, image, len); - /* Push direct block data through I/O filter pipeline */ - if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed") + /* Push direct block data through I/O filter pipeline */ + if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed") /* Update info about direct block */ - udata->decompressed = TRUE; + udata->decompressed = TRUE; len = nbytes; } /* end if */ else @@ -1818,45 +1822,49 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, udata->dblk = NULL; } /* end if */ else { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ unsigned filter_mask; /* Excluded filters for direct block */ /* Sanity check */ - HDassert(udata->dblk == NULL); + HDassert(udata->dblk == NULL); - /* Allocate buffer to perform I/O filtering on and copy image into - * it. Must do this as H5Z_pipeline() may resize the buffer - * provided to it. - */ - if(NULL == (read_buf = H5MM_malloc(len))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "memory allocation failed for pipeline buffer") + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + + /* Allocate buffer to perform I/O filtering on and copy image into + * it. Must do this as H5Z_pipeline() may resize the buffer + * provided to it. + */ + if (NULL == (read_buf = H5MM_malloc(len))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "memory allocation failed for pipeline buffer") /* Copy compressed image into buffer */ - HDmemcpy(read_buf, image, len); + HDmemcpy(read_buf, image, len); - /* Push direct block data through I/O filter pipeline */ - nbytes = len; - filter_mask = udata->filter_mask; - if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, NULL, "output pipeline failed") + /* Push direct block data through I/O filter pipeline */ + nbytes = len; + filter_mask = udata->filter_mask; + if (H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, NULL, "output pipeline failed") - /* Sanity check */ - HDassert(nbytes == dblock->size); + /* Sanity check */ + HDassert(nbytes == dblock->size); - /* Copy un-filtered data into block's buffer */ - HDmemcpy(dblock->blk, read_buf, dblock->size); - } /* end if */ + /* Copy un-filtered data into block's buffer */ + HDmemcpy(dblock->blk, read_buf, dblock->size); + } /* end if */ } /* end if */ else { /* Sanity checks */ - HDassert(udata->dblk == NULL); - HDassert(!udata->decompressed); + HDassert(udata->dblk == NULL); + HDassert(!udata->decompressed); - /* Allocate block buffer */ -/* XXX: Change to using free-list factories */ - if(NULL == (dblock->blk = H5FL_BLK_MALLOC(direct_block, (size_t)dblock->size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + /* Allocate block buffer */ + /* XXX: Change to using free-list factories */ + if (NULL == (dblock->blk = H5FL_BLK_MALLOC(direct_block, (size_t)dblock->size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy image to dblock->blk */ HDassert(dblock->size == len); @@ -1895,9 +1903,9 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, /* Decode checksum on direct block, if requested */ if(hdr->checksum_dblocks) { - uint32_t stored_chksum; /* Metadata checksum value */ + uint32_t stored_chksum; /* Metadata checksum value */ - /* checksum verification already done in verify_chksum cb */ + /* checksum verification already done in verify_chksum cb */ /* Metadata checksum */ UINT32DECODE(image, stored_chksum); @@ -2188,10 +2196,14 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used */ unsigned filter_mask = 0; /* Filter mask for block */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Allocate buffer to perform I/O filtering on */ write_size = dblock->size; if(NULL == (write_buf = H5MM_malloc(write_size))) diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index b2a1e68..350100e 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -345,9 +345,13 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); /* Check for I/O pipeline filter on heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Allocate buffer to perform I/O filtering on */ write_size = obj_size; if(NULL == (write_buf = H5MM_malloc(write_size))) @@ -773,10 +777,14 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check for I/O pipeline filter on heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t read_size; /* Object's size in the file */ size_t nbytes; /* Number of bytes used */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* De-filter the object */ read_size = nbytes = obj_size; if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &read_size, &read_buf) < 0) diff --git a/src/H5Z.c b/src/H5Z.c index 1e7cd79..89c97d4 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -275,7 +275,7 @@ done: * Function: H5Z_register * * Purpose: Same as the public version except this one allows filters - * to be set for predefined method numbers nused > 0); + HDassert(pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) @@ -926,7 +926,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert (pline->nused > 0); + HDassert(pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) @@ -1200,12 +1200,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); - HDassert (filter_mask); - HDassert (nbytes && *nbytes>0); - HDassert (buf_size && *buf_size>0); - HDassert (buf && *buf); - HDassert (!pline || pline->nused0); + HDassert(buf_size && *buf_size>0); + HDassert(buf && *buf); + HDassert(!pline || pline->nused < H5Z_MAX_NFILTERS); if (pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */ for (i = pline->nused; i > 0; --i) { @@ -1235,7 +1235,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* 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; @@ -1247,7 +1247,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) else HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") - } /* end if */ + } } /* end if */ fclass = &H5Z_table_g[fclass_idx]; @@ -1263,11 +1263,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, #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; + 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) + 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; @@ -1303,7 +1304,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, #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; + if (0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif if (0 == new_nbytes) { if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { @@ -1345,8 +1347,8 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(NULL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -1384,8 +1386,8 @@ H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -1421,7 +1423,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert (pline); + HDassert(pline); /* Iterate through all the filters in pipeline */ for (i = 0; i < pline->nused; i++) { @@ -1459,8 +1461,8 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* if the pipeline has no filters, just return */ if (pline->nused == 0) @@ -1470,7 +1472,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) if (H5Z_FILTER_ALL == filter) { if (H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFREE, FAIL, "can't release pipeline info") - } /* end if */ + } /* Delete filter */ else { size_t idx; /* Index of filter in pipeline */ @@ -1481,7 +1483,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) if (pline->filter[idx].id == filter) { found = TRUE; break; - } /* end if */ + } /* filter was not found in the pipeline */ if (!found) @@ -1489,11 +1491,11 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) /* Free information for deleted filter */ if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) - HDassert ((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); + HDassert((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); if (pline->filter[idx].name != pline->filter[idx]._name) pline->filter[idx].name = (char *)H5MM_xfree(pline->filter[idx].name); if (pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) - HDassert (pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); + HDassert(pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); if (pline->filter[idx].cd_values != pline->filter[idx]._cd_values) pline->filter[idx].cd_values = (unsigned *)H5MM_xfree(pline->filter[idx].cd_values); @@ -1506,8 +1508,8 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) pline->filter[idx].name = pline->filter[idx]._name; if (pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) pline->filter[idx].cd_values = pline->filter[idx]._cd_values; - } /* end for */ - } /* end if */ + } + } /* Decrement number of used filters */ pline->nused--; diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index f6b313e..fcb2d37 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -129,8 +129,8 @@ typedef H5Z_cb_return_t (*H5Z_filter_func_t)(H5Z_filter_t filter, void* buf, /* Structure for filter callback property */ typedef struct H5Z_cb_t { - H5Z_filter_func_t func; - void* op_data; + H5Z_filter_func_t func; + void *op_data; } H5Z_cb_t; #ifdef __cplusplus @@ -206,14 +206,14 @@ typedef size_t (*H5Z_func_t)(unsigned int flags, size_t cd_nelmts, * contain a pointers to the filter function and timing statistics. */ typedef struct H5Z_class2_t { - int version; /* Version number of the H5Z_class_t struct */ - H5Z_filter_t id; /* Filter ID number */ - unsigned encoder_present; /* Does this filter have an encoder? */ - unsigned decoder_present; /* Does this filter have a decoder? */ - const char *name; /* Comment for debugging */ - H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ - H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ - H5Z_func_t filter; /* The actual filter function */ + int version; /* Version number of the H5Z_class_t struct */ + H5Z_filter_t id; /* Filter ID number */ + unsigned encoder_present; /* Does this filter have an encoder? */ + unsigned decoder_present; /* Does this filter have a decoder? */ + const char *name; /* Comment for debugging */ + H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ + H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ + H5Z_func_t filter; /* The actual filter function */ } H5Z_class2_t; H5_DLL herr_t H5Zregister(const void *cls); -- cgit v0.12 From 22e58124ec26da5ffe2833f53c8d73ee9edf0570 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 13:20:33 -0800 Subject: Made a dcpl layout struct in H5Z.c dynamic to quiet a stack size warning. --- src/H5Z.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 89c97d4..6f173b2 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -752,6 +752,7 @@ 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 */ FUNC_ENTER_NOAPI_NOINIT @@ -761,19 +762,22 @@ 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 */ + H5P_genplist_t *dc_plist; /* Dataset creation property list object */ + + /* Get memory for the layout */ + if (NULL == (dcpl_layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate dcpl layout buffer") /* 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 */ @@ -787,28 +791,31 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type size_t u; /* Local index variable */ /* Create a dataspace 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 */ if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { - (void)H5S_close (space); + (void)H5S_close(space); HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") - } /* end if */ + } /* Make the callbacks */ if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") - } /* end if */ - } /* end if */ - } /* end if */ + } + } + } 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 8cb45292110453354afd78b7cf1da50db2341014 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 26 Nov 2017 18:13:18 -0800 Subject: Fixed misc Warnings flagged by VS2017. --- examples/h5_cmprss.c | 1 - src/H5Dio.c | 4 +- src/H5MF.c | 5 +- src/H5Tdbg.c | 227 +++++++++++++++++++++++++-------------------------- src/H5system.c | 2 +- test/cache_tagging.c | 13 +-- test/tarray.c | 24 +++--- test/tattr.c | 14 ++-- test/tchecksum.c | 2 +- test/testhdf5.h | 1 + test/tfile.c | 6 +- test/th5o.c | 4 +- test/theap.c | 30 +++---- test/tid.c | 18 ++-- test/titerate.c | 18 ++-- test/tmisc.c | 36 ++++---- test/trefstr.c | 26 +++--- test/tselect.c | 130 ++++++++++++++--------------- test/tskiplist.c | 142 ++++++++++++++++---------------- test/ttst.c | 18 ++-- test/tvltypes.c | 6 +- 21 files changed, 364 insertions(+), 363 deletions(-) diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index ebc7712..b51ec44 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -36,7 +36,6 @@ int main () { hsize_t dims[2]; hsize_t cdims[2]; - int idx; int i,j, numfilt; int buf[DIM0][DIM1]; int rbuf [DIM0][DIM1]; diff --git a/src/H5Dio.c b/src/H5Dio.c index 104a632..280d602 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -962,7 +962,9 @@ const io_info->using_mpi_vfd = H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI); #endif /* H5_HAVE_PARALLEL */ -done: +#ifdef H5_DEBUG_BUILD + done: +#endif /* H5_DEBUG_BUILD */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__ioinfo_init() */ diff --git a/src/H5MF.c b/src/H5MF.c index 49c7b77..7e06654 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -3247,7 +3247,6 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* for self referential FSMs */ haddr_t eoa_post_fsm_fsalloc; /* eoa post file space allocation */ /* for self referential FSMs */ - H5FS_stat_t fs_stat; /* Information for hdr FSM */ H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ hbool_t reset_ring = FALSE; /* Whether we set the ring */ @@ -3310,6 +3309,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) reset_ring = TRUE; #ifndef NDEBUG +{ + H5FS_stat_t fs_stat; /* Information for hdr FSM */ + /* Verify that sm_hdr_fspace is floating if it exists */ if(sm_hdr_fspace) { /* Query free space manager info for this type */ @@ -3357,6 +3359,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) HDassert(fs_stat.alloc_sect_size == 0); } /* end if */ } /* end if */ +} #endif /* NDEBUG */ /* Free the space in the metadata aggregator. Do this via the diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index f434543..eb648f3 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -32,9 +32,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Tpkg.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Tpkg.h" /* Datatypes */ /****************/ @@ -74,28 +74,21 @@ /*------------------------------------------------------------------------- - * Function: H5T__print_stats + * Function: H5T__print_stats * - * Purpose: Print statistics about a conversion path. Statistics are - * printed only if all the following conditions are true: + * Purpose: Print statistics about a conversion path. Statistics are + * printed only if all the following conditions are true: * - * 1. The library was compiled with H5T_DEBUG defined. - * 2. Data type debugging is turned on at run time. - * 3. The path was called at least one time. + * 1. The library was compiled with H5T_DEBUG defined. + * 2. Data type debugging is turned on at run time. + * 3. The path was called at least one time. * - * The optional NPRINT argument keeps track of the number of - * conversions paths for which statistics have been shown. If - * its value is zero then table headers are printed before the - * first line of output. + * The optional NPRINT argument keeps track of the number of + * conversions paths for which statistics have been shown. If + * its value is zero then table headers are printed before the + * first line of output. * - * Return: Success: non-negative - * - * Failure: negative - * - * Programmer: Robb Matzke - * Monday, December 14, 1998 - * - * Modifications: + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -110,34 +103,34 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* FUNC_ENTER_PACKAGE_NOERR #ifdef H5T_DEBUG - if(H5DEBUG(T) && path->stats.ncalls > 0) { - if(nprint && 0 == (*nprint)++) { - HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "Conversion", "Elmts", "Calls", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "----------", "-----", "-----", "----", - "------", "-------", "---------"); - } - if(path->src && path->dst) + if (H5DEBUG(T) && path->stats.ncalls > 0) { + if (nprint && 0 == (*nprint)++) { + HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "Conversion", "Elmts", "Calls", "User", + "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "----------", "-----", "-----", "----", + "------", "-------", "---------"); + } + if (path->src && path->dst) nbytes = MAX(H5T_get_size(path->src), H5T_get_size(path->dst)); - else if(path->src) + else if (path->src) nbytes = H5T_get_size(path->src); - else if(path->dst) + else if (path->dst) nbytes = H5T_get_size(path->dst); else nbytes = 0; - nbytes *= path->stats.nelmts; - H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime); - HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", - path->name, - path->stats.nelmts, - path->stats.ncalls, - path->stats.timer.utime, - path->stats.timer.stime, - path->stats.timer.etime, - bandwidth); + nbytes *= path->stats.nelmts; + H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime); + HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", + path->name, + path->stats.nelmts, + path->stats.ncalls, + path->stats.timer.utime, + path->stats.timer.stime, + path->stats.timer.etime, + bandwidth); } #endif FUNC_LEAVE_NOAPI(SUCCEED) @@ -145,24 +138,20 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* /*------------------------------------------------------------------------- - * Function: H5T_debug - * - * Purpose: Prints information about a data type. + * Function: H5T_debug * - * Return: Non-negative on success/Negative on failure + * Purpose: Prints information about a data type. * - * Programmer: Robb Matzke - * Wednesday, January 7, 1998 - * - * Modifications: + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5T_debug(const H5T_t *dt, FILE *stream) { - const char *s1 = "", *s2 = ""; - unsigned i; + const char *s1 = ""; + const char *s2 = ""; + unsigned i; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -171,7 +160,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) HDassert(dt); HDassert(stream); - switch(dt->shared->type) { + switch (dt->shared->type) { case H5T_NO_CLASS: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); break; @@ -221,9 +210,9 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: s1 = ""; break; - } /* end switch */ + } /* end switch */ - switch(dt->shared->state) { + switch (dt->shared->state) { case H5T_STATE_TRANSIENT: s2 = "[transient]"; break; @@ -245,14 +234,14 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; default: HDassert(0 && "This Should never be executed!"); - } /* end switch */ + } /* end switch */ - fprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); + HDfprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); - if(H5T_IS_ATOMIC(dt->shared)) { - uint64_t tmp; + if (H5T_IS_ATOMIC(dt->shared)) { + uint64_t tmp; - switch(dt->shared->u.atomic.order) { + switch (dt->shared->u.atomic.order) { case H5T_ORDER_ERROR: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "order error"); break; @@ -277,17 +266,16 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: s1 = "order?"; break; - } /* end switch */ + } /* end switch */ + + HDfprintf(stream, ", %s", s1); - fprintf(stream, ", %s", s1); + if (dt->shared->u.atomic.offset) + HDfprintf(stream, ", offset=%lu", (unsigned long) (dt->shared->u.atomic.offset)); + if (dt->shared->u.atomic.prec != 8 * dt->shared->size) + HDfprintf(stream, ", prec=%lu", (unsigned long) (dt->shared->u.atomic.prec)); - if(dt->shared->u.atomic.offset) - fprintf(stream, ", offset=%lu", - (unsigned long) (dt->shared->u.atomic.offset)); - if(dt->shared->u.atomic.prec != 8 * dt->shared->size) - fprintf(stream, ", prec=%lu", - (unsigned long) (dt->shared->u.atomic.prec)); - switch(dt->shared->type) { + switch (dt->shared->type) { case H5T_NO_CLASS: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); break; @@ -313,7 +301,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) } /* end switch */ if(s1) - fprintf(stream, ", %s", s1); + HDfprintf(stream, ", %s", s1); break; case H5T_FLOAT: @@ -339,23 +327,24 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; } /* end switch */ - fprintf(stream, ", sign=%lu+1", + HDfprintf(stream, ", sign=%lu+1", (unsigned long)(dt->shared->u.atomic.u.f.sign)); - fprintf(stream, ", mant=%lu+%lu (%s)", + HDfprintf(stream, ", mant=%lu+%lu (%s)", (unsigned long)(dt->shared->u.atomic.u.f.mpos), (unsigned long)(dt->shared->u.atomic.u.f.msize), s1); - fprintf(stream, ", exp=%lu+%lu", + HDfprintf(stream, ", exp=%lu+%lu", (unsigned long)(dt->shared->u.atomic.u.f.epos), (unsigned long)(dt->shared->u.atomic.u.f.esize)); tmp = dt->shared->u.atomic.u.f.ebias >> 32; - if(tmp) { + if (tmp) { size_t hi = (size_t)tmp; size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); - fprintf(stream, " bias=0x%08lx%08lx", + HDfprintf(stream, " bias=0x%08lx%08lx", (unsigned long)hi, (unsigned long)lo); - } else { + } + else { size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); - fprintf(stream, " bias=0x%08lx", (unsigned long)lo); + HDfprintf(stream, " bias=0x%08lx", (unsigned long)lo); } break; @@ -372,69 +361,73 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: /* No additional info */ break; - } /* end switch */ - } else if(H5T_COMPOUND == dt->shared->type) { - /* Compound data type */ - for(i = 0; i < dt->shared->u.compnd.nmembs; i++) { - fprintf(stream, "\n\"%s\" @%lu", - dt->shared->u.compnd.memb[i].name, - (unsigned long)(dt->shared->u.compnd.memb[i].offset)); - fprintf(stream, " "); - H5T_debug(dt->shared->u.compnd.memb[i].type, stream); - } /* end for */ - fprintf(stream, "\n"); - } else if(H5T_VLEN == dt->shared->type) { - switch(dt->shared->u.vlen.loc) { + } /* end switch */ + } + else if (H5T_COMPOUND == dt->shared->type) { + /* Compound data type */ + for (i = 0; i < dt->shared->u.compnd.nmembs; i++) { + HDfprintf(stream, "\n\"%s\" @%lu", + dt->shared->u.compnd.memb[i].name, + (unsigned long)(dt->shared->u.compnd.memb[i].offset)); + HDfprintf(stream, " "); + H5T_debug(dt->shared->u.compnd.memb[i].type, stream); + } /* end for */ + HDfprintf(stream, "\n"); + } + else if (H5T_VLEN == dt->shared->type) { + switch (dt->shared->u.vlen.loc) { case H5T_LOC_BADLOC: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "invalid datatype location"); break; case H5T_LOC_MEMORY: - fprintf(stream, ", loc=memory"); + HDfprintf(stream, ", loc=memory"); break; case H5T_LOC_DISK: - fprintf(stream, ", loc=disk"); + HDfprintf(stream, ", loc=disk"); break; case H5T_LOC_MAXLOC: default: - fprintf(stream, ", loc=UNKNOWN"); + HDfprintf(stream, ", loc=UNKNOWN"); break; } /* end switch */ - if(H5T_IS_VL_STRING(dt->shared)) + if (H5T_IS_VL_STRING(dt->shared)) /* Variable length string datatype */ - fprintf(stream, ", variable-length"); + HDfprintf(stream, ", variable-length"); else { /* Variable length sequence datatype */ - fprintf(stream, " VLEN "); + HDfprintf(stream, " VLEN "); H5T_debug(dt->shared->parent, stream); - fprintf(stream, "\n"); + HDfprintf(stream, "\n"); } /* end else */ - } else if(H5T_ENUM == dt->shared->type) { + } + else if (H5T_ENUM == dt->shared->type) { size_t base_size; - /* Enumeration data type */ - fprintf(stream, " "); - H5T_debug(dt->shared->parent, stream); - base_size = dt->shared->parent->shared->size; - for(i = 0; i < dt->shared->u.enumer.nmembs; i++) { + /* Enumeration data type */ + HDfprintf(stream, " "); + H5T_debug(dt->shared->parent, stream); + base_size = dt->shared->parent->shared->size; + for (i = 0; i < dt->shared->u.enumer.nmembs; i++) { size_t k; - fprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); - for(k = 0; k < base_size; k++) - fprintf(stream, "%02lx", - (unsigned long)(dt->shared->u.enumer.value + (i * base_size) + k)); - } /* end for */ - fprintf(stream, "\n"); - } else if(H5T_OPAQUE == dt->shared->type) { - fprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); - } else { - /* Unknown */ - fprintf(stream, "unknown class %d\n", (int)(dt->shared->type)); + HDfprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); + for (k = 0; k < base_size; k++) + HDfprintf(stream, "%02lx", (unsigned long)(dt->shared->u.enumer.value + (i * base_size) + k)); + } /* end for */ + HDfprintf(stream, "\n"); + } + else if (H5T_OPAQUE == dt->shared->type) { + HDfprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); + } + else { + /* Unknown */ + HDfprintf(stream, "unknown class %d\n", (int)(dt->shared->type)); } - fprintf(stream, "}"); + HDfprintf(stream, "}"); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5system.c b/src/H5system.c index a1cdf19..a8726c2 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -977,7 +977,7 @@ Wround(double arg) float Wroundf(float arg) { - return arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F); + return (float)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F)); } #endif /* H5_HAVE_WIN32_API */ diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 99ab49c..9c79968 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -3631,11 +3631,14 @@ error: static unsigned check_invalid_tag_application(void) { +#if H5C_DO_TAGGING_SANITY_CHECKS /* Variables */ H5F_t * f = NULL; - hid_t fid, dxpl_id = -1; + hid_t fid = -1; + hid_t dxpl_id = -1; haddr_t addr; H5HL_t * lheap = NULL; +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ /* Testing Macro */ TESTING("failure on invalid tag application"); @@ -3683,8 +3686,8 @@ check_invalid_tag_application(void) PASSED(); #else SKIPPED(); - printf(" test skipped because sanity checking on tag value is disabled.\n"); -#endif + HDprintf(" test skipped because sanity checking on tag value is disabled.\n"); +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ return 0; @@ -3791,10 +3794,10 @@ main(void) HDremove(FILENAME2); /* Return Errors */ - return(nerrs > 0); + return nerrs > 0; error: /* Return with Error */ - return(1); + return 1; } /* main */ diff --git a/test/tarray.c b/test/tarray.c index a35b8a3..b2e0ee7 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -679,7 +679,7 @@ test_array_compound_atomic(void) /* Check the 1st field's name */ mname = H5Tget_member_name(tid2, 0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname, "i") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); H5free_memory(mname); @@ -698,7 +698,7 @@ test_array_compound_atomic(void) /* Check the 2nd field's name */ mname = H5Tget_member_name(tid2, 1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname, "f") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); H5free_memory(mname); @@ -897,7 +897,7 @@ test_array_compound_array(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid2,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -916,7 +916,7 @@ test_array_compound_array(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid2,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1604,7 +1604,7 @@ test_array_bkg(void) /* Initialize the data */ /* ------------------- */ dtsinfo = (CmpDTSinfo *)HDmalloc(sizeof(CmpDTSinfo)); - CHECK(dtsinfo, NULL, "HDmalloc"); + CHECK_PTR(dtsinfo, "HDmalloc"); HDmemset(dtsinfo, 0, sizeof(CmpDTSinfo)); for (i = 0; i < LENGTH; i++) { for (j = 0; j < ALEN; j++) { @@ -1927,7 +1927,7 @@ test_compat(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid1,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1946,7 +1946,7 @@ test_compat(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid1,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1965,7 +1965,7 @@ test_compat(void) /* Check the 3rd field's name */ mname=H5Tget_member_name(tid1,2); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -2009,7 +2009,7 @@ test_compat(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid1,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2028,7 +2028,7 @@ test_compat(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid1,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2073,7 +2073,7 @@ test_compat(void) /* Check the 3rd field's name */ mname=H5Tget_member_name(tid1,2); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2118,7 +2118,7 @@ test_compat(void) /* Check the 4th field's name */ mname=H5Tget_member_name(tid1,3); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"d")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); diff --git a/test/tattr.c b/test/tattr.c index 3786d0d..2d333e9 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -277,7 +277,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size + 1), sizeof(char)); - CHECK(attr_name, NULL, "HDcalloc"); + CHECK_PTR(attr_name, "HDcalloc"); if(attr_name) { ret = (herr_t)H5Aget_name(attr, (size_t)(attr_name_size + 1), attr_name); @@ -313,7 +313,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char)); - CHECK(attr_name, NULL, "HDcalloc"); + CHECK_PTR(attr_name, "HDcalloc"); if(attr_name) { ret = (herr_t)H5Aget_name(attr2, (size_t)(attr_name_size + 1), attr_name); @@ -6862,7 +6862,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = max_compact * 2; visited = (hbool_t*)HDmalloc(sizeof(hbool_t) * iter_info.max_visit); - CHECK(visited, NULL, "HDmalloc"); + CHECK_PTR(visited, "HDmalloc"); iter_info.visited = visited; /* Loop over operating on different indices on link fields */ @@ -8040,7 +8040,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -8371,7 +8371,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -8817,7 +8817,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -9186,7 +9186,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ diff --git a/test/tchecksum.c b/test/tchecksum.c index febaacc..ffbab45 100644 --- a/test/tchecksum.c +++ b/test/tchecksum.c @@ -187,7 +187,7 @@ test_chksum_large(void) /* Allocate the buffer */ large_buf = (uint8_t *)HDmalloc((size_t)BUF_LEN); - CHECK(large_buf, NULL, "HDmalloc"); + CHECK_PTR(large_buf, "HDmalloc"); /* Initialize buffer w/known data */ for(u = 0; u < BUF_LEN; u++) diff --git a/test/testhdf5.h b/test/testhdf5.h index 2cbe6c6..41675cf 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -54,6 +54,7 @@ } \ } +/* Check that a pointer is valid (i.e.: not NULL) */ #define CHECK_PTR(ret,where) { \ if (VERBOSE_HI) { \ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ diff --git a/test/tfile.c b/test/tfile.c index 027ad62..80ba4da 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1072,7 +1072,7 @@ test_get_obj_ids(void) VERIFY(oid_count, (NGROUPS + NDSETS + 1), "H5Fget_obj_count"); oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t)); - CHECK(oid_list, NULL, "HDcalloc"); + CHECK_PTR(oid_list, "HDcalloc"); /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here. * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in @@ -1135,7 +1135,7 @@ test_get_obj_ids(void) VERIFY(oid_count, NDSETS, "H5Fget_obj_count"); oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t)); - CHECK(oid_list, NULL, "HDcalloc"); + CHECK_PTR(oid_list, "HDcalloc"); /* Get the list of all opened objects */ ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); @@ -2667,7 +2667,7 @@ cal_chksum(const char *file, uint32_t *chksum) /* Allocate space for the file data */ file_data = HDmalloc((size_t)sb.st_size); - CHECK(file_data, NULL, "HDmalloc"); + CHECK_PTR(file_data, "HDmalloc"); if(file_data) { /* Read file's data into memory */ diff --git a/test/th5o.c b/test/th5o.c index 4baac20..144ea4c 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -783,9 +783,9 @@ test_h5o_link(void) /* Allocate memory buffers */ /* (These are treated as 2-D buffers) */ wdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK(wdata, NULL, "HDmalloc"); + CHECK_PTR(wdata, "HDmalloc"); rdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK(rdata, NULL, "HDmalloc"); + CHECK_PTR(rdata, "HDmalloc"); /* Initialize the raw data */ for(i = n = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) diff --git a/test/theap.c b/test/theap.c index 3c23025..cdb423e 100644 --- a/test/theap.c +++ b/test/theap.c @@ -88,11 +88,11 @@ test_heap_init(void) /* Allocate arrays */ rand_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(rand_num, NULL, "HDmalloc"); + CHECK_PTR(rand_num, "HDmalloc"); inc_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(inc_sort_num, NULL, "HDmalloc"); + CHECK_PTR(inc_sort_num, "HDmalloc"); dec_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(dec_sort_num, NULL, "HDmalloc"); + CHECK_PTR(dec_sort_num, "HDmalloc"); /* Create randomized set of numbers */ curr_time = HDtime(NULL); @@ -127,7 +127,7 @@ test_heap_create(void) /* Try creating a maximum Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Try closing the heap */ ret=H5HP_close(heap); @@ -135,7 +135,7 @@ test_heap_create(void) /* Try creating a minimum Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Try closing the heap */ ret=H5HP_close(heap); @@ -163,7 +163,7 @@ test_heap_insert_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -237,7 +237,7 @@ test_heap_insert_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -325,7 +325,7 @@ test_heap_insert_many_core(H5HP_type_t heap_type, test_obj *arr, size_t nelem, i /* Create a Heap */ heap=H5HP_create(heap_type); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -405,7 +405,7 @@ test_heap_remove_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -479,7 +479,7 @@ test_heap_remove_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -567,7 +567,7 @@ static void test_heap_remove_many_core(H5HP_type_t heap_type, test_obj *arr, siz /* Create a Heap */ heap=H5HP_create(heap_type); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -714,7 +714,7 @@ test_heap_change_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -788,7 +788,7 @@ test_heap_change_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -880,7 +880,7 @@ test_heap_incdec_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -955,7 +955,7 @@ test_heap_incdec_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); diff --git a/test/tid.c b/test/tid.c index 494ee60..375ef69 100644 --- a/test/tid.c +++ b/test/tid.c @@ -57,7 +57,7 @@ static int basic_id_test(void) testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -65,7 +65,7 @@ static int basic_id_test(void) testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -118,7 +118,7 @@ static int basic_id_test(void) testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; @@ -126,14 +126,14 @@ static int basic_id_test(void) testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; /* Remove an ID and make sure we can't access it */ testPtr = (int*) H5Iremove_verify(arrayID, myType); - CHECK(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR(testPtr, "H5Iremove_verify"); if(testPtr == NULL) goto out; @@ -141,7 +141,7 @@ static int basic_id_test(void) testPtr = (int*) H5Iobject_verify(arrayID, myType); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -263,7 +263,7 @@ static int id_predefined_test(void ) testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Isearch"); + CHECK_PTR_NULL(testPtr, "H5Isearch"); if(testPtr != NULL) goto out; @@ -301,7 +301,7 @@ static int id_predefined_test(void ) testPtr = H5Iremove_verify(typeID, H5I_DATATYPE); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; @@ -309,7 +309,7 @@ static int id_predefined_test(void ) testPtr = H5Iobject_verify(typeID, H5I_DATATYPE); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; diff --git a/test/titerate.c b/test/titerate.c index aad62c9..231bd2e 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -159,7 +159,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) /* Keep a copy of the dataset names around for later */ lnames[i] = HDstrdup(name); - CHECK(lnames[i], NULL, "strdup"); + CHECK_PTR(lnames[i], "strdup"); ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -170,13 +170,13 @@ test_iter_group(hid_t fapl, hbool_t new_format) CHECK(ret, FAIL, "H5Gcreate2"); lnames[NDATASETS] = HDstrdup("grp"); - CHECK(lnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(lnames[NDATASETS], "strdup"); ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); lnames[NDATASETS + 1] = HDstrdup("dtype"); - CHECK(lnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(lnames[NDATASETS], "strdup"); /* Close everything up */ ret = H5Tclose(datatype); @@ -412,7 +412,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format) /* Keep a copy of the attribute names around for later */ anames[i] = HDstrdup(name); - CHECK(anames[i], NULL, "strdup"); + CHECK_PTR(anames[i], "strdup"); ret = H5Aclose(attribute); CHECK(ret, FAIL, "H5Aclose"); @@ -596,7 +596,7 @@ test_iter_group_large(hid_t fapl) /* Allocate & initialize array */ names = (iter_info *)HDcalloc(sizeof(iter_info), (ITER_NGROUPS + 2)); - CHECK(names, NULL, "HDcalloc"); + CHECK_PTR(names, "HDcalloc"); /* Output message about test being performed */ MESSAGE(5, ("Testing Large Group Iteration Functionality\n")); @@ -733,7 +733,7 @@ static void test_grp_memb_funcs(hid_t fapl) /* Keep a copy of the dataset names around for later */ dnames[i] = HDstrdup(name); - CHECK(dnames[i], NULL, "strdup"); + CHECK_PTR(dnames[i], "strdup"); ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -744,13 +744,13 @@ static void test_grp_memb_funcs(hid_t fapl) CHECK(ret, FAIL, "H5Gcreate2"); dnames[NDATASETS] = HDstrdup("grp"); - CHECK(dnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(dnames[NDATASETS], "strdup"); ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); dnames[NDATASETS + 1] = HDstrdup("dtype"); - CHECK(dnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(dnames[NDATASETS], "strdup"); /* Close everything up */ ret = H5Tclose(datatype); @@ -797,7 +797,7 @@ static void test_grp_memb_funcs(hid_t fapl) /* Keep a copy of the dataset names around for later */ obj_names[i] = HDstrdup(dataset_name); - CHECK(obj_names[i], NULL, "strdup"); + CHECK_PTR(obj_names[i], "strdup"); ret = H5Oget_info_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Oget_info_by_idx"); diff --git a/test/tmisc.c b/test/tmisc.c index 6da4589..f0e595b 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -723,7 +723,7 @@ create_struct3(void) herr_t ret; /* For error checking */ str3hndl = (misc5_struct3_hndl *)HDmalloc(sizeof(misc5_struct3_hndl)); - CHECK(str3hndl,NULL,"malloc"); + CHECK_PTR(str3hndl, "malloc"); str3hndl->st3h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct3)); CHECK(str3hndl->st3h_base, FAIL, "H5Tcreate"); @@ -766,7 +766,7 @@ create_struct2(void) herr_t ret; /* For error checking */ str2hndl = (misc5_struct2_hndl *)HDmalloc(sizeof(misc5_struct2_hndl)); - CHECK(str2hndl, NULL, "malloc"); + CHECK_PTR(str2hndl, "HDmalloc"); str2hndl->st2h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct2)); CHECK(str2hndl->st2h_base, FAIL, "H5Tcreate"); @@ -775,7 +775,7 @@ create_struct2(void) CHECK(ret, FAIL, "H5Tinsert"); str2hndl->st2h_st3hndl = create_struct3(); - CHECK(str2hndl->st2h_st3hndl,NULL,"create_struct3"); + CHECK_PTR(str2hndl->st2h_st3hndl, "create_struct3"); ret = H5Tinsert(str2hndl->st2h_base, "st2_el2", HOFFSET(misc5_struct2, st2_el2), str2hndl->st2h_st3hndl->st3h_id); CHECK(ret,FAIL,"H5Tinsert"); @@ -811,7 +811,7 @@ set_struct2(misc5_struct2 *buf) buf->st2_el2.len = MISC5_DBGNELM3; buf->st2_el2.p = HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3)); - CHECK(buf->st2_el2.p,NULL,"malloc"); + CHECK_PTR(buf->st2_el2.p, "HDmalloc"); for(i=0; i<(buf->st2_el2.len); i++) set_struct3(&(((misc5_struct3 *)(buf->st2_el2.p))[i])); @@ -832,7 +832,7 @@ create_struct1(void) herr_t ret; /* For error checking */ str1hndl = (misc5_struct1_hndl *)HDmalloc(sizeof(misc5_struct1_hndl)); - CHECK(str1hndl, NULL, "malloc"); + CHECK_PTR(str1hndl, "HDmalloc"); str1hndl->st1h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1)); CHECK(str1hndl->st1h_base, FAIL, "H5Tcreate"); @@ -841,7 +841,7 @@ create_struct1(void) CHECK(ret, FAIL, "H5Tinsert"); str1hndl->st1h_st2hndl=create_struct2(); - CHECK(str1hndl->st1h_st2hndl,NULL,"create_struct2"); + CHECK_PTR(str1hndl->st1h_st2hndl, "create_struct2"); ret = H5Tinsert(str1hndl->st1h_base, "st1_el2", HOFFSET(misc5_struct1, st1_el2), str1hndl->st1h_st2hndl->st2h_id); CHECK(ret,FAIL,"H5Tinsert"); @@ -877,7 +877,7 @@ set_struct1(misc5_struct1 *buf) buf->st1_el2.len=MISC5_DBGNELM2; buf->st1_el2.p=HDmalloc((buf->st1_el2.len)*sizeof(misc5_struct2)); - CHECK(buf->st1_el2.p,NULL,"malloc"); + CHECK_PTR(buf->st1_el2.p, "HDmalloc"); for(i=0; i<(buf->st1_el2.len); i++) set_struct2(&(((misc5_struct2 *)(buf->st1_el2.p))[i])); @@ -913,7 +913,7 @@ test_misc5(void) /* Create the memory structure to write */ str1hndl = create_struct1(); - CHECK(str1hndl, NULL, "create_struct1"); + CHECK_PTR(str1hndl, "create_struct1"); /* Create the dataspace */ dims[0] = MISC5_NELMTOPLVL; @@ -927,7 +927,7 @@ test_misc5(void) /* Create the variable-length buffer */ buf.len = MISC5_DBGNELM1; buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1)); - CHECK(buf.p, NULL, "malloc"); + CHECK_PTR(buf.p, "HDmalloc"); /* Create the top-level VL information */ for(i = 0; i < MISC5_DBGNELM1; i++) @@ -1253,10 +1253,10 @@ test_misc8(void) /* Allocate space for the data to write & read */ wdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK(wdata,NULL,"malloc"); + CHECK_PTR(wdata, "HDmalloc"); #ifdef VERIFY_DATA rdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK(rdata,NULL,"malloc"); + CHECK_PTR(rdata, "HDmalloc"); #endif /* VERIFY_DATA */ /* Initialize values */ @@ -2144,7 +2144,7 @@ misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data) /* Create a data buffer for the dataset read */ read_data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK(read_data, NULL, "HDcalloc"); + CHECK_PTR(read_data, "HDcalloc"); /* Open the contiguous dataset in the root group */ dsid = H5Dopen2(loc_id, name, H5P_DEFAULT); @@ -2270,14 +2270,14 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char /* Allocate space for the user block */ user_block = HDcalloc(size, (size_t)1); - CHECK(user_block, NULL, "HDcalloc"); + CHECK_PTR(user_block, "HDcalloc"); /* Copy in the user block data */ HDmemcpy(user_block, str, strlen(str)); /* Open the new file */ new_fp = HDfopen(new_name,"wb"); - CHECK(new_fp, NULL, "HDfopen"); + CHECK_PTR(new_fp, "HDfopen"); /* Write the user block to the new file */ written = HDfwrite(user_block, (size_t)1, size, new_fp); @@ -2285,11 +2285,11 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char /* Open the old file */ old_fp = HDfopen(old_name,"rb"); - CHECK(old_fp, NULL, "HDfopen"); + CHECK_PTR(old_fp, "HDfopen"); /* Allocate space for the copy buffer */ copy_buf = HDmalloc((size_t)MISC13_COPY_BUF_SIZE); - CHECK(copy_buf, NULL, "HDmalloc"); + CHECK_PTR(copy_buf, "HDmalloc"); /* Copy data from the old file to the new file */ while((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { @@ -2439,7 +2439,7 @@ test_misc13(void) /* Create a data buffer for the datasets */ data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK(data, NULL, "HDcalloc"); + CHECK_PTR(data, "HDcalloc"); /* Initialize data to write */ misc13_init_data(data); @@ -3446,7 +3446,7 @@ test_misc19(void) /* Get a VFD class to register */ vfd_cls = h5_get_dummy_vfd_class(); - CHECK(vfd_cls, NULL, "h5_get_dummy_vfd_class"); + CHECK_PTR(vfd_cls, "h5_get_dummy_vfd_class"); /* Register a virtual file driver */ vfdid = H5FDregister(vfd_cls); diff --git a/test/trefstr.c b/test/trefstr.c index 40ce344..f55ede0 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -67,7 +67,7 @@ test_refstr_create(void) /* Try creating a ref-counted string */ rs=H5RS_create("foo"); - CHECK(rs, NULL, "H5RS_create"); + CHECK_PTR(rs, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs); @@ -97,7 +97,7 @@ test_refstr_count(void) /* Try creating a ref-counted string */ rs=H5RS_create("foo"); - CHECK(rs, NULL, "H5RS_create"); + CHECK_PTR(rs, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs); @@ -144,7 +144,7 @@ test_refstr_dup(void) /* Try creating a ref-counted string */ rs1=H5RS_create("foo"); - CHECK(rs1, NULL, "H5RS_create"); + CHECK_PTR(rs1, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs1); @@ -152,7 +152,7 @@ test_refstr_dup(void) /* Duplicate r-string */ rs2=H5RS_dup(rs1); - CHECK(rs2, NULL, "H5RS_dup"); + CHECK_PTR(rs2, "H5RS_dup"); /* Get the reference count on the strings */ count=H5RS_get_count(rs1); @@ -194,11 +194,11 @@ test_refstr_cmp(void) /* Create first reference counted string */ rs1=H5RS_create("foo"); - CHECK(rs1, NULL, "H5RS_create"); + CHECK_PTR(rs1, "H5RS_create"); /* Create second reference counted string */ rs2=H5RS_create("foo2"); - CHECK(rs2, NULL, "H5RS_create"); + CHECK_PTR(rs2, "H5RS_create"); /* Compare the strings in various ways */ cmp=H5RS_cmp(rs1,rs1); @@ -246,11 +246,11 @@ test_refstr_wrap(void) /* Wrap ref-counted string around existing buffer */ rs=H5RS_wrap(buf); - CHECK(rs, NULL, "H5RS_wrap"); + CHECK_PTR(rs, "H5RS_wrap"); /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); - CHECK(s, NULL, "H5RS_get_str"); + CHECK_PTR(s, "H5RS_get_str"); VERIFY(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); VERIFY(cmp, 0, "HDstrcmp"); @@ -264,7 +264,7 @@ test_refstr_wrap(void) /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); - CHECK(s, NULL, "H5RS_get_str"); + CHECK_PTR(s, "H5RS_get_str"); CHECK(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); if(cmp<=0) @@ -299,16 +299,16 @@ test_refstr_own(void) /* Initialize buffer */ s = (char *)H5FL_BLK_MALLOC(str_buf,HDstrlen("foo") + 1); - CHECK(s, NULL, "H5FL_BLK_MALLOC"); + CHECK_PTR(s, "H5FL_BLK_MALLOC"); HDstrcpy(s, "foo"); /* Transfer ownership of dynamically allocated string to ref-counted string */ rs=H5RS_own(s); - CHECK(rs, NULL, "H5RS_own"); + CHECK_PTR(rs, "H5RS_own"); /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); - CHECK(t, NULL, "H5RS_get_str"); + CHECK_PTR(t, "H5RS_get_str"); VERIFY(t, s, "transferring"); cmp=HDstrcmp(s,t); VERIFY(cmp, 0, "HDstrcmp"); @@ -322,7 +322,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); - CHECK(t, NULL, "H5RS_get_str"); + CHECK_PTR(t, "H5RS_get_str"); VERIFY(t, s, "transferring"); cmp=HDstrcmp(t,s); VERIFY(cmp, 0, "HDstrcmp"); diff --git a/test/tselect.c b/test/tselect.c index 85c21bb..2022a11 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -228,9 +228,9 @@ test_select_hyper(hid_t xfer_plist) /* Allocate write & read buffers */ wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK(wbuf, NULL, "HDmalloc"); + CHECK_PTR(wbuf, "HDmalloc"); rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK(rbuf, NULL, "HDcalloc"); + CHECK_PTR(rbuf, "HDcalloc"); /* Initialize write buffer */ for(i=0, tbuf=wbuf; islist, &j); - CHECK(obj_ret, NULL, "H5SL_remove"); + CHECK_PTR(obj_ret, "H5SL_remove"); obj_ret->nfrees++; obj_list->nobjs_rem--; } /* end else */ @@ -1324,7 +1324,7 @@ test_skiplist_try_free_safe(void) /* Create a skip list */ obj_list.slist = H5SL_create(H5SL_TYPE_INT, NULL); - CHECK(obj_list.slist, NULL, "H5SL_create"); + CHECK_PTR(obj_list.slist, "H5SL_create"); /* Init obj_list.list */ obj_list.list = list; @@ -1396,7 +1396,7 @@ test_skiplist_less(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u=0; u<10; u++) { @@ -1430,7 +1430,7 @@ test_skiplist_less(void) VERIFY(*found_item,5,"H5SL_less"); find_item=4; found_item=(unsigned *)H5SL_less(slist,&find_item); - VERIFY(found_item,NULL,"H5SL_less"); + CHECK_PTR_NULL(found_item, "H5SL_less"); /* Close the skip list */ ret=H5SL_close(slist); @@ -1460,7 +1460,7 @@ test_skiplist_greater(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1488,7 +1488,7 @@ test_skiplist_greater(void) VERIFY(*found_item, 90, "H5SL_greater"); find_item = 100; found_item = (unsigned *)H5SL_greater(slist, &find_item); - VERIFY(found_item, NULL, "H5SL_greater"); + CHECK_PTR_NULL(found_item, "H5SL_greater"); find_item = 6; found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(*found_item, 10, "H5SL_greater"); @@ -1525,7 +1525,7 @@ test_skiplist_below(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1536,44 +1536,44 @@ test_skiplist_below(void) /* Check for exact match of items in various positions */ find_item = 20; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 90; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 5; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); /* Find item less than a missing key, in various positions */ find_item = 19; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 15, "H5SL_below"); find_item = 89; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 80, "H5SL_below"); find_item = 100; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_below"); find_item = 9; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_below"); find_item = 4; node = (H5SL_node_t *)H5SL_less(slist, &find_item); - VERIFY(node, NULL, "H5SL_below"); + CHECK_PTR_NULL(node, "H5SL_below"); /* Close the skip list */ ret = H5SL_close(slist); @@ -1604,7 +1604,7 @@ test_skiplist_above(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1615,42 +1615,42 @@ test_skiplist_above(void) /* Check for exact match of items in various positions */ find_item = 20; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 90; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 5; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); /* Find item greater than a missing key, in various positions */ find_item = 19; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 20, "H5SL_above"); find_item = 89; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_above"); find_item = 100; node = H5SL_above(slist, &find_item); - VERIFY(node, NULL, "H5SL_above"); + CHECK_PTR_NULL(node, "H5SL_above"); find_item = 6; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 10, "H5SL_above"); find_item = 4; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_above"); @@ -1681,7 +1681,7 @@ test_skiplist_remove_first(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1697,7 +1697,7 @@ test_skiplist_remove_first(void) /* Check for removing object from empty list */ found_item = (unsigned *)H5SL_remove_first(slist); - VERIFY(found_item, NULL, "H5SL_remove_first"); + CHECK_PTR_NULL(found_item, "H5SL_remove_first"); /* Close the skip list */ ret = H5SL_close(slist); @@ -1725,7 +1725,7 @@ test_skiplist_remove_first_many(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_INT, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < NUM_ELEMS; u++) { @@ -1742,7 +1742,7 @@ test_skiplist_remove_first_many(void) /* Check for removing object from empty list */ found_item = (int *)H5SL_remove_first(slist); - VERIFY(found_item, NULL, "H5SL_remove_first"); + CHECK_PTR_NULL(found_item, "H5SL_remove_first"); /* Close the skip list */ ret = H5SL_close(slist); diff --git a/test/ttst.c b/test/ttst.c index b26d582..c5912c5 100644 --- a/test/ttst.c +++ b/test/ttst.c @@ -157,7 +157,7 @@ test_tst_create(void) /* Try creating a TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Try closing a real tree */ ret=H5ST_close(tree); @@ -186,7 +186,7 @@ test_tst_insert(void) /* Create the TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Insert unique words into TST, in random order */ for(u=0; ueqkid,uniq_words[u])) TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,uniq_words[u]); obj=H5ST_locate(tree,uniq_words[u]); - CHECK(obj, NULL, "H5ST_locate"); + CHECK_PTR(obj, "H5ST_locate"); if(HDstrcmp((const char *)obj,uniq_words[u])) TestErrPrintf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,uniq_words[u]); @@ -246,7 +246,7 @@ test_tst_iterate(void) /* Create the TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Insert unique words into TST, in random order */ for(u=0; ueqkid,rand_uniq_words[u])) diff --git a/test/tvltypes.c b/test/tvltypes.c index 5121a66..0c4cb9d 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -1015,9 +1015,9 @@ test_vltypes_compound_vlen_vlen(void) /* Allocate and initialize VL data to write */ wdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK(wdata, NULL, "HDmalloc"); + CHECK_PTR(wdata, "HDmalloc"); rdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK(rdata, NULL, "HDmalloc"); + CHECK_PTR(rdata, "HDmalloc"); for(i = 0; i < SPACE3_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)(i * 20) / 3.0F; @@ -2503,7 +2503,7 @@ test_vltypes_fill_value(void) /* Allocate space for the buffer to read data */ rbuf = (dtype1_struct *)HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); - CHECK(rbuf, NULL, "HDmalloc"); + CHECK_PTR(rbuf, "HDmalloc"); /* Create the small & large dataspaces to use */ -- cgit v0.12 From 856e475c47ffd66668d2f868817357b4354f164b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 08:57:26 -0800 Subject: Added CHECK_PTR_EQ macro to testhdf5 to quiet cast warnings on Windows. --- test/testhdf5.h | 208 +++++++++++++++++---------------- test/theap.c | 12 +- test/tid.c | 342 ++++++++++++++++++++++++++++--------------------------- test/trefstr.c | 6 +- test/tskiplist.c | 14 +-- 5 files changed, 300 insertions(+), 282 deletions(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index 41675cf..6244524 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -30,131 +30,147 @@ /* Use %ld to print the value because long should cover most cases. */ /* Used to make certain a return value _is_not_ a value */ -#define CHECK(ret, val, where) do { \ - if (VERBOSE_HI) print_func(" Call to routine: %15s at line %4d " \ - "in %s returned %ld \n", \ - where, (int)__LINE__, __FILE__, \ - (long)(ret)); \ - if ((ret) == (val)) { \ - TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ - "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK(ret, val, where) do { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d " \ + "in %s returned %ld \n", \ + where, (int)__LINE__, __FILE__, \ + (long)(ret)); \ + } \ + if ((ret) == (val)) { \ + TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ + "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) -#define CHECK_I(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \ - (where), (int)__LINE__, __FILE__, (long)(ret)); \ - } \ - if ((ret)<0) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \ - (where), (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK_I(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \ + (where), (int)__LINE__, __FILE__, (long)(ret)); \ + } \ + if ((ret)<0) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \ + (where), (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } /* Check that a pointer is valid (i.e.: not NULL) */ -#define CHECK_PTR(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ - } \ - if (!(ret)) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \ - (where), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK_PTR(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (!(ret)) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \ + (where), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } -#define CHECK_PTR_NULL(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ - } \ - if (ret) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ - (where), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +/* Check that a pointer is NULL */ +#define CHECK_PTR_NULL(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (ret) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ + (where), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ +} + +/* Check that two pointers are equal */ +#define CHECK_PTR_EQ(ret, val, where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (ret != val) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ + (where), ret, val, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } /* Used to make certain a return value _is_ a value */ -#define VERIFY(_x, _val, where) do { \ - long __x = (long)_x, __val = (long)_val; \ - if(VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - "%ld \n", (where), (int)__LINE__, __FILE__, __x); \ - } \ - if((__x) != (__val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \ - "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY(_x, _val, where) do { \ + long __x = (long)_x, __val = (long)_val; \ + if(VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + "%ld \n", (where), (int)__LINE__, __FILE__, __x); \ + } \ + if((__x) != (__val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \ + "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to make certain a (non-'long' type's) return value _is_ a value */ -#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \ - _type __x = (_type)_x, __val = (_type)_val; \ - if(VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - _format " \n", (where), (int)__LINE__, __FILE__, __x); \ - } \ - if((__x) != (__val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \ - "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \ + _type __x = (_type)_x, __val = (_type)_val; \ + if(VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + _format " \n", (where), (int)__LINE__, __FILE__, __x); \ + } \ + if((__x) != (__val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \ + "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to make certain a string return value _is_ a value */ -#define VERIFY_STR(x, val, where) do { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - "%s \n", (where), (int)__LINE__, __FILE__, x); \ - } \ - if (HDstrcmp(x, val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \ - "in %s\n", where, val, x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY_STR(x, val, where) do { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + "%s \n", (where), (int)__LINE__, __FILE__, x); \ + } \ + if (HDstrcmp(x, val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \ + "in %s\n", where, val, x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to document process through a test and to check for errors */ -#define RESULT(ret,func) do { \ - if (VERBOSE_MED) { \ - print_func(" Call to routine: %15s at line %4d in %s returned " \ - "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \ - } \ - if (VERBOSE_HI) \ - H5Eprint2(H5E_DEFAULT, stdout); \ - if ((ret) == FAIL) { \ - TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ - "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define RESULT(ret,func) do { \ + if (VERBOSE_MED) { \ + print_func(" Call to routine: %15s at line %4d in %s returned " \ + "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \ + } \ + if (VERBOSE_HI) \ + H5Eprint2(H5E_DEFAULT, stdout); \ + if ((ret) == FAIL) { \ + TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ + "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to document process through a test */ #if defined(H5_HAVE_PARALLEL) && defined(H5_PARALLEL_TEST) -#define MESSAGE(V,A) { \ - int mpi_rank; \ - \ - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ - if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \ - print_func A ; \ +#define MESSAGE(V,A) { \ + int mpi_rank; \ + \ + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ + if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \ + print_func A ; \ } #else /* H5_HAVE_PARALLEL */ #define MESSAGE(V,A) {if (HDGetTestVerbosity() > (V)) print_func A;} #endif /* H5_HAVE_PARALLEL */ /* Used to indicate an error that is complex to check for */ -#define ERROR(where) do { \ - if(VERBOSE_HI) \ - print_func(" Call to routine: %15s at line %4d in %s returned " \ - "invalid result\n", where, (int)__LINE__, __FILE__); \ - TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ - where, (int)__LINE__, __FILE__); \ +#define ERROR(where) do { \ + if(VERBOSE_HI) \ + print_func(" Call to routine: %15s at line %4d in %s returned " \ + "invalid result\n", where, (int)__LINE__, __FILE__); \ + TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ + where, (int)__LINE__, __FILE__); \ } while(0) /* definitions for command strings */ diff --git a/test/theap.c b/test/theap.c index cdb423e..7b2fadb 100644 --- a/test/theap.c +++ b/test/theap.c @@ -434,19 +434,19 @@ test_heap_remove_min(void) ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 5, "H5HP_remove"); - VERIFY(ptr, &obj2, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove"); /* Remove second maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 10, "H5HP_remove"); - VERIFY(ptr, &obj1, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove"); /* Remove third maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 20, "H5HP_remove"); - VERIFY(ptr, &obj3, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove"); /* Try removing an object from an empty heap */ ret=H5HP_remove(heap,&val,&ptr); @@ -508,19 +508,19 @@ test_heap_remove_max(void) ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 20, "H5HP_remove"); - VERIFY(ptr, &obj3, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove"); /* Remove second maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 10, "H5HP_remove"); - VERIFY(ptr, &obj1, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove"); /* Remove third maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 5, "H5HP_remove"); - VERIFY(ptr, &obj2, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove"); /* Try removing an object from an empty heap */ ret=H5HP_remove(heap,&val,&ptr); diff --git a/test/tid.c b/test/tid.c index 375ef69..7d6757f 100644 --- a/test/tid.c +++ b/test/tid.c @@ -16,223 +16,225 @@ #include "testhdf5.h" #include "hdf5.h" - /* Include H5Ipkg.h to calculate max number of groups */ +/* Include H5Ipkg.h to calculate max number of groups */ #define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" - /* Test basic functionality of registering and deleting types and IDs */ +/* Test basic functionality of registering and deleting types and IDs */ static int basic_id_test(void) { - H5I_type_t myType = H5I_BADID; - hid_t arrayID = H5I_INVALID_HID; - void* testObj = NULL; - void* testPtr = NULL; - char nameString[10]; - hid_t testID; - ssize_t testSize = -1; - herr_t err; - int num_ref; - hsize_t num_members; - + H5I_type_t myType = H5I_BADID; + hid_t arrayID = H5I_INVALID_HID; + void* testObj = NULL; + void* testPtr = NULL; + char nameString[10]; + hid_t testID; + ssize_t testSize = -1; + herr_t err; + int num_ref; + hsize_t num_members; + + + /* Try to register an ID with ficticious types */ + H5E_BEGIN_TRY + arrayID = H5Iregister((H5I_type_t) 420, testObj); + H5E_END_TRY - /* Try to register an ID with ficticious types */ - H5E_BEGIN_TRY - arrayID = H5Iregister((H5I_type_t) 420, testObj); - H5E_END_TRY + VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID != H5I_INVALID_HID) + goto out; - VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID != H5I_INVALID_HID) - goto out; + H5E_BEGIN_TRY + arrayID = H5Iregister((H5I_type_t) -1, testObj); + H5E_END_TRY - H5E_BEGIN_TRY - arrayID = H5Iregister((H5I_type_t) -1, testObj); - H5E_END_TRY + VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID != H5I_INVALID_HID) + goto out; - VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID != H5I_INVALID_HID) - goto out; + /* Try to access IDs with ficticious types */ + H5E_BEGIN_TRY + testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); + H5E_END_TRY - /* Try to access IDs with ficticious types */ - H5E_BEGIN_TRY - testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + H5E_BEGIN_TRY + testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + /* Register a type */ + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); - /* Register a type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + CHECK(myType, H5I_BADID, "H5Iregister_type"); + if(myType == H5I_BADID) + goto out; - CHECK(myType, H5I_BADID, "H5Iregister_type"); - if(myType == H5I_BADID) - goto out; + /* Register an ID and retrieve the object it points to. + * Once the ID has been registered, testObj will be freed when + * its ID type is destroyed. + */ + testObj = HDmalloc(7 * sizeof(int)); + arrayID = H5Iregister(myType, testObj); - /* Register an ID and retrieve the object it points to. - * Once the ID has been registered, testObj will be freed when - * its ID type is destroyed. */ - testObj = HDmalloc(7 * sizeof(int)); - arrayID = H5Iregister(myType, testObj); + CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID == H5I_INVALID_HID) { + HDfree(testObj); + goto out; + } - CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID == H5I_INVALID_HID) - { - HDfree(testObj); - goto out; - } + testPtr = (int *)H5Iobject_verify(arrayID, myType); - testPtr = (int *) H5Iobject_verify(arrayID, myType); + CHECK_PTR_EQ(testPtr, testObj, "H5Iobject_verify"); + if(testPtr != testObj) + goto out; - VERIFY(testPtr, testObj, "H5Iobject_verify"); - if(testPtr != testObj) - goto out; + /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this + * is an hid_t for the wrong kind of object + */ + H5E_BEGIN_TRY + testID = H5Iget_file_id(arrayID); + H5E_END_TRY - /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this - * is an hid_t for the wrong kind of object */ - H5E_BEGIN_TRY - testID = H5Iget_file_id(arrayID); - H5E_END_TRY + VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id"); + if(testID != H5I_INVALID_HID) + goto out; - VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id"); - if(testID != H5I_INVALID_HID) - goto out; + H5E_BEGIN_TRY + testSize = H5Iget_name(arrayID, nameString, (size_t)9); + H5E_END_TRY - H5E_BEGIN_TRY - testSize = H5Iget_name(arrayID, nameString, (size_t)9); - H5E_END_TRY + VERIFY(testSize, -1, "H5Iget_name"); + if(testSize != -1) + goto out; - VERIFY(testSize, -1, "H5Iget_name"); - if(testSize != -1) - goto out; + /* Make sure H5Iremove_verify catches objects of the wrong type */ + H5E_BEGIN_TRY + testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); + H5E_END_TRY - /* Make sure H5Iremove_verify catches objects of the wrong type */ - H5E_BEGIN_TRY - testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + H5E_BEGIN_TRY + testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + /* Remove an ID and make sure we can't access it */ + testPtr = (int*) H5Iremove_verify(arrayID, myType); - /* Remove an ID and make sure we can't access it */ - testPtr = (int*) H5Iremove_verify(arrayID, myType); + CHECK_PTR(testPtr, "H5Iremove_verify"); + if(testPtr == NULL) + goto out; - CHECK_PTR(testPtr, "H5Iremove_verify"); - if(testPtr == NULL) - goto out; + H5E_BEGIN_TRY + testPtr = (int*) H5Iobject_verify(arrayID, myType); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = (int*) H5Iobject_verify(arrayID, myType); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + /* Delete the type and make sure we can't access objects within it */ + arrayID = H5Iregister(myType, testObj); - /* Delete the type and make sure we can't access objects within it */ - arrayID = H5Iregister(myType, testObj); + err = H5Idestroy_type(myType); + VERIFY(err, 0, "H5Idestroy_type"); + if( err != 0) + goto out; + VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); + if(H5Itype_exists(myType) != 0) + goto out; - err = H5Idestroy_type(myType); - VERIFY(err, 0, "H5Idestroy_type"); - if( err != 0) - goto out; - VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); - if(H5Itype_exists(myType) != 0) + H5E_BEGIN_TRY + VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers"); + if(H5Inmembers(myType, NULL) != -1) goto out; + H5E_END_TRY - H5E_BEGIN_TRY - VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers"); - if(H5Inmembers(myType, NULL) != -1) - goto out; - H5E_END_TRY - - /* Register another type and another object in that type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + /* Register another type and another object in that type */ + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); - CHECK(myType, H5I_BADID, "H5Iregister_type"); - if(myType == H5I_BADID) - goto out; + CHECK(myType, H5I_BADID, "H5Iregister_type"); + if(myType == H5I_BADID) + goto out; - /* The memory that testObj pointed to should already have been - * freed when the previous type was destroyed. Allocate new - * memory for it. - */ - testObj = HDmalloc(7 * sizeof(int)); - arrayID = H5Iregister(myType, testObj); + /* The memory that testObj pointed to should already have been + * freed when the previous type was destroyed. Allocate new + * memory for it. + */ + testObj = HDmalloc(7 * sizeof(int)); + arrayID = H5Iregister(myType, testObj); - CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID == H5I_INVALID_HID) - { - HDfree(testObj); - goto out; - } + CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID == H5I_INVALID_HID) { + HDfree(testObj); + goto out; + } - err = H5Inmembers(myType, &num_members); - CHECK(err, -1, "H5Inmembers"); - if (err < 0) - goto out; - VERIFY(num_members, 1, "H5Inmembers"); - if(num_members != 1) - goto out; + err = H5Inmembers(myType, &num_members); + CHECK(err, -1, "H5Inmembers"); + if (err < 0) + goto out; + VERIFY(num_members, 1, "H5Inmembers"); + if(num_members != 1) + goto out; - /* Increment references to type and ensure that dec_type_ref - doesn't destroy the type */ - num_ref = H5Iinc_type_ref(myType); - VERIFY(num_ref, 2, "H5Iinc_type_ref"); - if( num_ref != 2) - goto out; - num_ref = H5Idec_type_ref(myType); - VERIFY(num_ref, 1, "H5Idec_type_ref"); - if(num_ref != 1) - goto out; - err = H5Inmembers(myType, &num_members); - CHECK(err, -1, "H5Inmembers"); - if (err < 0) - goto out; - VERIFY(num_members, 1, "H5Inmembers"); - if(num_members != 1) - goto out; + /* Increment references to type and ensure that dec_type_ref + * doesn't destroy the type + */ + num_ref = H5Iinc_type_ref(myType); + VERIFY(num_ref, 2, "H5Iinc_type_ref"); + if( num_ref != 2) + goto out; + num_ref = H5Idec_type_ref(myType); + VERIFY(num_ref, 1, "H5Idec_type_ref"); + if(num_ref != 1) + goto out; + err = H5Inmembers(myType, &num_members); + CHECK(err, -1, "H5Inmembers"); + if (err < 0) + goto out; + VERIFY(num_members, 1, "H5Inmembers"); + if(num_members != 1) + goto out; - /* This call to dec_type_ref should destroy the type */ - num_ref = H5Idec_type_ref(myType); - VERIFY(num_ref, 0, "H5Idec_type_ref"); - if(num_ref != 0) - goto out; - VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); - if (H5Itype_exists(myType) != 0) - goto out; + /* This call to dec_type_ref should destroy the type */ + num_ref = H5Idec_type_ref(myType); + VERIFY(num_ref, 0, "H5Idec_type_ref"); + if(num_ref != 0) + goto out; + VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); + if (H5Itype_exists(myType) != 0) + goto out; - H5E_BEGIN_TRY + H5E_BEGIN_TRY err = H5Inmembers(myType, &num_members); - if(err >= 0) - goto out; - H5E_END_TRY + if(err >= 0) + goto out; + H5E_END_TRY - return 0; + return 0; out: - /* Clean up type if it has been allocated and free memory used - * by testObj */ - if(myType >= 0) - H5Idestroy_type(myType); + /* Clean up type if it has been allocated and free memory used + * by testObj + */ + if(myType >= 0) + H5Idestroy_type(myType); - return -1; + return -1; } diff --git a/test/trefstr.c b/test/trefstr.c index f55ede0..83e2951 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -251,7 +251,7 @@ test_refstr_wrap(void) /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); CHECK_PTR(s, "H5RS_get_str"); - VERIFY(s, buf, "wrapping"); + CHECK_PTR_EQ(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); VERIFY(cmp, 0, "HDstrcmp"); @@ -309,7 +309,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); CHECK_PTR(t, "H5RS_get_str"); - VERIFY(t, s, "transferring"); + CHECK_PTR_EQ(t, s, "transferring"); cmp=HDstrcmp(s,t); VERIFY(cmp, 0, "HDstrcmp"); @@ -323,7 +323,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); CHECK_PTR(t, "H5RS_get_str"); - VERIFY(t, s, "transferring"); + CHECK_PTR_EQ(t, s, "transferring"); cmp=HDstrcmp(t,s); VERIFY(cmp, 0, "HDstrcmp"); diff --git a/test/tskiplist.c b/test/tskiplist.c index 12320ea..2806afe 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -322,17 +322,17 @@ test_skiplist_remove(void) search_key=key1; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key1, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key1, "H5SL_remove"); search_key=key2; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key2, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key2, "H5SL_remove"); search_key=key3; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key3, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key3, "H5SL_remove"); /* Check that the skip list has no elements */ num=H5SL_count(slist); @@ -1210,8 +1210,8 @@ static herr_t test_tfs_iter(void *_obj, void *key, void *_udata) { test_tfs_it_ud_t *udata = (test_tfs_it_ud_t *)_udata; /* Check consistency */ - VERIFY((void *)&obj->idx, key, "obj->idx"); - VERIFY(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]"); + CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx"); + CHECK_PTR_EQ(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]"); /* Increment number of calls */ udata->ncalls++; @@ -1236,8 +1236,8 @@ static htri_t test_tfs_free(void *_obj, void *key, void *_obj_list) { htri_t ret_value; /* Check consistency */ - VERIFY((void *)&obj->idx, key, "obj->idx"); - VERIFY(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]"); + CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx"); + CHECK_PTR_EQ(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]"); /* Mark this object as freed (to make sure it isn't recursively freed, that * is not something we support, we will undo this if we decide later not to -- cgit v0.12 From 8d8dc867a4919af7774a73fbd90633dcd4c1a4ed Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 09:11:53 -0800 Subject: Casted pointers to void to quiet warnings on Linux. --- test/testhdf5.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index 6244524..c36c4e1 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -90,7 +90,7 @@ } \ if (ret != val) { \ TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ - (where), ret, val, (int)__LINE__, __FILE__); \ + (where), (void *)(ret), (void *)(val), (int)__LINE__, __FILE__); \ H5Eprint2(H5E_DEFAULT, stdout); \ } \ } -- cgit v0.12 From 9fdd984cdea6fce8b5fdd16a7ccc3cc9bbca6fed Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 09:15:45 -0800 Subject: Changed casts to const void * --- test/testhdf5.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index c36c4e1..127c687 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -86,11 +86,11 @@ #define CHECK_PTR_EQ(ret, val, where) { \ if (VERBOSE_HI) { \ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ + (where), (int)__LINE__, __FILE__, (const void *)(ret)); \ } \ if (ret != val) { \ TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ - (where), (void *)(ret), (void *)(val), (int)__LINE__, __FILE__); \ + (where), (const void *)(ret), (const void *)(val), (int)__LINE__, __FILE__); \ H5Eprint2(H5E_DEFAULT, stdout); \ } \ } -- cgit v0.12 From ea4f752ace88b0a9931d6f806044d86fc652ecf7 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 27 Nov 2017 12:44:23 -0600 Subject: Adding data file generator Description: Added gen_bounds.c to generate the following files: - bounds_earliest_latest.h5 - bounds_earliest_v18.h5 - bounds_latest_latest.h5 - bounds_v18_latest.h5 - bounds_v18_v18.h5 for testing the version bounds fix in 1.8 and 1.6. --- test/gen_bounds.c | 626 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 626 insertions(+) create mode 100644 test/gen_bounds.c diff --git a/test/gen_bounds.c b/test/gen_bounds.c new file mode 100644 index 0000000..1de78e8 --- /dev/null +++ b/test/gen_bounds.c @@ -0,0 +1,626 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Oct 24, 2017 + * + * Purpose: This program is run to generate HDF5 data files used to test + * version bounds. + * + * Description + * =========== + * gen_bounds.c will generate the following files: + * - bounds_earliest_latest.h5 + * - bounds_earliest_v18.h5 + * - bounds_latest_latest.h5 + * - bounds_v18_latest.h5 + * - bounds_v18_v18.h5 + * + */ + +#include "hdf5.h" + +/*********************************************************************** + * gen_earliest_latest() creates file "bounds_earliest_latest.h5" + * + * File contents: + * - Version 0 superblock (default) + * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) + * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) + * + ***********************************************************************/ +#define FILENAME_E_L "bounds_earliest_latest.h5" + +/* 2-D dataset with fixed dimensions */ +#define RANK 2 +#define DIM1 100 +#define DIM2 200 +#define CHUNK_DIM1 50 +#define CHUNK_DIM2 50 + +int gen_earliest_latest() +{ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; + float buf[DIM1][DIM2]; /* Buffer for writing data */ + int i, j; + + /* Create file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set the "use the earliest/latest version of the format" bounds + for creating objects in the file */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) + goto error; + + /* Create file */ + if((fid = H5Fcreate(FILENAME_E_L, H5F_ACC_TRUNC, fcpl, fapl)) <0) + goto error; + + /* Close file property lists */ + if(H5Pclose(fapl) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 3 (default) + */ + + /* Fill sample data */ + for (i = 0; i < DIM1; i++) + for (j = 0; j < DIM2; j++) + buf[i][j] = 100.0F; + + /* Create the dataspace */ + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) + goto error; + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close property list and dataset, will reuse dataspace */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) + */ + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Disable partial chunk filters, triggers layout version 4 */ + if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close everything */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + if(H5Sclose(space) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + +/*********************************************************************** + * gen_earliest_v18() creates file "bounds_earliest_v18.h5" + * + * File contents: + * - Version 0 superblock (default) + * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) + * + ***********************************************************************/ +#define FILENAME_E_18 "bounds_earliest_v18.h5" + +int gen_earliest_v18() +{ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; + float buf[DIM1][DIM2]; /* Buffer for writing data */ + int i, j; + + /* Create file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set the "use the earliest/v18 version of the format" bounds + for creating objects in the file */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0) + goto error; + + /* Create file */ + if((fid = H5Fcreate(FILENAME_E_18, H5F_ACC_TRUNC, fcpl, fapl)) <0) + goto error; + + /* Close file property lists */ + if(H5Pclose(fapl) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 3 (default) + */ + + /* Fill sample data */ + for (i = 0; i < DIM1; i++) + for (j = 0; j < DIM2; j++) + buf[i][j] = 100.0F; + + /* Create the dataspace */ + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) + goto error; + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close everything */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + if(H5Sclose(space) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + +/*********************************************************************** + * gen_latest_latest() creates file "bounds_latest_latest.h5" + * + * File contents: + * - Version 3 superblock (H5Fcreate with H5F_ACC_SWMR_WRITE) + * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) + * + ***********************************************************************/ +#define FILENAME_L_L "bounds_latest_latest.h5" + +int gen_latest_latest() +{ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; + float buf[DIM1][DIM2]; /* Buffer for writing data */ + int i, j; + + /* Create file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Create file with H5F_ACC_SWMR_WRITE, triggers version 3 superblock */ + if((fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, fcpl, fapl)) <0) + goto error; + + /* Close file property lists */ + if(H5Pclose(fapl) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) + */ + + /* Fill sample data */ + for (i = 0; i < DIM1; i++) + for (j = 0; j < DIM2; j++) + buf[i][j] = 100.0F; + + /* Create the dataspace */ + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) + goto error; + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Disable partial chunk filters, triggers layout version 4 */ + if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close everything */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + if(H5Sclose(space) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + +/*********************************************************************** + * gen_v18_latest() creates file "bounds_v18_latest.h5" + * + * File contents: + * - Version 2 superblock (H5Pset_shared_mesg_index) + * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) + * + ***********************************************************************/ +#define FILENAME_18_L "bounds_v18_latest.h5" + +int gen_v18_latest() +{ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; + float buf[DIM1][DIM2]; /* Buffer for writing data */ + int i, j; + + /* Create file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set the "use the v18/latest version of the format" bounds + for creating objects in the file, also trigger version 2 superblock */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) + goto error; + + /* Create file */ + if((fid = H5Fcreate(FILENAME_18_L, H5F_ACC_TRUNC, fcpl, fapl)) <0) + goto error; + + /* Close file property lists */ + if(H5Pclose(fapl) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 3 (default) + */ + + /* Fill sample data */ + for (i = 0; i < DIM1; i++) + for (j = 0; j < DIM2; j++) + buf[i][j] = 100.0F; + + /* Create the dataspace */ + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) + goto error; + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close property list and dataset, will reuse dataspace */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + if(H5Sclose(space) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + +/*********************************************************************** + * gen_v18_v18() creates file "bounds_v18_v18.h5" + * + * File contents: + * - Version 2 superblock (H5Pset_libver_bounds(v18, v18) + * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) + * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) + * + ***********************************************************************/ +#define FILENAME_18_18 "bounds_v18_v18.h5" + +int gen_v18_v18() +{ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; + float buf[DIM1][DIM2]; /* Buffer for writing data */ + int i, j; + + /* Create file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set the "use the v18 version of the format" bounds + for creating objects in the file */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18) < 0) + goto error; + + /* Create file */ + if((fid = H5Fcreate(FILENAME_18_18, H5F_ACC_TRUNC, fcpl, fapl)) <0) + goto error; + + /* Close file property lists */ + if(H5Pclose(fapl) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 3 (default) + */ + + /* Fill sample data */ + for (i = 0; i < DIM1; i++) + for (j = 0; j < DIM2; j++) + buf[i][j] = 100.0F; + + /* Create the dataspace */ + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) + goto error; + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close property list and dataset, will reuse dataspace */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + + /* Close the file, then reopen it with the latest version */ + if(H5Fclose(fid) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set the "use the latest version of the format" bounds + for creating a layout version 4 object in the file */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) + goto error; + + if((fid = H5Fopen(FILENAME_18_18, H5F_ACC_RDWR, fapl)) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) + */ + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Disable partial chunk filters */ + if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close everything */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Pclose(fapl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + if(H5Sclose(space) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + +int main(void) +{ + /* Generate file bounds_earliest_latest.h5 */ + if (gen_earliest_latest() < 0) + goto error; + + /* Generate file bounds_earliest_v18.h5 */ + if (gen_earliest_v18() < 0) + goto error; + + /* Generate file bounds_latest_latest.h5 */ + if (gen_latest_latest() < 0) + goto error; + + /* Generate file bounds_v18_latest.h5 */ + if (gen_v18_latest() < 0) + goto error; + + /* Generate file bounds_v18_v18.h5 */ + if (gen_v18_v18() < 0) + goto error; + + return 0; + +error: + return 1; +} + -- cgit v0.12 From c3249ecd79735fd8d32f0527db40493cbe89b502 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Nov 2017 13:06:10 -0600 Subject: Update macros --- config/cmake_ext_mod/HDFMacros.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 602b6bf..192a5c8 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -108,6 +108,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set_target_properties (${libtarget} PROPERTIES + OUTPUT_NAME ${LIB_RELEASE_NAME} OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME} OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} -- cgit v0.12 From 742798b84e59b8ae346edd8d0acd9face7796051 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 27 Nov 2017 13:41:44 -0600 Subject: Fixed comment. --- test/gen_bounds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/gen_bounds.c b/test/gen_bounds.c index 1de78e8..25db7e1 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -360,7 +360,7 @@ error: * gen_v18_latest() creates file "bounds_v18_latest.h5" * * File contents: - * - Version 2 superblock (H5Pset_shared_mesg_index) + * - Version 2 superblock * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) * ***********************************************************************/ -- cgit v0.12 From daa0eb801561dc1831065e4c8c06d6cd68330200 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 27 Nov 2017 15:09:15 -0600 Subject: Further improvement --- test/gen_bounds.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/test/gen_bounds.c b/test/gen_bounds.c index 25db7e1..50b4acc 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -161,7 +161,7 @@ error: H5Fclose(fid); } H5E_END_TRY; return 1; -} +} /* gen_earliest_latest */ /*********************************************************************** * gen_earliest_v18() creates file "bounds_earliest_v18.h5" @@ -258,7 +258,7 @@ error: H5Fclose(fid); } H5E_END_TRY; return 1; -} +} /* gen_earliest_v18 */ /*********************************************************************** * gen_latest_latest() creates file "bounds_latest_latest.h5" @@ -273,8 +273,6 @@ error: int gen_latest_latest() { hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ hid_t dcpl = -1; /* Dataset creation property list ID */ hid_t space = -1; /* Dataspace ID */ hid_t dset = -1; /* Dataset ID */ @@ -283,22 +281,8 @@ int gen_latest_latest() float buf[DIM1][DIM2]; /* Buffer for writing data */ int i, j; - /* Create file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; - - /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - /* Create file with H5F_ACC_SWMR_WRITE, triggers version 3 superblock */ - if((fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, fcpl, fapl)) <0) - goto error; - - /* Close file property lists */ - if(H5Pclose(fapl) < 0) - goto error; - if(H5Pclose(fcpl) < 0) + if((fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, H5P_DEFAULT, H5P_DEFAULT)) <0) goto error; /* @@ -349,12 +333,10 @@ error: H5Dclose(dset); H5Sclose(space); H5Pclose(dcpl); - H5Pclose(fcpl); - H5Pclose(fapl); H5Fclose(fid); } H5E_END_TRY; return 1; -} +} /* gen_latest_latest */ /*********************************************************************** * gen_v18_latest() creates file "bounds_v18_latest.h5" @@ -451,7 +433,7 @@ error: H5Fclose(fid); } H5E_END_TRY; return 1; -} +} /* gen_v18_latest */ /*********************************************************************** * gen_v18_v18() creates file "bounds_v18_v18.h5" @@ -541,7 +523,7 @@ int gen_v18_v18() if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error; - /* Set the "use the latest version of the format" bounds + /* Set the "use the v18/latest version of the format" bounds for creating a layout version 4 object in the file */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) goto error; @@ -594,7 +576,7 @@ error: H5Fclose(fid); } H5E_END_TRY; return 1; -} +} /* gen_v18_v18 */ int main(void) { -- cgit v0.12 From 4db7461569a90f466ba6be14d7e292a040bc3a36 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 09:52:37 -0600 Subject: intialized h5open_f arrays --- fortran/src/H5f90global.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index ee8959e..d4a9008 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -84,9 +84,9 @@ MODULE H5GLOBAL ! These arrays need to be global because they are used in ! both h5open_f and in h5close_f - INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types - INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types - INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 ! INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE -- cgit v0.12 From 4f7af1390ba62553278dc64b65f44b8efd870b83 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 10:08:10 -0600 Subject: misc. clean-up --- fortran/src/H5f90global.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index d4a9008..4a04971 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -83,7 +83,8 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in - ! both h5open_f and in h5close_f + ! both h5open_f and in h5close_f; initialize to fix linking issues + ! on OSX and Intel compilers. INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 @@ -437,7 +438,6 @@ MODULE H5GLOBAL INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - CONTAINS ! Copy a c string to a Fortran string -- cgit v0.12 From 858e6c3c9c374fa474b7da6fd594fbc022fdc9ae Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 17 Nov 2017 13:29:04 -0700 Subject: HDFFV-10325: removed the COMMON/EQUIV statements. --- fortran/src/H5_ff.F90 | 531 ++++++++++++++++++++++++++++++++--- fortran/src/H5f90global.F90 | 668 +++++--------------------------------------- 2 files changed, 552 insertions(+), 647 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index ef89d2f..db57f03 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -38,10 +38,111 @@ MODULE H5LIB - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, C_INTPTR_T + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_INTPTR_T USE H5GLOBAL IMPLICIT NONE + PRIVATE + ! + ! H5F flags declaration + ! + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags + ! + ! H5generic flags declaration + ! + INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags + + INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags + ! + ! H5G flags declaration + ! + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags + ! + ! H5D flags declaration + ! + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags + INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags + ! + ! H5E flags declaration + ! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags + INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags + ! + ! H5FD flags declaration + ! + INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags + ! + ! H5FD file drivers flags declaration + ! + INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags + ! + ! H5I flags declaration + ! + INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags + ! + ! H5L flags declaration + ! + INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags + ! + ! H5O flags declaration + ! + INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags + ! + ! H5P flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags + ! + ! H5P integers flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int + ! + ! H5R flags declaration + ! + INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags + ! + ! H5S flags declaration + ! + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags + INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags + INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags + ! + ! H5T flags declaration + ! + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags + ! + ! H5Z flags declaration + ! + INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags + ! + ! H5 Library flags declaration + ! + INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags + + PUBLIC :: h5open_f, h5close_f, h5get_libversion_f, h5dont_atexit_f, h5kind_to_type, h5offsetof + PUBLIC :: h5garbage_collect_f, h5check_version_f + CONTAINS !****s* H5LIB/h5open_f ! @@ -65,26 +166,24 @@ CONTAINS ! ! Removed call to h5open_c since this may cause a problem for an ! application that uses HDF5 library outside HDF5 Fortran APIs. -! October 13, 2011 +! October 13, 2011 ! Fortran90 Interface: SUBROUTINE h5open_f(error) IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1, error_2, error_3 - INTERFACE + INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & BIND(C,NAME='h5init_types_c') IMPORT :: HID_T IMPORT :: PREDEF_TYPES_LEN, FLOATING_TYPES_LEN, INTEGER_TYPES_LEN IMPLICIT NONE - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & i_H5D_size_flags,& i_H5E_flags, & @@ -116,39 +215,90 @@ CONTAINS H5R_FLAGS_LEN, H5S_FLAGS_LEN, H5S_HID_FLAGS_LEN, H5S_HSIZE_FLAGS_LEN, & H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN, H5generic_haddr_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5D_flags(H5D_FLAGS_LEN) - INTEGER(SIZE_T) i_H5D_size_flags(H5D_SIZE_FLAGS_LEN) - INTEGER i_H5E_flags(H5E_FLAGS_LEN) - INTEGER(HID_T) i_H5E_hid_flags(H5E_HID_FLAGS_LEN) - INTEGER i_H5F_flags(H5F_FLAGS_LEN) - INTEGER i_H5G_flags(H5G_FLAGS_LEN) - INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) - INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - INTEGER i_H5I_flags(H5I_FLAGS_LEN) - INTEGER i_H5L_flags(H5L_FLAGS_LEN) - INTEGER i_H5O_flags(H5O_FLAGS_LEN) - INTEGER(HID_T) i_H5P_flags(H5P_FLAGS_LEN) - INTEGER i_H5P_flags_int(H5P_FLAGS_INT_LEN) - INTEGER i_H5R_flags(H5R_FLAGS_LEN) - INTEGER i_H5S_flags(H5S_FLAGS_LEN) - INTEGER(HID_T) i_H5S_hid_flags(H5S_HID_FLAGS_LEN) - INTEGER(HSIZE_T) i_H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER i_H5T_flags(H5T_FLAGS_LEN) - INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) - INTEGER i_H5generic_flags(H5generic_FLAGS_LEN) - INTEGER(HADDR_T) i_H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + INTEGER , DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags + INTEGER(SIZE_T) , DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags + INTEGER , DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags + INTEGER(HID_T) , DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags + INTEGER , DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags + INTEGER , DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags + INTEGER , DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags + INTEGER(HID_T) , DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags + INTEGER , DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags + INTEGER , DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags + INTEGER , DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags + INTEGER(HID_T) , DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags + INTEGER , DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int + INTEGER , DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags + INTEGER , DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags + INTEGER(HID_T) , DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags + INTEGER , DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags + INTEGER , DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags + INTEGER , DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init1_flags_c( i_H5LIB_flags ) & BIND(C,NAME='h5init1_flags_c') IMPORT :: H5LIB_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: i_H5LIB_flags END FUNCTION h5init1_flags_c + END INTERFACE - error_1 = h5init_types_c(predef_types, floating_types, integer_types) - error_2 = h5init_flags_c(H5D_flags, & + + error = h5init_types_c(predef_types, floating_types, integer_types) + + H5T_NATIVE_INTEGER_KIND(1:5) = predef_types(1:5) + H5T_NATIVE_INTEGER = predef_types(6) + H5T_NATIVE_REAL = predef_types(7) + H5T_NATIVE_DOUBLE = predef_types(8) + H5T_NATIVE_CHARACTER = predef_types(9) + H5T_STD_REF_OBJ = predef_types(10) + H5T_STD_REF_DSETREG = predef_types(11) + H5T_NATIVE_REAL_C_FLOAT = predef_types(12) + H5T_NATIVE_REAL_C_DOUBLE = predef_types(13) + H5T_NATIVE_REAL_C_LONG_DOUBLE = predef_types(14) + H5T_NATIVE_B8 = predef_types(15) + H5T_NATIVE_B16 = predef_types(16) + H5T_NATIVE_B32 = predef_types(17) + H5T_NATIVE_B64 = predef_types(18) + H5T_NATIVE_FLOAT_128 = predef_types(19) + + H5T_IEEE_F32BE = floating_types(1) + H5T_IEEE_F32LE = floating_types(2) + H5T_IEEE_F64BE = floating_types(3) + H5T_IEEE_F64LE = floating_types(4) + + H5T_STD_I8BE = integer_types(1) + H5T_STD_I8LE = integer_types(2) + H5T_STD_I16BE = integer_types(3) + H5T_STD_I16LE = integer_types(4) + H5T_STD_I32BE = integer_types(5) + H5T_STD_I32LE = integer_types(6) + H5T_STD_I64BE = integer_types(7) + H5T_STD_I64LE = integer_types(8) + H5T_STD_U8BE = integer_types(9) + H5T_STD_U8LE = integer_types(10) + H5T_STD_U16BE = integer_types(11) + H5T_STD_U16LE = integer_types(12) + H5T_STD_U32BE = integer_types(13) + H5T_STD_U32LE = integer_types(14) + H5T_STD_U64BE = integer_types(15) + H5T_STD_U64LE = integer_types(16) + H5T_STRING = integer_types(17) + H5T_STD_B8BE = integer_types(18) + H5T_STD_B8LE = integer_types(19) + H5T_STD_B16BE = integer_types(20) + H5T_STD_B16LE = integer_types(21) + H5T_STD_B32BE = integer_types(22) + H5T_STD_B32LE = integer_types(23) + H5T_STD_B64BE = integer_types(24) + H5T_STD_B64LE = integer_types(25) + H5T_FORTRAN_S1 = integer_types(26) + H5T_C_S1 = integer_types(27) + + error = error + h5init_flags_c(H5D_flags, & H5D_size_flags, & H5E_flags, & H5E_hid_flags, & @@ -169,8 +319,299 @@ CONTAINS H5Z_flags, & H5generic_flags,& H5generic_haddr_flags) - error_3 = h5init1_flags_c(H5LIB_flags ) - error = error_1 + error_2 + error_3 + ! + ! H5F flags + ! + H5F_ACC_RDWR_F = H5F_flags(1) + H5F_ACC_RDONLY_F = H5F_flags(2) + H5F_ACC_TRUNC_F = H5F_flags(3) + H5F_ACC_EXCL_F = H5F_flags(4) + H5F_ACC_DEBUG_F = H5F_flags(5) + H5F_SCOPE_LOCAL_F = H5F_flags(6) + H5F_SCOPE_GLOBAL_F = H5F_flags(7) + H5F_CLOSE_DEFAULT_F = H5F_flags(8) + H5F_CLOSE_WEAK_F = H5F_flags(9) + H5F_CLOSE_SEMI_F = H5F_flags(10) + H5F_CLOSE_STRONG_F = H5F_flags(11) + H5F_OBJ_FILE_F = H5F_flags(12) + H5F_OBJ_DATASET_F = H5F_flags(13) + H5F_OBJ_GROUP_F = H5F_flags(14) + H5F_OBJ_DATATYPE_F = H5F_flags(15) + H5F_OBJ_ALL_F = H5F_flags(16) + H5F_LIBVER_EARLIEST_F = H5F_flags(17) + H5F_LIBVER_LATEST_F = H5F_flags(18) + H5F_UNLIMITED_F = H5F_flags(19) + ! + ! H5generic flags + ! + H5_INDEX_UNKNOWN_F = H5generic_flags(1) + H5_INDEX_NAME_F = H5generic_flags(2) + H5_INDEX_CRT_ORDER_F = H5generic_flags(3) + H5_INDEX_N_F = H5generic_flags(4) + H5_ITER_UNKNOWN_F = H5generic_flags(5) + H5_ITER_INC_F = H5generic_flags(6) + H5_ITER_DEC_F = H5generic_flags(7) + H5_ITER_NATIVE_F = H5generic_flags(8) + H5_ITER_N_F = H5generic_flags(9) + + HADDR_UNDEF_F = H5generic_haddr_flags(1) + ! + ! H5G flags + ! + H5G_UNKNOWN_F = H5G_flags(1) + H5G_GROUP_F = H5G_flags(2) + H5G_DATASET_F = H5G_flags(3) + H5G_TYPE_F = H5G_flags(4) + H5G_SAME_LOC_F = H5G_flags(5) + H5G_LINK_ERROR_F = H5G_flags(6) + H5G_LINK_HARD_F = H5G_flags(7) + H5G_LINK_SOFT_F = H5G_flags(8) + H5G_STORAGE_TYPE_UNKNOWN_F = H5G_flags(9) + H5G_STORAGE_TYPE_SYMBOL_TABLE_F = H5G_flags(10) + H5G_STORAGE_TYPE_COMPACT_F = H5G_flags(11) + H5G_STORAGE_TYPE_DENSE_F = H5G_flags(12) + ! + ! H5D flags + ! + H5D_COMPACT_F = H5D_flags(1) + H5D_CONTIGUOUS_F = H5D_flags(2) + H5D_CHUNKED_F = H5D_flags(3) + H5D_ALLOC_TIME_ERROR_F = H5D_flags(4) + H5D_ALLOC_TIME_DEFAULT_F = H5D_flags(5) + H5D_ALLOC_TIME_EARLY_F = H5D_flags(6) + H5D_ALLOC_TIME_LATE_F = H5D_flags(7) + H5D_ALLOC_TIME_INCR_F = H5D_flags(8) + H5D_SPACE_STS_ERROR_F = H5D_flags(9) + H5D_SPACE_STS_NOT_ALLOCATED_F = H5D_flags(10) + H5D_SPACE_STS_PART_ALLOCATED_F = H5D_flags(11) + H5D_SPACE_STS_ALLOCATED_F = H5D_flags(12) + H5D_FILL_TIME_ERROR_F = H5D_flags(13) + H5D_FILL_TIME_ALLOC_F = H5D_flags(14) + H5D_FILL_TIME_NEVER_F = H5D_flags(15) + H5D_FILL_VALUE_ERROR_F = H5D_flags(16) + H5D_FILL_VALUE_UNDEFINED_F = H5D_flags(17) + H5D_FILL_VALUE_DEFAULT_F = H5D_flags(18) + H5D_FILL_VALUE_USER_DEFINED_F = H5D_flags(19) + H5D_CHUNK_CACHE_W0_DFLT_F = H5D_flags(20) + H5D_MPIO_NO_COLLECTIVE_F = H5D_flags(21) + H5D_MPIO_CHUNK_INDEPENDENT_F = H5D_flags(22) + H5D_MPIO_CHUNK_COLLECTIVE_F = H5D_flags(23) + H5D_MPIO_CHUNK_MIXED_F = H5D_flags(24) + H5D_MPIO_CONTIG_COLLECTIVE_F = H5D_flags(25) + H5D_VDS_ERROR_F = H5D_flags(26) + H5D_VDS_FIRST_MISSING_F = H5D_flags(27) + H5D_VDS_LAST_AVAILABLE_F = H5D_flags(28) + H5D_VIRTUAL_F = H5D_flags(29) + + H5D_CHUNK_CACHE_NSLOTS_DFLT_F = H5D_size_flags(1) + H5D_CHUNK_CACHE_NBYTES_DFLT_F = H5D_size_flags(2) + ! + ! H5E flags + ! + H5E_DEFAULT_F = H5E_hid_flags(1) + + H5E_MAJOR_F = H5E_flags(1) + H5E_MINOR_F = H5E_flags(2) + H5E_WALK_UPWARD_F = H5E_flags(3) + H5E_WALK_DOWNWARD_F = H5E_flags(4) + ! + ! H5FD flags + ! + H5FD_MPIO_INDEPENDENT_F = H5FD_flags(1) + H5FD_MPIO_COLLECTIVE_F = H5FD_flags(2) + H5FD_MEM_NOLIST_F = H5FD_flags(3) + H5FD_MEM_DEFAULT_F = H5FD_flags(4) + H5FD_MEM_SUPER_F = H5FD_flags(5) + H5FD_MEM_BTREE_F = H5FD_flags(6) + H5FD_MEM_DRAW_F = H5FD_flags(7) + H5FD_MEM_GHEAP_F = H5FD_flags(8) + H5FD_MEM_LHEAP_F = H5FD_flags(9) + H5FD_MEM_OHDR_F = H5FD_flags(10) + H5FD_MEM_NTYPES_F = H5FD_flags(11) + ! + ! H5FD file driver flags + ! + H5FD_CORE_F = H5FD_hid_flags(1) + H5FD_FAMILY_F = H5FD_hid_flags(2) + H5FD_LOG_F = H5FD_hid_flags(3) + H5FD_MPIO_F = H5FD_hid_flags(4) + H5FD_MULTI_F = H5FD_hid_flags(5) + H5FD_SEC2_F = H5FD_hid_flags(6) + H5FD_STDIO_F = H5FD_hid_flags(7) + ! + ! H5I flags declaration + ! + H5I_FILE_F = H5I_flags(1) + H5I_GROUP_F = H5I_flags(2) + H5I_DATATYPE_F = H5I_flags(3) + H5I_DATASPACE_F = H5I_flags(4) + H5I_DATASET_F = H5I_flags(5) + H5I_ATTR_F = H5I_flags(6) + H5I_BADID_F = H5I_flags(7) + ! + ! H5L flags + ! + H5L_TYPE_ERROR_F = H5L_flags(1) + H5L_TYPE_HARD_F = H5L_flags(2) + H5L_TYPE_SOFT_F = H5L_flags(3) + H5L_TYPE_EXTERNAL_F = H5L_flags(4) + H5L_SAME_LOC_F = H5L_flags(5) + H5L_LINK_CLASS_T_VERS_F = H5L_flags(6) + ! + ! H5O flags + ! + H5O_COPY_SHALLOW_HIERARCHY_F = h5o_flags(1) + H5O_COPY_EXPAND_SOFT_LINK_F = h5o_flags(2) + H5O_COPY_EXPAND_EXT_LINK_F = h5o_flags(3) + H5O_COPY_EXPAND_REFERENCE_F = h5o_flags(4) + H5O_COPY_WITHOUT_ATTR_FLAG_F = h5o_flags(5) + H5O_COPY_PRESERVE_NULL_FLAG_F = h5o_flags(6) + H5O_COPY_ALL_F = h5o_flags(7) + H5O_SHMESG_NONE_FLAG_F = h5o_flags(8) + H5O_SHMESG_SDSPACE_FLAG_F = h5o_flags(9) + H5O_SHMESG_DTYPE_FLAG_F = h5o_flags(10) + H5O_SHMESG_FILL_FLAG_F = h5o_flags(11) + H5O_SHMESG_PLINE_FLAG_F = h5o_flags(12) + H5O_SHMESG_ATTR_FLAG_F = h5o_flags(13) + H5O_SHMESG_ALL_FLAG_F = h5o_flags(14) + H5O_HDR_CHUNK0_SIZE_F = h5o_flags(15) + H5O_HDR_ATTR_CRT_ORDER_TRACK_F = h5o_flags(16) + H5O_HDR_ATTR_CRT_ORDER_INDEX_F = h5o_flags(17) + H5O_HDR_ATTR_STORE_PHASE_CHA_F = h5o_flags(18) + H5O_HDR_STORE_TIMES_F = h5o_flags(19) + H5O_HDR_ALL_FLAGS_F = h5o_flags(20) + H5O_SHMESG_MAX_NINDEXES_F = h5o_flags(21) + H5O_SHMESG_MAX_LIST_SIZE_F = h5o_flags(22) + H5O_TYPE_UNKNOWN_F = h5o_flags(23) + H5O_TYPE_GROUP_F = h5o_flags(24) + H5O_TYPE_DATASET_F = h5o_flags(25) + H5O_TYPE_NAMED_DATATYPE_F = h5o_flags(26) + H5O_TYPE_NTYPES_F = h5o_flags(27) + ! + ! H5P flags + ! + H5P_FILE_CREATE_F = H5P_flags(1) + H5P_FILE_ACCESS_F = H5P_flags(2) + H5P_DATASET_CREATE_F = H5P_flags(3) + H5P_DATASET_XFER_F = H5P_flags(4) + H5P_FILE_MOUNT_F = H5P_flags(5) + H5P_DEFAULT_F = H5P_flags(6) + H5P_ROOT_F = H5P_flags(7) + H5P_OBJECT_CREATE_F = H5P_flags(8) + H5P_DATASET_ACCESS_F = H5P_flags(9) + H5P_GROUP_CREATE_F = H5P_flags(10) + H5P_GROUP_ACCESS_F = H5P_flags(11) + H5P_DATATYPE_CREATE_F = H5P_flags(12) + H5P_DATATYPE_ACCESS_F = H5P_flags(13) + H5P_STRING_CREATE_F = H5P_flags(14) + H5P_ATTRIBUTE_CREATE_F = H5P_flags(15) + H5P_OBJECT_COPY_F = H5P_flags(16) + H5P_LINK_CREATE_F = H5P_flags(17) + H5P_LINK_ACCESS_F = H5P_flags(18) + ! + ! H5P integers flags + ! + H5P_CRT_ORDER_INDEXED_F = H5P_flags_int(1) + H5P_CRT_ORDER_TRACKED_F = H5P_flags_int(2) + ! + ! H5R flags + ! + H5R_OBJECT_F = H5R_flags(1) + H5R_DATASET_REGION_F = H5R_flags(2) + ! + ! H5S flags + ! + H5S_ALL_F = H5S_hid_flags(1) + + H5S_UNLIMITED_F = H5S_hsize_flags(1) + + H5S_SCALAR_F = H5S_flags(1) + H5S_SIMPLE_F = H5S_flags(2) + H5S_NULL_F = H5S_flags(3) + H5S_SELECT_SET_F = H5S_flags(4) + H5S_SELECT_OR_F = H5S_flags(5) + H5S_SELECT_NOOP_F = H5S_flags(6) + H5S_SELECT_AND_F = H5S_flags(7) + H5S_SELECT_XOR_F = H5S_flags(8) + H5S_SELECT_NOTB_F = H5S_flags(9) + H5S_SELECT_NOTA_F = H5S_flags(10) + H5S_SELECT_APPEND_F = H5S_flags(11) + H5S_SELECT_PREPEND_F = H5S_flags(12) + H5S_SELECT_INVALID_F = H5S_flags(13) + H5S_SEL_ERROR_F = H5S_flags(14) + H5S_SEL_NONE_F = H5S_flags(15) + H5S_SEL_POINTS_F = H5S_flags(16) + H5S_SEL_HYPERSLABS_F = H5S_flags(17) + H5S_SEL_ALL_F = H5S_flags(18) + ! + ! H5T flags declaration + ! + H5T_NO_CLASS_F = H5T_flags(1) + H5T_INTEGER_F = H5T_flags(2) + H5T_FLOAT_F = H5T_flags(3) + H5T_TIME_F = H5T_flags(4) + H5T_STRING_F = H5T_flags(5) + H5T_BITFIELD_F = H5T_flags(6) + H5T_OPAQUE_F = H5T_flags(7) + H5T_COMPOUND_F = H5T_flags(8) + H5T_REFERENCE_F = H5T_flags(9) + H5T_ENUM_F = H5T_flags(10) + H5T_ORDER_LE_F = H5T_flags(11) + H5T_ORDER_BE_F = H5T_flags(12) + H5T_ORDER_MIXED_F = H5T_flags(13) + H5T_ORDER_VAX_F = H5T_flags(14) + H5T_ORDER_NONE_F = H5T_flags(15) + H5T_PAD_ZERO_F = H5T_flags(16) + H5T_PAD_ONE_F = H5T_flags(17) + H5T_PAD_BACKGROUND_F = H5T_flags(18) + H5T_PAD_ERROR_F = H5T_flags(19) + H5T_SGN_NONE_F = H5T_flags(20) + H5T_SGN_2_F = H5T_flags(21) + H5T_SGN_ERROR_F = H5T_flags(22) + H5T_NORM_IMPLIED_F = H5T_flags(23) + H5T_NORM_MSBSET_F = H5T_flags(24) + H5T_NORM_NONE_F = H5T_flags(25) + H5T_CSET_ASCII_F = H5T_flags(26) + H5T_CSET_UTF8_F = H5T_flags(27) + H5T_STR_NULLTERM_F = H5T_flags(28) + H5T_STR_NULLPAD_F = H5T_flags(29) + H5T_STR_SPACEPAD_F = H5T_flags(30) + H5T_STR_ERROR_F = H5T_flags(31) + H5T_VLEN_F = H5T_flags(32) + H5T_ARRAY_F = H5T_flags(33) + H5T_DIR_ASCEND_F = H5T_flags(34) + H5T_DIR_DESCEND_F = H5T_flags(35) + ! + ! H5Z flags + ! + H5Z_FILTER_ERROR_F = H5Z_flags(1) + H5Z_FILTER_NONE_F = H5Z_flags(2) + H5Z_FILTER_DEFLATE_F = H5Z_flags(3) + H5Z_FILTER_SHUFFLE_F = H5Z_flags(4) + H5Z_FILTER_FLETCHER32_F = H5Z_flags(5) + H5Z_ERROR_EDC_F = H5Z_flags(6) + H5Z_DISABLE_EDC_F = H5Z_flags(7) + H5Z_ENABLE_EDC_F = H5Z_flags(8) + H5Z_NO_EDC_F = H5Z_flags(9) + H5Z_FILTER_SZIP_F = H5Z_flags(10) + H5Z_FLAG_OPTIONAL_F = H5Z_flags(11) + H5Z_FILTER_ENCODE_ENABLED_F = H5Z_flags(12) + H5Z_FILTER_DECODE_ENABLED_F = H5Z_flags(13) + H5Z_FILTER_ALL_F = H5Z_flags(14) + H5Z_FILTER_NBIT_F = H5Z_flags(15) + H5Z_FILTER_SCALEOFFSET_F = H5Z_flags(16) + H5Z_SO_FLOAT_DSCALE_F = H5Z_flags(17) + H5Z_SO_FLOAT_ESCALE_F = H5Z_flags(18) + H5Z_SO_INT_F = H5Z_flags(19) + H5Z_SO_INT_MINBITS_DEFAULT_F = H5Z_flags(20) + + error = error + h5init1_flags_c(H5LIB_flags) + ! + ! H5 Library flags + ! + H5_SZIP_EC_OM_F = H5LIB_flags(1) + H5_SZIP_NN_OM_F = H5LIB_flags(2) + END SUBROUTINE h5open_f !****s* H5LIB/h5close_f @@ -201,25 +642,23 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1 INTERFACE INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & f_types, F_TYPES_LEN, & i_types, I_TYPES_LEN ) & BIND(C,NAME='h5close_types_c') IMPORT :: HID_T - INTEGER P_TYPES_LEN - INTEGER F_TYPES_LEN - INTEGER I_TYPES_LEN - INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types + INTEGER :: P_TYPES_LEN + INTEGER :: F_TYPES_LEN + INTEGER :: I_TYPES_LEN + INTEGER(HID_T), DIMENSION(1:P_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:F_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:I_TYPES_LEN) :: i_types END FUNCTION h5close_types_c END INTERFACE - error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & + error = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & floating_types, FLOATING_TYPES_LEN, & integer_types, INTEGER_TYPES_LEN ) - error = error_1 END SUBROUTINE h5close_f diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 629418a..d4a9008 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -50,7 +50,6 @@ MODULE H5GLOBAL END ENUM INTEGER, PARAMETER :: ENUM_T = KIND(enum_dtype) - ! Definitions for reference datatypes. ! If you change the value of these parameters, do not forget to change corresponding ! values in the H5f90.h file. @@ -71,9 +70,9 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change this - ! value when new predefined - ! datatypes are added + ! Do not forget to change this value when new predefined + ! datatypes are added + INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change the following line when new predefined ! floating data types are added @@ -83,32 +82,56 @@ MODULE H5GLOBAL ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT, & - H5T_NATIVE_REAL_C_DOUBLE, & - H5T_NATIVE_REAL_C_LONG_DOUBLE, & - H5T_NATIVE_INTEGER, & - H5T_NATIVE_REAL, & - H5T_NATIVE_DOUBLE, & - H5T_NATIVE_CHARACTER , & - H5T_STD_REF_OBJ, & - H5T_STD_REF_DSETREG, & - H5T_IEEE_F32BE, & - H5T_IEEE_F32LE, & - H5T_IEEE_F64BE, & - H5T_IEEE_F64LE, & - H5T_STD_I8BE, & - H5T_STD_I8LE, & - H5T_STD_I16BE, & - H5T_STD_I16LE, & - H5T_STD_I32BE, & - H5T_STD_I32LE, & - H5T_STD_I64BE, & - H5T_STD_I64LE, & - H5T_STD_U8BE, & - H5T_STD_U8LE, & - H5T_STD_U16BE, & - H5T_STD_U16LE, & - H5T_STD_U32BE + ! These arrays need to be global because they are used in + ! both h5open_f and in h5close_f + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 + ! + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_INTEGER + INTEGER(HID_T) :: H5T_NATIVE_REAL + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER + INTEGER(HID_T) :: H5T_STD_REF_OBJ + INTEGER(HID_T) :: H5T_STD_REF_DSETREG + INTEGER(HID_T) :: H5T_IEEE_F32BE + INTEGER(HID_T) :: H5T_IEEE_F32LE + INTEGER(HID_T) :: H5T_IEEE_F64BE + INTEGER(HID_T) :: H5T_IEEE_F64LE + INTEGER(HID_T) :: H5T_STD_I8BE + INTEGER(HID_T) :: H5T_STD_I8LE + INTEGER(HID_T) :: H5T_STD_I16BE + INTEGER(HID_T) :: H5T_STD_I16LE + INTEGER(HID_T) :: H5T_STD_I32BE + INTEGER(HID_T) :: H5T_STD_I32LE + INTEGER(HID_T) :: H5T_STD_I64BE + INTEGER(HID_T) :: H5T_STD_I64LE + INTEGER(HID_T) :: H5T_STD_U8BE + INTEGER(HID_T) :: H5T_STD_U8LE + INTEGER(HID_T) :: H5T_STD_U16BE + INTEGER(HID_T) :: H5T_STD_U16LE + INTEGER(HID_T) :: H5T_STD_U32BE + INTEGER(HID_T) :: H5T_STD_U32LE + INTEGER(HID_T) :: H5T_STD_U64BE + INTEGER(HID_T) :: H5T_STD_U64LE + INTEGER(HID_T) :: H5T_STRING + INTEGER(HID_T) :: H5T_STD_B8BE + INTEGER(HID_T) :: H5T_STD_B8LE + INTEGER(HID_T) :: H5T_STD_B16BE + INTEGER(HID_T) :: H5T_STD_B16LE + INTEGER(HID_T) :: H5T_STD_B32BE + INTEGER(HID_T) :: H5T_STD_B32LE + INTEGER(HID_T) :: H5T_STD_B64BE + INTEGER(HID_T) :: H5T_STD_B64LE + INTEGER(HID_T) :: H5T_NATIVE_B8 + INTEGER(HID_T) :: H5T_NATIVE_B16 + INTEGER(HID_T) :: H5T_NATIVE_B32 + INTEGER(HID_T) :: H5T_NATIVE_B64 + INTEGER(HID_T) :: H5T_FORTRAN_S1 + INTEGER(HID_T) :: H5T_C_S1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -116,139 +139,22 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- -! NOTE: Splitting the line since the Fortran 95 standard limits the number of -! continuation lines to 39; the F03/F08 standard limits the number -! to 255 lines. - - INTEGER(HID_T) :: H5T_STD_U32LE, & - H5T_STD_U64BE, & - H5T_STD_U64LE, & - H5T_STRING, & - H5T_STD_B8BE, & - H5T_STD_B8LE, & - H5T_STD_B16BE, & - H5T_STD_B16LE, & - H5T_STD_B32BE, & - H5T_STD_B32LE, & - H5T_STD_B64BE, & - H5T_STD_B64LE, & - H5T_NATIVE_B8, & - H5T_NATIVE_B16, & - H5T_NATIVE_B32, & - H5T_NATIVE_B64, & - H5T_FORTRAN_S1, & - H5T_C_S1 - - - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types - EQUIVALENCE (predef_types(1), H5T_NATIVE_INTEGER_KIND(1)) - ! EQUIVALENCE predef_types(2:5) are unnecessary and violate the standard - EQUIVALENCE (predef_types(6), H5T_NATIVE_INTEGER) - EQUIVALENCE (predef_types(7), H5T_NATIVE_REAL) - EQUIVALENCE (predef_types(8), H5T_NATIVE_DOUBLE) - EQUIVALENCE (predef_types(9), H5T_NATIVE_CHARACTER) - EQUIVALENCE (predef_types(10), H5T_STD_REF_OBJ) - EQUIVALENCE (predef_types(11), H5T_STD_REF_DSETREG) - EQUIVALENCE (predef_types(12), H5T_NATIVE_REAL_C_FLOAT) - EQUIVALENCE (predef_types(13), H5T_NATIVE_REAL_C_DOUBLE) - EQUIVALENCE (predef_types(14), H5T_NATIVE_REAL_C_LONG_DOUBLE) - EQUIVALENCE (predef_types(15), H5T_NATIVE_B8 ) - EQUIVALENCE (predef_types(16), H5T_NATIVE_B16) - EQUIVALENCE (predef_types(17), H5T_NATIVE_B32) - EQUIVALENCE (predef_types(18), H5T_NATIVE_B64) - EQUIVALENCE (predef_types(19), H5T_NATIVE_FLOAT_128) ! ADDED NEW TYPE -MSB- - - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types - EQUIVALENCE (floating_types(1), H5T_IEEE_F32BE ) - EQUIVALENCE (floating_types(2), H5T_IEEE_F32LE) - EQUIVALENCE (floating_types(3), H5T_IEEE_F64BE) - EQUIVALENCE (floating_types(4), H5T_IEEE_F64LE) - - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types - EQUIVALENCE (integer_types(1), H5T_STD_I8BE ) - EQUIVALENCE (integer_types(2), H5T_STD_I8LE) - EQUIVALENCE (integer_types(3), H5T_STD_I16BE) - EQUIVALENCE (integer_types(4), H5T_STD_I16LE) - EQUIVALENCE (integer_types(5), H5T_STD_I32BE) - EQUIVALENCE (integer_types(6), H5T_STD_I32LE) - EQUIVALENCE (integer_types(7), H5T_STD_I64BE) - EQUIVALENCE (integer_types(8), H5T_STD_I64LE) - EQUIVALENCE (integer_types(9), H5T_STD_U8BE) - EQUIVALENCE (integer_types(10), H5T_STD_U8LE) - EQUIVALENCE (integer_types(11), H5T_STD_U16BE) - EQUIVALENCE (integer_types(12), H5T_STD_U16LE) - EQUIVALENCE (integer_types(13), H5T_STD_U32BE) - EQUIVALENCE (integer_types(14), H5T_STD_U32LE) - EQUIVALENCE (integer_types(15), H5T_STD_U64BE) - EQUIVALENCE (integer_types(16), H5T_STD_U64LE) - EQUIVALENCE (integer_types(17), H5T_STRING) - EQUIVALENCE (integer_types(18), H5T_STD_B8BE) - EQUIVALENCE (integer_types(19), H5T_STD_B8LE) - EQUIVALENCE (integer_types(20), H5T_STD_B16BE) - EQUIVALENCE (integer_types(21), H5T_STD_B16LE) - EQUIVALENCE (integer_types(22), H5T_STD_B32BE) - EQUIVALENCE (integer_types(23), H5T_STD_B32LE) - EQUIVALENCE (integer_types(24), H5T_STD_B64BE) - EQUIVALENCE (integer_types(25), H5T_STD_B64LE) - EQUIVALENCE (integer_types(26), H5T_FORTRAN_S1) - EQUIVALENCE (integer_types(27), H5T_C_S1) - - - ! COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & - ! H5T_NATIVE_REAL, & - ! H5T_NATIVE_DOUBLE, & - ! H5T_NATIVE_CHARACTER, & - ! H5T_STD_REF_OBJ, & - ! H5T_STD_REF_DSETREG - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /PREDEFINED_TYPES/ - !DEC$endif - COMMON /PREDEFINED_TYPES/ predef_types - - ! COMMON /FLOATING_TYPES/ H5T_IEEE_F32BE, & - ! H5T_IEEE_F32LE, & - ! H5T_IEEE_F64BE, & - ! H5T_IEEE_F64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /FLOATING_TYPES/ - !DEC$endif - COMMON /FLOATING_TYPES/ floating_types - ! - ! COMMON /INTEGER_TYPES/ H5T_STD_I8BE, & - ! H5T_STD_I8LE, & - ! H5T_STD_I16BE, & - ! H5T_STD_I16LE, & - ! H5T_STD_I32BE, & - ! H5T_STD_I32LE, & - ! H5T_STD_I64BE, & - ! H5T_STD_I64LE, & - ! H5T_STD_U8BE, & - ! H5T_STD_U8LE, & - ! H5T_STD_U16BE, & - ! H5T_STD_U16LE, & - ! H5T_STD_U32BE, & - ! H5T_STD_U32LE, & - ! H5T_STD_U64BE, & - ! H5T_STD_U64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /INTEGER_TYPES/ - !DEC$endif - COMMON /INTEGER_TYPES/ integer_types - ! - ! Fortran flags - ! + ! H5generic flags declaration ! - ! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDED !) + INTEGER :: H5_INDEX_UNKNOWN_F + INTEGER :: H5_INDEX_NAME_F + INTEGER :: H5_INDEX_CRT_ORDER_F + INTEGER :: H5_INDEX_N_F + INTEGER :: H5_ITER_UNKNOWN_F + INTEGER :: H5_ITER_INC_F + INTEGER :: H5_ITER_DEC_F + INTEGER :: H5_ITER_NATIVE_F + INTEGER :: H5_ITER_N_F + + INTEGER(HADDR_T) :: HADDR_UNDEF_F ! ! H5F flags declaration ! - INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER :: H5F_flags(H5F_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ - !DEC$endif - COMMON /H5F_FLAGS/ H5F_flags - INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -268,77 +174,9 @@ MODULE H5GLOBAL INTEGER :: H5F_LIBVER_EARLIEST_F INTEGER :: H5F_LIBVER_LATEST_F INTEGER :: H5F_UNLIMITED_F - - EQUIVALENCE(H5F_flags(1), H5F_ACC_RDWR_F) - EQUIVALENCE(H5F_flags(2), H5F_ACC_RDONLY_F) - EQUIVALENCE(H5F_flags(3), H5F_ACC_TRUNC_F) - EQUIVALENCE(H5F_flags(4), H5F_ACC_EXCL_F) - EQUIVALENCE(H5F_flags(5), H5F_ACC_DEBUG_F) - EQUIVALENCE(H5F_flags(6), H5F_SCOPE_LOCAL_F) - EQUIVALENCE(H5F_flags(7), H5F_SCOPE_GLOBAL_F) - EQUIVALENCE(H5F_flags(8), H5F_CLOSE_DEFAULT_F) - EQUIVALENCE(H5F_flags(9), H5F_CLOSE_WEAK_F) - EQUIVALENCE(H5F_flags(10), H5F_CLOSE_SEMI_F) - EQUIVALENCE(H5F_flags(11), H5F_CLOSE_STRONG_F) - EQUIVALENCE(H5F_flags(12), H5F_OBJ_FILE_F) - EQUIVALENCE(H5F_flags(13), H5F_OBJ_DATASET_F) - EQUIVALENCE(H5F_flags(14), H5F_OBJ_GROUP_F) - EQUIVALENCE(H5F_flags(15), H5F_OBJ_DATATYPE_F) - EQUIVALENCE(H5F_flags(16), H5F_OBJ_ALL_F) - EQUIVALENCE(H5F_flags(17), H5F_LIBVER_EARLIEST_F) - EQUIVALENCE(H5F_flags(18), H5F_LIBVER_LATEST_F) - EQUIVALENCE(H5F_flags(19), H5F_UNLIMITED_F) - ! - ! H5generic flags declaration - ! - INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ - !DEC$endif - COMMON /H5generic_FLAGS/ H5generic_flags - - INTEGER :: H5_INDEX_UNKNOWN_F - INTEGER :: H5_INDEX_NAME_F - INTEGER :: H5_INDEX_CRT_ORDER_F - INTEGER :: H5_INDEX_N_F - INTEGER :: H5_ITER_UNKNOWN_F - INTEGER :: H5_ITER_INC_F - INTEGER :: H5_ITER_DEC_F - INTEGER :: H5_ITER_NATIVE_F - INTEGER :: H5_ITER_N_F - - EQUIVALENCE(H5generic_flags(1), H5_INDEX_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(2), H5_INDEX_NAME_F) - EQUIVALENCE(H5generic_flags(3), H5_INDEX_CRT_ORDER_F) - EQUIVALENCE(H5generic_flags(4), H5_INDEX_N_F) - EQUIVALENCE(H5generic_flags(5), H5_ITER_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(6), H5_ITER_INC_F) - EQUIVALENCE(H5generic_flags(7), H5_ITER_DEC_F) - EQUIVALENCE(H5generic_flags(8), H5_ITER_NATIVE_F) - EQUIVALENCE(H5generic_flags(9), H5_ITER_N_F) - - INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_haddr_FLAGS/ - !DEC$endif - COMMON /H5generic_haddr_FLAGS/ H5generic_haddr_flags - - INTEGER(HADDR_T) :: HADDR_UNDEF_F - - EQUIVALENCE(H5generic_haddr_flags(1), HADDR_UNDEF_F) - ! ! H5G flags declaration ! - INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER :: H5G_flags(H5G_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ - !DEC$endif - COMMON /H5G_FLAGS/ H5G_flags - INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -353,35 +191,9 @@ MODULE H5GLOBAL INTEGER :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F INTEGER :: H5G_STORAGE_TYPE_COMPACT_F INTEGER :: H5G_STORAGE_TYPE_DENSE_F - - EQUIVALENCE(H5G_flags(1), H5G_UNKNOWN_F) ! Unknown object type - EQUIVALENCE(H5G_flags(2), H5G_GROUP_F) ! Object is a group - EQUIVALENCE(H5G_flags(3), H5G_DATASET_F) ! Object is a dataset - EQUIVALENCE(H5G_flags(4), H5G_TYPE_F) ! Object is a named data type - EQUIVALENCE(H5G_flags(5), H5G_SAME_LOC_F) - EQUIVALENCE(H5G_flags(6), H5G_LINK_ERROR_F) - EQUIVALENCE(H5G_flags(7), H5G_LINK_HARD_F) - EQUIVALENCE(H5G_flags(8), H5G_LINK_SOFT_F) - - EQUIVALENCE(H5G_flags(9), H5G_STORAGE_TYPE_UNKNOWN_F ) - EQUIVALENCE(H5G_flags(10), H5G_STORAGE_TYPE_SYMBOL_TABLE_F) - EQUIVALENCE(H5G_flags(11), H5G_STORAGE_TYPE_COMPACT_F) - EQUIVALENCE(H5G_flags(12), H5G_STORAGE_TYPE_DENSE_F) - ! ! H5D flags declaration ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER :: H5D_flags(H5D_FLAGS_LEN) - INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_SIZE_FLAGS/ - !DEC$endif - COMMON /H5D_FLAGS/ H5D_flags - COMMON /H5D_SIZE_FLAGS/ H5D_size_flags - INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -413,6 +225,7 @@ MODULE H5GLOBAL INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + INTEGER :: H5D_CHUNK_CACHE_W0_DFLT_F INTEGER :: H5D_MPIO_NO_COLLECTIVE_F INTEGER :: H5D_MPIO_CHUNK_INDEPENDENT_F @@ -423,81 +236,17 @@ MODULE H5GLOBAL INTEGER :: H5D_VDS_FIRST_MISSING_F INTEGER :: H5D_VDS_LAST_AVAILABLE_F INTEGER :: H5D_VIRTUAL_F - - EQUIVALENCE(H5D_flags(1), H5D_COMPACT_F) - EQUIVALENCE(H5D_flags(2), H5D_CONTIGUOUS_F) - EQUIVALENCE(H5D_flags(3), H5D_CHUNKED_F) - - EQUIVALENCE(H5D_flags(4), H5D_ALLOC_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(5), H5D_ALLOC_TIME_DEFAULT_F) - EQUIVALENCE(H5D_flags(6), H5D_ALLOC_TIME_EARLY_F) - EQUIVALENCE(H5D_flags(7), H5D_ALLOC_TIME_LATE_F) - EQUIVALENCE(H5D_flags(8), H5D_ALLOC_TIME_INCR_F) - - EQUIVALENCE(H5D_flags(9), H5D_SPACE_STS_ERROR_F) - EQUIVALENCE(H5D_flags(10), H5D_SPACE_STS_NOT_ALLOCATED_F) - EQUIVALENCE(H5D_flags(11), H5D_SPACE_STS_PART_ALLOCATED_F) - EQUIVALENCE(H5D_flags(12), H5D_SPACE_STS_ALLOCATED_F) - - EQUIVALENCE(H5D_flags(13), H5D_FILL_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(14), H5D_FILL_TIME_ALLOC_F) - EQUIVALENCE(H5D_flags(15), H5D_FILL_TIME_NEVER_F) - - EQUIVALENCE(H5D_flags(16), H5D_FILL_VALUE_ERROR_F) - EQUIVALENCE(H5D_flags(17), H5D_FILL_VALUE_UNDEFINED_F) - EQUIVALENCE(H5D_flags(18), H5D_FILL_VALUE_DEFAULT_F) - EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) - - EQUIVALENCE(H5D_flags(20), H5D_CHUNK_CACHE_W0_DFLT_F) - EQUIVALENCE(H5D_flags(21), H5D_MPIO_NO_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(22), H5D_MPIO_CHUNK_INDEPENDENT_F) - EQUIVALENCE(H5D_flags(23), H5D_MPIO_CHUNK_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(24), H5D_MPIO_CHUNK_MIXED_F) - EQUIVALENCE(H5D_flags(25), H5D_MPIO_CONTIG_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(26), H5D_VDS_ERROR_F) - EQUIVALENCE(H5D_flags(27), H5D_VDS_FIRST_MISSING_F) - EQUIVALENCE(H5D_flags(28), H5D_VDS_LAST_AVAILABLE_F) - EQUIVALENCE(H5D_flags(29), H5D_VIRTUAL_F) - - EQUIVALENCE(H5D_size_flags(1), H5D_CHUNK_CACHE_NSLOTS_DFLT_F) - EQUIVALENCE(H5D_size_flags(2), H5D_CHUNK_CACHE_NBYTES_DFLT_F) - ! ! H5E flags declaration ! - INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER :: H5E_flags(H5E_FLAGS_LEN) - INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_HID_FLAGS/ - !DEC$endif - COMMON /H5E_FLAGS/ H5E_flags - COMMON /H5E_HID_FLAGS/ H5E_hid_flags - INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F INTEGER :: H5E_WALK_UPWARD_F INTEGER :: H5E_WALK_DOWNWARD_F - - EQUIVALENCE(H5E_hid_flags(1), H5E_DEFAULT_F) - EQUIVALENCE(H5E_flags(1) , H5E_MAJOR_F) - EQUIVALENCE(H5E_flags(2) , H5E_MINOR_F) - EQUIVALENCE(H5E_flags(3) , H5E_WALK_UPWARD_F) - EQUIVALENCE(H5E_flags(4) , H5E_WALK_DOWNWARD_F) - ! - ! H5FD flags declaration + ! H5FD file drivers flags declaration ! - INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_FLAGS/ - !DEC$endif - COMMON /H5FD_FLAGS/ H5FD_flags - INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -509,28 +258,6 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F INTEGER :: H5FD_MEM_NTYPES_F - - EQUIVALENCE(H5FD_flags(1), H5FD_MPIO_INDEPENDENT_F) - EQUIVALENCE(H5FD_flags(2), H5FD_MPIO_COLLECTIVE_F) - EQUIVALENCE(H5FD_flags(3), H5FD_MEM_NOLIST_F) - EQUIVALENCE(H5FD_flags(4), H5FD_MEM_DEFAULT_F) - EQUIVALENCE(H5FD_flags(5), H5FD_MEM_SUPER_F) - EQUIVALENCE(H5FD_flags(6), H5FD_MEM_BTREE_F) - EQUIVALENCE(H5FD_flags(7), H5FD_MEM_DRAW_F) - EQUIVALENCE(H5FD_flags(8), H5FD_MEM_GHEAP_F) - EQUIVALENCE(H5FD_flags(9), H5FD_MEM_LHEAP_F) - EQUIVALENCE(H5FD_flags(10), H5FD_MEM_OHDR_F) - EQUIVALENCE(H5FD_flags(11), H5FD_MEM_NTYPES_F) - ! - ! H5FD file drivers flags declaration - ! - INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/ - !DEC$endif - COMMON /H5FD_HID_FLAGS/ H5FD_hid_flags - INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F @@ -538,25 +265,9 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5FD_MULTI_F INTEGER(HID_T) :: H5FD_SEC2_F INTEGER(HID_T) :: H5FD_STDIO_F - - EQUIVALENCE(H5FD_hid_flags(1), H5FD_CORE_F) - EQUIVALENCE(H5FD_hid_flags(2), H5FD_FAMILY_F) - EQUIVALENCE(H5FD_hid_flags(3), H5FD_LOG_F) - EQUIVALENCE(H5FD_hid_flags(4), H5FD_MPIO_F) - EQUIVALENCE(H5FD_hid_flags(5), H5FD_MULTI_F) - EQUIVALENCE(H5FD_hid_flags(6), H5FD_SEC2_F) - EQUIVALENCE(H5FD_hid_flags(7), H5FD_STDIO_F) - ! ! H5I flags declaration ! - INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER :: H5I_flags(H5I_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5I_FLAGS/ - !DEC$endif - COMMON /H5I_FLAGS/ H5I_flags - INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -564,48 +275,18 @@ MODULE H5GLOBAL INTEGER :: H5I_DATASET_F INTEGER :: H5I_ATTR_F INTEGER :: H5I_BADID_F - - EQUIVALENCE(H5I_flags(1), H5I_FILE_F) - EQUIVALENCE(H5I_flags(2), H5I_GROUP_F) - EQUIVALENCE(H5I_flags(3), H5I_DATATYPE_F) - EQUIVALENCE(H5I_flags(4), H5I_DATASPACE_F) - EQUIVALENCE(H5I_flags(5), H5I_DATASET_F) - EQUIVALENCE(H5I_flags(6), H5I_ATTR_F) - EQUIVALENCE(H5I_flags(7), H5I_BADID_F) ! ! H5L flags declaration ! - INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER :: H5L_flags(H5L_FLAGS_LEN) - INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F INTEGER :: H5L_TYPE_EXTERNAL_F INTEGER :: H5L_SAME_LOC_F INTEGER :: H5L_LINK_CLASS_T_VERS_F - - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5L_FLAGS/ - !DEC$endif - COMMON /H5L_FLAGS/ H5L_flags - - EQUIVALENCE(H5L_flags(1), H5L_TYPE_ERROR_F) - EQUIVALENCE(H5L_flags(2), H5L_TYPE_HARD_F) - EQUIVALENCE(H5L_flags(3), H5L_TYPE_SOFT_F) - EQUIVALENCE(H5L_flags(4), H5L_TYPE_EXTERNAL_F) - EQUIVALENCE(H5L_flags(5), H5L_SAME_LOC_F) - EQUIVALENCE(H5L_flags(6), H5L_LINK_CLASS_T_VERS_F) ! ! H5O flags declaration ! - INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER :: H5o_flags(H5O_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5O_FLAGS/ - !DEC$endif - COMMON /H5O_FLAGS/ H5O_flags - INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -633,45 +314,9 @@ MODULE H5GLOBAL INTEGER :: H5O_TYPE_DATASET_F INTEGER :: H5O_TYPE_NAMED_DATATYPE_F INTEGER :: H5O_TYPE_NTYPES_F - - EQUIVALENCE(h5o_flags(1) , H5O_COPY_SHALLOW_HIERARCHY_F) - EQUIVALENCE(h5o_flags(2) , H5O_COPY_EXPAND_SOFT_LINK_F) - EQUIVALENCE(h5o_flags(3) , H5O_COPY_EXPAND_EXT_LINK_F) - EQUIVALENCE(h5o_flags(4) , H5O_COPY_EXPAND_REFERENCE_F) - EQUIVALENCE(h5o_flags(5) , H5O_COPY_WITHOUT_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(6) , H5O_COPY_PRESERVE_NULL_FLAG_F) - EQUIVALENCE(h5o_flags(7) , H5O_COPY_ALL_F) - EQUIVALENCE(h5o_flags(8) , H5O_SHMESG_NONE_FLAG_F) - EQUIVALENCE(h5o_flags(9) , H5O_SHMESG_SDSPACE_FLAG_F) - EQUIVALENCE(h5o_flags(10) , H5O_SHMESG_DTYPE_FLAG_F) - EQUIVALENCE(h5o_flags(11) , H5O_SHMESG_FILL_FLAG_F) - EQUIVALENCE(h5o_flags(12) , H5O_SHMESG_PLINE_FLAG_F) - EQUIVALENCE(h5o_flags(13) , H5O_SHMESG_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(14) , H5O_SHMESG_ALL_FLAG_F) - EQUIVALENCE(h5o_flags(15) , H5O_HDR_CHUNK0_SIZE_F) - EQUIVALENCE(h5o_flags(16) , H5O_HDR_ATTR_CRT_ORDER_TRACK_F) - EQUIVALENCE(h5o_flags(17) , H5O_HDR_ATTR_CRT_ORDER_INDEX_F) - EQUIVALENCE(h5o_flags(18) , H5O_HDR_ATTR_STORE_PHASE_CHA_F) - EQUIVALENCE(h5o_flags(19) , H5O_HDR_STORE_TIMES_F) - EQUIVALENCE(h5o_flags(20) , H5O_HDR_ALL_FLAGS_F) - EQUIVALENCE(h5o_flags(21) , H5O_SHMESG_MAX_NINDEXES_F) - EQUIVALENCE(h5o_flags(22) , H5O_SHMESG_MAX_LIST_SIZE_F) - EQUIVALENCE(h5o_flags(23) , H5O_TYPE_UNKNOWN_F) - EQUIVALENCE(h5o_flags(24) , H5O_TYPE_GROUP_F) - EQUIVALENCE(h5o_flags(25) , H5O_TYPE_DATASET_F) - EQUIVALENCE(h5o_flags(26) , H5O_TYPE_NAMED_DATATYPE_F) - EQUIVALENCE(h5o_flags(27) , H5O_TYPE_NTYPES_F) - ! ! H5P flags declaration ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ - !DEC$endif - COMMON /H5P_FLAGS/ H5P_flags - INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -691,72 +336,16 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5P_LINK_CREATE_F INTEGER(HID_T) :: H5P_LINK_ACCESS_F - EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F) - EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F) - EQUIVALENCE(H5P_flags(3), H5P_DATASET_CREATE_F) - EQUIVALENCE(H5P_flags(4), H5P_DATASET_XFER_F) - EQUIVALENCE(H5P_flags(5), H5P_FILE_MOUNT_F) - EQUIVALENCE(H5P_flags(6), H5P_DEFAULT_F) - EQUIVALENCE(H5P_flags(7), H5P_ROOT_F) - EQUIVALENCE(H5P_flags(8), H5P_OBJECT_CREATE_F) - EQUIVALENCE(H5P_flags(9), H5P_DATASET_ACCESS_F) - EQUIVALENCE(H5P_flags(10), H5P_GROUP_CREATE_F) - EQUIVALENCE(H5P_flags(11), H5P_GROUP_ACCESS_F) - EQUIVALENCE(H5P_flags(12), H5P_DATATYPE_CREATE_F) - EQUIVALENCE(H5P_flags(13), H5P_DATATYPE_ACCESS_F) - EQUIVALENCE(H5P_flags(14), H5P_STRING_CREATE_F) - EQUIVALENCE(H5P_flags(15), H5P_ATTRIBUTE_CREATE_F) - EQUIVALENCE(H5P_flags(16), H5P_OBJECT_COPY_F) - EQUIVALENCE(H5P_flags(17), H5P_LINK_CREATE_F) - EQUIVALENCE(H5P_flags(18), H5P_LINK_ACCESS_F) - - ! - ! H5P integers flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS_INT/ - !DEC$endif - COMMON /H5P_FLAGS_INT/ H5P_flags_int INTEGER :: H5P_CRT_ORDER_INDEXED_F INTEGER :: H5P_CRT_ORDER_TRACKED_F - EQUIVALENCE(H5P_flags_int(1), H5P_CRT_ORDER_INDEXED_F) - EQUIVALENCE(H5P_flags_int(2), H5P_CRT_ORDER_TRACKED_F) ! ! H5R flags declaration ! - INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER :: H5R_flags(H5R_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5R_FLAGS/ - !DEC$endif - COMMON /H5R_FLAGS/ H5R_flags - INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F - - EQUIVALENCE(H5R_flags(1), H5R_OBJECT_F) - EQUIVALENCE(H5R_flags(2), H5R_DATASET_REGION_F) - ! ! H5S flags declaration ! - INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER :: H5S_flags(H5S_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HID_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HSIZE_FLAGS/ - !DEC$endif - COMMON /H5S_FLAGS/ H5S_flags - COMMON /H5S_HID_FLAGS/ H5S_hid_flags - COMMON /H5S_HSIZE_FLAGS/ H5S_hsize_flags - INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -781,43 +370,9 @@ MODULE H5GLOBAL INTEGER :: H5S_SEL_POINTS_F INTEGER :: H5S_SEL_HYPERSLABS_F INTEGER :: H5S_SEL_ALL_F - - EQUIVALENCE(H5S_hid_flags(1), H5S_ALL_F) - - EQUIVALENCE(H5S_hsize_flags(1), H5S_UNLIMITED_F) - - EQUIVALENCE(H5S_flags(1), H5S_SCALAR_F) - EQUIVALENCE(H5S_flags(2), H5S_SIMPLE_F) - EQUIVALENCE(H5S_flags(3), H5S_NULL_F) - EQUIVALENCE(H5S_flags(4), H5S_SELECT_SET_F) - EQUIVALENCE(H5S_flags(5), H5S_SELECT_OR_F) - - EQUIVALENCE(H5S_flags(6), H5S_SELECT_NOOP_F) - EQUIVALENCE(H5S_flags(7), H5S_SELECT_AND_F) - EQUIVALENCE(H5S_flags(8), H5S_SELECT_XOR_F) - EQUIVALENCE(H5S_flags(9), H5S_SELECT_NOTB_F) - EQUIVALENCE(H5S_flags(10), H5S_SELECT_NOTA_F) - - EQUIVALENCE(H5S_flags(11), H5S_SELECT_APPEND_F) - EQUIVALENCE(H5S_flags(12), H5S_SELECT_PREPEND_F) - EQUIVALENCE(H5S_flags(13), H5S_SELECT_INVALID_F) - EQUIVALENCE(H5S_flags(14), H5S_SEL_ERROR_F) - EQUIVALENCE(H5S_flags(15), H5S_SEL_NONE_F) - - EQUIVALENCE(H5S_flags(16), H5S_SEL_POINTS_F) - EQUIVALENCE(H5S_flags(17), H5S_SEL_HYPERSLABS_F) - EQUIVALENCE(H5S_flags(18), H5S_SEL_ALL_F) - ! ! H5T flags declaration ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER :: H5T_flags(H5T_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ - !DEC$endif - COMMON /H5T_FLAGS/ H5T_flags - INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -853,52 +408,9 @@ MODULE H5GLOBAL INTEGER :: H5T_STR_ERROR_F INTEGER :: H5T_DIR_ASCEND_F INTEGER :: H5T_DIR_DESCEND_F - - EQUIVALENCE(H5T_flags(1), H5T_NO_CLASS_F) - EQUIVALENCE(H5T_flags(2), H5T_INTEGER_F) - EQUIVALENCE(H5T_flags(3), H5T_FLOAT_F) - EQUIVALENCE(H5T_flags(4), H5T_TIME_F) - EQUIVALENCE(H5T_flags(5), H5T_STRING_F) - EQUIVALENCE(H5T_flags(6), H5T_BITFIELD_F) - EQUIVALENCE(H5T_flags(7), H5T_OPAQUE_F) - EQUIVALENCE(H5T_flags(8), H5T_COMPOUND_F) - EQUIVALENCE(H5T_flags(9), H5T_REFERENCE_F) - EQUIVALENCE(H5T_flags(10), H5T_ENUM_F) - EQUIVALENCE(H5T_flags(11), H5T_ORDER_LE_F) - EQUIVALENCE(H5T_flags(12), H5T_ORDER_BE_F) - EQUIVALENCE(H5T_flags(13), H5T_ORDER_MIXED_F) - EQUIVALENCE(H5T_flags(14), H5T_ORDER_VAX_F) - EQUIVALENCE(H5T_flags(15), H5T_ORDER_NONE_F) - EQUIVALENCE(H5T_flags(16), H5T_PAD_ZERO_F) - EQUIVALENCE(H5T_flags(17), H5T_PAD_ONE_F) - EQUIVALENCE(H5T_flags(18), H5T_PAD_BACKGROUND_F) - EQUIVALENCE(H5T_flags(19), H5T_PAD_ERROR_F) - EQUIVALENCE(H5T_flags(20), H5T_SGN_NONE_F) - EQUIVALENCE(H5T_flags(21), H5T_SGN_2_F) - EQUIVALENCE(H5T_flags(22), H5T_SGN_ERROR_F) - EQUIVALENCE(H5T_flags(23), H5T_NORM_IMPLIED_F) - EQUIVALENCE(H5T_flags(24), H5T_NORM_MSBSET_F) - EQUIVALENCE(H5T_flags(25), H5T_NORM_NONE_F) - EQUIVALENCE(H5T_flags(26), H5T_CSET_ASCII_F) - EQUIVALENCE(H5T_flags(27), H5T_CSET_UTF8_F) - EQUIVALENCE(H5T_flags(28), H5T_STR_NULLTERM_F) - EQUIVALENCE(H5T_flags(29), H5T_STR_NULLPAD_F) - EQUIVALENCE(H5T_flags(30), H5T_STR_SPACEPAD_F) - EQUIVALENCE(H5T_flags(31), H5T_STR_ERROR_F) - EQUIVALENCE(H5T_flags(32), H5T_VLEN_F) - EQUIVALENCE(H5T_flags(33), H5T_ARRAY_F) - EQUIVALENCE(H5T_flags(34), H5T_DIR_ASCEND_F) - EQUIVALENCE(H5T_flags(35), H5T_DIR_DESCEND_F) ! ! H5Z flags declaration ! - INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ - !DEC$endif - COMMON /H5Z_FLAGS/ H5Z_flags - INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -919,58 +431,12 @@ MODULE H5GLOBAL INTEGER :: H5Z_SO_FLOAT_ESCALE_F INTEGER :: H5Z_SO_INT_F INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F - - EQUIVALENCE(H5Z_flags(1), H5Z_FILTER_ERROR_F) - EQUIVALENCE(H5Z_flags(2), H5Z_FILTER_NONE_F) - EQUIVALENCE(H5Z_flags(3), H5Z_FILTER_DEFLATE_F) - EQUIVALENCE(H5Z_flags(4), H5Z_FILTER_SHUFFLE_F) - EQUIVALENCE(H5Z_flags(5), H5Z_FILTER_FLETCHER32_F) - EQUIVALENCE(H5Z_flags(6), H5Z_ERROR_EDC_F) - EQUIVALENCE(H5Z_flags(7), H5Z_DISABLE_EDC_F) - EQUIVALENCE(H5Z_flags(8), H5Z_ENABLE_EDC_F) - EQUIVALENCE(H5Z_flags(9), H5Z_NO_EDC_F) - EQUIVALENCE(H5Z_flags(10), H5Z_FILTER_SZIP_F) - EQUIVALENCE(H5Z_flags(11), H5Z_FLAG_OPTIONAL_F) - EQUIVALENCE(H5Z_flags(12), H5Z_FILTER_ENCODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(13), H5Z_FILTER_DECODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(14), H5Z_FILTER_ALL_F) - EQUIVALENCE(H5Z_flags(15), H5Z_FILTER_NBIT_F) - EQUIVALENCE(H5Z_flags(16), H5Z_FILTER_SCALEOFFSET_F) - EQUIVALENCE(H5Z_flags(17), H5Z_SO_FLOAT_DSCALE_F) - EQUIVALENCE(H5Z_flags(18), H5Z_SO_FLOAT_ESCALE_F) - EQUIVALENCE(H5Z_flags(19), H5Z_SO_INT_F) - EQUIVALENCE(H5Z_flags(20), H5Z_SO_INT_MINBITS_DEFAULT_F) - ! ! H5 Library flags declaration ! - INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5LIB_FLAGS/ - !DEC$endif - COMMON /H5LIB_FLAGS/ H5LIB_flags INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - ! - EQUIVALENCE(H5LIB_flags(1), H5_SZIP_EC_OM_F) - EQUIVALENCE(H5LIB_flags(2), H5_SZIP_NN_OM_F) - - ! General H5 flags declarations - ! -!!$ INTEGER, PARAMETER :: H5_FLAGS_LEN = 2 -!!$ INTEGER H5_flags(H5_FLAGS_LEN) -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$ATTRIBUTES DLLEXPORT :: /H5_FLAGS/ -!!$!DEC$endif -!!$ COMMON /H5_FLAGS/ H5_flags -!!$ -!!$ INTEGER :: _F -!!$ INTEGER :: H5F_SCOPE_LOCAL_F -!!$ -!!$ EQUIVALENCE(H5F_flags(1), H5F_SCOPE_GLOBAL_F) -!!$ EQUIVALENCE(H5F_flags(2), H5F_SCOPE_LOCAL_F) CONTAINS -- cgit v0.12 From b162b949988def452b2a4a34426212d246e54b52 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 15 Nov 2017 17:14:35 -0600 Subject: Correct linkage of filters and other libs --- CMakeFilters.cmake | 16 ++++++++-------- src/CMakeLists.txt | 4 ++-- test/CMakeLists.txt | 4 ++-- test/dsets.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 804b16b..71dabb1 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -45,8 +45,8 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (NOT ZLIB_FOUND) find_package (ZLIB) # Legacy find if (ZLIB_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_LIBRARIES}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) endif () endif () endif () @@ -78,9 +78,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") endif () if (BUILD_SHARED_LIBS) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) endif () - set (LINK_LIBS ${LINK_LIBS} ${ZLIB_STATIC_LIBRARY}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) message (STATUS "Filter ZLIB is ON") endif () @@ -96,8 +96,8 @@ if (HDF5_ENABLE_SZIP_SUPPORT) if (NOT SZIP_FOUND) find_package (SZIP) # Legacy find if (SZIP_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_LIBRARIES}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) endif () endif () endif () @@ -119,9 +119,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) endif () endif () if (BUILD_SHARED_LIBS) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) endif () - set (LINK_LIBS ${LINK_LIBS} ${SZIP_STATIC_LIBRARY}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) message (STATUS "Filter SZIP is ON") if (H5_HAVE_FILTER_SZIP) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 91b8e0c..b163b8a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -883,7 +883,7 @@ set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS}) +target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) endif () @@ -927,7 +927,7 @@ if (BUILD_SHARED_LIBS) set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) endif () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0a2afbf..fca864b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -37,7 +37,7 @@ endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") endif () -target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test @@ -53,7 +53,7 @@ if (BUILD_SHARED_LIBS) if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") endif () - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_LIBS}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test diff --git a/test/dsets.c b/test/dsets.c index 4088304..0fff2d1 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -2087,7 +2087,7 @@ test_get_filter_info(void) #ifdef H5_HAVE_FILTER_SZIP if(H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0) TEST_ERROR - if(SZ_encoder_enabled()) { + if(H5Z_SZIP->encoder_present) { if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) || ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) TEST_ERROR -- cgit v0.12 From bbc0c85ab221d88565ddd2a1f4852b73d77d0fa2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 09:04:50 -0600 Subject: Add note for plugins --- release_docs/RELEASE.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f8ad620..9e3c3a9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -157,6 +157,25 @@ Bug Fixes since HDF5-1.10.1 release Library ------- + - filter plugin handling in H5PL.c and H5Z.c + + It was discovered that the dynamic loading process used by + filter plugins had issues with memory allocation and library + dependencies. + + CMake build process changed to use LINK INTERFACE keywords, which + allowed HDF5 C library to make dependent libraries private. The + filter plugin libraries no longer require dependent libraries + (such as szip or zlib) to be available. + (ADB - 2017/11/16, HDFFV-10328) + + The H5Z_class2_t structure returned by the filter plugins are + now dynamically allocated in H5Zregister function. Access to + the functions in the filter library now always use the dynamic + library API. + + (ADB - 2017/11/16, HDFFV-10329) + - H5Zfilter_avail in H5Z.c The public function checked for plugins, while the private -- cgit v0.12 From 3098356df0eeed116acca9d8997f672f6c8520a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 09:28:58 -0600 Subject: Fix some of the whitespace --- test/tattr.c | 254 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 127 insertions(+), 127 deletions(-) diff --git a/test/tattr.c b/test/tattr.c index d7152ed..3786d0d 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -163,21 +163,21 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo, static void test_attr_basic_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ - hsize_t attr_size; /* storage size for attribute */ - ssize_t attr_name_size; /* size of attribute name */ - char *attr_name=NULL; /* name of attribute */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ - int i; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr, attr2; /* Attribute ID */ + hsize_t attr_size; /* storage size for attribute */ + ssize_t attr_name_size; /* size of attribute name */ + char *attr_name=NULL; /* name of attribute */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ + int i; + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Writing Functions\n")); @@ -402,15 +402,15 @@ test_attr_basic_write(hid_t fapl) static void test_attr_basic_read(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t attr; /* Attribute ID */ - H5O_info_t oinfo; /* Object info */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t attr; /* Attribute ID */ + H5O_info_t oinfo; /* Object info */ int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */ int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */ - int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + int i, j; /* Local index variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -500,7 +500,7 @@ test_attr_flush(hid_t fapl) set; /* Dataset ID */ double wdata=3.14159F; /* Data to write */ double rdata; /* Data read in */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Flushing\n")); @@ -563,12 +563,12 @@ test_attr_plist(hid_t fapl) hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t plist; /* Property list ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - H5T_cset_t cset; /* Character set for attributes */ - herr_t ret; /* Generic return value */ + hid_t attr; /* Attribute ID */ + hid_t plist; /* Property list ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + H5T_cset_t cset; /* Character set for attributes */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Property Lists\n")); @@ -675,14 +675,14 @@ static void test_attr_compound_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t tid1; /* Attribute datatype ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t tid1; /* Attribute datatype ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -762,11 +762,11 @@ test_attr_compound_write(hid_t fapl) static void test_attr_compound_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ int rank; /* Attribute rank */ hsize_t dims[ATTR_MAX_DIMS]; /* Attribute dimensions */ @@ -781,7 +781,7 @@ test_attr_compound_read(hid_t fapl) ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -830,7 +830,7 @@ test_attr_compound_read(hid_t fapl) HDstrcmp(fieldname, ATTR4_FIELDNAME3))) TestErrPrintf("invalid field name for field #%d: %s\n", i, fieldname); H5free_memory(fieldname); - } /* end for */ + } /* end for */ offset = H5Tget_member_offset(type, 0); VERIFY(offset, attr4_field1_off, "H5Tget_member_offset"); offset = H5Tget_member_offset(type, 1); @@ -878,7 +878,7 @@ test_attr_compound_read(hid_t fapl) printf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i); printf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", __LINE__, i, j, attr_data4[i][j].d, i, j, read_data4[i][j].d); TestErrPrintf("%d: attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n", __LINE__, i, j, attr_data4[i][j].c, i, j, read_data4[i][j].c); - } /* end if */ + } /* end if */ /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); @@ -913,12 +913,12 @@ static void test_attr_scalar_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -979,13 +979,13 @@ static void test_attr_scalar_read(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ H5S_class_t stype; /* Dataspace class */ - float rdata = 0.0F; /* Buffer for reading 1st attribute */ + float rdata = 0.0F; /* Buffer for reading 1st attribute */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Reading Functions\n")); @@ -1013,8 +1013,8 @@ test_attr_scalar_read(hid_t fapl) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(rdata, attr_data5)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); /* Get the attribute's dataspace */ sid = H5Aget_space(attr); @@ -1051,15 +1051,15 @@ static void test_attr_mult_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -1170,11 +1170,11 @@ test_attr_mult_write(hid_t fapl) static void test_attr_mult_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ char temp_name[ATTR_NAME_LEN]; /* Buffer for mangling attribute names */ int rank; /* Attribute rank */ @@ -1185,10 +1185,10 @@ test_attr_mult_read(hid_t fapl) int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */ int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */ double read_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3] = {{{0}}}; /* Buffer for reading 3rd attribute */ - ssize_t name_len; /* Length of attribute name */ + ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j, k; /* Local index values */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1432,12 +1432,12 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR static void test_attr_iterate(hid_t fapl) { - hid_t file; /* HDF5 File ID */ + hid_t file; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t sid; /* Dataspace ID */ int count; /* operator data for the iterator */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1504,13 +1504,13 @@ test_attr_iterate(hid_t fapl) static void test_attr_delete(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1635,7 +1635,7 @@ test_attr_dtype_shared(hid_t fapl) H5O_info_t oinfo; /* Object's information */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Shared Datatypes with Attributes\n")); @@ -1802,17 +1802,17 @@ test_attr_dtype_shared(hid_t fapl) static void test_attr_duplicate_ids(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t gid1, gid2; /* Group ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t gid1, gid2; /* Group ID */ hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ - int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ - int i; - herr_t ret; /* Generic return value */ + hid_t attr, attr2; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ + int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ + int i; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two ID handles\n")); @@ -1830,7 +1830,7 @@ test_attr_duplicate_ids(hid_t fapl) /* Create a dataset */ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, - H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dcreate2"); /* Create dataspace for attribute */ @@ -2047,12 +2047,12 @@ test_attr_duplicate_ids(hid_t fapl) static int test_attr_dense_verify(hid_t loc_id, unsigned max_attr) { - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - hid_t attr; /* Attribute ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t attr; /* Attribute ID */ unsigned value; /* Attribute value */ unsigned u; /* Local index variable */ int old_nerrs; /* Number of errors when entering this check */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -2117,19 +2117,19 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) static void test_attr_dense_create(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dense Attribute Storage Creation\n")); @@ -2248,19 +2248,19 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) static void test_attr_dense_open(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Opening Attributes in Dense Storage\n")); @@ -2387,20 +2387,20 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) static void test_attr_dense_delete(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Attributes in Dense Storage\n")); @@ -2565,21 +2565,21 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) static void test_attr_dense_rename(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Renaming Attributes in Dense Storage\n")); @@ -2724,21 +2724,21 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) static void test_attr_dense_unlink(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ size_t mesg_count; /* # of shared messages */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Unlinking Object with Attributes in Dense Storage\n")); @@ -2856,17 +2856,17 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) { hid_t fid; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact, rmax_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense, rmin_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Phase Change Limits For Attributes in Dense Storage\n")); @@ -3019,13 +3019,13 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) static void test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ hid_t gid1, gid2; /* Group ID */ - hid_t sid, sid2; /* Dataspace ID */ + hid_t sid, sid2; /* Dataspace ID */ hid_t attr, attr2, add_attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ hsize_t dims[] = {ATTR1_DIM1}; int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading attribute */ int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ @@ -3033,9 +3033,9 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) unsigned read_scalar; /* variable for reading attribute*/ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u, i; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two IDs for Dense Storage\n")); -- cgit v0.12 From f4f94e1bf845e40ea085c93d03724ac96cb61b68 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 11:45:36 -0600 Subject: HDFFV-10328 merge allocation changes from 1.8 --- src/H5PLint.c | 21 +- src/H5PLplugin_cache.c | 26 +- src/H5Z.c | 715 ++++++++++++++++++++++++++----------------------- 3 files changed, 422 insertions(+), 340 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index c887f86..e969cbf 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -342,19 +342,38 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v /* Check if the filter IDs match */ if (info->id == id) { + H5Z_class2_t *plugin_copy = NULL; /* 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") + /* allocate local copy of plugin info */ + if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") + /* Set the plugin info to return */ + *plugin_info = (const void *)info; + + plugin_copy->version = info->version; + plugin_copy->id = info->id; + plugin_copy->encoder_present = info->encoder_present; + plugin_copy->decoder_present = info->decoder_present; + plugin_copy->can_apply = info->can_apply; + plugin_copy->set_local = info->set_local; + plugin_copy->filter = info->filter; + /* copy the user's string into the property */ + if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(info->name))) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") + /* Set output parameters */ *success = TRUE; - *plugin_info = (const void *)info; } } done: if (!success && handle) + if (*plugin_info) { + *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index d826ba0..ec14159 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -280,18 +280,34 @@ 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; + H5Z_class2_t *plugin_copy = NULL; /* 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") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") /* 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") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") + + if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") + /* Set the plugin info to return */ + *plugin_info = plugin_copy; + + plugin_copy->version = filter_info->version; + plugin_copy->id = filter_info->id; + plugin_copy->encoder_present = filter_info->encoder_present; + plugin_copy->decoder_present = filter_info->decoder_present; + plugin_copy->can_apply = filter_info->can_apply; + plugin_copy->set_local = filter_info->set_local; + plugin_copy->filter = filter_info->filter; + /* copy the user's string into the property */ + if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(filter_info->name))) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") /* Set output parameters */ *found = TRUE; - *plugin_info = filter_info; /* No need to continue processing */ break; @@ -301,6 +317,10 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f } /* end for */ done: + /* unallocate local copy of plugin info on failure */ + if (FAIL == ret_value && *plugin_info) { + *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_cache() */ #pragma GCC diagnostic pop diff --git a/src/H5Z.c b/src/H5Z.c index 1d023b5..e7574cd 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -34,15 +34,15 @@ #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 */ typedef struct H5Z_object_t { - H5Z_filter_t filter_id; /* ID of the filter we're looking for */ + H5Z_filter_t filter_id; /* ID of the filter we're looking for */ htri_t found; /* Whether we find an object using the filter */ } H5Z_object_t; @@ -86,23 +86,23 @@ H5Z__init_package(void) FUNC_ENTER_PACKAGE /* Internal filters */ - if(H5Z_register(H5Z_SHUFFLE) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") - if(H5Z_register(H5Z_FLETCHER32) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") - if(H5Z_register(H5Z_NBIT) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") - if(H5Z_register(H5Z_SCALEOFFSET) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") + if (H5Z_register (H5Z_SHUFFLE) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") + if (H5Z_register (H5Z_FLETCHER32) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") + if (H5Z_register (H5Z_NBIT) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") + if (H5Z_register (H5Z_SCALEOFFSET) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") /* External filters */ #ifdef H5_HAVE_FILTER_DEFLATE - if(H5Z_register(H5Z_DEFLATE) < 0) + if (H5Z_register (H5Z_DEFLATE) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if(H5Z_register(H5Z_SZIP) < 0) + if (H5Z_register (H5Z_SZIP) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") #endif /* H5_HAVE_FILTER_SZIP */ @@ -123,6 +123,7 @@ int H5Z_term_package(void) { int n = 0; + size_t i; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -130,7 +131,6 @@ H5Z_term_package(void) #ifdef H5Z_DEBUG char comment[16], bandwidth[32]; int dir, nprint = 0; - size_t i; if(H5DEBUG(Z)) { for(i = 0; i < H5Z_table_used_g; i++) { @@ -179,6 +179,12 @@ H5Z_term_package(void) } /* end for */ } /* end if */ #endif /* H5Z_DEBUG */ + for (i = 0; i < H5Z_table_used_g; i++) { + H5Z_class2_t *cls = (H5Z_class2_t *)(H5Z_table_g+i); + /* deallocate plugin info name */ + if (cls->name) + cls->name = (char *)H5MM_xfree(cls->name); + } /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); @@ -211,8 +217,8 @@ herr_t H5Zregister(const void *cls) { const H5Z_class2_t *cls_real = (const H5Z_class2_t *) cls; /* "Real" class pointer */ - H5Z_class2_t cls_new; /* Translated class struct */ - herr_t ret_value=SUCCEED; /* Return value */ + H5Z_class2_t cls_new; /* Translated class struct */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "*x", cls); @@ -231,7 +237,7 @@ H5Zregister(const void *cls) * at least 256, there should be no overlap and the version of the struct * can be determined by the value of the first field. */ - if(cls_real->version != H5Z_CLASS_T_VERS) { + if (cls_real->version != H5Z_CLASS_T_VERS) { #ifndef H5_NO_DEPRECATED_SYMBOLS /* Assume it is an old "H5Z_class1_t" instead */ const H5Z_class1_t *cls_old = (const H5Z_class1_t *) cls; @@ -251,19 +257,19 @@ H5Zregister(const void *cls) #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Deprecated symbols not allowed, throw an error */ - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end if */ - if (cls_real->id<0 || cls_real->id>H5Z_FILTER_MAX) + if (cls_real->id < 0 || cls_real->id > H5Z_FILTER_MAX) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if (cls_real->idid < H5Z_FILTER_RESERVED) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") - if (cls_real->filter==NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") + if (cls_real->filter == NULL) + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") /* Do it */ - if (H5Z_register (cls_real)<0) + if (H5Z_register (cls_real) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") done: @@ -277,39 +283,40 @@ done: * Purpose: Same as the public version except this one allows filters * to be set for predefined method numbers id >= 0 && cls->id <= H5Z_FILTER_MAX); + HDassert (cls); + HDassert (cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); /* Is the filter already registered? */ - for(i = 0; i < H5Z_table_used_g; i++) - if(H5Z_table_g[i].id == cls->id) + for (i = 0; i < H5Z_table_used_g; i++) + 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); + 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)); #ifdef H5Z_DEBUG 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") + 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") + 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; @@ -317,15 +324,21 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + H5Z_table_g[i].name = (char *)H5MM_xstrdup(cls->name); #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 { + H5Z_class2_t *old_cls = (H5Z_class2_t *)(H5Z_table_g+i); + /* deallocate plugin info name */ + if (old_cls->name) + old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Replace old contents */ - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy (old_cls, cls, sizeof(H5Z_class2_t)); + old_cls->name = (char *)H5MM_xstrdup(cls->name); } /* end else */ done: @@ -338,25 +351,26 @@ done: * * Purpose: This function unregisters a filter. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t H5Zunregister(H5Z_filter_t id) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "Zf", id); /* Check args */ - if(id < 0 || id > H5Z_FILTER_MAX) + if (id < 0 || id > H5Z_FILTER_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if(id < H5Z_FILTER_RESERVED) + if (id < H5Z_FILTER_RESERVED) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") /* Do it */ - if(H5Z_unregister(id) < 0) + if (H5Z_unregister(id) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") done: @@ -370,27 +384,29 @@ done: * Purpose: Same as the public version except this one allows filters * to be unset for predefined method numbers =0 && filter_id<=H5Z_FILTER_MAX); /* Is the filter already registered? */ - for (filter_index=0; filter_index=H5Z_table_used_g) + if (filter_index >= H5Z_table_used_g) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter is not registered") /* Initialize the structure object for iteration */ @@ -398,28 +414,32 @@ H5Z_unregister(H5Z_filter_t filter_id) object.found = FALSE; /* Iterate through all opened datasets, returns a failure if any of them uses the filter */ - if(H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) + if (H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - if(object.found) + if (object.found) HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a dataset is still using it") /* Iterate through all opened groups, returns a failure if any of them uses the filter */ - if(H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0) + if (H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - if(object.found) + if (object.found) HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a group is still using it") /* Iterate through all opened files and flush them */ - if(H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) + if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") + /* deallocate plugin info name */ + old_cls = (H5Z_class2_t *)(H5Z_table_g+filter_index); + if (old_cls->name) + old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ - HDmemmove(&H5Z_table_g[filter_index],&H5Z_table_g[filter_index+1],sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); #ifdef H5Z_DEBUG - HDmemmove(&H5Z_stat_table_g[filter_index],&H5Z_stat_table_g[filter_index+1],sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove (&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); #endif /* H5Z_DEBUG */ H5Z_table_used_g--; @@ -431,10 +451,10 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__check_unregister * - * Purpose: Check if an object uses the filter to be unregistered. + * Purpose: Check if an object uses the filter to be unregistered. * - * Return: TRUE if the object uses the filter. - * FALSE if not, NEGATIVE on error. + * Return: TRUE if the object uses the filter. + * FALSE if not, NEGATIVE on error. *------------------------------------------------------------------------- */ static htri_t @@ -446,12 +466,12 @@ H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id) FUNC_ENTER_STATIC /* Get the plist structure of object creation */ - if(NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) - HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") + if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) + HGOTO_ERROR (H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") /* Check if the object creation property list uses the filter */ - if((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") done: FUNC_LEAVE_NOAPI(ret_value) @@ -483,25 +503,25 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void HDassert(obj_ptr); /* Get the group creation property */ - if((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") + if ((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") /* Check if the filter is in the group creation property list */ - if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. */ - if(filter_in_pline) { + if (filter_in_pline) { object->found = TRUE; ret_value = TRUE; } /* end if */ done: - if(ocpl_id > 0) - if(H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + if (ocpl_id > 0) + if (H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_group_cb() */ @@ -510,13 +530,13 @@ 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. + * 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. + * Return: TRUE if the object uses the filter. + * FALSE otherwise. *------------------------------------------------------------------------- */ static int @@ -529,28 +549,28 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * FUNC_ENTER_STATIC - HDassert(obj_ptr); + HDassert (obj_ptr); /* Get the dataset creation property */ - 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") + 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 */ - if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. */ - if(filter_in_pline) { + if (filter_in_pline) { object->found = TRUE; ret_value = TRUE; } /* end if */ done: - if(ocpl_id > 0) - if(H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + if (ocpl_id > 0) + if (H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_dset_cb() */ @@ -569,17 +589,17 @@ done: static int H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUSED *key) { - int ret_value = FALSE; /* Return value */ + int ret_value = FALSE; /* Return value */ FUNC_ENTER_STATIC - HDassert(obj_ptr); + HDassert (obj_ptr); /* 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) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + 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) + HGOTO_ERROR (H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") } /* end if */ done: @@ -598,17 +618,17 @@ done: htri_t H5Zfilter_avail(H5Z_filter_t id) { - htri_t ret_value=FALSE; /* Return value */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "Zf", id); /* Check args */ - if(id<0 || id>H5Z_FILTER_MAX) + 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") + if ((ret_value = H5Z_filter_avail(id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") done: FUNC_LEAVE_API(ret_value) @@ -626,21 +646,25 @@ done: 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 */ + size_t i; /* Local index variable */ + H5Z_class2_t *filter_info; + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* 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(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) + for (i = 0; i < H5Z_table_used_g; i++) + 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))) { + herr_t status = H5Z_register(filter_info); + if (filter_info->name) + filter_info->name = (char *)H5MM_xfree(filter_info->name); + filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); + if (status < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") + HGOTO_DONE (TRUE) } done: FUNC_LEAVE_NOAPI(ret_value) @@ -666,59 +690,59 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, { H5Z_class2_t *fclass; /* Individual filter information */ size_t u; /* Local index variable */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(pline->nused > 0); /* Iterate over filters */ - for(u = 0; u < pline->nused; u++) { + for (u = 0; u < pline->nused; u++) { /* Get filter information */ - if(NULL == (fclass = H5Z_find(pline->filter[u].id))) { + if (NULL == (fclass = H5Z_find(pline->filter[u].id))) { /* Ignore errors from optional filters */ - if(pline->filter[u].flags & H5Z_FLAG_OPTIONAL) - H5E_clear_stack(NULL); + if (pline->filter[u].flags & H5Z_FLAG_OPTIONAL) + H5E_clear_stack (NULL); else - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") } /* end if */ else { /* Make correct callback */ - switch(prelude_type) { + switch (prelude_type) { case H5Z_PRELUDE_CAN_APPLY: /* Check if filter is configured to be able to encode */ - if(!fclass->encoder_present) - HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); + if (!fclass->encoder_present) + HGOTO_ERROR (H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); /* Check if there is a "can apply" callback */ - if(fclass->can_apply) { + if (fclass->can_apply) { /* Make callback to filter's "can apply" function */ htri_t status = (fclass->can_apply)(dcpl_id, type_id, space_id); /* Indicate error during filter callback */ - if(status < 0) + if (status < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "error during user callback") /* 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)) + if (status == FALSE && !(pline->filter[u].flags & H5Z_FLAG_OPTIONAL)) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "filter parameters not appropriate") } /* end if */ break; case H5Z_PRELUDE_SET_LOCAL: /* Check if there is a "set local" callback */ - if(fclass->set_local) { + if (fclass->set_local) { /* Make callback to filter's "set local" function */ - if((fclass->set_local)(dcpl_id, type_id, space_id) < 0) + if ((fclass->set_local)(dcpl_id, type_id, space_id) < 0) /* Indicate error during filter callback */ - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") } /* end if */ break; default: - HDassert("invalid prelude type" && 0); + HDassert ("invalid prelude type" && 0); } /* end switch */ } /* end else */ } /* end for */ @@ -745,62 +769,62 @@ 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 */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); - HDassert(H5I_DATATYPE == H5I_get_type(type_id)); + HDassert (H5I_GENPROP_LST == H5I_get_type(dcpl_id)); + HDassert (H5I_DATATYPE == H5I_get_type(type_id)); /* 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 (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 */ /* 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") + 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) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve layout") + 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 */ - if(H5P_peek(dc_plist, H5O_CRT_PIPELINE_NAME, &dcpl_pline) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") + if (H5P_peek(dc_plist, H5O_CRT_PIPELINE_NAME, &dcpl_pline) < 0) + HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") /* Check if the chunks have filters */ - if(dcpl_pline.nused > 0) { + if (dcpl_pline.nused > 0) { hsize_t chunk_dims[H5O_LAYOUT_NDIMS]; /* Size of chunk dimensions */ - H5S_t *space; /* Dataspace describing chunk */ - size_t u; /* Local index variable */ + H5S_t *space; /* Dataspace describing chunk */ + 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++) + /* Create a dataspace 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))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") + 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 */ - if((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { - (void)H5S_close(space); - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") + if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { + (void)H5S_close (space); + HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ /* Make the callbacks */ - if(H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") } /* end if */ } /* end if */ } /* end if */ done: - if(space_id > 0 && H5I_dec_ref(space_id) < 0) + if (space_id > 0 && H5I_dec_ref(space_id) < 0) HDONE_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") FUNC_LEAVE_NOAPI(ret_value) @@ -814,7 +838,8 @@ done: * property list can be applied to a particular combination of * datatype and dataspace for a dataset. * - * Return: Non-negative on success/Negative on failure + * 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 @@ -829,8 +854,8 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "can apply" callbacks for filters in pipeline */ - if(H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -844,7 +869,8 @@ done: * 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 + * 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 @@ -859,8 +885,8 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "set local" callbacks for filters in pipeline */ - if(H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -874,7 +900,8 @@ done: * 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 + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -884,11 +911,11 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert(pline->nused > 0); + HDassert (pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -902,7 +929,8 @@ done: * new opaque object. The pipeline is assumed to have at * least one filter. * - * Return: Non-negative on success/Negative on failure + * 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 @@ -916,11 +944,11 @@ H5Z_set_local_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert(pline->nused > 0); + HDassert (pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -930,58 +958,59 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_modify * - * Purpose: Modify filter parameters for specified pipeline. + * Purpose: Modify filter parameters for specified pipeline. * - * Return: Non-negative on success/Negative on failure + * 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 idx; /* Index of filter in pipeline */ - herr_t ret_value = SUCCEED; /* Return value */ + size_t idx; /* Index of filter in pipeline */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert(0 == cd_nelmts || cd_values); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert (0 == cd_nelmts || cd_values); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; 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, FAIL, "filter not in pipeline") + if (idx > pline->nused) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Change parameters for filter */ pline->filter[idx].flags = flags; pline->filter[idx].cd_nelmts = cd_nelmts; /* Free any existing parameters */ - if(pline->filter[idx].cd_values != NULL && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + if (pline->filter[idx].cd_values != NULL && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) H5MM_xfree(pline->filter[idx].cd_values); /* Set parameters */ - if(cd_nelmts > 0) { - size_t i; /* Local index variable */ + if (cd_nelmts > 0) { + size_t i; /* Local index variable */ /* Allocate memory or point at internal buffer */ - if(cd_nelmts > H5Z_COMMON_CD_VALUES) { + if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); - if(NULL == pline->filter[idx].cd_values) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") + if (NULL == pline->filter[idx].cd_values) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") } /* end if */ else 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; @@ -996,36 +1025,37 @@ done: * * Purpose: Append another filter to the specified pipeline. * - * Return: Non-negative on success/Negative on failure + * 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 idx; - herr_t ret_value = SUCCEED; /* Return value */ + size_t idx; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert(0 == cd_nelmts || cd_values); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert (0 == cd_nelmts || cd_values); /* * Check filter limit. We do it here for early warnings although we may * 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") + if (pline->nused >= H5Z_MAX_NFILTERS) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "too many filters in pipeline") /* Check for freshly allocated filter pipeline */ - if(pline->version == 0) + if (pline->version == 0) pline->version = H5O_PLINE_VERSION_1; /* Allocate additional space in the pipeline if it's full */ - if(pline->nused >= pline->nalloc) { + if (pline->nused >= pline->nalloc) { H5O_pline_t x; size_t n; @@ -1036,14 +1066,14 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, * filter struct is reallocated. Set these pointers to ~NULL * so that we can reset them after reallocating the filters array. */ - for(n = 0; n < pline->nalloc; ++n) - if(pline->filter[n].cd_values == pline->filter[n]._cd_values) + for (n = 0; n < pline->nalloc; ++n) + 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") + 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. @@ -1061,22 +1091,22 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, 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 */ + if (cd_nelmts > 0) { + size_t i; /* Local index variable */ /* Allocate memory or point at internal buffer */ - if(cd_nelmts > H5Z_COMMON_CD_VALUES) { + if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); - if(NULL == pline->filter[idx].cd_values) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") + if (NULL == pline->filter[idx].cd_values) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; /* Copy client data values */ - for(i = 0; i < cd_nelmts; i++) + for (i = 0; i < cd_nelmts; i++) pline->filter[idx].cd_values[i] = cd_values[i]; } /* end if */ else @@ -1095,8 +1125,8 @@ done: * 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 + * Return: Success: Non-negative index of entry in global filter table. + * Failure: Negative *------------------------------------------------------------------------- */ static int @@ -1107,9 +1137,9 @@ H5Z_find_idx(H5Z_filter_t id) 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 + * 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 @@ -1174,51 +1205,55 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, 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 */ + 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(filter_mask); - HDassert(nbytes && *nbytes > 0); - HDassert(buf_size && *buf_size > 0); - HDassert(buf && *buf); - HDassert(!pline || pline->nused < H5Z_MAX_NFILTERS); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); + HDassert (filter_mask); + HDassert (nbytes && *nbytes>0); + HDassert (buf_size && *buf_size>0); + HDassert (buf && *buf); + HDassert (!pline || pline->nusednused; i > 0; --i) { - idx = i - 1; + idx = i-1; if (*filter_mask & ((unsigned)1 << idx)) { failed |= (unsigned)1 << idx; - continue;/*filter excluded*/ + 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) { + * 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; + 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)))) { + 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") + herr_t status = H5Z_register(filter_info); + if (filter_info->name) + filter_info->name = (char *)H5MM_xfree(filter_info->name); + filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); + if (status < 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) + if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) issue_error = TRUE; } /* end if */ else @@ -1227,8 +1262,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* Check for error */ if(issue_error) { /* Print out the filter name to give more info. But the name is optional for - * the filter */ - if(pline->filter[idx].name) + * 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 HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") @@ -1238,26 +1273,26 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + H5_timer_begin (&timer); #endif - tmp_flags = flags|(pline->filter[idx].flags); + 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); + pline->filter[idx].cd_values, *nbytes, buf_size, buf); #ifdef H5Z_DEBUG - H5_timer_end(&(fstats->stats[1].timer), &timer); + 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 (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") *nbytes = *buf_size; failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); } else { *nbytes = new_nbytes; @@ -1276,35 +1311,34 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); continue; /*filter excluded*/ } fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + 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); + 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 == 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") + 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; } failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); } - else { + else *nbytes = new_nbytes; - } } } @@ -1320,7 +1354,8 @@ done: * * Purpose: Get pointer to filter info for pipeline * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ H5Z_filter_info_t * @@ -1331,17 +1366,17 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(NULL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; 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]; @@ -1365,21 +1400,21 @@ done: htri_t H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) { - size_t idx; /* Index of filter in pipeline */ - htri_t ret_value = TRUE; /* Return value */ + 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 (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; 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) + if (idx >= pline->nused) ret_value = FALSE; done: @@ -1394,30 +1429,31 @@ done: * 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 + * Return: Non-negative (TRUE/FALSE) on success + * Negative on failure *------------------------------------------------------------------------- */ htri_t H5Z_all_filters_avail(const H5O_pline_t *pline) { - size_t i,j; /* Local index variable */ - htri_t ret_value=TRUE; /* Return value */ + size_t i, j; /* Local index variable */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(pline); + HDassert (pline); /* Iterate through all the filters in pipeline */ - for(i = 0; i < pline->nused; i++) { + for (i = 0; i < pline->nused; i++) { /* Look for each filter in the list of registered filters */ - for(j = 0; j < H5Z_table_used_g; j++) - if(H5Z_table_g[j].id == pline->filter[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) - HGOTO_DONE(FALSE) + if (j == H5Z_table_used_g) + HGOTO_DONE (FALSE) } /* end for */ done: @@ -1432,7 +1468,8 @@ done: * Purpose: Delete filter FILTER from pipeline PLINE; * deletes all filters if FILTER is H5Z_FILTER_NONE * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1443,52 +1480,52 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* if the pipeline has no filters, just return */ - if(pline->nused == 0) - HGOTO_DONE(SUCCEED) + if (pline->nused == 0) + HGOTO_DONE (SUCCEED) /* Delete all filters */ - if(H5Z_FILTER_ALL == filter) { - if(H5O_msg_reset(H5O_PLINE_ID, pline) < 0) + if (H5Z_FILTER_ALL == filter) { + if (H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFREE, FAIL, "can't release pipeline info") } /* end if */ /* Delete filter */ else { - size_t idx; /* Index of filter in pipeline */ - hbool_t found = FALSE; /* Indicate filter was found in pipeline */ + size_t idx; /* Index of filter in pipeline */ + hbool_t found = FALSE; /* Indicate filter was found in pipeline */ /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; idx++) - if(pline->filter[idx].id == filter) { + for (idx = 0; idx < pline->nused; idx++) + if (pline->filter[idx].id == filter) { found = TRUE; break; } /* end if */ /* filter was not found in the pipeline */ - if(!found) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + if (!found) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Free information for deleted filter */ - if(pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) - HDassert((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); - if(pline->filter[idx].name != pline->filter[idx]._name) + if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) + HDassert ((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); + if (pline->filter[idx].name != pline->filter[idx]._name) pline->filter[idx].name = (char *)H5MM_xfree(pline->filter[idx].name); - if(pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) - HDassert(pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); - if(pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + if (pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + HDassert (pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); + if (pline->filter[idx].cd_values != pline->filter[idx]._cd_values) pline->filter[idx].cd_values = (unsigned *)H5MM_xfree(pline->filter[idx].cd_values); /* Remove filter from pipeline array */ - if((idx + 1) < pline->nused) { + if ((idx + 1) < pline->nused) { /* Copy filters down & fix up any client data value arrays using internal storage */ - for(; (idx + 1) < pline->nused; idx++) { + for (; (idx + 1) < pline->nused; idx++) { pline->filter[idx] = pline->filter[idx + 1]; - if(pline->filter[idx].name && (HDstrlen(pline->filter[idx].name) + 1) <= H5Z_COMMON_NAME_LEN) + if (pline->filter[idx].name && (HDstrlen(pline->filter[idx].name) + 1) <= H5Z_COMMON_NAME_LEN) pline->filter[idx].name = pline->filter[idx]._name; - if(pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) + if (pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) pline->filter[idx].cd_values = pline->filter[idx]._cd_values; } /* end for */ } /* end if */ @@ -1497,7 +1534,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) pline->nused--; /* Reset information for previous last filter in pipeline */ - HDmemset(&pline->filter[pline->nused], 0, sizeof(H5Z_filter_info_t)); + HDmemset (&pline->filter[pline->nused], 0, sizeof(H5Z_filter_info_t)); } /* end else */ done: @@ -1510,6 +1547,9 @@ done: * * Purpose: Gets information about a pipeline data filter and stores it * in filter_config_flags. + * + * Return: zero on success + * negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1521,8 +1561,8 @@ H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) H5TRACE2("e", "Zf*Iu", filter, filter_config_flags); /* Get the filter info */ - if(H5Z_get_filter_info(filter, filter_config_flags) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "Filter info not retrieved") + if (H5Z_get_filter_info(filter, filter_config_flags) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "Filter info not retrieved") done: FUNC_LEAVE_API(ret_value) @@ -1534,6 +1574,9 @@ done: * * Purpose: Gets information about a pipeline data filter and stores it * in filter_config_flags. + * + * Return: zero on success + * negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1545,16 +1588,16 @@ H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) FUNC_ENTER_NOAPI(FAIL) /* Look up the filter class info */ - if(NULL == (fclass = H5Z_find(filter))) - HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") + if (NULL == (fclass = H5Z_find(filter))) + HGOTO_ERROR (H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") /* Set the filter config flags for the application */ - if(filter_config_flags != NULL) { + if (filter_config_flags != NULL) { *filter_config_flags = 0; - if(fclass->encoder_present) + if (fclass->encoder_present) *filter_config_flags |= H5Z_FILTER_CONFIG_ENCODE_ENABLED; - if(fclass->decoder_present) + if (fclass->decoder_present) *filter_config_flags |= H5Z_FILTER_CONFIG_DECODE_ENABLED; } /* end if */ -- cgit v0.12 From fbae544330037bdaec14238a6486e8d0677eae4b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 15:00:13 -0600 Subject: Fix typo --- src/H5PLint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index e969cbf..33dda96 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -372,7 +372,7 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v done: if (!success && handle) - if (*plugin_info) { + if (*plugin_info) *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") -- cgit v0.12 From 6019c126c40d836a53a7b0eeb9b6873683206319 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 13:59:57 -0600 Subject: HDFFV-10328 - remove allocation changes --- src/H5PLint.c | 21 +-------------------- src/H5PLplugin_cache.c | 22 +--------------------- src/H5Z.c | 33 ++++----------------------------- 3 files changed, 6 insertions(+), 70 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index 33dda96..c887f86 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -342,38 +342,19 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v /* Check if the filter IDs match */ if (info->id == id) { - H5Z_class2_t *plugin_copy = NULL; /* 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") - /* allocate local copy of plugin info */ - if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") - /* Set the plugin info to return */ - *plugin_info = (const void *)info; - - plugin_copy->version = info->version; - plugin_copy->id = info->id; - plugin_copy->encoder_present = info->encoder_present; - plugin_copy->decoder_present = info->decoder_present; - plugin_copy->can_apply = info->can_apply; - plugin_copy->set_local = info->set_local; - plugin_copy->filter = info->filter; - /* copy the user's string into the property */ - if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(info->name))) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") - /* Set output parameters */ *success = TRUE; + *plugin_info = (const void *)info; } } done: if (!success && handle) - if (*plugin_info) - *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index ec14159..e483e01 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -280,7 +280,6 @@ 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; - H5Z_class2_t *plugin_copy = NULL; /* 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"))) @@ -290,24 +289,9 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info_function)())) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") - if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") - /* Set the plugin info to return */ - *plugin_info = plugin_copy; - - plugin_copy->version = filter_info->version; - plugin_copy->id = filter_info->id; - plugin_copy->encoder_present = filter_info->encoder_present; - plugin_copy->decoder_present = filter_info->decoder_present; - plugin_copy->can_apply = filter_info->can_apply; - plugin_copy->set_local = filter_info->set_local; - plugin_copy->filter = filter_info->filter; - /* copy the user's string into the property */ - if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(filter_info->name))) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") - /* Set output parameters */ *found = TRUE; + *plugin_info = filter_info; /* No need to continue processing */ break; @@ -317,10 +301,6 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f } /* end for */ done: - /* unallocate local copy of plugin info on failure */ - if (FAIL == ret_value && *plugin_info) { - *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); - } FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_cache() */ #pragma GCC diagnostic pop diff --git a/src/H5Z.c b/src/H5Z.c index e7574cd..1f1a905 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -123,7 +123,6 @@ int H5Z_term_package(void) { int n = 0; - size_t i; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -131,6 +130,7 @@ H5Z_term_package(void) #ifdef H5Z_DEBUG char comment[16], bandwidth[32]; int dir, nprint = 0; + size_t i; if(H5DEBUG(Z)) { for(i = 0; i < H5Z_table_used_g; i++) { @@ -179,12 +179,6 @@ H5Z_term_package(void) } /* end for */ } /* end if */ #endif /* H5Z_DEBUG */ - for (i = 0; i < H5Z_table_used_g; i++) { - H5Z_class2_t *cls = (H5Z_class2_t *)(H5Z_table_g+i); - /* deallocate plugin info name */ - if (cls->name) - cls->name = (char *)H5MM_xfree(cls->name); - } /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); @@ -325,20 +319,14 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); - H5Z_table_g[i].name = (char *)H5MM_xstrdup(cls->name); #ifdef H5Z_DEBUG HDmemset (H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ } /* end if */ /* Filter already registered */ else { - H5Z_class2_t *old_cls = (H5Z_class2_t *)(H5Z_table_g+i); - /* deallocate plugin info name */ - if (old_cls->name) - old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Replace old contents */ - HDmemcpy (old_cls, cls, sizeof(H5Z_class2_t)); - old_cls->name = (char *)H5MM_xstrdup(cls->name); + HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); } /* end else */ done: @@ -394,7 +382,6 @@ H5Z_unregister(H5Z_filter_t filter_id) size_t filter_index; /* Local index variable for filter */ H5Z_object_t object; herr_t ret_value = SUCCEED; /* Return value */ - H5Z_class2_t *old_cls = NULL; FUNC_ENTER_NOAPI(FAIL) @@ -431,10 +418,6 @@ H5Z_unregister(H5Z_filter_t filter_id) if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - /* deallocate plugin info name */ - old_cls = (H5Z_class2_t *)(H5Z_table_g+filter_index); - if (old_cls->name) - old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); @@ -658,11 +641,7 @@ H5Z_filter_avail(H5Z_filter_t id) HGOTO_DONE (TRUE) if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { - herr_t status = H5Z_register(filter_info); - if (filter_info->name) - filter_info->name = (char *)H5MM_xfree(filter_info->name); - filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); - if (status < 0) + if (H5Z_register (filter_info) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") HGOTO_DONE (TRUE) } @@ -1245,11 +1224,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* 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 */ - herr_t status = H5Z_register(filter_info); - if (filter_info->name) - filter_info->name = (char *)H5MM_xfree(filter_info->name); - filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); - if (status < 0) + 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 */ -- cgit v0.12 From 7aad737c9613712429ffb956d15938c34ee6363e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 14:02:07 -0600 Subject: HDFFV-10328 remove allocation note --- release_docs/RELEASE.txt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9e3c3a9..a1b59b1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -160,8 +160,7 @@ Bug Fixes since HDF5-1.10.1 release - filter plugin handling in H5PL.c and H5Z.c It was discovered that the dynamic loading process used by - filter plugins had issues with memory allocation and library - dependencies. + filter plugins had issues with library dependencies. CMake build process changed to use LINK INTERFACE keywords, which allowed HDF5 C library to make dependent libraries private. The @@ -169,13 +168,6 @@ Bug Fixes since HDF5-1.10.1 release (such as szip or zlib) to be available. (ADB - 2017/11/16, HDFFV-10328) - The H5Z_class2_t structure returned by the filter plugins are - now dynamically allocated in H5Zregister function. Access to - the functions in the filter library now always use the dynamic - library API. - - (ADB - 2017/11/16, HDFFV-10329) - - H5Zfilter_avail in H5Z.c The public function checked for plugins, while the private -- cgit v0.12 From 459e214ed5c48cdee335fe02f4534ab48ac49e3e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 14:20:14 -0600 Subject: HDFFV-10328 - fix typos --- src/H5Z.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 1f1a905..a9f7336 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1219,12 +1219,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; - 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) + 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 */ @@ -1235,7 +1235,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, issue_error = TRUE; /* Check for error */ - if(issue_error) { + if (issue_error) { /* Print out the filter name to give more info. But the name is optional for * the filter */ if (pline->filter[idx].name) @@ -1269,9 +1269,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, failed |= (unsigned)1 << idx; H5E_clear_stack (NULL); } - else { + else *nbytes = new_nbytes; - } } } else if (pline) { /* Write */ -- cgit v0.12 From d5b70b549e41a1a48e3745cb2c076e8953b60a71 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 17 Nov 2017 15:21:49 -0800 Subject: Brings H5Z and H5PL packages in sync with VOL integration branch. --- src/H5PLint.c | 62 +++-- src/H5PLpath.c | 4 +- src/H5PLpkg.h | 8 +- src/H5PLplugin_cache.c | 14 +- src/H5PLprivate.h | 7 +- src/H5PLpublic.h | 6 +- src/H5Z.c | 173 ++++++------ test/error_test.c | 416 ++++++++++++++--------------- test/testfiles/error_test_1 | 2 +- tools/test/h5dump/errfiles/filter_fail.err | 2 +- 10 files changed, 352 insertions(+), 342 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index c887f86..b190746 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -235,11 +235,11 @@ done: *------------------------------------------------------------------------- */ const void * -H5PL_load(H5PL_type_t type, int id) +H5PL_load(H5PL_type_t type, H5PL_key_t key) { - H5PL_search_params_t search_params; + H5PL_search_params_t search_params; /* Plugin search parameters */ hbool_t found = FALSE; /* Whether the plugin was found */ - const void *plugin_info = NULL; + const void *plugin_info = NULL; /* Information from the plugin */ const void *ret_value = NULL; FUNC_ENTER_NOAPI(NULL) @@ -248,18 +248,17 @@ H5PL_load(H5PL_type_t type, int id) 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) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "filter plugins disabled") 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) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "Invalid plugin type specified") } /* Set up the search parameters */ search_params.type = type; - search_params.id = id; + search_params.key.id = key.id; /* Search in the table of already loaded plugin libraries */ if(H5PL__find_plugin_in_cache(&search_params, &found, &plugin_info) < 0) @@ -304,11 +303,11 @@ done: #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) +H5PL__open(const char *path, H5PL_type_t type, H5PL_key_t key, 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; + herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -326,35 +325,46 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v */ if (NULL == (handle = H5PL_OPEN_DLIB(path))) { H5PL_CLR_ERROR; /* clear error */ - HGOTO_DONE(SUCCEED); + 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. */ - if (NULL != (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) { - - const H5Z_class2_t *info; + if (NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) + HGOTO_DONE(SUCCEED) - /* 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") + /* Get the plugin information */ + switch (type) { + case H5PL_TYPE_FILTER: + { + const H5Z_class2_t *filter_info; - /* Check if the filter IDs match */ - if (info->id == id) { + /* Get the plugin info */ + if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info)())) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get filter info from plugin") - /* 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") + /* If the filter IDs match, we're done. Set the output parameters. */ + if (filter_info->id == key.id) { + *plugin_info = (const void *)filter_info; + *success = TRUE; + } - /* Set output parameters */ - *success = TRUE; - *plugin_info = (const void *)info; + break; } - } + case H5PL_TYPE_ERROR: + case H5PL_TYPE_NONE: + default: + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "Invalid plugin type specified") + } /* end switch */ + + /* If we found the correct plugin, store it in the cache */ + if (*success) + if (H5PL__add_plugin(type, key, handle)) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to add new plugin to plugin cache") done: - if (!success && handle) + if (!(*success) && handle) if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 435802a..d8e82f8 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -689,7 +689,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo 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) + if (H5PL__open(path, search_params->type, search_params->key, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) @@ -755,7 +755,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo 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) + if (H5PL__open(path, search_params->type, search_params->search_key.id, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index 0d1c271..dfaa4af 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -115,8 +115,8 @@ /* Data used to search for plugins */ typedef struct H5PL_search_params_t { - H5PL_type_t type; - int id; + H5PL_type_t type; + H5PL_key_t key; } H5PL_search_params_t; @@ -134,13 +134,13 @@ 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__open(const char *libname, H5PL_type_t type, H5PL_key_t key, 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__add_plugin(H5PL_type_t type, H5PL_key_t key, 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 */ diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index e483e01..e905ac2 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -56,9 +56,9 @@ /* 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_type_t type; /* Plugin type */ + H5PL_key_t key; /* Unique key to identify the plugin */ + H5PL_HANDLE handle; /* Plugin handle */ } H5PL_plugin_t; @@ -209,14 +209,14 @@ done: /*------------------------------------------------------------------------- * Function: H5PL__add_plugin * - * Purpose: Add a plugin to the plugin cached. + * Purpose: Add a plugin to the plugin cache. * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t -H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle) +H5PL__add_plugin(H5PL_type_t type, H5PL_key_t key, H5PL_HANDLE handle) { herr_t ret_value = SUCCEED; @@ -229,7 +229,7 @@ H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle) /* 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].key = key; H5PL_cache_g[H5PL_num_plugins_g].handle = handle; H5PL_num_plugins_g++; @@ -276,7 +276,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f 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)) { + if ((search_params->type == (H5PL_cache_g[u]).type) && (search_params->key.id == (H5PL_cache_g[u]).key.id)) { H5PL_get_plugin_info_t get_plugin_info_function; const H5Z_class2_t *filter_info; diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index bc12e64..cc2e258 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -33,6 +33,11 @@ /* Library Private Typedefs */ /****************************/ +/* The key that will be used to find the plugin */ +typedef union H5PL_key_t { + int id; /* filters */ +} H5PL_key_t; + /*****************************/ /* Library-private Variables */ @@ -44,7 +49,7 @@ /***************************************/ /* Internal API routines */ -H5_DLL const void *H5PL_load(H5PL_type_t plugin_type, int type_id); +H5_DLL const void *H5PL_load(H5PL_type_t plugin_type, H5PL_key_t key); #endif /* _H5PLprivate_H */ diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 3b36ccd..fe5bdfb 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -30,9 +30,9 @@ /* 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 */ diff --git a/src/H5Z.c b/src/H5Z.c index a9f7336..1e7cd79 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -86,24 +86,24 @@ H5Z__init_package(void) FUNC_ENTER_PACKAGE /* Internal filters */ - if (H5Z_register (H5Z_SHUFFLE) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") - if (H5Z_register (H5Z_FLETCHER32) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") - if (H5Z_register (H5Z_NBIT) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") - if (H5Z_register (H5Z_SCALEOFFSET) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") + if (H5Z_register(H5Z_SHUFFLE) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") + if (H5Z_register(H5Z_FLETCHER32) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") + if (H5Z_register(H5Z_NBIT) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") + if (H5Z_register(H5Z_SCALEOFFSET) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") /* External filters */ #ifdef H5_HAVE_FILTER_DEFLATE - if (H5Z_register (H5Z_DEFLATE) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") + if (H5Z_register(H5Z_DEFLATE) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if (H5Z_register (H5Z_SZIP) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") + if (H5Z_register(H5Z_SZIP) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") #endif /* H5_HAVE_FILTER_SZIP */ done: @@ -180,7 +180,7 @@ H5Z_term_package(void) } /* end if */ #endif /* H5Z_DEBUG */ /* Free the table of filters */ - if(H5Z_table_g) { + if (H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); #ifdef H5Z_DEBUG H5Z_stat_table_g = (H5Z_stats_t *)H5MM_xfree(H5Z_stat_table_g); @@ -191,7 +191,7 @@ H5Z_term_package(void) } /* end if */ /* Mark interface as closed */ - if(0 == n) + if (0 == n) H5_PKG_INIT_VAR = FALSE; } /* end if */ @@ -219,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. @@ -251,20 +251,20 @@ H5Zregister(const void *cls) #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Deprecated symbols not allowed, throw an error */ - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* 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->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") if (cls_real->filter == 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") + if (H5Z_register(cls_real) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") done: FUNC_LEAVE_API(ret_value) @@ -289,8 +289,8 @@ H5Z_register (const H5Z_class2_t *cls) FUNC_ENTER_NOAPI(FAIL) - HDassert (cls); - HDassert (cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); + HDassert(cls); + HDassert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); /* Is the filter already registered? */ for (i = 0; i < H5Z_table_used_g; i++) @@ -306,11 +306,11 @@ H5Z_register (const H5Z_class2_t *cls) 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") + 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") + 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; @@ -318,15 +318,15 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; - HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + 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)); + HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); } /* end else */ done: @@ -420,9 +420,9 @@ H5Z_unregister(H5Z_filter_t filter_id) /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ - HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove(&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); #ifdef H5Z_DEBUG - HDmemmove (&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove(&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); #endif /* H5Z_DEBUG */ H5Z_table_used_g--; @@ -450,11 +450,11 @@ H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id) /* Get the plist structure of object creation */ if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) - HGOTO_ERROR (H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") + HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") /* Check if the object creation property list uses the filter */ if ((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") done: FUNC_LEAVE_NOAPI(ret_value) @@ -487,11 +487,11 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void /* Get the group creation property */ if ((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") /* Check if the filter is in the group creation property list */ if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. @@ -504,7 +504,7 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void done: if (ocpl_id > 0) if (H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_group_cb() */ @@ -536,11 +536,11 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * /* Get the dataset creation property */ 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") + 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 */ if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. @@ -553,7 +553,7 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * done: if (ocpl_id > 0) if (H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_dset_cb() */ @@ -582,7 +582,7 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUS * 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) - HGOTO_ERROR (H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") } /* end if */ done: @@ -608,10 +608,10 @@ 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") + 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") done: FUNC_LEAVE_API(ret_value) @@ -629,22 +629,25 @@ done: htri_t H5Z_filter_avail(H5Z_filter_t id) { - size_t i; /* Local index variable */ - H5Z_class2_t *filter_info; - htri_t ret_value = FALSE; /* Return value */ + H5PL_key_t key; /* Key for finding a plugin */ + const H5Z_class2_t *filter_info; /* Filter information */ + size_t i; /* Local index variable */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* 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) + key.id = (int)id; + if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, key))) { + 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() */ @@ -683,7 +686,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, if (pline->filter[u].flags & H5Z_FLAG_OPTIONAL) H5E_clear_stack (NULL); else - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") } /* end if */ else { /* Make correct callback */ @@ -691,7 +694,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, case H5Z_PRELUDE_CAN_APPLY: /* Check if filter is configured to be able to encode */ if (!fclass->encoder_present) - HGOTO_ERROR (H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); + HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); /* Check if there is a "can apply" callback */ @@ -716,7 +719,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, /* Make callback to filter's "set local" function */ if ((fclass->set_local)(dcpl_id, type_id, space_id) < 0) /* Indicate error during filter callback */ - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") } /* end if */ break; @@ -753,8 +756,8 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type FUNC_ENTER_NOAPI_NOINIT - HDassert (H5I_GENPROP_LST == H5I_get_type(dcpl_id)); - HDassert (H5I_DATATYPE == H5I_get_type(type_id)); + HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); + HDassert(H5I_DATATYPE == H5I_get_type(type_id)); /* Check if the property list is non-default */ if (dcpl_id != H5P_DATASET_CREATE_DEFAULT) { @@ -834,7 +837,7 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -865,7 +868,7 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -894,7 +897,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -927,7 +930,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -952,10 +955,10 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert (0 == cd_nelmts || cd_values); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert(0 == cd_nelmts || cd_values); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -964,7 +967,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; @@ -982,7 +985,7 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); if (NULL == pline->filter[idx].cd_values) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; @@ -1017,10 +1020,10 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert (0 == cd_nelmts || cd_values); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert(0 == cd_nelmts || cd_values); /* * Check filter limit. We do it here for early warnings although we may @@ -1052,13 +1055,13 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, 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") + 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. */ - for(n = 0; n < pline->nalloc; ++n) - if(x.filter[n].cd_values == (void *) ~((size_t) NULL)) + for (n = 0; n < pline->nalloc; ++n) + if (x.filter[n].cd_values == (void *) ~((size_t) NULL)) x.filter[n].cd_values = x.filter[n]._cd_values; /* Point to newly allocated buffer */ @@ -1079,7 +1082,7 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); if (NULL == pline->filter[idx].cd_values) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; @@ -1118,7 +1121,7 @@ H5Z_find_idx(H5Z_filter_t id) for (i = 0; i < H5Z_table_used_g; i++) if (H5Z_table_g[i].id == id) - HGOTO_DONE ((int)i) + HGOTO_DONE((int)i) done: FUNC_LEAVE_NOAPI(ret_value) @@ -1145,10 +1148,10 @@ 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 %d is not registered", id) + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "required filter %d is not registered", id) /* Set return value */ - ret_value = H5Z_table_g+idx; + ret_value = H5Z_table_g + idx; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1219,13 +1222,15 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; + H5PL_key_t key; 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)))) { + key.id = (int)(pline->filter[idx].id); + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, key))) { /* Register the filter we loaded */ - if (H5Z_register(filter_info) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + 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) @@ -1263,7 +1268,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, 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") + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") *nbytes = *buf_size; failed |= (unsigned)1 << idx; @@ -1303,7 +1308,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, 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") + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") *nbytes = *buf_size; } @@ -1350,7 +1355,7 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) /* 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") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") /* Set return value */ ret_value = &pline->filter[idx]; @@ -1427,7 +1432,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) /* Check if we didn't find the filter */ if (j == H5Z_table_used_g) - HGOTO_DONE (FALSE) + HGOTO_DONE(FALSE) } /* end for */ done: @@ -1480,7 +1485,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) /* filter was not found in the pipeline */ if (!found) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Free information for deleted filter */ if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) @@ -1563,7 +1568,7 @@ H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) /* Look up the filter class info */ if (NULL == (fclass = H5Z_find(filter))) - HGOTO_ERROR (H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") + HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") /* Set the filter config flags for the application */ if (filter_config_flags != NULL) { diff --git a/test/error_test.c b/test/error_test.c index 9c39065..5356fa7 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -82,35 +82,33 @@ static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, /*------------------------------------------------------------------------- - * Function: test_error + * Function: test_error * - * Purpose: Test error API functions + * Purpose: Test error API functions * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t test_error(hid_t file) { - hid_t dataset, space; - hid_t estack_id; + hid_t dataset = -1; + hid_t space = -1; + hid_t estack_id = -1; hsize_t dims[2]; const char *FUNC_test_error = "test_error"; H5E_auto2_t old_func; - void *old_data; + void *old_data = NULL; HDfprintf(stderr, "\nTesting error API based on data I/O\n"); /* Create the data space */ dims[0] = DIM0; dims[1] = DIM1; - if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR; + if ((space = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR; /* Test H5E_BEGIN_TRY */ H5E_BEGIN_TRY { @@ -118,40 +116,40 @@ test_error(hid_t file) } H5E_END_TRY; /* Create the dataset */ - if((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { + if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE, "H5Dcreate2 failed"); goto error; - } /* end if */ + } /* Test enabling and disabling default printing */ - if(H5Eget_auto2(H5E_DEFAULT, &old_func, &old_data) < 0) - TEST_ERROR; - if(old_data != NULL) - TEST_ERROR; + if (H5Eget_auto2(H5E_DEFAULT, &old_func, &old_data) < 0) + TEST_ERROR; + if (old_data != NULL) + TEST_ERROR; #ifdef H5_USE_16_API if (old_func != (H5E_auto_t)H5Eprint) - TEST_ERROR; + TEST_ERROR; #else /* H5_USE_16_API */ if (old_func != (H5E_auto2_t)H5Eprint2) - TEST_ERROR; + TEST_ERROR; #endif /* H5_USE_16_API */ - if(H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) + if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) TEST_ERROR; /* Make H5Dwrite fail, verify default print is disabled */ - if(H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) >= 0) { + if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) >= 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, "H5Dwrite shouldn't succeed"); goto error; - } /* end if */ + } - if(H5Eset_auto2(H5E_DEFAULT, old_func, old_data) < 0) + if (H5Eset_auto2(H5E_DEFAULT, old_func, old_data) < 0) TEST_ERROR; /* Test saving and restoring the current error stack */ - if(H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) { + if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, "H5Dwrite failed as supposed to"); estack_id = H5Eget_current_stack(); @@ -159,10 +157,11 @@ test_error(hid_t file) H5Sclose(space); H5Eset_current_stack(estack_id); goto error; - } /* end if */ + } /* In case program comes to this point, close dataset */ - if(H5Dclose(dataset) < 0) TEST_ERROR; + if(H5Dclose(dataset) < 0) + TEST_ERROR; TEST_ERROR; @@ -172,16 +171,12 @@ test_error(hid_t file) /*------------------------------------------------------------------------- - * Function: init_error + * Function: init_error * - * Purpose: Initialize error information. + * Purpose: Initialize error information. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -194,46 +189,46 @@ init_error(void) char *msg = NULL; H5E_type_t msg_type; - if(NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1))) + if (NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1))) TEST_ERROR - if(NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1))) + if (NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1))) TEST_ERROR - if((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0) + if ((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0) TEST_ERROR; - if(cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) + if (cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) TEST_ERROR; - if(HDstrcmp(ERR_CLS_NAME, cls_name)) + if (HDstrcmp(ERR_CLS_NAME, cls_name)) TEST_ERROR; - if((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0) + if ((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0) TEST_ERROR; - if((ERR_MAJ_IO = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_IO_MSG)) < 0) + if ((ERR_MAJ_IO = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_IO_MSG)) < 0) TEST_ERROR; - if((ERR_MAJ_API = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_API_MSG)) < 0) + if ((ERR_MAJ_API = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_API_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_SUBROUTINE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_SUBROUTINE_MSG)) < 0) + if ((ERR_MIN_SUBROUTINE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_SUBROUTINE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_ERRSTACK = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_ERRSTACK_MSG)) < 0) + if ((ERR_MIN_ERRSTACK = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_ERRSTACK_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_CREATE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_CREATE_MSG)) < 0) + if ((ERR_MIN_CREATE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_CREATE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_WRITE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_WRITE_MSG)) < 0) + if ((ERR_MIN_WRITE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_WRITE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_GETNUM = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_GETNUM_MSG)) < 0) + if ((ERR_MIN_GETNUM = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_GETNUM_MSG)) < 0) TEST_ERROR; - if(msg_size != H5Eget_msg(ERR_MIN_SUBROUTINE, &msg_type, msg, (size_t)msg_size) + 1) + if (msg_size != H5Eget_msg(ERR_MIN_SUBROUTINE, &msg_type, msg, (size_t)msg_size) + 1) TEST_ERROR; - if(msg_type != H5E_MINOR) + if (msg_type != H5E_MINOR) TEST_ERROR; - if(HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG)) + if (HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG)) TEST_ERROR; /* Register another class for later testing. */ - if((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0) + if ((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0) TEST_ERROR; HDfree(cls_name); @@ -242,9 +237,9 @@ init_error(void) return 0; error: - if(cls_name) + if (cls_name) HDfree(cls_name); - if(msg) + if (msg) HDfree(msg); return -1; @@ -252,16 +247,12 @@ error: /*------------------------------------------------------------------------- - * Function: error_stack - * - * Purpose: Manipulates current error stack. + * Function: error_stack * - * Return: Success: 0 + * Purpose: Manipulates current error stack. * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 14, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -271,23 +262,23 @@ error_stack(void) ssize_t err_num; const char *FUNC_error_stack = "error_stack"; - if((err_num = H5Eget_num(H5E_DEFAULT)) < 0) + if ((err_num = H5Eget_num(H5E_DEFAULT)) < 0) TEST_ERROR; - if(err_num) + if (err_num) TEST_ERROR; - if((ERR_STACK = H5Eget_current_stack()) < 0) + if ((ERR_STACK = H5Eget_current_stack()) < 0) TEST_ERROR; /* Make it push error, force this function to fail */ - if((err_num = H5Eget_num(ERR_STACK)) == 0) { + if ((err_num = H5Eget_num(ERR_STACK)) == 0) { H5Epush(ERR_STACK, __FILE__, FUNC_error_stack, __LINE__, ERR_CLS, ERR_MAJ_API, ERR_MIN_GETNUM, "Get number test failed, returned %d", (int)err_num); goto error; - } /* end if */ + } /* In case program falls through here, close the stack and let it fail. */ - if(H5Eclose_stack(ERR_STACK) < 0) + if (H5Eclose_stack(ERR_STACK) < 0) TEST_ERROR; return -1; @@ -300,14 +291,10 @@ error: /*------------------------------------------------------------------------- * Function: long_desc_cb * - * Purpose: Callback function to help test long description handling - * - * Return: Success: 0 + * Purpose: Callback function to help test long description handling * - * Failure: -1 - * - * Programmer: Quincey Koziol - * January 19, 2005 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -316,24 +303,20 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie { char *real_desc = (char *)client_data; - if(err_desc->desc != NULL && HDstrcmp(err_desc->desc, real_desc) == 0) - return(0); + if (err_desc->desc != NULL && HDstrcmp(err_desc->desc, real_desc) == 0) + return 0; else - return(-1); + return -1; } /* end long_desc_cb() */ /*------------------------------------------------------------------------- - * Function: test_long_desc + * Function: test_long_desc * - * Purpose: Test long error description handling + * Purpose: Test long error description handling * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Quincey Koziol - * January 19, 2005 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -347,56 +330,59 @@ test_long_desc(void) const char *test_FUNC = "test_long_desc"; /* Allocate space for the error description info */ - if(NULL == (long_desc = (char*)HDmalloc(LONG_DESC_SIZE))) TEST_ERROR; - if(NULL == (full_desc = (char*)HDmalloc(LONG_DESC_SIZE + 128))) TEST_ERROR; + if (NULL == (long_desc = (char *)HDmalloc(LONG_DESC_SIZE))) + TEST_ERROR; + if (NULL == (full_desc = (char *)HDmalloc(LONG_DESC_SIZE + 128))) + TEST_ERROR; /* Create the long part of the error description */ - for(u = 0; u < LONG_DESC_SIZE; u++) + for (u = 0; u < LONG_DESC_SIZE; u++) long_desc[u] = (char)('A' + (u % 26)); long_desc[LONG_DESC_SIZE - 1] = '\0'; /* Clear the default error stack */ - if(H5Eclear2(H5E_DEFAULT) < 0) TEST_ERROR; + if (H5Eclear2(H5E_DEFAULT) < 0) + TEST_ERROR; /* Push an error with a long description */ - if(H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0) TEST_ERROR; + if (H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0) + TEST_ERROR; /* Create the string that should be in the description. Must use HDsnprintf here - * because snprintf is _snprintf on Windows */ + * because snprintf is _snprintf on Windows + */ HDsnprintf(full_desc, (size_t)(LONG_DESC_SIZE + 128), format, long_desc); /* Make certain that the description is correct */ - if(H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0) TEST_ERROR; + if (H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0) + TEST_ERROR; /* Clear the default error stack again */ - if(H5Eclear2(H5E_DEFAULT) < 0) TEST_ERROR; + if (H5Eclear2(H5E_DEFAULT) < 0) + TEST_ERROR; HDfree(long_desc); HDfree(full_desc); - return(0); + return 0; error: - if(long_desc) + if (long_desc) HDfree(long_desc); - if(full_desc) + if (full_desc) HDfree(full_desc); - return(-1); + return -1; } /* end test_long_desc() */ /*------------------------------------------------------------------------- * Function: dump_error * - * Purpose: Prints error stack in default and customized ways. + * Purpose: Prints error stack in default and customized ways. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 17, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -405,12 +391,12 @@ dump_error(hid_t estack) { /* Print errors in library default way */ HDfprintf(stderr, "********* Print error stack in HDF5 default way *********\n"); - if(H5Eprint2(estack, stderr) < 0) + if (H5Eprint2(estack, stderr) < 0) TEST_ERROR; /* Customized way to print errors */ HDfprintf(stderr, "\n********* Print error stack in customized way *********\n"); - if(H5Ewalk2(estack, H5E_WALK_UPWARD, custom_print_cb, stderr) < 0) + if (H5Ewalk2(estack, H5E_WALK_UPWARD, custom_print_cb, stderr) < 0) TEST_ERROR; return 0; @@ -423,34 +409,30 @@ error: /*------------------------------------------------------------------------- * Function: custom_print_cb * - * Purpose: Callback function to print error stack in customized way. - * - * Return: Success: 0 + * Purpose: Callback function to print error stack in customized way. * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 17, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void* client_data) { - FILE *stream = (FILE *)client_data; + FILE *stream = (FILE *)client_data; char maj[MSG_SIZE]; char min[MSG_SIZE]; char cls[MSG_SIZE]; - const int indent = 4; + const int indent = 4; /* Get descriptions for the major and minor error numbers */ - if(H5Eget_class_name(err_desc->cls_id, cls, MSG_SIZE) < 0) + if (H5Eget_class_name(err_desc->cls_id, cls, MSG_SIZE) < 0) TEST_ERROR; - if(H5Eget_msg(err_desc->maj_num, NULL, maj, MSG_SIZE) < 0) + if (H5Eget_msg(err_desc->maj_num, NULL, maj, MSG_SIZE) < 0) TEST_ERROR; - if(H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE) < 0) + if (H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE) < 0) TEST_ERROR; HDfprintf(stream, "%*serror #%03d: %s in %s(): line %u\n", @@ -468,54 +450,58 @@ error: /*------------------------------------------------------------------------- - * Function: test_create - * - * Purpose: Test creating an empty error stack + * Function: test_create * - * Return: Success: 0 - * Failure: -1 + * Purpose: Test creating an empty error stack * - * Programmer: Quincey Koziol - * November 1, 2007 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t test_create(void) { - const char *err_func = "test_create"; /* Function name for pushing error */ - const char *err_msg = "Error message"; /* Error message for pushing error */ - ssize_t err_num; /* Number of errors on stack */ - hid_t estack_id; /* Error stack ID */ + const char *err_func = "test_create"; /* Function name for pushing error */ + const char *err_msg = "Error message"; /* Error message for pushing error */ + ssize_t err_num; /* Number of errors on stack */ + hid_t estack_id = -1; /* Error stack ID */ /* Create an empty error stack */ - if((estack_id = H5Ecreate_stack()) < 0) TEST_ERROR + if ((estack_id = H5Ecreate_stack()) < 0) + TEST_ERROR /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Push an error with a long description */ - if(H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; + if (H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) + TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Clear the error stack */ - if(H5Eclear2(estack_id) < 0) TEST_ERROR + if (H5Eclear2(estack_id) < 0) + TEST_ERROR /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Close error stack */ - if(H5Eclose_stack(estack_id) < 0) TEST_ERROR + if(H5Eclose_stack(estack_id) < 0) + TEST_ERROR - return(0); + return 0; error: - return(-1); + return -1; } /* end test_create() */ /*------------------------------------------------------------------------- @@ -526,70 +512,72 @@ error: * Return: Success: 0 * Failure: -1 * - * Programmer: Allen Byrne - * February 18, 2010 - * *------------------------------------------------------------------------- */ static herr_t test_copy(void) { - const char *err_func = "test_copy"; /* Function name for pushing error */ - const char *err_msg = "Error message"; /* Error message for pushing error */ - ssize_t err_num; /* Number of errors on stack */ - hid_t estack_id; /* Error stack ID */ - herr_t ret; /* Generic return value */ + const char *err_func = "test_copy"; /* Function name for pushing error */ + const char *err_msg = "Error message"; /* Error message for pushing error */ + ssize_t err_num; /* Number of errors on stack */ + hid_t estack_id = -1; /* Error stack ID */ + herr_t ret; /* Generic return value */ /* Push an error with a long description */ - if(H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; + if (H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) + TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Copy error stack, which clears the original */ - if((estack_id = H5Eget_current_stack()) < 0) TEST_ERROR + if ((estack_id = H5Eget_current_stack()) < 0) + TEST_ERROR /* Check the number of errors on stack copy */ err_num = H5Eget_num(estack_id); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Check the number of errors on original stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Put the stack copy as the default. It closes the stack copy, too. */ - if(H5Eset_current_stack(estack_id) < 0) TEST_ERROR + if (H5Eset_current_stack(estack_id) < 0) + TEST_ERROR /* Check the number of errors on default stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Try to close error stack copy. Should fail because - * the current H5Eset_current_stack closes the stack to be set.*/ + * the current H5Eset_current_stack closes the stack to be set. + */ H5E_BEGIN_TRY { ret = H5Eclose_stack(estack_id); } H5E_END_TRY - if(ret >= 0) TEST_ERROR + if (ret >= 0) + TEST_ERROR - return(0); + return 0; error: - return(-1); + return -1; } /* end test_copy() */ /*------------------------------------------------------------------------- - * Function: close_error + * Function: close_error * - * Purpose: Closes error information. + * Purpose: Closes error information. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -597,19 +585,19 @@ static herr_t close_error(void) { /* Close major errors, let H5Eunregister_class close minor errors */ - if(H5Eclose_msg(ERR_MAJ_TEST) < 0) + if (H5Eclose_msg(ERR_MAJ_TEST) < 0) TEST_ERROR; - if(H5Eclose_msg(ERR_MAJ_IO) < 0) + if (H5Eclose_msg(ERR_MAJ_IO) < 0) TEST_ERROR; - if(H5Eclose_msg(ERR_MAJ_API) < 0) + if (H5Eclose_msg(ERR_MAJ_API) < 0) TEST_ERROR; - if(H5Eunregister_class(ERR_CLS) < 0) + if (H5Eunregister_class(ERR_CLS) < 0) TEST_ERROR; - if(H5Eunregister_class(ERR_CLS2) < 0) + if (H5Eunregister_class(ERR_CLS2) < 0) TEST_ERROR; return 0; @@ -620,19 +608,15 @@ error: /*------------------------------------------------------------------------- - * Function: test_filter_error + * Function: test_filter_error * - * Purpose: Make sure the error message prints out the filter name + * Purpose: Make sure the error message prints out the filter name * when the existent file is opened but the filter isn't * registered. The existent file was created with * gen_filters.c. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * 2 June 2011 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -640,71 +624,72 @@ static herr_t test_filter_error(const char *fname) { const char *pathname = H5_get_srcdir_filename(fname); /* Corrected test file name */ - hid_t file, dataset; /* handles */ + hid_t file = -1; + hid_t dataset = -1; int buf[20]; HDfprintf(stderr, "\nTesting error message during data reading when filter isn't registered\n"); /* Open the file */ - if((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + if ((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR; /* Open the regular dataset */ - if((dataset = H5Dopen2(file, DSET_FILTER_NAME, H5P_DEFAULT)) < 0) + if ((dataset = H5Dopen2(file, DSET_FILTER_NAME, H5P_DEFAULT)) < 0) TEST_ERROR; - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) >= 0) - TEST_ERROR; + if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) >= 0) + TEST_ERROR; /* Close/release resources */ - if(H5Dclose(dataset) < 0) + if (H5Dclose(dataset) < 0) TEST_ERROR - if(H5Fclose(file) < 0) + if (H5Fclose(file) < 0) TEST_ERROR return 0; error: return -1; -} +} /* end test_filter_error() */ /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test error API. - * - * Programmer: Raymond Lu - * July 10, 2003 + * Purpose: Test error API. * *------------------------------------------------------------------------- */ int main(void) { - hid_t file, fapl; - hid_t estack_id; - char filename[1024]; - const char *FUNC_main = "main"; + hid_t file = -1; + hid_t fapl = -1; + hid_t estack_id = -1; + char filename[1024]; + const char *FUNC_main = "main"; HDfprintf(stderr, " This program tests the Error API. There're supposed to be some error messages\n"); /* Initialize errors */ - if(init_error() < 0) + if (init_error() < 0) TEST_ERROR; - fapl = h5_fileaccess(); + if ((fapl = h5_fileaccess()) < 0) + TEST_ERROR; - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR; + h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); + if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR; /* Test error stack */ - if(error_stack() < 0) { + if (error_stack() < 0) { /* Push an error onto error stack */ - if(H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, - "Error stack test failed") < 0) TEST_ERROR; + if (H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, + "Error stack test failed") < 0) + TEST_ERROR; /* Delete an error from the top of error stack */ H5Epop(ERR_STACK, 1); @@ -724,34 +709,39 @@ main(void) } /* end if */ /* Test error API */ - if(test_error(file) < 0) { + if (test_error(file) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "Error test failed, %s", "it's wrong"); estack_id = H5Eget_current_stack(); H5Eprint2(estack_id, stderr); H5Eclose_stack(estack_id); - } /* end if */ + } /* Test pushing a very long error description */ - if(test_long_desc() < 0) TEST_ERROR; + if (test_long_desc() < 0) + TEST_ERROR; /* Test creating a new error stack */ - if(test_create() < 0) TEST_ERROR; + if (test_create() < 0) + TEST_ERROR; /* Test copying a new error stack */ - if(test_copy() < 0) TEST_ERROR; + if (test_copy() < 0) + TEST_ERROR; - if(H5Fclose(file) < 0) TEST_ERROR; + if (H5Fclose(file) < 0) + TEST_ERROR; /* Close error information */ - if(close_error() < 0) + if (close_error() < 0) TEST_ERROR; /* Test error message during data reading when filter isn't registered * Use default FAPL to avoid some VFD drivers by the check-vfd test because - * the test file was pre-generated. */ + * the test file was pre-generated. + */ h5_fixname(DATAFILE, H5P_DEFAULT, filename, sizeof filename); - if(test_filter_error(filename) < 0) + if (test_filter_error(filename) < 0) TEST_ERROR; h5_clean_files(FILENAME, fapl); diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1 index 0acd288..5b68002 100644 --- a/test/testfiles/error_test_1 +++ b/test/testfiles/error_test_1 @@ -53,7 +53,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered major: Data filters minor: Read failed - #005: (file name) line (number) in H5PL_load(): required dynamically loaded plugin filter '305' is not available + #005: (file name) line (number) in H5PL_load(): filter plugins disabled major: Plugin for dynamically loaded library minor: Unable to load metadata into cache diff --git a/tools/test/h5dump/errfiles/filter_fail.err b/tools/test/h5dump/errfiles/filter_fail.err index db21044..5276ab0 100644 --- a/tools/test/h5dump/errfiles/filter_fail.err +++ b/tools/test/h5dump/errfiles/filter_fail.err @@ -14,7 +14,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #004: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered major: Data filters minor: Read failed - #005: (file name) line (number) in H5PL_load(): required dynamically loaded plugin filter '312' is not available + #005: (file name) line (number) in H5PL_load(): filter plugins disabled major: Plugin for dynamically loaded library minor: Unable to load metadata into cache h5dump error: unable to print data -- cgit v0.12 From 5c472f5d7bbaa7cad6ec29fa531fea4257a5fc39 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 01:22:21 -0800 Subject: Fixed Windows code in H5PLpath.c --- src/H5PLpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PLpath.c b/src/H5PLpath.c index d8e82f8..972f1d0 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -755,7 +755,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo continue; /* attempt to open the dynamic library as a filter library */ - if (H5PL__open(path, search_params->type, search_params->search_key.id, found, plugin_info) < 0) + if (H5PL__open(path, search_params->type, search_params->key, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) -- cgit v0.12 From 2b7f23a33323f68011540f31ecf4900415b17f56 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 10:38:15 -0800 Subject: Fixed an uninitialized filter callback struct in H5Dchunk.c and unified the naming and initialization of said struct throughout the library. This was causing a crash on VS2015 in debug mode when the debug heap complained. Fixes HDFFV-10330. --- release_docs/RELEASE.txt | 15 +++++++++ src/H5Dchunk.c | 76 ++++++++++++++++++++++------------------- src/H5HFcache.c | 88 +++++++++++++++++++++++++++--------------------- src/H5HFhuge.c | 12 +++++-- src/H5Z.c | 62 +++++++++++++++++----------------- src/H5Zpublic.h | 20 +++++------ 6 files changed, 159 insertions(+), 114 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a1b59b1..7498d01 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -179,6 +179,21 @@ Bug Fixes since HDF5-1.10.1 release (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) + - An uninitialized struct could cause a memory access error when using + variable-length or reference types in a compressed, chunked dataset. + + A struct containing a callback function pointer and a pointer to some + associated data was used before initialization. This could cause a + memory access error and system crash. This could only occur under + unusual conditions when using variable-lenth and reference types in + a compressed, chunked dataset. + + On recent versions of Visual Studio, when built in debug mode, the + debug heap will complain and cause a crash if the code in question + is executed (this will cause the objcopy test to fail). + + (DER - 2017/11/21, HDFFV-10330) + Configuration ------------- - cmake diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 0d7fcc9..be3b678 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -5661,7 +5661,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* needed for commpressed variable length data */ hbool_t must_filter = FALSE; /* Whether chunk must be filtered during copy */ size_t nbytes; /* Size of chunk in file (in bytes) */ - H5Z_cb_t cb_struct; /* Filter failure callback struct */ + H5Z_cb_t filter_cb; /* Filter failure callback struct */ int ret_value = H5_ITER_CONT; /* Return value */ @@ -5670,6 +5670,10 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Get 'size_t' local value for number of bytes in chunk */ H5_CHECKED_ASSIGN(nbytes, size_t, chunk_rec->nbytes, uint32_t); + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Check for filtered chunks */ /* Check for an edge chunk that is not filtered */ if(pline && pline->nused) { @@ -5716,7 +5720,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDassert(!H5F_addr_defined(chunk_rec->chunk_addr)); HDmemcpy(buf, udata->chunk, nbytes); udata->chunk = NULL; - } else { + } + else { H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ unsigned idx; /* Index of chunk in cache, if present */ unsigned u; /* Counter */ @@ -5748,7 +5753,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5_CHECKED_ASSIGN(nbytes, size_t, shared_fo->layout.u.chunk.size, uint32_t); HDmemcpy(buf, ent->chunk, nbytes); - } else { + } + 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") @@ -5759,8 +5765,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) 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 */ - if(H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, cb_struct, &nbytes, &buf_size, &buf) < 0) + if(H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &buf_size, &buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "data pipeline read failed") } /* end if */ @@ -5822,7 +5827,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* 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) + if(H5Z_pipeline(pline, 0, &(udata_dst.filter_mask), H5Z_NO_EDC, filter_cb, &nbytes, &buf_size, &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 */ @@ -6707,46 +6712,49 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5_CHECKED_ASSIGN(nbytes, size_t, chunk_rec->nbytes, uint32_t); chunk_addr = chunk_rec->chunk_addr; - if(new_idx_info->pline->nused && + if (new_idx_info->pline->nused && (new_idx_info->layout->flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && (H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, new_idx_info->layout->dim, chunk_rec->scaled, udata->dset_dims))) { - /* This is a partial non-filtered edge chunk */ - /* Convert the chunk to a filtered edge chunk for v1 B-tree chunk index */ - unsigned filter_mask = chunk_rec->filter_mask; - H5Z_cb_t cb_struct; /* Filter failure callback struct */ - size_t read_size = nbytes; /* Bytes to read */ + /* This is a partial non-filtered edge chunk */ + /* Convert the chunk to a filtered edge chunk for v1 B-tree chunk index */ - HDassert(read_size == new_idx_info->layout->size); + unsigned filter_mask = chunk_rec->filter_mask; + H5Z_cb_t filter_cb; /* Filter failure callback struct */ + size_t read_size = nbytes; /* Bytes to read */ + + HDassert(read_size == new_idx_info->layout->size); - cb_struct.func = NULL; /* no callback function when failed */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ - /* Allocate buffer for chunk data */ - if(NULL == (buf = H5MM_malloc(read_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for raw data chunk") + /* Allocate buffer for chunk data */ + if (NULL == (buf = H5MM_malloc(read_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for raw data chunk") - /* Read the non-filtered edge chunk */ - if(H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, H5AC_rawdata_dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + /* Read the non-filtered edge chunk */ + if (H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, H5AC_rawdata_dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") - /* Pass the chunk through the pipeline */ - if(H5Z_pipeline(new_idx_info->pline, 0, &filter_mask, H5Z_NO_EDC, cb_struct, &nbytes, &read_size, &buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") + /* Pass the chunk through the pipeline */ + if (H5Z_pipeline(new_idx_info->pline, 0, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &read_size, &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(nbytes > ((size_t)0xffffffff)) - HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, H5_ITER_ERROR, "chunk too large for 32-bit length") + if (nbytes > ((size_t)0xffffffff)) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, H5_ITER_ERROR, "chunk too large for 32-bit length") #endif /* H5_SIZEOF_SIZE_T > 4 */ - /* Allocate space for the filtered chunk */ - if((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, new_idx_info->dxpl_id, (hsize_t)nbytes)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, H5_ITER_ERROR, "file allocation failed for filtered chunk") - HDassert(H5F_addr_defined(chunk_addr)); + /* Allocate space for the filtered chunk */ + if ((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, new_idx_info->dxpl_id, (hsize_t)nbytes)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, H5_ITER_ERROR, "file allocation failed for filtered chunk") + HDassert(H5F_addr_defined(chunk_addr)); - /* Write the filtered chunk to disk */ - if(H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") + /* Write the filtered chunk to disk */ + if (H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") } /* end if */ /* Set up chunk information for insertion to chunk index */ @@ -6758,11 +6766,11 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) insert_udata.common.storage = new_idx_info->storage; /* Insert chunk into the v1 B-tree chunk index */ - if((new_idx_info->storage->ops->insert)(new_idx_info, &insert_udata, NULL) < 0) + if ((new_idx_info->storage->ops->insert)(new_idx_info, &insert_udata, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert chunk addr into index") done: - if(buf) + if (buf) H5MM_xfree(buf); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFcache.c b/src/H5HFcache.c index f957e2e..069bf17 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -1671,9 +1671,13 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) HGOTO_DONE(TRUE); if(hdr->filter_len > 0) { - size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ - unsigned filter_mask; /* Excluded filters for direct block */ - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ + unsigned filter_mask; /* Excluded filters for direct block */ + H5Z_cb_t filter_cb; /* Filter callback structure */ + + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ /* Allocate buffer to perform I/O filtering on and copy image into * it. Must do this as H5Z_pipeline() may re-size the buffer @@ -1682,17 +1686,17 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) if(NULL == (read_buf = H5MM_malloc(len))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for pipeline buffer") - /* Set up parameters for filter pipeline */ - nbytes = len; - filter_mask = udata->filter_mask; + /* Set up parameters for filter pipeline */ + nbytes = len; + filter_mask = udata->filter_mask; HDmemcpy(read_buf, image, len); - /* Push direct block data through I/O filter pipeline */ - if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed") + /* Push direct block data through I/O filter pipeline */ + if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed") /* Update info about direct block */ - udata->decompressed = TRUE; + udata->decompressed = TRUE; len = nbytes; } /* end if */ else @@ -1818,45 +1822,49 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, udata->dblk = NULL; } /* end if */ else { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ unsigned filter_mask; /* Excluded filters for direct block */ /* Sanity check */ - HDassert(udata->dblk == NULL); + HDassert(udata->dblk == NULL); - /* Allocate buffer to perform I/O filtering on and copy image into - * it. Must do this as H5Z_pipeline() may resize the buffer - * provided to it. - */ - if(NULL == (read_buf = H5MM_malloc(len))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "memory allocation failed for pipeline buffer") + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + + /* Allocate buffer to perform I/O filtering on and copy image into + * it. Must do this as H5Z_pipeline() may resize the buffer + * provided to it. + */ + if (NULL == (read_buf = H5MM_malloc(len))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "memory allocation failed for pipeline buffer") /* Copy compressed image into buffer */ - HDmemcpy(read_buf, image, len); + HDmemcpy(read_buf, image, len); - /* Push direct block data through I/O filter pipeline */ - nbytes = len; - filter_mask = udata->filter_mask; - if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, NULL, "output pipeline failed") + /* Push direct block data through I/O filter pipeline */ + nbytes = len; + filter_mask = udata->filter_mask; + if (H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, NULL, "output pipeline failed") - /* Sanity check */ - HDassert(nbytes == dblock->size); + /* Sanity check */ + HDassert(nbytes == dblock->size); - /* Copy un-filtered data into block's buffer */ - HDmemcpy(dblock->blk, read_buf, dblock->size); - } /* end if */ + /* Copy un-filtered data into block's buffer */ + HDmemcpy(dblock->blk, read_buf, dblock->size); + } /* end if */ } /* end if */ else { /* Sanity checks */ - HDassert(udata->dblk == NULL); - HDassert(!udata->decompressed); + HDassert(udata->dblk == NULL); + HDassert(!udata->decompressed); - /* Allocate block buffer */ -/* XXX: Change to using free-list factories */ - if(NULL == (dblock->blk = H5FL_BLK_MALLOC(direct_block, (size_t)dblock->size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + /* Allocate block buffer */ + /* XXX: Change to using free-list factories */ + if (NULL == (dblock->blk = H5FL_BLK_MALLOC(direct_block, (size_t)dblock->size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy image to dblock->blk */ HDassert(dblock->size == len); @@ -1895,9 +1903,9 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, /* Decode checksum on direct block, if requested */ if(hdr->checksum_dblocks) { - uint32_t stored_chksum; /* Metadata checksum value */ + uint32_t stored_chksum; /* Metadata checksum value */ - /* checksum verification already done in verify_chksum cb */ + /* checksum verification already done in verify_chksum cb */ /* Metadata checksum */ UINT32DECODE(image, stored_chksum); @@ -2188,10 +2196,14 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used */ unsigned filter_mask = 0; /* Filter mask for block */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Allocate buffer to perform I/O filtering on */ write_size = dblock->size; if(NULL == (write_buf = H5MM_malloc(write_size))) diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index b2a1e68..350100e 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -345,9 +345,13 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); /* Check for I/O pipeline filter on heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Allocate buffer to perform I/O filtering on */ write_size = obj_size; if(NULL == (write_buf = H5MM_malloc(write_size))) @@ -773,10 +777,14 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check for I/O pipeline filter on heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t read_size; /* Object's size in the file */ size_t nbytes; /* Number of bytes used */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* De-filter the object */ read_size = nbytes = obj_size; if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &read_size, &read_buf) < 0) diff --git a/src/H5Z.c b/src/H5Z.c index 1e7cd79..89c97d4 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -275,7 +275,7 @@ done: * Function: H5Z_register * * Purpose: Same as the public version except this one allows filters - * to be set for predefined method numbers nused > 0); + HDassert(pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) @@ -926,7 +926,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert (pline->nused > 0); + HDassert(pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) @@ -1200,12 +1200,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); - HDassert (filter_mask); - HDassert (nbytes && *nbytes>0); - HDassert (buf_size && *buf_size>0); - HDassert (buf && *buf); - HDassert (!pline || pline->nused0); + HDassert(buf_size && *buf_size>0); + HDassert(buf && *buf); + HDassert(!pline || pline->nused < H5Z_MAX_NFILTERS); if (pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */ for (i = pline->nused; i > 0; --i) { @@ -1235,7 +1235,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* 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; @@ -1247,7 +1247,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) else HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") - } /* end if */ + } } /* end if */ fclass = &H5Z_table_g[fclass_idx]; @@ -1263,11 +1263,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, #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; + 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) + 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; @@ -1303,7 +1304,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, #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; + if (0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif if (0 == new_nbytes) { if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { @@ -1345,8 +1347,8 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(NULL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -1384,8 +1386,8 @@ H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -1421,7 +1423,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert (pline); + HDassert(pline); /* Iterate through all the filters in pipeline */ for (i = 0; i < pline->nused; i++) { @@ -1459,8 +1461,8 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* if the pipeline has no filters, just return */ if (pline->nused == 0) @@ -1470,7 +1472,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) if (H5Z_FILTER_ALL == filter) { if (H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFREE, FAIL, "can't release pipeline info") - } /* end if */ + } /* Delete filter */ else { size_t idx; /* Index of filter in pipeline */ @@ -1481,7 +1483,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) if (pline->filter[idx].id == filter) { found = TRUE; break; - } /* end if */ + } /* filter was not found in the pipeline */ if (!found) @@ -1489,11 +1491,11 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) /* Free information for deleted filter */ if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) - HDassert ((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); + HDassert((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); if (pline->filter[idx].name != pline->filter[idx]._name) pline->filter[idx].name = (char *)H5MM_xfree(pline->filter[idx].name); if (pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) - HDassert (pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); + HDassert(pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); if (pline->filter[idx].cd_values != pline->filter[idx]._cd_values) pline->filter[idx].cd_values = (unsigned *)H5MM_xfree(pline->filter[idx].cd_values); @@ -1506,8 +1508,8 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) pline->filter[idx].name = pline->filter[idx]._name; if (pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) pline->filter[idx].cd_values = pline->filter[idx]._cd_values; - } /* end for */ - } /* end if */ + } + } /* Decrement number of used filters */ pline->nused--; diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index f6b313e..fcb2d37 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -129,8 +129,8 @@ typedef H5Z_cb_return_t (*H5Z_filter_func_t)(H5Z_filter_t filter, void* buf, /* Structure for filter callback property */ typedef struct H5Z_cb_t { - H5Z_filter_func_t func; - void* op_data; + H5Z_filter_func_t func; + void *op_data; } H5Z_cb_t; #ifdef __cplusplus @@ -206,14 +206,14 @@ typedef size_t (*H5Z_func_t)(unsigned int flags, size_t cd_nelmts, * contain a pointers to the filter function and timing statistics. */ typedef struct H5Z_class2_t { - int version; /* Version number of the H5Z_class_t struct */ - H5Z_filter_t id; /* Filter ID number */ - unsigned encoder_present; /* Does this filter have an encoder? */ - unsigned decoder_present; /* Does this filter have a decoder? */ - const char *name; /* Comment for debugging */ - H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ - H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ - H5Z_func_t filter; /* The actual filter function */ + int version; /* Version number of the H5Z_class_t struct */ + H5Z_filter_t id; /* Filter ID number */ + unsigned encoder_present; /* Does this filter have an encoder? */ + unsigned decoder_present; /* Does this filter have a decoder? */ + const char *name; /* Comment for debugging */ + H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ + H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ + H5Z_func_t filter; /* The actual filter function */ } H5Z_class2_t; H5_DLL herr_t H5Zregister(const void *cls); -- cgit v0.12 From e432a23f8bf7461ea4775986fd8c0b802ba67af9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 13:20:33 -0800 Subject: Made a dcpl layout struct in H5Z.c dynamic to quiet a stack size warning. --- src/H5Z.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 89c97d4..6f173b2 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -752,6 +752,7 @@ 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 */ FUNC_ENTER_NOAPI_NOINIT @@ -761,19 +762,22 @@ 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 */ + H5P_genplist_t *dc_plist; /* Dataset creation property list object */ + + /* Get memory for the layout */ + if (NULL == (dcpl_layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate dcpl layout buffer") /* 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 */ @@ -787,28 +791,31 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type size_t u; /* Local index variable */ /* Create a dataspace 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 */ if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { - (void)H5S_close (space); + (void)H5S_close(space); HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") - } /* end if */ + } /* Make the callbacks */ if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") - } /* end if */ - } /* end if */ - } /* end if */ + } + } + } 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 abd2ab411a68d95d122b17ef04447adb2be0794b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 26 Nov 2017 18:13:18 -0800 Subject: Fixed misc Warnings flagged by VS2017. --- examples/h5_cmprss.c | 1 - src/H5Dio.c | 4 +- src/H5MF.c | 5 +- src/H5Tdbg.c | 227 +++++++++++++++++++++++++-------------------------- src/H5system.c | 2 +- test/cache_tagging.c | 13 +-- test/tarray.c | 24 +++--- test/tattr.c | 14 ++-- test/tchecksum.c | 2 +- test/testhdf5.h | 1 + test/tfile.c | 6 +- test/th5o.c | 4 +- test/theap.c | 30 +++---- test/tid.c | 18 ++-- test/titerate.c | 18 ++-- test/tmisc.c | 36 ++++---- test/trefstr.c | 26 +++--- test/tselect.c | 130 ++++++++++++++--------------- test/tskiplist.c | 142 ++++++++++++++++---------------- test/ttst.c | 18 ++-- test/tvltypes.c | 6 +- 21 files changed, 364 insertions(+), 363 deletions(-) diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index ebc7712..b51ec44 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -36,7 +36,6 @@ int main () { hsize_t dims[2]; hsize_t cdims[2]; - int idx; int i,j, numfilt; int buf[DIM0][DIM1]; int rbuf [DIM0][DIM1]; diff --git a/src/H5Dio.c b/src/H5Dio.c index 104a632..280d602 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -962,7 +962,9 @@ const io_info->using_mpi_vfd = H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI); #endif /* H5_HAVE_PARALLEL */ -done: +#ifdef H5_DEBUG_BUILD + done: +#endif /* H5_DEBUG_BUILD */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__ioinfo_init() */ diff --git a/src/H5MF.c b/src/H5MF.c index 49c7b77..7e06654 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -3247,7 +3247,6 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* for self referential FSMs */ haddr_t eoa_post_fsm_fsalloc; /* eoa post file space allocation */ /* for self referential FSMs */ - H5FS_stat_t fs_stat; /* Information for hdr FSM */ H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ hbool_t reset_ring = FALSE; /* Whether we set the ring */ @@ -3310,6 +3309,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) reset_ring = TRUE; #ifndef NDEBUG +{ + H5FS_stat_t fs_stat; /* Information for hdr FSM */ + /* Verify that sm_hdr_fspace is floating if it exists */ if(sm_hdr_fspace) { /* Query free space manager info for this type */ @@ -3357,6 +3359,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) HDassert(fs_stat.alloc_sect_size == 0); } /* end if */ } /* end if */ +} #endif /* NDEBUG */ /* Free the space in the metadata aggregator. Do this via the diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index f434543..eb648f3 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -32,9 +32,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Tpkg.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Tpkg.h" /* Datatypes */ /****************/ @@ -74,28 +74,21 @@ /*------------------------------------------------------------------------- - * Function: H5T__print_stats + * Function: H5T__print_stats * - * Purpose: Print statistics about a conversion path. Statistics are - * printed only if all the following conditions are true: + * Purpose: Print statistics about a conversion path. Statistics are + * printed only if all the following conditions are true: * - * 1. The library was compiled with H5T_DEBUG defined. - * 2. Data type debugging is turned on at run time. - * 3. The path was called at least one time. + * 1. The library was compiled with H5T_DEBUG defined. + * 2. Data type debugging is turned on at run time. + * 3. The path was called at least one time. * - * The optional NPRINT argument keeps track of the number of - * conversions paths for which statistics have been shown. If - * its value is zero then table headers are printed before the - * first line of output. + * The optional NPRINT argument keeps track of the number of + * conversions paths for which statistics have been shown. If + * its value is zero then table headers are printed before the + * first line of output. * - * Return: Success: non-negative - * - * Failure: negative - * - * Programmer: Robb Matzke - * Monday, December 14, 1998 - * - * Modifications: + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -110,34 +103,34 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* FUNC_ENTER_PACKAGE_NOERR #ifdef H5T_DEBUG - if(H5DEBUG(T) && path->stats.ncalls > 0) { - if(nprint && 0 == (*nprint)++) { - HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "Conversion", "Elmts", "Calls", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "----------", "-----", "-----", "----", - "------", "-------", "---------"); - } - if(path->src && path->dst) + if (H5DEBUG(T) && path->stats.ncalls > 0) { + if (nprint && 0 == (*nprint)++) { + HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "Conversion", "Elmts", "Calls", "User", + "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "----------", "-----", "-----", "----", + "------", "-------", "---------"); + } + if (path->src && path->dst) nbytes = MAX(H5T_get_size(path->src), H5T_get_size(path->dst)); - else if(path->src) + else if (path->src) nbytes = H5T_get_size(path->src); - else if(path->dst) + else if (path->dst) nbytes = H5T_get_size(path->dst); else nbytes = 0; - nbytes *= path->stats.nelmts; - H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime); - HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", - path->name, - path->stats.nelmts, - path->stats.ncalls, - path->stats.timer.utime, - path->stats.timer.stime, - path->stats.timer.etime, - bandwidth); + nbytes *= path->stats.nelmts; + H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime); + HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", + path->name, + path->stats.nelmts, + path->stats.ncalls, + path->stats.timer.utime, + path->stats.timer.stime, + path->stats.timer.etime, + bandwidth); } #endif FUNC_LEAVE_NOAPI(SUCCEED) @@ -145,24 +138,20 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* /*------------------------------------------------------------------------- - * Function: H5T_debug - * - * Purpose: Prints information about a data type. + * Function: H5T_debug * - * Return: Non-negative on success/Negative on failure + * Purpose: Prints information about a data type. * - * Programmer: Robb Matzke - * Wednesday, January 7, 1998 - * - * Modifications: + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5T_debug(const H5T_t *dt, FILE *stream) { - const char *s1 = "", *s2 = ""; - unsigned i; + const char *s1 = ""; + const char *s2 = ""; + unsigned i; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -171,7 +160,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) HDassert(dt); HDassert(stream); - switch(dt->shared->type) { + switch (dt->shared->type) { case H5T_NO_CLASS: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); break; @@ -221,9 +210,9 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: s1 = ""; break; - } /* end switch */ + } /* end switch */ - switch(dt->shared->state) { + switch (dt->shared->state) { case H5T_STATE_TRANSIENT: s2 = "[transient]"; break; @@ -245,14 +234,14 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; default: HDassert(0 && "This Should never be executed!"); - } /* end switch */ + } /* end switch */ - fprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); + HDfprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); - if(H5T_IS_ATOMIC(dt->shared)) { - uint64_t tmp; + if (H5T_IS_ATOMIC(dt->shared)) { + uint64_t tmp; - switch(dt->shared->u.atomic.order) { + switch (dt->shared->u.atomic.order) { case H5T_ORDER_ERROR: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "order error"); break; @@ -277,17 +266,16 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: s1 = "order?"; break; - } /* end switch */ + } /* end switch */ + + HDfprintf(stream, ", %s", s1); - fprintf(stream, ", %s", s1); + if (dt->shared->u.atomic.offset) + HDfprintf(stream, ", offset=%lu", (unsigned long) (dt->shared->u.atomic.offset)); + if (dt->shared->u.atomic.prec != 8 * dt->shared->size) + HDfprintf(stream, ", prec=%lu", (unsigned long) (dt->shared->u.atomic.prec)); - if(dt->shared->u.atomic.offset) - fprintf(stream, ", offset=%lu", - (unsigned long) (dt->shared->u.atomic.offset)); - if(dt->shared->u.atomic.prec != 8 * dt->shared->size) - fprintf(stream, ", prec=%lu", - (unsigned long) (dt->shared->u.atomic.prec)); - switch(dt->shared->type) { + switch (dt->shared->type) { case H5T_NO_CLASS: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); break; @@ -313,7 +301,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) } /* end switch */ if(s1) - fprintf(stream, ", %s", s1); + HDfprintf(stream, ", %s", s1); break; case H5T_FLOAT: @@ -339,23 +327,24 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; } /* end switch */ - fprintf(stream, ", sign=%lu+1", + HDfprintf(stream, ", sign=%lu+1", (unsigned long)(dt->shared->u.atomic.u.f.sign)); - fprintf(stream, ", mant=%lu+%lu (%s)", + HDfprintf(stream, ", mant=%lu+%lu (%s)", (unsigned long)(dt->shared->u.atomic.u.f.mpos), (unsigned long)(dt->shared->u.atomic.u.f.msize), s1); - fprintf(stream, ", exp=%lu+%lu", + HDfprintf(stream, ", exp=%lu+%lu", (unsigned long)(dt->shared->u.atomic.u.f.epos), (unsigned long)(dt->shared->u.atomic.u.f.esize)); tmp = dt->shared->u.atomic.u.f.ebias >> 32; - if(tmp) { + if (tmp) { size_t hi = (size_t)tmp; size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); - fprintf(stream, " bias=0x%08lx%08lx", + HDfprintf(stream, " bias=0x%08lx%08lx", (unsigned long)hi, (unsigned long)lo); - } else { + } + else { size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); - fprintf(stream, " bias=0x%08lx", (unsigned long)lo); + HDfprintf(stream, " bias=0x%08lx", (unsigned long)lo); } break; @@ -372,69 +361,73 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: /* No additional info */ break; - } /* end switch */ - } else if(H5T_COMPOUND == dt->shared->type) { - /* Compound data type */ - for(i = 0; i < dt->shared->u.compnd.nmembs; i++) { - fprintf(stream, "\n\"%s\" @%lu", - dt->shared->u.compnd.memb[i].name, - (unsigned long)(dt->shared->u.compnd.memb[i].offset)); - fprintf(stream, " "); - H5T_debug(dt->shared->u.compnd.memb[i].type, stream); - } /* end for */ - fprintf(stream, "\n"); - } else if(H5T_VLEN == dt->shared->type) { - switch(dt->shared->u.vlen.loc) { + } /* end switch */ + } + else if (H5T_COMPOUND == dt->shared->type) { + /* Compound data type */ + for (i = 0; i < dt->shared->u.compnd.nmembs; i++) { + HDfprintf(stream, "\n\"%s\" @%lu", + dt->shared->u.compnd.memb[i].name, + (unsigned long)(dt->shared->u.compnd.memb[i].offset)); + HDfprintf(stream, " "); + H5T_debug(dt->shared->u.compnd.memb[i].type, stream); + } /* end for */ + HDfprintf(stream, "\n"); + } + else if (H5T_VLEN == dt->shared->type) { + switch (dt->shared->u.vlen.loc) { case H5T_LOC_BADLOC: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "invalid datatype location"); break; case H5T_LOC_MEMORY: - fprintf(stream, ", loc=memory"); + HDfprintf(stream, ", loc=memory"); break; case H5T_LOC_DISK: - fprintf(stream, ", loc=disk"); + HDfprintf(stream, ", loc=disk"); break; case H5T_LOC_MAXLOC: default: - fprintf(stream, ", loc=UNKNOWN"); + HDfprintf(stream, ", loc=UNKNOWN"); break; } /* end switch */ - if(H5T_IS_VL_STRING(dt->shared)) + if (H5T_IS_VL_STRING(dt->shared)) /* Variable length string datatype */ - fprintf(stream, ", variable-length"); + HDfprintf(stream, ", variable-length"); else { /* Variable length sequence datatype */ - fprintf(stream, " VLEN "); + HDfprintf(stream, " VLEN "); H5T_debug(dt->shared->parent, stream); - fprintf(stream, "\n"); + HDfprintf(stream, "\n"); } /* end else */ - } else if(H5T_ENUM == dt->shared->type) { + } + else if (H5T_ENUM == dt->shared->type) { size_t base_size; - /* Enumeration data type */ - fprintf(stream, " "); - H5T_debug(dt->shared->parent, stream); - base_size = dt->shared->parent->shared->size; - for(i = 0; i < dt->shared->u.enumer.nmembs; i++) { + /* Enumeration data type */ + HDfprintf(stream, " "); + H5T_debug(dt->shared->parent, stream); + base_size = dt->shared->parent->shared->size; + for (i = 0; i < dt->shared->u.enumer.nmembs; i++) { size_t k; - fprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); - for(k = 0; k < base_size; k++) - fprintf(stream, "%02lx", - (unsigned long)(dt->shared->u.enumer.value + (i * base_size) + k)); - } /* end for */ - fprintf(stream, "\n"); - } else if(H5T_OPAQUE == dt->shared->type) { - fprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); - } else { - /* Unknown */ - fprintf(stream, "unknown class %d\n", (int)(dt->shared->type)); + HDfprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); + for (k = 0; k < base_size; k++) + HDfprintf(stream, "%02lx", (unsigned long)(dt->shared->u.enumer.value + (i * base_size) + k)); + } /* end for */ + HDfprintf(stream, "\n"); + } + else if (H5T_OPAQUE == dt->shared->type) { + HDfprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); + } + else { + /* Unknown */ + HDfprintf(stream, "unknown class %d\n", (int)(dt->shared->type)); } - fprintf(stream, "}"); + HDfprintf(stream, "}"); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5system.c b/src/H5system.c index a1cdf19..a8726c2 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -977,7 +977,7 @@ Wround(double arg) float Wroundf(float arg) { - return arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F); + return (float)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F)); } #endif /* H5_HAVE_WIN32_API */ diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 99ab49c..9c79968 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -3631,11 +3631,14 @@ error: static unsigned check_invalid_tag_application(void) { +#if H5C_DO_TAGGING_SANITY_CHECKS /* Variables */ H5F_t * f = NULL; - hid_t fid, dxpl_id = -1; + hid_t fid = -1; + hid_t dxpl_id = -1; haddr_t addr; H5HL_t * lheap = NULL; +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ /* Testing Macro */ TESTING("failure on invalid tag application"); @@ -3683,8 +3686,8 @@ check_invalid_tag_application(void) PASSED(); #else SKIPPED(); - printf(" test skipped because sanity checking on tag value is disabled.\n"); -#endif + HDprintf(" test skipped because sanity checking on tag value is disabled.\n"); +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ return 0; @@ -3791,10 +3794,10 @@ main(void) HDremove(FILENAME2); /* Return Errors */ - return(nerrs > 0); + return nerrs > 0; error: /* Return with Error */ - return(1); + return 1; } /* main */ diff --git a/test/tarray.c b/test/tarray.c index a35b8a3..b2e0ee7 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -679,7 +679,7 @@ test_array_compound_atomic(void) /* Check the 1st field's name */ mname = H5Tget_member_name(tid2, 0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname, "i") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); H5free_memory(mname); @@ -698,7 +698,7 @@ test_array_compound_atomic(void) /* Check the 2nd field's name */ mname = H5Tget_member_name(tid2, 1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname, "f") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); H5free_memory(mname); @@ -897,7 +897,7 @@ test_array_compound_array(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid2,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -916,7 +916,7 @@ test_array_compound_array(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid2,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1604,7 +1604,7 @@ test_array_bkg(void) /* Initialize the data */ /* ------------------- */ dtsinfo = (CmpDTSinfo *)HDmalloc(sizeof(CmpDTSinfo)); - CHECK(dtsinfo, NULL, "HDmalloc"); + CHECK_PTR(dtsinfo, "HDmalloc"); HDmemset(dtsinfo, 0, sizeof(CmpDTSinfo)); for (i = 0; i < LENGTH; i++) { for (j = 0; j < ALEN; j++) { @@ -1927,7 +1927,7 @@ test_compat(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid1,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1946,7 +1946,7 @@ test_compat(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid1,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1965,7 +1965,7 @@ test_compat(void) /* Check the 3rd field's name */ mname=H5Tget_member_name(tid1,2); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -2009,7 +2009,7 @@ test_compat(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid1,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2028,7 +2028,7 @@ test_compat(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid1,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2073,7 +2073,7 @@ test_compat(void) /* Check the 3rd field's name */ mname=H5Tget_member_name(tid1,2); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2118,7 +2118,7 @@ test_compat(void) /* Check the 4th field's name */ mname=H5Tget_member_name(tid1,3); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"d")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); diff --git a/test/tattr.c b/test/tattr.c index 3786d0d..2d333e9 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -277,7 +277,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size + 1), sizeof(char)); - CHECK(attr_name, NULL, "HDcalloc"); + CHECK_PTR(attr_name, "HDcalloc"); if(attr_name) { ret = (herr_t)H5Aget_name(attr, (size_t)(attr_name_size + 1), attr_name); @@ -313,7 +313,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char)); - CHECK(attr_name, NULL, "HDcalloc"); + CHECK_PTR(attr_name, "HDcalloc"); if(attr_name) { ret = (herr_t)H5Aget_name(attr2, (size_t)(attr_name_size + 1), attr_name); @@ -6862,7 +6862,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = max_compact * 2; visited = (hbool_t*)HDmalloc(sizeof(hbool_t) * iter_info.max_visit); - CHECK(visited, NULL, "HDmalloc"); + CHECK_PTR(visited, "HDmalloc"); iter_info.visited = visited; /* Loop over operating on different indices on link fields */ @@ -8040,7 +8040,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -8371,7 +8371,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -8817,7 +8817,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -9186,7 +9186,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ diff --git a/test/tchecksum.c b/test/tchecksum.c index febaacc..ffbab45 100644 --- a/test/tchecksum.c +++ b/test/tchecksum.c @@ -187,7 +187,7 @@ test_chksum_large(void) /* Allocate the buffer */ large_buf = (uint8_t *)HDmalloc((size_t)BUF_LEN); - CHECK(large_buf, NULL, "HDmalloc"); + CHECK_PTR(large_buf, "HDmalloc"); /* Initialize buffer w/known data */ for(u = 0; u < BUF_LEN; u++) diff --git a/test/testhdf5.h b/test/testhdf5.h index 2cbe6c6..41675cf 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -54,6 +54,7 @@ } \ } +/* Check that a pointer is valid (i.e.: not NULL) */ #define CHECK_PTR(ret,where) { \ if (VERBOSE_HI) { \ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ diff --git a/test/tfile.c b/test/tfile.c index 027ad62..80ba4da 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1072,7 +1072,7 @@ test_get_obj_ids(void) VERIFY(oid_count, (NGROUPS + NDSETS + 1), "H5Fget_obj_count"); oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t)); - CHECK(oid_list, NULL, "HDcalloc"); + CHECK_PTR(oid_list, "HDcalloc"); /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here. * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in @@ -1135,7 +1135,7 @@ test_get_obj_ids(void) VERIFY(oid_count, NDSETS, "H5Fget_obj_count"); oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t)); - CHECK(oid_list, NULL, "HDcalloc"); + CHECK_PTR(oid_list, "HDcalloc"); /* Get the list of all opened objects */ ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); @@ -2667,7 +2667,7 @@ cal_chksum(const char *file, uint32_t *chksum) /* Allocate space for the file data */ file_data = HDmalloc((size_t)sb.st_size); - CHECK(file_data, NULL, "HDmalloc"); + CHECK_PTR(file_data, "HDmalloc"); if(file_data) { /* Read file's data into memory */ diff --git a/test/th5o.c b/test/th5o.c index 4baac20..144ea4c 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -783,9 +783,9 @@ test_h5o_link(void) /* Allocate memory buffers */ /* (These are treated as 2-D buffers) */ wdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK(wdata, NULL, "HDmalloc"); + CHECK_PTR(wdata, "HDmalloc"); rdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK(rdata, NULL, "HDmalloc"); + CHECK_PTR(rdata, "HDmalloc"); /* Initialize the raw data */ for(i = n = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) diff --git a/test/theap.c b/test/theap.c index 3c23025..cdb423e 100644 --- a/test/theap.c +++ b/test/theap.c @@ -88,11 +88,11 @@ test_heap_init(void) /* Allocate arrays */ rand_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(rand_num, NULL, "HDmalloc"); + CHECK_PTR(rand_num, "HDmalloc"); inc_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(inc_sort_num, NULL, "HDmalloc"); + CHECK_PTR(inc_sort_num, "HDmalloc"); dec_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(dec_sort_num, NULL, "HDmalloc"); + CHECK_PTR(dec_sort_num, "HDmalloc"); /* Create randomized set of numbers */ curr_time = HDtime(NULL); @@ -127,7 +127,7 @@ test_heap_create(void) /* Try creating a maximum Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Try closing the heap */ ret=H5HP_close(heap); @@ -135,7 +135,7 @@ test_heap_create(void) /* Try creating a minimum Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Try closing the heap */ ret=H5HP_close(heap); @@ -163,7 +163,7 @@ test_heap_insert_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -237,7 +237,7 @@ test_heap_insert_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -325,7 +325,7 @@ test_heap_insert_many_core(H5HP_type_t heap_type, test_obj *arr, size_t nelem, i /* Create a Heap */ heap=H5HP_create(heap_type); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -405,7 +405,7 @@ test_heap_remove_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -479,7 +479,7 @@ test_heap_remove_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -567,7 +567,7 @@ static void test_heap_remove_many_core(H5HP_type_t heap_type, test_obj *arr, siz /* Create a Heap */ heap=H5HP_create(heap_type); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -714,7 +714,7 @@ test_heap_change_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -788,7 +788,7 @@ test_heap_change_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -880,7 +880,7 @@ test_heap_incdec_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -955,7 +955,7 @@ test_heap_incdec_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); diff --git a/test/tid.c b/test/tid.c index 494ee60..375ef69 100644 --- a/test/tid.c +++ b/test/tid.c @@ -57,7 +57,7 @@ static int basic_id_test(void) testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -65,7 +65,7 @@ static int basic_id_test(void) testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -118,7 +118,7 @@ static int basic_id_test(void) testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; @@ -126,14 +126,14 @@ static int basic_id_test(void) testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; /* Remove an ID and make sure we can't access it */ testPtr = (int*) H5Iremove_verify(arrayID, myType); - CHECK(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR(testPtr, "H5Iremove_verify"); if(testPtr == NULL) goto out; @@ -141,7 +141,7 @@ static int basic_id_test(void) testPtr = (int*) H5Iobject_verify(arrayID, myType); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -263,7 +263,7 @@ static int id_predefined_test(void ) testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Isearch"); + CHECK_PTR_NULL(testPtr, "H5Isearch"); if(testPtr != NULL) goto out; @@ -301,7 +301,7 @@ static int id_predefined_test(void ) testPtr = H5Iremove_verify(typeID, H5I_DATATYPE); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; @@ -309,7 +309,7 @@ static int id_predefined_test(void ) testPtr = H5Iobject_verify(typeID, H5I_DATATYPE); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; diff --git a/test/titerate.c b/test/titerate.c index aad62c9..231bd2e 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -159,7 +159,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) /* Keep a copy of the dataset names around for later */ lnames[i] = HDstrdup(name); - CHECK(lnames[i], NULL, "strdup"); + CHECK_PTR(lnames[i], "strdup"); ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -170,13 +170,13 @@ test_iter_group(hid_t fapl, hbool_t new_format) CHECK(ret, FAIL, "H5Gcreate2"); lnames[NDATASETS] = HDstrdup("grp"); - CHECK(lnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(lnames[NDATASETS], "strdup"); ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); lnames[NDATASETS + 1] = HDstrdup("dtype"); - CHECK(lnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(lnames[NDATASETS], "strdup"); /* Close everything up */ ret = H5Tclose(datatype); @@ -412,7 +412,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format) /* Keep a copy of the attribute names around for later */ anames[i] = HDstrdup(name); - CHECK(anames[i], NULL, "strdup"); + CHECK_PTR(anames[i], "strdup"); ret = H5Aclose(attribute); CHECK(ret, FAIL, "H5Aclose"); @@ -596,7 +596,7 @@ test_iter_group_large(hid_t fapl) /* Allocate & initialize array */ names = (iter_info *)HDcalloc(sizeof(iter_info), (ITER_NGROUPS + 2)); - CHECK(names, NULL, "HDcalloc"); + CHECK_PTR(names, "HDcalloc"); /* Output message about test being performed */ MESSAGE(5, ("Testing Large Group Iteration Functionality\n")); @@ -733,7 +733,7 @@ static void test_grp_memb_funcs(hid_t fapl) /* Keep a copy of the dataset names around for later */ dnames[i] = HDstrdup(name); - CHECK(dnames[i], NULL, "strdup"); + CHECK_PTR(dnames[i], "strdup"); ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -744,13 +744,13 @@ static void test_grp_memb_funcs(hid_t fapl) CHECK(ret, FAIL, "H5Gcreate2"); dnames[NDATASETS] = HDstrdup("grp"); - CHECK(dnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(dnames[NDATASETS], "strdup"); ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); dnames[NDATASETS + 1] = HDstrdup("dtype"); - CHECK(dnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(dnames[NDATASETS], "strdup"); /* Close everything up */ ret = H5Tclose(datatype); @@ -797,7 +797,7 @@ static void test_grp_memb_funcs(hid_t fapl) /* Keep a copy of the dataset names around for later */ obj_names[i] = HDstrdup(dataset_name); - CHECK(obj_names[i], NULL, "strdup"); + CHECK_PTR(obj_names[i], "strdup"); ret = H5Oget_info_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Oget_info_by_idx"); diff --git a/test/tmisc.c b/test/tmisc.c index 6da4589..f0e595b 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -723,7 +723,7 @@ create_struct3(void) herr_t ret; /* For error checking */ str3hndl = (misc5_struct3_hndl *)HDmalloc(sizeof(misc5_struct3_hndl)); - CHECK(str3hndl,NULL,"malloc"); + CHECK_PTR(str3hndl, "malloc"); str3hndl->st3h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct3)); CHECK(str3hndl->st3h_base, FAIL, "H5Tcreate"); @@ -766,7 +766,7 @@ create_struct2(void) herr_t ret; /* For error checking */ str2hndl = (misc5_struct2_hndl *)HDmalloc(sizeof(misc5_struct2_hndl)); - CHECK(str2hndl, NULL, "malloc"); + CHECK_PTR(str2hndl, "HDmalloc"); str2hndl->st2h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct2)); CHECK(str2hndl->st2h_base, FAIL, "H5Tcreate"); @@ -775,7 +775,7 @@ create_struct2(void) CHECK(ret, FAIL, "H5Tinsert"); str2hndl->st2h_st3hndl = create_struct3(); - CHECK(str2hndl->st2h_st3hndl,NULL,"create_struct3"); + CHECK_PTR(str2hndl->st2h_st3hndl, "create_struct3"); ret = H5Tinsert(str2hndl->st2h_base, "st2_el2", HOFFSET(misc5_struct2, st2_el2), str2hndl->st2h_st3hndl->st3h_id); CHECK(ret,FAIL,"H5Tinsert"); @@ -811,7 +811,7 @@ set_struct2(misc5_struct2 *buf) buf->st2_el2.len = MISC5_DBGNELM3; buf->st2_el2.p = HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3)); - CHECK(buf->st2_el2.p,NULL,"malloc"); + CHECK_PTR(buf->st2_el2.p, "HDmalloc"); for(i=0; i<(buf->st2_el2.len); i++) set_struct3(&(((misc5_struct3 *)(buf->st2_el2.p))[i])); @@ -832,7 +832,7 @@ create_struct1(void) herr_t ret; /* For error checking */ str1hndl = (misc5_struct1_hndl *)HDmalloc(sizeof(misc5_struct1_hndl)); - CHECK(str1hndl, NULL, "malloc"); + CHECK_PTR(str1hndl, "HDmalloc"); str1hndl->st1h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1)); CHECK(str1hndl->st1h_base, FAIL, "H5Tcreate"); @@ -841,7 +841,7 @@ create_struct1(void) CHECK(ret, FAIL, "H5Tinsert"); str1hndl->st1h_st2hndl=create_struct2(); - CHECK(str1hndl->st1h_st2hndl,NULL,"create_struct2"); + CHECK_PTR(str1hndl->st1h_st2hndl, "create_struct2"); ret = H5Tinsert(str1hndl->st1h_base, "st1_el2", HOFFSET(misc5_struct1, st1_el2), str1hndl->st1h_st2hndl->st2h_id); CHECK(ret,FAIL,"H5Tinsert"); @@ -877,7 +877,7 @@ set_struct1(misc5_struct1 *buf) buf->st1_el2.len=MISC5_DBGNELM2; buf->st1_el2.p=HDmalloc((buf->st1_el2.len)*sizeof(misc5_struct2)); - CHECK(buf->st1_el2.p,NULL,"malloc"); + CHECK_PTR(buf->st1_el2.p, "HDmalloc"); for(i=0; i<(buf->st1_el2.len); i++) set_struct2(&(((misc5_struct2 *)(buf->st1_el2.p))[i])); @@ -913,7 +913,7 @@ test_misc5(void) /* Create the memory structure to write */ str1hndl = create_struct1(); - CHECK(str1hndl, NULL, "create_struct1"); + CHECK_PTR(str1hndl, "create_struct1"); /* Create the dataspace */ dims[0] = MISC5_NELMTOPLVL; @@ -927,7 +927,7 @@ test_misc5(void) /* Create the variable-length buffer */ buf.len = MISC5_DBGNELM1; buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1)); - CHECK(buf.p, NULL, "malloc"); + CHECK_PTR(buf.p, "HDmalloc"); /* Create the top-level VL information */ for(i = 0; i < MISC5_DBGNELM1; i++) @@ -1253,10 +1253,10 @@ test_misc8(void) /* Allocate space for the data to write & read */ wdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK(wdata,NULL,"malloc"); + CHECK_PTR(wdata, "HDmalloc"); #ifdef VERIFY_DATA rdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK(rdata,NULL,"malloc"); + CHECK_PTR(rdata, "HDmalloc"); #endif /* VERIFY_DATA */ /* Initialize values */ @@ -2144,7 +2144,7 @@ misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data) /* Create a data buffer for the dataset read */ read_data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK(read_data, NULL, "HDcalloc"); + CHECK_PTR(read_data, "HDcalloc"); /* Open the contiguous dataset in the root group */ dsid = H5Dopen2(loc_id, name, H5P_DEFAULT); @@ -2270,14 +2270,14 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char /* Allocate space for the user block */ user_block = HDcalloc(size, (size_t)1); - CHECK(user_block, NULL, "HDcalloc"); + CHECK_PTR(user_block, "HDcalloc"); /* Copy in the user block data */ HDmemcpy(user_block, str, strlen(str)); /* Open the new file */ new_fp = HDfopen(new_name,"wb"); - CHECK(new_fp, NULL, "HDfopen"); + CHECK_PTR(new_fp, "HDfopen"); /* Write the user block to the new file */ written = HDfwrite(user_block, (size_t)1, size, new_fp); @@ -2285,11 +2285,11 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char /* Open the old file */ old_fp = HDfopen(old_name,"rb"); - CHECK(old_fp, NULL, "HDfopen"); + CHECK_PTR(old_fp, "HDfopen"); /* Allocate space for the copy buffer */ copy_buf = HDmalloc((size_t)MISC13_COPY_BUF_SIZE); - CHECK(copy_buf, NULL, "HDmalloc"); + CHECK_PTR(copy_buf, "HDmalloc"); /* Copy data from the old file to the new file */ while((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { @@ -2439,7 +2439,7 @@ test_misc13(void) /* Create a data buffer for the datasets */ data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK(data, NULL, "HDcalloc"); + CHECK_PTR(data, "HDcalloc"); /* Initialize data to write */ misc13_init_data(data); @@ -3446,7 +3446,7 @@ test_misc19(void) /* Get a VFD class to register */ vfd_cls = h5_get_dummy_vfd_class(); - CHECK(vfd_cls, NULL, "h5_get_dummy_vfd_class"); + CHECK_PTR(vfd_cls, "h5_get_dummy_vfd_class"); /* Register a virtual file driver */ vfdid = H5FDregister(vfd_cls); diff --git a/test/trefstr.c b/test/trefstr.c index 40ce344..f55ede0 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -67,7 +67,7 @@ test_refstr_create(void) /* Try creating a ref-counted string */ rs=H5RS_create("foo"); - CHECK(rs, NULL, "H5RS_create"); + CHECK_PTR(rs, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs); @@ -97,7 +97,7 @@ test_refstr_count(void) /* Try creating a ref-counted string */ rs=H5RS_create("foo"); - CHECK(rs, NULL, "H5RS_create"); + CHECK_PTR(rs, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs); @@ -144,7 +144,7 @@ test_refstr_dup(void) /* Try creating a ref-counted string */ rs1=H5RS_create("foo"); - CHECK(rs1, NULL, "H5RS_create"); + CHECK_PTR(rs1, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs1); @@ -152,7 +152,7 @@ test_refstr_dup(void) /* Duplicate r-string */ rs2=H5RS_dup(rs1); - CHECK(rs2, NULL, "H5RS_dup"); + CHECK_PTR(rs2, "H5RS_dup"); /* Get the reference count on the strings */ count=H5RS_get_count(rs1); @@ -194,11 +194,11 @@ test_refstr_cmp(void) /* Create first reference counted string */ rs1=H5RS_create("foo"); - CHECK(rs1, NULL, "H5RS_create"); + CHECK_PTR(rs1, "H5RS_create"); /* Create second reference counted string */ rs2=H5RS_create("foo2"); - CHECK(rs2, NULL, "H5RS_create"); + CHECK_PTR(rs2, "H5RS_create"); /* Compare the strings in various ways */ cmp=H5RS_cmp(rs1,rs1); @@ -246,11 +246,11 @@ test_refstr_wrap(void) /* Wrap ref-counted string around existing buffer */ rs=H5RS_wrap(buf); - CHECK(rs, NULL, "H5RS_wrap"); + CHECK_PTR(rs, "H5RS_wrap"); /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); - CHECK(s, NULL, "H5RS_get_str"); + CHECK_PTR(s, "H5RS_get_str"); VERIFY(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); VERIFY(cmp, 0, "HDstrcmp"); @@ -264,7 +264,7 @@ test_refstr_wrap(void) /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); - CHECK(s, NULL, "H5RS_get_str"); + CHECK_PTR(s, "H5RS_get_str"); CHECK(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); if(cmp<=0) @@ -299,16 +299,16 @@ test_refstr_own(void) /* Initialize buffer */ s = (char *)H5FL_BLK_MALLOC(str_buf,HDstrlen("foo") + 1); - CHECK(s, NULL, "H5FL_BLK_MALLOC"); + CHECK_PTR(s, "H5FL_BLK_MALLOC"); HDstrcpy(s, "foo"); /* Transfer ownership of dynamically allocated string to ref-counted string */ rs=H5RS_own(s); - CHECK(rs, NULL, "H5RS_own"); + CHECK_PTR(rs, "H5RS_own"); /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); - CHECK(t, NULL, "H5RS_get_str"); + CHECK_PTR(t, "H5RS_get_str"); VERIFY(t, s, "transferring"); cmp=HDstrcmp(s,t); VERIFY(cmp, 0, "HDstrcmp"); @@ -322,7 +322,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); - CHECK(t, NULL, "H5RS_get_str"); + CHECK_PTR(t, "H5RS_get_str"); VERIFY(t, s, "transferring"); cmp=HDstrcmp(t,s); VERIFY(cmp, 0, "HDstrcmp"); diff --git a/test/tselect.c b/test/tselect.c index 85c21bb..2022a11 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -228,9 +228,9 @@ test_select_hyper(hid_t xfer_plist) /* Allocate write & read buffers */ wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK(wbuf, NULL, "HDmalloc"); + CHECK_PTR(wbuf, "HDmalloc"); rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK(rbuf, NULL, "HDcalloc"); + CHECK_PTR(rbuf, "HDcalloc"); /* Initialize write buffer */ for(i=0, tbuf=wbuf; islist, &j); - CHECK(obj_ret, NULL, "H5SL_remove"); + CHECK_PTR(obj_ret, "H5SL_remove"); obj_ret->nfrees++; obj_list->nobjs_rem--; } /* end else */ @@ -1324,7 +1324,7 @@ test_skiplist_try_free_safe(void) /* Create a skip list */ obj_list.slist = H5SL_create(H5SL_TYPE_INT, NULL); - CHECK(obj_list.slist, NULL, "H5SL_create"); + CHECK_PTR(obj_list.slist, "H5SL_create"); /* Init obj_list.list */ obj_list.list = list; @@ -1396,7 +1396,7 @@ test_skiplist_less(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u=0; u<10; u++) { @@ -1430,7 +1430,7 @@ test_skiplist_less(void) VERIFY(*found_item,5,"H5SL_less"); find_item=4; found_item=(unsigned *)H5SL_less(slist,&find_item); - VERIFY(found_item,NULL,"H5SL_less"); + CHECK_PTR_NULL(found_item, "H5SL_less"); /* Close the skip list */ ret=H5SL_close(slist); @@ -1460,7 +1460,7 @@ test_skiplist_greater(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1488,7 +1488,7 @@ test_skiplist_greater(void) VERIFY(*found_item, 90, "H5SL_greater"); find_item = 100; found_item = (unsigned *)H5SL_greater(slist, &find_item); - VERIFY(found_item, NULL, "H5SL_greater"); + CHECK_PTR_NULL(found_item, "H5SL_greater"); find_item = 6; found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(*found_item, 10, "H5SL_greater"); @@ -1525,7 +1525,7 @@ test_skiplist_below(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1536,44 +1536,44 @@ test_skiplist_below(void) /* Check for exact match of items in various positions */ find_item = 20; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 90; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 5; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); /* Find item less than a missing key, in various positions */ find_item = 19; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 15, "H5SL_below"); find_item = 89; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 80, "H5SL_below"); find_item = 100; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_below"); find_item = 9; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_below"); find_item = 4; node = (H5SL_node_t *)H5SL_less(slist, &find_item); - VERIFY(node, NULL, "H5SL_below"); + CHECK_PTR_NULL(node, "H5SL_below"); /* Close the skip list */ ret = H5SL_close(slist); @@ -1604,7 +1604,7 @@ test_skiplist_above(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1615,42 +1615,42 @@ test_skiplist_above(void) /* Check for exact match of items in various positions */ find_item = 20; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 90; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 5; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); /* Find item greater than a missing key, in various positions */ find_item = 19; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 20, "H5SL_above"); find_item = 89; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_above"); find_item = 100; node = H5SL_above(slist, &find_item); - VERIFY(node, NULL, "H5SL_above"); + CHECK_PTR_NULL(node, "H5SL_above"); find_item = 6; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 10, "H5SL_above"); find_item = 4; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_above"); @@ -1681,7 +1681,7 @@ test_skiplist_remove_first(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1697,7 +1697,7 @@ test_skiplist_remove_first(void) /* Check for removing object from empty list */ found_item = (unsigned *)H5SL_remove_first(slist); - VERIFY(found_item, NULL, "H5SL_remove_first"); + CHECK_PTR_NULL(found_item, "H5SL_remove_first"); /* Close the skip list */ ret = H5SL_close(slist); @@ -1725,7 +1725,7 @@ test_skiplist_remove_first_many(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_INT, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < NUM_ELEMS; u++) { @@ -1742,7 +1742,7 @@ test_skiplist_remove_first_many(void) /* Check for removing object from empty list */ found_item = (int *)H5SL_remove_first(slist); - VERIFY(found_item, NULL, "H5SL_remove_first"); + CHECK_PTR_NULL(found_item, "H5SL_remove_first"); /* Close the skip list */ ret = H5SL_close(slist); diff --git a/test/ttst.c b/test/ttst.c index b26d582..c5912c5 100644 --- a/test/ttst.c +++ b/test/ttst.c @@ -157,7 +157,7 @@ test_tst_create(void) /* Try creating a TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Try closing a real tree */ ret=H5ST_close(tree); @@ -186,7 +186,7 @@ test_tst_insert(void) /* Create the TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Insert unique words into TST, in random order */ for(u=0; ueqkid,uniq_words[u])) TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,uniq_words[u]); obj=H5ST_locate(tree,uniq_words[u]); - CHECK(obj, NULL, "H5ST_locate"); + CHECK_PTR(obj, "H5ST_locate"); if(HDstrcmp((const char *)obj,uniq_words[u])) TestErrPrintf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,uniq_words[u]); @@ -246,7 +246,7 @@ test_tst_iterate(void) /* Create the TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Insert unique words into TST, in random order */ for(u=0; ueqkid,rand_uniq_words[u])) diff --git a/test/tvltypes.c b/test/tvltypes.c index 5121a66..0c4cb9d 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -1015,9 +1015,9 @@ test_vltypes_compound_vlen_vlen(void) /* Allocate and initialize VL data to write */ wdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK(wdata, NULL, "HDmalloc"); + CHECK_PTR(wdata, "HDmalloc"); rdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK(rdata, NULL, "HDmalloc"); + CHECK_PTR(rdata, "HDmalloc"); for(i = 0; i < SPACE3_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)(i * 20) / 3.0F; @@ -2503,7 +2503,7 @@ test_vltypes_fill_value(void) /* Allocate space for the buffer to read data */ rbuf = (dtype1_struct *)HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); - CHECK(rbuf, NULL, "HDmalloc"); + CHECK_PTR(rbuf, "HDmalloc"); /* Create the small & large dataspaces to use */ -- cgit v0.12 From fd5531e302aeff22f94f380bebc8a380a21cb120 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 08:57:26 -0800 Subject: Added CHECK_PTR_EQ macro to testhdf5 to quiet cast warnings on Windows. --- test/testhdf5.h | 208 +++++++++++++++++---------------- test/theap.c | 12 +- test/tid.c | 342 ++++++++++++++++++++++++++++--------------------------- test/trefstr.c | 6 +- test/tskiplist.c | 14 +-- 5 files changed, 300 insertions(+), 282 deletions(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index 41675cf..6244524 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -30,131 +30,147 @@ /* Use %ld to print the value because long should cover most cases. */ /* Used to make certain a return value _is_not_ a value */ -#define CHECK(ret, val, where) do { \ - if (VERBOSE_HI) print_func(" Call to routine: %15s at line %4d " \ - "in %s returned %ld \n", \ - where, (int)__LINE__, __FILE__, \ - (long)(ret)); \ - if ((ret) == (val)) { \ - TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ - "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK(ret, val, where) do { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d " \ + "in %s returned %ld \n", \ + where, (int)__LINE__, __FILE__, \ + (long)(ret)); \ + } \ + if ((ret) == (val)) { \ + TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ + "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) -#define CHECK_I(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \ - (where), (int)__LINE__, __FILE__, (long)(ret)); \ - } \ - if ((ret)<0) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \ - (where), (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK_I(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \ + (where), (int)__LINE__, __FILE__, (long)(ret)); \ + } \ + if ((ret)<0) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \ + (where), (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } /* Check that a pointer is valid (i.e.: not NULL) */ -#define CHECK_PTR(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ - } \ - if (!(ret)) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \ - (where), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK_PTR(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (!(ret)) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \ + (where), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } -#define CHECK_PTR_NULL(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ - } \ - if (ret) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ - (where), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +/* Check that a pointer is NULL */ +#define CHECK_PTR_NULL(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (ret) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ + (where), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ +} + +/* Check that two pointers are equal */ +#define CHECK_PTR_EQ(ret, val, where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (ret != val) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ + (where), ret, val, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } /* Used to make certain a return value _is_ a value */ -#define VERIFY(_x, _val, where) do { \ - long __x = (long)_x, __val = (long)_val; \ - if(VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - "%ld \n", (where), (int)__LINE__, __FILE__, __x); \ - } \ - if((__x) != (__val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \ - "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY(_x, _val, where) do { \ + long __x = (long)_x, __val = (long)_val; \ + if(VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + "%ld \n", (where), (int)__LINE__, __FILE__, __x); \ + } \ + if((__x) != (__val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \ + "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to make certain a (non-'long' type's) return value _is_ a value */ -#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \ - _type __x = (_type)_x, __val = (_type)_val; \ - if(VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - _format " \n", (where), (int)__LINE__, __FILE__, __x); \ - } \ - if((__x) != (__val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \ - "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \ + _type __x = (_type)_x, __val = (_type)_val; \ + if(VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + _format " \n", (where), (int)__LINE__, __FILE__, __x); \ + } \ + if((__x) != (__val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \ + "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to make certain a string return value _is_ a value */ -#define VERIFY_STR(x, val, where) do { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - "%s \n", (where), (int)__LINE__, __FILE__, x); \ - } \ - if (HDstrcmp(x, val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \ - "in %s\n", where, val, x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY_STR(x, val, where) do { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + "%s \n", (where), (int)__LINE__, __FILE__, x); \ + } \ + if (HDstrcmp(x, val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \ + "in %s\n", where, val, x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to document process through a test and to check for errors */ -#define RESULT(ret,func) do { \ - if (VERBOSE_MED) { \ - print_func(" Call to routine: %15s at line %4d in %s returned " \ - "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \ - } \ - if (VERBOSE_HI) \ - H5Eprint2(H5E_DEFAULT, stdout); \ - if ((ret) == FAIL) { \ - TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ - "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define RESULT(ret,func) do { \ + if (VERBOSE_MED) { \ + print_func(" Call to routine: %15s at line %4d in %s returned " \ + "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \ + } \ + if (VERBOSE_HI) \ + H5Eprint2(H5E_DEFAULT, stdout); \ + if ((ret) == FAIL) { \ + TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ + "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to document process through a test */ #if defined(H5_HAVE_PARALLEL) && defined(H5_PARALLEL_TEST) -#define MESSAGE(V,A) { \ - int mpi_rank; \ - \ - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ - if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \ - print_func A ; \ +#define MESSAGE(V,A) { \ + int mpi_rank; \ + \ + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ + if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \ + print_func A ; \ } #else /* H5_HAVE_PARALLEL */ #define MESSAGE(V,A) {if (HDGetTestVerbosity() > (V)) print_func A;} #endif /* H5_HAVE_PARALLEL */ /* Used to indicate an error that is complex to check for */ -#define ERROR(where) do { \ - if(VERBOSE_HI) \ - print_func(" Call to routine: %15s at line %4d in %s returned " \ - "invalid result\n", where, (int)__LINE__, __FILE__); \ - TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ - where, (int)__LINE__, __FILE__); \ +#define ERROR(where) do { \ + if(VERBOSE_HI) \ + print_func(" Call to routine: %15s at line %4d in %s returned " \ + "invalid result\n", where, (int)__LINE__, __FILE__); \ + TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ + where, (int)__LINE__, __FILE__); \ } while(0) /* definitions for command strings */ diff --git a/test/theap.c b/test/theap.c index cdb423e..7b2fadb 100644 --- a/test/theap.c +++ b/test/theap.c @@ -434,19 +434,19 @@ test_heap_remove_min(void) ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 5, "H5HP_remove"); - VERIFY(ptr, &obj2, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove"); /* Remove second maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 10, "H5HP_remove"); - VERIFY(ptr, &obj1, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove"); /* Remove third maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 20, "H5HP_remove"); - VERIFY(ptr, &obj3, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove"); /* Try removing an object from an empty heap */ ret=H5HP_remove(heap,&val,&ptr); @@ -508,19 +508,19 @@ test_heap_remove_max(void) ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 20, "H5HP_remove"); - VERIFY(ptr, &obj3, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove"); /* Remove second maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 10, "H5HP_remove"); - VERIFY(ptr, &obj1, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove"); /* Remove third maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 5, "H5HP_remove"); - VERIFY(ptr, &obj2, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove"); /* Try removing an object from an empty heap */ ret=H5HP_remove(heap,&val,&ptr); diff --git a/test/tid.c b/test/tid.c index 375ef69..7d6757f 100644 --- a/test/tid.c +++ b/test/tid.c @@ -16,223 +16,225 @@ #include "testhdf5.h" #include "hdf5.h" - /* Include H5Ipkg.h to calculate max number of groups */ +/* Include H5Ipkg.h to calculate max number of groups */ #define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" - /* Test basic functionality of registering and deleting types and IDs */ +/* Test basic functionality of registering and deleting types and IDs */ static int basic_id_test(void) { - H5I_type_t myType = H5I_BADID; - hid_t arrayID = H5I_INVALID_HID; - void* testObj = NULL; - void* testPtr = NULL; - char nameString[10]; - hid_t testID; - ssize_t testSize = -1; - herr_t err; - int num_ref; - hsize_t num_members; - + H5I_type_t myType = H5I_BADID; + hid_t arrayID = H5I_INVALID_HID; + void* testObj = NULL; + void* testPtr = NULL; + char nameString[10]; + hid_t testID; + ssize_t testSize = -1; + herr_t err; + int num_ref; + hsize_t num_members; + + + /* Try to register an ID with ficticious types */ + H5E_BEGIN_TRY + arrayID = H5Iregister((H5I_type_t) 420, testObj); + H5E_END_TRY - /* Try to register an ID with ficticious types */ - H5E_BEGIN_TRY - arrayID = H5Iregister((H5I_type_t) 420, testObj); - H5E_END_TRY + VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID != H5I_INVALID_HID) + goto out; - VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID != H5I_INVALID_HID) - goto out; + H5E_BEGIN_TRY + arrayID = H5Iregister((H5I_type_t) -1, testObj); + H5E_END_TRY - H5E_BEGIN_TRY - arrayID = H5Iregister((H5I_type_t) -1, testObj); - H5E_END_TRY + VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID != H5I_INVALID_HID) + goto out; - VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID != H5I_INVALID_HID) - goto out; + /* Try to access IDs with ficticious types */ + H5E_BEGIN_TRY + testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); + H5E_END_TRY - /* Try to access IDs with ficticious types */ - H5E_BEGIN_TRY - testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + H5E_BEGIN_TRY + testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + /* Register a type */ + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); - /* Register a type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + CHECK(myType, H5I_BADID, "H5Iregister_type"); + if(myType == H5I_BADID) + goto out; - CHECK(myType, H5I_BADID, "H5Iregister_type"); - if(myType == H5I_BADID) - goto out; + /* Register an ID and retrieve the object it points to. + * Once the ID has been registered, testObj will be freed when + * its ID type is destroyed. + */ + testObj = HDmalloc(7 * sizeof(int)); + arrayID = H5Iregister(myType, testObj); - /* Register an ID and retrieve the object it points to. - * Once the ID has been registered, testObj will be freed when - * its ID type is destroyed. */ - testObj = HDmalloc(7 * sizeof(int)); - arrayID = H5Iregister(myType, testObj); + CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID == H5I_INVALID_HID) { + HDfree(testObj); + goto out; + } - CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID == H5I_INVALID_HID) - { - HDfree(testObj); - goto out; - } + testPtr = (int *)H5Iobject_verify(arrayID, myType); - testPtr = (int *) H5Iobject_verify(arrayID, myType); + CHECK_PTR_EQ(testPtr, testObj, "H5Iobject_verify"); + if(testPtr != testObj) + goto out; - VERIFY(testPtr, testObj, "H5Iobject_verify"); - if(testPtr != testObj) - goto out; + /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this + * is an hid_t for the wrong kind of object + */ + H5E_BEGIN_TRY + testID = H5Iget_file_id(arrayID); + H5E_END_TRY - /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this - * is an hid_t for the wrong kind of object */ - H5E_BEGIN_TRY - testID = H5Iget_file_id(arrayID); - H5E_END_TRY + VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id"); + if(testID != H5I_INVALID_HID) + goto out; - VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id"); - if(testID != H5I_INVALID_HID) - goto out; + H5E_BEGIN_TRY + testSize = H5Iget_name(arrayID, nameString, (size_t)9); + H5E_END_TRY - H5E_BEGIN_TRY - testSize = H5Iget_name(arrayID, nameString, (size_t)9); - H5E_END_TRY + VERIFY(testSize, -1, "H5Iget_name"); + if(testSize != -1) + goto out; - VERIFY(testSize, -1, "H5Iget_name"); - if(testSize != -1) - goto out; + /* Make sure H5Iremove_verify catches objects of the wrong type */ + H5E_BEGIN_TRY + testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); + H5E_END_TRY - /* Make sure H5Iremove_verify catches objects of the wrong type */ - H5E_BEGIN_TRY - testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + H5E_BEGIN_TRY + testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + /* Remove an ID and make sure we can't access it */ + testPtr = (int*) H5Iremove_verify(arrayID, myType); - /* Remove an ID and make sure we can't access it */ - testPtr = (int*) H5Iremove_verify(arrayID, myType); + CHECK_PTR(testPtr, "H5Iremove_verify"); + if(testPtr == NULL) + goto out; - CHECK_PTR(testPtr, "H5Iremove_verify"); - if(testPtr == NULL) - goto out; + H5E_BEGIN_TRY + testPtr = (int*) H5Iobject_verify(arrayID, myType); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = (int*) H5Iobject_verify(arrayID, myType); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + /* Delete the type and make sure we can't access objects within it */ + arrayID = H5Iregister(myType, testObj); - /* Delete the type and make sure we can't access objects within it */ - arrayID = H5Iregister(myType, testObj); + err = H5Idestroy_type(myType); + VERIFY(err, 0, "H5Idestroy_type"); + if( err != 0) + goto out; + VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); + if(H5Itype_exists(myType) != 0) + goto out; - err = H5Idestroy_type(myType); - VERIFY(err, 0, "H5Idestroy_type"); - if( err != 0) - goto out; - VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); - if(H5Itype_exists(myType) != 0) + H5E_BEGIN_TRY + VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers"); + if(H5Inmembers(myType, NULL) != -1) goto out; + H5E_END_TRY - H5E_BEGIN_TRY - VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers"); - if(H5Inmembers(myType, NULL) != -1) - goto out; - H5E_END_TRY - - /* Register another type and another object in that type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + /* Register another type and another object in that type */ + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); - CHECK(myType, H5I_BADID, "H5Iregister_type"); - if(myType == H5I_BADID) - goto out; + CHECK(myType, H5I_BADID, "H5Iregister_type"); + if(myType == H5I_BADID) + goto out; - /* The memory that testObj pointed to should already have been - * freed when the previous type was destroyed. Allocate new - * memory for it. - */ - testObj = HDmalloc(7 * sizeof(int)); - arrayID = H5Iregister(myType, testObj); + /* The memory that testObj pointed to should already have been + * freed when the previous type was destroyed. Allocate new + * memory for it. + */ + testObj = HDmalloc(7 * sizeof(int)); + arrayID = H5Iregister(myType, testObj); - CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID == H5I_INVALID_HID) - { - HDfree(testObj); - goto out; - } + CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID == H5I_INVALID_HID) { + HDfree(testObj); + goto out; + } - err = H5Inmembers(myType, &num_members); - CHECK(err, -1, "H5Inmembers"); - if (err < 0) - goto out; - VERIFY(num_members, 1, "H5Inmembers"); - if(num_members != 1) - goto out; + err = H5Inmembers(myType, &num_members); + CHECK(err, -1, "H5Inmembers"); + if (err < 0) + goto out; + VERIFY(num_members, 1, "H5Inmembers"); + if(num_members != 1) + goto out; - /* Increment references to type and ensure that dec_type_ref - doesn't destroy the type */ - num_ref = H5Iinc_type_ref(myType); - VERIFY(num_ref, 2, "H5Iinc_type_ref"); - if( num_ref != 2) - goto out; - num_ref = H5Idec_type_ref(myType); - VERIFY(num_ref, 1, "H5Idec_type_ref"); - if(num_ref != 1) - goto out; - err = H5Inmembers(myType, &num_members); - CHECK(err, -1, "H5Inmembers"); - if (err < 0) - goto out; - VERIFY(num_members, 1, "H5Inmembers"); - if(num_members != 1) - goto out; + /* Increment references to type and ensure that dec_type_ref + * doesn't destroy the type + */ + num_ref = H5Iinc_type_ref(myType); + VERIFY(num_ref, 2, "H5Iinc_type_ref"); + if( num_ref != 2) + goto out; + num_ref = H5Idec_type_ref(myType); + VERIFY(num_ref, 1, "H5Idec_type_ref"); + if(num_ref != 1) + goto out; + err = H5Inmembers(myType, &num_members); + CHECK(err, -1, "H5Inmembers"); + if (err < 0) + goto out; + VERIFY(num_members, 1, "H5Inmembers"); + if(num_members != 1) + goto out; - /* This call to dec_type_ref should destroy the type */ - num_ref = H5Idec_type_ref(myType); - VERIFY(num_ref, 0, "H5Idec_type_ref"); - if(num_ref != 0) - goto out; - VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); - if (H5Itype_exists(myType) != 0) - goto out; + /* This call to dec_type_ref should destroy the type */ + num_ref = H5Idec_type_ref(myType); + VERIFY(num_ref, 0, "H5Idec_type_ref"); + if(num_ref != 0) + goto out; + VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); + if (H5Itype_exists(myType) != 0) + goto out; - H5E_BEGIN_TRY + H5E_BEGIN_TRY err = H5Inmembers(myType, &num_members); - if(err >= 0) - goto out; - H5E_END_TRY + if(err >= 0) + goto out; + H5E_END_TRY - return 0; + return 0; out: - /* Clean up type if it has been allocated and free memory used - * by testObj */ - if(myType >= 0) - H5Idestroy_type(myType); + /* Clean up type if it has been allocated and free memory used + * by testObj + */ + if(myType >= 0) + H5Idestroy_type(myType); - return -1; + return -1; } diff --git a/test/trefstr.c b/test/trefstr.c index f55ede0..83e2951 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -251,7 +251,7 @@ test_refstr_wrap(void) /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); CHECK_PTR(s, "H5RS_get_str"); - VERIFY(s, buf, "wrapping"); + CHECK_PTR_EQ(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); VERIFY(cmp, 0, "HDstrcmp"); @@ -309,7 +309,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); CHECK_PTR(t, "H5RS_get_str"); - VERIFY(t, s, "transferring"); + CHECK_PTR_EQ(t, s, "transferring"); cmp=HDstrcmp(s,t); VERIFY(cmp, 0, "HDstrcmp"); @@ -323,7 +323,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); CHECK_PTR(t, "H5RS_get_str"); - VERIFY(t, s, "transferring"); + CHECK_PTR_EQ(t, s, "transferring"); cmp=HDstrcmp(t,s); VERIFY(cmp, 0, "HDstrcmp"); diff --git a/test/tskiplist.c b/test/tskiplist.c index 12320ea..2806afe 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -322,17 +322,17 @@ test_skiplist_remove(void) search_key=key1; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key1, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key1, "H5SL_remove"); search_key=key2; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key2, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key2, "H5SL_remove"); search_key=key3; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key3, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key3, "H5SL_remove"); /* Check that the skip list has no elements */ num=H5SL_count(slist); @@ -1210,8 +1210,8 @@ static herr_t test_tfs_iter(void *_obj, void *key, void *_udata) { test_tfs_it_ud_t *udata = (test_tfs_it_ud_t *)_udata; /* Check consistency */ - VERIFY((void *)&obj->idx, key, "obj->idx"); - VERIFY(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]"); + CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx"); + CHECK_PTR_EQ(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]"); /* Increment number of calls */ udata->ncalls++; @@ -1236,8 +1236,8 @@ static htri_t test_tfs_free(void *_obj, void *key, void *_obj_list) { htri_t ret_value; /* Check consistency */ - VERIFY((void *)&obj->idx, key, "obj->idx"); - VERIFY(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]"); + CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx"); + CHECK_PTR_EQ(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]"); /* Mark this object as freed (to make sure it isn't recursively freed, that * is not something we support, we will undo this if we decide later not to -- cgit v0.12 From eeb1802055922417ca281ecc7822fbef50975f6d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 09:11:53 -0800 Subject: Casted pointers to void to quiet warnings on Linux. --- test/testhdf5.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index 6244524..c36c4e1 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -90,7 +90,7 @@ } \ if (ret != val) { \ TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ - (where), ret, val, (int)__LINE__, __FILE__); \ + (where), (void *)(ret), (void *)(val), (int)__LINE__, __FILE__); \ H5Eprint2(H5E_DEFAULT, stdout); \ } \ } -- cgit v0.12 From 796cc17f414b35708ae51e06f75f5a7d0205881b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 09:15:45 -0800 Subject: Changed casts to const void * --- test/testhdf5.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index c36c4e1..127c687 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -86,11 +86,11 @@ #define CHECK_PTR_EQ(ret, val, where) { \ if (VERBOSE_HI) { \ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ + (where), (int)__LINE__, __FILE__, (const void *)(ret)); \ } \ if (ret != val) { \ TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ - (where), (void *)(ret), (void *)(val), (int)__LINE__, __FILE__); \ + (where), (const void *)(ret), (const void *)(val), (int)__LINE__, __FILE__); \ H5Eprint2(H5E_DEFAULT, stdout); \ } \ } -- cgit v0.12 From 04f22540e239103f468ed48c2349b8ffe8f3b476 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Nov 2017 13:06:10 -0600 Subject: Update macros --- config/cmake_ext_mod/HDFMacros.cmake | 1 + fortran/src/H5f90global.F90 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 602b6bf..192a5c8 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -108,6 +108,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set_target_properties (${libtarget} PROPERTIES + OUTPUT_NAME ${LIB_RELEASE_NAME} OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME} OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index d4a9008..4a04971 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -83,7 +83,8 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in - ! both h5open_f and in h5close_f + ! both h5open_f and in h5close_f; initialize to fix linking issues + ! on OSX and Intel compilers. INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 @@ -437,7 +438,6 @@ MODULE H5GLOBAL INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - CONTAINS ! Copy a c string to a Fortran string -- cgit v0.12 From d60ec508bcce1e6970bcf7f46ef81c87c6f420f0 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 15:24:27 -0600 Subject: initialized integer constants --- fortran/src/H5f90global.F90 | 126 ++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 4a04971..8d17ff0 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -89,50 +89,50 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 ! - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE - INTEGER(HID_T) :: H5T_NATIVE_INTEGER - INTEGER(HID_T) :: H5T_NATIVE_REAL - INTEGER(HID_T) :: H5T_NATIVE_DOUBLE - INTEGER(HID_T) :: H5T_NATIVE_CHARACTER - INTEGER(HID_T) :: H5T_STD_REF_OBJ - INTEGER(HID_T) :: H5T_STD_REF_DSETREG - INTEGER(HID_T) :: H5T_IEEE_F32BE - INTEGER(HID_T) :: H5T_IEEE_F32LE - INTEGER(HID_T) :: H5T_IEEE_F64BE - INTEGER(HID_T) :: H5T_IEEE_F64LE - INTEGER(HID_T) :: H5T_STD_I8BE - INTEGER(HID_T) :: H5T_STD_I8LE - INTEGER(HID_T) :: H5T_STD_I16BE - INTEGER(HID_T) :: H5T_STD_I16LE - INTEGER(HID_T) :: H5T_STD_I32BE - INTEGER(HID_T) :: H5T_STD_I32LE - INTEGER(HID_T) :: H5T_STD_I64BE - INTEGER(HID_T) :: H5T_STD_I64LE - INTEGER(HID_T) :: H5T_STD_U8BE - INTEGER(HID_T) :: H5T_STD_U8LE - INTEGER(HID_T) :: H5T_STD_U16BE - INTEGER(HID_T) :: H5T_STD_U16LE - INTEGER(HID_T) :: H5T_STD_U32BE - INTEGER(HID_T) :: H5T_STD_U32LE - INTEGER(HID_T) :: H5T_STD_U64BE - INTEGER(HID_T) :: H5T_STD_U64LE - INTEGER(HID_T) :: H5T_STRING - INTEGER(HID_T) :: H5T_STD_B8BE - INTEGER(HID_T) :: H5T_STD_B8LE - INTEGER(HID_T) :: H5T_STD_B16BE - INTEGER(HID_T) :: H5T_STD_B16LE - INTEGER(HID_T) :: H5T_STD_B32BE - INTEGER(HID_T) :: H5T_STD_B32LE - INTEGER(HID_T) :: H5T_STD_B64BE - INTEGER(HID_T) :: H5T_STD_B64LE - INTEGER(HID_T) :: H5T_NATIVE_B8 - INTEGER(HID_T) :: H5T_NATIVE_B16 - INTEGER(HID_T) :: H5T_NATIVE_B32 - INTEGER(HID_T) :: H5T_NATIVE_B64 - INTEGER(HID_T) :: H5T_FORTRAN_S1 - INTEGER(HID_T) :: H5T_C_S1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE = -1 + INTEGER(HID_T) :: H5T_NATIVE_INTEGER = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL = -1 + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE = -1 + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER = -1 + INTEGER(HID_T) :: H5T_STD_REF_OBJ = -1 + INTEGER(HID_T) :: H5T_STD_REF_DSETREG = -1 + INTEGER(HID_T) :: H5T_IEEE_F32BE = -1 + INTEGER(HID_T) :: H5T_IEEE_F32LE = -1 + INTEGER(HID_T) :: H5T_IEEE_F64BE = -1 + INTEGER(HID_T) :: H5T_IEEE_F64LE = -1 + INTEGER(HID_T) :: H5T_STD_I8BE = -1 + INTEGER(HID_T) :: H5T_STD_I8LE = -1 + INTEGER(HID_T) :: H5T_STD_I16BE = -1 + INTEGER(HID_T) :: H5T_STD_I16LE = -1 + INTEGER(HID_T) :: H5T_STD_I32BE = -1 + INTEGER(HID_T) :: H5T_STD_I32LE = -1 + INTEGER(HID_T) :: H5T_STD_I64BE = -1 + INTEGER(HID_T) :: H5T_STD_I64LE = -1 + INTEGER(HID_T) :: H5T_STD_U8BE = -1 + INTEGER(HID_T) :: H5T_STD_U8LE = -1 + INTEGER(HID_T) :: H5T_STD_U16BE = -1 + INTEGER(HID_T) :: H5T_STD_U16LE = -1 + INTEGER(HID_T) :: H5T_STD_U32BE = -1 + INTEGER(HID_T) :: H5T_STD_U32LE = -1 + INTEGER(HID_T) :: H5T_STD_U64BE = -1 + INTEGER(HID_T) :: H5T_STD_U64LE = -1 + INTEGER(HID_T) :: H5T_STRING = -1 + INTEGER(HID_T) :: H5T_STD_B8BE = -1 + INTEGER(HID_T) :: H5T_STD_B8LE = -1 + INTEGER(HID_T) :: H5T_STD_B16BE = -1 + INTEGER(HID_T) :: H5T_STD_B16LE = -1 + INTEGER(HID_T) :: H5T_STD_B32BE = -1 + INTEGER(HID_T) :: H5T_STD_B32LE = -1 + INTEGER(HID_T) :: H5T_STD_B64BE = -1 + INTEGER(HID_T) :: H5T_STD_B64LE = -1 + INTEGER(HID_T) :: H5T_NATIVE_B8 = -1 + INTEGER(HID_T) :: H5T_NATIVE_B16 = -1 + INTEGER(HID_T) :: H5T_NATIVE_B32 = -1 + INTEGER(HID_T) :: H5T_NATIVE_B64 = -1 + INTEGER(HID_T) :: H5T_FORTRAN_S1 = -1 + INTEGER(HID_T) :: H5T_C_S1 = -1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -156,25 +156,25 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! - INTEGER :: H5F_ACC_RDWR_F - INTEGER :: H5F_ACC_RDONLY_F - INTEGER :: H5F_ACC_TRUNC_F - INTEGER :: H5F_ACC_EXCL_F - INTEGER :: H5F_ACC_DEBUG_F - INTEGER :: H5F_SCOPE_LOCAL_F - INTEGER :: H5F_SCOPE_GLOBAL_F - INTEGER :: H5F_CLOSE_DEFAULT_F - INTEGER :: H5F_CLOSE_WEAK_F - INTEGER :: H5F_CLOSE_SEMI_F - INTEGER :: H5F_CLOSE_STRONG_F - INTEGER :: H5F_OBJ_FILE_F - INTEGER :: H5F_OBJ_DATASET_F - INTEGER :: H5F_OBJ_GROUP_F - INTEGER :: H5F_OBJ_DATATYPE_F - INTEGER :: H5F_OBJ_ALL_F - INTEGER :: H5F_LIBVER_EARLIEST_F - INTEGER :: H5F_LIBVER_LATEST_F - INTEGER :: H5F_UNLIMITED_F + INTEGER :: H5F_ACC_RDWR_F = -1 + INTEGER :: H5F_ACC_RDONLY_F = -1 + INTEGER :: H5F_ACC_TRUNC_F = -1 + INTEGER :: H5F_ACC_EXCL_F = -1 + INTEGER :: H5F_ACC_DEBUG_F = -1 + INTEGER :: H5F_SCOPE_LOCAL_F = -1 + INTEGER :: H5F_SCOPE_GLOBAL_F = -1 + INTEGER :: H5F_CLOSE_DEFAULT_F = -1 + INTEGER :: H5F_CLOSE_WEAK_F = -1 + INTEGER :: H5F_CLOSE_SEMI_F = -1 + INTEGER :: H5F_CLOSE_STRONG_F = -1 + INTEGER :: H5F_OBJ_FILE_F = -1 + INTEGER :: H5F_OBJ_DATASET_F = -1 + INTEGER :: H5F_OBJ_GROUP_F = -1 + INTEGER :: H5F_OBJ_DATATYPE_F = -1 + INTEGER :: H5F_OBJ_ALL_F = -1 + INTEGER :: H5F_LIBVER_EARLIEST_F = -1 + INTEGER :: H5F_LIBVER_LATEST_F = -1 + INTEGER :: H5F_UNLIMITED_F = -1 ! ! H5G flags declaration ! -- cgit v0.12 From d37c9b1cb03fa04aadf08bb51fd45aa570016797 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 16:34:20 -0600 Subject: export var. --- fortran/src/H5f90global.F90 | 128 ++++++++++++++++++------------------- fortran/src/hdf5_fortrandll.def.in | 2 + 2 files changed, 66 insertions(+), 64 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 8d17ff0..0247ad8 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -89,50 +89,50 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 ! - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT = -1 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE = -1 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE = -1 - INTEGER(HID_T) :: H5T_NATIVE_INTEGER = -1 - INTEGER(HID_T) :: H5T_NATIVE_REAL = -1 - INTEGER(HID_T) :: H5T_NATIVE_DOUBLE = -1 - INTEGER(HID_T) :: H5T_NATIVE_CHARACTER = -1 - INTEGER(HID_T) :: H5T_STD_REF_OBJ = -1 - INTEGER(HID_T) :: H5T_STD_REF_DSETREG = -1 - INTEGER(HID_T) :: H5T_IEEE_F32BE = -1 - INTEGER(HID_T) :: H5T_IEEE_F32LE = -1 - INTEGER(HID_T) :: H5T_IEEE_F64BE = -1 - INTEGER(HID_T) :: H5T_IEEE_F64LE = -1 - INTEGER(HID_T) :: H5T_STD_I8BE = -1 - INTEGER(HID_T) :: H5T_STD_I8LE = -1 - INTEGER(HID_T) :: H5T_STD_I16BE = -1 - INTEGER(HID_T) :: H5T_STD_I16LE = -1 - INTEGER(HID_T) :: H5T_STD_I32BE = -1 - INTEGER(HID_T) :: H5T_STD_I32LE = -1 - INTEGER(HID_T) :: H5T_STD_I64BE = -1 - INTEGER(HID_T) :: H5T_STD_I64LE = -1 - INTEGER(HID_T) :: H5T_STD_U8BE = -1 - INTEGER(HID_T) :: H5T_STD_U8LE = -1 - INTEGER(HID_T) :: H5T_STD_U16BE = -1 - INTEGER(HID_T) :: H5T_STD_U16LE = -1 - INTEGER(HID_T) :: H5T_STD_U32BE = -1 - INTEGER(HID_T) :: H5T_STD_U32LE = -1 - INTEGER(HID_T) :: H5T_STD_U64BE = -1 - INTEGER(HID_T) :: H5T_STD_U64LE = -1 - INTEGER(HID_T) :: H5T_STRING = -1 - INTEGER(HID_T) :: H5T_STD_B8BE = -1 - INTEGER(HID_T) :: H5T_STD_B8LE = -1 - INTEGER(HID_T) :: H5T_STD_B16BE = -1 - INTEGER(HID_T) :: H5T_STD_B16LE = -1 - INTEGER(HID_T) :: H5T_STD_B32BE = -1 - INTEGER(HID_T) :: H5T_STD_B32LE = -1 - INTEGER(HID_T) :: H5T_STD_B64BE = -1 - INTEGER(HID_T) :: H5T_STD_B64LE = -1 - INTEGER(HID_T) :: H5T_NATIVE_B8 = -1 - INTEGER(HID_T) :: H5T_NATIVE_B16 = -1 - INTEGER(HID_T) :: H5T_NATIVE_B32 = -1 - INTEGER(HID_T) :: H5T_NATIVE_B64 = -1 - INTEGER(HID_T) :: H5T_FORTRAN_S1 = -1 - INTEGER(HID_T) :: H5T_C_S1 = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_INTEGER + INTEGER(HID_T) :: H5T_NATIVE_REAL + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER + INTEGER(HID_T) :: H5T_STD_REF_OBJ + INTEGER(HID_T) :: H5T_STD_REF_DSETREG + INTEGER(HID_T) :: H5T_IEEE_F32BE + INTEGER(HID_T) :: H5T_IEEE_F32LE + INTEGER(HID_T) :: H5T_IEEE_F64BE + INTEGER(HID_T) :: H5T_IEEE_F64LE + INTEGER(HID_T) :: H5T_STD_I8BE + INTEGER(HID_T) :: H5T_STD_I8LE + INTEGER(HID_T) :: H5T_STD_I16BE + INTEGER(HID_T) :: H5T_STD_I16LE + INTEGER(HID_T) :: H5T_STD_I32BE + INTEGER(HID_T) :: H5T_STD_I32LE + INTEGER(HID_T) :: H5T_STD_I64BE + INTEGER(HID_T) :: H5T_STD_I64LE + INTEGER(HID_T) :: H5T_STD_U8BE + INTEGER(HID_T) :: H5T_STD_U8LE + INTEGER(HID_T) :: H5T_STD_U16BE + INTEGER(HID_T) :: H5T_STD_U16LE + INTEGER(HID_T) :: H5T_STD_U32BE + INTEGER(HID_T) :: H5T_STD_U32LE + INTEGER(HID_T) :: H5T_STD_U64BE + INTEGER(HID_T) :: H5T_STD_U64LE + INTEGER(HID_T) :: H5T_STRING + INTEGER(HID_T) :: H5T_STD_B8BE + INTEGER(HID_T) :: H5T_STD_B8LE + INTEGER(HID_T) :: H5T_STD_B16BE + INTEGER(HID_T) :: H5T_STD_B16LE + INTEGER(HID_T) :: H5T_STD_B32BE + INTEGER(HID_T) :: H5T_STD_B32LE + INTEGER(HID_T) :: H5T_STD_B64BE + INTEGER(HID_T) :: H5T_STD_B64LE + INTEGER(HID_T) :: H5T_NATIVE_B8 + INTEGER(HID_T) :: H5T_NATIVE_B16 + INTEGER(HID_T) :: H5T_NATIVE_B32 + INTEGER(HID_T) :: H5T_NATIVE_B64 + INTEGER(HID_T) :: H5T_FORTRAN_S1 + INTEGER(HID_T) :: H5T_C_S1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -156,25 +156,25 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! - INTEGER :: H5F_ACC_RDWR_F = -1 - INTEGER :: H5F_ACC_RDONLY_F = -1 - INTEGER :: H5F_ACC_TRUNC_F = -1 - INTEGER :: H5F_ACC_EXCL_F = -1 - INTEGER :: H5F_ACC_DEBUG_F = -1 - INTEGER :: H5F_SCOPE_LOCAL_F = -1 - INTEGER :: H5F_SCOPE_GLOBAL_F = -1 - INTEGER :: H5F_CLOSE_DEFAULT_F = -1 - INTEGER :: H5F_CLOSE_WEAK_F = -1 - INTEGER :: H5F_CLOSE_SEMI_F = -1 - INTEGER :: H5F_CLOSE_STRONG_F = -1 - INTEGER :: H5F_OBJ_FILE_F = -1 - INTEGER :: H5F_OBJ_DATASET_F = -1 - INTEGER :: H5F_OBJ_GROUP_F = -1 - INTEGER :: H5F_OBJ_DATATYPE_F = -1 - INTEGER :: H5F_OBJ_ALL_F = -1 - INTEGER :: H5F_LIBVER_EARLIEST_F = -1 - INTEGER :: H5F_LIBVER_LATEST_F = -1 - INTEGER :: H5F_UNLIMITED_F = -1 + INTEGER :: H5F_ACC_RDWR_F + INTEGER :: H5F_ACC_RDONLY_F + INTEGER :: H5F_ACC_TRUNC_F + INTEGER :: H5F_ACC_EXCL_F + INTEGER :: H5F_ACC_DEBUG_F + INTEGER :: H5F_SCOPE_LOCAL_F + INTEGER :: H5F_SCOPE_GLOBAL_F + INTEGER :: H5F_CLOSE_DEFAULT_F + INTEGER :: H5F_CLOSE_WEAK_F + INTEGER :: H5F_CLOSE_SEMI_F + INTEGER :: H5F_CLOSE_STRONG_F + INTEGER :: H5F_OBJ_FILE_F + INTEGER :: H5F_OBJ_DATASET_F + INTEGER :: H5F_OBJ_GROUP_F + INTEGER :: H5F_OBJ_DATATYPE_F + INTEGER :: H5F_OBJ_ALL_F + INTEGER :: H5F_LIBVER_EARLIEST_F + INTEGER :: H5F_LIBVER_LATEST_F + INTEGER :: H5F_UNLIMITED_F ! ! H5G flags declaration ! @@ -258,7 +258,7 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_GHEAP_F INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F - INTEGER :: H5FD_MEM_NTYPES_F + INTEGER :: H5FD_MEM_NTYPES_F=-1 INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 3a5a91f..43a802c 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,4 +1,6 @@ EXPORTS +; H5GLOBAL +H5GLOBAL_mp_H5FD_MEM_NTYPES_F ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F -- cgit v0.12 From c0021b348d01e4c87645224fc308697e39c95029 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 30 Nov 2017 09:56:43 -0800 Subject: Normalization with VOL integration branch. --- src/H5.c | 65 +++----------------- src/H5A.c | 62 ++++++------------- src/H5Aint.c | 69 +++++++++++---------- src/H5Aprivate.h | 4 +- src/H5Dio.c | 15 ++--- src/H5Dpkg.h | 2 + src/H5F.c | 167 +++++++++++++++++++++++--------------------------- src/H5FD.c | 18 +++--- src/H5Fint.c | 64 ++++++++++---------- src/H5I.c | 76 ++++++++++------------- src/H5Oflush.c | 2 +- src/H5Pfapl.c | 24 ++++---- src/H5Tcommit.c | 17 +++--- src/H5Tprivate.h | 6 +- src/H5private.h | 181 +++++++++++++++++++++++++++++-------------------------- src/H5public.h | 1 + src/H5trace.c | 30 ++++----- 17 files changed, 355 insertions(+), 448 deletions(-) diff --git a/src/H5.c b/src/H5.c index 59984dc..965c2e1 100644 --- a/src/H5.c +++ b/src/H5.c @@ -80,9 +80,9 @@ hbool_t H5_libterm_g = FALSE; /* Library isn't being shutdown */ hbool_t H5_MPEinit_g = FALSE; /* MPE Library hasn't been initialized */ #endif -char H5_lib_vers_info_g[] = H5_VERS_INFO; +char H5_lib_vers_info_g[] = H5_VERS_INFO; static hbool_t H5_dont_atexit_g = FALSE; -H5_debug_t H5_debug_g; /*debugging info */ +H5_debug_t H5_debug_g; /* debugging info */ /*******************/ @@ -243,11 +243,6 @@ done: * * Return: void * - * Programmer: Robb Matzke - * Friday, November 20, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -281,11 +276,11 @@ H5_term_library(void) */ #define DOWN(F) \ (((n = H5##F##_term_package()) && (at + 8) < sizeof loop)? \ - (sprintf(loop + at, "%s%s", (at ? "," : ""), #F), \ + (HDsprintf(loop + at, "%s%s", (at ? "," : ""), #F), \ at += HDstrlen(loop + at), \ n): \ ((n > 0 && (at + 5) < sizeof loop) ? \ - (sprintf(loop + at, "..."), \ + (HDsprintf(loop + at, "..."), \ at += HDstrlen(loop + at), \ n) : n)) @@ -364,8 +359,8 @@ H5_term_library(void) if(pending) { /* Only display the error message if the user is interested in them. */ if(func) { - fprintf(stderr, "HDF5: infinite loop closing library\n"); - fprintf(stderr, " %s\n", loop); + HDfprintf(stderr, "HDF5: infinite loop closing library\n"); + HDfprintf(stderr, " %s\n", loop); #ifndef NDEBUG HDabort(); #endif /* NDEBUG */ @@ -440,11 +435,6 @@ done: * Failure: negative if this function is called more than * once or if it is called too late. * - * Programmer: Robb Matzke - * Friday, November 20, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -479,11 +469,6 @@ H5dont_atexit(void) * * Failure: negative * - * Programmer: Quincey Koziol - * Saturday, March 11, 2000 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -528,13 +513,6 @@ done: * * Failure: negative * - * Programmer: Quincey Koziol - * Wednesday, August 2, 2000 - * - * Modifications: Neil Fortner - * Wednesday, April 8, 2009 - * Added support for factory free lists - * *------------------------------------------------------------------------- */ herr_t @@ -578,9 +556,6 @@ done: * * Return: void * - * Programmer: Robb Matzke - * Wednesday, August 19, 1998 - * *------------------------------------------------------------------------- */ static void @@ -632,7 +607,7 @@ H5_debug_mask(const char *s) } /* end if */ } /* end for */ if (i>=(size_t)H5_NPKGS) - fprintf(stderr, "HDF5_DEBUG: ignored %s\n", pkg_name); + HDfprintf(stderr, "HDF5_DEBUG: ignored %s\n", pkg_name); } /* end if-else */ } else if (HDisdigit(*s)) { @@ -672,8 +647,6 @@ H5_debug_mask(const char *s) * * Return: MPI_SUCCESS * - * Programmer: Mohamad Chaarawi, February 2015 - * *------------------------------------------------------------------------- */ static int H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H5_ATTR_UNUSED *attr_val, int H5_ATTR_UNUSED *flag) @@ -698,13 +671,6 @@ static int H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED key * * Return: Non-negative on success/Negative on failure * - * Programmer: Unknown - * - * Modifications: - * Robb Matzke, 4 Mar 1998 - * Now use "normal" data types for the interface. Any of the arguments - * may be null pointers - * *------------------------------------------------------------------------- */ herr_t @@ -738,13 +704,6 @@ done: * * Failure: abort() * - * Programmer: Robb Matzke - * Tuesday, April 21, 1998 - * - * Modifications: - * Albert Cheng, May 12, 2001 - * Added verification of H5_VERS_INFO. - * *------------------------------------------------------------------------- */ #define VERSION_MISMATCH_WARNING \ @@ -869,11 +828,6 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -896,11 +850,6 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Friday, January 30, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5A.c b/src/H5A.c index cf48232..1b80612 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -717,8 +717,7 @@ hid_t H5Aget_space(hid_t attr_id) { H5A_t *attr; /* Attribute object for ID */ - H5S_t *ds = NULL; - hid_t ret_value; + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", attr_id); @@ -727,19 +726,9 @@ H5Aget_space(hid_t attr_id) if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - if(NULL == (ds = H5A_get_space(attr))) + if((ret_value = H5A_get_space(attr)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get space ID of attribute") - - /* Atomize */ - if((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") - done: - if(ret_value < 0) { - if(ds && (H5S_close(ds) < 0)) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") - } /* end if */ - FUNC_LEAVE_API(ret_value) } /* H5Aget_space() */ @@ -764,7 +753,6 @@ hid_t H5Aget_type(hid_t attr_id) { H5A_t *attr; /* Attribute object for ID */ - H5T_t *dt = NULL; hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -774,19 +762,9 @@ H5Aget_type(hid_t attr_id) if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - if(NULL == (dt = H5A_get_type(attr))) - HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get space ID of attribute") - - /* Create an atom */ - if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") - + if((ret_value = H5A_get_type(attr)) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of attribute") done: - if(ret_value < 0) { - if(dt && (H5T_close(dt) < 0)) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") - } /* end if */ - FUNC_LEAVE_API(ret_value) } /* H5Aget_type() */ @@ -1685,12 +1663,12 @@ H5Aexists(hid_t obj_id, const char *attr_name) H5TRACE2("t", "i*s", obj_id, attr_name); /* check arguments */ - if(H5I_ATTR == H5I_get_type(obj_id)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") - if(H5G_loc(obj_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(!attr_name || !*attr_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") + if (H5I_ATTR == H5I_get_type(obj_id)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") + if (H5G_loc(obj_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if (!attr_name || !*attr_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") /* Check if the attribute exists */ if((ret_value = H5O_attr_exists(loc.oloc, attr_name, H5AC_ind_read_dxpl_id)) < 0) @@ -1726,20 +1704,20 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5TRACE4("t", "i*s*si", loc_id, obj_name, attr_name, lapl_id); /* check arguments */ - if(H5I_ATTR == H5I_get_type(loc_id)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(!obj_name || !*obj_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name") - if(!attr_name || !*attr_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") + if (H5I_ATTR == H5I_get_type(loc_id)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") + if (H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if (!obj_name || !*obj_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name") + if (!attr_name || !*attr_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) + if (H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - if((ret_value = H5A_exists_by_name(loc, obj_name, attr_name, lapl_id, dxpl_id)) < 0) + if ((ret_value = H5A_exists_by_name(loc, obj_name, attr_name, lapl_id, dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: diff --git a/src/H5Aint.c b/src/H5Aint.c index 160c7fb..a661a89 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -735,86 +735,89 @@ H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) /*------------------------------------------------------------------------- - * Function: H5A_get_space + * Function: H5A_get_space * - * Purpose: Returns dataspace of the attribute. + * Purpose: Returns dataspace of the attribute. * - * Return: Success: dataspace + * Return: Success: A valid ID for the dataspace of an attribute * - * Failure: NULL - * - * Programmer: Mohamad Chaarawi - * March, 2012 + * Failure: H5I_INVALID_ID * *------------------------------------------------------------------------- */ -H5S_t * +hid_t H5A_get_space(H5A_t *attr) { - H5S_t *ret_value = NULL; + H5S_t *ds = NULL; + hid_t ret_value = H5I_INVALID_HID; FUNC_ENTER_NOAPI_NOINIT HDassert(attr); /* Copy the attribute's dataspace */ - if(NULL == (ret_value = H5S_copy(attr->shared->ds, FALSE, TRUE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to copy dataspace") + if (NULL == (ds = H5S_copy(attr->shared->ds, FALSE, TRUE))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy dataspace") + + /* Atomize */ + if ((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom") done: + if (H5I_INVALID_HID == ret_value && ds && H5S_close(ds) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release dataspace") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_get_space() */ /*------------------------------------------------------------------------- - * Function: H5A_get_type + * Function: H5A_get_type * - * Purpose: Returns datatype of the dataset. + * Purpose: Returns an ID for the datatype of an attribute * - * Return: Success: datatype + * Return: Success: A valid ID for the datatype of an attribute * - * Failure: NULL - * - * Programmer: Mohamad Chaarawi - * March, 2012 + * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ -H5T_t * +hid_t H5A_get_type(H5A_t *attr) { H5T_t *dt = NULL; - H5T_t *ret_value = NULL; + hid_t ret_value = H5I_INVALID_HID; FUNC_ENTER_NOAPI_NOINIT HDassert(attr); /* Patch the datatype's "top level" file pointer */ - if(H5T_patch_file(attr->shared->dt, attr->oloc.file) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to patch datatype's file pointer") + if (H5T_patch_file(attr->shared->dt, attr->oloc.file) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to patch datatype's file pointer") - /* - * Copy the attribute's datatype. If the type is a named type then + /* Copy the attribute's datatype. If the type is a named type then * reopen the type before returning it to the user. Make the type * read-only. */ - if(NULL == (dt = H5T_copy(attr->shared->dt, H5T_COPY_REOPEN))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to copy datatype") + if (NULL == (dt = H5T_copy(attr->shared->dt, H5T_COPY_REOPEN))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy datatype") /* Mark any datatypes as being in memory now */ - if(H5T_set_loc(dt, NULL, H5T_LOC_MEMORY) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location") + if (H5T_set_loc(dt, NULL, H5T_LOC_MEMORY) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "invalid datatype location") /* Lock copied type */ - if(H5T_lock(dt, FALSE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to lock transient datatype") + if (H5T_lock(dt, FALSE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to lock transient datatype") - ret_value = dt; + /* Atomize */ + if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype") done: - if(!ret_value && dt && (H5T_close(dt) < 0)) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") + if (H5I_INVALID_HID == ret_value && dt && (H5T_close(dt) < 0)) + HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release datatype") FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_get_type() */ diff --git a/src/H5Aprivate.h b/src/H5Aprivate.h index b285920..9826859 100644 --- a/src/H5Aprivate.h +++ b/src/H5Aprivate.h @@ -76,8 +76,8 @@ typedef struct H5A_attr_iter_op_t { H5_DLL struct H5O_loc_t *H5A_oloc(H5A_t *attr); H5_DLL H5G_name_t *H5A_nameof(H5A_t *attr); H5_DLL H5T_t *H5A_type(const H5A_t *attr); -H5_DLL H5T_t *H5A_get_type(H5A_t *attr); -H5_DLL H5S_t *H5A_get_space(H5A_t *attr); +H5_DLL hid_t H5A_get_type(H5A_t *attr); +H5_DLL hid_t H5A_get_space(H5A_t *attr); H5_DLL herr_t H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data); diff --git a/src/H5Dio.c b/src/H5Dio.c index 280d602..4ab0b37 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -49,10 +49,6 @@ /* Local Prototypes */ /********************/ -/* Internal I/O routines */ -static herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); - /* Setup/teardown routines */ static herr_t H5D__ioinfo_init(H5D_t *dset, #ifndef H5_HAVE_PARALLEL @@ -324,18 +320,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__pre_write - * - * Purpose: Preparation for writing data. + * Function: H5D__pre_write * - * Return: Non-negative on success/Negative on failure + * Purpose: Preparation for writing data. * - * Programmer: Raymond Lu - * 2 November 2012 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf) diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index beb1089..542abd0 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -598,6 +598,8 @@ H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id); H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id); /* Internal I/O routines */ +H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, + const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, void *buf/*out*/); diff --git a/src/H5F.c b/src/H5F.c index 4b40248..f435502 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -21,20 +21,20 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Aprivate.h" /* Attributes */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5SMprivate.h" /* Shared Object Header Messages */ -#include "H5Tprivate.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5Aprivate.h" /* Attributes */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5SMprivate.h" /* Shared Object Header Messages */ +#include "H5Tprivate.h" /* Datatypes */ /****************/ @@ -377,83 +377,82 @@ done: /*------------------------------------------------------------------------- * Function: H5Fcreate * - * Purpose: This is the primary function for creating HDF5 files . The - * flags parameter determines whether an existing file will be - * overwritten or not. All newly created files are opened for - * both reading and writing. All flags may be combined with the - * bit-wise OR operator (`|') to change the behavior of the file - * create call. + * Purpose: This is the primary function for creating HDF5 files . The + * flags parameter determines whether an existing file will be + * overwritten or not. All newly created files are opened for + * both reading and writing. All flags may be combined with the + * bit-wise OR operator (`|') to change the behavior of the file + * create call. * - * The more complex behaviors of a file's creation and access - * are controlled through the file-creation and file-access - * property lists. The value of H5P_DEFAULT for a template - * value indicates that the library should use the default - * values for the appropriate template. + * The more complex behaviors of a file's creation and access + * are controlled through the file-creation and file-access + * property lists. The value of H5P_DEFAULT for a template + * value indicates that the library should use the default + * values for the appropriate template. * * See also: H5Fpublic.h for the list of supported flags. H5Ppublic.h for - * the list of file creation and file access properties. + * the list of file creation and file access properties. * - * Return: Success: A file ID - * Failure: FAIL + * Return: Success: A file ID + * Failure: FAIL *------------------------------------------------------------------------- */ hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { - 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 */ + 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 */ FUNC_ENTER_API(FAIL) H5TRACE4("i", "*sIuii", filename, flags, fcpl_id, fapl_id); /* Check/fix arguments */ - if(!filename || !*filename) + if (!filename || !*filename) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file name") + /* In this routine, we only accept the following flags: * H5F_ACC_EXCL, H5F_ACC_TRUNC and H5F_ACC_SWMR_WRITE */ - if(flags & ~(H5F_ACC_EXCL | H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE)) + if (flags & ~(H5F_ACC_EXCL | H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid flags") + /* The H5F_ACC_EXCL and H5F_ACC_TRUNC flags are mutually exclusive */ - if((flags & H5F_ACC_EXCL) && (flags & H5F_ACC_TRUNC)) + if ((flags & H5F_ACC_EXCL) && (flags & H5F_ACC_TRUNC)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mutually exclusive flags for file creation") /* Check file creation property list */ - if(H5P_DEFAULT == fcpl_id) + if (H5P_DEFAULT == fcpl_id) fcpl_id = H5P_FILE_CREATE_DEFAULT; else - if(TRUE != H5P_isa_class(fcpl_id, H5P_FILE_CREATE)) + if (TRUE != H5P_isa_class(fcpl_id, H5P_FILE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file create property list") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id, H5I_INVALID_HID, TRUE) < 0) + if (H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id, H5I_INVALID_HID, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - /* - * Adjust bit flags by turning on the creation bit and making sure that + /* Adjust bit flags by turning on the creation bit and making sure that * the EXCL or TRUNC bit is set. All newly-created files are opened for * reading and writing. */ - if (0==(flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC))) - flags |= H5F_ACC_EXCL; /*default*/ + if (0 == (flags & (H5F_ACC_EXCL | H5F_ACC_TRUNC))) + flags |= H5F_ACC_EXCL; /*default*/ flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; - /* - * Create a new file or truncate an existing file. - */ - if(NULL == (new_file = H5F_open(filename, flags, fcpl_id, fapl_id, dxpl_id))) + /* Create a new file or truncate an existing file. */ + 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") /* Get an atom for the file */ - if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file") /* Keep this ID in file object structure */ new_file->file_id = ret_value; done: - if(ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) + 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) @@ -463,46 +462,28 @@ done: /*------------------------------------------------------------------------- * Function: H5Fopen * - * Purpose: This is the primary function for accessing existing HDF5 - * files. The FLAGS argument determines whether writing to an - * existing file will be allowed or not. All flags may be - * combined with the bit-wise OR operator (`|') to change the - * behavior of the file open call. The more complex behaviors - * of a file's access are controlled through the file-access - * property list. - * - * See Also: H5Fpublic.h for a list of possible values for FLAGS. - * - * Return: Success: A file ID - * Failure: FAIL - * - * Modifications: - * Robb Matzke, 1997-07-18 - * File struct creation and destruction is through H5F_new() and - * H5F__dest(). Reading the root symbol table entry is done with - * H5G_decode(). - * - * Robb Matzke, 1997-09-23 - * Most of the work is now done by H5F_open() since H5Fcreate() - * and H5Fopen() originally contained almost identical code. - * - * Robb Matzke, 1998-02-18 - * Added better error checking for the flags and the file access - * property list. It used to be possible to make the library - * dump core by passing an object ID that was not a file access - * property list. - * - * Robb Matzke, 1999-08-02 - * The file access property list is passed to the H5F_open() as - * object IDs. + * Purpose: This is the primary function for accessing existing HDF5 + * files. The FLAGS argument determines whether writing to an + * existing file will be allowed or not. All flags may be + * combined with the bit-wise OR operator (`|') to change the + * behavior of the file open call. The more complex behaviors + * of a file's access are controlled through the file-access + * property list. + * + * See Also: H5Fpublic.h for a list of possible values for FLAGS. + * + * Return: Success: A file ID + * + * Failure: FAIL + * *------------------------------------------------------------------------- */ hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { - 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 */ + 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 */ FUNC_ENTER_API(FAIL) H5TRACE3("i", "*sIui", filename, flags, fapl_id); @@ -685,28 +666,28 @@ H5Fclose(hid_t file_id) H5TRACE1("e", "i", file_id); /* Check/fix arguments. */ - if(H5I_FILE != H5I_get_type(file_id)) + if (H5I_FILE != H5I_get_type(file_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file ID") /* Flush file if this is the last reference to this id and we have write * intent, unless it will be flushed by the "shared" file being closed. * This is only necessary to replicate previous behaviour, and could be - * disabled by an option/property to improve performance. */ - if(NULL == (f = (H5F_t *)H5I_object(file_id))) + * disabled by an option/property to improve performance. + */ + if (NULL == (f = (H5F_t *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if((f->shared->nrefs > 1) && (H5F_INTENT(f) & H5F_ACC_RDWR)) { - if((nref = H5I_get_ref(file_id, FALSE)) < 0) + if ((f->shared->nrefs > 1) && (H5F_INTENT(f) & H5F_ACC_RDWR)) { + if ((nref = H5I_get_ref(file_id, FALSE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count") - if(nref == 1) - if(H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) + if (nref == 1) + if (H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") - } /* end if */ + } - /* - * Decrement reference count on atom. When it reaches zero the file will + /* Decrement reference count on atom. When it reaches zero the file will * be closed. */ - if(H5I_dec_app_ref(file_id) < 0) + if (H5I_dec_app_ref(file_id) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEFILE, FAIL, "decrementing file ID failed") done: diff --git a/src/H5FD.c b/src/H5FD.c index 9f62065..405e2d8 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -119,7 +119,7 @@ H5FD__init_package(void) FUNC_ENTER_PACKAGE if(H5I_register_type(H5I_VFL_CLS) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Reset the file serial numbers */ H5FD_file_serial_no_g = 0; @@ -151,18 +151,18 @@ H5FD_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_PKG_INIT_VAR) { - if(H5I_nmembers(H5I_VFL) > 0) { - (void)H5I_clear_type(H5I_VFL, FALSE, FALSE); + if(H5I_nmembers(H5I_VFL) > 0) { + (void)H5I_clear_type(H5I_VFL, FALSE, FALSE); n++; /*H5I*/ - } /* end if */ + } /* end if */ else { - /* Destroy the VFL driver id group */ - n += (H5I_dec_type_ref(H5I_VFL) > 0); + /* Destroy the VFL driver ID group */ + n += (H5I_dec_type_ref(H5I_VFL) > 0); - /* Mark closed */ + /* Mark closed */ if(0 == n) H5_PKG_INIT_VAR = FALSE; - } /* end else */ + } /* end else */ } /* end if */ FUNC_LEAVE_NOAPI(n) @@ -247,7 +247,7 @@ H5FDregister(const H5FD_class_t *cls) 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) + if((ret_value = H5FD_register(cls, sizeof(H5FD_class_t), TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register file driver ID") done: diff --git a/src/H5Fint.c b/src/H5Fint.c index a48e41c..0eb1ea9 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -409,39 +409,39 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) H5O_loc_t *oloc; /* Group entry info for object */ switch(olist->obj_type) { - case H5I_ATTR: - oloc = H5A_oloc((H5A_t *)obj_ptr); - break; - - case H5I_GROUP: - oloc = H5G_oloc((H5G_t *)obj_ptr); - break; - - case H5I_DATASET: - oloc = H5D_oloc((H5D_t *)obj_ptr); - break; - - case H5I_DATATYPE: - if(H5T_is_named((H5T_t*)obj_ptr)==TRUE) - oloc = H5T_oloc((H5T_t*)obj_ptr); - else - oloc = NULL; - break; - - case H5I_UNINIT: - case H5I_BADID: - case H5I_FILE: - case H5I_DATASPACE: - 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_ATTR: + oloc = H5A_oloc((H5A_t *)obj_ptr); + break; + + case H5I_GROUP: + oloc = H5G_oloc((H5G_t *)obj_ptr); + break; + + case H5I_DATASET: + oloc = H5D_oloc((H5D_t *)obj_ptr); + break; + + case H5I_DATATYPE: + if(H5T_is_named((H5T_t*)obj_ptr)==TRUE) + oloc = H5T_oloc((H5T_t*)obj_ptr); + else + oloc = NULL; + break; + + case H5I_UNINIT: + case H5I_BADID: + case H5I_FILE: + case H5I_DATASPACE: + 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: default: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5_ITER_ERROR, "unknown data object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5_ITER_ERROR, "unknown or invalid data object") } /* end switch */ if((olist->file_info.local && diff --git a/src/H5I.c b/src/H5I.c index b8e47a2..3bd9c4d 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -12,25 +12,17 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * FILE: H5I.c - Internal storage routines for handling "IDs" + * FILE: H5I.c - Internal storage routines for handling "IDs" * - * REMARKS: ID's which allow objects (void *'s currently) to be bundled - * into "types" for more general storage. + * REMARKS: IDs which allow objects (void * currently) to be bundled + * into "types" for more general storage. * - * DESIGN: The types are stored in an array of pointers to store each - * type in an element. Each "type" node contains a link to a - * hash table to manage the IDs in each type. Allowed types are - * values within the range 1 to H5I_MAX_NUM_TYPES and are given out - * at run-time. Types used by the library are stored in global - * variables defined in H5Ipublic.h. - * - * AUTHOR: Quincey Koziol - * - * MODIFICATIONS: - * 1/3/96 - Starting writing specs & coding prototype - * 1/7/96 - Finished coding prototype - * 6/10/97 - Moved into HDF5 library - * 5/18/04 - Expanded to allow registration of new types at run-time + * DESIGN: The types are stored in an array of pointers to store each + * type in an element. Each "type" node contains a link to a + * hash table to manage the IDs in each type. Allowed types are + * values within the range 1 to H5I_MAX_NUM_TYPES and are given out + * at run-time. Types used by the library are stored in global + * variables defined in H5Ipublic.h. */ #include "H5Imodule.h" /* This source code file is part of the H5I module */ @@ -724,58 +716,54 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_register - * - * Purpose: Registers an OBJECT in a TYPE and returns an ID for it. - * This routine does _not_ check for unique-ness of the objects, - * if you register an object twice, you will get two different - * IDs for it. This routine does make certain that each ID in a - * type is unique. IDs are created by getting a unique number - * for the type the ID is in and incorporating the type into - * the ID which is returned to the user. + * Function: H5I_register * - * Return: Success: New object id. - * Failure: Negative + * Purpose: Registers an OBJECT in a TYPE and returns an ID for it. + * This routine does _not_ check for unique-ness of the objects, + * if you register an object twice, you will get two different + * IDs for it. This routine does make certain that each ID in a + * type is unique. IDs are created by getting a unique number + * for the type the ID is in and incorporating the type into + * the ID which is returned to the user. * - * Programmer: Unknown + * Return: Success: New object id + * Failure: Negative * *------------------------------------------------------------------------- */ hid_t H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) { - H5I_id_type_t *type_ptr; /*ptr to the type */ - H5I_id_info_t *id_ptr; /*ptr to the new ID information */ - hid_t new_id; /*new ID */ - hid_t ret_value = SUCCEED; /*return value */ + H5I_id_type_t *type_ptr = NULL; /* ptr to the type */ + H5I_id_info_t *id_ptr = NULL; /* ptr to the new ID information */ + hid_t new_id = -1; /* new ID */ + hid_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + if (type <= H5I_BADID || type >= H5I_next_type) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; - if(NULL == type_ptr || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - if(NULL == (id_ptr = H5FL_MALLOC(H5I_id_info_t))) + if ((NULL == type_ptr) || (type_ptr->init_count <= 0)) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + if (NULL == (id_ptr = H5FL_MALLOC(H5I_id_info_t))) HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, FAIL, "memory allocation failed") - /* Create the struct & it's ID */ + /* Create the struct & its ID */ new_id = H5I_MAKE(type, type_ptr->nextid); id_ptr->id = new_id; - id_ptr->count = 1; /*initial reference count*/ + id_ptr->count = 1; /* initial reference count */ id_ptr->app_count = !!app_ref; id_ptr->obj_ptr = object; /* Insert into the type */ - if(H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0) + if (H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list") type_ptr->id_count++; type_ptr->nextid++; - /* - * Sanity check for the 'nextid' getting too large and wrapping around. - */ + /* Sanity check for the 'nextid' getting too large and wrapping around */ HDassert(type_ptr->nextid <= ID_MASK); /* Set return value */ diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 9764f56..b1592dd 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -405,7 +405,7 @@ H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_ 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)") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid file object ID (dataset, group, or datatype)") break; } /* end switch */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 1b0a4b9..6beee6f 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -14,8 +14,6 @@ /*------------------------------------------------------------------------- * * Created: H5Pfapl.c - * February 26 1998 - * Robb Matzke * * Purpose: File access property list class routines * @@ -32,21 +30,21 @@ /***********/ /* 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 "H5FDprivate.h" /* File drivers */ -#include "H5Iprivate.h" /* IDs */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* Files */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory Management */ -#include "H5Ppkg.h" /* Property lists */ +#include "H5Ppkg.h" /* Property lists */ /* Includes needed to set as default file driver */ -#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ -#include "H5FDstdio.h" /* Standard C buffered I/O */ +#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ +#include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS -#include "H5FDwindows.h" /* Windows buffered I/O */ +#include "H5FDwindows.h" /* Win32 I/O */ #endif diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index c28b508..30fbeeb 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -26,14 +26,15 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FOprivate.h" /* File objects */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Lprivate.h" /* Links */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5Tpkg.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FOprivate.h" /* File objects */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ +#include "H5MMprivate.h" /* Memory Management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5Tpkg.h" /* Datatypes */ /****************/ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 17cdc49..9171e1e 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -27,9 +27,9 @@ typedef struct H5T_t H5T_t; #include "H5MMpublic.h" /* Memory management */ /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Rprivate.h" /* References */ +#include "H5private.h" /* Generic Functions */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Rprivate.h" /* References */ /* Macro for size of temporary buffers to contain a single element */ #define H5T_ELEM_BUF_SIZE 256 diff --git a/src/H5private.h b/src/H5private.h index ca4ebcf..2f33cff 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -53,7 +53,6 @@ # include # include # include -# include # include # include # include @@ -1688,25 +1687,25 @@ extern char *strdup(const char *s); * information about the package in H5_init_library(). */ typedef enum { - H5_PKG_A, /*Attributes */ - H5_PKG_AC, /*Meta data cache */ - H5_PKG_B, /*B-trees */ - H5_PKG_D, /*Datasets */ - H5_PKG_E, /*Error handling */ - H5_PKG_F, /*Files */ - H5_PKG_G, /*Groups */ - H5_PKG_HG, /*Global heap */ - H5_PKG_HL, /*Local heap */ - H5_PKG_I, /*Interface */ - H5_PKG_MF, /*File memory management */ - H5_PKG_MM, /*Core memory management */ - H5_PKG_O, /*Object headers */ - H5_PKG_P, /*Property lists */ - H5_PKG_S, /*Data spaces */ - H5_PKG_T, /*Data types */ - H5_PKG_V, /*Vector functions */ - H5_PKG_Z, /*Raw data filters */ - H5_NPKGS /*Must be last */ + H5_PKG_A, /* Attributes */ + H5_PKG_AC, /* Metadata cache */ + H5_PKG_B, /* B-trees */ + H5_PKG_D, /* Datasets */ + H5_PKG_E, /* Error handling */ + H5_PKG_F, /* Files */ + H5_PKG_G, /* Groups */ + H5_PKG_HG, /* Global heaps */ + H5_PKG_HL, /* Local heaps */ + H5_PKG_I, /* IDs */ + H5_PKG_MF, /* File memory management */ + H5_PKG_MM, /* Core memory management */ + H5_PKG_O, /* Object headers */ + H5_PKG_P, /* Property lists */ + H5_PKG_S, /* Dataspaces */ + H5_PKG_T, /* Datatypes */ + H5_PKG_V, /* Vector functions */ + H5_PKG_Z, /* Raw data filters */ + H5_NPKGS /* Must be last */ } H5_pkg_t; typedef struct H5_debug_open_stream_t { @@ -1735,76 +1734,90 @@ extern H5_debug_t H5_debug_g; extern char H5libhdf5_settings[]; /* embedded library information */ /*------------------------------------------------------------------------- - * Purpose: These macros are inserted automatically just after the - * FUNC_ENTER() macro of API functions and are used to trace - * application program execution. Unless H5_DEBUG_API has been - * defined they are no-ops. + * Purpose: These macros are inserted automatically just after the + * FUNC_ENTER() macro of API functions and are used to trace + * application program execution. Unless H5_DEBUG_API has been + * defined they are no-ops. * - * Arguments: R - Return type encoded as a string - * T - Argument types encoded as a string - * A0-An - Arguments. The number at the end of the macro name - * indicates the number of arguments. + * Arguments: R - Return type encoded as a string + * T - Argument types encoded as a string + * A0-An - Arguments. The number at the end of the macro name + * indicates the number of arguments. * - * Programmer: Robb Matzke - * - * Modifications: *------------------------------------------------------------------------- */ #ifdef H5_DEBUG_API -#define H5TRACE_DECL const char *RTYPE=NULL; \ - double CALLTIME; -#define H5TRACE0(R,T) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T) -#define H5TRACE1(R,T,A0) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0) -#define H5TRACE2(R,T,A0,A1) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1) -#define H5TRACE3(R,T,A0,A1,A2) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2) -#define H5TRACE4(R,T,A0,A1,A2,A3) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3) -#define H5TRACE5(R,T,A0,A1,A2,A3,A4) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4) -#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5) -#define H5TRACE7(R,T,A0,A1,A2,A3,A4,A5,A6) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5,#A6,A6) -#define H5TRACE8(R,T,A0,A1,A2,A3,A4,A5,A6,A7) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5,#A6,A6,#A7,A7) -#define H5TRACE9(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5,#A6,A6,#A7,A7,#A8,A8) -#define H5TRACE10(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5,#A6,A6,#A7,A7,#A8,A8,#A9,A9) -#define H5TRACE11(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5,#A6,A6,#A7,A7,#A8,A8,#A9,A9, \ - #A10,A10) -#define H5TRACE_RETURN(V) if (RTYPE) { \ - H5_trace(&CALLTIME,FUNC,RTYPE,NULL,V); \ - RTYPE=NULL; \ - } + +#define H5TRACE_DECL \ + const char *RTYPE = NULL; \ + double CALLTIME; + +#define H5TRACE0(R,T) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T) +#define H5TRACE1(R,T,A0) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0) +#define H5TRACE2(R,T,A0,A1) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1) +#define H5TRACE3(R,T,A0,A1,A2) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2) +#define H5TRACE4(R,T,A0,A1,A2,A3) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3) +#define H5TRACE5(R,T,A0,A1,A2,A3,A4) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4) +#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5) +#define H5TRACE7(R,T,A0,A1,A2,A3,A4,A5,A6) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6) +#define H5TRACE8(R,T,A0,A1,A2,A3,A4,A5,A6,A7) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6,#A7,A7) +#define H5TRACE9(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6,#A7,A7, \ + #A8,A8) +#define H5TRACE10(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6,#A7,A7, \ + #A8,A8,#A9,A9) +#define H5TRACE11(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6,#A7,A7, \ + #A8,A8,#A9,A9,#A10,A10) +#define H5TRACE12(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6,#A7,A7, \ + #A8,A8,#A9,A9,#A10,A10,#A11,A11) + +#define H5TRACE_RETURN(V) \ + if (RTYPE) { \ + H5_trace(&CALLTIME, FUNC, RTYPE, NULL, V); \ + RTYPE = NULL; \ + } #else -#define H5TRACE_DECL /*void*/ -#define H5TRACE0(R,T) /*void*/ -#define H5TRACE1(R,T,A0) /*void*/ -#define H5TRACE2(R,T,A0,A1) /*void*/ -#define H5TRACE3(R,T,A0,A1,A2) /*void*/ -#define H5TRACE4(R,T,A0,A1,A2,A3) /*void*/ -#define H5TRACE5(R,T,A0,A1,A2,A3,A4) /*void*/ -#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) /*void*/ -#define H5TRACE7(R,T,A0,A1,A2,A3,A4,A5,A6) /*void*/ -#define H5TRACE8(R,T,A0,A1,A2,A3,A4,A5,A6,A7) /*void*/ -#define H5TRACE9(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8) /*void*/ -#define H5TRACE10(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9) /*void*/ -#define H5TRACE11(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) /*void*/ -#define H5TRACE_RETURN(V) /*void*/ -#endif +#define H5TRACE_DECL /*void*/ +#define H5TRACE0(R,T) /*void*/ +#define H5TRACE1(R,T,A0) /*void*/ +#define H5TRACE2(R,T,A0,A1) /*void*/ +#define H5TRACE3(R,T,A0,A1,A2) /*void*/ +#define H5TRACE4(R,T,A0,A1,A2,A3) /*void*/ +#define H5TRACE5(R,T,A0,A1,A2,A3,A4) /*void*/ +#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) /*void*/ +#define H5TRACE7(R,T,A0,A1,A2,A3,A4,A5,A6) /*void*/ +#define H5TRACE8(R,T,A0,A1,A2,A3,A4,A5,A6,A7) /*void*/ +#define H5TRACE9(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8) /*void*/ +#define H5TRACE10(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9) /*void*/ +#define H5TRACE11(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) /*void*/ +#define H5TRACE12(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11) /*void*/ +#define H5TRACE_RETURN(V) /*void*/ +#endif /* H5_DEBUG_API */ H5_DLL double H5_trace(const double *calltime, const char *func, const char *type, ...); diff --git a/src/H5public.h b/src/H5public.h index 40e6e6e..58d0cd1 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -39,6 +39,7 @@ #endif #ifdef H5_STDC_HEADERS # include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ +# include /*for variadic functions in H5VLpublic.h */ #endif #ifndef __cplusplus # ifdef H5_HAVE_STDINT_H diff --git a/src/H5trace.c b/src/H5trace.c index 930002f..7bc2724 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -226,9 +226,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) * name is the null pointer then don't print the argument or the * following `='. This is used for return values. */ - argname = va_arg(ap, char *); /*lint !e64 Type mismatch not really occuring */ + argname = va_arg(ap, char *); if(argname) { - unsigned n = (unsigned)MAX (0, (int)HDstrlen(argname) - 3); /*lint !e666 Allow expression with side effects */ + unsigned n = (unsigned)MAX (0, (int)HDstrlen(argname) - 3); if(!HDstrcmp(argname + n, "_id")) { HDstrncpy(buf, argname, (size_t)MIN((int)sizeof(buf) - 1, n)); @@ -242,7 +242,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) /* The value */ if(ptr) - vp = va_arg(ap, void *); /*lint !e64 Type mismatch not really occuring */ + vp = va_arg(ap, void *); switch(type[0]) { case 'a': if(ptr) { @@ -252,7 +252,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - haddr_t addr = va_arg(ap, haddr_t); /*lint !e732 Loss of sign not really occuring */ + haddr_t addr = va_arg(ap, haddr_t); HDfprintf(out, "%a", addr); } /* end else */ @@ -807,7 +807,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - H5E_error2_t *error = va_arg(ap, H5E_error2_t *); /*lint !e64 Type mismatch not really occuring */ + H5E_error2_t *error = va_arg(ap, H5E_error2_t *); fprintf(out, "0x%lx", (unsigned long)error); } /* end else */ @@ -1093,7 +1093,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - H5G_stat_t *statbuf = va_arg(ap, H5G_stat_t*); /*lint !e64 Type mismatch not really occuring */ + H5G_stat_t *statbuf = va_arg(ap, H5G_stat_t*); fprintf(out, "0x%lx", (unsigned long)statbuf); } @@ -1127,7 +1127,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - hsize_t hsize = va_arg(ap, hsize_t); /*lint !e732 Loss of sign not really occuring */ + hsize_t hsize = va_arg(ap, hsize_t); if(H5S_UNLIMITED == hsize) HDfprintf(out, "H5S_UNLIMITED"); @@ -1553,7 +1553,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - unsigned iu = va_arg(ap, unsigned); /*lint !e732 Loss of sign not really occuring */ + unsigned iu = va_arg(ap, unsigned); fprintf(out, "%u", iu); asize[argno] = iu; @@ -1797,7 +1797,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - hobj_ref_t ref = va_arg(ap, hobj_ref_t); /*lint !e732 Loss of sign not really occuring */ + hobj_ref_t ref = va_arg(ap, hobj_ref_t); HDfprintf(out, "Reference Object=%a", ref); } /* end else */ @@ -1995,7 +1995,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - const char *str = va_arg(ap, const char *); /*lint !e64 Type mismatch not really occuring */ + const char *str = va_arg(ap, const char *); fprintf(out, "\"%s\"", str); } /* end else */ @@ -2422,7 +2422,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - unsigned long iul = va_arg(ap, unsigned long); /*lint !e732 Loss of sign not really occuring */ + unsigned long iul = va_arg(ap, unsigned long); fprintf(out, "%lu", iul); asize[argno] = (hssize_t)iul; @@ -2446,7 +2446,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - unsigned long long iull = va_arg(ap, unsigned long long); /*lint !e732 Loss of sign not really occuring */ + unsigned long long iull = va_arg(ap, unsigned long long); fprintf(out, "%llu", iull); asize[argno] = (hssize_t)iull; @@ -2480,7 +2480,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - vp = va_arg (ap, void *); /*lint !e64 Type mismatch not really occuring */ + vp = va_arg (ap, void *); if(vp) fprintf(out, "0x%lx", (unsigned long)vp); @@ -2506,7 +2506,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - size_t size = va_arg(ap, size_t); /*lint !e732 Loss of sign not really occuring */ + size_t size = va_arg(ap, size_t); HDfprintf(out, "%Zu", size); asize[argno] = (hssize_t)size; @@ -2553,7 +2553,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - H5Z_class2_t *filter = va_arg(ap, H5Z_class2_t*); /*lint !e64 Type mismatch not really occuring */ + H5Z_class2_t *filter = va_arg(ap, H5Z_class2_t*); fprintf(out, "0x%lx", (unsigned long)filter); } /* end else */ -- cgit v0.12 From bbb512bb55b430977713b4f8c662d6a918a456e9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 30 Nov 2017 17:12:37 -0800 Subject: Normalization with VOL integration branch. --- src/H5.c | 1 + src/H5A.c | 4 +- src/H5Aint.c | 16 +- src/H5Dio.c | 2 +- src/H5Fprivate.h | 11 +- src/H5Gdeprec.c | 61 +++--- src/H5I.c | 657 ++++++++++++++++++++++++------------------------------- src/H5L.c | 114 +++------- src/H5Lprivate.h | 49 +++++ src/H5Opkg.h | 18 +- src/H5Oprivate.h | 5 +- src/H5Pfapl.c | 4 +- src/H5Tbit.c | 395 ++++++++++++++++----------------- src/H5Tconv.c | 90 +++++--- 14 files changed, 674 insertions(+), 753 deletions(-) diff --git a/src/H5.c b/src/H5.c index 965c2e1..f0a222d 100644 --- a/src/H5.c +++ b/src/H5.c @@ -24,6 +24,7 @@ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ +#include "H5FSprivate.h" /* File free space */ #include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ diff --git a/src/H5A.c b/src/H5A.c index 1b80612..07aca92 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -1150,7 +1150,7 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) if(HDstrcmp(old_name, new_name)) { H5G_loc_t loc; /* Object location */ - if(H5G_loc(loc_id, & loc) < 0) + if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Call private attribute rename routine */ @@ -1205,7 +1205,7 @@ H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - if(H5G_loc(loc_id, & loc) < 0) + if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Call private attribute rename routine */ diff --git a/src/H5Aint.c b/src/H5Aint.c index a661a89..f1dd41e 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -33,14 +33,14 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Apkg.h" /* Attributes */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Opkg.h" /* Object headers */ -#include "H5SMprivate.h" /* Shared Object Header Messages */ +#include "H5private.h" /* Generic Functions */ +#include "H5Apkg.h" /* Attributes */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ +#include "H5SMprivate.h" /* Shared Object Header Messages */ /****************/ diff --git a/src/H5Dio.c b/src/H5Dio.c index 4ab0b37..aee3c35 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -322,7 +322,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D__pre_write * - * Purpose: Preparation for writing data. + * Purpose: Preparation for writing data. * * Return: SUCCEED/FAIL * diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index eba48de..18d0460 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -18,6 +18,9 @@ #ifndef _H5Fprivate_H #define _H5Fprivate_H +/* Early typedefs to avoid circular dependencies */ +typedef struct H5F_t H5F_t; + /* Include package's public header */ #include "H5Fpublic.h" @@ -475,8 +478,8 @@ #define H5F_ACS_SIEVE_BUF_SIZE_NAME "sieve_buf_size" /* Maximum sieve buffer size (when data sieving is allowed by file driver) */ #define H5F_ACS_SDATA_BLOCK_SIZE_NAME "sdata_block_size" /* Minimum "small data" allocation block size (when aggregating "small" raw data allocations) */ #define H5F_ACS_GARBG_COLCT_REF_NAME "gc_ref" /* Garbage-collect references */ -#define H5F_ACS_FILE_DRV_NAME "driver-id/info" /* File driver ID & info */ -#define H5F_ACS_CLOSE_DEGREE_NAME "close_degree" /* File close degree */ +#define H5F_ACS_FILE_DRV_NAME "vfd_info" /* File driver ID & info */ +#define H5F_ACS_CLOSE_DEGREE_NAME "close_degree" /* File close degree */ #define H5F_ACS_FAMILY_OFFSET_NAME "family_offset" /* Offset position in file for family file driver */ #define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" /* New member size of family driver. (private property only used by h5repart) */ #define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" /* Whether to convert family to sec2 driver. (private property only used by h5repart) */ @@ -484,7 +487,7 @@ #define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ -#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ +#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ @@ -652,12 +655,12 @@ struct H5B_class_t; struct H5UC_t; struct H5O_loc_t; struct H5HG_heap_t; +struct H5VL_class_t; struct H5P_genplist_t; /* Forward declarations for anonymous H5F objects */ /* Main file structures */ -typedef struct H5F_t H5F_t; typedef struct H5F_file_t H5F_file_t; /* Block aggregation structure */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 228fb9c..1cc7e15 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -695,29 +695,26 @@ done: /*------------------------------------------------------------------------- - * Function: H5Giterate + * Function: H5Giterate * - * Purpose: Iterates over the entries of a group. The LOC_ID and NAME - * identify the group over which to iterate and IDX indicates - * where to start iterating (zero means at the beginning). The - * OPERATOR is called for each member and the iteration - * continues until the operator returns non-zero or all members - * are processed. The operator is passed a group ID for the - * group being iterated, a member name, and OP_DATA for each - * member. + * Purpose: Iterates over the entries of a group. The LOC_ID and NAME + * identify the group over which to iterate and IDX indicates + * where to start iterating (zero means at the beginning). The + * OPERATOR is called for each member and the iteration + * continues until the operator returns non-zero or all members + * are processed. The operator is passed a group ID for the + * group being iterated, a member name, and OP_DATA for each + * member. * - * Note: Deprecated in favor of H5Literate + * NOTE: Deprecated in favor of H5Literate * - * Return: Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. + * Return: Success: The return value of the first operator that + * returns non-zero, or zero if all members were + * processed with no operator returning non-zero. * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. - * - * Programmer: Robb Matzke - * Monday, March 23, 1998 + * Failure: Negative if something goes wrong within the + * library, or the negative value returned by one + * of the operators. * *------------------------------------------------------------------------- */ @@ -725,21 +722,21 @@ herr_t H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, void *op_data) { - H5G_link_iterate_t lnk_op; /* Link operator */ - hsize_t last_obj; /* Index of last object looked at */ - hsize_t idx; /* Internal location to hold index */ - herr_t ret_value; + H5G_link_iterate_t lnk_op; /* Link operator */ + hsize_t last_obj; /* Index of last object looked at */ + hsize_t idx; /* Internal location to hold index */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*s*Isx*x", loc_id, name, idx_p, op, op_data); /* Check args */ - if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - if(idx_p && *idx_p < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") - if(!op) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") + if (!name || !*name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") + if (idx_p && *idx_p < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") + if (!op) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") /* Set number of objects looked at to zero */ last_obj = 0; @@ -750,11 +747,11 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, lnk_op.op_func.op_old = op; /* Call private function. */ - if((ret_value = H5G_iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed") + if ((ret_value = H5G_iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed") /* Set the index we stopped at */ - if(idx_p) + if (idx_p) *idx_p = (int)last_obj; done: diff --git a/src/H5I.c b/src/H5I.c index 3bd9c4d..99f944d 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -28,24 +28,24 @@ #include "H5Imodule.h" /* This source code file is part of the H5I module */ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Ipkg.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5SLprivate.h" /* Skip Lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Ipkg.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5SLprivate.h" /* Skip Lists */ /* Define this to compile in support for dumping ID information */ /* #define H5I_DEBUG_OUTPUT */ #ifndef H5I_DEBUG_OUTPUT -#include "H5Gprivate.h" /* Groups */ +#include "H5Gprivate.h" /* Groups */ #else /* H5I_DEBUG_OUTPUT */ -#define H5G_FRIEND /*suppress error about including H5Gpkg */ -#include "H5Gpkg.h" /* Groups */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Tprivate.h" /* Datatypes */ +#define H5G_FRIEND /* Suppress error about including H5Gpkg */ +#include "H5Gpkg.h" /* Groups */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Tprivate.h" /* Datatypes */ #endif /* H5I_DEBUG_OUTPUT */ /* Local Macros */ @@ -186,23 +186,19 @@ H5I_term_package(void) /*------------------------------------------------------------------------- - * Function: H5Iregister_type + * Function: H5Iregister_type * - * Purpose: Public interface to H5I_register_type. Creates a new type - * of ID's to give out. A specific number (RESERVED) of type - * entries may be reserved to enable "constant" values to be handed - * out which are valid IDs in the type, but which do not map to any - * data structures and are not allocated dynamically later. HASH_SIZE is - * the minimum hash table size to use for the type. FREE_FUNC is - * called with an object pointer when the object is removed from - * the type. + * Purpose: Public interface to H5I_register_type. Creates a new type + * of ID's to give out. A specific number (RESERVED) of type + * entries may be reserved to enable "constant" values to be handed + * out which are valid IDs in the type, but which do not map to any + * data structures and are not allocated dynamically later. HASH_SIZE is + * the minimum hash table size to use for the type. FREE_FUNC is + * called with an object pointer when the object is removed from + * the type. * - * Return: Success: Type ID of the new type - * Failure: H5I_BADID - * - * Programmers: Nathaniel Furrer - * James Laird - * Friday, April 30, 2004 + * Return: Success: Type ID of the new type + * Failure: H5I_BADID * *------------------------------------------------------------------------- */ @@ -270,18 +266,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_register_type + * Function: H5I_register_type * - * Purpose: Creates a new type of ID's to give out. - * The class is initialized or its reference count is incremented + * Purpose: Creates a new type of ID's to give out. + * The class is initialized or its reference count is incremented * (if it is already initialized). * - * Return: Success: Type ID of the new type - * Failure: H5I_BADID - * - * Programmers: Nathaniel Furrer - * James Laird - * Friday, April 30, 2004 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -335,17 +326,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Itype_exists + * Function: H5Itype_exists * * Purpose: Query function to inform the user if a given type is * currently registered with the library. * - * Return: Success: 1 if the type is registered, 0 if it is not - * Failure: Negative - * - * Programmer: James Laird - * Nathaniel Furrer - * Tuesday, June 29, 2004 + * Return: Success: 1 if the type is registered, 0 if it is not + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -357,10 +344,10 @@ H5Itype_exists(H5I_type_t type) FUNC_ENTER_API(FAIL) H5TRACE1("t", "It", type); - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + if (type <= H5I_BADID || type >= H5I_next_type) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - if(NULL == H5I_id_type_list_g[type]) + if (NULL == H5I_id_type_list_g[type]) ret_value = FALSE; done: @@ -401,9 +388,9 @@ H5Inmembers(H5I_type_t type, hsize_t *num_members) * an error when the supplied type does not exist. */ 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 == H5I_id_type_list_g[type]) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "supplied type does not exist") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "supplied type does not exist") if(num_members) { int64_t members; @@ -685,15 +672,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iregister + * Function: H5Iregister * - * Purpose: Public interface to H5I_register. + * Purpose: Public interface to H5I_register. * - * Return: Success: New object id. - * Failure: Negative - * - * Programmer: Nathaniel Furrer - * James Laird + * Return: Success: New object id. + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -727,7 +711,7 @@ done: * the ID which is returned to the user. * * Return: Success: New object id - * Failure: Negative + * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ @@ -737,18 +721,18 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) H5I_id_type_t *type_ptr = NULL; /* ptr to the type */ H5I_id_info_t *id_ptr = NULL; /* ptr to the new ID information */ hid_t new_id = -1; /* new ID */ - hid_t ret_value = SUCCEED; /* return value */ + hid_t ret_value = H5I_INVALID_HID; /* return value */ FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ if (type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "invalid type number") type_ptr = H5I_id_type_list_g[type]; if ((NULL == type_ptr) || (type_ptr->init_count <= 0)) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, H5I_INVALID_HID, "invalid type") if (NULL == (id_ptr = H5FL_MALLOC(H5I_id_info_t))) - HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, FAIL, "memory allocation failed") + HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, H5I_INVALID_HID, "memory allocation failed") /* Create the struct & its ID */ new_id = H5I_MAKE(type, type_ptr->nextid); @@ -759,7 +743,7 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) /* Insert into the type */ if (H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list") + HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert ID node into skip list") type_ptr->id_count++; type_ptr->nextid++; @@ -777,27 +761,23 @@ done: /*------------------------------------------------------------------------- * Function: H5I_register_with_id * - * Purpose: Registers an OBJECT in a TYPE with the supplied ID for it. - * This routine will check to ensure the supplied ID is not already - * in use, and ensure that it is a valid ID for the given type, - * but will NOT check to ensure the OBJECT is not already - * registered (thus, it is possible to register one object under - * multiple IDs). - * - * Return: Success: 0 - * Failure: -1 + * Purpose: Registers an OBJECT in a TYPE with the supplied ID for it. + * This routine will check to ensure the supplied ID is not already + * in use, and ensure that it is a valid ID for the given type, + * but will NOT check to ensure the OBJECT is not already + * registered (thus, it is possible to register one object under + * multiple IDs). * - * Programmer: Mike McGreevy - * Wednesday, July 21, 2010 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5I_register_with_id(H5I_type_t type, const void *object, hbool_t app_ref, hid_t id) { - H5I_id_type_t *type_ptr; /*ptr to the type */ - H5I_id_info_t *id_ptr; /*ptr to the new ID information */ - herr_t ret_value = SUCCEED; /*return value */ + H5I_id_type_t *type_ptr; /* ptr to the type */ + H5I_id_info_t *id_ptr; /* ptr to the new ID information */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1187,10 +1167,10 @@ H5I_remove(hid_t id) /* Check arguments */ type = H5I_TYPE(id); if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid type number") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; if(type_ptr == NULL || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "invalid type") + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "invalid type") /* Remove the node from the type */ if(NULL == (ret_value = H5I__remove_common(type_ptr, id))) @@ -1226,7 +1206,7 @@ H5Idec_ref(hid_t id) /* Check arguments */ if(id < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") /* Do actual decrement operation */ if((ret_value = H5I_dec_app_ref(id)) < 0) @@ -1359,16 +1339,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_dec_app_ref_always_close + * Function: H5I_dec_app_ref_always_close * - * Purpose: H5I_dec_app_ref wrapper for case of always closing the ID, - * even when the free routine fails + * Purpose: H5I_dec_app_ref wrapper for case of always closing the ID, + * even when the free routine fails * - * Return: Success: New app. reference count. - * Failure: Negative - * - * Programmer: Quincey Koziol - * Sept 16, 2010 + * Return: Success: New app. reference count. + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1386,7 +1363,7 @@ H5I_dec_app_ref_always_close(hid_t id) ret_value = H5I_dec_app_ref(id); /* Check for failure */ - if(ret_value < 0) { + if (ret_value < 0) { /* * If an object is closing, we can remove the ID even though the free * method might fail. This can happen when a mandatory filter fails to @@ -1396,7 +1373,7 @@ H5I_dec_app_ref_always_close(hid_t id) H5I_remove(id); HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count") - } /* end if */ + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -1404,15 +1381,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iinc_ref - * - * Purpose: Increments the number of references outstanding for an ID. + * Function: H5Iinc_ref * - * Return: Success: New reference count - * Failure: Negative + * Purpose: Increments the number of references outstanding for an ID. * - * Programmer: Quincey Koziol - * Dec 7, 2003 + * Return: Success: New reference count + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1425,11 +1399,11 @@ H5Iinc_ref(hid_t id) H5TRACE1("Is", "i", id); /* Check arguments */ - if(id < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") + if (id < 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") /* Do actual increment operation */ - if((ret_value = H5I_inc_ref(id, TRUE)) < 0) + if ((ret_value = H5I_inc_ref(id, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count") done: @@ -1438,15 +1412,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_inc_ref + * Function: H5I_inc_ref * - * Purpose: Increment the reference count for an object. + * Purpose: Increment the reference count for an object. * - * Return: Success: The new reference count. - * Failure: Negative - * - * Programmer: Robb Matzke - * Thursday, July 29, 1999 + * Return: Success: The new reference count. + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1462,8 +1433,8 @@ H5I_inc_ref(hid_t id, hbool_t app_ref) HDassert(id >= 0); /* General lookup of the ID */ - if(NULL == (id_ptr = H5I__find_id(id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") + if (NULL == (id_ptr = H5I__find_id(id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") /* Adjust reference counts */ ++(id_ptr->count); @@ -1479,15 +1450,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iget_ref + * Function: H5Iget_ref * - * Purpose: Retrieves the number of references outstanding for an ID. - * - * Return: Success: Reference count - * Failure: Negative + * Purpose: Retrieves the number of references outstanding for an ID. * - * Programmer: Quincey Koziol - * Dec 7, 2003 + * Return: Success: Reference count + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1500,11 +1468,11 @@ H5Iget_ref(hid_t id) H5TRACE1("Is", "i", id); /* Check arguments */ - if(id < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") + if (id < 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") /* Do actual retrieve operation */ - if((ret_value = H5I_get_ref(id, TRUE)) < 0) + if ((ret_value = H5I_get_ref(id, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count") done: @@ -1513,15 +1481,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_get_ref + * Function: H5I_get_ref * - * Purpose: Retrieve the reference count for an object. + * Purpose: Retrieve the reference count for an object. * - * Return: Success: The reference count. - * Failure: Negative - * - * Programmer: Quincey Koziol - * Saturday, Decemeber 6, 2003 + * Return: Success: The reference count. + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1537,8 +1502,8 @@ H5I_get_ref(hid_t id, hbool_t app_ref) HDassert(id >= 0); /* General lookup of the ID */ - if(NULL == (id_ptr = H5I__find_id(id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") + if (NULL == (id_ptr = H5I__find_id(id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") /* Set return value */ ret_value = (int)(app_ref ? id_ptr->app_count : id_ptr->count); @@ -1549,16 +1514,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iinc_type_ref + * Function: H5Iinc_type_ref * - * Purpose: Increments the number of references outstanding for an ID type. + * Purpose: Increments the number of references outstanding for an ID type. * - * Return: Success: New reference count - * Failure: Negative - * - * Programmer: Nat Furrer - * James Laird - * April 30, 2004 + * Return: Success: New reference count + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1571,14 +1532,14 @@ H5Iinc_type_ref(H5I_type_t type) H5TRACE1("Is", "It", type); /* Check arguments */ - if(type <= 0 || type >= H5I_next_type) + if (type <= 0 || type >= H5I_next_type) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID type") - if(H5I_IS_LIB_TYPE(type)) + if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type") /* Do actual increment operation */ - if((ret_value = H5I__inc_type_ref(type)) < 0) + if ((ret_value = H5I__inc_type_ref(type)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID type ref count") done: @@ -1587,16 +1548,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5I__inc_type_ref + * Function: H5I__inc_type_ref * - * Purpose: Increment the reference count for an ID type. + * Purpose: Increment the reference count for an ID type. * - * Return: Success: The new reference count. - * Failure: Negative - * - * Programmer: James Laird - * Nat Furrer - * Friday, April 30, 2004 + * Return: Success: The new reference count + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1613,8 +1570,8 @@ H5I__inc_type_ref(H5I_type_t type) /* Check arguments */ type_ptr = H5I_id_type_list_g[type]; - if(!type_ptr) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + if (!type_ptr) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") /* Set return value */ ret_value = (int)(++(type_ptr->init_count)); @@ -1625,24 +1582,26 @@ done: /*------------------------------------------------------------------------- - * Function: H5Idec_type_ref - * - * Purpose: Decrements the reference count on an entire type of IDs. - * If the type reference count becomes zero then the type is - * destroyed along with all atoms in that type regardless of - * their reference counts. Destroying IDs involves calling - * the free-func for each ID's object and then adding the ID - * struct to the ID free list. Public interface to - * H5I_dec_type_ref. - * Returns the number of references to the type on success; a - * return value of 0 means that the type will have to be - * re-initialized before it can be used again (and should probably - * be set to H5I_UNINIT). - * - * Return: Number of references to type on success/Negative on failure - * - * Programmer: Nathaniel Furrer - * James Laird + * Function: H5Idec_type_ref + * + * Purpose: Decrements the reference count on an entire type of IDs. + * If the type reference count becomes zero then the type is + * destroyed along with all atoms in that type regardless of + * their reference counts. Destroying IDs involves calling + * the free-func for each ID's object and then adding the ID + * struct to the ID free list. Public interface to + * H5I_dec_type_ref. + * Returns the number of references to the type on success; a + * return value of 0 means that the type will have to be + * re-initialized before it can be used again (and should probably + * be set to H5I_UNINIT). + * + * NOTE: Using an error type to also represent a count is semantially + * incorrect. We should consider fixing this in a future major + * release (DER). + * + * Return: Success: Number of references to type + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1654,7 +1613,7 @@ H5Idec_type_ref(H5I_type_t type) FUNC_ENTER_API(FAIL) H5TRACE1("e", "It", type); - if(H5I_IS_LIB_TYPE(type)) + if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type") ret_value = H5I_dec_type_ref(type); @@ -1665,22 +1624,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_dec_type_ref - * - * Purpose: Decrements the reference count on an entire type of IDs. - * If the type reference count becomes zero then the type is - * destroyed along with all atoms in that type regardless of - * their reference counts. Destroying IDs involves calling - * the free-func for each ID's object and then adding the ID - * struct to the ID free list. - * Returns the number of references to the type on success; a - * return value of 0 means that the type will have to be - * re-initialized before it can be used again (and should probably - * be set to H5I_UNINIT). - * - * Return: Number of references to type on success/Negative on failure - * - * Programmer: Unknown + * Function: H5I_dec_type_ref + * + * Purpose: Decrements the reference count on an entire type of IDs. + * If the type reference count becomes zero then the type is + * destroyed along with all atoms in that type regardless of + * their reference counts. Destroying IDs involves calling + * the free-func for each ID's object and then adding the ID + * struct to the ID free list. + * Returns the number of references to the type on success; a + * return value of 0 means that the type will have to be + * re-initialized before it can be used again (and should probably + * be set to H5I_UNINIT). + * + * Return: Success: Number of references to type + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1692,27 +1650,26 @@ H5I_dec_type_ref(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") + if (type <= H5I_BADID || type >= H5I_next_type) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; - if(type_ptr == NULL || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + if (type_ptr == NULL || type_ptr->init_count <= 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - /* - * Decrement the number of users of the atomic type. If this is the + /* Decrement the number of users of the atomic type. If this is the * last user of the type then release all atoms from the type and * free all memory it used. The free function is invoked for each atom * being freed. */ - if(1 == type_ptr->init_count) { + if (1 == type_ptr->init_count) { H5I__destroy_type(type); ret_value = 0; - } /* end if */ + } else { --(type_ptr->init_count); ret_value = (herr_t)type_ptr->init_count; - } /* end else */ + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -1720,16 +1677,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iget_type_ref + * Function: H5Iget_type_ref * - * Purpose: Retrieves the number of references outstanding for a type. - * - * Return: Success: Reference count - * Failure: Negative + * Purpose: Retrieves the number of references outstanding for a type. * - * Programmer: Nat Furrer - * James Laird - * April 30, 2004 + * Return: Success: Reference count + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1742,14 +1695,14 @@ H5Iget_type_ref(H5I_type_t type) H5TRACE1("Is", "It", type); /* Check arguments */ - if(type <= 0 || type >= H5I_next_type) + if (type <= 0 || type >= H5I_next_type) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID type") - if(H5I_IS_LIB_TYPE(type)) + if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type") /* Do actual retrieve operation */ - if((ret_value = H5I__get_type_ref(type)) < 0) + if ((ret_value = H5I__get_type_ref(type)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID type ref count") done: @@ -1758,25 +1711,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5I__get_type_ref + * Function: H5I__get_type_ref * - * Purpose: Retrieve the reference count for an ID type. + * Purpose: Retrieve the reference count for an ID type. * - * Return: Success: The reference count. + * Return: Success: The reference count. * - * Failure: Negative - * - * Programmer: Nat Furrer - * James Laird - * April 30, 2004 + * Failure: Negative * *------------------------------------------------------------------------- */ static int H5I__get_type_ref(H5I_type_t type) { - H5I_id_type_t *type_ptr; /*ptr to the type */ - int ret_value = -1; /* Return value */ + H5I_id_type_t *type_ptr; /* Pointer to the type */ + int ret_value = -1; /* Return value */ FUNC_ENTER_STATIC @@ -1785,7 +1734,7 @@ H5I__get_type_ref(H5I_type_t type) /* Check arguments */ type_ptr = H5I_id_type_list_g[type]; - if(!type_ptr) + if (!type_ptr) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") /* Set return value */ @@ -1797,17 +1746,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iis_valid + * Function: H5Iis_valid * - * Purpose: Check if the given id is valid. An id is valid if it is in + * Purpose: Check if the given id is valid. An id is valid if it is in * use and has an application reference count of at least 1. * - * Return: Success: TRUE if the id is valid, FALSE otherwise. - * - * Failure: Negative (never fails currently) + * Return: Success: TRUE if the id is valid, FALSE otherwise. * - * Programmer: Neil Fortner - * Friday, October 31, 2008 (boo) + * Failure: Negative (never fails currently) * *------------------------------------------------------------------------- */ @@ -1823,9 +1769,7 @@ H5Iis_valid(hid_t id) /* Find the ID */ if (NULL == (id_ptr = H5I__find_id(id))) ret_value = FALSE; - - /* Check if the found id is an internal id */ - else if (!id_ptr->app_count) + else if (!id_ptr->app_count) /* Check if the found id is an internal id */ ret_value = FALSE; done: @@ -1834,19 +1778,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5I__search_cb + * Function: H5I__search_cb * - * Purpose: Callback routine for H5Isearch, when it calls H5I_iterate. - * Calls "user" callback search function, and then sets return - * value, based on the result of that callback. - * - * Return: Success: The first object in the type for which FUNC - * returns non-zero. NULL if FUNC returned zero - * for every object in the type. - * Failure: NULL + * Purpose: Callback routine for H5Isearch, when it calls H5I_iterate. + * Calls "user" callback search function, and then sets return + * value, based on the result of that callback. * - * Programmer: Quincey Koziol - * Friday, March 30, 2012 + * Return: Success: The first object in the type for which FUNC + * returns non-zero. NULL if FUNC returned zero + * for every object in the type. + * Failure: NULL * *------------------------------------------------------------------------- */ @@ -1859,7 +1800,7 @@ H5I__search_cb(void *obj, hid_t id, void *_udata) FUNC_ENTER_STATIC_NOERR ret_value = (*udata->app_cb)(obj, id, udata->app_key); - if(ret_value > 0) + if (ret_value > 0) udata->ret_obj = obj; FUNC_LEAVE_NOAPI(ret_value) @@ -1867,26 +1808,22 @@ H5I__search_cb(void *obj, hid_t id, void *_udata) /*------------------------------------------------------------------------- - * Function: H5Isearch + * Function: H5Isearch * - * Purpose: Apply function FUNC to each member of type TYPE and return a - * pointer to the first object for which FUNC returns non-zero. - * The FUNC should take a pointer to the object and the KEY as - * arguments and return non-zero to terminate the search (zero - * to continue). Public interface to H5I_search. + * Purpose: Apply function FUNC to each member of type TYPE and return a + * pointer to the first object for which FUNC returns non-zero. + * The FUNC should take a pointer to the object and the KEY as + * arguments and return non-zero to terminate the search (zero + * to continue). Public interface to H5I_search. * - * Limitation: Currently there is no way to start searching from where a - * previous search left off. + * Limitation: Currently there is no way to start searching from where a + * previous search left off. * - * Return: Success: The first object in the type for which FUNC - * returns non-zero. NULL if FUNC returned zero - * for every object in the type. + * Return: Success: The first object in the type for which FUNC + * returns non-zero. NULL if FUNC returned zero + * for every object in the type. * - * Failure: NULL - * - * Programmer: James Laird - * Nathaniel Furrer - * Friday, April 23, 2004 + * Failure: NULL * *------------------------------------------------------------------------- */ @@ -1900,7 +1837,7 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) H5TRACE3("*x", "Itx*x", type, func, key); /* Check arguments */ - if(H5I_IS_LIB_TYPE(type)) + if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") /* Set up udata struct */ @@ -1922,17 +1859,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5I__iterate_cb + * Function: H5I__iterate_cb * - * Purpose: Callback routine for H5I_iterate, invokes "user" callback + * Purpose: Callback routine for H5I_iterate, invokes "user" callback * function, and then sets return value, based on the result of * that callback. * - * Return: Success: Non-negative on success - * Failure: Negative - * - * Programmer: Quincey Koziol - * Thursday, October 3, 2013 + * Return: Success: Non-negative on success + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1964,29 +1898,25 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) /*------------------------------------------------------------------------- * Function: H5I_iterate * - * Purpose: Apply function FUNC to each member of type TYPE (with - * non-zero application reference count if app_ref is TRUE). - * Stop if FUNC returns a non zero value (i.e. anything - * other than H5_ITER_CONT). + * Purpose: Apply function FUNC to each member of type TYPE (with + * non-zero application reference count if app_ref is TRUE). + * Stop if FUNC returns a non zero value (i.e. anything + * other than H5_ITER_CONT). * - * If FUNC returns a positive value (i.e. H5_ITER_STOP), - * return SUCCEED. + * If FUNC returns a positive value (i.e. H5_ITER_STOP), + * return SUCCEED. * - * If FUNC returns a negative value (i.e. H5_ITER_ERROR), - * return FAIL. + * If FUNC returns a negative value (i.e. H5_ITER_ERROR), + * return FAIL. * - * The FUNC should take a pointer to the object and the - * udata as arguments and return non-zero to terminate - * siteration, and zero to continue. + * The FUNC should take a pointer to the object and the + * udata as arguments and return non-zero to terminate + * siteration, and zero to continue. * - * Limitation: Currently there is no way to start the iteration from - * where a previous iteration left off. + * Limitation: Currently there is no way to start the iteration from + * where a previous iteration left off. * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: John Mainzer - * Monday, December 6, 2011 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1999,12 +1929,12 @@ H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_re FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + if (type <= H5I_BADID || type >= H5I_next_type) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; /* Only iterate through ID list if it is initialized and there are IDs in type */ - if(type_ptr && type_ptr->init_count > 0 && type_ptr->id_count > 0) { + if (type_ptr && type_ptr->init_count > 0 && type_ptr->id_count > 0) { H5I_iterate_ud_t iter_udata; /* User data for iteration callback */ herr_t iter_status; /* Iteration status */ @@ -2014,9 +1944,9 @@ H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_re iter_udata.app_ref = app_ref; /* Iterate over IDs */ - if((iter_status = H5SL_iterate(type_ptr->ids, H5I__iterate_cb, &iter_udata)) < 0) + if ((iter_status = H5SL_iterate(type_ptr->ids, H5I__iterate_cb, &iter_udata)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADITER, FAIL, "iteration failed") - } /* end if */ + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -2024,16 +1954,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5I__find_id - * - * Purpose: Given an object ID find the info struct that describes the - * object. + * Function: H5I__find_id * - * Return: Success: Ptr to the object's info struct. + * Purpose: Given an object ID find the info struct that describes the + * object. * - * Failure: NULL + * Return: Success: A pointer to the object's info struct. * - * Programmer: Unknown + * Failure: NULL * *------------------------------------------------------------------------- */ @@ -2048,12 +1976,12 @@ H5I__find_id(hid_t id) /* Check arguments */ type = H5I_TYPE(id); - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_DONE(NULL) + if (type <= H5I_BADID || type >= H5I_next_type) + HGOTO_DONE(NULL) type_ptr = H5I_id_type_list_g[type]; - if(!type_ptr || type_ptr->init_count <= 0) - HGOTO_DONE(NULL) + if (!type_ptr || type_ptr->init_count <= 0) + HGOTO_DONE(NULL) /* Locate the ID node for the ID */ ret_value = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id); @@ -2064,17 +1992,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iget_name - * - * Purpose: Gets a name of an object from its ID. + * Function: H5Iget_name * - * Return: Success: The length of name. + * Purpose: Gets a name of an object from its ID. * - * Failure: -1 + * Return: Success: The length of the name * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: July 26, 2002 + * Failure: -1 * * Comments: Public function * If `name' is non-NULL then write up to `size' bytes into that @@ -2098,12 +2022,12 @@ H5Iget_name(hid_t id, char *name/*out*/, size_t size) H5TRACE3("Zs", "ixz", id, name, size); /* Get object location */ - if(H5G_loc(id, &loc) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") + if (H5G_loc(id, &loc) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") /* Call internal group routine to retrieve object's name */ - if((ret_value = H5G_get_name(&loc, name, size, NULL, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") + if ((ret_value = H5G_get_name(&loc, name, size, NULL, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") done: FUNC_LEAVE_API(ret_value) @@ -2111,30 +2035,27 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iget_file_id + * Function: H5Iget_file_id * - * Purpose: The public version of H5I_get_file_id(), obtains the file + * Purpose: The public version of H5I_get_file_id(), obtains the file * ID given an object ID. User has to close this ID. * - * Return: Success: file ID - * - * Failure: a negative value + * Return: Success: The file ID associated with the object * - * Programmer: Raymond Lu - * Oct 27, 2003 + * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ hid_t H5Iget_file_id(hid_t obj_id) { - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", obj_id); - if((ret_value = H5I_get_file_id(obj_id, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve file ID") + if ((ret_value = H5I_get_file_id(obj_id, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file ID") done: FUNC_LEAVE_API(ret_value) @@ -2142,50 +2063,48 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_get_file_id + * Function: H5I_get_file_id * - * Purpose: The private version of H5Iget_file_id(), obtains the file + * Purpose: The private version of H5Iget_file_id(), obtains the file * ID given an object ID. * - * Return: Success: file ID - * Failure: a negative value + * Return: Success: The file ID associated with the object * - * Programmer: Raymond Lu - * Oct 27, 2003 + * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ hid_t H5I_get_file_id(hid_t obj_id, hbool_t app_ref) { - H5I_type_t type; /* ID type */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + H5I_type_t type; /* ID type */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Get object type */ type = H5I_TYPE(obj_id); - if(type == H5I_FILE) { + if (type == H5I_FILE) { /* Increment reference count on file ID */ if(H5I_inc_ref(obj_id, app_ref) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") + HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, H5I_INVALID_HID, "incrementing file ID failed") /* Set return value */ ret_value = obj_id; - } /* end if */ - else if(type == H5I_DATATYPE || type == H5I_GROUP || type == H5I_DATASET || type == H5I_ATTR) { + } + else if (type == H5I_DATATYPE || type == H5I_GROUP || type == H5I_DATASET || type == H5I_ATTR) { H5G_loc_t loc; /* Location of object */ /* Get the object location information */ if(H5G_loc(obj_id, &loc) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get object location") + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't get object location") /* Get the file ID for the object */ if((ret_value = H5F_get_id(loc.oloc->file, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get file ID") - } /* end if */ + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't get file ID") + } else - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid object ID") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "invalid object ID") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2194,34 +2113,29 @@ done: #ifdef H5I_DEBUG_OUTPUT /*------------------------------------------------------------------------- - * Function: H5I__debug_cb + * Function: H5I__debug_cb * - * Purpose: Dump the contents of an ID to stderr for debugging. + * Purpose: Dump the contents of an ID to stderr for debugging. * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Robb Matzke - * Friday, February 19, 1999 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ static herr_t H5I__debug_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) { - H5I_id_info_t *item = (H5I_id_info_t *)_item; /* Pointer to the ID node */ - H5I_type_t type = *(H5I_type_t *)_udata; /* User data */ - H5G_name_t *path = NULL; - int ret_value = H5_ITER_CONT; /* Return value */ + H5I_id_info_t *item = (H5I_id_info_t *)_item; /* Pointer to the ID node */ + H5I_type_t type = *(H5I_type_t *)_udata; /* User data */ + H5G_name_t *path = NULL; FUNC_ENTER_STATIC_NOERR - fprintf(stderr, " id = %lu\n", (unsigned long)(item->id)); - fprintf(stderr, " count = %u\n", item->count); - fprintf(stderr, " obj = 0x%08lx\n", (unsigned long)(item->obj_ptr)); + HDfprintf(stderr, " id = %lu\n", (unsigned long)(item->id)); + HDfprintf(stderr, " count = %u\n", item->count); + HDfprintf(stderr, " obj = 0x%08lx\n", (unsigned long)(item->obj_ptr)); /* Get the group location, so we get get the name */ - switch(type) { + switch (type) { case H5I_GROUP: path = H5G_nameof((H5G_t*)item->obj_ptr); break; @@ -2234,31 +2148,40 @@ H5I__debug_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) path = H5T_nameof((H5T_t*)item->obj_ptr); 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: default: break; /* Other types of IDs are not stored in files */ - } /* end switch*/ + } - if(path) { - if(path->user_path_r) - fprintf(stderr, " user_path = %s\n", H5RS_get_str(path->user_path_r)); - if(path->full_path_r) - fprintf(stderr, " full_path = %s\n", H5RS_get_str(path->full_path_r)); - } /* end if */ + if (path) { + if (path->user_path_r) + HDfprintf(stderr, " user_path = %s\n", H5RS_get_str(path->user_path_r)); + if (path->full_path_r) + HDfprintf(stderr, " full_path = %s\n", H5RS_get_str(path->full_path_r)); + } FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5I__debug_cb() */ /*------------------------------------------------------------------------- - * Function: H5I__debug - * - * Purpose: Dump the contents of a type to stderr for debugging. + * Function: H5I__debug * - * Return: Success: Non-negative - * Failure: Negative + * Purpose: Dump the contents of a type to stderr for debugging. * - * Programmer: Robb Matzke - * Friday, February 19, 1999 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -2269,17 +2192,17 @@ H5I__debug(H5I_type_t type) FUNC_ENTER_STATIC_NOERR - fprintf(stderr, "Dumping ID type %d\n", (int)type); + HDfprintf(stderr, "Dumping ID type %d\n", (int)type); type_ptr = H5I_id_type_list_g[type]; /* Header */ - fprintf(stderr, " init_count = %u\n", type_ptr->init_count); - fprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved); - fprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count); - fprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid); + HDfprintf(stderr, " init_count = %u\n", type_ptr->init_count); + HDfprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved); + HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count); + HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid); /* List */ - fprintf(stderr, " List:\n"); + HDfprintf(stderr, " List:\n"); H5SL_iterate(type_ptr->ids, H5I__debug_cb, &type); FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5L.c b/src/H5L.c index 469a86c..afd033a 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -50,18 +50,6 @@ typedef struct { hid_t dxpl_id; /* DXPL to use in callback */ } H5L_trav_gi_t; -/* User data for path traversal routine for getting link info by index */ -typedef struct { - /* In */ - H5_index_t idx_type; /* Index to use */ - H5_iter_order_t order; /* Order to iterate in index */ - hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ - - /* Out */ - H5L_info_t *linfo; /* Buffer to return to user */ -} H5L_trav_gibi_t; - /* User data for path traversal callback to creating a link */ typedef struct { H5F_t *file; /* Pointer to the file */ @@ -108,47 +96,11 @@ typedef struct { void *buf; /* User buffer */ } H5L_trav_gv_t; -/* User data for path traversal routine for getting link value by index */ -typedef struct { - /* In */ - H5_index_t idx_type; /* Index to use */ - H5_iter_order_t order; /* Order to iterate in index */ - hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ - size_t size; /* Size of user buffer */ - - /* Out */ - void *buf; /* User buffer */ -} H5L_trav_gvbi_t; - /* User data for path traversal routine for removing link */ typedef struct { hid_t dxpl_id; /* DXPL to use in callback */ } H5L_trav_rm_t; -/* User data for path traversal routine for removing link by index */ -typedef struct { - /* In */ - H5_index_t idx_type; /* Index to use */ - H5_iter_order_t order; /* Order to iterate in index */ - hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ -} H5L_trav_rmbi_t; - -/* User data for path traversal routine for getting name by index */ -typedef struct { - /* In */ - H5_index_t idx_type; /* Index to use */ - H5_iter_order_t order; /* Order to iterate in index */ - hsize_t n; /* Offset of link within index */ - size_t size; /* Size of name buffer */ - hid_t dxpl_id; /* DXPL to use in callback */ - - /* Out */ - char *name; /* Buffer to return name to user */ - ssize_t name_len; /* Length of full name */ -} H5L_trav_gnbi_t; - /********************/ /* Local Prototypes */ /********************/ @@ -185,8 +137,6 @@ static herr_t H5L__exists_final_cb(H5G_loc_t *grp_loc/*in*/, const char *name, static herr_t H5L__exists_inter_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static htri_t H5L__exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, - hid_t dxpl_id); static herr_t H5L_get_info_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); @@ -866,17 +816,17 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) /* Check arguments */ if(H5G_loc(loc_id, &loc)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Verify access property list and get correct dxpl */ if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Check for the existence of the link */ - if((ret_value = H5L__exists(&loc, name, lapl_id, dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info") + if((ret_value = H5L_exists(&loc, name, lapl_id, dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info") done: FUNC_LEAVE_API(ret_value) @@ -1181,24 +1131,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Literate + * Function: H5Literate * - * Purpose: Iterates over links in a group, with user callback routine, + * Purpose: Iterates over links in a group, with user callback routine, * according to the order within an index. * * Same pattern of behavior as H5Giterate. * - * Return: Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. + * Return: Success: The return value of the first operator that + * returns non-zero, or zero if all members were + * processed with no operator returning non-zero. * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. - * - * - * Programmer: Quincey Koziol - * Thursday, November 16, 2006 + * Failure: Negative if something goes wrong within the + * library, or the negative value returned by one + * of the operators. * *------------------------------------------------------------------------- */ @@ -1206,25 +1152,25 @@ herr_t H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data) { - H5I_type_t id_type; /* Type of ID */ - H5G_link_iterate_t lnk_op; /* Link operator */ - hsize_t last_lnk; /* Index of last object looked at */ - hsize_t idx; /* Internal location to hold index */ - herr_t ret_value; /* Return value */ + H5I_type_t id_type; /* Type of ID */ + H5G_link_iterate_t lnk_op; /* Link operator */ + hsize_t last_lnk; /* Index of last object looked at */ + hsize_t idx; /* Internal location to hold index */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "iIiIo*hx*x", grp_id, idx_type, order, idx_p, op, op_data); /* Check arguments */ id_type = H5I_get_type(grp_id); - if(!(H5I_GROUP == id_type || H5I_FILE == id_type)) + if (!(H5I_GROUP == id_type || H5I_FILE == id_type)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument") - if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") - if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - if(!op) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") + if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") + if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + if (!op) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") /* Set up iteration beginning/end info */ idx = (idx_p == NULL ? 0 : *idx_p); @@ -1235,8 +1181,8 @@ H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, lnk_op.op_func.op_new = op; /* Iterate over the links */ - if((ret_value = H5G_iterate(grp_id, ".", idx_type, order, idx, &last_lnk, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") + if ((ret_value = H5G_iterate(grp_id, ".", idx_type, order, idx, &last_lnk, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") /* Set the index we stopped at */ if(idx_p) @@ -2930,7 +2876,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L__exists + * Function: H5L_exists * * Purpose: Returns whether a link exists in a group * @@ -2944,8 +2890,8 @@ done: * *------------------------------------------------------------------------- */ -static htri_t -H5L__exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) +htri_t +H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) { H5L_trav_le_t udata; /* User data for traversal */ htri_t ret_value = FAIL; /* Return value */ @@ -2966,7 +2912,7 @@ H5L__exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5L__exists() */ +} /* H5L_exists() */ /*------------------------------------------------------------------------- diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index dd243a6..8a2bd34 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -48,6 +48,54 @@ /* Library Private Typedefs */ /****************************/ +/* User data for path traversal routine for getting link value by index */ +typedef struct { + /* In */ + H5_index_t idx_type; /* Index to use */ + H5_iter_order_t order; /* Order to iterate in index */ + hsize_t n; /* Offset of link within index */ + hid_t dxpl_id; /* DXPL to use in callback */ + size_t size; /* Size of user buffer */ + + /* Out */ + void *buf; /* User buffer */ +} H5L_trav_gvbi_t; + +/* User data for path traversal routine for getting link info by index */ +typedef struct { + /* In */ + H5_index_t idx_type; /* Index to use */ + H5_iter_order_t order; /* Order to iterate in index */ + hsize_t n; /* Offset of link within index */ + hid_t dxpl_id; /* DXPL to use in callback */ + + /* Out */ + H5L_info_t *linfo; /* Buffer to return to user */ +} H5L_trav_gibi_t; + +/* User data for path traversal routine for getting name by index */ +typedef struct { + /* In */ + H5_index_t idx_type; /* Index to use */ + H5_iter_order_t order; /* Order to iterate in index */ + hsize_t n; /* Offset of link within index */ + size_t size; /* Size of name buffer */ + hid_t dxpl_id; /* DXPL to use in callback */ + + /* Out */ + char *name; /* Buffer to return name to user */ + ssize_t name_len; /* Length of full name */ +} H5L_trav_gnbi_t; + +/* User data for path traversal routine for removing link by index */ +typedef struct { + /* In */ + H5_index_t idx_type; /* Index to use */ + H5_iter_order_t order; /* Order to iterate in index */ + hsize_t n; /* Offset of link within index */ + hid_t dxpl_id; /* DXPL to use in callback */ +} H5L_trav_rmbi_t; + /* Structure for external link traversal callback property */ typedef struct H5L_elink_cb_t { H5L_elink_traverse_t func; @@ -81,6 +129,7 @@ H5_DLL herr_t H5L_move(H5G_loc_t *src_loc, const char *src_name, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id); +H5_DLL htri_t H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id); H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info_t *linkbuf/*out*/, hid_t lapl_id, hid_t dxpl_id); H5_DLL herr_t H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, diff --git a/src/H5Opkg.h b/src/H5Opkg.h index b0c67d1..109d273 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -247,20 +247,20 @@ struct H5O_msg_class_t { }; struct H5O_mesg_t { - const H5O_msg_class_t *type; /*type of message */ - hbool_t dirty; /*raw out of date wrt native */ - uint8_t flags; /*message flags */ - H5O_msg_crt_idx_t crt_idx; /*message creation index */ - unsigned chunkno; /*chunk number for this mesg */ - void *native; /*native format message */ - uint8_t *raw; /*ptr to raw data */ - size_t raw_size; /*size with alignment */ + const H5O_msg_class_t *type; /* type of message */ + hbool_t dirty; /* raw out of date wrt native */ + uint8_t flags; /* message flags */ + H5O_msg_crt_idx_t crt_idx; /* message creation index */ + unsigned chunkno; /* chunk number for this mesg */ + void *native; /* native format message */ + uint8_t *raw; /* pointer to raw data */ + size_t raw_size; /* size with alignment */ }; /* Struct for storing information about "best" message to move to new chunk */ typedef struct H5O_msg_alloc_info_t { int msgno; /* Index in message array */ - unsigned id; /* Message type ID on disk */ + unsigned id; /* Message type ID on disk */ unsigned chunkno; /* Index in chunk array */ size_t gap_size; /* Size of any "gap" in the chunk immediately after message */ size_t null_size; /* Size of any null message in the chunk immediately after message */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index e87c148..4b74d8f 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -26,6 +26,7 @@ /* Early typedefs to avoid circular dependencies */ typedef struct H5O_t H5O_t; +typedef struct H5O_fill_t H5O_fill_t; /* Include the public header file for this API */ #include "H5Opublic.h" /* Object header functions */ @@ -308,7 +309,7 @@ typedef struct H5O_linfo_t { * message if it's shared. */ -typedef struct H5O_fill_t { +struct H5O_fill_t { H5O_shared_t sh_loc; /* Shared message info (must be first) */ unsigned version; /* Encoding version number */ @@ -318,7 +319,7 @@ typedef struct H5O_fill_t { H5D_alloc_time_t alloc_time; /* time to allocate space */ H5D_fill_time_t fill_time; /* time to write fill value */ hbool_t fill_defined; /* whether fill value is defined */ -} H5O_fill_t; +}; /* * Link message. diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 6beee6f..915aa38 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -389,8 +389,8 @@ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_ static herr_t H5P__facc_reg_prop(H5P_genclass_t *pclass) { - const H5FD_driver_prop_t def_driver_prop = H5F_ACS_FILE_DRV_DEF; /* Default VFL driver ID & info (initialized from a variable) */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5FD_driver_prop_t def_driver_prop = H5F_ACS_FILE_DRV_DEF; /* Default VFL driver ID & info (initialized from a variable) */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5Tbit.c b/src/H5Tbit.c index 12d1fd1..df6d2c3 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -11,10 +11,9 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Module Info: Operations on bit vectors. A bit vector is an array of bytes - * with the least-significant bits in the first byte. That is, - * the bytes are in little-endian order. +/* Module Info: Operations on bit vectors. A bit vector is an array of bytes + * with the least-significant bits in the first byte. That is, + * the bytes are in little-endian order. */ #include "H5Tmodule.h" /* This source code file is part of the H5T module */ @@ -29,14 +28,11 @@ /*------------------------------------------------------------------------- - * Function: H5T__bit_copy + * Function: H5T__bit_copy * - * Purpose: Copies bits from one vector to another. + * Purpose: Copies bits from one vector to another. * - * Return: void - * - * Programmer: Robb Matzke - * Wednesday, June 10, 1998 + * Return: void * *------------------------------------------------------------------------- */ @@ -50,8 +46,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, FUNC_ENTER_PACKAGE_NOERR - /* - * Normalize the offset to be a byte number and a bit offset within that + /* Normalize the offset to be a byte number and a bit offset within that * byte. */ s_idx = src_offset / 8; @@ -59,8 +54,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, src_offset %= 8; dst_offset %= 8; - /* - * Get things rolling. This means copying bits until we're aligned on a + /* Get things rolling. This means copying bits until we're aligned on a * source byte. This the following example, five bits are copied to the * destination. * @@ -75,30 +69,29 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, * ...+---------------+---------------+ * dst[d_idx+1] dst[d_idx] */ - while(src_offset && size > 0) { - size_t nbits = MIN3(size, 8 - dst_offset, 8 - src_offset); - size_t mask = ((size_t)1 << nbits) - 1; - - dst[d_idx] &= (uint8_t)~(mask << dst_offset); - dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); - - src_offset += nbits; - if(src_offset >= 8) { - s_idx++; - src_offset %= 8; - } /* end if */ - - dst_offset += nbits; - if(dst_offset >= 8) { - d_idx++; - dst_offset %= 8; - } /* end if */ - - size -= nbits; - } /* end while */ - - /* - * The middle bits. We are aligned on a source byte which needs to be + while (src_offset && size > 0) { + size_t nbits = MIN3(size, 8 - dst_offset, 8 - src_offset); + size_t mask = ((size_t)1 << nbits) - 1; + + dst[d_idx] &= (uint8_t)~(mask << dst_offset); + dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); + + src_offset += nbits; + if (src_offset >= 8) { + s_idx++; + src_offset %= 8; + } + + dst_offset += nbits; + if (dst_offset >= 8) { + d_idx++; + dst_offset %= 8; + } + + size -= nbits; + } + + /* The middle bits. We are aligned on a source byte which needs to be * copied to two (or one in the degenerate case) destination bytes. * * src[s_idx] @@ -122,48 +115,48 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, mask_lo = ((size_t)1 << (8 - shift)) - 1; mask_hi = (~mask_lo) & 0xff; - for(/*void*/; size > 8; size -= 8, d_idx++, s_idx++) { - if(shift) { - dst[d_idx + 0] &= (uint8_t)(~(mask_lo << shift)); - dst[d_idx + 0] |= (uint8_t)((src[s_idx] & mask_lo) << shift); - dst[d_idx + 1] &= (uint8_t)(~(mask_hi >> (8 - shift))); - dst[d_idx + 1] |= (uint8_t)((src[s_idx] & mask_hi) >> (8 - shift)); - } /* end if */ + for (/*void*/; size > 8; size -= 8, d_idx++, s_idx++) { + if (shift) { + dst[d_idx + 0] &= (uint8_t)(~(mask_lo << shift)); + dst[d_idx + 0] |= (uint8_t)((src[s_idx] & mask_lo) << shift); + dst[d_idx + 1] &= (uint8_t)(~(mask_hi >> (8 - shift))); + dst[d_idx + 1] |= (uint8_t)((src[s_idx] & mask_hi) >> (8 - shift)); + } else - dst[d_idx] = src[s_idx]; - } /* end for */ + dst[d_idx] = src[s_idx]; + } /* Finish up */ - while(size > 0) { - size_t nbits = (size_t)MIN3 (size, 8 - dst_offset, 8 - src_offset); - size_t mask = ((size_t)1 << nbits) - 1; + while (size > 0) { + size_t nbits = (size_t)MIN3 (size, 8 - dst_offset, 8 - src_offset); + size_t mask = ((size_t)1 << nbits) - 1; - dst[d_idx] &= (uint8_t)(~(mask << dst_offset)); - dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); + dst[d_idx] &= (uint8_t)(~(mask << dst_offset)); + dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); - src_offset += nbits; - if(src_offset >= 8) { - s_idx++; - src_offset %= 8; - } /* end if */ + src_offset += nbits; + if (src_offset >= 8) { + s_idx++; + src_offset %= 8; + } - dst_offset += nbits; - if(dst_offset >= 8) { - d_idx++; - dst_offset %= 8; - } /* end if */ + dst_offset += nbits; + if (dst_offset >= 8) { + d_idx++; + dst_offset %= 8; + } - size -= nbits; - } /* end while */ + size -= nbits; + } FUNC_LEAVE_NOAPI_VOID } /* end H5T__bit_copy() */ /*------------------------------------------------------------------------- - * Function: H5T__bit_shift + * Function: H5T__bit_shift * - * Purpose: Simulation of hardware shifting. Shifts a bit vector + * Purpose: Simulation of hardware shifting. Shifts a bit vector * in a way similar to shifting a variable value, like * value <<= 3, or value >>= 16. SHIFT_DIST is positive for * left shift, negative for right shift. The bit vector starts @@ -173,10 +166,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, * For example, if we have a bit sequence 00011100, offset=2, * size=3, shift_dist=2, the result will be 00010000. * - * Return: void - * - * Programmer: Raymond Lu - * Monday, April 12, 2004 + * Return: void * *------------------------------------------------------------------------- */ @@ -193,25 +183,25 @@ H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) HDassert(buf); HDassert(size); - if(shift_dist) { + if (shift_dist) { size_t abs_shift_dist = (size_t)ABS(shift_dist); - if(abs_shift_dist >= size) + if (abs_shift_dist >= size) H5T__bit_set(buf, offset, size, 0); else { size_t buf_size = (size / 8) + 1; /* Size of shift buffer needed */ uint8_t *shift_buf; /* Pointer to shift buffer */ /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(tmp_buf, sizeof(tmp_buf)))) + if (NULL == (wb = H5WB_wrap(tmp_buf, sizeof(tmp_buf)))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't wrap buffer") /* Get a pointer to a buffer that's large enough */ - if(NULL == (shift_buf = (uint8_t *)H5WB_actual(wb, buf_size))) + if (NULL == (shift_buf = (uint8_t *)H5WB_actual(wb, buf_size))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "can't get actual buffer") /* Shift vector by making copies */ - if(shift_dist > 0) { /* left shift */ + if (shift_dist > 0) { /* left shift */ /* Copy part to be shifted to a temporary buffer */ H5T__bit_copy(shift_buf, (size_t)0, buf, offset, size - abs_shift_dist); @@ -220,18 +210,18 @@ H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) /* Zero-set the left part*/ H5T__bit_set(buf, offset, abs_shift_dist, 0); - } /* end if */ + } else { /* right shift */ H5T__bit_copy(shift_buf, (size_t)0, buf, offset + abs_shift_dist, size - abs_shift_dist); H5T__bit_copy(buf, offset, shift_buf, (size_t)0, size - abs_shift_dist); H5T__bit_set(buf, offset + size - abs_shift_dist, abs_shift_dist, 0); - } /* end else */ + } } /* end else */ } /* end if */ done: /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) + if (wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") FUNC_LEAVE_NOAPI(ret_value) @@ -239,27 +229,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__bit_get_d + * Function: H5T__bit_get_d * - * Purpose: Return a small bit sequence as a number. Bit vector starts + * Purpose: Return a small bit sequence as a number. Bit vector starts * at OFFSET and is SIZE bits long. * - * Return: Success: The bit sequence interpretted as an unsigned - * integer. - * - * Failure: 0 + * Return: Success: The bit sequence interpretted as an unsigned + * integer. * - * Programmer: Robb Matzke - * Tuesday, June 23, 1998 + * Failure: 0 * *------------------------------------------------------------------------- */ uint64_t H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size) { - uint64_t val = 0; - size_t i, hs; - uint64_t ret_value = 0; /* Return value */ + uint64_t val = 0; + size_t i, hs; + uint64_t ret_value = 0; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -271,11 +258,11 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size) break; case H5T_ORDER_BE: - for(i = 0, hs = sizeof(val) / 2; i < hs; i++) { + for (i = 0, hs = sizeof(val) / 2; i < hs; i++) { uint8_t tmp = ((uint8_t*)&val)[i]; ((uint8_t*)&val)[i] = ((uint8_t*)&val)[sizeof(val) - (i + 1)]; ((uint8_t*)&val)[sizeof(val) - (i + 1)] = tmp; - } /* end for */ + } break; case H5T_ORDER_ERROR: @@ -285,7 +272,7 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size) default: /* Unknown endianness. Bail out. */ HGOTO_DONE(UFAIL) - } /* end switch */ + } /* Set return value */ ret_value = val; @@ -296,14 +283,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__bit_set_d + * Function: H5T__bit_set_d * - * Purpose: Sets part of a bit vector to the specified unsigned value. + * Purpose: Sets part of a bit vector to the specified unsigned value. * - * Return: void - * - * Programmer: Robb Matzke - * Wednesday, June 24, 1998 + * Return: void * *------------------------------------------------------------------------- */ @@ -321,11 +305,11 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) break; case H5T_ORDER_BE: - for(i = 0, hs = sizeof(val) / 2; i < hs; i++) { + for (i = 0, hs = sizeof(val) / 2; i < hs; i++) { uint8_t tmp = ((uint8_t *)&val)[i]; ((uint8_t *)&val)[i] = ((uint8_t *)&val)[sizeof(val) - (i + 1)]; ((uint8_t *)&val)[sizeof(val) - (i + 1)] = tmp; - } /* end for */ + } break; case H5T_ORDER_ERROR: @@ -334,7 +318,7 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) case H5T_ORDER_MIXED: default: HDabort(); - } /* end switch */ + } H5T__bit_copy(buf, offset, (uint8_t*)&val, (size_t)0, size); @@ -343,24 +327,19 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) /*------------------------------------------------------------------------- - * Function: H5T__bit_set + * Function: H5T__bit_set * - * Purpose: Sets or clears bits in a contiguous region of a vector - * beginning at bit OFFSET and continuing for SIZE bits. + * Purpose: Sets or clears bits in a contiguous region of a vector + * beginning at bit OFFSET and continuing for SIZE bits. * - * Return: void - * - * Programmer: Robb Matzke - * Wednesday, June 10, 1998 - * - * Modifications: + * Return: void * *------------------------------------------------------------------------- */ void H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) { - int idx; + int idx; FUNC_ENTER_PACKAGE_NOERR @@ -369,54 +348,51 @@ H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) offset %= 8; /* The first partial byte */ - if(size && offset % 8) { - size_t nbits = MIN(size, 8 - offset); - unsigned mask = ((unsigned)1 << nbits) - 1; + if (size && offset % 8) { + size_t nbits = MIN(size, 8 - offset); + unsigned mask = ((unsigned)1 << nbits) - 1; - if(value) - buf[idx] = (uint8_t)(buf[idx] | (mask << offset)); - else - buf[idx] &= (uint8_t)(~(mask << offset)); + if (value) + buf[idx] = (uint8_t)(buf[idx] | (mask << offset)); + else + buf[idx] &= (uint8_t)(~(mask << offset)); - idx++; - size -= nbits; - } /* end if */ + idx++; + size -= nbits; + } /* The middle bytes */ - while(size >= 8) { - buf[idx++] = value ? 0xff : 0x00; - size -= 8; - } /* end while */ + while (size >= 8) { + buf[idx++] = value ? 0xff : 0x00; + size -= 8; + } /* The last partial byte */ - if(size) { - if(value) - buf[idx] |= (uint8_t)(((unsigned)1 << size) - 1); - else - buf[idx] &= (uint8_t)(~(((unsigned)1 << size) - 1)); - } /* end if */ + if (size) { + if (value) + buf[idx] |= (uint8_t)(((unsigned)1 << size) - 1); + else + buf[idx] &= (uint8_t)(~(((unsigned)1 << size) - 1)); + } FUNC_LEAVE_NOAPI_VOID } /* end H5T__bit_set() */ /*------------------------------------------------------------------------- - * Function: H5T__bit_find + * Function: H5T__bit_find * - * Purpose: Finds the first bit with the specified VALUE within a region - * of a bit vector. The region begins at OFFSET and continues - * for SIZE bits, but the region can be searched from the least - * significat end toward the most significant end(H5T_BIT_LSB - * as DIRECTION), or from the most significant end to the least - * significant end(H5T_BIT_MSB as DIRECTION). + * Purpose: Finds the first bit with the specified VALUE within a region + * of a bit vector. The region begins at OFFSET and continues + * for SIZE bits, but the region can be searched from the least + * significat end toward the most significant end(H5T_BIT_LSB + * as DIRECTION), or from the most significant end to the least + * significant end(H5T_BIT_MSB as DIRECTION). * - * Return: Success: The position of the bit found, relative to - * the offset. + * Return: Success: The position of the bit found, relative to + * the offset. * - * Failure: -1 - * - * Programmer: Robb Matzke - * Wednesday, June 10, 1998 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -424,9 +400,9 @@ ssize_t H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value) { - ssize_t base = (ssize_t)offset; - ssize_t idx, i; - size_t iu; + ssize_t base = (ssize_t)offset; + ssize_t idx, i; + size_t iu; ssize_t ret_value = (-1); /* Return value */ /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ @@ -435,16 +411,16 @@ H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, /* Some functions call this with value=TRUE */ HDassert(TRUE == 1); - switch(direction) { + switch (direction) { case H5T_BIT_LSB: /* Calculate index */ idx = (ssize_t)(offset / 8); offset %= 8; /* Beginning */ - if(offset) { - for(iu = offset; iu < 8 && size > 0; iu++, size--) - if(value == (hbool_t)((buf[idx] >> iu) & 0x01)) + if (offset) { + for (iu = offset; iu < 8 && size > 0; iu++, size--) + if (value == (hbool_t)((buf[idx] >> iu) & 0x01)) HGOTO_DONE(8 * idx + (ssize_t)iu - base); offset = 0; @@ -452,10 +428,10 @@ H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, } /* end if */ /* Middle */ - while(size >= 8) { - if((value ? 0x00 : 0xff) != buf[idx]) - for(i = 0; i < 8; i++) - if(value == (hbool_t)((buf[idx] >> i) & 0x01)) + while (size >= 8) { + if ((value ? 0x00 : 0xff) != buf[idx]) + for (i = 0; i < 8; i++) + if (value == (hbool_t)((buf[idx] >> i) & 0x01)) HGOTO_DONE(8 * idx + i - base); size -= 8; @@ -463,8 +439,8 @@ H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, } /* end while */ /* End */ - for(i = 0; i < (ssize_t)size; i++) - if(value == (hbool_t)((buf[idx] >> i) & 0x01)) + for (i = 0; i < (ssize_t)size; i++) + if (value == (hbool_t)((buf[idx] >> i) & 0x01)) HGOTO_DONE(8 * idx + i - base); break; @@ -474,19 +450,19 @@ H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, offset %= 8; /* Beginning */ - if(size > 8 - offset && (offset + size) % 8) { - for(iu = (offset + size) % 8; iu > 0; --iu, --size) - if(value == (hbool_t)((buf[idx] >> (iu - 1)) & 0x01)) + if (size > 8 - offset && (offset + size) % 8) { + for (iu = (offset + size) % 8; iu > 0; --iu, --size) + if (value == (hbool_t)((buf[idx] >> (iu - 1)) & 0x01)) HGOTO_DONE(8 * idx + (ssize_t)(iu - 1) - base); --idx; } /* end if */ /* Middle */ - while(size >= 8) { - if((value ? 0x00 : 0xff) != buf[idx]) { - for(i = 7; i >= 0; --i) - if(value == (hbool_t)((buf[idx] >> i) & 0x01)) + while (size >= 8) { + if ((value ? 0x00 : 0xff) != buf[idx]) { + for (i = 7; i >= 0; --i) + if (value == (hbool_t)((buf[idx] >> i) & 0x01)) HGOTO_DONE(8 * idx + i - base); } /* end if */ @@ -495,11 +471,11 @@ H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, } /* end while */ /* End */ - if(size > 0) { - for(iu = offset + size; iu > offset; --iu) - if(value == (hbool_t)((buf[idx] >> (iu - 1)) & 0x01)) + if (size > 0) { + for (iu = offset + size; iu > offset; --iu) + if (value == (hbool_t)((buf[idx] >> (iu - 1)) & 0x01)) HGOTO_DONE(8 * idx + (ssize_t)(iu - 1) - base); - } /* end if */ + } break; default: @@ -519,17 +495,14 @@ done: * * Return: The carry-out value. TRUE if overflows, FALSE otherwise. * - * Programmer: Robb Matzke - * Friday, June 26, 1998 - * *------------------------------------------------------------------------- */ hbool_t H5T__bit_inc(uint8_t *buf, size_t start, size_t size) { - size_t idx = start / 8; - unsigned carry = 1; - unsigned acc, mask; + size_t idx = start / 8; + unsigned carry = 1; + unsigned acc, mask; /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ FUNC_ENTER_PACKAGE_NOERR @@ -539,7 +512,7 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size) start %= 8; /* The first partial byte */ - if(start) { + if (start) { if(size + start < 8) mask = ((unsigned)1 << size) - 1; else @@ -552,34 +525,34 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size) size -= MIN(size, 8 - start); start = 0; idx++; - } /* end if */ + } /* The middle */ - while(carry && size >= 8) { + while (carry && size >= 8) { acc = buf[idx]; acc++; carry = acc & 0x100; buf[idx] = acc & 0xff; idx++; size -= 8; - } /* end while */ + } /* The last bits */ - if(carry && size > 0) { + if (carry && size > 0) { mask = ((unsigned)1 << size) - 1; acc = buf[idx] & mask; acc++; carry = acc & ((unsigned)1 << size); buf[idx] &= (uint8_t)(~mask); buf[idx] |= (uint8_t)(acc & mask); - } /* end if */ + } FUNC_LEAVE_NOAPI(carry ? TRUE : FALSE) } /* end H5T__bit_inc() */ /*------------------------------------------------------------------------- - * Function: H5T__bit_dec + * Function: H5T__bit_dec * * Purpose: Decrement part of a bit field by substracting 1. The bit * field starts with bit position START and is SIZE bits long. @@ -587,18 +560,15 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size) * Return: The "borrow-in" value. It's TRUE if underflows, FALSE * otherwise. * - * Programmer: Raymond Lu - * March 17, 2004 - * *------------------------------------------------------------------------- */ hbool_t H5T__bit_dec(uint8_t *buf, size_t start, size_t size) { - size_t idx = start / 8; + size_t idx = start / 8; size_t pos = start % 8; uint8_t tmp; - unsigned borrow = 0; + unsigned borrow = 0; /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ FUNC_ENTER_PACKAGE_NOERR @@ -607,71 +577,72 @@ H5T__bit_dec(uint8_t *buf, size_t start, size_t size) HDassert(size); /* The first partial byte */ - if((size + start - 1) / 8 > idx) { /*bit sequence doesn't end in the same byte as starts*/ + if ((size + start - 1) / 8 > idx) { + /* The bit sequence doesn't end in the same byte as starts */ + /* Example: a sequence like 11000100 and start = 3. We substract 00001000 from * it and get 10111100. If a sequence is 00000111, we do right shift for START * bits and get 00000000. So we need to borrow from higher byte when we substract * 00001000. */ - if(!(buf[idx] >> pos)) + if (!(buf[idx] >> pos)) borrow = 1; buf[idx] = (uint8_t)(buf[idx] - (1 << pos)); idx++; size -= (8 - pos); /* The middle bytes */ - while(borrow && size >= 8) { - if(buf[idx]) + while (borrow && size >= 8) { + if (buf[idx]) borrow = 0; buf[idx]--; idx++; size -= 8; - } /* end while */ + } /* The last partial byte */ - if(borrow && size > 0) { + if (borrow && size > 0) { /* Similar to the first byte case, where sequence ends in the same byte as starts */ tmp = buf[idx]; buf[idx]--; - if((buf[idx] >> size) != tmp >> size) + if ((buf[idx] >> size) != tmp >> size) buf[idx] = (uint8_t)(buf[idx] + (1 << size)); - } /* end if */ - } /* end if */ - else { /* bit sequence ends in the same byte as starts */ + } + } + else { + /* The bit sequence ends in the same byte as starts */ + /* Example: a sequence like 11000100 and pos=3, size=3. We substract 00001000 * and get 10111100. A bit is borrowed from 6th bit(buf[idx]>>6=00000010, tmp>>6=00000011, * not equal). We need to put this bit back by increment 1000000. */ tmp = buf[idx]; buf[idx] = (uint8_t)(buf[idx] - (1 << pos)); - if((buf[idx] >> (pos + size)) != tmp >> (pos + size)) { + if ((buf[idx] >> (pos + size)) != tmp >> (pos + size)) { buf[idx] = (uint8_t)(buf[idx] + (1 << (pos + size))); borrow = 1; - } /* end if */ - } /* end else */ + } + } FUNC_LEAVE_NOAPI(borrow ? TRUE : FALSE) } /* end H5T__bit_dec() */ /*------------------------------------------------------------------------- - * Function: H5T__bit_neg - * - * Purpose: negate part of a bit sequence. The bit - * field starts with bit position START and is SIZE bits long. + * Function: H5T__bit_neg * - * Return: void + * Purpose: Negate part of a bit sequence. The bit field starts with + * bit position START and is SIZE bits long. * - * Programmer: Raymond Lu - * March 19, 2004 + * Return: void * *------------------------------------------------------------------------- */ void H5T__bit_neg(uint8_t *buf, size_t start, size_t size) { - size_t idx = start / 8; + size_t idx = start / 8; size_t pos = start % 8; uint8_t tmp[1]; @@ -695,17 +666,19 @@ H5T__bit_neg(uint8_t *buf, size_t start, size_t size) buf[idx] = (uint8_t)~(buf[idx]); idx++; size -= 8; - } /* end while */ + } /* The last partial byte */ if(size > 0) { /* Similar to the first byte case, where sequence ends in the same byte as starts */ tmp[0] = (uint8_t)~buf[idx]; H5T__bit_copy(&(buf[idx]), (size_t)0, tmp, (size_t)0, size); - } /* end if */ - } /* end if */ - else /* bit sequence ends in the same byte as starts */ + } + } + else { + /* bit sequence ends in the same byte as starts */ H5T__bit_copy(&(buf[idx]), pos, tmp, pos, size); + } FUNC_LEAVE_NOAPI_VOID } /* end H5T__bit_neg() */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 84a997e..3f4b489 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -4079,13 +4079,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, sp = dp = (uint8_t*)buf; direction = 1; olap = nelmts; - } else if (src_p->shared->size>=dst_p->shared->size) { + } + else if (src_p->shared->size>=dst_p->shared->size) { double olap_d = HDceil((double)(dst_p->shared->size)/ (double)(src_p->shared->size-dst_p->shared->size)); olap = (size_t)olap_d; sp = dp = (uint8_t*)buf; direction = 1; - } else { + } + else { double olap_d = HDceil((double)(src_p->shared->size)/ (double)(dst_p->shared->size-src_p->shared->size)); olap = (size_t)olap_d; @@ -4127,7 +4129,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (direction>0) { s = sp; d = elmtno= nelmts ? dbuf : dp; } @@ -4136,7 +4139,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (d==dbuf) { HDassert((dp>=sp && dpshared->size) || (sp>=dp && spshared->size)); - } else { + } + else { HDassert((dpshared->size<=sp) || (spshared->size<=dp)); } @@ -4154,7 +4158,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s[src_p->shared->size-(i+1)] = s[i]; s[i] = tmp1; } - } else if (H5T_ORDER_VAX==src.order) { + } + else if (H5T_ORDER_VAX==src.order) { tsize = src_p->shared->size; HDassert(0 == tsize % 2); @@ -4187,7 +4192,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_set (d, dst.u.f.epos, dst.u.f.esize, FALSE); H5T__bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); goto padding; - } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, + } + else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* +Inf or -Inf */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ @@ -4210,16 +4216,19 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, *this case.*/ if (H5T_NORM_NONE==dst.u.f.norm) H5T__bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, (size_t)1, TRUE); - } else if(except_ret == H5T_CONV_HANDLED) { + } + else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; goto next; - } else if(except_ret == H5T_CONV_ABORT) + } + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; } - } else if (H5T_NORM_NONE==src.u.f.norm && H5T__bit_find (s, src.u.f.mpos, src.u.f.msize-1, + } + else if (H5T_NORM_NONE==src.u.f.norm && H5T__bit_find (s, src.u.f.mpos, src.u.f.msize-1, H5T_BIT_LSB, TRUE)<0 && H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /*This is a special case for the source of no implied mantissa bit. @@ -4246,11 +4255,13 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, *this case.*/ if (H5T_NORM_NONE==dst.u.f.norm) H5T__bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, (size_t)1, TRUE); - } else if(except_ret == H5T_CONV_HANDLED) { + } + else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; goto next; - } else if(except_ret == H5T_CONV_ABORT) + } + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; @@ -4259,7 +4270,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * still need to handle legacy VAX files so this code must * remain in place. */ - } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, + } + else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* NaN */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ @@ -4275,11 +4287,13 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); H5T__bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, TRUE); - } else if(except_ret == H5T_CONV_HANDLED) { + } + else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; goto next; - } else if(except_ret == H5T_CONV_ABORT) + } + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; @@ -4292,7 +4306,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ expo = (int64_t)H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); - if(expo==0) + if (expo==0) denormalized=TRUE; /* @@ -4302,16 +4316,19 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, implied = 1; mpos = src.u.f.mpos; mrsh = 0; - if(0 == expo || H5T_NORM_NONE == src.u.f.norm) { - if((bitno = H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, TRUE)) > 0) { + if (0 == expo || H5T_NORM_NONE == src.u.f.norm) { + if ((bitno = H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, TRUE)) > 0) { msize = (size_t)bitno; - } else if (0==bitno) { + } + else if (0==bitno) { msize = 1; H5T__bit_set(s, src.u.f.mpos, (size_t)1, FALSE); } - } else if (H5T_NORM_IMPLIED==src.u.f.norm) { + } + else if (H5T_NORM_IMPLIED==src.u.f.norm) { msize = src.u.f.msize; - } else { + } + else { HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } @@ -4328,9 +4345,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (0==expo || H5T_NORM_NONE==src.u.f.norm) { HDassert(bitno>=0); expo -= (int64_t)((src.u.f.ebias - 1) + (src.u.f.msize - (size_t)bitno)); - } else if (H5T_NORM_IMPLIED==src.u.f.norm) { + } + else if (H5T_NORM_IMPLIED==src.u.f.norm) { expo -= (int64_t)src.u.f.ebias; - } else { + } + else { HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } @@ -4353,7 +4372,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, expo = 0; H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); msize = 0; - } else if (expo<=0) { + } + else if (expo<=0) { /* * The exponent is too small to fit in the exponent field, * but by shifting the mantissa to the right we can @@ -4363,7 +4383,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, mrsh += (size_t)(1 - expo); expo = 0; denormalized=TRUE; - } else if (expo>=expo_max) { + } + else if (expo>=expo_max) { /* * The exponent is too large to fit in the available region * or it results in the maximum possible value. Use positive @@ -4383,7 +4404,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, expo = expo_max; H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); msize = 0; - } else if(except_ret == H5T_CONV_ABORT) + } + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) { reverse = FALSE; @@ -4410,7 +4432,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(carry) implied = 2; } - } else if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && denormalized) + } + else if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && denormalized) /* For either source or destination, denormalized value doesn't increment carry.*/ H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno); } @@ -4422,13 +4445,16 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if (mrsh>dst.u.f.msize+1) { H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); - } else if (mrsh==dst.u.f.msize+1) { + } + else if (mrsh==dst.u.f.msize+1) { H5T__bit_set(d, dst.u.f.mpos+1, dst.u.f.msize-1, FALSE); H5T__bit_set(d, dst.u.f.mpos, (size_t)1, TRUE); - } else if (mrsh==dst.u.f.msize) { + } + else if (mrsh==dst.u.f.msize) { H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); H5T__bit_set_d(d, dst.u.f.mpos, MIN(2, dst.u.f.msize), (hsize_t)implied); - } else { + } + else { if (mrsh>0) { H5T__bit_set(d, dst.u.f.mpos+dst.u.f.msize-mrsh, mrsh, FALSE); @@ -4439,7 +4465,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_copy(d, dst.u.f.mpos, s, (mpos+msize+mrsh-dst.u.f.msize), dst.u.f.msize-mrsh); - } else { + } + else { H5T__bit_copy(d, dst.u.f.mpos+dst.u.f.msize-(mrsh+msize), s, mpos, msize); H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize-(mrsh+msize), @@ -4469,7 +4496,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(except_ret == H5T_CONV_UNHANDLED) { expo = expo_max; H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); - } else if(except_ret == H5T_CONV_ABORT) + } + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) { reverse = FALSE; -- cgit v0.12 From 2e80fbbfcc5a15c296c16e4a4295ce77a9af6587 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 30 Nov 2017 17:25:39 -0800 Subject: Fixed an incorrect FUNC_ENTER macro. --- src/H5L.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5L.c b/src/H5L.c index afd033a..07f3cdb 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -2896,7 +2896,7 @@ H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) H5L_trav_le_t udata; /* User data for traversal */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_NOAPI(FAIL) /* A path of "/" will always exist in a file */ if(0 == HDstrcmp(name, "/")) -- cgit v0.12 From 4a15b32a42f3f22773290e04f898d212e572dae0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 1 Dec 2017 13:36:23 -0600 Subject: H5detect and H5make_libsettings need include folder --- src/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b163b8a..ab06ce8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -849,6 +849,9 @@ endif () #----------------------------------------------------------------------------- add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) TARGET_C_PROPERTIES (H5detect STATIC " " " ") +if (H5_HAVE_PARALLEL AND MPI_C_FOUND) + target_include_directories (H5detect PUBLIC ${MPI_C_INCLUDE_DIRS}) +endif () if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") endif () @@ -863,6 +866,9 @@ add_custom_command ( add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") +if (H5_HAVE_PARALLEL AND MPI_C_FOUND) + target_include_directories (H5make_libsettings PUBLIC ${MPI_C_INCLUDE_DIRS}) +endif () if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") endif () -- cgit v0.12 From e416d374935430e94ebc8d7f3917b2a0b1f82967 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 12:18:13 -0600 Subject: exported global variables for windows --- fortran/src/H5f90global.F90 | 4 +- fortran/src/hdf5_fortrandll.def.in | 329 +++++++++++++++++++++++++++++++++++++ 2 files changed, 331 insertions(+), 2 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 0247ad8..9054522 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -139,7 +139,7 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:NUM_NATIVE_INTEGER_KIND) :: H5T_NATIVE_INTEGER_KIND INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- - + ! ! H5generic flags declaration ! INTEGER :: H5_INDEX_UNKNOWN_F @@ -258,7 +258,7 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_GHEAP_F INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F - INTEGER :: H5FD_MEM_NTYPES_F=-1 + INTEGER :: H5FD_MEM_NTYPES_F INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 43a802c..3903c8b 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,6 +1,335 @@ EXPORTS ; H5GLOBAL +H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT +H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE +H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE +H5GLOBAL_mp_H5T_NATIVE_INTEGER +H5GLOBAL_mp_H5T_NATIVE_REAL +H5GLOBAL_mp_H5T_NATIVE_DOUBLE +H5GLOBAL_mp_H5T_NATIVE_CHARACTER +H5GLOBAL_mp_H5T_STD_REF_OBJ +H5GLOBAL_mp_H5T_STD_REF_DSETREG +H5GLOBAL_mp_H5T_IEEE_F32BE +H5GLOBAL_mp_H5T_IEEE_F32LE +H5GLOBAL_mp_H5T_IEEE_F64BE +H5GLOBAL_mp_H5T_IEEE_F64LE +H5GLOBAL_mp_H5T_STD_I8BE +H5GLOBAL_mp_H5T_STD_I8LE +H5GLOBAL_mp_H5T_STD_I16BE +H5GLOBAL_mp_H5T_STD_I16LE +H5GLOBAL_mp_H5T_STD_I32BE +H5GLOBAL_mp_H5T_STD_I32LE +H5GLOBAL_mp_H5T_STD_I64BE +H5GLOBAL_mp_H5T_STD_I64LE +H5GLOBAL_mp_H5T_STD_U8BE +H5GLOBAL_mp_H5T_STD_U8LE +H5GLOBAL_mp_H5T_STD_U16BE +H5GLOBAL_mp_H5T_STD_U16LE +H5GLOBAL_mp_H5T_STD_U32BE +H5GLOBAL_mp_H5T_STD_U32LE +H5GLOBAL_mp_H5T_STD_U64BE +H5GLOBAL_mp_H5T_STD_U64LE +H5GLOBAL_mp_H5T_STRING +H5GLOBAL_mp_H5T_STD_B8BE +H5GLOBAL_mp_H5T_STD_B8LE +H5GLOBAL_mp_H5T_STD_B16BE +H5GLOBAL_mp_H5T_STD_B16LE +H5GLOBAL_mp_H5T_STD_B32BE +H5GLOBAL_mp_H5T_STD_B32LE +H5GLOBAL_mp_H5T_STD_B64BE +H5GLOBAL_mp_H5T_STD_B64LE +H5GLOBAL_mp_H5T_NATIVE_B8 +H5GLOBAL_mp_H5T_NATIVE_B16 +H5GLOBAL_mp_H5T_NATIVE_B32 +H5GLOBAL_mp_H5T_NATIVE_B64 +H5GLOBAL_mp_H5T_FORTRAN_S1 +H5GLOBAL_mp_H5T_C_S1 +H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 +; +; H5generic flags declaration +; +H5GLOBAL_mp_H5_INDEX_UNKNOWN_F +H5GLOBAL_mp_H5_INDEX_NAME_F +H5GLOBAL_mp_H5_INDEX_CRT_ORDER_F +H5GLOBAL_mp_H5_INDEX_N_F +H5GLOBAL_mp_H5_ITER_UNKNOWN_F +H5GLOBAL_mp_H5_ITER_INC_F +H5GLOBAL_mp_H5_ITER_DEC_F +H5GLOBAL_mp_H5_ITER_NATIVE_F +H5GLOBAL_mp_H5_ITER_N_F +H5GLOBAL_mp_HADDR_UNDEF_F +; +; H5F flags declaration +; +H5GLOBAL_mp_H5F_ACC_RDWR_F +H5GLOBAL_mp_H5F_ACC_RDONLY_F +H5GLOBAL_mp_H5F_ACC_TRUNC_F +H5GLOBAL_mp_H5F_ACC_EXCL_F +H5GLOBAL_mp_H5F_ACC_DEBUG_F +H5GLOBAL_mp_H5F_SCOPE_LOCAL_F +H5GLOBAL_mp_H5F_SCOPE_GLOBAL_F +H5GLOBAL_mp_H5F_CLOSE_DEFAULT_F +H5GLOBAL_mp_H5F_CLOSE_WEAK_F +H5GLOBAL_mp_H5F_CLOSE_SEMI_F +H5GLOBAL_mp_H5F_CLOSE_STRONG_F +H5GLOBAL_mp_H5F_OBJ_FILE_F +H5GLOBAL_mp_H5F_OBJ_DATASET_F +H5GLOBAL_mp_H5F_OBJ_GROUP_F +H5GLOBAL_mp_H5F_OBJ_DATATYPE_F +H5GLOBAL_mp_H5F_OBJ_ALL_F +H5GLOBAL_mp_H5F_LIBVER_EARLIEST_F +H5GLOBAL_mp_H5F_LIBVER_LATEST_F +H5GLOBAL_mp_H5F_UNLIMITED_F +; +; H5G flags declaration +; +H5GLOBAL_mp_H5G_UNKNOWN_F +H5GLOBAL_mp_H5G_GROUP_F +H5GLOBAL_mp_H5G_DATASET_F +H5GLOBAL_mp_H5G_TYPE_F +H5GLOBAL_mp_H5G_LINK_F +H5GLOBAL_mp_H5G_UDLINK_F +H5GLOBAL_mp_H5G_SAME_LOC_F +H5GLOBAL_mp_H5G_LINK_ERROR_F +H5GLOBAL_mp_H5G_LINK_HARD_F +H5GLOBAL_mp_H5G_LINK_SOFT_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_UNKNOWN_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_SYMBOL_TABLE_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_COMPACT_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_DENSE_F +; +; H5D flags declaration +; +H5GLOBAL_mp_H5D_COMPACT_F +H5GLOBAL_mp_H5D_CONTIGUOUS_F +H5GLOBAL_mp_H5D_CHUNKED_F +H5GLOBAL_mp_H5D_ALLOC_TIME_ERROR_F +H5GLOBAL_mp_H5D_ALLOC_TIME_DEFAULT_F +H5GLOBAL_mp_H5D_ALLOC_TIME_EARLY_F +H5GLOBAL_mp_H5D_ALLOC_TIME_LATE_F +H5GLOBAL_mp_H5D_ALLOC_TIME_INCR_F +H5GLOBAL_mp_H5D_SPACE_STS_ERROR_F +H5GLOBAL_mp_H5D_SPACE_STS_NOT_ALLOCATED_F +H5GLOBAL_mp_H5D_SPACE_STS_PART_ALLOCATED_F +H5GLOBAL_mp_H5D_SPACE_STS_ALLOCATED_F +H5GLOBAL_mp_H5D_FILL_TIME_ERROR_F +H5GLOBAL_mp_H5D_FILL_TIME_ALLOC_F +H5GLOBAL_mp_H5D_FILL_TIME_NEVER_F +H5GLOBAL_mp_H5D_FILL_VALUE_ERROR_F +H5GLOBAL_mp_H5D_FILL_VALUE_UNDEFINED_F +H5GLOBAL_mp_H5D_FILL_VALUE_DEFAULT_F +H5GLOBAL_mp_H5D_FILL_VALUE_USER_DEFINED_F +H5GLOBAL_mp_H5D_CHUNK_CACHE_NSLOTS_DFLT_F +H5GLOBAL_mp_H5D_CHUNK_CACHE_NBYTES_DFLT_F +H5GLOBAL_mp_H5D_CHUNK_CACHE_W0_DFLT_F +H5GLOBAL_mp_H5D_MPIO_NO_COLLECTIVE_F +H5GLOBAL_mp_H5D_MPIO_CHUNK_INDEPENDENT_F +H5GLOBAL_mp_H5D_MPIO_CHUNK_COLLECTIVE_F +H5GLOBAL_mp_H5D_MPIO_CHUNK_MIXED_F +H5GLOBAL_mp_H5D_MPIO_CONTIG_COLLECTIVE_F +H5GLOBAL_mp_H5D_VDS_ERROR_F +H5GLOBAL_mp_H5D_VDS_FIRST_MISSING_F +H5GLOBAL_mp_H5D_VDS_LAST_AVAILABLE_F +H5GLOBAL_mp_H5D_VIRTUAL_F +; +; H5E flags declaration +; +H5GLOBAL_mp_H5E_DEFAULT_F +H5GLOBAL_mp_H5E_MAJOR_F +H5GLOBAL_mp_H5E_MINOR_F +H5GLOBAL_mp_H5E_WALK_UPWARD_F +H5GLOBAL_mp_H5E_WALK_DOWNWARD_F +; +; H5FD file drivers flags declaration +; +H5GLOBAL_mp_H5FD_MPIO_INDEPENDENT_F +H5GLOBAL_mp_H5FD_MPIO_COLLECTIVE_F +H5GLOBAL_mp_H5FD_MEM_NOLIST_F +H5GLOBAL_mp_H5FD_MEM_DEFAULT_F +H5GLOBAL_mp_H5FD_MEM_SUPER_F +H5GLOBAL_mp_H5FD_MEM_BTREE_F +H5GLOBAL_mp_H5FD_MEM_DRAW_F +H5GLOBAL_mp_H5FD_MEM_GHEAP_F +H5GLOBAL_mp_H5FD_MEM_LHEAP_F +H5GLOBAL_mp_H5FD_MEM_OHDR_F H5GLOBAL_mp_H5FD_MEM_NTYPES_F +H5GLOBAL_mp_H5FD_CORE_F +H5GLOBAL_mp_H5FD_FAMILY_F +H5GLOBAL_mp_H5FD_LOG_F +H5GLOBAL_mp_H5FD_MPIO_F +H5GLOBAL_mp_H5FD_MULTI_F +H5GLOBAL_mp_H5FD_SEC2_F +H5GLOBAL_mp_H5FD_STDIO_F +; +; H5I flags declaration +; +H5GLOBAL_mp_H5I_FILE_F +H5GLOBAL_mp_H5I_GROUP_F +H5GLOBAL_mp_H5I_DATATYPE_F +H5GLOBAL_mp_H5I_DATASPACE_F +H5GLOBAL_mp_H5I_DATASET_F +H5GLOBAL_mp_H5I_ATTR_F +H5GLOBAL_mp_H5I_BADID_F +; +; H5L flags declaration +; +H5GLOBAL_mp_H5L_TYPE_ERROR_F +H5GLOBAL_mp_H5L_TYPE_HARD_F +H5GLOBAL_mp_H5L_TYPE_SOFT_F +H5GLOBAL_mp_H5L_TYPE_EXTERNAL_F +H5GLOBAL_mp_H5L_SAME_LOC_F +H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F +; +; H5O flags declaration +; +H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO +H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE +H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER +H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F ! TO STAY UNDER THE +H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F +H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F +H5GLOBAL_mp_H5O_COPY_ALL_F +H5GLOBAL_mp_H5O_SHMESG_NONE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_SDSPACE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_DTYPE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_FILL_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F +H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F ! 32 CHARACTER +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F ! VARIABLE +H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F ! LENGTH *** +H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F +H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F +H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F +H5GLOBAL_mp_H5O_SHMESG_MAX_LIST_SIZE_F +H5GLOBAL_mp_H5O_TYPE_UNKNOWN_F +H5GLOBAL_mp_H5O_TYPE_GROUP_F +H5GLOBAL_mp_H5O_TYPE_DATASET_F +H5GLOBAL_mp_H5O_TYPE_NAMED_DATATYPE_F +H5GLOBAL_mp_H5O_TYPE_NTYPES_F +; +; H5P flags declaration +; +H5GLOBAL_mp_H5P_FILE_CREATE_F +H5GLOBAL_mp_H5P_FILE_ACCESS_F +H5GLOBAL_mp_H5P_DATASET_CREATE_F +H5GLOBAL_mp_H5P_DATASET_XFER_F +H5GLOBAL_mp_H5P_FILE_MOUNT_F +H5GLOBAL_mp_H5P_DEFAULT_F +H5GLOBAL_mp_H5P_ROOT_F +H5GLOBAL_mp_H5P_OBJECT_CREATE_F +H5GLOBAL_mp_H5P_DATASET_ACCESS_F +H5GLOBAL_mp_H5P_GROUP_CREATE_F +H5GLOBAL_mp_H5P_GROUP_ACCESS_F +H5GLOBAL_mp_H5P_DATATYPE_CREATE_F +H5GLOBAL_mp_H5P_DATATYPE_ACCESS_F +H5GLOBAL_mp_H5P_STRING_CREATE_F +H5GLOBAL_mp_H5P_ATTRIBUTE_CREATE_F +H5GLOBAL_mp_H5P_OBJECT_COPY_F +H5GLOBAL_mp_H5P_LINK_CREATE_F +H5GLOBAL_mp_H5P_LINK_ACCESS_F +H5GLOBAL_mp_H5P_CRT_ORDER_INDEXED_F +H5GLOBAL_mp_H5P_CRT_ORDER_TRACKED_F +; +; H5R flags declaration +; +H5GLOBAL_mp_H5R_OBJECT_F +H5GLOBAL_mp_H5R_DATASET_REGION_F +; +; H5S flags declaration +; +H5GLOBAL_mp_H5S_UNLIMITED_F +H5GLOBAL_mp_H5S_ALL_F +H5GLOBAL_mp_H5S_SCALAR_F +H5GLOBAL_mp_H5S_SIMPLE_F +H5GLOBAL_mp_H5S_NULL_F +H5GLOBAL_mp_H5S_SELECT_NOOP_F +H5GLOBAL_mp_H5S_SELECT_SET_F +H5GLOBAL_mp_H5S_SELECT_OR_F +H5GLOBAL_mp_H5S_SELECT_AND_F +H5GLOBAL_mp_H5S_SELECT_XOR_F +H5GLOBAL_mp_H5S_SELECT_NOTB_F +H5GLOBAL_mp_H5S_SELECT_NOTA_F +H5GLOBAL_mp_H5S_SELECT_APPEND_F +H5GLOBAL_mp_H5S_SELECT_PREPEND_F +H5GLOBAL_mp_H5S_SELECT_INVALID_F +H5GLOBAL_mp_H5S_SEL_ERROR_F +H5GLOBAL_mp_H5S_SEL_NONE_F +H5GLOBAL_mp_H5S_SEL_POINTS_F +H5GLOBAL_mp_H5S_SEL_HYPERSLABS_F +H5GLOBAL_mp_H5S_SEL_ALL_F +; +; H5T flags declaration +; +H5GLOBAL_mp_H5T_NO_CLASS_F +H5GLOBAL_mp_H5T_INTEGER_F +H5GLOBAL_mp_H5T_FLOAT_F +H5GLOBAL_mp_H5T_TIME_F +H5GLOBAL_mp_H5T_STRING_F +H5GLOBAL_mp_H5T_BITFIELD_F +H5GLOBAL_mp_H5T_OPAQUE_F +H5GLOBAL_mp_H5T_COMPOUND_F +H5GLOBAL_mp_H5T_REFERENCE_F +H5GLOBAL_mp_H5T_ENUM_F +H5GLOBAL_mp_H5T_VLEN_F +H5GLOBAL_mp_H5T_ARRAY_F +H5GLOBAL_mp_H5T_ORDER_LE_F +H5GLOBAL_mp_H5T_ORDER_BE_F +H5GLOBAL_mp_H5T_ORDER_VAX_F +H5GLOBAL_mp_H5T_ORDER_NONE_F +H5GLOBAL_mp_H5T_ORDER_MIXED_F +H5GLOBAL_mp_H5T_PAD_ZERO_F +H5GLOBAL_mp_H5T_PAD_ONE_F +H5GLOBAL_mp_H5T_PAD_BACKGROUND_F +H5GLOBAL_mp_H5T_PAD_ERROR_F +H5GLOBAL_mp_H5T_SGN_NONE_F +H5GLOBAL_mp_H5T_SGN_2_F +H5GLOBAL_mp_H5T_SGN_ERROR_F +H5GLOBAL_mp_H5T_NORM_IMPLIED_F +H5GLOBAL_mp_H5T_NORM_MSBSET_F +H5GLOBAL_mp_H5T_NORM_NONE_F +H5GLOBAL_mp_H5T_CSET_ASCII_F +H5GLOBAL_mp_H5T_CSET_UTF8_F +H5GLOBAL_mp_H5T_STR_NULLTERM_F +H5GLOBAL_mp_H5T_STR_NULLPAD_F +H5GLOBAL_mp_H5T_STR_SPACEPAD_F +H5GLOBAL_mp_H5T_STR_ERROR_F +H5GLOBAL_mp_H5T_DIR_ASCEND_F +H5GLOBAL_mp_H5T_DIR_DESCEND_F +; +; H5Z flags declaration +; +H5GLOBAL_mp_H5Z_FILTER_ERROR_F +H5GLOBAL_mp_H5Z_FILTER_NONE_F +H5GLOBAL_mp_H5Z_FILTER_ALL_F +H5GLOBAL_mp_H5Z_FILTER_DEFLATE_F +H5GLOBAL_mp_H5Z_FILTER_SHUFFLE_F +H5GLOBAL_mp_H5Z_FILTER_FLETCHER32_F +H5GLOBAL_mp_H5Z_FILTER_SZIP_F +H5GLOBAL_mp_H5Z_ERROR_EDC_F +H5GLOBAL_mp_H5Z_DISABLE_EDC_F +H5GLOBAL_mp_H5Z_ENABLE_EDC_F +H5GLOBAL_mp_H5Z_NO_EDC_F +H5GLOBAL_mp_H5Z_FLAG_OPTIONAL_F +H5GLOBAL_mp_H5Z_FILTER_ENCODE_ENABLED_F +H5GLOBAL_mp_H5Z_FILTER_DECODE_ENABLED_F +H5GLOBAL_mp_H5Z_FILTER_NBIT_F +H5GLOBAL_mp_H5Z_FILTER_SCALEOFFSET_F +H5GLOBAL_mp_H5Z_SO_FLOAT_DSCALE_F +H5GLOBAL_mp_H5Z_SO_FLOAT_ESCALE_F +H5GLOBAL_mp_H5Z_SO_INT_F +H5GLOBAL_mp_H5Z_SO_INT_MINBITS_DEFAULT_F +; +; H5 Library flags declaration +; +H5GLOBAL_mp_H5_SZIP_EC_OM_F +H5GLOBAL_mp_H5_SZIP_NN_OM_F +; +; PROCEDURES +; -------------- +; ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F -- cgit v0.12 From e33d677636b860f8f6b95c0ee3736395541a2610 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 4 Dec 2017 12:21:12 -0600 Subject: Various code cleanup Description: - Replaced H5Location::exists with H5Location::nameExists and marked H5Location::exists as deprecated. - Miscellaneous test cleanup for consistency. Platforms tested: Linux/32 2.6 (jam) Linux/64 (jelly) Darwin (osx1010test) --- c++/src/H5DataType.cpp | 2 +- c++/src/H5DataType.h | 11 +- c++/src/H5IntType.cpp | 2 +- c++/src/H5Location.cpp | 44 ++++++- c++/src/H5Location.h | 5 + c++/test/dsets.cpp | 70 +++-------- c++/test/h5cpputil.cpp | 9 -- c++/test/tarray.cpp | 58 ++++----- c++/test/tattr.cpp | 320 +++++++++++++++++++++++++++++-------------------- c++/test/tcompound.cpp | 34 +----- c++/test/tdspl.cpp | 22 +++- c++/test/tfile.cpp | 49 ++++---- c++/test/tfilter.cpp | 33 ++--- c++/test/th5s.cpp | 38 +++--- c++/test/titerate.cpp | 59 ++++----- c++/test/tlinks.cpp | 20 ++-- c++/test/tobject.cpp | 57 +++++---- c++/test/trefer.cpp | 116 +++++++++--------- c++/test/ttypes.cpp | 51 +++----- c++/test/tvlstr.cpp | 64 +++++----- 20 files changed, 521 insertions(+), 543 deletions(-) diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index d2bfbda..444a77a 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -899,7 +899,7 @@ 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(inMemFunc("constructor"), "H5Topen2 failed"); return(ret_value); } diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 5b8f924..906ccef 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -36,6 +36,10 @@ class H5_DLLCPP DataType : public H5Object { // Creates a copy of a predefined type DataType(const PredType& pred_type); + // 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); + // 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); @@ -124,13 +128,6 @@ class H5_DLLCPP DataType : public H5Object { ///\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); - -// End of From CommonFG then H5Location - // Creates a copy of an existing DataType using its id DataType(const hid_t type_id); diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index ef4e1a9..f68e858 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -117,7 +117,7 @@ IntType::IntType(const H5Location& loc, const char *dtype_name) : AtomType() // Programmer Binh-Minh Ribler - Dec 2016 // Description // In 1.10.1, this constructor was introduced and may replace the -// existing function CommonFG::openArrayType(const H5std_string&) +// existing function CommonFG::openIntType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index a00e181..d0b5f9d 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -76,15 +76,15 @@ H5Location::H5Location() : IdComponent() {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::exists +// Function: H5Location::nameExists ///\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 +// Renamed from exists() in 1.10.2 -BMR //-------------------------------------------------------------------------- -bool H5Location::exists(const char* name, const LinkAccPropList& lapl) const +bool H5Location::nameExists(const char* name, const LinkAccPropList& lapl) const { htri_t ret_value = H5Lexists(getId(), name, lapl.getId()); if (ret_value > 0) @@ -93,22 +93,54 @@ bool H5Location::exists(const char* name, const LinkAccPropList& lapl) const return false; else // Raise exception when H5Lexists returns a negative value { - throw LocationException(inMemFunc("exists"), "H5Lexists failed"); + throw LocationException(inMemFunc("nameExists"), "H5Lexists failed"); } } //-------------------------------------------------------------------------- -// Function: H5Location::exists +// Function: H5Location::nameExists ///\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 +// Modification +// Renamed from exists() in 1.10.2 -BMR +//-------------------------------------------------------------------------- +bool H5Location::nameExists(const H5std_string& name, const LinkAccPropList& lapl) const +{ + return(nameExists(name.c_str(), lapl)); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::exists - Deprecated +// Purpose Checks if a link of a given name exists in a location +///\brief Deprecated in favor of nameExists +///\param name - IN: Searched name +///\param lapl - IN: Link access property list +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Nov, 2016 +// Modification +// Renamed to nameExists() in 1.10.2 -BMR +//-------------------------------------------------------------------------- +bool H5Location::exists(const char* name, const LinkAccPropList& lapl) const +{ + return(nameExists(name, lapl)); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::exists - Deprecated +// Purpose Checks if a link of a given name exists in a location +///\brief Deprecated in favor of nameExists +///\param name - IN: Searched name +///\param lapl - IN: Link access property list +///\exception H5::LocationException // Programmer Binh-Minh Ribler - Dec, 2016 // Modification +// Renamed to nameExists() in 1.10.2 -BMR //-------------------------------------------------------------------------- bool H5Location::exists(const H5std_string& name, const LinkAccPropList& lapl) const { - return(exists(name.c_str(), lapl)); + return(nameExists(name.c_str(), lapl)); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 2631169..e5fbc84 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -31,6 +31,11 @@ namespace H5 { class H5_DLLCPP H5Location : public IdComponent { public: // Checks if a link of a given name exists in a location + bool nameExists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + bool nameExists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Checks if a link of a given name exists in a location + // Deprecated in favor of nameExists for better name. bool exists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; bool exists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index a765fb1..250ce90 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -66,13 +66,9 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, * * Programmer Binh-Minh Ribler (using C version) * Friday, January 5, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_create( H5File& file) +static herr_t test_create( H5File& file) { SUBTEST("Create, open, close"); @@ -198,13 +194,9 @@ test_create( H5File& file) * * Programmer Binh-Minh Ribler (using C version) * Friday, January 5, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_simple_io( H5File& file) +static herr_t test_simple_io( H5File& file) { SUBTEST("Simple I/O"); @@ -284,13 +276,9 @@ test_simple_io( H5File& file) * * Programmer Binh-Minh Ribler * Thursday, March 22, 2012 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_datasize(FileAccPropList &fapl) +static herr_t test_datasize(FileAccPropList &fapl) { SUBTEST("DataSet::getInMemDataSize()"); try @@ -354,13 +342,9 @@ test_datasize(FileAccPropList &fapl) * * Programmer Binh-Minh Ribler (using C version) * Friday, January 5, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_tconv(H5File& file) +static herr_t test_tconv(H5File& file) { // Prepare buffers for input/output char *out=NULL, *in=NULL; @@ -437,6 +421,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ (H5Z_func_t)filter_bogus, /* The actual filter function */ }}; + /*------------------------------------------------------------------------- * Function: bogus * @@ -448,13 +433,9 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ * * Programmer Robb Matzke * Tuesday, April 21, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static size_t -filter_bogus(unsigned int flags, size_t cd_nelmts, +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) // H5_ATTR_UNUSED variables caused warning, but taking them out caused failure. @@ -477,13 +458,9 @@ filter_bogus(unsigned int flags, size_t cd_nelmts, * * Programmer Binh-Minh Ribler (using C version) * Friday, January 5, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_compression(H5File& file) +static herr_t test_compression(H5File& file) { #ifndef H5_HAVE_FILTER_DEFLATE const char *not_supported; @@ -764,9 +741,10 @@ test_compression(H5File& file) * *------------------------------------------------------------------------- */ -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) { typedef struct { @@ -880,13 +858,9 @@ static herr_t test_nbit_compression(H5File& file) * * Programmer Binh-Minh Ribler (using C version) * Saturday, February 17, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_multiopen (H5File& file) +static herr_t test_multiopen (H5File& file) { SUBTEST("Multi-open with extending"); @@ -963,13 +937,9 @@ test_multiopen (H5File& file) * * Programmer Binh-Minh Ribler (using C version) * February 17, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_types(H5File& file) +static herr_t test_types(H5File& file) { SUBTEST("Various datatypes"); @@ -1148,23 +1118,21 @@ test_types(H5File& file) /*------------------------------------------------------------------------- * Function: test_virtual * - * Purpose: Tests fixed, unlimited, and printf selections in the same + * Purpose Tests fixed, unlimited, and printf selections in the same * VDS * - * Return: Success: 0 + * Return Success: 0 * * Failure: number of errors * - * Programmer: Binh-Minh Ribler + * Programmer Binh-Minh Ribler * Friday, March 10, 2017 * - * Modifications: - * *------------------------------------------------------------------------- */ const int RANK = 2; -static herr_t -test_virtual() + +static herr_t test_virtual() { SUBTEST("DSetCreatPropList::setVirtual"); @@ -1293,17 +1261,15 @@ void test_dset() cleanup_dsets(); } // test_dset + /*------------------------------------------------------------------------- * Function: cleanup_dsets * * Purpose Cleanup temporary test files * - * Return none + * Return None * * Programmer (use C version) - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index f0c403c..f271eed 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -47,9 +47,6 @@ using namespace H5; * * Programmer Binh-Minh Ribler (using C code segment for reporting tests) * Friday, February 6, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ int test_report( int nerrors, const H5std_string& testname ) @@ -135,9 +132,6 @@ void issue_fail_msg(const char* where, int line, const char* file_name, * * Programmer Binh-Minh Ribler (using C code segment for checking values) * Friday, February 6, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ int check_values (hsize_t i, hsize_t j, int apoint, int acheck) @@ -191,9 +185,6 @@ void check_values(const char *value, const char* msg, int line, const char* file * * Programmer Binh-Minh Ribler * May 2, 2010 - * - * Modifications: - * *------------------------------------------------------------------------- */ void verify_val(const char* x, const char* value, const char* where, int line, const char* file_name) diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index a1de9c5..6bd4ca6 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -53,13 +53,10 @@ typedef enum int_t { * * Purpose Tests 1-D array of compound datatypes (with array fields) * - * Return None. + * Return None * * Programmer Binh-Minh Ribler (using C version) * January, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_array_compound_array() @@ -280,35 +277,33 @@ static void test_array_compound_array() } // end test_array_compound_array() +/* + * Helper routine to demonstrate the issue in HDFFV-9562 + */ +H5::DataType getArr() +{ + hsize_t *dims = new hsize_t; + *dims = 5; + H5::ArrayType ret; + ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims); + delete[] dims; + return ret; +} + /*------------------------------------------------------------------------- * Function: test_array_assignment * * Purpose Tests the operator= * - * Return None. + * Return None * * Programmer Binh-Minh Ribler (using C version) * March, 2016 * * Description: * Used user's sample code in HDFFV-9562 - * - * Modifications: - * *------------------------------------------------------------------------- */ -/* - * Helper routine to demonstrate the issue in HDFFV-9562 - */ -H5::DataType getArr() -{ - hsize_t *dims = new hsize_t; - *dims = 5; - H5::ArrayType ret; - ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims); - delete[] dims; - return ret; } - static void test_array_assignment() { hsize_t sdims1[] = {SPACE1_DIM1}; @@ -359,13 +354,10 @@ static void test_array_assignment() * * Purpose Tests getting array information using the const methods. * - * Return None. + * Return None * * Programmer Binh-Minh Ribler * April, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_array_info() @@ -477,11 +469,14 @@ static void test_array_info() } // end test_array_info() -/**************************************************************** -** -** test_array(): Main datatypes testing routine. -** -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_array + * + * Purpose Main datatypes testing routine + * + * Return None + *------------------------------------------------------------------------- + */ extern "C" void test_array() { @@ -505,13 +500,10 @@ void test_array() * * Purpose Cleanup temporary test files * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * January, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index d1a0d67..5aa4bf5 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -101,12 +101,15 @@ float attr_data5 = (float)-5.123; // Test data for 5th attribute const H5std_string ATTR1A_NAME("Attr1_a"); int attr_data1a[ATTR1_DIM1]={256,11945,-22107}; -/**************************************************************** -** -** test_attr_basic_write(): Test basic write attribute. -** Tests integer attributes on both datasets and groups -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_basic_write + * + * Purpose Test basic write attribute on both datasets and groups. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_basic_write() { hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; @@ -233,29 +236,34 @@ static void test_attr_basic_write() } } // test_attr_basic_write() -/**************************************************************** -** -** test_attr_getname(): Test getting attribute name functions. -** -** Test these functions: -** A. ssize_t Attribute::getName(char* attr_name, size_t buf_size) -** 1. With arbitrary buf_size that is larger than the name size -** 2. With arbitrary buf_size that is smaller than the name's length. -** 3. With a buf_size that equals the name's length. -** -** B. ssize_t Attribute::getName(H5std_string& attr_name, size_t buf_size) -** 1. With buffer smaller than the actual name -** 2. Same test but with retiring overloaded function -** ssize_t Attribute::getName(size_t buf_size, H5std_string& attr_name) -** -** C. H5std_string Attribute::getName() -** -** D. H5std_string Attribute::getName(size_t len) -** -** E. ssize_t Attribute::getName(H5std_string& attr_name, size_t buf_size) -** With buffer size equals the name's length, i.e., buf_size=0 -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_getname + * + * Purpose Test getting attribute name. + * + * Description + * Test these functions: + * A. ssize_t Attribute::getName(char* attr_name, size_t buf_size) + * 1. With arbitrary buf_size that is larger than the name size + * 2. With arbitrary buf_size that is smaller than the name's length. + * 3. With a buf_size that equals the name's length. + * + * B. ssize_t Attribute::getName(H5std_string& attr_name, size_t buf_size) + * 1. With buffer smaller than the actual name + * 2. Same test but with retiring overloaded function + * ssize_t Attribute::getName(size_t buf_size, H5std_string& attr_name) + * + * C. H5std_string Attribute::getName() + * + * D. H5std_string Attribute::getName(size_t len) + * + * E. ssize_t Attribute::getName(H5std_string& attr_name, size_t buf_size) + * With buffer size equals the name's length, i.e., buf_size=0 + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_getname() { // Output message about test being performed @@ -368,11 +376,15 @@ static void test_attr_getname() } } // test_attr_getname() -/**************************************************************** -** -** test_attr_rename(): Test renaming attribute function. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_rename + * + * Purpose Test renaming attribute function. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_rename() { int read_data1[ATTR1_DIM1]={0}; // Buffer for reading the attribute @@ -479,11 +491,15 @@ static void test_attr_rename() } } // test_attr_rename() -/******************************************************************** -** -** test_attr_basic_read(): Test basic read attribute. -** -********************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_basic_read + * + * Purpose Test basic read attribute. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_basic_read() { hsize_t i, j; @@ -548,11 +564,15 @@ static void test_attr_basic_read() } } // test_attr_basic_read() -/**************************************************************** -** -** test_attr_compound_write(): Tests compound datatype attributes -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_compound_write + * + * Purpose Test writing attributes with compound datatype. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_compound_write() { @@ -608,11 +628,15 @@ static void test_attr_compound_write() } } // test_attr_compound_write() -/**************************************************************** -** -** test_attr_compound_read(): Test basic H5A (attribute) code. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_compound_read + * + * Purpose Test reading attributes with compound datatype. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_compound_read() { hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions @@ -760,11 +784,15 @@ static void test_attr_compound_read() } } // test_attr_compound_read() -/**************************************************************** -** -** test_attr_scalar_write(): Test scalar attribute writing functionality. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_scalar_write + * + * Purpose Test scalar attribute writing functionality. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_scalar_write() { // Output message about test being performed @@ -815,11 +843,15 @@ static void test_attr_scalar_write() } } // test_attr_scalar_write() -/**************************************************************** -** -** test_attr_scalar_read(): Test scalar attribute reading functionality. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_scalar_read + * + * Purpose Test scalar attribute reading functionality. + * + * Return None + *------------------------------------------------------------------------- + */ /* Epsilon for floating-point comparisons */ #define FP_EPSILON 0.000001F @@ -864,11 +896,15 @@ static void test_attr_scalar_read() } } // test_attr_scalar_read() -/**************************************************************** -** -** test_attr_mult_write(): Test multiple attributes -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_mult_write + * + * Purpose Test writing multiple attributes. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_mult_write() { // Output message about test being performed @@ -937,11 +973,15 @@ static void test_attr_mult_write() } } // test_attr_mult_write() -/**************************************************************** -** -** test_attr_mult_read(): Test reading multiple attributes. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_mult_read + * + * Purpose Test reading multiple attributes. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_mult_read() { int read_data1[ATTR1_DIM1]={0}; // Buffer for reading 1st attribute @@ -1128,12 +1168,15 @@ static void test_attr_mult_read() } } // test_attr_mult_read() -/**************************************************************** -** -** test_attr_delete(): Test deleting attribute from different -** hdf5 objects. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_delete + * + * Purpose Test deleting attribute from different hdf5 objects. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_delete() { H5std_string attr_name; // Buffer for attribute names @@ -1245,20 +1288,23 @@ static void test_attr_delete() } } // test_attr_delete() -/**************************************************************** -** -** test_attr_dtype_shared(): Test code for using shared datatypes -** in attributes. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_dtype_shared + * + * Purpose Test accessing attributes using shared datatypes. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_dtype_shared() { - int data=8; /* Data to write */ - int rdata=0; /* Read read in */ + int data=8; // Data to write + int rdata=0; // Data read in #ifndef H5_NO_DEPRECATED_SYMBOLS - H5G_stat_t statbuf; /* Object's information */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - h5_stat_size_t filesize; /* Size of file after modifications */ + H5G_stat_t statbuf; // Object's information +#endif + h5_stat_size_t filesize; // Size of file after modifications // Output message about test being performed SUBTEST("Shared Datatypes with Attributes"); @@ -1294,7 +1340,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 1, "DataType::getObjinfo", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif // Create dataspace for dataset DataSpace dspace; @@ -1305,7 +1351,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 2, "H5File::getObjinfo", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif // Create attribute on dataset Attribute attr = dset.createAttribute(ATTR1_NAME,dtype,dspace); @@ -1314,7 +1360,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 3, "DataSet::getObjinfo", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif // Close attribute attr.close(); @@ -1326,7 +1372,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 2, "DataSet::getObjinfo after DataSet::removeAttr", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif // Create attribute on dataset attr = dset.createAttribute(ATTR1_NAME,dtype,dspace); @@ -1335,7 +1381,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 3, "DataSet::createAttribute", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif // Write data into the attribute attr.write(PredType::NATIVE_INT,&data); @@ -1372,7 +1418,7 @@ static void test_attr_dtype_shared() // 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 */ +#endif } // end of second enclosing // Unlink the dataset @@ -1382,7 +1428,7 @@ static void test_attr_dtype_shared() // 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 */ +#endif // Unlink the named datatype fid1.unlink(TYPE1_NAME); @@ -1403,12 +1449,15 @@ static void test_attr_dtype_shared() } } // test_attr_dtype_shared() -/**************************************************************** -** -** test_string_attr(): Test read/write string attribute. -** Tests string attributes on groups. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_string_attr + * + * Purpose Test read/write string attribute. + * + * Return None + *------------------------------------------------------------------------- + */ /* Info for a string attribute */ const H5std_string ATTR1_FL_STR_NAME("String_attr 1"); const H5std_string ATTR2_FL_STR_NAME("String_attr 2"); @@ -1528,12 +1577,18 @@ static void test_string_attr() } } // test_string_attr() -/**************************************************************** -** -** test_attr_exists(): Test checking for attribute existence. -** (additional attrExists tests are in test_attr_rename()) -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_exists + * + * Purpose Test checking for attribute existence. + * + * Return None + * + * Note + * Additional attrExists tests are in test_attr_rename(). + *------------------------------------------------------------------------- + */ static void test_attr_exists() { // Output message about test being performed @@ -1577,12 +1632,15 @@ static void test_attr_exists() } } // test_attr_exists() -/**************************************************************** -** -** test_attr_dense_create(): Test phase change properties -** Tests "dense" attribute storage creation -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_dense_create + * + * Purpose Test phase change properties + * + * Return None + *------------------------------------------------------------------------- + */ const H5std_string FILE_CRTPROPS("tattr_crt_properties.h5"); const int NAME_BUF_SIZE = 1024; const unsigned MAX_COMPACT_DEF = 8; @@ -1686,12 +1744,15 @@ static void test_attr_dense_create(FileCreatPropList& fcpl, } } // test_attr_dense_create() -/**************************************************************** -** -** test_attr_corder_create_basic(): Test creation order properties -** Tests creating an object w/attribute creation order info -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_corder_create_basic + * + * Purpose Test creation order properties + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_corder_create_basic(FileCreatPropList& fcpl, FileAccPropList& fapl) { @@ -1771,11 +1832,15 @@ static void test_attr_corder_create_basic(FileCreatPropList& fcpl, } } // test_attr_corder_create_basic() -/**************************************************************** -** -** test_attr(): Main attribute testing routine. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr + * + * Purpose Main attribute testing routine + * + * Return None + *------------------------------------------------------------------------- + */ extern "C" void test_attr() { @@ -1858,19 +1923,14 @@ void test_attr() issue_fail_msg("test_attr()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr() + /*------------------------------------------------------------------------- - * Function cleanup_attr + * Function: cleanup_attr * * Purpose Cleanup temporary test files * - * Return none - * - * Programmer Albert Cheng - * July 2, 1998 - * - * Modifications: - * + * Return None *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index 3af78c5..55d4744 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -49,9 +49,6 @@ typedef struct complex_t { * * Programmer Binh-Minh Ribler (using C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_1() @@ -86,9 +83,6 @@ static void test_compound_1() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_2() @@ -211,9 +205,6 @@ static void test_compound_2() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_3() @@ -333,9 +324,6 @@ static void test_compound_3() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_4() @@ -466,9 +454,6 @@ static void test_compound_4() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_5() @@ -569,9 +554,6 @@ static void test_compound_5() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_6() @@ -651,6 +633,7 @@ static void test_compound_6() } } // test_compound_6() + /*------------------------------------------------------------------------- * Function: test_compound_7 * @@ -661,9 +644,6 @@ static void test_compound_6() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_7() @@ -717,6 +697,7 @@ static void test_compound_7() issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } } // test_compound_7() + /*------------------------------------------------------------------------- * Function: test_compound_set_size @@ -727,12 +708,10 @@ static void test_compound_7() * * Programmer Binh-Minh Ribler (use partial C version test_ooo_order) * March, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ const H5std_string COMPFILE("tcompound_types.h5"); + static void test_compound_set_size() { typedef struct { @@ -807,6 +786,7 @@ static void test_compound_set_size() issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } } // test_compound_set_size() + /*------------------------------------------------------------------------- * Function: test_compound @@ -817,9 +797,6 @@ static void test_compound_set_size() * * Programmer Binh-Minh Ribler * January 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" @@ -845,9 +822,6 @@ void test_compound() * Purpose Cleanup temporary test files - nothing at this time. * * Return none - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index 4aaa93a..438f385 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -111,11 +111,14 @@ static void test_transfplist() } -/**************************************************************** -** -** test_dsproplist(): Main dataset property list testing routine. -** -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_dsproplist + * + * Purpose Main dataset property list testing routine + * + * Return None + *------------------------------------------------------------------------- + */ extern "C" void test_dsproplist() { @@ -126,6 +129,15 @@ void test_dsproplist() } // test_dsproplist() + +/*------------------------------------------------------------------------- + * Function: cleanup_dsproplist + * + * Purpose Cleanup temporary test files + * + * Return none + *------------------------------------------------------------------------- + */ extern "C" void cleanup_dsproplist() { diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index 51682a3..ba5b486 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -78,7 +78,6 @@ const H5std_string FILE4("tfile4.h5"); * 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_file_create() @@ -285,7 +284,6 @@ static void test_file_create() * 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_file_open() @@ -360,9 +358,6 @@ static void test_file_open() * * Programmer Raymond Lu * June, 2004 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_file_size() @@ -425,9 +420,6 @@ static void test_file_size() * * Programmer Binh-Minh Ribler * July, 2004 - * - * Modifications: - * *------------------------------------------------------------------------- */ const int RANK = 2; @@ -507,6 +499,15 @@ static void test_file_name() } // test_file_name() +/*------------------------------------------------------------------------- + * + * Function: test_file_attribute + * + * Purpose Test file attributes + * + * Return None + *------------------------------------------------------------------------- + */ const int RANK1 = 1; const int ATTR1_DIM1 = 3; const H5std_string FILE5("tfattrs.h5"); @@ -618,11 +619,6 @@ static void test_file_attribute() } // test_file_attribute() -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 * @@ -634,9 +630,13 @@ const H5std_string SUBGROUP3("/G1/G3"); * * Programmer Binh-Minh Ribler (use C version) * March, 2015 - * *------------------------------------------------------------------------- */ +const H5std_string FILE6("tfile5.h5"); +const H5std_string ROOTGROUP("/"); +const H5std_string GROUP1("/G1"); +const H5std_string SUBGROUP3("/G1/G3"); + static void test_libver_bounds_real( H5F_libver_t libver_create, unsigned oh_vers_create, H5F_libver_t libver_mod, unsigned oh_vers_mod) @@ -707,6 +707,7 @@ static void test_libver_bounds_real( } /* end test_libver_bounds_real() */ + /*------------------------------------------------------------------------- * * Function: test_libver_bounds @@ -718,7 +719,6 @@ static void test_libver_bounds_real( * * Programmer Binh-Minh Ribler (use C version) * March 2015 - * *------------------------------------------------------------------------- */ static void test_libver_bounds() @@ -731,9 +731,10 @@ static void test_libver_bounds() test_libver_bounds_real(H5F_LIBVER_LATEST, H5O_VERSION_2, H5F_LIBVER_EARLIEST, H5O_VERSION_2); PASSED(); } /* end test_libver_bounds() */ + /*------------------------------------------------------------------------- - * Function: test_commonfg + * Function: test_commonfg * * Purpose Verify that H5File works as a root group. * @@ -741,7 +742,6 @@ static void test_libver_bounds() * * Programmer Binh-Minh Ribler (use C version) * March, 2015 - * *------------------------------------------------------------------------- */ static void test_commonfg() @@ -793,9 +793,8 @@ static void test_commonfg() } } /* end test_commonfg() */ - -const H5std_string FILE7("tfile7.h5"); + /*------------------------------------------------------------------------- * Function: test_file_info * @@ -807,11 +806,12 @@ const H5std_string FILE7("tfile7.h5"); * * Programmer Binh-Minh Ribler * February, 2017 - * *------------------------------------------------------------------------- */ +const H5std_string FILE7("tfile7.h5"); const hsize_t FSP_SIZE_DEF = 4096; const hsize_t FSP_SIZE512 = 512; + static void test_file_info() { // Output message about test being performed @@ -932,6 +932,7 @@ static void test_file_info() issue_fail_msg("test_filespace_info()", __LINE__, __FILE__, E.getCDetailMsg()); } } /* test_file_info() */ + /*------------------------------------------------------------------------- * Function: test_file @@ -942,9 +943,6 @@ static void test_file_info() * * Programmer Binh-Minh Ribler (use C version) * January 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" @@ -970,11 +968,6 @@ void test_file() * Purpose Cleanup temporary test files * * Return none - * - * Programmer (use C version) - * - * Modifications: - * *------------------------------------------------------------------------- */ #ifdef __cplusplus diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 5de6590..5a493ac 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -65,6 +65,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ (H5Z_func_t)filter_bogus, /* The actual filter function */ }}; + /*------------------------------------------------------------------------- * Function: filter_bogus * @@ -76,9 +77,6 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ * * Programmer Robb Matzke * Tuesday, April 21, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t @@ -92,6 +90,7 @@ filter_bogus(size_t nbytes) return nbytes; } + /*------------------------------------------------------------------------- * Function: test_null_filter * @@ -104,11 +103,8 @@ filter_bogus(size_t nbytes) * * Modifications: * Note: H5Z interface is not implemented yet. - * *------------------------------------------------------------------------- */ - -// Chunk dimensions const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; static void test_null_filter() @@ -144,6 +140,7 @@ static void test_null_filter() } } // test_null_filter + /*------------------------------------------------------------------------- * Function: test_szip_filter * @@ -156,11 +153,9 @@ static void test_null_filter() * * Modifications: * Note: H5Z interface is not implemented yet. - * *------------------------------------------------------------------------- */ - -const H5std_string DSET_SZIP_NAME("szipped dataset"); +const H5std_string DSET_SZIP_NAME("szipped dataset"); static void test_szip_filter(H5File& file1) { @@ -242,11 +237,14 @@ static void test_szip_filter(H5File& file1) } // test_szip_filter -/**************************************************************** -** -** test_filters(): Main routine for testing filters. -** -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_filters + * + * Purpose Main routine for testing filters + * + * Return None + *------------------------------------------------------------------------- + */ const H5std_string FILE1("tfilters.h5"); extern "C" void test_filters() @@ -274,18 +272,13 @@ void test_filters() } } // test_filters() + /*------------------------------------------------------------------------- * Function: cleanup_filters * * Purpose Cleanup temporary test files * * Return none - * - * Programmer Quincey Koziol - * September 10, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index e99ce99..9c92b64 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -82,13 +82,13 @@ struct space4_struct { /* Null dataspace */ int space5_data = 7; + /*------------------------------------------------------------------------- - * * Function: test_h5s_basic * * Purpose Test basic H5S (dataspace) code * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 @@ -214,13 +214,13 @@ static void test_h5s_basic() } } // test_h5s_basic() + /*------------------------------------------------------------------------- - * * Function: test_h5s_scalar_write * * Purpose Test scalar H5S (dataspace) writing code * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 @@ -278,13 +278,13 @@ static void test_h5s_scalar_write() } } // test_h5s_scalar_write() + /*------------------------------------------------------------------------- - * * Function: test_h5s_scalar_read * * Purpose Test scalar H5S (dataspace) reading code * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 @@ -340,13 +340,13 @@ static void test_h5s_scalar_read() } // test_h5s_scalar_read() + /*------------------------------------------------------------------------- - * * Function: test_h5s_null * * Purpose Test null H5S (dataspace) code * - * Return none + * Return None * * Programmer Raymond Lu (using C version) * May 18, 2004 @@ -394,14 +394,14 @@ static void test_h5s_null() } } // test_h5s_null() + /*------------------------------------------------------------------------- - * * Function: test_h5s_compound_scalar_write * * Purpose Test scalar H5S (dataspace) writing for compound * datatypes * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 @@ -467,14 +467,14 @@ static void test_h5s_compound_scalar_write() } } // test_h5s_compound_scalar_write() + /*------------------------------------------------------------------------- - * * Function: test_h5s_compound_scalar_read * * Purpose Test scalar H5S (dataspace) reading for compound * datatypes * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 @@ -541,18 +541,16 @@ static void test_h5s_compound_scalar_read() } } // test_h5s_compound_scalar_read() + /*------------------------------------------------------------------------- - * * Function: test_h5s * * Purpose Main dataspace testing routine * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 - * - * Modifications: *------------------------------------------------------------------------- */ extern "C" @@ -575,13 +573,7 @@ void test_h5s() * * Purpose Cleanup temporary test files * - * Return none - * - * Programmer Albert Cheng - * July 2, 1998 - * - * Modifications: - * + * Return None *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index 5c760f3..e77ebcc 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -78,23 +78,25 @@ typedef struct { int iter_strcmp(const void *s1, const void *s2); -/**************************************************************** -** -** iter_strcmp(): String comparison routine for qsort -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: iter_strcmp + * + * Purpose String comparison routine for qsort + *------------------------------------------------------------------------- + */ int iter_strcmp(const void *s1, const void *s2) { return(HDstrcmp(*(const char * const *)s1,*(const char * const *)s2)); } -/**************************************************************** -** -** liter_cb(): Custom link iteration callback routine. -** -****************************************************************/ -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) +/*------------------------------------------------------------------------- + * Function: liter_cb + * + * Purpose Custom link iteration callback routine + *------------------------------------------------------------------------- + */ +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) { iter_info *info = (iter_info *)op_data; static int count = 0; @@ -123,6 +125,7 @@ liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_ } /* end switch */ } /* end liter_cb() */ + /*------------------------------------------------------------------------- * Function: test_iter_group * @@ -133,9 +136,6 @@ liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_ * * Programmer Binh-Minh Ribler * Friday, September 9, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_iter_group(FileAccPropList& fapl) @@ -348,13 +348,13 @@ static void test_iter_group(FileAccPropList& fapl) #endif } /* test_iter_group() */ - -/**************************************************************** -** -** printelems(): Open an attribute and verify that it has a -** the correct name -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: printelems + * + * Purpose Open an attribute and verify that it has a the correct name + *------------------------------------------------------------------------- + */ const H5std_string FILE_NAME("titerate.h5"); const H5std_string GRP_NAME("/Group_A"); const H5std_string FDATASET_NAME("file dset"); @@ -386,6 +386,7 @@ void printelems(const Group& group, const H5std_string& dsname, const H5std_stri } } + /*------------------------------------------------------------------------- * Function: test_HDFFV_9920 * @@ -393,9 +394,6 @@ void printelems(const Group& group, const H5std_string& dsname, const H5std_stri * * Programmer Binh-Minh Ribler * Friday, September 9, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_HDFFV_9920() @@ -444,7 +442,7 @@ static void test_HDFFV_9920() } } - + /*------------------------------------------------------------------------- * Function: test_iterate * @@ -455,9 +453,6 @@ static void test_HDFFV_9920() * * Programmer Binh-Minh Ribler * Tuesday, September 6, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" @@ -476,17 +471,13 @@ void test_iterate() } // test_iterate + /*------------------------------------------------------------------------- * Function: cleanup_iterate * * Purpose Cleanup temporary test files * * Return none - * - * Programmer (use C version) - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index dc592b3..e348d64 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -328,9 +328,6 @@ static const char *FILENAME[] = { * * Programmer Binh-Minh Ribler * October 16, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_basic_links(hid_t fapl_id, hbool_t new_format) @@ -414,6 +411,11 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); // Verify link existence + if(file.nameExists("dset1", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::nameExists", "dset1 doesn't exist"); + if(file.nameExists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::nameExists", "grp1/soft doesn't exist"); + // Deprecated if(file.exists("dset1", LinkAccPropList::DEFAULT) != TRUE) throw InvalidActionException("H5File::exists", "dset1 doesn't exist"); if(file.exists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) @@ -446,9 +448,6 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) * * Programmer Binh-Minh Ribler * October 16, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_num_links(hid_t fapl_id, hbool_t new_format) @@ -483,6 +482,7 @@ static void test_num_links(hid_t fapl_id, hbool_t new_format) issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_num_links + /*------------------------------------------------------------------------- * Function: test_links @@ -493,7 +493,6 @@ static void test_num_links(hid_t fapl_id, hbool_t new_format) * * Programmer Binh-Minh Ribler * October 16, 2009 - * *------------------------------------------------------------------------- */ extern "C" @@ -671,18 +670,13 @@ void test_links() } + /*------------------------------------------------------------------------- * Function: cleanup_links * * Purpose Cleanup temporary test files * * Return none - * - * Programmer Binh-Minh Ribler - * October 16, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index d9f4075..9980ce0 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -45,6 +45,7 @@ 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 * @@ -65,9 +66,6 @@ const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset_ * * Programmer Binh-Minh Ribler * Friday, March 4, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_get_objname() @@ -153,6 +151,7 @@ static void test_get_objname() } } // test_get_objname + /*------------------------------------------------------------------------- * Function: test_existance * @@ -173,9 +172,6 @@ static void test_get_objname() * * Programmer Binh-Minh Ribler * Friday, March 4, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_existance() @@ -187,18 +183,30 @@ static void test_existance() H5File file(FILE_OBJECTS, H5F_ACC_RDONLY); // Check if GROUP1 exists in the file - bool exists = file.exists(GROUP1); + bool exists = file.nameExists(GROUP1); + verify_val(exists, TRUE, "Group::nameExists GROUP1_1", __LINE__, __FILE__); + // Deprecated + exists = file.exists(GROUP1); + verify_val(exists, TRUE, "Group::exists GROUP1_1", __LINE__, __FILE__); // Open GROUP1 Group grp1 = file.openGroup(GROUP1); // Check if GROUP1_1 and GROUP1_2 exist in GROUP1 + exists = grp1.nameExists(GROUP1_1); + verify_val(exists, TRUE, "Group::nameExists GROUP1_1", __LINE__, __FILE__); + exists = grp1.nameExists(GROUP1_2); + verify_val(exists, TRUE, "Group::nameExists GROUP1_2", __LINE__, __FILE__); + // Deprecated 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.nameExists(DSET_IN_GRP1); + verify_val(exists, TRUE, "Group::nameExists DSET_IN_GRP1", __LINE__, __FILE__); + // Deprecated exists = grp1.exists(DSET_IN_GRP1); verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); @@ -206,14 +214,22 @@ static void test_existance() Group grp1_2 = grp1.openGroup(GROUP1_2); // Check if DSET_IN_GRP1_2 exists in GROUP1_2 + exists = grp1_2.nameExists(DSET_IN_GRP1_2); + verify_val(exists, TRUE, "Group::nameExists DSET_IN_GRP1_2", __LINE__, __FILE__); + // Deprecated 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.nameExists("/Top Group/Dataset_in_Group_1"); + verify_val(exists, TRUE, "Group::nameExists given dataset with full path name", __LINE__, __FILE__); + + exists = grp1_2.nameExists(DSET_IN_GRP1); + verify_val(exists, FALSE, "Group::nameExists DSET_IN_GRP1", __LINE__, __FILE__); + // Deprecated 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__); @@ -229,6 +245,7 @@ static void test_existance() } } // test_existance + /*------------------------------------------------------------------------- * Function: test_get_objname_ontypes * @@ -239,9 +256,6 @@ static void test_existance() * * Programmer Binh-Minh Ribler * March 4, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_get_objname_ontypes() @@ -330,6 +344,7 @@ static void test_get_objname_ontypes() } } // test_get_objname_ontypes + /*------------------------------------------------------------------------- * Function: test_get_objtype * @@ -340,9 +355,6 @@ static void test_get_objname_ontypes() * * Programmer Binh-Minh Ribler * Friday, March 4, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_get_objtype() @@ -394,6 +406,7 @@ static void test_get_objtype() issue_fail_msg("test_get_objtype", __LINE__, __FILE__); } } // test_get_objtype + /*------------------------------------------------------------------------- * Function: test_open_object_header @@ -404,9 +417,6 @@ static void test_get_objtype() * * Programmer Binh-Minh Ribler (use C version) * March, 2017 - * - * Modifications: - * *------------------------------------------------------------------------- */ const H5std_string GROUPNAME("group"); @@ -416,6 +426,7 @@ const H5std_string DSETNAME("dataset"); #define RANK 2 #define DIM0 5 #define DIM1 10 + static void test_open_object_header() { hsize_t dims[2]; @@ -513,6 +524,7 @@ static void test_open_object_header() issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg()); } } /* test_open_object_header() */ + /*------------------------------------------------------------------------- * Function: test_objects @@ -524,9 +536,6 @@ static void test_open_object_header() * * Programmer Binh-Minh Ribler * Friday, Mar 4, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" @@ -543,17 +552,13 @@ void test_object() } // test_objects + /*------------------------------------------------------------------------- * Function: cleanup_objects * * Purpose Cleanup temporary test files * - * Return none - * - * Programmer (use C version) - * - * Modifications: - * + * Return None *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index 9074154..bb09616 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -61,14 +61,16 @@ typedef struct s1_t { float c; } s1_t; -/**************************************************************** -** -** test_reference_params(): Test basic H5R (reference) parameters -** for correct processing -** -****************************************************************/ -static void -test_reference_params(void) + +/*------------------------------------------------------------------------- + * Function: test_reference_params + * + * Purpose Test basic H5R (reference) parameters for correct processing + * + * Return None + *------------------------------------------------------------------------- + */ +static void test_reference_params() { const char *write_comment = "Foo!"; /* Comments for group */ @@ -177,13 +179,17 @@ test_reference_params(void) delete file1; } /* test_reference_param() */ -/**************************************************************** -** -** test_reference_obj(): Test basic object reference functions -** to various kinds of objects -** -****************************************************************/ -static void test_reference_obj(void) + +/*------------------------------------------------------------------------- + * Function: test_reference_obj + * + * Purpose Test basic object reference functions to various kinds + * of objects + * + * Return None + *------------------------------------------------------------------------- + */ +static void test_reference_obj() { int i; // counting variables const H5std_string write_comment="Foo!"; // Comments for group @@ -369,14 +375,15 @@ static void test_reference_obj(void) delete file1; } // test_reference_obj() - -/**************************************************************** -** -** test_reference_group(): Test object reference functionality -** Tests for correct behavior of various routines on -** dereferenced group -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_reference_group + * + * Purpose Test object reference functionality on group. + * + * Return None + *------------------------------------------------------------------------- + */ #define GROUPNAME "/group" #define GROUPNAME2 "group2" #define GROUPNAME3 "group3" @@ -384,8 +391,7 @@ static void test_reference_obj(void) #define DSETNAME2 "dset2" #define NAME_SIZE 16 -static void -test_reference_group(void) +static void test_reference_group() { hobj_ref_t wref; /* Reference to write */ hobj_ref_t rref; /* Reference to read */ @@ -498,14 +504,16 @@ test_reference_group(void) delete file1; } /* test_reference_group() */ -/**************************************************************** -** -** test_reference_region_1D(): Test 1-D reference functionality -** Tests 1-D references to various kinds of objects -** -****************************************************************/ -static void -test_reference_region_1D(void) + +/*------------------------------------------------------------------------- + * Function: test_reference_region_1D + * + * Purpose Test 1-D reference functionality on various kinds of objects. + * + * Return None + *------------------------------------------------------------------------- + */ +static void test_reference_region_1D() { hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ @@ -787,26 +795,14 @@ test_reference_region_1D(void) } } /* test_reference_region_1D() */ - -/**************************************************************** -** -** test_reference_compat(): Test basic object reference functionality. -** Tests references to various kinds of objects using deprecated API. -** -****************************************************************/ -static void test_reference_compat(void) -{ - // Not yet -} // test_reference_compat() - - -/**************************************************************** -** -** test_reference(): Main reference testing routine. -** -****************************************************************/ +/*------------------------------------------------------------------------- + * + * test_reference(): Main reference testing routine. + * + *------------------------------------------------------------------------- + */ extern "C" -void test_reference(void) +void test_reference() { // Output message about test being performed MESSAGE(5, ("Testing References\n")); @@ -815,18 +811,20 @@ void test_reference(void) test_reference_obj(); // Test basic object reference functionality test_reference_group(); // Test group reference functionality test_reference_region_1D(); // Test 1-D reference functionality - test_reference_compat(); // Tests deprecated reference routines (not yet) } // test_reference() -/**************************************************************** -** 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) +void cleanup_reference() { HDremove(FILE1.c_str()); HDremove(FILE2.c_str()); diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 3cf0920..a2bd561 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -87,6 +87,7 @@ typedef struct { long c; double d; } src_typ_t; + /*------------------------------------------------------------------------- * Function: test_classes @@ -97,9 +98,6 @@ typedef struct { * * Programmer Binh-Minh Ribler (using C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_classes() @@ -126,6 +124,7 @@ static void test_classes() issue_fail_msg("test_classes", __LINE__, __FILE__, E.getCDetailMsg()); } } + /*------------------------------------------------------------------------- * Function: test_copy @@ -136,9 +135,6 @@ static void test_classes() * * Programmer Binh-Minh Ribler (using C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_copy() @@ -192,9 +188,6 @@ static void test_copy() * * Programmer Binh-Minh Ribler (using C version) * August, 2017 - * - * Modifications: - * *------------------------------------------------------------------------- */ typedef struct { /* Struct with atomic fields */ @@ -390,9 +383,6 @@ static void test_detect_type_class() * * Programmer Binh-Minh Ribler (use C version) * August, 2017 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_vltype() @@ -465,12 +455,8 @@ static void test_vltype() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ - const H5std_string CompT_NAME("Compound_type"); const H5std_string EnumT_NAME("Enum_type"); @@ -591,12 +577,10 @@ static void test_query() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ const char* filename1 = "dtypes1.h5"; + static void test_transient () { static hsize_t ds_size[2] = {10, 20}; @@ -668,12 +652,10 @@ static void test_transient () * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ const H5std_string filename2("dtypes2.h5"); + static void test_named () { static hsize_t ds_size[2] = {10, 20}; @@ -831,14 +813,12 @@ static void test_named () * * 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; @@ -1045,11 +1025,14 @@ static void test_encode_decode() } -/**************************************************************** -** -** test_types(): Main datatypes testing routine. -** -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_types + * + * Purpose Main datatypes testing routine + * + * Return None + *------------------------------------------------------------------------- + */ extern "C" void test_types() { @@ -1074,13 +1057,7 @@ void test_types() * * Purpose Cleanup temporary test files * - * Return none - * - * Programmer Quincey Koziol - * September 10, 1999 - * - * Modifications: - * + * Return None *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index d5fea07..2421a87 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -40,16 +40,22 @@ const H5std_string FILENAME("tvlstr.h5"); const int SPACE1_RANK = 1; 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. -** -** Note: exact copy from the C version. -** (Not used now) -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_vlstr_alloc_custom + * + * Purpose Test VL datatype custom memory allocation routines. + * + * Return None + * + * Description + * 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) + *------------------------------------------------------------------------- + */ #if 0 // not used now static void *test_vlstr_alloc_custom(size_t size, void *info) { @@ -74,16 +80,22 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) } #endif -/**************************************************************** -** -** 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. -** -** Note: exact copy from the C version. -** (Not used now) -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_vlstr_free_custom + * + * Purpose Test VL datatype custom memory de-allocation routines. + * + * Return None + * + * Description + * 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) + *------------------------------------------------------------------------- + */ #if 0 // not used now static void test_vlstr_free_custom(void *_mem, void *info) { @@ -221,6 +233,7 @@ static void test_vlstring_dataset() *------------------------------------------------------------------------- */ const H5std_string DSSTRARR_NAME("StringArray_dset"); + static void test_vlstring_array_dataset() { const char *string_ds_array[SPACE1_DIM1]= { @@ -440,6 +453,7 @@ static void test_vlstrings_special() *------------------------------------------------------------------------- */ const H5std_string VLSTR_TYPE("vl_string_type"); + static void test_vlstring_type() { // Output message about test being performed. @@ -608,10 +622,7 @@ static void test_compact_vlstring() * *------------------------------------------------------------------------- */ -// String for writing to attribute static char *string_att_write=NULL; - -// Info for a string attribute const H5std_string ATTRSTR_NAME("String_attr"); const H5std_string ATTRSTR_DATA("String Attribute"); @@ -877,6 +888,7 @@ static void read_scalar_dset(H5File& file, DataType& type, DataSpace& space, */ const H5std_string FILENAME2("tvlstr2.h5"); const int REWRITE_NDATASETS = 32; + static void test_vl_rewrite() { // Output message about test being performed @@ -987,12 +999,6 @@ void test_vlstrings() * Purpose Cleanup temporary test files * * Return none - * - * Programmer Quincey Koziol - * September 10, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" -- cgit v0.12 From 9e39def205fe470ef1527d7955ddbde6290be511 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 12:53:20 -0600 Subject: removed fortran comments --- fortran/src/hdf5_fortrandll.def.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 3903c8b..585602f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -182,10 +182,10 @@ H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F ; ; H5O flags declaration ; -H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO -H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE -H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER -H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F ! TO STAY UNDER THE +H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F +H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F +H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F +H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F H5GLOBAL_mp_H5O_COPY_ALL_F @@ -197,9 +197,9 @@ H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F ! 32 CHARACTER -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F ! VARIABLE -H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F ! LENGTH *** +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F +H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F -- cgit v0.12 From 9deb5267ca482050288d993bd67d1ec3064cdfb1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 4 Dec 2017 13:05:53 -0600 Subject: Changed reference from dl to CMake variable --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ab06ce8..1d217c6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -891,7 +891,7 @@ add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HE TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) + target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) @@ -935,7 +935,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) -- cgit v0.12 From 6d658a946cc71994fc239b16ccc645b5e728998f Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:26:19 -0600 Subject: removed duplicate exports of DS subroutines --- hl/fortran/src/H5DSff.F90 | 65 +++-------------------------------------------- 1 file changed, 3 insertions(+), 62 deletions(-) diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 index 4f0d040..2dca479 100644 --- a/hl/fortran/src/H5DSff.F90 +++ b/hl/fortran/src/H5DSff.F90 @@ -44,13 +44,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name INTEGER :: errcode ! Error code @@ -99,12 +92,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsattach_scale_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. @@ -148,13 +135,7 @@ CONTAINS SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsdetach_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached INTEGER , INTENT(in) :: idx ! the dimension of did to detach @@ -199,13 +180,7 @@ CONTAINS SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_attached_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with @@ -264,13 +239,7 @@ CONTAINS SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the data set to query LOGICAL , INTENT(out) :: is_scale ! logical: ! .TRUE. if did is a Dimension Scale @@ -319,13 +288,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -375,13 +337,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -430,13 +385,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_scale_name_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget CHARACTER(LEN=*), INTENT(out) :: name ! The name INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer @@ -478,13 +426,6 @@ CONTAINS SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_num_scales_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER , INTENT(in) :: idx ! the dimension of did to query INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did -- cgit v0.12 From fc089499ad407364bcefaa72ed06f7b4d579a387 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:38:38 -0600 Subject: added missing parameter --- fortran/src/hdf5_fortrandll.def.in | 1 + 1 file changed, 1 insertion(+) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 585602f..507c991 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -44,6 +44,7 @@ H5GLOBAL_mp_H5T_NATIVE_B32 H5GLOBAL_mp_H5T_NATIVE_B64 H5GLOBAL_mp_H5T_FORTRAN_S1 H5GLOBAL_mp_H5T_C_S1 +H5GLOBAL_mp_H5T_NATIVE_INTEGER_KIND H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 ; ; H5generic flags declaration -- cgit v0.12 From 1f3eb82bceacf5d08db02d68977de0d21f54d26f Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:55:51 -0600 Subject: added missing parameter --- fortran/src/hdf5_fortrandll.def.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 507c991..417778d 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,5 +1,7 @@ EXPORTS ; H5GLOBAL +H5GLOBAL_mp_H5_REAL_KIND +H5GLOBAL_mp_H5_INTEGER_KIND H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -- cgit v0.12 From 30807e1d80e9edd09cb5f2c75220bd82b761d595 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 16:35:13 -0600 Subject: removed parameters --- fortran/src/hdf5_fortrandll.def.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 417778d..507c991 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,7 +1,5 @@ EXPORTS ; H5GLOBAL -H5GLOBAL_mp_H5_REAL_KIND -H5GLOBAL_mp_H5_INTEGER_KIND H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -- cgit v0.12 From 17d148434fff055a2e22c6ac715c7ecff536a5c3 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 4 Dec 2017 16:57:37 -0600 Subject: Fixed typo. --- c++/test/tcompound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index 55d4744..ec8adf0 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -821,7 +821,7 @@ void test_compound() * * Purpose Cleanup temporary test files - nothing at this time. * - * Return none + * Return None *------------------------------------------------------------------------- */ extern "C" -- cgit v0.12 From bd49f6460c3b4b3bafe5607f41af8b605d3044bb Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 5 Dec 2017 10:03:49 -0600 Subject: moved dll export to Module --- fortran/src/H5f90global.F90 | 342 ++++++++++++++++++++++++++++++++++++- fortran/src/hdf5_fortrandll.def.in | 332 ----------------------------------- 2 files changed, 336 insertions(+), 338 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 9054522..3f00d9a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -88,7 +88,56 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 - ! + + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_FLOAT + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_LONG_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_CHARACTER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_OBJ + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_DSETREG + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B8 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B16 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B32 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B64 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FORTRAN_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_C_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER_KIND + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_FLOAT_128 + !DEC$endif + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE @@ -142,6 +191,19 @@ MODULE H5GLOBAL ! ! H5generic flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_NAME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_CRT_ORDER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_N_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_INC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_DEC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_NATIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_N_F + !DEC$ATTRIBUTES DLLEXPORT :: HADDR_UNDEF_F + !DEC$endif + INTEGER :: H5_INDEX_UNKNOWN_F INTEGER :: H5_INDEX_NAME_F INTEGER :: H5_INDEX_CRT_ORDER_F @@ -156,6 +218,28 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDWR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDONLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_TRUNC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_EXCL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_DEBUG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_LOCAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_GLOBAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_WEAK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_SEMI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_STRONG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_EARLIEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_LATEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_UNLIMITED_F + !DEC$endif + INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -178,6 +262,23 @@ MODULE H5GLOBAL ! ! H5G flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_TYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UDLINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_DENSE_F + !DEC$endif + INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -195,6 +296,40 @@ MODULE H5GLOBAL ! ! H5D flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5D_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CONTIGUOUS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNKED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_EARLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_LATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_INCR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_NOT_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_PART_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ALLOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_NEVER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_UNDEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_USER_DEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_W0_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_NO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CONTIG_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_FIRST_MISSING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_LAST_AVAILABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VIRTUAL_F + !DEC$endif + INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -219,11 +354,11 @@ MODULE H5GLOBAL INTEGER :: H5D_FILL_VALUE_DEFAULT_F INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F -! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 -! characters for variable names in Fortran. -! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 -! characters for variable names in Fortran. - + ! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 + ! characters for variable names in Fortran. + ! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 + ! characters for variable names in Fortran. + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F @@ -240,6 +375,14 @@ MODULE H5GLOBAL ! ! H5E flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5E_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MAJOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MINOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_UPWARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_DOWNWARD_F + !DEC$endif + INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F @@ -248,6 +391,27 @@ MODULE H5GLOBAL ! ! H5FD file drivers flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NOLIST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_SUPER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_BTREE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DRAW_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_GHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_LHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_OHDR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NTYPES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_CORE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_FAMILY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_LOG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MULTI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_SEC2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_STDIO_F + !DEC$endif + INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -269,6 +433,16 @@ MODULE H5GLOBAL ! ! H5I flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5I_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASPACE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_ATTR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_BADID_F + !DEC$endif + INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -279,6 +453,15 @@ MODULE H5GLOBAL ! ! H5L flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_EXTERNAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_LINK_CLASS_T_VERS_F + !DEC$endif + INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F @@ -288,6 +471,36 @@ MODULE H5GLOBAL ! ! H5O flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_SHALLOW_HIERARCHY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_SOFT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_EXT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_WITHOUT_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_PRESERVE_NULL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_NONE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_SDSPACE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_DTYPE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_FILL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_PLINE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ALL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_CHUNK0_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_STORE_PHASE_CHA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_STORE_TIMES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ALL_FLAGS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_NINDEXES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_LIST_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NAMED_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NTYPES_F + !DEC$endif + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -318,6 +531,29 @@ MODULE H5GLOBAL ! ! H5P flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_XFER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_MOUNT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ROOT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_STRING_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ATTRIBUTE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_COPY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_INDEXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_TRACKED_F + !DEC$endif + INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -342,11 +578,39 @@ MODULE H5GLOBAL ! ! H5R flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5R_OBJECT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5R_DATASET_REGION_F + !DEC$endif + INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F ! ! H5S flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5S_UNLIMITED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SCALAR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SIMPLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_NULL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOOP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_SET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_OR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_AND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_XOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTB_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_APPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_PREPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_INVALID_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_POINTS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_HYPERSLABS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ALL_F + !DEC$endif + INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -374,6 +638,44 @@ MODULE H5GLOBAL ! ! H5T flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NO_CLASS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_INTEGER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_TIME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_BITFIELD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_OPAQUE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_COMPOUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ENUM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_VLEN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ARRAY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_LE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_BE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_VAX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ZERO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_BACKGROUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_IMPLIED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_MSBSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_ASCII_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_UTF8_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLTERM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_SPACEPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_ASCEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_DESCEND_F + !DEC$endif + INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -412,6 +714,29 @@ MODULE H5GLOBAL ! ! H5Z flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DEFLATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SHUFFLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_FLETCHER32_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SZIP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ERROR_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_DISABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ENABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_NO_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FLAG_OPTIONAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ENCODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DECODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NBIT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SCALEOFFSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_DSCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_ESCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_MINBITS_DEFAULT_F + !DEC$endif + INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -435,6 +760,11 @@ MODULE H5GLOBAL ! ! H5 Library flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_EC_OM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_NN_OM_F + !DEC$endif + INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 507c991..3a5a91f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,336 +1,4 @@ EXPORTS -; H5GLOBAL -H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT -H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_INTEGER -H5GLOBAL_mp_H5T_NATIVE_REAL -H5GLOBAL_mp_H5T_NATIVE_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_CHARACTER -H5GLOBAL_mp_H5T_STD_REF_OBJ -H5GLOBAL_mp_H5T_STD_REF_DSETREG -H5GLOBAL_mp_H5T_IEEE_F32BE -H5GLOBAL_mp_H5T_IEEE_F32LE -H5GLOBAL_mp_H5T_IEEE_F64BE -H5GLOBAL_mp_H5T_IEEE_F64LE -H5GLOBAL_mp_H5T_STD_I8BE -H5GLOBAL_mp_H5T_STD_I8LE -H5GLOBAL_mp_H5T_STD_I16BE -H5GLOBAL_mp_H5T_STD_I16LE -H5GLOBAL_mp_H5T_STD_I32BE -H5GLOBAL_mp_H5T_STD_I32LE -H5GLOBAL_mp_H5T_STD_I64BE -H5GLOBAL_mp_H5T_STD_I64LE -H5GLOBAL_mp_H5T_STD_U8BE -H5GLOBAL_mp_H5T_STD_U8LE -H5GLOBAL_mp_H5T_STD_U16BE -H5GLOBAL_mp_H5T_STD_U16LE -H5GLOBAL_mp_H5T_STD_U32BE -H5GLOBAL_mp_H5T_STD_U32LE -H5GLOBAL_mp_H5T_STD_U64BE -H5GLOBAL_mp_H5T_STD_U64LE -H5GLOBAL_mp_H5T_STRING -H5GLOBAL_mp_H5T_STD_B8BE -H5GLOBAL_mp_H5T_STD_B8LE -H5GLOBAL_mp_H5T_STD_B16BE -H5GLOBAL_mp_H5T_STD_B16LE -H5GLOBAL_mp_H5T_STD_B32BE -H5GLOBAL_mp_H5T_STD_B32LE -H5GLOBAL_mp_H5T_STD_B64BE -H5GLOBAL_mp_H5T_STD_B64LE -H5GLOBAL_mp_H5T_NATIVE_B8 -H5GLOBAL_mp_H5T_NATIVE_B16 -H5GLOBAL_mp_H5T_NATIVE_B32 -H5GLOBAL_mp_H5T_NATIVE_B64 -H5GLOBAL_mp_H5T_FORTRAN_S1 -H5GLOBAL_mp_H5T_C_S1 -H5GLOBAL_mp_H5T_NATIVE_INTEGER_KIND -H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 -; -; H5generic flags declaration -; -H5GLOBAL_mp_H5_INDEX_UNKNOWN_F -H5GLOBAL_mp_H5_INDEX_NAME_F -H5GLOBAL_mp_H5_INDEX_CRT_ORDER_F -H5GLOBAL_mp_H5_INDEX_N_F -H5GLOBAL_mp_H5_ITER_UNKNOWN_F -H5GLOBAL_mp_H5_ITER_INC_F -H5GLOBAL_mp_H5_ITER_DEC_F -H5GLOBAL_mp_H5_ITER_NATIVE_F -H5GLOBAL_mp_H5_ITER_N_F -H5GLOBAL_mp_HADDR_UNDEF_F -; -; H5F flags declaration -; -H5GLOBAL_mp_H5F_ACC_RDWR_F -H5GLOBAL_mp_H5F_ACC_RDONLY_F -H5GLOBAL_mp_H5F_ACC_TRUNC_F -H5GLOBAL_mp_H5F_ACC_EXCL_F -H5GLOBAL_mp_H5F_ACC_DEBUG_F -H5GLOBAL_mp_H5F_SCOPE_LOCAL_F -H5GLOBAL_mp_H5F_SCOPE_GLOBAL_F -H5GLOBAL_mp_H5F_CLOSE_DEFAULT_F -H5GLOBAL_mp_H5F_CLOSE_WEAK_F -H5GLOBAL_mp_H5F_CLOSE_SEMI_F -H5GLOBAL_mp_H5F_CLOSE_STRONG_F -H5GLOBAL_mp_H5F_OBJ_FILE_F -H5GLOBAL_mp_H5F_OBJ_DATASET_F -H5GLOBAL_mp_H5F_OBJ_GROUP_F -H5GLOBAL_mp_H5F_OBJ_DATATYPE_F -H5GLOBAL_mp_H5F_OBJ_ALL_F -H5GLOBAL_mp_H5F_LIBVER_EARLIEST_F -H5GLOBAL_mp_H5F_LIBVER_LATEST_F -H5GLOBAL_mp_H5F_UNLIMITED_F -; -; H5G flags declaration -; -H5GLOBAL_mp_H5G_UNKNOWN_F -H5GLOBAL_mp_H5G_GROUP_F -H5GLOBAL_mp_H5G_DATASET_F -H5GLOBAL_mp_H5G_TYPE_F -H5GLOBAL_mp_H5G_LINK_F -H5GLOBAL_mp_H5G_UDLINK_F -H5GLOBAL_mp_H5G_SAME_LOC_F -H5GLOBAL_mp_H5G_LINK_ERROR_F -H5GLOBAL_mp_H5G_LINK_HARD_F -H5GLOBAL_mp_H5G_LINK_SOFT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_SYMBOL_TABLE_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_COMPACT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_DENSE_F -; -; H5D flags declaration -; -H5GLOBAL_mp_H5D_COMPACT_F -H5GLOBAL_mp_H5D_CONTIGUOUS_F -H5GLOBAL_mp_H5D_CHUNKED_F -H5GLOBAL_mp_H5D_ALLOC_TIME_ERROR_F -H5GLOBAL_mp_H5D_ALLOC_TIME_DEFAULT_F -H5GLOBAL_mp_H5D_ALLOC_TIME_EARLY_F -H5GLOBAL_mp_H5D_ALLOC_TIME_LATE_F -H5GLOBAL_mp_H5D_ALLOC_TIME_INCR_F -H5GLOBAL_mp_H5D_SPACE_STS_ERROR_F -H5GLOBAL_mp_H5D_SPACE_STS_NOT_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_PART_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_ALLOCATED_F -H5GLOBAL_mp_H5D_FILL_TIME_ERROR_F -H5GLOBAL_mp_H5D_FILL_TIME_ALLOC_F -H5GLOBAL_mp_H5D_FILL_TIME_NEVER_F -H5GLOBAL_mp_H5D_FILL_VALUE_ERROR_F -H5GLOBAL_mp_H5D_FILL_VALUE_UNDEFINED_F -H5GLOBAL_mp_H5D_FILL_VALUE_DEFAULT_F -H5GLOBAL_mp_H5D_FILL_VALUE_USER_DEFINED_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NSLOTS_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NBYTES_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_W0_DFLT_F -H5GLOBAL_mp_H5D_MPIO_NO_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_INDEPENDENT_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_MIXED_F -H5GLOBAL_mp_H5D_MPIO_CONTIG_COLLECTIVE_F -H5GLOBAL_mp_H5D_VDS_ERROR_F -H5GLOBAL_mp_H5D_VDS_FIRST_MISSING_F -H5GLOBAL_mp_H5D_VDS_LAST_AVAILABLE_F -H5GLOBAL_mp_H5D_VIRTUAL_F -; -; H5E flags declaration -; -H5GLOBAL_mp_H5E_DEFAULT_F -H5GLOBAL_mp_H5E_MAJOR_F -H5GLOBAL_mp_H5E_MINOR_F -H5GLOBAL_mp_H5E_WALK_UPWARD_F -H5GLOBAL_mp_H5E_WALK_DOWNWARD_F -; -; H5FD file drivers flags declaration -; -H5GLOBAL_mp_H5FD_MPIO_INDEPENDENT_F -H5GLOBAL_mp_H5FD_MPIO_COLLECTIVE_F -H5GLOBAL_mp_H5FD_MEM_NOLIST_F -H5GLOBAL_mp_H5FD_MEM_DEFAULT_F -H5GLOBAL_mp_H5FD_MEM_SUPER_F -H5GLOBAL_mp_H5FD_MEM_BTREE_F -H5GLOBAL_mp_H5FD_MEM_DRAW_F -H5GLOBAL_mp_H5FD_MEM_GHEAP_F -H5GLOBAL_mp_H5FD_MEM_LHEAP_F -H5GLOBAL_mp_H5FD_MEM_OHDR_F -H5GLOBAL_mp_H5FD_MEM_NTYPES_F -H5GLOBAL_mp_H5FD_CORE_F -H5GLOBAL_mp_H5FD_FAMILY_F -H5GLOBAL_mp_H5FD_LOG_F -H5GLOBAL_mp_H5FD_MPIO_F -H5GLOBAL_mp_H5FD_MULTI_F -H5GLOBAL_mp_H5FD_SEC2_F -H5GLOBAL_mp_H5FD_STDIO_F -; -; H5I flags declaration -; -H5GLOBAL_mp_H5I_FILE_F -H5GLOBAL_mp_H5I_GROUP_F -H5GLOBAL_mp_H5I_DATATYPE_F -H5GLOBAL_mp_H5I_DATASPACE_F -H5GLOBAL_mp_H5I_DATASET_F -H5GLOBAL_mp_H5I_ATTR_F -H5GLOBAL_mp_H5I_BADID_F -; -; H5L flags declaration -; -H5GLOBAL_mp_H5L_TYPE_ERROR_F -H5GLOBAL_mp_H5L_TYPE_HARD_F -H5GLOBAL_mp_H5L_TYPE_SOFT_F -H5GLOBAL_mp_H5L_TYPE_EXTERNAL_F -H5GLOBAL_mp_H5L_SAME_LOC_F -H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F -; -; H5O flags declaration -; -H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F -H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F -H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F -H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F -H5GLOBAL_mp_H5O_COPY_ALL_F -H5GLOBAL_mp_H5O_SHMESG_NONE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_SDSPACE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_DTYPE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_FILL_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F -H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F -H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F -H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F -H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F -H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F -H5GLOBAL_mp_H5O_SHMESG_MAX_LIST_SIZE_F -H5GLOBAL_mp_H5O_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5O_TYPE_GROUP_F -H5GLOBAL_mp_H5O_TYPE_DATASET_F -H5GLOBAL_mp_H5O_TYPE_NAMED_DATATYPE_F -H5GLOBAL_mp_H5O_TYPE_NTYPES_F -; -; H5P flags declaration -; -H5GLOBAL_mp_H5P_FILE_CREATE_F -H5GLOBAL_mp_H5P_FILE_ACCESS_F -H5GLOBAL_mp_H5P_DATASET_CREATE_F -H5GLOBAL_mp_H5P_DATASET_XFER_F -H5GLOBAL_mp_H5P_FILE_MOUNT_F -H5GLOBAL_mp_H5P_DEFAULT_F -H5GLOBAL_mp_H5P_ROOT_F -H5GLOBAL_mp_H5P_OBJECT_CREATE_F -H5GLOBAL_mp_H5P_DATASET_ACCESS_F -H5GLOBAL_mp_H5P_GROUP_CREATE_F -H5GLOBAL_mp_H5P_GROUP_ACCESS_F -H5GLOBAL_mp_H5P_DATATYPE_CREATE_F -H5GLOBAL_mp_H5P_DATATYPE_ACCESS_F -H5GLOBAL_mp_H5P_STRING_CREATE_F -H5GLOBAL_mp_H5P_ATTRIBUTE_CREATE_F -H5GLOBAL_mp_H5P_OBJECT_COPY_F -H5GLOBAL_mp_H5P_LINK_CREATE_F -H5GLOBAL_mp_H5P_LINK_ACCESS_F -H5GLOBAL_mp_H5P_CRT_ORDER_INDEXED_F -H5GLOBAL_mp_H5P_CRT_ORDER_TRACKED_F -; -; H5R flags declaration -; -H5GLOBAL_mp_H5R_OBJECT_F -H5GLOBAL_mp_H5R_DATASET_REGION_F -; -; H5S flags declaration -; -H5GLOBAL_mp_H5S_UNLIMITED_F -H5GLOBAL_mp_H5S_ALL_F -H5GLOBAL_mp_H5S_SCALAR_F -H5GLOBAL_mp_H5S_SIMPLE_F -H5GLOBAL_mp_H5S_NULL_F -H5GLOBAL_mp_H5S_SELECT_NOOP_F -H5GLOBAL_mp_H5S_SELECT_SET_F -H5GLOBAL_mp_H5S_SELECT_OR_F -H5GLOBAL_mp_H5S_SELECT_AND_F -H5GLOBAL_mp_H5S_SELECT_XOR_F -H5GLOBAL_mp_H5S_SELECT_NOTB_F -H5GLOBAL_mp_H5S_SELECT_NOTA_F -H5GLOBAL_mp_H5S_SELECT_APPEND_F -H5GLOBAL_mp_H5S_SELECT_PREPEND_F -H5GLOBAL_mp_H5S_SELECT_INVALID_F -H5GLOBAL_mp_H5S_SEL_ERROR_F -H5GLOBAL_mp_H5S_SEL_NONE_F -H5GLOBAL_mp_H5S_SEL_POINTS_F -H5GLOBAL_mp_H5S_SEL_HYPERSLABS_F -H5GLOBAL_mp_H5S_SEL_ALL_F -; -; H5T flags declaration -; -H5GLOBAL_mp_H5T_NO_CLASS_F -H5GLOBAL_mp_H5T_INTEGER_F -H5GLOBAL_mp_H5T_FLOAT_F -H5GLOBAL_mp_H5T_TIME_F -H5GLOBAL_mp_H5T_STRING_F -H5GLOBAL_mp_H5T_BITFIELD_F -H5GLOBAL_mp_H5T_OPAQUE_F -H5GLOBAL_mp_H5T_COMPOUND_F -H5GLOBAL_mp_H5T_REFERENCE_F -H5GLOBAL_mp_H5T_ENUM_F -H5GLOBAL_mp_H5T_VLEN_F -H5GLOBAL_mp_H5T_ARRAY_F -H5GLOBAL_mp_H5T_ORDER_LE_F -H5GLOBAL_mp_H5T_ORDER_BE_F -H5GLOBAL_mp_H5T_ORDER_VAX_F -H5GLOBAL_mp_H5T_ORDER_NONE_F -H5GLOBAL_mp_H5T_ORDER_MIXED_F -H5GLOBAL_mp_H5T_PAD_ZERO_F -H5GLOBAL_mp_H5T_PAD_ONE_F -H5GLOBAL_mp_H5T_PAD_BACKGROUND_F -H5GLOBAL_mp_H5T_PAD_ERROR_F -H5GLOBAL_mp_H5T_SGN_NONE_F -H5GLOBAL_mp_H5T_SGN_2_F -H5GLOBAL_mp_H5T_SGN_ERROR_F -H5GLOBAL_mp_H5T_NORM_IMPLIED_F -H5GLOBAL_mp_H5T_NORM_MSBSET_F -H5GLOBAL_mp_H5T_NORM_NONE_F -H5GLOBAL_mp_H5T_CSET_ASCII_F -H5GLOBAL_mp_H5T_CSET_UTF8_F -H5GLOBAL_mp_H5T_STR_NULLTERM_F -H5GLOBAL_mp_H5T_STR_NULLPAD_F -H5GLOBAL_mp_H5T_STR_SPACEPAD_F -H5GLOBAL_mp_H5T_STR_ERROR_F -H5GLOBAL_mp_H5T_DIR_ASCEND_F -H5GLOBAL_mp_H5T_DIR_DESCEND_F -; -; H5Z flags declaration -; -H5GLOBAL_mp_H5Z_FILTER_ERROR_F -H5GLOBAL_mp_H5Z_FILTER_NONE_F -H5GLOBAL_mp_H5Z_FILTER_ALL_F -H5GLOBAL_mp_H5Z_FILTER_DEFLATE_F -H5GLOBAL_mp_H5Z_FILTER_SHUFFLE_F -H5GLOBAL_mp_H5Z_FILTER_FLETCHER32_F -H5GLOBAL_mp_H5Z_FILTER_SZIP_F -H5GLOBAL_mp_H5Z_ERROR_EDC_F -H5GLOBAL_mp_H5Z_DISABLE_EDC_F -H5GLOBAL_mp_H5Z_ENABLE_EDC_F -H5GLOBAL_mp_H5Z_NO_EDC_F -H5GLOBAL_mp_H5Z_FLAG_OPTIONAL_F -H5GLOBAL_mp_H5Z_FILTER_ENCODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_DECODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_NBIT_F -H5GLOBAL_mp_H5Z_FILTER_SCALEOFFSET_F -H5GLOBAL_mp_H5Z_SO_FLOAT_DSCALE_F -H5GLOBAL_mp_H5Z_SO_FLOAT_ESCALE_F -H5GLOBAL_mp_H5Z_SO_INT_F -H5GLOBAL_mp_H5Z_SO_INT_MINBITS_DEFAULT_F -; -; H5 Library flags declaration -; -H5GLOBAL_mp_H5_SZIP_EC_OM_F -H5GLOBAL_mp_H5_SZIP_NN_OM_F -; -; PROCEDURES -; -------------- -; ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F -- cgit v0.12 From 23cec838a410deaf8be6a9ce76d2865a078a7d51 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 5 Dec 2017 10:29:53 -0600 Subject: clean-up --- fortran/src/H5f90global.F90 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 3f00d9a..078778a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -70,16 +70,10 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - ! Do not forget to change this value when new predefined + ! Do not forget to change these values when new predefined ! datatypes are added INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 - - ! Do not forget to change the following line when new predefined - ! floating data types are added INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4 - - ! Do not forget to change the following line when new predefined - ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in -- cgit v0.12 From ec1e00a55f7b005fa9d87f92e58bc312286d0b8a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 5 Dec 2017 10:41:54 -0800 Subject: Normalization with VOL integration branch. --- src/H5.c | 24 ++++++------- src/H5Fint.c | 2 +- src/H5Fmount.c | 7 ++-- src/H5Fpkg.h | 25 ++++++------- src/H5Fprivate.h | 4 +-- src/H5Fquery.c | 8 ++--- src/H5Pprivate.h | 12 ++++--- src/hdf5.h | 52 +++++++++++++-------------- test/h5test.c | 107 ++++++++++++++++++++++--------------------------------- 9 files changed, 109 insertions(+), 132 deletions(-) diff --git a/src/H5.c b/src/H5.c index f0a222d..b8fd885 100644 --- a/src/H5.c +++ b/src/H5.c @@ -19,18 +19,18 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free lists */ -#include "H5FSprivate.h" /* File free space */ -#include "H5Lprivate.h" /* Links */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5SLprivate.h" /* Skip lists */ -#include "H5Tprivate.h" /* Datatypes */ -#include "H5FSprivate.h" /* File free space */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5FSprivate.h" /* File free space */ +#include "H5Lprivate.h" /* Links */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5SLprivate.h" /* Skip lists */ +#include "H5Tprivate.h" /* Datatypes */ +#include "H5FSprivate.h" /* File free space */ /****************/ /* Local Macros */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 0eb1ea9..8212eb5 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1574,7 +1574,7 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi * * Purpose: Flushes cached data. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 3cd5c21..17d7850 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -25,9 +25,6 @@ #include "H5MMprivate.h" /* Memory management */ /* PRIVATE PROTOTYPES */ -static herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, - hid_t plist_id, hid_t dxpl_id); -static herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id); static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); @@ -99,7 +96,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED plist_id, hid_t dxpl_id) { @@ -265,7 +262,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) { H5G_t *child_group = NULL; /* Child's group in parent mtab */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index d702506..b50b4e5 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -360,16 +360,16 @@ struct H5F_file_t { * to shared H5F_file_t structs. */ struct H5F_t { - char *open_name; /* Name used to open file */ - char *actual_name; /* Actual name of the file, after resolving symlinks, etc. */ - char *extpath; /* Path for searching target external link file */ - H5F_file_t *shared; /* The shared file info */ - unsigned nopen_objs; /* Number of open object headers*/ - H5FO_t *obj_count; /* # of time each object is opened through top file structure */ - hid_t file_id; /* ID of this file */ - hbool_t closing; /* File is in the process of being closed */ - struct H5F_t *parent; /* Parent file that this file is mounted to */ - unsigned nmounts; /* Number of children mounted to this file */ + char *open_name; /* Name used to open file */ + char *actual_name; /* Actual name of the file, after resolving symlinks, etc. */ + char *extpath; /* Path for searching target external link file */ + H5F_file_t *shared; /* The shared file info */ + unsigned nopen_objs; /* Number of open object headers */ + H5FO_t *obj_count; /* # of time each object is opened through top file structure */ + hid_t file_id; /* ID of this file */ + hbool_t closing; /* File is in the process of being closed */ + struct H5F_t *parent; /* Parent file that this file is mounted to */ + unsigned nmounts; /* Number of children mounted to this file */ #ifdef H5_HAVE_PARALLEL H5P_coll_md_read_flag_t coll_md_read; /* Do all metadata reads collectively */ hbool_t coll_md_write; /* Do all metadata writes collectively */ @@ -399,11 +399,12 @@ H5_DLL herr_t H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t H5_DLL herr_t H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing); H5_DLL htri_t H5F__is_hdf5(const char *name, hid_t meta_dxpl_id, hid_t raw_dxpl_id); H5_DLL herr_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); -H5_DLL ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, - hid_t meta_dxpl_id, hid_t raw_dxpl_id); +H5_DLL ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_id, hid_t raw_dxpl_id); H5_DLL herr_t H5F_close(H5F_t *f); /* File mount related routines */ +H5_DLL herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id, hid_t dxpl_id); +H5_DLL herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id); H5_DLL herr_t H5F_close_mounts(H5F_t *f); H5_DLL int H5F_term_unmount_cb(void *obj_ptr, hid_t obj_id, void *key); H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 18d0460..daf0a52 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -586,7 +586,7 @@ typedef struct H5F_t H5F_t; #define H5_SIZEOF_CHKSUM 4 /* v1 B-tree node signature */ -#define H5B_MAGIC "TREE" +#define H5B_MAGIC "TREE" /* v2 B-tree signatures */ #define H5B2_HDR_MAGIC "BTHD" /* Header */ @@ -616,7 +616,7 @@ typedef struct H5F_t H5F_t; #define H5HF_DBLOCK_MAGIC "FHDB" /* Direct block */ /* Global heap signature */ -#define H5HG_MAGIC "GCOL" +#define H5HG_MAGIC "GCOL" /* Local heap signature */ #define H5HL_MAGIC "HEAP" diff --git a/src/H5Fquery.c b/src/H5Fquery.c index cc2399b..61b4183 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -32,10 +32,10 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ /****************/ diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index a468464..374c117 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -17,6 +17,9 @@ #ifndef _H5Pprivate_H #define _H5Pprivate_H +/* Early typedefs to avoid circular dependencies */ +typedef struct H5P_genplist_t H5P_genplist_t; + /* Include package's public header */ #include "H5Ppublic.h" @@ -52,12 +55,7 @@ typedef enum H5P_coll_md_read_flag_t { H5P_USER_TRUE = 1 } H5P_coll_md_read_flag_t; -/* Forward declarations (for prototypes & type definitions) */ -struct H5O_fill_t; -struct H5T_t; - /* Forward declarations for anonymous H5P objects */ -typedef struct H5P_genplist_t H5P_genplist_t; typedef struct H5P_genclass_t H5P_genclass_t; typedef enum H5P_plist_type_t { @@ -145,6 +143,10 @@ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_FACC[1]; /* File access */ /* Library Private Prototypes */ /******************************/ +/* Forward declaration of structs used below */ +struct H5O_fill_t; +struct H5T_t; + /* Package initialization routine */ H5_DLL herr_t H5P_init(void); diff --git a/src/hdf5.h b/src/hdf5.h index fc4541a..1709375 100644 --- a/src/hdf5.h +++ b/src/hdf5.h @@ -20,35 +20,35 @@ #define _HDF5_H #include "H5public.h" -#include "H5Apublic.h" /* Attributes */ -#include "H5ACpublic.h" /* Metadata cache */ -#include "H5Dpublic.h" /* Datasets */ -#include "H5Epublic.h" /* Errors */ -#include "H5Fpublic.h" /* Files */ -#include "H5FDpublic.h" /* File drivers */ -#include "H5Gpublic.h" /* Groups */ -#include "H5Ipublic.h" /* ID management */ -#include "H5Lpublic.h" /* Links */ -#include "H5MMpublic.h" /* Memory management */ -#include "H5Opublic.h" /* Object headers */ -#include "H5Ppublic.h" /* Property lists */ -#include "H5PLpublic.h" /* Plugins */ -#include "H5Rpublic.h" /* References */ -#include "H5Spublic.h" /* Dataspaces */ -#include "H5Tpublic.h" /* Datatypes */ -#include "H5Zpublic.h" /* Data filters */ +#include "H5Apublic.h" /* Attributes */ +#include "H5ACpublic.h" /* Metadata cache */ +#include "H5Dpublic.h" /* Datasets */ +#include "H5Epublic.h" /* Errors */ +#include "H5Fpublic.h" /* Files */ +#include "H5FDpublic.h" /* File drivers */ +#include "H5Gpublic.h" /* Groups */ +#include "H5Ipublic.h" /* ID management */ +#include "H5Lpublic.h" /* Links */ +#include "H5MMpublic.h" /* Memory management */ +#include "H5Opublic.h" /* Object headers */ +#include "H5Ppublic.h" /* Property lists */ +#include "H5PLpublic.h" /* Plugins */ +#include "H5Rpublic.h" /* References */ +#include "H5Spublic.h" /* Dataspaces */ +#include "H5Tpublic.h" /* Datatypes */ +#include "H5Zpublic.h" /* Data filters */ /* Predefined file drivers */ -#include "H5FDcore.h" /* Files stored entirely in memory */ -#include "H5FDdirect.h" /* Linux direct I/O */ -#include "H5FDfamily.h" /* File families */ -#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */ -#include "H5FDmpi.h" /* MPI-based file drivers */ -#include "H5FDmulti.h" /* Usage-partitioned file family */ -#include "H5FDsec2.h" /* POSIX unbuffered file I/O */ -#include "H5FDstdio.h" /* Standard C buffered I/O */ +#include "H5FDcore.h" /* Files stored entirely in memory */ +#include "H5FDdirect.h" /* Linux direct I/O */ +#include "H5FDfamily.h" /* File families */ +#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */ +#include "H5FDmpi.h" /* MPI-based file drivers */ +#include "H5FDmulti.h" /* Usage-partitioned file family */ +#include "H5FDsec2.h" /* POSIX unbuffered file I/O */ +#include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS -#include "H5FDwindows.h" /* Windows buffered I/O */ +#include "H5FDwindows.h" /* Win32 I/O */ #endif #endif diff --git a/test/h5test.c b/test/h5test.c index af45589..bbdd58b 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -104,68 +104,6 @@ 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 @@ -1890,6 +1828,33 @@ error: return FAIL; } /* h5_wait_message() */ +/* Functions for the dummy VFD class (see below). + * + * Useful 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; } + + /*------------------------------------------------------------------------- * Function: h5_get_dummy_vfd_class() * @@ -1913,12 +1878,24 @@ error: H5FD_class_t * h5_get_dummy_vfd_class(void) { - H5FD_class_t *vfd_class = NULL; + H5FD_class_t *vfd_class = NULL; /* Dummy VFD that will be returned */ - if(NULL == (vfd_class = (H5FD_class_t *)HDmalloc(sizeof(H5FD_class_t)))) + /* Create the class and initialize everything to zero/NULL */ + if(NULL == (vfd_class = (H5FD_class_t *)HDcalloc((size_t)1, sizeof(H5FD_class_t)))) TEST_ERROR; - HDmemcpy(vfd_class, &dummy_vfd_class_g, sizeof(H5FD_class_t)); + /* Fill in the minimum parameters to make a VFD that + * can be registered. + */ + vfd_class->name = "dummy"; + vfd_class->maxaddr = 1; + vfd_class->open = dummy_vfd_open; + vfd_class->close = dummy_vfd_close; + vfd_class->get_eoa = dummy_vfd_get_eoa; + vfd_class->set_eoa = dummy_vfd_set_eoa; + vfd_class->get_eof = dummy_vfd_get_eof; + vfd_class->read = dummy_vfd_read; + vfd_class->write = dummy_vfd_write; return vfd_class; -- cgit v0.12 From 19507b91d53dd7ee17fd26d10e672af26178110c Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:26:19 -0600 Subject: removed duplicate exports of DS subroutines added missing parameter added missing parameter removed parameters moved dll export to Module clean-up --- fortran/src/H5f90global.F90 | 350 +++++++++++++++++++++++++++++++++++-- fortran/src/hdf5_fortrandll.def.in | 331 ----------------------------------- hl/fortran/src/H5DSff.F90 | 65 +------ 3 files changed, 340 insertions(+), 406 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 9054522..078778a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -70,16 +70,10 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - ! Do not forget to change this value when new predefined + ! Do not forget to change these values when new predefined ! datatypes are added INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 - - ! Do not forget to change the following line when new predefined - ! floating data types are added INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4 - - ! Do not forget to change the following line when new predefined - ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in @@ -88,7 +82,56 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 - ! + + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_FLOAT + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_LONG_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_CHARACTER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_OBJ + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_DSETREG + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B8 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B16 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B32 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B64 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FORTRAN_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_C_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER_KIND + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_FLOAT_128 + !DEC$endif + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE @@ -142,6 +185,19 @@ MODULE H5GLOBAL ! ! H5generic flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_NAME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_CRT_ORDER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_N_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_INC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_DEC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_NATIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_N_F + !DEC$ATTRIBUTES DLLEXPORT :: HADDR_UNDEF_F + !DEC$endif + INTEGER :: H5_INDEX_UNKNOWN_F INTEGER :: H5_INDEX_NAME_F INTEGER :: H5_INDEX_CRT_ORDER_F @@ -156,6 +212,28 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDWR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDONLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_TRUNC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_EXCL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_DEBUG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_LOCAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_GLOBAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_WEAK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_SEMI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_STRONG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_EARLIEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_LATEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_UNLIMITED_F + !DEC$endif + INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -178,6 +256,23 @@ MODULE H5GLOBAL ! ! H5G flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_TYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UDLINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_DENSE_F + !DEC$endif + INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -195,6 +290,40 @@ MODULE H5GLOBAL ! ! H5D flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5D_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CONTIGUOUS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNKED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_EARLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_LATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_INCR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_NOT_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_PART_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ALLOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_NEVER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_UNDEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_USER_DEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_W0_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_NO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CONTIG_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_FIRST_MISSING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_LAST_AVAILABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VIRTUAL_F + !DEC$endif + INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -219,11 +348,11 @@ MODULE H5GLOBAL INTEGER :: H5D_FILL_VALUE_DEFAULT_F INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F -! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 -! characters for variable names in Fortran. -! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 -! characters for variable names in Fortran. - + ! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 + ! characters for variable names in Fortran. + ! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 + ! characters for variable names in Fortran. + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F @@ -240,6 +369,14 @@ MODULE H5GLOBAL ! ! H5E flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5E_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MAJOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MINOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_UPWARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_DOWNWARD_F + !DEC$endif + INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F @@ -248,6 +385,27 @@ MODULE H5GLOBAL ! ! H5FD file drivers flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NOLIST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_SUPER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_BTREE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DRAW_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_GHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_LHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_OHDR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NTYPES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_CORE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_FAMILY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_LOG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MULTI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_SEC2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_STDIO_F + !DEC$endif + INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -269,6 +427,16 @@ MODULE H5GLOBAL ! ! H5I flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5I_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASPACE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_ATTR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_BADID_F + !DEC$endif + INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -279,6 +447,15 @@ MODULE H5GLOBAL ! ! H5L flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_EXTERNAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_LINK_CLASS_T_VERS_F + !DEC$endif + INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F @@ -288,6 +465,36 @@ MODULE H5GLOBAL ! ! H5O flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_SHALLOW_HIERARCHY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_SOFT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_EXT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_WITHOUT_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_PRESERVE_NULL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_NONE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_SDSPACE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_DTYPE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_FILL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_PLINE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ALL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_CHUNK0_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_STORE_PHASE_CHA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_STORE_TIMES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ALL_FLAGS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_NINDEXES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_LIST_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NAMED_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NTYPES_F + !DEC$endif + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -318,6 +525,29 @@ MODULE H5GLOBAL ! ! H5P flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_XFER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_MOUNT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ROOT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_STRING_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ATTRIBUTE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_COPY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_INDEXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_TRACKED_F + !DEC$endif + INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -342,11 +572,39 @@ MODULE H5GLOBAL ! ! H5R flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5R_OBJECT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5R_DATASET_REGION_F + !DEC$endif + INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F ! ! H5S flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5S_UNLIMITED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SCALAR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SIMPLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_NULL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOOP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_SET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_OR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_AND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_XOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTB_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_APPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_PREPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_INVALID_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_POINTS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_HYPERSLABS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ALL_F + !DEC$endif + INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -374,6 +632,44 @@ MODULE H5GLOBAL ! ! H5T flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NO_CLASS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_INTEGER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_TIME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_BITFIELD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_OPAQUE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_COMPOUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ENUM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_VLEN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ARRAY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_LE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_BE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_VAX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ZERO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_BACKGROUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_IMPLIED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_MSBSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_ASCII_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_UTF8_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLTERM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_SPACEPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_ASCEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_DESCEND_F + !DEC$endif + INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -412,6 +708,29 @@ MODULE H5GLOBAL ! ! H5Z flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DEFLATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SHUFFLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_FLETCHER32_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SZIP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ERROR_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_DISABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ENABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_NO_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FLAG_OPTIONAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ENCODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DECODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NBIT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SCALEOFFSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_DSCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_ESCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_MINBITS_DEFAULT_F + !DEC$endif + INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -435,6 +754,11 @@ MODULE H5GLOBAL ! ! H5 Library flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_EC_OM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_NN_OM_F + !DEC$endif + INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 585602f..3a5a91f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,335 +1,4 @@ EXPORTS -; H5GLOBAL -H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT -H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_INTEGER -H5GLOBAL_mp_H5T_NATIVE_REAL -H5GLOBAL_mp_H5T_NATIVE_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_CHARACTER -H5GLOBAL_mp_H5T_STD_REF_OBJ -H5GLOBAL_mp_H5T_STD_REF_DSETREG -H5GLOBAL_mp_H5T_IEEE_F32BE -H5GLOBAL_mp_H5T_IEEE_F32LE -H5GLOBAL_mp_H5T_IEEE_F64BE -H5GLOBAL_mp_H5T_IEEE_F64LE -H5GLOBAL_mp_H5T_STD_I8BE -H5GLOBAL_mp_H5T_STD_I8LE -H5GLOBAL_mp_H5T_STD_I16BE -H5GLOBAL_mp_H5T_STD_I16LE -H5GLOBAL_mp_H5T_STD_I32BE -H5GLOBAL_mp_H5T_STD_I32LE -H5GLOBAL_mp_H5T_STD_I64BE -H5GLOBAL_mp_H5T_STD_I64LE -H5GLOBAL_mp_H5T_STD_U8BE -H5GLOBAL_mp_H5T_STD_U8LE -H5GLOBAL_mp_H5T_STD_U16BE -H5GLOBAL_mp_H5T_STD_U16LE -H5GLOBAL_mp_H5T_STD_U32BE -H5GLOBAL_mp_H5T_STD_U32LE -H5GLOBAL_mp_H5T_STD_U64BE -H5GLOBAL_mp_H5T_STD_U64LE -H5GLOBAL_mp_H5T_STRING -H5GLOBAL_mp_H5T_STD_B8BE -H5GLOBAL_mp_H5T_STD_B8LE -H5GLOBAL_mp_H5T_STD_B16BE -H5GLOBAL_mp_H5T_STD_B16LE -H5GLOBAL_mp_H5T_STD_B32BE -H5GLOBAL_mp_H5T_STD_B32LE -H5GLOBAL_mp_H5T_STD_B64BE -H5GLOBAL_mp_H5T_STD_B64LE -H5GLOBAL_mp_H5T_NATIVE_B8 -H5GLOBAL_mp_H5T_NATIVE_B16 -H5GLOBAL_mp_H5T_NATIVE_B32 -H5GLOBAL_mp_H5T_NATIVE_B64 -H5GLOBAL_mp_H5T_FORTRAN_S1 -H5GLOBAL_mp_H5T_C_S1 -H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 -; -; H5generic flags declaration -; -H5GLOBAL_mp_H5_INDEX_UNKNOWN_F -H5GLOBAL_mp_H5_INDEX_NAME_F -H5GLOBAL_mp_H5_INDEX_CRT_ORDER_F -H5GLOBAL_mp_H5_INDEX_N_F -H5GLOBAL_mp_H5_ITER_UNKNOWN_F -H5GLOBAL_mp_H5_ITER_INC_F -H5GLOBAL_mp_H5_ITER_DEC_F -H5GLOBAL_mp_H5_ITER_NATIVE_F -H5GLOBAL_mp_H5_ITER_N_F -H5GLOBAL_mp_HADDR_UNDEF_F -; -; H5F flags declaration -; -H5GLOBAL_mp_H5F_ACC_RDWR_F -H5GLOBAL_mp_H5F_ACC_RDONLY_F -H5GLOBAL_mp_H5F_ACC_TRUNC_F -H5GLOBAL_mp_H5F_ACC_EXCL_F -H5GLOBAL_mp_H5F_ACC_DEBUG_F -H5GLOBAL_mp_H5F_SCOPE_LOCAL_F -H5GLOBAL_mp_H5F_SCOPE_GLOBAL_F -H5GLOBAL_mp_H5F_CLOSE_DEFAULT_F -H5GLOBAL_mp_H5F_CLOSE_WEAK_F -H5GLOBAL_mp_H5F_CLOSE_SEMI_F -H5GLOBAL_mp_H5F_CLOSE_STRONG_F -H5GLOBAL_mp_H5F_OBJ_FILE_F -H5GLOBAL_mp_H5F_OBJ_DATASET_F -H5GLOBAL_mp_H5F_OBJ_GROUP_F -H5GLOBAL_mp_H5F_OBJ_DATATYPE_F -H5GLOBAL_mp_H5F_OBJ_ALL_F -H5GLOBAL_mp_H5F_LIBVER_EARLIEST_F -H5GLOBAL_mp_H5F_LIBVER_LATEST_F -H5GLOBAL_mp_H5F_UNLIMITED_F -; -; H5G flags declaration -; -H5GLOBAL_mp_H5G_UNKNOWN_F -H5GLOBAL_mp_H5G_GROUP_F -H5GLOBAL_mp_H5G_DATASET_F -H5GLOBAL_mp_H5G_TYPE_F -H5GLOBAL_mp_H5G_LINK_F -H5GLOBAL_mp_H5G_UDLINK_F -H5GLOBAL_mp_H5G_SAME_LOC_F -H5GLOBAL_mp_H5G_LINK_ERROR_F -H5GLOBAL_mp_H5G_LINK_HARD_F -H5GLOBAL_mp_H5G_LINK_SOFT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_SYMBOL_TABLE_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_COMPACT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_DENSE_F -; -; H5D flags declaration -; -H5GLOBAL_mp_H5D_COMPACT_F -H5GLOBAL_mp_H5D_CONTIGUOUS_F -H5GLOBAL_mp_H5D_CHUNKED_F -H5GLOBAL_mp_H5D_ALLOC_TIME_ERROR_F -H5GLOBAL_mp_H5D_ALLOC_TIME_DEFAULT_F -H5GLOBAL_mp_H5D_ALLOC_TIME_EARLY_F -H5GLOBAL_mp_H5D_ALLOC_TIME_LATE_F -H5GLOBAL_mp_H5D_ALLOC_TIME_INCR_F -H5GLOBAL_mp_H5D_SPACE_STS_ERROR_F -H5GLOBAL_mp_H5D_SPACE_STS_NOT_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_PART_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_ALLOCATED_F -H5GLOBAL_mp_H5D_FILL_TIME_ERROR_F -H5GLOBAL_mp_H5D_FILL_TIME_ALLOC_F -H5GLOBAL_mp_H5D_FILL_TIME_NEVER_F -H5GLOBAL_mp_H5D_FILL_VALUE_ERROR_F -H5GLOBAL_mp_H5D_FILL_VALUE_UNDEFINED_F -H5GLOBAL_mp_H5D_FILL_VALUE_DEFAULT_F -H5GLOBAL_mp_H5D_FILL_VALUE_USER_DEFINED_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NSLOTS_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NBYTES_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_W0_DFLT_F -H5GLOBAL_mp_H5D_MPIO_NO_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_INDEPENDENT_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_MIXED_F -H5GLOBAL_mp_H5D_MPIO_CONTIG_COLLECTIVE_F -H5GLOBAL_mp_H5D_VDS_ERROR_F -H5GLOBAL_mp_H5D_VDS_FIRST_MISSING_F -H5GLOBAL_mp_H5D_VDS_LAST_AVAILABLE_F -H5GLOBAL_mp_H5D_VIRTUAL_F -; -; H5E flags declaration -; -H5GLOBAL_mp_H5E_DEFAULT_F -H5GLOBAL_mp_H5E_MAJOR_F -H5GLOBAL_mp_H5E_MINOR_F -H5GLOBAL_mp_H5E_WALK_UPWARD_F -H5GLOBAL_mp_H5E_WALK_DOWNWARD_F -; -; H5FD file drivers flags declaration -; -H5GLOBAL_mp_H5FD_MPIO_INDEPENDENT_F -H5GLOBAL_mp_H5FD_MPIO_COLLECTIVE_F -H5GLOBAL_mp_H5FD_MEM_NOLIST_F -H5GLOBAL_mp_H5FD_MEM_DEFAULT_F -H5GLOBAL_mp_H5FD_MEM_SUPER_F -H5GLOBAL_mp_H5FD_MEM_BTREE_F -H5GLOBAL_mp_H5FD_MEM_DRAW_F -H5GLOBAL_mp_H5FD_MEM_GHEAP_F -H5GLOBAL_mp_H5FD_MEM_LHEAP_F -H5GLOBAL_mp_H5FD_MEM_OHDR_F -H5GLOBAL_mp_H5FD_MEM_NTYPES_F -H5GLOBAL_mp_H5FD_CORE_F -H5GLOBAL_mp_H5FD_FAMILY_F -H5GLOBAL_mp_H5FD_LOG_F -H5GLOBAL_mp_H5FD_MPIO_F -H5GLOBAL_mp_H5FD_MULTI_F -H5GLOBAL_mp_H5FD_SEC2_F -H5GLOBAL_mp_H5FD_STDIO_F -; -; H5I flags declaration -; -H5GLOBAL_mp_H5I_FILE_F -H5GLOBAL_mp_H5I_GROUP_F -H5GLOBAL_mp_H5I_DATATYPE_F -H5GLOBAL_mp_H5I_DATASPACE_F -H5GLOBAL_mp_H5I_DATASET_F -H5GLOBAL_mp_H5I_ATTR_F -H5GLOBAL_mp_H5I_BADID_F -; -; H5L flags declaration -; -H5GLOBAL_mp_H5L_TYPE_ERROR_F -H5GLOBAL_mp_H5L_TYPE_HARD_F -H5GLOBAL_mp_H5L_TYPE_SOFT_F -H5GLOBAL_mp_H5L_TYPE_EXTERNAL_F -H5GLOBAL_mp_H5L_SAME_LOC_F -H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F -; -; H5O flags declaration -; -H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F -H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F -H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F -H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F -H5GLOBAL_mp_H5O_COPY_ALL_F -H5GLOBAL_mp_H5O_SHMESG_NONE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_SDSPACE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_DTYPE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_FILL_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F -H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F -H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F -H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F -H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F -H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F -H5GLOBAL_mp_H5O_SHMESG_MAX_LIST_SIZE_F -H5GLOBAL_mp_H5O_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5O_TYPE_GROUP_F -H5GLOBAL_mp_H5O_TYPE_DATASET_F -H5GLOBAL_mp_H5O_TYPE_NAMED_DATATYPE_F -H5GLOBAL_mp_H5O_TYPE_NTYPES_F -; -; H5P flags declaration -; -H5GLOBAL_mp_H5P_FILE_CREATE_F -H5GLOBAL_mp_H5P_FILE_ACCESS_F -H5GLOBAL_mp_H5P_DATASET_CREATE_F -H5GLOBAL_mp_H5P_DATASET_XFER_F -H5GLOBAL_mp_H5P_FILE_MOUNT_F -H5GLOBAL_mp_H5P_DEFAULT_F -H5GLOBAL_mp_H5P_ROOT_F -H5GLOBAL_mp_H5P_OBJECT_CREATE_F -H5GLOBAL_mp_H5P_DATASET_ACCESS_F -H5GLOBAL_mp_H5P_GROUP_CREATE_F -H5GLOBAL_mp_H5P_GROUP_ACCESS_F -H5GLOBAL_mp_H5P_DATATYPE_CREATE_F -H5GLOBAL_mp_H5P_DATATYPE_ACCESS_F -H5GLOBAL_mp_H5P_STRING_CREATE_F -H5GLOBAL_mp_H5P_ATTRIBUTE_CREATE_F -H5GLOBAL_mp_H5P_OBJECT_COPY_F -H5GLOBAL_mp_H5P_LINK_CREATE_F -H5GLOBAL_mp_H5P_LINK_ACCESS_F -H5GLOBAL_mp_H5P_CRT_ORDER_INDEXED_F -H5GLOBAL_mp_H5P_CRT_ORDER_TRACKED_F -; -; H5R flags declaration -; -H5GLOBAL_mp_H5R_OBJECT_F -H5GLOBAL_mp_H5R_DATASET_REGION_F -; -; H5S flags declaration -; -H5GLOBAL_mp_H5S_UNLIMITED_F -H5GLOBAL_mp_H5S_ALL_F -H5GLOBAL_mp_H5S_SCALAR_F -H5GLOBAL_mp_H5S_SIMPLE_F -H5GLOBAL_mp_H5S_NULL_F -H5GLOBAL_mp_H5S_SELECT_NOOP_F -H5GLOBAL_mp_H5S_SELECT_SET_F -H5GLOBAL_mp_H5S_SELECT_OR_F -H5GLOBAL_mp_H5S_SELECT_AND_F -H5GLOBAL_mp_H5S_SELECT_XOR_F -H5GLOBAL_mp_H5S_SELECT_NOTB_F -H5GLOBAL_mp_H5S_SELECT_NOTA_F -H5GLOBAL_mp_H5S_SELECT_APPEND_F -H5GLOBAL_mp_H5S_SELECT_PREPEND_F -H5GLOBAL_mp_H5S_SELECT_INVALID_F -H5GLOBAL_mp_H5S_SEL_ERROR_F -H5GLOBAL_mp_H5S_SEL_NONE_F -H5GLOBAL_mp_H5S_SEL_POINTS_F -H5GLOBAL_mp_H5S_SEL_HYPERSLABS_F -H5GLOBAL_mp_H5S_SEL_ALL_F -; -; H5T flags declaration -; -H5GLOBAL_mp_H5T_NO_CLASS_F -H5GLOBAL_mp_H5T_INTEGER_F -H5GLOBAL_mp_H5T_FLOAT_F -H5GLOBAL_mp_H5T_TIME_F -H5GLOBAL_mp_H5T_STRING_F -H5GLOBAL_mp_H5T_BITFIELD_F -H5GLOBAL_mp_H5T_OPAQUE_F -H5GLOBAL_mp_H5T_COMPOUND_F -H5GLOBAL_mp_H5T_REFERENCE_F -H5GLOBAL_mp_H5T_ENUM_F -H5GLOBAL_mp_H5T_VLEN_F -H5GLOBAL_mp_H5T_ARRAY_F -H5GLOBAL_mp_H5T_ORDER_LE_F -H5GLOBAL_mp_H5T_ORDER_BE_F -H5GLOBAL_mp_H5T_ORDER_VAX_F -H5GLOBAL_mp_H5T_ORDER_NONE_F -H5GLOBAL_mp_H5T_ORDER_MIXED_F -H5GLOBAL_mp_H5T_PAD_ZERO_F -H5GLOBAL_mp_H5T_PAD_ONE_F -H5GLOBAL_mp_H5T_PAD_BACKGROUND_F -H5GLOBAL_mp_H5T_PAD_ERROR_F -H5GLOBAL_mp_H5T_SGN_NONE_F -H5GLOBAL_mp_H5T_SGN_2_F -H5GLOBAL_mp_H5T_SGN_ERROR_F -H5GLOBAL_mp_H5T_NORM_IMPLIED_F -H5GLOBAL_mp_H5T_NORM_MSBSET_F -H5GLOBAL_mp_H5T_NORM_NONE_F -H5GLOBAL_mp_H5T_CSET_ASCII_F -H5GLOBAL_mp_H5T_CSET_UTF8_F -H5GLOBAL_mp_H5T_STR_NULLTERM_F -H5GLOBAL_mp_H5T_STR_NULLPAD_F -H5GLOBAL_mp_H5T_STR_SPACEPAD_F -H5GLOBAL_mp_H5T_STR_ERROR_F -H5GLOBAL_mp_H5T_DIR_ASCEND_F -H5GLOBAL_mp_H5T_DIR_DESCEND_F -; -; H5Z flags declaration -; -H5GLOBAL_mp_H5Z_FILTER_ERROR_F -H5GLOBAL_mp_H5Z_FILTER_NONE_F -H5GLOBAL_mp_H5Z_FILTER_ALL_F -H5GLOBAL_mp_H5Z_FILTER_DEFLATE_F -H5GLOBAL_mp_H5Z_FILTER_SHUFFLE_F -H5GLOBAL_mp_H5Z_FILTER_FLETCHER32_F -H5GLOBAL_mp_H5Z_FILTER_SZIP_F -H5GLOBAL_mp_H5Z_ERROR_EDC_F -H5GLOBAL_mp_H5Z_DISABLE_EDC_F -H5GLOBAL_mp_H5Z_ENABLE_EDC_F -H5GLOBAL_mp_H5Z_NO_EDC_F -H5GLOBAL_mp_H5Z_FLAG_OPTIONAL_F -H5GLOBAL_mp_H5Z_FILTER_ENCODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_DECODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_NBIT_F -H5GLOBAL_mp_H5Z_FILTER_SCALEOFFSET_F -H5GLOBAL_mp_H5Z_SO_FLOAT_DSCALE_F -H5GLOBAL_mp_H5Z_SO_FLOAT_ESCALE_F -H5GLOBAL_mp_H5Z_SO_INT_F -H5GLOBAL_mp_H5Z_SO_INT_MINBITS_DEFAULT_F -; -; H5 Library flags declaration -; -H5GLOBAL_mp_H5_SZIP_EC_OM_F -H5GLOBAL_mp_H5_SZIP_NN_OM_F -; -; PROCEDURES -; -------------- -; ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 index 4f0d040..2dca479 100644 --- a/hl/fortran/src/H5DSff.F90 +++ b/hl/fortran/src/H5DSff.F90 @@ -44,13 +44,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name INTEGER :: errcode ! Error code @@ -99,12 +92,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsattach_scale_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. @@ -148,13 +135,7 @@ CONTAINS SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsdetach_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached INTEGER , INTENT(in) :: idx ! the dimension of did to detach @@ -199,13 +180,7 @@ CONTAINS SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_attached_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with @@ -264,13 +239,7 @@ CONTAINS SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the data set to query LOGICAL , INTENT(out) :: is_scale ! logical: ! .TRUE. if did is a Dimension Scale @@ -319,13 +288,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -375,13 +337,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -430,13 +385,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_scale_name_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget CHARACTER(LEN=*), INTENT(out) :: name ! The name INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer @@ -478,13 +426,6 @@ CONTAINS SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_num_scales_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER , INTENT(in) :: idx ! the dimension of did to query INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did -- cgit v0.12 From 701029876eef6c54df27620411c959969dfab5a4 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:26:19 -0600 Subject: removed duplicate exports of DS subroutines --- fortran/src/H5f90global.F90 | 354 +++++++++++++++++++++++++++++++++++-- fortran/src/hdf5_fortrandll.def.in | 2 - hl/fortran/src/H5DSff.F90 | 65 +------ 3 files changed, 342 insertions(+), 79 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 0247ad8..078778a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -70,16 +70,10 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - ! Do not forget to change this value when new predefined + ! Do not forget to change these values when new predefined ! datatypes are added INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 - - ! Do not forget to change the following line when new predefined - ! floating data types are added INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4 - - ! Do not forget to change the following line when new predefined - ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in @@ -88,7 +82,56 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 - ! + + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_FLOAT + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_LONG_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_CHARACTER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_OBJ + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_DSETREG + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B8 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B16 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B32 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B64 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FORTRAN_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_C_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER_KIND + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_FLOAT_128 + !DEC$endif + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE @@ -139,9 +182,22 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:NUM_NATIVE_INTEGER_KIND) :: H5T_NATIVE_INTEGER_KIND INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- - + ! ! H5generic flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_NAME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_CRT_ORDER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_N_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_INC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_DEC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_NATIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_N_F + !DEC$ATTRIBUTES DLLEXPORT :: HADDR_UNDEF_F + !DEC$endif + INTEGER :: H5_INDEX_UNKNOWN_F INTEGER :: H5_INDEX_NAME_F INTEGER :: H5_INDEX_CRT_ORDER_F @@ -156,6 +212,28 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDWR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDONLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_TRUNC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_EXCL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_DEBUG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_LOCAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_GLOBAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_WEAK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_SEMI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_STRONG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_EARLIEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_LATEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_UNLIMITED_F + !DEC$endif + INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -178,6 +256,23 @@ MODULE H5GLOBAL ! ! H5G flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_TYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UDLINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_DENSE_F + !DEC$endif + INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -195,6 +290,40 @@ MODULE H5GLOBAL ! ! H5D flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5D_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CONTIGUOUS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNKED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_EARLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_LATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_INCR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_NOT_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_PART_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ALLOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_NEVER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_UNDEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_USER_DEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_W0_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_NO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CONTIG_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_FIRST_MISSING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_LAST_AVAILABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VIRTUAL_F + !DEC$endif + INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -219,11 +348,11 @@ MODULE H5GLOBAL INTEGER :: H5D_FILL_VALUE_DEFAULT_F INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F -! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 -! characters for variable names in Fortran. -! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 -! characters for variable names in Fortran. - + ! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 + ! characters for variable names in Fortran. + ! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 + ! characters for variable names in Fortran. + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F @@ -240,6 +369,14 @@ MODULE H5GLOBAL ! ! H5E flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5E_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MAJOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MINOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_UPWARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_DOWNWARD_F + !DEC$endif + INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F @@ -248,6 +385,27 @@ MODULE H5GLOBAL ! ! H5FD file drivers flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NOLIST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_SUPER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_BTREE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DRAW_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_GHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_LHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_OHDR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NTYPES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_CORE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_FAMILY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_LOG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MULTI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_SEC2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_STDIO_F + !DEC$endif + INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -258,7 +416,7 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_GHEAP_F INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F - INTEGER :: H5FD_MEM_NTYPES_F=-1 + INTEGER :: H5FD_MEM_NTYPES_F INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F @@ -269,6 +427,16 @@ MODULE H5GLOBAL ! ! H5I flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5I_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASPACE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_ATTR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_BADID_F + !DEC$endif + INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -279,6 +447,15 @@ MODULE H5GLOBAL ! ! H5L flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_EXTERNAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_LINK_CLASS_T_VERS_F + !DEC$endif + INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F @@ -288,6 +465,36 @@ MODULE H5GLOBAL ! ! H5O flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_SHALLOW_HIERARCHY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_SOFT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_EXT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_WITHOUT_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_PRESERVE_NULL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_NONE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_SDSPACE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_DTYPE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_FILL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_PLINE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ALL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_CHUNK0_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_STORE_PHASE_CHA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_STORE_TIMES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ALL_FLAGS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_NINDEXES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_LIST_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NAMED_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NTYPES_F + !DEC$endif + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -318,6 +525,29 @@ MODULE H5GLOBAL ! ! H5P flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_XFER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_MOUNT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ROOT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_STRING_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ATTRIBUTE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_COPY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_INDEXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_TRACKED_F + !DEC$endif + INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -342,11 +572,39 @@ MODULE H5GLOBAL ! ! H5R flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5R_OBJECT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5R_DATASET_REGION_F + !DEC$endif + INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F ! ! H5S flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5S_UNLIMITED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SCALAR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SIMPLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_NULL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOOP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_SET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_OR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_AND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_XOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTB_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_APPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_PREPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_INVALID_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_POINTS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_HYPERSLABS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ALL_F + !DEC$endif + INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -374,6 +632,44 @@ MODULE H5GLOBAL ! ! H5T flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NO_CLASS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_INTEGER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_TIME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_BITFIELD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_OPAQUE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_COMPOUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ENUM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_VLEN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ARRAY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_LE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_BE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_VAX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ZERO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_BACKGROUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_IMPLIED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_MSBSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_ASCII_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_UTF8_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLTERM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_SPACEPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_ASCEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_DESCEND_F + !DEC$endif + INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -412,6 +708,29 @@ MODULE H5GLOBAL ! ! H5Z flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DEFLATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SHUFFLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_FLETCHER32_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SZIP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ERROR_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_DISABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ENABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_NO_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FLAG_OPTIONAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ENCODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DECODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NBIT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SCALEOFFSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_DSCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_ESCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_MINBITS_DEFAULT_F + !DEC$endif + INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -435,6 +754,11 @@ MODULE H5GLOBAL ! ! H5 Library flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_EC_OM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_NN_OM_F + !DEC$endif + INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 43a802c..3a5a91f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,6 +1,4 @@ EXPORTS -; H5GLOBAL -H5GLOBAL_mp_H5FD_MEM_NTYPES_F ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 index 4f0d040..2dca479 100644 --- a/hl/fortran/src/H5DSff.F90 +++ b/hl/fortran/src/H5DSff.F90 @@ -44,13 +44,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name INTEGER :: errcode ! Error code @@ -99,12 +92,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsattach_scale_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. @@ -148,13 +135,7 @@ CONTAINS SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsdetach_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached INTEGER , INTENT(in) :: idx ! the dimension of did to detach @@ -199,13 +180,7 @@ CONTAINS SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_attached_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with @@ -264,13 +239,7 @@ CONTAINS SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the data set to query LOGICAL , INTENT(out) :: is_scale ! logical: ! .TRUE. if did is a Dimension Scale @@ -319,13 +288,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -375,13 +337,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -430,13 +385,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_scale_name_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget CHARACTER(LEN=*), INTENT(out) :: name ! The name INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer @@ -478,13 +426,6 @@ CONTAINS SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_num_scales_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER , INTENT(in) :: idx ! the dimension of did to query INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did -- cgit v0.12 From 6eab04894e88f7dcc0e684271328efc409a98662 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 7 Dec 2017 08:56:04 -0600 Subject: HDFFV-10223 Shared libraries fail test on OSX with fortran enabled with cmake This is now fixed via the HDFFV-10325 fix. --- CMakeLists.txt | 15 +-------------- fortran/examples/CMakeLists.txt | 6 +++--- fortran/examples/CMakeTests.cmake | 8 ++++---- fortran/src/CMakeLists.txt | 14 +++++++------- fortran/test/CMakeLists.txt | 20 ++++++++++---------- fortran/test/CMakeTests.cmake | 2 +- hl/fortran/src/CMakeLists.txt | 14 +++++++------- hl/fortran/test/CMakeLists.txt | 8 ++++---- hl/fortran/test/CMakeTests.cmake | 2 +- release_docs/INSTALL_CMake.txt | 1 - 10 files changed, 38 insertions(+), 52 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2640b1..e22ac2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -849,21 +849,8 @@ set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") option (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) - 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) - else () - message (STATUS " **** Allowing unsupported Fortran shared libraries **** ") - endif () - endif () + option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON) include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 426df7e..a05f296 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -52,7 +52,7 @@ foreach (example ${examples}) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_executable (f90_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_${example}-shared SHARED " " " ") @@ -83,7 +83,7 @@ foreach (example ${F2003_examples}) FOLDER examples/fortran03 Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f03_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f03_ex_${example}-shared SHARED " " " ") @@ -114,7 +114,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_executable (f90_ex_ph5example-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example-shared SHARED " " " ") diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index b130f30..c3d94b4 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -41,7 +41,7 @@ set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) endif () set (last_test "f90_ex-clear-objects") - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_test ( NAME f90_ex-shared-clear-objects COMMAND ${CMAKE_COMMAND} @@ -87,7 +87,7 @@ foreach (example ${examples}) set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) endif () set (last_test "f90_ex_${example}") - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME f90_ex-shared_${example} COMMAND $) else () @@ -129,7 +129,7 @@ if (HDF5_ENABLE_F2003) set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) endif () set (last_test "f03_ex_${example}") - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME f03_ex-shared_${example} COMMAND $) else () @@ -154,7 +154,7 @@ endif () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_test (NAME f90_ex-shared_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endif () endif () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index e34c778..0f576d4 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -64,7 +64,7 @@ set_target_properties (H5_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) @@ -136,7 +136,7 @@ set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES ) set (install_targets ${HDF5_F90_C_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) @@ -173,7 +173,7 @@ add_custom_target (H5gen ALL ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 @@ -220,7 +220,7 @@ set (f90_F_SOURCES # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (f90_F_SOURCES_SHARED # generated file ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 @@ -262,7 +262,7 @@ endif () set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET}) add_dependencies(${HDF5_F90_LIB_TARGET} H5gen) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES_SHARED}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) @@ -339,7 +339,7 @@ install ( fortheaders ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (modsh_files ${MODSH_BUILD_DIR}/h5fortran_types.mod ${MODSH_BUILD_DIR}/hdf5.mod @@ -375,7 +375,7 @@ endif () # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) 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 () diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 1661a10..3c3eb8f 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -32,7 +32,7 @@ set_target_properties (H5_test_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) @@ -64,7 +64,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C INTERFACE_INCLUDE_DIRECTORIES "$/include>" ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} @@ -94,7 +94,7 @@ add_custom_target (H5testgen ALL ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES GENERATED TRUE) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 @@ -117,7 +117,7 @@ set (HDF5_F90_TF_SOURCES tf.F90 ) set_source_files_properties (${HDF5_F90_TF_SOURCES} PROPERTIES LANGUAGE Fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (HDF5_F90_TF_SOURCES_SHARED # generated file ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 @@ -150,7 +150,7 @@ if (WIN32) endif () add_dependencies(${HDF5_F90_TEST_LIB_TARGET} H5testgen) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED ${HDF5_F90_TF_SOURCES_SHARED}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) @@ -220,7 +220,7 @@ set_target_properties (testhdf5_fortran PROPERTIES ) add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (testhdf5_fortran-shared fortranlib_test.F90 tH5A.F90 @@ -284,7 +284,7 @@ set_target_properties (testhdf5_fortran_1_8 PROPERTIES ) add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (testhdf5_fortran_1_8-shared fortranlib_test_1_8.F90 tH5O.F90 @@ -341,7 +341,7 @@ set_target_properties (fortranlib_test_F03 PROPERTIES ) add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (fortranlib_test_F03-shared fortranlib_test_F03.F90 tH5E_F03.F90 @@ -392,7 +392,7 @@ set_target_properties (fflush1 PROPERTIES ) add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (fflush1-shared fflush1.F90) TARGET_NAMING (fflush1-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush1-shared SHARED " " " ") @@ -433,7 +433,7 @@ set_target_properties (fflush2 PROPERTIES ) add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (fflush2-shared fflush2.F90) TARGET_NAMING (fflush2-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush2-shared SHARED " " " ") diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index e171e7c..4d06359 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -132,7 +132,7 @@ set_tests_properties (FORTRAN_fflush1 PROPERTIES DEPENDS FORTRAN_testhdf5-clear- add_test (NAME FORTRAN_fflush2 COMMAND $) set_tests_properties (FORTRAN_fflush2 PROPERTIES DEPENDS FORTRAN_fflush1) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_test ( NAME FORTRAN_testhdf5-shared-clear-objects COMMAND ${CMAKE_COMMAND} diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 345a739..c870aed 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -36,7 +36,7 @@ set_target_properties (H5HL_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) @@ -87,7 +87,7 @@ set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES ) set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) @@ -129,7 +129,7 @@ set_source_files_properties ( ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 PROPERTIES GENERATED TRUE ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 @@ -157,7 +157,7 @@ set (HDF5_HL_F90_F_SOURCES ) set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (HDF5_HL_F90_F_SOURCES_SHARED ${HDF5_HL_F90_F_BASE_SOURCES} @@ -187,7 +187,7 @@ endif () set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET}) add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) @@ -236,7 +236,7 @@ install ( fortheaders ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (modsh_files ${MODSH_BUILD_DIR}/h5ds.mod ${MODSH_BUILD_DIR}/h5tb.mod @@ -259,7 +259,7 @@ endif () # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) 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 () diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 3138173..fbd31c5 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -14,7 +14,7 @@ target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TAR target_include_directories (hl_f90_tstds PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstds-shared tstds.F90) TARGET_NAMING (hl_f90_tstds-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds-shared SHARED " " " ") @@ -35,7 +35,7 @@ target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_T target_include_directories (hl_f90_tstlite PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstlite-shared tstlite.F90) TARGET_NAMING (hl_f90_tstlite-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite-shared SHARED " " " ") @@ -56,7 +56,7 @@ target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB target_include_directories (hl_f90_tstimage PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstimage-shared tstimage.F90) TARGET_NAMING (hl_f90_tstimage-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage-shared SHARED " " " ") @@ -77,7 +77,7 @@ target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_ target_include_directories (hl_f90_tsttable PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tsttable-shared tsttable.F90) TARGET_NAMING (hl_f90_tsttable-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable-shared SHARED " " " ") diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 90cc3a3..d541377 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -96,7 +96,7 @@ else () 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) +if (BUILD_SHARED_LIBS) add_test ( NAME HL_FORTRAN_test-shared-clear-objects COMMAND ${CMAKE_COMMAND} diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 26750b5..f20ca43 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -594,7 +594,6 @@ HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." 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 -SKIP_HDF5_FORTRAN_SHARED "Do not build the fortran shared libraries" OFF if (APPLE) HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF if (CMAKE_BUILD_TYPE MATCHES Debug) -- cgit v0.12 From 95e96246a67593776da863c88837c6cb0b7d0058 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 11 Dec 2017 14:44:30 -0600 Subject: HDFFV-9724 Initial changes and test --- src/H5Dint.c | 101 +++++++++++++++ src/H5Dpkg.h | 3 +- src/H5Dprivate.h | 11 +- src/H5Dvirtual.c | 65 ++++++++-- src/H5Fprivate.h | 1 + src/H5Pdapl.c | 366 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5Pfapl.c | 69 +++++++++++ src/H5Ppublic.h | 4 + test/vds.c | 274 +++++++++++++++++++++++++++++++++++++++++ 9 files changed, 879 insertions(+), 15 deletions(-) diff --git a/src/H5Dint.c b/src/H5Dint.c index b6c0341..2123836 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -63,6 +63,8 @@ static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix); +static herr_t H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, + char **vds_prefix); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); @@ -1037,6 +1039,81 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D_build_extfile_prefix() */ + +/*-------------------------------------------------------------------------- + * Function: H5D_build_vds_prefix + * + * Purpose: Determine the vds file prefix to be used and store + * it in vds_prefix. Stores an empty string if no prefix + * should be used. + * + * Return: SUCCEED/FAIL + *-------------------------------------------------------------------------- + */ +static herr_t +H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, char **vds_prefix /*out*/) +{ + char *prefix = NULL; /* prefix used to look for the file */ + char *vdspath = NULL; /* absolute path of directory the HDF5 file is in */ + size_t vdspath_len; /* length of vdstpath */ + size_t prefix_len; /* length of prefix */ + size_t vds_prefix_len; /* length of expanded prefix */ + H5P_genplist_t *plist = NULL; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* Return value */ + + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(dset); + HDassert(dset->oloc.file); + + vdspath = H5F_EXTPATH(dset->oloc.file); + HDassert(vdspath); + + /* XXX: Future thread-safety note - getenv is not required + * to be reentrant. + */ + prefix = HDgetenv("HDF5_VDS_PREFIX"); + + if(prefix == NULL || *prefix == '\0') { + /* Set prefix to value of H5D_ACS_VDS_PREFIX_NAME property */ + if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds prefix") + } /* end if */ + + /* Prefix has to be checked for NULL / empty string again because the + * code above might have updated it. + */ + if(prefix == NULL || *prefix == '\0' || HDstrcmp(prefix, ".") == 0) { + /* filename is interpreted as relative to the current directory, + * does not need to be expanded + */ + if(NULL == (*vds_prefix = (char *)H5MM_strdup(""))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + } /* end if */ + else { + if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) { + /* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */ + vdspath_len = HDstrlen(vdspath); + prefix_len = HDstrlen(prefix); + vds_prefix_len = vdspath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; + + if(NULL == (*vds_prefix = (char *)H5MM_malloc(vds_prefix_len))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") + HDsnprintf(*vds_prefix, vds_prefix_len, "%s%s", vdspath, prefix + HDstrlen("${ORIGIN}")); + } /* end if */ + else { + if(NULL == (*vds_prefix = (char *)H5MM_strdup(prefix))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + } /* end else */ + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_build_vds_prefix() */ + /*------------------------------------------------------------------------- * Function: H5D__create @@ -1220,6 +1297,10 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") + /* Set the vds file prefix */ + if(H5D_build_vds_prefix(new_dset, dapl_id, &new_dset->shared->vds_prefix) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") + /* Add the dataset to the list of opened objects in the file */ if(H5FO_top_incr(new_dset->oloc.file, new_dset->oloc.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't incr object ref. count") @@ -1265,6 +1346,7 @@ done: if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list") new_dset->shared->extfile_prefix = (char *)H5MM_xfree(new_dset->shared->extfile_prefix); + new_dset->shared->vds_prefix = (char *)H5MM_xfree(new_dset->shared->vds_prefix); new_dset->shared = H5FL_FREE(H5D_shared_t, new_dset->shared); } /* end if */ new_dset->oloc.file = NULL; @@ -1351,6 +1433,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) H5D_shared_t *shared_fo = NULL; H5D_t *dataset = NULL; char *extfile_prefix = NULL; /* Expanded external file prefix */ + char *vds_prefix = NULL; /* Expanded vds prefix */ H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1374,6 +1457,10 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") + /* Get the vds prefix */ + if(H5D_build_vds_prefix(dataset, dapl_id, &vds_prefix) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") + /* Check if dataset was already open */ if(NULL == (shared_fo = (H5D_shared_t *)H5FO_opened(dataset->oloc.file, dataset->oloc.addr))) { /* Clear any errors from H5FO_opened() */ @@ -1399,6 +1486,11 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) /* Prevent string from being freed during done: */ extfile_prefix = NULL; + /* Set the vds file prefix */ + dataset->shared->vds_prefix = vds_prefix; + /* Prevent string from being freed during done: */ + vds_prefix = NULL; + } /* end if */ else { /* Point to shared info */ @@ -1430,12 +1522,14 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) done: extfile_prefix = (char *)H5MM_xfree(extfile_prefix); + vds_prefix = (char *)H5MM_xfree(vds_prefix); if(ret_value == NULL) { /* Free the location--casting away const*/ if(dataset) { if(shared_fo == NULL && dataset->shared) { /* Need to free shared fo */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); + dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); } @@ -1818,6 +1912,9 @@ H5D_close(H5D_t *dataset) /* Free the external file prefix */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); + /* Free the vds file prefix */ + dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); + /* Release layout, fill-value, efl & pipeline messages */ if(dataset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT) free_failed |= (H5O_msg_reset(H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline) < 0) || @@ -3360,6 +3457,10 @@ H5D_get_access_plist(H5D_t *dset) if(H5P_set(new_plist, H5D_ACS_VDS_PRINTF_GAP_NAME, &(dset->shared->layout.storage.u.virt.printf_gap)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS printf gap") + /* Set the vds prefix option */ + if(H5P_set(new_plist, H5D_ACS_VDS_PREFIX_NAME, &(dset->shared->vds_prefix)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds prefix") + /* Set the external file prefix option */ if(H5P_set(new_plist, H5D_ACS_EFILE_PREFIX_NAME, &(dset->shared->extfile_prefix)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set external file prefix") diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 542abd0..45f2d3a 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -476,6 +476,7 @@ typedef struct H5D_shared_t { H5D_append_flush_t append_flush; /* Append flush property information */ char *extfile_prefix; /* expanded external file prefix */ + char *vds_prefix; /* expanded vds prefix */ } H5D_shared_t; struct H5D_t { @@ -598,7 +599,7 @@ H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id); H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id); /* Internal I/O routines */ -H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, +H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index fb994d8..ed13467 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -47,12 +47,13 @@ #define H5D_CRT_EXT_FILE_LIST_NAME "efl" /* External file list */ /* ======== Dataset access property names ======== */ -#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ -#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ -#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ -#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ +#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ +#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ +#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ +#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ #define H5D_ACS_VDS_PRINTF_GAP_NAME "vds_printf_gap" /* VDS printf gap size */ -#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ +#define H5D_ACS_VDS_PREFIX_NAME "vds_prefix" /* VDS file prefix */ +#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ #define H5D_ACS_EFILE_PREFIX_NAME "external file prefix" /* External file prefix */ /* ======== Data transfer properties ======== */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 3be2353..e0a4a83 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -731,6 +731,38 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_delete */ + +/*-------------------------------------------------------------------------- + * Function: H5D__virtual_build_name + * + * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME + * + * Return: Non-negative on success/Negative on failure + *--------------------------------------------------------------------------*/ +static herr_t +H5D__virtual_build_name(char *prefix, char *file_name, char **full_name/*out*/) +{ + size_t prefix_len; /* length of prefix */ + size_t fname_len; /* Length of external link file name */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + prefix_len = HDstrlen(prefix); + fname_len = HDstrlen(file_name); + + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") + + /* Compose the full file name */ + HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, + (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__virtual_build_name() */ + /*------------------------------------------------------------------------- * Function: H5D__virtual_open_source_dset @@ -750,9 +782,11 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id) { H5F_t *src_file = NULL; /* Source file */ + char *vds_prefix = NULL; /* Source file vds_prefix */ hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */ H5G_loc_t src_root_loc; /* Object location of source file root group */ herr_t ret_value = SUCCEED; /* Return value */ + char *full_name = NULL; /* File name with prefix */ FUNC_ENTER_STATIC @@ -762,14 +796,27 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, HDassert(!source_dset->dset); HDassert(source_dset->file_name); HDassert(source_dset->dset_name); + vds_prefix = vdset->shared->vds_prefix; /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { - /* Open the source file */ - if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) - H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ - else - src_file_open = TRUE; + if(vds_prefix && HDstrlen(vds_prefix) > 0) { + if(H5D__virtual_build_name(vds_prefix, source_dset->file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") + /* Open the source file */ + if(NULL == (src_file = H5F_open(full_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ + else + src_file_open = TRUE; + full_name = (char *)H5MM_xfree(full_name); + } + else { + /* Open the source file */ + if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ + else + src_file_open = TRUE; + } } /* end if */ else /* Source file is ".", use the virtual dataset's file */ @@ -1407,7 +1454,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "failed to clip unlimited selection") } /* end if */ - /* Update cached values unlim_extent_source and + /* Update cached values unlim_extent_source and * clip_size_virtual */ storage->list[i].unlim_extent_source = curr_dims[storage->list[i].unlim_dim_source]; storage->list[i].clip_size_virtual = clip_size; @@ -1559,7 +1606,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space") /* Mark the space as dirty, for later writing to the file */ - if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) + if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ @@ -2246,7 +2293,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close projected memory space") storage->list[i].sub_dset[j].projected_mem_space = NULL; } /* end if */ - else + else *tot_nelmts += (hsize_t)select_nelmts; } /* end if */ } /* end for */ @@ -2506,7 +2553,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "unable to clip fill selection") /* Write fill values to memory buffer */ - if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, + if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed") diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 18d0460..262e63b 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -489,6 +489,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ #define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ +#define H5F_ACS_VDS_SIZE_NAME "vds_size" /* Size of vds file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ #define H5F_ACS_USE_MDC_LOGGING_NAME "use_mdc_logging" /* Whether to use metadata cache logging */ diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 494de3e..da06297 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -71,6 +71,17 @@ #define H5D_ACS_VDS_PRINTF_GAP_DEF (hsize_t)0 #define H5D_ACS_VDS_PRINTF_GAP_ENC H5P__encode_hsize_t #define H5D_ACS_VDS_PRINTF_GAP_DEC H5P__decode_hsize_t +/* Definitions for VDS file prefix */ +#define H5D_ACS_VDS_PREFIX_SIZE sizeof(char *) +#define H5D_ACS_VDS_PREFIX_DEF NULL /*default is no prefix */ +#define H5D_ACS_VDS_PREFIX_SET H5P__dapl_vds_file_pref_set +#define H5D_ACS_VDS_PREFIX_GET H5P__dapl_vds_file_pref_get +#define H5D_ACS_VDS_PREFIX_ENC H5P__dapl_vds_file_pref_enc +#define H5D_ACS_VDS_PREFIX_DEC H5P__dapl_vds_file_pref_dec +#define H5D_ACS_VDS_PREFIX_DEL H5P__dapl_vds_file_pref_del +#define H5D_ACS_VDS_PREFIX_COPY H5P__dapl_vds_file_pref_copy +#define H5D_ACS_VDS_PREFIX_CMP H5P__dapl_vds_file_pref_cmp +#define H5D_ACS_VDS_PREFIX_CLOSE H5P__dapl_vds_file_pref_close /* Definition for append flush */ #define H5D_ACS_APPEND_FLUSH_SIZE sizeof(H5D_append_flush_t) #define H5D_ACS_APPEND_FLUSH_DEF {0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},NULL,NULL} @@ -112,6 +123,14 @@ static herr_t H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value); /* Property list callbacks */ static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dacc_vds_view_dec(const void **pp, void *value); +static herr_t H5P__dapl_vds_file_pref_set(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_get(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size); +static herr_t H5P__dapl_vds_file_pref_dec(const void **_pp, void *value); +static herr_t H5P__dapl_vds_file_pref_del(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_copy(const char* name, size_t size, void* value); +static int H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t size); +static herr_t H5P__dapl_vds_file_pref_close(const char* name, size_t size, void* value); /* Property list callbacks */ static herr_t H5P__dapl_efile_pref_set(hid_t prop_id, const char* name, size_t size, void* value); @@ -160,6 +179,7 @@ const H5P_libclass_t H5P_CLS_DACC[1] = {{ /* Property value defaults */ static const H5D_append_flush_t H5D_def_append_flush_g = H5D_ACS_APPEND_FLUSH_DEF; /* Default setting for append flush */ static const char *H5D_def_efile_prefix_g = H5D_ACS_EFILE_PREFIX_DEF; /* Default external file prefix string */ +static const char *H5D_def_vds_prefix_g = H5D_ACS_VDS_PREFIX_DEF; /* Default vds prefix string */ /*------------------------------------------------------------------------- @@ -210,6 +230,12 @@ H5P__dacc_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register property for vds prefix */ + if(H5P_register_real(pclass, H5D_ACS_VDS_PREFIX_NAME, H5D_ACS_VDS_PREFIX_SIZE, &H5D_def_vds_prefix_g, + NULL, H5D_ACS_VDS_PREFIX_SET, H5D_ACS_VDS_PREFIX_GET, H5D_ACS_VDS_PREFIX_ENC, H5D_ACS_VDS_PREFIX_DEC, + H5D_ACS_VDS_PREFIX_DEL, H5D_ACS_VDS_PREFIX_COPY, H5D_ACS_VDS_PREFIX_CMP, H5D_ACS_VDS_PREFIX_CLOSE) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register info for append flush */ /* (Note: this property should not have an encode/decode callback -QAK) */ if(H5P_register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g, @@ -226,6 +252,254 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dacc_reg_prop() */ + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_set + * + * Purpose: Copies a vds file prefix property when it's set + * for a property list + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(value); + + /* Copy the prefix */ + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_set() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_get + * + * Purpose: Copies a vds file prefix property when it's retrieved + * from a property list + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(value); + + /* Copy the prefix */ + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_get() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_enc + * + * Purpose: Callback routine which is called whenever the vds file flags + * property in the dataset access property list is + * encoded. + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) +{ + const char *vds_file_pref = *(const char * const *)value; + uint8_t **pp = (uint8_t **)_pp; + size_t len = 0; + uint64_t enc_value; + unsigned enc_size; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); + + /* calculate prefix length */ + if(NULL != vds_file_pref) + len = HDstrlen(vds_file_pref); + + enc_value = (uint64_t)len; + enc_size = H5VM_limit_enc_size(enc_value); + HDassert(enc_size < 256); + + if(NULL != *pp) { + /* encode the length of the prefix */ + *(*pp)++ = (uint8_t)enc_size; + UINT64ENCODE_VAR(*pp, enc_value, enc_size); + + /* encode the prefix */ + if(NULL != vds_file_pref) { + HDmemcpy(*(char **)pp, vds_file_pref, len); + *pp += len; + } /* end if */ + } /* end if */ + + *size += (1 + enc_size); + if(NULL != vds_file_pref) + *size += len; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_enc() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_dec + * + * Purpose: Callback routine which is called whenever the vds file prefix + * property in the dataset access property list is + * decoded. + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value) +{ + char **vds_file_pref = (char **)_value; + const uint8_t **pp = (const uint8_t **)_pp; + size_t len; + uint64_t enc_value; /* Decoded property value */ + unsigned enc_size; /* Size of encoded property */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(pp); + HDassert(*pp); + HDassert(vds_file_pref); + HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); + + /* Decode the size */ + enc_size = *(*pp)++; + HDassert(enc_size < 256); + + /* Decode the value */ + UINT64DECODE_VAR(*pp, enc_value, enc_size); + len = (size_t)enc_value; + + if(0 != len) { + /* Make a copy of the user's prefix string */ + if(NULL == (*vds_file_pref = (char *)H5MM_malloc(len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "memory allocation failed for prefix") + HDstrncpy(*vds_file_pref, *(const char **)pp, len); + (*vds_file_pref)[len] = '\0'; + + *pp += len; + } /* end if */ + else + *vds_file_pref = NULL; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dapl_vds_file_pref_dec() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_del + * + * Purpose: Frees memory used to store the vds file prefix string + * + * Return: SUCCEED (Can't fail) + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + H5MM_xfree(*(void **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_del() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_copy + * + * Purpose: Creates a copy of the vds file prefix string + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_copy() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_cmp + * + * Purpose: Callback routine which is called whenever the vds file prefix + * property in the dataset creation property list is + * compared. + * + * Return: zero if VALUE1 and VALUE2 are equal, non zero otherwise. + *------------------------------------------------------------------------- + */ +static int +H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) +{ + const char *pref1 = *(const char * const *)value1; + const char *pref2 = *(const char * const *)value2; + int ret_value = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(NULL == pref1 && NULL != pref2) + HGOTO_DONE(1); + if(NULL != pref1 && NULL == pref2) + HGOTO_DONE(-1); + if(NULL != pref1 && NULL != pref2) + ret_value = HDstrcmp(pref1, pref2); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dapl_vds_file_pref_cmp() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_close + * + * Purpose: Frees memory used to store the vds file prefix string + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + H5MM_xfree(*(void **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_close() */ + /*------------------------------------------------------------------------- * Function: H5P__dapl_efile_pref_set @@ -1220,3 +1494,95 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_efile_prefix() */ + +/*------------------------------------------------------------------------- + * Function: H5Pset_virtual_prefix + * + * Purpose: Set a prefix to be applied to the path of any vds files + * traversed. + * + * If the prefix starts with ${ORIGIN}, this will be replaced by + * the absolute path of the directory of the HDF5 file containing + * the dataset. + * + * If the prefix is ".", no prefix will be applied. + * + * This property can be overwritten by the environment variable + * HDF5_VDS_PREFIX. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_virtual_prefix(hid_t plist_id, const char *prefix) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*s", plist_id, prefix); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Set prefix */ + if(H5P_set(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set prefix info") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_virtual_prefix() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_virtual_prefix + * + * Purpose: Gets the prefix to be applied to any vds file + * traversals made using this property list. + * + * If the pointer is not NULL, it points to a user-allocated + * buffer. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +ssize_t +H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size) +{ + H5P_genplist_t *plist; /* Property list pointer */ + char *my_prefix; /* Library's copy of the prefix */ + size_t len; /* Length of prefix string */ + ssize_t ret_value; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("Zs", "i*sz", plist_id, prefix, size); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get the current prefix */ + if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &my_prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file prefix") + + /* Check for prefix being set */ + if(my_prefix) { + /* Copy to user's buffer, if given */ + len = HDstrlen(my_prefix); + if(prefix) { + HDstrncpy(prefix, my_prefix, MIN(len + 1, size)); + if(len >= size) + prefix[size - 1] = '\0'; + } /* end if */ + } /* end if */ + else + len = 0; + + /* Set return value */ + ret_value = (ssize_t)len; + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_virtual_prefix() */ + diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 915aa38..8650a03 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -2462,6 +2462,75 @@ done: /*------------------------------------------------------------------------- + * Function: H5Pset_vds_file_cache_size + * + * Purpose: Sets the number of files opened through vds links + * from the file associated with this fapl to be held open + * in that file's vds file cache. When the maximum + * number of files is reached, the least recently used file + * is closed (unless it is opened from somewhere else). + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "iIu", plist_id, vds_size); + + /* 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") + + /* Set value */ + if(H5P_set(plist, H5F_ACS_VDS_SIZE_NAME, &vds_size) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set elink file cache size") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_vds_file_cache_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_vds_file_cache_size + * + * Purpose: Gets the number of files opened through vds links + * from the file associated with this fapl to be held open + * in that file's vds file cache. When the maximum + * number of files is reached, the least recently used file + * is closed (unless it is opened from somewhere else). + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*Iu", plist_id, vds_size); + + /* 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") + + /* Get value */ + if(vds_size) + if(H5P_get(plist, H5F_ACS_VDS_SIZE_NAME, vds_size) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get elink file cache size") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_vds_file_cache_size() */ + + +/*------------------------------------------------------------------------- * Function: H5Pset_file_image * * Purpose: Sets the initial file image. Some file drivers can initialize diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 493a322..38be320 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -343,6 +343,8 @@ H5_DLL herr_t H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low, H5F_libver_t *high); H5_DLL herr_t H5Pset_elink_file_cache_size(hid_t plist_id, unsigned efc_size); H5_DLL herr_t H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size); +H5_DLL herr_t H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size); +H5_DLL herr_t H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size); H5_DLL herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); H5_DLL herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); H5_DLL herr_t H5Pset_file_image_callbacks(hid_t fapl_id, @@ -420,6 +422,8 @@ H5_DLL herr_t H5Pset_virtual_view(hid_t plist_id, H5D_vds_view_t view); H5_DLL herr_t H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view); H5_DLL herr_t H5Pset_virtual_printf_gap(hid_t plist_id, hsize_t gap_size); H5_DLL herr_t H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size); +H5_DLL herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); +H5_DLL ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); H5_DLL herr_t H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t boundary[], H5D_append_cb_t func, void *udata); H5_DLL herr_t H5Pget_append_flush(hid_t plist_id, unsigned dims, diff --git a/test/vds.c b/test/vds.c index c9b7a1b..3485023 100644 --- a/test/vds.c +++ b/test/vds.c @@ -36,6 +36,12 @@ const char *FILENAME[] = { "vds_src_1", "vds%%_src", "vds_dapl", + "vds_virt_2", + "vds_virt_3", + "vds_src_2", + "vds_src_3", + "vds%%_src2", + "vds_dapl2", NULL }; @@ -49,6 +55,8 @@ const char *FILENAME[] = { #define FILENAME_BUF_SIZE 1024 +#define TMPDIR "tmp/" + /*------------------------------------------------------------------------- * Function: vds_select_equal @@ -1140,6 +1148,271 @@ error: return 1; } /* end test_api() */ +/*------------------------------------------------------------------------- + * Function: vds_link_prefix + * + * Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp" + * Should be able to access the target source files in tmp directory via the prefix set + * by H5Pset_virtual_prefix() + * + * Return: Success: 0 + * Failure: -1 + *------------------------------------------------------------------------- + */ +static int +test_vds_prefix(unsigned config, hid_t fapl) +{ + char srcfilename[FILENAME_BUF_SIZE]; + char srcfilename_map[FILENAME_BUF_SIZE]; + char vfilename[FILENAME_BUF_SIZE]; + char vfilename2[FILENAME_BUF_SIZE]; + char srcfilenamepct[FILENAME_BUF_SIZE]; + char srcfilenamepct_map[FILENAME_BUF_SIZE]; + const char *srcfilenamepct_map_orig = "vds%%%%_src"; + hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */ + hid_t vfile = -1; /* File with virtual dset */ + hid_t vfile2 = -1; /* File with copied virtual dset */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t dapl = -1; /* Dataset access property list */ + hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */ + hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */ + hid_t memspace = -1; /* Memory dataspace */ + hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */ + hid_t vdset = -1; /* Virtual dataset */ + hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ + hsize_t start[4]; /* Hyperslab start */ + hsize_t stride[4]; /* Hyperslab stride */ + hsize_t count[4]; /* Hyperslab count */ + hsize_t block[4]; /* Hyperslab block */ + hssize_t offset[2] = {0, 0}; /* Selection offset */ + int buf[10][26]; /* Write and expected read buffer */ + int rbuf[10][26]; /* Read buffer */ + int rbuf99[9][9]; /* 9x9 Read buffer */ + int evbuf[10][26]; /* Expected VDS "buffer" */ + int erbuf[10][26]; /* Expected read buffer */ + int fill = -1; /* Fill value */ + herr_t ret; /* Generic return value */ + int i, j; + char buffer[1024]; /* buffer to read vds_prefix */ + + TESTING("basic virtual dataset I/O via H5Pset_vds_prefix()") + + h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename); + h5_fixname(FILENAME[7], fapl, vfilename2, sizeof vfilename2); + h5_fixname(FILENAME[8], fapl, srcfilename, sizeof srcfilename); + h5_fixname_printf(FILENAME[8], fapl, srcfilename_map, sizeof srcfilename_map); + h5_fixname(FILENAME[10], fapl, srcfilenamepct, sizeof srcfilenamepct); + h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map); + + /* create tmp directory and get current working directory path */ + if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) + TEST_ERROR + + /* Create DCPL */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + /* Set fill value */ + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) + TEST_ERROR + + /* Initialize VDS prefix items */ + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) + TEST_ERROR + + if(H5Pset_virtual_prefix(dapl, TMPDIR) < 0) + TEST_ERROR + if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) + TEST_ERROR + + if(HDstrcmp(buffer, TMPDIR) != 0) + FAIL_PUTS_ERROR("vds prefix not set correctly"); + + /* + * Test 1: All - all selection + */ + /* Create source dataspace */ + if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Create virtual dataspace */ + if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Select all (should not be necessary, but just to be sure) */ + if(H5Sselect_all(srcspace[0]) < 0) + TEST_ERROR + if(H5Sselect_all(vspace[0]) < 0) + TEST_ERROR + + /* Add virtual layout mapping */ + if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) + TEST_ERROR + + /* Create virtual file */ + if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Create source file if requested */ + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } /* end if */ + else { + srcfile[0] = vfile; + if(H5Iinc_ref(srcfile[0]) < 0) + TEST_ERROR + } /* end if */ + + /* Create source dataset */ + if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Create virtual dataset */ + if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) + TEST_ERROR + + /* Populate write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; + + /* Write data directly to source dataset */ + if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Close srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + + if(config & TEST_IO_DIFFERENT_FILE) { + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + } /* end if */ + } /* end if */ + + /* Reopen virtual dataset and file if config option specified */ + if(config & TEST_IO_REOPEN_VIRT) { + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) + TEST_ERROR + } /* end if */ + + /* Read data through virtual dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) { + TEST_ERROR + } + } + + /* Adjust write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); + + /* Write data through virtual dataset */ + if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Reopen srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) + TEST_ERROR + } /* end if */ + + /* Read data directly from source dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) + TEST_ERROR + + /* Close */ + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if(H5Sclose(srcspace[0]) < 0) + TEST_ERROR + srcspace[0] = -1; + if(H5Sclose(vspace[0]) < 0) + TEST_ERROR + vspace[0] = -1; + + PASSED(); + return 0; + + error: + H5E_BEGIN_TRY { + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { + if(srcdset[i] >= 0) + (void)H5Dclose(srcdset[i]); + } /* end for */ + if(vdset >= 0) + (void)H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { + if(srcfile[i] >= 0) + (void)H5Fclose(srcfile[i]); + } /* end for */ + if(vfile >= 0) + (void)H5Fclose(vfile); + if(vfile2 >= 0) + (void)H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { + if(srcspace[i] >= 0) + (void)H5Sclose(srcspace[i]); + } /* end for */ + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { + if(vspace[i] >= 0) + (void)H5Sclose(vspace[i]); + } /* end for */ + if(memspace >= 0) + (void)H5Sclose(memspace); + if(dcpl >= 0) + (void)H5Pclose(dcpl); + } H5E_END_TRY; + + return 1; +} /* end vds_link_prefix() */ + /*------------------------------------------------------------------------- * Function: test_basic_io @@ -11299,6 +11572,7 @@ main(void) for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) { printf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : ""); nerrors += test_basic_io(bit_config, fapl); + nerrors += test_vds_prefix(bit_config, fapl); nerrors += test_unlim(bit_config, fapl); nerrors += test_printf(bit_config, fapl); nerrors += test_all(bit_config, fapl); -- cgit v0.12 From 690cb84f10da7d72fcf87b07d346a26e6fefd1d0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Dec 2017 13:10:46 -0600 Subject: Added java wrappers and tests --- java/src/hdf/hdf5lib/H5.java | 196 ++++++- java/src/hdf/hdf5lib/HDF5Constants.java | 3 + java/src/hdf/overview.html | 6 +- java/src/jni/h5Constants.c | 2 + java/src/jni/h5pImp.c | 246 ++++++++ java/src/jni/h5pImp.h | 91 ++- java/test/JUnit-interface.txt | 10 +- java/test/TestH5P.java | 53 +- java/test/TestH5Pfapl.java | 41 ++ java/test/TestH5Pvirtual.java | 33 ++ release_docs/RELEASE.txt | 32 +- src/H5Pfapl.c | 954 ++++++++++++++++---------------- 12 files changed, 1172 insertions(+), 495 deletions(-) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 7b5b5c9..3de49da 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -4451,7 +4451,7 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// - // Generic property list routines + // /////// Generic property list routines /////// /** * H5Pget_class_name retrieves the name of a generic property list class @@ -4767,7 +4767,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException; - // Object creation property list (OCPL) routines + // /////// Object creation property list (OCPL) routines /////// /** * H5Pget_attr_phase_change retrieves attribute storage phase change thresholds. @@ -5071,7 +5071,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException, NullPointerException; - // File creation property list (FCPL) routines + // /////// File creation property list (FCPL) routines /////// /** * H5Pget_userblock retrieves the size of a user block in a file creation property list. @@ -5480,7 +5480,7 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, IllegalArgumentException; - // File access property list (FAPL) routines + // /////// File access property list (FAPL) routines /////// /** * H5Pget_alignment retrieves the current settings for alignment properties from a file access property list. @@ -5860,6 +5860,37 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_metadata_read_attempts(long plist_id, long attempts) throws HDF5LibraryException; + /** + * H5Pget_evict_on_close retrieves the file access property list setting that determines whether an HDF5 object + * will be evicted from the library's metadata cache when it is closed. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return indication if the object will be evicted on close. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native boolean H5Pget_evict_on_close(long fapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_evict_on_close controls the library's behavior of evicting metadata associated with a closed object. + * + * @param fapl_id + * IN: File access property list identifier + * @param evict_on_close + * IN: Whether the HDF5 object should be evicted on close. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close) + throws HDF5LibraryException; + // Dataset creation property list (DCPL) routines // /** @@ -6067,6 +6098,35 @@ public class H5 implements java.io.Serializable { public synchronized static native String H5Pget_virtual_dsetname(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException; /** + * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return VDS link open file cache size in number of files. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException; + + /** + * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache. + * + * @param fapl_id + * IN: File access property list identifier + * @param efc_size + * IN: VDS link open file cache size in number of files. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size) + throws HDF5LibraryException; + + /** * H5Pget_external returns information about an external file. * * @param plist @@ -6285,7 +6345,37 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException, NullPointerException; - // Dataset access property list (DAPL) routines // + // /////// Dataset creation property list (DCPL) routines /////// + + /** + * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list. + * + * @param dcpl_id + * IN: Dataset creation property list identifier + * @param opts + * IN: Edge chunk option flag. Valid values are: + * H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS - filters are not applied to partial edge chunks. + * 0 - Disables option; partial edge chunks will be compressed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library + **/ + public synchronized static native void H5Pset_chunk_opts(long dcpl_id, int opts) throws HDF5LibraryException; + + /** + * H5Pget_chunk_opts retrieves the edge chunk option setting stored in the dataset creation property list . + * + * @param dcpl_id + * IN: Dataset creation property list + + * @return The edge chunk option setting. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library + **/ + public synchronized static native int H5Pget_chunk_opts(long dcpl_id) throws HDF5LibraryException; + + // /////// Dataset access property list (DAPL) routines /////// /** * Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes @@ -6388,12 +6478,76 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native long H5Pget_virtual_printf_gap(long dapl_id) throws HDF5LibraryException; + /** + * H5Pget_virtual_prefix Retrieves prefix applied to virtual file paths. + * + * @param dapl_id + * IN: Link access property list identifier + * + * @return the prefix to be applied to virtual file paths. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native String H5Pget_virtual_prefix(long dapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_virtual_prefix Sets prefix to be applied to virtual file paths. + * + * @param dapl_id + * IN: Dataset access property list identifier + * @param prefix + * IN: Prefix to be applied to virtual file paths + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - prefix is null. + * + **/ + public synchronized static native void H5Pset_virtual_prefix(long dapl_id, String prefix) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Pget_efile_prefix Retrieves prefix applied to external file paths. + * + * @param dapl_id + * IN: Link access property list identifier + * + * @return the prefix to be applied to external file paths. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native String H5Pget_efile_prefix(long dapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_efile_prefix Sets prefix to be applied to external file paths. + * + * @param dapl_id + * IN: Dataset access property list identifier + * @param prefix + * IN: Prefix to be applied to external file paths + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - prefix is null. + * + **/ + public synchronized static native void H5Pset_efile_prefix(long dapl_id, String prefix) + throws HDF5LibraryException, NullPointerException; + // public synchronized static native void H5Pset_append_flush(long plist_id, int ndims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; // public synchronized static native void H5Pget_append_flush(long plist_id, int dims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; - // Dataset xfer property list (DXPL) routines // + // /////// Dataset xfer property list (DXPL) routines /////// /** * H5Pget_data_transform retrieves the data transform expression previously set in the dataset transfer property @@ -6544,7 +6698,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size) throws HDF5LibraryException, NullPointerException; - // Link creation property list (LCPL) routines // + // /////// Link creation property list (LCPL) routines /////// /** * H5Pget_create_intermediate_group determines whether property is set to enable creating missing intermediate @@ -6579,7 +6733,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_create_intermediate_group(long lcpl_id, boolean crt_intermed_group) throws HDF5LibraryException; - // Group creation property list (GCPL) routines // + // /////// Group creation property list (GCPL) routines /////// /** * H5Pget_local_heap_size_hint Retrieves the anticipated size of the local heap for original-style groups. @@ -6736,14 +6890,14 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_link_creation_order(long gcpl_id, int crt_order_flags) throws HDF5LibraryException; - // String creation property list (STRCPL) routines // + // /////// String creation property list (STRCPL) routines /////// public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException; public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding) throws HDF5LibraryException; - // Link access property list (LAPL) routines // + // /////// Link access property list (LAPL) routines /////// /** * H5Pget_nlinks retrieves the maximum number of soft or user-defined link traversals allowed, nlinks, before the @@ -6896,7 +7050,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_elink_acc_flags(long lapl_id, int flags) throws HDF5LibraryException, IllegalArgumentException; - // Object copy property list (OCPYPL) routines // + // /////// Object copy property list (OCPYPL) routines /////// /** * H5Pget_copy_object retrieves the properties to be used when an object is copied. @@ -6927,7 +7081,7 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options) throws HDF5LibraryException; - // Other/Older property list routines // + // /////// Other/Older property list routines /////// /** * H5Pget_version retrieves the version information of various objects for a file creation property list. @@ -6955,7 +7109,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pget_version(long plist, int[] version_info) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; - // file drivers property list routines // + // /////// file drivers property list routines /////// public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store) throws HDF5LibraryException, NullPointerException; @@ -7102,20 +7256,28 @@ public class H5 implements java.io.Serializable { // File creation property list (FCPL) routines // // File access property list (FAPL) routines // - // herr_t H5Pset_driver( hid_t plist_id, hid_t new_driver_id, const void *new_driver_info ) - // const void *H5Pget_driver_info( hid_t plist_id ) - // herr_t H5Pget_multi_type ( hid_t fapl_id, H5FD_mem_t *type ) - // herr_t H5Pset_multi_type ( hid_t fapl_id, H5FD_mem_t type ) + // herr_t H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info) + // const void *H5Pget_driver_info(hid_t plist_id) + // herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) + // herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) // herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); // herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); // herr_t H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size); // herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size); + // herr_t H5Pset_all_coll_metadata_ops(hid_t accpl_id, hbool_t is_collective); + // herr_t H5Pset_coll_metadata_write(hid_t fapl_id, hbool_t is_collective); + // herr_t H5Pget_coll_metadata_write(hid_t fapl_id, hbool_t *is_collective); + // herr_t H5Pget_page_buffer_size(hid_t fapl_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc); + // herr_t H5Pset_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t func, void *user_data); + // herr_t H5Pget_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t *func, void **user_data); // Dataset creation property list (DCPL) routines // // Dataset access property list (DAPL) routines // + // herr_t H5Pset_append_flush (hid_t dapl_id, int ndims, const hsize_t boundary[], H5D_append_cb_t func, void *user_data); + // herr_t H5Pget_append_flush(hid_t dapl_id, int ndims, hsize_t boundary[], H5D_append_cb_t *func, void **user_data) // Dataset xfer property list (DXPL) routines // // herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg); diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 8a3d6c8..3e43ba2 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -88,6 +88,7 @@ public class HDF5Constants { public static final int H5D_VDS_ERROR = H5D_VDS_ERROR(); public static final int H5D_VDS_FIRST_MISSING = H5D_VDS_FIRST_MISSING(); public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE(); + public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); public static final int H5E_MAJOR = H5E_MAJOR(); public static final int H5E_MINOR = H5E_MINOR(); @@ -768,6 +769,8 @@ public class HDF5Constants { private static native final int H5D_VDS_LAST_AVAILABLE(); + private static native final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); + private static native final long H5E_ALIGNMENT(); private static native final long H5E_ALREADYEXISTS(); diff --git a/java/src/hdf/overview.html b/java/src/hdf/overview.html index 39d75b7..9c19442 100644 --- a/java/src/hdf/overview.html +++ b/java/src/hdf/overview.html @@ -47,20 +47,20 @@ which has a method: The native method is implemented in C using the Java Native Method Interface (JNI). This is written something like the following: -
JNIEXPORT jint
+
JNIEXPORT jlong
 JNICALL Java_hdf_hdf5lib_H5_H5Fopen
 (
  JNIEnv *env,
  jclass class,
  jstring hdfFile,
  jint flags,
- jint access)
+ jlong access)
  {
 
  /* ...convert Java String to (char *) */
 
  /* call the HDF library */
- retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access );
+ retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access);
 
  /* ... */
 }
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index f6f8bfa..5a4b53e 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -140,6 +140,8 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1FIRST_1MISSING(JNIEnv *env, jclass cls) { return H5D_VDS_FIRST_MISSING; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1LAST_1AVAILABLE(JNIEnv *env, jclass cls) { return H5D_VDS_LAST_AVAILABLE; } +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNK_1DONT_1FILTER_1PARTIAL_1CHUNKS(JNIEnv *env, jclass cls) { return H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS; } JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALIGNMENT(JNIEnv *env, jclass cls) { return H5E_ALIGNMENT; } diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index dcfcd82..3c799f2 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5733,6 +5733,252 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts } /* end else */ } /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_vds_file_cache_size + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size + (JNIEnv *env, jclass clss, jlong plist, jint size) +{ + unsigned sz = (unsigned)size; + + if (H5Pset_vds_file_cache_size((hid_t)plist, (unsigned)sz) < 0) + h5libraryError(env); +} /* end Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_vds_file_cache_size + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size + (JNIEnv *env, jclass clss, jlong plist) +{ + unsigned s; + + if (H5Pget_vds_file_cache_size((hid_t)plist, &s) < 0) + h5libraryError(env); + + return (jint)s; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_virtual_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) +{ + herr_t retVal = -1; + const char *aName; + + PIN_JAVA_STRING(prefix, aName); + if (aName != NULL) { + retVal = H5Pset_virtual_prefix((hid_t)dapl_id, aName); + + UNPIN_JAVA_STRING(prefix, aName); + + if(retVal < 0) + h5libraryError(env); + } + + return (jint)retVal; +} /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_virtual_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id) +{ + size_t size = 0; + char *pre; + jlong prefix_size = -1; + jstring str = NULL; + + prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)NULL, size); + if(prefix_size < 0) { + h5libraryError(env); + } /* end if */ + else { + size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ + pre = (char*)HDmalloc(sizeof(char)*size); + if (pre == NULL) { + h5outOfMemory(env, "H5Pget_virtual_prefix: malloc failed "); + } /* end if */ + else { + prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)pre, size); + + if (prefix_size >= 0) { + str = ENVPTR->NewStringUTF(ENVPAR pre); + HDfree(pre); + if (str == NULL) + h5JNIFatalError( env, "H5Pget_virtual_prefix: return string not allocated"); + } /* end if */ + else { + HDfree(pre); + h5libraryError(env); + } /* end else */ + } /* end else */ + } /* end else */ + + return (jstring)str; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_efile_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) +{ + herr_t retVal = -1; + const char *aName; + + PIN_JAVA_STRING(prefix, aName); + if (aName != NULL) { + retVal = H5Pset_efile_prefix((hid_t)dapl_id, aName); + + UNPIN_JAVA_STRING(prefix, aName); + + if(retVal < 0) + h5libraryError(env); + } + + return (jint)retVal; +} /* end Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_efile_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id) +{ + size_t size = 0; + char *pre; + jlong prefix_size = -1; + jstring str = NULL; + + prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)NULL, size); + if(prefix_size < 0) { + h5libraryError(env); + } /* end if */ + else { + size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ + pre = (char*)HDmalloc(sizeof(char)*size); + if (pre == NULL) { + h5outOfMemory(env, "H5Pget_efile_prefix: malloc failed "); + } /* end if */ + else { + prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)pre, size); + + if (prefix_size >= 0) { + str = ENVPTR->NewStringUTF(ENVPAR pre); + HDfree(pre); + if (str == NULL) + h5JNIFatalError( env, "H5Pget_efile_prefix: return string not allocated"); + } /* end if */ + else { + HDfree(pre); + h5libraryError(env); + } /* end else */ + } /* end else */ + } /* end else */ + + return (jstring)str; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_evict_on_close + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close + (JNIEnv *env, jclass clss, jlong fapl_id, jboolean evict_on_close) +{ + herr_t retVal = -1; + hbool_t evict_on_close_val; + + if (evict_on_close == JNI_TRUE) + evict_on_close_val = TRUE; + else + evict_on_close_val = FALSE; + + retVal = H5Pset_evict_on_close((hid_t)fapl_id, (hbool_t)evict_on_close_val); + if (retVal < 0) + h5libraryError(env); +} /* end Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_evict_on_close + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close + (JNIEnv *env, jclass clss, jlong fapl_id) +{ + hbool_t evict_on_close_val = FALSE; + jboolean bval = JNI_FALSE; + + if (H5Pget_evict_on_close((hid_t)fapl_id, (hbool_t *)&evict_on_close_val) < 0) { + h5libraryError(env); + } /* end if */ + else { + if (evict_on_close_val == TRUE) + bval = JNI_TRUE; + } /* end else */ + + return bval; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_chunk_opts + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts + (JNIEnv *env, jclass clss, jlong dcpl_id, jint opts) +{ + herr_t retVal = -1; + + retVal = H5Pset_chunk_opts((hid_t)dcpl_id, (unsigned)opts); + if (retVal < 0) + h5libraryError(env); +} /* end Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_chunk_opts + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts + (JNIEnv *env, jclass clss, jlong dcpl_id) +{ + unsigned opts = 0; + + if (H5Pget_chunk_opts((hid_t)dcpl_id, opts) < 0) + h5libraryError(env); + + return (jint)opts; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts */ + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index d413f69..19df4b2 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -1533,7 +1533,6 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts (JNIEnv *, jclass, jlong); - /* * Class: hdf_hdf5lib_H5 * Method: H5Pset_metadata_read_attempts @@ -1543,6 +1542,96 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts (JNIEnv *, jclass, jlong, jlong); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_vds_file_cache_size + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size +(JNIEnv *, jclass, jlong, jint); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_vds_file_cache_size + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_virtual_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix +(JNIEnv *, jclass, jlong, jstring); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_virtual_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_efile_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix +(JNIEnv *, jclass, jlong, jstring); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_efile_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_evict_on_close + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close +(JNIEnv *, jclass, jlong, jboolean); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_evict_on_close + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_chunk_opts + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts +(JNIEnv *, jclass, jlong, jint); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_chunk_opts + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts +(JNIEnv *, jclass, jlong); + #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index ab2f3b1..fa5b149 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -415,6 +415,7 @@ JUnit version 4.11 .testH5PH5Pset_shared_mesg_phase_change_HighMaxlistValue .testH5P_layout .testH5Pget_link_creation_order +.testH5Pget_efile_prefix .testH5Pset_shared_mesg_nindexes_InvalidHIGHnindexes .testH5P_file_space_page_size .testH5Pget_shared_mesg_index_Invalid_indexnum @@ -444,6 +445,7 @@ JUnit version 4.11 .testH5Pset_est_link_info_InvalidValues .testH5Pset_local_heap_size_hint .testH5Pget_est_link_info +.testH5Pset_efile_prefix_null .testH5Pset_scaleoffset .testH5Pset_create_intermediate_group_invalidobject .testH5PH5Pset_shared_mesg_phase_change_HighMinbtreeValue @@ -466,6 +468,7 @@ JUnit version 4.11 .testH5Pget_sym_k_null .testH5Pset_nlinks .testH5P_obj_track_times +.testH5Pset_efile_prefix .testH5P_userblock .testH5Pget_local_heap_size_hint .testH5Pset_shared_mesg_index_Invalid_indexnum @@ -502,8 +505,10 @@ JUnit version 4.11 .testH5Fmdc_logging .testH5Pget_elink_fapl .testH5Pset_mdc_config +.testH5P_vds_file_cache_size .testH5P_small_data_block_size .testH5Pset_fapl_log +.testH5P_evict_on_close .testH5Pset_libver_bounds .testH5P_sieve_buf_size .testH5P_elink_file_cache_size @@ -530,11 +535,14 @@ JUnit version 4.11 .testH5Pget_source_datasetname .testH5Pvirtual_storage .testH5Pget_selection_source_dataset +.testH5Pget_virtual_prefix .testH5Pget_source_filename .testH5Pset_get_virtual_printf_gap .testH5Pget_virtual_count +.testH5Pset_virtual_prefix .testH5Pset_get_virtual_view .testH5Pget_mapping_parameters +.testH5Pset_virtual_prefix_null .testH5P_genprop_basic_class .testH5P_genprop_class_iter .testH5P_genprop_basic_class_prop @@ -640,7 +648,7 @@ JUnit version 4.11 Time: XXXX -OK (638 tests) +OK (646 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/TestH5P.java b/java/test/TestH5P.java index 5aafb5b..9e45e4c 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -28,6 +28,7 @@ import hdf.hdf5lib.exceptions.HDF5LibraryException; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; @@ -852,7 +853,7 @@ public class TestH5P { } catch (Throwable err) { err.printStackTrace(); - fail("H5Pset_est_link_info: " + err); + fail("H5Pset_elink_prefix: " + err); } assertTrue("H5Pset_elink_prefix", ret_val >= 0); } @@ -1232,4 +1233,54 @@ public class TestH5P { fail("testH5P_file_space_page_size: " + err); } } + + @Test + public void testH5Pset_efile_prefix() { + String prefix = "tmp"; + try { + H5.H5Pset_efile_prefix(lapl_id, prefix); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pset_efile_prefix: " + err); + } + } + + @Test(expected = NullPointerException.class) + public void testH5Pset_efile_prefix_null() throws Throwable{ + H5.H5Pset_efile_prefix(lapl_id, null); + } + + @Test + public void testH5Pget_efile_prefix() { + String prefix = "tmp"; + String pre = ""; + + try { + H5.H5Pset_efile_prefix(lapl_id, prefix); + pre = H5.H5Pget_efile_prefix(lapl_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_efile_prefix: " + err); + } + assertTrue("The prefix: ", prefix.equals(pre)); + } + + @Ignore + public void testH5P_chunk_opts() { + int chunk_opts = -1; + + try { + chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); + assertTrue("chunk_opts: "+chunk_opts, chunk_opts == 0); + H5.H5Pset_chunk_opts(ocpl_id, HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); + assertTrue("chunk_opts: "+chunk_opts, chunk_opts == HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_lchunk_opts: " + err); + } + } } diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index d4a2231..f6783d4 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1376,4 +1376,45 @@ public class TestH5Pfapl { deleteH5file(); _deleteLogFile(); } + + @Test + public void testH5P_evict_on_close() { + boolean ret_val_id = false; + try { + H5.H5Pset_evict_on_close(fapl_id, true); + ret_val_id = H5.H5Pget_evict_on_close(fapl_id); + assertTrue("H5P_evict_on_close", ret_val_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5P_evict_on_close: " + err); + } + } + + @Test + public void testH5P_vds_file_cache_size() { + int vds_size = 0; + try { + try { + vds_size = H5.H5Pget_vds_file_cache_size(fapl_id); + assertTrue("H5P_vds_file_cache_size default", vds_size == 0); + } + catch (UnsupportedOperationException err) { + System.out.println(err.getMessage()); + } + try { + vds_size = 8; + H5.H5Pset_vds_file_cache_size(fapl_id, vds_size); + vds_size = H5.H5Pget_vds_file_cache_size(fapl_id); + assertTrue("H5P_vds_file_cache_size 8", vds_size == 8); + } + catch (UnsupportedOperationException err) { + System.out.println(err.getMessage()); + } + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5P_vds_file_cache_size: " + err); + } + } } diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index 40cfbac..ff2e4dc 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -429,4 +429,37 @@ public class TestH5Pvirtual { try {H5.H5Dclose(H5did);} catch (Exception ex) {} } } + + @Test + public void testH5Pset_virtual_prefix() { + String prefix = "tmp"; + try { + H5.H5Pset_virtual_prefix(H5dapl_id, prefix); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pset_virtual_prefix: " + err); + } + } + + @Test(expected = NullPointerException.class) + public void testH5Pset_virtual_prefix_null() throws Throwable{ + H5.H5Pset_virtual_prefix(H5dapl_id, null); + } + + @Test + public void testH5Pget_virtual_prefix() { + String prefix = "tmp"; + String pre = ""; + + try { + H5.H5Pset_virtual_prefix(H5dapl_id, prefix); + pre = H5.H5Pget_virtual_prefix(H5dapl_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_virtual_prefix: " + err); + } + assertTrue("The prefix: ", prefix.equals(pre)); + } } diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7498d01..5249c1a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -58,7 +58,23 @@ New Features Library: -------- - - + - Add prefix option to VDS files. + + Currently, VDS source files must be in the active directory to be + found by the virtual file. Adding the option of a prefix to be set + on the virtual file, using a data access property list (DAPL), + allows the source files to located at an absolute or relative path + to the virtual file. + + New public APIs: + herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); + ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); + herr_t H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size); + herr_t H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size); + The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. + + (ADB - 2017/12/12, HDFFV-9724) + Parallel Library: ----------------- @@ -119,6 +135,20 @@ New Features ------------ - + Java Library: + ---------------- + - Wrappers added for the following APIs: + H5Pset_evict_on_close + H5Pget_evict_on_close + H5Pset_chunk_opts + H5Pget_chunk_opts + H5Pset_efile_prefix + H5Pget_efile_prefix + H5Pset_virtual_prefix + H5Pget_virtual_prefix + H5Pset_vds_file_cache_size + H5Pget_vds_file_cache_size + Tools: ------ - h5diff diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 8650a03..586f559 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -13,9 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Pfapl.c + * Created: H5Pfapl.c * - * Purpose: File access property list class routines + * Purpose: File access property list class routines * *------------------------------------------------------------------------- */ @@ -41,7 +41,7 @@ #include "H5Ppkg.h" /* Property lists */ /* Includes needed to set as default file driver */ -#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ +#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ #include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS #include "H5FDwindows.h" /* Win32 I/O */ @@ -54,10 +54,10 @@ /* ========= File Access properties ============ */ /* Definitions for the initial metadata cache resize configuration */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG -#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec +#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG +#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec #define H5F_ACS_META_CACHE_INIT_CONFIG_CMP H5P__facc_cache_config_cmp /* Definitions for size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE sizeof(size_t) @@ -118,10 +118,10 @@ #define H5F_ACS_FILE_DRV_CMP H5P__facc_file_driver_cmp #define H5F_ACS_FILE_DRV_CLOSE H5P__facc_file_driver_close /* Definition for file close degree */ -#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) -#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT -#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc -#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec +#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) +#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT +#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc +#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec /* Definition for offset position in file for family file driver */ #define H5F_ACS_FAMILY_OFFSET_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_OFFSET_DEF 0 @@ -155,6 +155,11 @@ #define H5F_ACS_EFC_SIZE_DEF 0 #define H5F_ACS_EFC_SIZE_ENC H5P__encode_unsigned #define H5F_ACS_EFC_SIZE_DEC H5P__decode_unsigned +/* Definition for vds file cache size */ +#define H5F_ACS_VDS_SIZE_SIZE sizeof(unsigned) +#define H5F_ACS_VDS_SIZE_DEF 0 +#define H5F_ACS_VDS_SIZE_ENC H5P__encode_unsigned +#define H5F_ACS_VDS_SIZE_DEC H5P__decode_unsigned /* Definition of pointer to initial file image info */ #define H5F_ACS_FILE_IMAGE_INFO_SIZE sizeof(H5FD_file_image_info_t) #define H5F_ACS_FILE_IMAGE_INFO_DEF H5FD_DEFAULT_FILE_IMAGE_INFO @@ -175,12 +180,12 @@ #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC H5P__encode_size_t #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC H5P__decode_size_t /* Definition for # of metadata read attempts */ -#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 -#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 +#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned /* Definition for object flush callback */ -#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) +#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) #define H5F_ACS_OBJECT_FLUSH_CB_DEF {NULL, NULL} /* Definition for status_flags in the superblock */ #define H5F_ACS_CLEAR_STATUS_FLAGS_SIZE sizeof(hbool_t) @@ -309,21 +314,21 @@ static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value); /* File access property list class library initialization object */ const H5P_libclass_t H5P_CLS_FACC[1] = {{ - "file access", /* Class name for debugging */ + "file access", /* Class name for debugging */ H5P_TYPE_FILE_ACCESS, /* Class type */ - &H5P_CLS_ROOT_g, /* Parent class */ - &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ - &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ - &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ - H5P__facc_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 */ + &H5P_CLS_ROOT_g, /* Parent class */ + &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ + &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ + &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ + H5P__facc_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 */ }}; @@ -355,6 +360,7 @@ static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; static const hbool_t H5F_def_latest_format_g = H5F_ACS_LATEST_FORMAT_DEF; /* Default setting for "use the latest version of the format" flag */ static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ +static const unsigned H5F_def_vds_size_g = H5F_ACS_VDS_SIZE_DEF; /* Default vds file cache size */ static const H5FD_file_image_info_t H5F_def_file_image_info_g = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */ static const hbool_t H5F_def_core_write_tracking_flag_g = H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEF; /* Default setting for core VFD write tracking */ static const size_t H5F_def_core_write_tracking_page_size_g = H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEF; /* Default core VFD write tracking page size */ @@ -395,149 +401,155 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the initial metadata cache resize configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, - NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, + NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache (elements) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache(bytes) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the preemption for reading chunks */ - if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, - NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, + if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, + NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the threshold for alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum metadata allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, - NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, + NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the maximum sieve buffer size */ - if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, - NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, + NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum "small data" allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, - NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, + NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the garbage collection reference */ - if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, - NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, + if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, + NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file driver ID & info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, + if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, H5F_ACS_FILE_DRV_CRT, H5F_ACS_FILE_DRV_SET, H5F_ACS_FILE_DRV_GET, NULL, NULL, H5F_ACS_FILE_DRV_DEL, H5F_ACS_FILE_DRV_COPY, H5F_ACS_FILE_DRV_CMP, H5F_ACS_FILE_DRV_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file close degree */ - if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, - NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, + NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the offset of family driver info */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, - NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, + NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of new family file size. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, 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 private property of whether convert family to sec2 driver. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, 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 data type of multi driver info */ - if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, - NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, + if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, + NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'use the latest version of the format' flag */ - if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, - NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, + if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, + NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether to retrieve the file descriptor from the core VFD */ /* (used internally to the library only) */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, + if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, 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 external file cache size */ - if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, - NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, + NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, + NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the vds file cache size */ + if(H5P_register_real(pclass, H5F_ACS_VDS_SIZE_NAME, H5F_ACS_VDS_SIZE_SIZE, &H5F_def_vds_size_g, + NULL, NULL, NULL, H5F_ACS_VDS_SIZE_ENC, H5F_ACS_VDS_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the initial file image info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, + if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, NULL, H5F_ACS_FILE_IMAGE_INFO_SET, H5F_ACS_FILE_IMAGE_INFO_GET, NULL, NULL, H5F_ACS_FILE_IMAGE_INFO_DEL, H5F_ACS_FILE_IMAGE_INFO_COPY, H5F_ACS_FILE_IMAGE_INFO_CMP, H5F_ACS_FILE_IMAGE_INFO_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the core VFD backing store write tracking flag */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the core VFD backing store page size */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the # of read attempts */ - if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, - NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, + NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register object flush callback */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, + if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -563,44 +575,44 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the evict on close flag */ - if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, - NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, + NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL /* Register the metadata collective read flag */ - if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, + if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the metadata collective write flag */ - if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) 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, + 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") /* Register the size of the page buffer size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum metadata size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum raw data size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -610,33 +622,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_alignment + * Function: H5Pset_alignment * - * Purpose: Sets the alignment properties of a file access property list - * so that any file object >= THRESHOLD bytes will be aligned on - * an address which is a multiple of ALIGNMENT. The addresses - * are relative to the end of the user block; the alignment is - * calculated by subtracting the user block size from the - * absolute file address and then adjusting the address to be a - * multiple of ALIGNMENT. + * Purpose: Sets the alignment properties of a file access property list + * so that any file object >= THRESHOLD bytes will be aligned on + * an address which is a multiple of ALIGNMENT. The addresses + * are relative to the end of the user block; the alignment is + * calculated by subtracting the user block size from the + * absolute file address and then adjusting the address to be a + * multiple of ALIGNMENT. * - * Default values for THRESHOLD and ALIGNMENT are one, implying - * no alignment. Generally the default values will result in - * the best performance for single-process access to the file. - * For MPI-IO and other parallel systems, choose an alignment - * which is a multiple of the disk block size. + * Default values for THRESHOLD and ALIGNMENT are one, implying + * no alignment. Generally the default values will result in + * the best performance for single-process access to the file. + * For MPI-IO and other parallel systems, choose an alignment + * which is a multiple of the disk block size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed file access property list mechanism to the new - * generic property list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed file access property list mechanism to the new + * generic property list. *------------------------------------------------------------------------- */ herr_t @@ -668,15 +680,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_alignment + * Function: H5Pget_alignment * - * Purpose: Returns the current settings for alignment properties from a - * file access property list. The THRESHOLD and/or ALIGNMENT - * pointers may be null pointers. + * Purpose: Returns the current settings for alignment properties from a + * file access property list. The THRESHOLD and/or ALIGNMENT + * pointers may be null pointers. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * *------------------------------------------------------------------------- @@ -709,20 +721,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_set_driver + * Function: H5P_set_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -757,20 +769,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_driver + * Function: H5Pset_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -800,20 +812,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver + * Function: H5P_peek_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Return: Success: 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. + * Return: Success: 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. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -844,22 +856,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver + * Function: H5Pget_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Note: The ID returned should not be closed. + * Note: The ID returned should not be closed. * - * Return: Success: 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. + * Return: Success: 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. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -867,7 +879,7 @@ hid_t H5Pget_driver(hid_t plist_id) { H5P_genplist_t *plist; /* Property list pointer */ - hid_t ret_value; /* Return value */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", plist_id); @@ -885,20 +897,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver_info + * Function: H5P_peek_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -927,20 +939,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver_info + * Function: H5Pget_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -973,7 +985,7 @@ done: * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -1486,30 +1498,30 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_cache + * Function: H5Pset_cache * - * Purpose: Set the number of objects in the meta data cache and the - * maximum number of chunks and bytes in the raw data chunk - * cache. + * Purpose: Set the number of objects in the meta data cache and the + * maximum number of chunks and bytes in the raw data chunk + * cache. * - * The RDCC_W0 value should be between 0 and 1 inclusive and - * indicates how much chunks that have been fully read or fully - * written are favored for preemption. A value of zero means - * fully read or written 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. + * The RDCC_W0 value should be between 0 and 1 inclusive and + * indicates how much chunks that have been fully read or fully + * written are favored for preemption. A value of zero means + * fully read or written 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. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, - size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) + size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1540,24 +1552,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_cache + * Function: H5Pget_cache * - * Purpose: Retrieves the maximum possible number of elements in the meta - * data cache and the maximum possible number of elements and - * bytes and the RDCC_W0 value in the raw data chunk cache. Any - * (or all) arguments may be null pointers in which case the - * corresponding datum is not returned. + * Purpose: Retrieves the maximum possible number of elements in the meta + * data cache and the maximum possible number of elements and + * bytes and the RDCC_W0 value in the raw data chunk cache. Any + * (or all) arguments may be null pointers in which case the + * corresponding datum is not returned. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pget_cache(hid_t plist_id, int *mdc_nelmts, - size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) + size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1592,14 +1604,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_image_config + * Function: H5Pset_mdc_image_config * - * Purpose: Set the initial metadata cache image configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache image configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, June 25, 2015 * *------------------------------------------------------------------------- @@ -1636,18 +1648,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_image_config + * Function: H5Pget_mdc_image_config * - * Purpose: Retrieve the metadata cache initial image configuration - * from the target FAPL. + * 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. + * 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 + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Friday, June 26, 2015 * *------------------------------------------------------------------------- @@ -1687,14 +1699,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_config + * Function: H5Pset_mdc_config * - * Purpose: Set the initial metadata cache resize configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache resize configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1731,18 +1743,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_config + * Function: H5Pget_mdc_config * - * Purpose: Retrieve the metadata cache initial resize configuration - * from the target FAPL. + * Purpose: Retrieve the metadata cache initial resize 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_config_t. + * Observe that the function will fail if config_ptr is + * NULL, or if config_ptr->version specifies an unknown + * version of H5AC_cache_config_t. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1782,33 +1794,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_gc_references + * Function: H5Pset_gc_references * - * Purpose: Sets the flag for garbage collecting references for the file. - * Dataset region references (and other reference types - * probably) use space in the file heap. If garbage collection - * is on and the user passes in an uninitialized value in a - * reference structure, the heap might get corrupted. When - * garbage collection is off however and the user re-uses a - * reference, the previous heap block will be orphaned and not - * returned to the free heap space. When garbage collection is - * on, the user must initialize the reference structures to 0 or - * risk heap corruption. + * Purpose: Sets the flag for garbage collecting references for the file. + * Dataset region references (and other reference types + * probably) use space in the file heap. If garbage collection + * is on and the user passes in an uninitialized value in a + * reference structure, the heap might get corrupted. When + * garbage collection is off however and the user re-uses a + * reference, the previous heap block will be orphaned and not + * returned to the free heap space. When garbage collection is + * on, the user must initialize the reference structures to 0 or + * risk heap corruption. * - * Default value for garbage collecting references is off, just - * to be on the safe side. + * Default value for garbage collecting references is off, just + * to be on the safe side. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * June, 1999 + * Programmer: Quincey Koziol + * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1835,22 +1847,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_gc_references + * Function: H5Pget_gc_references * - * Purpose: Returns the current setting for the garbage collection - * references property from a file access property list. + * Purpose: Returns the current setting for the garbage collection + * references property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1949,31 +1961,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_meta_block_size + * Function: H5Pset_meta_block_size * - * Purpose: Sets the minimum size of metadata block allocations when + * Purpose: Sets the minimum size of metadata block allocations when * the H5FD_FEAT_AGGREGATE_METADATA is set by a VFL driver. * Each "raw" metadata block is allocated to be this size and then * specific pieces of metadata (object headers, local heaps, B-trees, etc) * are sub-allocated from this block. * - * The default value is set to 2048 (bytes), indicating that metadata + * The default value is set to 2048 (bytes), indicating that metadata * will be attempted to be bunched together in (at least) 2K blocks in * the file. Setting the value to 0 with this API function will * turn off the metadata aggregation, even if the VFL driver attempts to * use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 25, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2000,22 +2012,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_meta_block_size + * Function: H5Pget_meta_block_size * - * Purpose: Returns the current settings for the metadata block allocation + * Purpose: Returns the current settings for the metadata block allocation * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 29, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2044,31 +2056,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_sieve_buf_size + * Function: H5Pset_sieve_buf_size * - * Purpose: Sets the maximum size of the data seive buffer used for file + * Purpose: Sets the maximum size of the data seive buffer used for file * drivers which are capable of using data sieving. The data sieve * buffer is used when performing I/O on datasets in the file. Using a * buffer which is large anough to hold several pieces of the dataset * being read in for hyperslab selections boosts performance by quite a * bit. * - * The default value is set to 64KB, indicating that file I/O for raw data + * The default value is set to 64KB, indicating that file I/O for raw data * reads and writes will occur in at least 64KB blocks. * Setting the value to 0 with this API function will turn off the * data sieving, even if the VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2095,22 +2107,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_sieve_buf_size + * Function: H5Pget_sieve_buf_size * - * Purpose: Returns the current settings for the data sieve buffer size + * Purpose: Returns the current settings for the data sieve buffer size * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2138,23 +2150,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_small_data_block_size + * Function: H5Pset_small_data_block_size * - * Purpose: Sets the minimum size of "small" raw data block allocations + * Purpose: Sets the minimum size of "small" raw data block allocations * when the H5FD_FEAT_AGGREGATE_SMALLDATA is set by a VFL driver. * Each "small" raw data block is allocated to be this size and then * pieces of raw data which are small enough to fit are sub-allocated from * this block. * - * The default value is set to 2048 (bytes), indicating that raw data + * The default value is set to 2048 (bytes), indicating that raw data * smaller than this value will be attempted to be bunched together in (at * least) 2K blocks in the file. Setting the value to 0 with this API * function will turn off the "small" raw data aggregation, even if the * VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * * Modifications: @@ -2184,14 +2196,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_small_data_block_size + * Function: H5Pget_small_data_block_size * - * Purpose: Returns the current settings for the "small" raw data block + * Purpose: Returns the current settings for the "small" raw data block * allocation property from a file access 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, June 5, 2002 * * Modifications: @@ -2223,9 +2235,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_libver_bounds + * Function: H5Pset_libver_bounds * - * Purpose: Indicates which versions of the file format the library should + * Purpose: Indicates which versions of the file format the library should * use when creating objects. LOW is the earliest version of the HDF5 * library that is guaranteed to be able to access the objects created * (the format of some objects in an HDF5 file may not have changed between @@ -2301,9 +2313,9 @@ done: * releases and then map down to the previous actual library release which * had a format change. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, December 30, 2007 * *------------------------------------------------------------------------- @@ -2341,14 +2353,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_libver_bounds + * Function: H5Pget_libver_bounds * - * Purpose: Returns the current settings for the library version format bounds + * Purpose: Returns the current settings for the library version format bounds * from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 3, 2008 * *------------------------------------------------------------------------- @@ -2488,7 +2500,7 @@ H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size) /* Set value */ if(H5P_set(plist, H5F_ACS_VDS_SIZE_NAME, &vds_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set elink file cache size") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds file cache size") done: FUNC_LEAVE_API(ret_value) @@ -2523,7 +2535,7 @@ H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size) /* Get value */ if(vds_size) if(H5P_get(plist, H5F_ACS_VDS_SIZE_NAME, vds_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get elink file cache size") + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file cache size") done: FUNC_LEAVE_API(ret_value) @@ -2533,9 +2545,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_file_image * - * Purpose: Sets the initial file image. Some file drivers can initialize - * the starting data in a file from a buffer. - * + * Purpose: Sets the initial file image. Some file drivers can initialize + * the starting data in a file from a buffer. + * * Return: Non-negative on success/Negative on failure * * Programmer: Jacob Gruber @@ -2549,22 +2561,22 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) H5P_genplist_t *fapl; /* Property list pointer */ H5FD_file_image_info_t image_info; /* File image info */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*xz", fapl_id, buf_ptr, buf_len); /* validate parameters */ if(!(((buf_ptr == NULL) && (buf_len == 0)) || ((buf_ptr != NULL) && (buf_len > 0)))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistant buf_ptr and buf_len") - + /* Get the plist structure */ if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - + /* Get old image info */ if(H5P_peek(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image pointer") - + /* Release previous buffer, if it exists */ if(image_info.buffer != NULL) { if(image_info.callbacks.image_free) { @@ -2573,8 +2585,8 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) } /* end if */ else H5MM_xfree(image_info.buffer); - } /* end if */ - + } /* end if */ + /* Update struct */ if(buf_ptr) { /* Allocate memory */ @@ -2586,15 +2598,15 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) else if(NULL == (image_info.buffer = H5MM_malloc(buf_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { - if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, - buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, + buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata)) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(image_info.buffer, buf_ptr, buf_len); } /* end if */ else @@ -2614,24 +2626,24 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_file_image * - * Purpose: If the file image exists and buf_ptr_ptr is not NULL, - * allocate a buffer of the correct size, copy the image into - * the new buffer, and return the buffer to the caller in - * *buf_ptr_ptr. Do this using the file image callbacks - * if defined. + * Purpose: If the file image exists and buf_ptr_ptr is not NULL, + * allocate a buffer of the correct size, copy the image into + * the new buffer, and return the buffer to the caller in + * *buf_ptr_ptr. Do this using the file image callbacks + * if defined. * - * NB: It is the responsibility of the caller to free the - * buffer whose address is returned in *buf_ptr_ptr. Do - * this using free if the file image callbacks are not - * defined, or with whatever method is appropriate if - * the callbacks are defined. + * NB: It is the responsibility of the caller to free the + * buffer whose address is returned in *buf_ptr_ptr. Do + * this using free if the file image callbacks are not + * defined, or with whatever method is appropriate if + * the callbacks are defined. * - * If buf_ptr_ptr is not NULL, and no image exists, set - * *buf_ptr_ptr to NULL. + * If buf_ptr_ptr is not NULL, and no image exists, set + * *buf_ptr_ptr to NULL. * - * If buf_len_ptr is not NULL, set *buf_len_ptr equal - * to the length of the file image if it exists, and - * to 0 if it does not. + * If buf_len_ptr is not NULL, set *buf_len_ptr equal + * to the length of the file image if it exists, and + * to 0 if it does not. * * Return: Non-negative on success/Negative on failure * @@ -2659,7 +2671,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || + HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || ((image_info.buffer == NULL) && (image_info.size == 0))); /* Set output size */ @@ -2680,15 +2692,15 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) else if(NULL == (copy_ptr = H5MM_malloc(image_info.size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate copy") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { if(copy_ptr != image_info.callbacks.image_memcpy(copy_ptr, image_info.buffer, - image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, + image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, image_info.callbacks.udata)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(copy_ptr, image_info.buffer, image_info.size); } /* end if */ @@ -2705,7 +2717,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * and memcpys or to perform detailed logging. * @@ -2735,7 +2747,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* Make sure a file image hasn't already been set */ @@ -2744,7 +2756,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Make sure udata callbacks are going to be set if udata is going to be set */ if(callbacks_ptr->udata) @@ -2755,7 +2767,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback if(info.callbacks.udata != NULL) { HDassert(info.callbacks.udata_free); if(info.callbacks.udata_free(info.callbacks.udata) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") } /* end if */ /* Update struct */ @@ -2782,7 +2794,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * * Return: Non-negative on success/Negative on failure @@ -2811,12 +2823,12 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Transfer values to parameters */ *callbacks_ptr = info.callbacks; @@ -2837,12 +2849,12 @@ done: * Function: H5P__file_image_info_copy * * Purpose: Copy file image info. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -2865,7 +2877,7 @@ H5P__file_image_info_copy(void *value) info = (H5FD_file_image_info_t *)value; /* verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); if(info->buffer && info->size > 0) { @@ -2884,14 +2896,14 @@ H5P__file_image_info_copy(void *value) if(NULL == (info->buffer = H5MM_malloc(info->size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory block") } /* end else */ - + /* Copy data to new buffer */ if(info->callbacks.image_memcpy) { - if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, - info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, + info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(info->buffer, old_buffer, info->size); } /* end if */ @@ -2915,8 +2927,8 @@ done: * Function: H5P__file_image_info_free * * Purpose: Free file image info. The buffer and udata may need to be - * freed, possibly using their respective callbacks, so the - * default free won't work. + * freed, possibly using their respective callbacks, so the + * default free won't work. * * Return: Success: Non-negative * Failure: Negative @@ -2937,16 +2949,16 @@ H5P__file_image_info_free(void *value) H5FD_file_image_info_t *info; /* Image info struct */ info = (H5FD_file_image_info_t *)value; - + /* Verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); /* Free buffer */ - if(info->buffer != NULL && info->size > 0) { + if(info->buffer != NULL && info->size > 0) { if(info->callbacks.image_free) { if((*info->callbacks.image_free)(info->buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, info->callbacks.udata) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") + HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") } /* end if */ else H5MM_xfree(info->buffer); @@ -2972,7 +2984,7 @@ done: * 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. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: John Mainzer * June 26, 2015 @@ -3013,11 +3025,11 @@ done: * 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. + * cache image config property in the file creation + * property list is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -3059,11 +3071,11 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) * 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. + * cache image config property in the file creation property + * list is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -3178,7 +3190,7 @@ done: * * Purpose: Delete callback for the file image info property, called * when the property is deleted from the plist. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the default free won't work. * * Return: Non-negative on success/Negative on failure @@ -3208,7 +3220,7 @@ done: * Function: H5P__facc_file_image_info_copy * * Purpose: Copy callback for the file image info property. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Return: Non-negative on success/Negative on failure @@ -3297,7 +3309,7 @@ done: * Function: H5P__facc_file_image_info_close * * Purpose: Close callback for the file image info property. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the standard free won't work. * * Return: Non-negative on success/Negative on failure @@ -3329,7 +3341,7 @@ done: * Purpose: Compare two cache configurations. * * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is - * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: Mohamad Chaarawi * September 24, 2012 @@ -3442,8 +3454,8 @@ done: * cache config property in the file creation property list is * encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3587,8 +3599,8 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) * cache config property in the file creation property list is * decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3722,8 +3734,8 @@ done: * degree property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3760,8 +3772,8 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) * degree property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3795,8 +3807,8 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) * memory type property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3833,8 +3845,8 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size) * memory type property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3862,12 +3874,12 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_core_write_tracking + * Function: H5Pset_core_write_tracking * - * Purpose: Enables/disables core VFD write tracking and page + * Purpose: Enables/disables core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3903,12 +3915,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_core_write_tracking + * Function: H5Pget_core_write_tracking * - * Purpose: Gets information about core VFD write tracking and page + * Purpose: Gets information about core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3945,19 +3957,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_metadata_read_attempts + * Function: H5Pset_metadata_read_attempts + * + * Purpose: Sets the # of read attempts in the file access property list + * when reading metadata with checksum. + * The # of read attempts set via this routine will only apply + * when opening a file with SWMR access. + * The # of read attempts set via this routine does not have + * any effect when opening a file with non-SWMR access; for this + * case, the # of read attempts will be always be 1. * - * Purpose: Sets the # of read attempts in the file access property list - * when reading metadata with checksum. - * The # of read attempts set via this routine will only apply - * when opening a file with SWMR access. - * The # of read attempts set via this routine does not have - * any effect when opening a file with non-SWMR access; for this - * case, the # of read attempts will be always be 1. - * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -3988,13 +4000,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_metadata_read_attempts + * Function: H5Pget_metadata_read_attempts * - * Purpose: Returns the # of metadata read attempts set in the file access property list. + * Purpose: Returns the # of metadata read attempts set in the file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -4014,13 +4026,13 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/) if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Get the # of read attempts set */ + /* Get the # of read attempts set */ if(H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get the number of metadata read attempts") - /* If not set, return the default value */ - if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ - *attempts = H5F_METADATA_READ_ATTEMPTS; + /* If not set, return the default value */ + if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ + *attempts = H5F_METADATA_READ_ATTEMPTS; } /* end if */ done: @@ -4029,14 +4041,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_obj_flush_cb + * Function: H5Pset_obj_flush_cb * - * Purpose: Sets the callback function to invoke and the user data when an - * object flush occurs in the file. - * - * Return: Non-negative on success/Negative on failure + * Purpose: Sets the callback function to invoke and the user data when an + * object flush occurs in the file. * - * Programmer: Vailin Choi; Dec 2013 + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4073,14 +4085,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_obj_flush_cb + * Function: H5Pget_obj_flush_cb + * + * Purpose: Retrieves the callback function and user data set in the + * property list for an object flush. * - * Purpose: Retrieves the callback function and user data set in the - * property list for an object flush. - * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Dec 2013 + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4104,9 +4116,9 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata) /* Assign return value */ if(func) - *func = flush_info.func; + *func = flush_info.func; if(udata) - *udata = flush_info.udata; + *udata = flush_info.udata; done: FUNC_LEAVE_API(ret_value) @@ -4114,11 +4126,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_log_options + * Function: H5Pset_mdc_log_options * - * Purpose: Set metadata cache log options. + * Purpose: Set metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4166,11 +4178,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_log_options + * Function: H5Pget_mdc_log_options * - * Purpose: Get metadata cache log options. + * Purpose: Get metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4524,8 +4536,8 @@ done: * * Purpose: Generic encoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4562,8 +4574,8 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) * * Purpose: Generic decoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4592,22 +4604,22 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_all_coll_metadata_ops + * Function: H5Pset_all_coll_metadata_ops * - * Purpose: Tell the library whether the metadata read operations will - * be done collectively (1) or not (0). Default is independent. - * With collective mode, the library will optimize access to - * metadata operations on the file. + * Purpose: Tell the library whether the metadata read operations will + * be done collectively (1) or not (0). Default is independent. + * With collective mode, the library will optimize access to + * metadata operations on the file. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4651,19 +4663,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_all_coll_metadata_ops + * Function: H5Pget_all_coll_metadata_ops * - * Purpose: Gets information about collective metadata read mode. + * Purpose: Gets information about collective metadata read mode. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4709,14 +4721,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_coll_metadata_write + * Function: H5Pset_coll_metadata_write * - * Purpose: Tell the library whether the metadata write operations will - * be done collectively (1) or not (0). Default is collective. + * Purpose: Tell the library whether the metadata write operations will + * be done collectively (1) or not (0). Default is collective. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4748,13 +4760,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_coll_metadata_write + * Function: H5Pget_coll_metadata_write * - * Purpose: Gets information about collective metadata write mode. + * Purpose: Gets information about collective metadata write mode. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4786,15 +4798,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_page_buffer_size + * Function: H5Pset_page_buffer_size * * Purpose: Set the maximum page buffering size. This has to be a * multiple of the page allocation size which must be enabled; * otherwise file create/open will fail. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- @@ -4834,13 +4846,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_page_buffer_size + * Function: H5Pget_page_buffer_size * - * Purpose: Retrieves the maximum page buffer size. + * Purpose: Retrieves the maximum page buffer size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- -- cgit v0.12 From b475a809d823c0aaf91260f3b3b7df6026ba13b9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 10:31:30 -0600 Subject: Remove return from void functions --- java/src/jni/h5pImp.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index 3c799f2..b144ff6 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5786,8 +5786,6 @@ Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix if(retVal < 0) h5libraryError(env); } - - return (jint)retVal; } /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix */ /* @@ -5854,8 +5852,6 @@ Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix if(retVal < 0) h5libraryError(env); } - - return (jint)retVal; } /* end Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix */ /* -- cgit v0.12 From 8561bd327b37960d62e977e1283a10d8e5102424 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 11:04:29 -0600 Subject: Fix VDS file cache var names --- src/H5Fprivate.h | 424 +++++++++++++++++++++++++++---------------------------- src/H5Pfapl.c | 18 +-- 2 files changed, 221 insertions(+), 221 deletions(-) diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 262e63b..84c8c90 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -25,13 +25,13 @@ typedef struct H5F_t H5F_t; #include "H5Fpublic.h" /* Public headers needed by this file */ -#include "H5FDpublic.h" /* File drivers */ +#include "H5FDpublic.h" /* File drivers */ /* Private headers needed by this file */ #ifdef H5_HAVE_PARALLEL -#include "H5Pprivate.h" /* Property lists */ +#include "H5Pprivate.h" /* Property lists */ #endif /* H5_HAVE_PARALLEL */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /**************************/ @@ -43,68 +43,68 @@ typedef struct H5F_t H5F_t; * Currently, all file meta-data is little-endian. */ -# define INT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define INT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define UINT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define UINT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define INT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ +# define INT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ } -# define UINT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ +# define UINT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ } /* Encode an unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define ENCODE_VAR(p, typ, n, l) { \ - typ _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for(_i = 0; _i < l; _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t*)(p) + l; \ +# define ENCODE_VAR(p, typ, n, l) { \ + typ _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for(_i = 0; _i < l; _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t*)(p) + l; \ } /* Encode a 32-bit unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ # define UINT32ENCODE_VAR(p, n, l) ENCODE_VAR(p, uint32_t, n, l) -# define INT64ENCODE(p, n) { \ - int64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = (n) < 0 ? 0xff : 0; \ - (p) = (uint8_t*)(p)+8; \ +# define INT64ENCODE(p, n) { \ + int64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = (n) < 0 ? 0xff : 0; \ + (p) = (uint8_t*)(p)+8; \ } -# define UINT64ENCODE(p, n) { \ - uint64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = 0; \ - (p) = (uint8_t*)(p) + 8; \ +# define UINT64ENCODE(p, n) { \ + uint64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = 0; \ + (p) = (uint8_t*)(p) + 8; \ } /* Encode a 64-bit unsigned integer into a variable-sized buffer */ @@ -113,31 +113,31 @@ typedef struct H5F_t H5F_t; /* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define UINT64ENCODE_VARLEN(p, n) { \ - uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM_limit_enc_size(__n); \ - \ - *(p)++ = (uint8_t)_s; \ - UINT64ENCODE_VAR(p, __n, _s); \ +# define UINT64ENCODE_VARLEN(p, n) { \ + uint64_t __n = (uint64_t)(n); \ + unsigned _s = H5VM_limit_enc_size(__n); \ + \ + *(p)++ = (uint8_t)_s; \ + UINT64ENCODE_VAR(p, __n, _s); \ } -# define H5_ENCODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32ENCODE(p, n) \ +# define H5_ENCODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32ENCODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_ENCODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - HDmemcpy(&_n, &n, sizeof(double)); \ - for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t *)(p) + 8; \ +# define H5_ENCODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + HDmemcpy(&_n, &n, sizeof(double)); \ + for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t *)(p) + 8; \ } /* DECODE converts little endian bytes pointed by p to integer values and store @@ -148,68 +148,68 @@ typedef struct H5F_t H5F_t; * correctly even if i is actually a 64bit int like in a Cray. */ -# define INT16DECODE(p, i) { \ - (i) = (int16_t)((*(p) & 0xff)); (p)++; \ +# define INT16DECODE(p, i) { \ + (i) = (int16_t)((*(p) & 0xff)); (p)++; \ (i) |= (int16_t)(((*(p) & 0xff) << 8) | \ - ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ + ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ } -# define UINT16DECODE(p, i) { \ - (i) = (uint16_t) (*(p) & 0xff); (p)++; \ - (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ +# define UINT16DECODE(p, i) { \ + (i) = (uint16_t) (*(p) & 0xff); (p)++; \ + (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ } -# define INT32DECODE(p, i) { \ - (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ +# define INT32DECODE(p, i) { \ + (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ (i) |= ((int32_t)(((*(p) & (unsigned)0xff) << 24) | \ ((*(p) & (unsigned)0x80) ? (unsigned)(~0xffffffff) : (unsigned)0x0))); (p)++; \ } -# define UINT32DECODE(p, i) { \ - (i) = (uint32_t)(*(p) & 0xff); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ +# define UINT32DECODE(p, i) { \ + (i) = (uint32_t)(*(p) & 0xff); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ } /* Decode a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define DECODE_VAR(p, n, l) { \ - size_t _i; \ - \ - n = 0; \ - (p) += l; \ - for (_i = 0; _i < l; _i++) \ - n = (n << 8) | *(--p); \ - (p) += l; \ +# define DECODE_VAR(p, n, l) { \ + size_t _i; \ + \ + n = 0; \ + (p) += l; \ + for (_i = 0; _i < l; _i++) \ + n = (n << 8) | *(--p); \ + (p) += l; \ } /* Decode a variable-sized buffer into a 32-bit unsigned integer */ /* (Assumes that the high bits of the integer will be zero) */ # define UINT32DECODE_VAR(p, n, l) DECODE_VAR(p, n, l) -# define INT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(int64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define INT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(int64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } -# define UINT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(uint64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define UINT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(uint64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } /* Decode a variable-sized buffer into a 64-bit unsigned integer */ @@ -218,58 +218,58 @@ typedef struct H5F_t H5F_t; /* Decode a 64-bit unsigned integer and its length from a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define UINT64DECODE_VARLEN(p, n) { \ - unsigned _s = *(p)++; \ - \ - UINT64DECODE_VAR(p, n, _s); \ +# define UINT64DECODE_VARLEN(p, n) { \ + unsigned _s = *(p)++; \ + \ + UINT64DECODE_VAR(p, n, _s); \ } -# define H5_DECODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32DECODE(p, n) \ +# define H5_DECODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32DECODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_DECODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - _n = 0; \ - (p) += 8; \ - for(_u = 0; _u < sizeof(uint64_t); _u++) \ - _n = (_n << 8) | *(--p); \ - HDmemcpy(&(n), &_n, sizeof(double)); \ - (p) += 8; \ +# define H5_DECODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + _n = 0; \ + (p) += 8; \ + for(_u = 0; _u < sizeof(uint64_t); _u++) \ + _n = (_n << 8) | *(--p); \ + HDmemcpy(&(n), &_n, sizeof(double)); \ + (p) += 8; \ } /* Address-related macros */ -#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ - HADDR_UNDEF==(X)+(haddr_t)(Z) || \ - (X)+(haddr_t)(Z)<(X)) -#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) +#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ + HADDR_UNDEF==(X)+(haddr_t)(Z) || \ + (X)+(haddr_t)(Z)<(X)) +#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) /* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making * certain that X is not HADDR_UNDEF and then checking that X equals Y */ -#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ - (X)==(Y)) -#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) -#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<(Y)) -#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<=(Y)) -#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>(Y)) -#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>=(Y)) -#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ - (H5F_addr_lt((X), (Y)) ? -1 : 1)) -#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) +#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ + (X)==(Y)) +#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) +#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<(Y)) +#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<=(Y)) +#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>(Y)) +#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>=(Y)) +#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ + (H5F_addr_lt((X), (Y)) ? -1 : 1)) +#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) #define H5F_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \ ((O1) >= (O2) && (O1) < ((O2) + (L2)))) @@ -294,7 +294,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr) #define H5F_SYM_LEAF_K(F) ((F)->shared->sblock->sym_leaf_k) #define H5F_KVALUE(F,T) ((F)->shared->sblock->btree_k[(T)->id]) -#define H5F_NREFS(F) ((F)->shared->nrefs) +#define H5F_NREFS(F) ((F)->shared->nrefs) #define H5F_SIZEOF_ADDR(F) ((F)->shared->sizeof_addr) #define H5F_SIZEOF_SIZE(F) ((F)->shared->sizeof_size) #define H5F_SOHM_ADDR(F) ((F)->shared->sohm_addr) @@ -325,8 +325,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) ((F)->shared->use_mdc_logging) #define H5F_START_MDC_LOG_ON_ACCESS(F) ((F)->shared->start_mdc_log_on_access) #define H5F_MDC_LOG_LOCATION(F) ((F)->shared->mdc_log_location) -#define H5F_ALIGNMENT(F) ((F)->shared->alignment) -#define H5F_THRESHOLD(F) ((F)->shared->threshold) +#define H5F_ALIGNMENT(F) ((F)->shared->alignment) +#define H5F_THRESHOLD(F) ((F)->shared->threshold) #define H5F_PGEND_META_THRES(F) ((F)->shared->fs.pgend_meta_thres) #define H5F_POINT_OF_NO_RETURN(F) ((F)->shared->fs.point_of_no_return) #define H5F_FIRST_ALLOC_DEALLOC(F) ((F)->shared->first_alloc_dealloc) @@ -351,7 +351,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) (H5F_get_base_addr(F)) #define H5F_SYM_LEAF_K(F) (H5F_sym_leaf_k(F)) #define H5F_KVALUE(F,T) (H5F_Kvalue(F,T)) -#define H5F_NREFS(F) (H5F_get_nrefs(F)) +#define H5F_NREFS(F) (H5F_get_nrefs(F)) #define H5F_SIZEOF_ADDR(F) (H5F_sizeof_addr(F)) #define H5F_SIZEOF_SIZE(F) (H5F_sizeof_size(F)) #define H5F_SOHM_ADDR(F) (H5F_get_sohm_addr(F)) @@ -382,8 +382,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) (H5F_use_mdc_logging(F)) #define H5F_START_MDC_LOG_ON_ACCESS(F) (H5F_start_mdc_log_on_access(F)) #define H5F_MDC_LOG_LOCATION(F) (H5F_mdc_log_location(F)) -#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) -#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) +#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) +#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) #define H5F_PGEND_META_THRES(F) (H5F_get_pgend_meta_thres(F)) #define H5F_POINT_OF_NO_RETURN(F) (H5F_get_point_of_no_return(F)) #define H5F_FIRST_ALLOC_DEALLOC(F) (H5F_get_first_alloc_dealloc(F)) @@ -392,32 +392,32 @@ typedef struct H5F_t H5F_t; /* Macros to encode/decode offset/length's for storing in the file */ -#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ - case 4: UINT32ENCODE(p,o); break; \ - case 8: UINT64ENCODE(p,o); break; \ - case 2: UINT16ENCODE(p,o); break; \ +#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ + case 4: UINT32ENCODE(p,o); break; \ + case 8: UINT64ENCODE(p,o); break; \ + case 2: UINT16ENCODE(p,o); break; \ } -#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ - case 4: UINT32DECODE(p, o); break; \ - case 8: UINT64DECODE(p, o); break; \ - case 2: UINT16DECODE(p, o); break; \ +#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ + case 4: UINT32DECODE(p, o); break; \ + case 8: UINT64DECODE(p, o); break; \ + case 2: UINT16DECODE(p, o); break; \ } -#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32ENCODE(p,l); break; \ - case 8: UINT64ENCODE(p,l); break; \ - case 2: UINT16ENCODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32ENCODE(p,l); break; \ + case 8: UINT64ENCODE(p,l); break; \ + case 2: UINT16ENCODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_ENCODE_LENGTH(f,p,l) H5F_ENCODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) -#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32DECODE(p,l); break; \ - case 8: UINT64DECODE(p,l); break; \ - case 2: UINT16DECODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32DECODE(p,l); break; \ + case 8: UINT64DECODE(p,l); break; \ + case 2: UINT16DECODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_DECODE_LENGTH(f,p,l) H5F_DECODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) @@ -427,13 +427,13 @@ typedef struct H5F_t H5F_t; * with. */ #if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_SIZET2OFFT(X) \ +# define H5F_OVERFLOW_SIZET2OFFT(X) \ ((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(HDoff_t)-1))) #else # define H5F_OVERFLOW_SIZET2OFFT(X) 0 #endif #if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_HSIZET2OFFT(X) \ +# define H5F_OVERFLOW_HSIZET2OFFT(X) \ ((hsize_t)(X) >= (hsize_t)((hsize_t)1 << (8 * sizeof(HDoff_t) - 1))) #else # define H5F_OVERFLOW_HSIZET2OFFT(X) 0 @@ -461,14 +461,14 @@ typedef struct H5F_t H5F_t; #define H5F_CRT_SHMSG_LIST_MAX_NAME "shmsg_list_max" /* Shared message list maximum size */ #define H5F_CRT_SHMSG_BTREE_MIN_NAME "shmsg_btree_min" /* Shared message B-tree minimum size */ #define H5F_CRT_FILE_SPACE_STRATEGY_NAME "file_space_strategy" /* File space handling strategy */ -#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ +#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ #define H5F_CRT_FREE_SPACE_THRESHOLD_NAME "free_space_threshold" /* Free space section threshold */ #define H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME "file_space_page_size" /* File space page size */ /* ========= File Access properties ============ */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ +#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ #define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ @@ -487,9 +487,9 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ -#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ +#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ -#define H5F_ACS_VDS_SIZE_NAME "vds_size" /* Size of vds file cache */ +#define H5F_ACS_VDS_FILE_CACHE_SIZE_NAME "vds_file_cache_size" /* Size of vds file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ #define H5F_ACS_USE_MDC_LOGGING_NAME "use_mdc_logging" /* Whether to use metadata cache logging */ @@ -505,7 +505,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME "page_buffer_min_raw_perc" /* the min raw data percentage for the page buffer cache */ /* ======================== File Mount properties ====================*/ -#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ +#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ #ifdef H5_HAVE_PARALLEL @@ -514,20 +514,20 @@ typedef struct H5F_t H5F_t; #endif /* H5_HAVE_PARALLEL */ /* Define the HDF5 file signature */ -#define H5F_SIGNATURE "\211HDF\r\n\032\n" +#define H5F_SIGNATURE "\211HDF\r\n\032\n" #define H5F_SIGNATURE_LEN 8 /* Version #'s of the major components of the file format */ -#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ -#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ -#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ -#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ -#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ +#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ +#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ +#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ +#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ +#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ #define HDF5_SUPERBLOCK_VERSION_V18_LATEST HDF5_SUPERBLOCK_VERSION_2 /* The latest superblock version for v18 */ -#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ -#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ -#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ -#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ +#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ +#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ +#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ +#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ /* B-tree internal 'K' values */ #define HDF5_BTREE_SNODE_IK_DEF 16 @@ -537,43 +537,43 @@ typedef struct H5F_t H5F_t; if it is changed, the code must compensate. -QAK */ -#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ - /* See format specification on version 1 B-trees */ +#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ + /* See format specification on version 1 B-trees */ /* Default file space handling strategy */ -#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR +#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_PERSIST_DEF FALSE +#define H5F_FREE_SPACE_PERSIST_DEF FALSE /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_THRESHOLD_DEF 1 +#define H5F_FREE_SPACE_THRESHOLD_DEF 1 /* For paged aggregation: default file space page size when not set */ -#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096 +#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 +#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 +#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 0 /* Default for threshold for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_DEF 1 +#define H5F_ALIGN_DEF 1 /* Default for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_THRHD_DEF 1 +#define H5F_ALIGN_THRHD_DEF 1 /* Default size for meta data aggregation block (can be set via H5Pset_meta_block_size()) */ -#define H5F_META_BLOCK_SIZE_DEF 2048 +#define H5F_META_BLOCK_SIZE_DEF 2048 /* Default size for small data aggregation block (can be set via H5Pset_small_data_block_size()) */ -#define H5F_SDATA_BLOCK_SIZE_DEF 2048 +#define H5F_SDATA_BLOCK_SIZE_DEF 2048 /* Check for file using paged aggregation */ #define H5F_PAGED_AGGR(F) (F->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE && F->shared->fs_page_size) /* Metadata read attempt values */ -#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ -#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ +#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ +#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ /* Macros to define signatures of all objects in the file */ @@ -584,10 +584,10 @@ typedef struct H5F_t H5F_t; /* Size of checksum information (on disk) */ /* (all on-disk checksums should be this length) */ -#define H5_SIZEOF_CHKSUM 4 +#define H5_SIZEOF_CHKSUM 4 /* v1 B-tree node signature */ -#define H5B_MAGIC "TREE" +#define H5B_MAGIC "TREE" /* v2 B-tree signatures */ #define H5B2_HDR_MAGIC "BTHD" /* Header */ @@ -617,7 +617,7 @@ typedef struct H5F_t H5F_t; #define H5HF_DBLOCK_MAGIC "FHDB" /* Direct block */ /* Global heap signature */ -#define H5HG_MAGIC "GCOL" +#define H5HG_MAGIC "GCOL" /* Local heap signature */ #define H5HL_MAGIC "HEAP" @@ -705,11 +705,11 @@ typedef enum H5F_fs_state_t { typedef enum H5F_mem_page_t { H5F_MEM_PAGE_DEFAULT = 0, /* Not used */ H5F_MEM_PAGE_SUPER = 1, - H5F_MEM_PAGE_BTREE = 2, - H5F_MEM_PAGE_DRAW = 3, - H5F_MEM_PAGE_GHEAP = 4, - H5F_MEM_PAGE_LHEAP = 5, - H5F_MEM_PAGE_OHDR = 6, + H5F_MEM_PAGE_BTREE = 2, + H5F_MEM_PAGE_DRAW = 3, + H5F_MEM_PAGE_GHEAP = 4, + H5F_MEM_PAGE_LHEAP = 5, + H5F_MEM_PAGE_OHDR = 6, H5F_MEM_PAGE_LARGE_SUPER = 7, H5F_MEM_PAGE_LARGE_BTREE = 8, H5F_MEM_PAGE_LARGE_DRAW = 9, diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 586f559..d4e84ab 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -156,10 +156,10 @@ #define H5F_ACS_EFC_SIZE_ENC H5P__encode_unsigned #define H5F_ACS_EFC_SIZE_DEC H5P__decode_unsigned /* Definition for vds file cache size */ -#define H5F_ACS_VDS_SIZE_SIZE sizeof(unsigned) -#define H5F_ACS_VDS_SIZE_DEF 0 -#define H5F_ACS_VDS_SIZE_ENC H5P__encode_unsigned -#define H5F_ACS_VDS_SIZE_DEC H5P__decode_unsigned +#define H5F_ACS_VDS_FILE_CACHE_SIZE_SIZE sizeof(unsigned) +#define H5F_ACS_VDS_FILE_CACHE_SIZE_DEF 0 +#define H5F_ACS_VDS_FILE_CACHE_SIZE_ENC H5P__encode_unsigned +#define H5F_ACS_VDS_FILE_CACHE_SIZE_DEC H5P__decode_unsigned /* Definition of pointer to initial file image info */ #define H5F_ACS_FILE_IMAGE_INFO_SIZE sizeof(H5FD_file_image_info_t) #define H5F_ACS_FILE_IMAGE_INFO_DEF H5FD_DEFAULT_FILE_IMAGE_INFO @@ -360,7 +360,7 @@ static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; static const hbool_t H5F_def_latest_format_g = H5F_ACS_LATEST_FORMAT_DEF; /* Default setting for "use the latest version of the format" flag */ static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ -static const unsigned H5F_def_vds_size_g = H5F_ACS_VDS_SIZE_DEF; /* Default vds file cache size */ +static const unsigned H5F_def_vds_file_cache_size_g = H5F_ACS_VDS_FILE_CACHE_SIZE_DEF; /* Default vds file cache size */ static const H5FD_file_image_info_t H5F_def_file_image_info_g = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */ static const hbool_t H5F_def_core_write_tracking_flag_g = H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEF; /* Default setting for core VFD write tracking */ static const size_t H5F_def_core_write_tracking_page_size_g = H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEF; /* Default core VFD write tracking page size */ @@ -517,8 +517,8 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vds file cache size */ - if(H5P_register_real(pclass, H5F_ACS_VDS_SIZE_NAME, H5F_ACS_VDS_SIZE_SIZE, &H5F_def_vds_size_g, - NULL, NULL, NULL, H5F_ACS_VDS_SIZE_ENC, H5F_ACS_VDS_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, H5F_ACS_VDS_FILE_CACHE_SIZE_SIZE, &H5F_def_vds_file_cache_size_g, + NULL, NULL, NULL, H5F_ACS_VDS_FILE_CACHE_SIZE_ENC, H5F_ACS_VDS_FILE_CACHE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -2499,7 +2499,7 @@ H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Set value */ - if(H5P_set(plist, H5F_ACS_VDS_SIZE_NAME, &vds_size) < 0) + if(H5P_set(plist, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, &vds_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds file cache size") done: @@ -2534,7 +2534,7 @@ H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size) /* Get value */ if(vds_size) - if(H5P_get(plist, H5F_ACS_VDS_SIZE_NAME, vds_size) < 0) + if(H5P_get(plist, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, vds_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file cache size") done: -- cgit v0.12 From 8b24653c1fba1d1811e692a028760ffb091cd0a8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 11:14:49 -0600 Subject: Correct var name --- src/H5Fprivate.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 84c8c90..575aa1c 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -489,7 +489,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ #define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ -#define H5F_ACS_VDS_FILE_CACHE_SIZE_NAME "vds_file_cache_size" /* Size of vds file cache */ +#define H5F_ACS_VDS_FILE_CACHE_SIZE_NAME "vds_file_cache_size" /* Size of vds file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ #define H5F_ACS_USE_MDC_LOGGING_NAME "use_mdc_logging" /* Whether to use metadata cache logging */ @@ -580,14 +580,14 @@ typedef struct H5F_t H5F_t; /* Size of signature information (on disk) */ /* (all on-disk signatures should be this length) */ -#define H5_SIZEOF_MAGIC 4 +#define H5_SIZEOF_MAGIC 4 /* Size of checksum information (on disk) */ /* (all on-disk checksums should be this length) */ #define H5_SIZEOF_CHKSUM 4 /* v1 B-tree node signature */ -#define H5B_MAGIC "TREE" +#define H5B_MAGIC "TREE" /* v2 B-tree signatures */ #define H5B2_HDR_MAGIC "BTHD" /* Header */ @@ -617,7 +617,7 @@ typedef struct H5F_t H5F_t; #define H5HF_DBLOCK_MAGIC "FHDB" /* Direct block */ /* Global heap signature */ -#define H5HG_MAGIC "GCOL" +#define H5HG_MAGIC "GCOL" /* Local heap signature */ #define H5HL_MAGIC "HEAP" -- cgit v0.12 From 386be69a30f2ef8db94c32b1d9731fd379a4062a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 11:51:09 -0600 Subject: HDFFV-9724 combine efc and vds into one function --- src/H5Dint.c | 131 +++++++++++++-------------------------------------------- src/H5Fquery.c | 2 +- 2 files changed, 31 insertions(+), 102 deletions(-) diff --git a/src/H5Dint.c b/src/H5Dint.c index 2123836..8b663b8 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -61,9 +61,7 @@ static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); -static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, - char **extfile_prefix); -static herr_t H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, +static herr_t H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char * prefix_type, char **vds_prefix); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, @@ -965,99 +963,25 @@ done: } /* end H5D__update_oh_info() */ -/*-------------------------------------------------------------------------- - * Function: H5D_build_extfile_prefix - * - * Purpose: Determine the external file prefix to be used and store - * it in extfile_prefix. Stores an empty string if no prefix - * should be used. - * - * Return: SUCCEED/FAIL - *-------------------------------------------------------------------------- - */ -static herr_t -H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/) -{ - char *prefix = NULL; /* prefix used to look for the file */ - char *extpath = NULL; /* absolute path of directory the HDF5 file is in */ - size_t extpath_len; /* length of extpath */ - size_t prefix_len; /* length of prefix */ - size_t extfile_prefix_len; /* length of expanded prefix */ - H5P_genplist_t *plist = NULL; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* Return value */ - - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(dset); - HDassert(dset->oloc.file); - - extpath = H5F_EXTPATH(dset->oloc.file); - HDassert(extpath); - - /* XXX: Future thread-safety note - getenv is not required - * to be reentrant. - */ - prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); - - if(prefix == NULL || *prefix == '\0') { - /* Set prefix to value of H5D_ACS_EFILE_PREFIX_NAME property */ - if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_peek(plist, H5D_ACS_EFILE_PREFIX_NAME, &prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file prefix") - } /* end if */ - - /* Prefix has to be checked for NULL / empty string again because the - * code above might have updated it. - */ - if(prefix == NULL || *prefix == '\0' || HDstrcmp(prefix, ".") == 0) { - /* filename is interpreted as relative to the current directory, - * does not need to be expanded - */ - if(NULL == (*extfile_prefix = (char *)H5MM_strdup(""))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - } /* end if */ - else { - if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) { - /* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */ - extpath_len = HDstrlen(extpath); - prefix_len = HDstrlen(prefix); - extfile_prefix_len = extpath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; - - if(NULL == (*extfile_prefix = (char *)H5MM_malloc(extfile_prefix_len))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") - HDsnprintf(*extfile_prefix, extfile_prefix_len, "%s%s", extpath, prefix + HDstrlen("${ORIGIN}")); - } /* end if */ - else { - if(NULL == (*extfile_prefix = (char *)H5MM_strdup(prefix))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - } /* end else */ - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_build_extfile_prefix() */ - /*-------------------------------------------------------------------------- - * Function: H5D_build_vds_prefix + * Function: H5D_build_file_prefix * - * Purpose: Determine the vds file prefix to be used and store - * it in vds_prefix. Stores an empty string if no prefix + * Purpose: Determine the file prefix to be used and store + * it in file_prefix. Stores an empty string if no prefix * should be used. * * Return: SUCCEED/FAIL *-------------------------------------------------------------------------- */ static herr_t -H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, char **vds_prefix /*out*/) +H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, char **file_prefix /*out*/) { char *prefix = NULL; /* prefix used to look for the file */ - char *vdspath = NULL; /* absolute path of directory the HDF5 file is in */ - size_t vdspath_len; /* length of vdstpath */ + char *filepath = NULL; /* absolute path of directory the HDF5 file is in */ + size_t filepath_len; /* length of file path */ size_t prefix_len; /* length of prefix */ - size_t vds_prefix_len; /* length of expanded prefix */ + size_t file_prefix_len; /* length of expanded prefix */ H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1067,20 +991,25 @@ H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, char **vds_prefix /*out*/ HDassert(dset); HDassert(dset->oloc.file); - vdspath = H5F_EXTPATH(dset->oloc.file); - HDassert(vdspath); + filepath = H5F_EXTPATH(dset->oloc.file); + HDassert(filepath); /* XXX: Future thread-safety note - getenv is not required * to be reentrant. */ - prefix = HDgetenv("HDF5_VDS_PREFIX"); + if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) + prefix = HDgetenv("HDF5_VDS_PREFIX"); + else if (HDstrcmp(prefix_type, H5D_ACS_EFILE_PREFIX_NAME) == 0) + prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); + else + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "prefix name is not sensible") if(prefix == NULL || *prefix == '\0') { - /* Set prefix to value of H5D_ACS_VDS_PREFIX_NAME property */ + /* Set prefix to value of prefix_type property */ if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds prefix") + if(H5P_peek(plist, prefix_type, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file prefix") } /* end if */ /* Prefix has to be checked for NULL / empty string again because the @@ -1090,29 +1019,29 @@ H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, char **vds_prefix /*out*/ /* filename is interpreted as relative to the current directory, * does not need to be expanded */ - if(NULL == (*vds_prefix = (char *)H5MM_strdup(""))) + if(NULL == (*file_prefix = (char *)H5MM_strdup(""))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end if */ else { if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) { /* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */ - vdspath_len = HDstrlen(vdspath); + filepath_len = HDstrlen(filepath); prefix_len = HDstrlen(prefix); - vds_prefix_len = vdspath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; + file_prefix_len = filepath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; - if(NULL == (*vds_prefix = (char *)H5MM_malloc(vds_prefix_len))) + if(NULL == (*file_prefix = (char *)H5MM_malloc(file_prefix_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") - HDsnprintf(*vds_prefix, vds_prefix_len, "%s%s", vdspath, prefix + HDstrlen("${ORIGIN}")); + HDsnprintf(*file_prefix, file_prefix_len, "%s%s", filepath, prefix + HDstrlen("${ORIGIN}")); } /* end if */ else { - if(NULL == (*vds_prefix = (char *)H5MM_strdup(prefix))) + if(NULL == (*file_prefix = (char *)H5MM_strdup(prefix))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end else */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_build_vds_prefix() */ +} /* H5D_build_file_prefix() */ /*------------------------------------------------------------------------- @@ -1294,11 +1223,11 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") /* Set the external file prefix */ - if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) + if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &new_dset->shared->extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") /* Set the vds file prefix */ - if(H5D_build_vds_prefix(new_dset, dapl_id, &new_dset->shared->vds_prefix) < 0) + if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &new_dset->shared->vds_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") /* Add the dataset to the list of opened objects in the file */ @@ -1454,11 +1383,11 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path") /* Get the external file prefix */ - if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) + if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") /* Get the vds prefix */ - if(H5D_build_vds_prefix(dataset, dapl_id, &vds_prefix) < 0) + if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &vds_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") /* Check if dataset was already open */ diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 61b4183..4765d00 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -144,7 +144,7 @@ H5F_get_actual_name(const H5F_t *f) * Function: H5F_get_extpath * * Purpose: Retrieve the file's 'extpath' flags - * This is used by H5L_extern_traverse() and H5D_build_extfile_prefix() to retrieve the main file's location + * This is used by H5L_extern_traverse() and H5D_build_file_prefix() to retrieve the main file's location * when searching the target file. * * Return: 'extpath' on success/abort on failure (shouldn't fail) -- cgit v0.12 From 4da73f893ab4df56871e11d82978d21b6b9a6ecb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 14:29:22 -0600 Subject: Add h5dump VDS prefix tests --- tools/test/h5dump/CMakeTestsVDS.cmake | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 3addecf..368471c 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -72,6 +72,14 @@ f-3.h5 vds-eiger.h5 ) + set (HDF5_REFERENCE_PREFIX_VDS + 1_vds.h5 + 2_vds.h5 + 4_vds.h5 + 5_vds.h5 + vds-percival-unlim-maxmin.h5 + vds-eiger.h5 + ) set (HDF5_ERROR_REFERENCE_VDS ) @@ -80,12 +88,21 @@ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach () + foreach (vds_h5_file ${HDF5_REFERENCE_PREFIX_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/prefix/${fname}" "h5dump_vds_files") + 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 () + 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/prefix/${fname}" "h5dump_vds_files") + 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") @@ -134,6 +151,44 @@ endif () endmacro () + macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + if (NOT "${resultcode}" STREQUAL "0") + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") + endif () + if (NOT "${last_vds_test}" STREQUAL "") + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) + endif () + else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP_PREFIX-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + add_test ( + NAME H5DUMP_PREFIX-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" + -D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects) + endif () + endmacro () + macro (ADD_H5_VDS_LAYOUT resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) @@ -261,3 +316,15 @@ 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 () + + # Data read with prefix + if (USE_FILTER_DEFLATE) + ADD_H5_VDS_PREFIX_TEST (tvds-1 0 --enable-error-stack 1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-2 0 --enable-error-stack 2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-4 0 --enable-error-stack 4_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-5 0 --enable-error-stack 5_vds.h5) + ADD_H5_VDS_PREFIX_TEST (vds-first 0 --vds-view-first-missing --enable-error-stack vds-percival-unlim-maxmin.h5) + ADD_H5_VDS_PREFIX_TEST (vds-gap1 0 -d /VDS-Eiger --vds-gap-size=1 --enable-error-stack vds-eiger.h5) + ADD_H5_VDS_PREFIX_TEST (vds-gap2 0 --vds-gap-size=2 --enable-error-stack vds-eiger.h5) + endif () + -- cgit v0.12 From ba714e682047d19fba7ef2c87b072f75ac772e88 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 15:08:04 -0600 Subject: HDFFV-9724 Add H5LS prefix test with ${ORIGIN} --- MANIFEST | 6 ++++ config/cmake_ext_mod/runTest.cmake | 1 + tools/test/h5ls/CMakeTestsVDS.cmake | 55 ++++++++++++++++++++++++++++++++++ tools/test/h5ls/vds_prefix/tvds-1.ls | 14 +++++++++ tools/test/h5ls/vds_prefix/tvds-2.ls | 13 ++++++++ tools/test/h5ls/vds_prefix/tvds-3_1.ls | 14 +++++++++ tools/test/h5ls/vds_prefix/tvds-3_2.ls | 13 ++++++++ tools/test/h5ls/vds_prefix/tvds-4.ls | 9 ++++++ tools/test/h5ls/vds_prefix/tvds-5.ls | 11 +++++++ 9 files changed, 136 insertions(+) create mode 100644 tools/test/h5ls/vds_prefix/tvds-1.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-2.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-3_1.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-3_2.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-4.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-5.ls diff --git a/MANIFEST b/MANIFEST index 9b91c78..c6c7b3c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1430,6 +1430,12 @@ ./tools/test/h5ls/h5ls_plugin.sh.in ./tools/test/h5ls/testh5ls.sh.in ./tools/test/h5ls/testh5lsvds.sh.in +./tools/test/h5ls/vds_prefix/tvds-1.ls +./tools/test/h5ls/vds_prefix/tvds-2.ls +./tools/test/h5ls/vds_prefix/tvds-3_1.ls +./tools/test/h5ls/vds_prefix/tvds-3_2.ls +./tools/test/h5ls/vds_prefix/tvds-4.ls +./tools/test/h5ls/vds_prefix/tvds-5.ls # h5copy sources ./tools/src/h5copy/Makefile.am diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 2479728..5569a73 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -55,6 +55,7 @@ endif () if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") + #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") endif () if (NOT TEST_INPUT) diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index 5df61bb..f7eb198 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -61,6 +61,17 @@ 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 () + + foreach (listfiles ${LIST_HDF5_TEST_FILES}) + get_filename_component(fname "${listfiles}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") + endforeach () + + foreach (listfiles ${LIST_OTHER_TEST_FILES}) + get_filename_component(fname "${listfiles}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5LS_SOURCE_DIR}/vds_prefix/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") + endforeach () + add_custom_target(h5ls_vds_files ALL COMMENT "Copying files needed by h5ls_vds tests" DEPENDS ${h5ls_vds_files_list}) ############################################################################## @@ -104,6 +115,43 @@ endif () endmacro () + macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") + if ("${resultcode}" STREQUAL "1") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") + endif () + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () + else () + add_test ( + NAME H5LS_PREFIX-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") + add_test ( + NAME H5LS_PREFIX-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=vds/prefix/${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=vds/prefix/${resultfile}.ls" + -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" + -D "TEST_ENV_VALUE=\${ORIGIN}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects) + endif () + endmacro () + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -155,3 +203,10 @@ ADD_H5_VDS_TEST (tvds-4 0 -w80 -v -S 4_vds.h5) ADD_H5_VDS_TEST (tvds-5 0 -w80 -v -S 5_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-1 0 -w80 -v -S vds/prefix/1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-2 0 -w80 -v -S vds/prefix/2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-3_1 0 -w80 -v -S vds/prefix/3_1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-3_2 0 -w80 -v -S vds/prefix/3_2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-4 0 -w80 -v -S vds/prefix/4_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-5 0 -w80 -v -S vds/prefix/5_vds.h5) + diff --git a/tools/test/h5ls/vds_prefix/tvds-1.ls b/tools/test/h5ls/vds_prefix/tvds-1.ls new file mode 100644 index 0000000..2830d1a --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-1.ls @@ -0,0 +1,14 @@ +Opened "vds/prefix/1_vds.h5" with sec2 driver. +vds_dset Dataset {5/Inf, 18/18, 8/8} + Location: 1:800 + Links: 1 + Maps: {6} Source { + 1_a.h5 /source_dset + 1_b.h5 /source_dset + 1_c.h5 /source_dset + 1_d.h5 /source_dset + 1_e.h5 /source_dset + 1_f.h5 /source_dset + } + Storage: 2880 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-2.ls b/tools/test/h5ls/vds_prefix/tvds-2.ls new file mode 100644 index 0000000..5c6f9d3 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-2.ls @@ -0,0 +1,13 @@ +Opened "vds/prefix/2_vds.h5" with sec2 driver. +vds_dset Dataset {6/Inf, 8/8, 14/14} + Location: 1:800 + Links: 1 + Maps: {5} Source { + 2_a.h5 /source_dset + 2_b.h5 /source_dset + 2_c.h5 /source_dset + 2_d.h5 /source_dset + 2_e.h5 /source_dset + } + Storage: 2688 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_1.ls b/tools/test/h5ls/vds_prefix/tvds-3_1.ls new file mode 100644 index 0000000..f4c8e78 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-3_1.ls @@ -0,0 +1,14 @@ +Opened "vds/prefix/3_1_vds.h5" with sec2 driver. +vds_dset Dataset {5/Inf, 25/25, 8/8} + Location: 1:800 + Links: 1 + Maps: {6} Source { + 1_a.h5 /source_dset + 1_b.h5 /source_dset + 1_c.h5 /source_dset + 1_d.h5 /source_dset + 1_e.h5 /source_dset + 1_f.h5 /source_dset + } + Storage: 4000 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_2.ls b/tools/test/h5ls/vds_prefix/tvds-3_2.ls new file mode 100644 index 0000000..5a7e2d8 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-3_2.ls @@ -0,0 +1,13 @@ +Opened "vds/prefix/3_2_vds.h5" with sec2 driver. +vds_dset Dataset {6/Inf, 13/13, 19/19} + Location: 1:800 + Links: 1 + Maps: {5} Source { + 2_a.h5 /source_dset + 2_b.h5 /source_dset + 2_c.h5 /source_dset + 2_d.h5 /source_dset + 2_e.h5 /source_dset + } + Storage: 5928 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-4.ls b/tools/test/h5ls/vds_prefix/tvds-4.ls new file mode 100644 index 0000000..c22d3a4 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-4.ls @@ -0,0 +1,9 @@ +Opened "vds/prefix/4_vds.h5" with sec2 driver. +vds_dset Dataset {9/Inf, 4/4, 4/4} + Location: 1:800 + Links: 1 + Maps: {1} Source { + 4_%b.h5 /source_dset + } + Storage: 576 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-5.ls b/tools/test/h5ls/vds_prefix/tvds-5.ls new file mode 100644 index 0000000..efba8dc --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-5.ls @@ -0,0 +1,11 @@ +Opened "vds/prefix/5_vds.h5" with sec2 driver. +vds_dset Dataset {9/Inf, 4/4, 4/4} + Location: 1:800 + Links: 1 + Maps: {3} Source { + 5_a.h5 /source_dset + 5_b.h5 /source_dset + 5_c.h5 /source_dset + } + Storage: 576 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer -- cgit v0.12 From 65e09afd6c05ab34fde4f8779ca93a822014c8aa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 15:17:02 -0600 Subject: Add prefix dir to the clear command --- tools/test/h5ls/CMakeTestsVDS.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index f7eb198..f25bd98 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -119,7 +119,7 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") if ("${resultcode}" STREQUAL "1") set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") endif () @@ -134,7 +134,7 @@ ${resultfile}.out ${resultfile}.out.err ) - set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") + set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") add_test ( NAME H5LS_PREFIX-${resultfile} COMMAND "${CMAKE_COMMAND}" -- cgit v0.12 From ac8274c3506c106a65dbc9c7a53a6f574ff3379a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Dec 2017 15:32:27 -0600 Subject: HDFFV-9724 Copy efc_open search from Lextern_traverse --- src/H5Dvirtual.c | 230 ++++++++++++++++++++++++++++++++++++++++++++++++++----- src/H5system.c | 2 +- 2 files changed, 212 insertions(+), 20 deletions(-) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index e0a4a83..4882e9f 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -763,6 +763,208 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__virtual_build_name() */ + +/*-------------------------------------------------------------------------- + * Function: H5D_getenv_prefix_name -- + * + * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, + * which is separated by the environment delimiter. + * env_prefix is modified to point to the remaining pathnames + * in the list. + * + * Return: A pointer to a pathname +--------------------------------------------------------------------------*/ +static char * +H5D_getenv_prefix_name(char **env_prefix/*in,out*/) +{ + char *retptr=NULL; + char *strret=NULL; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + strret = HDstrchr(*env_prefix, H5_COLON_SEPC); + if (strret == NULL) { + retptr = *env_prefix; + *env_prefix = strret; + } else { + retptr = *env_prefix; + *env_prefix = strret + 1; + *strret = '\0'; + } + + FUNC_LEAVE_NOAPI(retptr) +} /* end H5D_getenv_prefix_name() */ + +/*------------------------------------------------------------------------- + * Function: H5D__virtual_open_file + * + * Purpose: Attempts to open a source dataset file. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +static H5F_t * +H5D__virtual_open_file(H5P_genplist_t *plist, const H5F_t *vdset_file, + const char *file_name, + hid_t fapl_id, hid_t dxpl_id) +{ + H5F_t *src_file = NULL; /* Source file */ + H5F_t *ret_value = NULL; /* Actual return value */ + char *full_name = NULL; /* File name with prefix */ + char *my_prefix; /* Library's copy of the prefix */ + unsigned intent; /* File access permissions */ + char *actual_file_name = NULL; /* Virtual file's actual name */ + char *temp_file_name = NULL; /* Temporary pointer to file name */ + size_t temp_file_name_len; /* Length of temporary file name */ + + FUNC_ENTER_STATIC + + /* Simplify intent flags for open calls */ + intent = H5F_INTENT(vdset_file); + intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); + + /* Copy the file name to use */ + if(NULL == (temp_file_name = H5MM_strdup(file_name))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + temp_file_name_len = HDstrlen(temp_file_name); + + /* target file_name is an absolute pathname: see RM for detailed description */ + if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + char *ptr; + + H5E_clear_stack(NULL); + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(file_name, ptr) + HDassert(ptr); + + /* Increment past delimiter */ + ptr++; + + /* Copy into the temp. file name */ + HDstrncpy(temp_file_name, ptr, temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + else if(H5_CHECK_ABS_DRIVE(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + + H5E_clear_stack(NULL); + + /* strip ":" */ + HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + + /* try searching from paths set in the environment variable */ + if(src_file == NULL) { + char *env_prefix; + + if(NULL != (env_prefix = HDgetenv("HDF5_VDS_PREFIX"))) { + char *tmp_env_prefix, *saved_env; + + if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + + while((tmp_env_prefix) && (*tmp_env_prefix)) { + char *out_prefix_name; + + out_prefix_name = H5D_getenv_prefix_name(&tmp_env_prefix/*in,out*/); + if(out_prefix_name && (*out_prefix_name)) { + if(H5D__virtual_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { + saved_env = (char *)H5MM_xfree(saved_env); + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + } /* end if */ + + src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); + full_name = (char *)H5MM_xfree(full_name); + if(src_file != NULL) + break; + H5E_clear_stack(NULL); + } /* end if */ + } /* end while */ + saved_env = (char *)H5MM_xfree(saved_env); + } /* end if */ + } /* end if */ + + /* try searching from property list */ + if(src_file == NULL) { + size_t size = 0; + if((size = H5Pget_virtual_prefix(plist, NULL, 0)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (my_prefix = (char *)H5MM_malloc(size + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate prefix buffer") + if(H5Pget_virtual_prefix(plist, my_prefix, size+1) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") + if(my_prefix) { + if(H5D__virtual_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + } /* end if */ + + /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ + if(src_file == NULL) { + char *vdspath; + + if(NULL != (vdspath = H5F_EXTPATH(vdset_file))) { + if(H5D__virtual_build_name(vdspath, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + } /* end if */ + + /* try the relative file_name stored in temp_file_name */ + if(src_file == NULL) { + if(NULL == (src_file = H5F_open(temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + } /* end if */ + + /* try the 'resolved' name for the virtual file */ + if(src_file == NULL) { + char *ptr = NULL; + + /* Copy resolved file name */ + if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(vdset_file)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string") + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(actual_file_name, ptr) + if(!ptr) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + + /* Truncate filename portion from actual file name path */ + *ptr = '\0'; + + /* Build new file name for the external file */ + if(H5D__virtual_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + + /* Try opening with the resolved name */ + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + + /* Success */ + ret_value = src_file; +done: + if((NULL == ret_value) && src_file) + if(H5F_try_close(src_file, NULL) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, FAIL, "can't close source file") + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__virtual_open_file() */ + /*------------------------------------------------------------------------- * Function: H5D__virtual_open_source_dset @@ -787,6 +989,8 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5G_loc_t src_root_loc; /* Object location of source file root group */ herr_t ret_value = SUCCEED; /* Return value */ char *full_name = NULL; /* File name with prefix */ + unsigned intent; /* File access permissions */ + H5P_genplist_t *plist; /* Property list pointer */ FUNC_ENTER_STATIC @@ -796,27 +1000,15 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, HDassert(!source_dset->dset); HDassert(source_dset->file_name); HDassert(source_dset->dset_name); - vds_prefix = vdset->shared->vds_prefix; /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { - if(vds_prefix && HDstrlen(vds_prefix) > 0) { - if(H5D__virtual_build_name(vds_prefix, source_dset->file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - /* Open the source file */ - if(NULL == (src_file = H5F_open(full_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) - H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ - else - src_file_open = TRUE; - full_name = (char *)H5MM_xfree(full_name); - } - else { - /* Open the source file */ - if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) - H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ - else - src_file_open = TRUE; - } + if((plist = H5D_get_access_plist(vdset)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get access plist") + if(NULL == (src_file = H5D__virtual_open_file(plist, vdset->oloc.file, source_dset->file_name, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ + else + src_file_open = TRUE; } /* end if */ else /* Source file is ".", use the virtual dataset's file */ @@ -2312,7 +2504,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Check if anything is selected */ if(select_nelmts > (hssize_t)0) { /* Open source dataset */ - if(!storage->list[i].source_dset.dset) + if(!storage->list[i].source_dset.dset) /* Try to open dataset */ if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") diff --git a/src/H5system.c b/src/H5system.c index a8726c2..7b3a0eb 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1043,7 +1043,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/) * Unix: does not apply */ if(H5_CHECK_ABS_DRIVE(name)) { - drive = name[0] - 'A' + 1; + drive = toupper(name[0]) - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrncpy(new_name, &name[2], name_len); } /* end if */ -- cgit v0.12 From 8aa520584463a5151699dc5768bcdef39f5564a6 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 18 Dec 2017 13:42:09 -0600 Subject: Optimized version of avoid truncate patch. --- src/H5FDmpio.c | 198 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5FDprivate.h | 3 + src/H5Fint.c | 11 +++ 3 files changed, 212 insertions(+) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index f594d8e..3fe6ed9 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -56,6 +56,7 @@ static char H5FD_mpi_native_g[] = "native"; * library to determine whether the file is empty, truncated, or okay. The MPIO * driver doesn't bother to keep it updated since it's an expensive operation. */ +#if 0 /* original version */ /* JRM */ typedef struct H5FD_mpio_t { H5FD_t pub; /*public stuff, must be first */ MPI_File f; /*MPIO file handle */ @@ -68,6 +69,26 @@ typedef struct H5FD_mpio_t { haddr_t last_eoa; /* Last known end-of-address marker */ haddr_t local_eof; /* Local end-of-file address for each process */ } H5FD_mpio_t; +#else /* modified version */ /* JRM */ +typedef struct H5FD_mpio_t { + H5FD_t pub; /*public stuff, must be first */ + MPI_File f; /*MPIO file handle */ + MPI_Comm comm; /*communicator */ + MPI_Info info; /*file information */ + int mpi_rank; /* This process's rank */ + int mpi_size; /* Total number of processes */ + haddr_t eof; /*end-of-file marker */ + haddr_t eoa; /*end-of-address marker */ + haddr_t last_eoa; /* Last known end-of-address marker */ + haddr_t local_eof; /* Local end-of-file address for each process */ + herr_t do_pre_trunc_barrier; /* hack to allow us to skip */ + /* unnecessary barriers in */ + /* H5FD_mpio_trucate() without a VFD */ + /* API change. This should be removed */ + /* as soon as be make the necessary */ + /* VFD API change. */ +} H5FD_mpio_t; +#endif /* modified version */ /* JRM */ /* Private Prototypes */ @@ -1039,6 +1060,11 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, file->eof = H5FD_mpi_MPIOff_to_haddr(size); file->local_eof = file->eof; +#if 1 /* JRM */ + /* Mark initial barriers in H5FD_mpio_truncate() as necessary */ + file->do_pre_trunc_barrier = TRUE; +#endif /* JRM */ + /* Set return value */ ret_value=(H5FD_t*)file; @@ -1930,6 +1956,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_mpio_flush() */ +#if 0 /* original version */ /*------------------------------------------------------------------------- * Function: H5FD_mpio_truncate @@ -1996,6 +2023,177 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_mpio_truncate() */ +#else /* modified versin */ + + +/*------------------------------------------------------------------------- + * Function: H5FD_mark_pre_trunc_barrier_unecessary + * + * Purpose: Hack to allow us to avoid most unnecessary barriers + * prior in H5FD_mpio_truncate(). + * + * This function should be deleted when next we modify the + * VFD interface. This change should allow us to tell the + * truncate function to omit the initial barrier if no + * file I/O has occurred since the last barrier. + * + * Return: void + * + * + * Programmer: John Mainzer + * 12/14/17 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +H5FD_mpio_mark_pre_trunc_barrier_unecessary(H5FD_t *_file) +{ + H5FD_mpio_t *file = (H5FD_mpio_t*)_file; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(file); + HDassert(H5FD_MPIO == file->pub.driver_id); + + file->do_pre_trunc_barrier = FALSE; + + FUNC_LEAVE_NOAPI_VOID + +} /* end H5FD_mpio_mark_pre_trunc_barrier_unecessary() */ + + +/*------------------------------------------------------------------------- + * Function: H5FD_mpio_truncate + * + * Purpose: Make certain the file's size matches it's allocated size + * + * This is a little sticky in the mpio case, as it is not + * easy for us to track the current EOF by extracting it from + * write calls. + * + * Instead, we first check to see if the eoa has changed since + * the last call to this function. If it has, we call + * MPI_File_get_size() to determine the current EOF, and + * only call MPI_File_set_size() if this value disagrees + * with the current eoa. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * January 31, 2008 + * + * Changes: Heavily reworked to avoid unnecessary MPI_File_set_size() + * calls. The hope is that these calls are superfluous in the + * typical case, allowing us to avoid truncates most of the + * time. + * + * The basic idea is to query the file system to get the + * current eof, and only truncate if the file systems + * conception of the eof disagrees with our eoa. + * + * JRM -- 10/27/17 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +{ + H5FD_mpio_t *file = (H5FD_mpio_t*)_file; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#ifdef H5FDmpio_DEBUG + if(H5FD_mpio_Debug[(int)'t']) + HDfprintf(stdout, "Entering %s\n", FUNC); +#endif + HDassert(file); + HDassert(H5FD_MPIO == file->pub.driver_id); + + if ( !H5F_addr_eq(file->eoa, file->last_eoa) ) { + + int mpi_code; /* mpi return code */ + MPI_Offset size; + MPI_Offset needed_eof; + + /* In principle, it is possible for the size returned by the + * call to MPI_File_get_size() to depend on whether writes from + * all proceeses have completed at the time process 0 makes the + * call. + * + * In practice, most (all?) truncate calls will come after a barrier + * and with no interviening writes to the file (with the possible + * exception of sueprblock / superblock extension message updates). + * + * Unfortunately, the current VFD API doesn't let us pass in a + * flag indicating whether this particular call is unnecessary. + * To work around this, I have added the new function + * H5FD_mpio_mark_pre_trunc_barrier_unecessary() allow us to + * set a flag in H5FD_mpio_t indicating that we can skip the + * barrier. + * + * This is a pretty ugly hack, but until we revise the VFD API, + * it is about the best we can do. + */ + if (file->do_pre_trunc_barrier) { + if (MPI_SUCCESS!= (mpi_code=MPI_Barrier(file->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed(1)", mpi_code) + } + + /* Only processor p0 will get the filesize and broadcast it. */ + if (file->mpi_rank == 0) { + if (MPI_SUCCESS != (mpi_code=MPI_File_get_size(file->f, &size))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_get_size failed", mpi_code) + } /* end if */ + + /* Broadcast file size */ + if(MPI_SUCCESS != (mpi_code = MPI_Bcast(&size, (int)sizeof(MPI_Offset), + MPI_BYTE, 0, file->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code) + + if(H5FD_mpi_haddr_to_MPIOff(file->eoa, &needed_eof) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, \ + "cannot convert from haddr_t to MPI_Offset") + + if (size != needed_eof) /* eoa != eof. Set eof to eoa */ { + + /* Extend the file's size */ + if(MPI_SUCCESS != (mpi_code=MPI_File_set_size(file->f, needed_eof))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code) + + /* In general, we must wait until all processes have finished + * the truncate before any process can continue, since it is + * possible that a process would write at the end of the + * file, and this write would be discarded by the truncate. + * + * While this is an issue for a user initiated flush, it may + * not be an issue at file close. If so, we may be able to + * optimize out the following barrier in that case. + */ + if(MPI_SUCCESS != (mpi_code = MPI_Barrier(file->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code) + } + + /* Update the 'last' eoa value */ + file->last_eoa = file->eoa; + } /* end if */ + +done: + file->do_pre_trunc_barrier = TRUE; + +#ifdef H5FDmpio_DEBUG + if(H5FD_mpio_Debug[(int)'t']) + HDfprintf(stdout, "Leaving %s\n", FUNC); +#endif + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD_mpio_truncate() */ + +#endif /* modified version */ + /*------------------------------------------------------------------------- * Function: H5FD_mpio_mpi_rank diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index e758951..f7be327 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -203,6 +203,9 @@ H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file); H5_DLL int H5FD_mpi_get_size(const H5FD_t *file); H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file); H5_DLL herr_t H5FD_get_mpi_info(H5FD_t *file, void** file_info); +#if 1 /* JRM */ +H5_DLL void H5FD_mpio_mark_pre_trunc_barrier_unecessary(H5FD_t *_file); +#endif /* JRM */ #endif /* H5_HAVE_PARALLEL */ #endif /* !_H5FDprivate_H */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 8212eb5..25df964 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1532,6 +1532,17 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") /* Truncate the file to the current allocated size */ +#if 1 /* JRM */ +#ifdef H5_HAVE_PARALLEL + if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { + /* Since we just returned from a call to H5AC_flush(), we just + * passed through a barrier. Hence we can skip the barrier on + * entry to the mpio file driver call below. + */ + H5FD_mpio_mark_pre_trunc_barrier_unecessary(f->shared->lf); + } +#endif /* H5_HAVE_PARALLEL */ +#endif /* JRM */ if(H5FD_truncate(f->shared->lf, meta_dxpl_id, closing) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") -- cgit v0.12 From 8444f018ca115dcf8b1066b9dbad69b0617c0e58 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Dec 2017 14:58:17 -0600 Subject: HDFFV-9724 Add ENV VAR to vds test --- test/CMakeTests.cmake | 2 +- test/vds.c | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+), 1 deletion(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 973d389..e0acc6d 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -452,7 +452,6 @@ set (test_CLEANFILES extlinks19B00026.h5 extlinks19B00027.h5 extlinks19B00028.h5 - tmp big.data big*.h5 stdio.h5 @@ -582,6 +581,7 @@ set (test_CLEANFILES cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 + tmp/vds_src_2.h5 ) # Remove any output file left over from previous test run diff --git a/test/vds.c b/test/vds.c index 3485023..66de456 100644 --- a/test/vds.c +++ b/test/vds.c @@ -1376,6 +1376,193 @@ test_vds_prefix(unsigned config, hid_t fapl) if(H5Sclose(vspace[0]) < 0) TEST_ERROR vspace[0] = -1; + if(H5Pclose(dapl) < 0) + TEST_ERROR + dapl = -1; + if(H5Pclose(dcpl) < 0) + TEST_ERROR + dcpl = -1; + + /* + * Test 2: All - all selection with ENV prefix + */ + if(HDsetenv("HDF5_VDS_PREFIX", "${ORIGIN}/tmp", 1)) + TEST_ERROR + + /* Create DCPL */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + /* Set fill value */ + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) + TEST_ERROR + + /* Set prefix to a nonexistent directory, will be overwritten by environment variable */ + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) + TEST_ERROR + + if(H5Pset_virtual_prefix(dapl, "someprefix") < 0) + TEST_ERROR + if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) + TEST_ERROR + + if(HDstrcmp(buffer, "someprefix") != 0) + FAIL_PUTS_ERROR("vds prefix not set correctly"); + + /* Create source dataspace */ + if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Create virtual dataspace */ + if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Select all (should not be necessary, but just to be sure) */ + if(H5Sselect_all(srcspace[0]) < 0) + TEST_ERROR + if(H5Sselect_all(vspace[0]) < 0) + TEST_ERROR + + /* Add virtual layout mapping */ + if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) + TEST_ERROR + + /* Create virtual file */ + if((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Create source file if requested */ + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } /* end if */ + else { + srcfile[0] = vfile; + if(H5Iinc_ref(srcfile[0]) < 0) + TEST_ERROR + } /* end if */ + + /* Create source dataset */ + if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Create virtual dataset */ + if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) + TEST_ERROR + + /* Populate write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; + + /* Write data directly to source dataset */ + if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Close srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + + if(config & TEST_IO_DIFFERENT_FILE) { + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + } /* end if */ + } /* end if */ + + /* Reopen virtual dataset and file if config option specified */ + if(config & TEST_IO_REOPEN_VIRT) { + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if((vfile = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) + TEST_ERROR + } /* end if */ + + /* Read data through virtual dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) { + TEST_ERROR + } + } + + /* Adjust write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); + + /* Write data through virtual dataset */ + if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Reopen srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) + TEST_ERROR + } /* end if */ + + /* Read data directly from source dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) + TEST_ERROR + + /* Close */ + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if(H5Sclose(srcspace[0]) < 0) + TEST_ERROR + srcspace[0] = -1; + if(H5Sclose(vspace[0]) < 0) + TEST_ERROR + vspace[0] = -1; + if(H5Pclose(dapl) < 0) + TEST_ERROR + dapl = -1; + if(H5Pclose(dcpl) < 0) + TEST_ERROR + dcpl = -1; + + if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) + TEST_ERROR PASSED(); return 0; @@ -1410,6 +1597,9 @@ test_vds_prefix(unsigned config, hid_t fapl) (void)H5Pclose(dcpl); } H5E_END_TRY; + if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) + TEST_ERROR + return 1; } /* end vds_link_prefix() */ -- cgit v0.12 From 6cbb336ca753118a8413feb928627cb3a33a227f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Dec 2017 15:47:05 -0600 Subject: Skip test if 1.6 API --- test/CMakeTests.cmake | 74 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 30 deletions(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index e0acc6d..fca2f27 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -839,21 +839,28 @@ add_test (NAME H5TEST-clear-error_test-objects WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" -) -set_tests_properties (H5TEST-error_test PROPERTIES - DEPENDS H5TEST-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST -) +if (HDF5_USE_16_API_DEFAULT) + add_test ( + NAME H5TEST-error_test-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" + ) +else () + add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-error_test PROPERTIES + DEPENDS H5TEST-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) +endif () #-- Adding test for links_env add_test (NAME H5TEST-clear-links_env-objects @@ -959,21 +966,28 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5TEST-shared-error_test PROPERTIES - DEPENDS H5TEST-shared-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared - ) + if (HDF5_USE_16_API_DEFAULT) + add_test ( + NAME H5TEST-shared-error_test-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" + ) + else () + add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-shared-error_test PROPERTIES + DEPENDS H5TEST-shared-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + endif () #-- Adding test for links_env add_test (NAME H5TEST-shared-clear-links_env-objects -- cgit v0.12 From 0065fd4b6d5edf61b21cd352c74268de13fd516a Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 19 Dec 2017 16:47:31 -0600 Subject: Fix -- HDFFV-10363 Fortran compilation fails for xlf and cmake builds --- fortran/src/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 0f576d4..18d6d80 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -95,6 +95,18 @@ add_custom_command ( ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5f90i_gen.h PROPERTIES GENERATED TRUE) set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 PROPERTIES GENERATED TRUE) +if (BUILD_SHARED_LIBS) + set (CMDSH $) + add_custom_command ( + OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 + COMMAND ${CMDSH} + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared + DEPENDS H5match_types + ) + set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h PROPERTIES GENERATED TRUE) + set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 PROPERTIES GENERATED TRUE) +endif () #----------------------------------------------------------------------------- # f90CStub lib @@ -223,7 +235,7 @@ set (f90_F_SOURCES if (BUILD_SHARED_LIBS) set (f90_F_SOURCES_SHARED # generated file - ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 + ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 ${f90_F_BASE_SOURCES} @@ -243,6 +255,7 @@ set (SHARED_LINK_FLAGS " ") TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET}) target_link_libraries (${HDF5_F90_LIB_TARGET} PRIVATE ${LINK_Fortran_LIBS}) +target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/static) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () @@ -271,6 +284,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET}) target_link_libraries (${HDF5_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS}) + target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () -- cgit v0.12 From 94b8a212bfba2ad7a7740c8a22e0e5d96d05e4ec Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 10:57:41 -0600 Subject: Cleanup comments and if() in TRY blocks --- test/vds.c | 1105 +++++++++++++++++++++++++++--------------------------------- 1 file changed, 497 insertions(+), 608 deletions(-) diff --git a/test/vds.c b/test/vds.c index 66de456..eca26bc 100644 --- a/test/vds.c +++ b/test/vds.c @@ -65,14 +65,7 @@ const char *FILENAME[] = { * provided dataspaces are the same. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Neil Fortner - * Monday, March 2, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static htri_t @@ -138,7 +131,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } /* end if */ + } /* Free buffers */ HDfree(buf1); @@ -188,7 +181,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } /* end if */ + } /* Free buffers */ HDfree(buf1); @@ -225,14 +218,7 @@ error: * parameters. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Neil Fortner - * Monday, March 2, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -306,8 +292,7 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace, error: H5E_BEGIN_TRY { - if(space_out >= 0) - (void)H5Sclose(space_out); + H5Sclose(space_out); } H5E_END_TRY return -1; @@ -320,14 +305,7 @@ error: * Purpose: Tests API functions related to virtual datasets. * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Monday, February 16, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ /* Helper function to get DCPL for examination depending on config */ @@ -378,12 +356,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, file = -1; if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open dataset */ if((dset = H5Dopen2(file, "vdset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get DCPL from dataset */ if((*ex_dcpl = H5Dget_create_plist(dset)) < 0) @@ -402,8 +380,8 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(oinfo.meta_size.obj.heap_size != exp_meta_size) { printf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size); TEST_ERROR - } /* end if */ - } /* end if */ + } + } else if((oinfo.meta_size.obj.heap_size != exp_meta_size) && (oinfo.meta_size.obj.heap_size != (hsize_t)0)) @@ -432,12 +410,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(H5Fclose(file) < 0) TEST_ERROR file = -1; - } /* end if */ + } else if(config == TEST_API_COPY_PLIST) { /* Copy property list */ if((*ex_dcpl = H5Pcopy(dcpl)) < 0) TEST_ERROR - } /* end if */ + } else if(config == TEST_API_ENCDEC_PLIST) { size_t plist_buf_size; @@ -456,14 +434,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, /* Free plist_buf */ HDfree(plist_buf); plist_buf = NULL; - } /* end if */ + } else { /* Simply copy the id to ex_dcpl and increment the ref count so ex_dcpl * can be closed */ if(H5Iinc_ref(dcpl) < 0) TEST_ERROR *ex_dcpl = dcpl; - } /* end else */ + } /* Verify examination DCPL is equal to original DCPL. Do not compare the * plist to itself, and do not do the comparison if we reopened the file, @@ -474,16 +452,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, TEST_ERROR if(!tri_ret) TEST_ERROR - } /* end if */ + } return 0; error: H5E_BEGIN_TRY { - if(file >= 0) - (void)H5Fclose(file); - if(dset >= 0) - (void)H5Dclose(dset); + H5Fclose(file); + H5Dclose(dset); } H5E_END_TRY; if(plist_buf) HDfree(plist_buf); @@ -540,7 +516,7 @@ test_api(test_api_config_t config, hid_t fapl) case TEST_API_NTESTS: default: TEST_ERROR - } /* end switch */ + } h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -826,7 +802,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Create virtual dataspace */ if((vspace[i] = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR - } /* end for */ + } /* Select all (should not be necessary, but just to be sure) */ if(H5Sselect_all(srcspace[0]) < 0) @@ -940,7 +916,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1046,7 +1022,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Add virtual layout mapping */ if(H5Pset_virtual(dcpl, vspace[i], tmp_filename, tmp_dsetname, srcspace[0]) < 0) TEST_ERROR - } /* end if */ + } /* Get examination DCPL */ if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)697) < 0) @@ -1071,7 +1047,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Check that the mapping in the DCPL is correct */ if(vds_check_mapping(ex_dcpl, (size_t)i, vspace[i], srcspace[0], tmp_filename, tmp_dsetname) < 0) TEST_ERROR - } /* end if */ + } /* Close */ if(H5Sclose(srcspace[0]) < 0) @@ -1081,7 +1057,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1131,18 +1107,12 @@ test_api(test_api_config_t config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(ex_dcpl >= 0) - (void)H5Pclose(ex_dcpl); + for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Pclose(dcpl); + H5Pclose(ex_dcpl); } H5E_END_TRY; return 1; @@ -1260,12 +1230,12 @@ test_vds_prefix(unsigned config, hid_t fapl) if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR HDchdir(buffer); - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1294,8 +1264,8 @@ test_vds_prefix(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1309,7 +1279,7 @@ test_vds_prefix(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1344,7 +1314,7 @@ test_vds_prefix(unsigned config, hid_t fapl) } if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1438,12 +1408,12 @@ test_vds_prefix(unsigned config, hid_t fapl) if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR HDchdir(buffer); - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1472,8 +1442,8 @@ test_vds_prefix(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1487,7 +1457,7 @@ test_vds_prefix(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1522,7 +1492,7 @@ test_vds_prefix(unsigned config, hid_t fapl) } if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1569,32 +1539,19 @@ test_vds_prefix(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - if(vfile2 >= 0) - (void)H5Fclose(vfile2); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(memspace); + H5Pclose(dcpl); } H5E_END_TRY; if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) @@ -1611,14 +1568,7 @@ test_vds_prefix(unsigned config, hid_t fapl) * pattern-matching file/dataset strings * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Tuesday, March 3, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1701,12 +1651,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1735,8 +1685,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1750,7 +1700,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1779,7 +1729,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1863,12 +1813,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1904,8 +1854,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1919,7 +1869,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1950,7 +1900,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1999,8 +1949,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2009,7 +1959,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open v_dset2 */ if((vdset = H5Dopen2(vfile, "v_dset2", H5P_DEFAULT)) < 0) @@ -2035,7 +1985,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Only copy to a different file if the source datasets are in a different * file */ @@ -2077,8 +2027,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen copied virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2087,7 +2037,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile2 = -1; if((vfile2 = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open v_dset3 */ if((vdset = H5Dopen2(vfile2, "v_dset3", H5P_DEFAULT)) < 0) @@ -2113,13 +2063,13 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Close copied virtual file */ if(H5Fclose(vfile2) < 0) TEST_ERROR vfile2 = -1; - } /* end if */ + } /* Close */ if(H5Dclose(srcdset[0]) < 0) @@ -2198,12 +2148,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2245,8 +2195,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2260,7 +2210,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2291,7 +2241,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2386,12 +2336,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2427,8 +2377,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2442,7 +2392,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read first source dataset through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2495,7 +2445,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2594,12 +2544,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2627,7 +2577,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i][j] = buf[2 * i][j]; for(/* j = 13 */; j < 26; j++) evbuf[i][j] = buf[2 * i + 1][j - 13]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2644,7 +2594,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i + 5][j] = buf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) evbuf[i + 5][j] = buf[2 * i + 1][j]; - } /* end for */ + } /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2659,8 +2609,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2674,7 +2624,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -2690,7 +2640,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i][j] = evbuf[2 * i][j]; for(/* j = 13 */; j < 26; j++) erbuf[i][j] = evbuf[2 * i + 1][j - 13]; - } /* end for */ + } /* Read second slice */ if(H5Dread(vdset, H5T_NATIVE_INT, vspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2702,7 +2652,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i + 5][j] = evbuf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) erbuf[i + 5][j] = evbuf[2 * i + 1][j]; - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2726,7 +2676,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j] = buf[i][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j - 13] = buf[i][j]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2743,7 +2693,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j + 13] = buf[i + 5][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j] = buf[i + 5][j]; - } /* end for */ + } /* Reopen srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2754,7 +2704,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ /* Reset rbuf */ @@ -2770,7 +2720,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j] = evbuf[i][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j - 13] = evbuf[i][j]; - } /* end for */ + } /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, srcspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2782,7 +2732,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j + 13] = evbuf[i + 5][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j] = evbuf[i + 5][j]; - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2902,12 +2852,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2961,8 +2911,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2976,7 +2926,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -3001,7 +2951,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -3047,7 +2997,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ /* Reset rbuf */ @@ -3068,7 +3018,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } /* end for */ + } /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, memspace, srcspace[0], H5P_DEFAULT, rbuf[0]) < 0) @@ -3243,12 +3193,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -3285,8 +3235,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3300,7 +3250,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ /* Reset rbuf */ @@ -3406,7 +3356,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 3) && (j < 6)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -3459,7 +3409,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 6) && (j < 9)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -3677,7 +3627,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ /* Select hyperslab in memory space */ @@ -3752,32 +3702,19 @@ test_basic_io(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - if(vfile2 >= 0) - (void)H5Fclose(vfile2); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(memspace); + H5Pclose(dcpl); } H5E_END_TRY; return 1; @@ -3790,14 +3727,7 @@ error: * Purpose: Tests VDS with unlimited selections * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Thursday, April 30, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3910,12 +3840,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -3980,8 +3910,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3995,7 +3925,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4040,11 +3970,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Test H5Pget_virtual_view() */ if(H5Pget_virtual_view(dapl, &virtual_view) < 0) @@ -4064,7 +3994,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4112,11 +4042,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4125,7 +4055,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[0] = 5; @@ -4162,8 +4092,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4177,7 +4107,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4224,11 +4154,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -4242,7 +4172,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4295,11 +4225,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4308,7 +4238,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 5; @@ -4350,8 +4280,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4365,7 +4295,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4427,7 +4357,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -4492,11 +4422,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Shrink to 15 */ dims[1] = 15; @@ -4523,12 +4453,12 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4542,7 +4472,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4590,11 +4520,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -4629,11 +4559,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Grow to 18 */ @@ -4661,11 +4591,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Grow to 20 */ dims[1] = 20; @@ -4691,7 +4621,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < (int)mdims[1]; j++) if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -4704,12 +4634,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -4785,12 +4715,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -4855,8 +4785,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4870,7 +4800,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4914,11 +4844,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4932,7 +4862,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4974,11 +4904,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4987,7 +4917,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[1] = 7; @@ -5029,8 +4959,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5044,7 +4974,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5090,11 +5020,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5108,7 +5038,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5159,11 +5089,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5172,7 +5102,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[1] = 10; @@ -5214,8 +5144,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5229,7 +5159,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5291,7 +5221,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -5308,7 +5238,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5360,11 +5290,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -5377,12 +5307,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -5477,12 +5407,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -5522,7 +5452,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][6 * j] = buf[i][2 * j]; erbuf[i][(6 * j) + 1] = buf[i][(2 * j) + 1]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5538,7 +5468,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][(6 * j) + 2] = buf[i][2 * j]; erbuf[i][(6 * j) + 3] = buf[i][(2 * j) + 1]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5559,7 +5489,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][4] = buf[i][0]; erbuf[i][5] = buf[i][1]; - } /* end for */ + } /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5577,8 +5507,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5592,7 +5522,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5636,11 +5566,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -5654,7 +5584,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5696,11 +5626,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5709,7 +5639,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[1] = 7; @@ -5746,8 +5676,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5761,7 +5691,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5806,11 +5736,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5824,7 +5754,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5834,7 +5764,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][12] = buf[i][0]; erbuf[i][13] = buf[i][1]; erbuf[i][18] = buf[i][2]; - } /* end for */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5878,11 +5808,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5891,7 +5821,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset3", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[2] */ dims[1] = 5; @@ -5923,7 +5853,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][10] = buf[i][0]; erbuf[i][11] = buf[i][1]; erbuf[i][16] = buf[i][2]; - } /* end for */ + } /* Close srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5935,8 +5865,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5950,7 +5880,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5995,11 +5925,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -6013,7 +5943,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6059,11 +5989,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6072,7 +6002,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[1] = 6; @@ -6103,7 +6033,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][14] = buf[i][0]; erbuf[i][15] = buf[i][1]; - } /* end for */ + } /* Close srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6115,8 +6045,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6130,7 +6060,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6174,11 +6104,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -6192,7 +6122,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6234,11 +6164,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now just read middle 2 rows */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -6264,11 +6194,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -6287,12 +6217,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -6373,12 +6303,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -6431,8 +6361,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6446,7 +6376,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6492,11 +6422,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -6510,7 +6440,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6552,11 +6482,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6565,7 +6495,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[0] = 5; @@ -6603,8 +6533,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6618,7 +6548,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6664,11 +6594,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -6682,7 +6612,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6730,11 +6660,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -6747,12 +6677,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -6795,23 +6725,23 @@ error: for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { if(srcdset[i] >= 0) (void)H5Dclose(srcdset[i]); - } /* end for */ + } if(vdset >= 0) (void)H5Dclose(vdset); for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { if(srcfile[i] >= 0) (void)H5Fclose(srcfile[i]); - } /* end for */ + } if(vfile >= 0) (void)H5Fclose(vfile); for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { if(srcspace[i] >= 0) (void)H5Sclose(srcspace[i]); - } /* end for */ + } for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { if(vspace[i] >= 0) (void)H5Sclose(vspace[i]); - } /* end for */ + } if(filespace >= 0) (void)H5Sclose(filespace); if(memspace >= 0) @@ -6948,12 +6878,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -6965,7 +6895,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6979,7 +6909,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7065,8 +6995,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7080,7 +7010,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7124,11 +7054,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -7165,8 +7095,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7180,7 +7110,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7220,11 +7150,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try with different selections */ count[0] = 10; @@ -7251,12 +7181,12 @@ test_printf(unsigned config, hid_t fapl) if((j < (int)start[1]) || (j >= (int)(start[1] + count[1]))) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end for */ + } + } start[1] = 0; /* Now try writing through VDS */ @@ -7292,7 +7222,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read srcdset[0] */ count[0] = 10; @@ -7394,12 +7324,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -7411,7 +7341,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7425,7 +7355,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7563,14 +7493,14 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7584,7 +7514,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7628,11 +7558,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Test H5Pget_virtual_printf_gap() */ if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) @@ -7652,7 +7582,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7704,11 +7634,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 2, reopen file as well if * config option specified */ @@ -7722,7 +7652,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7774,11 +7704,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 3, reopen file as well if * config option specified */ @@ -7792,7 +7722,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7844,11 +7774,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 4, reopen file as well if * config option specified */ @@ -7862,7 +7792,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7914,11 +7844,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -7932,7 +7862,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7978,11 +7908,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -7996,16 +7926,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8078,7 +8008,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8144,7 +8074,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8158,7 +8088,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8202,11 +8132,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -8241,7 +8171,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8255,7 +8185,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8299,11 +8229,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -8319,7 +8249,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8389,7 +8319,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8455,7 +8385,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8469,7 +8399,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8513,11 +8443,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -8552,7 +8482,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8566,7 +8496,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8610,11 +8540,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -8630,7 +8560,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8643,7 +8573,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Sclose(vspace[0]) < 0) TEST_ERROR vspace[0] = -1; - } /* end if */ + } /* @@ -8701,12 +8631,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -8718,7 +8648,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8732,7 +8662,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8818,8 +8748,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8833,7 +8763,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8877,11 +8807,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -8917,8 +8847,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8932,7 +8862,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8976,11 +8906,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -8994,7 +8924,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9041,11 +8971,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9081,8 +9011,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9096,7 +9026,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9140,11 +9070,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -9158,7 +9088,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9205,11 +9135,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf_gap set to 1, reopen file as well if * config option specified */ @@ -9223,7 +9153,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9270,11 +9200,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -9288,16 +9218,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -9373,12 +9303,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -9390,7 +9320,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9404,7 +9334,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9500,8 +9430,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9515,7 +9445,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9559,11 +9489,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -9577,7 +9507,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9624,11 +9554,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9668,8 +9598,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9683,7 +9613,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9727,11 +9657,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -9745,7 +9675,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9791,11 +9721,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9832,8 +9762,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9847,7 +9777,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9891,11 +9821,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -9929,11 +9859,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Shrink to 12 */ @@ -9959,11 +9889,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Shrink to 10 */ dims[1] = 12; @@ -9988,12 +9918,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -10007,7 +9937,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -10053,11 +9983,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -10091,11 +10021,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Grow to 12 */ @@ -10121,11 +10051,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Grow to 15 */ dims[1] = 15; @@ -10150,12 +10080,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Reset dapl */ if(H5Pset_virtual_view(dapl, H5D_VDS_LAST_AVAILABLE) < 0) @@ -10167,16 +10097,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -10233,12 +10163,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -10250,7 +10180,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10264,7 +10194,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10330,8 +10260,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10345,7 +10275,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10389,11 +10319,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 127, reopen file as well if * config option specified */ @@ -10407,7 +10337,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -10453,11 +10383,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -10471,12 +10401,12 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -10507,32 +10437,19 @@ test_printf(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - if(srcspace >= 0) - (void)H5Sclose(srcspace); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(filespace >= 0) - (void)H5Sclose(filespace); - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(dapl >= 0) - (void)H5Pclose(dapl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Sclose(srcspace); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Pclose(dapl); } H5E_END_TRY; return 1; @@ -10546,14 +10463,7 @@ error: * VDS * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Friday, August 14, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -10675,12 +10585,12 @@ test_all(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile = vfile; if(H5Iinc_ref(srcfile) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -10692,7 +10602,7 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10706,7 +10616,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10777,14 +10687,14 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10798,7 +10708,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10844,11 +10754,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10857,7 +10767,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 2; @@ -10892,8 +10802,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10907,7 +10817,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10953,11 +10863,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -10997,8 +10907,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11012,7 +10922,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11058,11 +10968,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -11071,7 +10981,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 3; @@ -11115,8 +11025,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11130,7 +11040,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11176,11 +11086,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -11220,8 +11130,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11235,7 +11145,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11281,11 +11191,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -11294,7 +11204,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 7; @@ -11339,8 +11249,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11354,7 +11264,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11400,11 +11310,11 @@ test_all(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -11444,8 +11354,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11459,7 +11369,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11511,16 +11421,16 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -11531,12 +11441,12 @@ test_all(unsigned config, hid_t fapl) if(H5Sclose(srcspace[i]) < 0) TEST_ERROR srcspace[i] = -1; - } /* end for */ + } for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(dcpl) < 0) TEST_ERROR dcpl = -1; @@ -11552,32 +11462,19 @@ test_all(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - if(srcfile >= 0) - (void)H5Fclose(srcfile); - if(vfile >= 0) - (void)H5Fclose(vfile); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(filespace >= 0) - (void)H5Sclose(filespace); - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(srcdcpl >= 0) - (void)H5Pclose(srcdcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + H5Fclose(srcfile); + H5Fclose(vfile); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Pclose(srcdcpl); } H5E_END_TRY; return 1; @@ -11591,10 +11488,6 @@ error: * * Return: Success: 0 * Failure: 1 - * - * Programmer: Dana Robinson - * March 2016 - * *------------------------------------------------------------------------- */ static int @@ -11736,10 +11629,6 @@ test_dapl_values(hid_t fapl_id) * Purpose: Tests datasets with virtual layout * * Return: EXIT_SUCCESS/EXIT_FAILURE - * - * Programmer: Neil Fortner - * Tuesday, February 17, 2015 - * *------------------------------------------------------------------------- */ int @@ -11766,7 +11655,7 @@ main(void) nerrors += test_unlim(bit_config, fapl); nerrors += test_printf(bit_config, fapl); nerrors += test_all(bit_config, fapl); - } /* end for */ + } nerrors += test_dapl_values(fapl); -- cgit v0.12 From 925f3c9b54368005da0129d5928142f04f53ef57 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 13:10:34 -0600 Subject: Because of MPI requirements in library ALWAYS add include path --- CMakeLists.txt | 1 + config/cmake_ext_mod/FindMPI.cmake | 287 ++++++++++++++++++++++--------------- src/CMakeLists.txt | 12 -- 3 files changed, 171 insertions(+), 129 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e22ac2e..6165b35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -631,6 +631,7 @@ if (HDF5_ENABLE_PARALLEL) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) + INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_DIRS}) else () message (STATUS "Parallel libraries not found") endif () diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index 8084472..d01dd35 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -347,7 +347,7 @@ function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) # library that has invalid or missing version information there would be warning # messages emitted by ld.so in the compiler output. In either case, we'll treat # the output as invalid. - if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available") + if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found") set(WRAPPER_RETURN 255) endif() # Ensure that no error output might be passed upwards. @@ -615,6 +615,16 @@ function (_MPI_interrogate_compiler lang) endif() endif() + if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) + list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}") + endif() + if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) + list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}") + endif() + if(MPI_${LANG}_EXTRA_LIB_NAMES) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}") + endif() + # If we found MPI, set up all of the appropriate cache entries if(NOT MPI_${LANG}_COMPILE_OPTIONS) set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) @@ -823,33 +833,43 @@ endfunction() macro(_MPI_assemble_libraries LANG) set(MPI_${LANG}_LIBRARIES "") - foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) - endforeach() + # Only for libraries do we need to check whether the compiler's linking stage is separate. + if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT) + foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) + endforeach() + endif() endmacro() macro(_MPI_assemble_include_dirs LANG) - set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") - if("${LANG}" MATCHES "(C|CXX)") - if(MPI_${LANG}_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - else() # Fortran - if(MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + set(MPI_${LANG}_INCLUDE_DIRS "") + else() + set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") + if("${LANG}" MATCHES "(C|CXX)") + if(MPI_${LANG}_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + else() # Fortran + if(MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + endif() + if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + endif() endif() - if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}") + endforeach() endif() endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}") - endforeach() - endif() endmacro() function(_MPI_split_include_dirs LANG) + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + return() + endif() # Backwards compatibility: Search INCLUDE_PATH if given. if(MPI_${LANG}_INCLUDE_PATH) list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") @@ -885,6 +905,13 @@ function(_MPI_split_include_dirs LANG) endif() mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) endif() + # Remove duplicates and default system directories from the list. + if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) + list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR}) + endforeach() + endif() set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) endfunction() @@ -1014,7 +1041,7 @@ elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") # FreeBSD ships mpich under the normal system paths - but available openmpi implementations # will be found in /usr/local/mpi/ - MPI_search_mpi_prefix_folder("/usr/local/mpi/") + MPI_search_mpi_prefix_folder("/usr/local/mpi") endif() # Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. @@ -1050,48 +1077,54 @@ mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXE # # Once we find the new variables, we translate them back into their old # equivalents below. -foreach (LANG IN ITEMS C CXX) - # Old input variables. - set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) - - # Set new vars based on their old equivalents, if the new versions are not already set. - foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${LANG}_${var} AND MPI_${var}) - set(MPI_${LANG}_${var} "${MPI_${var}}") - endif() - endforeach() - - # Chop the old compile flags into options and definitions - if(MPI_${LANG}_COMPILE_FLAGS) - unset(MPI_${LANG}_COMPILE_OPTIONS) - unset(MPI_${LANG}_COMPILE_DEFINITIONS) - separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") - foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) - if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") - list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") - else() - list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}") +if(NOT MPI_IGNORE_LEGACY_VARIABLES) + foreach (LANG IN ITEMS C CXX) + # Old input variables. + set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) + + # Set new vars based on their old equivalents, if the new versions are not already set. + foreach (var ${_MPI_OLD_INPUT_VARS}) + if (NOT MPI_${LANG}_${var} AND MPI_${var}) + set(MPI_${LANG}_${var} "${MPI_${var}}") endif() endforeach() - unset(MPI_SEPARATE_FLAGS) - endif() - # If a list of libraries was given, we'll split it into new-style cache variables - if(NOT MPI_${LANG}_LIB_NAMES) - foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) - get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endforeach() - endif() -endforeach() + # Chop the old compile flags into options and definitions + + unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) + unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) + if(MPI_${LANG}_COMPILE_FLAGS) + separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") + foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) + if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") + list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") + else() + list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}") + endif() + endforeach() + unset(MPI_SEPARATE_FLAGS) + endif() + + # If a list of libraries was given, we'll split it into new-style cache variables + unset(MPI_${LANG}_EXTRA_LIB_NAMES) + if(NOT MPI_${LANG}_LIB_NAMES) + foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) + if(_MPI_LIB) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) + get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) + list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endif() + endforeach() + endif() + endforeach() +endif() #============================================================================= unset(MPI_VERSION) @@ -1100,6 +1133,11 @@ unset(MPI_VERSION_MINOR) unset(_MPI_MIN_VERSION) +# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. +if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) + set(MPI_SKIP_COMPILER_WRAPPER TRUE) +endif() + # This loop finds the compilers and sends them off for interrogation. foreach(LANG IN ITEMS C CXX Fortran) if(CMAKE_${LANG}_COMPILER_LOADED) @@ -1121,6 +1159,8 @@ foreach(LANG IN ITEMS C CXX Fortran) mark_as_advanced(MPI_CXX_SKIP_MPICXX) endif() if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) + set(MPI_${LANG}_TRIED_IMPLICIT FALSE) + set(MPI_${LANG}_WORKS_IMPLICIT FALSE) if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. # Cray PrgEnv. @@ -1130,80 +1170,90 @@ foreach(LANG IN ITEMS C CXX Fortran) # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. if(MPI_${LANG}_WORKS) set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) + set(MPI_${LANG}_WORKS_IMPLICIT TRUE) endif() + set(MPI_${LANG}_TRIED_IMPLICIT TRUE) endif() - # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. - if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) - set(MPI_SKIP_COMPILER_WRAPPER TRUE) - endif() - if(NOT MPI_SKIP_COMPILER_WRAPPER) - if(MPI_${LANG}_COMPILER) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") - unset(MPI_${LANG}_COMPILER CACHE) + if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS) + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + set(MPI_PINNED_COMPILER FALSE) + + if(NOT MPI_SKIP_COMPILER_WRAPPER) + if(MPI_${LANG}_COMPILER) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") + unset(MPI_${LANG}_COMPILER CACHE) + endif() + # If the user specifies a compiler, we don't want to try to search libraries either. + set(MPI_PINNED_COMPILER TRUE) + endif() + + # If we have an MPI base directory, we'll try all compiler names in that one first. + # This should prevent mixing different MPI environments + if(_MPI_BASE_DIR) + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + HINTS ${_MPI_BASE_DIR} + NO_DEFAULT_PATH + DOC "MPI compiler for ${LANG}" + ) endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(MPI_PINNED_COMPILER TRUE) - else() - set(MPI_PINNED_COMPILER FALSE) - endif() - # If we have an MPI base directory, we'll try all compiler names in that one first. - # This should prevent mixing different MPI environments - if(_MPI_BASE_DIR) + # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), + # we shall try searching in the default paths. find_program(MPI_${LANG}_COMPILER NAMES ${_MPI_${LANG}_COMPILER_NAMES} PATH_SUFFIXES bin sbin - HINTS ${_MPI_BASE_DIR} - NO_DEFAULT_PATH DOC "MPI compiler for ${LANG}" ) - endif() - # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), - # we shall try searching in the default paths. - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - DOC "MPI compiler for ${LANG}" - ) - - if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - set(MPI_SKIP_GUESSING TRUE) - elseif(MPI_${LANG}_COMPILER) - _MPI_interrogate_compiler(${LANG}) - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + set(MPI_PINNED_COMPILER TRUE) + + # If we haven't made the implicit compiler test yet, perform it now. + if(NOT MPI_${LANG}_TRIED_IMPLICIT) + _MPI_create_imported_target(${LANG}) + _MPI_check_lang_works(${LANG}) + endif() + + # Should the MPI compiler not work implicitly for MPI, still interrogate it. + # Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used + # directly during linkage instead of CMAKE__COMPILER will not work. + if(NOT MPI_${LANG}_WORKS) + set(MPI_${LANG}_WORKS_IMPLICIT FALSE) + _MPI_interrogate_compiler(${LANG}) + else() + set(MPI_${LANG}_WORKS_IMPLICIT TRUE) + endif() + elseif(MPI_${LANG}_COMPILER) + _MPI_interrogate_compiler(${LANG}) + endif() endif() - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) - set(MPI_PINNED_COMPILER FALSE) - endif() - if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) - # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the - # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. - if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) - set(MPI_${LANG}_WRAPPER_FOUND TRUE) - elseif(NOT MPI_SKIP_GUESSING) - _MPI_guess_settings(${LANG}) + if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) + # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the + # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. + if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) + else() + _MPI_guess_settings(${LANG}) + endif() endif() endif() endif() _MPI_split_include_dirs(${LANG}) - if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - _MPI_assemble_include_dirs(${LANG}) - _MPI_assemble_libraries(${LANG}) - endif() + _MPI_assemble_include_dirs(${LANG}) + _MPI_assemble_libraries(${LANG}) + _MPI_adjust_compile_definitions(${LANG}) # We always create imported targets even if they're empty _MPI_create_imported_target(${LANG}) @@ -1217,7 +1267,9 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + endif() mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) @@ -1337,7 +1389,7 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) unset(MPI_${LANG}_REQUIRED_VARS) - if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND) + if (NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") endforeach() @@ -1448,6 +1500,7 @@ if (MPI_NUMLIBS GREATER 1) else() set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") endif() +set(MPI_IGNORE_LEGACY_VARIABLES TRUE) #============================================================================= # unset these vars to cleanup namespace diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1d217c6..0552244 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -849,9 +849,6 @@ endif () #----------------------------------------------------------------------------- add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) TARGET_C_PROPERTIES (H5detect STATIC " " " ") -if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (H5detect PUBLIC ${MPI_C_INCLUDE_DIRS}) -endif () if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") endif () @@ -866,9 +863,6 @@ add_custom_command ( add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") -if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (H5make_libsettings PUBLIC ${MPI_C_INCLUDE_DIRS}) -endif () if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") endif () @@ -893,9 +887,6 @@ target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () -if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) -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 @@ -937,9 +928,6 @@ if (BUILD_SHARED_LIBS) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () - if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) - 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 -- cgit v0.12 From 50238cb285c37dc32029f1891f069fc76f5cbb07 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 13:33:57 -0600 Subject: Par example needs to link with mpi libs --- examples/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d8eb1a2..04a99ce 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -63,13 +63,13 @@ if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example STATIC) TARGET_C_PROPERTIES (ph5example STATIC " " " ") - target_link_libraries (ph5example ${HDF5_LIB_TARGET}) + target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example-shared SHARED) TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") - target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET}) + target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) endif () endif () -- cgit v0.12 From d989a0b1cb3d6abeb71d1e37fae5a6d353fb7fc2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 13:41:06 -0600 Subject: Removed incorrect MPI text --- 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 5249c1a..96d247a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -243,7 +243,7 @@ Bug Fixes since HDF5-1.10.1 release CMake implementation for MPI was problematic and would create incorrect MPI library references in the hdf5 libraries. - Reworked the CMake MPI code to properly create CMake targets.Also merged + Reworked the CMake MPI code to properly create CMake targets. Also merged the latest CMake FindMPI.cmake changes to the local copy. This is necessary until HDF changes the CMake minimum to 3.9 or greater. -- cgit v0.12 From 4ecf02f6f6a7c79e4e0d57ea2058ccb5e760f992 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 14:23:19 -0600 Subject: HDFFV-9724 Remove VDS file cache functionality --- java/src/hdf/hdf5lib/H5.java | 57 +++++++++++++++--------------- java/src/jni/h5pImp.c | 31 ----------------- java/src/jni/h5pImp.h | 18 ---------- java/test/JUnit-interface.txt | 3 +- java/test/TestH5Pfapl.java | 27 --------------- release_docs/RELEASE.txt | 4 --- src/H5Fprivate.h | 1 - src/H5Pfapl.c | 81 ------------------------------------------- src/H5Ppublic.h | 2 -- 9 files changed, 30 insertions(+), 194 deletions(-) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 3de49da..78ebbe2 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -6097,34 +6097,35 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native String H5Pget_virtual_dsetname(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException; - /** - * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache. - * - * @param fapl_id - * IN: File access property list identifier - * - * @return VDS link open file cache size in number of files. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException; - - /** - * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache. - * - * @param fapl_id - * IN: File access property list identifier - * @param efc_size - * IN: VDS link open file cache size in number of files. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size) - throws HDF5LibraryException; +// ///// unimplemented ///// +// /** +// * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache. +// * +// * @param fapl_id +// * IN: File access property list identifier +// * +// * @return VDS link open file cache size in number of files. +// * +// * @exception HDF5LibraryException +// * - Error from the HDF-5 Library. +// * +// **/ +// public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException; +// +// /** +// * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache. +// * +// * @param fapl_id +// * IN: File access property list identifier +// * @param efc_size +// * IN: VDS link open file cache size in number of files. +// * +// * @exception HDF5LibraryException +// * - Error from the HDF-5 Library. +// * +// **/ +// public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size) +// throws HDF5LibraryException; /** * H5Pget_external returns information about an external file. diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index b144ff6..cf27341 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5733,37 +5733,6 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts } /* end else */ } /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */ -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_vds_file_cache_size - * Signature: (JI)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size - (JNIEnv *env, jclass clss, jlong plist, jint size) -{ - unsigned sz = (unsigned)size; - - if (H5Pset_vds_file_cache_size((hid_t)plist, (unsigned)sz) < 0) - h5libraryError(env); -} /* end Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_vds_file_cache_size - * Signature: (J)I - */ -JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size - (JNIEnv *env, jclass clss, jlong plist) -{ - unsigned s; - - if (H5Pget_vds_file_cache_size((hid_t)plist, &s) < 0) - h5libraryError(env); - - return (jint)s; -} /* end Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size */ /* * Class: hdf_hdf5lib_H5 diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index 19df4b2..1d12e3d 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -1544,24 +1544,6 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts /* * Class: hdf_hdf5lib_H5 - * Method: H5Pset_vds_file_cache_size - * Signature: (JI)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size -(JNIEnv *, jclass, jlong, jint); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_vds_file_cache_size - * Signature: (J)I - */ -JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size -(JNIEnv *, jclass, jlong); - -/* - * Class: hdf_hdf5lib_H5 * Method: H5Pset_virtual_prefix * Signature: (JLjava/lang/String;)V */ diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index fa5b149..91ea286 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -505,7 +505,6 @@ JUnit version 4.11 .testH5Fmdc_logging .testH5Pget_elink_fapl .testH5Pset_mdc_config -.testH5P_vds_file_cache_size .testH5P_small_data_block_size .testH5Pset_fapl_log .testH5P_evict_on_close @@ -648,7 +647,7 @@ JUnit version 4.11 Time: XXXX -OK (646 tests) +OK (645 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/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index f6783d4..48a5986 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1390,31 +1390,4 @@ public class TestH5Pfapl { fail("H5P_evict_on_close: " + err); } } - - @Test - public void testH5P_vds_file_cache_size() { - int vds_size = 0; - try { - try { - vds_size = H5.H5Pget_vds_file_cache_size(fapl_id); - assertTrue("H5P_vds_file_cache_size default", vds_size == 0); - } - catch (UnsupportedOperationException err) { - System.out.println(err.getMessage()); - } - try { - vds_size = 8; - H5.H5Pset_vds_file_cache_size(fapl_id, vds_size); - vds_size = H5.H5Pget_vds_file_cache_size(fapl_id); - assertTrue("H5P_vds_file_cache_size 8", vds_size == 8); - } - catch (UnsupportedOperationException err) { - System.out.println(err.getMessage()); - } - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5P_vds_file_cache_size: " + err); - } - } } diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 96d247a..dc4c98e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -69,8 +69,6 @@ New Features New public APIs: herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); - herr_t H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size); - herr_t H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size); The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. (ADB - 2017/12/12, HDFFV-9724) @@ -146,8 +144,6 @@ New Features H5Pget_efile_prefix H5Pset_virtual_prefix H5Pget_virtual_prefix - H5Pset_vds_file_cache_size - H5Pget_vds_file_cache_size Tools: ------ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 575aa1c..96b8e36 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -489,7 +489,6 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ #define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ -#define H5F_ACS_VDS_FILE_CACHE_SIZE_NAME "vds_file_cache_size" /* Size of vds file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ #define H5F_ACS_USE_MDC_LOGGING_NAME "use_mdc_logging" /* Whether to use metadata cache logging */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index d4e84ab..ea9bfb4 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -155,11 +155,6 @@ #define H5F_ACS_EFC_SIZE_DEF 0 #define H5F_ACS_EFC_SIZE_ENC H5P__encode_unsigned #define H5F_ACS_EFC_SIZE_DEC H5P__decode_unsigned -/* Definition for vds file cache size */ -#define H5F_ACS_VDS_FILE_CACHE_SIZE_SIZE sizeof(unsigned) -#define H5F_ACS_VDS_FILE_CACHE_SIZE_DEF 0 -#define H5F_ACS_VDS_FILE_CACHE_SIZE_ENC H5P__encode_unsigned -#define H5F_ACS_VDS_FILE_CACHE_SIZE_DEC H5P__decode_unsigned /* Definition of pointer to initial file image info */ #define H5F_ACS_FILE_IMAGE_INFO_SIZE sizeof(H5FD_file_image_info_t) #define H5F_ACS_FILE_IMAGE_INFO_DEF H5FD_DEFAULT_FILE_IMAGE_INFO @@ -360,7 +355,6 @@ static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; static const hbool_t H5F_def_latest_format_g = H5F_ACS_LATEST_FORMAT_DEF; /* Default setting for "use the latest version of the format" flag */ static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ -static const unsigned H5F_def_vds_file_cache_size_g = H5F_ACS_VDS_FILE_CACHE_SIZE_DEF; /* Default vds file cache size */ static const H5FD_file_image_info_t H5F_def_file_image_info_g = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */ static const hbool_t H5F_def_core_write_tracking_flag_g = H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEF; /* Default setting for core VFD write tracking */ static const size_t H5F_def_core_write_tracking_page_size_g = H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEF; /* Default core VFD write tracking page size */ @@ -516,12 +510,6 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the vds file cache size */ - if(H5P_register_real(pclass, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, H5F_ACS_VDS_FILE_CACHE_SIZE_SIZE, &H5F_def_vds_file_cache_size_g, - NULL, NULL, NULL, H5F_ACS_VDS_FILE_CACHE_SIZE_ENC, H5F_ACS_VDS_FILE_CACHE_SIZE_DEC, - NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the initial file image info */ /* (Note: this property should not have an encode/decode callback -QAK) */ if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, @@ -2474,75 +2462,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_vds_file_cache_size - * - * Purpose: Sets the number of files opened through vds links - * from the file associated with this fapl to be held open - * in that file's vds file cache. When the maximum - * number of files is reached, the least recently used file - * is closed (unless it is opened from somewhere else). - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -herr_t -H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "iIu", plist_id, vds_size); - - /* 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") - - /* Set value */ - if(H5P_set(plist, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, &vds_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds file cache size") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pset_vds_file_cache_size() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pget_vds_file_cache_size - * - * Purpose: Gets the number of files opened through vds links - * from the file associated with this fapl to be held open - * in that file's vds file cache. When the maximum - * number of files is reached, the least recently used file - * is closed (unless it is opened from somewhere else). - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -herr_t -H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Iu", plist_id, vds_size); - - /* 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") - - /* Get value */ - if(vds_size) - if(H5P_get(plist, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, vds_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file cache size") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pget_vds_file_cache_size() */ - - -/*------------------------------------------------------------------------- * Function: H5Pset_file_image * * Purpose: Sets the initial file image. Some file drivers can initialize diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 38be320..a2c0418 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -343,8 +343,6 @@ H5_DLL herr_t H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low, H5F_libver_t *high); H5_DLL herr_t H5Pset_elink_file_cache_size(hid_t plist_id, unsigned efc_size); H5_DLL herr_t H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size); -H5_DLL herr_t H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size); -H5_DLL herr_t H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size); H5_DLL herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); H5_DLL herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); H5_DLL herr_t H5Pset_file_image_callbacks(hid_t fapl_id, -- cgit v0.12 From e94ed99c5bf7c4ae5df56f75606ef1b486e16bb2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 14:24:57 -0600 Subject: Add HD prefix --- src/H5system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5system.c b/src/H5system.c index 7b3a0eb..719b7e0 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1043,7 +1043,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/) * Unix: does not apply */ if(H5_CHECK_ABS_DRIVE(name)) { - drive = toupper(name[0]) - 'A' + 1; + drive = HDtoupper(name[0]) - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrncpy(new_name, &name[2], name_len); } /* end if */ -- cgit v0.12 From 82d092a499dbbb0f5918b887b302e4754821cfd2 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 20 Dec 2017 23:11:58 -0600 Subject: Update for new support website Description: - Replaced external links with text including the C API name - Removed links of copyright at the bottom of each page - Removed logo at top - Removed document name and version number Platforms tested: Linux/32 2.6 (jam) - only documentation --- c++/src/H5ArrayType.cpp | 7 ------- c++/src/H5AtomType.cpp | 12 ++++++------ c++/src/H5CppDoc.h | 13 ++++--------- c++/src/H5DataSet.cpp | 13 ++----------- c++/src/H5DataSpace.cpp | 20 ++++++++------------ c++/src/H5DataType.cpp | 7 ++----- c++/src/H5DcreatProp.cpp | 28 +++++++++++++--------------- c++/src/H5DxferProp.cpp | 9 ++++----- c++/src/H5FaccProp.cpp | 48 +++++++++++++++++++++++------------------------- c++/src/H5FcreatProp.cpp | 25 ++++++++++++------------- c++/src/H5File.cpp | 5 ++--- c++/src/H5Library.cpp | 8 +++----- c++/src/H5Location.cpp | 30 +++++++++--------------------- c++/src/H5Object.cpp | 6 ++---- c++/src/H5OcreatProp.cpp | 14 ++++++-------- c++/src/H5StrType.cpp | 4 ++-- c++/src/cpp_doc_config | 6 +++--- c++/src/footer.html | 4 ++-- 18 files changed, 103 insertions(+), 156 deletions(-) diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 15ac140..76e7532 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -119,7 +119,6 @@ ArrayType::ArrayType(const H5Location& loc, const H5std_string& dtype_name) : Da // 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) { @@ -165,9 +164,6 @@ DataType* ArrayType::decode() const ///\return Number of dimensions ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 2004 -// Modification -// Apr, 2016 -// Became const. //-------------------------------------------------------------------------- int ArrayType::getArrayNDims() const { @@ -188,9 +184,6 @@ int ArrayType::getArrayNDims() const ///\return Number of dimensions ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 2004 -// Modification -// Apr, 2016 -// Became const. //-------------------------------------------------------------------------- int ArrayType::getArrayDims(hsize_t* dims) const { diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 5e709af..4e19850 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -175,8 +175,8 @@ size_t AtomType::getPrecision() const ///\param precision - IN: Number of bits of precision ///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision +/// For information, please refer to the H5Tset_precision API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setPrecision(size_t precision) const @@ -195,8 +195,8 @@ void AtomType::setPrecision(size_t precision) const ///\return Offset value ///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset +/// For information, please refer to the H5Tget_offset API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 // Modification // 12/05/00: due to C API change @@ -222,8 +222,8 @@ int AtomType::getOffset() const ///\param offset - IN: Offset of first significant bit ///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset +/// For information, please refer to the H5Tset_offset API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setOffset(size_t offset) const diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index bfab9cd..6eb85bf 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -26,12 +26,9 @@ * * 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. + * It is assumed that the user has knowledge of the HDF5 file format and its + * components. For more information on the HDF5 C Library, please refer to + * the HDF5 Software Documentation page. * * Because the HDF5 C Library maps very well to * the object oriented design approach, classes in the C++ API can @@ -51,15 +48,13 @@ 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 * * The HDF5 C++ API is included with the HDF5 source code and can * be obtained from - * - * 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 32377bc..9e0f9ff 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -90,9 +90,6 @@ DataSet::DataSet(const DataSet& original) : H5Object(), AbstractDs(), id(origina /// \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. //-------------------------------------------------------------------------- DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID) { @@ -109,9 +106,6 @@ DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, co ///\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. //-------------------------------------------------------------------------- DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID) { @@ -577,10 +571,8 @@ int DataSet::iterateElems(void* buf, const DataType& type, const DataSpace& spac ///\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: -///\par -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend +/// For information, please refer to the H5Dset_extent API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::extend(const hsize_t* size) const @@ -600,7 +592,6 @@ void DataSet::extend(const hsize_t* size) const ///\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 { diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 379de2f..b563da4 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -466,9 +466,8 @@ hssize_t DataSpace::getSelectElemNpoints () const ///\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: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList +/// For information, please refer to the C API +/// H5Sget_select_elem_pointlist in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const @@ -490,9 +489,8 @@ void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, h /// the coordinates of the diagonally opposite corner ///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds +/// For information, please refer to the H5Sget_select_bounds API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const @@ -516,9 +514,8 @@ void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const /// 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: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements +/// For information, please refer to the H5Sselect_elements API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectElements (H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const @@ -598,9 +595,8 @@ bool DataSpace::selectValid () const ///\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: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab +/// For information, please refer to the H5Sselect_hyperslab API in +/// the HDF5 C Reference Manual. // 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/H5DataType.cpp b/c++/src/H5DataType.cpp index 444a77a..4b06c0a 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -96,9 +96,6 @@ DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object(), enco ///\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. //-------------------------------------------------------------------------- DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), encoded_buf(NULL), buf_size(0) { @@ -653,8 +650,8 @@ DataType DataType::getSuper() const /// destination datatypes. ///\exception H5::DataTypeIException ///\par Description -/// For more information, please see: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register +/// For information, please refer to the H5Tregister API in +/// the HDF5 C Reference Manual. // 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/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index fd3cd17..2946730 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -158,8 +158,8 @@ int DSetCreatPropList::getChunk(int max_ndims, hsize_t* dim) const ///\param layout - IN: Type of storage layout for raw data ///\exception H5::PropListIException ///\par Description -/// For information on valid layout types, please refer to -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout +/// For information, please refer to the H5Pset_layout API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setLayout(H5D_layout_t layout) const @@ -233,9 +233,8 @@ void DSetCreatPropList::setDeflate(int level) const ///\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: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSzip +/// SZIP and usage, please refer to the H5Pset_szip API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - Jan, 2007 //-------------------------------------------------------------------------- void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_per_block) const @@ -255,9 +254,8 @@ void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_p ///\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: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-setNbit +/// Nbit compression, please refer to the H5Pset_nbit API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - Apr, 2016 //-------------------------------------------------------------------------- void DSetCreatPropList::setNbit() const @@ -284,8 +282,7 @@ void DSetCreatPropList::setNbit() const /// according to the actual dataset datatype. ///\par /// For information on setting fill value, please refer to the -/// C layer Reference Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue +/// H5Pset_fill_value API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFillValue(const DataType& fvalue_type, const void* value) const @@ -534,9 +531,8 @@ bool DSetCreatPropList::allFiltersAvail() const /// ///\exception H5::PropListIException ///\par Description -/// Please refer to the Reference Manual of \c H5Pset_shuffle for -/// details. -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle +/// For information, please refer to the H5Pset_shuffle API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setShuffle() const @@ -752,7 +748,8 @@ void DSetCreatPropList::getExternal(unsigned idx, size_t name_size, char* name, /// an unlimited selection ///\exception H5::PropListIException ///\par Description -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetVirtual +/// For information, please refer to the H5Pset_virtual API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - Mar, 2017 //-------------------------------------------------------------------------- void DSetCreatPropList::setVirtual(const DataSpace& vspace, const char *src_fname, const char *src_dsname, const DataSpace& sspace) const @@ -779,7 +776,8 @@ void DSetCreatPropList::setVirtual(const DataSpace& vspace, const char *src_fnam /// an unlimited selection ///\exception H5::PropListIException ///\par Description -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetVirtual +/// For information, please refer to the H5Pset_virtual API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - Mar, 2017 //-------------------------------------------------------------------------- void DSetCreatPropList::setVirtual(const DataSpace& vspace, const H5std_string src_fname, const H5std_string src_dsname, const DataSpace& sspace) const diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 3a72b28..21e18e7 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -434,8 +434,8 @@ void DSetMemXferPropList::getVlenMemManager(H5MM_allocate_t& alloc_func, void** ///\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: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData +/// For detail, please refer to the H5Pset_small_data_block_size +/// API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const @@ -473,9 +473,8 @@ hsize_t DSetMemXferPropList::getSmallDataBlockSize() const /// ///\exception H5::PropListIException ///\par Description -/// For information, please refer to the C layer Reference -/// Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize +/// For detail, please refer to the H5Pset_hyper_vector_size +/// API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index b414294..9e1098b 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -124,8 +124,8 @@ void FileAccPropList::setStdio() const ///\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 +/// For detail on valid driver identifiers, please refer to the +/// H5Pget_driver API in the HDF5 C Reference Manual. ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -146,9 +146,8 @@ hid_t FileAccPropList::getDriver() const ///\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: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetDriver +/// For information, please refer to the H5Pset_driver API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info) const @@ -205,8 +204,7 @@ hsize_t FileAccPropList::getFamilyOffset() const ///\exception H5::PropListIException ///\par Description /// 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 +/// refer to the H5Pset_fapl_core API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const @@ -309,8 +307,8 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const ///\param raw_ext - IN: Raw data filename extension as \c char* ///\exception H5::PropListIException ///\par Description -/// Temporary - For information, please refer to: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplSplit +/// For information, please refer to the H5Pset_fapl_split API in +/// the HDF5 C Reference Manual. // 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 @@ -369,8 +367,8 @@ size_t FileAccPropList::getSieveBufSize() const ///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer ///\exception H5::PropListIException ///\par Description -/// For detail on data sieving, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize +/// For more detail, please refer to the H5Pset_sieve_buf_size +/// API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setSieveBufSize(size_t bufsize) const @@ -389,8 +387,8 @@ void FileAccPropList::setSieveBufSize(size_t bufsize) const /// block allocations ///\exception H5::PropListIException ///\par Description -/// For more detail, please see the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMetaBlockSize +/// For information, please refer to the H5Pset_meta_block_size +/// API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const @@ -429,8 +427,8 @@ hsize_t FileAccPropList::getMetaBlockSize() const ///\param buf_size - IN: Size of the logging buffer ///\exception H5::PropListIException ///\par Description -/// For detail on \a flags, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplLog +/// For information, please refer to the H5Pset_fapl_log API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_size) const @@ -486,8 +484,8 @@ void FileAccPropList::setSec2() const /// 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 -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAlignment +/// For more detail, please refer to the H5Pset_alignment API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setAlignment(hsize_t threshold, hsize_t alignment) const @@ -523,8 +521,8 @@ void FileAccPropList::getAlignment(hsize_t &threshold, hsize_t &alignment) const ///\param dtype - IN: Type of data ///\exception H5::PropListIException ///\par Description -/// More details and valid values for \a dtype can be found at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMultiType +/// For information, please refer to the H5Pset_multi_type API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMultiType(H5FD_mem_t dtype) const @@ -542,8 +540,8 @@ void FileAccPropList::setMultiType(H5FD_mem_t dtype) const ///\return The data type property ///\exception H5::PropListIException ///\par Description -/// More details and possible returned values can be found at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMultiType +/// For information, please refer to the H5Pget_multi_type API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5FD_mem_t FileAccPropList::getMultiType() const @@ -643,8 +641,8 @@ H5F_close_degree_t FileAccPropList::getFcloseDegree() const /// on (1) or off (0). ///\exception H5::PropListIException ///\par Description -/// For detail on \a fapl, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetGCReferences +/// For information, please refer to the H5Pset_gc_references API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setGcReferences(unsigned gc_ref) const @@ -694,8 +692,8 @@ unsigned FileAccPropList::getGcReferences() const /// \li \c H5F_LIBVER_18 /// \li \c H5F_LIBVER_LATEST (Default) /// -/// For more details, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLibverBounds +/// For more detail, please refer to the H5Pset_libver_bounds API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - March, 2015 //-------------------------------------------------------------------------- void FileAccPropList::setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 9674c0a..98a35cb 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -173,9 +173,8 @@ hsize_t FileCreatPropList::getUserblock() const ///\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: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes +/// For information, please refer to the H5Pset_sizes API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSizes(size_t sizeof_addr, size_t sizeof_size) const @@ -214,8 +213,8 @@ void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t& sizeof_size) const ///\param lk - IN: Symbol table node size ///\exception H5::PropListIException ///\par Description -/// For information, please see the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK +/// For information, please refer to the H5Pset_sym_k API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const @@ -235,8 +234,8 @@ void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const /// ///\exception H5::PropListIException ///\par Description -/// For information, please see -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK +/// For information, please refer to the H5Pget_sym_k API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const @@ -256,8 +255,8 @@ void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const ///\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: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK +/// For information, please refer to the H5Pset_istore_k API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setIstorek(unsigned ik) const @@ -276,8 +275,8 @@ void FileCreatPropList::setIstorek(unsigned ik) const ///\return 1/2 rank of chunked storage B-tree ///\exception H5::PropListIException ///\par Description -/// For information, please see -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetIstoreK +/// For information, please refer to the H5Pget_istore_k API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- unsigned FileCreatPropList::getIstorek() const @@ -306,8 +305,8 @@ unsigned FileCreatPropList::getIstorek() const /// 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. -/// For information, please see the C layer Reference Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFileSpace +/// For information, please refer to the H5Pset_file_space_strategy +/// API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - Feb, 2017 //-------------------------------------------------------------------------- void FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t persist, hsize_t threshold) const diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 3a0b54d..57ee4d5 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -72,9 +72,8 @@ H5File::H5File() : Group(), id(H5I_INVALID_HID) {} /// 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: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create +/// please refer to the \b Special \b case section of the H5Fcreate +/// API in the C Reference Manual. // 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 diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 9293622..214c5b2 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -110,8 +110,7 @@ void H5Library::getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& reln ///\exception H5::LibraryIException ///\par Description /// 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 +/// the H5check_version API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) @@ -240,9 +239,8 @@ void H5Library::termH5cpp() ///\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: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-SetFreeListLimits +/// For more information on free list limits, please refer to +/// the H5set_free_list_limits API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index d0b5f9d..95c96ad 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -230,7 +230,6 @@ void H5Location::setComment(const H5std_string& name, const H5std_string& commen /// 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 { @@ -513,9 +512,6 @@ void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_t // from_func - IN: Name of the calling function // Exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 -// Modification -// 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) { @@ -544,9 +540,6 @@ hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_ty ///\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 //-------------------------------------------------------------------------- void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) { @@ -563,8 +556,6 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t // exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// May, 2008 -// Corrected missing parameters. -BMR // Mar, 2017 // Removed in 1.10.1 because H5Location is Attribute's baseclass // now. -BMR @@ -955,9 +946,8 @@ DataSet H5Location::openDataSet(const H5std_string& name) const /// 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 +/// refer to the H5Lcreate_hard and H5Lcreate_soft APIs in the +/// HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 // Modification // 2007: QAK modified to use H5L APIs - BMR @@ -1036,8 +1026,7 @@ void H5Location::unlink(const H5std_string& name) const ///\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: -/// https://www.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FGroups%2FHDF5_Groups.htm +/// to the Group Interface in the HDF5 User's Guide for details. // Programmer Binh-Minh Ribler - 2000 // Modification // 2007: QAK modified to use H5L APIs - BMR @@ -1070,9 +1059,8 @@ void H5Location::move(const H5std_string& src, const H5std_string& dst) const ///\param statbuf - OUT: Buffer to return information about the object ///\exception H5::FileIException/H5::GroupIException/H5::LocationException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetObjinfo +/// For information, please refer to the H5Gget_objinfo API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Location::getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const @@ -1435,8 +1423,8 @@ ssize_t H5Location::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size /// \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 +/// For information, please refer to the H5Oget_info_by_name API in +/// the HDF5 C Reference Manual. ///\exception H5::FileIException/H5::GroupIException/H5::LocationException /// Exception will be thrown when: /// - an error returned by the C API @@ -1501,8 +1489,8 @@ H5O_type_t H5Location::childObjType(const H5std_string& objname) const /// \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 +/// For information, please refer to the H5Oget_info_by_idx API in +/// the HDF5 C Reference Manual. ///\exception H5::FileIException/H5::GroupIException/H5::LocationException /// Exception will be thrown when: /// - an error returned by the C API diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 3eed168..fcdfd59 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -224,9 +224,8 @@ Attribute H5Object::openAttribute(const unsigned int idx) const ///\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: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate +/// For information, please refer to the H5Aiterate2 API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_data) @@ -421,7 +420,6 @@ ssize_t H5Object::getObjName(char *obj_name, size_t buf_size) const ///\return Name of the object ///\exception H5::Exception // Programmer Binh-Minh Ribler - Mar, 2014 -// Modification //-------------------------------------------------------------------------- H5std_string H5Object::getObjName() const { diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index ec6c08e..121198c 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -113,8 +113,7 @@ ObjCreatPropList::ObjCreatPropList(const hid_t plist_id) : PropList(plist_id) {} ///\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: -/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrPhaseChange +/// H5Pset_attr_phase_change API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_dense) const @@ -137,8 +136,7 @@ void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_den ///\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: -/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrPhaseChange +/// H5Pget_attr_phase_change API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const @@ -166,8 +164,8 @@ void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_d /// 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 +/// For detail, please refer to the H5Pset_attr_creation_order API +/// in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const @@ -188,8 +186,8 @@ void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const ///\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: -/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrCreationOrder +/// For detail, please refer to the H5Pget_attr_creation_order API +/// in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- unsigned ObjCreatPropList::getAttrCrtOrder() const diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index d2d87e9..7125676 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -281,8 +281,8 @@ H5T_str_t StrType::getStrpad() const ///\param strpad - IN: String padding type ///\exception H5::DataTypeIException ///\par Description -/// For detail, please refer to the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad +/// For information, please refer to the H5Tset_strpad API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void StrType::setStrpad(H5T_str_t strpad) const diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index ae5dd90..6a9f171 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -32,13 +32,13 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "HDF5 C++ API" +PROJECT_NAME = # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.11.0" +PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -51,7 +51,7 @@ PROJECT_BRIEF = # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo # to the output directory. -PROJECT_LOGO = ./header_files/hdf_logo.jpg +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is diff --git a/c++/src/footer.html b/c++/src/footer.html index ba37ee7..5ad9b7c 100644 --- a/c++/src/footer.html +++ b/c++/src/footer.html @@ -11,8 +11,8 @@   - Copyright by - The HDF Group + Copyright by + The HDF Group
and the Board of Trustees of the University of Illinois -- cgit v0.12 From 86d8a4c267eccbc66d6ee6120c9099788853c40f Mon Sep 17 00:00:00 2001 From: lrknox Date: Fri, 22 Dec 2017 12:28:24 -0600 Subject: Revert "Merge pull request #826 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop" This reverts commit b1223dd653e65e076af92b2dfe236f3704da81c8, reversing changes made to b25f123f5f5e25c1447a6a02861cb7c7265c12f2. --- CMakeLists.txt | 1 - MANIFEST | 6 - config/cmake_ext_mod/FindMPI.cmake | 287 +++--- config/cmake_ext_mod/runTest.cmake | 1 - examples/CMakeLists.txt | 4 +- java/src/hdf/hdf5lib/H5.java | 197 +--- java/src/hdf/hdf5lib/HDF5Constants.java | 3 - java/src/hdf/overview.html | 6 +- java/src/jni/h5Constants.c | 2 - java/src/jni/h5pImp.c | 211 ----- java/src/jni/h5pImp.h | 73 +- java/test/JUnit-interface.txt | 9 +- java/test/TestH5P.java | 53 +- java/test/TestH5Pfapl.java | 14 - java/test/TestH5Pvirtual.java | 33 - release_docs/RELEASE.txt | 30 +- src/CMakeLists.txt | 10 +- src/H5Dint.c | 78 +- src/H5Dpkg.h | 3 +- src/H5Dprivate.h | 11 +- src/H5Dvirtual.c | 253 +----- src/H5Fprivate.h | 420 ++++----- src/H5Fquery.c | 2 +- src/H5Pdapl.c | 366 -------- src/H5Pfapl.c | 938 +++++++++---------- src/H5Ppublic.h | 2 - src/H5system.c | 2 +- test/CMakeTests.cmake | 76 +- test/vds.c | 1493 ++++++++++++------------------- tools/test/h5dump/CMakeTestsVDS.cmake | 67 -- tools/test/h5ls/CMakeTestsVDS.cmake | 55 -- tools/test/h5ls/vds_prefix/tvds-1.ls | 14 - tools/test/h5ls/vds_prefix/tvds-2.ls | 13 - tools/test/h5ls/vds_prefix/tvds-3_1.ls | 14 - tools/test/h5ls/vds_prefix/tvds-3_2.ls | 13 - tools/test/h5ls/vds_prefix/tvds-4.ls | 9 - tools/test/h5ls/vds_prefix/tvds-5.ls | 11 - 37 files changed, 1471 insertions(+), 3309 deletions(-) delete mode 100644 tools/test/h5ls/vds_prefix/tvds-1.ls delete mode 100644 tools/test/h5ls/vds_prefix/tvds-2.ls delete mode 100644 tools/test/h5ls/vds_prefix/tvds-3_1.ls delete mode 100644 tools/test/h5ls/vds_prefix/tvds-3_2.ls delete mode 100644 tools/test/h5ls/vds_prefix/tvds-4.ls delete mode 100644 tools/test/h5ls/vds_prefix/tvds-5.ls diff --git a/CMakeLists.txt b/CMakeLists.txt index 6165b35..e22ac2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -631,7 +631,6 @@ if (HDF5_ENABLE_PARALLEL) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) - INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_DIRS}) else () message (STATUS "Parallel libraries not found") endif () diff --git a/MANIFEST b/MANIFEST index c6c7b3c..9b91c78 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1430,12 +1430,6 @@ ./tools/test/h5ls/h5ls_plugin.sh.in ./tools/test/h5ls/testh5ls.sh.in ./tools/test/h5ls/testh5lsvds.sh.in -./tools/test/h5ls/vds_prefix/tvds-1.ls -./tools/test/h5ls/vds_prefix/tvds-2.ls -./tools/test/h5ls/vds_prefix/tvds-3_1.ls -./tools/test/h5ls/vds_prefix/tvds-3_2.ls -./tools/test/h5ls/vds_prefix/tvds-4.ls -./tools/test/h5ls/vds_prefix/tvds-5.ls # h5copy sources ./tools/src/h5copy/Makefile.am diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index d01dd35..8084472 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -347,7 +347,7 @@ function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) # library that has invalid or missing version information there would be warning # messages emitted by ld.so in the compiler output. In either case, we'll treat # the output as invalid. - if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found") + if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available") set(WRAPPER_RETURN 255) endif() # Ensure that no error output might be passed upwards. @@ -615,16 +615,6 @@ function (_MPI_interrogate_compiler lang) endif() endif() - if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) - list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}") - endif() - if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) - list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}") - endif() - if(MPI_${LANG}_EXTRA_LIB_NAMES) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}") - endif() - # If we found MPI, set up all of the appropriate cache entries if(NOT MPI_${LANG}_COMPILE_OPTIONS) set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) @@ -833,43 +823,33 @@ endfunction() macro(_MPI_assemble_libraries LANG) set(MPI_${LANG}_LIBRARIES "") - # Only for libraries do we need to check whether the compiler's linking stage is separate. - if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT) - foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) - endforeach() - endif() + foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) + endforeach() endmacro() macro(_MPI_assemble_include_dirs LANG) - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - set(MPI_${LANG}_INCLUDE_DIRS "") - else() - set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") - if("${LANG}" MATCHES "(C|CXX)") - if(MPI_${LANG}_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - else() # Fortran - if(MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") - endif() - if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") - endif() + set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") + if("${LANG}" MATCHES "(C|CXX)") + if(MPI_${LANG}_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}") - endforeach() + else() # Fortran + if(MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + endif() + if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") endif() endif() + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}") + endforeach() + endif() endmacro() function(_MPI_split_include_dirs LANG) - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - return() - endif() # Backwards compatibility: Search INCLUDE_PATH if given. if(MPI_${LANG}_INCLUDE_PATH) list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") @@ -905,13 +885,6 @@ function(_MPI_split_include_dirs LANG) endif() mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) endif() - # Remove duplicates and default system directories from the list. - if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) - list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR}) - endforeach() - endif() set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) endfunction() @@ -1041,7 +1014,7 @@ elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") # FreeBSD ships mpich under the normal system paths - but available openmpi implementations # will be found in /usr/local/mpi/ - MPI_search_mpi_prefix_folder("/usr/local/mpi") + MPI_search_mpi_prefix_folder("/usr/local/mpi/") endif() # Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. @@ -1077,54 +1050,48 @@ mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXE # # Once we find the new variables, we translate them back into their old # equivalents below. -if(NOT MPI_IGNORE_LEGACY_VARIABLES) - foreach (LANG IN ITEMS C CXX) - # Old input variables. - set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) - - # Set new vars based on their old equivalents, if the new versions are not already set. - foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${LANG}_${var} AND MPI_${var}) - set(MPI_${LANG}_${var} "${MPI_${var}}") +foreach (LANG IN ITEMS C CXX) + # Old input variables. + set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) + + # Set new vars based on their old equivalents, if the new versions are not already set. + foreach (var ${_MPI_OLD_INPUT_VARS}) + if (NOT MPI_${LANG}_${var} AND MPI_${var}) + set(MPI_${LANG}_${var} "${MPI_${var}}") + endif() + endforeach() + + # Chop the old compile flags into options and definitions + if(MPI_${LANG}_COMPILE_FLAGS) + unset(MPI_${LANG}_COMPILE_OPTIONS) + unset(MPI_${LANG}_COMPILE_DEFINITIONS) + separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") + foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) + if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") + list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") + else() + list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}") endif() endforeach() + unset(MPI_SEPARATE_FLAGS) + endif() - # Chop the old compile flags into options and definitions - - unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) - unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) - if(MPI_${LANG}_COMPILE_FLAGS) - separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") - foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) - if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") - list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") - else() - list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}") - endif() - endforeach() - unset(MPI_SEPARATE_FLAGS) - endif() - - # If a list of libraries was given, we'll split it into new-style cache variables - unset(MPI_${LANG}_EXTRA_LIB_NAMES) - if(NOT MPI_${LANG}_LIB_NAMES) - foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) - if(_MPI_LIB) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) - get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) - list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endif() - endforeach() - endif() - endforeach() -endif() + # If a list of libraries was given, we'll split it into new-style cache variables + if(NOT MPI_${LANG}_LIB_NAMES) + foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) + get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endforeach() + endif() +endforeach() #============================================================================= unset(MPI_VERSION) @@ -1133,11 +1100,6 @@ unset(MPI_VERSION_MINOR) unset(_MPI_MIN_VERSION) -# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. -if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) - set(MPI_SKIP_COMPILER_WRAPPER TRUE) -endif() - # This loop finds the compilers and sends them off for interrogation. foreach(LANG IN ITEMS C CXX Fortran) if(CMAKE_${LANG}_COMPILER_LOADED) @@ -1159,8 +1121,6 @@ foreach(LANG IN ITEMS C CXX Fortran) mark_as_advanced(MPI_CXX_SKIP_MPICXX) endif() if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) - set(MPI_${LANG}_TRIED_IMPLICIT FALSE) - set(MPI_${LANG}_WORKS_IMPLICIT FALSE) if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. # Cray PrgEnv. @@ -1170,90 +1130,80 @@ foreach(LANG IN ITEMS C CXX Fortran) # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. if(MPI_${LANG}_WORKS) set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) - set(MPI_${LANG}_WORKS_IMPLICIT TRUE) endif() - set(MPI_${LANG}_TRIED_IMPLICIT TRUE) endif() - if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS) - set(MPI_${LANG}_WRAPPER_FOUND FALSE) - set(MPI_PINNED_COMPILER FALSE) - - if(NOT MPI_SKIP_COMPILER_WRAPPER) - if(MPI_${LANG}_COMPILER) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") - unset(MPI_${LANG}_COMPILER CACHE) - endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(MPI_PINNED_COMPILER TRUE) - endif() - - # If we have an MPI base directory, we'll try all compiler names in that one first. - # This should prevent mixing different MPI environments - if(_MPI_BASE_DIR) - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - HINTS ${_MPI_BASE_DIR} - NO_DEFAULT_PATH - DOC "MPI compiler for ${LANG}" - ) + # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. + if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) + set(MPI_SKIP_COMPILER_WRAPPER TRUE) + endif() + if(NOT MPI_SKIP_COMPILER_WRAPPER) + if(MPI_${LANG}_COMPILER) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") + unset(MPI_${LANG}_COMPILER CACHE) endif() + # If the user specifies a compiler, we don't want to try to search libraries either. + set(MPI_PINNED_COMPILER TRUE) + else() + set(MPI_PINNED_COMPILER FALSE) + endif() - # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), - # we shall try searching in the default paths. + # If we have an MPI base directory, we'll try all compiler names in that one first. + # This should prevent mixing different MPI environments + if(_MPI_BASE_DIR) find_program(MPI_${LANG}_COMPILER NAMES ${_MPI_${LANG}_COMPILER_NAMES} PATH_SUFFIXES bin sbin + HINTS ${_MPI_BASE_DIR} + NO_DEFAULT_PATH DOC "MPI compiler for ${LANG}" ) + endif() - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - set(MPI_PINNED_COMPILER TRUE) - - # If we haven't made the implicit compiler test yet, perform it now. - if(NOT MPI_${LANG}_TRIED_IMPLICIT) - _MPI_create_imported_target(${LANG}) - _MPI_check_lang_works(${LANG}) - endif() - - # Should the MPI compiler not work implicitly for MPI, still interrogate it. - # Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used - # directly during linkage instead of CMAKE__COMPILER will not work. - if(NOT MPI_${LANG}_WORKS) - set(MPI_${LANG}_WORKS_IMPLICIT FALSE) - _MPI_interrogate_compiler(${LANG}) - else() - set(MPI_${LANG}_WORKS_IMPLICIT TRUE) - endif() - elseif(MPI_${LANG}_COMPILER) - _MPI_interrogate_compiler(${LANG}) - endif() + # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), + # we shall try searching in the default paths. + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + DOC "MPI compiler for ${LANG}" + ) + + if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + set(MPI_SKIP_GUESSING TRUE) + elseif(MPI_${LANG}_COMPILER) + _MPI_interrogate_compiler(${LANG}) + else() + set(MPI_${LANG}_WRAPPER_FOUND FALSE) endif() + else() + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + set(MPI_PINNED_COMPILER FALSE) + endif() - if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) - # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the - # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. - if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) - else() - _MPI_guess_settings(${LANG}) - endif() + if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) + # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the + # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. + if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) + set(MPI_${LANG}_WRAPPER_FOUND TRUE) + elseif(NOT MPI_SKIP_GUESSING) + _MPI_guess_settings(${LANG}) endif() endif() endif() _MPI_split_include_dirs(${LANG}) - _MPI_assemble_include_dirs(${LANG}) - _MPI_assemble_libraries(${LANG}) - + if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + _MPI_assemble_include_dirs(${LANG}) + _MPI_assemble_libraries(${LANG}) + endif() _MPI_adjust_compile_definitions(${LANG}) # We always create imported targets even if they're empty _MPI_create_imported_target(${LANG}) @@ -1267,9 +1217,7 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) - if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) - endif() + set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) @@ -1389,7 +1337,7 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) unset(MPI_${LANG}_REQUIRED_VARS) - if (NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND) foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") endforeach() @@ -1500,7 +1448,6 @@ if (MPI_NUMLIBS GREATER 1) else() set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") endif() -set(MPI_IGNORE_LEGACY_VARIABLES TRUE) #============================================================================= # unset these vars to cleanup namespace diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 5569a73..2479728 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -55,7 +55,6 @@ endif () if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") - #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") endif () if (NOT TEST_INPUT) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 04a99ce..d8eb1a2 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -63,13 +63,13 @@ if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example STATIC) TARGET_C_PROPERTIES (ph5example STATIC " " " ") - target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) + target_link_libraries (ph5example ${HDF5_LIB_TARGET}) set_target_properties (ph5example PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example-shared SHARED) TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") - target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) + target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) endif () endif () diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 78ebbe2..7b5b5c9 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -4451,7 +4451,7 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// - // /////// Generic property list routines /////// + // Generic property list routines /** * H5Pget_class_name retrieves the name of a generic property list class @@ -4767,7 +4767,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException; - // /////// Object creation property list (OCPL) routines /////// + // Object creation property list (OCPL) routines /** * H5Pget_attr_phase_change retrieves attribute storage phase change thresholds. @@ -5071,7 +5071,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException, NullPointerException; - // /////// File creation property list (FCPL) routines /////// + // File creation property list (FCPL) routines /** * H5Pget_userblock retrieves the size of a user block in a file creation property list. @@ -5480,7 +5480,7 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, IllegalArgumentException; - // /////// File access property list (FAPL) routines /////// + // File access property list (FAPL) routines /** * H5Pget_alignment retrieves the current settings for alignment properties from a file access property list. @@ -5860,37 +5860,6 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_metadata_read_attempts(long plist_id, long attempts) throws HDF5LibraryException; - /** - * H5Pget_evict_on_close retrieves the file access property list setting that determines whether an HDF5 object - * will be evicted from the library's metadata cache when it is closed. - * - * @param fapl_id - * IN: File access property list identifier - * - * @return indication if the object will be evicted on close. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native boolean H5Pget_evict_on_close(long fapl_id) - throws HDF5LibraryException; - - /** - * H5Pset_evict_on_close controls the library's behavior of evicting metadata associated with a closed object. - * - * @param fapl_id - * IN: File access property list identifier - * @param evict_on_close - * IN: Whether the HDF5 object should be evicted on close. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close) - throws HDF5LibraryException; - // Dataset creation property list (DCPL) routines // /** @@ -6097,36 +6066,6 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native String H5Pget_virtual_dsetname(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException; -// ///// unimplemented ///// -// /** -// * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache. -// * -// * @param fapl_id -// * IN: File access property list identifier -// * -// * @return VDS link open file cache size in number of files. -// * -// * @exception HDF5LibraryException -// * - Error from the HDF-5 Library. -// * -// **/ -// public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException; -// -// /** -// * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache. -// * -// * @param fapl_id -// * IN: File access property list identifier -// * @param efc_size -// * IN: VDS link open file cache size in number of files. -// * -// * @exception HDF5LibraryException -// * - Error from the HDF-5 Library. -// * -// **/ -// public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size) -// throws HDF5LibraryException; - /** * H5Pget_external returns information about an external file. * @@ -6346,37 +6285,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException, NullPointerException; - // /////// Dataset creation property list (DCPL) routines /////// - - /** - * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list. - * - * @param dcpl_id - * IN: Dataset creation property list identifier - * @param opts - * IN: Edge chunk option flag. Valid values are: - * H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS - filters are not applied to partial edge chunks. - * 0 - Disables option; partial edge chunks will be compressed. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library - **/ - public synchronized static native void H5Pset_chunk_opts(long dcpl_id, int opts) throws HDF5LibraryException; - - /** - * H5Pget_chunk_opts retrieves the edge chunk option setting stored in the dataset creation property list . - * - * @param dcpl_id - * IN: Dataset creation property list - - * @return The edge chunk option setting. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library - **/ - public synchronized static native int H5Pget_chunk_opts(long dcpl_id) throws HDF5LibraryException; - - // /////// Dataset access property list (DAPL) routines /////// + // Dataset access property list (DAPL) routines // /** * Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes @@ -6479,76 +6388,12 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native long H5Pget_virtual_printf_gap(long dapl_id) throws HDF5LibraryException; - /** - * H5Pget_virtual_prefix Retrieves prefix applied to virtual file paths. - * - * @param dapl_id - * IN: Link access property list identifier - * - * @return the prefix to be applied to virtual file paths. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native String H5Pget_virtual_prefix(long dapl_id) - throws HDF5LibraryException; - - /** - * H5Pset_virtual_prefix Sets prefix to be applied to virtual file paths. - * - * @param dapl_id - * IN: Dataset access property list identifier - * @param prefix - * IN: Prefix to be applied to virtual file paths - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * @exception NullPointerException - * - prefix is null. - * - **/ - public synchronized static native void H5Pset_virtual_prefix(long dapl_id, String prefix) - throws HDF5LibraryException, NullPointerException; - - /** - * H5Pget_efile_prefix Retrieves prefix applied to external file paths. - * - * @param dapl_id - * IN: Link access property list identifier - * - * @return the prefix to be applied to external file paths. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native String H5Pget_efile_prefix(long dapl_id) - throws HDF5LibraryException; - - /** - * H5Pset_efile_prefix Sets prefix to be applied to external file paths. - * - * @param dapl_id - * IN: Dataset access property list identifier - * @param prefix - * IN: Prefix to be applied to external file paths - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * @exception NullPointerException - * - prefix is null. - * - **/ - public synchronized static native void H5Pset_efile_prefix(long dapl_id, String prefix) - throws HDF5LibraryException, NullPointerException; - // public synchronized static native void H5Pset_append_flush(long plist_id, int ndims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; // public synchronized static native void H5Pget_append_flush(long plist_id, int dims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; - // /////// Dataset xfer property list (DXPL) routines /////// + // Dataset xfer property list (DXPL) routines // /** * H5Pget_data_transform retrieves the data transform expression previously set in the dataset transfer property @@ -6699,7 +6544,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size) throws HDF5LibraryException, NullPointerException; - // /////// Link creation property list (LCPL) routines /////// + // Link creation property list (LCPL) routines // /** * H5Pget_create_intermediate_group determines whether property is set to enable creating missing intermediate @@ -6734,7 +6579,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_create_intermediate_group(long lcpl_id, boolean crt_intermed_group) throws HDF5LibraryException; - // /////// Group creation property list (GCPL) routines /////// + // Group creation property list (GCPL) routines // /** * H5Pget_local_heap_size_hint Retrieves the anticipated size of the local heap for original-style groups. @@ -6891,14 +6736,14 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_link_creation_order(long gcpl_id, int crt_order_flags) throws HDF5LibraryException; - // /////// String creation property list (STRCPL) routines /////// + // String creation property list (STRCPL) routines // public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException; public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding) throws HDF5LibraryException; - // /////// Link access property list (LAPL) routines /////// + // Link access property list (LAPL) routines // /** * H5Pget_nlinks retrieves the maximum number of soft or user-defined link traversals allowed, nlinks, before the @@ -7051,7 +6896,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_elink_acc_flags(long lapl_id, int flags) throws HDF5LibraryException, IllegalArgumentException; - // /////// Object copy property list (OCPYPL) routines /////// + // Object copy property list (OCPYPL) routines // /** * H5Pget_copy_object retrieves the properties to be used when an object is copied. @@ -7082,7 +6927,7 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options) throws HDF5LibraryException; - // /////// Other/Older property list routines /////// + // Other/Older property list routines // /** * H5Pget_version retrieves the version information of various objects for a file creation property list. @@ -7110,7 +6955,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pget_version(long plist, int[] version_info) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; - // /////// file drivers property list routines /////// + // file drivers property list routines // public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store) throws HDF5LibraryException, NullPointerException; @@ -7257,28 +7102,20 @@ public class H5 implements java.io.Serializable { // File creation property list (FCPL) routines // // File access property list (FAPL) routines // - // herr_t H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info) - // const void *H5Pget_driver_info(hid_t plist_id) - // herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) - // herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) + // herr_t H5Pset_driver( hid_t plist_id, hid_t new_driver_id, const void *new_driver_info ) + // const void *H5Pget_driver_info( hid_t plist_id ) + // herr_t H5Pget_multi_type ( hid_t fapl_id, H5FD_mem_t *type ) + // herr_t H5Pset_multi_type ( hid_t fapl_id, H5FD_mem_t type ) // herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); // herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); // herr_t H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size); // herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size); - // herr_t H5Pset_all_coll_metadata_ops(hid_t accpl_id, hbool_t is_collective); - // herr_t H5Pset_coll_metadata_write(hid_t fapl_id, hbool_t is_collective); - // herr_t H5Pget_coll_metadata_write(hid_t fapl_id, hbool_t *is_collective); - // herr_t H5Pget_page_buffer_size(hid_t fapl_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc); - // herr_t H5Pset_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t func, void *user_data); - // herr_t H5Pget_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t *func, void **user_data); // Dataset creation property list (DCPL) routines // // Dataset access property list (DAPL) routines // - // herr_t H5Pset_append_flush (hid_t dapl_id, int ndims, const hsize_t boundary[], H5D_append_cb_t func, void *user_data); - // herr_t H5Pget_append_flush(hid_t dapl_id, int ndims, hsize_t boundary[], H5D_append_cb_t *func, void **user_data) // Dataset xfer property list (DXPL) routines // // herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg); diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 3e43ba2..8a3d6c8 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -88,7 +88,6 @@ public class HDF5Constants { public static final int H5D_VDS_ERROR = H5D_VDS_ERROR(); public static final int H5D_VDS_FIRST_MISSING = H5D_VDS_FIRST_MISSING(); public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE(); - public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); public static final int H5E_MAJOR = H5E_MAJOR(); public static final int H5E_MINOR = H5E_MINOR(); @@ -769,8 +768,6 @@ public class HDF5Constants { private static native final int H5D_VDS_LAST_AVAILABLE(); - private static native final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); - private static native final long H5E_ALIGNMENT(); private static native final long H5E_ALREADYEXISTS(); diff --git a/java/src/hdf/overview.html b/java/src/hdf/overview.html index 9c19442..39d75b7 100644 --- a/java/src/hdf/overview.html +++ b/java/src/hdf/overview.html @@ -47,20 +47,20 @@ which has a method: The native method is implemented in C using the Java Native Method Interface (JNI). This is written something like the following: -
JNIEXPORT jlong
+
JNIEXPORT jint
 JNICALL Java_hdf_hdf5lib_H5_H5Fopen
 (
  JNIEnv *env,
  jclass class,
  jstring hdfFile,
  jint flags,
- jlong access)
+ jint access)
  {
 
  /* ...convert Java String to (char *) */
 
  /* call the HDF library */
- retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access);
+ retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access );
 
  /* ... */
 }
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 5a4b53e..f6f8bfa 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -140,8 +140,6 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1FIRST_1MISSING(JNIEnv *env, jclass cls) { return H5D_VDS_FIRST_MISSING; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1LAST_1AVAILABLE(JNIEnv *env, jclass cls) { return H5D_VDS_LAST_AVAILABLE; } -JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNK_1DONT_1FILTER_1PARTIAL_1CHUNKS(JNIEnv *env, jclass cls) { return H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS; } JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALIGNMENT(JNIEnv *env, jclass cls) { return H5E_ALIGNMENT; } diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index cf27341..dcfcd82 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5733,217 +5733,6 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts } /* end else */ } /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_virtual_prefix - * Signature: (JLjava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix - (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) -{ - herr_t retVal = -1; - const char *aName; - - PIN_JAVA_STRING(prefix, aName); - if (aName != NULL) { - retVal = H5Pset_virtual_prefix((hid_t)dapl_id, aName); - - UNPIN_JAVA_STRING(prefix, aName); - - if(retVal < 0) - h5libraryError(env); - } -} /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_virtual_prefix - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix - (JNIEnv *env, jclass clss, jlong dapl_id) -{ - size_t size = 0; - char *pre; - jlong prefix_size = -1; - jstring str = NULL; - - prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)NULL, size); - if(prefix_size < 0) { - h5libraryError(env); - } /* end if */ - else { - size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ - pre = (char*)HDmalloc(sizeof(char)*size); - if (pre == NULL) { - h5outOfMemory(env, "H5Pget_virtual_prefix: malloc failed "); - } /* end if */ - else { - prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)pre, size); - - if (prefix_size >= 0) { - str = ENVPTR->NewStringUTF(ENVPAR pre); - HDfree(pre); - if (str == NULL) - h5JNIFatalError( env, "H5Pget_virtual_prefix: return string not allocated"); - } /* end if */ - else { - HDfree(pre); - h5libraryError(env); - } /* end else */ - } /* end else */ - } /* end else */ - - return (jstring)str; -} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_efile_prefix - * Signature: (JLjava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix - (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) -{ - herr_t retVal = -1; - const char *aName; - - PIN_JAVA_STRING(prefix, aName); - if (aName != NULL) { - retVal = H5Pset_efile_prefix((hid_t)dapl_id, aName); - - UNPIN_JAVA_STRING(prefix, aName); - - if(retVal < 0) - h5libraryError(env); - } -} /* end Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_efile_prefix - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix - (JNIEnv *env, jclass clss, jlong dapl_id) -{ - size_t size = 0; - char *pre; - jlong prefix_size = -1; - jstring str = NULL; - - prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)NULL, size); - if(prefix_size < 0) { - h5libraryError(env); - } /* end if */ - else { - size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ - pre = (char*)HDmalloc(sizeof(char)*size); - if (pre == NULL) { - h5outOfMemory(env, "H5Pget_efile_prefix: malloc failed "); - } /* end if */ - else { - prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)pre, size); - - if (prefix_size >= 0) { - str = ENVPTR->NewStringUTF(ENVPAR pre); - HDfree(pre); - if (str == NULL) - h5JNIFatalError( env, "H5Pget_efile_prefix: return string not allocated"); - } /* end if */ - else { - HDfree(pre); - h5libraryError(env); - } /* end else */ - } /* end else */ - } /* end else */ - - return (jstring)str; -} /* end Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_evict_on_close - * Signature: (JZ)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close - (JNIEnv *env, jclass clss, jlong fapl_id, jboolean evict_on_close) -{ - herr_t retVal = -1; - hbool_t evict_on_close_val; - - if (evict_on_close == JNI_TRUE) - evict_on_close_val = TRUE; - else - evict_on_close_val = FALSE; - - retVal = H5Pset_evict_on_close((hid_t)fapl_id, (hbool_t)evict_on_close_val); - if (retVal < 0) - h5libraryError(env); -} /* end Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_evict_on_close - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close - (JNIEnv *env, jclass clss, jlong fapl_id) -{ - hbool_t evict_on_close_val = FALSE; - jboolean bval = JNI_FALSE; - - if (H5Pget_evict_on_close((hid_t)fapl_id, (hbool_t *)&evict_on_close_val) < 0) { - h5libraryError(env); - } /* end if */ - else { - if (evict_on_close_val == TRUE) - bval = JNI_TRUE; - } /* end else */ - - return bval; -} /* end Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_chunk_opts - * Signature: (JI)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts - (JNIEnv *env, jclass clss, jlong dcpl_id, jint opts) -{ - herr_t retVal = -1; - - retVal = H5Pset_chunk_opts((hid_t)dcpl_id, (unsigned)opts); - if (retVal < 0) - h5libraryError(env); -} /* end Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_chunk_opts - * Signature: (J)I - */ -JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts - (JNIEnv *env, jclass clss, jlong dcpl_id) -{ - unsigned opts = 0; - - if (H5Pget_chunk_opts((hid_t)dcpl_id, opts) < 0) - h5libraryError(env); - - return (jint)opts; -} /* end Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts */ - #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index 1d12e3d..d413f69 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -1533,6 +1533,7 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts (JNIEnv *, jclass, jlong); + /* * Class: hdf_hdf5lib_H5 * Method: H5Pset_metadata_read_attempts @@ -1542,78 +1543,6 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts (JNIEnv *, jclass, jlong, jlong); -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_virtual_prefix - * Signature: (JLjava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix -(JNIEnv *, jclass, jlong, jstring); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_virtual_prefix - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix -(JNIEnv *, jclass, jlong); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_efile_prefix - * Signature: (JLjava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix -(JNIEnv *, jclass, jlong, jstring); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_efile_prefix - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix -(JNIEnv *, jclass, jlong); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_evict_on_close - * Signature: (JZ)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close -(JNIEnv *, jclass, jlong, jboolean); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_evict_on_close - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close -(JNIEnv *, jclass, jlong); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_chunk_opts - * Signature: (JI)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts -(JNIEnv *, jclass, jlong, jint); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_chunk_opts - * Signature: (J)I - */ -JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts -(JNIEnv *, jclass, jlong); - #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index 91ea286..ab2f3b1 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -415,7 +415,6 @@ JUnit version 4.11 .testH5PH5Pset_shared_mesg_phase_change_HighMaxlistValue .testH5P_layout .testH5Pget_link_creation_order -.testH5Pget_efile_prefix .testH5Pset_shared_mesg_nindexes_InvalidHIGHnindexes .testH5P_file_space_page_size .testH5Pget_shared_mesg_index_Invalid_indexnum @@ -445,7 +444,6 @@ JUnit version 4.11 .testH5Pset_est_link_info_InvalidValues .testH5Pset_local_heap_size_hint .testH5Pget_est_link_info -.testH5Pset_efile_prefix_null .testH5Pset_scaleoffset .testH5Pset_create_intermediate_group_invalidobject .testH5PH5Pset_shared_mesg_phase_change_HighMinbtreeValue @@ -468,7 +466,6 @@ JUnit version 4.11 .testH5Pget_sym_k_null .testH5Pset_nlinks .testH5P_obj_track_times -.testH5Pset_efile_prefix .testH5P_userblock .testH5Pget_local_heap_size_hint .testH5Pset_shared_mesg_index_Invalid_indexnum @@ -507,7 +504,6 @@ JUnit version 4.11 .testH5Pset_mdc_config .testH5P_small_data_block_size .testH5Pset_fapl_log -.testH5P_evict_on_close .testH5Pset_libver_bounds .testH5P_sieve_buf_size .testH5P_elink_file_cache_size @@ -534,14 +530,11 @@ JUnit version 4.11 .testH5Pget_source_datasetname .testH5Pvirtual_storage .testH5Pget_selection_source_dataset -.testH5Pget_virtual_prefix .testH5Pget_source_filename .testH5Pset_get_virtual_printf_gap .testH5Pget_virtual_count -.testH5Pset_virtual_prefix .testH5Pset_get_virtual_view .testH5Pget_mapping_parameters -.testH5Pset_virtual_prefix_null .testH5P_genprop_basic_class .testH5P_genprop_class_iter .testH5P_genprop_basic_class_prop @@ -647,7 +640,7 @@ JUnit version 4.11 Time: XXXX -OK (645 tests) +OK (638 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/TestH5P.java b/java/test/TestH5P.java index 9e45e4c..5aafb5b 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -28,7 +28,6 @@ import hdf.hdf5lib.exceptions.HDF5LibraryException; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; @@ -853,7 +852,7 @@ public class TestH5P { } catch (Throwable err) { err.printStackTrace(); - fail("H5Pset_elink_prefix: " + err); + fail("H5Pset_est_link_info: " + err); } assertTrue("H5Pset_elink_prefix", ret_val >= 0); } @@ -1233,54 +1232,4 @@ public class TestH5P { fail("testH5P_file_space_page_size: " + err); } } - - @Test - public void testH5Pset_efile_prefix() { - String prefix = "tmp"; - try { - H5.H5Pset_efile_prefix(lapl_id, prefix); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5Pset_efile_prefix: " + err); - } - } - - @Test(expected = NullPointerException.class) - public void testH5Pset_efile_prefix_null() throws Throwable{ - H5.H5Pset_efile_prefix(lapl_id, null); - } - - @Test - public void testH5Pget_efile_prefix() { - String prefix = "tmp"; - String pre = ""; - - try { - H5.H5Pset_efile_prefix(lapl_id, prefix); - pre = H5.H5Pget_efile_prefix(lapl_id); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5Pget_efile_prefix: " + err); - } - assertTrue("The prefix: ", prefix.equals(pre)); - } - - @Ignore - public void testH5P_chunk_opts() { - int chunk_opts = -1; - - try { - chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); - assertTrue("chunk_opts: "+chunk_opts, chunk_opts == 0); - H5.H5Pset_chunk_opts(ocpl_id, HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); - chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); - assertTrue("chunk_opts: "+chunk_opts, chunk_opts == HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5Pget_lchunk_opts: " + err); - } - } } diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index 48a5986..d4a2231 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1376,18 +1376,4 @@ public class TestH5Pfapl { deleteH5file(); _deleteLogFile(); } - - @Test - public void testH5P_evict_on_close() { - boolean ret_val_id = false; - try { - H5.H5Pset_evict_on_close(fapl_id, true); - ret_val_id = H5.H5Pget_evict_on_close(fapl_id); - assertTrue("H5P_evict_on_close", ret_val_id); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5P_evict_on_close: " + err); - } - } } diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index ff2e4dc..40cfbac 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -429,37 +429,4 @@ public class TestH5Pvirtual { try {H5.H5Dclose(H5did);} catch (Exception ex) {} } } - - @Test - public void testH5Pset_virtual_prefix() { - String prefix = "tmp"; - try { - H5.H5Pset_virtual_prefix(H5dapl_id, prefix); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5Pset_virtual_prefix: " + err); - } - } - - @Test(expected = NullPointerException.class) - public void testH5Pset_virtual_prefix_null() throws Throwable{ - H5.H5Pset_virtual_prefix(H5dapl_id, null); - } - - @Test - public void testH5Pget_virtual_prefix() { - String prefix = "tmp"; - String pre = ""; - - try { - H5.H5Pset_virtual_prefix(H5dapl_id, prefix); - pre = H5.H5Pget_virtual_prefix(H5dapl_id); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5Pget_virtual_prefix: " + err); - } - assertTrue("The prefix: ", prefix.equals(pre)); - } } diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index dc4c98e..7498d01 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -58,21 +58,7 @@ New Features Library: -------- - - Add prefix option to VDS files. - - Currently, VDS source files must be in the active directory to be - found by the virtual file. Adding the option of a prefix to be set - on the virtual file, using a data access property list (DAPL), - allows the source files to located at an absolute or relative path - to the virtual file. - - New public APIs: - herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); - ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); - The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. - - (ADB - 2017/12/12, HDFFV-9724) - + - Parallel Library: ----------------- @@ -133,18 +119,6 @@ New Features ------------ - - Java Library: - ---------------- - - Wrappers added for the following APIs: - H5Pset_evict_on_close - H5Pget_evict_on_close - H5Pset_chunk_opts - H5Pget_chunk_opts - H5Pset_efile_prefix - H5Pget_efile_prefix - H5Pset_virtual_prefix - H5Pget_virtual_prefix - Tools: ------ - h5diff @@ -239,7 +213,7 @@ Bug Fixes since HDF5-1.10.1 release CMake implementation for MPI was problematic and would create incorrect MPI library references in the hdf5 libraries. - Reworked the CMake MPI code to properly create CMake targets. Also merged + Reworked the CMake MPI code to properly create CMake targets.Also merged the latest CMake FindMPI.cmake changes to the local copy. This is necessary until HDF changes the CMake minimum to 3.9 or greater. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0552244..b163b8a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -885,7 +885,10 @@ add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HE TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS}) + target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) +endif () +if (H5_HAVE_PARALLEL AND MPI_C_FOUND) + target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) @@ -926,7 +929,10 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) + endif () + if (H5_HAVE_PARALLEL AND MPI_C_FOUND) + target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) 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}) diff --git a/src/H5Dint.c b/src/H5Dint.c index 8b663b8..b6c0341 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -61,8 +61,8 @@ static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); -static herr_t H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char * prefix_type, - char **vds_prefix); +static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, + char **extfile_prefix); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); @@ -963,25 +963,24 @@ done: } /* end H5D__update_oh_info() */ - /*-------------------------------------------------------------------------- - * Function: H5D_build_file_prefix + * Function: H5D_build_extfile_prefix * - * Purpose: Determine the file prefix to be used and store - * it in file_prefix. Stores an empty string if no prefix + * Purpose: Determine the external file prefix to be used and store + * it in extfile_prefix. Stores an empty string if no prefix * should be used. * * Return: SUCCEED/FAIL *-------------------------------------------------------------------------- */ static herr_t -H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, char **file_prefix /*out*/) +H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/) { char *prefix = NULL; /* prefix used to look for the file */ - char *filepath = NULL; /* absolute path of directory the HDF5 file is in */ - size_t filepath_len; /* length of file path */ + char *extpath = NULL; /* absolute path of directory the HDF5 file is in */ + size_t extpath_len; /* length of extpath */ size_t prefix_len; /* length of prefix */ - size_t file_prefix_len; /* length of expanded prefix */ + size_t extfile_prefix_len; /* length of expanded prefix */ H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -991,25 +990,20 @@ H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, HDassert(dset); HDassert(dset->oloc.file); - filepath = H5F_EXTPATH(dset->oloc.file); - HDassert(filepath); + extpath = H5F_EXTPATH(dset->oloc.file); + HDassert(extpath); /* XXX: Future thread-safety note - getenv is not required * to be reentrant. */ - if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) - prefix = HDgetenv("HDF5_VDS_PREFIX"); - else if (HDstrcmp(prefix_type, H5D_ACS_EFILE_PREFIX_NAME) == 0) - prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); - else - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "prefix name is not sensible") + prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); if(prefix == NULL || *prefix == '\0') { - /* Set prefix to value of prefix_type property */ + /* Set prefix to value of H5D_ACS_EFILE_PREFIX_NAME property */ if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_peek(plist, prefix_type, &prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file prefix") + if(H5P_peek(plist, H5D_ACS_EFILE_PREFIX_NAME, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file prefix") } /* end if */ /* Prefix has to be checked for NULL / empty string again because the @@ -1019,29 +1013,29 @@ H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, /* filename is interpreted as relative to the current directory, * does not need to be expanded */ - if(NULL == (*file_prefix = (char *)H5MM_strdup(""))) + if(NULL == (*extfile_prefix = (char *)H5MM_strdup(""))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end if */ else { if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) { /* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */ - filepath_len = HDstrlen(filepath); + extpath_len = HDstrlen(extpath); prefix_len = HDstrlen(prefix); - file_prefix_len = filepath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; + extfile_prefix_len = extpath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; - if(NULL == (*file_prefix = (char *)H5MM_malloc(file_prefix_len))) + if(NULL == (*extfile_prefix = (char *)H5MM_malloc(extfile_prefix_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") - HDsnprintf(*file_prefix, file_prefix_len, "%s%s", filepath, prefix + HDstrlen("${ORIGIN}")); + HDsnprintf(*extfile_prefix, extfile_prefix_len, "%s%s", extpath, prefix + HDstrlen("${ORIGIN}")); } /* end if */ else { - if(NULL == (*file_prefix = (char *)H5MM_strdup(prefix))) + if(NULL == (*extfile_prefix = (char *)H5MM_strdup(prefix))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end else */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_build_file_prefix() */ +} /* H5D_build_extfile_prefix() */ /*------------------------------------------------------------------------- @@ -1223,13 +1217,9 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") /* Set the external file prefix */ - if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &new_dset->shared->extfile_prefix) < 0) + if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") - /* Set the vds file prefix */ - if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &new_dset->shared->vds_prefix) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") - /* Add the dataset to the list of opened objects in the file */ if(H5FO_top_incr(new_dset->oloc.file, new_dset->oloc.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't incr object ref. count") @@ -1275,7 +1265,6 @@ done: if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list") new_dset->shared->extfile_prefix = (char *)H5MM_xfree(new_dset->shared->extfile_prefix); - new_dset->shared->vds_prefix = (char *)H5MM_xfree(new_dset->shared->vds_prefix); new_dset->shared = H5FL_FREE(H5D_shared_t, new_dset->shared); } /* end if */ new_dset->oloc.file = NULL; @@ -1362,7 +1351,6 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) H5D_shared_t *shared_fo = NULL; H5D_t *dataset = NULL; char *extfile_prefix = NULL; /* Expanded external file prefix */ - char *vds_prefix = NULL; /* Expanded vds prefix */ H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1383,13 +1371,9 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path") /* Get the external file prefix */ - if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &extfile_prefix) < 0) + if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") - /* Get the vds prefix */ - if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &vds_prefix) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") - /* Check if dataset was already open */ if(NULL == (shared_fo = (H5D_shared_t *)H5FO_opened(dataset->oloc.file, dataset->oloc.addr))) { /* Clear any errors from H5FO_opened() */ @@ -1415,11 +1399,6 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) /* Prevent string from being freed during done: */ extfile_prefix = NULL; - /* Set the vds file prefix */ - dataset->shared->vds_prefix = vds_prefix; - /* Prevent string from being freed during done: */ - vds_prefix = NULL; - } /* end if */ else { /* Point to shared info */ @@ -1451,14 +1430,12 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) done: extfile_prefix = (char *)H5MM_xfree(extfile_prefix); - vds_prefix = (char *)H5MM_xfree(vds_prefix); if(ret_value == NULL) { /* Free the location--casting away const*/ if(dataset) { if(shared_fo == NULL && dataset->shared) { /* Need to free shared fo */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); - dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); } @@ -1841,9 +1818,6 @@ H5D_close(H5D_t *dataset) /* Free the external file prefix */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); - /* Free the vds file prefix */ - dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); - /* Release layout, fill-value, efl & pipeline messages */ if(dataset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT) free_failed |= (H5O_msg_reset(H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline) < 0) || @@ -3386,10 +3360,6 @@ H5D_get_access_plist(H5D_t *dset) if(H5P_set(new_plist, H5D_ACS_VDS_PRINTF_GAP_NAME, &(dset->shared->layout.storage.u.virt.printf_gap)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS printf gap") - /* Set the vds prefix option */ - if(H5P_set(new_plist, H5D_ACS_VDS_PREFIX_NAME, &(dset->shared->vds_prefix)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds prefix") - /* Set the external file prefix option */ if(H5P_set(new_plist, H5D_ACS_EFILE_PREFIX_NAME, &(dset->shared->extfile_prefix)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set external file prefix") diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 45f2d3a..542abd0 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -476,7 +476,6 @@ typedef struct H5D_shared_t { H5D_append_flush_t append_flush; /* Append flush property information */ char *extfile_prefix; /* expanded external file prefix */ - char *vds_prefix; /* expanded vds prefix */ } H5D_shared_t; struct H5D_t { @@ -599,7 +598,7 @@ H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id); H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id); /* Internal I/O routines */ -H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, +H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index ed13467..fb994d8 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -47,13 +47,12 @@ #define H5D_CRT_EXT_FILE_LIST_NAME "efl" /* External file list */ /* ======== Dataset access property names ======== */ -#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ -#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ -#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ -#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ +#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ +#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ +#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ +#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ #define H5D_ACS_VDS_PRINTF_GAP_NAME "vds_printf_gap" /* VDS printf gap size */ -#define H5D_ACS_VDS_PREFIX_NAME "vds_prefix" /* VDS file prefix */ -#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ +#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ #define H5D_ACS_EFILE_PREFIX_NAME "external file prefix" /* External file prefix */ /* ======== Data transfer properties ======== */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 4882e9f..3be2353 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -731,240 +731,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_delete */ - -/*-------------------------------------------------------------------------- - * Function: H5D__virtual_build_name - * - * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME - * - * Return: Non-negative on success/Negative on failure - *--------------------------------------------------------------------------*/ -static herr_t -H5D__virtual_build_name(char *prefix, char *file_name, char **full_name/*out*/) -{ - size_t prefix_len; /* length of prefix */ - size_t fname_len; /* Length of external link file name */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - prefix_len = HDstrlen(prefix); - fname_len = HDstrlen(file_name); - - /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ - if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") - - /* Compose the full file name */ - HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, - (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__virtual_build_name() */ - - -/*-------------------------------------------------------------------------- - * Function: H5D_getenv_prefix_name -- - * - * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, - * which is separated by the environment delimiter. - * env_prefix is modified to point to the remaining pathnames - * in the list. - * - * Return: A pointer to a pathname ---------------------------------------------------------------------------*/ -static char * -H5D_getenv_prefix_name(char **env_prefix/*in,out*/) -{ - char *retptr=NULL; - char *strret=NULL; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - strret = HDstrchr(*env_prefix, H5_COLON_SEPC); - if (strret == NULL) { - retptr = *env_prefix; - *env_prefix = strret; - } else { - retptr = *env_prefix; - *env_prefix = strret + 1; - *strret = '\0'; - } - - FUNC_LEAVE_NOAPI(retptr) -} /* end H5D_getenv_prefix_name() */ - -/*------------------------------------------------------------------------- - * Function: H5D__virtual_open_file - * - * Purpose: Attempts to open a source dataset file. - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -static H5F_t * -H5D__virtual_open_file(H5P_genplist_t *plist, const H5F_t *vdset_file, - const char *file_name, - hid_t fapl_id, hid_t dxpl_id) -{ - H5F_t *src_file = NULL; /* Source file */ - H5F_t *ret_value = NULL; /* Actual return value */ - char *full_name = NULL; /* File name with prefix */ - char *my_prefix; /* Library's copy of the prefix */ - unsigned intent; /* File access permissions */ - char *actual_file_name = NULL; /* Virtual file's actual name */ - char *temp_file_name = NULL; /* Temporary pointer to file name */ - size_t temp_file_name_len; /* Length of temporary file name */ - - FUNC_ENTER_STATIC - - /* Simplify intent flags for open calls */ - intent = H5F_INTENT(vdset_file); - intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); - - /* Copy the file name to use */ - if(NULL == (temp_file_name = H5MM_strdup(file_name))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - temp_file_name_len = HDstrlen(temp_file_name); - - /* target file_name is an absolute pathname: see RM for detailed description */ - if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { - /* Try opening file */ - if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - char *ptr; - - H5E_clear_stack(NULL); - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(file_name, ptr) - HDassert(ptr); - - /* Increment past delimiter */ - ptr++; - - /* Copy into the temp. file name */ - HDstrncpy(temp_file_name, ptr, temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - else if(H5_CHECK_ABS_DRIVE(file_name)) { - /* Try opening file */ - if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - - H5E_clear_stack(NULL); - - /* strip ":" */ - HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - - /* try searching from paths set in the environment variable */ - if(src_file == NULL) { - char *env_prefix; - - if(NULL != (env_prefix = HDgetenv("HDF5_VDS_PREFIX"))) { - char *tmp_env_prefix, *saved_env; - - if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - while((tmp_env_prefix) && (*tmp_env_prefix)) { - char *out_prefix_name; - - out_prefix_name = H5D_getenv_prefix_name(&tmp_env_prefix/*in,out*/); - if(out_prefix_name && (*out_prefix_name)) { - if(H5D__virtual_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { - saved_env = (char *)H5MM_xfree(saved_env); - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - } /* end if */ - - src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); - full_name = (char *)H5MM_xfree(full_name); - if(src_file != NULL) - break; - H5E_clear_stack(NULL); - } /* end if */ - } /* end while */ - saved_env = (char *)H5MM_xfree(saved_env); - } /* end if */ - } /* end if */ - - /* try searching from property list */ - if(src_file == NULL) { - size_t size = 0; - if((size = H5Pget_virtual_prefix(plist, NULL, 0)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") - /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ - if(NULL == (my_prefix = (char *)H5MM_malloc(size + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate prefix buffer") - if(H5Pget_virtual_prefix(plist, my_prefix, size+1) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") - if(my_prefix) { - if(H5D__virtual_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - } /* end if */ - - /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ - if(src_file == NULL) { - char *vdspath; - - if(NULL != (vdspath = H5F_EXTPATH(vdset_file))) { - if(H5D__virtual_build_name(vdspath, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - } /* end if */ - - /* try the relative file_name stored in temp_file_name */ - if(src_file == NULL) { - if(NULL == (src_file = H5F_open(temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - } /* end if */ - - /* try the 'resolved' name for the virtual file */ - if(src_file == NULL) { - char *ptr = NULL; - - /* Copy resolved file name */ - if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(vdset_file)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string") - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(actual_file_name, ptr) - if(!ptr) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - - /* Truncate filename portion from actual file name path */ - *ptr = '\0'; - - /* Build new file name for the external file */ - if(H5D__virtual_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - - /* Try opening with the resolved name */ - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - - /* Success */ - ret_value = src_file; -done: - if((NULL == ret_value) && src_file) - if(H5F_try_close(src_file, NULL) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, FAIL, "can't close source file") - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__virtual_open_file() */ - /*------------------------------------------------------------------------- * Function: H5D__virtual_open_source_dset @@ -984,13 +750,9 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id) { H5F_t *src_file = NULL; /* Source file */ - char *vds_prefix = NULL; /* Source file vds_prefix */ hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */ H5G_loc_t src_root_loc; /* Object location of source file root group */ herr_t ret_value = SUCCEED; /* Return value */ - char *full_name = NULL; /* File name with prefix */ - unsigned intent; /* File access permissions */ - H5P_genplist_t *plist; /* Property list pointer */ FUNC_ENTER_STATIC @@ -1003,9 +765,8 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { - if((plist = H5D_get_access_plist(vdset)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get access plist") - if(NULL == (src_file = H5D__virtual_open_file(plist, vdset->oloc.file, source_dset->file_name, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + /* Open the source file */ + if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ else src_file_open = TRUE; @@ -1646,7 +1407,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "failed to clip unlimited selection") } /* end if */ - /* Update cached values unlim_extent_source and + /* Update cached values unlim_extent_source and * clip_size_virtual */ storage->list[i].unlim_extent_source = curr_dims[storage->list[i].unlim_dim_source]; storage->list[i].clip_size_virtual = clip_size; @@ -1798,7 +1559,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space") /* Mark the space as dirty, for later writing to the file */ - if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) + if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ @@ -2485,7 +2246,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close projected memory space") storage->list[i].sub_dset[j].projected_mem_space = NULL; } /* end if */ - else + else *tot_nelmts += (hsize_t)select_nelmts; } /* end if */ } /* end for */ @@ -2504,7 +2265,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Check if anything is selected */ if(select_nelmts > (hssize_t)0) { /* Open source dataset */ - if(!storage->list[i].source_dset.dset) + if(!storage->list[i].source_dset.dset) /* Try to open dataset */ if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") @@ -2745,7 +2506,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "unable to clip fill selection") /* Write fill values to memory buffer */ - if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, + if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed") diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 96b8e36..daf0a52 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -25,13 +25,13 @@ typedef struct H5F_t H5F_t; #include "H5Fpublic.h" /* Public headers needed by this file */ -#include "H5FDpublic.h" /* File drivers */ +#include "H5FDpublic.h" /* File drivers */ /* Private headers needed by this file */ #ifdef H5_HAVE_PARALLEL -#include "H5Pprivate.h" /* Property lists */ +#include "H5Pprivate.h" /* Property lists */ #endif /* H5_HAVE_PARALLEL */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /**************************/ @@ -43,68 +43,68 @@ typedef struct H5F_t H5F_t; * Currently, all file meta-data is little-endian. */ -# define INT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define INT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define UINT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define UINT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define INT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ +# define INT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ } -# define UINT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ +# define UINT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ } /* Encode an unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define ENCODE_VAR(p, typ, n, l) { \ - typ _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for(_i = 0; _i < l; _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t*)(p) + l; \ +# define ENCODE_VAR(p, typ, n, l) { \ + typ _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for(_i = 0; _i < l; _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t*)(p) + l; \ } /* Encode a 32-bit unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ # define UINT32ENCODE_VAR(p, n, l) ENCODE_VAR(p, uint32_t, n, l) -# define INT64ENCODE(p, n) { \ - int64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = (n) < 0 ? 0xff : 0; \ - (p) = (uint8_t*)(p)+8; \ +# define INT64ENCODE(p, n) { \ + int64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = (n) < 0 ? 0xff : 0; \ + (p) = (uint8_t*)(p)+8; \ } -# define UINT64ENCODE(p, n) { \ - uint64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = 0; \ - (p) = (uint8_t*)(p) + 8; \ +# define UINT64ENCODE(p, n) { \ + uint64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = 0; \ + (p) = (uint8_t*)(p) + 8; \ } /* Encode a 64-bit unsigned integer into a variable-sized buffer */ @@ -113,31 +113,31 @@ typedef struct H5F_t H5F_t; /* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define UINT64ENCODE_VARLEN(p, n) { \ - uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM_limit_enc_size(__n); \ - \ - *(p)++ = (uint8_t)_s; \ - UINT64ENCODE_VAR(p, __n, _s); \ +# define UINT64ENCODE_VARLEN(p, n) { \ + uint64_t __n = (uint64_t)(n); \ + unsigned _s = H5VM_limit_enc_size(__n); \ + \ + *(p)++ = (uint8_t)_s; \ + UINT64ENCODE_VAR(p, __n, _s); \ } -# define H5_ENCODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32ENCODE(p, n) \ +# define H5_ENCODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32ENCODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_ENCODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - HDmemcpy(&_n, &n, sizeof(double)); \ - for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t *)(p) + 8; \ +# define H5_ENCODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + HDmemcpy(&_n, &n, sizeof(double)); \ + for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t *)(p) + 8; \ } /* DECODE converts little endian bytes pointed by p to integer values and store @@ -148,68 +148,68 @@ typedef struct H5F_t H5F_t; * correctly even if i is actually a 64bit int like in a Cray. */ -# define INT16DECODE(p, i) { \ - (i) = (int16_t)((*(p) & 0xff)); (p)++; \ +# define INT16DECODE(p, i) { \ + (i) = (int16_t)((*(p) & 0xff)); (p)++; \ (i) |= (int16_t)(((*(p) & 0xff) << 8) | \ - ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ + ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ } -# define UINT16DECODE(p, i) { \ - (i) = (uint16_t) (*(p) & 0xff); (p)++; \ - (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ +# define UINT16DECODE(p, i) { \ + (i) = (uint16_t) (*(p) & 0xff); (p)++; \ + (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ } -# define INT32DECODE(p, i) { \ - (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ +# define INT32DECODE(p, i) { \ + (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ (i) |= ((int32_t)(((*(p) & (unsigned)0xff) << 24) | \ ((*(p) & (unsigned)0x80) ? (unsigned)(~0xffffffff) : (unsigned)0x0))); (p)++; \ } -# define UINT32DECODE(p, i) { \ - (i) = (uint32_t)(*(p) & 0xff); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ +# define UINT32DECODE(p, i) { \ + (i) = (uint32_t)(*(p) & 0xff); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ } /* Decode a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define DECODE_VAR(p, n, l) { \ - size_t _i; \ - \ - n = 0; \ - (p) += l; \ - for (_i = 0; _i < l; _i++) \ - n = (n << 8) | *(--p); \ - (p) += l; \ +# define DECODE_VAR(p, n, l) { \ + size_t _i; \ + \ + n = 0; \ + (p) += l; \ + for (_i = 0; _i < l; _i++) \ + n = (n << 8) | *(--p); \ + (p) += l; \ } /* Decode a variable-sized buffer into a 32-bit unsigned integer */ /* (Assumes that the high bits of the integer will be zero) */ # define UINT32DECODE_VAR(p, n, l) DECODE_VAR(p, n, l) -# define INT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(int64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define INT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(int64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } -# define UINT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(uint64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define UINT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(uint64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } /* Decode a variable-sized buffer into a 64-bit unsigned integer */ @@ -218,58 +218,58 @@ typedef struct H5F_t H5F_t; /* Decode a 64-bit unsigned integer and its length from a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define UINT64DECODE_VARLEN(p, n) { \ - unsigned _s = *(p)++; \ - \ - UINT64DECODE_VAR(p, n, _s); \ +# define UINT64DECODE_VARLEN(p, n) { \ + unsigned _s = *(p)++; \ + \ + UINT64DECODE_VAR(p, n, _s); \ } -# define H5_DECODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32DECODE(p, n) \ +# define H5_DECODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32DECODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_DECODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - _n = 0; \ - (p) += 8; \ - for(_u = 0; _u < sizeof(uint64_t); _u++) \ - _n = (_n << 8) | *(--p); \ - HDmemcpy(&(n), &_n, sizeof(double)); \ - (p) += 8; \ +# define H5_DECODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + _n = 0; \ + (p) += 8; \ + for(_u = 0; _u < sizeof(uint64_t); _u++) \ + _n = (_n << 8) | *(--p); \ + HDmemcpy(&(n), &_n, sizeof(double)); \ + (p) += 8; \ } /* Address-related macros */ -#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ - HADDR_UNDEF==(X)+(haddr_t)(Z) || \ - (X)+(haddr_t)(Z)<(X)) -#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) +#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ + HADDR_UNDEF==(X)+(haddr_t)(Z) || \ + (X)+(haddr_t)(Z)<(X)) +#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) /* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making * certain that X is not HADDR_UNDEF and then checking that X equals Y */ -#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ - (X)==(Y)) -#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) -#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<(Y)) -#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<=(Y)) -#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>(Y)) -#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>=(Y)) -#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ - (H5F_addr_lt((X), (Y)) ? -1 : 1)) -#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) +#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ + (X)==(Y)) +#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) +#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<(Y)) +#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<=(Y)) +#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>(Y)) +#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>=(Y)) +#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ + (H5F_addr_lt((X), (Y)) ? -1 : 1)) +#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) #define H5F_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \ ((O1) >= (O2) && (O1) < ((O2) + (L2)))) @@ -294,7 +294,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr) #define H5F_SYM_LEAF_K(F) ((F)->shared->sblock->sym_leaf_k) #define H5F_KVALUE(F,T) ((F)->shared->sblock->btree_k[(T)->id]) -#define H5F_NREFS(F) ((F)->shared->nrefs) +#define H5F_NREFS(F) ((F)->shared->nrefs) #define H5F_SIZEOF_ADDR(F) ((F)->shared->sizeof_addr) #define H5F_SIZEOF_SIZE(F) ((F)->shared->sizeof_size) #define H5F_SOHM_ADDR(F) ((F)->shared->sohm_addr) @@ -325,8 +325,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) ((F)->shared->use_mdc_logging) #define H5F_START_MDC_LOG_ON_ACCESS(F) ((F)->shared->start_mdc_log_on_access) #define H5F_MDC_LOG_LOCATION(F) ((F)->shared->mdc_log_location) -#define H5F_ALIGNMENT(F) ((F)->shared->alignment) -#define H5F_THRESHOLD(F) ((F)->shared->threshold) +#define H5F_ALIGNMENT(F) ((F)->shared->alignment) +#define H5F_THRESHOLD(F) ((F)->shared->threshold) #define H5F_PGEND_META_THRES(F) ((F)->shared->fs.pgend_meta_thres) #define H5F_POINT_OF_NO_RETURN(F) ((F)->shared->fs.point_of_no_return) #define H5F_FIRST_ALLOC_DEALLOC(F) ((F)->shared->first_alloc_dealloc) @@ -351,7 +351,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) (H5F_get_base_addr(F)) #define H5F_SYM_LEAF_K(F) (H5F_sym_leaf_k(F)) #define H5F_KVALUE(F,T) (H5F_Kvalue(F,T)) -#define H5F_NREFS(F) (H5F_get_nrefs(F)) +#define H5F_NREFS(F) (H5F_get_nrefs(F)) #define H5F_SIZEOF_ADDR(F) (H5F_sizeof_addr(F)) #define H5F_SIZEOF_SIZE(F) (H5F_sizeof_size(F)) #define H5F_SOHM_ADDR(F) (H5F_get_sohm_addr(F)) @@ -382,8 +382,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) (H5F_use_mdc_logging(F)) #define H5F_START_MDC_LOG_ON_ACCESS(F) (H5F_start_mdc_log_on_access(F)) #define H5F_MDC_LOG_LOCATION(F) (H5F_mdc_log_location(F)) -#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) -#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) +#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) +#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) #define H5F_PGEND_META_THRES(F) (H5F_get_pgend_meta_thres(F)) #define H5F_POINT_OF_NO_RETURN(F) (H5F_get_point_of_no_return(F)) #define H5F_FIRST_ALLOC_DEALLOC(F) (H5F_get_first_alloc_dealloc(F)) @@ -392,32 +392,32 @@ typedef struct H5F_t H5F_t; /* Macros to encode/decode offset/length's for storing in the file */ -#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ - case 4: UINT32ENCODE(p,o); break; \ - case 8: UINT64ENCODE(p,o); break; \ - case 2: UINT16ENCODE(p,o); break; \ +#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ + case 4: UINT32ENCODE(p,o); break; \ + case 8: UINT64ENCODE(p,o); break; \ + case 2: UINT16ENCODE(p,o); break; \ } -#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ - case 4: UINT32DECODE(p, o); break; \ - case 8: UINT64DECODE(p, o); break; \ - case 2: UINT16DECODE(p, o); break; \ +#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ + case 4: UINT32DECODE(p, o); break; \ + case 8: UINT64DECODE(p, o); break; \ + case 2: UINT16DECODE(p, o); break; \ } -#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32ENCODE(p,l); break; \ - case 8: UINT64ENCODE(p,l); break; \ - case 2: UINT16ENCODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32ENCODE(p,l); break; \ + case 8: UINT64ENCODE(p,l); break; \ + case 2: UINT16ENCODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_ENCODE_LENGTH(f,p,l) H5F_ENCODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) -#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32DECODE(p,l); break; \ - case 8: UINT64DECODE(p,l); break; \ - case 2: UINT16DECODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32DECODE(p,l); break; \ + case 8: UINT64DECODE(p,l); break; \ + case 2: UINT16DECODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_DECODE_LENGTH(f,p,l) H5F_DECODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) @@ -427,13 +427,13 @@ typedef struct H5F_t H5F_t; * with. */ #if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_SIZET2OFFT(X) \ +# define H5F_OVERFLOW_SIZET2OFFT(X) \ ((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(HDoff_t)-1))) #else # define H5F_OVERFLOW_SIZET2OFFT(X) 0 #endif #if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_HSIZET2OFFT(X) \ +# define H5F_OVERFLOW_HSIZET2OFFT(X) \ ((hsize_t)(X) >= (hsize_t)((hsize_t)1 << (8 * sizeof(HDoff_t) - 1))) #else # define H5F_OVERFLOW_HSIZET2OFFT(X) 0 @@ -461,14 +461,14 @@ typedef struct H5F_t H5F_t; #define H5F_CRT_SHMSG_LIST_MAX_NAME "shmsg_list_max" /* Shared message list maximum size */ #define H5F_CRT_SHMSG_BTREE_MIN_NAME "shmsg_btree_min" /* Shared message B-tree minimum size */ #define H5F_CRT_FILE_SPACE_STRATEGY_NAME "file_space_strategy" /* File space handling strategy */ -#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ +#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ #define H5F_CRT_FREE_SPACE_THRESHOLD_NAME "free_space_threshold" /* Free space section threshold */ #define H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME "file_space_page_size" /* File space page size */ /* ========= File Access properties ============ */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ +#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ #define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ @@ -487,7 +487,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ -#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ +#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ @@ -504,7 +504,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME "page_buffer_min_raw_perc" /* the min raw data percentage for the page buffer cache */ /* ======================== File Mount properties ====================*/ -#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ +#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ #ifdef H5_HAVE_PARALLEL @@ -513,20 +513,20 @@ typedef struct H5F_t H5F_t; #endif /* H5_HAVE_PARALLEL */ /* Define the HDF5 file signature */ -#define H5F_SIGNATURE "\211HDF\r\n\032\n" +#define H5F_SIGNATURE "\211HDF\r\n\032\n" #define H5F_SIGNATURE_LEN 8 /* Version #'s of the major components of the file format */ -#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ -#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ -#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ -#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ -#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ +#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ +#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ +#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ +#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ +#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ #define HDF5_SUPERBLOCK_VERSION_V18_LATEST HDF5_SUPERBLOCK_VERSION_2 /* The latest superblock version for v18 */ -#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ -#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ -#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ -#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ +#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ +#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ +#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ +#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ /* B-tree internal 'K' values */ #define HDF5_BTREE_SNODE_IK_DEF 16 @@ -536,54 +536,54 @@ typedef struct H5F_t H5F_t; if it is changed, the code must compensate. -QAK */ -#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ - /* See format specification on version 1 B-trees */ +#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ + /* See format specification on version 1 B-trees */ /* Default file space handling strategy */ -#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR +#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_PERSIST_DEF FALSE +#define H5F_FREE_SPACE_PERSIST_DEF FALSE /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_THRESHOLD_DEF 1 +#define H5F_FREE_SPACE_THRESHOLD_DEF 1 /* For paged aggregation: default file space page size when not set */ -#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096 +#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 +#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 +#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 0 /* Default for threshold for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_DEF 1 +#define H5F_ALIGN_DEF 1 /* Default for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_THRHD_DEF 1 +#define H5F_ALIGN_THRHD_DEF 1 /* Default size for meta data aggregation block (can be set via H5Pset_meta_block_size()) */ -#define H5F_META_BLOCK_SIZE_DEF 2048 +#define H5F_META_BLOCK_SIZE_DEF 2048 /* Default size for small data aggregation block (can be set via H5Pset_small_data_block_size()) */ -#define H5F_SDATA_BLOCK_SIZE_DEF 2048 +#define H5F_SDATA_BLOCK_SIZE_DEF 2048 /* Check for file using paged aggregation */ #define H5F_PAGED_AGGR(F) (F->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE && F->shared->fs_page_size) /* Metadata read attempt values */ -#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ -#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ +#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ +#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ /* Macros to define signatures of all objects in the file */ /* Size of signature information (on disk) */ /* (all on-disk signatures should be this length) */ -#define H5_SIZEOF_MAGIC 4 +#define H5_SIZEOF_MAGIC 4 /* Size of checksum information (on disk) */ /* (all on-disk checksums should be this length) */ -#define H5_SIZEOF_CHKSUM 4 +#define H5_SIZEOF_CHKSUM 4 /* v1 B-tree node signature */ #define H5B_MAGIC "TREE" @@ -704,11 +704,11 @@ typedef enum H5F_fs_state_t { typedef enum H5F_mem_page_t { H5F_MEM_PAGE_DEFAULT = 0, /* Not used */ H5F_MEM_PAGE_SUPER = 1, - H5F_MEM_PAGE_BTREE = 2, - H5F_MEM_PAGE_DRAW = 3, - H5F_MEM_PAGE_GHEAP = 4, - H5F_MEM_PAGE_LHEAP = 5, - H5F_MEM_PAGE_OHDR = 6, + H5F_MEM_PAGE_BTREE = 2, + H5F_MEM_PAGE_DRAW = 3, + H5F_MEM_PAGE_GHEAP = 4, + H5F_MEM_PAGE_LHEAP = 5, + H5F_MEM_PAGE_OHDR = 6, H5F_MEM_PAGE_LARGE_SUPER = 7, H5F_MEM_PAGE_LARGE_BTREE = 8, H5F_MEM_PAGE_LARGE_DRAW = 9, diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 4765d00..61b4183 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -144,7 +144,7 @@ H5F_get_actual_name(const H5F_t *f) * Function: H5F_get_extpath * * Purpose: Retrieve the file's 'extpath' flags - * This is used by H5L_extern_traverse() and H5D_build_file_prefix() to retrieve the main file's location + * This is used by H5L_extern_traverse() and H5D_build_extfile_prefix() to retrieve the main file's location * when searching the target file. * * Return: 'extpath' on success/abort on failure (shouldn't fail) diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index da06297..494de3e 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -71,17 +71,6 @@ #define H5D_ACS_VDS_PRINTF_GAP_DEF (hsize_t)0 #define H5D_ACS_VDS_PRINTF_GAP_ENC H5P__encode_hsize_t #define H5D_ACS_VDS_PRINTF_GAP_DEC H5P__decode_hsize_t -/* Definitions for VDS file prefix */ -#define H5D_ACS_VDS_PREFIX_SIZE sizeof(char *) -#define H5D_ACS_VDS_PREFIX_DEF NULL /*default is no prefix */ -#define H5D_ACS_VDS_PREFIX_SET H5P__dapl_vds_file_pref_set -#define H5D_ACS_VDS_PREFIX_GET H5P__dapl_vds_file_pref_get -#define H5D_ACS_VDS_PREFIX_ENC H5P__dapl_vds_file_pref_enc -#define H5D_ACS_VDS_PREFIX_DEC H5P__dapl_vds_file_pref_dec -#define H5D_ACS_VDS_PREFIX_DEL H5P__dapl_vds_file_pref_del -#define H5D_ACS_VDS_PREFIX_COPY H5P__dapl_vds_file_pref_copy -#define H5D_ACS_VDS_PREFIX_CMP H5P__dapl_vds_file_pref_cmp -#define H5D_ACS_VDS_PREFIX_CLOSE H5P__dapl_vds_file_pref_close /* Definition for append flush */ #define H5D_ACS_APPEND_FLUSH_SIZE sizeof(H5D_append_flush_t) #define H5D_ACS_APPEND_FLUSH_DEF {0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},NULL,NULL} @@ -123,14 +112,6 @@ static herr_t H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value); /* Property list callbacks */ static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dacc_vds_view_dec(const void **pp, void *value); -static herr_t H5P__dapl_vds_file_pref_set(hid_t prop_id, const char* name, size_t size, void* value); -static herr_t H5P__dapl_vds_file_pref_get(hid_t prop_id, const char* name, size_t size, void* value); -static herr_t H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size); -static herr_t H5P__dapl_vds_file_pref_dec(const void **_pp, void *value); -static herr_t H5P__dapl_vds_file_pref_del(hid_t prop_id, const char* name, size_t size, void* value); -static herr_t H5P__dapl_vds_file_pref_copy(const char* name, size_t size, void* value); -static int H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t size); -static herr_t H5P__dapl_vds_file_pref_close(const char* name, size_t size, void* value); /* Property list callbacks */ static herr_t H5P__dapl_efile_pref_set(hid_t prop_id, const char* name, size_t size, void* value); @@ -179,7 +160,6 @@ const H5P_libclass_t H5P_CLS_DACC[1] = {{ /* Property value defaults */ static const H5D_append_flush_t H5D_def_append_flush_g = H5D_ACS_APPEND_FLUSH_DEF; /* Default setting for append flush */ static const char *H5D_def_efile_prefix_g = H5D_ACS_EFILE_PREFIX_DEF; /* Default external file prefix string */ -static const char *H5D_def_vds_prefix_g = H5D_ACS_VDS_PREFIX_DEF; /* Default vds prefix string */ /*------------------------------------------------------------------------- @@ -230,12 +210,6 @@ H5P__dacc_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register property for vds prefix */ - if(H5P_register_real(pclass, H5D_ACS_VDS_PREFIX_NAME, H5D_ACS_VDS_PREFIX_SIZE, &H5D_def_vds_prefix_g, - NULL, H5D_ACS_VDS_PREFIX_SET, H5D_ACS_VDS_PREFIX_GET, H5D_ACS_VDS_PREFIX_ENC, H5D_ACS_VDS_PREFIX_DEC, - H5D_ACS_VDS_PREFIX_DEL, H5D_ACS_VDS_PREFIX_COPY, H5D_ACS_VDS_PREFIX_CMP, H5D_ACS_VDS_PREFIX_CLOSE) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register info for append flush */ /* (Note: this property should not have an encode/decode callback -QAK) */ if(H5P_register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g, @@ -252,254 +226,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dacc_reg_prop() */ - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_set - * - * Purpose: Copies a vds file prefix property when it's set - * for a property list - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, - size_t H5_ATTR_UNUSED size, void *value) -{ - FUNC_ENTER_STATIC_NOERR - - /* Sanity check */ - HDassert(value); - - /* Copy the prefix */ - *(char **)value = H5MM_xstrdup(*(const char **)value); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_set() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_get - * - * Purpose: Copies a vds file prefix property when it's retrieved - * from a property list - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, - size_t H5_ATTR_UNUSED size, void *value) -{ - FUNC_ENTER_STATIC_NOERR - - /* Sanity check */ - HDassert(value); - - /* Copy the prefix */ - *(char **)value = H5MM_xstrdup(*(const char **)value); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_get() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_enc - * - * Purpose: Callback routine which is called whenever the vds file flags - * property in the dataset access property list is - * encoded. - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) -{ - const char *vds_file_pref = *(const char * const *)value; - uint8_t **pp = (uint8_t **)_pp; - size_t len = 0; - uint64_t enc_value; - unsigned enc_size; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - - /* calculate prefix length */ - if(NULL != vds_file_pref) - len = HDstrlen(vds_file_pref); - - enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); - - if(NULL != *pp) { - /* encode the length of the prefix */ - *(*pp)++ = (uint8_t)enc_size; - UINT64ENCODE_VAR(*pp, enc_value, enc_size); - - /* encode the prefix */ - if(NULL != vds_file_pref) { - HDmemcpy(*(char **)pp, vds_file_pref, len); - *pp += len; - } /* end if */ - } /* end if */ - - *size += (1 + enc_size); - if(NULL != vds_file_pref) - *size += len; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_enc() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_dec - * - * Purpose: Callback routine which is called whenever the vds file prefix - * property in the dataset access property list is - * decoded. - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value) -{ - char **vds_file_pref = (char **)_value; - const uint8_t **pp = (const uint8_t **)_pp; - size_t len; - uint64_t enc_value; /* Decoded property value */ - unsigned enc_size; /* Size of encoded property */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(pp); - HDassert(*pp); - HDassert(vds_file_pref); - HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - - /* Decode the size */ - enc_size = *(*pp)++; - HDassert(enc_size < 256); - - /* Decode the value */ - UINT64DECODE_VAR(*pp, enc_value, enc_size); - len = (size_t)enc_value; - - if(0 != len) { - /* Make a copy of the user's prefix string */ - if(NULL == (*vds_file_pref = (char *)H5MM_malloc(len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "memory allocation failed for prefix") - HDstrncpy(*vds_file_pref, *(const char **)pp, len); - (*vds_file_pref)[len] = '\0'; - - *pp += len; - } /* end if */ - else - *vds_file_pref = NULL; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__dapl_vds_file_pref_dec() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_del - * - * Purpose: Frees memory used to store the vds file prefix string - * - * Return: SUCCEED (Can't fail) - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, - size_t H5_ATTR_UNUSED size, void *value) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(value); - - H5MM_xfree(*(void **)value); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_del() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_copy - * - * Purpose: Creates a copy of the vds file prefix string - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(value); - - *(char **)value = H5MM_xstrdup(*(const char **)value); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_copy() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_cmp - * - * Purpose: Callback routine which is called whenever the vds file prefix - * property in the dataset creation property list is - * compared. - * - * Return: zero if VALUE1 and VALUE2 are equal, non zero otherwise. - *------------------------------------------------------------------------- - */ -static int -H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) -{ - const char *pref1 = *(const char * const *)value1; - const char *pref2 = *(const char * const *)value2; - int ret_value = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if(NULL == pref1 && NULL != pref2) - HGOTO_DONE(1); - if(NULL != pref1 && NULL == pref2) - HGOTO_DONE(-1); - if(NULL != pref1 && NULL != pref2) - ret_value = HDstrcmp(pref1, pref2); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__dapl_vds_file_pref_cmp() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_close - * - * Purpose: Frees memory used to store the vds file prefix string - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(value); - - H5MM_xfree(*(void **)value); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_close() */ - /*------------------------------------------------------------------------- * Function: H5P__dapl_efile_pref_set @@ -1494,95 +1220,3 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_efile_prefix() */ - -/*------------------------------------------------------------------------- - * Function: H5Pset_virtual_prefix - * - * Purpose: Set a prefix to be applied to the path of any vds files - * traversed. - * - * If the prefix starts with ${ORIGIN}, this will be replaced by - * the absolute path of the directory of the HDF5 file containing - * the dataset. - * - * If the prefix is ".", no prefix will be applied. - * - * This property can be overwritten by the environment variable - * HDF5_VDS_PREFIX. - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -herr_t -H5Pset_virtual_prefix(hid_t plist_id, const char *prefix) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*s", plist_id, prefix); - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - - /* Set prefix */ - if(H5P_set(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set prefix info") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pset_virtual_prefix() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pget_virtual_prefix - * - * Purpose: Gets the prefix to be applied to any vds file - * traversals made using this property list. - * - * If the pointer is not NULL, it points to a user-allocated - * buffer. - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -ssize_t -H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size) -{ - H5P_genplist_t *plist; /* Property list pointer */ - char *my_prefix; /* Library's copy of the prefix */ - size_t len; /* Length of prefix string */ - ssize_t ret_value; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE3("Zs", "i*sz", plist_id, prefix, size); - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - - /* Get the current prefix */ - if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &my_prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file prefix") - - /* Check for prefix being set */ - if(my_prefix) { - /* Copy to user's buffer, if given */ - len = HDstrlen(my_prefix); - if(prefix) { - HDstrncpy(prefix, my_prefix, MIN(len + 1, size)); - if(len >= size) - prefix[size - 1] = '\0'; - } /* end if */ - } /* end if */ - else - len = 0; - - /* Set return value */ - ret_value = (ssize_t)len; - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pget_virtual_prefix() */ - diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index ea9bfb4..915aa38 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -13,9 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Pfapl.c + * Created: H5Pfapl.c * - * Purpose: File access property list class routines + * Purpose: File access property list class routines * *------------------------------------------------------------------------- */ @@ -41,7 +41,7 @@ #include "H5Ppkg.h" /* Property lists */ /* Includes needed to set as default file driver */ -#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ +#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ #include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS #include "H5FDwindows.h" /* Win32 I/O */ @@ -54,10 +54,10 @@ /* ========= File Access properties ============ */ /* Definitions for the initial metadata cache resize configuration */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG -#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec +#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG +#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec #define H5F_ACS_META_CACHE_INIT_CONFIG_CMP H5P__facc_cache_config_cmp /* Definitions for size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE sizeof(size_t) @@ -118,10 +118,10 @@ #define H5F_ACS_FILE_DRV_CMP H5P__facc_file_driver_cmp #define H5F_ACS_FILE_DRV_CLOSE H5P__facc_file_driver_close /* Definition for file close degree */ -#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) -#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT -#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc -#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec +#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) +#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT +#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc +#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec /* Definition for offset position in file for family file driver */ #define H5F_ACS_FAMILY_OFFSET_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_OFFSET_DEF 0 @@ -175,12 +175,12 @@ #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC H5P__encode_size_t #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC H5P__decode_size_t /* Definition for # of metadata read attempts */ -#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 -#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 +#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned /* Definition for object flush callback */ -#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) +#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) #define H5F_ACS_OBJECT_FLUSH_CB_DEF {NULL, NULL} /* Definition for status_flags in the superblock */ #define H5F_ACS_CLEAR_STATUS_FLAGS_SIZE sizeof(hbool_t) @@ -309,21 +309,21 @@ static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value); /* File access property list class library initialization object */ const H5P_libclass_t H5P_CLS_FACC[1] = {{ - "file access", /* Class name for debugging */ + "file access", /* Class name for debugging */ H5P_TYPE_FILE_ACCESS, /* Class type */ - &H5P_CLS_ROOT_g, /* Parent class */ - &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ - &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ - &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ - H5P__facc_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 */ + &H5P_CLS_ROOT_g, /* Parent class */ + &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ + &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ + &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ + H5P__facc_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 */ }}; @@ -395,149 +395,149 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the initial metadata cache resize configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, - NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, + NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache (elements) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache(bytes) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the preemption for reading chunks */ - if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, - NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, + if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, + NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the threshold for alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum metadata allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, - NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, + NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the maximum sieve buffer size */ - if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, - NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, + NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum "small data" allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, - NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, + NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the garbage collection reference */ - if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, - NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, + if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, + NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file driver ID & info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, + if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, H5F_ACS_FILE_DRV_CRT, H5F_ACS_FILE_DRV_SET, H5F_ACS_FILE_DRV_GET, NULL, NULL, H5F_ACS_FILE_DRV_DEL, H5F_ACS_FILE_DRV_COPY, H5F_ACS_FILE_DRV_CMP, H5F_ACS_FILE_DRV_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file close degree */ - if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, - NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, + NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the offset of family driver info */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, - NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, + NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of new family file size. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, 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 private property of whether convert family to sec2 driver. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, 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 data type of multi driver info */ - if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, - NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, + if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, + NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'use the latest version of the format' flag */ - if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, - NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, + if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, + NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether to retrieve the file descriptor from the core VFD */ /* (used internally to the library only) */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, + if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, 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 external file cache size */ - if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, - NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, + NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the initial file image info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, + if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, NULL, H5F_ACS_FILE_IMAGE_INFO_SET, H5F_ACS_FILE_IMAGE_INFO_GET, NULL, NULL, H5F_ACS_FILE_IMAGE_INFO_DEL, H5F_ACS_FILE_IMAGE_INFO_COPY, H5F_ACS_FILE_IMAGE_INFO_CMP, H5F_ACS_FILE_IMAGE_INFO_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the core VFD backing store write tracking flag */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the core VFD backing store page size */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the # of read attempts */ - if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, - NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, + NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register object flush callback */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, + if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -563,44 +563,44 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the evict on close flag */ - if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, - NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, + NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL /* Register the metadata collective read flag */ - if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, + if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the metadata collective write flag */ - if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) 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, + 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") /* Register the size of the page buffer size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum metadata size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum raw data size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -610,33 +610,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_alignment + * Function: H5Pset_alignment * - * Purpose: Sets the alignment properties of a file access property list - * so that any file object >= THRESHOLD bytes will be aligned on - * an address which is a multiple of ALIGNMENT. The addresses - * are relative to the end of the user block; the alignment is - * calculated by subtracting the user block size from the - * absolute file address and then adjusting the address to be a - * multiple of ALIGNMENT. + * Purpose: Sets the alignment properties of a file access property list + * so that any file object >= THRESHOLD bytes will be aligned on + * an address which is a multiple of ALIGNMENT. The addresses + * are relative to the end of the user block; the alignment is + * calculated by subtracting the user block size from the + * absolute file address and then adjusting the address to be a + * multiple of ALIGNMENT. * - * Default values for THRESHOLD and ALIGNMENT are one, implying - * no alignment. Generally the default values will result in - * the best performance for single-process access to the file. - * For MPI-IO and other parallel systems, choose an alignment - * which is a multiple of the disk block size. + * Default values for THRESHOLD and ALIGNMENT are one, implying + * no alignment. Generally the default values will result in + * the best performance for single-process access to the file. + * For MPI-IO and other parallel systems, choose an alignment + * which is a multiple of the disk block size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed file access property list mechanism to the new - * generic property list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed file access property list mechanism to the new + * generic property list. *------------------------------------------------------------------------- */ herr_t @@ -668,15 +668,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_alignment + * Function: H5Pget_alignment * - * Purpose: Returns the current settings for alignment properties from a - * file access property list. The THRESHOLD and/or ALIGNMENT - * pointers may be null pointers. + * Purpose: Returns the current settings for alignment properties from a + * file access property list. The THRESHOLD and/or ALIGNMENT + * pointers may be null pointers. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * *------------------------------------------------------------------------- @@ -709,20 +709,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_set_driver + * Function: H5P_set_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -757,20 +757,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_driver + * Function: H5Pset_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -800,20 +800,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver + * Function: H5P_peek_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Return: Success: 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. + * Return: Success: 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. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -844,22 +844,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver + * Function: H5Pget_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Note: The ID returned should not be closed. + * Note: The ID returned should not be closed. * - * Return: Success: 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. + * Return: Success: 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. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -867,7 +867,7 @@ hid_t H5Pget_driver(hid_t plist_id) { H5P_genplist_t *plist; /* Property list pointer */ - hid_t ret_value; /* Return value */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", plist_id); @@ -885,20 +885,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver_info + * Function: H5P_peek_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -927,20 +927,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver_info + * Function: H5Pget_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -973,7 +973,7 @@ done: * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -1486,30 +1486,30 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_cache + * Function: H5Pset_cache * - * Purpose: Set the number of objects in the meta data cache and the - * maximum number of chunks and bytes in the raw data chunk - * cache. + * Purpose: Set the number of objects in the meta data cache and the + * maximum number of chunks and bytes in the raw data chunk + * cache. * - * The RDCC_W0 value should be between 0 and 1 inclusive and - * indicates how much chunks that have been fully read or fully - * written are favored for preemption. A value of zero means - * fully read or written 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. + * The RDCC_W0 value should be between 0 and 1 inclusive and + * indicates how much chunks that have been fully read or fully + * written are favored for preemption. A value of zero means + * fully read or written 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. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, - size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) + size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1540,24 +1540,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_cache + * Function: H5Pget_cache * - * Purpose: Retrieves the maximum possible number of elements in the meta - * data cache and the maximum possible number of elements and - * bytes and the RDCC_W0 value in the raw data chunk cache. Any - * (or all) arguments may be null pointers in which case the - * corresponding datum is not returned. + * Purpose: Retrieves the maximum possible number of elements in the meta + * data cache and the maximum possible number of elements and + * bytes and the RDCC_W0 value in the raw data chunk cache. Any + * (or all) arguments may be null pointers in which case the + * corresponding datum is not returned. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pget_cache(hid_t plist_id, int *mdc_nelmts, - size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) + size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1592,14 +1592,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_image_config + * Function: H5Pset_mdc_image_config * - * Purpose: Set the initial metadata cache image configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache image configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, June 25, 2015 * *------------------------------------------------------------------------- @@ -1636,18 +1636,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_image_config + * Function: H5Pget_mdc_image_config * - * Purpose: Retrieve the metadata cache initial image configuration - * from the target FAPL. + * 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. + * 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 + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Friday, June 26, 2015 * *------------------------------------------------------------------------- @@ -1687,14 +1687,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_config + * Function: H5Pset_mdc_config * - * Purpose: Set the initial metadata cache resize configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache resize configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1731,18 +1731,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_config + * Function: H5Pget_mdc_config * - * Purpose: Retrieve the metadata cache initial resize configuration - * from the target FAPL. + * Purpose: Retrieve the metadata cache initial resize 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_config_t. + * Observe that the function will fail if config_ptr is + * NULL, or if config_ptr->version specifies an unknown + * version of H5AC_cache_config_t. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1782,33 +1782,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_gc_references + * Function: H5Pset_gc_references * - * Purpose: Sets the flag for garbage collecting references for the file. - * Dataset region references (and other reference types - * probably) use space in the file heap. If garbage collection - * is on and the user passes in an uninitialized value in a - * reference structure, the heap might get corrupted. When - * garbage collection is off however and the user re-uses a - * reference, the previous heap block will be orphaned and not - * returned to the free heap space. When garbage collection is - * on, the user must initialize the reference structures to 0 or - * risk heap corruption. + * Purpose: Sets the flag for garbage collecting references for the file. + * Dataset region references (and other reference types + * probably) use space in the file heap. If garbage collection + * is on and the user passes in an uninitialized value in a + * reference structure, the heap might get corrupted. When + * garbage collection is off however and the user re-uses a + * reference, the previous heap block will be orphaned and not + * returned to the free heap space. When garbage collection is + * on, the user must initialize the reference structures to 0 or + * risk heap corruption. * - * Default value for garbage collecting references is off, just - * to be on the safe side. + * Default value for garbage collecting references is off, just + * to be on the safe side. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * June, 1999 + * Programmer: Quincey Koziol + * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1835,22 +1835,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_gc_references + * Function: H5Pget_gc_references * - * Purpose: Returns the current setting for the garbage collection - * references property from a file access property list. + * Purpose: Returns the current setting for the garbage collection + * references property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1949,31 +1949,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_meta_block_size + * Function: H5Pset_meta_block_size * - * Purpose: Sets the minimum size of metadata block allocations when + * Purpose: Sets the minimum size of metadata block allocations when * the H5FD_FEAT_AGGREGATE_METADATA is set by a VFL driver. * Each "raw" metadata block is allocated to be this size and then * specific pieces of metadata (object headers, local heaps, B-trees, etc) * are sub-allocated from this block. * - * The default value is set to 2048 (bytes), indicating that metadata + * The default value is set to 2048 (bytes), indicating that metadata * will be attempted to be bunched together in (at least) 2K blocks in * the file. Setting the value to 0 with this API function will * turn off the metadata aggregation, even if the VFL driver attempts to * use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 25, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2000,22 +2000,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_meta_block_size + * Function: H5Pget_meta_block_size * - * Purpose: Returns the current settings for the metadata block allocation + * Purpose: Returns the current settings for the metadata block allocation * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 29, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2044,31 +2044,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_sieve_buf_size + * Function: H5Pset_sieve_buf_size * - * Purpose: Sets the maximum size of the data seive buffer used for file + * Purpose: Sets the maximum size of the data seive buffer used for file * drivers which are capable of using data sieving. The data sieve * buffer is used when performing I/O on datasets in the file. Using a * buffer which is large anough to hold several pieces of the dataset * being read in for hyperslab selections boosts performance by quite a * bit. * - * The default value is set to 64KB, indicating that file I/O for raw data + * The default value is set to 64KB, indicating that file I/O for raw data * reads and writes will occur in at least 64KB blocks. * Setting the value to 0 with this API function will turn off the * data sieving, even if the VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2095,22 +2095,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_sieve_buf_size + * Function: H5Pget_sieve_buf_size * - * Purpose: Returns the current settings for the data sieve buffer size + * Purpose: Returns the current settings for the data sieve buffer size * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2138,23 +2138,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_small_data_block_size + * Function: H5Pset_small_data_block_size * - * Purpose: Sets the minimum size of "small" raw data block allocations + * Purpose: Sets the minimum size of "small" raw data block allocations * when the H5FD_FEAT_AGGREGATE_SMALLDATA is set by a VFL driver. * Each "small" raw data block is allocated to be this size and then * pieces of raw data which are small enough to fit are sub-allocated from * this block. * - * The default value is set to 2048 (bytes), indicating that raw data + * The default value is set to 2048 (bytes), indicating that raw data * smaller than this value will be attempted to be bunched together in (at * least) 2K blocks in the file. Setting the value to 0 with this API * function will turn off the "small" raw data aggregation, even if the * VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * * Modifications: @@ -2184,14 +2184,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_small_data_block_size + * Function: H5Pget_small_data_block_size * - * Purpose: Returns the current settings for the "small" raw data block + * Purpose: Returns the current settings for the "small" raw data block * allocation property from a file access 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, June 5, 2002 * * Modifications: @@ -2223,9 +2223,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_libver_bounds + * Function: H5Pset_libver_bounds * - * Purpose: Indicates which versions of the file format the library should + * Purpose: Indicates which versions of the file format the library should * use when creating objects. LOW is the earliest version of the HDF5 * library that is guaranteed to be able to access the objects created * (the format of some objects in an HDF5 file may not have changed between @@ -2301,9 +2301,9 @@ done: * releases and then map down to the previous actual library release which * had a format change. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, December 30, 2007 * *------------------------------------------------------------------------- @@ -2341,14 +2341,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_libver_bounds + * Function: H5Pget_libver_bounds * - * Purpose: Returns the current settings for the library version format bounds + * Purpose: Returns the current settings for the library version format bounds * from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 3, 2008 * *------------------------------------------------------------------------- @@ -2464,9 +2464,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_file_image * - * Purpose: Sets the initial file image. Some file drivers can initialize - * the starting data in a file from a buffer. - * + * Purpose: Sets the initial file image. Some file drivers can initialize + * the starting data in a file from a buffer. + * * Return: Non-negative on success/Negative on failure * * Programmer: Jacob Gruber @@ -2480,22 +2480,22 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) H5P_genplist_t *fapl; /* Property list pointer */ H5FD_file_image_info_t image_info; /* File image info */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*xz", fapl_id, buf_ptr, buf_len); /* validate parameters */ if(!(((buf_ptr == NULL) && (buf_len == 0)) || ((buf_ptr != NULL) && (buf_len > 0)))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistant buf_ptr and buf_len") - + /* Get the plist structure */ if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - + /* Get old image info */ if(H5P_peek(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image pointer") - + /* Release previous buffer, if it exists */ if(image_info.buffer != NULL) { if(image_info.callbacks.image_free) { @@ -2504,8 +2504,8 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) } /* end if */ else H5MM_xfree(image_info.buffer); - } /* end if */ - + } /* end if */ + /* Update struct */ if(buf_ptr) { /* Allocate memory */ @@ -2517,15 +2517,15 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) else if(NULL == (image_info.buffer = H5MM_malloc(buf_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { - if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, - buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, + buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata)) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(image_info.buffer, buf_ptr, buf_len); } /* end if */ else @@ -2545,24 +2545,24 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_file_image * - * Purpose: If the file image exists and buf_ptr_ptr is not NULL, - * allocate a buffer of the correct size, copy the image into - * the new buffer, and return the buffer to the caller in - * *buf_ptr_ptr. Do this using the file image callbacks - * if defined. + * Purpose: If the file image exists and buf_ptr_ptr is not NULL, + * allocate a buffer of the correct size, copy the image into + * the new buffer, and return the buffer to the caller in + * *buf_ptr_ptr. Do this using the file image callbacks + * if defined. * - * NB: It is the responsibility of the caller to free the - * buffer whose address is returned in *buf_ptr_ptr. Do - * this using free if the file image callbacks are not - * defined, or with whatever method is appropriate if - * the callbacks are defined. + * NB: It is the responsibility of the caller to free the + * buffer whose address is returned in *buf_ptr_ptr. Do + * this using free if the file image callbacks are not + * defined, or with whatever method is appropriate if + * the callbacks are defined. * - * If buf_ptr_ptr is not NULL, and no image exists, set - * *buf_ptr_ptr to NULL. + * If buf_ptr_ptr is not NULL, and no image exists, set + * *buf_ptr_ptr to NULL. * - * If buf_len_ptr is not NULL, set *buf_len_ptr equal - * to the length of the file image if it exists, and - * to 0 if it does not. + * If buf_len_ptr is not NULL, set *buf_len_ptr equal + * to the length of the file image if it exists, and + * to 0 if it does not. * * Return: Non-negative on success/Negative on failure * @@ -2590,7 +2590,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || + HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || ((image_info.buffer == NULL) && (image_info.size == 0))); /* Set output size */ @@ -2611,15 +2611,15 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) else if(NULL == (copy_ptr = H5MM_malloc(image_info.size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate copy") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { if(copy_ptr != image_info.callbacks.image_memcpy(copy_ptr, image_info.buffer, - image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, + image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, image_info.callbacks.udata)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(copy_ptr, image_info.buffer, image_info.size); } /* end if */ @@ -2636,7 +2636,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * and memcpys or to perform detailed logging. * @@ -2666,7 +2666,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* Make sure a file image hasn't already been set */ @@ -2675,7 +2675,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Make sure udata callbacks are going to be set if udata is going to be set */ if(callbacks_ptr->udata) @@ -2686,7 +2686,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback if(info.callbacks.udata != NULL) { HDassert(info.callbacks.udata_free); if(info.callbacks.udata_free(info.callbacks.udata) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") } /* end if */ /* Update struct */ @@ -2713,7 +2713,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * * Return: Non-negative on success/Negative on failure @@ -2742,12 +2742,12 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Transfer values to parameters */ *callbacks_ptr = info.callbacks; @@ -2768,12 +2768,12 @@ done: * Function: H5P__file_image_info_copy * * Purpose: Copy file image info. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -2796,7 +2796,7 @@ H5P__file_image_info_copy(void *value) info = (H5FD_file_image_info_t *)value; /* verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); if(info->buffer && info->size > 0) { @@ -2815,14 +2815,14 @@ H5P__file_image_info_copy(void *value) if(NULL == (info->buffer = H5MM_malloc(info->size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory block") } /* end else */ - + /* Copy data to new buffer */ if(info->callbacks.image_memcpy) { - if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, - info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, + info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(info->buffer, old_buffer, info->size); } /* end if */ @@ -2846,8 +2846,8 @@ done: * Function: H5P__file_image_info_free * * Purpose: Free file image info. The buffer and udata may need to be - * freed, possibly using their respective callbacks, so the - * default free won't work. + * freed, possibly using their respective callbacks, so the + * default free won't work. * * Return: Success: Non-negative * Failure: Negative @@ -2868,16 +2868,16 @@ H5P__file_image_info_free(void *value) H5FD_file_image_info_t *info; /* Image info struct */ info = (H5FD_file_image_info_t *)value; - + /* Verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); /* Free buffer */ - if(info->buffer != NULL && info->size > 0) { + if(info->buffer != NULL && info->size > 0) { if(info->callbacks.image_free) { if((*info->callbacks.image_free)(info->buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, info->callbacks.udata) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") + HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") } /* end if */ else H5MM_xfree(info->buffer); @@ -2903,7 +2903,7 @@ done: * 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. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: John Mainzer * June 26, 2015 @@ -2944,11 +2944,11 @@ done: * 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. + * cache image config property in the file creation + * property list is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -2990,11 +2990,11 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) * 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. + * cache image config property in the file creation property + * list is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -3109,7 +3109,7 @@ done: * * Purpose: Delete callback for the file image info property, called * when the property is deleted from the plist. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the default free won't work. * * Return: Non-negative on success/Negative on failure @@ -3139,7 +3139,7 @@ done: * Function: H5P__facc_file_image_info_copy * * Purpose: Copy callback for the file image info property. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Return: Non-negative on success/Negative on failure @@ -3228,7 +3228,7 @@ done: * Function: H5P__facc_file_image_info_close * * Purpose: Close callback for the file image info property. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the standard free won't work. * * Return: Non-negative on success/Negative on failure @@ -3260,7 +3260,7 @@ done: * Purpose: Compare two cache configurations. * * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is - * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: Mohamad Chaarawi * September 24, 2012 @@ -3373,8 +3373,8 @@ done: * cache config property in the file creation property list is * encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3518,8 +3518,8 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) * cache config property in the file creation property list is * decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3653,8 +3653,8 @@ done: * degree property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3691,8 +3691,8 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) * degree property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3726,8 +3726,8 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) * memory type property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3764,8 +3764,8 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size) * memory type property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3793,12 +3793,12 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_core_write_tracking + * Function: H5Pset_core_write_tracking * - * Purpose: Enables/disables core VFD write tracking and page + * Purpose: Enables/disables core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3834,12 +3834,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_core_write_tracking + * Function: H5Pget_core_write_tracking * - * Purpose: Gets information about core VFD write tracking and page + * Purpose: Gets information about core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3876,19 +3876,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_metadata_read_attempts - * - * Purpose: Sets the # of read attempts in the file access property list - * when reading metadata with checksum. - * The # of read attempts set via this routine will only apply - * when opening a file with SWMR access. - * The # of read attempts set via this routine does not have - * any effect when opening a file with non-SWMR access; for this - * case, the # of read attempts will be always be 1. + * Function: H5Pset_metadata_read_attempts * - * Return: Non-negative on success/Negative on failure + * Purpose: Sets the # of read attempts in the file access property list + * when reading metadata with checksum. + * The # of read attempts set via this routine will only apply + * when opening a file with SWMR access. + * The # of read attempts set via this routine does not have + * any effect when opening a file with non-SWMR access; for this + * case, the # of read attempts will be always be 1. + * + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -3919,13 +3919,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_metadata_read_attempts + * Function: H5Pget_metadata_read_attempts * - * Purpose: Returns the # of metadata read attempts set in the file access property list. + * Purpose: Returns the # of metadata read attempts set in the file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -3945,13 +3945,13 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/) if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Get the # of read attempts set */ + /* Get the # of read attempts set */ if(H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get the number of metadata read attempts") - /* If not set, return the default value */ - if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ - *attempts = H5F_METADATA_READ_ATTEMPTS; + /* If not set, return the default value */ + if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ + *attempts = H5F_METADATA_READ_ATTEMPTS; } /* end if */ done: @@ -3960,14 +3960,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_obj_flush_cb + * Function: H5Pset_obj_flush_cb * - * Purpose: Sets the callback function to invoke and the user data when an - * object flush occurs in the file. + * Purpose: Sets the callback function to invoke and the user data when an + * object flush occurs in the file. + * + * Return: Non-negative on success/Negative on failure * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi; Dec 2013 + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4004,14 +4004,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_obj_flush_cb - * - * Purpose: Retrieves the callback function and user data set in the - * property list for an object flush. + * Function: H5Pget_obj_flush_cb * - * Return: Non-negative on success/Negative on failure + * Purpose: Retrieves the callback function and user data set in the + * property list for an object flush. + * + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Dec 2013 + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4035,9 +4035,9 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata) /* Assign return value */ if(func) - *func = flush_info.func; + *func = flush_info.func; if(udata) - *udata = flush_info.udata; + *udata = flush_info.udata; done: FUNC_LEAVE_API(ret_value) @@ -4045,11 +4045,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_log_options + * Function: H5Pset_mdc_log_options * - * Purpose: Set metadata cache log options. + * Purpose: Set metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4097,11 +4097,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_log_options + * Function: H5Pget_mdc_log_options * - * Purpose: Get metadata cache log options. + * Purpose: Get metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4455,8 +4455,8 @@ done: * * Purpose: Generic encoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4493,8 +4493,8 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) * * Purpose: Generic decoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4523,22 +4523,22 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_all_coll_metadata_ops + * Function: H5Pset_all_coll_metadata_ops * - * Purpose: Tell the library whether the metadata read operations will - * be done collectively (1) or not (0). Default is independent. - * With collective mode, the library will optimize access to - * metadata operations on the file. + * Purpose: Tell the library whether the metadata read operations will + * be done collectively (1) or not (0). Default is independent. + * With collective mode, the library will optimize access to + * metadata operations on the file. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4582,19 +4582,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_all_coll_metadata_ops + * Function: H5Pget_all_coll_metadata_ops * - * Purpose: Gets information about collective metadata read mode. + * Purpose: Gets information about collective metadata read mode. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4640,14 +4640,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_coll_metadata_write + * Function: H5Pset_coll_metadata_write * - * Purpose: Tell the library whether the metadata write operations will - * be done collectively (1) or not (0). Default is collective. + * Purpose: Tell the library whether the metadata write operations will + * be done collectively (1) or not (0). Default is collective. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4679,13 +4679,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_coll_metadata_write + * Function: H5Pget_coll_metadata_write * - * Purpose: Gets information about collective metadata write mode. + * Purpose: Gets information about collective metadata write mode. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4717,15 +4717,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_page_buffer_size + * Function: H5Pset_page_buffer_size * * Purpose: Set the maximum page buffering size. This has to be a * multiple of the page allocation size which must be enabled; * otherwise file create/open will fail. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- @@ -4765,13 +4765,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_page_buffer_size + * Function: H5Pget_page_buffer_size * - * Purpose: Retrieves the maximum page buffer size. + * Purpose: Retrieves the maximum page buffer size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index a2c0418..493a322 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -420,8 +420,6 @@ H5_DLL herr_t H5Pset_virtual_view(hid_t plist_id, H5D_vds_view_t view); H5_DLL herr_t H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view); H5_DLL herr_t H5Pset_virtual_printf_gap(hid_t plist_id, hsize_t gap_size); H5_DLL herr_t H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size); -H5_DLL herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); -H5_DLL ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); H5_DLL herr_t H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t boundary[], H5D_append_cb_t func, void *udata); H5_DLL herr_t H5Pget_append_flush(hid_t plist_id, unsigned dims, diff --git a/src/H5system.c b/src/H5system.c index 719b7e0..a8726c2 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1043,7 +1043,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/) * Unix: does not apply */ if(H5_CHECK_ABS_DRIVE(name)) { - drive = HDtoupper(name[0]) - 'A' + 1; + drive = name[0] - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrncpy(new_name, &name[2], name_len); } /* end if */ diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index fca2f27..973d389 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -452,6 +452,7 @@ set (test_CLEANFILES extlinks19B00026.h5 extlinks19B00027.h5 extlinks19B00028.h5 + tmp big.data big*.h5 stdio.h5 @@ -581,7 +582,6 @@ set (test_CLEANFILES cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 - tmp/vds_src_2.h5 ) # Remove any output file left over from previous test run @@ -839,28 +839,21 @@ add_test (NAME H5TEST-clear-error_test-objects WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -if (HDF5_USE_16_API_DEFAULT) - add_test ( - NAME H5TEST-error_test-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" - ) -else () - add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5TEST-error_test PROPERTIES - DEPENDS H5TEST-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST - ) -endif () +add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" +) +set_tests_properties (H5TEST-error_test PROPERTIES + DEPENDS H5TEST-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST +) #-- Adding test for links_env add_test (NAME H5TEST-clear-links_env-objects @@ -966,28 +959,21 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - if (HDF5_USE_16_API_DEFAULT) - add_test ( - NAME H5TEST-shared-error_test-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" - ) - else () - add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5TEST-shared-error_test PROPERTIES - DEPENDS H5TEST-shared-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared - ) - endif () + add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-shared-error_test PROPERTIES + DEPENDS H5TEST-shared-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) #-- Adding test for links_env add_test (NAME H5TEST-shared-clear-links_env-objects diff --git a/test/vds.c b/test/vds.c index eca26bc..c9b7a1b 100644 --- a/test/vds.c +++ b/test/vds.c @@ -36,12 +36,6 @@ const char *FILENAME[] = { "vds_src_1", "vds%%_src", "vds_dapl", - "vds_virt_2", - "vds_virt_3", - "vds_src_2", - "vds_src_3", - "vds%%_src2", - "vds_dapl2", NULL }; @@ -55,8 +49,6 @@ const char *FILENAME[] = { #define FILENAME_BUF_SIZE 1024 -#define TMPDIR "tmp/" - /*------------------------------------------------------------------------- * Function: vds_select_equal @@ -65,7 +57,14 @@ const char *FILENAME[] = { * provided dataspaces are the same. * * Return: Success: 0 + * * Failure: -1 + * + * Programmer: Neil Fortner + * Monday, March 2, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ static htri_t @@ -131,7 +130,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } + } /* end if */ /* Free buffers */ HDfree(buf1); @@ -181,7 +180,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } + } /* end if */ /* Free buffers */ HDfree(buf1); @@ -218,7 +217,14 @@ error: * parameters. * * Return: Success: 0 + * * Failure: -1 + * + * Programmer: Neil Fortner + * Monday, March 2, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ static int @@ -292,7 +298,8 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace, error: H5E_BEGIN_TRY { - H5Sclose(space_out); + if(space_out >= 0) + (void)H5Sclose(space_out); } H5E_END_TRY return -1; @@ -305,7 +312,14 @@ error: * Purpose: Tests API functions related to virtual datasets. * * Return: Success: 0 + * * Failure: number of errors + * + * Programmer: Neil Fortner + * Monday, February 16, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ /* Helper function to get DCPL for examination depending on config */ @@ -356,12 +370,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, file = -1; if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ /* Open dataset */ if((dset = H5Dopen2(file, "vdset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get DCPL from dataset */ if((*ex_dcpl = H5Dget_create_plist(dset)) < 0) @@ -380,8 +394,8 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(oinfo.meta_size.obj.heap_size != exp_meta_size) { printf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size); TEST_ERROR - } - } + } /* end if */ + } /* end if */ else if((oinfo.meta_size.obj.heap_size != exp_meta_size) && (oinfo.meta_size.obj.heap_size != (hsize_t)0)) @@ -410,12 +424,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(H5Fclose(file) < 0) TEST_ERROR file = -1; - } + } /* end if */ else if(config == TEST_API_COPY_PLIST) { /* Copy property list */ if((*ex_dcpl = H5Pcopy(dcpl)) < 0) TEST_ERROR - } + } /* end if */ else if(config == TEST_API_ENCDEC_PLIST) { size_t plist_buf_size; @@ -434,14 +448,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, /* Free plist_buf */ HDfree(plist_buf); plist_buf = NULL; - } + } /* end if */ else { /* Simply copy the id to ex_dcpl and increment the ref count so ex_dcpl * can be closed */ if(H5Iinc_ref(dcpl) < 0) TEST_ERROR *ex_dcpl = dcpl; - } + } /* end else */ /* Verify examination DCPL is equal to original DCPL. Do not compare the * plist to itself, and do not do the comparison if we reopened the file, @@ -452,14 +466,16 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, TEST_ERROR if(!tri_ret) TEST_ERROR - } + } /* end if */ return 0; error: H5E_BEGIN_TRY { - H5Fclose(file); - H5Dclose(dset); + if(file >= 0) + (void)H5Fclose(file); + if(dset >= 0) + (void)H5Dclose(dset); } H5E_END_TRY; if(plist_buf) HDfree(plist_buf); @@ -516,7 +532,7 @@ test_api(test_api_config_t config, hid_t fapl) case TEST_API_NTESTS: default: TEST_ERROR - } + } /* end switch */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -802,7 +818,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Create virtual dataspace */ if((vspace[i] = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR - } + } /* end for */ /* Select all (should not be necessary, but just to be sure) */ if(H5Sselect_all(srcspace[0]) < 0) @@ -916,7 +932,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } + } /* end for */ if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1022,7 +1038,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Add virtual layout mapping */ if(H5Pset_virtual(dcpl, vspace[i], tmp_filename, tmp_dsetname, srcspace[0]) < 0) TEST_ERROR - } + } /* end if */ /* Get examination DCPL */ if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)697) < 0) @@ -1047,7 +1063,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Check that the mapping in the DCPL is correct */ if(vds_check_mapping(ex_dcpl, (size_t)i, vspace[i], srcspace[0], tmp_filename, tmp_dsetname) < 0) TEST_ERROR - } + } /* end if */ /* Close */ if(H5Sclose(srcspace[0]) < 0) @@ -1057,7 +1073,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } + } /* end for */ if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1107,459 +1123,23 @@ test_api(test_api_config_t config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) - H5Sclose(srcspace[i]); - for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) - H5Sclose(vspace[i]); - H5Pclose(dcpl); - H5Pclose(ex_dcpl); + for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) { + if(srcspace[i] >= 0) + (void)H5Sclose(srcspace[i]); + } /* end for */ + for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) { + if(vspace[i] >= 0) + (void)H5Sclose(vspace[i]); + } /* end for */ + if(dcpl >= 0) + (void)H5Pclose(dcpl); + if(ex_dcpl >= 0) + (void)H5Pclose(ex_dcpl); } H5E_END_TRY; return 1; } /* end test_api() */ -/*------------------------------------------------------------------------- - * Function: vds_link_prefix - * - * Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp" - * Should be able to access the target source files in tmp directory via the prefix set - * by H5Pset_virtual_prefix() - * - * Return: Success: 0 - * Failure: -1 - *------------------------------------------------------------------------- - */ -static int -test_vds_prefix(unsigned config, hid_t fapl) -{ - char srcfilename[FILENAME_BUF_SIZE]; - char srcfilename_map[FILENAME_BUF_SIZE]; - char vfilename[FILENAME_BUF_SIZE]; - char vfilename2[FILENAME_BUF_SIZE]; - char srcfilenamepct[FILENAME_BUF_SIZE]; - char srcfilenamepct_map[FILENAME_BUF_SIZE]; - const char *srcfilenamepct_map_orig = "vds%%%%_src"; - hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */ - hid_t vfile = -1; /* File with virtual dset */ - hid_t vfile2 = -1; /* File with copied virtual dset */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t dapl = -1; /* Dataset access property list */ - hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */ - hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */ - hid_t memspace = -1; /* Memory dataspace */ - hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */ - hid_t vdset = -1; /* Virtual dataset */ - hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ - hsize_t start[4]; /* Hyperslab start */ - hsize_t stride[4]; /* Hyperslab stride */ - hsize_t count[4]; /* Hyperslab count */ - hsize_t block[4]; /* Hyperslab block */ - hssize_t offset[2] = {0, 0}; /* Selection offset */ - int buf[10][26]; /* Write and expected read buffer */ - int rbuf[10][26]; /* Read buffer */ - int rbuf99[9][9]; /* 9x9 Read buffer */ - int evbuf[10][26]; /* Expected VDS "buffer" */ - int erbuf[10][26]; /* Expected read buffer */ - int fill = -1; /* Fill value */ - herr_t ret; /* Generic return value */ - int i, j; - char buffer[1024]; /* buffer to read vds_prefix */ - - TESTING("basic virtual dataset I/O via H5Pset_vds_prefix()") - - h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename); - h5_fixname(FILENAME[7], fapl, vfilename2, sizeof vfilename2); - h5_fixname(FILENAME[8], fapl, srcfilename, sizeof srcfilename); - h5_fixname_printf(FILENAME[8], fapl, srcfilename_map, sizeof srcfilename_map); - h5_fixname(FILENAME[10], fapl, srcfilenamepct, sizeof srcfilenamepct); - h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map); - - /* create tmp directory and get current working directory path */ - if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) - TEST_ERROR - - /* Create DCPL */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - TEST_ERROR - - /* Set fill value */ - if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) - TEST_ERROR - - /* Initialize VDS prefix items */ - if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) - TEST_ERROR - - if(H5Pset_virtual_prefix(dapl, TMPDIR) < 0) - TEST_ERROR - if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) - TEST_ERROR - - if(HDstrcmp(buffer, TMPDIR) != 0) - FAIL_PUTS_ERROR("vds prefix not set correctly"); - - /* - * Test 1: All - all selection - */ - /* Create source dataspace */ - if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) - TEST_ERROR - - /* Create virtual dataspace */ - if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) - TEST_ERROR - - /* Select all (should not be necessary, but just to be sure) */ - if(H5Sselect_all(srcspace[0]) < 0) - TEST_ERROR - if(H5Sselect_all(vspace[0]) < 0) - TEST_ERROR - - /* Add virtual layout mapping */ - if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) - TEST_ERROR - - /* Create virtual file */ - if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - - /* Create source file if requested */ - if(config & TEST_IO_DIFFERENT_FILE) { - HDgetcwd(buffer, 1024); - HDchdir(TMPDIR); - if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - HDchdir(buffer); - } - else { - srcfile[0] = vfile; - if(H5Iinc_ref(srcfile[0]) < 0) - TEST_ERROR - } - - /* Create source dataset */ - if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Create virtual dataset */ - if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) - TEST_ERROR - - /* Populate write buffer */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; - - /* Write data directly to source dataset */ - if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) - TEST_ERROR - - /* Close srcdset and srcfile if config option specified */ - if(config & TEST_IO_CLOSE_SRC) { - if(H5Dclose(srcdset[0]) < 0) - TEST_ERROR - srcdset[0] = -1; - - if(config & TEST_IO_DIFFERENT_FILE) { - if(H5Fclose(srcfile[0]) < 0) - TEST_ERROR - srcfile[0] = -1; - } - } - - /* Reopen virtual dataset and file if config option specified */ - if(config & TEST_IO_REOPEN_VIRT) { - if(H5Dclose(vdset) < 0) - TEST_ERROR - vdset = -1; - if(H5Fclose(vfile) < 0) - TEST_ERROR - vfile = -1; - if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) - TEST_ERROR - if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) - TEST_ERROR - } - - /* Read data through virtual dataset */ - HDmemset(rbuf[0], 0, sizeof(rbuf)); - if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) - TEST_ERROR - - /* Verify read data */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - if(rbuf[i][j] != buf[i][j]) { - TEST_ERROR - } - } - - /* Adjust write buffer */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); - - /* Write data through virtual dataset */ - if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) - TEST_ERROR - - /* Reopen srcdset and srcfile if config option specified */ - if(config & TEST_IO_CLOSE_SRC) { - if(config & TEST_IO_DIFFERENT_FILE) { - HDgetcwd(buffer, 1024); - HDchdir(TMPDIR); - if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR - HDchdir(buffer); - } - if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) - TEST_ERROR - } - - /* Read data directly from source dataset */ - HDmemset(rbuf[0], 0, sizeof(rbuf)); - if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) - TEST_ERROR - - /* Verify read data */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - if(rbuf[i][j] != buf[i][j]) - TEST_ERROR - - /* Close */ - if(H5Dclose(srcdset[0]) < 0) - TEST_ERROR - srcdset[0] = -1; - if(H5Dclose(vdset) < 0) - TEST_ERROR - vdset = -1; - if(H5Fclose(srcfile[0]) < 0) - TEST_ERROR - srcfile[0] = -1; - if(H5Fclose(vfile) < 0) - TEST_ERROR - vfile = -1; - if(H5Sclose(srcspace[0]) < 0) - TEST_ERROR - srcspace[0] = -1; - if(H5Sclose(vspace[0]) < 0) - TEST_ERROR - vspace[0] = -1; - if(H5Pclose(dapl) < 0) - TEST_ERROR - dapl = -1; - if(H5Pclose(dcpl) < 0) - TEST_ERROR - dcpl = -1; - - /* - * Test 2: All - all selection with ENV prefix - */ - if(HDsetenv("HDF5_VDS_PREFIX", "${ORIGIN}/tmp", 1)) - TEST_ERROR - - /* Create DCPL */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - TEST_ERROR - - /* Set fill value */ - if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) - TEST_ERROR - - /* Set prefix to a nonexistent directory, will be overwritten by environment variable */ - if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) - TEST_ERROR - - if(H5Pset_virtual_prefix(dapl, "someprefix") < 0) - TEST_ERROR - if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) - TEST_ERROR - - if(HDstrcmp(buffer, "someprefix") != 0) - FAIL_PUTS_ERROR("vds prefix not set correctly"); - - /* Create source dataspace */ - if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) - TEST_ERROR - - /* Create virtual dataspace */ - if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) - TEST_ERROR - - /* Select all (should not be necessary, but just to be sure) */ - if(H5Sselect_all(srcspace[0]) < 0) - TEST_ERROR - if(H5Sselect_all(vspace[0]) < 0) - TEST_ERROR - - /* Add virtual layout mapping */ - if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) - TEST_ERROR - - /* Create virtual file */ - if((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - - /* Create source file if requested */ - if(config & TEST_IO_DIFFERENT_FILE) { - HDgetcwd(buffer, 1024); - HDchdir(TMPDIR); - if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - HDchdir(buffer); - } - else { - srcfile[0] = vfile; - if(H5Iinc_ref(srcfile[0]) < 0) - TEST_ERROR - } - - /* Create source dataset */ - if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Create virtual dataset */ - if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) - TEST_ERROR - - /* Populate write buffer */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; - - /* Write data directly to source dataset */ - if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) - TEST_ERROR - - /* Close srcdset and srcfile if config option specified */ - if(config & TEST_IO_CLOSE_SRC) { - if(H5Dclose(srcdset[0]) < 0) - TEST_ERROR - srcdset[0] = -1; - - if(config & TEST_IO_DIFFERENT_FILE) { - if(H5Fclose(srcfile[0]) < 0) - TEST_ERROR - srcfile[0] = -1; - } - } - - /* Reopen virtual dataset and file if config option specified */ - if(config & TEST_IO_REOPEN_VIRT) { - if(H5Dclose(vdset) < 0) - TEST_ERROR - vdset = -1; - if(H5Fclose(vfile) < 0) - TEST_ERROR - vfile = -1; - if((vfile = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) - TEST_ERROR - if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) - TEST_ERROR - } - - /* Read data through virtual dataset */ - HDmemset(rbuf[0], 0, sizeof(rbuf)); - if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) - TEST_ERROR - - /* Verify read data */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - if(rbuf[i][j] != buf[i][j]) { - TEST_ERROR - } - } - - /* Adjust write buffer */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); - - /* Write data through virtual dataset */ - if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) - TEST_ERROR - - /* Reopen srcdset and srcfile if config option specified */ - if(config & TEST_IO_CLOSE_SRC) { - if(config & TEST_IO_DIFFERENT_FILE) { - HDgetcwd(buffer, 1024); - HDchdir(TMPDIR); - if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR - HDchdir(buffer); - } - if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) - TEST_ERROR - } - - /* Read data directly from source dataset */ - HDmemset(rbuf[0], 0, sizeof(rbuf)); - if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) - TEST_ERROR - - /* Verify read data */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - if(rbuf[i][j] != buf[i][j]) - TEST_ERROR - - /* Close */ - if(H5Dclose(vdset) < 0) - TEST_ERROR - vdset = -1; - if(H5Dclose(srcdset[0]) < 0) - TEST_ERROR - srcdset[0] = -1; - if(H5Fclose(srcfile[0]) < 0) - TEST_ERROR - srcfile[0] = -1; - if(H5Fclose(vfile) < 0) - TEST_ERROR - vfile = -1; - if(H5Sclose(srcspace[0]) < 0) - TEST_ERROR - srcspace[0] = -1; - if(H5Sclose(vspace[0]) < 0) - TEST_ERROR - vspace[0] = -1; - if(H5Pclose(dapl) < 0) - TEST_ERROR - dapl = -1; - if(H5Pclose(dcpl) < 0) - TEST_ERROR - dcpl = -1; - - if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) - TEST_ERROR - - PASSED(); - return 0; - - error: - H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) - H5Dclose(srcdset[i]); - H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) - H5Fclose(srcfile[i]); - H5Fclose(vfile); - H5Fclose(vfile2); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) - H5Sclose(srcspace[i]); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) - H5Sclose(vspace[i]); - H5Sclose(memspace); - H5Pclose(dcpl); - } H5E_END_TRY; - - if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) - TEST_ERROR - - return 1; -} /* end vds_link_prefix() */ - /*------------------------------------------------------------------------- * Function: test_basic_io @@ -1568,7 +1148,14 @@ test_vds_prefix(unsigned config, hid_t fapl) * pattern-matching file/dataset strings * * Return: Success: 0 + * * Failure: number of errors + * + * Programmer: Neil Fortner + * Tuesday, March 3, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ static int @@ -1651,12 +1238,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1685,8 +1272,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1700,7 +1287,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1729,7 +1316,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1813,12 +1400,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1854,8 +1441,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1869,7 +1456,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1900,7 +1487,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1949,8 +1536,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1959,7 +1546,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ /* Open v_dset2 */ if((vdset = H5Dopen2(vfile, "v_dset2", H5P_DEFAULT)) < 0) @@ -1985,7 +1572,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Only copy to a different file if the source datasets are in a different * file */ @@ -2027,8 +1614,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen copied virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2037,7 +1624,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile2 = -1; if((vfile2 = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ /* Open v_dset3 */ if((vdset = H5Dopen2(vfile2, "v_dset3", H5P_DEFAULT)) < 0) @@ -2063,13 +1650,13 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Close copied virtual file */ if(H5Fclose(vfile2) < 0) TEST_ERROR vfile2 = -1; - } + } /* end if */ /* Close */ if(H5Dclose(srcdset[0]) < 0) @@ -2148,12 +1735,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2195,8 +1782,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2210,7 +1797,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2241,7 +1828,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2336,12 +1923,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2377,8 +1964,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2392,7 +1979,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read first source dataset through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2445,7 +2032,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2544,12 +2131,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2577,7 +2164,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i][j] = buf[2 * i][j]; for(/* j = 13 */; j < 26; j++) evbuf[i][j] = buf[2 * i + 1][j - 13]; - } + } /* end for */ /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2594,7 +2181,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i + 5][j] = buf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) evbuf[i + 5][j] = buf[2 * i + 1][j]; - } + } /* end for */ /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2609,8 +2196,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2624,7 +2211,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -2640,7 +2227,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i][j] = evbuf[2 * i][j]; for(/* j = 13 */; j < 26; j++) erbuf[i][j] = evbuf[2 * i + 1][j - 13]; - } + } /* end for */ /* Read second slice */ if(H5Dread(vdset, H5T_NATIVE_INT, vspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2652,7 +2239,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i + 5][j] = evbuf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) erbuf[i + 5][j] = evbuf[2 * i + 1][j]; - } + } /* end for */ /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2676,7 +2263,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j] = buf[i][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j - 13] = buf[i][j]; - } + } /* end for */ /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2693,7 +2280,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j + 13] = buf[i + 5][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j] = buf[i + 5][j]; - } + } /* end for */ /* Reopen srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2704,7 +2291,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source datasets */ /* Reset rbuf */ @@ -2720,7 +2307,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j] = evbuf[i][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j - 13] = evbuf[i][j]; - } + } /* end for */ /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, srcspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2732,7 +2319,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j + 13] = evbuf[i + 5][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j] = evbuf[i + 5][j]; - } + } /* end for */ /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2852,12 +2439,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2911,8 +2498,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2926,7 +2513,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -2951,7 +2538,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } + } /* end for */ /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2997,7 +2584,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source datasets */ /* Reset rbuf */ @@ -3018,7 +2605,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } + } /* end for */ /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, memspace, srcspace[0], H5P_DEFAULT, rbuf[0]) < 0) @@ -3193,12 +2780,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -3235,8 +2822,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3250,7 +2837,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset */ /* Reset rbuf */ @@ -3356,7 +2943,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 3) && (j < 6)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != 0) TEST_ERROR @@ -3409,7 +2996,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 6) && (j < 9)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != 0) TEST_ERROR @@ -3627,7 +3214,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source dataset */ /* Select hyperslab in memory space */ @@ -3702,19 +3289,32 @@ test_basic_io(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) - H5Dclose(srcdset[i]); - H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) - H5Fclose(srcfile[i]); - H5Fclose(vfile); - H5Fclose(vfile2); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) - H5Sclose(srcspace[i]); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) - H5Sclose(vspace[i]); - H5Sclose(memspace); - H5Pclose(dcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { + if(srcdset[i] >= 0) + (void)H5Dclose(srcdset[i]); + } /* end for */ + if(vdset >= 0) + (void)H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { + if(srcfile[i] >= 0) + (void)H5Fclose(srcfile[i]); + } /* end for */ + if(vfile >= 0) + (void)H5Fclose(vfile); + if(vfile2 >= 0) + (void)H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { + if(srcspace[i] >= 0) + (void)H5Sclose(srcspace[i]); + } /* end for */ + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { + if(vspace[i] >= 0) + (void)H5Sclose(vspace[i]); + } /* end for */ + if(memspace >= 0) + (void)H5Sclose(memspace); + if(dcpl >= 0) + (void)H5Pclose(dcpl); } H5E_END_TRY; return 1; @@ -3727,7 +3327,14 @@ error: * Purpose: Tests VDS with unlimited selections * * Return: Success: 0 + * * Failure: number of errors + * + * Programmer: Neil Fortner + * Thursday, April 30, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ static int @@ -3840,12 +3447,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -3910,8 +3517,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3925,7 +3532,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -3970,11 +3577,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Test H5Pget_virtual_view() */ if(H5Pget_virtual_view(dapl, &virtual_view) < 0) @@ -3994,7 +3601,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4042,11 +3649,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4055,7 +3662,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[0] */ dims[0] = 5; @@ -4092,8 +3699,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4107,7 +3714,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4154,11 +3761,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -4172,7 +3779,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4225,11 +3832,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4238,7 +3845,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[0] = 5; @@ -4280,8 +3887,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4295,7 +3902,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4357,7 +3964,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != 0) TEST_ERROR @@ -4422,11 +4029,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Shrink to 15 */ dims[1] = 15; @@ -4453,12 +4060,12 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } - } + } /* end for */ + } /* end if */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4472,7 +4079,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4520,11 +4127,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -4559,11 +4166,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now try setting extent manually */ /* Grow to 18 */ @@ -4591,11 +4198,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Grow to 20 */ dims[1] = 20; @@ -4621,7 +4228,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < (int)mdims[1]; j++) if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -4634,12 +4241,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -4715,12 +4322,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -4785,8 +4392,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4800,7 +4407,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4844,11 +4451,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4862,7 +4469,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4904,11 +4511,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4917,7 +4524,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[0] */ dims[1] = 7; @@ -4959,8 +4566,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4974,7 +4581,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5020,11 +4627,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5038,7 +4645,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5089,11 +4696,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5102,7 +4709,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[1] = 10; @@ -5144,8 +4751,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5159,7 +4766,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5221,7 +4828,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != 0) TEST_ERROR @@ -5238,7 +4845,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5290,11 +4897,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -5307,12 +4914,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -5407,12 +5014,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -5452,7 +5059,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][6 * j] = buf[i][2 * j]; erbuf[i][(6 * j) + 1] = buf[i][(2 * j) + 1]; - } + } /* end for */ /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5468,7 +5075,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][(6 * j) + 2] = buf[i][2 * j]; erbuf[i][(6 * j) + 3] = buf[i][(2 * j) + 1]; - } + } /* end for */ /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5489,7 +5096,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][4] = buf[i][0]; erbuf[i][5] = buf[i][1]; - } + } /* end for */ /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5507,8 +5114,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5522,7 +5129,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5566,11 +5173,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -5584,7 +5191,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5626,11 +5233,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5639,7 +5246,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[0] */ dims[1] = 7; @@ -5676,8 +5283,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5691,7 +5298,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5736,11 +5343,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5754,7 +5361,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5764,7 +5371,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][12] = buf[i][0]; erbuf[i][13] = buf[i][1]; erbuf[i][18] = buf[i][2]; - } + } /* end for */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5808,11 +5415,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5821,7 +5428,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset3", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[2] */ dims[1] = 5; @@ -5853,7 +5460,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][10] = buf[i][0]; erbuf[i][11] = buf[i][1]; erbuf[i][16] = buf[i][2]; - } + } /* end for */ /* Close srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5865,8 +5472,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5880,7 +5487,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5925,11 +5532,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -5943,7 +5550,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5989,11 +5596,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6002,7 +5609,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[1] = 6; @@ -6033,7 +5640,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][14] = buf[i][0]; erbuf[i][15] = buf[i][1]; - } + } /* end for */ /* Close srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6045,8 +5652,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6060,7 +5667,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6104,11 +5711,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -6122,7 +5729,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6164,11 +5771,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now just read middle 2 rows */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -6194,11 +5801,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != 0) TEST_ERROR @@ -6217,12 +5824,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -6303,12 +5910,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -6361,8 +5968,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6376,7 +5983,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6422,11 +6029,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -6440,7 +6047,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6482,11 +6089,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6495,7 +6102,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[0] */ dims[0] = 5; @@ -6533,8 +6140,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6548,7 +6155,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6594,11 +6201,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -6612,7 +6219,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6660,11 +6267,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -6677,12 +6284,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -6725,23 +6332,23 @@ error: for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { if(srcdset[i] >= 0) (void)H5Dclose(srcdset[i]); - } + } /* end for */ if(vdset >= 0) (void)H5Dclose(vdset); for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { if(srcfile[i] >= 0) (void)H5Fclose(srcfile[i]); - } + } /* end for */ if(vfile >= 0) (void)H5Fclose(vfile); for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { if(srcspace[i] >= 0) (void)H5Sclose(srcspace[i]); - } + } /* end for */ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { if(vspace[i] >= 0) (void)H5Sclose(vspace[i]); - } + } /* end for */ if(filespace >= 0) (void)H5Sclose(filespace); if(memspace >= 0) @@ -6878,12 +6485,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -6895,7 +6502,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6909,7 +6516,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6995,8 +6602,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7010,7 +6617,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7054,11 +6661,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -7095,8 +6702,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7110,7 +6717,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7150,11 +6757,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now try with different selections */ count[0] = 10; @@ -7181,12 +6788,12 @@ test_printf(unsigned config, hid_t fapl) if((j < (int)start[1]) || (j >= (int)(start[1] + count[1]))) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } - } + } /* end for */ + } /* end for */ start[1] = 0; /* Now try writing through VDS */ @@ -7222,7 +6829,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read srcdset[0] */ count[0] = 10; @@ -7324,12 +6931,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -7341,7 +6948,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7355,7 +6962,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7493,14 +7100,14 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7514,7 +7121,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7558,11 +7165,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Test H5Pget_virtual_printf_gap() */ if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) @@ -7582,7 +7189,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7634,11 +7241,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with printf gap set to 2, reopen file as well if * config option specified */ @@ -7652,7 +7259,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7704,11 +7311,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with printf gap set to 3, reopen file as well if * config option specified */ @@ -7722,7 +7329,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7774,11 +7381,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with printf gap set to 4, reopen file as well if * config option specified */ @@ -7792,7 +7399,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7844,11 +7451,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -7862,7 +7469,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7908,11 +7515,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -7926,16 +7533,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8008,7 +7615,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8074,7 +7681,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8088,7 +7695,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8132,11 +7739,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -8171,7 +7778,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8185,7 +7792,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8229,11 +7836,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -8249,7 +7856,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8319,7 +7926,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8385,7 +7992,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8399,7 +8006,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8443,11 +8050,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -8482,7 +8089,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8496,7 +8103,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8540,11 +8147,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -8560,7 +8167,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8573,7 +8180,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Sclose(vspace[0]) < 0) TEST_ERROR vspace[0] = -1; - } + } /* end if */ /* @@ -8631,12 +8238,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -8648,7 +8255,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8662,7 +8269,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8748,8 +8355,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8763,7 +8370,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8807,11 +8414,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -8847,8 +8454,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8862,7 +8469,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8906,11 +8513,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -8924,7 +8531,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -8971,11 +8578,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9011,8 +8618,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9026,7 +8633,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9070,11 +8677,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -9088,7 +8695,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9135,11 +8742,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with printf_gap set to 1, reopen file as well if * config option specified */ @@ -9153,7 +8760,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9200,11 +8807,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -9218,16 +8825,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -9303,12 +8910,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -9320,7 +8927,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9334,7 +8941,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9430,8 +9037,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9445,7 +9052,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9489,11 +9096,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -9507,7 +9114,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9554,11 +9161,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9598,8 +9205,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9613,7 +9220,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9657,11 +9264,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -9675,7 +9282,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9721,11 +9328,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9762,8 +9369,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9777,7 +9384,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9821,11 +9428,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -9859,11 +9466,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now try setting extent manually */ /* Shrink to 12 */ @@ -9889,11 +9496,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Shrink to 10 */ dims[1] = 12; @@ -9918,12 +9525,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } - } + } /* end for */ + } /* end if */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -9937,7 +9544,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9983,11 +9590,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -10021,11 +9628,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now try setting extent manually */ /* Grow to 12 */ @@ -10051,11 +9658,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Grow to 15 */ dims[1] = 15; @@ -10080,12 +9687,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } - } + } /* end for */ + } /* end if */ /* Reset dapl */ if(H5Pset_virtual_view(dapl, H5D_VDS_LAST_AVAILABLE) < 0) @@ -10097,16 +9704,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -10163,12 +9770,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -10180,7 +9787,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10194,7 +9801,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10260,8 +9867,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10275,7 +9882,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10319,11 +9926,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with printf gap set to 127, reopen file as well if * config option specified */ @@ -10337,7 +9944,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -10383,11 +9990,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -10401,12 +10008,12 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -10437,19 +10044,32 @@ test_printf(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) - H5Dclose(srcdset[i]); - H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) - H5Fclose(srcfile[i]); - H5Fclose(vfile); - H5Sclose(srcspace); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) - H5Sclose(vspace[i]); - H5Sclose(filespace); - H5Sclose(memspace); - H5Pclose(dcpl); - H5Pclose(dapl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { + if(srcdset[i] >= 0) + (void)H5Dclose(srcdset[i]); + } /* end for */ + if(vdset >= 0) + (void)H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { + if(srcfile[i] >= 0) + (void)H5Fclose(srcfile[i]); + } /* end for */ + if(vfile >= 0) + (void)H5Fclose(vfile); + if(srcspace >= 0) + (void)H5Sclose(srcspace); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { + if(vspace[i] >= 0) + (void)H5Sclose(vspace[i]); + } /* end for */ + if(filespace >= 0) + (void)H5Sclose(filespace); + if(memspace >= 0) + (void)H5Sclose(memspace); + if(dcpl >= 0) + (void)H5Pclose(dcpl); + if(dapl >= 0) + (void)H5Pclose(dapl); } H5E_END_TRY; return 1; @@ -10463,7 +10083,14 @@ error: * VDS * * Return: Success: 0 + * * Failure: number of errors + * + * Programmer: Neil Fortner + * Friday, August 14, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ static int @@ -10585,12 +10212,12 @@ test_all(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile = vfile; if(H5Iinc_ref(srcfile) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -10602,7 +10229,7 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10616,7 +10243,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10687,14 +10314,14 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10708,7 +10335,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10754,11 +10381,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10767,7 +10394,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[0] = 2; @@ -10802,8 +10429,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10817,7 +10444,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10863,11 +10490,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -10907,8 +10534,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10922,7 +10549,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10968,11 +10595,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10981,7 +10608,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[0] = 3; @@ -11025,8 +10652,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11040,7 +10667,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11086,11 +10713,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -11130,8 +10757,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11145,7 +10772,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11191,11 +10818,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -11204,7 +10831,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[0] = 7; @@ -11249,8 +10876,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11264,7 +10891,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11310,11 +10937,11 @@ test_all(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -11354,8 +10981,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11369,7 +10996,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11421,16 +11048,16 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -11441,12 +11068,12 @@ test_all(unsigned config, hid_t fapl) if(H5Sclose(srcspace[i]) < 0) TEST_ERROR srcspace[i] = -1; - } + } /* end for */ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } + } /* end for */ if(H5Pclose(dcpl) < 0) TEST_ERROR dcpl = -1; @@ -11462,19 +11089,32 @@ test_all(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) - H5Dclose(srcdset[i]); - H5Dclose(vdset); - H5Fclose(srcfile); - H5Fclose(vfile); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) - H5Sclose(srcspace[i]); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) - H5Sclose(vspace[i]); - H5Sclose(filespace); - H5Sclose(memspace); - H5Pclose(dcpl); - H5Pclose(srcdcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { + if(srcdset[i] >= 0) + (void)H5Dclose(srcdset[i]); + } /* end for */ + if(vdset >= 0) + (void)H5Dclose(vdset); + if(srcfile >= 0) + (void)H5Fclose(srcfile); + if(vfile >= 0) + (void)H5Fclose(vfile); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { + if(srcspace[i] >= 0) + (void)H5Sclose(srcspace[i]); + } /* end for */ + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { + if(vspace[i] >= 0) + (void)H5Sclose(vspace[i]); + } /* end for */ + if(filespace >= 0) + (void)H5Sclose(filespace); + if(memspace >= 0) + (void)H5Sclose(memspace); + if(dcpl >= 0) + (void)H5Pclose(dcpl); + if(srcdcpl >= 0) + (void)H5Pclose(srcdcpl); } H5E_END_TRY; return 1; @@ -11488,6 +11128,10 @@ error: * * Return: Success: 0 * Failure: 1 + * + * Programmer: Dana Robinson + * March 2016 + * *------------------------------------------------------------------------- */ static int @@ -11629,6 +11273,10 @@ test_dapl_values(hid_t fapl_id) * Purpose: Tests datasets with virtual layout * * Return: EXIT_SUCCESS/EXIT_FAILURE + * + * Programmer: Neil Fortner + * Tuesday, February 17, 2015 + * *------------------------------------------------------------------------- */ int @@ -11651,11 +11299,10 @@ main(void) for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) { printf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : ""); nerrors += test_basic_io(bit_config, fapl); - nerrors += test_vds_prefix(bit_config, fapl); nerrors += test_unlim(bit_config, fapl); nerrors += test_printf(bit_config, fapl); nerrors += test_all(bit_config, fapl); - } + } /* end for */ nerrors += test_dapl_values(fapl); diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 368471c..3addecf 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -72,14 +72,6 @@ f-3.h5 vds-eiger.h5 ) - set (HDF5_REFERENCE_PREFIX_VDS - 1_vds.h5 - 2_vds.h5 - 4_vds.h5 - 5_vds.h5 - vds-percival-unlim-maxmin.h5 - vds-eiger.h5 - ) set (HDF5_ERROR_REFERENCE_VDS ) @@ -88,21 +80,12 @@ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach () - foreach (vds_h5_file ${HDF5_REFERENCE_PREFIX_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/prefix/${fname}" "h5dump_vds_files") - 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 () - 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/prefix/${fname}" "h5dump_vds_files") - 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") @@ -151,44 +134,6 @@ endif () endmacro () - macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) - # If using memchecker add tests without using scripts - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $ ${ARGN}) - set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") - if (NOT "${resultcode}" STREQUAL "0") - set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") - endif () - if (NOT "${last_vds_test}" STREQUAL "") - set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) - endif () - else () - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP_PREFIX-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") - add_test ( - NAME H5DUMP_PREFIX-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" - -D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects) - endif () - endmacro () - macro (ADD_H5_VDS_LAYOUT resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) @@ -316,15 +261,3 @@ 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 () - - # Data read with prefix - if (USE_FILTER_DEFLATE) - ADD_H5_VDS_PREFIX_TEST (tvds-1 0 --enable-error-stack 1_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-2 0 --enable-error-stack 2_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-4 0 --enable-error-stack 4_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-5 0 --enable-error-stack 5_vds.h5) - ADD_H5_VDS_PREFIX_TEST (vds-first 0 --vds-view-first-missing --enable-error-stack vds-percival-unlim-maxmin.h5) - ADD_H5_VDS_PREFIX_TEST (vds-gap1 0 -d /VDS-Eiger --vds-gap-size=1 --enable-error-stack vds-eiger.h5) - ADD_H5_VDS_PREFIX_TEST (vds-gap2 0 --vds-gap-size=2 --enable-error-stack vds-eiger.h5) - endif () - diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index f25bd98..5df61bb 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -61,17 +61,6 @@ 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 () - - foreach (listfiles ${LIST_HDF5_TEST_FILES}) - get_filename_component(fname "${listfiles}" NAME) - HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") - endforeach () - - foreach (listfiles ${LIST_OTHER_TEST_FILES}) - get_filename_component(fname "${listfiles}" NAME) - HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5LS_SOURCE_DIR}/vds_prefix/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") - endforeach () - add_custom_target(h5ls_vds_files ALL COMMENT "Copying files needed by h5ls_vds tests" DEPENDS ${h5ls_vds_files_list}) ############################################################################## @@ -115,43 +104,6 @@ endif () endmacro () - macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) - # If using memchecker add tests without using scripts - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") - if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") - endif () - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () - add_test ( - NAME H5LS_PREFIX-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") - add_test ( - NAME H5LS_PREFIX-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=vds/prefix/${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=vds/prefix/${resultfile}.ls" - -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" - -D "TEST_ENV_VALUE=\${ORIGIN}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects) - endif () - endmacro () - ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -203,10 +155,3 @@ ADD_H5_VDS_TEST (tvds-4 0 -w80 -v -S 4_vds.h5) ADD_H5_VDS_TEST (tvds-5 0 -w80 -v -S 5_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-1 0 -w80 -v -S vds/prefix/1_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-2 0 -w80 -v -S vds/prefix/2_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-3_1 0 -w80 -v -S vds/prefix/3_1_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-3_2 0 -w80 -v -S vds/prefix/3_2_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-4 0 -w80 -v -S vds/prefix/4_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-5 0 -w80 -v -S vds/prefix/5_vds.h5) - diff --git a/tools/test/h5ls/vds_prefix/tvds-1.ls b/tools/test/h5ls/vds_prefix/tvds-1.ls deleted file mode 100644 index 2830d1a..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-1.ls +++ /dev/null @@ -1,14 +0,0 @@ -Opened "vds/prefix/1_vds.h5" with sec2 driver. -vds_dset Dataset {5/Inf, 18/18, 8/8} - Location: 1:800 - Links: 1 - Maps: {6} Source { - 1_a.h5 /source_dset - 1_b.h5 /source_dset - 1_c.h5 /source_dset - 1_d.h5 /source_dset - 1_e.h5 /source_dset - 1_f.h5 /source_dset - } - Storage: 2880 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-2.ls b/tools/test/h5ls/vds_prefix/tvds-2.ls deleted file mode 100644 index 5c6f9d3..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-2.ls +++ /dev/null @@ -1,13 +0,0 @@ -Opened "vds/prefix/2_vds.h5" with sec2 driver. -vds_dset Dataset {6/Inf, 8/8, 14/14} - Location: 1:800 - Links: 1 - Maps: {5} Source { - 2_a.h5 /source_dset - 2_b.h5 /source_dset - 2_c.h5 /source_dset - 2_d.h5 /source_dset - 2_e.h5 /source_dset - } - Storage: 2688 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_1.ls b/tools/test/h5ls/vds_prefix/tvds-3_1.ls deleted file mode 100644 index f4c8e78..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-3_1.ls +++ /dev/null @@ -1,14 +0,0 @@ -Opened "vds/prefix/3_1_vds.h5" with sec2 driver. -vds_dset Dataset {5/Inf, 25/25, 8/8} - Location: 1:800 - Links: 1 - Maps: {6} Source { - 1_a.h5 /source_dset - 1_b.h5 /source_dset - 1_c.h5 /source_dset - 1_d.h5 /source_dset - 1_e.h5 /source_dset - 1_f.h5 /source_dset - } - Storage: 4000 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_2.ls b/tools/test/h5ls/vds_prefix/tvds-3_2.ls deleted file mode 100644 index 5a7e2d8..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-3_2.ls +++ /dev/null @@ -1,13 +0,0 @@ -Opened "vds/prefix/3_2_vds.h5" with sec2 driver. -vds_dset Dataset {6/Inf, 13/13, 19/19} - Location: 1:800 - Links: 1 - Maps: {5} Source { - 2_a.h5 /source_dset - 2_b.h5 /source_dset - 2_c.h5 /source_dset - 2_d.h5 /source_dset - 2_e.h5 /source_dset - } - Storage: 5928 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-4.ls b/tools/test/h5ls/vds_prefix/tvds-4.ls deleted file mode 100644 index c22d3a4..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-4.ls +++ /dev/null @@ -1,9 +0,0 @@ -Opened "vds/prefix/4_vds.h5" with sec2 driver. -vds_dset Dataset {9/Inf, 4/4, 4/4} - Location: 1:800 - Links: 1 - Maps: {1} Source { - 4_%b.h5 /source_dset - } - Storage: 576 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-5.ls b/tools/test/h5ls/vds_prefix/tvds-5.ls deleted file mode 100644 index efba8dc..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-5.ls +++ /dev/null @@ -1,11 +0,0 @@ -Opened "vds/prefix/5_vds.h5" with sec2 driver. -vds_dset Dataset {9/Inf, 4/4, 4/4} - Location: 1:800 - Links: 1 - Maps: {3} Source { - 5_a.h5 /source_dset - 5_b.h5 /source_dset - 5_c.h5 /source_dset - } - Storage: 576 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer -- cgit v0.12 From 718006f8606f784ab7795ce5e50281fe318abadc Mon Sep 17 00:00:00 2001 From: lrknox Date: Sat, 23 Dec 2017 20:46:01 -0600 Subject: Increase maximum number of retries for h5watch tests. --- hl/tools/h5watch/testh5watch.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in index 05e66bf..7514281 100644 --- a/hl/tools/h5watch/testh5watch.sh.in +++ b/hl/tools/h5watch/testh5watch.sh.in @@ -44,7 +44,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 +TRY_MAX=20 # 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 -- cgit v0.12 From 732074d47e02c2e01fe794351c681d64b93a5f47 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 17:00:24 -0600 Subject: Add library INTERFACE and MPI to tools --- c++/src/CMakeLists.txt | 4 ++-- hl/c++/src/CMakeLists.txt | 12 ++---------- hl/fortran/src/CMakeLists.txt | 8 ++++---- hl/src/CMakeLists.txt | 4 ++-- java/src/jni/CMakeLists.txt | 2 +- test/CMakeLists.txt | 18 ++++++++++-------- testpar/CMakeLists.txt | 10 ++++++++-- tools/lib/CMakeLists.txt | 10 ++++++++-- 8 files changed, 37 insertions(+), 31 deletions(-) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index b147cfa..3b9a0c3 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -82,7 +82,7 @@ set (CPP_HDRS add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS}) TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC) set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES @@ -94,7 +94,7 @@ set (install_targets ${HDF5_CPP_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SOURCES} ${CPP_HDRS}) TARGET_C_PROPERTIES (${HDF5_CPP_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_CPP_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_CPP_LIBSH_TARGET} ${HDF5_CPP_LIB_NAME} SHARED ${HDF5_CXX_PACKAGE_SOVERSION}) set_target_properties (${HDF5_CPP_LIBSH_TARGET} PROPERTIES diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 38604cd..70f0a79 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -12,11 +12,7 @@ set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES}) TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} STATIC " " " ") -target_link_libraries ( - ${HDF5_HL_CPP_LIB_TARGET} - ${HDF5_HL_LIB_TARGET} - ${HDF5_LIB_TARGET} -) +target_link_libraries (${HDF5_HL_CPP_LIB_TARGET} PUBLIC ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} STATIC) set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES @@ -28,11 +24,7 @@ set (install_targets ${HDF5_HL_CPP_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_CPP_LIBSH_TARGET} SHARED ${HDF5_HL_CPP_SOURCES}) TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIBSH_TARGET} SHARED " " " ") - target_link_libraries ( - ${HDF5_HL_CPP_LIBSH_TARGET} - ${HDF5_HL_LIBSH_TARGET} - ${HDF5_LIBSH_TARGET} - ) + target_link_libraries (${HDF5_HL_CPP_LIBSH_TARGET} PUBLIC ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_HL_CPP_LIB_NAME} SHARED ${HDF5_HL_CXX_PACKAGE_SOVERSION}) set_target_properties (${HDF5_HL_CPP_LIBSH_TARGET} PROPERTIES diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index c870aed..3fc66c4 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -77,7 +77,7 @@ set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) +target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} STATIC) set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES @@ -90,7 +90,7 @@ set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) + target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_HL_F90_C_LIB_NAME} SHARED ${HDF5_HL_F_PACKAGE_SOVERSION}) set_target_properties (${HDF5_HL_F90_C_LIBSH_TARGET} PROPERTIES @@ -170,7 +170,7 @@ endif () add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES}) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC) set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES @@ -194,7 +194,7 @@ if (BUILD_SHARED_LIBS) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def") 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}) + target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${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}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_LIB_NAME} SHARED ${HDF5_HL_F_PACKAGE_SOVERSION}) set_target_properties (${HDF5_HL_F90_LIBSH_TARGET} PROPERTIES diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 86472fb..3dd6ce8 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -31,7 +31,7 @@ set (HL_HEADERS add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC) set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl @@ -43,7 +43,7 @@ set (install_targets ${HDF5_HL_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SOURCES} ${HL_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_HL_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIBSH_TARGET} ${HDF5_HL_LIB_NAME} SHARED ${HDF5_HL_PACKAGE_SOVERSION}) set_target_properties (${HDF5_HL_LIBSH_TARGET} PROPERTIES FOLDER libraries/hl diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 9e6c099..10d1b6d 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -51,7 +51,7 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) ########### JNI libraries always must be built shared ############### add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JAVA_JNI_CHDRS}) TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED " " " ") -target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_JAVA_JNI_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED ${HDF5_JAVA_PACKAGE_SOVERSION}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fca864b..6e8fd78 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -32,12 +32,13 @@ set (TEST_LIB_HEADERS 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") + target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "ws2_32.lib") endif () if (MINGW) - target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") + target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib") endif () -target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE ${LINK_LIBS}) +target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test @@ -48,12 +49,13 @@ if (BUILD_SHARED_LIBS) add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED " " " ") if (MSVC) - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "ws2_32.lib") + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "ws2_32.lib") endif () if (MINGW) - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib") endif () - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_LIBS}) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE ${LINK_LIBS}) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${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 FOLDER libraries/test @@ -97,7 +99,7 @@ endif () add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) @@ -123,7 +125,7 @@ endif () add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index b116d66..997d1a1 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -30,14 +30,20 @@ set (testphdf5_SOURCES add_executable (testphdf5 ${testphdf5_SOURCES}) TARGET_NAMING (testphdf5 STATIC) TARGET_C_PROPERTIES (testphdf5 STATIC " " " ") -target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) +if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + target_link_libraries (testphdf5 PRIVATE ${MPI_C_LIBRARIES}) +endif () set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") - target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) + if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + target_link_libraries (${file} PRIVATE ${MPI_C_LIBRARIES}) + endif () set_target_properties (${file} PROPERTIES FOLDER test/par) ENDMACRO (ADD_H5P_EXE file) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index ade7671..0fc1981 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -39,7 +39,10 @@ set (H5_TOOLS_LIB_HDRS add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) +if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PRIVATE ${MPI_C_LIBRARIES}) +endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC) set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES @@ -52,7 +55,10 @@ set (install_targets ${HDF5_TOOLS_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) TARGET_C_PROPERTIES (${HDF5_TOOLS_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) + if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES}) + endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TOOLS_LIB_NAME} SHARED ${HDF5_TOOLS_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TOOLS_LIBSH_TARGET} PROPERTIES -- cgit v0.12 From bd34c9e455988ab1d4e550ff16c0410b5624298a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 28 Dec 2017 16:49:50 -0600 Subject: HDFFV-9724 Corrected files and verified tests --- CMakeLists.txt | 4 +- MANIFEST | 6 + config/cmake_ext_mod/FindMPI.cmake | 287 +++--- config/cmake_ext_mod/runTest.cmake | 1 + examples/CMakeLists.txt | 4 +- java/src/hdf/hdf5lib/H5.java | 197 +++- java/src/hdf/hdf5lib/HDF5Constants.java | 3 + java/src/hdf/overview.html | 6 +- java/src/jni/h5Constants.c | 2 + java/src/jni/h5pImp.c | 211 +++++ java/src/jni/h5pImp.h | 73 +- java/test/JUnit-interface.txt | 9 +- java/test/TestH5P.java | 53 +- java/test/TestH5Pfapl.java | 14 + java/test/TestH5Pvirtual.java | 33 + release_docs/RELEASE.txt | 32 +- src/CMakeLists.txt | 10 +- src/H5Dint.c | 78 +- src/H5Dpkg.h | 3 +- src/H5Dprivate.h | 11 +- src/H5Dvirtual.c | 271 +++++- src/H5Fprivate.h | 420 ++++----- src/H5Fquery.c | 2 +- src/H5Pdapl.c | 366 ++++++++ src/H5Pfapl.c | 938 +++++++++---------- src/H5Ppublic.h | 2 + src/H5system.c | 2 +- test/CMakeLists.txt | 12 +- test/CMakeTests.cmake | 76 +- test/vds.c | 1538 +++++++++++++++++++------------ tools/test/h5dump/CMakeTestsVDS.cmake | 67 ++ tools/test/h5ls/CMakeTestsVDS.cmake | 55 ++ tools/test/h5ls/vds_prefix/tvds-1.ls | 14 + tools/test/h5ls/vds_prefix/tvds-2.ls | 13 + tools/test/h5ls/vds_prefix/tvds-3_1.ls | 14 + tools/test/h5ls/vds_prefix/tvds-3_2.ls | 13 + tools/test/h5ls/vds_prefix/tvds-4.ls | 9 + tools/test/h5ls/vds_prefix/tvds-5.ls | 11 + 38 files changed, 3347 insertions(+), 1513 deletions(-) create mode 100644 tools/test/h5ls/vds_prefix/tvds-1.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-2.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-3_1.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-3_2.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-4.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-5.ls diff --git a/CMakeLists.txt b/CMakeLists.txt index e22ac2e..d4e6300 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -631,6 +631,7 @@ if (HDF5_ENABLE_PARALLEL) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) + INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_DIRS}) else () message (STATUS "Parallel libraries not found") endif () @@ -639,7 +640,6 @@ endif () # Parallel IO usage requires MPI to be Linked and Included if (H5_HAVE_PARALLEL) set (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES}) - 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 () @@ -864,7 +864,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake) set (LINK_Fortran_LIBS ${LINK_LIBS}) - set (LINK_Fortran_SHARED_LIBS ${LINK_SHARED_LIBS}) if (HDF5_ENABLE_F2003) if (NOT FORTRAN_HAVE_ISO_C_BINDING) @@ -875,7 +874,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for # Parallel IO usage requires MPI to be Linked and Included if (H5_HAVE_PARALLEL) set (LINK_Fortran_LIBS ${LINK_Fortran_LIBS} ${MPI_Fortran_LIBRARIES}) - set (LINK_Fortran_SHARED_LIBS ${LINK_Fortran_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 () diff --git a/MANIFEST b/MANIFEST index 9b91c78..c6c7b3c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1430,6 +1430,12 @@ ./tools/test/h5ls/h5ls_plugin.sh.in ./tools/test/h5ls/testh5ls.sh.in ./tools/test/h5ls/testh5lsvds.sh.in +./tools/test/h5ls/vds_prefix/tvds-1.ls +./tools/test/h5ls/vds_prefix/tvds-2.ls +./tools/test/h5ls/vds_prefix/tvds-3_1.ls +./tools/test/h5ls/vds_prefix/tvds-3_2.ls +./tools/test/h5ls/vds_prefix/tvds-4.ls +./tools/test/h5ls/vds_prefix/tvds-5.ls # h5copy sources ./tools/src/h5copy/Makefile.am diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index 8084472..d01dd35 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -347,7 +347,7 @@ function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) # library that has invalid or missing version information there would be warning # messages emitted by ld.so in the compiler output. In either case, we'll treat # the output as invalid. - if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available") + if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found") set(WRAPPER_RETURN 255) endif() # Ensure that no error output might be passed upwards. @@ -615,6 +615,16 @@ function (_MPI_interrogate_compiler lang) endif() endif() + if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) + list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}") + endif() + if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) + list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}") + endif() + if(MPI_${LANG}_EXTRA_LIB_NAMES) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}") + endif() + # If we found MPI, set up all of the appropriate cache entries if(NOT MPI_${LANG}_COMPILE_OPTIONS) set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) @@ -823,33 +833,43 @@ endfunction() macro(_MPI_assemble_libraries LANG) set(MPI_${LANG}_LIBRARIES "") - foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) - endforeach() + # Only for libraries do we need to check whether the compiler's linking stage is separate. + if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT) + foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) + endforeach() + endif() endmacro() macro(_MPI_assemble_include_dirs LANG) - set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") - if("${LANG}" MATCHES "(C|CXX)") - if(MPI_${LANG}_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - else() # Fortran - if(MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + set(MPI_${LANG}_INCLUDE_DIRS "") + else() + set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") + if("${LANG}" MATCHES "(C|CXX)") + if(MPI_${LANG}_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + else() # Fortran + if(MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + endif() + if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + endif() endif() - if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}") + endforeach() endif() endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}") - endforeach() - endif() endmacro() function(_MPI_split_include_dirs LANG) + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + return() + endif() # Backwards compatibility: Search INCLUDE_PATH if given. if(MPI_${LANG}_INCLUDE_PATH) list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") @@ -885,6 +905,13 @@ function(_MPI_split_include_dirs LANG) endif() mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) endif() + # Remove duplicates and default system directories from the list. + if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) + list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR}) + endforeach() + endif() set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) endfunction() @@ -1014,7 +1041,7 @@ elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") # FreeBSD ships mpich under the normal system paths - but available openmpi implementations # will be found in /usr/local/mpi/ - MPI_search_mpi_prefix_folder("/usr/local/mpi/") + MPI_search_mpi_prefix_folder("/usr/local/mpi") endif() # Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. @@ -1050,48 +1077,54 @@ mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXE # # Once we find the new variables, we translate them back into their old # equivalents below. -foreach (LANG IN ITEMS C CXX) - # Old input variables. - set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) - - # Set new vars based on their old equivalents, if the new versions are not already set. - foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${LANG}_${var} AND MPI_${var}) - set(MPI_${LANG}_${var} "${MPI_${var}}") - endif() - endforeach() - - # Chop the old compile flags into options and definitions - if(MPI_${LANG}_COMPILE_FLAGS) - unset(MPI_${LANG}_COMPILE_OPTIONS) - unset(MPI_${LANG}_COMPILE_DEFINITIONS) - separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") - foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) - if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") - list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") - else() - list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}") +if(NOT MPI_IGNORE_LEGACY_VARIABLES) + foreach (LANG IN ITEMS C CXX) + # Old input variables. + set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) + + # Set new vars based on their old equivalents, if the new versions are not already set. + foreach (var ${_MPI_OLD_INPUT_VARS}) + if (NOT MPI_${LANG}_${var} AND MPI_${var}) + set(MPI_${LANG}_${var} "${MPI_${var}}") endif() endforeach() - unset(MPI_SEPARATE_FLAGS) - endif() - # If a list of libraries was given, we'll split it into new-style cache variables - if(NOT MPI_${LANG}_LIB_NAMES) - foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) - get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endforeach() - endif() -endforeach() + # Chop the old compile flags into options and definitions + + unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) + unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) + if(MPI_${LANG}_COMPILE_FLAGS) + separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") + foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) + if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") + list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") + else() + list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}") + endif() + endforeach() + unset(MPI_SEPARATE_FLAGS) + endif() + + # If a list of libraries was given, we'll split it into new-style cache variables + unset(MPI_${LANG}_EXTRA_LIB_NAMES) + if(NOT MPI_${LANG}_LIB_NAMES) + foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) + if(_MPI_LIB) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) + get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) + list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endif() + endforeach() + endif() + endforeach() +endif() #============================================================================= unset(MPI_VERSION) @@ -1100,6 +1133,11 @@ unset(MPI_VERSION_MINOR) unset(_MPI_MIN_VERSION) +# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. +if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) + set(MPI_SKIP_COMPILER_WRAPPER TRUE) +endif() + # This loop finds the compilers and sends them off for interrogation. foreach(LANG IN ITEMS C CXX Fortran) if(CMAKE_${LANG}_COMPILER_LOADED) @@ -1121,6 +1159,8 @@ foreach(LANG IN ITEMS C CXX Fortran) mark_as_advanced(MPI_CXX_SKIP_MPICXX) endif() if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) + set(MPI_${LANG}_TRIED_IMPLICIT FALSE) + set(MPI_${LANG}_WORKS_IMPLICIT FALSE) if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. # Cray PrgEnv. @@ -1130,80 +1170,90 @@ foreach(LANG IN ITEMS C CXX Fortran) # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. if(MPI_${LANG}_WORKS) set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) + set(MPI_${LANG}_WORKS_IMPLICIT TRUE) endif() + set(MPI_${LANG}_TRIED_IMPLICIT TRUE) endif() - # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. - if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) - set(MPI_SKIP_COMPILER_WRAPPER TRUE) - endif() - if(NOT MPI_SKIP_COMPILER_WRAPPER) - if(MPI_${LANG}_COMPILER) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") - unset(MPI_${LANG}_COMPILER CACHE) + if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS) + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + set(MPI_PINNED_COMPILER FALSE) + + if(NOT MPI_SKIP_COMPILER_WRAPPER) + if(MPI_${LANG}_COMPILER) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") + unset(MPI_${LANG}_COMPILER CACHE) + endif() + # If the user specifies a compiler, we don't want to try to search libraries either. + set(MPI_PINNED_COMPILER TRUE) + endif() + + # If we have an MPI base directory, we'll try all compiler names in that one first. + # This should prevent mixing different MPI environments + if(_MPI_BASE_DIR) + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + HINTS ${_MPI_BASE_DIR} + NO_DEFAULT_PATH + DOC "MPI compiler for ${LANG}" + ) endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(MPI_PINNED_COMPILER TRUE) - else() - set(MPI_PINNED_COMPILER FALSE) - endif() - # If we have an MPI base directory, we'll try all compiler names in that one first. - # This should prevent mixing different MPI environments - if(_MPI_BASE_DIR) + # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), + # we shall try searching in the default paths. find_program(MPI_${LANG}_COMPILER NAMES ${_MPI_${LANG}_COMPILER_NAMES} PATH_SUFFIXES bin sbin - HINTS ${_MPI_BASE_DIR} - NO_DEFAULT_PATH DOC "MPI compiler for ${LANG}" ) - endif() - # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), - # we shall try searching in the default paths. - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - DOC "MPI compiler for ${LANG}" - ) - - if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - set(MPI_SKIP_GUESSING TRUE) - elseif(MPI_${LANG}_COMPILER) - _MPI_interrogate_compiler(${LANG}) - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + set(MPI_PINNED_COMPILER TRUE) + + # If we haven't made the implicit compiler test yet, perform it now. + if(NOT MPI_${LANG}_TRIED_IMPLICIT) + _MPI_create_imported_target(${LANG}) + _MPI_check_lang_works(${LANG}) + endif() + + # Should the MPI compiler not work implicitly for MPI, still interrogate it. + # Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used + # directly during linkage instead of CMAKE__COMPILER will not work. + if(NOT MPI_${LANG}_WORKS) + set(MPI_${LANG}_WORKS_IMPLICIT FALSE) + _MPI_interrogate_compiler(${LANG}) + else() + set(MPI_${LANG}_WORKS_IMPLICIT TRUE) + endif() + elseif(MPI_${LANG}_COMPILER) + _MPI_interrogate_compiler(${LANG}) + endif() endif() - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) - set(MPI_PINNED_COMPILER FALSE) - endif() - if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) - # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the - # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. - if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) - set(MPI_${LANG}_WRAPPER_FOUND TRUE) - elseif(NOT MPI_SKIP_GUESSING) - _MPI_guess_settings(${LANG}) + if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) + # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the + # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. + if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) + else() + _MPI_guess_settings(${LANG}) + endif() endif() endif() endif() _MPI_split_include_dirs(${LANG}) - if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - _MPI_assemble_include_dirs(${LANG}) - _MPI_assemble_libraries(${LANG}) - endif() + _MPI_assemble_include_dirs(${LANG}) + _MPI_assemble_libraries(${LANG}) + _MPI_adjust_compile_definitions(${LANG}) # We always create imported targets even if they're empty _MPI_create_imported_target(${LANG}) @@ -1217,7 +1267,9 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + endif() mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) @@ -1337,7 +1389,7 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) unset(MPI_${LANG}_REQUIRED_VARS) - if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND) + if (NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") endforeach() @@ -1448,6 +1500,7 @@ if (MPI_NUMLIBS GREATER 1) else() set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") endif() +set(MPI_IGNORE_LEGACY_VARIABLES TRUE) #============================================================================= # unset these vars to cleanup namespace diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 2479728..5569a73 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -55,6 +55,7 @@ endif () if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") + #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") endif () if (NOT TEST_INPUT) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d8eb1a2..04a99ce 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -63,13 +63,13 @@ if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example STATIC) TARGET_C_PROPERTIES (ph5example STATIC " " " ") - target_link_libraries (ph5example ${HDF5_LIB_TARGET}) + target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example-shared SHARED) TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") - target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET}) + target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) endif () endif () diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 7b5b5c9..78ebbe2 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -4451,7 +4451,7 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// - // Generic property list routines + // /////// Generic property list routines /////// /** * H5Pget_class_name retrieves the name of a generic property list class @@ -4767,7 +4767,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException; - // Object creation property list (OCPL) routines + // /////// Object creation property list (OCPL) routines /////// /** * H5Pget_attr_phase_change retrieves attribute storage phase change thresholds. @@ -5071,7 +5071,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException, NullPointerException; - // File creation property list (FCPL) routines + // /////// File creation property list (FCPL) routines /////// /** * H5Pget_userblock retrieves the size of a user block in a file creation property list. @@ -5480,7 +5480,7 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, IllegalArgumentException; - // File access property list (FAPL) routines + // /////// File access property list (FAPL) routines /////// /** * H5Pget_alignment retrieves the current settings for alignment properties from a file access property list. @@ -5860,6 +5860,37 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_metadata_read_attempts(long plist_id, long attempts) throws HDF5LibraryException; + /** + * H5Pget_evict_on_close retrieves the file access property list setting that determines whether an HDF5 object + * will be evicted from the library's metadata cache when it is closed. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return indication if the object will be evicted on close. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native boolean H5Pget_evict_on_close(long fapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_evict_on_close controls the library's behavior of evicting metadata associated with a closed object. + * + * @param fapl_id + * IN: File access property list identifier + * @param evict_on_close + * IN: Whether the HDF5 object should be evicted on close. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close) + throws HDF5LibraryException; + // Dataset creation property list (DCPL) routines // /** @@ -6066,6 +6097,36 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native String H5Pget_virtual_dsetname(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException; +// ///// unimplemented ///// +// /** +// * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache. +// * +// * @param fapl_id +// * IN: File access property list identifier +// * +// * @return VDS link open file cache size in number of files. +// * +// * @exception HDF5LibraryException +// * - Error from the HDF-5 Library. +// * +// **/ +// public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException; +// +// /** +// * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache. +// * +// * @param fapl_id +// * IN: File access property list identifier +// * @param efc_size +// * IN: VDS link open file cache size in number of files. +// * +// * @exception HDF5LibraryException +// * - Error from the HDF-5 Library. +// * +// **/ +// public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size) +// throws HDF5LibraryException; + /** * H5Pget_external returns information about an external file. * @@ -6285,7 +6346,37 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException, NullPointerException; - // Dataset access property list (DAPL) routines // + // /////// Dataset creation property list (DCPL) routines /////// + + /** + * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list. + * + * @param dcpl_id + * IN: Dataset creation property list identifier + * @param opts + * IN: Edge chunk option flag. Valid values are: + * H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS - filters are not applied to partial edge chunks. + * 0 - Disables option; partial edge chunks will be compressed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library + **/ + public synchronized static native void H5Pset_chunk_opts(long dcpl_id, int opts) throws HDF5LibraryException; + + /** + * H5Pget_chunk_opts retrieves the edge chunk option setting stored in the dataset creation property list . + * + * @param dcpl_id + * IN: Dataset creation property list + + * @return The edge chunk option setting. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library + **/ + public synchronized static native int H5Pget_chunk_opts(long dcpl_id) throws HDF5LibraryException; + + // /////// Dataset access property list (DAPL) routines /////// /** * Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes @@ -6388,12 +6479,76 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native long H5Pget_virtual_printf_gap(long dapl_id) throws HDF5LibraryException; + /** + * H5Pget_virtual_prefix Retrieves prefix applied to virtual file paths. + * + * @param dapl_id + * IN: Link access property list identifier + * + * @return the prefix to be applied to virtual file paths. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native String H5Pget_virtual_prefix(long dapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_virtual_prefix Sets prefix to be applied to virtual file paths. + * + * @param dapl_id + * IN: Dataset access property list identifier + * @param prefix + * IN: Prefix to be applied to virtual file paths + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - prefix is null. + * + **/ + public synchronized static native void H5Pset_virtual_prefix(long dapl_id, String prefix) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Pget_efile_prefix Retrieves prefix applied to external file paths. + * + * @param dapl_id + * IN: Link access property list identifier + * + * @return the prefix to be applied to external file paths. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native String H5Pget_efile_prefix(long dapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_efile_prefix Sets prefix to be applied to external file paths. + * + * @param dapl_id + * IN: Dataset access property list identifier + * @param prefix + * IN: Prefix to be applied to external file paths + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - prefix is null. + * + **/ + public synchronized static native void H5Pset_efile_prefix(long dapl_id, String prefix) + throws HDF5LibraryException, NullPointerException; + // public synchronized static native void H5Pset_append_flush(long plist_id, int ndims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; // public synchronized static native void H5Pget_append_flush(long plist_id, int dims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; - // Dataset xfer property list (DXPL) routines // + // /////// Dataset xfer property list (DXPL) routines /////// /** * H5Pget_data_transform retrieves the data transform expression previously set in the dataset transfer property @@ -6544,7 +6699,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size) throws HDF5LibraryException, NullPointerException; - // Link creation property list (LCPL) routines // + // /////// Link creation property list (LCPL) routines /////// /** * H5Pget_create_intermediate_group determines whether property is set to enable creating missing intermediate @@ -6579,7 +6734,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_create_intermediate_group(long lcpl_id, boolean crt_intermed_group) throws HDF5LibraryException; - // Group creation property list (GCPL) routines // + // /////// Group creation property list (GCPL) routines /////// /** * H5Pget_local_heap_size_hint Retrieves the anticipated size of the local heap for original-style groups. @@ -6736,14 +6891,14 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_link_creation_order(long gcpl_id, int crt_order_flags) throws HDF5LibraryException; - // String creation property list (STRCPL) routines // + // /////// String creation property list (STRCPL) routines /////// public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException; public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding) throws HDF5LibraryException; - // Link access property list (LAPL) routines // + // /////// Link access property list (LAPL) routines /////// /** * H5Pget_nlinks retrieves the maximum number of soft or user-defined link traversals allowed, nlinks, before the @@ -6896,7 +7051,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_elink_acc_flags(long lapl_id, int flags) throws HDF5LibraryException, IllegalArgumentException; - // Object copy property list (OCPYPL) routines // + // /////// Object copy property list (OCPYPL) routines /////// /** * H5Pget_copy_object retrieves the properties to be used when an object is copied. @@ -6927,7 +7082,7 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options) throws HDF5LibraryException; - // Other/Older property list routines // + // /////// Other/Older property list routines /////// /** * H5Pget_version retrieves the version information of various objects for a file creation property list. @@ -6955,7 +7110,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pget_version(long plist, int[] version_info) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; - // file drivers property list routines // + // /////// file drivers property list routines /////// public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store) throws HDF5LibraryException, NullPointerException; @@ -7102,20 +7257,28 @@ public class H5 implements java.io.Serializable { // File creation property list (FCPL) routines // // File access property list (FAPL) routines // - // herr_t H5Pset_driver( hid_t plist_id, hid_t new_driver_id, const void *new_driver_info ) - // const void *H5Pget_driver_info( hid_t plist_id ) - // herr_t H5Pget_multi_type ( hid_t fapl_id, H5FD_mem_t *type ) - // herr_t H5Pset_multi_type ( hid_t fapl_id, H5FD_mem_t type ) + // herr_t H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info) + // const void *H5Pget_driver_info(hid_t plist_id) + // herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) + // herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) // herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); // herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); // herr_t H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size); // herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size); + // herr_t H5Pset_all_coll_metadata_ops(hid_t accpl_id, hbool_t is_collective); + // herr_t H5Pset_coll_metadata_write(hid_t fapl_id, hbool_t is_collective); + // herr_t H5Pget_coll_metadata_write(hid_t fapl_id, hbool_t *is_collective); + // herr_t H5Pget_page_buffer_size(hid_t fapl_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc); + // herr_t H5Pset_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t func, void *user_data); + // herr_t H5Pget_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t *func, void **user_data); // Dataset creation property list (DCPL) routines // // Dataset access property list (DAPL) routines // + // herr_t H5Pset_append_flush (hid_t dapl_id, int ndims, const hsize_t boundary[], H5D_append_cb_t func, void *user_data); + // herr_t H5Pget_append_flush(hid_t dapl_id, int ndims, hsize_t boundary[], H5D_append_cb_t *func, void **user_data) // Dataset xfer property list (DXPL) routines // // herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg); diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 8a3d6c8..3e43ba2 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -88,6 +88,7 @@ public class HDF5Constants { public static final int H5D_VDS_ERROR = H5D_VDS_ERROR(); public static final int H5D_VDS_FIRST_MISSING = H5D_VDS_FIRST_MISSING(); public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE(); + public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); public static final int H5E_MAJOR = H5E_MAJOR(); public static final int H5E_MINOR = H5E_MINOR(); @@ -768,6 +769,8 @@ public class HDF5Constants { private static native final int H5D_VDS_LAST_AVAILABLE(); + private static native final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); + private static native final long H5E_ALIGNMENT(); private static native final long H5E_ALREADYEXISTS(); diff --git a/java/src/hdf/overview.html b/java/src/hdf/overview.html index 39d75b7..9c19442 100644 --- a/java/src/hdf/overview.html +++ b/java/src/hdf/overview.html @@ -47,20 +47,20 @@ which has a method: The native method is implemented in C using the Java Native Method Interface (JNI). This is written something like the following: -
JNIEXPORT jint
+
JNIEXPORT jlong
 JNICALL Java_hdf_hdf5lib_H5_H5Fopen
 (
  JNIEnv *env,
  jclass class,
  jstring hdfFile,
  jint flags,
- jint access)
+ jlong access)
  {
 
  /* ...convert Java String to (char *) */
 
  /* call the HDF library */
- retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access );
+ retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access);
 
  /* ... */
 }
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index f6f8bfa..5a4b53e 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -140,6 +140,8 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1FIRST_1MISSING(JNIEnv *env, jclass cls) { return H5D_VDS_FIRST_MISSING; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1LAST_1AVAILABLE(JNIEnv *env, jclass cls) { return H5D_VDS_LAST_AVAILABLE; } +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNK_1DONT_1FILTER_1PARTIAL_1CHUNKS(JNIEnv *env, jclass cls) { return H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS; } JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALIGNMENT(JNIEnv *env, jclass cls) { return H5E_ALIGNMENT; } diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index dcfcd82..cf27341 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5733,6 +5733,217 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts } /* end else */ } /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_virtual_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) +{ + herr_t retVal = -1; + const char *aName; + + PIN_JAVA_STRING(prefix, aName); + if (aName != NULL) { + retVal = H5Pset_virtual_prefix((hid_t)dapl_id, aName); + + UNPIN_JAVA_STRING(prefix, aName); + + if(retVal < 0) + h5libraryError(env); + } +} /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_virtual_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id) +{ + size_t size = 0; + char *pre; + jlong prefix_size = -1; + jstring str = NULL; + + prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)NULL, size); + if(prefix_size < 0) { + h5libraryError(env); + } /* end if */ + else { + size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ + pre = (char*)HDmalloc(sizeof(char)*size); + if (pre == NULL) { + h5outOfMemory(env, "H5Pget_virtual_prefix: malloc failed "); + } /* end if */ + else { + prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)pre, size); + + if (prefix_size >= 0) { + str = ENVPTR->NewStringUTF(ENVPAR pre); + HDfree(pre); + if (str == NULL) + h5JNIFatalError( env, "H5Pget_virtual_prefix: return string not allocated"); + } /* end if */ + else { + HDfree(pre); + h5libraryError(env); + } /* end else */ + } /* end else */ + } /* end else */ + + return (jstring)str; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_efile_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) +{ + herr_t retVal = -1; + const char *aName; + + PIN_JAVA_STRING(prefix, aName); + if (aName != NULL) { + retVal = H5Pset_efile_prefix((hid_t)dapl_id, aName); + + UNPIN_JAVA_STRING(prefix, aName); + + if(retVal < 0) + h5libraryError(env); + } +} /* end Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_efile_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id) +{ + size_t size = 0; + char *pre; + jlong prefix_size = -1; + jstring str = NULL; + + prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)NULL, size); + if(prefix_size < 0) { + h5libraryError(env); + } /* end if */ + else { + size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ + pre = (char*)HDmalloc(sizeof(char)*size); + if (pre == NULL) { + h5outOfMemory(env, "H5Pget_efile_prefix: malloc failed "); + } /* end if */ + else { + prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)pre, size); + + if (prefix_size >= 0) { + str = ENVPTR->NewStringUTF(ENVPAR pre); + HDfree(pre); + if (str == NULL) + h5JNIFatalError( env, "H5Pget_efile_prefix: return string not allocated"); + } /* end if */ + else { + HDfree(pre); + h5libraryError(env); + } /* end else */ + } /* end else */ + } /* end else */ + + return (jstring)str; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_evict_on_close + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close + (JNIEnv *env, jclass clss, jlong fapl_id, jboolean evict_on_close) +{ + herr_t retVal = -1; + hbool_t evict_on_close_val; + + if (evict_on_close == JNI_TRUE) + evict_on_close_val = TRUE; + else + evict_on_close_val = FALSE; + + retVal = H5Pset_evict_on_close((hid_t)fapl_id, (hbool_t)evict_on_close_val); + if (retVal < 0) + h5libraryError(env); +} /* end Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_evict_on_close + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close + (JNIEnv *env, jclass clss, jlong fapl_id) +{ + hbool_t evict_on_close_val = FALSE; + jboolean bval = JNI_FALSE; + + if (H5Pget_evict_on_close((hid_t)fapl_id, (hbool_t *)&evict_on_close_val) < 0) { + h5libraryError(env); + } /* end if */ + else { + if (evict_on_close_val == TRUE) + bval = JNI_TRUE; + } /* end else */ + + return bval; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_chunk_opts + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts + (JNIEnv *env, jclass clss, jlong dcpl_id, jint opts) +{ + herr_t retVal = -1; + + retVal = H5Pset_chunk_opts((hid_t)dcpl_id, (unsigned)opts); + if (retVal < 0) + h5libraryError(env); +} /* end Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_chunk_opts + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts + (JNIEnv *env, jclass clss, jlong dcpl_id) +{ + unsigned opts = 0; + + if (H5Pget_chunk_opts((hid_t)dcpl_id, opts) < 0) + h5libraryError(env); + + return (jint)opts; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts */ + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index d413f69..1d12e3d 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -1533,7 +1533,6 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts (JNIEnv *, jclass, jlong); - /* * Class: hdf_hdf5lib_H5 * Method: H5Pset_metadata_read_attempts @@ -1543,6 +1542,78 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts (JNIEnv *, jclass, jlong, jlong); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_virtual_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix +(JNIEnv *, jclass, jlong, jstring); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_virtual_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_efile_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix +(JNIEnv *, jclass, jlong, jstring); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_efile_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_evict_on_close + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close +(JNIEnv *, jclass, jlong, jboolean); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_evict_on_close + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_chunk_opts + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts +(JNIEnv *, jclass, jlong, jint); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_chunk_opts + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts +(JNIEnv *, jclass, jlong); + #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index ab2f3b1..91ea286 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -415,6 +415,7 @@ JUnit version 4.11 .testH5PH5Pset_shared_mesg_phase_change_HighMaxlistValue .testH5P_layout .testH5Pget_link_creation_order +.testH5Pget_efile_prefix .testH5Pset_shared_mesg_nindexes_InvalidHIGHnindexes .testH5P_file_space_page_size .testH5Pget_shared_mesg_index_Invalid_indexnum @@ -444,6 +445,7 @@ JUnit version 4.11 .testH5Pset_est_link_info_InvalidValues .testH5Pset_local_heap_size_hint .testH5Pget_est_link_info +.testH5Pset_efile_prefix_null .testH5Pset_scaleoffset .testH5Pset_create_intermediate_group_invalidobject .testH5PH5Pset_shared_mesg_phase_change_HighMinbtreeValue @@ -466,6 +468,7 @@ JUnit version 4.11 .testH5Pget_sym_k_null .testH5Pset_nlinks .testH5P_obj_track_times +.testH5Pset_efile_prefix .testH5P_userblock .testH5Pget_local_heap_size_hint .testH5Pset_shared_mesg_index_Invalid_indexnum @@ -504,6 +507,7 @@ JUnit version 4.11 .testH5Pset_mdc_config .testH5P_small_data_block_size .testH5Pset_fapl_log +.testH5P_evict_on_close .testH5Pset_libver_bounds .testH5P_sieve_buf_size .testH5P_elink_file_cache_size @@ -530,11 +534,14 @@ JUnit version 4.11 .testH5Pget_source_datasetname .testH5Pvirtual_storage .testH5Pget_selection_source_dataset +.testH5Pget_virtual_prefix .testH5Pget_source_filename .testH5Pset_get_virtual_printf_gap .testH5Pget_virtual_count +.testH5Pset_virtual_prefix .testH5Pset_get_virtual_view .testH5Pget_mapping_parameters +.testH5Pset_virtual_prefix_null .testH5P_genprop_basic_class .testH5P_genprop_class_iter .testH5P_genprop_basic_class_prop @@ -640,7 +647,7 @@ JUnit version 4.11 Time: XXXX -OK (638 tests) +OK (645 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/TestH5P.java b/java/test/TestH5P.java index 5aafb5b..9e45e4c 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -28,6 +28,7 @@ import hdf.hdf5lib.exceptions.HDF5LibraryException; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; @@ -852,7 +853,7 @@ public class TestH5P { } catch (Throwable err) { err.printStackTrace(); - fail("H5Pset_est_link_info: " + err); + fail("H5Pset_elink_prefix: " + err); } assertTrue("H5Pset_elink_prefix", ret_val >= 0); } @@ -1232,4 +1233,54 @@ public class TestH5P { fail("testH5P_file_space_page_size: " + err); } } + + @Test + public void testH5Pset_efile_prefix() { + String prefix = "tmp"; + try { + H5.H5Pset_efile_prefix(lapl_id, prefix); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pset_efile_prefix: " + err); + } + } + + @Test(expected = NullPointerException.class) + public void testH5Pset_efile_prefix_null() throws Throwable{ + H5.H5Pset_efile_prefix(lapl_id, null); + } + + @Test + public void testH5Pget_efile_prefix() { + String prefix = "tmp"; + String pre = ""; + + try { + H5.H5Pset_efile_prefix(lapl_id, prefix); + pre = H5.H5Pget_efile_prefix(lapl_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_efile_prefix: " + err); + } + assertTrue("The prefix: ", prefix.equals(pre)); + } + + @Ignore + public void testH5P_chunk_opts() { + int chunk_opts = -1; + + try { + chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); + assertTrue("chunk_opts: "+chunk_opts, chunk_opts == 0); + H5.H5Pset_chunk_opts(ocpl_id, HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); + assertTrue("chunk_opts: "+chunk_opts, chunk_opts == HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_lchunk_opts: " + err); + } + } } diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index d4a2231..48a5986 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1376,4 +1376,18 @@ public class TestH5Pfapl { deleteH5file(); _deleteLogFile(); } + + @Test + public void testH5P_evict_on_close() { + boolean ret_val_id = false; + try { + H5.H5Pset_evict_on_close(fapl_id, true); + ret_val_id = H5.H5Pget_evict_on_close(fapl_id); + assertTrue("H5P_evict_on_close", ret_val_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5P_evict_on_close: " + err); + } + } } diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index 40cfbac..ff2e4dc 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -429,4 +429,37 @@ public class TestH5Pvirtual { try {H5.H5Dclose(H5did);} catch (Exception ex) {} } } + + @Test + public void testH5Pset_virtual_prefix() { + String prefix = "tmp"; + try { + H5.H5Pset_virtual_prefix(H5dapl_id, prefix); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pset_virtual_prefix: " + err); + } + } + + @Test(expected = NullPointerException.class) + public void testH5Pset_virtual_prefix_null() throws Throwable{ + H5.H5Pset_virtual_prefix(H5dapl_id, null); + } + + @Test + public void testH5Pget_virtual_prefix() { + String prefix = "tmp"; + String pre = ""; + + try { + H5.H5Pset_virtual_prefix(H5dapl_id, prefix); + pre = H5.H5Pget_virtual_prefix(H5dapl_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_virtual_prefix: " + err); + } + assertTrue("The prefix: ", prefix.equals(pre)); + } } diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7498d01..3882c4c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -58,7 +58,21 @@ New Features Library: -------- - - + - Add prefix option to VDS files. + + Currently, VDS source files must be in the active directory to be + found by the virtual file. Adding the option of a prefix to be set + on the virtual file, using a data access property list (DAPL), + allows the source files to located at an absolute or relative path + to the virtual file. + + New public APIs: + herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); + ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); + The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. + + (ADB - 2017/12/12, HDFFV-9724) + Parallel Library: ----------------- @@ -119,6 +133,20 @@ New Features ------------ - + Java Library: + ---------------- + - Wrappers added for the following APIs: + H5Pset_evict_on_close + H5Pget_evict_on_close + H5Pset_chunk_opts + H5Pget_chunk_opts + H5Pset_efile_prefix + H5Pget_efile_prefix + H5Pset_virtual_prefix + H5Pget_virtual_prefix + + (ADB - 2017/12/20) + Tools: ------ - h5diff @@ -213,7 +241,7 @@ Bug Fixes since HDF5-1.10.1 release CMake implementation for MPI was problematic and would create incorrect MPI library references in the hdf5 libraries. - Reworked the CMake MPI code to properly create CMake targets.Also merged + Reworked the CMake MPI code to properly create CMake targets. Also merged the latest CMake FindMPI.cmake changes to the local copy. This is necessary until HDF changes the CMake minimum to 3.9 or greater. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b163b8a..0552244 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -885,10 +885,7 @@ add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HE TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) -endif () -if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) + target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) @@ -929,10 +926,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) - endif () - if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS}) 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}) diff --git a/src/H5Dint.c b/src/H5Dint.c index b6c0341..bfe1497 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -61,8 +61,8 @@ static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); -static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, - char **extfile_prefix); +static herr_t H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char * prefix_type, + char **file_prefix); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); @@ -963,24 +963,25 @@ done: } /* end H5D__update_oh_info() */ + /*-------------------------------------------------------------------------- - * Function: H5D_build_extfile_prefix + * Function: H5D_build_file_prefix * - * Purpose: Determine the external file prefix to be used and store - * it in extfile_prefix. Stores an empty string if no prefix + * Purpose: Determine the file prefix to be used and store + * it in file_prefix. Stores an empty string if no prefix * should be used. * * Return: SUCCEED/FAIL *-------------------------------------------------------------------------- */ static herr_t -H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/) +H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, char **file_prefix /*out*/) { char *prefix = NULL; /* prefix used to look for the file */ - char *extpath = NULL; /* absolute path of directory the HDF5 file is in */ - size_t extpath_len; /* length of extpath */ + char *filepath = NULL; /* absolute path of directory the HDF5 file is in */ + size_t filepath_len; /* length of file path */ size_t prefix_len; /* length of prefix */ - size_t extfile_prefix_len; /* length of expanded prefix */ + size_t file_prefix_len; /* length of expanded prefix */ H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -990,20 +991,25 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix HDassert(dset); HDassert(dset->oloc.file); - extpath = H5F_EXTPATH(dset->oloc.file); - HDassert(extpath); + filepath = H5F_EXTPATH(dset->oloc.file); + HDassert(filepath); /* XXX: Future thread-safety note - getenv is not required * to be reentrant. */ - prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); + if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) + prefix = HDgetenv("HDF5_VDS_PREFIX"); + else if (HDstrcmp(prefix_type, H5D_ACS_EFILE_PREFIX_NAME) == 0) + prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); + else + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "prefix name is not sensible") if(prefix == NULL || *prefix == '\0') { - /* Set prefix to value of H5D_ACS_EFILE_PREFIX_NAME property */ + /* Set prefix to value of prefix_type property */ if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_peek(plist, H5D_ACS_EFILE_PREFIX_NAME, &prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file prefix") + if(H5P_peek(plist, prefix_type, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file prefix") } /* end if */ /* Prefix has to be checked for NULL / empty string again because the @@ -1013,29 +1019,29 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /* filename is interpreted as relative to the current directory, * does not need to be expanded */ - if(NULL == (*extfile_prefix = (char *)H5MM_strdup(""))) + if(NULL == (*file_prefix = (char *)H5MM_strdup(""))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end if */ else { if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) { /* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */ - extpath_len = HDstrlen(extpath); + filepath_len = HDstrlen(filepath); prefix_len = HDstrlen(prefix); - extfile_prefix_len = extpath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; + file_prefix_len = filepath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; - if(NULL == (*extfile_prefix = (char *)H5MM_malloc(extfile_prefix_len))) + if(NULL == (*file_prefix = (char *)H5MM_malloc(file_prefix_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") - HDsnprintf(*extfile_prefix, extfile_prefix_len, "%s%s", extpath, prefix + HDstrlen("${ORIGIN}")); + HDsnprintf(*file_prefix, file_prefix_len, "%s%s", filepath, prefix + HDstrlen("${ORIGIN}")); } /* end if */ else { - if(NULL == (*extfile_prefix = (char *)H5MM_strdup(prefix))) + if(NULL == (*file_prefix = (char *)H5MM_strdup(prefix))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end else */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_build_extfile_prefix() */ +} /* H5D_build_file_prefix() */ /*------------------------------------------------------------------------- @@ -1217,9 +1223,13 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") /* Set the external file prefix */ - if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) + if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &new_dset->shared->extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") + /* Set the vds file prefix */ + if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &new_dset->shared->vds_prefix) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") + /* Add the dataset to the list of opened objects in the file */ if(H5FO_top_incr(new_dset->oloc.file, new_dset->oloc.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't incr object ref. count") @@ -1265,6 +1275,7 @@ done: if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list") new_dset->shared->extfile_prefix = (char *)H5MM_xfree(new_dset->shared->extfile_prefix); + new_dset->shared->vds_prefix = (char *)H5MM_xfree(new_dset->shared->vds_prefix); new_dset->shared = H5FL_FREE(H5D_shared_t, new_dset->shared); } /* end if */ new_dset->oloc.file = NULL; @@ -1351,6 +1362,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) H5D_shared_t *shared_fo = NULL; H5D_t *dataset = NULL; char *extfile_prefix = NULL; /* Expanded external file prefix */ + char *vds_prefix = NULL; /* Expanded vds prefix */ H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1371,9 +1383,13 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path") /* Get the external file prefix */ - if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) + if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") + /* Get the vds prefix */ + if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &vds_prefix) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") + /* Check if dataset was already open */ if(NULL == (shared_fo = (H5D_shared_t *)H5FO_opened(dataset->oloc.file, dataset->oloc.addr))) { /* Clear any errors from H5FO_opened() */ @@ -1399,6 +1415,11 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) /* Prevent string from being freed during done: */ extfile_prefix = NULL; + /* Set the vds file prefix */ + dataset->shared->vds_prefix = vds_prefix; + /* Prevent string from being freed during done: */ + vds_prefix = NULL; + } /* end if */ else { /* Point to shared info */ @@ -1430,12 +1451,14 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) done: extfile_prefix = (char *)H5MM_xfree(extfile_prefix); + vds_prefix = (char *)H5MM_xfree(vds_prefix); if(ret_value == NULL) { /* Free the location--casting away const*/ if(dataset) { if(shared_fo == NULL && dataset->shared) { /* Need to free shared fo */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); + dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); } @@ -1818,6 +1841,9 @@ H5D_close(H5D_t *dataset) /* Free the external file prefix */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); + /* Free the vds file prefix */ + dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); + /* Release layout, fill-value, efl & pipeline messages */ if(dataset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT) free_failed |= (H5O_msg_reset(H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline) < 0) || @@ -3360,6 +3386,10 @@ H5D_get_access_plist(H5D_t *dset) if(H5P_set(new_plist, H5D_ACS_VDS_PRINTF_GAP_NAME, &(dset->shared->layout.storage.u.virt.printf_gap)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS printf gap") + /* Set the vds prefix option */ + if(H5P_set(new_plist, H5D_ACS_VDS_PREFIX_NAME, &(dset->shared->vds_prefix)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds prefix") + /* Set the external file prefix option */ if(H5P_set(new_plist, H5D_ACS_EFILE_PREFIX_NAME, &(dset->shared->extfile_prefix)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set external file prefix") diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 542abd0..45f2d3a 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -476,6 +476,7 @@ typedef struct H5D_shared_t { H5D_append_flush_t append_flush; /* Append flush property information */ char *extfile_prefix; /* expanded external file prefix */ + char *vds_prefix; /* expanded vds prefix */ } H5D_shared_t; struct H5D_t { @@ -598,7 +599,7 @@ H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id); H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id); /* Internal I/O routines */ -H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, +H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index fb994d8..ed13467 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -47,12 +47,13 @@ #define H5D_CRT_EXT_FILE_LIST_NAME "efl" /* External file list */ /* ======== Dataset access property names ======== */ -#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ -#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ -#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ -#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ +#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ +#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ +#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ +#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ #define H5D_ACS_VDS_PRINTF_GAP_NAME "vds_printf_gap" /* VDS printf gap size */ -#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ +#define H5D_ACS_VDS_PREFIX_NAME "vds_prefix" /* VDS file prefix */ +#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ #define H5D_ACS_EFILE_PREFIX_NAME "external file prefix" /* External file prefix */ /* ======== Data transfer properties ======== */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 3be2353..8d861c9 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -55,6 +55,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ +#include "H5Pprivate.h" /* Property Lists */ #include "H5Sprivate.h" /* Dataspaces */ @@ -731,6 +732,255 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_delete */ + +/*-------------------------------------------------------------------------- + * Function: H5D__virtual_build_name + * + * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME + * + * Return: Non-negative on success/Negative on failure + *--------------------------------------------------------------------------*/ +static herr_t +H5D__virtual_build_name(char *prefix, char *file_name, char **full_name/*out*/) +{ + size_t prefix_len; /* length of prefix */ + size_t fname_len; /* Length of external link file name */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + prefix_len = HDstrlen(prefix); + fname_len = HDstrlen(file_name); + + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") + + /* Compose the full file name */ + HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, + (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__virtual_build_name() */ + + +/*-------------------------------------------------------------------------- + * Function: H5D_getenv_prefix_name -- + * + * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, + * which is separated by the environment delimiter. + * env_prefix is modified to point to the remaining pathnames + * in the list. + * + * Return: A pointer to a pathname +--------------------------------------------------------------------------*/ +static char * +H5D_getenv_prefix_name(char **env_prefix/*in,out*/) +{ + char *retptr=NULL; + char *strret=NULL; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + strret = HDstrchr(*env_prefix, H5_COLON_SEPC); + if (strret == NULL) { + retptr = *env_prefix; + *env_prefix = strret; + } else { + retptr = *env_prefix; + *env_prefix = strret + 1; + *strret = '\0'; + } + + FUNC_LEAVE_NOAPI(retptr) +} /* end H5D_getenv_prefix_name() */ + +/*------------------------------------------------------------------------- + * Function: H5D__virtual_open_file + * + * Purpose: Attempts to open a source dataset file. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +static H5F_t * +H5D__virtual_open_file(hid_t plist_id, const H5F_t *vdset_file, + const char *file_name, + hid_t fapl_id, hid_t dxpl_id) +{ + H5F_t *src_file = NULL; /* Source file */ + H5F_t *ret_value = NULL; /* Actual return value */ + char *full_name = NULL; /* File name with prefix */ + char *my_prefix; /* Library's copy of the prefix */ + unsigned intent; /* File access permissions */ + char *actual_file_name = NULL; /* Virtual file's actual name */ + char *temp_file_name = NULL; /* Temporary pointer to file name */ + size_t temp_file_name_len; /* Length of temporary file name */ + + FUNC_ENTER_STATIC + + /* Simplify intent flags for open calls */ + intent = H5F_INTENT(vdset_file); + intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); + + /* Copy the file name to use */ + if(NULL == (temp_file_name = H5MM_strdup(file_name))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + temp_file_name_len = HDstrlen(temp_file_name); + + /* target file_name is an absolute pathname: see RM for detailed description */ + if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + char *ptr; + + H5E_clear_stack(NULL); + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(file_name, ptr) + HDassert(ptr); + + /* Increment past delimiter */ + ptr++; + + /* Copy into the temp. file name */ + HDstrncpy(temp_file_name, ptr, temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + else if(H5_CHECK_ABS_DRIVE(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + + H5E_clear_stack(NULL); + + /* strip ":" */ + HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + + /* try searching from paths set in the environment variable */ + if(src_file == NULL) { + char *env_prefix; + + if(NULL != (env_prefix = HDgetenv("HDF5_VDS_PREFIX"))) { + char *tmp_env_prefix, *saved_env; + + if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + + while((tmp_env_prefix) && (*tmp_env_prefix)) { + char *out_prefix_name; + + out_prefix_name = H5D_getenv_prefix_name(&tmp_env_prefix/*in,out*/); + if(out_prefix_name && (*out_prefix_name)) { + if(H5D__virtual_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { + saved_env = (char *)H5MM_xfree(saved_env); + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + } /* end if */ + + src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); + full_name = (char *)H5MM_xfree(full_name); + if(src_file != NULL) + break; + H5E_clear_stack(NULL); + } /* end if */ + } /* end while */ + saved_env = (char *)H5MM_xfree(saved_env); + } /* end if */ + } /* end if */ + + /* try searching from property list */ + if(src_file == NULL) { + size_t size = 0; + H5E_BEGIN_TRY { + size = H5Pget_virtual_prefix(plist_id, NULL, 0); + } H5E_END_TRY; + if(size < 0) + my_prefix = NULL; + else { + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (my_prefix = (char *)H5MM_malloc(size + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate prefix buffer") + if(H5Pget_virtual_prefix(plist_id, my_prefix, size+1) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") + if(my_prefix) { + if(H5D__virtual_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + my_prefix = (char *)H5MM_xfree(my_prefix); + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } + } /* end if */ + } /* end if */ + + /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ + if(src_file == NULL) { + char *vdspath; + + if(NULL != (vdspath = H5F_EXTPATH(vdset_file))) { + if(H5D__virtual_build_name(vdspath, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + } /* end if */ + + /* try the relative file_name stored in temp_file_name */ + if(src_file == NULL) { + if(NULL == (src_file = H5F_open(temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + } /* end if */ + + /* try the 'resolved' name for the virtual file */ + if(src_file == NULL) { + char *ptr = NULL; + + /* Copy resolved file name */ + if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(vdset_file)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string") + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(actual_file_name, ptr) + if(!ptr) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + + /* Truncate filename portion from actual file name path */ + *ptr = '\0'; + + /* Build new file name for the external file */ + if(H5D__virtual_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + actual_file_name = (char *)H5MM_xfree(actual_file_name); + + /* Try opening with the resolved name */ + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + + /* Success */ + ret_value = src_file; +done: + if((NULL == ret_value) && src_file) + if(H5F_try_close(src_file, NULL) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, NULL, "can't close source file") + if(my_prefix) + my_prefix = (char *)H5MM_xfree(my_prefix); + if(full_name) + full_name = (char *)H5MM_xfree(full_name); + if(temp_file_name) + temp_file_name = (char *)H5MM_xfree(temp_file_name); + if(actual_file_name) + actual_file_name = (char *)H5MM_xfree(actual_file_name); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__virtual_open_file() */ + /*------------------------------------------------------------------------- * Function: H5D__virtual_open_source_dset @@ -750,9 +1000,13 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id) { H5F_t *src_file = NULL; /* Source file */ + char *vds_prefix = NULL; /* Source file vds_prefix */ hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */ H5G_loc_t src_root_loc; /* Object location of source file root group */ herr_t ret_value = SUCCEED; /* Return value */ + char *full_name = NULL; /* File name with prefix */ + unsigned intent; /* File access permissions */ + hid_t plist_id = -1; /* Property list pointer */ FUNC_ENTER_STATIC @@ -765,8 +1019,9 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { - /* Open the source file */ - if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + if((plist_id = H5D_get_access_plist(vdset)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get access plist") + if(NULL == (src_file = H5D__virtual_open_file(plist_id, vdset->oloc.file, source_dset->file_name, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ else src_file_open = TRUE; @@ -803,6 +1058,8 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, } /* end if */ done: + if(plist_id >= 0) + H5Pclose(plist_id); /* Close source file */ if(src_file_open) if(H5F_try_close(src_file, NULL) < 0) @@ -1407,7 +1664,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "failed to clip unlimited selection") } /* end if */ - /* Update cached values unlim_extent_source and + /* Update cached values unlim_extent_source and * clip_size_virtual */ storage->list[i].unlim_extent_source = curr_dims[storage->list[i].unlim_dim_source]; storage->list[i].clip_size_virtual = clip_size; @@ -1559,7 +1816,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space") /* Mark the space as dirty, for later writing to the file */ - if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) + if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ @@ -2246,7 +2503,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close projected memory space") storage->list[i].sub_dset[j].projected_mem_space = NULL; } /* end if */ - else + else *tot_nelmts += (hsize_t)select_nelmts; } /* end if */ } /* end for */ @@ -2265,7 +2522,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Check if anything is selected */ if(select_nelmts > (hssize_t)0) { /* Open source dataset */ - if(!storage->list[i].source_dset.dset) + if(!storage->list[i].source_dset.dset) /* Try to open dataset */ if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") @@ -2506,7 +2763,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "unable to clip fill selection") /* Write fill values to memory buffer */ - if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, + if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed") diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index daf0a52..96b8e36 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -25,13 +25,13 @@ typedef struct H5F_t H5F_t; #include "H5Fpublic.h" /* Public headers needed by this file */ -#include "H5FDpublic.h" /* File drivers */ +#include "H5FDpublic.h" /* File drivers */ /* Private headers needed by this file */ #ifdef H5_HAVE_PARALLEL -#include "H5Pprivate.h" /* Property lists */ +#include "H5Pprivate.h" /* Property lists */ #endif /* H5_HAVE_PARALLEL */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /**************************/ @@ -43,68 +43,68 @@ typedef struct H5F_t H5F_t; * Currently, all file meta-data is little-endian. */ -# define INT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define INT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define UINT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define UINT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define INT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ +# define INT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ } -# define UINT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ +# define UINT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ } /* Encode an unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define ENCODE_VAR(p, typ, n, l) { \ - typ _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for(_i = 0; _i < l; _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t*)(p) + l; \ +# define ENCODE_VAR(p, typ, n, l) { \ + typ _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for(_i = 0; _i < l; _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t*)(p) + l; \ } /* Encode a 32-bit unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ # define UINT32ENCODE_VAR(p, n, l) ENCODE_VAR(p, uint32_t, n, l) -# define INT64ENCODE(p, n) { \ - int64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = (n) < 0 ? 0xff : 0; \ - (p) = (uint8_t*)(p)+8; \ +# define INT64ENCODE(p, n) { \ + int64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = (n) < 0 ? 0xff : 0; \ + (p) = (uint8_t*)(p)+8; \ } -# define UINT64ENCODE(p, n) { \ - uint64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = 0; \ - (p) = (uint8_t*)(p) + 8; \ +# define UINT64ENCODE(p, n) { \ + uint64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = 0; \ + (p) = (uint8_t*)(p) + 8; \ } /* Encode a 64-bit unsigned integer into a variable-sized buffer */ @@ -113,31 +113,31 @@ typedef struct H5F_t H5F_t; /* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define UINT64ENCODE_VARLEN(p, n) { \ - uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM_limit_enc_size(__n); \ - \ - *(p)++ = (uint8_t)_s; \ - UINT64ENCODE_VAR(p, __n, _s); \ +# define UINT64ENCODE_VARLEN(p, n) { \ + uint64_t __n = (uint64_t)(n); \ + unsigned _s = H5VM_limit_enc_size(__n); \ + \ + *(p)++ = (uint8_t)_s; \ + UINT64ENCODE_VAR(p, __n, _s); \ } -# define H5_ENCODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32ENCODE(p, n) \ +# define H5_ENCODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32ENCODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_ENCODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - HDmemcpy(&_n, &n, sizeof(double)); \ - for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t *)(p) + 8; \ +# define H5_ENCODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + HDmemcpy(&_n, &n, sizeof(double)); \ + for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t *)(p) + 8; \ } /* DECODE converts little endian bytes pointed by p to integer values and store @@ -148,68 +148,68 @@ typedef struct H5F_t H5F_t; * correctly even if i is actually a 64bit int like in a Cray. */ -# define INT16DECODE(p, i) { \ - (i) = (int16_t)((*(p) & 0xff)); (p)++; \ +# define INT16DECODE(p, i) { \ + (i) = (int16_t)((*(p) & 0xff)); (p)++; \ (i) |= (int16_t)(((*(p) & 0xff) << 8) | \ - ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ + ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ } -# define UINT16DECODE(p, i) { \ - (i) = (uint16_t) (*(p) & 0xff); (p)++; \ - (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ +# define UINT16DECODE(p, i) { \ + (i) = (uint16_t) (*(p) & 0xff); (p)++; \ + (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ } -# define INT32DECODE(p, i) { \ - (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ +# define INT32DECODE(p, i) { \ + (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ (i) |= ((int32_t)(((*(p) & (unsigned)0xff) << 24) | \ ((*(p) & (unsigned)0x80) ? (unsigned)(~0xffffffff) : (unsigned)0x0))); (p)++; \ } -# define UINT32DECODE(p, i) { \ - (i) = (uint32_t)(*(p) & 0xff); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ +# define UINT32DECODE(p, i) { \ + (i) = (uint32_t)(*(p) & 0xff); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ } /* Decode a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define DECODE_VAR(p, n, l) { \ - size_t _i; \ - \ - n = 0; \ - (p) += l; \ - for (_i = 0; _i < l; _i++) \ - n = (n << 8) | *(--p); \ - (p) += l; \ +# define DECODE_VAR(p, n, l) { \ + size_t _i; \ + \ + n = 0; \ + (p) += l; \ + for (_i = 0; _i < l; _i++) \ + n = (n << 8) | *(--p); \ + (p) += l; \ } /* Decode a variable-sized buffer into a 32-bit unsigned integer */ /* (Assumes that the high bits of the integer will be zero) */ # define UINT32DECODE_VAR(p, n, l) DECODE_VAR(p, n, l) -# define INT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(int64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define INT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(int64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } -# define UINT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(uint64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define UINT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(uint64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } /* Decode a variable-sized buffer into a 64-bit unsigned integer */ @@ -218,58 +218,58 @@ typedef struct H5F_t H5F_t; /* Decode a 64-bit unsigned integer and its length from a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define UINT64DECODE_VARLEN(p, n) { \ - unsigned _s = *(p)++; \ - \ - UINT64DECODE_VAR(p, n, _s); \ +# define UINT64DECODE_VARLEN(p, n) { \ + unsigned _s = *(p)++; \ + \ + UINT64DECODE_VAR(p, n, _s); \ } -# define H5_DECODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32DECODE(p, n) \ +# define H5_DECODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32DECODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_DECODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - _n = 0; \ - (p) += 8; \ - for(_u = 0; _u < sizeof(uint64_t); _u++) \ - _n = (_n << 8) | *(--p); \ - HDmemcpy(&(n), &_n, sizeof(double)); \ - (p) += 8; \ +# define H5_DECODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + _n = 0; \ + (p) += 8; \ + for(_u = 0; _u < sizeof(uint64_t); _u++) \ + _n = (_n << 8) | *(--p); \ + HDmemcpy(&(n), &_n, sizeof(double)); \ + (p) += 8; \ } /* Address-related macros */ -#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ - HADDR_UNDEF==(X)+(haddr_t)(Z) || \ - (X)+(haddr_t)(Z)<(X)) -#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) +#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ + HADDR_UNDEF==(X)+(haddr_t)(Z) || \ + (X)+(haddr_t)(Z)<(X)) +#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) /* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making * certain that X is not HADDR_UNDEF and then checking that X equals Y */ -#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ - (X)==(Y)) -#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) -#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<(Y)) -#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<=(Y)) -#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>(Y)) -#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>=(Y)) -#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ - (H5F_addr_lt((X), (Y)) ? -1 : 1)) -#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) +#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ + (X)==(Y)) +#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) +#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<(Y)) +#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<=(Y)) +#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>(Y)) +#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>=(Y)) +#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ + (H5F_addr_lt((X), (Y)) ? -1 : 1)) +#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) #define H5F_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \ ((O1) >= (O2) && (O1) < ((O2) + (L2)))) @@ -294,7 +294,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr) #define H5F_SYM_LEAF_K(F) ((F)->shared->sblock->sym_leaf_k) #define H5F_KVALUE(F,T) ((F)->shared->sblock->btree_k[(T)->id]) -#define H5F_NREFS(F) ((F)->shared->nrefs) +#define H5F_NREFS(F) ((F)->shared->nrefs) #define H5F_SIZEOF_ADDR(F) ((F)->shared->sizeof_addr) #define H5F_SIZEOF_SIZE(F) ((F)->shared->sizeof_size) #define H5F_SOHM_ADDR(F) ((F)->shared->sohm_addr) @@ -325,8 +325,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) ((F)->shared->use_mdc_logging) #define H5F_START_MDC_LOG_ON_ACCESS(F) ((F)->shared->start_mdc_log_on_access) #define H5F_MDC_LOG_LOCATION(F) ((F)->shared->mdc_log_location) -#define H5F_ALIGNMENT(F) ((F)->shared->alignment) -#define H5F_THRESHOLD(F) ((F)->shared->threshold) +#define H5F_ALIGNMENT(F) ((F)->shared->alignment) +#define H5F_THRESHOLD(F) ((F)->shared->threshold) #define H5F_PGEND_META_THRES(F) ((F)->shared->fs.pgend_meta_thres) #define H5F_POINT_OF_NO_RETURN(F) ((F)->shared->fs.point_of_no_return) #define H5F_FIRST_ALLOC_DEALLOC(F) ((F)->shared->first_alloc_dealloc) @@ -351,7 +351,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) (H5F_get_base_addr(F)) #define H5F_SYM_LEAF_K(F) (H5F_sym_leaf_k(F)) #define H5F_KVALUE(F,T) (H5F_Kvalue(F,T)) -#define H5F_NREFS(F) (H5F_get_nrefs(F)) +#define H5F_NREFS(F) (H5F_get_nrefs(F)) #define H5F_SIZEOF_ADDR(F) (H5F_sizeof_addr(F)) #define H5F_SIZEOF_SIZE(F) (H5F_sizeof_size(F)) #define H5F_SOHM_ADDR(F) (H5F_get_sohm_addr(F)) @@ -382,8 +382,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) (H5F_use_mdc_logging(F)) #define H5F_START_MDC_LOG_ON_ACCESS(F) (H5F_start_mdc_log_on_access(F)) #define H5F_MDC_LOG_LOCATION(F) (H5F_mdc_log_location(F)) -#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) -#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) +#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) +#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) #define H5F_PGEND_META_THRES(F) (H5F_get_pgend_meta_thres(F)) #define H5F_POINT_OF_NO_RETURN(F) (H5F_get_point_of_no_return(F)) #define H5F_FIRST_ALLOC_DEALLOC(F) (H5F_get_first_alloc_dealloc(F)) @@ -392,32 +392,32 @@ typedef struct H5F_t H5F_t; /* Macros to encode/decode offset/length's for storing in the file */ -#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ - case 4: UINT32ENCODE(p,o); break; \ - case 8: UINT64ENCODE(p,o); break; \ - case 2: UINT16ENCODE(p,o); break; \ +#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ + case 4: UINT32ENCODE(p,o); break; \ + case 8: UINT64ENCODE(p,o); break; \ + case 2: UINT16ENCODE(p,o); break; \ } -#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ - case 4: UINT32DECODE(p, o); break; \ - case 8: UINT64DECODE(p, o); break; \ - case 2: UINT16DECODE(p, o); break; \ +#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ + case 4: UINT32DECODE(p, o); break; \ + case 8: UINT64DECODE(p, o); break; \ + case 2: UINT16DECODE(p, o); break; \ } -#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32ENCODE(p,l); break; \ - case 8: UINT64ENCODE(p,l); break; \ - case 2: UINT16ENCODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32ENCODE(p,l); break; \ + case 8: UINT64ENCODE(p,l); break; \ + case 2: UINT16ENCODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_ENCODE_LENGTH(f,p,l) H5F_ENCODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) -#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32DECODE(p,l); break; \ - case 8: UINT64DECODE(p,l); break; \ - case 2: UINT16DECODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32DECODE(p,l); break; \ + case 8: UINT64DECODE(p,l); break; \ + case 2: UINT16DECODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_DECODE_LENGTH(f,p,l) H5F_DECODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) @@ -427,13 +427,13 @@ typedef struct H5F_t H5F_t; * with. */ #if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_SIZET2OFFT(X) \ +# define H5F_OVERFLOW_SIZET2OFFT(X) \ ((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(HDoff_t)-1))) #else # define H5F_OVERFLOW_SIZET2OFFT(X) 0 #endif #if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_HSIZET2OFFT(X) \ +# define H5F_OVERFLOW_HSIZET2OFFT(X) \ ((hsize_t)(X) >= (hsize_t)((hsize_t)1 << (8 * sizeof(HDoff_t) - 1))) #else # define H5F_OVERFLOW_HSIZET2OFFT(X) 0 @@ -461,14 +461,14 @@ typedef struct H5F_t H5F_t; #define H5F_CRT_SHMSG_LIST_MAX_NAME "shmsg_list_max" /* Shared message list maximum size */ #define H5F_CRT_SHMSG_BTREE_MIN_NAME "shmsg_btree_min" /* Shared message B-tree minimum size */ #define H5F_CRT_FILE_SPACE_STRATEGY_NAME "file_space_strategy" /* File space handling strategy */ -#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ +#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ #define H5F_CRT_FREE_SPACE_THRESHOLD_NAME "free_space_threshold" /* Free space section threshold */ #define H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME "file_space_page_size" /* File space page size */ /* ========= File Access properties ============ */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ +#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ #define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ @@ -487,7 +487,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ -#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ +#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ @@ -504,7 +504,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME "page_buffer_min_raw_perc" /* the min raw data percentage for the page buffer cache */ /* ======================== File Mount properties ====================*/ -#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ +#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ #ifdef H5_HAVE_PARALLEL @@ -513,20 +513,20 @@ typedef struct H5F_t H5F_t; #endif /* H5_HAVE_PARALLEL */ /* Define the HDF5 file signature */ -#define H5F_SIGNATURE "\211HDF\r\n\032\n" +#define H5F_SIGNATURE "\211HDF\r\n\032\n" #define H5F_SIGNATURE_LEN 8 /* Version #'s of the major components of the file format */ -#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ -#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ -#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ -#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ -#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ +#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ +#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ +#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ +#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ +#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ #define HDF5_SUPERBLOCK_VERSION_V18_LATEST HDF5_SUPERBLOCK_VERSION_2 /* The latest superblock version for v18 */ -#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ -#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ -#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ -#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ +#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ +#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ +#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ +#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ /* B-tree internal 'K' values */ #define HDF5_BTREE_SNODE_IK_DEF 16 @@ -536,54 +536,54 @@ typedef struct H5F_t H5F_t; if it is changed, the code must compensate. -QAK */ -#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ - /* See format specification on version 1 B-trees */ +#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ + /* See format specification on version 1 B-trees */ /* Default file space handling strategy */ -#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR +#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_PERSIST_DEF FALSE +#define H5F_FREE_SPACE_PERSIST_DEF FALSE /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_THRESHOLD_DEF 1 +#define H5F_FREE_SPACE_THRESHOLD_DEF 1 /* For paged aggregation: default file space page size when not set */ -#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096 +#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 +#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 +#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 0 /* Default for threshold for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_DEF 1 +#define H5F_ALIGN_DEF 1 /* Default for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_THRHD_DEF 1 +#define H5F_ALIGN_THRHD_DEF 1 /* Default size for meta data aggregation block (can be set via H5Pset_meta_block_size()) */ -#define H5F_META_BLOCK_SIZE_DEF 2048 +#define H5F_META_BLOCK_SIZE_DEF 2048 /* Default size for small data aggregation block (can be set via H5Pset_small_data_block_size()) */ -#define H5F_SDATA_BLOCK_SIZE_DEF 2048 +#define H5F_SDATA_BLOCK_SIZE_DEF 2048 /* Check for file using paged aggregation */ #define H5F_PAGED_AGGR(F) (F->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE && F->shared->fs_page_size) /* Metadata read attempt values */ -#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ -#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ +#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ +#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ /* Macros to define signatures of all objects in the file */ /* Size of signature information (on disk) */ /* (all on-disk signatures should be this length) */ -#define H5_SIZEOF_MAGIC 4 +#define H5_SIZEOF_MAGIC 4 /* Size of checksum information (on disk) */ /* (all on-disk checksums should be this length) */ -#define H5_SIZEOF_CHKSUM 4 +#define H5_SIZEOF_CHKSUM 4 /* v1 B-tree node signature */ #define H5B_MAGIC "TREE" @@ -704,11 +704,11 @@ typedef enum H5F_fs_state_t { typedef enum H5F_mem_page_t { H5F_MEM_PAGE_DEFAULT = 0, /* Not used */ H5F_MEM_PAGE_SUPER = 1, - H5F_MEM_PAGE_BTREE = 2, - H5F_MEM_PAGE_DRAW = 3, - H5F_MEM_PAGE_GHEAP = 4, - H5F_MEM_PAGE_LHEAP = 5, - H5F_MEM_PAGE_OHDR = 6, + H5F_MEM_PAGE_BTREE = 2, + H5F_MEM_PAGE_DRAW = 3, + H5F_MEM_PAGE_GHEAP = 4, + H5F_MEM_PAGE_LHEAP = 5, + H5F_MEM_PAGE_OHDR = 6, H5F_MEM_PAGE_LARGE_SUPER = 7, H5F_MEM_PAGE_LARGE_BTREE = 8, H5F_MEM_PAGE_LARGE_DRAW = 9, diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 61b4183..4765d00 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -144,7 +144,7 @@ H5F_get_actual_name(const H5F_t *f) * Function: H5F_get_extpath * * Purpose: Retrieve the file's 'extpath' flags - * This is used by H5L_extern_traverse() and H5D_build_extfile_prefix() to retrieve the main file's location + * This is used by H5L_extern_traverse() and H5D_build_file_prefix() to retrieve the main file's location * when searching the target file. * * Return: 'extpath' on success/abort on failure (shouldn't fail) diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 494de3e..da06297 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -71,6 +71,17 @@ #define H5D_ACS_VDS_PRINTF_GAP_DEF (hsize_t)0 #define H5D_ACS_VDS_PRINTF_GAP_ENC H5P__encode_hsize_t #define H5D_ACS_VDS_PRINTF_GAP_DEC H5P__decode_hsize_t +/* Definitions for VDS file prefix */ +#define H5D_ACS_VDS_PREFIX_SIZE sizeof(char *) +#define H5D_ACS_VDS_PREFIX_DEF NULL /*default is no prefix */ +#define H5D_ACS_VDS_PREFIX_SET H5P__dapl_vds_file_pref_set +#define H5D_ACS_VDS_PREFIX_GET H5P__dapl_vds_file_pref_get +#define H5D_ACS_VDS_PREFIX_ENC H5P__dapl_vds_file_pref_enc +#define H5D_ACS_VDS_PREFIX_DEC H5P__dapl_vds_file_pref_dec +#define H5D_ACS_VDS_PREFIX_DEL H5P__dapl_vds_file_pref_del +#define H5D_ACS_VDS_PREFIX_COPY H5P__dapl_vds_file_pref_copy +#define H5D_ACS_VDS_PREFIX_CMP H5P__dapl_vds_file_pref_cmp +#define H5D_ACS_VDS_PREFIX_CLOSE H5P__dapl_vds_file_pref_close /* Definition for append flush */ #define H5D_ACS_APPEND_FLUSH_SIZE sizeof(H5D_append_flush_t) #define H5D_ACS_APPEND_FLUSH_DEF {0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},NULL,NULL} @@ -112,6 +123,14 @@ static herr_t H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value); /* Property list callbacks */ static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dacc_vds_view_dec(const void **pp, void *value); +static herr_t H5P__dapl_vds_file_pref_set(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_get(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size); +static herr_t H5P__dapl_vds_file_pref_dec(const void **_pp, void *value); +static herr_t H5P__dapl_vds_file_pref_del(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_copy(const char* name, size_t size, void* value); +static int H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t size); +static herr_t H5P__dapl_vds_file_pref_close(const char* name, size_t size, void* value); /* Property list callbacks */ static herr_t H5P__dapl_efile_pref_set(hid_t prop_id, const char* name, size_t size, void* value); @@ -160,6 +179,7 @@ const H5P_libclass_t H5P_CLS_DACC[1] = {{ /* Property value defaults */ static const H5D_append_flush_t H5D_def_append_flush_g = H5D_ACS_APPEND_FLUSH_DEF; /* Default setting for append flush */ static const char *H5D_def_efile_prefix_g = H5D_ACS_EFILE_PREFIX_DEF; /* Default external file prefix string */ +static const char *H5D_def_vds_prefix_g = H5D_ACS_VDS_PREFIX_DEF; /* Default vds prefix string */ /*------------------------------------------------------------------------- @@ -210,6 +230,12 @@ H5P__dacc_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register property for vds prefix */ + if(H5P_register_real(pclass, H5D_ACS_VDS_PREFIX_NAME, H5D_ACS_VDS_PREFIX_SIZE, &H5D_def_vds_prefix_g, + NULL, H5D_ACS_VDS_PREFIX_SET, H5D_ACS_VDS_PREFIX_GET, H5D_ACS_VDS_PREFIX_ENC, H5D_ACS_VDS_PREFIX_DEC, + H5D_ACS_VDS_PREFIX_DEL, H5D_ACS_VDS_PREFIX_COPY, H5D_ACS_VDS_PREFIX_CMP, H5D_ACS_VDS_PREFIX_CLOSE) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register info for append flush */ /* (Note: this property should not have an encode/decode callback -QAK) */ if(H5P_register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g, @@ -226,6 +252,254 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dacc_reg_prop() */ + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_set + * + * Purpose: Copies a vds file prefix property when it's set + * for a property list + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(value); + + /* Copy the prefix */ + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_set() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_get + * + * Purpose: Copies a vds file prefix property when it's retrieved + * from a property list + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(value); + + /* Copy the prefix */ + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_get() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_enc + * + * Purpose: Callback routine which is called whenever the vds file flags + * property in the dataset access property list is + * encoded. + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) +{ + const char *vds_file_pref = *(const char * const *)value; + uint8_t **pp = (uint8_t **)_pp; + size_t len = 0; + uint64_t enc_value; + unsigned enc_size; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); + + /* calculate prefix length */ + if(NULL != vds_file_pref) + len = HDstrlen(vds_file_pref); + + enc_value = (uint64_t)len; + enc_size = H5VM_limit_enc_size(enc_value); + HDassert(enc_size < 256); + + if(NULL != *pp) { + /* encode the length of the prefix */ + *(*pp)++ = (uint8_t)enc_size; + UINT64ENCODE_VAR(*pp, enc_value, enc_size); + + /* encode the prefix */ + if(NULL != vds_file_pref) { + HDmemcpy(*(char **)pp, vds_file_pref, len); + *pp += len; + } /* end if */ + } /* end if */ + + *size += (1 + enc_size); + if(NULL != vds_file_pref) + *size += len; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_enc() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_dec + * + * Purpose: Callback routine which is called whenever the vds file prefix + * property in the dataset access property list is + * decoded. + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value) +{ + char **vds_file_pref = (char **)_value; + const uint8_t **pp = (const uint8_t **)_pp; + size_t len; + uint64_t enc_value; /* Decoded property value */ + unsigned enc_size; /* Size of encoded property */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(pp); + HDassert(*pp); + HDassert(vds_file_pref); + HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); + + /* Decode the size */ + enc_size = *(*pp)++; + HDassert(enc_size < 256); + + /* Decode the value */ + UINT64DECODE_VAR(*pp, enc_value, enc_size); + len = (size_t)enc_value; + + if(0 != len) { + /* Make a copy of the user's prefix string */ + if(NULL == (*vds_file_pref = (char *)H5MM_malloc(len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "memory allocation failed for prefix") + HDstrncpy(*vds_file_pref, *(const char **)pp, len); + (*vds_file_pref)[len] = '\0'; + + *pp += len; + } /* end if */ + else + *vds_file_pref = NULL; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dapl_vds_file_pref_dec() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_del + * + * Purpose: Frees memory used to store the vds file prefix string + * + * Return: SUCCEED (Can't fail) + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + H5MM_xfree(*(void **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_del() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_copy + * + * Purpose: Creates a copy of the vds file prefix string + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_copy() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_cmp + * + * Purpose: Callback routine which is called whenever the vds file prefix + * property in the dataset creation property list is + * compared. + * + * Return: zero if VALUE1 and VALUE2 are equal, non zero otherwise. + *------------------------------------------------------------------------- + */ +static int +H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) +{ + const char *pref1 = *(const char * const *)value1; + const char *pref2 = *(const char * const *)value2; + int ret_value = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(NULL == pref1 && NULL != pref2) + HGOTO_DONE(1); + if(NULL != pref1 && NULL == pref2) + HGOTO_DONE(-1); + if(NULL != pref1 && NULL != pref2) + ret_value = HDstrcmp(pref1, pref2); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dapl_vds_file_pref_cmp() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_close + * + * Purpose: Frees memory used to store the vds file prefix string + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + H5MM_xfree(*(void **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_close() */ + /*------------------------------------------------------------------------- * Function: H5P__dapl_efile_pref_set @@ -1220,3 +1494,95 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_efile_prefix() */ + +/*------------------------------------------------------------------------- + * Function: H5Pset_virtual_prefix + * + * Purpose: Set a prefix to be applied to the path of any vds files + * traversed. + * + * If the prefix starts with ${ORIGIN}, this will be replaced by + * the absolute path of the directory of the HDF5 file containing + * the dataset. + * + * If the prefix is ".", no prefix will be applied. + * + * This property can be overwritten by the environment variable + * HDF5_VDS_PREFIX. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_virtual_prefix(hid_t plist_id, const char *prefix) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*s", plist_id, prefix); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Set prefix */ + if(H5P_set(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set prefix info") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_virtual_prefix() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_virtual_prefix + * + * Purpose: Gets the prefix to be applied to any vds file + * traversals made using this property list. + * + * If the pointer is not NULL, it points to a user-allocated + * buffer. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +ssize_t +H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size) +{ + H5P_genplist_t *plist; /* Property list pointer */ + char *my_prefix; /* Library's copy of the prefix */ + size_t len; /* Length of prefix string */ + ssize_t ret_value; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("Zs", "i*sz", plist_id, prefix, size); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get the current prefix */ + if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &my_prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file prefix") + + /* Check for prefix being set */ + if(my_prefix) { + /* Copy to user's buffer, if given */ + len = HDstrlen(my_prefix); + if(prefix) { + HDstrncpy(prefix, my_prefix, MIN(len + 1, size)); + if(len >= size) + prefix[size - 1] = '\0'; + } /* end if */ + } /* end if */ + else + len = 0; + + /* Set return value */ + ret_value = (ssize_t)len; + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_virtual_prefix() */ + diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 915aa38..ea9bfb4 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -13,9 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Pfapl.c + * Created: H5Pfapl.c * - * Purpose: File access property list class routines + * Purpose: File access property list class routines * *------------------------------------------------------------------------- */ @@ -41,7 +41,7 @@ #include "H5Ppkg.h" /* Property lists */ /* Includes needed to set as default file driver */ -#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ +#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ #include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS #include "H5FDwindows.h" /* Win32 I/O */ @@ -54,10 +54,10 @@ /* ========= File Access properties ============ */ /* Definitions for the initial metadata cache resize configuration */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG -#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec +#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG +#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec #define H5F_ACS_META_CACHE_INIT_CONFIG_CMP H5P__facc_cache_config_cmp /* Definitions for size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE sizeof(size_t) @@ -118,10 +118,10 @@ #define H5F_ACS_FILE_DRV_CMP H5P__facc_file_driver_cmp #define H5F_ACS_FILE_DRV_CLOSE H5P__facc_file_driver_close /* Definition for file close degree */ -#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) -#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT -#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc -#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec +#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) +#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT +#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc +#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec /* Definition for offset position in file for family file driver */ #define H5F_ACS_FAMILY_OFFSET_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_OFFSET_DEF 0 @@ -175,12 +175,12 @@ #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC H5P__encode_size_t #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC H5P__decode_size_t /* Definition for # of metadata read attempts */ -#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 -#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 +#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned /* Definition for object flush callback */ -#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) +#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) #define H5F_ACS_OBJECT_FLUSH_CB_DEF {NULL, NULL} /* Definition for status_flags in the superblock */ #define H5F_ACS_CLEAR_STATUS_FLAGS_SIZE sizeof(hbool_t) @@ -309,21 +309,21 @@ static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value); /* File access property list class library initialization object */ const H5P_libclass_t H5P_CLS_FACC[1] = {{ - "file access", /* Class name for debugging */ + "file access", /* Class name for debugging */ H5P_TYPE_FILE_ACCESS, /* Class type */ - &H5P_CLS_ROOT_g, /* Parent class */ - &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ - &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ - &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ - H5P__facc_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 */ + &H5P_CLS_ROOT_g, /* Parent class */ + &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ + &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ + &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ + H5P__facc_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 */ }}; @@ -395,149 +395,149 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the initial metadata cache resize configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, - NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, + NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache (elements) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache(bytes) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the preemption for reading chunks */ - if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, - NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, + if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, + NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the threshold for alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum metadata allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, - NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, + NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the maximum sieve buffer size */ - if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, - NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, + NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum "small data" allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, - NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, + NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the garbage collection reference */ - if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, - NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, + if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, + NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file driver ID & info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, + if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, H5F_ACS_FILE_DRV_CRT, H5F_ACS_FILE_DRV_SET, H5F_ACS_FILE_DRV_GET, NULL, NULL, H5F_ACS_FILE_DRV_DEL, H5F_ACS_FILE_DRV_COPY, H5F_ACS_FILE_DRV_CMP, H5F_ACS_FILE_DRV_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file close degree */ - if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, - NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, + NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the offset of family driver info */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, - NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, + NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of new family file size. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, 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 private property of whether convert family to sec2 driver. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, 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 data type of multi driver info */ - if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, - NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, + if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, + NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'use the latest version of the format' flag */ - if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, - NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, + if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, + NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether to retrieve the file descriptor from the core VFD */ /* (used internally to the library only) */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, + if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, 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 external file cache size */ - if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, - NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, + NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the initial file image info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, + if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, NULL, H5F_ACS_FILE_IMAGE_INFO_SET, H5F_ACS_FILE_IMAGE_INFO_GET, NULL, NULL, H5F_ACS_FILE_IMAGE_INFO_DEL, H5F_ACS_FILE_IMAGE_INFO_COPY, H5F_ACS_FILE_IMAGE_INFO_CMP, H5F_ACS_FILE_IMAGE_INFO_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the core VFD backing store write tracking flag */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the core VFD backing store page size */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the # of read attempts */ - if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, - NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, + NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register object flush callback */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, + if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -563,44 +563,44 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the evict on close flag */ - if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, - NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, + NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL /* Register the metadata collective read flag */ - if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, + if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the metadata collective write flag */ - if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) 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, + 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") /* Register the size of the page buffer size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum metadata size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum raw data size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -610,33 +610,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_alignment + * Function: H5Pset_alignment * - * Purpose: Sets the alignment properties of a file access property list - * so that any file object >= THRESHOLD bytes will be aligned on - * an address which is a multiple of ALIGNMENT. The addresses - * are relative to the end of the user block; the alignment is - * calculated by subtracting the user block size from the - * absolute file address and then adjusting the address to be a - * multiple of ALIGNMENT. + * Purpose: Sets the alignment properties of a file access property list + * so that any file object >= THRESHOLD bytes will be aligned on + * an address which is a multiple of ALIGNMENT. The addresses + * are relative to the end of the user block; the alignment is + * calculated by subtracting the user block size from the + * absolute file address and then adjusting the address to be a + * multiple of ALIGNMENT. * - * Default values for THRESHOLD and ALIGNMENT are one, implying - * no alignment. Generally the default values will result in - * the best performance for single-process access to the file. - * For MPI-IO and other parallel systems, choose an alignment - * which is a multiple of the disk block size. + * Default values for THRESHOLD and ALIGNMENT are one, implying + * no alignment. Generally the default values will result in + * the best performance for single-process access to the file. + * For MPI-IO and other parallel systems, choose an alignment + * which is a multiple of the disk block size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed file access property list mechanism to the new - * generic property list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed file access property list mechanism to the new + * generic property list. *------------------------------------------------------------------------- */ herr_t @@ -668,15 +668,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_alignment + * Function: H5Pget_alignment * - * Purpose: Returns the current settings for alignment properties from a - * file access property list. The THRESHOLD and/or ALIGNMENT - * pointers may be null pointers. + * Purpose: Returns the current settings for alignment properties from a + * file access property list. The THRESHOLD and/or ALIGNMENT + * pointers may be null pointers. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * *------------------------------------------------------------------------- @@ -709,20 +709,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_set_driver + * Function: H5P_set_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -757,20 +757,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_driver + * Function: H5Pset_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -800,20 +800,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver + * Function: H5P_peek_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Return: Success: 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. + * Return: Success: 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. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -844,22 +844,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver + * Function: H5Pget_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Note: The ID returned should not be closed. + * Note: The ID returned should not be closed. * - * Return: Success: 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. + * Return: Success: 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. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -867,7 +867,7 @@ hid_t H5Pget_driver(hid_t plist_id) { H5P_genplist_t *plist; /* Property list pointer */ - hid_t ret_value; /* Return value */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", plist_id); @@ -885,20 +885,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver_info + * Function: H5P_peek_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -927,20 +927,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver_info + * Function: H5Pget_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -973,7 +973,7 @@ done: * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -1486,30 +1486,30 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_cache + * Function: H5Pset_cache * - * Purpose: Set the number of objects in the meta data cache and the - * maximum number of chunks and bytes in the raw data chunk - * cache. + * Purpose: Set the number of objects in the meta data cache and the + * maximum number of chunks and bytes in the raw data chunk + * cache. * - * The RDCC_W0 value should be between 0 and 1 inclusive and - * indicates how much chunks that have been fully read or fully - * written are favored for preemption. A value of zero means - * fully read or written 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. + * The RDCC_W0 value should be between 0 and 1 inclusive and + * indicates how much chunks that have been fully read or fully + * written are favored for preemption. A value of zero means + * fully read or written 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. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, - size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) + size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1540,24 +1540,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_cache + * Function: H5Pget_cache * - * Purpose: Retrieves the maximum possible number of elements in the meta - * data cache and the maximum possible number of elements and - * bytes and the RDCC_W0 value in the raw data chunk cache. Any - * (or all) arguments may be null pointers in which case the - * corresponding datum is not returned. + * Purpose: Retrieves the maximum possible number of elements in the meta + * data cache and the maximum possible number of elements and + * bytes and the RDCC_W0 value in the raw data chunk cache. Any + * (or all) arguments may be null pointers in which case the + * corresponding datum is not returned. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pget_cache(hid_t plist_id, int *mdc_nelmts, - size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) + size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1592,14 +1592,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_image_config + * Function: H5Pset_mdc_image_config * - * Purpose: Set the initial metadata cache image configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache image configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, June 25, 2015 * *------------------------------------------------------------------------- @@ -1636,18 +1636,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_image_config + * Function: H5Pget_mdc_image_config * - * Purpose: Retrieve the metadata cache initial image configuration - * from the target FAPL. + * 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. + * 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 + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Friday, June 26, 2015 * *------------------------------------------------------------------------- @@ -1687,14 +1687,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_config + * Function: H5Pset_mdc_config * - * Purpose: Set the initial metadata cache resize configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache resize configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1731,18 +1731,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_config + * Function: H5Pget_mdc_config * - * Purpose: Retrieve the metadata cache initial resize configuration - * from the target FAPL. + * Purpose: Retrieve the metadata cache initial resize 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_config_t. + * Observe that the function will fail if config_ptr is + * NULL, or if config_ptr->version specifies an unknown + * version of H5AC_cache_config_t. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1782,33 +1782,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_gc_references + * Function: H5Pset_gc_references * - * Purpose: Sets the flag for garbage collecting references for the file. - * Dataset region references (and other reference types - * probably) use space in the file heap. If garbage collection - * is on and the user passes in an uninitialized value in a - * reference structure, the heap might get corrupted. When - * garbage collection is off however and the user re-uses a - * reference, the previous heap block will be orphaned and not - * returned to the free heap space. When garbage collection is - * on, the user must initialize the reference structures to 0 or - * risk heap corruption. + * Purpose: Sets the flag for garbage collecting references for the file. + * Dataset region references (and other reference types + * probably) use space in the file heap. If garbage collection + * is on and the user passes in an uninitialized value in a + * reference structure, the heap might get corrupted. When + * garbage collection is off however and the user re-uses a + * reference, the previous heap block will be orphaned and not + * returned to the free heap space. When garbage collection is + * on, the user must initialize the reference structures to 0 or + * risk heap corruption. * - * Default value for garbage collecting references is off, just - * to be on the safe side. + * Default value for garbage collecting references is off, just + * to be on the safe side. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * June, 1999 + * Programmer: Quincey Koziol + * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1835,22 +1835,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_gc_references + * Function: H5Pget_gc_references * - * Purpose: Returns the current setting for the garbage collection - * references property from a file access property list. + * Purpose: Returns the current setting for the garbage collection + * references property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1949,31 +1949,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_meta_block_size + * Function: H5Pset_meta_block_size * - * Purpose: Sets the minimum size of metadata block allocations when + * Purpose: Sets the minimum size of metadata block allocations when * the H5FD_FEAT_AGGREGATE_METADATA is set by a VFL driver. * Each "raw" metadata block is allocated to be this size and then * specific pieces of metadata (object headers, local heaps, B-trees, etc) * are sub-allocated from this block. * - * The default value is set to 2048 (bytes), indicating that metadata + * The default value is set to 2048 (bytes), indicating that metadata * will be attempted to be bunched together in (at least) 2K blocks in * the file. Setting the value to 0 with this API function will * turn off the metadata aggregation, even if the VFL driver attempts to * use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 25, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2000,22 +2000,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_meta_block_size + * Function: H5Pget_meta_block_size * - * Purpose: Returns the current settings for the metadata block allocation + * Purpose: Returns the current settings for the metadata block allocation * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 29, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2044,31 +2044,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_sieve_buf_size + * Function: H5Pset_sieve_buf_size * - * Purpose: Sets the maximum size of the data seive buffer used for file + * Purpose: Sets the maximum size of the data seive buffer used for file * drivers which are capable of using data sieving. The data sieve * buffer is used when performing I/O on datasets in the file. Using a * buffer which is large anough to hold several pieces of the dataset * being read in for hyperslab selections boosts performance by quite a * bit. * - * The default value is set to 64KB, indicating that file I/O for raw data + * The default value is set to 64KB, indicating that file I/O for raw data * reads and writes will occur in at least 64KB blocks. * Setting the value to 0 with this API function will turn off the * data sieving, even if the VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2095,22 +2095,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_sieve_buf_size + * Function: H5Pget_sieve_buf_size * - * Purpose: Returns the current settings for the data sieve buffer size + * Purpose: Returns the current settings for the data sieve buffer size * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2138,23 +2138,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_small_data_block_size + * Function: H5Pset_small_data_block_size * - * Purpose: Sets the minimum size of "small" raw data block allocations + * Purpose: Sets the minimum size of "small" raw data block allocations * when the H5FD_FEAT_AGGREGATE_SMALLDATA is set by a VFL driver. * Each "small" raw data block is allocated to be this size and then * pieces of raw data which are small enough to fit are sub-allocated from * this block. * - * The default value is set to 2048 (bytes), indicating that raw data + * The default value is set to 2048 (bytes), indicating that raw data * smaller than this value will be attempted to be bunched together in (at * least) 2K blocks in the file. Setting the value to 0 with this API * function will turn off the "small" raw data aggregation, even if the * VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * * Modifications: @@ -2184,14 +2184,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_small_data_block_size + * Function: H5Pget_small_data_block_size * - * Purpose: Returns the current settings for the "small" raw data block + * Purpose: Returns the current settings for the "small" raw data block * allocation property from a file access 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, June 5, 2002 * * Modifications: @@ -2223,9 +2223,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_libver_bounds + * Function: H5Pset_libver_bounds * - * Purpose: Indicates which versions of the file format the library should + * Purpose: Indicates which versions of the file format the library should * use when creating objects. LOW is the earliest version of the HDF5 * library that is guaranteed to be able to access the objects created * (the format of some objects in an HDF5 file may not have changed between @@ -2301,9 +2301,9 @@ done: * releases and then map down to the previous actual library release which * had a format change. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, December 30, 2007 * *------------------------------------------------------------------------- @@ -2341,14 +2341,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_libver_bounds + * Function: H5Pget_libver_bounds * - * Purpose: Returns the current settings for the library version format bounds + * Purpose: Returns the current settings for the library version format bounds * from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 3, 2008 * *------------------------------------------------------------------------- @@ -2464,9 +2464,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_file_image * - * Purpose: Sets the initial file image. Some file drivers can initialize - * the starting data in a file from a buffer. - * + * Purpose: Sets the initial file image. Some file drivers can initialize + * the starting data in a file from a buffer. + * * Return: Non-negative on success/Negative on failure * * Programmer: Jacob Gruber @@ -2480,22 +2480,22 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) H5P_genplist_t *fapl; /* Property list pointer */ H5FD_file_image_info_t image_info; /* File image info */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*xz", fapl_id, buf_ptr, buf_len); /* validate parameters */ if(!(((buf_ptr == NULL) && (buf_len == 0)) || ((buf_ptr != NULL) && (buf_len > 0)))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistant buf_ptr and buf_len") - + /* Get the plist structure */ if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - + /* Get old image info */ if(H5P_peek(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image pointer") - + /* Release previous buffer, if it exists */ if(image_info.buffer != NULL) { if(image_info.callbacks.image_free) { @@ -2504,8 +2504,8 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) } /* end if */ else H5MM_xfree(image_info.buffer); - } /* end if */ - + } /* end if */ + /* Update struct */ if(buf_ptr) { /* Allocate memory */ @@ -2517,15 +2517,15 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) else if(NULL == (image_info.buffer = H5MM_malloc(buf_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { - if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, - buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, + buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata)) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(image_info.buffer, buf_ptr, buf_len); } /* end if */ else @@ -2545,24 +2545,24 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_file_image * - * Purpose: If the file image exists and buf_ptr_ptr is not NULL, - * allocate a buffer of the correct size, copy the image into - * the new buffer, and return the buffer to the caller in - * *buf_ptr_ptr. Do this using the file image callbacks - * if defined. + * Purpose: If the file image exists and buf_ptr_ptr is not NULL, + * allocate a buffer of the correct size, copy the image into + * the new buffer, and return the buffer to the caller in + * *buf_ptr_ptr. Do this using the file image callbacks + * if defined. * - * NB: It is the responsibility of the caller to free the - * buffer whose address is returned in *buf_ptr_ptr. Do - * this using free if the file image callbacks are not - * defined, or with whatever method is appropriate if - * the callbacks are defined. + * NB: It is the responsibility of the caller to free the + * buffer whose address is returned in *buf_ptr_ptr. Do + * this using free if the file image callbacks are not + * defined, or with whatever method is appropriate if + * the callbacks are defined. * - * If buf_ptr_ptr is not NULL, and no image exists, set - * *buf_ptr_ptr to NULL. + * If buf_ptr_ptr is not NULL, and no image exists, set + * *buf_ptr_ptr to NULL. * - * If buf_len_ptr is not NULL, set *buf_len_ptr equal - * to the length of the file image if it exists, and - * to 0 if it does not. + * If buf_len_ptr is not NULL, set *buf_len_ptr equal + * to the length of the file image if it exists, and + * to 0 if it does not. * * Return: Non-negative on success/Negative on failure * @@ -2590,7 +2590,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || + HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || ((image_info.buffer == NULL) && (image_info.size == 0))); /* Set output size */ @@ -2611,15 +2611,15 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) else if(NULL == (copy_ptr = H5MM_malloc(image_info.size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate copy") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { if(copy_ptr != image_info.callbacks.image_memcpy(copy_ptr, image_info.buffer, - image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, + image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, image_info.callbacks.udata)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(copy_ptr, image_info.buffer, image_info.size); } /* end if */ @@ -2636,7 +2636,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * and memcpys or to perform detailed logging. * @@ -2666,7 +2666,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* Make sure a file image hasn't already been set */ @@ -2675,7 +2675,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Make sure udata callbacks are going to be set if udata is going to be set */ if(callbacks_ptr->udata) @@ -2686,7 +2686,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback if(info.callbacks.udata != NULL) { HDassert(info.callbacks.udata_free); if(info.callbacks.udata_free(info.callbacks.udata) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") } /* end if */ /* Update struct */ @@ -2713,7 +2713,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * * Return: Non-negative on success/Negative on failure @@ -2742,12 +2742,12 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Transfer values to parameters */ *callbacks_ptr = info.callbacks; @@ -2768,12 +2768,12 @@ done: * Function: H5P__file_image_info_copy * * Purpose: Copy file image info. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -2796,7 +2796,7 @@ H5P__file_image_info_copy(void *value) info = (H5FD_file_image_info_t *)value; /* verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); if(info->buffer && info->size > 0) { @@ -2815,14 +2815,14 @@ H5P__file_image_info_copy(void *value) if(NULL == (info->buffer = H5MM_malloc(info->size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory block") } /* end else */ - + /* Copy data to new buffer */ if(info->callbacks.image_memcpy) { - if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, - info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, + info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(info->buffer, old_buffer, info->size); } /* end if */ @@ -2846,8 +2846,8 @@ done: * Function: H5P__file_image_info_free * * Purpose: Free file image info. The buffer and udata may need to be - * freed, possibly using their respective callbacks, so the - * default free won't work. + * freed, possibly using their respective callbacks, so the + * default free won't work. * * Return: Success: Non-negative * Failure: Negative @@ -2868,16 +2868,16 @@ H5P__file_image_info_free(void *value) H5FD_file_image_info_t *info; /* Image info struct */ info = (H5FD_file_image_info_t *)value; - + /* Verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); /* Free buffer */ - if(info->buffer != NULL && info->size > 0) { + if(info->buffer != NULL && info->size > 0) { if(info->callbacks.image_free) { if((*info->callbacks.image_free)(info->buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, info->callbacks.udata) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") + HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") } /* end if */ else H5MM_xfree(info->buffer); @@ -2903,7 +2903,7 @@ done: * 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. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: John Mainzer * June 26, 2015 @@ -2944,11 +2944,11 @@ done: * 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. + * cache image config property in the file creation + * property list is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -2990,11 +2990,11 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) * 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. + * cache image config property in the file creation property + * list is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -3109,7 +3109,7 @@ done: * * Purpose: Delete callback for the file image info property, called * when the property is deleted from the plist. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the default free won't work. * * Return: Non-negative on success/Negative on failure @@ -3139,7 +3139,7 @@ done: * Function: H5P__facc_file_image_info_copy * * Purpose: Copy callback for the file image info property. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Return: Non-negative on success/Negative on failure @@ -3228,7 +3228,7 @@ done: * Function: H5P__facc_file_image_info_close * * Purpose: Close callback for the file image info property. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the standard free won't work. * * Return: Non-negative on success/Negative on failure @@ -3260,7 +3260,7 @@ done: * Purpose: Compare two cache configurations. * * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is - * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: Mohamad Chaarawi * September 24, 2012 @@ -3373,8 +3373,8 @@ done: * cache config property in the file creation property list is * encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3518,8 +3518,8 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) * cache config property in the file creation property list is * decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3653,8 +3653,8 @@ done: * degree property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3691,8 +3691,8 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) * degree property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3726,8 +3726,8 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) * memory type property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3764,8 +3764,8 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size) * memory type property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3793,12 +3793,12 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_core_write_tracking + * Function: H5Pset_core_write_tracking * - * Purpose: Enables/disables core VFD write tracking and page + * Purpose: Enables/disables core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3834,12 +3834,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_core_write_tracking + * Function: H5Pget_core_write_tracking * - * Purpose: Gets information about core VFD write tracking and page + * Purpose: Gets information about core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3876,19 +3876,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_metadata_read_attempts + * Function: H5Pset_metadata_read_attempts + * + * Purpose: Sets the # of read attempts in the file access property list + * when reading metadata with checksum. + * The # of read attempts set via this routine will only apply + * when opening a file with SWMR access. + * The # of read attempts set via this routine does not have + * any effect when opening a file with non-SWMR access; for this + * case, the # of read attempts will be always be 1. * - * Purpose: Sets the # of read attempts in the file access property list - * when reading metadata with checksum. - * The # of read attempts set via this routine will only apply - * when opening a file with SWMR access. - * The # of read attempts set via this routine does not have - * any effect when opening a file with non-SWMR access; for this - * case, the # of read attempts will be always be 1. - * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -3919,13 +3919,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_metadata_read_attempts + * Function: H5Pget_metadata_read_attempts * - * Purpose: Returns the # of metadata read attempts set in the file access property list. + * Purpose: Returns the # of metadata read attempts set in the file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -3945,13 +3945,13 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/) if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Get the # of read attempts set */ + /* Get the # of read attempts set */ if(H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get the number of metadata read attempts") - /* If not set, return the default value */ - if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ - *attempts = H5F_METADATA_READ_ATTEMPTS; + /* If not set, return the default value */ + if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ + *attempts = H5F_METADATA_READ_ATTEMPTS; } /* end if */ done: @@ -3960,14 +3960,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_obj_flush_cb + * Function: H5Pset_obj_flush_cb * - * Purpose: Sets the callback function to invoke and the user data when an - * object flush occurs in the file. - * - * Return: Non-negative on success/Negative on failure + * Purpose: Sets the callback function to invoke and the user data when an + * object flush occurs in the file. * - * Programmer: Vailin Choi; Dec 2013 + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4004,14 +4004,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_obj_flush_cb + * Function: H5Pget_obj_flush_cb + * + * Purpose: Retrieves the callback function and user data set in the + * property list for an object flush. * - * Purpose: Retrieves the callback function and user data set in the - * property list for an object flush. - * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Dec 2013 + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4035,9 +4035,9 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata) /* Assign return value */ if(func) - *func = flush_info.func; + *func = flush_info.func; if(udata) - *udata = flush_info.udata; + *udata = flush_info.udata; done: FUNC_LEAVE_API(ret_value) @@ -4045,11 +4045,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_log_options + * Function: H5Pset_mdc_log_options * - * Purpose: Set metadata cache log options. + * Purpose: Set metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4097,11 +4097,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_log_options + * Function: H5Pget_mdc_log_options * - * Purpose: Get metadata cache log options. + * Purpose: Get metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4455,8 +4455,8 @@ done: * * Purpose: Generic encoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4493,8 +4493,8 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) * * Purpose: Generic decoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4523,22 +4523,22 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_all_coll_metadata_ops + * Function: H5Pset_all_coll_metadata_ops * - * Purpose: Tell the library whether the metadata read operations will - * be done collectively (1) or not (0). Default is independent. - * With collective mode, the library will optimize access to - * metadata operations on the file. + * Purpose: Tell the library whether the metadata read operations will + * be done collectively (1) or not (0). Default is independent. + * With collective mode, the library will optimize access to + * metadata operations on the file. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4582,19 +4582,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_all_coll_metadata_ops + * Function: H5Pget_all_coll_metadata_ops * - * Purpose: Gets information about collective metadata read mode. + * Purpose: Gets information about collective metadata read mode. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4640,14 +4640,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_coll_metadata_write + * Function: H5Pset_coll_metadata_write * - * Purpose: Tell the library whether the metadata write operations will - * be done collectively (1) or not (0). Default is collective. + * Purpose: Tell the library whether the metadata write operations will + * be done collectively (1) or not (0). Default is collective. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4679,13 +4679,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_coll_metadata_write + * Function: H5Pget_coll_metadata_write * - * Purpose: Gets information about collective metadata write mode. + * Purpose: Gets information about collective metadata write mode. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4717,15 +4717,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_page_buffer_size + * Function: H5Pset_page_buffer_size * * Purpose: Set the maximum page buffering size. This has to be a * multiple of the page allocation size which must be enabled; * otherwise file create/open will fail. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- @@ -4765,13 +4765,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_page_buffer_size + * Function: H5Pget_page_buffer_size * - * Purpose: Retrieves the maximum page buffer size. + * Purpose: Retrieves the maximum page buffer size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 493a322..a2c0418 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -420,6 +420,8 @@ H5_DLL herr_t H5Pset_virtual_view(hid_t plist_id, H5D_vds_view_t view); H5_DLL herr_t H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view); H5_DLL herr_t H5Pset_virtual_printf_gap(hid_t plist_id, hsize_t gap_size); H5_DLL herr_t H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size); +H5_DLL herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); +H5_DLL ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); H5_DLL herr_t H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t boundary[], H5D_append_cb_t func, void *udata); H5_DLL herr_t H5Pget_append_flush(hid_t plist_id, unsigned dims, diff --git a/src/H5system.c b/src/H5system.c index a8726c2..719b7e0 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1043,7 +1043,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/) * Unix: does not apply */ if(H5_CHECK_ABS_DRIVE(name)) { - drive = name[0] - 'A' + 1; + drive = HDtoupper(name[0]) - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrncpy(new_name, &name[2], name_len); } /* end if */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6e8fd78..713f2bd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -37,7 +37,7 @@ endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib") endif () -target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE ${LINK_LIBS}) +target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${LINK_LIBS}) target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES @@ -54,7 +54,7 @@ if (BUILD_SHARED_LIBS) if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib") endif () - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE ${LINK_LIBS}) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${LINK_LIBS}) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${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 @@ -174,13 +174,13 @@ set (testhdf5_SOURCES add_executable (testhdf5 ${testhdf5_SOURCES}) TARGET_NAMING (testhdf5 STATIC) TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") -target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET}) set_target_properties (testhdf5 PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (testhdf5-shared ${testhdf5_SOURCES}) TARGET_NAMING (testhdf5-shared SHARED) TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") - target_link_libraries (testhdf5-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (testhdf5-shared PROPERTIES FOLDER test) endif () @@ -188,13 +188,13 @@ MACRO (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") - target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET}) set_target_properties (${file} PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file}-shared SHARED) TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") - target_link_libraries (${file}-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (${file}-shared PROPERTIES FOLDER test) endif () ENDMACRO () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 973d389..fca2f27 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -452,7 +452,6 @@ set (test_CLEANFILES extlinks19B00026.h5 extlinks19B00027.h5 extlinks19B00028.h5 - tmp big.data big*.h5 stdio.h5 @@ -582,6 +581,7 @@ set (test_CLEANFILES cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 + tmp/vds_src_2.h5 ) # Remove any output file left over from previous test run @@ -839,21 +839,28 @@ add_test (NAME H5TEST-clear-error_test-objects WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" -) -set_tests_properties (H5TEST-error_test PROPERTIES - DEPENDS H5TEST-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST -) +if (HDF5_USE_16_API_DEFAULT) + add_test ( + NAME H5TEST-error_test-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" + ) +else () + add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-error_test PROPERTIES + DEPENDS H5TEST-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) +endif () #-- Adding test for links_env add_test (NAME H5TEST-clear-links_env-objects @@ -959,21 +966,28 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5TEST-shared-error_test PROPERTIES - DEPENDS H5TEST-shared-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared - ) + if (HDF5_USE_16_API_DEFAULT) + add_test ( + NAME H5TEST-shared-error_test-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" + ) + else () + add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-shared-error_test PROPERTIES + DEPENDS H5TEST-shared-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + endif () #-- Adding test for links_env add_test (NAME H5TEST-shared-clear-links_env-objects diff --git a/test/vds.c b/test/vds.c index c9b7a1b..a882698 100644 --- a/test/vds.c +++ b/test/vds.c @@ -36,6 +36,12 @@ const char *FILENAME[] = { "vds_src_1", "vds%%_src", "vds_dapl", + "vds_virt_2", + "vds_virt_3", + "vds_src_2", + "vds_src_3", + "vds%%_src2", + "vds_dapl2", NULL }; @@ -49,6 +55,8 @@ const char *FILENAME[] = { #define FILENAME_BUF_SIZE 1024 +#define TMPDIR "tmp/" + /*------------------------------------------------------------------------- * Function: vds_select_equal @@ -57,14 +65,7 @@ const char *FILENAME[] = { * provided dataspaces are the same. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Neil Fortner - * Monday, March 2, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static htri_t @@ -130,7 +131,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } /* end if */ + } /* Free buffers */ HDfree(buf1); @@ -180,7 +181,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } /* end if */ + } /* Free buffers */ HDfree(buf1); @@ -217,14 +218,7 @@ error: * parameters. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Neil Fortner - * Monday, March 2, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -298,8 +292,7 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace, error: H5E_BEGIN_TRY { - if(space_out >= 0) - (void)H5Sclose(space_out); + H5Sclose(space_out); } H5E_END_TRY return -1; @@ -312,14 +305,7 @@ error: * Purpose: Tests API functions related to virtual datasets. * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Monday, February 16, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ /* Helper function to get DCPL for examination depending on config */ @@ -370,12 +356,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, file = -1; if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open dataset */ if((dset = H5Dopen2(file, "vdset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get DCPL from dataset */ if((*ex_dcpl = H5Dget_create_plist(dset)) < 0) @@ -394,8 +380,8 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(oinfo.meta_size.obj.heap_size != exp_meta_size) { printf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size); TEST_ERROR - } /* end if */ - } /* end if */ + } + } else if((oinfo.meta_size.obj.heap_size != exp_meta_size) && (oinfo.meta_size.obj.heap_size != (hsize_t)0)) @@ -424,12 +410,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(H5Fclose(file) < 0) TEST_ERROR file = -1; - } /* end if */ + } else if(config == TEST_API_COPY_PLIST) { /* Copy property list */ if((*ex_dcpl = H5Pcopy(dcpl)) < 0) TEST_ERROR - } /* end if */ + } else if(config == TEST_API_ENCDEC_PLIST) { size_t plist_buf_size; @@ -448,14 +434,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, /* Free plist_buf */ HDfree(plist_buf); plist_buf = NULL; - } /* end if */ + } else { /* Simply copy the id to ex_dcpl and increment the ref count so ex_dcpl * can be closed */ if(H5Iinc_ref(dcpl) < 0) TEST_ERROR *ex_dcpl = dcpl; - } /* end else */ + } /* Verify examination DCPL is equal to original DCPL. Do not compare the * plist to itself, and do not do the comparison if we reopened the file, @@ -466,16 +452,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, TEST_ERROR if(!tri_ret) TEST_ERROR - } /* end if */ + } return 0; error: H5E_BEGIN_TRY { - if(file >= 0) - (void)H5Fclose(file); - if(dset >= 0) - (void)H5Dclose(dset); + H5Fclose(file); + H5Dclose(dset); } H5E_END_TRY; if(plist_buf) HDfree(plist_buf); @@ -532,7 +516,7 @@ test_api(test_api_config_t config, hid_t fapl) case TEST_API_NTESTS: default: TEST_ERROR - } /* end switch */ + } h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -818,7 +802,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Create virtual dataspace */ if((vspace[i] = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR - } /* end for */ + } /* Select all (should not be necessary, but just to be sure) */ if(H5Sselect_all(srcspace[0]) < 0) @@ -932,7 +916,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1038,7 +1022,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Add virtual layout mapping */ if(H5Pset_virtual(dcpl, vspace[i], tmp_filename, tmp_dsetname, srcspace[0]) < 0) TEST_ERROR - } /* end if */ + } /* Get examination DCPL */ if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)697) < 0) @@ -1063,7 +1047,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Check that the mapping in the DCPL is correct */ if(vds_check_mapping(ex_dcpl, (size_t)i, vspace[i], srcspace[0], tmp_filename, tmp_dsetname) < 0) TEST_ERROR - } /* end if */ + } /* Close */ if(H5Sclose(srcspace[0]) < 0) @@ -1073,7 +1057,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1123,23 +1107,460 @@ test_api(test_api_config_t config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(ex_dcpl >= 0) - (void)H5Pclose(ex_dcpl); + for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Pclose(dcpl); + H5Pclose(ex_dcpl); } H5E_END_TRY; return 1; } /* end test_api() */ +/*------------------------------------------------------------------------- + * Function: vds_link_prefix + * + * Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp" + * Should be able to access the target source files in tmp directory via the prefix set + * by H5Pset_virtual_prefix() + * + * Return: Success: 0 + * Failure: -1 + *------------------------------------------------------------------------- + */ +static int +test_vds_prefix(unsigned config, hid_t fapl) +{ + char srcfilename[FILENAME_BUF_SIZE]; + char srcfilename_map[FILENAME_BUF_SIZE]; + char vfilename[FILENAME_BUF_SIZE]; + char vfilename2[FILENAME_BUF_SIZE]; + char srcfilenamepct[FILENAME_BUF_SIZE]; + char srcfilenamepct_map[FILENAME_BUF_SIZE]; + const char *srcfilenamepct_map_orig = "vds%%%%_src"; + hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */ + hid_t vfile = -1; /* File with virtual dset */ + hid_t vfile2 = -1; /* File with copied virtual dset */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t dapl = -1; /* Dataset access property list */ + hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */ + hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */ + hid_t memspace = -1; /* Memory dataspace */ + hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */ + hid_t vdset = -1; /* Virtual dataset */ + hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ + hsize_t start[4]; /* Hyperslab start */ + hsize_t stride[4]; /* Hyperslab stride */ + hsize_t count[4]; /* Hyperslab count */ + hsize_t block[4]; /* Hyperslab block */ + hssize_t offset[2] = {0, 0}; /* Selection offset */ + int buf[10][26]; /* Write and expected read buffer */ + int rbuf[10][26]; /* Read buffer */ + int rbuf99[9][9]; /* 9x9 Read buffer */ + int evbuf[10][26]; /* Expected VDS "buffer" */ + int erbuf[10][26]; /* Expected read buffer */ + int fill = -1; /* Fill value */ + herr_t ret; /* Generic return value */ + int i, j; + char buffer[1024]; /* buffer to read vds_prefix */ + + TESTING("basic virtual dataset I/O via H5Pset_vds_prefix()") + + h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename); + h5_fixname(FILENAME[7], fapl, vfilename2, sizeof vfilename2); + h5_fixname(FILENAME[8], fapl, srcfilename, sizeof srcfilename); + h5_fixname_printf(FILENAME[8], fapl, srcfilename_map, sizeof srcfilename_map); + h5_fixname(FILENAME[10], fapl, srcfilenamepct, sizeof srcfilenamepct); + h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map); + + /* create tmp directory and get current working directory path */ + if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) + TEST_ERROR + + /* Create DCPL */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + /* Set fill value */ + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) + TEST_ERROR + + /* Initialize VDS prefix items */ + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) + TEST_ERROR + + if(H5Pset_virtual_prefix(dapl, TMPDIR) < 0) + TEST_ERROR + if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) + TEST_ERROR + + if(HDstrcmp(buffer, TMPDIR) != 0) + FAIL_PUTS_ERROR("vds prefix not set correctly"); + + /* + * Test 1: All - all selection + */ + /* Create source dataspace */ + if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Create virtual dataspace */ + if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Select all (should not be necessary, but just to be sure) */ + if(H5Sselect_all(srcspace[0]) < 0) + TEST_ERROR + if(H5Sselect_all(vspace[0]) < 0) + TEST_ERROR + + /* Add virtual layout mapping */ + if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) + TEST_ERROR + + /* Create virtual file */ + if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Create source file if requested */ + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + else { + srcfile[0] = vfile; + if(H5Iinc_ref(srcfile[0]) < 0) + TEST_ERROR + } + + /* Create source dataset */ + if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Create virtual dataset */ + if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) + TEST_ERROR + + /* Populate write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; + + /* Write data directly to source dataset */ + if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Close srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + + if(config & TEST_IO_DIFFERENT_FILE) { + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + } + } + + /* Reopen virtual dataset and file if config option specified */ + if(config & TEST_IO_REOPEN_VIRT) { + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) + TEST_ERROR + } + + /* Read data through virtual dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) { + TEST_ERROR + } + } + + /* Adjust write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); + + /* Write data through virtual dataset */ + if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Reopen srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) + TEST_ERROR + } + + /* Read data directly from source dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) + TEST_ERROR + + /* Close */ + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if(H5Sclose(srcspace[0]) < 0) + TEST_ERROR + srcspace[0] = -1; + if(H5Sclose(vspace[0]) < 0) + TEST_ERROR + vspace[0] = -1; + if(H5Pclose(dapl) < 0) + TEST_ERROR + dapl = -1; + if(H5Pclose(dcpl) < 0) + TEST_ERROR + dcpl = -1; + + /* + * Test 2: All - all selection with ENV prefix + */ + if(HDsetenv("HDF5_VDS_PREFIX", "${ORIGIN}/tmp", 1)) + TEST_ERROR + + /* Create DCPL */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + /* Set fill value */ + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) + TEST_ERROR + + /* Set prefix to a nonexistent directory, will be overwritten by environment variable */ + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) + TEST_ERROR + + if(H5Pset_virtual_prefix(dapl, "someprefix") < 0) + TEST_ERROR + if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) + TEST_ERROR + + if(HDstrcmp(buffer, "someprefix") != 0) + FAIL_PUTS_ERROR("vds prefix not set correctly"); + + /* Create source dataspace */ + if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Create virtual dataspace */ + if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Select all (should not be necessary, but just to be sure) */ + if(H5Sselect_all(srcspace[0]) < 0) + TEST_ERROR + if(H5Sselect_all(vspace[0]) < 0) + TEST_ERROR + + /* Add virtual layout mapping */ + if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) + TEST_ERROR + + /* Create virtual file */ + if((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Create source file if requested */ + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + else { + srcfile[0] = vfile; + if(H5Iinc_ref(srcfile[0]) < 0) + TEST_ERROR + } + + /* Create source dataset */ + if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Create virtual dataset */ + if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) + TEST_ERROR + + /* Populate write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; + + /* Write data directly to source dataset */ + if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Close srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + + if(config & TEST_IO_DIFFERENT_FILE) { + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + } + } + + /* Reopen virtual dataset and file if config option specified */ + if(config & TEST_IO_REOPEN_VIRT) { + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if((vfile = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) + TEST_ERROR + } + + /* Read data through virtual dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) { + TEST_ERROR + } + } + + /* Adjust write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); + + /* Write data through virtual dataset */ + if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Reopen srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) + TEST_ERROR + } + + /* Read data directly from source dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) + TEST_ERROR + + /* Close */ + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if(H5Sclose(srcspace[0]) < 0) + TEST_ERROR + srcspace[0] = -1; + if(H5Sclose(vspace[0]) < 0) + TEST_ERROR + vspace[0] = -1; + if(H5Pclose(dapl) < 0) + TEST_ERROR + dapl = -1; + if(H5Pclose(dcpl) < 0) + TEST_ERROR + dcpl = -1; + + if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) + TEST_ERROR + + PASSED(); + return 0; + + error: + H5E_BEGIN_TRY { + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(memspace); + H5Pclose(dapl); + H5Pclose(dcpl); + } H5E_END_TRY; + + if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) + TEST_ERROR + + return 1; +} /* end vds_link_prefix() */ + /*------------------------------------------------------------------------- * Function: test_basic_io @@ -1148,14 +1569,7 @@ error: * pattern-matching file/dataset strings * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Tuesday, March 3, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1238,12 +1652,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1272,8 +1686,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1287,7 +1701,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1316,7 +1730,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1400,12 +1814,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1441,8 +1855,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1456,7 +1870,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1487,7 +1901,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1536,8 +1950,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1546,7 +1960,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open v_dset2 */ if((vdset = H5Dopen2(vfile, "v_dset2", H5P_DEFAULT)) < 0) @@ -1572,7 +1986,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Only copy to a different file if the source datasets are in a different * file */ @@ -1614,8 +2028,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen copied virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1624,7 +2038,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile2 = -1; if((vfile2 = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open v_dset3 */ if((vdset = H5Dopen2(vfile2, "v_dset3", H5P_DEFAULT)) < 0) @@ -1650,13 +2064,13 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Close copied virtual file */ if(H5Fclose(vfile2) < 0) TEST_ERROR vfile2 = -1; - } /* end if */ + } /* Close */ if(H5Dclose(srcdset[0]) < 0) @@ -1735,12 +2149,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1782,8 +2196,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1797,7 +2211,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1828,7 +2242,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1923,12 +2337,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1964,8 +2378,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1979,7 +2393,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read first source dataset through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2032,7 +2446,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2131,12 +2545,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2164,7 +2578,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i][j] = buf[2 * i][j]; for(/* j = 13 */; j < 26; j++) evbuf[i][j] = buf[2 * i + 1][j - 13]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2181,7 +2595,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i + 5][j] = buf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) evbuf[i + 5][j] = buf[2 * i + 1][j]; - } /* end for */ + } /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2196,8 +2610,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2211,7 +2625,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -2227,7 +2641,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i][j] = evbuf[2 * i][j]; for(/* j = 13 */; j < 26; j++) erbuf[i][j] = evbuf[2 * i + 1][j - 13]; - } /* end for */ + } /* Read second slice */ if(H5Dread(vdset, H5T_NATIVE_INT, vspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2239,7 +2653,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i + 5][j] = evbuf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) erbuf[i + 5][j] = evbuf[2 * i + 1][j]; - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2263,7 +2677,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j] = buf[i][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j - 13] = buf[i][j]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2280,7 +2694,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j + 13] = buf[i + 5][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j] = buf[i + 5][j]; - } /* end for */ + } /* Reopen srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2291,7 +2705,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ /* Reset rbuf */ @@ -2307,7 +2721,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j] = evbuf[i][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j - 13] = evbuf[i][j]; - } /* end for */ + } /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, srcspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2319,7 +2733,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j + 13] = evbuf[i + 5][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j] = evbuf[i + 5][j]; - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2439,12 +2853,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2498,8 +2912,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2513,7 +2927,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -2538,7 +2952,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2584,7 +2998,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ /* Reset rbuf */ @@ -2605,7 +3019,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } /* end for */ + } /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, memspace, srcspace[0], H5P_DEFAULT, rbuf[0]) < 0) @@ -2780,12 +3194,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2822,8 +3236,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2837,7 +3251,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ /* Reset rbuf */ @@ -2943,7 +3357,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 3) && (j < 6)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -2996,7 +3410,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 6) && (j < 9)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -3214,7 +3628,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ /* Select hyperslab in memory space */ @@ -3289,32 +3703,19 @@ test_basic_io(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - if(vfile2 >= 0) - (void)H5Fclose(vfile2); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(memspace); + H5Pclose(dcpl); } H5E_END_TRY; return 1; @@ -3327,14 +3728,7 @@ error: * Purpose: Tests VDS with unlimited selections * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Thursday, April 30, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3447,12 +3841,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -3517,8 +3911,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3532,7 +3926,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -3577,11 +3971,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Test H5Pget_virtual_view() */ if(H5Pget_virtual_view(dapl, &virtual_view) < 0) @@ -3601,7 +3995,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -3649,11 +4043,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -3662,7 +4056,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[0] = 5; @@ -3699,8 +4093,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3714,7 +4108,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -3761,11 +4155,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -3779,7 +4173,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -3832,11 +4226,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -3845,7 +4239,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 5; @@ -3887,8 +4281,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3902,7 +4296,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -3964,7 +4358,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -4029,11 +4423,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Shrink to 15 */ dims[1] = 15; @@ -4060,12 +4454,12 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4079,7 +4473,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4127,11 +4521,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -4166,11 +4560,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Grow to 18 */ @@ -4198,11 +4592,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Grow to 20 */ dims[1] = 20; @@ -4228,7 +4622,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < (int)mdims[1]; j++) if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -4241,12 +4635,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -4322,12 +4716,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -4392,8 +4786,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4407,7 +4801,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4451,11 +4845,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4469,7 +4863,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4511,11 +4905,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4524,7 +4918,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[1] = 7; @@ -4566,8 +4960,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4581,7 +4975,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4627,11 +5021,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -4645,7 +5039,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4696,11 +5090,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4709,7 +5103,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[1] = 10; @@ -4751,8 +5145,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4766,7 +5160,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4828,7 +5222,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -4845,7 +5239,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4897,11 +5291,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -4914,12 +5308,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -5014,12 +5408,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -5059,7 +5453,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][6 * j] = buf[i][2 * j]; erbuf[i][(6 * j) + 1] = buf[i][(2 * j) + 1]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5075,7 +5469,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][(6 * j) + 2] = buf[i][2 * j]; erbuf[i][(6 * j) + 3] = buf[i][(2 * j) + 1]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5096,7 +5490,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][4] = buf[i][0]; erbuf[i][5] = buf[i][1]; - } /* end for */ + } /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5114,8 +5508,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5129,7 +5523,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5173,11 +5567,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -5191,7 +5585,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5233,11 +5627,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5246,7 +5640,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[1] = 7; @@ -5283,8 +5677,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5298,7 +5692,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5343,11 +5737,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5361,7 +5755,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5371,7 +5765,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][12] = buf[i][0]; erbuf[i][13] = buf[i][1]; erbuf[i][18] = buf[i][2]; - } /* end for */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5415,11 +5809,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5428,7 +5822,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset3", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[2] */ dims[1] = 5; @@ -5460,7 +5854,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][10] = buf[i][0]; erbuf[i][11] = buf[i][1]; erbuf[i][16] = buf[i][2]; - } /* end for */ + } /* Close srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5472,8 +5866,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5487,7 +5881,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5532,11 +5926,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -5550,7 +5944,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5596,11 +5990,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5609,7 +6003,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[1] = 6; @@ -5640,7 +6034,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][14] = buf[i][0]; erbuf[i][15] = buf[i][1]; - } /* end for */ + } /* Close srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5652,8 +6046,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5667,7 +6061,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5711,11 +6105,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5729,7 +6123,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5771,11 +6165,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now just read middle 2 rows */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -5801,11 +6195,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -5824,12 +6218,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -5910,12 +6304,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -5968,8 +6362,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5983,7 +6377,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6029,11 +6423,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -6047,7 +6441,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6089,11 +6483,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6102,7 +6496,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[0] = 5; @@ -6140,8 +6534,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6155,7 +6549,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6201,11 +6595,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -6219,7 +6613,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6267,11 +6661,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -6284,12 +6678,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -6329,36 +6723,21 @@ test_unlim(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(filespace >= 0) - (void)H5Sclose(filespace); - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(srcdcpl >= 0) - (void)H5Pclose(srcdcpl); - if(dapl >= 0) - (void)H5Pclose(dapl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Pclose(srcdcpl); + H5Pclose(dapl); } H5E_END_TRY; return 1; @@ -6372,14 +6751,7 @@ error: * source dataset resolution * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Tuesday, May 26, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -6485,12 +6857,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -6502,7 +6874,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6516,7 +6888,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6602,8 +6974,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6617,7 +6989,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6661,11 +7033,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -6702,8 +7074,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6717,7 +7089,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6757,11 +7129,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try with different selections */ count[0] = 10; @@ -6788,12 +7160,12 @@ test_printf(unsigned config, hid_t fapl) if((j < (int)start[1]) || (j >= (int)(start[1] + count[1]))) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end for */ + } + } start[1] = 0; /* Now try writing through VDS */ @@ -6829,7 +7201,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read srcdset[0] */ count[0] = 10; @@ -6931,12 +7303,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -6948,7 +7320,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6962,7 +7334,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7100,14 +7472,14 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7121,7 +7493,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7165,11 +7537,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Test H5Pget_virtual_printf_gap() */ if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) @@ -7189,7 +7561,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7241,11 +7613,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 2, reopen file as well if * config option specified */ @@ -7259,7 +7631,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7311,11 +7683,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 3, reopen file as well if * config option specified */ @@ -7329,7 +7701,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7381,11 +7753,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 4, reopen file as well if * config option specified */ @@ -7399,7 +7771,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7451,11 +7823,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -7469,7 +7841,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7515,11 +7887,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -7533,16 +7905,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -7615,7 +7987,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7681,7 +8053,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7695,7 +8067,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7739,11 +8111,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -7778,7 +8150,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7792,7 +8164,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7836,11 +8208,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -7856,7 +8228,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -7926,7 +8298,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7992,7 +8364,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8006,7 +8378,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8050,11 +8422,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -8089,7 +8461,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8103,7 +8475,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8147,11 +8519,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -8167,7 +8539,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8180,7 +8552,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Sclose(vspace[0]) < 0) TEST_ERROR vspace[0] = -1; - } /* end if */ + } /* @@ -8238,12 +8610,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -8255,7 +8627,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8269,7 +8641,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8355,8 +8727,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8370,7 +8742,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8414,11 +8786,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -8454,8 +8826,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8469,7 +8841,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8513,11 +8885,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -8531,7 +8903,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -8578,11 +8950,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -8618,8 +8990,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8633,7 +9005,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8677,11 +9049,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -8695,7 +9067,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -8742,11 +9114,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf_gap set to 1, reopen file as well if * config option specified */ @@ -8760,7 +9132,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -8807,11 +9179,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -8825,16 +9197,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8910,12 +9282,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -8927,7 +9299,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8941,7 +9313,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9037,8 +9409,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9052,7 +9424,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9096,11 +9468,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -9114,7 +9486,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9161,11 +9533,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9205,8 +9577,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9220,7 +9592,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9264,11 +9636,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -9282,7 +9654,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9328,11 +9700,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9369,8 +9741,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9384,7 +9756,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9428,11 +9800,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -9466,11 +9838,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Shrink to 12 */ @@ -9496,11 +9868,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Shrink to 10 */ dims[1] = 12; @@ -9525,12 +9897,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -9544,7 +9916,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9590,11 +9962,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -9628,11 +10000,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Grow to 12 */ @@ -9658,11 +10030,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Grow to 15 */ dims[1] = 15; @@ -9687,12 +10059,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Reset dapl */ if(H5Pset_virtual_view(dapl, H5D_VDS_LAST_AVAILABLE) < 0) @@ -9704,16 +10076,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -9770,12 +10142,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -9787,7 +10159,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9801,7 +10173,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9867,8 +10239,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9882,7 +10254,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9926,11 +10298,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 127, reopen file as well if * config option specified */ @@ -9944,7 +10316,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9990,11 +10362,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -10008,12 +10380,12 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -10044,32 +10416,19 @@ test_printf(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - if(srcspace >= 0) - (void)H5Sclose(srcspace); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(filespace >= 0) - (void)H5Sclose(filespace); - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(dapl >= 0) - (void)H5Pclose(dapl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Sclose(srcspace); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Pclose(dapl); } H5E_END_TRY; return 1; @@ -10083,14 +10442,7 @@ error: * VDS * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Friday, August 14, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -10212,12 +10564,12 @@ test_all(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile = vfile; if(H5Iinc_ref(srcfile) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -10229,7 +10581,7 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10243,7 +10595,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10314,14 +10666,14 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10335,7 +10687,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10381,11 +10733,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10394,7 +10746,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 2; @@ -10429,8 +10781,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10444,7 +10796,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10490,11 +10842,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -10534,8 +10886,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10549,7 +10901,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10595,11 +10947,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10608,7 +10960,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 3; @@ -10652,8 +11004,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10667,7 +11019,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10713,11 +11065,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -10757,8 +11109,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10772,7 +11124,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10818,11 +11170,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10831,7 +11183,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 7; @@ -10876,8 +11228,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10891,7 +11243,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10937,11 +11289,11 @@ test_all(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -10981,8 +11333,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10996,7 +11348,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11048,16 +11400,16 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -11068,12 +11420,12 @@ test_all(unsigned config, hid_t fapl) if(H5Sclose(srcspace[i]) < 0) TEST_ERROR srcspace[i] = -1; - } /* end for */ + } for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(dcpl) < 0) TEST_ERROR dcpl = -1; @@ -11089,32 +11441,19 @@ test_all(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - if(srcfile >= 0) - (void)H5Fclose(srcfile); - if(vfile >= 0) - (void)H5Fclose(vfile); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(filespace >= 0) - (void)H5Sclose(filespace); - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(srcdcpl >= 0) - (void)H5Pclose(srcdcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + H5Fclose(srcfile); + H5Fclose(vfile); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Pclose(srcdcpl); } H5E_END_TRY; return 1; @@ -11128,10 +11467,6 @@ error: * * Return: Success: 0 * Failure: 1 - * - * Programmer: Dana Robinson - * March 2016 - * *------------------------------------------------------------------------- */ static int @@ -11273,10 +11608,6 @@ test_dapl_values(hid_t fapl_id) * Purpose: Tests datasets with virtual layout * * Return: EXIT_SUCCESS/EXIT_FAILURE - * - * Programmer: Neil Fortner - * Tuesday, February 17, 2015 - * *------------------------------------------------------------------------- */ int @@ -11299,10 +11630,11 @@ main(void) for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) { printf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : ""); nerrors += test_basic_io(bit_config, fapl); + nerrors += test_vds_prefix(bit_config, fapl); nerrors += test_unlim(bit_config, fapl); nerrors += test_printf(bit_config, fapl); nerrors += test_all(bit_config, fapl); - } /* end for */ + } nerrors += test_dapl_values(fapl); diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 3addecf..368471c 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -72,6 +72,14 @@ f-3.h5 vds-eiger.h5 ) + set (HDF5_REFERENCE_PREFIX_VDS + 1_vds.h5 + 2_vds.h5 + 4_vds.h5 + 5_vds.h5 + vds-percival-unlim-maxmin.h5 + vds-eiger.h5 + ) set (HDF5_ERROR_REFERENCE_VDS ) @@ -80,12 +88,21 @@ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach () + foreach (vds_h5_file ${HDF5_REFERENCE_PREFIX_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/prefix/${fname}" "h5dump_vds_files") + 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 () + 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/prefix/${fname}" "h5dump_vds_files") + 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") @@ -134,6 +151,44 @@ endif () endmacro () + macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + if (NOT "${resultcode}" STREQUAL "0") + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") + endif () + if (NOT "${last_vds_test}" STREQUAL "") + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) + endif () + else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP_PREFIX-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + add_test ( + NAME H5DUMP_PREFIX-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" + -D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects) + endif () + endmacro () + macro (ADD_H5_VDS_LAYOUT resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) @@ -261,3 +316,15 @@ 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 () + + # Data read with prefix + if (USE_FILTER_DEFLATE) + ADD_H5_VDS_PREFIX_TEST (tvds-1 0 --enable-error-stack 1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-2 0 --enable-error-stack 2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-4 0 --enable-error-stack 4_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-5 0 --enable-error-stack 5_vds.h5) + ADD_H5_VDS_PREFIX_TEST (vds-first 0 --vds-view-first-missing --enable-error-stack vds-percival-unlim-maxmin.h5) + ADD_H5_VDS_PREFIX_TEST (vds-gap1 0 -d /VDS-Eiger --vds-gap-size=1 --enable-error-stack vds-eiger.h5) + ADD_H5_VDS_PREFIX_TEST (vds-gap2 0 --vds-gap-size=2 --enable-error-stack vds-eiger.h5) + endif () + diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index 5df61bb..f25bd98 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -61,6 +61,17 @@ 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 () + + foreach (listfiles ${LIST_HDF5_TEST_FILES}) + get_filename_component(fname "${listfiles}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") + endforeach () + + foreach (listfiles ${LIST_OTHER_TEST_FILES}) + get_filename_component(fname "${listfiles}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5LS_SOURCE_DIR}/vds_prefix/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") + endforeach () + add_custom_target(h5ls_vds_files ALL COMMENT "Copying files needed by h5ls_vds tests" DEPENDS ${h5ls_vds_files_list}) ############################################################################## @@ -104,6 +115,43 @@ endif () endmacro () + macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + if ("${resultcode}" STREQUAL "1") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") + endif () + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () + else () + add_test ( + NAME H5LS_PREFIX-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + add_test ( + NAME H5LS_PREFIX-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=vds/prefix/${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=vds/prefix/${resultfile}.ls" + -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" + -D "TEST_ENV_VALUE=\${ORIGIN}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects) + endif () + endmacro () + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -155,3 +203,10 @@ ADD_H5_VDS_TEST (tvds-4 0 -w80 -v -S 4_vds.h5) ADD_H5_VDS_TEST (tvds-5 0 -w80 -v -S 5_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-1 0 -w80 -v -S vds/prefix/1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-2 0 -w80 -v -S vds/prefix/2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-3_1 0 -w80 -v -S vds/prefix/3_1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-3_2 0 -w80 -v -S vds/prefix/3_2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-4 0 -w80 -v -S vds/prefix/4_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-5 0 -w80 -v -S vds/prefix/5_vds.h5) + diff --git a/tools/test/h5ls/vds_prefix/tvds-1.ls b/tools/test/h5ls/vds_prefix/tvds-1.ls new file mode 100644 index 0000000..2830d1a --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-1.ls @@ -0,0 +1,14 @@ +Opened "vds/prefix/1_vds.h5" with sec2 driver. +vds_dset Dataset {5/Inf, 18/18, 8/8} + Location: 1:800 + Links: 1 + Maps: {6} Source { + 1_a.h5 /source_dset + 1_b.h5 /source_dset + 1_c.h5 /source_dset + 1_d.h5 /source_dset + 1_e.h5 /source_dset + 1_f.h5 /source_dset + } + Storage: 2880 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-2.ls b/tools/test/h5ls/vds_prefix/tvds-2.ls new file mode 100644 index 0000000..5c6f9d3 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-2.ls @@ -0,0 +1,13 @@ +Opened "vds/prefix/2_vds.h5" with sec2 driver. +vds_dset Dataset {6/Inf, 8/8, 14/14} + Location: 1:800 + Links: 1 + Maps: {5} Source { + 2_a.h5 /source_dset + 2_b.h5 /source_dset + 2_c.h5 /source_dset + 2_d.h5 /source_dset + 2_e.h5 /source_dset + } + Storage: 2688 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_1.ls b/tools/test/h5ls/vds_prefix/tvds-3_1.ls new file mode 100644 index 0000000..f4c8e78 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-3_1.ls @@ -0,0 +1,14 @@ +Opened "vds/prefix/3_1_vds.h5" with sec2 driver. +vds_dset Dataset {5/Inf, 25/25, 8/8} + Location: 1:800 + Links: 1 + Maps: {6} Source { + 1_a.h5 /source_dset + 1_b.h5 /source_dset + 1_c.h5 /source_dset + 1_d.h5 /source_dset + 1_e.h5 /source_dset + 1_f.h5 /source_dset + } + Storage: 4000 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_2.ls b/tools/test/h5ls/vds_prefix/tvds-3_2.ls new file mode 100644 index 0000000..5a7e2d8 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-3_2.ls @@ -0,0 +1,13 @@ +Opened "vds/prefix/3_2_vds.h5" with sec2 driver. +vds_dset Dataset {6/Inf, 13/13, 19/19} + Location: 1:800 + Links: 1 + Maps: {5} Source { + 2_a.h5 /source_dset + 2_b.h5 /source_dset + 2_c.h5 /source_dset + 2_d.h5 /source_dset + 2_e.h5 /source_dset + } + Storage: 5928 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-4.ls b/tools/test/h5ls/vds_prefix/tvds-4.ls new file mode 100644 index 0000000..c22d3a4 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-4.ls @@ -0,0 +1,9 @@ +Opened "vds/prefix/4_vds.h5" with sec2 driver. +vds_dset Dataset {9/Inf, 4/4, 4/4} + Location: 1:800 + Links: 1 + Maps: {1} Source { + 4_%b.h5 /source_dset + } + Storage: 576 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-5.ls b/tools/test/h5ls/vds_prefix/tvds-5.ls new file mode 100644 index 0000000..efba8dc --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-5.ls @@ -0,0 +1,11 @@ +Opened "vds/prefix/5_vds.h5" with sec2 driver. +vds_dset Dataset {9/Inf, 4/4, 4/4} + Location: 1:800 + Links: 1 + Maps: {3} Source { + 5_a.h5 /source_dset + 5_b.h5 /source_dset + 5_c.h5 /source_dset + } + Storage: 576 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer -- cgit v0.12 From f5f2c36d98a6bfeb41363e38f1a34036264d1036 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 29 Dec 2017 09:05:30 -0600 Subject: HDFFV-9724 prefix of 0 length should be null value --- src/H5Dvirtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 8d861c9..24623e4 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -898,7 +898,7 @@ H5D__virtual_open_file(hid_t plist_id, const H5F_t *vdset_file, H5E_BEGIN_TRY { size = H5Pget_virtual_prefix(plist_id, NULL, 0); } H5E_END_TRY; - if(size < 0) + if(size <= 0) my_prefix = NULL; else { /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ -- cgit v0.12 From 6d3f7dea8683053cad86c04ac800ecf78361590f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 29 Dec 2017 11:53:11 -0600 Subject: Fix memory leak due to addition of FORMAT check loop --- test/filter_plugin.c | 204 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 126 insertions(+), 78 deletions(-) diff --git a/test/filter_plugin.c b/test/filter_plugin.c index 8b7e0e4..9897c84 100644 --- a/test/filter_plugin.c +++ b/test/filter_plugin.c @@ -134,7 +134,7 @@ allocate_and_init_2D_array(int ***arr, const hsize_t *sizes, int **initial_value return SUCCEED; error: free_2D_array(arr); - + return FAIL; } /* end allocate_and_init_2D_array() */ @@ -165,7 +165,7 @@ compare_2D_arrays(int **dset1, int **dset2, const hsize_t *sizes, /*OUT*/ hbool_ } return SUCCEED; - + } /* end compare_2D_arrays() */ @@ -612,7 +612,7 @@ test_read_data(hid_t did, int *origin_data) free_2D_array(&check); PASSED(); - + return SUCCEED; error: @@ -943,14 +943,14 @@ error: * paths. * * Return: SUCCEED/FAIL - * + * *------------------------------------------------------------------------- */ static herr_t test_path_api_calls(void) { unsigned int n_starting_paths; - unsigned int u; + unsigned int u; unsigned int n_paths; herr_t ret; ssize_t path_len = -1; @@ -1319,7 +1319,7 @@ error: * Purpose: Turns the chunk cache off * * Return: SUCCEED/FAIL - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1360,37 +1360,36 @@ main(void) unsigned new_format; int nerrors = 0; - /* Testing setup */ - h5_reset(); - /*******************************************************************/ /* ENSURE THAT WRITING TO DATASETS AND CREATING GROUPS WORKS */ /*******************************************************************/ + /* Test with old & new format groups */ + for (new_format = FALSE; new_format <= TRUE; new_format++) { + hid_t my_fapl_id; - /* Get a VFD-dependent filename */ - if ((old_ff_fapl_id = h5_fileaccess()) < 0) - TEST_ERROR; - - /* Turn off the chunk cache, so all the chunks are immediately written to disk */ - if (disable_chunk_cache(old_ff_fapl_id) < 0) - TEST_ERROR; + /* Testing setup */ + h5_reset(); - /* Copy the file access property list and set the latest file format on it */ - if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0) - TEST_ERROR; - if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - TEST_ERROR; + /* Get a VFD-dependent filename */ + if ((old_ff_fapl_id = h5_fileaccess()) < 0) + TEST_ERROR; - /* Fix up the filename for the VFD */ - h5_fixname(FILENAME[0], old_ff_fapl_id, filename, sizeof(filename)); + /* Turn off the chunk cache, so all the chunks are immediately written to disk */ + if (disable_chunk_cache(old_ff_fapl_id) < 0) + TEST_ERROR; - /* Test with old & new format groups */ - for (new_format = FALSE; new_format <= TRUE; new_format++) { - hid_t my_fapl_id; + /* Fix up the filename for the VFD */ + h5_fixname(FILENAME[0], old_ff_fapl_id, filename, sizeof(filename)); /* Set the FAPL for the type of format */ if (new_format) { HDputs("\nTesting with new file format:"); + /* Copy the file access property list and set the latest file format on it */ + if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0) + TEST_ERROR; + if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + TEST_ERROR; + my_fapl_id = new_ff_fapl_id; } else { @@ -1410,61 +1409,121 @@ main(void) if (H5Fclose(fid) < 0) TEST_ERROR; - } /* end for */ - /* Close FAPLs */ - if (H5Pclose(old_ff_fapl_id) < 0) - TEST_ERROR; - if (H5Pclose(new_ff_fapl_id) < 0) - TEST_ERROR; + /* Close FAPLs */ + if (H5Pclose(old_ff_fapl_id) < 0) + TEST_ERROR; + if (new_format) { + if (H5Pclose(new_ff_fapl_id) < 0) + TEST_ERROR; + } - /* Restore the default error handler (set in h5_reset()) */ - h5_restore_err(); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); - /*******************************************************************/ - /* ENSURE THAT READING FROM DATASETS AND OPENING GROUPS WORKS */ - /*******************************************************************/ + /*******************************************************************/ + /* ENSURE THAT READING FROM DATASETS AND OPENING GROUPS WORKS */ + /*******************************************************************/ - HDputs("\nTesting reading data with with dynamic plugin filters:"); + HDputs("\nTesting reading data with with dynamic plugin filters:"); - /* Close the library so that all loaded plugin libraries are unloaded */ - h5_reset(); - if ((old_ff_fapl_id = h5_fileaccess()) < 0) - TEST_ERROR; + /* Close the library so that all loaded plugin libraries are unloaded */ + h5_reset(); + if ((old_ff_fapl_id = h5_fileaccess()) < 0) + TEST_ERROR; - /* Reopen the file for testing data reading */ - if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, old_ff_fapl_id)) < 0) - TEST_ERROR; + /* Set the FAPL for the type of format */ + if (new_format) { + /* Copy the file access property list and set the latest file format on it */ + if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0) + TEST_ERROR; + if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + TEST_ERROR; - /* Read the data with filters */ - nerrors += (test_dataset_read_with_filters(fid) < 0 ? 1 : 0); + my_fapl_id = new_ff_fapl_id; + } + else + my_fapl_id = old_ff_fapl_id; - /* Test creating groups using dynamically-loaded plugin filters */ - nerrors += (test_opening_groups_using_plugins(fid) < 0 ? 1 : 0); + /* Reopen the file for testing data reading */ + if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, my_fapl_id)) < 0) + TEST_ERROR; - /* Restore the default error handler (set in h5_reset()) */ - h5_restore_err(); + /* Read the data with filters */ + nerrors += (test_dataset_read_with_filters(fid) < 0 ? 1 : 0); - /*******************************************************************/ - /* ENSURE THAT DISABLING FILTER PLUGINS VIA THE FILTER FLAGS WORKS */ - /*******************************************************************/ + /* Test creating groups using dynamically-loaded plugin filters */ + nerrors += (test_opening_groups_using_plugins(fid) < 0 ? 1 : 0); - /* Close the library so that all loaded plugin libraries are unloaded */ - h5_reset(); - if ((old_ff_fapl_id = h5_fileaccess()) < 0) - TEST_ERROR; + /* Close FAPLs */ + if (H5Pclose(old_ff_fapl_id) < 0) + TEST_ERROR; + if (new_format) { + if (H5Pclose(new_ff_fapl_id) < 0) + TEST_ERROR; + } - /* Reopen the file for testing data reading */ - if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, old_ff_fapl_id)) < 0) - TEST_ERROR; + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); - /* When filters are disabled, make sure we can't read data from a - * dataset that requires a filter plugin. - */ - nerrors += (test_no_read_when_plugins_disabled(fid) < 0 ? 1 : 0); + /*******************************************************************/ + /* ENSURE THAT DISABLING FILTER PLUGINS VIA THE FILTER FLAGS WORKS */ + /*******************************************************************/ - if (H5Fclose(fid) < 0) - TEST_ERROR; + /* Close the library so that all loaded plugin libraries are unloaded */ + h5_reset(); + if ((old_ff_fapl_id = h5_fileaccess()) < 0) + TEST_ERROR; + + /* Set the FAPL for the type of format */ + if (new_format) { + /* Copy the file access property list and set the latest file format on it */ + if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0) + TEST_ERROR; + if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + TEST_ERROR; + + my_fapl_id = new_ff_fapl_id; + } + else + my_fapl_id = old_ff_fapl_id; + + /* Reopen the file for testing data reading */ + if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, my_fapl_id)) < 0) + TEST_ERROR; + + /* When filters are disabled, make sure we can't read data from a + * dataset that requires a filter plugin. + */ + nerrors += (test_no_read_when_plugins_disabled(fid) < 0 ? 1 : 0); + + if (H5Fclose(fid) < 0) + TEST_ERROR; + + /*********************/ + /* CLEAN UP */ + /*********************/ + /* Close FAPLs */ + if (new_format) { + if (H5Pclose(new_ff_fapl_id) < 0) + TEST_ERROR; + } + else { + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + + if (H5Pclose(old_ff_fapl_id) < 0) + TEST_ERROR; + } + + /* Free up saved arrays */ + free_2D_array(&orig_deflate_g); + free_2D_array(&orig_dynlib1_g); + free_2D_array(&orig_dynlib2_g); + free_2D_array(&orig_dynlib4_g); + } /* end for */ + + h5_cleanup(FILENAME, old_ff_fapl_id); /************************************/ /* TEST THE FILTER PLUGIN API CALLS */ @@ -1473,21 +1532,10 @@ main(void) /* Test the APIs for access to the filter plugin path table */ nerrors += (test_path_api_calls() < 0 ? 1 : 0); - /*********************/ - /* CLEAN UP AND EXIT */ - /*********************/ - - /* Free up saved arrays */ - free_2D_array(&orig_deflate_g); - free_2D_array(&orig_dynlib1_g); - free_2D_array(&orig_dynlib2_g); - free_2D_array(&orig_dynlib4_g); - if (nerrors) TEST_ERROR; HDprintf("All plugin tests passed.\n"); - h5_cleanup(FILENAME, old_ff_fapl_id); HDexit(EXIT_SUCCESS); -- cgit v0.12 From 9a477bef3a55718fbc886a70576f90c8329f7f12 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 29 Dec 2017 13:13:30 -0600 Subject: HDFFV-9724 add valgrind ENV --- tools/test/h5dump/CMakeTestsVDS.cmake | 5 ++++- tools/test/h5ls/CMakeTestsVDS.cmake | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 368471c..922e79e 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -155,7 +155,10 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $ ${ARGN}) - set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES + ENVIRONMENT "HDF5_VDS_PREFIX=${PROJECT_BINARY_DIR}/testfiles/vds/" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix" + ) if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") endif () diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index f25bd98..00e7d28 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -119,7 +119,10 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES + ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix" + ) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") endif () -- cgit v0.12 From fa1ae9f312aad7fa51e01961ce255a4ce08539e0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 29 Dec 2017 13:42:16 -0600 Subject: HDFFV-9724 init var to null --- src/H5Dvirtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 24623e4..306fe62 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -812,7 +812,7 @@ H5D__virtual_open_file(hid_t plist_id, const H5F_t *vdset_file, H5F_t *src_file = NULL; /* Source file */ H5F_t *ret_value = NULL; /* Actual return value */ char *full_name = NULL; /* File name with prefix */ - char *my_prefix; /* Library's copy of the prefix */ + char *my_prefix = NULL; /* Library's copy of the prefix */ unsigned intent; /* File access permissions */ char *actual_file_name = NULL; /* Virtual file's actual name */ char *temp_file_name = NULL; /* Temporary pointer to file name */ -- cgit v0.12 From 17b8f0bb936633f01bf6deba247e37bcadbc6b82 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Jan 2018 09:39:09 -0600 Subject: Fix valgrind issues --- config/cmake/CTestCustom.cmake | 81 ++++++++++++++++++++++++++++++++++++- tools/test/h5ls/CMakeTestsVDS.cmake | 2 +- 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 7aff076..33e6d4c 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -45,11 +45,13 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5TEST-clear-objects H5TEST-clear-cache-objects H5TEST-clear-cache_api-objects + H5TEST-clear-cache_image-objects H5TEST-clear-cache_tagging-objects - H5TEST-clear-ttsafe-objects H5TEST-clear-err_compat-objects H5TEST-clear-error_test-objects + H5TEST-clear-filenotclosed-objects H5TEST-clear-links_env-objects + H5TEST-clear-ttsafe-objects PERFORM_h5perform-clear-objects HL_TOOLS-clear-objects HL_test-clear-objects @@ -58,6 +60,18 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE CPP_testhdf5-clear-objects ######### tools/h5clear ######### H5CLEAR-clearall-objects + H5CLEAR-copy_h5clear_log_v3.h5 + H5CLEAR-copy_h5clear_mdc_image.h5 + H5CLEAR-copy_h5clear_sec2_v0.h5 + H5CLEAR-copy_h5clear_sec2_v2.h5 + H5CLEAR-copy_h5clear_sec2_v3.h5 + H5CLEAR-copy_latest_h5clear_log_v3.h5 + H5CLEAR-copy_latest_h5clear_sec2_v3.h5 + H5CLEAR-copy_mod_h5clear_mdc_image.h5 + H5CLEAR-copy_mod_h5clr_mdc_image2.h5 + H5CLEAR-copy_orig_h5clear_sec2_v0.h5 + H5CLEAR-copy_orig_h5clear_sec2_v2.h5 + H5CLEAR-copy_orig_h5clear_sec2_v3.h5 H5CLEAR-h5clear_gentest # does not close ids by design ######### tools/h5copy ######### H5COPY-clearall-objects @@ -209,6 +223,68 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5LS_VDS-clearall-objects ######### tools/h5repack ######### H5REPACK-clearall-objects + H5REPACK-add_alignment-clear-objects + H5REPACK-add_userblock-clear-objects + H5REPACK-all_filters-clear-objects + H5REPACK-attr-clear-objects + H5REPACK-committed_dt-clear-objects + H5REPACK-deflate_convert-clear-objects + H5REPACK-deflate_copy-clear-objects + H5REPACK-deflate_file-clear-objects + H5REPACK-deflate_remove-clear-objects + H5REPACK-early-clear-objects + H5REPACK-error4-clear-objects + H5REPACK-family-clear-objects + H5REPACK-fill-clear-objects + H5REPACK-fletcher_all-clear-objects + H5REPACK-fletcher_copy-clear-objects + H5REPACK-fletcher_individual-clear-objects + H5REPACK-fletcher_remove-clear-objects + H5REPACK-global_filters-clear-objects + H5REPACK-gt_mallocsize-clear-objects + H5REPACK-gzip_all-clear-objects + H5REPACK-gzip_individual-clear-objects + H5REPACK-hlink-clear-objects + H5REPACK-layout-clear-objects + H5REPACK-native_attr-clear-objects + H5REPACK-native_fill-clear-objects + H5REPACK-nbit_add-clear-objects + H5REPACK-nbit_copy-clear-objects + H5REPACK-nbit_remove-clear-objects + H5REPACK-nested_8bit_enum-clear-objects + H5REPACK-objs-clear-objects + H5REPACK-remove_all-clear-objects + H5REPACK-scale_add-clear-objects + H5REPACK-scale_copy-clear-objects + H5REPACK-scale_remove-clear-objects + H5REPACK-shuffle_all-clear-objects + H5REPACK-shuffle_copy-clear-objects + H5REPACK-shuffle_individual-clear-objects + H5REPACK-shuffle_remove-clear-objects + H5REPACK-szip_all-clear-objects + H5REPACK-szip_convert-clear-objects + H5REPACK-szip_copy-clear-objects + H5REPACK-szip_individual-clear-objects + H5REPACK-szip_remove-clear-objects + H5REPACK-upgrade_layout-clear-objects + H5REPACK_DMP-crtorder-clear-objects + H5REPACK_DMP-deflate_limit-clear-objects + H5REPACK-bug1814-clear-objects + H5REPACK-HDFFV-5932-clear-objects + H5REPACK-HDFFV-7840-clear-objects + H5REPACK_META-meta_long_N-clear-objects + H5REPACK_META-meta_short_N-clear-objects + H5REPACK_OLD-old_style_layout_short_switches-clear-objects + H5REPACK_STAT-GS_AGGR-clear-objects + H5REPACK_STAT-S_AGGR-clear-objects + H5REPACK_STAT-SP_NONE-clear-objects + H5REPACK_STAT-SP_PAGE-clear-objects + H5REPACK_STAT-SPT_FSM_AGGR-clear-objects + H5REPACK_STAT-STG_PAGE-clear-objects + ######### + H5REPACK_META-meta_long + H5REPACK_META-meta_short + ######### H5REPACK-gzip_verbose_filters #uses runTest.cmake H5REPACK_VERIFY_LAYOUT-dset2_chunk_20x10 #uses grepTest.cmake H5REPACK_VERIFY_LAYOUT_ALL-chunk_20x10 #uses grepTest.cmake @@ -236,6 +312,8 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE ######### tools/misc ######### H5REPART-clearall-objects H5MKGRP-clearall-objects + ######### tools/perform ######### + PERFORM_h5perform-clearall-objects ######### hl/tools/h5watch ######### H5WATCH-clearall-objects ######### examples ######### @@ -244,5 +322,6 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE CPP_ex_tutr-clear-objects HL_ex-clear-objects f90_ex-clear-objects + HL_CPP_ex_ptExampleFL-clear-objects HL_FORTRAN_f90_ex-clear-objects ) diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index 00e7d28..2b6f61e 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -121,7 +121,7 @@ add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}" - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" ) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") -- cgit v0.12 From 5f4676f3c8f077b1667611b78d2cb19deec1f37a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Jan 2018 14:39:32 -0600 Subject: HDFFV-8745 - fix implementation of 8625 --- MANIFEST | 2 +- tools/lib/h5diff_attr.c | 20 -------------------- tools/lib/h5diff_dset.c | 19 +++++++++++++++++++ tools/test/h5diff/CMakeTests.cmake | 12 +++++++----- tools/test/h5diff/testfiles/h5diff_8625.txt | 10 ++++++++++ tools/test/h5diff/testfiles/h5diff_tmp1.txt | 5 ----- tools/test/h5diff/testh5diff.sh.in | 8 ++++---- 7 files changed, 41 insertions(+), 35 deletions(-) create mode 100644 tools/test/h5diff/testfiles/h5diff_8625.txt delete mode 100644 tools/test/h5diff/testfiles/h5diff_tmp1.txt diff --git a/MANIFEST b/MANIFEST index c6c7b3c..45b6912 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2425,7 +2425,7 @@ ./tools/test/h5diff/testfiles/non_comparables2.h5 ./tools/test/h5diff/testfiles/tmptest2.he5 ./tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 -./tools/test/h5diff/testfiles/h5diff_tmp1.txt +./tools/test/h5diff/testfiles/h5diff_8625.txt ./tools/test/h5diff/testfiles/tmptest.he5 ./tools/test/h5diff/testfiles/h5diff_tmp2.txt ./tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 6019738..4e4b40d 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -385,28 +385,8 @@ hsize_t diff_attr(hid_t loc1_id, /* get the datatypes */ if((ftype1_id = H5Aget_type(attr1_id)) < 0) 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(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 */ - if (vstrtype1 != vstrtype2) { - 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); - opts->not_cmp = 1; - if (H5Tclose(ftype1_id) < 0) - HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); - if (H5Tclose(ftype2_id) < 0) - HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed"); - if (H5Aclose(attr1_id) < 0) - HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose first attribute failed"); - if (H5Aclose(attr2_id) < 0) - 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(1, H5E_tools_min_id_g, "H5Tget_native_type first attribute ftype failed"); diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index ee42b99..55e9839 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -767,12 +767,31 @@ int diff_can_type(hid_t f_tid1, /* file data type */ } } + if(tclass1 == H5T_STRING) { + hid_t vstrtype1 = -1; + hid_t vstrtype2 = -1; + h5difftrace("diff_can_type end - H5T_STRING\n"); + + vstrtype1 = H5Tis_variable_str(f_tid1); + vstrtype2 = H5Tis_variable_str(f_tid2); + + /* no compare if either one but not both are variable string type */ + if (vstrtype1 != vstrtype2) { + if((opts->m_verbose || opts->m_list_not_cmp)) + parallel_print("Not comparable: <%s> or <%s> is of mixed string type\n", + obj1_name, obj2_name); + opts->not_cmp = 1; + HGOTO_DONE(0); + } + } + if(tclass1 == H5T_COMPOUND) { int nmembs1; int nmembs2; int j; hid_t memb_type1 = -1; hid_t memb_type2 = -1; + h5difftrace("diff_can_type end - H5T_COMPOUND\n"); nmembs1 = H5Tget_nmembers(f_tid1); nmembs2 = H5Tget_nmembers(f_tid2); diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index bbc39d8..773b03d 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -293,7 +293,7 @@ ${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_8625.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 @@ -1021,6 +1021,8 @@ h5diff_800.out.err h5diff_801.out h5diff_801.out.err + h5diff_8625.out + h5diff_8625.out.err h5diff_90.out h5diff_90.out.err h5diff_v1.out @@ -1281,9 +1283,7 @@ ADD_H5_TEST (h5diff_631 0 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp18 g1/f # 7. attributes # ############################################################################## ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) -# temporary test to verify HDF5-8625 -ADD_H5_TEST (h5diff_tmp1 0 tmptest2.he5 tmptest.he5) -# temporary test to verify HDF5-8639 +# temporary test to verify HDFFV-8639 ADD_H5_TEST (h5diff_tmp2 1 tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.reference.h5) # ################################################## @@ -1613,7 +1613,9 @@ 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_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group /group_copy) +# test to verify HDFFV-8625 +ADD_H5_TEST (h5diff_8625 0 -v --enable-error-stack ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group/Compound_dset1 /group_copy/Compound_dset3) ADD_H5_TEST (h5diff_vlstr 0 -v tvlstr.h5 tvlstr2.h5) # ############################################################################## diff --git a/tools/test/h5diff/testfiles/h5diff_8625.txt b/tools/test/h5diff/testfiles/h5diff_8625.txt new file mode 100644 index 0000000..a7ddb86 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_8625.txt @@ -0,0 +1,10 @@ +dataset: and +Warning: different storage datatype +Warning: different storage datatype +Not comparable: or is of mixed string type +0 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. +EXIT CODE: 0 diff --git a/tools/test/h5diff/testfiles/h5diff_tmp1.txt b/tools/test/h5diff/testfiles/h5diff_tmp1.txt deleted file mode 100644 index 40e3fb6..0000000 --- a/tools/test/h5diff/testfiles/h5diff_tmp1.txt +++ /dev/null @@ -1,5 +0,0 @@ --------------------------------- -Some objects are not comparable --------------------------------- -Use -c for a list of objects. -EXIT CODE: 0 diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index df472d4..2f04ab2 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -337,7 +337,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_709.txt $SRC_H5DIFF_TESTFILES/h5diff_710.txt $SRC_H5DIFF_TESTFILES/h5diff_80.txt $SRC_H5DIFF_TESTFILES/h5diff_90.txt -$SRC_H5DIFF_TESTFILES/h5diff_tmp1.txt +$SRC_H5DIFF_TESTFILES/h5diff_8625.txt $SRC_H5DIFF_TESTFILES/h5diff_tmp2.txt $SRC_H5DIFF_TESTFILES/h5diff_v1.txt $SRC_H5DIFF_TESTFILES/h5diff_v2.txt @@ -820,9 +820,7 @@ TOOLTEST h5diff_631.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h # 7. attributes # ############################################################################## TOOLTEST h5diff_70.txt -v h5diff_attr1.h5 h5diff_attr2.h5 -# temporary test to verify HDF5-8625 -TOOLTEST h5diff_tmp1.txt tmptest2.he5 tmptest.he5 -# temporary test to verify HDF5-8639 +# temporary test to verify HDFFV-8639 TOOLTEST h5diff_tmp2.txt tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.reference.h5 # ################################################## @@ -1145,6 +1143,8 @@ 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 +# test to verify HDFFV-8625 +TOOLTEST h5diff_8625.txt -v --enable-error-stack h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group/Compound_dset1 /group_copy/Compound_dset3 TOOLTEST h5diff_vlstr.txt -v tvlstr.h5 tvlstr2.h5 # ############################################################################## -- cgit v0.12 From ccf044135c675baa95e79a0623216c644ed6b657 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Jan 2018 14:43:28 -0600 Subject: HDFFV-8745 remove obsolete files --- MANIFEST | 2 -- tools/test/h5diff/testfiles/tmptest.he5 | Bin 4740424 -> 0 bytes tools/test/h5diff/testfiles/tmptest2.he5 | Bin 4734280 -> 0 bytes 3 files changed, 2 deletions(-) delete mode 100644 tools/test/h5diff/testfiles/tmptest.he5 delete mode 100644 tools/test/h5diff/testfiles/tmptest2.he5 diff --git a/MANIFEST b/MANIFEST index 45b6912..3b729ff 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2423,10 +2423,8 @@ ./tools/test/h5diff/testfiles/compounds_array_vlen2.h5 ./tools/test/h5diff/testfiles/non_comparables1.h5 ./tools/test/h5diff/testfiles/non_comparables2.h5 -./tools/test/h5diff/testfiles/tmptest2.he5 ./tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 ./tools/test/h5diff/testfiles/h5diff_8625.txt -./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 diff --git a/tools/test/h5diff/testfiles/tmptest.he5 b/tools/test/h5diff/testfiles/tmptest.he5 deleted file mode 100644 index edcfcd2..0000000 Binary files a/tools/test/h5diff/testfiles/tmptest.he5 and /dev/null differ diff --git a/tools/test/h5diff/testfiles/tmptest2.he5 b/tools/test/h5diff/testfiles/tmptest2.he5 deleted file mode 100644 index a6ab02b..0000000 Binary files a/tools/test/h5diff/testfiles/tmptest2.he5 and /dev/null differ -- cgit v0.12 From 0ec1e5eeeea9667c267a88814381de4242447da9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Jan 2018 15:08:43 -0600 Subject: HDFFV-8745 remove files from test scripts --- tools/test/h5diff/CMakeTests.cmake | 2 -- tools/test/h5diff/testh5diff.sh.in | 2 -- 2 files changed, 4 deletions(-) diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 773b03d..0a8d40f 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -63,8 +63,6 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/non_comparables1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmptest.he5 - ${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 diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 2f04ab2..d9cb857 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -118,8 +118,6 @@ $SRC_H5DIFF_TESTFILES/h5diff_attr_v_level2.h5 $SRC_H5DIFF_TESTFILES/h5diff_enum_invalid_values.h5 $SRC_H5DIFF_TESTFILES/non_comparables1.h5 $SRC_H5DIFF_TESTFILES/non_comparables2.h5 -$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 -- cgit v0.12 From f8e84c55092d71b491cf86292a981f6122c78cfa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Jan 2018 16:25:03 -0600 Subject: HDFFV-8745 cleanup vl resource usage --- tools/lib/h5diff_dset.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 55e9839..86aa543 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -192,7 +192,8 @@ hsize_t diff_datasetid(hid_t did1, 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 */ + unsigned int vl_data1 = 0; /*contains VL datatypes */ + unsigned int vl_data2 = 0; /*contains VL datatypes */ h5difftrace("diff_datasetid start\n"); /* Get the dataspace handle */ @@ -320,7 +321,9 @@ hsize_t diff_datasetid(hid_t did1, * VLEN memory buffer later */ if(TRUE == h5tools_detect_vlen(m_tid1)) - vl_data = TRUE; + vl_data1 = TRUE; + if(TRUE == h5tools_detect_vlen(m_tid2)) + vl_data2 = TRUE; h5diffdebug2("h5tools_detect_vlen - errstat:%d\n", opts->err_stat); /*------------------------------------------------------------------------ @@ -411,11 +414,12 @@ hsize_t diff_datasetid(hid_t did1, h5diffdebug2("diff_array nfound:%d\n", nfound); /* reclaim any VL memory, if necessary */ - if(vl_data) { - h5difftrace("check vl_data\n"); + h5diffdebug2("check vl_data1:%d\n", vl_data1); + if(vl_data1) H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); + h5diffdebug2("check vl_data2:%d\n", vl_data2); + if(vl_data2) H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); - } /* end if */ if(buf1 != NULL) { HDfree(buf1); buf1 = NULL; @@ -505,10 +509,10 @@ hsize_t diff_datasetid(hid_t did1, dadims, opts, name1, name2, dam_tid, did1, did2); /* reclaim any VL memory, if necessary */ - if(vl_data) { + if(vl_data1) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); - H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2); - } /* end if */ + if(vl_data2) + H5Dvlen_reclaim(m_tid2, sm_space, H5P_DEFAULT, sm_buf2); /* calculate the next hyperslab offset */ for(i = rank1, carry = 1; i > 0 && carry; --i) { @@ -545,29 +549,29 @@ done: /* free */ if(buf1 != NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) + if(vl_data1) H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); HDfree(buf1); buf1 = NULL; } if(buf2 != NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) + if(vl_data2) H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); HDfree(buf2); buf2 = NULL; } if(sm_buf1 != NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) + if(vl_data1) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); HDfree(sm_buf1); sm_buf1 = NULL; } if(sm_buf2 != NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) - H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2); + if(vl_data2) + H5Dvlen_reclaim(m_tid2, sm_space, H5P_DEFAULT, sm_buf2); HDfree(sm_buf2); sm_buf2 = NULL; } @@ -576,6 +580,7 @@ done: H5E_BEGIN_TRY { H5Sclose(sid1); H5Sclose(sid2); + H5Sclose(sm_space); H5Tclose(f_tid1); H5Tclose(f_tid2); H5Tclose(m_tid1); -- cgit v0.12 From 7d13e53294dc5e5161da49bc2654ecb1fbe207b8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 Jan 2018 10:09:03 -0600 Subject: HDFFV-9745 Create test and files to verify fixes --- MANIFEST | 5 +- tools/test/h5diff/CMakeTests.cmake | 11 +- tools/test/h5diff/h5diffgentest.c | 6776 +++++++++++++++------------ tools/test/h5diff/testfiles/h5diff_8639.txt | 72 + tools/test/h5diff/testfiles/h5diff_attr1.h5 | Bin 26000 -> 27480 bytes tools/test/h5diff/testfiles/h5diff_attr2.h5 | Bin 26000 -> 27480 bytes tools/test/h5diff/testfiles/h5diff_attr3.h5 | Bin 0 -> 27440 bytes tools/test/h5diff/testfiles/h5diff_tmp2.txt | 13 - tools/test/h5diff/testh5diff.sh.in | 9 +- 9 files changed, 3748 insertions(+), 3138 deletions(-) create mode 100644 tools/test/h5diff/testfiles/h5diff_8639.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_attr3.h5 delete mode 100644 tools/test/h5diff/testfiles/h5diff_tmp2.txt diff --git a/MANIFEST b/MANIFEST index 3b729ff..2db6d6b 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2382,6 +2382,7 @@ ./tools/test/h5diff/testfiles/h5diff_attr1.h5 ./tools/test/h5diff/testfiles/h5diff_attr2.h5 +./tools/test/h5diff/testfiles/h5diff_attr3.h5 ./tools/test/h5diff/testfiles/h5diff_attr_v_level1.h5 ./tools/test/h5diff/testfiles/h5diff_attr_v_level2.h5 ./tools/test/h5diff/testfiles/h5diff_basic1.h5 @@ -2423,10 +2424,8 @@ ./tools/test/h5diff/testfiles/compounds_array_vlen2.h5 ./tools/test/h5diff/testfiles/non_comparables1.h5 ./tools/test/h5diff/testfiles/non_comparables2.h5 -./tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 ./tools/test/h5diff/testfiles/h5diff_8625.txt -./tools/test/h5diff/testfiles/h5diff_tmp2.txt -./tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 +./tools/test/h5diff/testfiles/h5diff_8639.txt ./tools/test/h5diff/testfiles/tudfilter.h5 ./tools/test/h5diff/testfiles/tudfilter2.h5 ./tools/test/h5diff/testfiles/h5diff_ud.txt diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 0a8d40f..e06f069 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -26,6 +26,7 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dtypes.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr2.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr3.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 @@ -63,8 +64,6 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/non_comparables1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 - ${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 @@ -292,7 +291,7 @@ ${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_8625.txt - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp2.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8639.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 @@ -1021,6 +1020,8 @@ h5diff_801.out.err h5diff_8625.out h5diff_8625.out.err + h5diff_8639.out + h5diff_8639.out.err h5diff_90.out h5diff_90.out.err h5diff_v1.out @@ -1281,8 +1282,6 @@ ADD_H5_TEST (h5diff_631 0 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp18 g1/f # 7. attributes # ############################################################################## ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) -# temporary test to verify HDFFV-8639 -ADD_H5_TEST (h5diff_tmp2 1 tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.reference.h5) # ################################################## # attrs with verbose option level @@ -1614,6 +1613,8 @@ ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 ADD_H5_TEST (h5diff_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group /group_copy) # test to verify HDFFV-8625 ADD_H5_TEST (h5diff_8625 0 -v --enable-error-stack ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group/Compound_dset1 /group_copy/Compound_dset3) +# test to verify HDFFV-8639 +ADD_H5_TEST (h5diff_8639 0 -v h5diff_attr3.h5 h5diff_attr2.h5 /g1) ADD_H5_TEST (h5diff_vlstr 0 -v tvlstr.h5 tvlstr2.h5) # ############################################################################## diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 459a37e..2e98436 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.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 #include @@ -29,16 +29,16 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /*------------------------------------------------------------------------- -* Program: h5diffgentest -* -* Purpose: generate files for h5diff testing -* -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu -* -* Date: November 12, 2003 -* -*------------------------------------------------------------------------- -*/ + * Program: h5diffgentest + * + * Purpose: generate files for h5diff testing + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: November 12, 2003 + * + *------------------------------------------------------------------------- + */ #define FILE1 "h5diff_basic1.h5" #define FILE2 "h5diff_basic2.h5" @@ -46,6 +46,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define FILE4 "h5diff_dtypes.h5" #define FILE5 "h5diff_attr1.h5" #define FILE6 "h5diff_attr2.h5" +#define FILE6a "h5diff_attr3.h5" #define FILE7 "h5diff_dset1.h5" #define FILE8 "h5diff_dset2.h5" #define FILE8A "h5diff_dset3.h5" @@ -110,37 +111,36 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define SPACE1_DIM2 0 /* 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, - H5_ATTR_UNUSED const void * udata, H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id) -{ +static hid_t UD_traverse(H5_ATTR_UNUSED const char * link_name, + H5_ATTR_UNUSED hid_t cur_group, H5_ATTR_UNUSED const void * udata, + H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id) { return -1; } -const H5L_class_t UD_link_class[1] = {{ - H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ - (H5L_type_t)MY_LINKCLASS, /* Link type id number */ - "UD link class", /* name for debugging */ - NULL, /* Creation callback */ - NULL, /* Move/rename callback */ - NULL, /* Copy callback */ - UD_traverse, /* The actual traversal function */ - NULL, /* Deletion callback */ - NULL /* Query callback */ -}}; - +const H5L_class_t UD_link_class[1] = { { + H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ + (H5L_type_t) MY_LINKCLASS, /* Link type id number */ + "UD link class", /* name for debugging */ + NULL, /* Creation callback */ + NULL, /* Move/rename callback */ + NULL, /* Copy callback */ + UD_traverse, /* The actual traversal function */ + NULL, /* Deletion callback */ + NULL /* Query callback */ +} }; /*------------------------------------------------------------------------- -* prototypes -*------------------------------------------------------------------------- -*/ + * prototypes + *------------------------------------------------------------------------- + */ /* tests called in main() */ static int test_basic(const char *fname1, const char *fname2, const char *fname3); static int test_types(const char *fname); static int test_datatypes(const char *fname); -static int test_attributes(const char *fname,int make_diffs); -static int test_datasets(const char *fname,int make_diffs); -static int test_special_datasets(const char *fname,int make_diffs); -static int test_hyperslab(const char *fname,int make_diffs); +static int test_attributes(const char *fname, int make_diffs); +static int test_datasets(const char *fname, int make_diffs); +static int test_special_datasets(const char *fname, int make_diffs); +static int test_hyperslab(const char *fname, int make_diffs); static int test_link_name(const char *fname1); static int test_soft_links(const char *fname1); static int test_linked_softlinks(const char *fname1); @@ -155,54 +155,60 @@ static int test_exclude_obj3(const char *fname1, const char *fname2); static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new); static int test_attributes_verbose_level(const char *fname1, const char *fname2); static int test_enums(const char *fname); -static void test_comps_array (const char *fname, const char *dset, const char *attr,int diff, int is_file_new); -static void test_comps_vlen (const char *fname, const char *dset,const char *attr, int diff, int is_file_new); -static void test_comps_array_vlen (const char *fname, const char *dset, const char *attr, int diff, int is_file_new); -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); +static void test_comps_array(const char *fname, const char *dset, + const char *attr, int diff, int is_file_new); +static void test_comps_vlen(const char *fname, const char *dset, + const char *attr, int diff, int is_file_new); +static void test_comps_array_vlen(const char *fname, const char *dset, + const char *attr, int diff, int is_file_new); +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); -static void write_dset_in(hid_t loc_id,const char* dset_name,hid_t fid,int make_diffs); -static void gen_datareg(hid_t fid,int make_diffs); +static void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs); +static void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs); +static void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs); +static void gen_datareg(hid_t fid, int make_diffs); /* utilities */ -static int write_attr(hid_t loc_id,int rank,hsize_t *dims,const char *name,hid_t tid,void *buf); -static int write_dset(hid_t loc_id,int rank,hsize_t *dims,const char *name,hid_t tid,void *buf); +static int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf); +static int write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf); static int gen_dataset_idx(const char *file, int format); - /*------------------------------------------------------------------------- -* Function: main -* -* Purpose: main program -* -*------------------------------------------------------------------------- -*/ + * Function: main + * + * Purpose: main program + * + *------------------------------------------------------------------------- + */ int main(void) { test_basic(FILE1, FILE2, FILE11); - test_types (FILE3); + test_types(FILE3); test_datatypes(FILE4); /* generate 2 files, the second call creates a similar file with differences */ - test_attributes(FILE5,0); - test_attributes(FILE6,1); + test_attributes(FILE5, 0); + test_attributes(FILE6, 1); + /* generate file with string datatypes swapped */ + test_attributes(FILE6a, 2); /* test attributes with verbose level */ test_attributes_verbose_level(ATTR_VERBOSE_LEVEL_FILE1, ATTR_VERBOSE_LEVEL_FILE2); /* generate 2 files, the second call creates a similar file with differences */ - test_datasets(FILE7,0); - test_datasets(FILE8,1); - test_datasets(FILE8A,2); + 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); - test_hyperslab(FILE10,1); + test_hyperslab(FILE9, 0); + test_hyperslab(FILE10, 1); test_link_name(FILE12); @@ -215,15 +221,15 @@ int main(void) test_ext2soft_links(FILE17, FILE18); /* generate 2 files, the second call creates a similar file with differences */ - test_special_datasets(FILE19,0); - test_special_datasets(FILE20,1); + 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 - */ + * 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 + */ gen_dataset_idx(FILE21, 0); gen_dataset_idx(FILE22, 1); @@ -241,34 +247,34 @@ int main(void) test_comp_vlen_strings(COMP_VL_STRS_FILE, "group_copy", 0); /* diff when invalid enum values are present. - * This will probably grow to involve more extensive testing of - * enums so it has been given its own test file and test (apart - * from the basic type testing). - */ + * This will probably grow to involve more extensive testing of + * enums so it has been given its own test file and test (apart + * from the basic type testing). + */ test_enums(ENUM_INVALID_VALUES); /* ------------------------------------------------- - * Create test files with dataset and attribute with container types - * (array, vlen) with multiple nested compound types. - */ + * Create test files with dataset and attribute with container types + * (array, vlen) with multiple nested compound types. + */ /* file1 */ - test_comps_array(COMPS_COMPLEX1,"dset1", "attr1", 0, 1); - test_comps_vlen(COMPS_COMPLEX1,"dset2", "attr2", 0, 0); - test_comps_array_vlen(COMPS_COMPLEX1,"dset3", "attr3", 0, 0); - test_comps_vlen_arry(COMPS_COMPLEX1,"dset4", "attr4", 0, 0); + test_comps_array(COMPS_COMPLEX1, "dset1", "attr1", 0, 1); + test_comps_vlen(COMPS_COMPLEX1, "dset2", "attr2", 0, 0); + test_comps_array_vlen(COMPS_COMPLEX1, "dset3", "attr3", 0, 0); + test_comps_vlen_arry(COMPS_COMPLEX1, "dset4", "attr4", 0, 0); /* file2 */ - test_comps_array(COMPS_COMPLEX2,"dset1", "attr1", 5, 1); - test_comps_vlen(COMPS_COMPLEX2,"dset2", "attr2",5, 0); - test_comps_array_vlen(COMPS_COMPLEX2,"dset3", "attr3", 5, 0); - test_comps_vlen_arry(COMPS_COMPLEX2,"dset4", "attr4", 5, 0); + test_comps_array(COMPS_COMPLEX2, "dset1", "attr1", 5, 1); + test_comps_vlen(COMPS_COMPLEX2, "dset2", "attr2", 5, 0); + test_comps_array_vlen(COMPS_COMPLEX2, "dset3", "attr3", 5, 0); + 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 - * differences. - */ - test_data_nocomparables(NON_COMPARBLES1,0); - test_data_nocomparables(NON_COMPARBLES2,5); + * 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); + test_data_nocomparables(NON_COMPARBLES2, 5); /* common objects (same name) with different object types. HDFFV-7644 */ test_objs_nocomparables(NON_COMPARBLES1, NON_COMPARBLES2); @@ -280,28 +286,28 @@ int main(void) } /*------------------------------------------------------------------------- -* Function: test_basic -* -* Purpose: Create basic test files, first two contains different data, the -* third one is just an empty file. -* -*------------------------------------------------------------------------- -*/ + * Function: test_basic + * + * Purpose: Create basic test files, first two contains different data, the + * third one is just an empty file. + * + *------------------------------------------------------------------------- + */ static int test_basic(const char *fname1, const char *fname2, const char *fname3) { - hid_t fid1, fid2; - hid_t gid1, gid2, gid3; + hid_t fid1 = -1, fid2 = -1; + hid_t gid1 = -1, gid2 = -1, gid3 = -1; hsize_t dims1[1] = { 6 }; - hsize_t dims2[2] = { 3,2 }; + hsize_t dims2[2] = { 3, 2 }; /* create the empty file */ - if ((fid1=H5Fcreate(fname3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0){ + if ((fid1 = H5Fcreate(fname3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { fprintf(stderr, "empty file (%s) creation failed.\n", fname3); goto out; } - if (H5Fclose(fid1) < 0){ + if (H5Fclose(fid1) < 0) { fprintf(stderr, "empty file (%s) close failed.\n", fname3); goto out; } @@ -311,9 +317,9 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ - if (( fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) + if ((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (( fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) + if ((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /*------------------------------------------------------------------------- @@ -336,16 +342,20 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) */ { - double data1[3][2] = {{ 1.0F, 1.0F}, { 1.00F, 1.000F}, { 0.0F, 0.0F}}; - double data2[3][2] = {{ 0.0F, 1.1F}, { 1.01F, 1.001F}, { 0.0F, 1.0F}}; - double data3[3][2] = {{100.0F, 100.0F}, {100.00F, 100.000F}, {100.0F, 100.0F}}; - double data4[3][2] = {{105.0F, 120.0F}, {160.00F, 95.000F}, { 80.0F, 40.0F}}; + double data1[3][2] = + { { 1.0F, 1.0F }, { 1.00F, 1.000F }, { 0.0F, 0.0F } }; + double data2[3][2] = + { { 0.0F, 1.1F }, { 1.01F, 1.001F }, { 0.0F, 1.0F } }; + double data3[3][2] = { { 100.0F, 100.0F }, { 100.00F, 100.000F }, { + 100.0F, 100.0F } }; + double data4[3][2] = { { 105.0F, 120.0F }, { 160.00F, 95.000F }, { + 80.0F, 40.0F } }; - write_dset(gid1,2,dims2,"dset1",H5T_NATIVE_DOUBLE,data1); - write_dset(gid2,2,dims2,"dset2",H5T_NATIVE_DOUBLE,data2); - write_dset(gid1,2,dims2,"dset3",H5T_NATIVE_DOUBLE,data3); - write_dset(gid2,2,dims2,"dset4",H5T_NATIVE_DOUBLE,data4); - write_dset(gid2,2,dims2,"dset1",H5T_NATIVE_DOUBLE,data2); + write_dset(gid1, 2, dims2, "dset1", H5T_NATIVE_DOUBLE, data1); + write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_DOUBLE, data2); + write_dset(gid1, 2, dims2, "dset3", H5T_NATIVE_DOUBLE, data3); + write_dset(gid2, 2, dims2, "dset4", H5T_NATIVE_DOUBLE, data4); + write_dset(gid2, 2, dims2, "dset1", H5T_NATIVE_DOUBLE, data2); } /*------------------------------------------------------------------------- @@ -354,11 +364,11 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ { - int data5[3][2] = {{100,100},{100,0},{0,100}}; - int data6[3][2] = {{120,80}, {0,100},{0,50}}; + int data5[3][2] = { { 100, 100 }, { 100, 0 }, { 0, 100 } }; + int data6[3][2] = { { 120, 80 }, { 0, 100 }, { 0, 50 } }; - write_dset(gid1,2,dims2,"dset5",H5T_NATIVE_INT,data5); - write_dset(gid1,2,dims2,"dset6",H5T_NATIVE_INT,data6); + write_dset(gid1, 2, dims2, "dset5", H5T_NATIVE_INT, data5); + write_dset(gid1, 2, dims2, "dset6", H5T_NATIVE_INT, data6); } @@ -368,11 +378,12 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ { - unsigned long long data7[3][2] = {{100,100},{100,0},{0,100}}; - unsigned long long data8[3][2] = {{120,80}, {0,100},{0,50}}; + unsigned long long data7[3][2] = + { { 100, 100 }, { 100, 0 }, { 0, 100 } }; + unsigned long long data8[3][2] = { { 120, 80 }, { 0, 100 }, { 0, 50 } }; - write_dset(gid1,2,dims2,"dset7",H5T_NATIVE_ULLONG,data7); - write_dset(gid1,2,dims2,"dset8",H5T_NATIVE_ULLONG,data8); + write_dset(gid1, 2, dims2, "dset7", H5T_NATIVE_ULLONG, data7); + write_dset(gid1, 2, dims2, "dset8", H5T_NATIVE_ULLONG, data8); } @@ -390,45 +401,47 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ { - double data9[3][2] = {{100.0F, 100.0F}, {100.0F, 0.0F}, {0.0F, 100.0F}}; - double data10[3][2] ={{120.0F, 80.0F}, { 0.0F, 100.0F}, {0.0F, 50.0F}}; + double data9[3][2] = { { 100.0F, 100.0F }, { 100.0F, 0.0F }, { 0.0F, + 100.0F } }; + double data10[3][2] = { { 120.0F, 80.0F }, { 0.0F, 100.0F }, { 0.0F, + 50.0F } }; - write_dset(gid1,2,dims2,"dset9",H5T_NATIVE_DOUBLE,data9); - write_dset(gid1,2,dims2,"dset10",H5T_NATIVE_DOUBLE,data10); + write_dset(gid1, 2, dims2, "dset9", H5T_NATIVE_DOUBLE, data9); + write_dset(gid1, 2, dims2, "dset10", H5T_NATIVE_DOUBLE, data10); } - /*------------------------------------------------------------------------- * test floating point comparison *------------------------------------------------------------------------- */ { /* epsilon = 0.0000001 = 1e-7 - * system epsilon for float : FLT_EPSILON = 1.19209E-07 - */ - float data11[3][2] ={{0.000000f,0.0000001f},{0.0000001f, 0.00000022f},{0.0000001f,0.0000001f}}; - float data12[3][2] ={{0.000000f,0.0000002f},{0.0000003f,0.0000001f},{0.000000f,0.0000001f}}; + * system epsilon for float : FLT_EPSILON = 1.19209E-07 + */ + float data11[3][2] = { { 0.000000f, 0.0000001f }, { 0.0000001f, + 0.00000022f }, { 0.0000001f, 0.0000001f } }; + float data12[3][2] = { { 0.000000f, 0.0000002f }, { 0.0000003f, + 0.0000001f }, { 0.000000f, 0.0000001f } }; /* epsilon = 0.0000000000000001 = 1e-16 - * system epsilon for double : DBL_EPSILON = 2.22045E-16 - */ - double data13[3][2] ={ - {H5_DOUBLE(0.0000000000000000), H5_DOUBLE(0.0000000000000001)}, - {H5_DOUBLE(0.0000000000000001), H5_DOUBLE(0.0000000000000000)}, - {H5_DOUBLE(0.00000000000000033), H5_DOUBLE(0.0000000000000001)}}; - double data14[3][2] ={ - {H5_DOUBLE(0.0000000000000000), H5_DOUBLE(0.0000000000000004)}, - {H5_DOUBLE(0.0000000000000002), H5_DOUBLE(0.0000000000000001)}, - {H5_DOUBLE(0.0000000000000001), H5_DOUBLE(0.00000000000000000)}}; + * system epsilon for double : DBL_EPSILON = 2.22045E-16 + */ + double data13[3][2] = { { H5_DOUBLE(0.0000000000000000), H5_DOUBLE( + 0.0000000000000001) }, { H5_DOUBLE(0.0000000000000001), + H5_DOUBLE(0.0000000000000000) }, { H5_DOUBLE( + 0.00000000000000033), H5_DOUBLE(0.0000000000000001) } }; + double data14[3][2] = { { H5_DOUBLE(0.0000000000000000), H5_DOUBLE( + 0.0000000000000004) }, { H5_DOUBLE(0.0000000000000002), + H5_DOUBLE(0.0000000000000001) }, { H5_DOUBLE( + 0.0000000000000001), H5_DOUBLE(0.00000000000000000) } }; - write_dset(gid1,2,dims2,"fp1",H5T_NATIVE_FLOAT,data11); - write_dset(gid1,2,dims2,"fp2",H5T_NATIVE_FLOAT,data12); - write_dset(gid1,2,dims2,"d1",H5T_NATIVE_DOUBLE,data13); - write_dset(gid1,2,dims2,"d2",H5T_NATIVE_DOUBLE,data14); + write_dset(gid1, 2, dims2, "fp1", H5T_NATIVE_FLOAT, data11); + write_dset(gid1, 2, dims2, "fp2", H5T_NATIVE_FLOAT, data12); + write_dset(gid1, 2, dims2, "d1", H5T_NATIVE_DOUBLE, data13); + write_dset(gid1, 2, dims2, "d2", H5T_NATIVE_DOUBLE, data14); } - #if H5_SIZEOF_LONG_DOUBLE !=0 { @@ -437,15 +450,13 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ - long double data15[3][2] ={{1.0L,1.0L},{1.0L,1.0L},{1.0L,1.0L}}; + long double data15[3][2] = { {1.0L,1.0L}, {1.0L,1.0L}, {1.0L,1.0L}}; write_dset(gid1,2,dims2,"ld",H5T_NATIVE_LDOUBLE,data15); } #endif - - /*------------------------------------------------------------------------- * NaNs in H5T_NATIVE_FLOAT *------------------------------------------------------------------------- @@ -455,22 +466,22 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) float data15[6]; float data16[6]; - data15[0] = (float)HDsqrt(-1.0F); + data15[0] = (float) HDsqrt(-1.0F); data15[1] = 1.0F; - data15[2] = (float)HDsqrt(-1.0F); + data15[2] = (float) HDsqrt(-1.0F); data15[3] = 1.0F; data15[4] = 1.0F; data15[5] = 1.0F; - data16[0] = (float)HDsqrt(-1.0F); - data16[1] = (float)HDsqrt(-1.0F); + data16[0] = (float) HDsqrt(-1.0F); + data16[1] = (float) HDsqrt(-1.0F); data16[2] = 1.0F; data16[3] = 1.0F; data16[4] = 1.0F; data16[5] = 1.0F; - write_dset(gid1,1,dims1,"fp15",H5T_NATIVE_FLOAT,data15); - write_dset(gid1,1,dims1,"fp16",H5T_NATIVE_FLOAT,data16); + write_dset(gid1, 1, dims1, "fp15", H5T_NATIVE_FLOAT, data15); + write_dset(gid1, 1, dims1, "fp16", H5T_NATIVE_FLOAT, data16); } @@ -497,29 +508,29 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) data18[4] = 1.0F; data18[5] = 1.0F; - write_dset(gid1,1,dims1,"fp17",H5T_NATIVE_DOUBLE,data17); - write_dset(gid1,1,dims1,"fp18",H5T_NATIVE_DOUBLE,data18); - write_dset(gid1,1,dims1,"fp18_COPY",H5T_NATIVE_DOUBLE,data18); + write_dset(gid1, 1, dims1, "fp17", H5T_NATIVE_DOUBLE, data17); + write_dset(gid1, 1, dims1, "fp18", H5T_NATIVE_DOUBLE, data18); + write_dset(gid1, 1, dims1, "fp18_COPY", H5T_NATIVE_DOUBLE, data18); } /*------------------------------------------------------------------------ - * INFINITY values - *------------------------------------------------------------------------ - */ + * INFINITY values + *------------------------------------------------------------------------ + */ { - float data19[6]; + float data19[6]; double data20[6]; - data19[0] = data19[1] = data19[2] = (float)HDlog(0.0F); - data19[3] = data19[4] = data19[5] = (float)-HDlog(0.0F); + data19[0] = data19[1] = data19[2] = (float) HDlog(0.0F); + data19[3] = data19[4] = data19[5] = (float) -HDlog(0.0F); data20[0] = data20[1] = data20[2] = HDlog(0.0F); data20[3] = data20[4] = data20[5] = -HDlog(0.0F); - write_dset(gid1,1,dims1,"fp19",H5T_NATIVE_FLOAT,data19); - write_dset(gid1,1,dims1,"fp19_COPY",H5T_NATIVE_FLOAT,data19); - write_dset(gid1,1,dims1,"fp20",H5T_NATIVE_DOUBLE,data20); - write_dset(gid1,1,dims1,"fp20_COPY",H5T_NATIVE_DOUBLE,data20); + write_dset(gid1, 1, dims1, "fp19", H5T_NATIVE_FLOAT, data19); + write_dset(gid1, 1, dims1, "fp19_COPY", H5T_NATIVE_FLOAT, data19); + write_dset(gid1, 1, dims1, "fp20", H5T_NATIVE_DOUBLE, data20); + write_dset(gid1, 1, dims1, "fp20_COPY", H5T_NATIVE_DOUBLE, data20); } /*------------------------------------------------------------------------- @@ -527,105 +538,97 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ { - typedef struct cmp1_t - { + typedef struct cmp1_t { double d; - float f; + float f; } cmp1_t; - cmp1_t buf1[2]; - cmp1_t buf2[2]; - hsize_t dims[1] = {2}; - size_t type_size; - hid_t tid; + cmp1_t buf1[2]; + cmp1_t buf2[2]; + hsize_t dims[1] = { 2 }; + size_t type_size; + hid_t tid; buf1[0].d = HDsqrt(-1.0F); - buf1[0].f = (float)HDsqrt(-1.0F); + buf1[0].f = (float) HDsqrt(-1.0F); buf2[0].d = HDsqrt(-1.0F); - buf2[0].f = (float)HDsqrt(-1.0F); + buf2[0].f = (float) HDsqrt(-1.0F); buf1[1].d = HDsqrt(-1.0F); - buf1[1].f = (float)HDsqrt(-1.0F); + buf1[1].f = (float) HDsqrt(-1.0F); buf2[1].d = 0.0F; buf2[1].f = 0.0F; - type_size = sizeof( cmp1_t ); - tid = H5Tcreate (H5T_COMPOUND, type_size ); - H5Tinsert(tid, "d", HOFFSET( cmp1_t, d ), H5T_NATIVE_DOUBLE ); - H5Tinsert(tid, "f", HOFFSET( cmp1_t, f ), H5T_NATIVE_FLOAT ); - write_dset(gid1,1,dims,"dset11",tid,buf1); - write_dset(gid1,1,dims,"dset12",tid,buf2); + type_size = sizeof(cmp1_t); + tid = H5Tcreate(H5T_COMPOUND, type_size); + H5Tinsert(tid, "d", HOFFSET(cmp1_t, d), H5T_NATIVE_DOUBLE); + H5Tinsert(tid, "f", HOFFSET(cmp1_t, f), H5T_NATIVE_FLOAT); + write_dset(gid1, 1, dims, "dset11", tid, buf1); + write_dset(gid1, 1, dims, "dset12", tid, buf2); H5Tclose(tid); - } /* not comparable objects */ { - typedef struct cmp1_t - { + typedef struct cmp1_t { double d; - int i; + int i; } cmp1_t; - typedef struct cmp2_t - { - int i; + typedef struct cmp2_t { + int i; double d; } cmp2_t; - typedef struct cmp3_t - { + typedef struct cmp3_t { int i; } cmp3_t; - double data2[6] = {0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; - int data3[6] = {0,0,0,0,0,0}; - int data4[3][2] = {{0,0},{0,0},{0,0}}; - int data5[2][2] = {{0,0},{0,0}}; - unsigned int data6[3][2] = {{0,0},{0,0},{0,0}}; - cmp1_t data7[1] = {{1.0f, 2}}; - cmp2_t data8[1] = {{1, 2.0f}}; - hsize_t dims3[2] = {2, 2}; - hsize_t dims4[1] = {1}; - size_t type_size; - hid_t tid; - - - - write_dset(gid3,1,dims1,"dset1",H5T_NATIVE_DOUBLE,NULL); - write_dset(gid3,1,dims1,"dset2",H5T_NATIVE_DOUBLE,data2); - write_dset(gid3,1,dims1,"dset3",H5T_NATIVE_INT,data3); - write_dset(gid3,2,dims2,"dset4",H5T_NATIVE_INT,data4); - write_dset(gid3,2,dims3,"dset5",H5T_NATIVE_INT,data5); - write_dset(gid3,2,dims2,"dset6",H5T_NATIVE_UINT,data6); + double data2[6] = { 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }; + int data3[6] = { 0, 0, 0, 0, 0, 0 }; + int data4[3][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 } }; + int data5[2][2] = { { 0, 0 }, { 0, 0 } }; + unsigned int data6[3][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 } }; + cmp1_t data7[1] = { { 1.0f, 2 } }; + cmp2_t data8[1] = { { 1, 2.0f } }; + hsize_t dims3[2] = { 2, 2 }; + hsize_t dims4[1] = { 1 }; + size_t type_size; + hid_t tid; + + write_dset(gid3, 1, dims1, "dset1", H5T_NATIVE_DOUBLE, NULL); + write_dset(gid3, 1, dims1, "dset2", H5T_NATIVE_DOUBLE, data2); + write_dset(gid3, 1, dims1, "dset3", H5T_NATIVE_INT, data3); + write_dset(gid3, 2, dims2, "dset4", H5T_NATIVE_INT, data4); + write_dset(gid3, 2, dims3, "dset5", H5T_NATIVE_INT, data5); + write_dset(gid3, 2, dims2, "dset6", H5T_NATIVE_UINT, data6); /* case of compound with different type members */ - type_size = sizeof( cmp1_t ); - tid = H5Tcreate (H5T_COMPOUND, type_size ); - H5Tinsert(tid, "d", HOFFSET( cmp1_t, d ), H5T_NATIVE_DOUBLE ); - H5Tinsert(tid, "i", HOFFSET( cmp1_t, i ), H5T_NATIVE_INT ); - write_dset(gid3,1,dims4,"dset7",tid,data7); + type_size = sizeof(cmp1_t); + tid = H5Tcreate(H5T_COMPOUND, type_size); + H5Tinsert(tid, "d", HOFFSET(cmp1_t, d), H5T_NATIVE_DOUBLE); + H5Tinsert(tid, "i", HOFFSET(cmp1_t, i), H5T_NATIVE_INT); + write_dset(gid3, 1, dims4, "dset7", tid, data7); H5Tclose(tid); - type_size = sizeof( cmp2_t ); - tid = H5Tcreate (H5T_COMPOUND, type_size ); - H5Tinsert(tid, "i", HOFFSET( cmp2_t, i ), H5T_NATIVE_INT ); - H5Tinsert(tid, "d", HOFFSET( cmp2_t, d ), H5T_NATIVE_DOUBLE ); - write_dset(gid3,1,dims4,"dset8",tid,data8); + type_size = sizeof(cmp2_t); + tid = H5Tcreate(H5T_COMPOUND, type_size); + H5Tinsert(tid, "i", HOFFSET(cmp2_t, i), H5T_NATIVE_INT); + H5Tinsert(tid, "d", HOFFSET(cmp2_t, d), H5T_NATIVE_DOUBLE); + write_dset(gid3, 1, dims4, "dset8", tid, data8); H5Tclose(tid); /* case of compound with different number of members */ - type_size = sizeof( cmp3_t ); - tid = H5Tcreate (H5T_COMPOUND, type_size ); - H5Tinsert(tid, "i", HOFFSET( cmp2_t, i ), H5T_NATIVE_INT ); - write_dset(gid3,1,dims4,"dset9",tid,NULL); + type_size = sizeof(cmp3_t); + tid = H5Tcreate(H5T_COMPOUND, type_size); + H5Tinsert(tid, "i", HOFFSET(cmp2_t, i), H5T_NATIVE_INT); + write_dset(gid3, 1, dims4, "dset9", tid, NULL); H5Tclose(tid); } - /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- @@ -642,46 +645,43 @@ out: return FAIL; } - /*------------------------------------------------------------------------- -* Function: test_types -* -* Purpose: Compare different HDF5 object & link types: -* H5G_DATASET, H5G_TYPE, H5G_GROUP, H5G_LINK, H5G_UDLINK -* -*------------------------------------------------------------------------- -*/ + * Function: test_types + * + * Purpose: Compare different HDF5 object & link types: + * H5G_DATASET, H5G_TYPE, H5G_GROUP, H5G_LINK, H5G_UDLINK + * + *------------------------------------------------------------------------- + */ static int test_types(const char *fname) { - hid_t fid1; - hid_t gid1; - hid_t gid2; - hid_t tid1; - hid_t tid2; - herr_t status; - hsize_t dims[1]={1}; - typedef struct s1_t - { - int a; - float b; + hid_t fid1 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hid_t tid1 = -1; + hid_t tid2 = -1; + herr_t status; + hsize_t dims[1] = { 1 }; + typedef struct s1_t { + int a; + float b; } s1_t; - typedef struct s2_t - { - int a; + typedef struct s2_t { + int a; } s2_t; /*------------------------------------------------------------------------- * Create one file *------------------------------------------------------------------------- */ - fid1 = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid1 = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * H5G_DATASET *------------------------------------------------------------------------- */ - write_dset(fid1,1,dims,"dset",H5T_NATIVE_INT,0); + write_dset(fid1, 1, dims, "dset", H5T_NATIVE_INT, 0); /*------------------------------------------------------------------------- * H5G_GROUP @@ -723,7 +723,7 @@ int test_types(const char *fname) */ H5Lcreate_external("filename", "objname", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT); H5Lregister(UD_link_class); - H5Lcreate_ud(fid1, "ud_link", (H5L_type_t)MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_ud(fid1, "ud_link", (H5L_type_t) MY_LINKCLASS, NULL, (size_t) 0, H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * Close @@ -733,195 +733,192 @@ int test_types(const char *fname) return status; } - /* -# ############################################################################## -# # not comparable types -# ############################################################################## + # ############################################################################## + # # not comparable types + # ############################################################################## -# 2.0 -TOOLTEST h5diff_20.txt file3.h5 file3.h5 -v dset g1 + # 2.0 + TOOLTEST h5diff_20.txt file3.h5 file3.h5 -v dset g1 -# 2.1 -TOOLTEST h5diff_21.txt file3.h5 file3.h5 -v dset l1 + # 2.1 + TOOLTEST h5diff_21.txt file3.h5 file3.h5 -v dset l1 -# 2.2 -TOOLTEST h5diff_22.txt file3.h5 file3.h5 -v dset t1 + # 2.2 + TOOLTEST h5diff_22.txt file3.h5 file3.h5 -v dset t1 -# ############################################################################## -# # compare groups, types, links (no differences and differences) -# ############################################################################## + # ############################################################################## + # # compare groups, types, links (no differences and differences) + # ############################################################################## -# 2.3 -TOOLTEST h5diff_23.txt file3.h5 file3.h5 -v g1 g1 + # 2.3 + TOOLTEST h5diff_23.txt file3.h5 file3.h5 -v g1 g1 -# 2.4 -TOOLTEST h5diff_24.txt file3.h5 file3.h5 -v t1 t1 + # 2.4 + TOOLTEST h5diff_24.txt file3.h5 file3.h5 -v t1 t1 -# 2.5 -TOOLTEST h5diff_25.txt file3.h5 file3.h5 -v l1 l1 + # 2.5 + TOOLTEST h5diff_25.txt file3.h5 file3.h5 -v l1 l1 -# 2.6 -TOOLTEST h5diff_26.txt file3.h5 file3.h5 -v g1 g2 + # 2.6 + TOOLTEST h5diff_26.txt file3.h5 file3.h5 -v g1 g2 -# 2.7 -TOOLTEST h5diff_27.txt file3.h5 file3.h5 -v t1 t2 + # 2.7 + TOOLTEST h5diff_27.txt file3.h5 file3.h5 -v t1 t2 -# 2.8 -TOOLTEST h5diff_28.txt file3.h5 file3.h5 -v l1 l2 -*/ + # 2.8 + TOOLTEST h5diff_28.txt file3.h5 file3.h5 -v l1 l2 + */ /*------------------------------------------------------------------------- -* Function: test_datatypes -* -* Purpose: test dataset datatypes -* -*------------------------------------------------------------------------- -*/ + * Function: test_datatypes + * + * Purpose: test dataset datatypes + * + *------------------------------------------------------------------------- + */ static int test_datatypes(const char *fname) { - - hid_t fid1; - hid_t dset; - hsize_t dims[2]={3,2}; - herr_t status; - char buf1a[3][2] = {{1,1},{1,1},{1,1}}; - char buf1b[3][2] = {{1,1},{3,4},{5,6}}; - short buf2a[3][2] = {{1,1},{1,1},{1,1}}; - short buf2b[3][2] = {{1,1},{3,4},{5,6}}; - int buf3a[3][2] = {{1,1},{1,1},{1,1}}; - int buf3b[3][2] = {{1,1},{3,4},{5,6}}; - long buf4a[3][2] = {{1,1},{1,1},{1,1}}; - long buf4b[3][2] = {{1,1},{3,4},{5,6}}; - float buf5a[3][2] = {{1.0F, 1.0F}, {1.0F, 1.0F}, {1.0F, 1.0F}}; - float buf5b[3][2] = {{1.0F, 1.0F}, {3.0F, 4.0F}, {5.0F, 6.0F}}; - double buf6a[3][2] = {{1.0F, 1.0F}, {1.0F, 1.0F}, {1.0F, 1.0F}}; - double buf6b[3][2] = {{1.0F, 1.0F}, {3.0F, 4.0F}, {5.0F, 6.0F}}; + hid_t fid1 = -1; + hid_t dset = -1; + hsize_t dims[2] = { 3, 2 }; + herr_t status; + char buf1a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + char buf1b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; + short buf2a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + short buf2b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; + int buf3a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + int buf3b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; + long buf4a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + long buf4b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; + float buf5a[3][2] = { { 1.0F, 1.0F }, { 1.0F, 1.0F }, { 1.0F, 1.0F } }; + float buf5b[3][2] = { { 1.0F, 1.0F }, { 3.0F, 4.0F }, { 5.0F, 6.0F } }; + double buf6a[3][2] = { { 1.0F, 1.0F }, { 1.0F, 1.0F }, { 1.0F, 1.0F } }; + double buf6b[3][2] = { { 1.0F, 1.0F }, { 3.0F, 4.0F }, { 5.0F, 6.0F } }; /*unsigned/signed test signed char -128 to 127 unsigned char 0 to 255 */ - char buf7a[3][2] = {{-1,-128},{-1,-1},{-1,-1}}; - unsigned char buf7b[3][2] = {{1,128},{1,1},{1,1}}; + char buf7a[3][2] = { { -1, -128 }, { -1, -1 }, { -1, -1 } }; + unsigned char buf7b[3][2] = { { 1, 128 }, { 1, 1 }, { 1, 1 } }; /* long long test */ - long long buf8a[3][2] = {{1,1},{1,1},{1,1}}; - long long buf8b[3][2] = {{1,1},{3,4},{5,6}}; - unsigned long long buf9a[3][2] = {{1,1},{1,1},{1,1}}; - unsigned long long buf9b[3][2] = {{1,1},{3,4},{5,6}}; + long long buf8a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + long long buf8b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; + unsigned long long buf9a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + unsigned long long buf9b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; - unsigned int buf10a[3][2] = {{UIMAX,1},{1,1},{1,1}}; - unsigned int buf10b[3][2] = {{UIMAX-1,1},{3,4},{5,6}}; - - unsigned short buf11a[3][2] = {{204,205},{2,3},{1,1}}; - unsigned int buf11b[3][2] = {{204,205},{2,3},{1,1}}; + unsigned int buf10a[3][2] = { { UIMAX, 1 }, { 1, 1 }, { 1, 1 } }; + unsigned int buf10b[3][2] = { { UIMAX - 1, 1 }, { 3, 4 }, { 5, 6 } }; + unsigned short buf11a[3][2] = { { 204, 205 }, { 2, 3 }, { 1, 1 } }; + unsigned int buf11b[3][2] = { { 204, 205 }, { 2, 3 }, { 1, 1 } }; /*------------------------------------------------------------------------- * Create a file *------------------------------------------------------------------------- */ - fid1 = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid1 = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * Check for different storage order. Give a warning if they are different *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset0a",H5T_STD_I16LE,buf2a); - write_dset(fid1,2,dims,"dset0b",H5T_STD_I32LE,buf3b); + write_dset(fid1, 2, dims, "dset0a", H5T_STD_I16LE, buf2a); + write_dset(fid1, 2, dims, "dset0b", H5T_STD_I32LE, buf3b); /*------------------------------------------------------------------------- * H5T_NATIVE_CHAR *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset1a",H5T_NATIVE_CHAR,buf1a); - write_dset(fid1,2,dims,"dset1b",H5T_NATIVE_CHAR,buf1b); + write_dset(fid1, 2, dims, "dset1a", H5T_NATIVE_CHAR, buf1a); + write_dset(fid1, 2, dims, "dset1b", H5T_NATIVE_CHAR, buf1b); /*------------------------------------------------------------------------- * H5T_NATIVE_SHORT *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset2a",H5T_NATIVE_SHORT,buf2a); - write_dset(fid1,2,dims,"dset2b",H5T_NATIVE_SHORT,buf2b); + write_dset(fid1, 2, dims, "dset2a", H5T_NATIVE_SHORT, buf2a); + write_dset(fid1, 2, dims, "dset2b", H5T_NATIVE_SHORT, buf2b); /*------------------------------------------------------------------------- * H5T_NATIVE_INT *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset3a",H5T_NATIVE_INT,buf3a); - write_dset(fid1,2,dims,"dset3b",H5T_NATIVE_INT,buf3b); + write_dset(fid1, 2, dims, "dset3a", H5T_NATIVE_INT, buf3a); + write_dset(fid1, 2, dims, "dset3b", H5T_NATIVE_INT, buf3b); /*------------------------------------------------------------------------- * H5T_NATIVE_LONG *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset4a",H5T_NATIVE_LONG,buf4a); - write_dset(fid1,2,dims,"dset4b",H5T_NATIVE_LONG,buf4b); + write_dset(fid1, 2, dims, "dset4a", H5T_NATIVE_LONG, buf4a); + write_dset(fid1, 2, dims, "dset4b", H5T_NATIVE_LONG, buf4b); /*------------------------------------------------------------------------- * H5T_NATIVE_FLOAT *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset5a",H5T_NATIVE_FLOAT,buf5a); - write_dset(fid1,2,dims,"dset5b",H5T_NATIVE_FLOAT,buf5b); + write_dset(fid1, 2, dims, "dset5a", H5T_NATIVE_FLOAT, buf5a); + write_dset(fid1, 2, dims, "dset5b", H5T_NATIVE_FLOAT, buf5b); /*------------------------------------------------------------------------- * H5T_NATIVE_DOUBLE *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset6a",H5T_NATIVE_DOUBLE,buf6a); - write_dset(fid1,2,dims,"dset6b",H5T_NATIVE_DOUBLE,buf6b); + write_dset(fid1, 2, dims, "dset6a", H5T_NATIVE_DOUBLE, buf6a); + write_dset(fid1, 2, dims, "dset6b", H5T_NATIVE_DOUBLE, buf6b); /*------------------------------------------------------------------------- * H5T_NATIVE_CHAR and H5T_NATIVE_UCHAR *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset7a",H5T_NATIVE_CHAR,buf7a); - write_dset(fid1,2,dims,"dset7b",H5T_NATIVE_UCHAR,buf7b); + write_dset(fid1, 2, dims, "dset7a", H5T_NATIVE_CHAR, buf7a); + write_dset(fid1, 2, dims, "dset7b", H5T_NATIVE_UCHAR, buf7b); /*------------------------------------------------------------------------- * H5T_NATIVE_LLONG *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset8a",H5T_NATIVE_LLONG,buf8a); - write_dset(fid1,2,dims,"dset8b",H5T_NATIVE_LLONG,buf8b); + write_dset(fid1, 2, dims, "dset8a", H5T_NATIVE_LLONG, buf8a); + write_dset(fid1, 2, dims, "dset8b", H5T_NATIVE_LLONG, buf8b); /*------------------------------------------------------------------------- * H5T_NATIVE_ULLONG *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset9a",H5T_NATIVE_ULLONG,buf9a); - write_dset(fid1,2,dims,"dset9b",H5T_NATIVE_ULLONG,buf9b); + write_dset(fid1, 2, dims, "dset9a", H5T_NATIVE_ULLONG, buf9a); + write_dset(fid1, 2, dims, "dset9b", H5T_NATIVE_ULLONG, buf9b); /*------------------------------------------------------------------------- * H5T_NATIVE_INT *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset10a",H5T_NATIVE_UINT,buf10a); - write_dset(fid1,2,dims,"dset10b",H5T_NATIVE_UINT,buf10b); + write_dset(fid1, 2, dims, "dset10a", H5T_NATIVE_UINT, buf10a); + write_dset(fid1, 2, dims, "dset10b", H5T_NATIVE_UINT, buf10b); /*------------------------------------------------------------------------- * Same type class, different size *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset11a",H5T_STD_U16LE,buf11a); - dset=H5Dopen2 (fid1, "dset11a", H5P_DEFAULT); - write_attr(dset,2,dims,"attr",H5T_STD_U16LE,buf11a); - H5Dclose (dset); + write_dset(fid1, 2, dims, "dset11a", H5T_STD_U16LE, buf11a); + dset = H5Dopen2(fid1, "dset11a", H5P_DEFAULT); + write_attr(dset, 2, dims, "attr", H5T_STD_U16LE, buf11a); + H5Dclose(dset); - write_dset(fid1,2,dims,"dset11b",H5T_STD_U32LE,buf11b); - dset=H5Dopen2 (fid1, "dset11b", H5P_DEFAULT); - write_attr(dset,2,dims,"attr",H5T_STD_U32LE,buf11b); - H5Dclose (dset); + write_dset(fid1, 2, dims, "dset11b", H5T_STD_U32LE, buf11b); + dset = H5Dopen2(fid1, "dset11b", H5P_DEFAULT); + write_attr(dset, 2, dims, "attr", H5T_STD_U32LE, buf11b); + H5Dclose(dset); /*------------------------------------------------------------------------- * Close @@ -932,59 +929,58 @@ int test_datatypes(const char *fname) } /* -# ############################################################################## -# # Dataset datatypes -# ############################################################################## + # ############################################################################## + # # Dataset datatypes + # ############################################################################## -# 5.0 -TOOLTEST h5diff_50.txt file4.h5 file4.h5 -v dset0a dset0b + # 5.0 + TOOLTEST h5diff_50.txt file4.h5 file4.h5 -v dset0a dset0b -# 5.1 -TOOLTEST h5diff_51.txt file4.h5 file4.h5 -v dset1a dset1b + # 5.1 + TOOLTEST h5diff_51.txt file4.h5 file4.h5 -v dset1a dset1b -# 5.2 -TOOLTEST h5diff_52.txt file4.h5 file4.h5 -v dset2a dset2b + # 5.2 + TOOLTEST h5diff_52.txt file4.h5 file4.h5 -v dset2a dset2b -# 5.3 -TOOLTEST h5diff_53.txt file4.h5 file4.h5 -v dset3a dset4b + # 5.3 + TOOLTEST h5diff_53.txt file4.h5 file4.h5 -v dset3a dset4b -# 5.4 -TOOLTEST h5diff_54.txt file4.h5 file4.h5 -v dset4a dset4b + # 5.4 + TOOLTEST h5diff_54.txt file4.h5 file4.h5 -v dset4a dset4b -# 5.5 -TOOLTEST h5diff_55.txt file4.h5 file4.h5 -v dset5a dset5b + # 5.5 + TOOLTEST h5diff_55.txt file4.h5 file4.h5 -v dset5a dset5b -# 5.6 -TOOLTEST h5diff_56.txt file4.h5 file4.h5 -v dset6a dset6b + # 5.6 + TOOLTEST h5diff_56.txt file4.h5 file4.h5 -v dset6a dset6b -# 5.7 -TOOLTEST h5diff_57.txt file4.h5 file4.h5 -v dset7a dset7b + # 5.7 + TOOLTEST h5diff_57.txt file4.h5 file4.h5 -v dset7a dset7b -# 5.8 (region reference) -TOOLTEST h5diff_58.txt file7.h5 file8.h5 -v refreg -*/ + # 5.8 (region reference) + TOOLTEST h5diff_58.txt file7.h5 file8.h5 -v refreg + */ /*------------------------------------------------------------------------- -* Function: test_attributes -* -* Purpose: test attributes -* -*------------------------------------------------------------------------- -*/ + * Function: test_attributes + * + * Purpose: test attributes + * + *------------------------------------------------------------------------- + */ static -int test_attributes(const char *file, - int make_diffs /* flag to modify data buffers */) +int test_attributes(const char *file, int make_diffs /* flag to modify data buffers */) { - hid_t fid; - hid_t did; - hid_t gid; - hid_t root_id; - hid_t sid; - hsize_t dims[1]={2}; - herr_t status; + hid_t fid = -1; + hid_t did = -1; + hid_t gid = -1; + hid_t root_id = -1; + hid_t sid = -1; + hsize_t dims[1] = { 2 }; + herr_t status; /* Create a file */ - if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; /* Create a 1D dataset */ @@ -994,18 +990,23 @@ int test_attributes(const char *file, assert(status >= 0); /* Create groups */ - gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - root_id = H5Gopen2(fid, "/", H5P_DEFAULT); + gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + root_id = H5Gopen2(fid, "/", H5P_DEFAULT); /*------------------------------------------------------------------------- * write a series of attributes on the dataset, group, and root group *------------------------------------------------------------------------- */ - - write_attr_in(did,"dset",fid,make_diffs); - write_attr_in(gid,NULL,(hid_t)0,make_diffs); - write_attr_in(root_id,NULL,(hid_t)0,make_diffs); - + if (make_diffs > 1) { + write_attr_strings(did, "dset", fid, make_diffs); + write_attr_strings(gid, NULL, (hid_t) 0, make_diffs); + write_attr_strings(root_id, NULL, (hid_t) 0, make_diffs); + } + else { + write_attr_in(did, "dset", fid, make_diffs); + write_attr_in(gid, NULL, (hid_t) 0, make_diffs); + write_attr_in(root_id, NULL, (hid_t) 0, make_diffs); + } /* Close */ status = H5Dclose(did); @@ -1021,338 +1022,313 @@ int test_attributes(const char *file, return status; } - /*------------------------------------------------------------------------- -* Function: test_attributes_verbose_level -* -* Purpose: Cresting test files for testing attributes along with -* levels of verbos option -* -*------------------------------------------------------------------------- -*/ + * Function: test_attributes_verbose_level + * + * Purpose: Cresting test files for testing attributes along with + * levels of verbos option + * + *------------------------------------------------------------------------- + */ static int test_attributes_verbose_level(const char *fname1, const char *fname2) { - herr_t status = SUCCEED; - hid_t fid1 = -1, fid2 = -1; - hid_t f1_gid = -1, f2_gid = -1; - hid_t f1_gid2 = -1, f2_gid2 = -1; - hid_t f1_gid3 = -1, f2_gid3 = -1; - hid_t f1_gid4 = -1, f2_gid4 = -1; - hid_t f1_did = -1, f2_did = -1; - hid_t f1_sid = -1, f2_sid = -1; - hid_t f1_tid = -1, f2_tid = -1; + herr_t status = SUCCEED; + hid_t fid1 = -1, fid2 = -1; + hid_t f1_gid = -1, f2_gid = -1; + hid_t f1_gid2 = -1, f2_gid2 = -1; + hid_t f1_gid3 = -1, f2_gid3 = -1; + hid_t f1_gid4 = -1, f2_gid4 = -1; + hid_t f1_did = -1, f2_did = -1; + hid_t f1_sid = -1, f2_sid = -1; + hid_t f1_tid = -1, f2_tid = -1; /* dset */ - hsize_t dset_dims[1]={3}; - int dset_data[3] = {0,1,2}; + hsize_t dset_dims[1] = { 3 }; + int dset_data[3] = { 0, 1, 2 }; /* common attrs dim */ - hsize_t attr_dims[1]={2}; + hsize_t attr_dims[1] = { 2 }; /* file1 attr */ - int f1_attr_idata[2]= {1,2}; /* integer */ - float f1_attr_fdata[2]= {1.1F,2.2F}; /* float */ + int f1_attr_idata[2] = { 1, 2 }; /* integer */ + float f1_attr_fdata[2] = { 1.1F, 2.2F }; /* float */ /* file2 attr */ - int f2_attr_idata[2]= {2,3}; /* integer */ - float f2_attr_fdata[2]= {2.1F,3.2F}; /* float */ - + int f2_attr_idata[2] = { 2, 3 }; /* integer */ + float f2_attr_fdata[2] = { 2.1F, 3.2F }; /* float */ /*---------------------------------------------------------------------- * Create file1 *-----------------------------------------------------------------------*/ - if((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) - { + if ((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Groups */ f1_gid = H5Gcreate2(fid1, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f1_gid < 0) - { + if (f1_gid < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid2 = H5Gcreate2(fid1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f1_gid2 < 0) - { + if (f1_gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid3 = H5Gcreate2(fid1, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f1_gid3 < 0) - { + if (f1_gid3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid4 = H5Gcreate2(fid1, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f1_gid4 < 0) - { + if (f1_gid4 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Datasets */ f1_sid = H5Screate_simple(1, dset_dims, NULL); f1_did = H5Dcreate2(fid1, "dset", H5T_NATIVE_INT, f1_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f1_did == FAIL) - { + if (f1_did == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = H5Dwrite(f1_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Named Datatype */ f1_tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(fid1, "ntype", f1_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1); status = FAIL; goto out; } - - - /*---------------------------------------------------------------------- * Create file2 *-----------------------------------------------------------------------*/ - if((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) - { + if ((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Groups */ f2_gid = H5Gcreate2(fid2, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f2_gid < 0) - { + if (f2_gid < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid2 = H5Gcreate2(fid2, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f2_gid2 < 0) - { + if (f2_gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid3 = H5Gcreate2(fid2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f2_gid3 < 0) - { + if (f2_gid3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid4 = H5Gcreate2(fid2, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f2_gid4 < 0) - { + if (f2_gid4 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Datasets */ f2_sid = H5Screate_simple(1, dset_dims, NULL); f2_did = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, f2_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f2_did == FAIL) - { + if (f2_did == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = H5Dwrite(f2_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname2); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Named Datatype */ f2_tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(fid2, "ntype", f2_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * CASE1 - Same attr number, all Same attr name * add attr to group */ - write_attr(f1_gid,1,attr_dims,"integer1",H5T_NATIVE_INT,f1_attr_idata); - write_attr(f1_gid,1,attr_dims,"float1",H5T_NATIVE_FLOAT,f1_attr_fdata); + write_attr(f1_gid, 1, attr_dims, "integer1", H5T_NATIVE_INT, f1_attr_idata); + write_attr(f1_gid, 1, attr_dims, "float1", H5T_NATIVE_FLOAT, f1_attr_fdata); - write_attr(f2_gid,1,attr_dims,"integer1",H5T_NATIVE_INT,f2_attr_idata); - write_attr(f2_gid,1,attr_dims,"float1",H5T_NATIVE_FLOAT,f2_attr_fdata); + write_attr(f2_gid, 1, attr_dims, "integer1", H5T_NATIVE_INT, f2_attr_idata); + write_attr(f2_gid, 1, attr_dims, "float1", H5T_NATIVE_FLOAT, f2_attr_fdata); - /*---------------------------------- + /*---------------------------------- * CASE2 - Same attr number, some Same attr name * add attr to dset */ - write_attr(f1_did,1,attr_dims,"integer1",H5T_NATIVE_INT,f1_attr_idata); - write_attr(f1_did,1,attr_dims,"float2",H5T_NATIVE_FLOAT,f1_attr_fdata); + write_attr(f1_did, 1, attr_dims, "integer1", H5T_NATIVE_INT, f1_attr_idata); + write_attr(f1_did, 1, attr_dims, "float2", H5T_NATIVE_FLOAT, f1_attr_fdata); - write_attr(f2_did,1,attr_dims,"integer1",H5T_NATIVE_INT,f2_attr_idata); - write_attr(f2_did,1,attr_dims,"float3",H5T_NATIVE_FLOAT,f2_attr_fdata); + write_attr(f2_did, 1, attr_dims, "integer1", H5T_NATIVE_INT, f2_attr_idata); + write_attr(f2_did, 1, attr_dims, "float3", H5T_NATIVE_FLOAT, f2_attr_fdata); - /*---------------------------------- + /*---------------------------------- * CASE3 - Same attr number, all different attr name * add attr to ntype */ - write_attr(f1_tid,1,attr_dims,"integer1",H5T_NATIVE_INT,f1_attr_idata); - write_attr(f1_tid,1,attr_dims,"float2",H5T_NATIVE_FLOAT,f1_attr_fdata); - write_attr(f1_tid,1,attr_dims,"float3",H5T_NATIVE_FLOAT,f1_attr_fdata); + write_attr(f1_tid, 1, attr_dims, "integer1", H5T_NATIVE_INT, f1_attr_idata); + write_attr(f1_tid, 1, attr_dims, "float2", H5T_NATIVE_FLOAT, f1_attr_fdata); + write_attr(f1_tid, 1, attr_dims, "float3", H5T_NATIVE_FLOAT, f1_attr_fdata); - write_attr(f2_tid,1,attr_dims,"integer4",H5T_NATIVE_INT,f2_attr_idata); - write_attr(f2_tid,1,attr_dims,"float5",H5T_NATIVE_FLOAT,f2_attr_fdata); - write_attr(f2_tid,1,attr_dims,"float6",H5T_NATIVE_FLOAT,f2_attr_fdata); + write_attr(f2_tid, 1, attr_dims, "integer4", H5T_NATIVE_INT, f2_attr_idata); + write_attr(f2_tid, 1, attr_dims, "float5", H5T_NATIVE_FLOAT, f2_attr_fdata); + write_attr(f2_tid, 1, attr_dims, "float6", H5T_NATIVE_FLOAT, f2_attr_fdata); - /*---------------------------------- + /*---------------------------------- * CASE4 - Different attr number, some same attr name (vs file2-g2) * add attr to g2 */ - write_attr(f1_gid2,1,attr_dims,"integer1",H5T_NATIVE_INT,f1_attr_idata); - write_attr(f1_gid2,1,attr_dims,"float2",H5T_NATIVE_FLOAT,f1_attr_fdata); - write_attr(f1_gid2,1,attr_dims,"float3",H5T_NATIVE_FLOAT,f1_attr_fdata); - - write_attr(f2_gid2,1,attr_dims,"integer1",H5T_NATIVE_INT,f2_attr_idata); - write_attr(f2_gid2,1,attr_dims,"float2",H5T_NATIVE_FLOAT,f2_attr_fdata); + write_attr(f1_gid2, 1, attr_dims, "integer1", H5T_NATIVE_INT, f1_attr_idata); + write_attr(f1_gid2, 1, attr_dims, "float2", H5T_NATIVE_FLOAT, f1_attr_fdata); + write_attr(f1_gid2, 1, attr_dims, "float3", H5T_NATIVE_FLOAT, f1_attr_fdata); + write_attr(f2_gid2, 1, attr_dims, "integer1", H5T_NATIVE_INT, f2_attr_idata); + write_attr(f2_gid2, 1, attr_dims, "float2", H5T_NATIVE_FLOAT, f2_attr_fdata); - /*---------------------------------- + /*---------------------------------- * CASE5 - Different attr number, all different attr name * add attr to g3 */ - write_attr(f1_gid3,1,attr_dims,"integer10",H5T_NATIVE_INT,f1_attr_idata); - write_attr(f1_gid3,1,attr_dims,"float11",H5T_NATIVE_FLOAT,f1_attr_fdata); - write_attr(f1_gid3,1,attr_dims,"float12",H5T_NATIVE_FLOAT,f1_attr_fdata); - - write_attr(f2_gid3,1,attr_dims,"integer3",H5T_NATIVE_INT,f2_attr_idata); - write_attr(f2_gid3,1,attr_dims,"float4",H5T_NATIVE_FLOAT,f2_attr_fdata); + write_attr(f1_gid3, 1, attr_dims, "integer10", H5T_NATIVE_INT, f1_attr_idata); + write_attr(f1_gid3, 1, attr_dims, "float11", H5T_NATIVE_FLOAT, f1_attr_fdata); + write_attr(f1_gid3, 1, attr_dims, "float12", H5T_NATIVE_FLOAT, f1_attr_fdata); + write_attr(f2_gid3, 1, attr_dims, "integer3", H5T_NATIVE_INT, f2_attr_idata); + write_attr(f2_gid3, 1, attr_dims, "float4", H5T_NATIVE_FLOAT, f2_attr_fdata); out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1 > 0) + if (fid1 > 0) H5Fclose(fid1); - if(fid2 > 0) + if (fid2 > 0) H5Fclose(fid2); - if(f1_gid > 0) + if (f1_gid > 0) H5Gclose(f1_gid); - if(f2_gid > 0) + if (f2_gid > 0) H5Gclose(f2_gid); - if(f1_gid2 > 0) + if (f1_gid2 > 0) H5Gclose(f1_gid2); - if(f2_gid2 > 0) + if (f2_gid2 > 0) H5Gclose(f2_gid2); - if(f1_gid3 > 0) + if (f1_gid3 > 0) H5Gclose(f1_gid3); - if(f2_gid3 > 0) + if (f2_gid3 > 0) H5Gclose(f2_gid3); - if(f1_gid4 > 0) + if (f1_gid4 > 0) H5Gclose(f1_gid4); - if(f2_gid4 > 0) + if (f2_gid4 > 0) H5Gclose(f2_gid4); - if(f1_did > 0) + if (f1_did > 0) H5Dclose(f1_did); - if(f2_did > 0) + if (f2_did > 0) H5Dclose(f2_did); - if(f1_sid > 0) + if (f1_sid > 0) H5Sclose(f1_sid); - if(f2_sid > 0) + if (f2_sid > 0) H5Sclose(f2_sid); - if(f1_tid > 0) + if (f1_tid > 0) H5Tclose(f1_tid); - if(f2_tid > 0) + if (f2_tid > 0) H5Tclose(f2_tid); return status; } - /*------------------------------------------------------------------------- -* Function: test_datasets -* -* Purpose: Check all HDF5 classes -* H5T_INTEGER, H5T_FLOAT -* H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_COMPOUND, H5T_REFERENCE, -* H5T_ENUM, H5T_VLEN, H5T_ARRAY -* -*------------------------------------------------------------------------- -*/ + * Function: test_datasets + * + * Purpose: Check all HDF5 classes + * H5T_INTEGER, H5T_FLOAT + * H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_COMPOUND, H5T_REFERENCE, + * H5T_ENUM, H5T_VLEN, H5T_ARRAY + * + *------------------------------------------------------------------------- + */ static -int test_datasets(const char *file, - int make_diffs /* flag to modify data buffers */) +int test_datasets(const char *file, int make_diffs /* flag to modify data buffers */) { - hid_t fid; - hid_t did; - hid_t gid; - hid_t sid; - hsize_t dims[1]={2}; - herr_t status; - int buf[2]={1,2}; - - if(make_diffs > 0) + hid_t fid = -1; + hid_t did = -1; + hid_t gid = -1; + hid_t sid = -1; + hsize_t dims[1] = { 2 }; + herr_t status; + int buf[2] = { 1, 2 }; + + if (make_diffs > 0) memset(buf, 0, sizeof buf); /* Create a file */ - if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; /* Create a 1D dataset */ sid = H5Screate_simple(1, dims, NULL); - did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); status = H5Sclose(sid); assert(status >= 0); /* Create a group */ - gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * write a series of datasets on the group *------------------------------------------------------------------------- */ - write_dset_in(gid,"/dset",fid,make_diffs); + write_dset_in(gid, "/dset", fid, make_diffs); /* close */ status = H5Dclose(did); @@ -1367,29 +1343,29 @@ int test_datasets(const char *file, } /*------------------------------------------------------------------------- -* Function: test_special_datasets -* -* Purpose: Check datasets with datasapce of zero dimension size. -*------------------------------------------------------------------------- -*/ + * Function: test_special_datasets + * + * Purpose: Check datasets with datasapce of zero dimension size. + *------------------------------------------------------------------------- + */ static -int test_special_datasets(const char *file, - int make_diffs /* flag to modify data buffers */) +int test_special_datasets(const char *file, int make_diffs /* flag to modify data buffers */) { - hid_t fid; - hid_t did; - hid_t sid0, sid; - hsize_t dims0[SPACE1_RANK]={SPACE1_DIM1, SPACE1_DIM2}; - hsize_t dims[SPACE1_RANK]={SPACE1_DIM1, SPACE1_DIM2}; - herr_t status; + hid_t fid = -1; + hid_t did = -1; + hid_t sid0 = -1; + hid_t sid = -1; + hsize_t dims0[SPACE1_RANK] = { SPACE1_DIM1, SPACE1_DIM2 }; + hsize_t dims[SPACE1_RANK] = { SPACE1_DIM1, SPACE1_DIM2 }; + herr_t status; /* Create a file */ - if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; /* Create a dataset with zero dimension size */ sid0 = H5Screate_simple(SPACE1_RANK, dims0, NULL); - did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid0, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid0, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* close dataset */ status = H5Dclose(did); @@ -1400,12 +1376,12 @@ int test_special_datasets(const char *file, assert(status >= 0); /* 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) + * has a dataset with a non-zero dimension size */ + 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); + did = H5Dcreate2(fid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* close dataspace */ status = H5Sclose(sid); @@ -1422,26 +1398,25 @@ int test_special_datasets(const char *file, } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare links, one has longer name than -* the other and short name is subset of long name. -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare links, one has longer name than + * the other and short name is subset of long name. + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_link_name(const char *fname1) { - hid_t fid1=0; - hid_t gid1=0; - hid_t gid2=0; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + 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; @@ -1451,16 +1426,15 @@ static int test_link_name(const char *fname1) * Groups *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } - gid2 = H5Gcreate2(fid1, "group_longname", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + gid2 = H5Gcreate2(fid1, "group_longname", H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -1470,16 +1444,14 @@ static int test_link_name(const char *fname1) * Soft Links *------------------------------------------------------------------------*/ status = H5Lcreate_soft("group", fid1, "link_g1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("group_longname", fid1, "link_g2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; @@ -1489,38 +1461,37 @@ out: /*----------------------------------------------------------------------- * Close *------------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare soft links in various way -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare soft links in various way + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_soft_links(const char *fname1) { - hid_t fid1=0; - hid_t gid1=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - int data2[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t gid1 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + 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; @@ -1530,8 +1501,7 @@ static int test_soft_links(const char *fname1) * Groups *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -1541,25 +1511,22 @@ static int test_soft_links(const char *fname1) * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"target_dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"target_dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; @@ -1570,48 +1537,42 @@ static int test_soft_links(const char *fname1) *------------------------------------------------------------------------*/ /* file 1 */ status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset2", fid1, "softlink_dset2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_group", fid1, "softlink_group1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_group", fid1, "softlink_group2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/no_obj", fid1, "softlink_noexist", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; @@ -1621,38 +1582,37 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(gid1) + if (gid1) H5Gclose(gid1); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare linked soft links in various way -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare linked soft links in various way + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_linked_softlinks(const char *fname1) { - hid_t fid1=0; - hid_t gid1=0; - hid_t gid2=0; - hid_t gid3=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - int data2[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hid_t gid3 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + 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; @@ -1662,24 +1622,21 @@ static int test_linked_softlinks(const char *fname1) * Groups *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid2 = H5Gcreate2(fid1, "target_group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid3 = H5Gcreate2(fid1, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid3 < 0) - { + if (gid3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -1689,24 +1646,21 @@ static int test_linked_softlinks(const char *fname1) * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"target_dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"target_dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; @@ -1716,98 +1670,86 @@ static int test_linked_softlinks(const char *fname1) * Soft Links (Linked) *------------------------------------------------------------------------*/ /*--------- - * file 1 */ + * file 1 */ status = H5Lcreate_soft("/target_dset1", fid1, "softlink1_to_dset1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink1_to_dset1", fid1, "softlink1_to_slink1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink1_to_slink1", fid1, "softlink1_to_slink2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset2", fid1, "softlink2_to_dset2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink2_to_dset2", fid1, "softlink2_to_slink1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink2_to_slink1", fid1, "softlink2_to_slink2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("target_group1", fid1, "softlink3_to_group1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink3_to_group1", fid1, "softlink3_to_slink1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink3_to_slink1", fid1, "softlink3_to_slink2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("target_group2", fid1, "softlink4_to_group2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink4_to_group2", fid1, "softlink4_to_slink1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink4_to_slink1", fid1, "softlink4_to_slink2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; @@ -1817,52 +1759,50 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); - if(gid3) + if (gid3) H5Gclose(gid3); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare external links in various way -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare external links in various way + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_external_links(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid1=0; - hid_t gid2=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - int data2[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ /* source file */ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + 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; } /* target file */ - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + 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; @@ -1872,18 +1812,16 @@ static int test_external_links(const char *fname1, const char *fname2) * Groups *------------------------------------------------------------------------*/ /*-------------- - * target file */ + * target file */ gid1 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid2 = H5Gcreate2(fid2, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -1892,26 +1830,23 @@ static int test_external_links(const char *fname1, const char *fname2) * Datasets *------------------------------------------------------------------------*/ /*-------------- - * target file */ - status = write_dset(fid2,2,dims2,"target_dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + * target file */ + status = write_dset(fid2, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"x_dset",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "x_dset", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2,2,dims2,"x_dset",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid2, 2, dims2, "x_dset", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; @@ -1923,48 +1858,42 @@ static int test_external_links(const char *fname1, const char *fname2) /*--------------*/ /* source file */ status = H5Lcreate_external(fname2, "/target_group/x_dset", fid1, "ext_link_dset1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/target_group2/x_dset", fid1, "ext_link_dset2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/target_group", fid1, "/ext_link_grp1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/target_group2", fid1, "/ext_link_grp2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link_noexist1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link_noexist2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; @@ -1974,52 +1903,50 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare external links which point to -* soft link in various way -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare external links which point to + * soft link in various way + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_ext2soft_links(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid2=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - int data2[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid2 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ /* source file */ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + 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; } /* target file */ - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + 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; @@ -2030,8 +1957,7 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* target file */ gid2 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -2041,18 +1967,16 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) * Datasets *------------------------------------------------------------------------*/ /*-------------- - * target file */ - status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + * target file */ + status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(fid2,2,dims2,"dset2",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; @@ -2062,18 +1986,16 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) * Soft Links (Linked) *------------------------------------------------------------------------*/ /*--------------- - * target file */ + * target file */ status = H5Lcreate_soft("/dset1", fid2, "softlink_to_dset1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/dset2", fid2, "softlink_to_dset2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; @@ -2083,26 +2005,23 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) * External Links *------------------------------------------------------------------------*/ /*--------------- - * source file */ + * source file */ status = H5Lcreate_external(fname2, "/target_group", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/softlink_to_dset1", fid1, "ext_link_to_slink1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/softlink_to_dset2", fid1, "ext_link_to_slink2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; @@ -2112,56 +2031,57 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid2) + if (gid2) H5Gclose(gid2); return status; } /*------------------------------------------------------------------------- -* 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 -* -*------------------------------------------------------------------------- -*/ + * 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 + * + *------------------------------------------------------------------------- + */ 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 = -1; /* file id */ + hid_t did = -1; + hid_t did2 = -1; /* dataset id */ + hid_t sid = -1; /* space id */ + hid_t fapl = -1; /* file access property id */ + hid_t dcpl = -1; /* 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); + if (format) { + status = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + assert(status >= 0); } /* Create a file */ - if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) return -1; /* Create data */ - for(i = 0; i < 10; i++) - buf[i] = i; + for (i = 0; i < 10; i++) + buf[i] = i; /* Set chunk */ dcpl = H5Pcreate(H5P_DATASET_CREATE); @@ -2170,7 +2090,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); + 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); @@ -2182,7 +2102,7 @@ int gen_dataset_idx(const char *file, int format) assert(status >= 0); /* Create and write the dataset */ - did2 = H5Dcreate2(fid, "dset_filter", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + did2 = H5Dcreate2(fid, "dset_filter", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); assert(status >= 0); @@ -2212,35 +2132,33 @@ int gen_dataset_idx(const char *file, int format) } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare dangling links in various way -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare dangling links in various way + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_dangle_links(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - int data2[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + 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; } - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + 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; @@ -2250,34 +2168,30 @@ static int test_dangle_links(const char *fname1, const char *fname2) * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } /* file2 */ - status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(fid2,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; @@ -2288,32 +2202,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* file 1 */ status = H5Lcreate_soft("no_obj", fid1, "soft_link1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/dset1", fid1, "soft_link2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj", fid1, "soft_link3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj1", fid1, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; @@ -2321,32 +2231,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) /* file 2 */ status = H5Lcreate_soft("no_obj", fid2, "soft_link1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj", fid2, "soft_link2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/dset2", fid2, "soft_link3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj2", fid2, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; @@ -2357,32 +2263,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* file1 */ status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/dset1", fid1, "ext_link2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; @@ -2390,32 +2292,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) /* file2 */ status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/dset2", fid2, "ext_link3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; @@ -2425,47 +2323,45 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); return status; } /*------------------------------------------------------------------------- -* -* Purpose: For testing comparing group member objects recursively -* -* Programmer: Jonathan Kim (Aug 19, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: For testing comparing group member objects recursively + * + * Programmer: Jonathan Kim (Aug 19, 2010) + * + *-------------------------------------------------------------------------*/ static int test_group_recurse(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid1_f1=0, gid2_f1=0, gid3_f1=0, gid10_f1=0; - hid_t gid1_f2=0, gid2_f2=0, gid3_f2=0, gid11_f2=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{0,1},{1,0},{1,0}}; - int data2[4][2] = {{0,2},{0,2},{2,0},{2,0}}; - int data3[4][2] = {{0,3},{0,3},{3,0},{3,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid1_f1 = -1, gid2_f1 = -1, gid3_f1 = -1, gid10_f1 = -1; + hid_t gid1_f2 = -1, gid2_f2 = -1, gid3_f2 = -1, gid11_f2 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 0, 1 }, { 1, 0 }, { 1, 0 } }; + int data2[4][2] = { { 0, 2 }, { 0, 2 }, { 2, 0 }, { 2, 0 } }; + int data3[4][2] = { { 0, 3 }, { 0, 3 }, { 3, 0 }, { 3, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + 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; } - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + 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; @@ -2476,32 +2372,28 @@ static int test_group_recurse(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* file1 */ gid1_f1 = H5Gcreate2(fid1, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1_f1 < 0) - { + if (gid1_f1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid2_f1 = H5Gcreate2(fid1, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2_f1 < 0) - { + if (gid2_f1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid3_f1 = H5Gcreate2(fid1, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid3_f1 < 0) - { + if (gid3_f1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid10_f1 = H5Gcreate2(fid1, "/grp10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid10_f1 < 0) - { + if (gid10_f1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -2509,32 +2401,28 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file2 */ gid1_f2 = H5Gcreate2(fid2, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1_f2 < 0) - { + if (gid1_f2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid2_f2 = H5Gcreate2(fid2, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2_f2 < 0) - { + if (gid2_f2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid3_f2 = H5Gcreate2(fid2, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid3_f2 < 0) - { + if (gid3_f2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid11_f2 = H5Gcreate2(fid2, "/grp11", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid11_f2 < 0) - { + if (gid11_f2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -2544,50 +2432,44 @@ static int test_group_recurse(const char *fname1, const char *fname2) * Datasets under root *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"dset3",H5T_NATIVE_INT,data3); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset3", H5T_NATIVE_INT, data3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } /* file2 */ - status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(fid2,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(fid2,2,dims2,"dset3",H5T_NATIVE_INT,data3); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset3", H5T_NATIVE_INT, data3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; @@ -2597,163 +2479,142 @@ static int test_group_recurse(const char *fname1, const char *fname2) * Datasets under group *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(gid1_f1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid2_f1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid2_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid2_f1,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid2_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid3_f1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid3_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid3_f1,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid3_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid3_f1,2,dims2,"dset3",H5T_NATIVE_INT,data3); - if (status == FAIL) - { + status = write_dset(gid3_f1, 2, dims2, "dset3", H5T_NATIVE_INT, data3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid10_f1,2,dims2,"dset4",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid10_f1, 2, dims2, "dset4", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid10_f1,2,dims2,"dset5",H5T_NATIVE_INT,data3); - if (status == FAIL) - { + status = write_dset(gid10_f1, 2, dims2, "dset5", H5T_NATIVE_INT, data3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } /* file2 */ - status = write_dset(gid1_f2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2_f2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid2_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2_f2,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid2_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid3_f2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid3_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid3_f2,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid3_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid3_f2,2,dims2,"dset3",H5T_NATIVE_INT,data3); - if (status == FAIL) - { + status = write_dset(gid3_f2, 2, dims2, "dset3", H5T_NATIVE_INT, data3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid11_f2,2,dims2,"dset4",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid11_f2, 2, dims2, "dset4", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid11_f2,2,dims2,"dset5",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid11_f2, 2, dims2, "dset5", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - /*----------------------------------------------------------------------- * Soft Links *------------------------------------------------------------------------*/ /* file 1 */ status = H5Lcreate_soft("/grp1", fid1, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2", fid1, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2/grp3", fid1, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp10", fid1, "slink_grp10", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; @@ -2761,32 +2622,28 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file 2 */ status = H5Lcreate_soft("/grp1", fid2, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2", fid2, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2/grp3", fid2, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp11", fid2, "slink_grp11", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; @@ -2797,24 +2654,21 @@ static int test_group_recurse(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* file1 */ status = H5Lcreate_external(fname2, "/grp1", fid1, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/grp1/grp2", fid1, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/grp1/grp2/grp3", fid1, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; @@ -2822,225 +2676,210 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file2 */ status = H5Lcreate_external(fname1, "/grp1", fid2, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/grp1/grp2", fid2, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/grp1/grp2/grp3", fid2, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } /*------------------------------ - * external circle route test - * file1/grp11 <-> file2/grp10 via elink_grp_circle link - */ + * external circle route test + * file1/grp11 <-> file2/grp10 via elink_grp_circle link + */ /* file1 */ status = H5Lcreate_external(fname2, "/grp11", gid10_f1, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } /* file2 */ status = H5Lcreate_external(fname1, "/grp10", gid11_f2, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } - out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid1_f1) + if (gid1_f1) H5Gclose(gid1_f1); - if(gid2_f1) + if (gid2_f1) H5Gclose(gid2_f1); - if(gid3_f1) + if (gid3_f1) H5Gclose(gid3_f1); - if(gid1_f2) + if (gid1_f2) H5Gclose(gid1_f2); - if(gid2_f2) + if (gid2_f2) H5Gclose(gid2_f2); - if(gid3_f2) + if (gid3_f2) H5Gclose(gid3_f2); return status; } /*------------------------------------------------------------------------- -* -* Purpose: -* For testing comparing group member objects recursively via multiple -* linked external links -* -* Programmer: Jonathan Kim (Sep 16, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: + * For testing comparing group member objects recursively via multiple + * linked external links + * + * Programmer: Jonathan Kim (Sep 16, 2010) + * + *-------------------------------------------------------------------------*/ #define GRP_R_DSETNAME1 "dset1" #define GRP_R_DSETNAME2 "dset2" static int test_group_recurse2(void) { - hid_t fileid1 = -1; - hid_t grp1 = -1; - hid_t grp2 = -1; - hid_t grp3 = -1; - hid_t grp4 = -1; - hid_t dset1 = -1; - hid_t dset2 = -1; - hid_t datatype = -1; - hid_t dataspace = -1; - hid_t fileid2 = -1; - hid_t fileid3 = -1; - hid_t fileid4 = -1; - hsize_t dimsf[2]; /* dataset dimensions */ - herr_t status=0; - int data1[4][2] = {{0,0},{1,1},{2,2},{3,3}}; - int data2[4][2] = {{0,0},{0,1},{0,2},{3,3}}; - - /*----------------------------------------------------------------------- + hid_t fileid1 = -1; + hid_t grp1 = -1; + hid_t grp2 = -1; + hid_t grp3 = -1; + hid_t grp4 = -1; + hid_t dset1 = -1; + hid_t dset2 = -1; + hid_t datatype = -1; + hid_t dataspace = -1; + hid_t fileid2 = -1; + hid_t fileid3 = -1; + hid_t fileid4 = -1; + hsize_t dimsf[2]; /* dataset dimensions */ + herr_t status = 0; + int data1[4][2] = { { 0, 0 }, { 1, 1 }, { 2, 2 }, { 3, 3 } }; + int data2[4][2] = { { 0, 0 }, { 0, 1 }, { 0, 2 }, { 3, 3 } }; + + /*----------------------------------------------------------------------- * FILE 1 *------------------------------------------------------------------------*/ /* - * Create a new file using H5F_ACC_TRUNC access, - * default file creation properties, and default file - * access properties. - */ + * Create a new file using H5F_ACC_TRUNC access, + * default file creation properties, and default file + * access properties. + */ fileid1 = H5Fcreate(GRP_RECURSE1_EXT, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Groups *------------------------------------------------------------------------*/ grp1 = H5Gcreate2(fileid1, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp1 < 0) - { + if (grp1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp2 = H5Gcreate2(grp1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp2 < 0) - { + if (grp2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp3 < 0) - { + if (grp3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp4 = H5Gcreate2(grp3, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp4 < 0) - { + if (grp4 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Datasets *------------------------------------------------------------------------*/ /* - * Describe the size of the array and create the data space for fixed - * size dataset. - */ + * Describe the size of the array and create the data space for fixed + * size dataset. + */ dimsf[0] = 4; dimsf[1] = 2; dataspace = H5Screate_simple(2, dimsf, NULL); /* - * Define datatype for the data in the file. - * We will store little endian INT numbers. - */ + * Define datatype for the data in the file. + * We will store little endian INT numbers. + */ datatype = H5Tcopy(H5T_NATIVE_INT); status = H5Tset_order(datatype, H5T_ORDER_LE); /*--------------- - * dset1 - */ + * dset1 + */ /* - * Create a new dataset within the file using defined dataspace and - * datatype and default dataset creation properties. - */ - dset1 = H5Dcreate2(fileid1, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * Create a new dataset within the file using defined dataspace and + * datatype and default dataset creation properties. + */ + dset1 = H5Dcreate2(fileid1, GRP_R_DSETNAME1, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); H5Dclose(dset1); /*--------------- - * dset1 - */ + * dset1 + */ /* - * Create a new dataset within the file using defined dataspace and - * datatype and default dataset creation properties. - */ - dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * Create a new dataset within the file using defined dataspace and + * datatype and default dataset creation properties. + */ + dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); /*--------------- - * dset2 - */ + * dset2 + */ /* - * Create a new dataset within the fileid1 using defined dataspace and - * datatype and default dataset creation properties. - */ - dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * Create a new dataset within the fileid1 using defined dataspace and + * datatype and default dataset creation properties. + */ + dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2); - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Soft links *------------------------------------------------------------------------*/ /* - * under '/' root - */ + * under '/' root + */ /* link to dset1 */ status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; @@ -3053,90 +2892,83 @@ static int test_group_recurse2(void) H5Gclose(grp3); H5Gclose(grp4); - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * FILE 2-3 *------------------------------------------------------------------------*/ /* crate target file */ fileid4 = H5Fcreate(GRP_RECURSE2_EXT3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /*----------------------------------------------- + /*----------------------------------------------- * Groups */ grp4 = H5Gcreate2(fileid4, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp4 < 0) - { + if (grp4 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT3); status = FAIL; goto out; } /*--------------- - * dset2 - */ + * dset2 + */ /* - * Create a new dataset within the fileid1 using defined dataspace and - * datatype and default dataset creation properties. - */ - dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * Create a new dataset within the fileid1 using defined dataspace and + * datatype and default dataset creation properties. + */ + dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2); H5Gclose(grp4); H5Dclose(dset2); - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * FILE 2-2 *------------------------------------------------------------------------*/ /* crate target file */ fileid3 = H5Fcreate(GRP_RECURSE2_EXT2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /*----------------------------------------------- + /*----------------------------------------------- * Groups */ grp2 = H5Gcreate2(fileid3, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp2 < 0) - { + if (grp2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; } grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp3 < 0) - { + if (grp3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; } /*--------------- - * dset1 - */ + * dset1 + */ /* - * Create a new dataset within the fileid1 using defined dataspace and - * datatype and default dataset creation properties. - */ - dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * Create a new dataset within the fileid1 using defined dataspace and + * datatype and default dataset creation properties. + */ + dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); - /*----------------------------------------------- + /*----------------------------------------------- * extlink to $GRP_RECURSE2_EXT3/g4 */ status = H5Lcreate_external(GRP_RECURSE2_EXT3, "/g4", fileid3, "/g2/g3/g4", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; @@ -3146,56 +2978,52 @@ static int test_group_recurse2(void) H5Gclose(grp2); H5Gclose(grp3); - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * FILE 2-1 *------------------------------------------------------------------------*/ /* crate target file */ fileid2 = H5Fcreate(GRP_RECURSE2_EXT1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /*----------------------------------------------- + /*----------------------------------------------- * Groups */ grp1 = H5Gcreate2(fileid2, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp1 < 0) - { + if (grp1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } /*--------------- - * dset1 - */ - dset1 = H5Dcreate2(fileid2, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * dset1 + */ + dset1 = H5Dcreate2(fileid2, GRP_R_DSETNAME1, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Soft links *------------------------------------------------------------------------*/ /* - * under '/' root - */ + * under '/' root + */ /* link to dset1 */ status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid2, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE2_EXT1); status = FAIL; goto out; } - /*----------------------------------------------- + /*----------------------------------------------- * extlink to $GRP_RECURSE2_EXT2/g2 */ status = H5Lcreate_external(GRP_RECURSE2_EXT2, "/g2", fileid2, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT1); status = FAIL; goto out; @@ -3206,72 +3034,67 @@ static int test_group_recurse2(void) out: /* - * Close/release resources. - */ - if(dataspace > 0) + * Close/release resources. + */ + if (dataspace > 0) H5Sclose(dataspace); - if(datatype > 0) + if (datatype > 0) H5Tclose(datatype); - if(fileid1 > 0) + if (fileid1 > 0) H5Fclose(fileid1); - if(fileid2 > 0) + if (fileid2 > 0) H5Fclose(fileid2); - if(fileid3 > 0) + if (fileid3 > 0) H5Fclose(fileid3); - if(fileid4 > 0) + if (fileid4 > 0) H5Fclose(fileid4); return status; } - /*------------------------------------------------------------------------- -* -* Purpose: Create test files for excluding obj. -* Same structure, same obj names -* Test : exclude obj with different value to verify the rest are same -* -* Programmer: Jonathan Kim (July, 21, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files for excluding obj. + * Same structure, same obj names + * Test : exclude obj with different value to verify the rest are same + * + * Programmer: Jonathan Kim (July, 21, 2010) + * + *-------------------------------------------------------------------------*/ static int test_exclude_obj1(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid1=0; - hid_t gid2=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - int data2[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + int data2[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + 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; } - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + 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; } - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Group *------------------------------------------------------------------------*/ /* file1 */ gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -3280,133 +3103,119 @@ static int test_exclude_obj1(const char *fname1, const char *fname2) /* file2 */ gid2 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } - /*----------------------------------------------------------------------- * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset2",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset3",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset3", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - /* file2 */ - status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2,2,dims2,"dset2",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2,2,dims2,"dset3",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid2, 2, dims2, "dset3", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files for excluding obj. -* different structure and name -* Test : exclude different objs to verify the rest are same -* -* Programmer: Jonathan Kim (July, 21, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files for excluding obj. + * different structure and name + * Test : exclude different objs to verify the rest are same + * + * Programmer: Jonathan Kim (July, 21, 2010) + * + *-------------------------------------------------------------------------*/ static int test_exclude_obj2(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid1=0; - hid_t gid2=0; - hid_t gid3=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - int data2[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hid_t gid3 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + int data2[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + 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; } - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + 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; } - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Group *------------------------------------------------------------------------*/ /* file1 */ gid1 = H5Gcreate2(fid1, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -3414,9 +3223,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2) /* file2 */ gid2 = H5Gcreate2(fid2, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -3425,133 +3232,118 @@ static int test_exclude_obj2(const char *fname1, const char *fname2) /* subset name from group10 */ gid3 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid3 < 0) - { + if (gid3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } - /*----------------------------------------------------------------------- * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"dset10",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset10", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset2",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - /* file2 */ - status = write_dset(fid2,2,dims2,"dset10",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset10", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2,2,dims2,"dset2",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid3,2,dims2,"dset3",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid3, 2, dims2, "dset3", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); - if(gid3) + if (gid3) H5Gclose(gid3); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files for excluding obj. -* Only one file contains unique objs. Common objs are same. -* Test : exclude unique objs to verify the rest are same -* - HDFFV-7837 -* -* Programmer: Jonathan Kim (Mar, 19, 2012) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files for excluding obj. + * Only one file contains unique objs. Common objs are same. + * Test : exclude unique objs to verify the rest are same - HDFFV-7837 + * + * Programmer: Jonathan Kim (Mar, 19, 2012) + * + *-------------------------------------------------------------------------*/ static int test_exclude_obj3(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid1=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid1 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + 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; } - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + 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; } - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Group *------------------------------------------------------------------------*/ /* file1 */ gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -3561,26 +3353,23 @@ static int test_exclude_obj3(const char *fname1, const char *fname2) * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } /* file2 */ - status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; @@ -3590,25 +3379,25 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid1) + if (gid1) H5Gclose(gid1); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files for multiple variable length string/string array -* along with fixed length string/string array types in -* a compound type dataset. -* -* Programmer: Jonathan Kim (Oct, 26, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files for multiple variable length string/string array + * along with fixed length string/string array types in + * a compound type dataset. + * + * Programmer: Jonathan Kim (Oct, 26, 2010) + * + *-------------------------------------------------------------------------*/ #define STR_RANK 1 #define VLEN_STR_DIM 1 #define FIXLEN_STR_SIZE 21 @@ -3621,187 +3410,170 @@ out: static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new) { int i; - - hid_t fid1 = -1; /* file id */ - hid_t gid = -1; + hid_t fid1 = -1; /* file id */ + hid_t gid = -1; /* compound1 datatype */ - typedef struct comp1_t - { - char *str_vlen; /* vlen string */ - 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 */ - 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 */ + typedef struct comp1_t { + char *str_vlen; /* vlen string */ + 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 */ + 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; /* compound2 datatype */ - typedef struct comp2_t - { - char *str_vlen; /* vlen string */ - 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 */ - 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 */ - 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 */ + typedef struct comp2_t { + char *str_vlen; /* vlen string */ + 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 */ + 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 */ + 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; /* compound3 datatype */ - typedef struct comp3_t - { - char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_vlen; /* vlen 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_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len 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 */ + typedef struct comp3_t { + char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + char *str_vlen; /* vlen 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_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len 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 */ - typedef struct comp4_t - { - char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_vlen; /* vlen string */ - 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 */ - 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 */ - const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + typedef struct comp4_t { + char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ + char *str_vlen; /* vlen string */ + 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 */ + 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 */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ } comp4_t; /* compound5 datatype */ - typedef struct comp5_t - { - 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 */ - 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 */ + typedef struct comp5_t { + 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 */ + 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 */ } comp5_t; /* compound6 datatype */ - typedef struct comp6_t - { - 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 */ - 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 */ - char *str_vlen_repeat; /* vlen string */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + typedef struct comp6_t { + 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 */ + 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 */ + char *str_vlen_repeat; /* vlen string */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ } comp6_t; /* compound7 datatype */ - typedef struct comp7_t - { - 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 */ - 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 */ - char *str_vlen_repeat; /* vlen string */ + typedef struct comp7_t { + 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 */ + 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 */ + char *str_vlen_repeat; /* vlen string */ } comp7_t; /* compound8 datatype */ - typedef struct comp8_t - { - char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len 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 */ - 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 */ - char *str_vlen_repeat; /* vlen string */ + typedef struct comp8_t { + char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len 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 */ + 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 */ + char *str_vlen_repeat; /* vlen string */ } comp8_t; /* compound9 datatype */ - typedef struct comp9_t - { - 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 */ - 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 */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - hobj_ref_t objref2; /* reference */ - char *str_vlen; /* vlen string */ - int int_data2; - char *str_vlen_repeat; /* vlen string */ - hobj_ref_t objref3; /* reference */ - int int_data3; + typedef struct comp9_t { + 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 */ + 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 */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + hobj_ref_t objref2; /* reference */ + char *str_vlen; /* vlen string */ + int int_data2; + char *str_vlen_repeat; /* vlen string */ + hobj_ref_t objref3; /* reference */ + int int_data3; } comp9_t; /* vlen string */ - hid_t sid_vlen_str=0; /* dataspace ID */ - hid_t tid_vlen_str=0; /* datatype ID */ - char vlen_str_buf[]= { - "Variable length string" - }; - hsize_t dims_vlen_str[] = {VLEN_STR_DIM}; + hid_t sid_vlen_str = -1; /* dataspace ID */ + hid_t tid_vlen_str = -1; /* datatype ID */ + char vlen_str_buf[] = { "Variable length string" }; + hsize_t dims_vlen_str[] = { VLEN_STR_DIM }; /* fixlen string */ - hid_t sid_fixlen_str=0; /* dataspace ID */ - hid_t tid_fixlen_str=0; /* datatype ID */ - const char fixlen_str_buf[FIXLEN_STR_SIZE]= { - "Fixed length string" - }; - hsize_t dims_fixlen_str[] = {FIXLEN_STR_DIM}; + hid_t sid_fixlen_str = -1; /* dataspace ID */ + hid_t tid_fixlen_str = -1; /* datatype ID */ + const char fixlen_str_buf[FIXLEN_STR_SIZE] = { "Fixed length string" }; + hsize_t dims_fixlen_str[] = { FIXLEN_STR_DIM }; /* vlen string array */ - 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 */ - 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," - }; - hsize_t dims_vlen_str_array[] = {VLEN_STR_ARRY_DIM}; + hid_t sid_vlen_str_array = -1; /* dataspace ID */ + hid_t tid_vlen_str_array_pre = -1; /* datatype ID */ + hid_t tid_vlen_str_array = -1; /* datatype ID */ + 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," }; + hsize_t dims_vlen_str_array[] = { VLEN_STR_ARRY_DIM }; /* fixlen string array */ - hid_t sid_fixlen_str_array=0; /* dataspace ID */ - hid_t tid_fixlen_str_array_pre=0; /* datatype ID */ - hid_t tid_fixlen_str_array=0; /* datatype ID */ - const char *fixlen_str_array_buf[FIXLEN_STR_ARRY_DIM]= { - "1 - Fixed length string Array", - "2 - Fixed length string Array", - "3 - Fixed length string Array" - }; - hsize_t dims_fixlen_str_array[] = {FIXLEN_STR_ARRY_DIM}; + hid_t sid_fixlen_str_array = -1; /* dataspace ID */ + hid_t tid_fixlen_str_array_pre = -1; /* datatype ID */ + hid_t tid_fixlen_str_array = -1; /* datatype ID */ + const char *fixlen_str_array_buf[FIXLEN_STR_ARRY_DIM] = { + "1 - Fixed length string Array", "2 - Fixed length string Array", + "3 - Fixed length string Array" }; + hsize_t dims_fixlen_str_array[] = { FIXLEN_STR_ARRY_DIM }; /*------------------------------------------ - * compound dataset - *------------------------------------------*/ - hid_t sid_comp=0; /* dataspace ID */ - hid_t tid1_comp=0; /* datatype ID */ - hid_t tid2_comp=0; /* datatype ID */ - hid_t tid3_comp=0; /* datatype ID */ - hid_t tid4_comp=0; /* datatype ID */ - hid_t tid5_comp=0; /* datatype ID */ - hid_t tid6_comp=0; /* datatype ID */ - hid_t tid7_comp=0; /* datatype ID */ - hid_t tid8_comp=0; /* datatype ID */ - hid_t tid9_comp=0; /* datatype ID */ - hid_t did_comp=0; /* dataset ID */ - hsize_t dims_comp[] = {COMP_DIM}; - herr_t status = SUCCEED; + * compound dataset + *------------------------------------------*/ + hid_t sid_comp = -1; /* dataspace ID */ + hid_t tid1_comp = -1; /* datatype ID */ + hid_t tid2_comp = -1; /* datatype ID */ + hid_t tid3_comp = -1; /* datatype ID */ + hid_t tid4_comp = -1; /* datatype ID */ + hid_t tid5_comp = -1; /* datatype ID */ + hid_t tid6_comp = -1; /* datatype ID */ + hid_t tid7_comp = -1; /* datatype ID */ + hid_t tid8_comp = -1; /* datatype ID */ + hid_t tid9_comp = -1; /* datatype ID */ + hid_t did_comp = -1; /* dataset ID */ + hsize_t dims_comp[] = { COMP_DIM }; + herr_t status = SUCCEED; /* make compound strings data */ comp1_t comp1_buf; @@ -3857,23 +3629,30 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int HDstrcpy(comp9_buf.str_fixlen_repeat, fixlen_str_buf); /* copy vlen string array data to compound buffers */ - for (i=0; i < VLEN_STR_ARRY_DIM; i++) - { - comp1_buf.str_array_vlen[i] = comp1_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp2_buf.str_array_vlen[i] = comp2_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp3_buf.str_array_vlen[i] = comp3_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp4_buf.str_array_vlen[i] = comp4_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp5_buf.str_array_vlen[i] = comp5_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp6_buf.str_array_vlen[i] = comp6_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp7_buf.str_array_vlen[i] = comp7_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp8_buf.str_array_vlen[i] = comp8_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp9_buf.str_array_vlen[i] = comp9_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; + for (i = 0; i < VLEN_STR_ARRY_DIM; i++) { + comp1_buf.str_array_vlen[i] = comp1_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp2_buf.str_array_vlen[i] = comp2_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp3_buf.str_array_vlen[i] = comp3_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp4_buf.str_array_vlen[i] = comp4_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp5_buf.str_array_vlen[i] = comp5_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp6_buf.str_array_vlen[i] = comp6_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp7_buf.str_array_vlen[i] = comp7_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp8_buf.str_array_vlen[i] = comp8_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp9_buf.str_array_vlen[i] = comp9_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; } /* copy fixlen string attay data to compound buffers */ - for (i=0; i < FIXLEN_STR_ARRY_DIM; i++) - { + for (i = 0; i < FIXLEN_STR_ARRY_DIM; i++) { HDstrcpy(comp1_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); HDstrcpy(comp1_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); @@ -3907,25 +3686,20 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int comp9_buf.int_data2 = 20; comp9_buf.int_data3 = 30; - /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - if (is_file_new == 1) - { - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + if (is_file_new == 1) { + 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; } } - else - { - fid1 = H5Fopen (fname1, H5F_ACC_RDWR, H5P_DEFAULT); - if (fid1 < 0) - { + else { + fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1); status = FAIL; goto out; @@ -3936,8 +3710,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int * Create group *------------------------------------------------------------------------*/ gid = H5Gcreate2(fid1, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid < 0) - { + if (gid < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -3947,8 +3720,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int * Variable length String1 - Create space and type *------------------------------------------------------------------------*/ sid_vlen_str = H5Screate_simple(STR_RANK, dims_vlen_str, NULL); - if (sid_vlen_str < 0) - { + if (sid_vlen_str < 0) { fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; @@ -3956,8 +3728,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_vlen_str = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_vlen_str, H5T_VARIABLE); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; @@ -3967,8 +3738,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int * Fixed length String2 - Create space and type *------------------------------------------------------------------------*/ sid_fixlen_str = H5Screate_simple(STR_RANK, dims_fixlen_str, NULL); - if (sid_fixlen_str < 0) - { + if (sid_fixlen_str < 0) { fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; @@ -3976,8 +3746,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_fixlen_str = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_fixlen_str, FIXLEN_STR_SIZE); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; @@ -3987,8 +3756,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int * Fixed length String3 array - Create space and type *------------------------------------------------------------------------*/ sid_vlen_str_array = H5Screate_simple(STR_RANK, dims_vlen_str_array, NULL); - if (sid_vlen_str_array < 0) - { + if (sid_vlen_str_array < 0) { fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; @@ -3996,17 +3764,15 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_vlen_str_array_pre = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_vlen_str_array_pre, H5T_VARIABLE); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } - /* Create the array data type for the string array */ + /* Create the array data type for the string array */ tid_vlen_str_array = H5Tarray_create2(tid_vlen_str_array_pre, COMP_RANK, dims_vlen_str_array); - if (tid_vlen_str_array < 0) - { + if (tid_vlen_str_array < 0) { fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); status = FAIL; goto out; @@ -4016,8 +3782,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int * Variable length String4 array - Create space and type *------------------------------------------------------------------------*/ sid_fixlen_str_array = H5Screate_simple(STR_RANK, dims_fixlen_str_array, NULL); - if (sid_fixlen_str_array < 0) - { + if (sid_fixlen_str_array < 0) { fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; @@ -4025,126 +3790,123 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_fixlen_str_array_pre = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_fixlen_str_array_pre, FIXLEN_STR_ARRY_SIZE); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } - /* Create the array data type for the string array */ + /* Create the array data type for the string array */ tid_fixlen_str_array = H5Tarray_create2(tid_fixlen_str_array_pre, COMP_RANK, dims_fixlen_str_array); - if (tid_fixlen_str_array < 0) - { + if (tid_fixlen_str_array < 0) { fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); status = FAIL; goto out; } - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * Compound dataset *------------------------------------------------------------------------*/ sid_comp = H5Screate_simple(COMP_RANK, dims_comp, NULL); - if (sid_comp < 0) - { + if (sid_comp < 0) { fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } - tid1_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp1_t)); - tid2_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp2_t)); - tid3_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp3_t)); - tid4_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp4_t)); - tid5_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp5_t)); - tid6_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp6_t)); - tid7_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp7_t)); - tid8_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp8_t)); - tid9_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp9_t)); + tid1_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp1_t)); + tid2_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp2_t)); + tid3_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp3_t)); + tid4_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp4_t)); + tid5_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp5_t)); + tid6_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp6_t)); + tid7_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp7_t)); + tid8_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp8_t)); + tid9_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp9_t)); /* compound 1 */ - H5Tinsert(tid1_comp, "VLEN_STR1", HOFFSET(comp1_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid1_comp, "VLEN_STR2", HOFFSET(comp1_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid1_comp, "FIXLEN_STR1", HOFFSET(comp1_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid1_comp, "FIXLEN_STR2", HOFFSET(comp1_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid1_comp, "VLEN_STR1", HOFFSET(comp1_t, str_vlen), tid_vlen_str); + H5Tinsert(tid1_comp, "VLEN_STR2", HOFFSET(comp1_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid1_comp, "FIXLEN_STR1", HOFFSET(comp1_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid1_comp, "FIXLEN_STR2", HOFFSET(comp1_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid1_comp, "VLEN_STR_ARRAY1", HOFFSET(comp1_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid1_comp, "VLEN_STR_ARRAY2", HOFFSET(comp1_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid1_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp1_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid1_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp1_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 2 */ - H5Tinsert(tid2_comp, "VLEN_STR1", HOFFSET(comp2_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid2_comp, "VLEN_STR2", HOFFSET(comp2_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid2_comp, "FIXLEN_STR1", HOFFSET(comp2_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid2_comp, "FIXLEN_STR2", HOFFSET(comp2_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid2_comp, "VLEN_STR1", HOFFSET(comp2_t, str_vlen), tid_vlen_str); + H5Tinsert(tid2_comp, "VLEN_STR2", HOFFSET(comp2_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid2_comp, "FIXLEN_STR1", HOFFSET(comp2_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid2_comp, "FIXLEN_STR2", HOFFSET(comp2_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid2_comp, "VLEN_STR_ARRAY1", HOFFSET(comp2_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid2_comp, "VLEN_STR_ARRAY2", HOFFSET(comp2_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid2_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp2_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid2_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp2_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 3 */ - H5Tinsert(tid3_comp, "VLEN_STR1", HOFFSET(comp3_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid3_comp, "VLEN_STR2", HOFFSET(comp3_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid3_comp, "FIXLEN_STR1", HOFFSET(comp3_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid3_comp, "FIXLEN_STR2", HOFFSET(comp3_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid3_comp, "VLEN_STR1", HOFFSET(comp3_t, str_vlen), tid_vlen_str); + H5Tinsert(tid3_comp, "VLEN_STR2", HOFFSET(comp3_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid3_comp, "FIXLEN_STR1", HOFFSET(comp3_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid3_comp, "FIXLEN_STR2", HOFFSET(comp3_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid3_comp, "VLEN_STR_ARRAY1", HOFFSET(comp3_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid3_comp, "VLEN_STR_ARRAY2", HOFFSET(comp3_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid3_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp3_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid3_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp3_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 4 */ - H5Tinsert(tid4_comp, "VLEN_STR1", HOFFSET(comp4_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid4_comp, "VLEN_STR2", HOFFSET(comp4_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid4_comp, "FIXLEN_STR1", HOFFSET(comp4_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid4_comp, "FIXLEN_STR2", HOFFSET(comp4_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid4_comp, "VLEN_STR1", HOFFSET(comp4_t, str_vlen), tid_vlen_str); + H5Tinsert(tid4_comp, "VLEN_STR2", HOFFSET(comp4_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid4_comp, "FIXLEN_STR1", HOFFSET(comp4_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid4_comp, "FIXLEN_STR2", HOFFSET(comp4_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid4_comp, "VLEN_STR_ARRAY1", HOFFSET(comp4_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid4_comp, "VLEN_STR_ARRAY2", HOFFSET(comp4_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid4_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp4_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid4_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp4_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 5 */ - H5Tinsert(tid5_comp, "VLEN_STR1", HOFFSET(comp5_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid5_comp, "VLEN_STR2", HOFFSET(comp5_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid5_comp, "FIXLEN_STR1", HOFFSET(comp5_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid5_comp, "FIXLEN_STR2", HOFFSET(comp5_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid5_comp, "VLEN_STR1", HOFFSET(comp5_t, str_vlen), tid_vlen_str); + H5Tinsert(tid5_comp, "VLEN_STR2", HOFFSET(comp5_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid5_comp, "FIXLEN_STR1", HOFFSET(comp5_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid5_comp, "FIXLEN_STR2", HOFFSET(comp5_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid5_comp, "VLEN_STR_ARRAY1", HOFFSET(comp5_t, str_array_vlen), tid_vlen_str_array); - H5Tinsert(tid5_comp, "VLEN_STR_ARRAY2", HOFFSET(comp5_t, str_vlen_array_again), tid_vlen_str_array); + H5Tinsert(tid5_comp, "VLEN_STR_ARRAY2", HOFFSET(comp5_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid5_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp5_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid5_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp5_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 6 */ - H5Tinsert(tid6_comp, "VLEN_STR1", HOFFSET(comp6_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid6_comp, "VLEN_STR2", HOFFSET(comp6_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid6_comp, "FIXLEN_STR1", HOFFSET(comp6_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid6_comp, "FIXLEN_STR2", HOFFSET(comp6_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid6_comp, "VLEN_STR1", HOFFSET(comp6_t, str_vlen), tid_vlen_str); + H5Tinsert(tid6_comp, "VLEN_STR2", HOFFSET(comp6_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid6_comp, "FIXLEN_STR1", HOFFSET(comp6_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid6_comp, "FIXLEN_STR2", HOFFSET(comp6_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid6_comp, "VLEN_STR_ARRAY1", HOFFSET(comp6_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid6_comp, "VLEN_STR_ARRAY2", HOFFSET(comp6_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid6_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp6_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid6_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp6_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 7 */ - H5Tinsert(tid7_comp, "VLEN_STR1", HOFFSET(comp7_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid7_comp, "VLEN_STR2", HOFFSET(comp7_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid7_comp, "FIXLEN_STR1", HOFFSET(comp7_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid7_comp, "FIXLEN_STR2", HOFFSET(comp7_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid7_comp, "VLEN_STR1", HOFFSET(comp7_t, str_vlen), tid_vlen_str); + H5Tinsert(tid7_comp, "VLEN_STR2", HOFFSET(comp7_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid7_comp, "FIXLEN_STR1", HOFFSET(comp7_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid7_comp, "FIXLEN_STR2", HOFFSET(comp7_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid7_comp, "VLEN_STR_ARRAY1", HOFFSET(comp7_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid7_comp, "VLEN_STR_ARRAY2", HOFFSET(comp7_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid7_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp7_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid7_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp7_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 8 */ - H5Tinsert(tid8_comp, "VLEN_STR1", HOFFSET(comp8_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid8_comp, "VLEN_STR2", HOFFSET(comp8_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid8_comp, "FIXLEN_STR1", HOFFSET(comp8_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid8_comp, "FIXLEN_STR2", HOFFSET(comp8_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid8_comp, "VLEN_STR1", HOFFSET(comp8_t, str_vlen), tid_vlen_str); + H5Tinsert(tid8_comp, "VLEN_STR2", HOFFSET(comp8_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid8_comp, "FIXLEN_STR1", HOFFSET(comp8_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid8_comp, "FIXLEN_STR2", HOFFSET(comp8_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid8_comp, "VLEN_STR_ARRAY1", HOFFSET(comp8_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid8_comp, "VLEN_STR_ARRAY2", HOFFSET(comp8_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid8_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp8_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid8_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp8_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 9 */ - H5Tinsert(tid9_comp, "VLEN_STR1", HOFFSET(comp9_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid9_comp, "VLEN_STR2", HOFFSET(comp9_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid9_comp, "FIXLEN_STR1", HOFFSET(comp9_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid9_comp, "FIXLEN_STR2", HOFFSET(comp9_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid9_comp, "VLEN_STR1", HOFFSET(comp9_t, str_vlen), tid_vlen_str); + H5Tinsert(tid9_comp, "VLEN_STR2", HOFFSET(comp9_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid9_comp, "FIXLEN_STR1", HOFFSET(comp9_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid9_comp, "FIXLEN_STR2", HOFFSET(comp9_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid9_comp, "VLEN_STR_ARRAY1", HOFFSET(comp9_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid9_comp, "VLEN_STR_ARRAY2", HOFFSET(comp9_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid9_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp9_t, str_array_fixlen), tid_fixlen_str_array); @@ -4156,12 +3918,10 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int H5Tinsert(tid9_comp, "OBJREF2", HOFFSET(comp9_t, objref2), H5T_STD_REF_OBJ); H5Tinsert(tid9_comp, "OBJREF3", HOFFSET(comp9_t, objref3), H5T_STD_REF_OBJ); - /* Write data to compound 1 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset1", tid1_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid1_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp1_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4171,8 +3931,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 2 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset2", tid2_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid2_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp2_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4182,8 +3941,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 3 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset3", tid3_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid3_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp3_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4193,8 +3951,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 4 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset4", tid4_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid4_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp4_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4204,8 +3961,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 5 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset5", tid5_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid5_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp5_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4215,8 +3971,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 6 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset6", tid6_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid6_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp6_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4226,8 +3981,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 7 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset7", tid7_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid7_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp7_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4237,8 +3991,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 8 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset8", tid8_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid8_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp8_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4249,166 +4002,158 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int did_comp = H5Dcreate2(gid, "Compound_dset9", tid9_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* obj references */ - status=H5Rcreate(&(comp9_buf.objref1),gid,"Compound_dset2",H5R_OBJECT,(hid_t)-1); - status=H5Rcreate(&(comp9_buf.objref2),gid,"Compound_dset3",H5R_OBJECT,(hid_t)-1); - status=H5Rcreate(&(comp9_buf.objref3),gid,"Compound_dset4",H5R_OBJECT,(hid_t)-1); + status = H5Rcreate(&(comp9_buf.objref1), gid, "Compound_dset2", H5R_OBJECT, (hid_t) -1); + status = H5Rcreate(&(comp9_buf.objref2), gid, "Compound_dset3", H5R_OBJECT, (hid_t) -1); + status = H5Rcreate(&(comp9_buf.objref3), gid, "Compound_dset4", H5R_OBJECT, (hid_t) -1); status = H5Dwrite(did_comp, tid9_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp9_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } - H5Dclose(did_comp); + did_comp = -1; - did_comp=0; out: - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1 > 0) + if (fid1 > 0) H5Fclose(fid1); - if(gid > 0) + if (gid > 0) H5Gclose(gid); /* vlen string */ - if(tid_vlen_str > 0) + if (tid_vlen_str > 0) H5Tclose(tid_vlen_str); - if(sid_vlen_str > 0) + if (sid_vlen_str > 0) H5Sclose(sid_vlen_str); /* fixed len string */ - if(tid_fixlen_str > 0) + if (tid_fixlen_str > 0) H5Tclose(tid_fixlen_str); - if(sid_fixlen_str > 0) + if (sid_fixlen_str > 0) H5Sclose(sid_fixlen_str); /* vlen string array */ - if(tid_vlen_str_array_pre > 0) + if (tid_vlen_str_array_pre > 0) H5Tclose(tid_vlen_str_array_pre); - if(tid_vlen_str_array > 0) + if (tid_vlen_str_array > 0) H5Tclose(tid_vlen_str_array); - if(sid_vlen_str_array > 0) + if (sid_vlen_str_array > 0) H5Sclose(sid_vlen_str_array); /* fixed len string array */ - if(tid_fixlen_str_array_pre > 0) + if (tid_fixlen_str_array_pre > 0) H5Tclose(tid_fixlen_str_array_pre); - if(tid_fixlen_str_array > 0) + if (tid_fixlen_str_array > 0) H5Tclose(tid_fixlen_str_array); - if(sid_fixlen_str_array > 0) + if (sid_fixlen_str_array > 0) H5Sclose(sid_fixlen_str_array); /* compound */ - if(tid1_comp > 0) + if (tid1_comp > 0) H5Tclose(tid1_comp); - if(tid2_comp > 0) + if (tid2_comp > 0) H5Tclose(tid2_comp); - if(tid3_comp > 0) + if (tid3_comp > 0) H5Tclose(tid3_comp); - if(tid4_comp > 0) + if (tid4_comp > 0) H5Tclose(tid4_comp); - if(tid5_comp > 0) + if (tid5_comp > 0) H5Tclose(tid5_comp); - if(tid6_comp > 0) + if (tid6_comp > 0) H5Tclose(tid6_comp); - if(tid7_comp > 0) + if (tid7_comp > 0) H5Tclose(tid7_comp); - if(tid8_comp > 0) + if (tid8_comp > 0) H5Tclose(tid8_comp); - if(tid9_comp > 0) + if (tid9_comp > 0) H5Tclose(tid9_comp); - if(did_comp > 0) + if (did_comp > 0) H5Dclose(did_comp); - if(sid_comp > 0) + if (sid_comp > 0) H5Sclose(sid_comp); return status; } /* end test_comp_vlen_strings() */ - /*------------------------------------------------------------------------- -* -* Purpose: Test diffs of enum values which may include invalid values. -* -* Programmer: Dana Robinson -* -*-------------------------------------------------------------------------*/ - -static int -test_enums(const char *fname) + * + * Purpose: Test diffs of enum values which may include invalid values. + * + * Programmer: Dana Robinson + * + *-------------------------------------------------------------------------*/ + +static int test_enums(const char *fname) { - hid_t fid = -1; + hid_t fid = -1; - hid_t tid = -1; - int enum_val = -1; + hid_t tid = -1; + int enum_val = -1; /* The data in the two arrays cover the following cases: - * - * V = valid enum value, I = invalid enum value - * - * 0: I-I (same value) - * 1: V-I - * 2: I-V - * 3: V-V (same value) - * 4: I-I (different values) SKIPPED FOR NOW - * 5: V-V (different values) - */ + * + * V = valid enum value, I = invalid enum value + * + * 0: I-I (same value) + * 1: V-I + * 2: I-V + * 3: V-V (same value) + * 4: I-I (different values) SKIPPED FOR NOW + * 5: V-V (different values) + */ /* *** NOTE *** - * - * There is a bug in H5Dread() where invalid enum values are always - * returned as -1 so two different invalid enum values cannot be - * properly compared. Test 4 has been adjusted to pass here - * while we fix the issue. - */ - int data1[6] = {9, 0, 9, 0, 9, 0}; + * + * There is a bug in H5Dread() where invalid enum values are always + * returned as -1 so two different invalid enum values cannot be + * properly compared. Test 4 has been adjusted to pass here + * while we fix the issue. + */ + int data1[6] = { 9, 0, 9, 0, 9, 0 }; /*int data1[6] = {9, 0, 9, 0, 8, 0}; */ - int data2[6] = {9, 9, 0, 0, 9, 1}; + int data2[6] = { 9, 9, 0, 0, 9, 1 }; - hsize_t dims = 6; + hsize_t dims = 6; - herr_t status = SUCCEED; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- - * Create the file - *---------------------------------------------------------------------*/ + * Create the file + *---------------------------------------------------------------------*/ fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /*----------------------------------------------------------------------- - * Create enum types - *---------------------------------------------------------------------*/ + * Create enum types + *---------------------------------------------------------------------*/ tid = H5Tenum_create(H5T_NATIVE_INT); enum_val = 0; status = H5Tenum_insert(tid, "YIN", &enum_val); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); status = FAIL; goto out; } enum_val = 1; status = H5Tenum_insert(tid, "YANG", &enum_val); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); status = FAIL; goto out; } /*----------------------------------------------------------------------- - * Create datasets containing enum data. - *---------------------------------------------------------------------*/ + * Create datasets containing enum data. + *---------------------------------------------------------------------*/ status = write_dset(fid, 1, &dims, "dset1", tid, data1); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> write_dset failed.\n", fname); status = FAIL; goto out; } status = write_dset(fid, 1, &dims, "dset2", tid, data2); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> write_dset failed.\n", fname); status = FAIL; goto out; @@ -4416,41 +4161,41 @@ test_enums(const char *fname) out: /*----------------------------------------------------------------------- - * Close - *---------------------------------------------------------------------*/ - if(fid) + * Close + *---------------------------------------------------------------------*/ + if (fid) H5Fclose(fid); - if(tid) + if (tid) H5Tclose(tid); return status; } /*------------------------------------------------------------------------- -* -* Purpose: -* Create test files with dataset and attribute with container types -* (array, vlen) with multiple nested compound types. -* -* Function: test_comps_array() -* - type: compound->array->compound -* -* Function: test_comps_vlen() -* - type: compound->vlen->compound -* -* Function: test_comps_array_vlen() -* - type: compound->array->compound->vlen->compound -* -* Function: test_comps_vlen_arry() -* - type: compound->vlen->compound->array->compound -* -* Programmer: Jonathan Kim (Sep, 1, 2011) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: + * Create test files with dataset and attribute with container types + * (array, vlen) with multiple nested compound types. + * + * Function: test_comps_array() + * - type: compound->array->compound + * + * Function: test_comps_vlen() + * - type: compound->vlen->compound + * + * Function: test_comps_array_vlen() + * - type: compound->array->compound->vlen->compound + * + * Function: test_comps_vlen_arry() + * - type: compound->vlen->compound->array->compound + * + * Programmer: Jonathan Kim (Sep, 1, 2011) + * + *-------------------------------------------------------------------------*/ #define SDIM_DSET 2 #define SDIM_CMPD_ARRAY 2 -static void test_comps_array (const char *fname, const char *dset, const char *attr,int diff, int is_file_new) +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 { @@ -4464,42 +4209,39 @@ static void test_comps_array (const char *fname, const char *dset, const char *a cmpd2_t cmpd2[SDIM_CMPD_ARRAY]; } cmpd1_t; - cmpd1_t wdata[SDIM_DSET]; /* dataset with compound1 */ + cmpd1_t wdata[SDIM_DSET]; /* dataset with compound1 */ - hid_t fid; /* HDF5 File IDs */ - hid_t did_dset; /* Dataset ID */ - hid_t sid_dset; /* Dataset space ID */ - hid_t tid_cmpd1; /* Compound1 type ID */ - hid_t tid_arry1; /* Array type ID in compound1 */ - hid_t tid_cmpd2; /* Compound2 type ID */ - hid_t tid_attr; - hsize_t sdims_dset[] = {SDIM_DSET}; - hsize_t sdims_cmpd_arry[] = {SDIM_CMPD_ARRAY}; - int i,j; - herr_t ret; /* Generic return value */ + hid_t fid = -1; /* HDF5 File IDs */ + hid_t did_dset = -1; /* Dataset ID */ + hid_t sid_dset = -1; /* Dataset space ID */ + hid_t tid_cmpd1 = -1; /* Compound1 type ID */ + hid_t tid_arry1 = -1; /* Array type ID in compound1 */ + hid_t tid_cmpd2 = -1; /* Compound2 type ID */ + hid_t tid_attr = -1; + hsize_t sdims_dset[] = { SDIM_DSET }; + hsize_t sdims_cmpd_arry[] = { SDIM_CMPD_ARRAY }; + int i, j; + herr_t ret; /* Generic return value */ /* Initialize array data to write */ - for(i=0; i < SDIM_DSET; i++) - { + 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; + wdata[i].cmpd2[j].f2 = (float) i * 10.5F + (float) diff; } /* end for */ } - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ if (is_file_new == 1) fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); else - fid = H5Fopen (fname, H5F_ACC_RDWR, H5P_DEFAULT); - + fid = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); /* ------------------------------- - * Create a sub compound2 datatype */ + * Create a sub compound2 datatype */ tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t)); /* Insert integer field */ @@ -4511,9 +4253,9 @@ static void test_comps_array (const char *fname, const char *dset, const char *a assert(ret >= 0); /*----------------------------------- - * Create a top compound1. - */ - tid_cmpd1 = H5Tcreate (H5T_COMPOUND, sizeof(cmpd1_t)); + * Create a top compound1. + */ + tid_cmpd1 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd1_t)); ret = H5Tinsert(tid_cmpd1, "int1", HOFFSET(cmpd1_t, i1), H5T_NATIVE_INT); assert(ret >= 0); @@ -4524,10 +4266,9 @@ static void test_comps_array (const char *fname, const char *dset, const char *a ret = H5Tinsert(tid_cmpd1, "array_cmpd1", HOFFSET(cmpd1_t, cmpd2), tid_arry1); assert(ret >= 0); - /* ------------------- - * Create a dataset - */ + * Create a dataset + */ /* Create dataspace for datasets */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); @@ -4538,15 +4279,15 @@ static void test_comps_array (const char *fname, const char *dset, const char *a assert(ret >= 0); /*----------------------------------- - * Create an attribute in root group - */ + * Create an attribute in root group + */ tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); assert(ret >= 0); /* ---------------- - * Close Dataset */ + * Close Dataset */ ret = H5Aclose(tid_attr); assert(ret >= 0); ret = H5Tclose(tid_arry1); @@ -4563,9 +4304,7 @@ static void test_comps_array (const char *fname, const char *dset, const char *a assert(ret >= 0); } - - -static void test_comps_vlen (const char * fname, const char *dset, const char *attr, int diff, int is_file_new) +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 { @@ -4576,44 +4315,46 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a /* top compound 1 */ typedef struct { int i1; - hvl_t vl; /* VL information for compound2 */ + 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 */ - hid_t sid_dset; /* dataset space ID */ - hid_t tid_attr; - hid_t tid_cmpd2; /* compound2 type ID */ - hid_t tid_cmpd1; /* compound1 type ID */ - hid_t tid_cmpd1_vlen; - hsize_t sdims_dset[] = {SDIM_DSET}; + hid_t fid = -1; /* HDF5 File ID */ + hid_t did_dset = -1; /* dataset ID */ + hid_t sid_dset = -1; /* dataset space ID */ + hid_t tid_attr = -1; + hid_t tid_cmpd2 = -1; /* compound2 type ID */ + hid_t tid_cmpd1 = -1; /* compound1 type ID */ + hid_t tid_cmpd1_vlen = -1; + hsize_t sdims_dset[] = { SDIM_DSET }; - unsigned i,j; /* counting variables */ - herr_t ret; /* Generic return value */ + unsigned i, j; /* counting variables */ + herr_t ret; /* Generic return value */ /* Allocate and initialize VL data to write */ - for(i = 0; i < SDIM_DSET; i++) { - wdata[i].i1 = (int)i; + for (i = 0; i < SDIM_DSET; i++) { + wdata[i].i1 = (int) i; wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); wdata[i].vl.len = i + 1; - for(j = 0; j < (i + 1); j++) { - ((cmpd2_t *)wdata[i].vl.p)[j].i2 = (int)(i * 10 + (unsigned)diff); - ((cmpd2_t *)wdata[i].vl.p)[j].f2 = (float)i * 10.5F + (float)diff; + for (j = 0; j < (i + 1); j++) { + ((cmpd2_t *) wdata[i].vl.p)[j].i2 = + (int) (i * 10 + (unsigned) diff); + ((cmpd2_t *) wdata[i].vl.p)[j].f2 = (float) i * 10.5F + + (float) diff; } /* end for */ } /* end for */ /*----------------------------------------------------------------------- - * Create file(s) - *------------------------------------------------------------------------*/ + * Create file(s) + *------------------------------------------------------------------------*/ if (is_file_new == 1) fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); else - fid = H5Fopen (fname, H5F_ACC_RDWR, H5P_DEFAULT); + fid = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); /* ----------------------------- - * Create sub compound2 type */ + * Create sub compound2 type */ tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t)); /* Insert fields */ @@ -4623,7 +4364,7 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a assert(ret >= 0); /* --------------------------- - * Create top compound1 type */ + * Create top compound1 type */ tid_cmpd1 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd1_t)); /* Insert fields */ ret = H5Tinsert(tid_cmpd1, "int1", HOFFSET(cmpd1_t, i1), H5T_NATIVE_INT); @@ -4635,8 +4376,8 @@ 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); @@ -4648,8 +4389,8 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a assert(ret >= 0); /*----------------------------------- - * Create an attribute in root group - */ + * Create an attribute in root group + */ tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); @@ -4660,7 +4401,7 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a assert(ret >= 0); /* ---------------- - * Close IDs */ + * Close IDs */ ret = H5Aclose(tid_attr); assert(ret >= 0); ret = H5Dclose(did_dset); @@ -4677,17 +4418,16 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a assert(ret >= 0); } - -static void test_comps_array_vlen (const char * fname, const char *dset,const char *attr, int diff, int is_file_new) +static void test_comps_array_vlen(const char * fname, const char *dset, const char *attr, int diff, int is_file_new) { typedef struct { int i3; float f3; } cmpd3_t; - typedef struct { /* Typedef for compound datatype */ + typedef struct { /* Typedef for compound datatype */ int i2; - hvl_t vl; /* VL information to write */ + hvl_t vl; /* VL information to write */ } cmpd2_t; typedef struct { @@ -4695,53 +4435,53 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch cmpd2_t cmpd2[SDIM_CMPD_ARRAY]; } cmpd1_t; - cmpd1_t wdata[SDIM_DSET]; /* Information to write */ - hid_t fid; /* HDF5 File IDs */ - hid_t did_dset; /* Dataset ID */ - hid_t sid_dset; /* Dataspace ID */ - hid_t tid_attr; - hid_t tid_cmpd1; /* Compound1 Datatype ID */ - hid_t tid_arry1; /* Array Datatype ID */ - hid_t tid_cmpd2; /* Compound2 Datatype ID */ - hid_t tid_cmpd2_vlen; - hid_t tid_cmpd3; /* Compound3 Datatype ID */ - hsize_t sdims_dset[] = {SDIM_DSET}; - hsize_t sdims_arry[] = {SDIM_CMPD_ARRAY}; - unsigned i, j, k; /* counting variables */ - herr_t ret; /* Generic return value */ - - + cmpd1_t wdata[SDIM_DSET]; /* Information to write */ + hid_t fid = -1; /* HDF5 File IDs */ + hid_t did_dset = -1; /* Dataset ID */ + hid_t sid_dset = -1; /* Dataspace ID */ + hid_t tid_attr = -1; + hid_t tid_cmpd1 = -1; /* Compound1 Datatype ID */ + hid_t tid_arry1 = -1; /* Array Datatype ID */ + hid_t tid_cmpd2 = -1; /* Compound2 Datatype ID */ + hid_t tid_cmpd2_vlen = -1; + hid_t tid_cmpd3 = -1; /* Compound3 Datatype ID */ + hsize_t sdims_dset[] = { SDIM_DSET }; + hsize_t sdims_arry[] = { SDIM_CMPD_ARRAY }; + unsigned i, j, k; /* counting variables */ + herr_t ret; /* Generic return value */ /* Initialize array data to write in compound1 */ - for(i = 0; i < SDIM_DSET; i++) { - wdata[i].i1 = (int)i; + for (i = 0; i < SDIM_DSET; i++) { + wdata[i].i1 = (int) i; /* Allocate and initialize VL data to write in compound2 */ - for(j = 0; j < SDIM_CMPD_ARRAY; j++) { - wdata[i].cmpd2[j].i2 = (int)(j * 10); + for (j = 0; j < SDIM_CMPD_ARRAY; j++) { + wdata[i].cmpd2[j].i2 = (int) (j * 10); wdata[i].cmpd2[j].vl.p = HDmalloc((j + 1) * sizeof(cmpd3_t)); wdata[i].cmpd2[j].vl.len = j + 1; - for(k = 0; k < (j + 1); k++) { + for (k = 0; k < (j + 1); k++) { /* Initialize data of compound3 */ - ((cmpd3_t *)wdata[i].cmpd2[j].vl.p)[k].i3 = (int)j * 10 + diff; - ((cmpd3_t *)wdata[i].cmpd2[j].vl.p)[k].f3 = (float)j * 10.5F + (float)diff; + ((cmpd3_t *) wdata[i].cmpd2[j].vl.p)[k].i3 = (int) j * 10 + + diff; + ((cmpd3_t *) wdata[i].cmpd2[j].vl.p)[k].f3 = (float) j * 10.5F + + (float) diff; } /* end for */ } /* end for */ } /*----------------------------------------------------------------------- - * Create file(s) - *------------------------------------------------------------------------*/ + * Create file(s) + *------------------------------------------------------------------------*/ if (is_file_new == 1) fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); else - fid = H5Fopen (fname, H5F_ACC_RDWR, H5P_DEFAULT); + fid = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); /* Create dataspace for datasets */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); /*------------------------------------- - * Create a sub compound3 datatype */ + * Create a sub compound3 datatype */ tid_cmpd3 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd3_t)); /* Insert integer field */ @@ -4752,9 +4492,8 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch ret = H5Tinsert(tid_cmpd3, "float", HOFFSET(cmpd3_t, f3), H5T_NATIVE_FLOAT); assert(ret >= 0); - /*------------------------------------- - * Create a sub compound2 datatype */ + * Create a sub compound2 datatype */ tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t)); /* Insert integer field */ @@ -4765,20 +4504,18 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch ret = H5Tinsert(tid_cmpd2, "vlen", HOFFSET(cmpd2_t, vl), tid_cmpd2_vlen); assert(ret >= 0); - /*----------------------------------- - * Create a top compound1 datatype for dataset. - */ - tid_cmpd1 = H5Tcreate (H5T_COMPOUND, sizeof(cmpd1_t)); + * Create a top compound1 datatype for dataset. + */ + tid_cmpd1 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd1_t)); /* Create an array datatype */ tid_arry1 = H5Tarray_create2(tid_cmpd2, 1, sdims_arry); /* insert the array */ H5Tinsert(tid_cmpd1, "array_comp", HOFFSET(cmpd1_t, cmpd2), tid_arry1); - /* ---------------------- - * Create a dataset */ + * Create a dataset */ did_dset = H5Dcreate2(fid, dset, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ @@ -4786,8 +4523,8 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch assert(ret >= 0); /*----------------------------------- - * Create an attribute in root group - */ + * Create an attribute in root group + */ tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); @@ -4798,7 +4535,7 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch assert(ret >= 0); /*------------------- - * Close IDs */ + * Close IDs */ ret = H5Aclose(tid_attr); assert(ret >= 0); ret = H5Tclose(tid_arry1); @@ -4819,8 +4556,7 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch assert(ret >= 0); } - -static void test_comps_vlen_arry (const char * fname, const char *dset, const char *attr, int diff, int is_file_new) +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 { @@ -4837,53 +4573,53 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch /* top compound 1 */ typedef struct { int i1; - hvl_t vl; /* VL information for compound2 */ + 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 */ - hid_t sid_dset; /* dataset space ID */ - hid_t tid_attr; - hid_t tid_cmpd3; /* compound3 type ID */ - hid_t tid_cmpd2; /* compound2 type ID */ - hid_t tid_cmpd2_arry; - hid_t tid_cmpd1; /* compound1 type ID */ - hid_t tid_cmpd1_vlen; - hsize_t sdims_dset[] = {SDIM_DSET}; - hsize_t sdims_cmpd_arry[] = {SDIM_CMPD_ARRAY}; + hid_t fid = -1; /* HDF5 File ID */ + hid_t did_dset = -1; /* dataset ID */ + hid_t sid_dset = -1; /* dataset space ID */ + hid_t tid_attr = -1; + hid_t tid_cmpd3 = -1; /* compound3 type ID */ + hid_t tid_cmpd2 = -1; /* compound2 type ID */ + hid_t tid_cmpd2_arry = -1; + hid_t tid_cmpd1 = -1; /* compound1 type ID */ + hid_t tid_cmpd1_vlen = -1; + hsize_t sdims_dset[] = { SDIM_DSET }; + hsize_t sdims_cmpd_arry[] = { SDIM_CMPD_ARRAY }; - unsigned i,j,k; /* counting variables */ - herr_t ret; /* Generic return value */ + unsigned i, j, k; /* counting variables */ + herr_t ret; /* Generic return value */ /* Allocate and initialize VL data to write */ - for(i = 0; i < SDIM_DSET; i++) { + for (i = 0; i < SDIM_DSET; i++) { /* compound 1 data */ - wdata[i].i1 = (int)i; + wdata[i].i1 = (int) i; wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); wdata[i].vl.len = i + 1; - for(j = 0; j < (i + 1); j++) { + for (j = 0; j < (i + 1); j++) { /* compound2 data */ - ((cmpd2_t *)wdata[i].vl.p)[j].i2 = (int)i * 10 + diff; - for(k = 0; k < SDIM_CMPD_ARRAY; k++) { + ((cmpd2_t *) wdata[i].vl.p)[j].i2 = (int) i * 10 + diff; + for (k = 0; k < SDIM_CMPD_ARRAY; k++) { /* compound 3 data */ - ((cmpd2_t *)(wdata[i].vl.p))[j].cmpd3[k].i3 = (int)((float)k * 10.5F) + diff; - ((cmpd2_t *)(wdata[i].vl.p))[j].cmpd3[k].f3 = (float)k * 10.5F + (float)diff; + ((cmpd2_t *) (wdata[i].vl.p))[j].cmpd3[k].i3 = (int) ((float) k * 10.5F) + diff; + ((cmpd2_t *) (wdata[i].vl.p))[j].cmpd3[k].f3 = (float) k * 10.5F + (float) diff; } /* end for */ } /* end for */ } /* end for */ /*----------------------------------------------------------------------- - * Create file(s) - *------------------------------------------------------------------------*/ + * Create file(s) + *------------------------------------------------------------------------*/ if (is_file_new == 1) fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); else - fid = H5Fopen (fname, H5F_ACC_RDWR, H5P_DEFAULT); + fid = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); /* ----------------------------- - * Create sub compound3 type */ + * Create sub compound3 type */ tid_cmpd3 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd3_t)); /* Insert fields */ @@ -4893,7 +4629,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch assert(ret >= 0); /* ----------------------------- - * Create sub compound2 type */ + * Create sub compound2 type */ tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t)); ret = H5Tinsert(tid_cmpd2, "int2", HOFFSET(cmpd2_t, i2), H5T_NATIVE_INT); @@ -4904,8 +4640,8 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch assert(ret >= 0); /* --------------------------- - * Create top compound1 type - */ + * Create top compound1 type + */ /* Create a VL datatype */ tid_cmpd1 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd1_t)); /* Insert fields */ @@ -4916,21 +4652,22 @@ 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); /* Create a dataset */ - did_dset = H5Dcreate2(fid, dset, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did_dset = H5Dcreate2(fid, dset, tid_cmpd1, sid_dset, H5P_DEFAULT, + H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); assert(ret >= 0); /*----------------------------------- - * Create an attribute in root group - */ + * Create an attribute in root group + */ tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); @@ -4941,7 +4678,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch assert(ret >= 0); /* ---------------- - * Close IDs */ + * Close IDs */ ret = H5Aclose(tid_attr); assert(ret >= 0); ret = H5Dclose(did_dset); @@ -4962,99 +4699,95 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch assert(ret >= 0); } - /*------------------------------------------------------------------------- -* Function: test_data_nocomparables -* -* Purpose: -* Create test files with non-comparable dataset and attributes with -* comparable datasets and attributes. All the comparables should display -* differences. -* -*-------------------------------------------------------------------------*/ + * Function: test_data_nocomparables + * + * Purpose: + * Create test files with non-comparable dataset and attributes with + * comparable datasets and attributes. All the comparables should display + * differences. + * + *-------------------------------------------------------------------------*/ #define DIM_ARRY 3 -static void test_data_nocomparables (const char * fname, int make_diffs) +static void test_data_nocomparables(const char * fname, int make_diffs) { - hid_t fid=0; - hid_t gid1=0; - hid_t gid2=0; - hid_t did1=0; - hid_t did2=0; - hid_t sid1=0; - hid_t tid_dset1=0; - hid_t tid_attr1=0; - hsize_t dims1_1[1] = {DIM_ARRY}; - hsize_t dims1_2[1] = {DIM_ARRY+1}; - hsize_t dims2[2] = {DIM_ARRY, 1}; - int data1[DIM_ARRY] = {0,0,0}; - int data2[DIM_ARRY] = {1,1,1}; - int data3[DIM_ARRY+1] = {1,1,1,1}; - int data1_dim2[DIM_ARRY][1] = {{0},{0},{0}}; + hid_t fid = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hid_t did1 = -1; + hid_t did2 = -1; + hid_t sid1 = -1; + hid_t tid_dset1 = -1; + hid_t tid_attr1 = -1; + hsize_t dims1_1[1] = { DIM_ARRY }; + hsize_t dims1_2[1] = { DIM_ARRY + 1 }; + hsize_t dims2[2] = { DIM_ARRY, 1 }; + int data1[DIM_ARRY] = { 0, 0, 0 }; + int data2[DIM_ARRY] = { 1, 1, 1 }; + int data3[DIM_ARRY + 1] = { 1, 1, 1, 1 }; + int data1_dim2[DIM_ARRY][1] = { { 0 }, { 0 }, { 0 } }; int rank_attr; - char data1_str[DIM_ARRY][STR_SIZE]= {"ab","cd","ef"}; - herr_t status = SUCCEED; - void *dset_data_ptr1=NULL; - void *dset_data_ptr2=NULL; - void *dset_data_ptr3=NULL; - void *attr_data_ptr1=NULL; - void *attr_data_ptr2=NULL; - void *attr_data_ptr3=NULL; - void *attr_data_ptr4=NULL; - void *attr2_dim_ptr=NULL; - void *attr3_dim_ptr=NULL; + char data1_str[DIM_ARRY][STR_SIZE] = { "ab", "cd", "ef" }; + herr_t status = SUCCEED; + void *dset_data_ptr1 = NULL; + void *dset_data_ptr2 = NULL; + void *dset_data_ptr3 = NULL; + void *attr_data_ptr1 = NULL; + void *attr_data_ptr2 = NULL; + void *attr_data_ptr3 = NULL; + void *attr_data_ptr4 = NULL; + void *attr2_dim_ptr = NULL; + void *attr3_dim_ptr = NULL; /* init */ - tid_dset1=H5Tcopy(H5T_NATIVE_INT); - dset_data_ptr1=(int*)&data1; - dset_data_ptr2=(int*)&data1; - dset_data_ptr3=(int*)&data1; - tid_attr1=H5Tcopy(H5T_NATIVE_INT); - attr_data_ptr1=(int*)&data1; - attr_data_ptr3=(int*)&data1; - attr_data_ptr4=(int*)&data1; - attr2_dim_ptr=(hsize_t*)&dims1_1; - attr3_dim_ptr=(hsize_t*)&dims1_1; - rank_attr=1; - - if (make_diffs) - { + tid_dset1 = H5Tcopy(H5T_NATIVE_INT); + dset_data_ptr1 = (int*) &data1; + dset_data_ptr2 = (int*) &data1; + dset_data_ptr3 = (int*) &data1; + tid_attr1 = H5Tcopy(H5T_NATIVE_INT); + attr_data_ptr1 = (int*) &data1; + attr_data_ptr3 = (int*) &data1; + attr_data_ptr4 = (int*) &data1; + attr2_dim_ptr = (hsize_t*) &dims1_1; + attr3_dim_ptr = (hsize_t*) &dims1_1; + rank_attr = 1; + + if (make_diffs) { /* ------------ - * group1 */ - tid_dset1=H5Tcopy(H5T_C_S1); - H5Tset_size(tid_dset1, (size_t)STR_SIZE); - dset_data_ptr1=(char*)&data1_str; - dset_data_ptr2=(int*)&data2; - attr_data_ptr1=(int*)&data2; + * group1 */ + tid_dset1 = H5Tcopy(H5T_C_S1); + H5Tset_size(tid_dset1, (size_t) STR_SIZE); + dset_data_ptr1 = (char*) &data1_str; + dset_data_ptr2 = (int*) &data2; + attr_data_ptr1 = (int*) &data2; /* ----------- - * group2 - */ - dset_data_ptr3=(int*)&data2; + * group2 + */ + dset_data_ptr3 = (int*) &data2; /* dset1/attr1 */ - tid_attr1=H5Tcopy(H5T_C_S1); - H5Tset_size(tid_attr1, (size_t)STR_SIZE); - attr_data_ptr2=(char*)&data1_str; + tid_attr1 = H5Tcopy(H5T_C_S1); + H5Tset_size(tid_attr1, (size_t) STR_SIZE); + attr_data_ptr2 = (char*) &data1_str; /* dset1/attr2 */ - attr2_dim_ptr=(hsize_t*)&dims1_2; + attr2_dim_ptr = (hsize_t*) &dims1_2; /* dset1/attr3 */ - attr_data_ptr3=(int*)&data1_dim2; - attr3_dim_ptr=(hsize_t*)&dims2; - rank_attr=2; + attr_data_ptr3 = (int*) &data1_dim2; + attr3_dim_ptr = (hsize_t*) &dims2; + rank_attr = 2; /* dset1/attr4 */ - attr_data_ptr4=(int*)&data2; + attr_data_ptr4 = (int*) &data2; } - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid < 0) - { + fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname); status = FAIL; goto out; @@ -5064,16 +4797,14 @@ static void test_data_nocomparables (const char * fname, int make_diffs) * Groups *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); status = FAIL; goto out; } gid2 = H5Gcreate2(fid, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); status = FAIL; goto out; @@ -5082,29 +4813,26 @@ static void test_data_nocomparables (const char * fname, int make_diffs) /*----------------------------------------------------------------------- * Datasets in /g1 *------------------------------------------------------------------------*/ - if((sid1 = H5Screate_simple(1, dims1_1, NULL)) < 0) - goto out; + if ((sid1 = H5Screate_simple(1, dims1_1, NULL)) < 0) + goto out; /* dset1 */ - if((did1 = H5Dcreate2(gid1, "dset1", tid_dset1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - { + if ((did1 = H5Dcreate2(gid1, "dset1", tid_dset1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); status = FAIL; goto out; } - if(H5Dwrite(did1, tid_dset1, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr1) < 0) - { + if (H5Dwrite(did1, tid_dset1, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr1) < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); status = FAIL; goto out; } - write_attr(did1,1,dims1_1,"attr", H5T_NATIVE_INT, attr_data_ptr1); + write_attr(did1, 1, dims1_1, "attr", H5T_NATIVE_INT, attr_data_ptr1); /* dset2 */ - status = write_dset(gid1, 1, dims1_1,"dset2", H5T_NATIVE_INT, dset_data_ptr2); - if (status == FAIL) - { + status = write_dset(gid1, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname); goto out; } @@ -5113,108 +4841,100 @@ static void test_data_nocomparables (const char * fname, int make_diffs) * Datasets in /g2 *------------------------------------------------------------------------*/ /* --------- - * dset1 */ - if((did2 = H5Dcreate2(gid2, "dset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - { + * dset1 */ + if ((did2 = H5Dcreate2(gid2, "dset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); status = FAIL; goto out; } - if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr3) < 0) - { + if (H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr3) < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); status = FAIL; goto out; } /* attr1 - non-compatible : different type */ - write_attr(did2,1,dims1_1,"attr1", tid_attr1, attr_data_ptr2); - + write_attr(did2, 1, dims1_1, "attr1", tid_attr1, attr_data_ptr2); /* attr2 - non-compatible : same rank, different dimention */ - write_attr(did2,1,(hsize_t *)attr2_dim_ptr,"attr2", H5T_NATIVE_INT, data3); + write_attr(did2, 1, (hsize_t *) attr2_dim_ptr, "attr2", H5T_NATIVE_INT, data3); /* attr3 - non-compatible : different rank */ - write_attr(did2, rank_attr,(hsize_t *)attr3_dim_ptr,"attr3", H5T_NATIVE_INT, attr_data_ptr3); + write_attr(did2, rank_attr, (hsize_t *) attr3_dim_ptr, "attr3", H5T_NATIVE_INT, attr_data_ptr3); /* attr4 - compatible : different data values */ - write_attr(did2,1,dims1_1,"attr4", H5T_NATIVE_INT, attr_data_ptr4); + write_attr(did2, 1, dims1_1, "attr4", H5T_NATIVE_INT, attr_data_ptr4); /*---------- - * dset2 */ - status = write_dset(gid2, 1, dims1_1,"dset2", H5T_NATIVE_INT, dset_data_ptr3); - if (status == FAIL) - { + * dset2 */ + status = write_dset(gid2, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname); goto out; } - - out: /*----------------------------------------------------------------------- * Close IDs *-----------------------------------------------------------------------*/ - if(fid) + if (fid) H5Fclose(fid); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); - if(did1) + if (did1) H5Dclose(did1); - if(did2) + if (did2) H5Dclose(did2); - if(sid1) + if (sid1) H5Sclose(sid1); - if(tid_dset1) + if (tid_dset1) H5Tclose(tid_dset1); - if(tid_attr1) + if (tid_attr1) H5Tclose(tid_attr1); } /*------------------------------------------------------------------------- -* Function: test_objs_nocomparables -* -* Purpose: -* Create test files with common objects (same name) but different object -* types. -* h5diff should show non-comparable output from these common objects. -*-------------------------------------------------------------------------*/ + * Function: test_objs_nocomparables + * + * Purpose: + * Create test files with common objects (same name) but different object + * types. + * h5diff should show non-comparable output from these common objects. + *-------------------------------------------------------------------------*/ static void test_objs_nocomparables(const char *fname1, const char *fname2) { - herr_t status = SUCCEED; - hid_t fid1=0; - hid_t fid2=0; - hid_t topgid1=0; - hid_t topgid2=0; - hid_t gid1=0; - hid_t did1=0; - hid_t tid1=0; - hid_t gid2=0; - hid_t did2=0; - hid_t tid2=0; - hsize_t dims[1] = {DIM_ARRY}; - int data1[DIM_ARRY] = {1,1,1}; - int data2[DIM_ARRY] = {2,2,2}; - - /*----------------------------------------------------------------------- + herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t topgid1 = -1; + hid_t topgid2 = -1; + hid_t gid1 = -1; + hid_t did1 = -1; + hid_t tid1 = -1; + hid_t gid2 = -1; + hid_t did2 = -1; + hid_t tid2 = -1; + hsize_t dims[1] = { DIM_ARRY }; + int data1[DIM_ARRY] = { 1, 1, 1 }; + int data2[DIM_ARRY] = { 2, 2, 2 }; + + /*----------------------------------------------------------------------- * Open file(s) to add objects *------------------------------------------------------------------------*/ /* file1 */ - fid1 = H5Fopen (fname1, H5F_ACC_RDWR, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1); status = FAIL; goto out; } /* file2 */ - fid2 = H5Fopen (fname2, H5F_ACC_RDWR, H5P_DEFAULT); - if (fid2 < 0) - { + fid2 = H5Fopen(fname2, H5F_ACC_RDWR, H5P_DEFAULT); + if (fid2 < 0) { fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname2); status = FAIL; goto out; @@ -5225,25 +4945,22 @@ static void test_objs_nocomparables(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* parent group */ topgid1 = H5Gcreate2(fid1, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (topgid1 < 0) - { + if (topgid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } /* dataset */ - status = write_dset(topgid1, 1, dims,"obj1", H5T_NATIVE_INT, data1); - if (status == FAIL) - { + status = write_dset(topgid1, 1, dims, "obj1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); goto out; } /* group */ gid1 = H5Gcreate2(topgid1, "obj2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -5252,8 +4969,7 @@ static void test_objs_nocomparables(const char *fname1, const char *fname2) /* committed type */ tid1 = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(topgid1, "obj3", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1); goto out; } @@ -5263,8 +4979,7 @@ static void test_objs_nocomparables(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* parent group */ topgid2 = H5Gcreate2(fid2, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (topgid2 < 0) - { + if (topgid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -5272,8 +4987,7 @@ static void test_objs_nocomparables(const char *fname1, const char *fname2) /* group */ gid2 = H5Gcreate2(topgid2, "obj1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -5282,16 +4996,14 @@ static void test_objs_nocomparables(const char *fname1, const char *fname2) /* committed type */ tid2 = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(topgid2, "obj2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2); goto out; } /* dataset */ - status = write_dset(topgid2, 1, dims,"obj3", H5T_NATIVE_INT, data2); - if (status == FAIL) - { + status = write_dset(topgid2, 1, dims, "obj3", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); goto out; } @@ -5300,113 +5012,109 @@ out: /*----------------------------------------------------------------------- * Close IDs *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(topgid1) + if (topgid1) H5Gclose(topgid1); - if(topgid2) + if (topgid2) H5Gclose(topgid2); - if(did1) + if (did1) H5Dclose(did1); - if(did2) + if (did2) H5Dclose(did2); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); - if(tid1) + if (tid1) H5Tclose(tid1); - if(tid2) + if (tid2) H5Tclose(tid2); } -static hid_t mkstr(int size, H5T_str_t pad) { +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; + 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. -*-------------------------------------------------------------------------*/ + * 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) { - 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}; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t dataset = -1; + hid_t space = -1; + hid_t f_type = -1; + hid_t m_type = -1; + 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"}; + "s12345678901234567" }; char string4B[3][21] = { "s1234567890123456789", "s12345678901234567", - "s1234567890123456789"}; + "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); - goto out; - } - - /* file2 */ - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); - goto out; - } + * 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); + goto out; + } + + /* file2 */ + fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + goto out; + } /* string 1 : nullterm string */ space = H5Screate_simple(2, dims1, NULL); @@ -5496,88 +5204,82 @@ out: /*----------------------------------------------------------------------- * Close IDs *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); } /*------------------------------------------------------------------------- -* Function: write_attr_in -* -* Purpose: write attributes in LOC_ID (dataset, group, named datatype) -* -*------------------------------------------------------------------------- -*/ + * Function: write_attr_strings + * + * Purpose: write attributes in LOC_ID (dataset, group, named datatype) + * swap VL strings + * + *------------------------------------------------------------------------- + */ static -void write_attr_in(hid_t loc_id, - const char* dset_name, /* for saving reference to dataset*/ - hid_t fid, - int make_diffs /* flag to modify data buffers */) +void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs /* flag to modify data buffers */) { /* Compound datatype */ - typedef struct s_t - { - char a; + typedef struct s_t { + char a; double b; } s_t; - typedef enum - { - RED, - GREEN + typedef enum { + RED, GREEN } e_t; - hid_t aid; - hid_t sid; - hid_t tid; - herr_t status; - int val, i, j, k, l, n; - float f; + hid_t aid = -1; + hid_t sid = -1; + hid_t tid = -1; + herr_t status; + int val, i, j, k, l, n; + float f; /* create 1D attributes with dimension [2], 2 elements */ - hsize_t dims[1]={2}; - char buf1[2][STR_SIZE]= {"ab","de"}; /* string */ - char *buf1a[2]; /* VL string */ - char buf2[2]= {1,2}; /* bitfield, opaque */ - s_t buf3[2]= {{1,2.0F},{3,4.0F}}; /* compound */ - hobj_ref_t buf4[2]; /* reference */ - e_t buf45[2]= {RED,RED}; /* enum */ - hvl_t buf5[2]; /* vlen */ - hsize_t dimarray[1]={3}; /* array dimension */ - int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ - int buf7[2]= {1,2}; /* integer */ - float buf8[2]= {1.0F, 2.0F}; /* float */ + hsize_t dims[1] = { 2 }; + char buf1[2][STR_SIZE] = { "ab", "de" }; /* string */ + char *buf1a[2]; /* VL string */ + char buf2[2] = { 1, 2 }; /* bitfield, opaque */ + s_t buf3[2] = { { 1, 2.0F }, { 3, 4.0F } }; /* compound */ + hobj_ref_t buf4[2]; /* reference */ + e_t buf45[2] = { RED, RED }; /* enum */ + hvl_t buf5[2]; /* vlen */ + hsize_t dimarray[1] = { 3 }; /* array dimension */ + int buf6[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } }; /* array */ + int buf7[2] = { 1, 2 }; /* integer */ + float buf8[2] = { 1.0F, 2.0F }; /* float */ /* create 2D attributes with dimension [3][2], 6 elements */ - hsize_t dims2[2]={3,2}; - char buf12[3][2][STR_SIZE]= {{"ab","cd"},{"ef","gh"},{"ij","kl"}}; /* string */ - char *buf12a[3][2]; /* VL string */ - char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ - s_t buf32[6]= {{1,2.0F},{3,4.0F},{5,6.0F},{7,8.0F},{9,10.0F},{11,12.0F}}; /* compound */ - hobj_ref_t buf42[3][2]; /* reference */ - e_t buf452[3][2]; /* enum */ - hvl_t buf52[3][2]; /* vlen */ - int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ - int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ - float buf82[3][2]= {{1.0F,2.0F},{3.0F,4.0F},{5.0F,6.0F}}; /* float */ + hsize_t dims2[2] = { 3, 2 }; + char buf12[3][2][STR_SIZE] = { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }; /* string */ + char *buf12a[3][2]; /* VL string */ + char buf22[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* bitfield, opaque */ + s_t buf32[6] = { { 1, 2.0F }, { 3, 4.0F }, { 5, 6.0F }, { 7, 8.0F }, { 9, 10.0F }, { 11, 12.0F } }; /* compound */ + hobj_ref_t buf42[3][2]; /* reference */ + e_t buf452[3][2]; /* enum */ + hvl_t buf52[3][2]; /* vlen */ + int buf62[6][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, { 10, 11, 12 }, { 13, 14, 15 }, { 16, 17, 18 } }; /* array */ + int buf72[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* integer */ + float buf82[3][2] = { { 1.0F, 2.0F }, { 3.0F, 4.0F }, { 5.0F, 6.0F } }; /* float */ /* create 3D attributes with dimension [4][3][2], 24 elements */ - hsize_t dims3[3]={4,3,2}; - char buf13[4][3][2][STR_SIZE]= {{{"ab","cd"},{"ef","gh"},{"ij","kl"}}, - {{"mn","pq"},{"rs","tu"},{"vw","xz"}}, - {{"AB","CD"},{"EF","GH"},{"IJ","KL"}}, - {{"MN","PQ"},{"RS","TU"},{"VW","XZ"}}}; /* string */ - char *buf13a[4][3][2]; /* VL string */ - char buf23[4][3][2]; /* bitfield, opaque */ - s_t buf33[4][3][2]; /* compound */ - hobj_ref_t buf43[4][3][2]; /* reference */ - e_t buf453[4][3][2]; /* enum */ - hvl_t buf53[4][3][2]; /* vlen */ - int buf63[24][3]; /* array */ - int buf73[4][3][2]; /* integer */ - float buf83[4][3][2]; /* float */ - + hsize_t dims3[3] = { 4, 3, 2 }; + char buf13[4][3][2][STR_SIZE] = { { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }, + { { "mn", "pq" }, { "rs", "tu" }, { "vw", "xz" } }, + { { "AB", "CD" }, { "EF", "GH" }, { "IJ", "KL" } }, + { { "MN", "PQ" }, { "RS", "TU" }, { "VW", "XZ" } } }; /* string */ + char *buf13a[4][3][2]; /* VL string */ + char buf23[4][3][2]; /* bitfield, opaque */ + s_t buf33[4][3][2]; /* compound */ + hobj_ref_t buf43[4][3][2]; /* reference */ + e_t buf453[4][3][2]; /* enum */ + hvl_t buf53[4][3][2]; /* vlen */ + int buf63[24][3]; /* array */ + int buf73[4][3][2]; /* integer */ + float buf83[4][3][2]; /* float */ /*------------------------------------------------------------------------- * 1D attributes @@ -5590,15 +5292,10 @@ void write_attr_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - { - for (j=0; j<2; j++) - { - buf1[i][j]='z'; - } - } - } + for (i = 0; i < 2; i++) + for (j = 0; j < 2; j++) + buf1[i][j] = 'z'; + /* buf1[2][2]= {"ab","de"}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -5611,16 +5308,17 @@ void write_attr_in(hid_t loc_id, [ 1 ] d z [ 1 ] e z */ + for (i = 0; i < 2; i++) + buf1a[i] = buf1[i]; + tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, (size_t)STR_SIZE); - write_attr(loc_id,1,dims,"string",tid,buf1); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 1, dims, "string", tid, buf1a); status = H5Tclose(tid); - for (i=0; i<2; i++) - buf1a[i]=buf1[i]; tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_attr(loc_id,1,dims,"VLstring",tid,buf1a); + status = H5Tset_size(tid, (size_t)STR_SIZE); + write_attr(loc_id, 1, dims, "VLstring", tid, buf1); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5629,10 +5327,8 @@ void write_attr_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - buf2[i]=buf2[1]=0; - } + for (i = 0; i < 2; i++) + buf2[i] = buf2[1] = 0; /* buf2[2]= {1,2}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -5646,7 +5342,7 @@ void write_attr_in(hid_t loc_id, */ tid = H5Tcopy(H5T_STD_B8LE); - write_attr(loc_id,1,dims,"bitfield",tid,buf2); + write_attr(loc_id, 1, dims, "bitfield", tid, buf2); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5666,9 +5362,9 @@ void write_attr_in(hid_t loc_id, [ 1 ] 2 0 2 */ - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_attr(loc_id,1,dims,"opaque",tid,buf2); + write_attr(loc_id, 1, dims, "opaque", tid, buf2); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5677,12 +5373,10 @@ void write_attr_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - { - buf3[i].a=0; buf3[i].b=0; + for (i = 0; i < 2; i++) { + buf3[i].a = 0; + buf3[i].b = 0; } - } /* buf3[2]= {{1,2},{3,4}}; @@ -5697,10 +5391,10 @@ void write_attr_in(hid_t loc_id, [ 1 ] 4 5 1 */ - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_attr(loc_id,1,dims,"compound",tid,buf3); + write_attr(loc_id, 1, dims, "compound", tid, buf3); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5708,70 +5402,64 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1); - status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1); - write_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); + if (dset_name) { + status = H5Rcreate(&buf4[0], fid, dset_name, H5R_OBJECT, (hid_t) -1); + status = H5Rcreate(&buf4[1], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_attr(loc_id, 1, dims, "reference", H5T_STD_REF_OBJ, buf4); } /*------------------------------------------------------------------------- - * H5T_ENUM - *------------------------------------------------------------------------- - */ + * H5T_ENUM + *------------------------------------------------------------------------- + */ if (make_diffs) - { - for (i=0; i<2; i++) - { - buf45[i]=GREEN; - } - } + for (i = 0; i < 2; i++) + buf45[i] = GREEN; /* - buf45[2]= {RED,RED}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Group: and - Attribute: and - position enum of enum of difference - ------------------------------------------------------------ - [ 0 ] RED GREEN - [ 1 ] RED GREEN - */ + buf45[2]= {RED,RED}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position enum of enum of difference + ------------------------------------------------------------ + [ 0 ] RED GREEN + [ 1 ] RED GREEN + */ tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_attr(loc_id,1,dims,"enum",tid,buf45); + write_attr(loc_id, 1, dims, "enum", tid, buf45); status = H5Tclose(tid); /*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ + * H5T_VLEN + *------------------------------------------------------------------------- + */ /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc( 1 * sizeof(int)); - ((int *)buf5[0].p)[0]=1; + buf5[0].p = HDmalloc(1 * sizeof(int)); + ((int *) buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc( 2 * sizeof(int)); - ((int *)buf5[1].p)[0]=2; - ((int *)buf5[1].p)[1]=3; + buf5[1].p = HDmalloc(2 * sizeof(int)); + ((int *) buf5[1].p)[0] = 2; + ((int *) buf5[1].p)[1] = 3; - if (make_diffs) - { - ((int *)buf5[0].p)[0]=0; - ((int *)buf5[1].p)[0]=0; - ((int *)buf5[1].p)[1]=0; + if (make_diffs) { + ((int *) buf5[0].p)[0] = 0; + ((int *) buf5[1].p)[0] = 0; + ((int *) buf5[1].p)[1] = 0; } /* - $h5diff file7.h5 file6.h5 g1 g1 -v - Group: and - position vlen of vlen of difference - ------------------------------------------------------------ - [ 0 ] 1 0 1 - [ 1 ] 2 0 2 - [ 1 ] 3 0 3 - */ + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + position vlen of vlen of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + [ 1 ] 3 0 3 + */ sid = H5Screate_simple(1, dims, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); @@ -5785,31 +5473,1016 @@ void write_attr_in(hid_t loc_id, status = H5Sclose(sid); /*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ + * H5T_ARRAY + *------------------------------------------------------------------------- + */ if (make_diffs) - { - for (i=0; i<2; i++) - for (j=0; j<3; j++) - { - buf6[i][j]=0; - } - } + for (i = 0; i < 2; i++) + for (j = 0; j < 3; j++) + buf6[i][j] = 0; /* - buf6[2][3]= {{1,2,3},{4,5,6}}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Group: and - Attribute: and - position array of array of 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 + buf6[2][3]= {{1,2,3},{4,5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position array of array of 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 + */ + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 1, dims, "array", tid, buf6); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + + if (make_diffs) + for (i = 0; i < 2; i++) { + buf7[i] = 0; + buf8[i] = 0; + } + /* + buf7[2]= {1,2}; + buf8[2]= {1,2}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + position integer of integer of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + position float of float of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + */ + write_attr(loc_id, 1, dims, "integer", H5T_NATIVE_INT, buf7); + write_attr(loc_id, 1, dims, "float", H5T_NATIVE_FLOAT, buf8); + + /*------------------------------------------------------------------------- + * 2D attributes + *------------------------------------------------------------------------- + */ + + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + if (make_diffs) + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + for (k = 0; k < 2; k++) + buf12[i][j][k] = 'z'; + + /* + buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + 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 + */ + + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + buf12a[i][j] = buf12[i][j]; + + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 2, dims2, "string2D", tid, buf12a); + status = H5Tclose(tid); + + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_attr(loc_id, 2, dims2, "VLstring2D", tid, buf12); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + if (make_diffs) + memset(buf22, 0, sizeof buf22); + /* + buf22[3][2]= {{1,2},{3,4},{5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position bitfield2D of bitfield2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + + tid = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id, 2, dims2, "bitfield2D", tid, buf22); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + + /* + buf22[3][2]= {{1,2},{3,4},{5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position opaque2D of opaque2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_attr(loc_id, 2, dims2, "opaque2D", tid, buf22); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + if (make_diffs) + memset(buf32, 0, sizeof buf32); + + /* + buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position opaque2D of opaque2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id, 2, dims2, "compound2D", tid, buf32); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_REFERENCE (H5R_OBJECT object reference) + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + status = H5Rcreate(&buf42[i][j], fid, dset_name, H5R_OBJECT, + (hid_t) -1); + write_attr(loc_id, 2, dims2, "reference2D", H5T_STD_REF_OBJ, buf42); + } + + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + if (make_diffs) + buf452[i][j] = GREEN; + else + buf452[i][j] = RED; + + /* + Attribute: and + position enum2D of enum2D of difference + ------------------------------------------------------------ + [ 0 0 ] RED GREEN + [ 0 1 ] RED GREEN + [ 1 0 ] RED GREEN + [ 1 1 ] RED GREEN + [ 2 0 ] RED GREEN + [ 2 1 ] RED GREEN + */ + + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_attr(loc_id, 2, dims2, "enum2D", tid, buf452); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + n = 0; + for (i = 0; i < 3; i++) { + for (j = 0; j < 2; j++) { + buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].len = (size_t)(i + 1); + for (l = 0; l < i + 1; l++) + if (make_diffs) + ((int *) buf52[i][j].p)[l] = 0; + else + ((int *) buf52[i][j].p)[l] = n++; + } + } + + /* + position vlen2D of vlen2D of difference + ------------------------------------------------------------ + [ 0 1 ] 1 0 1 + [ 1 0 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 1 1 ] 5 0 5 + [ 2 0 ] 6 0 6 + [ 2 0 ] 7 0 7 + [ 2 0 ] 8 0 8 + [ 2 1 ] 9 0 9 + [ 2 1 ] 10 0 10 + [ 2 1 ] 11 0 11 + */ + + sid = H5Screate_simple(2, dims2, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + status = H5Awrite(aid, tid, buf52); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); + assert(status >= 0); + status = H5Aclose(aid); + status = H5Tclose(tid); + status = H5Sclose(sid); + + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + + if (make_diffs) + memset(buf62, 0, sizeof buf62); + /* + buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position array2D of array2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 0 ] 2 0 2 + [ 0 0 ] 3 0 3 + [ 0 1 ] 4 0 4 + [ 0 1 ] 5 0 5 + [ 0 1 ] 6 0 6 + [ 1 0 ] 7 0 7 + [ 1 0 ] 8 0 8 + [ 1 0 ] 9 0 9 + [ 1 1 ] 10 0 10 + [ 1 1 ] 11 0 11 + [ 1 1 ] 12 0 12 + [ 2 0 ] 13 0 13 + [ 2 0 ] 14 0 14 + [ 2 0 ] 15 0 15 + [ 2 1 ] 16 0 16 + [ 2 1 ] 17 0 17 + [ 2 1 ] 18 0 18 + */ + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 2, dims2, "array2D", tid, buf62); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + + if (make_diffs) { + memset(buf72, 0, sizeof buf72); + memset(buf82, 0, sizeof buf82); + } + /* + Attribute: and + position integer2D of integer2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + 6 differences found + Attribute: and + position float2D of float2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + + write_attr(loc_id, 2, dims2, "integer2D", H5T_NATIVE_INT, buf72); + write_attr(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); + + /*------------------------------------------------------------------------- + * 3D attributes + *------------------------------------------------------------------------- + */ + + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + + if (make_diffs) + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + for (l = 0; l < 2; l++) + buf13[i][j][k][l] = 'z'; + + /* + buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", + "rs","tu","vw","xz","AB","CD","EF","GH", + "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; + + Attribute: and + 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 + */ + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + buf13a[i][j][k] = buf13[i][j][k]; + + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 3, dims3, "string3D", tid, buf13a); + status = H5Tclose(tid); + + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_attr(loc_id, 3, dims3, "VLstring3D", tid, buf13); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + if (make_diffs) + buf23[i][j][k] = 0; + else + buf23[i][j][k] = (char) n++; + + /* + position bitfield3D of bitfield3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 1 ] 2 0 2 + [ 0 1 0 ] 3 0 3 + [ 0 1 1 ] 4 0 4 + [ 0 2 0 ] 5 0 5 + [ 0 2 1 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 1 0 ] 9 0 9 + [ 1 1 1 ] 10 0 10 + [ 1 2 0 ] 11 0 11 + [ 1 2 1 ] 12 0 12 + [ 2 0 0 ] 13 0 13 + [ 2 0 1 ] 14 0 14 + [ 2 1 0 ] 15 0 15 + [ 2 1 1 ] 16 0 16 + [ 2 2 0 ] 17 0 17 + [ 2 2 1 ] 18 0 18 + [ 3 0 0 ] 19 0 19 + [ 3 0 1 ] 20 0 20 + [ 3 1 0 ] 21 0 21 + [ 3 1 1 ] 22 0 22 + [ 3 2 0 ] 23 0 23 + [ 3 2 1 ] 24 0 24 + */ + + tid = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id, 3, dims3, "bitfield3D", tid, buf23); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_attr(loc_id, 3, dims3, "opaque3D", tid, buf23); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + if (make_diffs) { + buf33[i][j][k].a = 0; + buf33[i][j][k].b = 0.0F; + } else { + buf33[i][j][k].a = (char) n++; + buf33[i][j][k].b = n++; + } + /*position compound3D of compound3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 0 ] 2 0 2 + [ 0 0 1 ] 3 0 3 + [ 0 0 1 ] 4 0 4 + [ 0 1 0 ] 5 0 5 + [ 0 1 0 ] 6 0 6 + [ 0 1 1 ] 7 0 7 + [ 0 1 1 ] 8 0 8 + [ 0 2 0 ] 9 0 9 + [ 0 2 0 ] 10 0 10 + [ 0 2 1 ] 11 0 11 + [ 0 2 1 ] 12 0 12 + [ 1 0 0 ] 13 0 13 + [ 1 0 0 ] 14 0 14 + [ 1 0 1 ] 15 0 15 + [ 1 0 1 ] 16 0 16 + [ 1 1 0 ] 17 0 17 + [ 1 1 0 ] 18 0 18 + [ 1 1 1 ] 19 0 19 + [ 1 1 1 ] 20 0 20 + [ 1 2 0 ] 21 0 21 + [ 1 2 0 ] 22 0 22 + [ 1 2 1 ] 23 0 23 + [ 1 2 1 ] 24 0 24 + [ 2 0 0 ] 25 0 25 + [ 2 0 0 ] 26 0 26 + [ 2 0 1 ] 27 0 27 + [ 2 0 1 ] 28 0 28 + [ 2 1 0 ] 29 0 29 + [ 2 1 0 ] 30 0 30 + [ 2 1 1 ] 31 0 31 + [ 2 1 1 ] 32 0 32 + [ 2 2 0 ] 33 0 33 + [ 2 2 0 ] 34 0 34 + [ 2 2 1 ] 35 0 35 + [ 2 2 1 ] 36 0 36 + [ 3 0 0 ] 37 0 37 + [ 3 0 0 ] 38 0 38 + [ 3 0 1 ] 39 0 39 + [ 3 0 1 ] 40 0 40 + [ 3 1 0 ] 41 0 41 + [ 3 1 0 ] 42 0 42 + [ 3 1 1 ] 43 0 43 + [ 3 1 1 ] 44 0 44 + [ 3 2 0 ] 45 0 45 + [ 3 2 0 ] 46 0 46 + [ 3 2 1 ] 47 0 47 + [ 3 2 1 ] 48 0 48 + */ + + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id, 3, dims3, "compound3D", tid, buf33); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_REFERENCE (H5R_OBJECT object reference) + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + status = H5Rcreate(&buf43[i][j][k], fid, dset_name, + H5R_OBJECT, (hid_t) -1); + write_attr(loc_id, 3, dims3, "reference3D", H5T_STD_REF_OBJ, buf43); + } + + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + if (make_diffs) + buf453[i][j][k] = RED; + else + buf453[i][j][k] = GREEN; + + /* + position enum3D of enum3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] GREEN RED + [ 0 0 1 ] GREEN RED + [ 0 1 0 ] GREEN RED + [ 0 1 1 ] GREEN RED + [ 0 2 0 ] GREEN RED + [ 0 2 1 ] GREEN RED + [ 1 0 0 ] GREEN RED + [ 1 0 1 ] GREEN RED + [ 1 1 0 ] GREEN RED + [ 1 1 1 ] GREEN RED + [ 1 2 0 ] GREEN RED + [ 1 2 1 ] GREEN RED + [ 2 0 0 ] GREEN RED + [ 2 0 1 ] GREEN RED + [ 2 1 0 ] GREEN RED + [ 2 1 1 ] GREEN RED + [ 2 2 0 ] GREEN RED + [ 2 2 1 ] GREEN RED + [ 3 0 0 ] GREEN RED + [ 3 0 1 ] GREEN RED + [ 3 1 0 ] GREEN RED + [ 3 1 1 ] GREEN RED + [ 3 2 0 ] GREEN RED + [ 3 2 1 ] GREEN RED + */ + + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_attr(loc_id, 3, dims3, "enum3D", tid, buf453); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + n = 0; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) { + buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].len = (size_t)(i + 1); + for (l = 0; l < i + 1; l++) + if (make_diffs) + ((int *) buf53[i][j][k].p)[l] = 0; + else + ((int *) buf53[i][j][k].p)[l] = n++; + } + /* + position vlen3D of vlen3D of difference + ------------------------------------------------------------ + [ 0 0 1 ] 1 0 1 + [ 0 1 0 ] 2 0 2 + [ 0 1 1 ] 3 0 3 + [ 0 2 0 ] 4 0 4 + [ 0 2 1 ] 5 0 5 + [ 1 0 0 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 0 1 ] 9 0 9 + [ 1 1 0 ] 10 0 10 + etc + */ + sid = H5Screate_simple(3, dims3, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + status = H5Awrite(aid, tid, buf53); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); + assert(status >= 0); + status = H5Aclose(aid); + status = H5Tclose(tid); + status = H5Sclose(sid); + + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + n = 1; + for (i = 0; i < 24; i++) { + for (j = 0; j < (int) dimarray[0]; j++) { + if (make_diffs) + buf63[i][j] = 0; + else + buf63[i][j] = n++; + } + } + /* + position array3D of array3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 0 ] 2 0 2 + [ 0 0 0 ] 3 0 3 + [ 0 0 1 ] 4 0 4 + [ 0 0 1 ] 5 0 5 + [ 0 0 1 ] 6 0 6 + [ 0 1 0 ] 7 0 7 + etc + */ + + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 3, dims3, "array3D", tid, buf63); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + n = 1; + f = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) { + if (make_diffs) { + buf73[i][j][k] = 0; + buf83[i][j][k] = 0.0F; + } + else { + buf73[i][j][k] = n++; + buf83[i][j][k] = f++; + } + } + + /* + position integer3D of integer3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 1 ] 2 0 2 + [ 0 1 0 ] 3 0 3 + [ 0 1 1 ] 4 0 4 + [ 0 2 0 ] 5 0 5 + [ 0 2 1 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 1 0 ] 9 0 9 + [ 1 1 1 ] 10 0 10 + etc + */ + write_attr(loc_id, 3, dims3, "integer3D", H5T_NATIVE_INT, buf73); + write_attr(loc_id, 3, dims3, "float3D", H5T_NATIVE_FLOAT, buf83); +} + +/*------------------------------------------------------------------------- + * Function: write_attr_in + * + * Purpose: write attributes in LOC_ID (dataset, group, named datatype) + * + *------------------------------------------------------------------------- + */ +static +void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs /* flag to modify data buffers */) +{ + /* Compound datatype */ + typedef struct s_t { + char a; + double b; + } s_t; + + typedef enum { + RED, GREEN + } e_t; + + hid_t aid = -1; + hid_t sid = -1; + hid_t tid = -1; + herr_t status; + int val, i, j, k, l, n; + float f; + + /* create 1D attributes with dimension [2], 2 elements */ + hsize_t dims[1] = { 2 }; + char buf1[2][STR_SIZE] = { "ab", "de" }; /* string */ + char *buf1a[2]; /* VL string */ + char buf2[2] = { 1, 2 }; /* bitfield, opaque */ + s_t buf3[2] = { { 1, 2.0F }, { 3, 4.0F } }; /* compound */ + hobj_ref_t buf4[2]; /* reference */ + e_t buf45[2] = { RED, RED }; /* enum */ + hvl_t buf5[2]; /* vlen */ + hsize_t dimarray[1] = { 3 }; /* array dimension */ + int buf6[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } }; /* array */ + int buf7[2] = { 1, 2 }; /* integer */ + float buf8[2] = { 1.0F, 2.0F }; /* float */ + + /* create 2D attributes with dimension [3][2], 6 elements */ + hsize_t dims2[2] = { 3, 2 }; + char buf12[3][2][STR_SIZE] = { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }; /* string */ + char *buf12a[3][2]; /* VL string */ + char buf22[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* bitfield, opaque */ + s_t buf32[6] = { { 1, 2.0F }, { 3, 4.0F }, { 5, 6.0F }, { 7, 8.0F }, { 9, 10.0F }, { 11, 12.0F } }; /* compound */ + hobj_ref_t buf42[3][2]; /* reference */ + e_t buf452[3][2]; /* enum */ + hvl_t buf52[3][2]; /* vlen */ + int buf62[6][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, { 10, 11, 12 }, { 13, 14, 15 }, { 16, 17, 18 } }; /* array */ + int buf72[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* integer */ + float buf82[3][2] = { { 1.0F, 2.0F }, { 3.0F, 4.0F }, { 5.0F, 6.0F } }; /* float */ + + /* create 3D attributes with dimension [4][3][2], 24 elements */ + hsize_t dims3[3] = { 4, 3, 2 }; + char buf13[4][3][2][STR_SIZE] = { { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }, + { { "mn", "pq" }, { "rs", "tu" }, { "vw", "xz" } }, + { { "AB", "CD" }, { "EF", "GH" }, { "IJ", "KL" } }, + { { "MN", "PQ" }, { "RS", "TU" }, { "VW", "XZ" } } }; /* string */ + char *buf13a[4][3][2]; /* VL string */ + char buf23[4][3][2]; /* bitfield, opaque */ + s_t buf33[4][3][2]; /* compound */ + hobj_ref_t buf43[4][3][2]; /* reference */ + e_t buf453[4][3][2]; /* enum */ + hvl_t buf53[4][3][2]; /* vlen */ + int buf63[24][3]; /* array */ + int buf73[4][3][2]; /* integer */ + float buf83[4][3][2]; /* float */ + + /*------------------------------------------------------------------------- + * 1D attributes + *------------------------------------------------------------------------- + */ + + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + + if (make_diffs) + for (i = 0; i < 2; i++) + for (j = 0; j < 2; j++) + buf1[i][j] = 'z'; + /* + buf1[2][2]= {"ab","de"}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position string of string of difference + ------------------------------------------------------------ + [ 0 ] a z + [ 0 ] b z + [ 1 ] d z + [ 1 ] e z + */ + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_attr(loc_id, 1, dims, "string", tid, buf1); + status = H5Tclose(tid); + + for (i = 0; i < 2; i++) + buf1a[i] = buf1[i]; + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 1, dims, "VLstring", tid, buf1a); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + if (make_diffs) + for (i = 0; i < 2; i++) + buf2[i] = buf2[1] = 0; + /* + buf2[2]= {1,2}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position bitfield of bitfield of difference + position opaque of opaque of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + */ + + tid = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id, 1, dims, "bitfield", tid, buf2); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + + /* + buf2[2]= {1,2}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position opaque of opaque of difference + position opaque of opaque of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + */ + + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_attr(loc_id, 1, dims, "opaque", tid, buf2); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + + if (make_diffs) + for (i = 0; i < 2; i++) { + buf3[i].a = 0; + buf3[i].b = 0; + } + /* + buf3[2]= {{1,2},{3,4}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position compound of compound of difference + ------------------------------------------------------------ + [ 0 ] 1 5 4 + [ 0 ] 2 5 3 + [ 1 ] 3 5 2 + [ 1 ] 4 5 1 + */ + + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id, 1, dims, "compound", tid, buf3); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_REFERENCE (H5R_OBJECT object reference) + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) { + status = H5Rcreate(&buf4[0], fid, dset_name, H5R_OBJECT, (hid_t) -1); + status = H5Rcreate(&buf4[1], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_attr(loc_id, 1, dims, "reference", H5T_STD_REF_OBJ, buf4); + } + + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + if (make_diffs) + for (i = 0; i < 2; i++) + buf45[i] = GREEN; + /* + buf45[2]= {RED,RED}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position enum of enum of difference + ------------------------------------------------------------ + [ 0 ] RED GREEN + [ 1 ] RED GREEN + */ + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_attr(loc_id, 1, dims, "enum", tid, buf45); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + + buf5[0].len = 1; + buf5[0].p = HDmalloc(1 * sizeof(int)); + ((int *) buf5[0].p)[0] = 1; + buf5[1].len = 2; + buf5[1].p = HDmalloc(2 * sizeof(int)); + ((int *) buf5[1].p)[0] = 2; + ((int *) buf5[1].p)[1] = 3; + + if (make_diffs) { + ((int *) buf5[0].p)[0] = 0; + ((int *) buf5[1].p)[0] = 0; + ((int *) buf5[1].p)[1] = 0; + } + /* + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + position vlen of vlen of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + [ 1 ] 3 0 3 + */ + + sid = H5Screate_simple(1, dims, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + status = H5Awrite(aid, tid, buf5); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); + assert(status >= 0); + status = H5Aclose(aid); + status = H5Tclose(tid); + status = H5Sclose(sid); + + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + + if (make_diffs) { + for (i = 0; i < 2; i++) + for (j = 0; j < 3; j++) + buf6[i][j] = 0; + } + /* + buf6[2][3]= {{1,2,3},{4,5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position array of array of 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 */ tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_attr(loc_id, 1, dims, "array", tid, buf6); @@ -5820,31 +6493,28 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<2; i++) - { - buf7[i]=0; - buf8[i]=0; + if (make_diffs) { + for (i = 0; i < 2; i++) { + buf7[i] = 0; + buf8[i] = 0; } } /* - buf7[2]= {1,2}; - buf8[2]= {1,2}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Group: and - position integer of integer of difference - ------------------------------------------------------------ - [ 0 ] 1 0 1 - [ 1 ] 2 0 2 - position float of float of difference - ------------------------------------------------------------ - [ 0 ] 1 0 1 - [ 1 ] 2 0 2 - */ - write_attr(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); - write_attr(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); - + buf7[2]= {1,2}; + buf8[2]= {1,2}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + position integer of integer of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + position float of float of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + */ + write_attr(loc_id, 1, dims, "integer", H5T_NATIVE_INT, buf7); + write_attr(loc_id, 1, dims, "float", H5T_NATIVE_FLOAT, buf8); /*------------------------------------------------------------------------- * 2D attributes @@ -5855,50 +6525,45 @@ void write_attr_in(hid_t loc_id, * H5T_STRING *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<3; i++) - for (j=0; j<2; j++) - for (k=0; k<2; k++) - buf12[i][j][k]='z'; + if (make_diffs) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + for (k = 0; k < 2; k++) + buf12[i][j][k] = 'z'; } /* - buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Attribute: and - 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 + buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + 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 */ tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, (size_t)STR_SIZE); - write_attr(loc_id,2,dims2,"string2D",tid,buf12); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_attr(loc_id, 2, dims2, "string2D", tid, buf12); status = H5Tclose(tid); - for (i=0; i<3; i++) - { - for (j=0; j<2; j++) - { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + buf12a[i][j] = buf12[i][j]; - buf12a[i][j]=buf12[i][j]; - } - } tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_attr(loc_id,2,dims2,"VLstring2D",tid,buf12a); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 2, dims2, "VLstring2D", tid, buf12a); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5907,27 +6572,23 @@ void write_attr_in(hid_t loc_id, */ if (make_diffs) - { - memset(buf22,0,sizeof buf22); - } - + memset(buf22, 0, sizeof buf22); /* - buf22[3][2]= {{1,2},{3,4},{5,6}}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Attribute: and - position bitfield2D of bitfield2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 1 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 2 0 ] 5 0 5 - [ 2 1 ] 6 0 6 + buf22[3][2]= {{1,2},{3,4},{5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position bitfield2D of bitfield2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 */ - tid = H5Tcopy(H5T_STD_B8LE); - write_attr(loc_id,2,dims2,"bitfield2D",tid,buf22); + write_attr(loc_id, 2, dims2, "bitfield2D", tid, buf22); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5936,21 +6597,21 @@ void write_attr_in(hid_t loc_id, */ /* - buf22[3][2]= {{1,2},{3,4},{5,6}}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Attribute: and - position opaque2D of opaque2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 1 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 2 0 ] 5 0 5 - [ 2 1 ] 6 0 6 - */ - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + buf22[3][2]= {{1,2},{3,4},{5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position opaque2D of opaque2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_attr(loc_id,2,dims2,"opaque2D",tid,buf22); + write_attr(loc_id, 2, dims2, "opaque2D", tid, buf22); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5958,29 +6619,25 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ if (make_diffs) - { - memset(buf32,0,sizeof buf32); - } - + memset(buf32, 0, sizeof buf32); /* - buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Attribute: and - position opaque2D of opaque2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 1 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 2 0 ] 5 0 5 - [ 2 1 ] 6 0 6 - */ - - - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position opaque2D of opaque2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_attr(loc_id,2,dims2,"compound2D",tid,buf32); + write_attr(loc_id, 2, dims2, "compound2D", tid, buf32); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5988,44 +6645,41 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { - status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1); - } - } - write_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); + if (dset_name) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + status = H5Rcreate(&buf42[i][j], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_attr(loc_id, 2, dims2, "reference2D", H5T_STD_REF_OBJ, buf42); } /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- */ - for (i=0; i<3; i++) - { - for (j=0; j<2; j++) - { - if (make_diffs) buf452[i][j]=GREEN; else buf452[i][j]=RED; + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) { + if (make_diffs) + buf452[i][j] = GREEN; + else + buf452[i][j] = RED; } - } /* - Attribute: and - position enum2D of enum2D of difference - ------------------------------------------------------------ - [ 0 0 ] RED GREEN - [ 0 1 ] RED GREEN - [ 1 0 ] RED GREEN - [ 1 1 ] RED GREEN - [ 2 0 ] RED GREEN - [ 2 1 ] RED GREEN + Attribute: and + position enum2D of enum2D of difference + ------------------------------------------------------------ + [ 0 0 ] RED GREEN + [ 0 1 ] RED GREEN + [ 1 0 ] RED GREEN + [ 1 1 ] RED GREEN + [ 2 0 ] RED GREEN + [ 2 1 ] RED GREEN */ tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_attr(loc_id,2,dims2,"enum2D",tid,buf452); + write_attr(loc_id, 2, dims2, "enum2D", tid, buf452); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6034,33 +6688,33 @@ void write_attr_in(hid_t loc_id, */ /* Allocate and initialize VL dataset to write */ - n=0; - for(i = 0; i < 3; i++) { - for(j = 0; j < 2; j++) { + n = 0; + for (i = 0; i < 3; i++) { + for (j = 0; j < 2; j++) { buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); - for(l = 0; l < i + 1; l++) - if(make_diffs) - ((int *)buf52[i][j].p)[l] = 0; + for (l = 0; l < i + 1; l++) + if (make_diffs) + ((int *) buf52[i][j].p)[l] = 0; else - ((int *)buf52[i][j].p)[l] = n++; + ((int *) buf52[i][j].p)[l] = n++; } } /* - position vlen2D of vlen2D of difference - ------------------------------------------------------------ - [ 0 1 ] 1 0 1 - [ 1 0 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 1 1 ] 5 0 5 - [ 2 0 ] 6 0 6 - [ 2 0 ] 7 0 7 - [ 2 0 ] 8 0 8 - [ 2 1 ] 9 0 9 - [ 2 1 ] 10 0 10 - [ 2 1 ] 11 0 11 + position vlen2D of vlen2D of difference + ------------------------------------------------------------ + [ 0 1 ] 1 0 1 + [ 1 0 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 1 1 ] 5 0 5 + [ 2 0 ] 6 0 6 + [ 2 0 ] 7 0 7 + [ 2 0 ] 8 0 8 + [ 2 1 ] 9 0 9 + [ 2 1 ] 10 0 10 + [ 2 1 ] 11 0 11 */ sid = H5Screate_simple(2, dims2, NULL); @@ -6080,34 +6734,32 @@ void write_attr_in(hid_t loc_id, */ if (make_diffs) - { - memset(buf62,0,sizeof buf62); - } + memset(buf62, 0, sizeof buf62); /* - buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Group: and - Attribute: and - position array2D of array2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 0 ] 2 0 2 - [ 0 0 ] 3 0 3 - [ 0 1 ] 4 0 4 - [ 0 1 ] 5 0 5 - [ 0 1 ] 6 0 6 - [ 1 0 ] 7 0 7 - [ 1 0 ] 8 0 8 - [ 1 0 ] 9 0 9 - [ 1 1 ] 10 0 10 - [ 1 1 ] 11 0 11 - [ 1 1 ] 12 0 12 - [ 2 0 ] 13 0 13 - [ 2 0 ] 14 0 14 - [ 2 0 ] 15 0 15 - [ 2 1 ] 16 0 16 - [ 2 1 ] 17 0 17 - [ 2 1 ] 18 0 18 + buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position array2D of array2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 0 ] 2 0 2 + [ 0 0 ] 3 0 3 + [ 0 1 ] 4 0 4 + [ 0 1 ] 5 0 5 + [ 0 1 ] 6 0 6 + [ 1 0 ] 7 0 7 + [ 1 0 ] 8 0 8 + [ 1 0 ] 9 0 9 + [ 1 1 ] 10 0 10 + [ 1 1 ] 11 0 11 + [ 1 1 ] 12 0 12 + [ 2 0 ] 13 0 13 + [ 2 0 ] 14 0 14 + [ 2 0 ] 15 0 15 + [ 2 1 ] 16 0 16 + [ 2 1 ] 17 0 17 + [ 2 1 ] 18 0 18 */ tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_attr(loc_id, 2, dims2, "array2D", tid, buf62); @@ -6118,36 +6770,34 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - memset(buf72,0,sizeof buf72); - memset(buf82,0,sizeof buf82); + if (make_diffs) { + memset(buf72, 0, sizeof buf72); + memset(buf82, 0, sizeof buf82); } /* - Attribute: and - position integer2D of integer2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 1 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 2 0 ] 5 0 5 - [ 2 1 ] 6 0 6 - 6 differences found - Attribute: and - position float2D of float2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 1 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 2 0 ] 5 0 5 - [ 2 1 ] 6 0 6 - */ - - write_attr(loc_id,2,dims2,"integer2D",H5T_NATIVE_INT,buf72); - write_attr(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - + Attribute: and + position integer2D of integer2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + 6 differences found + Attribute: and + position float2D of float2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + + write_attr(loc_id, 2, dims2, "integer2D", H5T_NATIVE_INT, buf72); + write_attr(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); /*------------------------------------------------------------------------- * 3D attributes @@ -6159,90 +6809,83 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<4; i++) - for (j=0; j<3; j++) - for (k=0; k<2; k++) - for (l=0; l<2; l++) - buf13[i][j][k][l]='z'; + if (make_diffs) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + for (l = 0; l < 2; l++) + buf13[i][j][k][l] = 'z'; } /* - buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", - "rs","tu","vw","xz","AB","CD","EF","GH", - "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; - - Attribute: and - 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 + buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", + "rs","tu","vw","xz","AB","CD","EF","GH", + "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; + + Attribute: and + 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 */ tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, (size_t)STR_SIZE); - write_attr(loc_id,3,dims3,"string3D",tid,buf13); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_attr(loc_id, 3, dims3, "string3D", tid, buf13); status = H5Tclose(tid); - for (i=0; i<4; i++) - { - for (j=0; j<3; j++) - { - for (k=0; k<2; k++) - { - buf13a[i][j][k]=buf13[i][j][k]; - } - } - } + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + buf13a[i][j][k] = buf13[i][j][k]; tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_attr(loc_id,3,dims3,"VLstring3D",tid,buf13a); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 3, dims3, "VLstring3D", tid, buf13a); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6250,58 +6893,55 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - if(make_diffs) + if (make_diffs) buf23[i][j][k] = 0; else - buf23[i][j][k] = (char)n++; + buf23[i][j][k] = (char) n++; } - } - } - /* - position bitfield3D of bitfield3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] 1 0 1 - [ 0 0 1 ] 2 0 2 - [ 0 1 0 ] 3 0 3 - [ 0 1 1 ] 4 0 4 - [ 0 2 0 ] 5 0 5 - [ 0 2 1 ] 6 0 6 - [ 1 0 0 ] 7 0 7 - [ 1 0 1 ] 8 0 8 - [ 1 1 0 ] 9 0 9 - [ 1 1 1 ] 10 0 10 - [ 1 2 0 ] 11 0 11 - [ 1 2 1 ] 12 0 12 - [ 2 0 0 ] 13 0 13 - [ 2 0 1 ] 14 0 14 - [ 2 1 0 ] 15 0 15 - [ 2 1 1 ] 16 0 16 - [ 2 2 0 ] 17 0 17 - [ 2 2 1 ] 18 0 18 - [ 3 0 0 ] 19 0 19 - [ 3 0 1 ] 20 0 20 - [ 3 1 0 ] 21 0 21 - [ 3 1 1 ] 22 0 22 - [ 3 2 0 ] 23 0 23 - [ 3 2 1 ] 24 0 24 + position bitfield3D of bitfield3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 1 ] 2 0 2 + [ 0 1 0 ] 3 0 3 + [ 0 1 1 ] 4 0 4 + [ 0 2 0 ] 5 0 5 + [ 0 2 1 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 1 0 ] 9 0 9 + [ 1 1 1 ] 10 0 10 + [ 1 2 0 ] 11 0 11 + [ 1 2 1 ] 12 0 12 + [ 2 0 0 ] 13 0 13 + [ 2 0 1 ] 14 0 14 + [ 2 1 0 ] 15 0 15 + [ 2 1 1 ] 16 0 16 + [ 2 2 0 ] 17 0 17 + [ 2 2 1 ] 18 0 18 + [ 3 0 0 ] 19 0 19 + [ 3 0 1 ] 20 0 20 + [ 3 1 0 ] 21 0 21 + [ 3 1 1 ] 22 0 22 + [ 3 2 0 ] 23 0 23 + [ 3 2 1 ] 24 0 24 */ tid = H5Tcopy(H5T_STD_B8LE); - write_attr(loc_id,3,dims3,"bitfield3D",tid,buf23); + write_attr(loc_id, 3, dims3, "bitfield3D", tid, buf23); status = H5Tclose(tid); /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_attr(loc_id,3,dims3,"opaque3D",tid,buf23); + write_attr(loc_id, 3, dims3, "opaque3D", tid, buf23); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6309,77 +6949,75 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { if (make_diffs) { buf33[i][j][k].a = 0; buf33[i][j][k].b = 0.0F; } else { - buf33[i][j][k].a = (char)n++; + buf33[i][j][k].a = (char) n++; buf33[i][j][k].b = n++; } } - } - } /*position compound3D of compound3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] 1 0 1 - [ 0 0 0 ] 2 0 2 - [ 0 0 1 ] 3 0 3 - [ 0 0 1 ] 4 0 4 - [ 0 1 0 ] 5 0 5 - [ 0 1 0 ] 6 0 6 - [ 0 1 1 ] 7 0 7 - [ 0 1 1 ] 8 0 8 - [ 0 2 0 ] 9 0 9 - [ 0 2 0 ] 10 0 10 - [ 0 2 1 ] 11 0 11 - [ 0 2 1 ] 12 0 12 - [ 1 0 0 ] 13 0 13 - [ 1 0 0 ] 14 0 14 - [ 1 0 1 ] 15 0 15 - [ 1 0 1 ] 16 0 16 - [ 1 1 0 ] 17 0 17 - [ 1 1 0 ] 18 0 18 - [ 1 1 1 ] 19 0 19 - [ 1 1 1 ] 20 0 20 - [ 1 2 0 ] 21 0 21 - [ 1 2 0 ] 22 0 22 - [ 1 2 1 ] 23 0 23 - [ 1 2 1 ] 24 0 24 - [ 2 0 0 ] 25 0 25 - [ 2 0 0 ] 26 0 26 - [ 2 0 1 ] 27 0 27 - [ 2 0 1 ] 28 0 28 - [ 2 1 0 ] 29 0 29 - [ 2 1 0 ] 30 0 30 - [ 2 1 1 ] 31 0 31 - [ 2 1 1 ] 32 0 32 - [ 2 2 0 ] 33 0 33 - [ 2 2 0 ] 34 0 34 - [ 2 2 1 ] 35 0 35 - [ 2 2 1 ] 36 0 36 - [ 3 0 0 ] 37 0 37 - [ 3 0 0 ] 38 0 38 - [ 3 0 1 ] 39 0 39 - [ 3 0 1 ] 40 0 40 - [ 3 1 0 ] 41 0 41 - [ 3 1 0 ] 42 0 42 - [ 3 1 1 ] 43 0 43 - [ 3 1 1 ] 44 0 44 - [ 3 2 0 ] 45 0 45 - [ 3 2 0 ] 46 0 46 - [ 3 2 1 ] 47 0 47 - [ 3 2 1 ] 48 0 48 - */ - - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 0 ] 2 0 2 + [ 0 0 1 ] 3 0 3 + [ 0 0 1 ] 4 0 4 + [ 0 1 0 ] 5 0 5 + [ 0 1 0 ] 6 0 6 + [ 0 1 1 ] 7 0 7 + [ 0 1 1 ] 8 0 8 + [ 0 2 0 ] 9 0 9 + [ 0 2 0 ] 10 0 10 + [ 0 2 1 ] 11 0 11 + [ 0 2 1 ] 12 0 12 + [ 1 0 0 ] 13 0 13 + [ 1 0 0 ] 14 0 14 + [ 1 0 1 ] 15 0 15 + [ 1 0 1 ] 16 0 16 + [ 1 1 0 ] 17 0 17 + [ 1 1 0 ] 18 0 18 + [ 1 1 1 ] 19 0 19 + [ 1 1 1 ] 20 0 20 + [ 1 2 0 ] 21 0 21 + [ 1 2 0 ] 22 0 22 + [ 1 2 1 ] 23 0 23 + [ 1 2 1 ] 24 0 24 + [ 2 0 0 ] 25 0 25 + [ 2 0 0 ] 26 0 26 + [ 2 0 1 ] 27 0 27 + [ 2 0 1 ] 28 0 28 + [ 2 1 0 ] 29 0 29 + [ 2 1 0 ] 30 0 30 + [ 2 1 1 ] 31 0 31 + [ 2 1 1 ] 32 0 32 + [ 2 2 0 ] 33 0 33 + [ 2 2 0 ] 34 0 34 + [ 2 2 1 ] 35 0 35 + [ 2 2 1 ] 36 0 36 + [ 3 0 0 ] 37 0 37 + [ 3 0 0 ] 38 0 38 + [ 3 0 1 ] 39 0 39 + [ 3 0 1 ] 40 0 40 + [ 3 1 0 ] 41 0 41 + [ 3 1 0 ] 42 0 42 + [ 3 1 1 ] 43 0 43 + [ 3 1 1 ] 44 0 44 + [ 3 2 0 ] 45 0 45 + [ 3 2 0 ] 46 0 46 + [ 3 2 1 ] 47 0 47 + [ 3 2 1 ] 48 0 48 + */ + + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_attr(loc_id,3,dims3,"compound3D",tid,buf33); + write_attr(loc_id, 3, dims3, "compound3D", tid, buf33); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6387,15 +7025,13 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + if (dset_name) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) - status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1); - } - } - write_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); + status = H5Rcreate(&buf43[i][j][k], fid, dset_name, + H5R_OBJECT, (hid_t) -1); + write_attr(loc_id, 3, dims3, "reference3D", H5T_STD_REF_OBJ, buf43); } /*------------------------------------------------------------------------- @@ -6403,48 +7039,47 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - if (make_diffs) buf453[i][j][k]=RED; else buf453[i][j][k]=GREEN; + if (make_diffs) + buf453[i][j][k] = RED; + else + buf453[i][j][k] = GREEN; } - } - } - /* - position enum3D of enum3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] GREEN RED - [ 0 0 1 ] GREEN RED - [ 0 1 0 ] GREEN RED - [ 0 1 1 ] GREEN RED - [ 0 2 0 ] GREEN RED - [ 0 2 1 ] GREEN RED - [ 1 0 0 ] GREEN RED - [ 1 0 1 ] GREEN RED - [ 1 1 0 ] GREEN RED - [ 1 1 1 ] GREEN RED - [ 1 2 0 ] GREEN RED - [ 1 2 1 ] GREEN RED - [ 2 0 0 ] GREEN RED - [ 2 0 1 ] GREEN RED - [ 2 1 0 ] GREEN RED - [ 2 1 1 ] GREEN RED - [ 2 2 0 ] GREEN RED - [ 2 2 1 ] GREEN RED - [ 3 0 0 ] GREEN RED - [ 3 0 1 ] GREEN RED - [ 3 1 0 ] GREEN RED - [ 3 1 1 ] GREEN RED - [ 3 2 0 ] GREEN RED - [ 3 2 1 ] GREEN RED + position enum3D of enum3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] GREEN RED + [ 0 0 1 ] GREEN RED + [ 0 1 0 ] GREEN RED + [ 0 1 1 ] GREEN RED + [ 0 2 0 ] GREEN RED + [ 0 2 1 ] GREEN RED + [ 1 0 0 ] GREEN RED + [ 1 0 1 ] GREEN RED + [ 1 1 0 ] GREEN RED + [ 1 1 1 ] GREEN RED + [ 1 2 0 ] GREEN RED + [ 1 2 1 ] GREEN RED + [ 2 0 0 ] GREEN RED + [ 2 0 1 ] GREEN RED + [ 2 1 0 ] GREEN RED + [ 2 1 1 ] GREEN RED + [ 2 2 0 ] GREEN RED + [ 2 2 1 ] GREEN RED + [ 3 0 0 ] GREEN RED + [ 3 0 1 ] GREEN RED + [ 3 1 0 ] GREEN RED + [ 3 1 1 ] GREEN RED + [ 3 2 0 ] GREEN RED + [ 3 2 1 ] GREEN RED */ - tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_attr(loc_id,3,dims3,"enum3D",tid,buf453); + write_attr(loc_id, 3, dims3, "enum3D", tid, buf453); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6453,34 +7088,32 @@ void write_attr_in(hid_t loc_id, */ /* Allocate and initialize VL dataset to write */ - n=0; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 0; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) - if(make_diffs) - ((int *)buf53[i][j][k].p)[l] = 0; + if (make_diffs) + ((int *) buf53[i][j][k].p)[l] = 0; else - ((int *)buf53[i][j][k].p)[l] = n++; + ((int *) buf53[i][j][k].p)[l] = n++; } - } - } /* - position vlen3D of vlen3D of difference - ------------------------------------------------------------ - [ 0 0 1 ] 1 0 1 - [ 0 1 0 ] 2 0 2 - [ 0 1 1 ] 3 0 3 - [ 0 2 0 ] 4 0 4 - [ 0 2 1 ] 5 0 5 - [ 1 0 0 ] 6 0 6 - [ 1 0 0 ] 7 0 7 - [ 1 0 1 ] 8 0 8 - [ 1 0 1 ] 9 0 9 - [ 1 1 0 ] 10 0 10 - etc + position vlen3D of vlen3D of difference + ------------------------------------------------------------ + [ 0 0 1 ] 1 0 1 + [ 0 1 0 ] 2 0 2 + [ 0 1 1 ] 3 0 3 + [ 0 2 0 ] 4 0 4 + [ 0 2 1 ] 5 0 5 + [ 1 0 0 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 0 1 ] 9 0 9 + [ 1 1 0 ] 10 0 10 + etc */ sid = H5Screate_simple(3, dims3, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); @@ -6497,24 +7130,25 @@ void write_attr_in(hid_t loc_id, * H5T_ARRAY *------------------------------------------------------------------------- */ - n=1; - for (i = 0; i < 24; i++) { - for (j = 0; j < (int)dimarray[0]; j++) { - if (make_diffs) buf63[i][j]=0; - else buf63[i][j]=n++; + n = 1; + for (i = 0; i < 24; i++) + for (j = 0; j < (int) dimarray[0]; j++) { + if (make_diffs) + buf63[i][j] = 0; + else + buf63[i][j] = n++; } - } /* - position array3D of array3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] 1 0 1 - [ 0 0 0 ] 2 0 2 - [ 0 0 0 ] 3 0 3 - [ 0 0 1 ] 4 0 4 - [ 0 0 1 ] 5 0 5 - [ 0 0 1 ] 6 0 6 - [ 0 1 0 ] 7 0 7 - etc + position array3D of array3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 0 ] 2 0 2 + [ 0 0 0 ] 3 0 3 + [ 0 0 1 ] 4 0 4 + [ 0 0 1 ] 5 0 5 + [ 0 0 1 ] 6 0 6 + [ 0 1 0 ] 7 0 7 + etc */ tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); @@ -6525,132 +7159,120 @@ void write_attr_in(hid_t loc_id, * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - n=1; f=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + f = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { if (make_diffs) { - buf73[i][j][k]=0; - buf83[i][j][k]=0.0F; + buf73[i][j][k] = 0; + buf83[i][j][k] = 0.0F; } else { - buf73[i][j][k]=n++; - buf83[i][j][k]=f++; + buf73[i][j][k] = n++; + buf83[i][j][k] = f++; } } - } - } /* - position integer3D of integer3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] 1 0 1 - [ 0 0 1 ] 2 0 2 - [ 0 1 0 ] 3 0 3 - [ 0 1 1 ] 4 0 4 - [ 0 2 0 ] 5 0 5 - [ 0 2 1 ] 6 0 6 - [ 1 0 0 ] 7 0 7 - [ 1 0 1 ] 8 0 8 - [ 1 1 0 ] 9 0 9 - [ 1 1 1 ] 10 0 10 - etc - */ - write_attr(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); - write_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); + position integer3D of integer3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 1 ] 2 0 2 + [ 0 1 0 ] 3 0 3 + [ 0 1 1 ] 4 0 4 + [ 0 2 0 ] 5 0 5 + [ 0 2 1 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 1 0 ] 9 0 9 + [ 1 1 1 ] 10 0 10 + etc + */ + write_attr(loc_id, 3, dims3, "integer3D", H5T_NATIVE_INT, buf73); + write_attr(loc_id, 3, dims3, "float3D", H5T_NATIVE_FLOAT, buf83); } - - /*------------------------------------------------------------------------- -* Function: write_dset_in -* -* Purpose: write datasets in LOC_ID -* -*------------------------------------------------------------------------- -*/ + * Function: write_dset_in + * + * Purpose: write datasets in LOC_ID + * + *------------------------------------------------------------------------- + */ static -void write_dset_in(hid_t loc_id, - const char* dset_name, /* for saving reference to dataset*/ - hid_t fid, - int make_diffs /* flag to modify data buffers */) +void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs /* flag to modify data buffers */) { /* Compound datatype */ - typedef struct s_t - { - char a; + typedef struct s_t { + char a; double b; } s_t; - typedef enum - { - RED, - GREEN + typedef enum { + RED, GREEN } e_t; - hid_t did; - hid_t sid; - hid_t tid; - hid_t dcpl; - herr_t status; - int val, i, j, k, l, n; - float f; - int fillvalue=2; - int scalar_data = 2; + hid_t did = -1; + hid_t sid = -1; + hid_t tid = -1; + hid_t dcpl = -1; + herr_t status; + int val, i, j, k, l, n; + float f; + int fillvalue = 2; + int scalar_data = 2; /* create 1D attributes with dimension [2], 2 elements */ - hsize_t dims[1]={2}; - char buf1[2][STR_SIZE]= {"ab","de"}; /* string */ - char *buf1a[2]; /* VL string */ - char buf2[2]= {1,2}; /* bitfield, opaque */ - s_t buf3[2]= {{1,2.0F},{3,4.0F}}; /* compound */ - hobj_ref_t buf4[2]; /* reference */ - e_t buf45[2]= {RED,GREEN}; /* enum */ - hvl_t buf5[2]; /* vlen */ - hsize_t dimarray[1]={3}; /* array dimension */ - int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ - int buf7[2]= {1,2}; /* integer */ - float buf8[2]= {1.0F,2.0F}; /* float */ + hsize_t dims[1] = { 2 }; + char buf1[2][STR_SIZE] = { "ab", "de" }; /* string */ + char *buf1a[2]; /* VL string */ + char buf2[2] = { 1, 2 }; /* bitfield, opaque */ + s_t buf3[2] = { { 1, 2.0F }, { 3, 4.0F } }; /* compound */ + hobj_ref_t buf4[2]; /* reference */ + e_t buf45[2] = { RED, GREEN }; /* enum */ + hvl_t buf5[2]; /* vlen */ + hsize_t dimarray[1] = { 3 }; /* array dimension */ + int buf6[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } }; /* array */ + int buf7[2] = { 1, 2 }; /* integer */ + float buf8[2] = { 1.0F, 2.0F }; /* float */ /* create 2D attributes with dimension [3][2], 6 elements */ - hsize_t dims2[2]={3,2}; - char buf12[3][2][STR_SIZE]= {{"ab","cd"},{"ef","gh"},{"ij","kl"}}; /* string */ - char *buf12a[3][2]; /* VL string */ - char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ - s_t buf32[6]= {{1,2.0F},{3,4.0F},{5,6.0F},{7,8.0F},{9,10.0F},{11,12.0F}}; /* compound */ - hobj_ref_t buf42[3][2]; /* reference */ - hvl_t buf52[3][2]; /* vlen */ - int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ - int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ - float buf82[3][2]= {{1.0F,2.0F},{3.0F,4.0F},{5.0F,6.0F}}; /* float */ + hsize_t dims2[2] = { 3, 2 }; + char buf12[3][2][STR_SIZE] = { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }; /* string */ + char *buf12a[3][2]; /* VL string */ + char buf22[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* bitfield, opaque */ + s_t buf32[6] = { { 1, 2.0F }, { 3, 4.0F }, { 5, 6.0F }, { 7, 8.0F }, { 9, 10.0F }, { 11, 12.0F } }; /* compound */ + hobj_ref_t buf42[3][2]; /* reference */ + hvl_t buf52[3][2]; /* vlen */ + int buf62[6][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, { 10, 11, 12 }, { 13, 14, 15 }, { 16, 17, 18 } }; /* array */ + int buf72[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* integer */ + float buf82[3][2] = { { 1.0F, 2.0F }, { 3.0F, 4.0F }, { 5.0F, 6.0F } }; /* float */ /* create 3D attributes with dimension [4][3][2], 24 elements */ - hsize_t dims3[3]={4,3,2}; - char buf13[4][3][2][STR_SIZE]= {{{"ab","cd"},{"ef","gh"},{"ij","kl"}}, - {{"mn","pq"},{"rs","tu"},{"vw","xz"}}, - {{"AB","CD"},{"EF","GH"},{"IJ","KL"}}, - {{"MN","PQ"},{"RS","TU"},{"VW","XZ"}}}; /* string */ - char *buf13a[4][3][2]; /* VL string */ - char buf23[4][3][2]; /* bitfield, opaque */ - s_t buf33[4][3][2]; /* compound */ - hobj_ref_t buf43[4][3][2]; /* reference */ - hvl_t buf53[4][3][2]; /* vlen */ - int buf63[24][3]; /* array */ - int buf73[4][3][2]; /* integer */ - float buf83[4][3][2]; /* float */ - - if(make_diffs == 2) { + hsize_t dims3[3] = { 4, 3, 2 }; + char buf13[4][3][2][STR_SIZE] = { { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }, + { { "mn", "pq" }, { "rs", "tu" }, { "vw", "xz" } }, + { { "AB", "CD" }, { "EF", "GH" }, { "IJ", "KL" } }, + { { "MN", "PQ" }, { "RS", "TU" }, { "VW", "XZ" } } }; /* string */ + char *buf13a[4][3][2]; /* VL string */ + char buf23[4][3][2]; /* bitfield, opaque */ + s_t buf33[4][3][2]; /* compound */ + hobj_ref_t buf43[4][3][2]; /* reference */ + hvl_t buf53[4][3][2]; /* vlen */ + int buf63[24][3]; /* array */ + int buf73[4][3][2]; /* integer */ + float buf83[4][3][2]; /* float */ + + if (make_diffs == 2) dimarray[0] = 4; - } /*------------------------------------------------------------------------- * H5S_SCALAR *------------------------------------------------------------------------- */ - - - if(make_diffs) + if (make_diffs) scalar_data = 1; /* create a space */ @@ -6666,7 +7288,6 @@ void write_dset_in(hid_t loc_id, H5Dclose(did); H5Sclose(sid); - /*------------------------------------------------------------------------- * 1D *------------------------------------------------------------------------- @@ -6677,27 +7298,22 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<2; i++) - for (j=0; j<2; j++) - buf1[i][j]='z'; - } - + for (i = 0; i < 2; i++) + for (j = 0; j < 2; j++) + buf1[i][j] = 'z'; tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid,(size_t)STR_SIZE); - write_dset(loc_id,1,dims,"string",tid,buf1); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_dset(loc_id, 1, dims, "string", tid, buf1); status = H5Tclose(tid); - for (i=0; i<2; i++) - { - buf1a[i]=buf1[i]; - } + for (i = 0; i < 2; i++) + buf1a[i] = buf1[i]; + tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_dset(loc_id,1,dims,"VLstring",tid,buf1a); + status = H5Tset_size(tid, H5T_VARIABLE); + write_dset(loc_id, 1, dims, "VLstring", tid, buf1a); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6706,13 +7322,11 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - buf2[i]=buf2[1]=0; - } + for (i = 0; i < 2; i++) + buf2[i] = buf2[1] = 0; tid = H5Tcopy(H5T_STD_B8LE); - write_dset(loc_id,1,dims,"bitfield",tid,buf2); + write_dset(loc_id, 1, dims, "bitfield", tid, buf2); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6721,16 +7335,14 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - { - buf3[i].a=0; buf3[i].b=0; + for (i = 0; i < 2; i++) { + buf3[i].a = 0; + buf3[i].b = 0; } - } - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_dset(loc_id,1,dims,"opaque",tid,buf2); + write_dset(loc_id, 1, dims, "opaque", tid, buf2); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6738,19 +7350,14 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<2; i++) - { - buf45[i]=GREEN; - } - } + for (i = 0; i < 2; i++) + buf45[i] = GREEN; - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_dset(loc_id,1,dims,"compound",tid,buf3); + write_dset(loc_id, 1, dims, "compound", tid, buf3); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6758,11 +7365,10 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1); - status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1); - write_dset(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); + if (dset_name) { + status = H5Rcreate(&buf4[0], fid, dset_name, H5R_OBJECT, (hid_t) -1); + status = H5Rcreate(&buf4[1], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_dset(loc_id, 1, dims, "reference", H5T_STD_REF_OBJ, buf4); } /*------------------------------------------------------------------------- @@ -6770,16 +7376,16 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - gen_datareg(fid,make_diffs); + gen_datareg(fid, make_diffs); /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- */ tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_dset(loc_id,1,dims,"enum",tid,buf45); + write_dset(loc_id, 1, dims, "enum", tid, buf45); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6790,22 +7396,23 @@ void write_dset_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc( 1 * sizeof(int)); - ((int *)buf5[0].p)[0]=1; + buf5[0].p = HDmalloc(1 * sizeof(int)); + ((int *) buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc( 2 * sizeof(int)); - ((int *)buf5[1].p)[0]=2; - ((int *)buf5[1].p)[1]=3; + buf5[1].p = HDmalloc(2 * sizeof(int)); + ((int *) buf5[1].p)[0] = 2; + ((int *) buf5[1].p)[1] = 3; - if(make_diffs) { - ((int *)buf5[0].p)[0] = 0; - ((int *)buf5[1].p)[0] = 0; - ((int *)buf5[1].p)[1]=0; + if (make_diffs) { + ((int *) buf5[0].p)[0] = 0; + ((int *) buf5[1].p)[0] = 0; + ((int *) buf5[1].p)[1] = 0; } sid = H5Screate_simple(1, dims, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); HDassert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); @@ -6820,37 +7427,32 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - for (j=0; j<3; j++) - { - buf6[i][j]=0; - } - } + for (i = 0; i < 2; i++) + for (j = 0; j < 3; j++) + buf6[i][j] = 0; tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_dset(loc_id, 1, dims, "array", tid, buf6); status = H5Tclose(tid); { - double *dbuf; /* information to write */ - hid_t ldid; /* dataset ID */ - hid_t lsid; /* dataspace ID */ - hid_t ltid; /* datatype ID */ - size_t size; - hsize_t sdims[] = {1}; - hsize_t tdims[] = {H5TOOLS_MALLOCSIZE / sizeof(double) + 1}; - size_t jj; + double *dbuf; /* information to write */ + hid_t ldid = -1; /* dataset ID */ + hid_t lsid = -1; /* dataspace ID */ + hid_t ltid = -1; /* datatype ID */ + size_t size; + hsize_t sdims[] = { 1 }; + hsize_t tdims[] = { H5TOOLS_MALLOCSIZE / sizeof(double) + 1 }; + size_t jj; /* allocate and initialize array data to write */ - size = ( H5TOOLS_MALLOCSIZE / sizeof(double) + 1 ) * sizeof(double); - dbuf = (double *)HDmalloc(size); + size = (H5TOOLS_MALLOCSIZE / sizeof(double) + 1) * sizeof(double); + dbuf = (double *) HDmalloc(size); - for(jj = 0; jj < (H5TOOLS_MALLOCSIZE / sizeof(double) + 1); jj++) - dbuf[jj] = (double)jj; + for (jj = 0; jj < (H5TOOLS_MALLOCSIZE / sizeof(double) + 1); jj++) + dbuf[jj] = (double) jj; - if (make_diffs) - { + if (make_diffs) { dbuf[5] = 0; dbuf[6] = 0; } @@ -6877,17 +7479,13 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - { - buf7[i]=0; - buf8[i]=0; + for (i = 0; i < 2; i++) { + buf7[i] = 0; + buf8[i] = 0; } - } - - write_dset(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); - write_dset(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); + write_dset(loc_id, 1, dims, "integer", H5T_NATIVE_INT, buf7); + write_dset(loc_id, 1, dims, "float", H5T_NATIVE_FLOAT, buf8); /*------------------------------------------------------------------------- * 2D @@ -6899,30 +7497,25 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<3; i++) - for (j=0; j<2; j++) - for (k=0; k<2; k++) - buf12[i][j][k]='z'; + if (make_diffs) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + for (k = 0; k < 2; k++) + buf12[i][j][k] = 'z'; } - tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid,(size_t)STR_SIZE); - write_dset(loc_id,2,dims2,"string2D",tid,buf12); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_dset(loc_id, 2, dims2, "string2D", tid, buf12); status = H5Tclose(tid); - for (i=0; i<3; i++) - { - for (j=0; j<2; j++) - { - buf12a[i][j]=buf12[i][j]; - } - } + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + buf12a[i][j] = buf12[i][j]; + tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_dset(loc_id,2,dims2,"VLstring2D",tid,buf12a); + status = H5Tset_size(tid, H5T_VARIABLE); + write_dset(loc_id, 2, dims2, "VLstring2D", tid, buf12a); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6930,23 +7523,20 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - memset(buf22,0,sizeof buf22); - } + memset(buf22, 0, sizeof buf22); tid = H5Tcopy(H5T_STD_B8LE); - write_dset(loc_id,2,dims2,"bitfield2D",tid,buf22); + write_dset(loc_id, 2, dims2, "bitfield2D", tid, buf22); status = H5Tclose(tid); /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_dset(loc_id,2,dims2,"opaque2D",tid,buf22); + write_dset(loc_id, 2, dims2, "opaque2D", tid, buf22); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6955,14 +7545,12 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - memset(buf32,0,sizeof buf32); - } + memset(buf32, 0, sizeof buf32); - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_dset(loc_id,2,dims2,"compound2D",tid,buf32); + write_dset(loc_id, 2, dims2, "compound2D", tid, buf32); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6970,14 +7558,11 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { - status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1); - } - } - write_dset(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); + if (dset_name) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + status = H5Rcreate(&buf42[i][j], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_dset(loc_id, 2, dims2, "reference2D", H5T_STD_REF_OBJ, buf42); } /*------------------------------------------------------------------------- @@ -6986,9 +7571,9 @@ void write_dset_in(hid_t loc_id, */ tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_dset(loc_id,2,dims2,"enum2D",tid,0); + write_dset(loc_id, 2, dims2, "enum2D", tid, 0); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6998,18 +7583,17 @@ void write_dset_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ n = 0; - for(i = 0; i < 3; i++) { - for(j = 0; j < 2; j++) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) { buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); - for(l = 0; l < i + 1; l++) { - if(make_diffs) - ((int *)buf52[i][j].p)[l] = 0; + for (l = 0; l < i + 1; l++) { + if (make_diffs) + ((int *) buf52[i][j].p)[l] = 0; else - ((int *)buf52[i][j].p)[l] = n++; + ((int *) buf52[i][j].p)[l] = n++; } } - } sid = H5Screate_simple(2, dims2, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); @@ -7028,10 +7612,7 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - memset(buf62,0,sizeof buf62); - } - + memset(buf62, 0, sizeof buf62); tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_dset(loc_id, 2, dims2, "array2D", tid, buf62); @@ -7042,14 +7623,11 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - - if (make_diffs) - { + if (make_diffs) { memset(buf72, 0, sizeof buf72); memset(buf82, 0, sizeof buf82); } - dcpl = H5Pcreate(H5P_DATASET_CREATE); status = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillvalue); sid = H5Screate_simple(2, dims2, NULL); @@ -7064,8 +7642,7 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - + write_dset(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); /*------------------------------------------------------------------------- * 3D @@ -7077,33 +7654,27 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<4; i++) - for (j=0; j<3; j++) - for (k=0; k<2; k++) - for (l=0; l<2; l++) - buf13[i][j][k][l]='z'; + if (make_diffs) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + for (l = 0; l < 2; l++) + buf13[i][j][k][l] = 'z'; } tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid,(size_t)STR_SIZE); - write_dset(loc_id,3,dims3,"string3D",tid,buf13); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_dset(loc_id, 3, dims3, "string3D", tid, buf13); status = H5Tclose(tid); - for (i=0; i<4; i++) - { - for (j=0; j<3; j++) - { - for (k=0; k<2; k++) - { - buf13a[i][j][k]=buf13[i][j][k]; - } - } - } + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + buf13a[i][j][k] = buf13[i][j][k]; + tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_dset(loc_id,3,dims3,"VLstring3D",tid,buf13a); + status = H5Tset_size(tid, H5T_VARIABLE); + write_dset(loc_id, 3, dims3, "VLstring3D", tid, buf13a); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -7111,31 +7682,27 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - - n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - if(make_diffs) + if (make_diffs) buf23[i][j][k] = 0; else - buf23[i][j][k] = (char)n++; + buf23[i][j][k] = (char) n++; } - } - } - tid = H5Tcopy(H5T_STD_B8LE); - write_dset(loc_id,3,dims3,"bitfield3D",tid,buf23); + write_dset(loc_id, 3, dims3, "bitfield3D", tid, buf23); status = H5Tclose(tid); /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_dset(loc_id,3,dims3,"opaque3D",tid,buf23); + write_dset(loc_id, 3, dims3, "opaque3D", tid, buf23); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -7143,27 +7710,24 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { if (make_diffs) { buf33[i][j][k].a = 0; buf33[i][j][k].b = 0.0F; } else { - buf33[i][j][k].a = (char)n++; + buf33[i][j][k].a = (char) n++; buf33[i][j][k].b = n++; } } - } - } - - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_dset(loc_id,3,dims3,"compound3D",tid,buf33); + write_dset(loc_id, 3, dims3, "compound3D", tid, buf33); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -7171,15 +7735,12 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + if (dset_name) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) - status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1); - } - } - write_dset(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); + status = H5Rcreate(&buf43[i][j][k], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_dset(loc_id, 3, dims3, "reference3D", H5T_STD_REF_OBJ, buf43); } /*------------------------------------------------------------------------- @@ -7188,9 +7749,9 @@ void write_dset_in(hid_t loc_id, */ tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_dset(loc_id,3,dims3,"enum3D",tid,0); + write_dset(loc_id, 3, dims3, "enum3D", tid, 0); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -7199,21 +7760,19 @@ void write_dset_in(hid_t loc_id, */ /* Allocate and initialize VL dataset to write */ - n=0; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) { + n = 0; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) { buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); - for(l = 0; l < i + 1; l++) { - if(make_diffs) - ((int *)buf53[i][j][k].p)[l] = 0; + for (l = 0; l < i + 1; l++) { + if (make_diffs) + ((int *) buf53[i][j][k].p)[l] = 0; else - ((int *)buf53[i][j][k].p)[l] = n++; + ((int *) buf53[i][j][k].p)[l] = n++; } } - } - } sid = H5Screate_simple(3, dims3, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); @@ -7231,14 +7790,14 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - - n=1; - for (i = 0; i < 24; i++) { + n = 1; + for (i = 0; i < 24; i++) for (j = 0; j < 3; j++) { - if (make_diffs) buf63[i][j]=0; - else buf63[i][j]=n++; + if (make_diffs) + buf63[i][j] = 0; + else + buf63[i][j] = n++; } - } tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_dset(loc_id, 3, dims3, "array3D", tid, buf63); @@ -7248,82 +7807,86 @@ void write_dset_in(hid_t loc_id, * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - n=1; f=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + f = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { if (make_diffs) { - buf73[i][j][k]=0; - buf83[i][j][k]=0.0F; + buf73[i][j][k] = 0; + buf83[i][j][k] = 0.0F; } else { - buf73[i][j][k]=n++; - buf83[i][j][k]=f++; + buf73[i][j][k] = n++; + buf83[i][j][k] = f++; } } - } - } - write_dset(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); - write_dset(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); + + write_dset(loc_id, 3, dims3, "integer3D", H5T_NATIVE_INT, buf73); + write_dset(loc_id, 3, dims3, "float3D", H5T_NATIVE_FLOAT, buf83); } /*------------------------------------------------------------------------- -* Function: gen_datareg -* -* Purpose: generate a dataset region and its reference -* -* Date: April 19, 2006 -* -*------------------------------------------------------------------------- -*/ + * Function: gen_datareg + * + * Purpose: generate a dataset region and its reference + * + * Date: April 19, 2006 + * + *------------------------------------------------------------------------- + */ static -void gen_datareg(hid_t fid, - int make_diffs /* flag to modify data buffers */) +void gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) { /* data dataset */ - hid_t did1; /* dataset ID */ - hid_t sid1; /* dataspace ID */ - hsize_t dims1[2] = {10,10};/* dimensions */ - int *buf; /* dataset buffer */ + hid_t did1 = -1; /* dataset ID */ + hid_t sid1 = -1; /* dataspace ID */ + hsize_t dims1[2] = { 10, 10 };/* dimensions */ + int *buf; /* dataset buffer */ /* reference dataset */ - hid_t did2; /* dataset ID */ - hid_t sid2; /* dataspace ID */ - hsize_t dims2[] = {2}; /* 2 references */ - hdset_reg_ref_t *rbuf; /* buffer for write the references */ - hsize_t start[10]; /* starting location of hyperslab */ - hsize_t count[10]; /* element count of hyperslab */ - hsize_t coord[5][2]; /* coordinates for point selection */ - herr_t status; - int i; + hid_t did2 = -1; /* dataset ID */ + hid_t sid2 = -1; /* dataspace ID */ + hsize_t dims2[] = { 2 }; /* 2 references */ + hdset_reg_ref_t *rbuf; /* buffer for write the references */ + hsize_t start[10]; /* starting location of hyperslab */ + hsize_t count[10]; /* element count of hyperslab */ + hsize_t coord[5][2]; /* coordinates for point selection */ + herr_t status; + int i; /* allocate the buffer for write the references */ - rbuf = (hdset_reg_ref_t *)HDcalloc((size_t)2, sizeof(hdset_reg_ref_t)); + rbuf = (hdset_reg_ref_t *) HDcalloc((size_t )2, sizeof(hdset_reg_ref_t)); /* allocate the buffer for write the data dataset */ - buf = (int *)HDmalloc(10 * 10 * sizeof(int)); + buf = (int *) HDmalloc(10 * 10 * sizeof(int)); - for(i = 0; i < 10 * 10; i++) + for (i = 0; i < 10 * 10; i++) buf[i] = i; /* create the data dataset */ - sid1 = H5Screate_simple(2, dims1, NULL); - did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + sid1 = H5Screate_simple(2, dims1, NULL); + did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); HDassert(status >= 0); /* create the reference dataset */ - sid2 = H5Screate_simple(1, dims2, NULL); - did2 = H5Dcreate2(fid, "refreg", H5T_STD_REF_DSETREG, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + sid2 = H5Screate_simple(1, dims2, NULL); + did2 = H5Dcreate2(fid, "refreg", H5T_STD_REF_DSETREG, sid2, H5P_DEFAULT, + H5P_DEFAULT, H5P_DEFAULT); /* create the references */ /* select hyperslab for first reference */ - start[0] = 2; start[1] = 2; - count[0] = 6; count[1] = 6; - if(make_diffs) { - start[0] = 0; start[1] = 0; - count[0] = 3; count[1] = 3; + start[0] = 2; + start[1] = 2; + count[0] = 6; + count[1] = 6; + if (make_diffs) { + start[0] = 0; + start[1] = 0; + count[0] = 3; + count[1] = 3; } status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); @@ -7335,25 +7898,32 @@ void gen_datareg(hid_t fid, HDassert(status >= 0); /* select sequence of five points for second reference */ - coord[0][0]=6; coord[0][1]=9; - coord[1][0]=2; coord[1][1]=2; - coord[2][0]=8; coord[2][1]=4; - coord[3][0]=1; coord[3][1]=6; - coord[4][0]=2; coord[4][1]=8; - if (make_diffs) - { - coord[1][0]=3; coord[1][1]=3; - coord[3][0]=2; coord[3][1]=5; - coord[4][0]=1; coord[4][1]=7; - } - H5Sselect_elements(sid1,H5S_SELECT_SET,(size_t)5,(const hsize_t *)coord); + coord[0][0] = 6; + coord[0][1] = 9; + coord[1][0] = 2; + coord[1][1] = 2; + coord[2][0] = 8; + coord[2][1] = 4; + coord[3][0] = 1; + coord[3][1] = 6; + coord[4][0] = 2; + coord[4][1] = 8; + if (make_diffs) { + coord[1][0] = 3; + coord[1][1] = 3; + coord[3][0] = 2; + coord[3][1] = 5; + coord[4][0] = 1; + coord[4][1] = 7; + } + H5Sselect_elements(sid1, H5S_SELECT_SET, (size_t) 5, (const hsize_t *) coord); H5Sget_select_npoints(sid1); /* store second dataset region */ - H5Rcreate(&rbuf[1],fid,"dsetref",H5R_DATASET_REGION,sid1); + H5Rcreate(&rbuf[1], fid, "dsetref", H5R_DATASET_REGION, sid1); /* write */ - status = H5Dwrite(did2,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,rbuf); + status = H5Dwrite(did2, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf); HDassert(status >= 0); /* close, free memory buffers */ @@ -7370,60 +7940,58 @@ void gen_datareg(hid_t fid, HDfree(buf); } - /*------------------------------------------------------------------------- -* Function: test_hyperslab -* -* Purpose: test diff by hyperslabs. create a dataset with 1GB dimensions -* by iterating trough 1KB hyperslabs -* -*------------------------------------------------------------------------- -*/ + * Function: test_hyperslab + * + * Purpose: test diff by hyperslabs. create a dataset with 1GB dimensions + * by iterating trough 1KB hyperslabs + * + *------------------------------------------------------------------------- + */ static -int test_hyperslab(const char *fname, - int make_diffs /* flag to modify data buffers */) +int test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers */) { - hid_t did=-1; - hid_t fid=-1; - hid_t f_sid=-1; - hid_t m_sid=-1; - hid_t tid=-1; - hid_t dcpl=-1; - hsize_t dims[1]={GBLL}; /* dataset dimensions */ - hsize_t hs_size[1]={GBLL/(1024*1024)}; /* hyperslab dimensions */ - hsize_t chunk_dims[1]={GBLL/1024}; /* chunk dimensions */ + hid_t did = -1; + hid_t fid = -1; + hid_t f_sid = -1; + hid_t m_sid = -1; + hid_t tid = -1; + hid_t dcpl = -1; + hsize_t dims[1] = { GBLL }; /* dataset dimensions */ + hsize_t hs_size[1] = { GBLL / (1024 * 1024) }; /* hyperslab dimensions */ + hsize_t chunk_dims[1] = { GBLL / 1024 }; /* chunk dimensions */ hsize_t hs_start[1]; - size_t size; - size_t nelmts=(size_t)GBLL/(1024*1024); /* elements in each hyperslab */ - char fillvalue=-1; - char *buf=NULL; - int i, j, s; - char c; + size_t size; + size_t nelmts = (size_t)GBLL / (1024 * 1024); /* elements in each hyperslab */ + char fillvalue = -1; + char *buf = NULL; + int i, j, s; + char c; /* create */ fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto out; - if(H5Pset_fill_value(dcpl, H5T_NATIVE_CHAR, &fillvalue) < 0) + if (H5Pset_fill_value(dcpl, H5T_NATIVE_CHAR, &fillvalue) < 0) goto out; - if(H5Pset_chunk(dcpl, 1, chunk_dims) < 0) + if (H5Pset_chunk(dcpl, 1, chunk_dims) < 0) goto out; - if((f_sid = H5Screate_simple(1, dims, NULL)) < 0) + if ((f_sid = H5Screate_simple(1, dims, NULL)) < 0) goto out; - if((did = H5Dcreate2(fid, "big", H5T_NATIVE_CHAR, f_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if ((did = H5Dcreate2(fid, "big", H5T_NATIVE_CHAR, f_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto out; - if((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) + if ((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) goto out; - if((tid = H5Dget_type(did)) < 0) + if ((tid = H5Dget_type(did)) < 0) goto out; - if((size = H5Tget_size(tid)) <= 0) + if ((size = H5Tget_size(tid)) <= 0) goto out; /* create a evenly divided buffer from 0 to 127 */ - buf = (char *)HDmalloc((size_t)(nelmts * size)); + buf = (char *) HDmalloc((size_t)(nelmts * size)); s = 1024 * 1024 / 127; - for(i = 0, j = 0, c = 0; i < 1024 * 1024; j++, i++) { - if(j == s) { + for (i = 0, j = 0, c = 0; i < 1024 * 1024; j++, i++) { + if (j == s) { c++; j = 0; } @@ -7432,32 +8000,30 @@ int test_hyperslab(const char *fname, HDmemset(buf, c, nelmts); /* make a different hyperslab at this position */ - if(make_diffs && i == 512 * 512) + if (make_diffs && i == 512 * 512) HDmemset(buf, 0, nelmts); - hs_start[0] = (unsigned long long)i * GBLL / (1024 * 1024); - if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size, NULL) < 0) + hs_start[0] = (unsigned long long) i * GBLL / (1024 * 1024); + if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, hs_start, NULL, hs_size, NULL) < 0) goto out; /* write only one hyperslab */ - if ( i==512*512) - { - if (H5Dwrite (did,H5T_NATIVE_CHAR,m_sid,f_sid,H5P_DEFAULT,buf) < 0) + if (i == 512 * 512) { + if (H5Dwrite(did, H5T_NATIVE_CHAR, m_sid, f_sid, H5P_DEFAULT, buf) < 0) goto out; } - } HDfree(buf); - buf=NULL; + buf = NULL; /* close */ - if(H5Sclose(f_sid) < 0) + if (H5Sclose(f_sid) < 0) goto out; - if(H5Sclose(m_sid) < 0) + if (H5Sclose(m_sid) < 0) goto out; - if(H5Pclose(dcpl) < 0) + if (H5Pclose(dcpl) < 0) goto out; - if(H5Dclose(did) < 0) + if (H5Dclose(did) < 0) goto out; H5Fclose(fid); @@ -7472,40 +8038,32 @@ out: H5Fclose(fid); } H5E_END_TRY; return -1; - } - /*------------------------------------------------------------------------- -* Function: write_attr -* -* Purpose: utility function to write an attribute in LOC_ID -* -*------------------------------------------------------------------------- -*/ + * Function: write_attr + * + * Purpose: utility function to write an attribute in LOC_ID + * + *------------------------------------------------------------------------- + */ static -int write_attr(hid_t loc_id, - int rank, - hsize_t *dims, - const char *name, - hid_t tid, - void *buf) +int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf) { - hid_t aid=-1; - hid_t sid=-1; + hid_t aid = -1; + hid_t sid = -1; /* create a space */ - if((sid = H5Screate_simple(rank, dims, NULL)) < 0) + if ((sid = H5Screate_simple(rank, dims, NULL)) < 0) goto out; /* create the attribute */ - if((aid = H5Acreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((aid = H5Acreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* write */ - if(buf) - { - if(H5Awrite(aid, tid, buf) < 0) + if (buf) { + if (H5Awrite(aid, tid, buf) < 0) goto out; } @@ -7523,35 +8081,29 @@ out: } /*------------------------------------------------------------------------- -* Function: write_dset -* -* Purpose: utility function to create and write a dataset in LOC_ID -* -*------------------------------------------------------------------------- -*/ + * Function: write_dset + * + * Purpose: utility function to create and write a dataset in LOC_ID + * + *------------------------------------------------------------------------- + */ static -int write_dset( hid_t loc_id, - int rank, - hsize_t *dims, - const char *name, - hid_t tid, - void *buf ) +int write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf) { - hid_t did=-1; - hid_t sid=-1; + hid_t did = -1; + hid_t sid = -1; /* create a space */ - if((sid = H5Screate_simple(rank, dims, NULL)) < 0) + if ((sid = H5Screate_simple(rank, dims, NULL)) < 0) goto out; /* create the dataset */ - if((did = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((did = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* write */ - if(buf) - { - if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + if (buf) { + if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto out; } diff --git a/tools/test/h5diff/testfiles/h5diff_8639.txt b/tools/test/h5diff/testfiles/h5diff_8639.txt new file mode 100644 index 0000000..4022e06 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_8639.txt @@ -0,0 +1,72 @@ + +group1 group2 +--------------------------------------- + x x + +group : and +0 differences found +Warning: different storage datatype +Not comparable: or is of mixed string type +Warning: different storage datatype +Not comparable: or is of mixed string type +Warning: different storage datatype +Not comparable: or is of mixed string type +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +Warning: different storage datatype +Not comparable: or is of mixed string type +Warning: different storage datatype +Not comparable: or is of mixed string type +Warning: different storage datatype +Not comparable: or is of mixed string type +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. +EXIT CODE: 0 diff --git a/tools/test/h5diff/testfiles/h5diff_attr1.h5 b/tools/test/h5diff/testfiles/h5diff_attr1.h5 index c44066b..4cea743 100644 Binary files a/tools/test/h5diff/testfiles/h5diff_attr1.h5 and b/tools/test/h5diff/testfiles/h5diff_attr1.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_attr2.h5 b/tools/test/h5diff/testfiles/h5diff_attr2.h5 index 5de3303..3ea3302 100644 Binary files a/tools/test/h5diff/testfiles/h5diff_attr2.h5 and b/tools/test/h5diff/testfiles/h5diff_attr2.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_attr3.h5 b/tools/test/h5diff/testfiles/h5diff_attr3.h5 new file mode 100644 index 0000000..631845d Binary files /dev/null and b/tools/test/h5diff/testfiles/h5diff_attr3.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_tmp2.txt b/tools/test/h5diff/testfiles/h5diff_tmp2.txt deleted file mode 100644 index a2d6da6..0000000 --- a/tools/test/h5diff/testfiles/h5diff_tmp2.txt +++ /dev/null @@ -1,13 +0,0 @@ -dataset: and -1599 differences found -dataset: and -8 differences found -dataset: and -1845 differences found -dataset: and -10 differences found --------------------------------- -Some objects are not comparable --------------------------------- -Use -c for a list of objects. -EXIT CODE: 1 diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index d9cb857..c464f94 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -82,6 +82,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_types.h5 $SRC_H5DIFF_TESTFILES/h5diff_dtypes.h5 $SRC_H5DIFF_TESTFILES/h5diff_attr1.h5 $SRC_H5DIFF_TESTFILES/h5diff_attr2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_attr3.h5 $SRC_H5DIFF_TESTFILES/h5diff_dset1.h5 $SRC_H5DIFF_TESTFILES/h5diff_dset2.h5 $SRC_H5DIFF_TESTFILES/h5diff_hyper1.h5 @@ -118,8 +119,6 @@ $SRC_H5DIFF_TESTFILES/h5diff_attr_v_level2.h5 $SRC_H5DIFF_TESTFILES/h5diff_enum_invalid_values.h5 $SRC_H5DIFF_TESTFILES/non_comparables1.h5 $SRC_H5DIFF_TESTFILES/non_comparables2.h5 -$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 @@ -336,7 +335,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_710.txt $SRC_H5DIFF_TESTFILES/h5diff_80.txt $SRC_H5DIFF_TESTFILES/h5diff_90.txt $SRC_H5DIFF_TESTFILES/h5diff_8625.txt -$SRC_H5DIFF_TESTFILES/h5diff_tmp2.txt +$SRC_H5DIFF_TESTFILES/h5diff_8639.txt $SRC_H5DIFF_TESTFILES/h5diff_v1.txt $SRC_H5DIFF_TESTFILES/h5diff_v2.txt $SRC_H5DIFF_TESTFILES/h5diff_v3.txt @@ -818,8 +817,6 @@ TOOLTEST h5diff_631.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h # 7. attributes # ############################################################################## TOOLTEST h5diff_70.txt -v h5diff_attr1.h5 h5diff_attr2.h5 -# temporary test to verify HDFFV-8639 -TOOLTEST h5diff_tmp2.txt tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.reference.h5 # ################################################## # attrs with verbose option level @@ -1143,6 +1140,8 @@ TOOLTEST h5diff_487.txt -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5 TOOLTEST h5diff_530.txt -v h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group /group_copy # test to verify HDFFV-8625 TOOLTEST h5diff_8625.txt -v --enable-error-stack h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group/Compound_dset1 /group_copy/Compound_dset3 +# test to verify HDFFV-8639 +TOOLTEST h5diff_8639.txt -v h5diff_attr3.h5 h5diff_attr2.h5 /g1 TOOLTEST h5diff_vlstr.txt -v tvlstr.h5 tvlstr2.h5 # ############################################################################## -- cgit v0.12 From db1add7e22be9ec8e44aba29b3988e6c1826fe25 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 Jan 2018 10:19:21 -0600 Subject: HDFFV-8745 update release note --- release_docs/RELEASE.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 3882c4c..17ec3ac 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -268,6 +268,21 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5diff + + h5diff seg faulted if comparing VL strings against fixed strigs. + + Reworked solution for HDFFV-8625 and 8639. Implemented the check + for string objects of same type in the diff_can_type function by + adding an if(tclass1 == H5T_STRING) block. This if block moves the + same check that was added for attributes to this function, which is + used by all object types. This function also handles complex type + structures. + Also added a new test file in h5diffgenttest for testing this issue + and removed the temporary files used in the test scripts. + + (ADB - 2018/01/04, HDFFV-8745) + - h5repack h5repack failed to copy a dataset with existing filter. -- cgit v0.12 From db918c06b549ef8dc8d106d69da277bcf8d0aa11 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 Jan 2018 10:44:02 -0600 Subject: HDFFV-8745 fix typos --- release_docs/RELEASE.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 17ec3ac..b52a46f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -270,9 +270,9 @@ Bug Fixes since HDF5-1.10.1 release ----- - h5diff - h5diff seg faulted if comparing VL strings against fixed strigs. + h5diff seg faulted if comparing VL strings against fixed strings. - Reworked solution for HDFFV-8625 and 8639. Implemented the check + Reworked solution for HDFFV-8625 and HDFFV-8639. Implemented the check for string objects of same type in the diff_can_type function by adding an if(tclass1 == H5T_STRING) block. This if block moves the same check that was added for attributes to this function, which is -- cgit v0.12 From d01ad2a94ae5643090e9443dfb0ee69657d894c2 Mon Sep 17 00:00:00 2001 From: hdftest Date: Fri, 5 Jan 2018 08:50:10 -0600 Subject: Snapshot version 1.11 release 1 --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 2 +- java/src/hdf/hdf5lib/H5.java | 4 ++-- java/test/TestH5.java | 4 ++-- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- .../testfiles/h5repack_layout.h5-plugin_version_test.ddl | 14 +++++++------- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.txt b/README.txt index 6820267..e9985c2 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.11.0 currently under development +HDF5 version 1.11.1 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index ae5dd90..c4725c3 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.11.0" +PROJECT_NUMBER = "1.11.1" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index e7b73b3..011ee7b 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,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.11.0") +set (CTEST_SOURCE_VERSION "1.11.1") set (CTEST_SOURCE_VERSEXT "") ############################################################################## diff --git a/configure.ac b/configure.ac index 5562d5c..7a8ccbf 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.11.0], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.11.1], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 78ebbe2..5285ac5 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -214,7 +214,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * exception handlers to print out the HDF-5 error stack. *
* - * @version HDF5 1.11.0
+ * @version HDF5 1.11.1
* See also: hdf.hdf5lib.HDFArray
* hdf.hdf5lib.HDF5Constants
* hdf.hdf5lib.HDF5CDataTypes
@@ -237,7 +237,7 @@ public class H5 implements java.io.Serializable { * * Make sure to update the versions number when a different library is used. */ - public final static int LIB_VERSION[] = { 1, 11, 0 }; + public final static int LIB_VERSION[] = { 1, 11, 1 }; public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib"; diff --git a/java/test/TestH5.java b/java/test/TestH5.java index 413e58d..a45984e 100644 --- a/java/test/TestH5.java +++ b/java/test/TestH5.java @@ -162,7 +162,7 @@ public class TestH5 { */ @Test public void testH5get_libversion() { - int libversion[] = { 1, 11, 0 }; + int libversion[] = { 1, 11, 1 }; try { H5.H5get_libversion(libversion); @@ -184,7 +184,7 @@ public class TestH5 { */ @Test public void testH5check_version() { - int majnum = 1, minnum = 11, relnum = 0; + int majnum = 1, minnum = 11, relnum = 1; try { H5.H5check_version(majnum, minnum, relnum); diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 3882c4c..d022526 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.11.0 currently under development +HDF5 version 1.11.1 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 58d0cd1..d08e6b0 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,10 +93,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 11 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 1 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.11.0" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.11.1" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) 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 283b44c..0821257 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 @@ -11,7 +11,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -33,7 +33,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -55,7 +55,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -77,7 +77,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -99,7 +99,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -121,7 +121,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -143,7 +143,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { -- cgit v0.12 From bee148a99501e9aa582e93bfb880648a905f4301 Mon Sep 17 00:00:00 2001 From: hdftest Date: Fri, 5 Jan 2018 10:09:10 -0600 Subject: Snapshot version 1.11 release 2 --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 4 ++-- java/src/hdf/hdf5lib/H5.java | 4 ++-- java/test/TestH5.java | 4 ++-- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- .../testfiles/h5repack_layout.h5-plugin_version_test.ddl | 14 +++++++------- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.txt b/README.txt index e9985c2..759e412 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.11.1 currently under development +HDF5 version 1.11.2 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index c4725c3..56ea1e6 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.11.1" +PROJECT_NUMBER = "1.11.2" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 011ee7b..d32a6bdb 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,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.11.1") +set (CTEST_SOURCE_VERSION "1.11.2") set (CTEST_SOURCE_VERSEXT "") ############################################################################## diff --git a/configure.ac b/configure.ac index 7a8ccbf..6bd650f 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.11.1], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.11.2], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) @@ -48,7 +48,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # use silent rules where a ## ## By default, it is enabled. Users can configure with ## --disable-maintainer-mode to prevent running the autotools. -AM_MAINTAINER_MODE([enable]) +AM_MAINTAINER_MODE([disable]) ## ---------------------------------------------------------------------- ## Set prefix default (install directory) to a directory in the build area. diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 5285ac5..20aa634 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -214,7 +214,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * exception handlers to print out the HDF-5 error stack. *
* - * @version HDF5 1.11.1
+ * @version HDF5 1.11.2
* See also: hdf.hdf5lib.HDFArray
* hdf.hdf5lib.HDF5Constants
* hdf.hdf5lib.HDF5CDataTypes
@@ -237,7 +237,7 @@ public class H5 implements java.io.Serializable { * * Make sure to update the versions number when a different library is used. */ - public final static int LIB_VERSION[] = { 1, 11, 1 }; + public final static int LIB_VERSION[] = { 1, 11, 2 }; public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib"; diff --git a/java/test/TestH5.java b/java/test/TestH5.java index a45984e..b922583 100644 --- a/java/test/TestH5.java +++ b/java/test/TestH5.java @@ -162,7 +162,7 @@ public class TestH5 { */ @Test public void testH5get_libversion() { - int libversion[] = { 1, 11, 1 }; + int libversion[] = { 1, 11, 2 }; try { H5.H5get_libversion(libversion); @@ -184,7 +184,7 @@ public class TestH5 { */ @Test public void testH5check_version() { - int majnum = 1, minnum = 11, relnum = 1; + int majnum = 1, minnum = 11, relnum = 2; try { H5.H5check_version(majnum, minnum, relnum); diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d022526..dac5876 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.11.1 currently under development +HDF5 version 1.11.2 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index d08e6b0..9157366 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,10 +93,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 11 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 1 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 2 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.11.1" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.11.2" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) 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 0821257..5a1ebe7 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 @@ -11,7 +11,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -33,7 +33,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -55,7 +55,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -77,7 +77,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -99,7 +99,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -121,7 +121,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -143,7 +143,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { -- cgit v0.12 From 2a1a2c59937657cf318232e6bfde456cbd297ef1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 5 Jan 2018 11:45:44 -0600 Subject: HDDFV-10361 combine duplicated prefix utility functions --- src/H5Dvirtual.c | 319 +++------------------------ src/H5Fint.c | 331 +++++++++++++++++++++++++--- src/H5Fprivate.h | 6 + src/H5Lexternal.c | 306 ++++--------------------- tools/test/h5dump/errfiles/tall-1.err | 5 +- tools/test/h5dump/errfiles/tall-2A.err | 5 +- tools/test/h5dump/errfiles/tall-2A0.err | 5 +- tools/test/h5dump/errfiles/tall-2B.err | 5 +- tools/test/h5dump/errfiles/textlink.err | 10 +- tools/test/h5dump/errfiles/torderlinks1.err | 5 +- tools/test/h5dump/errfiles/torderlinks2.err | 5 +- 11 files changed, 415 insertions(+), 587 deletions(-) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 306fe62..9e1ebe8 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -147,7 +147,7 @@ H5FL_DEFINE(H5O_storage_virtual_name_seg_t); H5FL_DEFINE_STATIC(H5D_virtual_held_file_t); - + /*------------------------------------------------------------------------- * Function: H5D_virtual_check_mapping_pre * @@ -217,7 +217,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_check_mapping_pre() */ - + /*------------------------------------------------------------------------- * Function: H5D_virtual_check_mapping_post * @@ -285,7 +285,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_check_mapping_post() */ - + /*------------------------------------------------------------------------- * Function: H5D_virtual_update_min_dims * @@ -344,7 +344,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_update_min_dims() */ - + /*------------------------------------------------------------------------- * Function: H5D_virtual_check_min_dims * @@ -389,7 +389,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_check_min_dims() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_copy_layout * @@ -553,7 +553,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_copy_layout() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_reset_layout * @@ -637,7 +637,7 @@ H5D__virtual_reset_layout(H5O_layout_t *layout) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_reset_layout() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_copy * @@ -683,7 +683,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_copy() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_delete * @@ -733,255 +733,6 @@ done: } /* end H5D__virtual_delete */ -/*-------------------------------------------------------------------------- - * Function: H5D__virtual_build_name - * - * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME - * - * Return: Non-negative on success/Negative on failure - *--------------------------------------------------------------------------*/ -static herr_t -H5D__virtual_build_name(char *prefix, char *file_name, char **full_name/*out*/) -{ - size_t prefix_len; /* length of prefix */ - size_t fname_len; /* Length of external link file name */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - prefix_len = HDstrlen(prefix); - fname_len = HDstrlen(file_name); - - /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ - if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") - - /* Compose the full file name */ - HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, - (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__virtual_build_name() */ - - -/*-------------------------------------------------------------------------- - * Function: H5D_getenv_prefix_name -- - * - * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, - * which is separated by the environment delimiter. - * env_prefix is modified to point to the remaining pathnames - * in the list. - * - * Return: A pointer to a pathname ---------------------------------------------------------------------------*/ -static char * -H5D_getenv_prefix_name(char **env_prefix/*in,out*/) -{ - char *retptr=NULL; - char *strret=NULL; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - strret = HDstrchr(*env_prefix, H5_COLON_SEPC); - if (strret == NULL) { - retptr = *env_prefix; - *env_prefix = strret; - } else { - retptr = *env_prefix; - *env_prefix = strret + 1; - *strret = '\0'; - } - - FUNC_LEAVE_NOAPI(retptr) -} /* end H5D_getenv_prefix_name() */ - -/*------------------------------------------------------------------------- - * Function: H5D__virtual_open_file - * - * Purpose: Attempts to open a source dataset file. - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -static H5F_t * -H5D__virtual_open_file(hid_t plist_id, const H5F_t *vdset_file, - const char *file_name, - hid_t fapl_id, hid_t dxpl_id) -{ - H5F_t *src_file = NULL; /* Source file */ - H5F_t *ret_value = NULL; /* Actual return value */ - char *full_name = NULL; /* File name with prefix */ - char *my_prefix = NULL; /* Library's copy of the prefix */ - unsigned intent; /* File access permissions */ - char *actual_file_name = NULL; /* Virtual file's actual name */ - char *temp_file_name = NULL; /* Temporary pointer to file name */ - size_t temp_file_name_len; /* Length of temporary file name */ - - FUNC_ENTER_STATIC - - /* Simplify intent flags for open calls */ - intent = H5F_INTENT(vdset_file); - intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); - - /* Copy the file name to use */ - if(NULL == (temp_file_name = H5MM_strdup(file_name))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - temp_file_name_len = HDstrlen(temp_file_name); - - /* target file_name is an absolute pathname: see RM for detailed description */ - if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { - /* Try opening file */ - if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - char *ptr; - - H5E_clear_stack(NULL); - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(file_name, ptr) - HDassert(ptr); - - /* Increment past delimiter */ - ptr++; - - /* Copy into the temp. file name */ - HDstrncpy(temp_file_name, ptr, temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - else if(H5_CHECK_ABS_DRIVE(file_name)) { - /* Try opening file */ - if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - - H5E_clear_stack(NULL); - - /* strip ":" */ - HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - - /* try searching from paths set in the environment variable */ - if(src_file == NULL) { - char *env_prefix; - - if(NULL != (env_prefix = HDgetenv("HDF5_VDS_PREFIX"))) { - char *tmp_env_prefix, *saved_env; - - if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - while((tmp_env_prefix) && (*tmp_env_prefix)) { - char *out_prefix_name; - - out_prefix_name = H5D_getenv_prefix_name(&tmp_env_prefix/*in,out*/); - if(out_prefix_name && (*out_prefix_name)) { - if(H5D__virtual_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { - saved_env = (char *)H5MM_xfree(saved_env); - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - } /* end if */ - - src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); - full_name = (char *)H5MM_xfree(full_name); - if(src_file != NULL) - break; - H5E_clear_stack(NULL); - } /* end if */ - } /* end while */ - saved_env = (char *)H5MM_xfree(saved_env); - } /* end if */ - } /* end if */ - - /* try searching from property list */ - if(src_file == NULL) { - size_t size = 0; - H5E_BEGIN_TRY { - size = H5Pget_virtual_prefix(plist_id, NULL, 0); - } H5E_END_TRY; - if(size <= 0) - my_prefix = NULL; - else { - /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ - if(NULL == (my_prefix = (char *)H5MM_malloc(size + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate prefix buffer") - if(H5Pget_virtual_prefix(plist_id, my_prefix, size+1) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") - if(my_prefix) { - if(H5D__virtual_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - my_prefix = (char *)H5MM_xfree(my_prefix); - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } - } /* end if */ - } /* end if */ - - /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ - if(src_file == NULL) { - char *vdspath; - - if(NULL != (vdspath = H5F_EXTPATH(vdset_file))) { - if(H5D__virtual_build_name(vdspath, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - } /* end if */ - - /* try the relative file_name stored in temp_file_name */ - if(src_file == NULL) { - if(NULL == (src_file = H5F_open(temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - } /* end if */ - - /* try the 'resolved' name for the virtual file */ - if(src_file == NULL) { - char *ptr = NULL; - - /* Copy resolved file name */ - if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(vdset_file)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string") - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(actual_file_name, ptr) - if(!ptr) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - - /* Truncate filename portion from actual file name path */ - *ptr = '\0'; - - /* Build new file name for the external file */ - if(H5D__virtual_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - actual_file_name = (char *)H5MM_xfree(actual_file_name); - - /* Try opening with the resolved name */ - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - - /* Success */ - ret_value = src_file; -done: - if((NULL == ret_value) && src_file) - if(H5F_try_close(src_file, NULL) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, NULL, "can't close source file") - if(my_prefix) - my_prefix = (char *)H5MM_xfree(my_prefix); - if(full_name) - full_name = (char *)H5MM_xfree(full_name); - if(temp_file_name) - temp_file_name = (char *)H5MM_xfree(temp_file_name); - if(actual_file_name) - actual_file_name = (char *)H5MM_xfree(actual_file_name); - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__virtual_open_file() */ - - /*------------------------------------------------------------------------- * Function: H5D__virtual_open_source_dset * @@ -1000,13 +751,11 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id) { H5F_t *src_file = NULL; /* Source file */ - char *vds_prefix = NULL; /* Source file vds_prefix */ hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */ H5G_loc_t src_root_loc; /* Object location of source file root group */ herr_t ret_value = SUCCEED; /* Return value */ - char *full_name = NULL; /* File name with prefix */ - unsigned intent; /* File access permissions */ hid_t plist_id = -1; /* Property list pointer */ + unsigned intent; /* File access permissions */ FUNC_ENTER_STATIC @@ -1019,9 +768,11 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { - if((plist_id = H5D_get_access_plist(vdset)) < 0) + if((plist_id = H5D_get_access_plist((H5D_t *)vdset)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get access plist") - if(NULL == (src_file = H5D__virtual_open_file(plist_id, vdset->oloc.file, source_dset->file_name, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + intent = H5F_INTENT(vdset->oloc.file); + if(NULL == (src_file = H5F_prefix_open_file(plist_id, vdset->oloc.file, H5D_ACS_VDS_PREFIX_NAME, source_dset->file_name, intent, + vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ else src_file_open = TRUE; @@ -1062,13 +813,13 @@ done: H5Pclose(plist_id); /* Close source file */ if(src_file_open) - if(H5F_try_close(src_file, NULL) < 0) + if(H5F_efc_close(vdset->oloc.file, src_file) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, FAIL, "can't close source file") FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_open_source_dset() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_reset_source_dset * @@ -1155,7 +906,7 @@ H5D__virtual_reset_source_dset(H5O_storage_virtual_ent_t *virtual_ent, FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_reset_source_dset() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_str_append * @@ -1231,7 +982,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5D__virtual_str_append() */ - + /*------------------------------------------------------------------------- * Function: H5D_virtual_parse_source_name * @@ -1347,7 +1098,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_parse_source_name() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_copy_parsed_name * @@ -1404,7 +1155,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_copy_parsed_name() */ - + /*------------------------------------------------------------------------- * Function: H5D_virtual_free_parsed_name * @@ -1437,7 +1188,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_free_parsed_name() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_build_source_name * @@ -1539,7 +1290,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_build_source_name() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_set_extent_unlim * @@ -1967,7 +1718,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_set_extent_unlim() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_init_all * @@ -2191,7 +1942,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_init_all() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_init * @@ -2286,7 +2037,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_init() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_is_space_alloc * @@ -2318,7 +2069,7 @@ H5D__virtual_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_is_space_alloc() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_pre_io * @@ -2559,7 +2310,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_pre_io() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_post_io * @@ -2609,7 +2360,7 @@ H5D__virtual_post_io(H5O_storage_virtual_t *storage) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_post_io() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_read_one * @@ -2666,7 +2417,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_read_one() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_read * @@ -2799,7 +2550,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_read() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_write_one * @@ -2858,7 +2609,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_write_one() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_write * @@ -2935,7 +2686,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_write() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_flush * @@ -2983,7 +2734,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_flush() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_hold_source_dset_files * @@ -3061,7 +2812,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_hold_source_dset_files() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_refresh_source_dset * @@ -3101,7 +2852,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_refresh_source_dsets() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_refresh_source_dsets * @@ -3154,7 +2905,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_refresh_source_dsets() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_release_source_dset_files * diff --git a/src/H5Fint.c b/src/H5Fint.c index 8212eb5..b135ce1 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -30,6 +30,7 @@ #include "H5FDprivate.h" /* File drivers */ #include "H5Gprivate.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ @@ -98,7 +99,7 @@ H5FL_DEFINE(H5F_t); /* Declare a free list to manage the H5F_file_t struct */ H5FL_DEFINE(H5F_file_t); - + /*------------------------------------------------------------------------- * Function: H5F_get_access_plist * @@ -213,7 +214,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_access_plist() */ - + /*------------------------------------------------------------------------- * Function: H5F_get_obj_count * @@ -241,7 +242,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_obj_count() */ - + /*------------------------------------------------------------------------- * Function: H5F_get_obj_ids * @@ -268,7 +269,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_obj_ids() */ - + /*--------------------------------------------------------------------------- * Function: H5F_get_objects * @@ -370,7 +371,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_objects() */ - + /*------------------------------------------------------------------------- * Function: H5F_get_objects_cb * @@ -479,7 +480,265 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_objects_cb() */ - +/*-------------------------------------------------------------------------- + * Function: H5F_build_name + * + * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME + * + * Return: Non-negative on success/Negative on failure + *--------------------------------------------------------------------------*/ +herr_t +H5F_build_name(char *prefix, char *file_name, char **full_name/*out*/) +{ + size_t prefix_len; /* length of prefix */ + size_t fname_len; /* Length of external link file name */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + prefix_len = HDstrlen(prefix); + fname_len = HDstrlen(file_name); + + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") + + /* Compose the full file name */ + HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, + (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F_build_name() */ + + +/*-------------------------------------------------------------------------- + * Function: H5F_getenv_prefix_name -- + * + * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, + * which is separated by the environment delimiter. + * env_prefix is modified to point to the remaining pathnames + * in the list. + * + * Return: A pointer to a pathname +--------------------------------------------------------------------------*/ +char * +H5F_getenv_prefix_name(char **env_prefix/*in,out*/) +{ + char *retptr=NULL; + char *strret=NULL; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + strret = HDstrchr(*env_prefix, H5_COLON_SEPC); + if (strret == NULL) { + retptr = *env_prefix; + *env_prefix = strret; + } else { + retptr = *env_prefix; + *env_prefix = strret + 1; + *strret = '\0'; + } + + FUNC_LEAVE_NOAPI(retptr) +} /* end H5F_getenv_prefix_name() */ + +/*------------------------------------------------------------------------- + * Function: H5F_prefix_open_file + * + * Purpose: Attempts to open a dataset file. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +H5F_t * +H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_type, + const char *file_name, unsigned file_intent, hid_t fapl_id, hid_t dxpl_id) +{ + H5F_t *src_file = NULL; /* Source file */ + H5F_t *ret_value = NULL; /* Actual return value */ + char *full_name = NULL; /* File name with prefix */ + char *my_prefix = NULL; /* Library's copy of the prefix */ + char *actual_file_name = NULL; /* File's actual name */ + char *temp_file_name = NULL; /* Temporary pointer to file name */ + size_t temp_file_name_len; /* Length of temporary file name */ + + FUNC_ENTER_STATIC + + /* Simplify intent flags for open calls */ + file_intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); + + /* Copy the file name to use */ + if(NULL == (temp_file_name = H5MM_strdup(file_name))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + temp_file_name_len = HDstrlen(temp_file_name); + + /* target file_name is an absolute pathname: see RM for detailed description */ + if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_efc_open(primary_file, file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + char *ptr; + + H5E_clear_stack(NULL); + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(file_name, ptr) + HDassert(ptr); + + /* Increment past delimiter */ + ptr++; + + /* Copy into the temp. file name */ + HDstrncpy(temp_file_name, ptr, temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + else if(H5_CHECK_ABS_DRIVE(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_efc_open(primary_file, file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + + H5E_clear_stack(NULL); + + /* strip ":" */ + HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + + /* try searching from paths set in the environment variable */ + if(src_file == NULL) { + char *env_prefix; + + if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) + env_prefix = HDgetenv("HDF5_VDS_PREFIX"); + else if (HDstrcmp(prefix_type, H5L_ACS_ELINK_PREFIX_NAME) == 0) + env_prefix = HDgetenv("HDF5_EXT_PREFIX"); + else + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, NULL, "prefix name is not sensible") + if(NULL != env_prefix) { + char *tmp_env_prefix, *saved_env; + + if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + + while((tmp_env_prefix) && (*tmp_env_prefix)) { + char *out_prefix_name; + + out_prefix_name = H5F_getenv_prefix_name(&tmp_env_prefix/*in,out*/); + if(out_prefix_name && (*out_prefix_name)) { + if(H5F_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { + saved_env = (char *)H5MM_xfree(saved_env); + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") + } /* end if */ + + src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); + full_name = (char *)H5MM_xfree(full_name); + if(src_file != NULL) + break; + H5E_clear_stack(NULL); + } /* end if */ + } /* end while */ + saved_env = (char *)H5MM_xfree(saved_env); + } /* end if */ + } /* end if */ + + /* try searching from property list */ + if(src_file == NULL) { + ssize_t size = 0; + H5E_BEGIN_TRY { + if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) + size = H5Pget_virtual_prefix(plist_id, NULL, 0); + else if (HDstrcmp(prefix_type, H5L_ACS_ELINK_PREFIX_NAME) == 0) + size = H5Pget_elink_prefix(plist_id, NULL, 0); + } H5E_END_TRY; + if(size <= 0) + my_prefix = NULL; + else { + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (my_prefix = (char *)H5MM_malloc((size_t)size + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate prefix buffer") + if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) + size = H5Pget_virtual_prefix(plist_id, my_prefix, (size_t)size+1); + else if (HDstrcmp(prefix_type, H5L_ACS_ELINK_PREFIX_NAME) == 0) + size = H5Pget_elink_prefix(plist_id, my_prefix, (size_t)size+1); + if(size < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get file prefix") + if(my_prefix) { + if(H5F_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") + my_prefix = (char *)H5MM_xfree(my_prefix); + if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } + } + } + + /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ + if(src_file == NULL) { + char *dspath; + + if(NULL != (dspath = H5F_EXTPATH(primary_file))) { + if(H5F_build_name(dspath, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") + if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + } /* end if */ + + /* try the relative file_name stored in temp_file_name */ + if(src_file == NULL) { + if(NULL == (src_file = H5F_efc_open(primary_file, temp_file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + } /* end if */ + + /* try the 'resolved' name for the virtual file */ + if(src_file == NULL) { + char *ptr = NULL; + + /* Copy resolved file name */ + if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(primary_file)))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string") + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(actual_file_name, ptr) + if(!ptr) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file, file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + + /* Truncate filename portion from actual file name path */ + *ptr = '\0'; + + /* Build new file name for the external file */ + if(H5F_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") + actual_file_name = (char *)H5MM_xfree(actual_file_name); + + /* Try opening with the resolved name */ + if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file, file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + + /* Success */ + ret_value = src_file; +done: + if((NULL == ret_value) && src_file) + if(H5F_efc_close(primary_file, src_file) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "can't close source file") + if(my_prefix) + my_prefix = (char *)H5MM_xfree(my_prefix); + if(full_name) + full_name = (char *)H5MM_xfree(full_name); + if(temp_file_name) + temp_file_name = (char *)H5MM_xfree(temp_file_name); + if(actual_file_name) + actual_file_name = (char *)H5MM_xfree(actual_file_name); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F_prefix_open_file() */ + + /*------------------------------------------------------------------------- * Function: H5F__is_hdf5 * @@ -528,7 +787,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__is_hdf5() */ - + /*------------------------------------------------------------------------- * Function: H5F_new * @@ -792,7 +1051,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_new() */ - + /*------------------------------------------------------------------------- * Function: H5F__dest * @@ -1051,7 +1310,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_dest() */ - + /*------------------------------------------------------------------------- * Function: H5F_open * @@ -1469,7 +1728,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_open() */ - + /*------------------------------------------------------------------------- * Function: H5F_flush_phase1 * @@ -1506,7 +1765,7 @@ H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id) FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__flush_phase1() */ - + /*------------------------------------------------------------------------- * Function: H5F__flush_phase2 * @@ -1568,7 +1827,7 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__flush_phase2() */ - + /*------------------------------------------------------------------------- * Function: H5F__flush * @@ -1600,7 +1859,7 @@ H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing) FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__flush() */ - + /*------------------------------------------------------------------------- * Function: H5F_close * @@ -1661,7 +1920,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_close() */ - + /*------------------------------------------------------------------------- * Function: H5F_try_close * @@ -1834,7 +2093,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_try_close() */ - + /*------------------------------------------------------------------------- * Function: H5F_get_id * @@ -1870,7 +2129,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_id() */ - + /*------------------------------------------------------------------------- * Function: H5F_incr_nopen_objs * @@ -1891,7 +2150,7 @@ H5F_incr_nopen_objs(H5F_t *f) FUNC_LEAVE_NOAPI(++f->nopen_objs) } /* end H5F_incr_nopen_objs() */ - + /*------------------------------------------------------------------------- * Function: H5F_decr_nopen_objs * @@ -1912,7 +2171,7 @@ H5F_decr_nopen_objs(H5F_t *f) FUNC_LEAVE_NOAPI(--f->nopen_objs) } /* end H5F_decr_nopen_objs() */ - + /*------------------------------------------------------------------------- * Function: H5F_build_actual_name * @@ -2034,7 +2293,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_build_actual_name() */ - + /*------------------------------------------------------------------------- * Function: H5F_addr_encode_len * @@ -2071,7 +2330,7 @@ H5F_addr_encode_len(size_t addr_len, uint8_t **pp/*in,out*/, haddr_t addr) FUNC_LEAVE_NOAPI_VOID } /* end H5F_addr_encode_len() */ - + /*------------------------------------------------------------------------- * Function: H5F_addr_encode * @@ -2095,7 +2354,7 @@ H5F_addr_encode(const H5F_t *f, uint8_t **pp/*in,out*/, haddr_t addr) FUNC_LEAVE_NOAPI_VOID } /* end H5F_addr_encode() */ - + /*------------------------------------------------------------------------- * Function: H5F_addr_decode_len * @@ -2159,7 +2418,7 @@ H5F_addr_decode_len(size_t addr_len, const uint8_t **pp/*in,out*/, haddr_t *addr FUNC_LEAVE_NOAPI_VOID } /* end H5F_addr_decode_len() */ - + /*------------------------------------------------------------------------- * Function: H5F_addr_decode * @@ -2186,7 +2445,7 @@ H5F_addr_decode(const H5F_t *f, const uint8_t **pp/*in,out*/, haddr_t *addr_p/*o FUNC_LEAVE_NOAPI_VOID } /* end H5F_addr_decode() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_grp_btree_shared * @@ -2212,7 +2471,7 @@ H5F_set_grp_btree_shared(H5F_t *f, H5UC_t *rc) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_grp_btree_shared() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_sohm_addr * @@ -2237,7 +2496,7 @@ H5F_set_sohm_addr(H5F_t *f, haddr_t addr) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_sohm_addr() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_sohm_vers * @@ -2262,7 +2521,7 @@ H5F_set_sohm_vers(H5F_t *f, unsigned vers) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_sohm_vers() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_sohm_nindexes * @@ -2287,7 +2546,7 @@ H5F_set_sohm_nindexes(H5F_t *f, unsigned nindexes) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_sohm_nindexes() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_store_msg_crt_idx * @@ -2312,7 +2571,7 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_store_msg_crt_idx() */ - + /*------------------------------------------------------------------------- * Function: H5F_get_file_image * @@ -2428,7 +2687,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_get_file_image() */ - + /*------------------------------------------------------------------------- * Function: H5F_track_metadata_read_retries * @@ -2476,7 +2735,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_track_metadata_read_retries() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_retries * @@ -2512,7 +2771,7 @@ H5F_set_retries(H5F_t *f) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_retries() */ - + /*------------------------------------------------------------------------- * Function: H5F_object_flush_cb * @@ -2542,7 +2801,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_object_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5F__set_base_addr * @@ -2569,7 +2828,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__set_base_addr() */ - + /*------------------------------------------------------------------------- * Function: H5F__set_eoa * @@ -2596,7 +2855,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__set_eoa() */ - + /*------------------------------------------------------------------------- * Function: H5F__set_paged_aggr * @@ -2625,7 +2884,7 @@ done: } /* end H5F__set_paged_aggr() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- * Function: H5F_set_coll_md_read * @@ -2650,7 +2909,7 @@ 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 * diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 96b8e36..ba94069 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -863,6 +863,12 @@ H5_DLL H5F_t *H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); H5_DLL herr_t H5F_efc_close(H5F_t *parent, H5F_t *file); +/* File prefix routines */ +H5_DLL herr_t H5F_build_name(char *prefix, char *file_name, char **full_name); +H5_DLL char * H5F_getenv_prefix_name(char **env_prefix); +H5F_t *H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_type, + const char *file_name, unsigned file_intent, hid_t fapl_id, hid_t dxpl_id); + /* Global heap CWFS routines */ H5_DLL herr_t H5F_cwfs_add(H5F_t *f, struct H5HG_heap_t *heap); H5_DLL herr_t H5F_cwfs_find_free_heap(H5F_t *f, hid_t dxpl_id, size_t need, haddr_t *addr); diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index b4a173f..bf0a044 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -15,7 +15,7 @@ /* Module Setup */ /****************/ -#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #include "H5Lmodule.h" /* This source code file is part of the H5L module */ @@ -25,8 +25,9 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* Files */ #include "H5Gpkg.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ +#include "H5Iprivate.h" /* IDs */ #include "H5Lpkg.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opublic.h" /* File objects */ @@ -79,7 +80,7 @@ static ssize_t H5L_extern_query(const char H5_ATTR_UNUSED * link_name, const voi /* Default External Link link class */ static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ - H5L_TYPE_EXTERNAL, /* Link type id number */ + H5L_TYPE_EXTERNAL, /* Link type id number */ "external", /* Link name for debugging */ NULL, /* Creation callback */ NULL, /* Move callback */ @@ -89,82 +90,10 @@ static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ H5L_extern_query /* Query callback */ }}; - - -/*-------------------------------------------------------------------------- - * Function: H5L_getenv_prefix_name -- - * - * Purpose: Get the first pathname in the list of pathnames stored in ENV_PREFIX, - * which is separated by the environment delimiter. - * ENV_PREFIX is modified to point to the remaining pathnames - * in the list. - * - * Return: A pointer to a pathname - * - * Programmer: Vailin Choi, April 2, 2008 - * ---------------------------------------------------------------------------*/ -static char * -H5L_getenv_prefix_name(char **env_prefix/*in,out*/) -{ - char *retptr=NULL; - char *strret=NULL; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - strret = HDstrchr(*env_prefix, H5_COLON_SEPC); - if (strret == NULL) { - retptr = *env_prefix; - *env_prefix = strret; - } else { - retptr = *env_prefix; - *env_prefix = strret + 1; - *strret = '\0'; - } - - FUNC_LEAVE_NOAPI(retptr) -} /* end H5L_getenv_prefix_name() */ - - -/*-------------------------------------------------------------------------- - * Function: H5L_build_name - * - * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi, April 2, 2008 - * ---------------------------------------------------------------------------*/ -static herr_t -H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) -{ - size_t prefix_len; /* length of prefix */ - size_t fname_len; /* Length of external link file name */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - prefix_len = HDstrlen(prefix); - fname_len = HDstrlen(file_name); - - /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ - if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") - - /* Compose the full file name */ - HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, - (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_build_name() */ - - /*------------------------------------------------------------------------- - * Function: H5L_extern_traverse + * Function: H5L_extern_traverse * - * Purpose: Default traversal function for external links. This can + * Purpose: Default traversal function for external links. This can * be overridden using H5Lregister(). * * Given a filename and path packed into the link udata, @@ -173,25 +102,25 @@ done: * link access property list, appends that prefix to the * filename being opened. * - * Return: ID of the opened object on success/Negative on failure + * Return: ID of the opened object on success/Negative on failure * - * Programmer: James Laird + * Programmer: James Laird * Monday, July 10, 2006 * Modifications: - * Vailin Choi, April 2, 2008 - * Add handling to search for the target file - * See description in RM: H5Lcreate_external + * Vailin Choi, April 2, 2008 + * Add handling to search for the target file + * See description in RM: H5Lcreate_external * - * Vailin Choi; Sept. 12th, 2008; bug #1247 - * Retrieve the file access property list identifer that is set - * for link access property via H5Pget_elink_fapl(). - * If the return value is H5P_DEFAULT, the parent's file access - * property is used to H5F_open() the target file; - * Otherwise, the file access property retrieved from H5Pget_elink_fapl() - * is used to H5F_open() the target file. + * Vailin Choi; Sept. 12th, 2008; bug #1247 + * Retrieve the file access property list identifer that is set + * for link access property via H5Pget_elink_fapl(). + * If the return value is H5P_DEFAULT, the parent's file access + * property is used to H5F_open() the target file; + * Otherwise, the file access property retrieved from H5Pget_elink_fapl() + * is used to H5F_open() the target file. * - * Vailin Choi; Nov 2010 - * Free memory pointed to by tmp_env_prefix for HDF5_EXT_PREFIX case. + * Vailin Choi; Nov 2010 + * Free memory pointed to by tmp_env_prefix for HDF5_EXT_PREFIX case. * *------------------------------------------------------------------------- */ @@ -200,13 +129,11 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, const void *_udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id) { H5P_genplist_t *plist; /* Property list pointer */ - char *my_prefix; /* Library's copy of the prefix */ H5G_loc_t root_loc; /* Location of root group in external file */ H5G_loc_t loc; /* Location of object */ - H5F_t *ext_file = NULL; /* File struct for external file */ + H5F_t *ext_file = NULL; /* File struct for external file */ const uint8_t *p = (const uint8_t *)_udata; /* Pointer into external link buffer */ const char *file_name; /* Name of file containing external link's object */ - char *full_name = NULL; /* File name with prefix */ const char *obj_name; /* Name external link's object */ size_t fname_len; /* Length of external link file name */ unsigned intent; /* File access permissions */ @@ -215,11 +142,8 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, hid_t ext_obj = -1; /* ID for external link's object */ char *parent_group_name = NULL;/* Temporary pointer to group name */ char local_group_name[H5L_EXT_TRAVERSE_BUF_SIZE]; /* Local buffer to hold group name */ - char *temp_file_name = NULL; /* Temporary pointer to file name */ - size_t temp_file_name_len; /* Length of temporary file name */ - char *actual_file_name = NULL; /* Parent file's actual name */ H5P_genplist_t *fa_plist; /* File access property list pointer */ - H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ + H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -266,7 +190,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, intent = H5F_INTENT(loc.oloc->file); if((fapl_id == H5P_DEFAULT) && ((fapl_id = H5F_get_access_plist(loc.oloc->file, FALSE)) < 0)) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get parent's file access property list") + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get parent's file access property list") /* Get callback_info */ if(H5P_get(plist, H5L_ACS_ELINK_CB_NAME, &cb_info) < 0) @@ -274,7 +198,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* Get file access property list */ if(NULL == (fa_plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) - 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") /* Make callback if it exists */ if(cb_info.func) { @@ -314,143 +238,11 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* Set file close degree for new file to "weak" */ if(H5P_set(fa_plist, H5F_ACS_CLOSE_DEGREE_NAME, &fc_degree) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") - - /* - * Start searching for the target file - */ - - /* Simplify intent flags for open calls */ - intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); - - /* Copy the file name to use */ - if(NULL == (temp_file_name = H5MM_strdup(file_name))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - temp_file_name_len = HDstrlen(temp_file_name); - - /* target file_name is an absolute pathname: see RM for detailed description */ - if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { - /* Try opening file */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - char *ptr; - - H5E_clear_stack(NULL); - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(file_name, ptr) - HDassert(ptr); - - /* Increment past delimiter */ - ptr++; - - /* Copy into the temp. file name */ - HDstrncpy(temp_file_name, ptr, temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - else if(H5_CHECK_ABS_DRIVE(file_name)) { - /* Try opening file */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - - H5E_clear_stack(NULL); - - /* strip ":" */ - HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - - /* try searching from paths set in the environment variable */ - if(ext_file == NULL) { - char *env_prefix; - - if(NULL != (env_prefix = HDgetenv("HDF5_EXT_PREFIX"))) { - char *tmp_env_prefix, *saved_env; - - if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) - HGOTO_ERROR(H5E_LINK, H5E_NOSPACE, FAIL, "memory allocation failed") - - while((tmp_env_prefix) && (*tmp_env_prefix)) { - char *out_prefix_name; - - out_prefix_name = H5L_getenv_prefix_name(&tmp_env_prefix/*in,out*/); - if(out_prefix_name && (*out_prefix_name)) { - if(H5L_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { - saved_env = (char *)H5MM_xfree(saved_env); - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - } /* end if */ - - ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); - full_name = (char *)H5MM_xfree(full_name); - if(ext_file != NULL) - break; - H5E_clear_stack(NULL); - } /* end if */ - } /* end while */ - saved_env = (char *)H5MM_xfree(saved_env); - } /* end if */ - } /* end if */ - - /* try searching from property list */ - if(ext_file == NULL) { - if(H5P_peek(plist, H5L_ACS_ELINK_PREFIX_NAME, &my_prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external link prefix") - if(my_prefix) { - if(H5L_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - } /* end if */ - - /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ - if(ext_file == NULL) { - char *extpath; - - if(NULL != (extpath = H5F_EXTPATH(loc.oloc->file))) { - if(H5L_build_name(extpath, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - } /* end if */ - - /* try the relative file_name stored in temp_file_name */ - if(ext_file == NULL) { - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - } /* end if */ - - /* try the 'resolved' name for the parent file (i.e. the name after symlinks - * were resolved) - */ - if(ext_file == NULL) { - char *ptr = NULL; - - /* Copy resolved file name */ - if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(loc.oloc->file)))) - HGOTO_ERROR(H5E_LINK, H5E_CANTALLOC, FAIL, "can't duplicate resolved file name string") - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(actual_file_name, ptr) - if(!ptr) - HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - - /* Truncate filename portion from actual file name path */ - *ptr = '\0'; - - /* Build new file name for the external file */ - if(H5L_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - - /* Try opening with the resolved name */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") + /* Search for the target file */ + if(NULL == (ext_file = H5F_prefix_open_file(lapl_id, loc.oloc->file, H5L_ACS_ELINK_PREFIX_NAME, file_name, intent, fapl_id, dxpl_id))) + HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s'", file_name) /* Retrieve the "group location" for the file's root group */ if(H5G_root_loc(ext_file, &root_loc) < 0) @@ -471,10 +263,6 @@ done: HDONE_ERROR(H5E_LINK, H5E_CANTCLOSEFILE, FAIL, "problem closing external file") if(parent_group_name && parent_group_name != local_group_name) parent_group_name = (char *)H5MM_xfree(parent_group_name); - full_name = (char *)H5MM_xfree(full_name); - temp_file_name = (char *)H5MM_xfree(temp_file_name); - actual_file_name = (char *)H5MM_xfree(actual_file_name); - if(ret_value < 0) { /* Close object if it's open and something failed */ if(ext_obj >= 0 && H5I_dec_ref(ext_obj) < 0) @@ -484,20 +272,20 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5L_extern_traverse() */ - + /*------------------------------------------------------------------------- - * Function: H5L_extern_query + * Function: H5L_extern_query * - * Purpose: Default query function for external links. This can + * Purpose: Default query function for external links. This can * be overridden using H5Lregister(). * * Returns the size of the link's user data. If a buffer of * is provided, copies at most buf_size bytes of the udata * into it. * - * Return: Size of buffer on success/Negative on failure + * Return: Size of buffer on success/Negative on failure * - * Programmer: James Laird + * Programmer: James Laird * Monday, July 10, 2006 * *------------------------------------------------------------------------- @@ -534,23 +322,23 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5L_extern_query() */ - + /*------------------------------------------------------------------------- - * Function: H5Lcreate_external + * Function: H5Lcreate_external * - * Purpose: Creates an external link from LINK_NAME to OBJ_NAME. + * Purpose: Creates an external link from LINK_NAME to OBJ_NAME. * * External links are links to objects in other HDF5 files. They * are allowed to "dangle" like soft links internal to a file. * FILE_NAME is the name of the file that OBJ_NAME is is contained * within. If OBJ_NAME is given as a relative path name, the * path will be relative to the root group of FILE_NAME. - * LINK_NAME is interpreted relative to LINK_LOC_ID, which is + * LINK_NAME is interpreted relative to LINK_LOC_ID, which is * either a file ID or a group ID. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 18, 2005 * *------------------------------------------------------------------------- @@ -559,14 +347,14 @@ herr_t H5Lcreate_external(const char *file_name, const char *obj_name, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id) { - H5G_loc_t link_loc; /* Group location to create link */ - char *norm_obj_name = NULL; /* Pointer to normalized current name */ + H5G_loc_t link_loc; /* Group location to create link */ + char *norm_obj_name = NULL; /* Pointer to normalized current name */ void *ext_link_buf = NULL; /* Buffer to contain external link */ size_t buf_size; /* Size of buffer to hold external link */ size_t file_name_len; /* Length of file name string */ size_t norm_obj_name_len; /* Length of normalized object name string */ uint8_t *p; /* Pointer into external link buffer */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -575,13 +363,13 @@ H5Lcreate_external(const char *file_name, const char *obj_name, /* Check arguments */ if(!file_name || !*file_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no file name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no file name specified") if(!obj_name || !*obj_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name specified") if(H5G_loc(link_loc_id, &link_loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(!link_name || !*link_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no link name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no link name specified") /* Get normalized copy of the link target */ if(NULL == (norm_obj_name = H5G_normalize(obj_name))) @@ -616,7 +404,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_external() */ - + /*------------------------------------------------------------------------- * Function: H5L_register_external * @@ -645,7 +433,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5L_register_external() */ - + /*------------------------------------------------------------------------- * Function: H5Lunpack_elink_val * diff --git a/tools/test/h5dump/errfiles/tall-1.err b/tools/test/h5dump/errfiles/tall-1.err index ab9dbe3..5bfb451 100644 --- a/tools/test/h5dump/errfiles/tall-1.err +++ b/tools/test/h5dump/errfiles/tall-1.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2A.err b/tools/test/h5dump/errfiles/tall-2A.err index ab9dbe3..5bfb451 100644 --- a/tools/test/h5dump/errfiles/tall-2A.err +++ b/tools/test/h5dump/errfiles/tall-2A.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2A0.err b/tools/test/h5dump/errfiles/tall-2A0.err index ab9dbe3..5bfb451 100644 --- a/tools/test/h5dump/errfiles/tall-2A0.err +++ b/tools/test/h5dump/errfiles/tall-2A0.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2B.err b/tools/test/h5dump/errfiles/tall-2B.err index ab9dbe3..5bfb451 100644 --- a/tools/test/h5dump/errfiles/tall-2B.err +++ b/tools/test/h5dump/errfiles/tall-2B.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/textlink.err b/tools/test/h5dump/errfiles/textlink.err index 95556db..fbbfb12 100644 --- a/tools/test/h5dump/errfiles/textlink.err +++ b/tools/test/h5dump/errfiles/textlink.err @@ -20,9 +20,12 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'filename', temp_file_name = 'filename' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'filename' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'filename', temp_file_name = 'filename' + major: File accessibilty + minor: Unable to open file HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header @@ -45,6 +48,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'anotherfile', temp_file_name = 'anotherfile' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'anotherfile' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'anotherfile', temp_file_name = 'anotherfile' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/torderlinks1.err b/tools/test/h5dump/errfiles/torderlinks1.err index e665f03..b72872d 100644 --- a/tools/test/h5dump/errfiles/torderlinks1.err +++ b/tools/test/h5dump/errfiles/torderlinks1.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'fname', temp_file_name = 'fname' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/torderlinks2.err b/tools/test/h5dump/errfiles/torderlinks2.err index e665f03..b72872d 100644 --- a/tools/test/h5dump/errfiles/torderlinks2.err +++ b/tools/test/h5dump/errfiles/torderlinks2.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'fname', temp_file_name = 'fname' + major: File accessibilty + minor: Unable to open file -- cgit v0.12 From 804d89f596869635318fbcc20723034bd737619c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 5 Jan 2018 13:58:23 -0600 Subject: HDFFV-10361 Update release note for vds prefix --- release_docs/RELEASE.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b52a46f..a7e56f7 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -65,13 +65,15 @@ New Features on the virtual file, using a data access property list (DAPL), allows the source files to located at an absolute or relative path to the virtual file. + Private utility functions in H5D and H5L packages merged into single + function in H5F package. New public APIs: herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. - (ADB - 2017/12/12, HDFFV-9724) + (ADB - 2017/12/12, HDFFV-9724, HDFFV-10361) Parallel Library: -- cgit v0.12 From be42e047913c332f148db3b8a9180e6a2eb5c23a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jan 2018 09:56:28 -0600 Subject: HDFFV-10385 refactor CMAKE_BUILD_TYPE usage --- CMakeLists.txt | 6 +++-- config/cmake/HDFCompilerFlags.cmake | 6 ++--- config/cmake/libhdf5.settings.cmake.in | 6 ++--- config/cmake_ext_mod/HDFMacros.cmake | 39 +++++++++++++++++++++++++++---- config/cmake_ext_mod/HDFUseFortran.cmake | 8 +++++++ fortran/src/CMakeLists.txt | 14 ++++------- fortran/test/CMakeLists.txt | 14 ++++------- hl/fortran/src/CMakeLists.txt | 14 ++++------- java/examples/datasets/CMakeLists.txt | 2 +- java/examples/datatypes/CMakeLists.txt | 2 +- java/examples/groups/CMakeLists.txt | 2 +- java/examples/intro/CMakeLists.txt | 2 +- java/src/jni/CMakeLists.txt | 2 +- java/test/CMakeLists.txt | 2 +- release_docs/RELEASE.txt | 25 ++++++++++++++++---- test/CMakeTests.cmake | 2 +- testpar/CMakeLists.txt | 4 ++-- tools/src/h5copy/CMakeLists.txt | 7 +++--- tools/src/h5diff/CMakeLists.txt | 7 +++--- tools/src/h5dump/CMakeLists.txt | 7 +++--- tools/src/h5format_convert/CMakeLists.txt | 6 +++-- tools/src/h5import/CMakeLists.txt | 6 +++-- tools/src/h5jam/CMakeLists.txt | 6 +++-- tools/src/h5ls/CMakeLists.txt | 7 +++--- tools/src/h5repack/CMakeLists.txt | 7 +++--- tools/src/h5stat/CMakeLists.txt | 7 +++--- tools/src/misc/CMakeLists.txt | 8 +++---- 27 files changed, 129 insertions(+), 89 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4e6300..5be2f03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -409,6 +409,8 @@ include (${HDF_RESOURCES_EXT_DIR}/HDFMacros.cmake) include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake) include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake) +SET_HDF5_BUILD_TYPE() + #----------------------------------------------------------------------------- # Setup output Directories #----------------------------------------------------------------------------- @@ -426,7 +428,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules." ) if (WIN32) - set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}) + set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}) set (CMAKE_PDB_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files." ) @@ -582,7 +584,7 @@ option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF) #----------------------------------------------------------------------------- option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) mark_as_advanced (HDF5_ENABLE_TRACE) -if (CMAKE_BUILD_TYPE MATCHES Debug) +if (HDF5_BUILD_TYPE MATCHES Debug) add_definitions (-DDEBUG) # Enable tracing of the API if (HDF5_ENABLE_TRACE) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 5f71f33..eeb4b97 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -13,12 +13,12 @@ # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") endif () - else (CMAKE_BUILD_TYPE MATCHES Debug) + else (HDF5_BUILD_TYPE MATCHES Debug) set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") @@ -26,7 +26,7 @@ if (CMAKE_COMPILER_IS_GNUCC) endif () endif () if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_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") diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 8348af0..28fb876 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -1,5 +1,5 @@ - SUMMARY OF THE HDF5 CONFIGURATION - ================================= + SUMMARY OF THE HDF5 CONFIGURATION + ================================= General Information: ------------------- @@ -13,7 +13,7 @@ General Information: Compiling Options: ------------------ - Build Mode: @CMAKE_BUILD_TYPE@ + Build Mode: @HDF5_BUILD_TYPE@ Debugging Symbols: @SYMBOLS@ Asserts: @ASSERTS@ Profiling: @PROFILING@ diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 192a5c8..dd7e262 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -9,6 +9,37 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # + +#------------------------------------------------------------------------------- +macro (SET_HDF5_BUILD_TYPE) + get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(_isMultiConfig) + set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR}) + else() + if(CMAKE_BUILD_TYPE) + set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE}) + else() + set(HDF5_BUILD_TYPE) + endif() + endif() +endmacro () + +#------------------------------------------------------------------------------- +macro (CREATE_CONFIG_DIR path) + get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(_isMultiConfig) + foreach(c ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) + file(MAKE_DIRECTORY "${path}/${c}") + endforeach() + else() + if(CMAKE_BUILD_TYPE) + file(MAKE_DIRECTORY "${path}/${CMAKE_BUILD_TYPE}") + else() + file(MAKE_DIRECTORY "${path}") + endif() + endif() +endmacro () + #------------------------------------------------------------------------------- macro (SET_GLOBAL_VARIABLE name value) set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) @@ -145,7 +176,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${HDF5_BUILD_TYPE} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) @@ -160,8 +191,8 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) ) 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}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) endif () else () @@ -181,7 +212,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) 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_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) else () diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 7bf4d81..5be2c49 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -15,6 +15,14 @@ #------------------------------------------------------------------------------- ENABLE_LANGUAGE (Fortran) +#------------------------------------------------------------------------------- +# Fix Fortran flags if we are compiling staticly on Windows using +# Windows_MT.cmake from config/cmake/UserMacros +#------------------------------------------------------------------------------- +if (BUILD_STATIC_CRT_LIBS) + TARGET_STATIC_CRT_FLAGS () +endif () + #----------------------------------------------------------------------------- # Detect name mangling convention used between Fortran and C #----------------------------------------------------------------------------- diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 18d6d80..692509b 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -66,17 +66,11 @@ set_target_properties (H5_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - if (WIN32) - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else () - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif () -endif () -if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else () - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) endif () +CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 3c3eb8f..f536bf2 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -34,17 +34,11 @@ set_target_properties (H5_test_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - if (WIN32) - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else () - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif () -endif () -if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else () - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) endif () +CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 3fc66c4..90ee19b 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -38,17 +38,11 @@ set_target_properties (H5HL_buildiface PROPERTIES if (BUILD_SHARED_LIBS) 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 () - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif () -endif () -if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else () - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) endif () +CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) #----------------------------------------------------------------------------- # Setup include Directories diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 3972ec8..dd007f5 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -62,7 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 8569b8b..fac8158 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -62,7 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index b912208..7f2801a 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -61,7 +61,7 @@ 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 (HDF5_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 9dc4dd7..a21d369 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -63,7 +63,7 @@ foreach (example ${HDF_JAVA_OBJECT_EXAMPLES}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 10d1b6d..90343b2 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -57,7 +57,7 @@ SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED ${HDF5_JAVA_PACKAGE_SOVERSION}) if (WIN32) get_filename_component (HDF5_JAVA_JNI_DLL_NAME ${HDF5_JAVA_JNI_LIB_TARGET} NAME_WE) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) set (HDF5_JAVA_JNI_DLL_NAME "${HDF5_JAVA_JNI_DLL_NAME}_D") endif () # message (STATUS "HDF5_JAVA_JNI_DLL_NAME: ${HDF5_JAVA_JNI_DLL_NAME}") diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 8912b3f..fadc1ea 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -88,7 +88,7 @@ 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 (HDF5_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7f2f8b4..1dc5bd1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -54,7 +54,15 @@ New Features Configuration: ------------- - - + - CMake + + Refactor use of CMAKE_BUILD_TYPE for new variable, which understands + the type of generator in use. + + Added new configuration macros to use new HDF5_BUILD_TYPE variable. This + variable is set correctly for the type of generator being used for the build. + + (ADB - 2018/01/08, HDFFV-10385, HDFFV-10296) Library: -------- @@ -224,7 +232,16 @@ Bug Fixes since HDF5-1.10.1 release Configuration ------------- - - cmake + - CMake + + Add replacement of fortran flags if using static CRT. + + Added TARGET_STATIC_CRT_FLAGS call to HDFUseFortran.cmake file in + config/cmake_ext_mod folder. + + (ADB - 2018/01/08, HDFFV-10334) + + - CMake The hdf5 library used shared szip and zlib, which needlessly required applications to link with the same szip and zlib libraries. @@ -236,7 +253,7 @@ Bug Fixes since HDF5-1.10.1 release (ADB - 2017/11/14, HDFFV-10329) - - cmake MPI + - CMake MPI CMake implementation for MPI was problematic and would create incorrect MPI library references in the hdf5 libraries. @@ -247,7 +264,7 @@ Bug Fixes since HDF5-1.10.1 release (ADB - 2017/11/02, HDFFV-10321) - - cmake + - CMake Too many commands for POST_BUILD step caused command line to be too big on windows. diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index fca2f27..a304485 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1133,7 +1133,7 @@ if (HDF5_TEST_VFD) 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) + if (NOT BUILD_SHARED_LIBS AND NOT HDF5_BUILD_TYPE MATCHES Debug) add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 997d1a1..db61d35 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -30,7 +30,7 @@ set (testphdf5_SOURCES add_executable (testphdf5 ${testphdf5_SOURCES}) TARGET_NAMING (testphdf5 STATIC) TARGET_C_PROPERTIES (testphdf5 STATIC " " " ") -target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) +target_link_libraries (testphdf5 PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) target_link_libraries (testphdf5 PRIVATE ${MPI_C_LIBRARIES}) endif () @@ -40,7 +40,7 @@ MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") - target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) + target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${file} PRIVATE ${MPI_C_LIBRARIES}) endif () diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index d1f5f50..23c8fae 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -39,10 +39,9 @@ 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) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 00d93de..b0cf66e 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -57,10 +57,9 @@ 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) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index 65a7cdd..c58b20c 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -47,10 +47,9 @@ 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) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index fa3abc0..1e3e62f 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -28,11 +28,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) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS - h5format_convert + ${H5_DEP_EXECUTABLES} 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..bebc6d8 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -29,11 +29,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) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS - h5import + ${H5_DEP_EXECUTABLES} 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..1075180 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -38,11 +38,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) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS - h5jam h5unjam + ${H5_DEP_EXECUTABLES} 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..0e3d57f 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -39,10 +39,9 @@ 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) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index 81e6275..abf4c24 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -50,10 +50,9 @@ 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) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index 9762dbb..60d3f7c 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -39,10 +39,9 @@ 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) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 1292628..20c9171 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -62,13 +62,13 @@ 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) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS - h5debug h5repart h5mkgrp + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -- cgit v0.12 From 9c2a9cec1f708039dbc625bcc6827ab64282e065 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jan 2018 14:35:59 -0600 Subject: HDFFV-10361 Correct signatures --- src/H5Fint.c | 32 ++++++++++++++++---------------- src/H5Fprivate.h | 4 +--- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/H5Fint.c b/src/H5Fint.c index b135ce1..e528cab 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -481,20 +481,20 @@ done: } /* end H5F_get_objects_cb() */ /*-------------------------------------------------------------------------- - * Function: H5F_build_name + * Function: H5F__build_name * * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME * * Return: Non-negative on success/Negative on failure *--------------------------------------------------------------------------*/ -herr_t -H5F_build_name(char *prefix, char *file_name, char **full_name/*out*/) +static herr_t +H5F__build_name(char *prefix, char *file_name, char **full_name/*out*/) { size_t prefix_len; /* length of prefix */ size_t fname_len; /* Length of external link file name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC prefix_len = HDstrlen(prefix); fname_len = HDstrlen(file_name); @@ -509,11 +509,11 @@ H5F_build_name(char *prefix, char *file_name, char **full_name/*out*/) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_build_name() */ +} /* H5F__build_name() */ /*-------------------------------------------------------------------------- - * Function: H5F_getenv_prefix_name -- + * Function: H5F__getenv_prefix_name -- * * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, * which is separated by the environment delimiter. @@ -522,13 +522,13 @@ done: * * Return: A pointer to a pathname --------------------------------------------------------------------------*/ -char * -H5F_getenv_prefix_name(char **env_prefix/*in,out*/) +static char * +H5F__getenv_prefix_name(char **env_prefix/*in,out*/) { char *retptr=NULL; char *strret=NULL; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC strret = HDstrchr(*env_prefix, H5_COLON_SEPC); if (strret == NULL) { @@ -541,7 +541,7 @@ H5F_getenv_prefix_name(char **env_prefix/*in,out*/) } FUNC_LEAVE_NOAPI(retptr) -} /* end H5F_getenv_prefix_name() */ +} /* end H5F__getenv_prefix_name() */ /*------------------------------------------------------------------------- * Function: H5F_prefix_open_file @@ -563,7 +563,7 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ char *temp_file_name = NULL; /* Temporary pointer to file name */ size_t temp_file_name_len; /* Length of temporary file name */ - FUNC_ENTER_STATIC + FUNC_ENTER_NOAPI_NOINIT /* Simplify intent flags for open calls */ file_intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); @@ -624,9 +624,9 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ while((tmp_env_prefix) && (*tmp_env_prefix)) { char *out_prefix_name; - out_prefix_name = H5F_getenv_prefix_name(&tmp_env_prefix/*in,out*/); + out_prefix_name = H5F__getenv_prefix_name(&tmp_env_prefix/*in,out*/); if(out_prefix_name && (*out_prefix_name)) { - if(H5F_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { + if(H5F__build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { saved_env = (char *)H5MM_xfree(saved_env); HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") } /* end if */ @@ -664,7 +664,7 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ if(size < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get file prefix") if(my_prefix) { - if(H5F_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) + if(H5F__build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") my_prefix = (char *)H5MM_xfree(my_prefix); if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) @@ -679,7 +679,7 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ char *dspath; if(NULL != (dspath = H5F_EXTPATH(primary_file))) { - if(H5F_build_name(dspath, temp_file_name, &full_name/*out*/) < 0) + if(H5F__build_name(dspath, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) H5E_clear_stack(NULL); @@ -710,7 +710,7 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ *ptr = '\0'; /* Build new file name for the external file */ - if(H5F_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) + if(H5F__build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") actual_file_name = (char *)H5MM_xfree(actual_file_name); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index ba94069..49c5098 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -864,9 +864,7 @@ H5_DLL H5F_t *H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, H5_DLL herr_t H5F_efc_close(H5F_t *parent, H5F_t *file); /* File prefix routines */ -H5_DLL herr_t H5F_build_name(char *prefix, char *file_name, char **full_name); -H5_DLL char * H5F_getenv_prefix_name(char **env_prefix); -H5F_t *H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_type, +H5_DLL H5F_t *H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_type, const char *file_name, unsigned file_intent, hid_t fapl_id, hid_t dxpl_id); /* Global heap CWFS routines */ -- cgit v0.12 From 3e0c6530dc3a6008f800b25eb55c1422d853cc67 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jan 2018 16:26:12 -0600 Subject: HDFFV-10385 fix platform errors --- CMakeLists.txt | 4 ++-- config/cmake/hdf5-config.cmake.in | 6 ----- config/cmake_ext_mod/HDFMacros.cmake | 21 ++++-------------- fortran/src/CMakeLists.txt | 43 ++++++++++++++++++++---------------- fortran/test/CMakeLists.txt | 21 +++++++++--------- hl/fortran/src/CMakeLists.txt | 23 +++++++++---------- 6 files changed, 52 insertions(+), 66 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5be2f03..f40fc2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -428,12 +428,12 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules." ) if (WIN32) - set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}) + set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE}) 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}) + set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE}) endif () else () # if we are externally configured, but the project uses old cmake scripts diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 01c27df..421f693 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -105,12 +105,6 @@ set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) # project which has already built hdf5 as a subproject #----------------------------------------------------------------------------- if (NOT TARGET "@HDF5_PACKAGE@") - if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib") - include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) - endif () - if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip") - include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) - endif () include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) endif () diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index dd7e262..218c882 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -15,27 +15,14 @@ macro (SET_HDF5_BUILD_TYPE) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR}) + set(HDF5_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) else() if(CMAKE_BUILD_TYPE) set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE}) + set(HDF5_CFG_BUILD_TYPE ${CMAKE_BUILD_TYPE}) else() - set(HDF5_BUILD_TYPE) - endif() - endif() -endmacro () - -#------------------------------------------------------------------------------- -macro (CREATE_CONFIG_DIR path) - get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) - if(_isMultiConfig) - foreach(c ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) - file(MAKE_DIRECTORY "${path}/${c}") - endforeach() - else() - if(CMAKE_BUILD_TYPE) - file(MAKE_DIRECTORY "${path}/${CMAKE_BUILD_TYPE}") - else() - file(MAKE_DIRECTORY "${path}") + set(HDF5_BUILD_TYPE "Release") + set(HDF5_CFG_BUILD_TYPE "Release") endif() endif() endmacro () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 692509b..c377d62 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -66,11 +66,10 @@ set_target_properties (H5_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () -CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) +file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) @@ -81,14 +80,14 @@ add_executable (H5match_types ) set (CMD $) add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h - ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 + OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 COMMAND ${CMD} - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static DEPENDS H5match_types ) -set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5f90i_gen.h PROPERTIES GENERATED TRUE) -set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( @@ -127,10 +126,15 @@ set_source_files_properties (${f90CStub_C_SOURCES} PROPERTIES LANGUAGE C) set (f90CStub_C_HDRS # generated files - ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h +) +set (f90CStub_C_SHHDRS + # generated files + ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h ) add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) +target_include_directories(${HDF5_F90_C_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") @@ -143,7 +147,8 @@ set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES set (install_targets ${HDF5_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) - add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) + add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS}) + target_include_directories(${HDF5_F90_C_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}") @@ -168,16 +173,16 @@ set (f90_F_GEN_SOURCES ) set (CMD $) add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 COMMAND ${CMD} - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static DEPENDS ${f90_F_GEN_SOURCES} COMMENT "Generating the H5_gen.F90 file" ) add_custom_target (H5gen ALL - DEPENDS ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + DEPENDS ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 ) -set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) set (CMDSH $) @@ -216,12 +221,12 @@ set (f90_F_BASE_SOURCES set (f90_F_SOURCES # generated file - ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 + ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 ${f90_F_BASE_SOURCES} # generated file - ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 @@ -309,8 +314,8 @@ install ( ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h ${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h - ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h - ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 + ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index f536bf2..c47618e 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -33,12 +33,11 @@ set_target_properties (H5_test_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) + file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () -CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) +file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) @@ -47,6 +46,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) #----------------------------------------------------------------------------- add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c) set_source_files_properties (t.c PROPERTIES LANGUAGE C) +target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} @@ -60,6 +60,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES ) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) +target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} @@ -77,16 +78,16 @@ endif () set (CMD $) add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/tf_gen.F90 + OUTPUT ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 COMMAND ${CMD} - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static DEPENDS H5_test_buildiface COMMENT "Generating the tf_gen.F90 file" ) add_custom_target (H5testgen ALL - DEPENDS ${HDF5_F90_BINARY_DIR}/tf_gen.F90 + DEPENDS ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 ) -set_source_files_properties (${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) set (CMDSH $) @@ -105,7 +106,7 @@ endif () set (HDF5_F90_TF_SOURCES # generated files - ${HDF5_F90_BINARY_DIR}/tf_gen.F90 + ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 # normal distribution tf.F90 diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 90ee19b..47e8236 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -37,12 +37,9 @@ set_target_properties (H5HL_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") - CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () -CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- # Setup include Directories @@ -70,6 +67,7 @@ set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C) set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) +target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") @@ -83,6 +81,7 @@ set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) + target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}") @@ -109,18 +108,18 @@ set (HDF5_HL_F90_F_BASE_SOURCES set (CMD $) add_custom_command ( - OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 COMMAND ${CMD} - WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR} + WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/static DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files" ) add_custom_target (H5HLgen ALL - DEPENDS ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + DEPENDS ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 ) set_source_files_properties ( - ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 + ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5TBff_gen.F90 PROPERTIES GENERATED TRUE ) if (BUILD_SHARED_LIBS) @@ -146,8 +145,8 @@ set (HDF5_HL_F90_F_SOURCES ${HDF5_HL_F90_F_BASE_SOURCES} # generated files - ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 + ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5TBff_gen.F90 ) set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran) -- cgit v0.12 From a5789f6c9ab1f9308b5cc4dc64b156e9be077459 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jan 2018 16:26:25 -0600 Subject: HDFFV-8745 fix minor defects --- tools/lib/h5diff_attr.c | 2 -- tools/lib/h5diff_dset.c | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 4e4b40d..7f08cc7 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -325,8 +325,6 @@ 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 */ 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 */ diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 86aa543..ff542db 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -773,8 +773,8 @@ int diff_can_type(hid_t f_tid1, /* file data type */ } if(tclass1 == H5T_STRING) { - hid_t vstrtype1 = -1; - hid_t vstrtype2 = -1; + htri_t vstrtype1 = -1; + htri_t vstrtype2 = -1; h5difftrace("diff_can_type end - H5T_STRING\n"); vstrtype1 = H5Tis_variable_str(f_tid1); @@ -782,7 +782,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */ /* no compare if either one but not both are variable string type */ if (vstrtype1 != vstrtype2) { - if((opts->m_verbose || opts->m_list_not_cmp)) + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) parallel_print("Not comparable: <%s> or <%s> is of mixed string type\n", obj1_name, obj2_name); opts->not_cmp = 1; -- cgit v0.12 From 16e0a6b85868ddc30fffe2c92063f71caa5c71c2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jan 2018 16:55:29 -0600 Subject: Correct folder typo --- CMakeLists.txt | 2 +- fortran/test/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f40fc2a..2288be5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,7 +233,7 @@ if (NOT HDF5_INSTALL_DATA_DIR) set (HDF5_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) endif () set (HDF5_INSTALL_DATA_DIR share) - set (HDF5_INSTALL_CMAKE_DIR share/cmake) + set (HDF5_INSTALL_CMAKE_DIR share/cmake/hdf5) else () set (HDF5_INSTALL_DATA_DIR ".") set (HDF5_INSTALL_CMAKE_DIR cmake) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index c47618e..0af4df9 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -33,10 +33,10 @@ set_target_properties (H5_test_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") + file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () -file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") +file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) -- cgit v0.12 From 6bf125c7b38887a26b95d3eac4be08e5e44bb1af Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 08:31:44 -0600 Subject: HDFFV-10385 fix fortran references --- fortran/examples/h5_crtatt.f90 | 4 ++++ hl/fortran/src/CMakeLists.txt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/fortran/examples/h5_crtatt.f90 b/fortran/examples/h5_crtatt.f90 index 7e287c6..d3df380 100644 --- a/fortran/examples/h5_crtatt.f90 +++ b/fortran/examples/h5_crtatt.f90 @@ -84,6 +84,10 @@ PROGRAM H5_CRTATT ! CALL h5aclose_f(attr_id, error) ! + ! Close the attribute datatype. + ! + CALL h5tclose_f(atype_id, error) + ! ! Terminate access to the data space. ! CALL h5sclose_f(aspace_id, error) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 47e8236..dc2629a 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -37,8 +37,10 @@ set_target_properties (H5HL_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) + file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () +file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- -- cgit v0.12 From 850ec7a30a3e7cb9fb5727f1819a182dcebbe25d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 08:39:50 -0600 Subject: HDFFV-10385 - add release note --- release_docs/RELEASE.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1dc5bd1..2cacc30 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -234,6 +234,19 @@ Bug Fixes since HDF5-1.10.1 release ------------- - CMake + Correct usuage of CMAKE_BUILD_TYPE variable. + + The use of the CMAKE_BUILD_TYPE is incorrect for multi-config + generators (Visual Studio and XCode) and is optional for single + config generators. Created a new macro to check + GLOBAL PROPERTY -> GENERATOR_IS_MULTI_CONFIG + Created two new HDF variable, HDF5_BUILD_TYPE and HDF5_CFG_BUILD_TYPE. + Defaults for these variables is "Release". + + (ADB - 2018/01/10, HDFFV-10385) + + - CMake + Add replacement of fortran flags if using static CRT. Added TARGET_STATIC_CRT_FLAGS call to HDFUseFortran.cmake file in -- cgit v0.12 From 82709178aa25d726224d91df2b9e51b626137922 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 09:52:06 -0600 Subject: HDFFV-10385 includes cleanup --- fortran/test/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 0af4df9..7842359 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities @@ -39,8 +39,6 @@ endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) - #----------------------------------------------------------------------------- # Add Test Lib #----------------------------------------------------------------------------- -- cgit v0.12 From bdde53eb3ec3341bbe0b28617c0784dcd1f31b50 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 11:49:09 -0600 Subject: HDFFV-8745 remove obsolete files --- .../test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 | Bin 124440 -> 0 bytes .../h5diff/testfiles/tmpSingleSiteBethe.reference.h5 | Bin 119464 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 delete mode 100644 tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 diff --git a/tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 b/tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 deleted file mode 100644 index bbcfb63..0000000 Binary files a/tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 and /dev/null differ diff --git a/tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 b/tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 deleted file mode 100644 index 6b19ed7..0000000 Binary files a/tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 and /dev/null differ -- cgit v0.12 From 5b4b4658328b63181899834c1981555bc6144f98 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 13:04:06 -0600 Subject: Fix typo --- config/cmake/UseJava.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index 52b37a9..c70f52e 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -285,7 +285,7 @@ # # Example: # create_javadoc(my_example_doc -# PACKAGES com.exmaple.foo com.example.bar +# PACKAGES com.example.foo com.example.bar # SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}" # CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH} # WINDOWTITLE "My example" -- cgit v0.12 From 681047269b27d0f1be33827362ff823f919c593b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 13:31:47 -0600 Subject: HDFFV-10385 fix packaging --- fortran/src/CMakeLists.txt | 4 ++-- fortran/test/CMakeLists.txt | 4 ++-- hl/fortran/src/CMakeLists.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c377d62..030cb37 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -66,10 +66,10 @@ set_target_properties (H5_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 7842359..31d0f59 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -34,10 +34,10 @@ set_target_properties (H5_test_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) #----------------------------------------------------------------------------- # Add Test Lib diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index dc2629a..22738b90 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -38,10 +38,10 @@ set_target_properties (H5HL_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) endif () file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) #----------------------------------------------------------------------------- # Setup include Directories -- cgit v0.12 From 9956b151e005fa98e28926cbbb3565afb85b1d06 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 14:35:00 -0600 Subject: HDFFV-10385 multi-config builders need folder set --- config/cmake_ext_mod/HDFMacros.cmake | 3 +-- fortran/src/CMakeLists.txt | 4 ++-- fortran/test/CMakeLists.txt | 4 ++-- hl/fortran/src/CMakeLists.txt | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 218c882..76e0612 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -17,12 +17,11 @@ macro (SET_HDF5_BUILD_TYPE) set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR}) set(HDF5_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) else() + set(HDF5_CFG_BUILD_TYPE ".") if(CMAKE_BUILD_TYPE) set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE}) - set(HDF5_CFG_BUILD_TYPE ${CMAKE_BUILD_TYPE}) else() set(HDF5_BUILD_TYPE "Release") - set(HDF5_CFG_BUILD_TYPE "Release") endif() endif() endmacro () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 030cb37..c377d62 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -66,10 +66,10 @@ set_target_properties (H5_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 31d0f59..7842359 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -34,10 +34,10 @@ set_target_properties (H5_test_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- # Add Test Lib diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 22738b90..dc2629a 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -38,10 +38,10 @@ set_target_properties (H5HL_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- # Setup include Directories -- cgit v0.12 From c7e8a0788c68c2fe05b6b70591a499ad277c8fa5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 14:36:25 -0600 Subject: Correct whitespace --- fortran/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 7842359..9946aa0 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -58,7 +58,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES ) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) -target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) + target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} -- cgit v0.12 From a2f2e1f4cf44f305a12c674a37c120d26ce3362b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 11 Jan 2018 10:48:14 -0600 Subject: Fix fortran cmake variable usage --- fortran/src/CMakeLists.txt | 6 +++--- fortran/test/CMakeLists.txt | 30 +++++++++++++++--------------- hl/fortran/src/CMakeLists.txt | 5 +++-- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c377d62..7ed5fef 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -71,7 +71,7 @@ endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) -INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) +INCLUDE_DIRECTORIES (${HDF5_F90_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) #----------------------------------------------------------------------------- add_executable (H5match_types @@ -134,7 +134,7 @@ set (f90CStub_C_SHHDRS ) add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) -target_include_directories(${HDF5_F90_C_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) +target_include_directories(${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") @@ -148,7 +148,7 @@ set (install_targets ${HDF5_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS}) - target_include_directories(${HDF5_F90_C_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) + target_include_directories(${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}") diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 9946aa0..9f2d593 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_FORTRAN_TESTS_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities @@ -33,10 +33,10 @@ set_target_properties (H5_test_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") + file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared") set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () -file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") +file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- @@ -44,7 +44,7 @@ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYP #----------------------------------------------------------------------------- add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c) set_source_files_properties (t.c PROPERTIES LANGUAGE C) -target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) +target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} @@ -58,7 +58,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES ) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) - target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) + target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} @@ -76,35 +76,35 @@ endif () set (CMD $) add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 + OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 COMMAND ${CMD} - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static + WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static DEPENDS H5_test_buildiface COMMENT "Generating the tf_gen.F90 file" ) add_custom_target (H5testgen ALL - DEPENDS ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 + DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 ) -set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 + OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 COMMAND ${CMDSH} - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared + WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared DEPENDS H5_test_buildiface COMMENT "Generating the tf_gen.F90 shared file" ) add_custom_target (H5testgenSH ALL - DEPENDS ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 + DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 ) - set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE) + set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE) endif () set (HDF5_F90_TF_SOURCES # generated files - ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 + ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 # normal distribution tf.F90 @@ -113,7 +113,7 @@ set_source_files_properties (${HDF5_F90_TF_SOURCES} PROPERTIES LANGUAGE Fortran) if (BUILD_SHARED_LIBS) set (HDF5_F90_TF_SOURCES_SHARED # generated file - ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 + ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 # normal distribution tf.F90 diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index dc2629a..9190354 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -49,6 +49,7 @@ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYP INCLUDE_DIRECTORIES ( ${HDF5_HL_SRC_DIR}/src ${HDF5_F90_SRC_DIR}/src + ${HDF5_HL_F90_SRC_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR} @@ -69,7 +70,7 @@ set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C) set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) -target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) +target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") @@ -83,7 +84,7 @@ set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) - target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) + target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}") -- cgit v0.12 From 19c18e44ed113af84896604d7cedcc892f8338dc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 12 Jan 2018 14:17:04 -0600 Subject: Revert CMAKE_BUILD_TYPE for matches - need to redesign --- CMakeLists.txt | 2 +- config/cmake/HDFCompilerFlags.cmake | 6 +++--- config/cmake_ext_mod/HDFMacros.cmake | 5 ++++- java/examples/datasets/CMakeLists.txt | 2 +- java/examples/datatypes/CMakeLists.txt | 2 +- java/examples/groups/CMakeLists.txt | 2 +- java/examples/intro/CMakeLists.txt | 2 +- java/src/jni/CMakeLists.txt | 2 +- java/test/CMakeLists.txt | 2 +- test/CMakeTests.cmake | 2 +- 10 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2288be5..cb01cd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -584,7 +584,7 @@ option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF) #----------------------------------------------------------------------------- option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) mark_as_advanced (HDF5_ENABLE_TRACE) -if (HDF5_BUILD_TYPE MATCHES Debug) +if (CMAKE_BUILD_TYPE MATCHES Debug) add_definitions (-DDEBUG) # Enable tracing of the API if (HDF5_ENABLE_TRACE) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index eeb4b97..72d320c 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -13,12 +13,12 @@ # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") endif () - else (HDF5_BUILD_TYPE MATCHES Debug) + else () set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") @@ -26,7 +26,7 @@ if (CMAKE_COMPILER_IS_GNUCC) endif () endif () if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - if (HDF5_BUILD_TYPE MATCHES Debug) + 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") diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 76e0612..8a6b74d 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -24,6 +24,9 @@ macro (SET_HDF5_BUILD_TYPE) set(HDF5_BUILD_TYPE "Release") endif() endif() + if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release") + endif() endmacro () #------------------------------------------------------------------------------- @@ -162,7 +165,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${HDF5_BUILD_TYPE} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index dd007f5..3972ec8 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -62,7 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index fac8158..8569b8b 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -62,7 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 7f2801a..b912208 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -61,7 +61,7 @@ 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 (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index a21d369..9dc4dd7 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -63,7 +63,7 @@ foreach (example ${HDF_JAVA_OBJECT_EXAMPLES}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 90343b2..10d1b6d 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -57,7 +57,7 @@ SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED ${HDF5_JAVA_PACKAGE_SOVERSION}) if (WIN32) get_filename_component (HDF5_JAVA_JNI_DLL_NAME ${HDF5_JAVA_JNI_LIB_TARGET} NAME_WE) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) set (HDF5_JAVA_JNI_DLL_NAME "${HDF5_JAVA_JNI_DLL_NAME}_D") endif () # message (STATUS "HDF5_JAVA_JNI_DLL_NAME: ${HDF5_JAVA_JNI_DLL_NAME}") diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index fadc1ea..8912b3f 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -88,7 +88,7 @@ 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 (HDF5_BUILD_TYPE MATCHES Debug) +if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index a304485..fca2f27 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1133,7 +1133,7 @@ if (HDF5_TEST_VFD) 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 HDF5_BUILD_TYPE MATCHES Debug) + if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -- cgit v0.12 From 37318f109a294bb47e5040be5888963967c1badc Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Fri, 12 Jan 2018 14:36:03 -0600 Subject: Changes made based on code reviews. --- src/H5Aint.c | 17 +- src/H5Dint.c | 25 +- src/H5Dlayout.c | 19 +- src/H5F.c | 18 +- src/H5Fdeprec.c | 62 ++ src/H5Fint.c | 36 +- src/H5Fprivate.h | 1 + src/H5Fpublic.h | 3 +- src/H5Fquery.c | 11 +- src/H5Fsuper.c | 87 ++- src/H5Gobj.c | 12 +- src/H5Oattr.c | 2 + src/H5Ocopy.c | 6 + src/H5Odtype.c | 2 + src/H5Ofill.c | 22 +- src/H5Oint.c | 22 +- src/H5Olayout.c | 5 +- src/H5Opkg.h | 8 +- src/H5Opline.c | 19 +- src/H5Oprivate.h | 6 +- src/H5Osdspace.c | 2 + src/H5S.c | 15 +- src/H5T.c | 5 +- src/H5trace.c | 3 +- test/genall5.c | 8 +- test/mf.c | 10 +- test/tfile.c | 2236 +++++++++++++++++++++++++++++------------------------- 27 files changed, 1534 insertions(+), 1128 deletions(-) diff --git a/src/H5Aint.c b/src/H5Aint.c index 5c32e86..666f11d 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -1863,6 +1863,7 @@ herr_t H5A_set_version(const H5F_t *f, H5A_t *attr) { hbool_t type_shared, space_shared; /* Flags to indicate that shared messages are used for this attribute */ + uint8_t version; /* Message version */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1884,18 +1885,22 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) /* Check which version to encode attribute with */ if(attr->shared->encoding != H5T_CSET_ASCII) - attr->shared->version = H5O_ATTR_VERSION_3; /* Write version which includes the character encoding */ + version = H5O_ATTR_VERSION_3; /* Write version which includes the character encoding */ else if(type_shared || space_shared) - attr->shared->version = H5O_ATTR_VERSION_2; /* Write out version with flag for indicating shared datatype or dataspace */ + version = H5O_ATTR_VERSION_2; /* Write out version with flag for indicating shared datatype or dataspace */ else - attr->shared->version = H5O_ATTR_VERSION_1; /* Write out basic version */ + version = H5O_ATTR_VERSION_1; /* Write out basic version */ /* Upgrade to the version indicated by the file's low bound if higher */ - attr->shared->version = MAX(attr->shared->version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(attr->shared->version > H5O_attr_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_attr_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_ATTR, H5E_BADRANGE, FAIL, "attribute version out of bounds") + + /* Set the message version */ + attr->shared->version = version; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_set_version() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index c1a66ca..89dff1e 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -623,10 +623,10 @@ done: static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) { - htri_t relocatable; /* Flag whether the type is relocatable */ - htri_t immutable; /* Flag whether the type is immutable */ - hbool_t use_v18_latest_format; /* Flag indicating the 'latest datatype version support' is enabled */ - herr_t ret_value = SUCCEED; /* Return value */ + htri_t relocatable; /* Flag whether the type is relocatable */ + htri_t immutable; /* Flag whether the type is immutable */ + hbool_t use_at_least_v18; /* Flag indicating to use at least v18 format versions */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -643,10 +643,11 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) if((immutable = H5T_is_immutable(type)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't check datatype?") - use_v18_latest_format = (H5F_LOW_BOUND(file) >= H5F_LIBVER_V18); + /* To use at least v18 format versions or not */ + use_at_least_v18 = (H5F_LOW_BOUND(file) >= H5F_LIBVER_V18); /* Copy the datatype if it's a custom datatype or if it'll change when it's location is changed */ - if(!immutable || relocatable || use_v18_latest_format) { + if(!immutable || relocatable || use_at_least_v18) { /* Copy datatype for dataset */ if((dset->shared->type = H5T_copy(type, H5T_COPY_ALL)) == NULL) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy datatype") @@ -786,6 +787,7 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) H5D_fill_value_t fill_status; /* Fill value status */ hbool_t fill_changed = FALSE; /* Flag indicating the fill value was changed */ hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ + hbool_t use_at_least_v18; /* Flag indicating to use at least v18 format versions */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -800,6 +802,9 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) type = dset->shared->type; fill_prop = &dset->shared->dcpl_cache.fill; + /* To use at least v18 format versions or not */ + use_at_least_v18 = (H5F_LOW_BOUND(file) >= H5F_LIBVER_V18); + /* Retrieve "defined" status of fill value */ if(H5P_is_fill_value_defined(fill_prop, &fill_status) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't tell if fill value defined") @@ -878,8 +883,8 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update new fill value header message") /* If there is valid information for the old fill value struct, add it */ - /* (only if we aren't trying to write the 'latest fill message version support') */ - if(fill_prop->buf && (H5F_LOW_BOUND(file) < H5F_LIBVER_V18)) { + /* (only if we aren't using v18 format versions and above */ + if(fill_prop->buf && !use_at_least_v18) { H5O_fill_t old_fill_prop; /* Copy of fill value property, for writing as "old" fill value */ /* Shallow copy the fill value property */ @@ -931,10 +936,10 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) #endif /* H5O_ENABLE_BOGUS */ /* Add a modification time message, if using older format. */ - /* (If using the latest 'no modification time message' version support, the modification time is part of the object + /* (If using v18 format versions and above, the the modification time is part of the object * header and doesn't use a separate message -QAK) */ - if(H5F_LOW_BOUND(file) < H5F_LIBVER_V18) + if(!use_at_least_v18) if(H5O_touch_oh(file, dxpl_id, oh, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 5a4d537..980b810 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -46,9 +46,10 @@ /* Package Variables */ /*********************/ +/* Format version bounds for layout */ const unsigned H5O_layout_ver_bounds[] = { H5O_LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ - H5O_LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ /* H5O_LAYOUT_VERSION_DEFAULT */ H5O_LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; @@ -289,16 +290,15 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, January 15, 2009 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ herr_t H5D__layout_set_version(H5F_t *f, H5O_layout_t *layout) { - unsigned vers; - herr_t ret_value = SUCCEED; /* Return value */ + unsigned version; /* Message version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -307,12 +307,15 @@ H5D__layout_set_version(H5F_t *f, H5O_layout_t *layout) HDassert(f); /* Upgrade to the version indicated by the file's low bound if higher */ - layout->version = MAX(layout->version, H5O_layout_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(layout->version, H5O_layout_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(layout->version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "layout version out of bounds") + /* Set the message version */ + layout->version = version; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_set_version() */ diff --git a/src/H5F.c b/src/H5F.c index c670e17..8e5f65a 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1478,6 +1478,8 @@ 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->low_bound == H5F_LIBVER_V110) && (file->shared->high_bound == H5F_LIBVER_V110)); + /* Should not be marked for SWMR writing mode already */ if(file->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file already in SWMR writing mode") @@ -1739,9 +1741,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fset_libver_bounds (Internal library use) + * Function: H5Fset_libver_bounds * - * Purpose: Set .... the "latest format" flag while a file is open. + * Purpose: Set to a different low and high bounds while a file is open. + * This public routine is introduced in place of + * H5Fset_latest_format() starting release 1.10.2. + * See explanation for H5Fset_latest_format() in H5Fdeprec.c. * * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- @@ -1759,12 +1764,9 @@ H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high) if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID") - /* Call the flush routine, for this file */ - if(H5F__flush(f, 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") - - f->shared->low_bound = low; - f->shared->high_bound = high; + /* Call private set_libver_bounds function */ + if(H5F_set_libver_bounds(f, low, high) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds") done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 03f5df8..a9ffa43 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -143,5 +143,67 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Fget_info1() */ + +/*------------------------------------------------------------------------- + * Function: H5Fset_latest_format + * + * Purpose: Enable switching between latest or non-latest format while + * a file is open. + * This is deprecated starting release 1.10.2 and is modified + * to call the private H5F_set_libver_bounds() to set the + * bounds. + * + * Before release 1.10.2, the library supports only two + * combinations of low/high bounds: + * (earliest, latest) + * (latest, latest) + * Thus, this public routine does the job in switching + * between the two combinations listed above. + * + * Starting release 1.10.2, we add v18 to the enumerated + * define H5F_libver_t and the library supports five combinations + * as below: + * (earliest, v18) + * (earliest, v10) + * (v18, v18) + * (v18, v10) + * (v10, v10) + * So we introduce the new public routine H5Fset_libver_bounds() + * in place of H5Fset_latest_format(). + * See also RFC: Setting Bounds for Object Creation in HDF5 1.10.0. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi; December 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Fset_latest_format(hid_t file_id, hbool_t latest_format) +{ + H5F_t *f; /* File */ + H5F_libver_t low = H5F_LIBVER_LATEST; /* Low bound */ + H5F_libver_t high = H5F_LIBVER_LATEST; /* High bound */ + 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") + + /* 'low' and 'high' are both initialized to LATEST. + If latest format is not expected, set 'low' to EARLIEST */ + if(!latest_format) + low = H5F_LIBVER_EARLIEST; + + /* Call private set_libver_bounds function to set the bounds */ + if(H5F_set_libver_bounds(f, low, high) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Fset_latest_format() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Fint.c b/src/H5Fint.c index f223195..79f0d06 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -671,9 +671,9 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t 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") - /* File format version high bound does not allow the generation of metadata cache image */ + /* Format version high bound does not allow the generation of metadata cache image */ if(f->shared->mdc_initCacheImageCfg.generate_image && f->shared->high_bound < H5F_LIBVER_V110) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "file format version out of bound for cache image") + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "format version out of bound for cache image") /* Get the VFD values to cache */ f->shared->maxaddr = H5FD_get_maxaddr(lf); @@ -2313,6 +2313,38 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_store_msg_crt_idx() */ +/*------------------------------------------------------------------------- + * Function: H5F_set_libver_bounds() + * + * Purpose: Set the file's low and high bound to the input parameters + * 'low' and 'high' respectively. + * This is done only if the existing setting is different + * from the inputs. + * + * Return: SUCCEED on success, and FAIL on failure. + * + * Programmer: Vailin Choi; December 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_set_libver_bounds(H5F_t * f, H5F_libver_t low, H5F_libver_t high) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + + /* Set the bounds only if the existing setting is different from the inputs */ + if(f->shared->low_bound != low || f->shared->high_bound != high) { + f->shared->low_bound = low; + f->shared->high_bound = high; + } + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5F_set_libver_bounds() */ + /*------------------------------------------------------------------------- * Function: H5F_get_file_image diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 50325bb..ec98468 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -769,6 +769,7 @@ H5_DLL unsigned H5F_gc_ref(const H5F_t *f); H5_DLL unsigned H5F_use_latest_flags(const H5F_t *f, unsigned fl); H5_DLL hbool_t H5F_store_msg_crt_idx(const H5F_t *f); H5_DLL herr_t H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag); +H5_DLL herr_t H5F_set_libver_bounds(H5F_t * f, H5F_libver_t low, H5F_libver_t high); 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); diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 9364ee2..d333fa7 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -173,7 +173,7 @@ typedef struct H5F_sect_info_t { hsize_t size; /* Size of free space section */ } H5F_sect_info_t; -/* Library's file format versions */ +/* Library's format versions */ typedef enum H5F_libver_t { H5F_LIBVER_ERROR = -1, H5F_LIBVER_EARLIEST = 0, /* Use the earliest possible format for storing objects */ @@ -300,6 +300,7 @@ typedef struct H5F_info1_t { /* Function prototypes */ H5_DLL herr_t H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo); +H5_DLL herr_t H5Fset_latest_format(hid_t file_id, hbool_t latest_format); #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 6b641f1..5d7de9d 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -716,9 +716,14 @@ H5F_sieve_buf_size(const H5F_t *f) * Purpose: Replaced a macro to retrieve the "garbage collect * references flag" now that the generic properties are being used * to store the values. - e - * is returned. - * Failure: (should not happen) + * + * Return: Success: The "garbage collect references flag" is returned. + * Failure: (should not happen) + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Jul 8 2005 + * *------------------------------------------------------------------------- */ unsigned diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 4c12cb9..d30434d 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -457,23 +457,46 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, meta_dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags))) HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock") - /* Upgrade low bound to at least V18 when encountering version 2 superblock */ + /* + * When opening a file with SWMR-write access, the library will first + * check to ensure that superblock version 3 is used. Otherwise fail + * file open. + * + * Then the library will upgrade the file's low_bound depending on + * superblock version as follows: + * --version 0 or 1: no change to low_bound + * --version 2: upgrade low_bound to at least V18 + * --version 3: upgrade low_bound to at least V110 + * + * Upgrading low_bound will give the best format versions available for + * that superblock version. Due to the possible upgrade, the fapl returned + * from H5Fget_access_plist() might indicate a low_bound higher than what + * the user originally set. + * + * After upgrading low_bound, the library will check to ensure that the + * superblock version does not exceed the version allowed by high_bound. + * Otherise fail file open. + * + * For details, please see RFC:Setting Bounds for Object Creation in HDF5 1.10.0. + */ + + /* Check to ensure that superblock version 3 is used for SWMR-write access */ + if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) { + if(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version for SWMR is less than 3") + } + + /* Upgrade low_bound to at least V18 when encountering version 2 superblock */ if(sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2) f->shared->low_bound = MAX(H5F_LIBVER_V18, f->shared->low_bound); - /* Upgrade low bound to at least V110 when encountering version 3 superblock or SWMR_WRITE */ - if((sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) || (H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)) + /* Upgrade low_bound to at least V110 when encountering version 3 superblock */ + if(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) f->shared->low_bound = MAX(H5F_LIBVER_V110, f->shared->low_bound); - /* File bound check */ + /* Version bounds check */ if(sblock->super_vers > HDF5_superblock_ver_bounds[f->shared->high_bound]) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds (high bound)") - - /* SWMR requires at least superblock version 3 */ - if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) { - if(sblock->super_vers < HDF5_superblock_ver_bounds[f->shared->low_bound]) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds (low bound)") - } + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version exceeds high bound") /* Pin the superblock in the cache */ if(H5AC_pin_protected_entry(sblock) < 0) @@ -833,9 +856,9 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial hbool_t rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0); H5O_mdci_t mdci_msg; - /* Message exists but file format version high bound does not allow it */ + /* Message exists but version high bound does not allow it */ if(f->shared->high_bound < H5F_LIBVER_V110) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file format version out of bound for metadata cache image") + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "format version out of bound for metadata cache image") /* if the metadata cache image superblock extension message exists, * read its contents and pass the data on to the metadata cache. @@ -1037,6 +1060,36 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) non_default_fs_settings = TRUE; + /* + * When creating a file with write access, the library will: + * -- set superblock version to 0, 1 or 2 based on feature enabled + * -- no change to low_bound + * When creating a file with SWMR-write access, the library will: + * (See explanation (#) below.) + * -- set superblock version to 3 + * -- upgrade low_bound to at least V110 + * + * Then the library will finalize superblock version to that allowed by + * low_bound if that is higher. + * Lastly, the library will check to ensure the superblock version does not + * exceed the version allowed by high_bound. Otherwise fail file open. + * + * For details, please see RFC:Setting Bounds for Object Creation in HDF5 1.10.0. + * + * (#) + * Version 3 superblock is introduced in 1.10 for SWMR due to the problem of + * the status_flags field in the superblock. The problem is discussed in + * jira issue SWMR-79 and also in the RFC: File Format Changes in HDF5 1.10.0. + * The file's low_bound is upgraded for SWMR so that the library will + * use the best format versions available in 1.10. + * Due to the possible upgrade, the fapl returned from H5Fget_access_plist() + * might indicate a low_bound higher than what the user originally set. + */ + + /* + * Creating a file with SWMR-write access will + * upgrade superblock version and low_bound + */ if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) { super_vers = HDF5_SUPERBLOCK_VERSION_3; f->shared->low_bound = MAX(H5F_LIBVER_V110, f->shared->low_bound); @@ -1060,10 +1113,10 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) else if(sblock->btree_k[H5B_CHUNK_ID] != HDF5_BTREE_CHUNK_IK_DEF) super_vers = HDF5_SUPERBLOCK_VERSION_1; - /* Upgrade to the version indicated by the file's low bound if higher */ + /* Finalize superblock version to that allowed by the file's low bound if higher */ super_vers = MAX(super_vers, HDF5_superblock_ver_bounds[f->shared->low_bound]); - /* File bound check */ + /* Version bounds check */ if(super_vers > HDF5_superblock_ver_bounds[f->shared->high_bound]) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds") @@ -1091,8 +1144,8 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) /* Sanity check the userblock size vs. the file's allocation alignment */ if(userblock_size > 0) { - /* Set up the alignment to use for page or aggr fs */ - hsize_t alignment = H5F_PAGED_AGGR(f) ? f->shared->fs_page_size : f->shared->alignment; + /* Set up the alignment to use for page or aggr fs */ + hsize_t alignment = H5F_PAGED_AGGR(f) ? f->shared->fs_page_size : f->shared->alignment; if(userblock_size < alignment) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "userblock size must be > file object alignment") diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 832c9a7..5f9bdc8 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -185,7 +185,7 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { size_t hdr_size; /* Size of object header to request */ - hbool_t use_v18_latest_format; /* Flag indicating the new group format should be used */ + hbool_t use_at_least_v18; /* Flag indicating the new group format should be used */ hid_t gcpl_id = gcrt_info->gcpl_id; /* Group creation property list ID */ herr_t ret_value = SUCCEED; /* Return value */ @@ -204,12 +204,12 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "no write intent on file") - /* Check for using the latest version of the group format */ + /* Check for using the latest version of the group format which is introduced in v18 */ /* (add more checks for creating "new format" groups when needed) */ if((H5F_LOW_BOUND(f) >= H5F_LIBVER_V18) || linfo->track_corder || (pline && pline->nused)) - use_v18_latest_format = TRUE; + use_at_least_v18 = TRUE; else - use_v18_latest_format = FALSE; + use_at_least_v18 = FALSE; /* Make certain that the creation order is being tracked if an index is * going to be built on it. @@ -218,7 +218,7 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "must track creation order to create index for it") /* Check if we should be using the latest version of the group format */ - if(use_v18_latest_format) { + if(use_at_least_v18) { H5O_link_t lnk; /* Temporary link message info for computing message size */ char null_char = '\0'; /* Character for creating null string */ size_t ginfo_size; /* Size of the group info message */ @@ -264,7 +264,7 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") /* Check for format of group to create */ - if(use_v18_latest_format) { + if(use_at_least_v18) { /* Insert link info message */ /* (Casting away const OK - QAK) */ if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo, dxpl_id) < 0) diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 5c45e82..773a16b 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -635,6 +635,8 @@ H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ if(attr_src->shared->version > H5O_attr_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "attribute message version out of bounds") diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index aa26f05..74c02f4 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -416,6 +416,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, /* Initialize header information */ oh_dst->version = oh_src->version; + /* Version bounds check for destination object header */ if(oh_dst->version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(oloc_dst->file)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "destination object header version out of bounds") @@ -494,7 +495,12 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, /* Decode the message if necessary. */ H5O_LOAD_NATIVE(oloc_src->file, dxpl_id, 0, oh_src, mesg_src, FAIL) + /* Save destination file pointer in cpy_info so that it can be used + in the pre_copy_file callback to obtain the destination file's + high bound. The high bound is used to index into the corresponding + message's array of versions for doing version bounds check. */ cpy_info->file_dst = oloc_dst->file; + /* Perform "pre copy" operation on message */ if((copy_type->pre_copy_file)(oloc_src->file, mesg_src->native, &(deleted[mesgno]), cpy_info, cpy_udata) < 0) diff --git a/src/H5Odtype.c b/src/H5Odtype.c index f6331df..c51e31d 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -1531,6 +1531,8 @@ H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version as indicated by the destination file's high bound */ if(dt_src->shared->version > H5O_dtype_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "datatype message version out of bounds") diff --git a/src/H5Ofill.c b/src/H5Ofill.c index cf64594..6dc3064 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -156,7 +156,7 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ /* Format version bounds for fill value */ const unsigned H5O_fill_ver_bounds[] = { H5O_FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */ - H5O_FILL_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_FILL_VERSION_2, /* H5F_LIBVER_V18 */ H5O_FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; @@ -809,8 +809,7 @@ H5O_fill_free(void *fill) * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Friday, March 9, 2007 + * Programmer: Vailin Choi; Dec 2017 * *------------------------------------------------------------------------- */ @@ -827,6 +826,8 @@ H5O_fill_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ if(fill_src->version > H5O_fill_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "fill value message version out of bounds") @@ -1047,15 +1048,15 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, July 24, 2007 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ herr_t H5O_fill_set_version(H5F_t *f, H5O_fill_t *fill) { - herr_t ret_value = SUCCEED; /* Return value */ + unsigned version; /* Message version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1064,12 +1065,15 @@ H5O_fill_set_version(H5F_t *f, H5O_fill_t *fill) HDassert(fill); /* Upgrade to the version indicated by the file's low bound if higher */ - fill->version = MAX(fill->version, H5O_fill_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(fill->version, H5O_fill_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(fill->version > H5O_fill_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_fill_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "Filter pipeline version out of bounds") + /* Set the message version */ + fill->version = version; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_fill_set_version() */ diff --git a/src/H5Oint.c b/src/H5Oint.c index 0df7467..08eb28d 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -216,18 +216,17 @@ H5O__init_package(void) * Chooses the oldest version possible, unless the file's * low bound indicates otherwise. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jul 17 2007 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ static herr_t H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx) { + uint8_t version; /* Message version */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -238,17 +237,20 @@ H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx /* Set the correct version to encode object header with */ if(store_msg_crt_idx || (oh_flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)) - oh->version = H5O_VERSION_2; + version = H5O_VERSION_LATEST; else - oh->version = H5O_VERSION_1; + version = H5O_VERSION_1; /* Upgrade to the version indicated by the file's low bound if higher */ - oh->version = MAX(oh->version, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(version, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(oh->version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "object header version out of bounds") + /* Set the message version */ + oh->version = version; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_set_version() */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 3745f6d..85d7791 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -1055,8 +1055,7 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Friday, March 9, 2007 + * Programmer: Vailin Choi; Dec 2017 * *------------------------------------------------------------------------- */ @@ -1073,6 +1072,8 @@ H5O__layout_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ if(layout_src->version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "layout message version out of bounds") diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 13e0e3e..498938a 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -63,8 +63,8 @@ ) #define H5O_ALIGN_OH(O, X) \ H5O_ALIGN_VERS((O)->version, X) -#define H5O_ALIGN_F(F, X) \ - H5O_ALIGN_VERS(((H5F_LOW_BOUND(F) >= H5F_LIBVER_V18) ? H5O_VERSION_LATEST : H5O_VERSION_1), X) +#define H5O_ALIGN_F(F, X) \ + H5O_ALIGN_VERS(MAX(H5O_VERSION_1, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(F)]), X) /* Size of checksum (on disk) */ #define H5O_SIZEOF_CHKSUM 4 @@ -136,7 +136,7 @@ #define H5O_SIZEOF_MSGHDR_OH(O) \ H5O_SIZEOF_MSGHDR_VERS((O)->version, (O)->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) #define H5O_SIZEOF_MSGHDR_F(F, C) \ - H5O_SIZEOF_MSGHDR_VERS(((H5F_LOW_BOUND(F) >= H5F_LIBVER_V18) || H5F_STORE_MSG_CRT_IDX(F)) ? H5O_VERSION_LATEST : H5O_VERSION_1, (C)) + H5O_SIZEOF_MSGHDR_VERS(MAX((H5F_STORE_MSG_CRT_IDX(F) ? H5O_VERSION_LATEST : H5O_VERSION_1), (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(F)]), (C)) /* * Size of chunk "header" for each chunk @@ -641,6 +641,8 @@ H5_DLL herr_t H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg H5_DLL herr_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs); +/* Arrays of versions for: + Object header, Layout/Attribute/Datatype/Fill value/Filter pipeline/Dataspace messages */ H5_DLLVAR const unsigned H5O_obj_ver_bounds[H5F_LIBVER_NBOUNDS]; H5_DLLVAR const unsigned H5O_layout_ver_bounds[H5F_LIBVER_NBOUNDS]; H5_DLLVAR const unsigned H5O_attr_ver_bounds[H5F_LIBVER_NBOUNDS]; diff --git a/src/H5Opline.c b/src/H5Opline.c index ea913da..e817f9a 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -576,7 +576,7 @@ H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, { const H5O_pline_t *pline_src = (const H5O_pline_t *)mesg_src; /* Source pline */ H5O_copy_file_ud_common_t *udata = (H5O_copy_file_ud_common_t *)_udata; /* Object copying user data */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -585,6 +585,8 @@ H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ if(pline_src->version > H5O_pline_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "pline message version out of bounds") @@ -681,15 +683,15 @@ H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, July 24, 2007 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ herr_t H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline) { - herr_t ret_value = SUCCEED; /* Return value */ + unsigned version; /* Message version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -698,12 +700,15 @@ H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline) HDassert(pline); /* Upgrade to the version indicated by the file's low bound if higher */ - pline->version = MAX(pline->version, H5O_pline_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(pline->version, H5O_pline_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(pline->version > H5O_pline_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_pline_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_PLINE, H5E_BADRANGE, FAIL, "Filter pipeline version out of bounds") + /* Set the message version */ + pline->version = version; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_pline_set_version() */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 5cf9dce..2253bb2 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -178,7 +178,11 @@ typedef struct H5O_copy_t { 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 */ H5F_t *file_dst; /* The destination file pointer */ - void *shared_fo; /* The shared pointer for the object */ + /* This is used in the pre_copy_file callback to obtain + the destination file's high bound. The high bound + is used to index into the corresponding message's + array of versions for doing version bounds check. */ + void *shared_fo; /* The shared pointer for the src 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/src/H5Osdspace.c b/src/H5Osdspace.c index 9a9d020..12a9bb6 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -455,6 +455,8 @@ H5O_sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ if(src_space_extent->version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "dataspace message version out of bounds") diff --git a/src/H5S.c b/src/H5S.c index 8046357..8f3e132 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -2180,15 +2180,15 @@ H5S_extent_nelem(const H5S_extent_t *ext) * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, July 24, 2007 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ herr_t H5S_set_version(H5F_t *f, H5S_t *ds) { - herr_t ret_value = SUCCEED; /* Return value */ + unsigned version; /* Message version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2197,12 +2197,15 @@ H5S_set_version(H5F_t *f, H5S_t *ds) HDassert(ds); /* Upgrade to the version indicated by the file's low bound if higher */ - ds->extent.version = MAX(ds->extent.version, H5O_sdspace_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(ds->extent.version, H5O_sdspace_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(ds->extent.version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "Dataspace version out of bounds") + /* Set the message version */ + ds->extent.version = version; + done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5T.c b/src/H5T.c index aa61358..eca0132 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -5418,8 +5418,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, July 19, 2007 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ @@ -5442,7 +5441,7 @@ H5T_set_version(H5F_t *f, H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade datatype encoding") } - /* File bound check */ + /* Version bounds check */ if(dt->shared->version > H5O_dtype_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_DATATYPE, H5E_BADRANGE, FAIL, "Datatype version out of bounds") diff --git a/src/H5trace.c b/src/H5trace.c index 5f8ccd1..b1f05ba 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -1021,7 +1021,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "H5F_LIBVER_V18"); break; - case H5F_LIBVER_LATEST: + case H5F_LIBVER_V110: + HDassert(H5F_LIBVER_LATEST == H5F_LIBVER_V110); fprintf(out, "H5F_LIBVER_LATEST"); break; diff --git a/test/genall5.c b/test/genall5.c index 0ac1515..e3a9c96 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -1264,7 +1264,7 @@ os_grp_0(hid_t fid, const char *group_name) HDassert(fapl > 0); } - if ( pass ) { /* get libver_bounds from fapl */ + if ( pass ) { /* get low and high bounds from fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); if ( ret < 0 ) { @@ -1312,7 +1312,7 @@ os_grp_0(hid_t fid, const char *group_name) HDassert(ret >= 0); } - if ( pass ) { /* restore libver_bounds */ + if ( pass ) { /* restore low and high bounds */ if(low >= H5F_LIBVER_V18) { ret = H5Fset_libver_bounds(fid, low, high); @@ -1504,7 +1504,7 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) HDassert(fapl > 0); } - if ( pass ) { /* get libver_bounds from fapl */ + if ( pass ) { /* get low and high bounds from fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); if ( ret < 0 ) { @@ -1590,7 +1590,7 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) assert(ret >= 0); } - if ( pass ) { /* restore libver_bounds */ + if ( pass ) { /* restore low and high bounds */ if(low >= H5F_LIBVER_V18) { ret = H5Fset_libver_bounds(fid, low, high); diff --git a/test/mf.c b/test/mf.c index 289f04a..35dfab3 100644 --- a/test/mf.c +++ b/test/mf.c @@ -6920,6 +6920,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) H5FD_mem_t type; /* File allocation type */ H5FS_stat_t fs_stat; /* Information for free-space manager */ haddr_t addr1, addr2, addr3, addr4; /* File address for H5FD_MEM_SUPER */ + haddr_t addrx; H5FD_mem_t fs_type; hbool_t contig_addr_vfd; hbool_t ran_H5MF_tidy_self_referential_fsm_hack = FALSE; @@ -7054,6 +7055,12 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE4) < 0) FAIL_STACK_ERROR + if(!new_format) { + /* Need to take up this space so that the free-space manager will go away */ + if(HADDR_UNDEF == (addrx = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)103))) + FAIL_STACK_ERROR + } + /* The H5FD_MEM_SUPER free-space manager will go away at H5MF_close() */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -7065,7 +7072,6 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR - /* Verify that the H5FD_MEM_SUPER free-space manager is not there */ if(H5F_addr_defined(f->shared->fs_addr[fs_type])) TEST_ERROR @@ -8936,9 +8942,7 @@ main(void) /* Temporary: modify to skip testing for multi/split driver: fail file create when persisting free-space or using paged aggregation strategy */ -#ifdef OUT /* Will take a close look at this later */ nerrors += test_mf_fs_gone(env_h5_drvr, fapl, FALSE); -#endif nerrors += test_mf_fs_gone(env_h5_drvr, fapl, TRUE); /* Temporary: modify to skip testing multi/split driver: diff --git a/test/tfile.c b/test/tfile.c index 653fd12..03a5233 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -44,8 +44,11 @@ #define H5T_FRIEND /*suppress error about including H5Tpkg */ #include "H5Tpkg.h" /* Datatype */ -#define H5A_FRIEND /*suppress error about including H5Apkg */ -#include "H5Apkg.h" /* Attributes */ +#define H5A_FRIEND /*suppress error about including H5Apkg */ +#include "H5Apkg.h" /* Attributes */ + +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#include "H5Opkg.h" /* Object headers */ #define BAD_USERBLOCK_SIZE1 (hsize_t)1 #define BAD_USERBLOCK_SIZE2 (hsize_t)2 @@ -164,73 +167,19 @@ const char *FILESPACE_NAME[] = { NULL }; -/* - * Declarations for test_libver_bounds_low_high() and its associated functions: - * test_libver_bounds_super(), test_libver_bounds_super_create(), test_libver_bounds_super_open(), - * test_libver_bounds_obj(), - * test_libver_bounds_dataset(), - * test_libver_bounds_dataspace(), - * test_libver_bounds_datatype_check(), test_libver_bounds_datatype() - * test_libver_bounds_attributes() - */ -#define FILE8 "tfile8.h5" /* Test file */ - -/* See HDF5_SUPERBLOCK* versions in H5Fprivate.h */ -#define SUPERBLOCK_VERSION_3 3 - -/* See H5O* versions in H5Opkg.h */ -#define OBJ_VERSION_1 1 -#define OBJ_VERSION_2 2 -#define OBJ_VERSION_LATEST OBJ_VERSION_2 - -/* These should be in sync with H5O_obj_ver_bounds[] in H5O.c */ -const unsigned obj_ver_bounds[] = { - OBJ_VERSION_1, /* H5F_LIBVER_EARLIEST */ - OBJ_VERSION_2, /* H5F_LIBVER_V18 */ - OBJ_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; - -/* See H5O_LAYOUT* versions in H5Oprivate.h */ -/* The library defines LAYOUT_VERSION_3 as the default--see H5Pdcpl.c */ -#define LAYOUT_VERSION_1 1 -#define LAYOUT_VERSION_3 3 -#define LAYOUT_VERSION_4 4 -#define LAYOUT_VERSION_DEFAULT LAYOUT_VERSION_3 -#define LAYOUT_VERSION_LATEST LAYOUT_VERSION_4 - -/* These should be in sync with H5O_layout_ver_bounds[] in H5Dlayout.c */ -const unsigned layout_ver_bounds[] = { - LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ - LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ - LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; - -/* See H5O_PLINE* versions in H5Oprivate.h */ -#define PLINE_VERSION_1 1 -#define PLINE_VERSION_2 2 -#define PLINE_VERSION_LATEST H5O_PLINE_VERSION_2 - -/* These should be in sync with H5O_pline_ver_bounds[] in H5Opline.c */ -const unsigned pline_ver_bounds[] = { - PLINE_VERSION_1, /* H5F_LIBVER_EARLIEST */ - PLINE_VERSION_2, /* H5F_LIBVER_V18 */ - PLINE_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; +/* Local test function declarations for version bounds */ +static void test_libver_bounds_low_high(void); +static void test_libver_bounds_super(hid_t fapl); +static void test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr); +static void test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr); +static void test_libver_bounds_obj(hid_t fapl); +static void test_libver_bounds_dataset(hid_t fapl); +static void test_libver_bounds_dataspace(hid_t fapl); +static void test_libver_bounds_datatype(hid_t fapl); +static void test_libver_bounds_datatype_check(hid_t fapl, hid_t tid); +static void test_libver_bounds_attributes(hid_t fapl); -/* See H5O_FILL* versions in H5Oprivate.h */ -/* FILL_VERSION_2 is the default--see H5Pdcpl.c */ -#define FILL_VERSION_1 1 -#define FILL_VERSION_2 2 -#define FILL_VERSION_3 3 -#define FILL_VERSION_DEFAULT FILL_VERSION_2 -#define FILL_VERSION_LATEST H5O_FILL_VERSION_3 - -/* These should be in sync with H5O_fill_ver_bounds[] in H5Ofill.c */ -const unsigned fill_ver_bounds[] = { - FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */ - FILL_VERSION_3, /* H5F_LIBVER_V18 */ - FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; +#define FILE8 "tfile8.h5" /* Test file */ #define DSET_NULL "DSET_NULL" #define DSET "DSET" @@ -238,44 +187,6 @@ const unsigned fill_ver_bounds[] = { #define DSETB "DSETB" #define DSETC "DSETC" -/* See H5O_SDSPACE* versions in H5Spkg.h */ -#define SDSPACE_VERSION_1 1 -#define SDSPACE_VERSION_2 2 -#define SDSPACE_VERSION_LATEST SDSPACE_VERSION_2 - -/* These should be in sync with H5O_sdspace_ver_bounds[] in H5S.c */ -const unsigned sdspace_ver_bounds[] = { - SDSPACE_VERSION_1, /* H5F_LIBVER_EARLIEST */ - SDSPACE_VERSION_2, /* H5F_LIBVER_V18 */ - SDSPACE_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; - -/* See H5O_DTYPE* versions in H5Tpkg.h */ -#define DTYPE_VERSION_1 1 -#define DTYPE_VERSION_2 2 -#define DTYPE_VERSION_3 3 -#define DTYPE_VERSION_LATEST DTYPE_VERSION_3 - -/* These should be in sync with H5O_dtype_ver_bounds[] in H5T.c */ -const unsigned dtype_ver_bounds[] = { - DTYPE_VERSION_1, /* H5F_LIBVER_EARLIEST */ - DTYPE_VERSION_3, /* H5F_LIBVER_V18 */ - DTYPE_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; - -/* See H5O_ATTR* versions in H5Apkg.h */ -#define ATTR_VERSION_1 1 -#define ATTR_VERSION_2 2 -#define ATTR_VERSION_3 3 -#define ATTR_VERSION_LATEST ATTR_VERSION_3 - -/* These should be in sync with H5O_attr_ver_bounds[] in H5Aint.c */ -const unsigned attr_ver_bounds[] = { - ATTR_VERSION_1, /* H5F_LIBVER_EARLIEST */ - ATTR_VERSION_3, /* H5F_LIBVER_V18 */ - ATTR_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; - static void create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *); static void @@ -2259,7 +2170,7 @@ test_file_double_file_dataset_open(hbool_t new_format) /* Create a chunked dataset with fixed array indexing */ sid1 = H5Screate_simple(1, dims, max_dims0); - CHECK(sid1, FAIL, "H5Screate"); + CHECK(sid1, FAIL, "H5Screate_simple"); tid1 = H5Tcopy(H5T_C_S1); CHECK(tid1, FAIL, "H5Tcopy"); ret = H5Tset_size(tid1, H5T_VARIABLE); @@ -2285,7 +2196,7 @@ test_file_double_file_dataset_open(hbool_t new_format) /* Create a chunked dataset with extensible array indexing */ sid1 = H5Screate_simple(1, dims, max_dims1); - CHECK(sid1, FAIL, "H5Screate"); + CHECK(sid1, FAIL, "H5Screate_simple"); tid1 = H5Tcopy(H5T_C_S1); CHECK(tid1, FAIL, "H5Tcopy"); ret = H5Tset_size(tid1, H5T_VARIABLE); @@ -2314,7 +2225,7 @@ test_file_double_file_dataset_open(hbool_t new_format) /* Create a chunked dataset with v2 btree indexing */ sid2 = H5Screate_simple(2, dims2, max_dims2); - CHECK(sid2, FAIL, "H5Screate"); + CHECK(sid2, FAIL, "H5Screate_simple"); dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); @@ -5008,8 +4919,8 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, CHECK(group, FAIL, "H5Gcreate"); ret = H5Oget_info(group, &oinfo); - CHECK(ret, FAIL, "H5Oget_info_by_name"); - VERIFY(oinfo.hdr.version, oh_vers_mod, "H5Oget_info_by_name"); + CHECK(ret, FAIL, "H5Oget_info"); + VERIFY(oinfo.hdr.version, oh_vers_mod, "H5Oget_info"); ret = H5Gclose(group); CHECK(ret, FAIL, "H5Gclose"); @@ -5061,252 +4972,472 @@ test_libver_bounds(void) test_libver_bounds_real(H5F_LIBVER_LATEST, 2, H5F_LIBVER_EARLIEST, 2); } /* end test_libver_bounds() */ -/**************************************************************** +/************************************************************************************** ** -** test_libver_bounds_attributes(): -** Verify the attribute versions. +** test_libver_bounds_low_high(): +** Tests to verify that format versions are correct with the following five +** pairs of low/high version bounds set in fapl via H5Pset_libver_bounds(): +** (1) (earliest, v18) +** (2) (earliest, v110) +** (3) (v18, v18) +** (4) (v18, v110) +** (5) (v110, v110) ** -****************************************************************/ +** For each pair of setting in fapl, verify format versions with the following +** six tests: +** (1) test_libver_bounds_super(fapl): superblock versions +** (2) test_libver_bounds_obj(fapl): object header versions +** (3) test_libver_bounds_dataset(fapl): message versions associated with dataset +** (4) test_libver_bounds_dataspace(fapl): dataspace message versions +** (5) test_libver_bounds_datatype(fapl): datatype message versions +** (6) test_libver_bounds_attributes(fapl): attribute message versions +** +**************************************************************************************/ static void -test_libver_bounds_attributes(hid_t fapl) +test_libver_bounds_low_high(void) { - hid_t fid; /* File ID */ - hid_t fcpl; /* File creation property list */ - hid_t new_fapl; /* File access property list */ - hid_t did; /* Dataset ID */ - hid_t tid; /* Datatype ID */ - hid_t gid; /* Group ID */ - hid_t sid; /* Dataspace ID */ - hid_t aid; /* Attribute ID */ - hid_t attr_cpl; /* Attribute creation property list */ - H5A_t *attr; /* Internal attribute pointer */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - herr_t ret; /* Return value */ - - /* Retrieve the library format bounds */ - ret = H5Pget_libver_bounds(fapl, &low, &high); - CHECK(ret, FAIL, "H5Pget_libver_bounds"); - - /* Create the file */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - CHECK(fid, FAIL, "H5Fcreate"); - - /* Integer datatpye */ - tid = H5Tcopy(H5T_NATIVE_INT); - CHECK(tid, FAIL, "H5Tcopy"); - - /* Create a committed datatype */ - ret = H5Tcommit2(fid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Tcommit2"); + hid_t fapl = -1; /* File access property list */ + H5F_libver_t low, high; /* Low and high bounds */ + herr_t ret; /* The return value */ - /* Create dataspace */ - sid = H5Screate(H5S_SCALAR); - CHECK(sid, FAIL, "H5Screate"); - - /* Create a group */ - gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(gid, FAIL, "H5Gcreate2"); + /* Output message about test being performed */ + MESSAGE(5, ("Testing setting (low, high) format version bounds\n")); - /* Create an attribute to the group with the committed datatype */ - aid = H5Acreate2(gid, "attr1", tid, sid, H5P_DEFAULT, H5P_DEFAULT); - CHECK(aid, FAIL, "H5Acreate2"); + /* Create a file access property list */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); - /* Get the internal attribute pointer */ - attr = (H5A_t *)H5I_object(aid); - CHECK(attr, NULL, "H5I_object"); + /* Loop through all the combinations of low/high version bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + H5E_BEGIN_TRY { + /* Set the low/high version bounds */ + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; - /* Verify the attribute version */ - if(low == H5F_LIBVER_EARLIEST) - VERIFY(attr->shared->version, ATTR_VERSION_2, "attr_ver_bounds"); - else - VERIFY(attr->shared->version, attr_ver_bounds[low], "attr_ver_bounds"); + /* Should fail: invalid combinations */ + if(high == H5F_LIBVER_EARLIEST) { + VERIFY(ret, FAIL, "H5Pset_libver_bounds"); + continue; + } - /* Close the attribute */ - ret = H5Aclose(aid); - CHECK(ret, FAIL, "H5Aclose"); + /* Should fail: invalid combinations */ + if(high < low) { + VERIFY(ret, FAIL, "H5Pset_libver_bounds"); + continue; + } - /* Create an attribute to the group with integer type */ - aid = H5Acreate2(gid, "attr2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); - CHECK(aid, FAIL, "H5Acreate2"); + /* All other combinations are valid and should succeed */ + VERIFY(ret, SUCCEED, "H5Pset_libver_bounds"); - /* Get the internal attribute pointer */ - attr = (H5A_t *)H5I_object(aid); - CHECK(attr, NULL, "H5I_object"); + /* Tests to verify version bounds */ + test_libver_bounds_super(fapl); + test_libver_bounds_obj(fapl); + test_libver_bounds_dataset(fapl); + test_libver_bounds_dataspace(fapl); + test_libver_bounds_datatype(fapl); + test_libver_bounds_attributes(fapl); + } - /* Verify attribute version */ - VERIFY(attr->shared->version, attr_ver_bounds[low], "attr_ver_bounds"); + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); - /* Close the attribute */ - ret = H5Aclose(aid); - CHECK(ret, FAIL, "H5Aclose"); +} /* end test_libver_bounds_low_high() */ - /* Enable character encoding in attribute creation property list */ - attr_cpl = H5Pcreate(H5P_ATTRIBUTE_CREATE); - CHECK(attr_cpl, FAIL, "H5Pcreate"); - ret = H5Pset_char_encoding(attr_cpl, H5T_CSET_UTF8); - CHECK(ret, FAIL, "H5Pset_char_encoding"); - /* Create an attribute to the group with character encoding set */ - aid = H5Acreate2(gid, "attr3", H5T_NATIVE_INT, sid, attr_cpl, H5P_DEFAULT); - CHECK(aid, FAIL, "H5Acreate2"); +/*********************************************************************** +** +** test_libver_bounds_super(): +** Verify superblock version with the following two tests: +** (1) test_libver_bounds_super_create(): +** --when creating a file with the input fapl and the fcpl +** that has the following feature enabled: +** (A) default fcpl +** (B) fcpl with v1-btee K value enabled +** (C) fcpl with shared messages enabled +** (D) fcpl with persistent free-space manager enabled +** +** (2) test_libver_bounds_super_open(): +** --when opening a file which is created with the input fapl +** and the fcpl setting as #A to #D above. +** +** These two tests are run with or without SWMR file access. +** +*************************************************************************/ +static void +test_libver_bounds_super(hid_t fapl) +{ + hid_t fcpl = -1; /* File creation property list */ + herr_t ret; /* The return value */ - /* Get internal attribute pointer */ - attr = (H5A_t *)H5I_object(aid); - CHECK(attr, NULL, "H5I_object"); + /* Create a default fcpl: #A */ + /* This will result in superblock version 0 */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); - /* Verify attribute version */ - if(low == H5F_LIBVER_EARLIEST) - VERIFY(attr->shared->version, ATTR_VERSION_3, "attr_ver_bounds"); - else - VERIFY(attr->shared->version, attr_ver_bounds[low], "attr_ver_bounds"); + /* Verify superblock version when creating a file with input fapl, + fcpl #A and with/without SWMR access */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); - /* Close the attribute */ - ret = H5Aclose(aid); - CHECK(ret, FAIL, "H5Aclose"); + /* Verify superblock version when opening a file which is created + with input fapl, fcpl #A and with/without SWMR access */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); - /* Close the attribute creation property list */ - ret = H5Pclose(attr_cpl); + /* Close the fcpl */ + ret = H5Pclose(fcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Close the group */ - ret = H5Gclose(gid); - CHECK(ret, FAIL, "H5Gclose"); + /* Create a fcpl with v1-btree K value enabled: #B */ + /* This will result in superblock version 1 */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + ret = H5Pset_istore_k(fcpl, 64); + CHECK(ret, FAIL, "H5Pset_istore_k"); - /* Close the dataspace */ - ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Sclose"); + /* Verify superblock version when creating a file with input fapl, + fcpl #B and with/without SWMR access */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); - /* Close the datatype */ - ret = H5Tclose(tid); - CHECK(ret, FAIL, "H5Tclose"); + /* Verify superblock version when opening a file which is created + with input fapl, fcpl #B and with/without SWMR access */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the fcpl */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Create a copy of the file creation property list */ + /* Create a fcpl with shared messages enabled: #C */ + /* This will result in superblock version 2 */ fcpl = H5Pcreate(H5P_FILE_CREATE); CHECK(fcpl, FAIL, "H5Pcreate"); - - /* Enable shared datatype message */ ret = H5Pset_shared_mesg_nindexes(fcpl, 1); CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); - ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 2); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - /* Create the file with shared datatype message enabled */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); - CHECK(fid, FAIL, "H5Fcreate"); - - /* Integer datatye */ - tid = H5Tcopy(H5T_NATIVE_INT); - CHECK(tid, FAIL, "H5Tcopy"); + /* Verify superblock version when creating a file with input fapl, + fcpl #C and with/without SWMR access */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); - /* Create dataspace */ - sid = H5Screate(H5S_SCALAR); - CHECK(sid, FAIL, "H5Screate"); + /* Verify superblock version when opening a file which is created + with input fapl, fcpl #C and with/without SWMR access */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); - /* Create a group */ - gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(gid, FAIL, "H5Gcreate2"); + /* Close the fcpl */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Create an attribute to the group with integer datatype */ - aid = H5Acreate2(gid, ATTR_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - CHECK(aid, FAIL, "H5Acreate2"); + /* Create a fcpl with persistent free-space manager enabled: #D */ + /* This will result in superblock version 2 */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0); + CHECK(ret, FAIL, "H5Pset_file_space"); - /* Get the internal attribute pointer */ - attr = (H5A_t *)H5I_object(aid); - CHECK(attr, NULL, "H5I_object"); + /* Verify superblock version when creating a file with input fapl, + fcpl #D and with/without SWMR access */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); - /* Verify the attribute version */ - if(low == H5F_LIBVER_EARLIEST) - VERIFY(attr->shared->version, ATTR_VERSION_2, "attr_ver_bounds"); - else - VERIFY(attr->shared->version, attr_ver_bounds[low], "attr_ver_bounds"); + /* Verify superblock version when opening a file which is created + with input fapl, fcpl #D and with/without SWMR access */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); - /* Close the attribute */ - ret = H5Aclose(aid); - CHECK(ret, FAIL, "H5Aclose"); + /* Close the fcpl */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Close the group */ - ret = H5Gclose(gid); - CHECK(ret, FAIL, "H5Gclose"); +} /* end test_libver_bounds_super() */ - /* Close the dataspace */ - ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Sclose"); - /* Close the datatype */ - ret = H5Tclose(tid); - CHECK(ret, FAIL, "H5Tclose"); +/************************************************************************************************** +** +** test_libver_bounds_super_create(): +** Verify the following when the file is created with the input fapl, fcpl, and +** with/without SWMR access: +** (a) the superblock version # +** (b) the file's low bound setting +** (c) fail or succeed in creating the file +** +** For file creation, the bounds setting in fapl, the feature enabled in fcpl, +** and with/without SWMR file access will determine the results for #a to #c. +** +** The first row for the following two tables is the 5 pairs of low/high bounds setting +** in the input fapl. The next three rows list the expected results for #a to #c. +** "-->" indicates "upgrade to" +** +** Creating a file with write access +** -------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) | +** |______________________________________________________________________________| +** Superblock version | vers 0, 1, 2 | vers 0, 1, 2 | vers 2 | vers 2 | vers 3 | +** |------------------------------------------------------------------------------| +** File's low bound | no change | +** |------------------------------------------------------------------------------| +** File creation | succeed | +** |______________________________________________________________________________| +** +** Creating a file with SWMR-write access +** -------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) | +** |______________________________________________________________________________| +** Superblock version | -- | vers 3 | -- | vers 3 | vers 3 | +** |------------------------------------------------------------------------------| +** File's low bound | -- | ->v110 | -- | ->v110 | no change | +** |------------------------------------------------------------------------------| +** File creation | fail | succeed | fail | succeed | succed | +** |______________________________________________________________________________| +** +******************************************************************************************************/ +static void +test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) +{ + hid_t fid = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* The return value */ - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Try to create the file */ + H5E_BEGIN_TRY { + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), fcpl, fapl); + } H5E_END_TRY; - /* Create a copy of the file access property list */ - new_fapl = H5Pcreate(H5P_FILE_ACCESS); - CHECK(new_fapl, FAIL, "H5Pcreate"); + /* Get the internal file pointer if the create succeeds */ + if((ok = fid >= 0)) { + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + } - /* Create the dataspace */ - sid = H5Screate(H5S_SCALAR); - CHECK(sid, FAIL, "H5Screate"); + /* Retrieve the low/high bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); - /* Loop through all the combinations of low/high library format bounds */ - /* Open the file and group and attach an attribute to the group */ - /* Verify the attribute version */ - for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { - for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - H5E_BEGIN_TRY { - ret = H5Pset_libver_bounds(new_fapl, low, high); - } H5E_END_TRY; + if(is_swmr) { /* SWMR is enabled */ - if(ret < 0) /* Invalid low/high combinations */ - continue; + if(high == H5F_LIBVER_LATEST) { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(HDF5_SUPERBLOCK_VERSION_3, f->shared->sblock->super_vers, "HDF5_superblock_ver_bounds"); + VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds"); - /* Open the file */ + } else /* Should fail */ + VERIFY(ok, FALSE, "H5Fcreate"); + + } else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds"); + + switch(low) { + case H5F_LIBVER_EARLIEST: + ok = (f->shared->sblock->super_vers == 0 || + f->shared->sblock->super_vers == 1 || + f->shared->sblock->super_vers == 2); + VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); + break; + + case H5F_LIBVER_V18: + ok = (f->shared->sblock->super_vers == 2); + VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); + break; + + case H5F_LIBVER_V110: + ok = (f->shared->sblock->super_vers == 3); + VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); + break; + + case H5F_LIBVER_ERROR: + case H5F_LIBVER_NBOUNDS: + default: + ERROR("H5Pget_libver_bounds"); + + } /* end switch */ + } + + if(ok) { /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + +} /* end test_libver_bounds_super_create() */ + +/************************************************************************************************** +** +** test_libver_bounds_super_open(): +** Verify the following when opening a file which is created with the input fapl, fcpl, +** and with/without SWMR access: +** (a) the file's low bound setting +** (b) fail or succeed in opening the file +** +** (1) Create a file with the input fapl, fcpl and with/without SWMR access +** (2) Close the file +** (3) Reopen the file with a new fapl that is set to the 5 pairs of low/high bounds +** in a for loop. For each pair of setting in the new fapl: +** --Verify the expected results for #a and #b above. +** --Close the file. +** +** For file open, the file's superblock version, the low/high bounds setting in fapl, +** and with/without SWMR file access will determine the results for #a and #b. +** +** The first row for the following tables is the 5 pairs of low/high bounds setting +** in the input fapl. The next two rows list the expected results for #a and #b. +** "-->" indicates "upgrade to" +** +** Opening a file with write access +** +** Superblock version 0, 1 +** -------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) | +** |______________________________________________________________________________| +** File's low bound | no change | +** |------------------------------------------------------------------------------| +** File open | succeed | +** |______________________________________________________________________________| +** +** +** Superblock version 2 +** -------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) | +** |______________________________________________________________________________| +** File's low bound | -->v18 | no change | +** |------------------------------------------------------------------------------| +** File open | succeed | +** |______________________________________________________________________________| +** +** Superblock version 3 +** -------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) | +** |______________________________________________________________________________| +** File's low bound | -- | -->v110 | -- | -->v110 | no change | +** |------------------------------------------------------------------------------| +** File open | fail | succeed | fail | succeed | succeed | +** |______________________________________________________________________________| +** +** +** +** Opening a file with SWMR-write access +** +** Superblock version 0, 1, 2 +** ------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v10) | (v18, v18) | (v18, v110) | (v110, v110) | +** |_____________________________________________________________________________| +** File's low bound | ---- +** |-----------------------------------------------------------------------------| +** File open | fail +** |_____________________________________________________________________________| +** +** +** Superblock version 3 +** ------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v10) | (v18, v18) | (v18, v110) | (v110, v110) | +** |_____________________________________________________________________________| +** File's low bound | -- | -->v110 | -- | -->v110 | no change | +** |-----------------------------------------------------------------------------| +** File open | fail | succeed | fail | succeed | succeed | +** |_____________________________________________________________________________| +** +** +******************************************************************************************************/ +static void +test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) +{ + hid_t fid = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file pointer */ + hid_t new_fapl = -1; /* File access property list */ + unsigned super_vers; /* Superblock version */ + H5F_libver_t low, high; /* Low and high bounds */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* Return value */ + + /* Create the file with the input fcpl and fapl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* The file's superblock version */ + super_vers = f->shared->sblock->super_vers; + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a default file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Loop through all the combinations of low/high bounds in new_fapl */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { H5E_BEGIN_TRY { - fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + ret = H5Pset_libver_bounds(new_fapl, low, high); } H5E_END_TRY; - if(fid >=0 ) { /* The file open succeeds */ - - /* Get the internal file pointer */ - f = (H5F_t *)H5I_object(fid); - CHECK(f, NULL, "H5I_object"); + /* Invalid combinations */ + if (ret < 0) + continue; - /* Open the group */ - gid = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT); - CHECK(gid, FAIL, "H5Dcreate2"); + /* Open the file with or without SWMR access */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl); + } H5E_END_TRY; + ok = fid >= 0; - /* Create an attribute to the group */ - aid = H5Acreate2(gid, "attr1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); - CHECK(aid, FAIL, "H5Acreate2"); + /* Verify the file open succeeds or fails */ + switch(super_vers) { + case 3: + if(high == H5F_LIBVER_LATEST) { + /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); + VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds"); - /* Get the internal attribute pointer */ - attr = (H5A_t *)H5I_object(aid); - CHECK(attr, NULL, "H5I_object"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } else /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + break; - VERIFY(attr->shared->version, attr_ver_bounds[f->shared->low_bound], "attr_ver_bounds"); + case 2: + if(is_swmr) /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); - /* Close the attribute */ - ret = H5Aclose(aid); - CHECK(ret, FAIL, "H5Aclose"); + ok = f->shared->low_bound >= H5F_LIBVER_V18; + VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); - /* Delete the attribute */ - ret = H5Adelete(gid, "attr1"); - CHECK(ret, FAIL, "H5Ldelete"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + break; - /* Close the group */ - ret = H5Gclose(gid); - CHECK(ret, FAIL, "H5Gclose"); + case 1: + case 0: + if(is_swmr) /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); + VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + break; - } /* end if */ + default: + break; + } /* end switch */ } /* end for */ } /* end for */ @@ -5314,126 +5445,111 @@ test_libver_bounds_attributes(hid_t fapl) ret = H5Pclose(new_fapl); CHECK(ret, FAIL, "H5Pclose"); - /* Close the dataspace */ - ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Sclose"); - -} /* end test_libver_bounds_attributes() */ +} /* end test_libver_bounds_super_open() */ /**************************************************************** ** -** test_libver_bounds_datatype(): -** Verify the datatype message versions for parameter "tid". +** test_libver_bounds_obj(): +** Verify object header versions: +** +** (a) Create a file with: +** --the input fapl +** --a fcpl that has shared message enabled +** Verify the root group's object header version. +** Close the file. +** +** (b) Create another file with: +** --the input fapl +** --a default fcpl +** Verify the root group's object header version. +** Close the file. +** +** (c) Reopen the same file in (b) with a new fapl. +** The new fapl is set to the 5 pairs of low/high +** bounds in a "for" loop. For each setting in fapl: +** --Create a group in the file +** --Verify the group's object header version +** --Close and delete the group +** --Close the file ** ****************************************************************/ static void -test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) +test_libver_bounds_obj(hid_t fapl) { - hid_t fid; /* File ID */ - hid_t new_fapl; /* File acess property list */ - hid_t dcpl; /* Dataset creation property list */ - hid_t dtid; /* Datatype ID for the dataset */ - hid_t str_tid; /* String datatype ID */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hsize_t dims[1] = {1}; /* Dimension sizes */ - hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ - hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ - hsize_t chunks[2] = {2, 3}; /* Chunk dimension sizes */ - H5T_t *dtype; /* Internal datatype pointer */ - H5T_t *str_dtype; /* Internal datatype pointer for the string datatype */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - herr_t ret; /* Return value */ - - /* Retrieve the library format bounds */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + hid_t fcpl = -1; /* File creation property list */ + hid_t new_fapl = -1; /* File access property list */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ + H5O_info_t oinfo; /* Object info */ + H5G_info_t ginfo; /* Group info */ + herr_t ret; /* Return value */ + + /* Retrieve the low/high bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); - /* Create the file */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - CHECK(fid, FAIL, "H5Fcreate"); - - /* Create a committed datatype of string */ - str_tid = H5Tcopy(H5T_C_S1); - CHECK(str_tid, FAIL, "H5Tcopy"); - ret = H5Tset_size(str_tid, (size_t)10); - CHECK(ret, FAIL, "H5Tset_size"); - ret = H5Tcommit2(fid, "datatype", str_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Tcommit2"); - ret = H5Tclose(str_tid); - CHECK(ret, FAIL, "H5Tclose"); + /* Create a default file creation property list */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); - /* Create dataspace */ - sid = H5Screate_simple(1, dims, NULL); - CHECK(sid, FAIL, "H5Screate"); + /* Enable shared message in the fcpl */ + /* This will result in a version 2 object header */ + ret = H5Pset_shared_mesg_nindexes(fcpl, 1); + CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); + CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - /* Create a dataset */ - did = H5Dcreate2(fid, DSET1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate2"); + /* Create the file with the fcpl and the input fapl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); - /* Get the dataset's datatype */ - dtid = H5Dget_type(did); - CHECK(dtid, FAIL, "H5Dget_type"); + /* Get root group's object info */ + ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info_by_name"); - /* Get the internal datatype pointer */ - dtype = (H5T_t *)H5I_object(dtid); - CHECK(dtype, NULL, "H5I_object"); + /* Verify object header version is 2 because shared message is enabled */ + VERIFY(oinfo.hdr.version, H5O_VERSION_2, "H5O_obj_ver_bounds"); - /* Verify the datatype versions */ - /* Datatype version is upgraded only for H5T_COMPOUND, H5T_ENUM, H5T_ARRAY */ - /* H5T_VLEN: the version is upgraded if the parent datatype version is greater */ - /* Remaining datatypes use basic version: - H5T_INTEGER H5T_FLOAT H5T_TIME H5T_STRING H5T_BITFIELD H5T_OPAQUE H5T_REFERENCE */ + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); - if(dtype->shared->type == H5T_COMPOUND || - dtype->shared->type == H5T_ENUM || - dtype->shared->type == H5T_ARRAY) { - if(dtype->shared->type == H5T_ARRAY && low == H5F_LIBVER_EARLIEST) - VERIFY(dtype->shared->version, DTYPE_VERSION_2, "dtype_ver_bounds"); - else - VERIFY(dtype->shared->version, dtype_ver_bounds[low], "dtype_ver_bounds"); - } else - VERIFY(dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); + /* Close the file creation property list */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Close the dataset */ - ret = H5Dclose(did); - CHECK(ret, FAIL, "H5Dclose"); + /* Create a file with the default fcpl and input fapl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); - /* Close the dataspace */ - ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Dclose"); + /* Get root group's object info */ + ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info_by_name"); - /* Close the datatype */ - ret = H5Tclose(dtid); - CHECK(ret, FAIL, "H5Fclose"); + /* Verify object header version is as indicated by low_bound */ + VERIFY(oinfo.hdr.version, H5O_obj_ver_bounds[low], "H5O_obj_ver_bounds"); /* Close the file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Create a copy of file access property list */ + /* Create a new default file access property list which + is used to open the file in the "for" loop */ new_fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(new_fapl, FAIL, "H5Pcreate"); - /* Prepare to create a chunked dataset with 2 unlimited dimensions */ - sid = H5Screate_simple(2, dims2, max_dims2); - CHECK(sid, FAIL, "H5Screate"); - dcpl = H5Pcreate(H5P_DATASET_CREATE); - CHECK(dcpl, FAIL, "H5Pcreate"); - ret = H5Pset_chunk(dcpl, 2, chunks); - CHECK(ret, FAIL, "H5Pset_chunk"); - - /* Loop through all the combinations of low/high library format bounds */ - /* Open the file and create the chunked dataset */ - /* Verify the dataset's datatype versions */ + /* Loop through all the combinations of low/high bounds in new_fapl */ + /* Open the file with the fapl; create a group and verify the + object header version, then delete the group and close the file.*/ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); } H5E_END_TRY; - if (ret < 0) /* Invalid low/high combinations */ + if (ret < 0) /* Invalid combinations */ continue; /* Open the file */ @@ -5441,59 +5557,41 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); } H5E_END_TRY; - if(fid >= 0 ) { /* The file open succeeds */ + if(fid >=0 ) { /* The file open succeeds */ /* Get the internal file pointer */ f = (H5F_t *)H5I_object(fid); CHECK(f, NULL, "H5I_object"); - /* Verify the committed datatype's version */ - str_tid = H5Topen2(fid, "datatype", H5P_DEFAULT); - CHECK(str_tid, FAIL, "H5Topen2"); - str_dtype = (H5T_t *)H5I_object(str_tid); - CHECK(str_dtype, NULL, "H5I_object"); + /* Create a group in the file */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); - VERIFY(str_dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); + /* Get group information */ + ret = H5Gget_info(gid, &ginfo); + CHECK(ret, FAIL, "H5Gget_info"); - ret = H5Tclose(str_tid); - CHECK(ret, FAIL, "H5Tclose"); + /* Verify group storage type */ + if(f->shared->low_bound >= H5F_LIBVER_V18) + /* Links in group are stored in object header */ + VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_COMPACT, "H5Gget_info"); + else + /* Links in group are stored with a "symbol table" */ + VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_SYMBOL_TABLE, "H5Gget_info"); + /* Get object header information */ + ret = H5Oget_info_by_name(gid, GRP_NAME, &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info_by_name"); - /* Create the chunked dataset */ - did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate2"); + /* Verify object header version as indicated by low_bound */ + VERIFY(oinfo.hdr.version, H5O_obj_ver_bounds[f->shared->low_bound], "H5O_obj_ver_bounds"); - /* Get the dataset's datatype */ - dtid = H5Dget_type(did); - CHECK(dtid, FAIL, "H5Dget_type"); - - /* Get the internal datatype pointer */ - dtype = (H5T_t *)H5I_object(dtid); - CHECK(dtype, NULL, "H5I_object"); - - if(dtype->shared->type == H5T_COMPOUND || - dtype->shared->type == H5T_ENUM || - dtype->shared->type == H5T_ARRAY) { - - if(dtype->shared->type == H5T_ARRAY && - f->shared->low_bound == H5F_LIBVER_EARLIEST) - VERIFY(dtype->shared->version, DTYPE_VERSION_2, "dtype_ver_bounds"); - else - VERIFY(dtype->shared->version, dtype_ver_bounds[f->shared->low_bound], "dtype_ver_bounds"); - - } else /* not compound/enum/array */ - VERIFY(dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); - - /* Close the dataset */ - ret = H5Dclose(did); - CHECK(ret, FAIL, "H5Dclose"); - - /* Close the dataset's datatype */ - ret = H5Tclose(dtid); - CHECK(ret, FAIL, "H5Tclose"); + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); - /* Delete the dataset */ - ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); + /* Delete the group */ + ret = H5Ldelete(fid, GRP_NAME, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); /* Close the file */ @@ -5508,118 +5606,282 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) ret = H5Pclose(new_fapl); CHECK(ret, FAIL, "H5Pclose"); +} /* end test_libver_bounds_obj() */ + +/**************************************************************** +** +** test_libver_bounds_dataset(): +** Verify message versions associated with datasets: +** +** (a) Create a file with default fcpl and the input fapl. +** Create the following two datasets: +** --A contiguous dataset +** --A chunked dataset with "no filter edge chunks" +** For both datasets, verify the versions for the layout, +** fill value and filter pipeline messages. +** Close the file. +** +** (b) Create a new fapl that is set to the 5 pairs of low/high +** bounds in a "for" loop. For each pair of setting in the +** new fapl: +** --Open the same file in (a) with the fapl +** --Create a chunked dataset with 2 unlimited +** dimensions +** --Verify the versions for the layout, fill value +** and filter pipeline messages +** --Close and delete the dataset +** --Close the file +** +****************************************************************/ +static void +test_libver_bounds_dataset(hid_t fapl) +{ + hid_t fid = -1; /* File ID */ + hid_t new_fapl = -1; /* File access property list */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t dcpl = -1; /* Dataset creation property list */ + H5D_t *dset = NULL; /* Internal dataset pointer */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ + herr_t ret; /* Return value */ + hsize_t fix_dims2[2] = {10, 4}; /* Dimension sizes */ + hsize_t fix_chunks2[2] = {4, 3}; /* Chunk dimension sizes */ + hsize_t dims2[2] = {1, 4}; /* Dimension sizes */ + hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks2[2] = {4, 5}; /* Chunk dimension sizes */ + + /* Retrieve the low/high bounds from the input fapl */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file with the input fapl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create the dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a contiguous dataset */ + did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate"); + + /* Get the internal dataset pointer */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); + + /* Verify version for layout and fill value messages */ + if(low == H5F_LIBVER_EARLIEST) { + /* For layout message: the earliest version the library will set is 3 */ + /* For fill value message: the earliest version the library will set is 2 */ + VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds"); + } else { + VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[low], "H5O_layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[low], "H5O_fill_ver_bounds"); + } + + /* Verify filter pipleline message version */ + VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[low], "H5O_pline_ver_bounds"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + /* Close the dataspace */ ret = H5Sclose(sid); CHECK(ret, FAIL, "H5Sclose"); - /* Close the dataset creation property list */ + /* Set up dataspace and dcpl for creating a chunked dataset + with "no filter edge chunks" enabled. + This will result in a version 4 layout message */ + sid = H5Screate_simple(2, fix_dims2, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 2, fix_chunks2); + CHECK(ret, FAIL, "H5Pset_chunk"); + ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + CHECK(ret, FAIL, "H5Pset_chunk_opts"); + + /* Create the chunked dataset */ + H5E_BEGIN_TRY { + did = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + } H5E_END_TRY; + + if(did >= 0) { + + /* Get the internal dataset pointer */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); + + /* Verify layout message version and chunk indexing type */ + VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_4, "H5O_layout_ver_bounds"); + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_FARRAY, "chunk_index_type"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + } + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the datset creation property list */ ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); -} /* end test_libver_bounds_datatype_check() */ + /* Create a default file access property list which is used + to open the file in the 'for' loop */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); -/**************************************************************** -** -** test_libver_bounds_datatype(): -** Verify the datatype versions for various datatypes. -** -****************************************************************/ -static void -test_libver_bounds_datatype(hid_t fapl) -{ - hid_t tid, tid_enum, tid_array, tid_compound, tid_vlen; /* Datatype IDs */ - int enum_value; /* Value for enum datatype */ - typedef struct s1 { /* Data structure for compound datatype */ - char c; - int i; - } s1; - hsize_t dims[1] = {1}; /* Dimension sizes */ - herr_t ret; /* Return value */ + /* Set up dataspace and dcpl for creating a chunked dataset with + 2 unlimited dimensions in the 'for' loop */ + sid = H5Screate_simple(2, dims2, max_dims2); + CHECK(sid, FAIL, "H5Screate_simple"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 2, chunks2); + CHECK(ret, FAIL, "H5Pset_chunk"); - /* Create integer datatype */ - tid = H5Tcopy(H5T_NATIVE_INT); + /* Loop through all the combinations of low/high bounds in new_fapl */ + /* Open the file with the fapl and create the chunked dataset */ + /* Verify the dataset's layout, fill value and filter pipleline message versions */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; - /* Verify datatype versions */ - test_libver_bounds_datatype_check(fapl, tid); + if (ret < 0) /* Invalid low/high combinations */ + continue; - /* Create enum datatype */ - tid_enum = H5Tenum_create(tid); - enum_value = 0; - H5Tenum_insert(tid_enum, "val1", &enum_value); - enum_value = 1; - H5Tenum_insert(tid_enum, "val2", &enum_value); + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; - /* Verify datatype versions */ - test_libver_bounds_datatype_check(fapl, tid_enum); + if(fid >=0 ) { /* The file open succeeds */ - /* Create array datatype */ - tid_array = H5Tarray_create2(tid, 1, dims); + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); - /* Verify datatype versions */ - test_libver_bounds_datatype_check(fapl, tid_array); + /* Create the chunked dataset */ + did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); - /* Create compound datatype */ - tid_compound = H5Tcreate(H5T_COMPOUND, sizeof(s1)); - H5Tinsert(tid_compound, "c", HOFFSET(s1, c), H5T_STD_U8LE); - H5Tinsert(tid_compound, "i", HOFFSET(s1, i), H5T_NATIVE_INT); + /* Get the internal file pointer */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); - /* Verify datatype versions */ - test_libver_bounds_datatype_check(fapl, tid_compound); + /* Verify the dataset's layout, fill value and filter pipeline message versions */ + /* Also verify the chunk indexing type */ + if(f->shared->low_bound == H5F_LIBVER_EARLIEST) { + /* For layout message: the earliest version the library will set is 3 */ + /* For fill value message: the earliest version the library will set is 2 */ + VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds"); + } else { + VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[f->shared->low_bound], "H5O_layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[f->shared->low_bound], "H5O_fill_ver_bounds"); + } - /* Create vlen datatype */ - tid_vlen = H5Tvlen_create(tid); + /* Verify the filter pipeline message version */ + VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[f->shared->low_bound], "H5O_pline_ver_bounds"); - /* Verify datatype versions */ - test_libver_bounds_datatype_check(fapl, tid_vlen); + /* Verify the dataset's chunk indexing type */ + if(dset->shared->layout.version == H5O_LAYOUT_VERSION_LATEST) + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type"); + else + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE, "chunk_index_type"); - /* Close datatypes */ - ret = H5Tclose(tid); - CHECK(ret, FAIL, "H5Tclose"); + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); - ret = H5Tclose(tid_enum); - CHECK(ret, FAIL, "H5Tclose"); + /* Delete the dataset */ + ret = H5Ldelete(fid, DSETC, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); - ret = H5Tclose(tid_array); - CHECK(ret, FAIL, "H5Tclose"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); - ret = H5Tclose(tid_compound); - CHECK(ret, FAIL, "H5Tclose"); + } /* end if */ + } /* end for */ + } /* end for */ - ret = H5Tclose(tid_vlen); - CHECK(ret, FAIL, "H5Tclose"); + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); -} /* end test_libver_bounds_datatype() */ + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the dataset creation property list */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_dataset() */ /**************************************************************** ** ** test_libver_bounds_dataspace(): -** Verify the dataspace message versions. +** Verify dataspace message versions: +** +** (a) Create a file with default fcpl and the input fapl. +** Create the following two datasets: +** --A dataset with scalar dataspace +** --A dataset with null dataspace +** For both datasets, verify the dataspace message versions. +** Close the file. +** +** (b) Create a new fapl that is set to the 5 pairs of low/high +** bounds in a "for" loop. For each pair of setting in the +** new fapl: +** --Open the same file in (a) with the fapl +** --Create a chunked dataset, a compact dataset and +** a contigous dataset +** --Verify the dataspace message version for these +** three datasets +** --Delete the three datasets and the dataspaces +** --Close the file ** ****************************************************************/ static void test_libver_bounds_dataspace(hid_t fapl) { - hid_t fid; /* File ID */ - hid_t new_fapl; /* File access property list */ - hid_t did, did_null, did_compact, did_contig; /* Dataset IDs */ - hid_t sid, sid_null, sid_compact, sid_contig; /* Dataspace IDs */ - hid_t dcpl, dcpl_compact, dcpl_contig; /* Dataset creation property lists */ - H5S_t *space, *space_null; /* Internal dataspace pointers */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - hsize_t dims[1] = {1}; /* Dimension sizes */ - hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ - hsize_t max_dims[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */ - hsize_t chunks[1] = {4}; /* Chunk dimension sizes */ - herr_t ret; /* Return value */ - - /* Create null dataspace, scalar dataspace */ - - /* Retrieve the library format bounds */ + hid_t fid = -1; /* File ID */ + hid_t new_fapl = -1; /* File access property list */ + hid_t did = -1, did_null = -1; /* Dataset IDs */ + hid_t did_compact = -1, did_contig = -1; /* Dataset IDs */ + hid_t sid = -1, sid_null = -1; /* Dataspace IDs */ + hid_t sid_compact = -1, sid_contig = -1; /* Dataspace IDs */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t dcpl_compact = -1, dcpl_contig = -1; /* Dataset creation property lists */ + H5S_t *space = NULL, *space_null = NULL; /* Internal dataspace pointers */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ + hsize_t dims[1] = {1}; /* Dimension sizes */ + hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ + hsize_t max_dims[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks[1] = {4}; /* Chunk dimension sizes */ + herr_t ret; /* Return value */ + + /* Retrieve the low/high bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); - /* Create the file */ + /* Create the file with the input fapl */ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid, FAIL, "H5Fcreate"); @@ -5627,7 +5889,7 @@ test_libver_bounds_dataspace(hid_t fapl) sid = H5Screate(H5S_SCALAR); CHECK(sid, FAIL, "H5Screate"); - /* Create the dataset with scalar dataspace */ + /* Create a dataset with the scalar dataspace */ did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(did, FAIL, "H5Dcreate"); @@ -5638,13 +5900,13 @@ test_libver_bounds_dataspace(hid_t fapl) CHECK(space, NULL, "H5I_object"); /* Verify the dataspace version */ - VERIFY(space->extent.version, sdspace_ver_bounds[low], "sdspace_ver_bounds"); + VERIFY(space->extent.version, H5O_sdspace_ver_bounds[low], "H5O_sdspace_ver_bounds"); /* Create null dataspace */ sid_null = H5Screate(H5S_NULL); CHECK(sid_null, FAIL, "H5Screate"); - /* Create the dataset with null dataspace */ + /* Create a dataset with the null dataspace */ did_null = H5Dcreate2(fid, DSET_NULL, H5T_NATIVE_INT, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(did_null, FAIL, "H5Dcreate"); @@ -5655,7 +5917,7 @@ test_libver_bounds_dataspace(hid_t fapl) CHECK(space_null, NULL, "H5I_object"); /* Verify the dataspace version */ - VERIFY(space_null->extent.version, SDSPACE_VERSION_2, "sdspace_ver_bounds"); + VERIFY(space_null->extent.version, H5O_SDSPACE_VERSION_2, "H5O_sdspace_ver_bounds"); /* Close the datasets */ ret = H5Dclose(did); @@ -5673,38 +5935,38 @@ test_libver_bounds_dataspace(hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - - /* Create a copy of file access property list */ + /* Create a default file access property list which is used + to open the file in the 'for' loop */ new_fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(new_fapl, FAIL, "H5Pcreate"); - /* Prepare to create a chunked dataset with 1 unlimited dimension */ + /* Set up dataspace and dcpl for creating a chunked dataset */ sid = H5Screate_simple(1, dims, max_dims); - CHECK(sid, FAIL, "H5Screate"); + CHECK(sid, FAIL, "H5Screate_simple"); dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); ret = H5Pset_chunk(dcpl, 1, chunks); CHECK(ret, FAIL, "H5Pset_chunk"); - /* Prepare to create a compact dataset */ + /* Set up dataspace and dcpl for creating a compact dataset */ sid_compact = H5Screate_simple(1, dims, NULL); - CHECK(sid_compact, FAIL, "H5Screate"); + CHECK(sid_compact, FAIL, "H5Screate_simple"); dcpl_compact = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl_compact, FAIL, "H5Pcreate"); ret = H5Pset_layout(dcpl_compact, H5D_COMPACT); CHECK(ret, FAIL, "H5Pset_layout"); - /* Prepare to create a contiguous dataset */ + /* Set up dataspace and dcpl for creating a contiguous dataset */ sid_contig = H5Screate_simple(2, dims2, NULL); - CHECK(sid_contig, FAIL, "H5Screate"); + CHECK(sid_contig, FAIL, "H5Screate_simple"); dcpl_contig = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl_contig, FAIL, "H5Pcreate"); ret = H5Pset_layout(dcpl_contig, H5D_CONTIGUOUS); CHECK(ret, FAIL, "H5Pset_layout"); - /* Loop through all the combinations of low/high library format bounds */ + /* Loop through all the combinations of low/high bounds in new_fapl */ /* Open the file and create the chunked/compact/contiguous datasets */ - /* Verify the dataspace version for the three datasets */ + /* Verify the dataspace message version for the three datasets */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { hid_t tmp_sid, tmp_sid_compact, tmp_sid_contig; /* Dataspace IDs */ @@ -5758,9 +6020,10 @@ test_libver_bounds_dataspace(hid_t fapl) tmp_space_contig = (H5S_t *)H5I_object(tmp_sid_contig); CHECK(tmp_space_contig, NULL, "H5I_object"); - VERIFY(tmp_space->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); - VERIFY(tmp_space_compact->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); - VERIFY(tmp_space_contig->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); + /* Verify versions for the three dataspaces */ + VERIFY(tmp_space->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds"); + VERIFY(tmp_space_compact->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds"); + VERIFY(tmp_space_contig->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds"); /* Close the three datasets */ ret = H5Dclose(did); @@ -5770,6 +6033,7 @@ test_libver_bounds_dataspace(hid_t fapl) ret = H5Dclose(did_contig); CHECK(ret, FAIL, "H5Dclose"); + /* Close the three dataspaces */ ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); ret = H5Sclose(tmp_sid_compact); @@ -5815,127 +6079,218 @@ test_libver_bounds_dataspace(hid_t fapl) } /* end test_libver_bounds_dataspace() */ + /**************************************************************** ** -** test_libver_bounds_dataset(): -** Verify the dataset's layout, fill, and pline message versions -** with the low/high library format bounds setting in the fapl. -** For chunked dataset, also verify the chunked indexing type. +** test_libver_bounds_datatype(): +** Verify the datatype message version: +** +** (a) Create the following datatypes: +** 1) integer +** 2) enum +** 3) array +** 4) compound +** 5) vlen +** (b) Call test_libver_bounds_datatype_check() for each +** datatype in (a) to verify the datatype message version. ** ****************************************************************/ static void -test_libver_bounds_dataset(hid_t fapl) +test_libver_bounds_datatype(hid_t fapl) { - hid_t fid; /* File ID */ - hid_t new_fapl; /* File access property list */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t dcpl; /* Dataset creation property list */ - H5D_t *dset; /* Internal dataset pointer */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - herr_t ret; /* Return value */ - hsize_t fix_dims2[2] = {10, 4}; /* Dimension sizes */ - hsize_t fix_chunks2[2] = {4, 3}; /* Chunk dimension sizes */ - hsize_t dims2[2] = {1, 4}; /* Dimension sizes */ - hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ - hsize_t chunks2[2] = {4, 5}; /* Chunk dimension sizes */ + hid_t tid = -1, tid_enum = -1, tid_array = -1; /* Datatype IDs */ + hid_t tid_compound = -1, tid_vlen = -1; /* Datatype IDs */ + int enum_value; /* Value for enum datatype */ + typedef struct s1 { /* Data structure for compound datatype */ + char c; + int i; + } s1; + hsize_t dims[1] = {1}; /* Dimension sizes */ + herr_t ret; /* Return value */ - /* Retrieve the library format bounds */ - ret = H5Pget_libver_bounds(fapl, &low, &high); - CHECK(ret, FAIL, "H5Pget_libver_bounds"); + /* Create integer datatype */ + tid = H5Tcopy(H5T_NATIVE_INT); - /* Create the file */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - CHECK(fid, FAIL, "H5Fcreate"); + /* Verify datatype message version */ + test_libver_bounds_datatype_check(fapl, tid); - /* Create the dataspace */ - sid = H5Screate(H5S_SCALAR); - CHECK(sid, FAIL, "H5Screate"); + /* Create enum datatype */ + tid_enum = H5Tenum_create(tid); + enum_value = 0; + H5Tenum_insert(tid_enum, "val1", &enum_value); + enum_value = 1; + H5Tenum_insert(tid_enum, "val2", &enum_value); - /* Create a contiguous dataset */ - did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate"); + /* Verify datatype message version */ + test_libver_bounds_datatype_check(fapl, tid_enum); - /* Get the internal dataset pointer */ - dset = (H5D_t *)H5I_object(did); - CHECK(dset, NULL, "H5I_object"); + /* Create array datatype */ + tid_array = H5Tarray_create2(tid, 1, dims); - /* Verify layout and fill messages version */ - if(low == H5F_LIBVER_EARLIEST) { - VERIFY(dset->shared->layout.version, LAYOUT_VERSION_DEFAULT, "layout_ver_bounds"); - VERIFY(dset->shared->dcpl_cache.fill.version, FILL_VERSION_DEFAULT, "fill_ver_bounds"); - } else { - VERIFY(dset->shared->layout.version, layout_ver_bounds[low], "layout_ver_bounds"); - VERIFY(dset->shared->dcpl_cache.fill.version, fill_ver_bounds[low], "fill_ver_bounds"); - } + /* Verify datatype message version */ + test_libver_bounds_datatype_check(fapl, tid_array); - /* Verify pline message version */ - VERIFY(dset->shared->dcpl_cache.pline.version, pline_ver_bounds[low], "pline_ver_bounds"); + /* Create compound datatype */ + tid_compound = H5Tcreate(H5T_COMPOUND, sizeof(s1)); + H5Tinsert(tid_compound, "c", HOFFSET(s1, c), H5T_STD_U8LE); + H5Tinsert(tid_compound, "i", HOFFSET(s1, i), H5T_NATIVE_INT); - /* Close the dataset */ - ret = H5Dclose(did); - CHECK(ret, FAIL, "H5Dclose"); + /* Verify datatype message version */ + test_libver_bounds_datatype_check(fapl, tid_compound); - /* Close the dataspace */ - ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Sclose"); + /* Create vlen datatype */ + tid_vlen = H5Tvlen_create(tid); - /* Create a chunked dataset with "no filter edge chunks" enabled */ - sid = H5Screate_simple(2, fix_dims2, NULL); - CHECK(sid, FAIL, "H5Screate"); - dcpl = H5Pcreate(H5P_DATASET_CREATE); - CHECK(dcpl, FAIL, "H5Pcreate"); - ret = H5Pset_chunk(dcpl, 2, fix_chunks2); - CHECK(ret, FAIL, "H5Pset_chunk"); - ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); - CHECK(ret, FAIL, "H5Pset_chunk_opts"); + /* Verify datatype message version */ + test_libver_bounds_datatype_check(fapl, tid_vlen); - H5E_BEGIN_TRY { - did = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - } H5E_END_TRY; + /* Close the datatypes */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); - if(did >= 0) { + ret = H5Tclose(tid_enum); + CHECK(ret, FAIL, "H5Tclose"); - /* Get the internal dataset pointer */ - dset = (H5D_t *)H5I_object(did); - CHECK(dset, NULL, "H5I_object"); + ret = H5Tclose(tid_array); + CHECK(ret, FAIL, "H5Tclose"); - VERIFY(dset->shared->layout.version, LAYOUT_VERSION_4, "layout_ver_bounds"); - VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_FARRAY, "chunk_index_type"); + ret = H5Tclose(tid_compound); + CHECK(ret, FAIL, "H5Tclose"); - /* Close the dataset */ - ret = H5Dclose(did); - CHECK(ret, FAIL, "H5Dclose"); - } + ret = H5Tclose(tid_vlen); + CHECK(ret, FAIL, "H5Tclose"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); +} /* end test_libver_bounds_datatype() */ + +/**************************************************************** +** +** test_libver_bounds_datatype_check(): +** Helper routine called by test_libver_bounds_datatype() +** to verify the datatype message version for the input tid: +** +** (a) Create a file with default fcpl and the input fapl. +** Create a contiguous dataset with the input tid. +** Verify the datatype message version. +** Create a committed datatype of string to be +** used later. +** Close the file. +** +** (b) Create a new fapl that is set to the 5 pairs of low/high +** bounds in a "for" loop. For each pair of setting in +** the new fapl: +** --Open the same file in (a) with the fapl +** --Verify the message version for the committed +** datatype created earlier +** --Create a chunked dataset with the input tid +** --Verify the datatype message version +** --Close and delete the dataset +** --Close the file +** +****************************************************************/ +static void +test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) +{ + hid_t fid = -1; /* File ID */ + hid_t new_fapl = -1; /* File acess property list */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t dtid = -1; /* Datatype ID for the dataset */ + hid_t str_tid = -1; /* String datatype ID */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ + hsize_t dims[1] = {1}; /* Dimension sizes */ + hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ + hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks[2] = {2, 3}; /* Chunk dimension sizes */ + H5T_t *dtype = NULL; /* Internal datatype pointer */ + H5T_t *str_dtype = NULL; /* Internal datatype pointer for the string datatype */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ + herr_t ret; /* Return value */ + + /* Retrieve the low/high version bounds from the input fapl */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file with the input fapl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create a committed datatype of string which will be used + later inside the 'for' loop */ + str_tid = H5Tcopy(H5T_C_S1); + CHECK(str_tid, FAIL, "H5Tcopy"); + ret = H5Tset_size(str_tid, (size_t)10); + CHECK(ret, FAIL, "H5Tset_size"); + ret = H5Tcommit2(fid, "datatype", str_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + ret = H5Tclose(str_tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Create dataspace */ + sid = H5Screate_simple(1, dims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + /* Create a dataset with the input tid */ + did = H5Dcreate2(fid, DSET1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Get the dataset's datatype */ + dtid = H5Dget_type(did); + CHECK(dtid, FAIL, "H5Dget_type"); + + /* Get the internal datatype pointer */ + dtype = (H5T_t *)H5I_object(dtid); + CHECK(dtype, NULL, "H5I_object"); + + /* Verify the datatype message version */ + /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: + * --the library will set version according to low_bound + * --H5T_ARRAY: the earliest version the library will set is 2 + * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: + * --the library will only use basic version + */ + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || + dtype->shared->type == H5T_ARRAY) { + if(dtype->shared->type == H5T_ARRAY && low == H5F_LIBVER_EARLIEST) + VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); + else + VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[low], "H5O_dtype_ver_bounds"); + } else + VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); /* Close the dataspace */ ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Sclose"); + CHECK(ret, FAIL, "H5Dclose"); - /* Close the datset creation property list */ - ret = H5Pclose(dcpl); - CHECK(ret, FAIL, "H5Pclose"); + /* Close the datatype */ + ret = H5Tclose(dtid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); - /* Create a copy of file access property list */ + /* Create a default file access property list */ new_fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(new_fapl, FAIL, "H5Pcreate"); - /* Prepare to create a chunked dataset with 2 unlimited dimensions */ + /* Set up dataspace and dcpl for creating a chunked dataset */ sid = H5Screate_simple(2, dims2, max_dims2); - CHECK(sid, FAIL, "H5Screate"); + CHECK(sid, FAIL, "H5Screate_simple"); dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); - ret = H5Pset_chunk(dcpl, 2, chunks2); + ret = H5Pset_chunk(dcpl, 2, chunks); CHECK(ret, FAIL, "H5Pset_chunk"); - /* Loop through all the combinations of low/high library format bounds */ - /* Open the file and create the chunked dataset */ - /* Verify the dataset's layout, fill, pline message versions and chunked indexing type */ + /* Loop through all the combinations of low/high bounds */ + /* Open the file and create the chunked dataset with the input tid */ + /* Verify the dataset's datatype message version */ + /* Also verify the committed atatype message version */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { H5E_BEGIN_TRY { @@ -5950,41 +6305,66 @@ test_libver_bounds_dataset(hid_t fapl) fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); } H5E_END_TRY; - if(fid >=0 ) { /* The file open succeeds */ + if(fid >= 0 ) { /* The file open succeeds */ /* Get the internal file pointer */ f = (H5F_t *)H5I_object(fid); CHECK(f, NULL, "H5I_object"); + /* Open the committed datatype */ + str_tid = H5Topen2(fid, "datatype", H5P_DEFAULT); + CHECK(str_tid, FAIL, "H5Topen2"); + str_dtype = (H5T_t *)H5I_object(str_tid); + CHECK(str_dtype, NULL, "H5I_object"); + + /* Verify the committed datatype message version */ + VERIFY(str_dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds"); + + /* Close the committed datatype */ + ret = H5Tclose(str_tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Create the chunked dataset */ - did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); CHECK(did, FAIL, "H5Dcreate2"); - /* Get the internal file pointer */ - dset = (H5D_t *)H5I_object(did); - CHECK(dset, NULL, "H5I_object"); + /* Get the dataset's datatype */ + dtid = H5Dget_type(did); + CHECK(dtid, FAIL, "H5Dget_type"); - /* Verify the dataset's layout, fill, pline message versions and chunked indexing type */ - if(f->shared->low_bound == H5F_LIBVER_EARLIEST) { - VERIFY(dset->shared->layout.version, LAYOUT_VERSION_DEFAULT, "layout_ver_bounds"); - VERIFY(dset->shared->dcpl_cache.fill.version, FILL_VERSION_DEFAULT, "fill_ver_bounds"); - } else { - VERIFY(dset->shared->layout.version, layout_ver_bounds[f->shared->low_bound], "layout_ver_bounds"); - VERIFY(dset->shared->dcpl_cache.fill.version, fill_ver_bounds[f->shared->low_bound], "fill_ver_bounds"); - } + /* Get the internal datatype pointer */ + dtype = (H5T_t *)H5I_object(dtid); + CHECK(dtype, NULL, "H5I_object"); - VERIFY(dset->shared->dcpl_cache.pline.version, pline_ver_bounds[f->shared->low_bound], "pline_ver_bounds"); - if(dset->shared->layout.version == LAYOUT_VERSION_LATEST) - VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type"); - else - VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE, "chunk_index_type"); + /* Verify the dataset's datatype message version */ + /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: + * --the library will set version according to low_bound + * --H5T_ARRAY: the earliest version the library will set is 2 + * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: + * --the library will only use basic version + */ + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || + dtype->shared->type == H5T_ARRAY) { + if(dtype->shared->type == H5T_ARRAY && + f->shared->low_bound == H5F_LIBVER_EARLIEST) + VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); + else + VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[f->shared->low_bound], "H5O_dtype_ver_bounds"); + } else + VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds"); /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); + /* Close the dataset's datatype */ + ret = H5Tclose(dtid); + CHECK(ret, FAIL, "H5Tclose"); + /* Delete the dataset */ - ret = H5Ldelete(fid, DSETC, H5P_DEFAULT); + ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); /* Close the file */ @@ -6007,242 +6387,283 @@ test_libver_bounds_dataset(hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); -} /* end test_libver_bounds_dataset() */ +} /* end test_libver_bounds_datatype_check() */ /**************************************************************** ** -** test_libver_bounds_obj(): -** Verify object header version with the low/high library -** format bounds setting in the fapl. +** test_libver_bounds_attributes(): +** Verify the attribute message versions: +** +** (a) Create a file with default fcpl and the input fapl. +** Create a group and attach the following three attributes +** to the group: +** (1) Attribute with a committed datatype +** (2) Attribute with integer type +** (3) Attribute with character encoding set +** Verify the three attributes' message versions. +** Close the file. +** +** (b) Create a fcpl that has shared datatype message enabled. +** Create a file with the fcpl and the input fapl. +** Create a group and attach an attribute with shared +** integer type to the group. +** Verify the attribute message version. +** Close the file +** +** (b) Create a new fapl that is set to the 5 pairs of low/high +** bounds in a "for" loop. For each pair of setting in +** the new fapl: +** --Open the same file in (b) with the fapl +** --Open the group and attach an attribute with integer +** type to the group +** --Verify the attribute message version +** --Delete the attribute +** --Close the group and the file ** ****************************************************************/ static void -test_libver_bounds_obj(hid_t fapl) +test_libver_bounds_attributes(hid_t fapl) { - hid_t fid; /* File ID */ - hid_t gid; /* Group ID */ - hid_t fcpl; /* File creation property list */ - hid_t new_fapl; /* File access property list */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - H5O_info_t oinfo; /* Object info */ - H5G_info_t ginfo; /* Group info */ + hid_t fid = -1; /* File ID */ + hid_t fcpl = -1; /* File creation property list */ + hid_t new_fapl = -1; /* File access property list */ + hid_t tid = -1; /* Datatype ID */ + hid_t gid = -1; /* Group ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t attr_cpl = -1; /* Attribute creation property list */ + H5A_t *attr = NULL; /* Internal attribute pointer */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ herr_t ret; /* Return value */ - /* Retrieve the format bounds */ + /* Retrieve the low/high bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); - /* Get a copy of file creation property list */ - fcpl = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl, FAIL, "H5Pcreate"); - - /* Enable shared message */ - ret = H5Pset_shared_mesg_nindexes(fcpl, 1); - CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); - ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); - CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - /* Create the file */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid, FAIL, "H5Fcreate"); - /* Get root group's object info */ - ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Oget_info"); + /* Integer datatpye */ + tid = H5Tcopy(H5T_NATIVE_INT); + CHECK(tid, FAIL, "H5Tcopy"); - /* Verify object header version is 2 when shared message is enabled */ - VERIFY(oinfo.hdr.version, OBJ_VERSION_2, "H5Oget_info"); + /* Create a committed datatype */ + ret = H5Tcommit2(fid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Create dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); - /* Close the file creation property list */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Fclose"); + /* Create a group */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); - /* Create a file with default fcpl */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - CHECK(fid, FAIL, "H5Fcreate"); + /* Attach an attribute to the group with the committed datatype */ + aid = H5Acreate2(gid, "attr1", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); - /* Get root group's object info */ - ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Oget_info"); + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); - /* Verify object header version */ - VERIFY(oinfo.hdr.version, obj_ver_bounds[low], "obj_ver_bounds"); + /* Verify the attribute version */ + if(low == H5F_LIBVER_EARLIEST) + /* The earliest version the library can set for an attribute with committed datatype is 2 */ + VERIFY(attr->shared->version, H5O_ATTR_VERSION_2, "H5O_attr_ver_bounds"); + else + VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); - /* Create a copy of file access property list */ - new_fapl = H5Pcreate(H5P_FILE_ACCESS); - CHECK(new_fapl, FAIL, "H5Pcreate"); + /* Create an attribute to the group with integer type */ + aid = H5Acreate2(gid, "attr2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); - /* Loop through all the combinations of low/high library format bounds */ - /* Open the file to verify object header version */ - for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { - for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - H5E_BEGIN_TRY { - ret = H5Pset_libver_bounds(new_fapl, low, high); - } H5E_END_TRY; + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); - if (ret < 0) /* Invalid combinations */ - continue; + /* Verify attribute version */ + VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds"); - /* Open the file */ - H5E_BEGIN_TRY { - fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); - } H5E_END_TRY; + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); - if(fid >=0 ) { /* The file open succeeds */ + /* Enable character encoding in attribute creation property list */ + attr_cpl = H5Pcreate(H5P_ATTRIBUTE_CREATE); + CHECK(attr_cpl, FAIL, "H5Pcreate"); + ret = H5Pset_char_encoding(attr_cpl, H5T_CSET_UTF8); + CHECK(ret, FAIL, "H5Pset_char_encoding"); - /* Get the internal file pointer */ - f = (H5F_t *)H5I_object(fid); - CHECK(f, NULL, "H5I_object"); - - /* Create a group in the file */ - gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(gid, FAIL, "H5Gcreate2"); - - /* Get group information */ - ret = H5Gget_info(gid, &ginfo); - CHECK(ret, FAIL, "H5Gget_info"); + /* Attach an attribute to the group with character encoding set */ + aid = H5Acreate2(gid, "attr3", H5T_NATIVE_INT, sid, attr_cpl, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); - /* Verify group storage type */ - if(f->shared->low_bound >= H5F_LIBVER_V18) - VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_COMPACT, "H5Gget_info"); - else - VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_SYMBOL_TABLE, "H5Gget_info"); + /* Get internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); - /* Get object header information */ - ret = H5Oget_info_by_name(gid, GRP_NAME, &oinfo, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Oget_info"); + /* Verify attribute version */ + if(low == H5F_LIBVER_EARLIEST) + /* The earliest version the library can set for an attribute with character encoding is 3 */ + VERIFY(attr->shared->version, H5O_ATTR_VERSION_3, "H5O_attr_ver_bounds"); + else + VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds"); - /* Verify object header version */ - VERIFY(oinfo.hdr.version, obj_ver_bounds[f->shared->low_bound], "obj_ver_bounds"); + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); - /* Close the group */ - ret = H5Gclose(gid); - CHECK(ret, FAIL, "H5Gclose"); + /* Close the attribute creation property list */ + ret = H5Pclose(attr_cpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Delete the group */ - ret = H5Ldelete(fid, GRP_NAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Gclose"); + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); - } /* end if */ - } /* end for */ - } /* end for */ + /* Close the datatype */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); - /* Close the file access property list */ - ret = H5Pclose(new_fapl); - CHECK(ret, FAIL, "H5Pclose"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); -} /* end test_libver_bounds_obj() */ + /* Create a copy of the file creation property list */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); -/**************************************************************** -** -** test_libver_bounds_super(): -** Verify open of a file with 0, 1, 2 and 3 superblock versions. -** -****************************************************************/ -static void -test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) -{ - hid_t fid; /* File ID */ - H5F_t *f; /* Internal file pointer */ - hid_t new_fapl; /* File access property list */ - unsigned super_vers; /* Superblock version */ - H5F_libver_t low, high; /* File format bounds */ - hbool_t ok; /* The result is ok or not */ - herr_t ret; /* Return value */ + /* Enable shared datatype message */ + ret = H5Pset_shared_mesg_nindexes(fcpl, 1); + CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 2); + CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - /* Create the file */ + /* Create the file with shared datatype message enabled */ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); - /* Get the internal file pointer */ - f = (H5F_t *)H5I_object(fid); - CHECK(f, NULL, "H5I_object"); + /* Create an integer datatye */ + tid = H5Tcopy(H5T_NATIVE_INT); + CHECK(tid, FAIL, "H5Tcopy"); - /* The file's superblock version */ - super_vers = f->shared->sblock->super_vers; + /* Create dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a group */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Attach an attribute to the group with shared integer datatype */ + aid = H5Acreate2(gid, ATTR_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + /* Verify the attribute version */ + if(low == H5F_LIBVER_EARLIEST) + /* The earliest version the library can set for an attribute with shared datatype is 2 */ + VERIFY(attr->shared->version, H5O_ATTR_VERSION_2, "H5O_attr_ver_bounds"); + else + VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the datatype */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); /* Close the file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Create a file access property list */ + /* Create a default file access property list */ new_fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(new_fapl, FAIL, "H5Pcreate"); - /* Loop through all the combinations of low/high library format bounds */ + /* Create a scalar dataspace to be used later for the attribute */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Loop through all the combinations of low/high bounds */ + /* Open the file and group and attach an attribute to the group */ + /* Verify the attribute version */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); } H5E_END_TRY; - /* Invalid combinations */ - if (ret < 0) + if(ret < 0) /* Invalid low/high combinations */ continue; - /* Open the file with or without SWMR */ + /* Open the file */ H5E_BEGIN_TRY { - fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl); + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); } H5E_END_TRY; - ok = fid >= 0; - /* Verify the file open succeeds or fails */ - switch(super_vers) { - case 3: - if(high == H5F_LIBVER_LATEST) { - /* Should succeed */ - VERIFY(ok, TRUE, "H5Fopen"); - VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "superblock_ver_bounds"); + if(fid >=0 ) { /* The file open succeeds */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); - } else /* Should fail */ - VERIFY(ok, FALSE, "H5Fopen"); - break; + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); - case 2: - if(is_swmr) /* Should fail */ - VERIFY(ok, FALSE, "H5Fopen"); - else { /* Should succeed */ - VERIFY(ok, TRUE, "H5Fopen"); + /* Open the group */ + gid = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); - ok = f->shared->low_bound >= H5F_LIBVER_V18; - VERIFY(ok, TRUE, "superblock_ver_bounds"); + /* Attach an attribute to the group */ + aid = H5Acreate2(gid, "attr1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); - } - break; + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); - case 1: - case 0: - if(is_swmr) /* Should fail */ - VERIFY(ok, FALSE, "H5Fopen"); - else { /* Should succeed */ - VERIFY(ok, TRUE, "H5Fopen"); - VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); + /* Verify the attribute message version */ + VERIFY(attr->shared->version, H5O_attr_ver_bounds[f->shared->low_bound], "H5O_attr_ver_bounds"); - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); - } - break; + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); - default: - break; - } /* end switch */ + /* Delete the attribute */ + ret = H5Adelete(gid, "attr1"); + CHECK(ret, FAIL, "H5Adelete"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ } /* end for */ } /* end for */ @@ -6250,232 +6671,11 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) ret = H5Pclose(new_fapl); CHECK(ret, FAIL, "H5Pclose"); -} /* end test_libver_bounds_super_open() */ - -/**************************************************************** -** -** test_libver_bounds_super_create(): -** Verify the superblock version with the low/high library -** version bounds setting in the fapl. -** -****************************************************************/ -static void -test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) -{ - hid_t fid; /* File ID */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - hbool_t ok; /* The result is ok or not */ - herr_t ret; /* The return value */ - - /* Try to create the file */ - H5E_BEGIN_TRY { - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), fcpl, fapl); - } H5E_END_TRY; - - /* Get the internal file pointer if the create succeeds */ - if((ok = fid >= 0)) { - f = (H5F_t *)H5I_object(fid); - CHECK(f, NULL, "H5I_object"); - } - - /* Retrieve the format bounds */ - ret = H5Pget_libver_bounds(fapl, &low, &high); - CHECK(ret, FAIL, "H5Pget_libver_bounds"); - - if(is_swmr) { /* SWMR is enabled */ - - if(high == H5F_LIBVER_LATEST) { /* Superblock version is 3 */ - VERIFY(ok, TRUE, "H5Fcreate"); - VERIFY(SUPERBLOCK_VERSION_3, f->shared->sblock->super_vers, "superblock_ver_bounds"); - VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "superblock_ver_bounds"); - - } else /* Should fail */ - VERIFY(ok, FALSE, "H5Fcreate"); - - } else { /* Should succeed */ - VERIFY(ok, TRUE, "H5Fcreate"); - - switch(low) { - case H5F_LIBVER_EARLIEST: - ok = (f->shared->sblock->super_vers == 0 || - f->shared->sblock->super_vers == 1 || - f->shared->sblock->super_vers == 2); - VERIFY(ok, TRUE, "H5Fcreate"); - VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); - break; - - case H5F_LIBVER_V18: - ok = (f->shared->sblock->super_vers == 2); - VERIFY(ok, TRUE, "H5Fcreate"); - VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); - break; - - case H5F_LIBVER_V110: - ok = (f->shared->sblock->super_vers == 3); - VERIFY(ok, TRUE, "H5Fcreate"); - VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); - break; - - case H5F_LIBVER_ERROR: - case H5F_LIBVER_NBOUNDS: - default: - ERROR("H5Pget_libver_bounds"); - - } /* end switch */ - } - - if(ok) { /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); - } - -} /* end test_libver_bounds_super_create() */ - -/**************************************************************** -** -** test_libver_bounds_super(): -** Verify superblock version via: -** test_libver_bounds_super_create() -** test_libver_bounds_super_open() -** -****************************************************************/ -static void -test_libver_bounds_super(hid_t fapl) -{ - hid_t fcpl; - herr_t ret; - - /* Create a default fcpl */ - fcpl = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl, FAIL, "H5Pcreate"); - - /* Verify superblock version is 0 when creating a file with or without SWMR */ - test_libver_bounds_super_create(fapl, fcpl, TRUE); - test_libver_bounds_super_create(fapl, fcpl, FALSE); - - /* Verify opening a file with or without SWMR when superblock version is 0 */ - test_libver_bounds_super_open(fapl, fcpl, TRUE); - test_libver_bounds_super_open(fapl, fcpl, FALSE); - - /* Close fcpl */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); - - /* Create fcpl with non-default v1-btree K value enabled */ - fcpl = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl, FAIL, "H5Pcreate"); - - ret = H5Pset_istore_k(fcpl, 64); - CHECK(ret, FAIL, "H5Pset_istore_k"); - - /* Verify superblock version is 1 when creating a file with or without SWMR */ - test_libver_bounds_super_create(fapl, fcpl, TRUE); - test_libver_bounds_super_create(fapl, fcpl, FALSE); - - /* Verify opening a file with or without SWMR when superblock version is 1 */ - test_libver_bounds_super_open(fapl, fcpl, TRUE); - test_libver_bounds_super_open(fapl, fcpl, FALSE); - - /* Close fcpl */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); - - /* Create fcpl with shared messages enabled */ - fcpl = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl, FAIL, "H5Pcreate"); - ret = H5Pset_shared_mesg_nindexes(fcpl, 1); - CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); - ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); - CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - - /* Verify superblock version is 2 when creating a file with or without SWMR */ - test_libver_bounds_super_create(fapl, fcpl, TRUE); - test_libver_bounds_super_create(fapl, fcpl, FALSE); - - /* Verify opening a file with or without SWMR when superblock version is 2 */ - test_libver_bounds_super_open(fapl, fcpl, TRUE); - test_libver_bounds_super_open(fapl, fcpl, FALSE); - - /* Close fcpl */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); - - /* Create fcpl with persistent free-space enabled */ - fcpl = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl, FAIL, "H5Pcreate"); - ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0); - CHECK(ret, FAIL, "H5Pset_file_space"); - - /* Verify superblock version is 2 when creating a file with or without SWMR */ - test_libver_bounds_super_create(fapl, fcpl, TRUE); - test_libver_bounds_super_create(fapl, fcpl, FALSE); - - /* Verify opening a file with or without SWMR when superblock version is 2 */ - test_libver_bounds_super_open(fapl, fcpl, TRUE); - test_libver_bounds_super_open(fapl, fcpl, FALSE); - - /* Close fcpl */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); - -} /* end test_libver_bounds_super() */ - -/**************************************************************** -** -** test_libver_bounds_low_high(): -** Tests to verify that format versions are correct with the five -** pairs of (low, high) combinations via H5Pset_libver_bounds(). -** -****************************************************************/ -static void -test_libver_bounds_low_high(void) -{ - hid_t fapl; - H5F_libver_t low, high; - herr_t ret; - - /* Output message about test being performed */ - MESSAGE(5, ("Testing setting library version bounds for (low, high) bounds\n")); - - fapl = H5Pcreate(H5P_FILE_ACCESS); - CHECK(fapl, FAIL, "H5Pcreate"); - - /* Loop through all the combinations of low/high library format bounds */ - for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) - for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - H5E_BEGIN_TRY { - ret = H5Pset_libver_bounds(fapl, low, high); - } H5E_END_TRY; - - /* Should fail: invalid combinations */ - if(high == H5F_LIBVER_EARLIEST) { - VERIFY(ret, FAIL, "H5Pset_libver_bounds"); - continue; - } - - /* Should fail: invalid combinations */ - if(high < low) { - VERIFY(ret, FAIL, "H5Pset_libver_bounds"); - continue; - } - - /* All other combinations are valid and should succeed */ - VERIFY(ret, SUCCEED, "H5Pset_libver_bounds"); - - /* Tests to verify format versions */ - test_libver_bounds_super(fapl); - test_libver_bounds_obj(fapl); - test_libver_bounds_dataset(fapl); - test_libver_bounds_dataspace(fapl); - test_libver_bounds_datatype(fapl); - test_libver_bounds_attributes(fapl); - } - - ret = H5Pclose(fapl); - CHECK(ret, FAIL, "H5Pclose"); + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); -} /* end test_libver_bounds_low_high() */ +} /* end test_libver_bounds_attributes() */ /**************************************************************** ** -- cgit v0.12 From 0291c0907502b8d1b2f0328a97c2f19ca16c7370 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 16 Jan 2018 16:08:52 -0600 Subject: HDFFV-10385 Use OUTPUT_NAME property instead of CMAKE_BUILD_TYPE --- java/examples/datasets/CMakeLists.txt | 9 ++------- java/examples/datatypes/CMakeLists.txt | 9 ++------- java/examples/groups/CMakeLists.txt | 9 ++------- java/examples/intro/CMakeLists.txt | 9 ++------- java/test/CMakeLists.txt | 10 ++-------- 5 files changed, 10 insertions(+), 36 deletions(-) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 3972ec8..b95ede7 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -62,13 +62,8 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) 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 () - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") add_test ( NAME JAVA_datasets-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 8569b8b..9c6e29f 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -62,13 +62,8 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) 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 () - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") add_test ( NAME JAVA_datatypes-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index b912208..5bf5040 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -61,13 +61,8 @@ 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 () - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") add_test ( NAME JAVA_groups-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 9dc4dd7..0e5ae79 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -63,13 +63,8 @@ foreach (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 () - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") add_test ( NAME JAVA_intro-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 8912b3f..5c8fa8d 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -88,14 +88,8 @@ 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 () - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () -endif () - +string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) +set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") add_test ( NAME JUnit-interface-clearall-objects COMMAND ${CMAKE_COMMAND} -- cgit v0.12 From d202b3cfa14baf3a32fdf03b1e59759fe2a67c6b Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 16 Jan 2018 17:35:29 -0600 Subject: Modify h5repack usage so that it is more descriptive. --- tools/src/h5repack/h5repack_main.c | 21 ++++++++++++++++----- tools/test/h5repack/testfiles/h5repack-help.txt | 19 +++++++++++++++---- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 037aa4a..9a24057 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -83,10 +83,13 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " -v, --verbose Verbose mode, print object information\n"); PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); PRINTVALSTREAM(rawoutstream, " -n, --native Use a native HDF5 type when repacking\n"); + PRINTVALSTREAM(rawoutstream, " -E --enable-error-stack Prints messages from the HDF5 error stack as they occur\n"); PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n"); PRINTVALSTREAM(rawoutstream, " This option will take precedence over the -j and -k options\n"); - PRINTVALSTREAM(rawoutstream, " -j, --low The low bound as in H5Pset_libver_bounds()\n"); - PRINTVALSTREAM(rawoutstream, " -k, --high The high bound as in H5Pset_libver_bounds()\n"); + PRINTVALSTREAM(rawoutstream, " -j BOUND, --low=BOUND The low bound for library release versions to use when creating\n"); + PRINTVALSTREAM(rawoutstream, " objects in the file\n"); + PRINTVALSTREAM(rawoutstream, " -k BOUND, --high=BOUND The high bound for library release versions to use when creating\n"); + PRINTVALSTREAM(rawoutstream, " objects in the file\n"); PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n"); PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n"); PRINTVALSTREAM(rawoutstream, " -s S[:F], --ssize=S[:F] Shared object header message minimum size\n"); @@ -119,8 +122,11 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " F - is the shared object header message type, any of . If F is not specified, S applies to all messages\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); - PRINTVALSTREAM(rawoutstream, " occur.\n"); + PRINTVALSTREAM(rawoutstream, " BOUND is an integer indicating the library release versions to use when creating\n"); + PRINTVALSTREAM(rawoutstream, " objects in the file (see H5Pset_libver_bounds()):\n"); + PRINTVALSTREAM(rawoutstream, " 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct\n"); + PRINTVALSTREAM(rawoutstream, " 1: This is H5F_LIBVER_V18 in H5F_libver_t struct\n"); + PRINTVALSTREAM(rawoutstream, " 2: This is H5F_LIBVER_V110 in H5F_libver_t struct\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " FS_STRATEGY is a string indicating the file space strategy used:\n"); PRINTVALSTREAM(rawoutstream, " FSM_AGGR:\n"); @@ -210,6 +216,11 @@ static void usage(const char *prog) { 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 -j 0 -k 1 file1 file2\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when\n"); + PRINTVALSTREAM(rawoutstream, " creating the repacked file: file2\n"); + PRINTVALSTREAM(rawoutstream, "\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"); @@ -655,7 +666,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'E': - enable_error_stack = TRUE; + enable_error_stack = TRUE; break; default: diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index 77e2178..da75e9f 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -6,10 +6,13 @@ usage: h5repack [OPTIONS] file1 file2 -v, --verbose Verbose mode, print object information -V, --version Print version number and exit -n, --native Use a native HDF5 type when repacking + -E --enable-error-stack Prints messages from the HDF5 error stack as they occur -L, --latest Use latest version of file format This option will take precedence over the -j and -k options - -j, --low The low bound as in H5Pset_libver_bounds() - -k, --high The high bound as in H5Pset_libver_bounds() + -j BOUND, --low=BOUND The low bound for library release versions to use when creating + objects in the file + -k BOUND, --high=BOUND The high bound for library release versions to use when creating + objects in the file -c L1, --compact=L1 Maximum number of links in header messages -d L2, --indexed=L2 Minimum number of links in the indexed format -s S[:F], --ssize=S[:F] Shared object header message minimum size @@ -42,8 +45,11 @@ usage: h5repack [OPTIONS] file1 file2 F - is the shared object header message type, any of . If F is not specified, S applies to all messages - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + BOUND is an integer indicating the library release versions to use when creating + objects in the file (see H5Pset_libver_bounds()): + 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct + 1: This is H5F_LIBVER_V18 in H5F_libver_t struct + 2: This is H5F_LIBVER_V110 in H5F_libver_t struct FS_STRATEGY is a string indicating the file space strategy used: FSM_AGGR: @@ -133,6 +139,11 @@ Examples of use: Using latest file format with maximum compact group size of 10 and and minimum shared datatype size of 20 +5) h5repack -j 0 -k 1 file1 file2 + + Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when + creating the repacked file: file2 + 5) h5repack -f SHUF -f GZIP=1 file1 file2 Add both filters SHUF and GZIP in this order to all datasets -- cgit v0.12 From 6ca95c512a116340b6e483882a4a3737d9d1c67c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 17 Jan 2018 10:27:00 -0600 Subject: HDFFV-10385 rework java names --- c++/examples/CMakeLists.txt | 2 -- c++/test/CMakeLists.txt | 1 - config/cmake_ext_mod/HDFMacros.cmake | 32 +++++++++++++++++++----------- examples/CMakeLists.txt | 4 ---- fortran/examples/CMakeLists.txt | 6 ------ fortran/test/CMakeLists.txt | 10 ---------- fortran/testpar/CMakeLists.txt | 1 - hl/c++/examples/CMakeLists.txt | 1 - hl/c++/test/CMakeLists.txt | 1 - hl/examples/CMakeLists.txt | 1 - hl/fortran/examples/CMakeLists.txt | 1 - hl/fortran/test/CMakeLists.txt | 8 -------- hl/test/CMakeLists.txt | 5 ----- hl/tools/gif2h5/CMakeLists.txt | 3 --- hl/tools/h5watch/CMakeLists.txt | 4 ---- java/examples/datasets/CMakeLists.txt | 3 +-- java/examples/datatypes/CMakeLists.txt | 3 +-- java/examples/groups/CMakeLists.txt | 3 +-- java/examples/intro/CMakeLists.txt | 3 +-- java/src/jni/CMakeLists.txt | 4 +--- java/test/CMakeLists.txt | 3 +-- release_docs/USING_HDF5_CMake.txt | 9 ++++----- test/CMakeLists.txt | 19 ------------------ test/CMakeTests.cmake | 1 - testpar/CMakeLists.txt | 2 -- tools/src/h5copy/CMakeLists.txt | 2 -- tools/src/h5diff/CMakeLists.txt | 3 --- tools/src/h5dump/CMakeLists.txt | 2 -- tools/src/h5format_convert/CMakeLists.txt | 1 - tools/src/h5import/CMakeLists.txt | 1 - tools/src/h5jam/CMakeLists.txt | 2 -- tools/src/h5ls/CMakeLists.txt | 2 -- tools/src/h5repack/CMakeLists.txt | 2 -- tools/src/h5stat/CMakeLists.txt | 2 -- tools/src/misc/CMakeLists.txt | 4 ---- tools/test/h5copy/CMakeLists.txt | 1 - tools/test/h5diff/CMakeLists.txt | 1 - tools/test/h5dump/CMakeLists.txt | 1 - tools/test/h5format_convert/CMakeLists.txt | 2 -- tools/test/h5import/CMakeLists.txt | 1 - tools/test/h5jam/CMakeLists.txt | 3 --- tools/test/h5repack/CMakeLists.txt | 2 -- tools/test/h5stat/CMakeLists.txt | 1 - tools/test/misc/CMakeLists.txt | 4 ---- tools/test/misc/vds/CMakeLists.txt | 1 - tools/test/perform/CMakeLists.txt | 9 --------- 46 files changed, 30 insertions(+), 147 deletions(-) diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index e5b0b4a..300f6bc 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -34,7 +34,6 @@ set (tutr_examples foreach (example ${examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - TARGET_NAMING (cpp_ex_${example} STATIC) 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) @@ -42,7 +41,6 @@ endforeach () foreach (example ${tutr_examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - TARGET_NAMING (cpp_ex_${example} STATIC) 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) diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 65815f9..4930626 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -37,7 +37,6 @@ set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ) -TARGET_NAMING (cpp_testhdf5 STATIC) TARGET_C_PROPERTIES (cpp_testhdf5 STATIC " " " ") target_link_libraries (cpp_testhdf5 ${HDF5_CPP_LIB_TARGET} diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 8a6b74d..2813de6 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -14,13 +14,16 @@ macro (SET_HDF5_BUILD_TYPE) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) + set(HDF5_CFG_NAME ${CTEST_CONFIGURATION_TYPE}) set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR}) set(HDF5_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) else() set(HDF5_CFG_BUILD_TYPE ".") if(CMAKE_BUILD_TYPE) + set(HDF5_CFG_NAME ${CMAKE_BUILD_TYPE}) set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE}) else() + set(HDF5_CFG_NAME "Release") set(HDF5_BUILD_TYPE "Release") endif() endif() @@ -65,13 +68,6 @@ macro (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) endmacro () #------------------------------------------------------------------------------- -macro (TARGET_NAMING libtarget libtype) - if (${libtype} MATCHES "SHARED") - set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}${ARGN}") - endif () -endmacro () - -#------------------------------------------------------------------------------- macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) if (WIN32 AND MSVC) get_target_property (target_type ${libtarget} TYPE) @@ -108,6 +104,12 @@ endmacro () #------------------------------------------------------------------------------- macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) + set (LIB_DEBUG_PREFIX "") + if (WIN32) + set (LIB_DEBUG_SUFFIX "_D") + else () + set (LIB_DEBUG_SUFFIX "_debug") + endif () if (${libtype} MATCHES "SHARED") if (WIN32) set (LIB_RELEASE_NAME "${libname}") @@ -118,6 +120,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) endif () else () if (WIN32) + set (LIB_DEBUG_PREFIX "lib") set (LIB_RELEASE_NAME "lib${libname}") set (LIB_DEBUG_NAME "lib${libname}_D") else () @@ -128,11 +131,16 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set_target_properties (${libtarget} PROPERTIES - OUTPUT_NAME ${LIB_RELEASE_NAME} - OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} - OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME} - OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} - OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} +# OUTPUT_NAME +# ${LIB_DEBUG_PREFIX}${libname}$<$:${LIB_DEBUG_SUFFIX}> + OUTPUT_NAME_DEBUG + ${LIB_DEBUG_NAME} + OUTPUT_NAME_RELEASE + ${LIB_RELEASE_NAME} + OUTPUT_NAME_MINSIZEREL + ${LIB_RELEASE_NAME} + OUTPUT_NAME_RELWITHDEBINFO + ${LIB_RELEASE_NAME} ) if (${libtype} MATCHES "STATIC") if (WIN32) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 04a99ce..43c6d63 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -46,13 +46,11 @@ set (examples foreach (example ${examples}) add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) - TARGET_NAMING (${example} STATIC) TARGET_C_PROPERTIES (${example} STATIC " " " ") target_link_libraries (${example} ${HDF5_LIB_TARGET}) set_target_properties (${example} PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (${example}-shared ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) - TARGET_NAMING (${example}-shared SHARED) TARGET_C_PROPERTIES (${example}-shared SHARED " " " ") target_link_libraries (${example}-shared ${HDF5_LIBSH_TARGET}) set_target_properties (${example}-shared PROPERTIES FOLDER examples) @@ -61,13 +59,11 @@ endforeach () if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) - TARGET_NAMING (ph5example STATIC) TARGET_C_PROPERTIES (ph5example STATIC " " " ") target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) - TARGET_NAMING (ph5example-shared SHARED) TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index a05f296..a48b3bd 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -40,7 +40,6 @@ set (F2003_examples foreach (example ${examples}) add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f90_ex_${example} STATIC) TARGET_FORTRAN_PROPERTIES (f90_ex_${example} STATIC " " " ") target_link_libraries (f90_ex_${example} ${HDF5_F90_LIB_TARGET} @@ -54,7 +53,6 @@ foreach (example ${examples}) ) if (BUILD_SHARED_LIBS) add_executable (f90_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f90_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_${example}-shared SHARED " " " ") target_link_libraries (f90_ex_${example}-shared ${HDF5_F90_LIBSH_TARGET} @@ -71,7 +69,6 @@ endforeach () foreach (example ${F2003_examples}) add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f03_ex_${example} STATIC) TARGET_FORTRAN_PROPERTIES (f03_ex_${example} STATIC " " " ") target_link_libraries (f03_ex_${example} ${HDF5_F90_LIB_TARGET} @@ -85,7 +82,6 @@ foreach (example ${F2003_examples}) ) if (BUILD_SHARED_LIBS) add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f03_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f03_ex_${example}-shared SHARED " " " ") target_link_libraries (f03_ex_${example}-shared ${HDF5_F90_LIBSH_TARGET} @@ -102,7 +98,6 @@ endforeach () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) - TARGET_NAMING (f90_ex_ph5example STATIC) TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example STATIC " " " ") target_link_libraries (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} @@ -116,7 +111,6 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ) if (BUILD_SHARED_LIBS) add_executable (f90_ex_ph5example-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) - TARGET_NAMING (f90_ex_ph5example-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example-shared SHARED " " " ") target_link_libraries (f90_ex_ph5example-shared ${HDF5_F90_LIBSH_TARGET} diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 9f2d593..e9eed90 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -195,7 +195,6 @@ add_executable (testhdf5_fortran tH5Z.F90 tHDF5.F90 ) -TARGET_NAMING (testhdf5_fortran STATIC) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran STATIC " " " ") target_link_libraries (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET} @@ -231,7 +230,6 @@ if (BUILD_SHARED_LIBS) tH5Z.F90 tHDF5.F90 ) - TARGET_NAMING (testhdf5_fortran-shared SHARED) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran-shared SHARED " " " ") target_link_libraries (testhdf5_fortran-shared ${HDF5_F90_TEST_LIBSH_TARGET} @@ -259,7 +257,6 @@ add_executable (testhdf5_fortran_1_8 tH5MISC_1_8.F90 tHDF5_1_8.F90 ) -TARGET_NAMING (testhdf5_fortran_1_8 STATIC) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 STATIC " " " ") target_link_libraries (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET} @@ -286,7 +283,6 @@ if (BUILD_SHARED_LIBS) tH5MISC_1_8.F90 tHDF5_1_8.F90 ) - TARGET_NAMING (testhdf5_fortran_1_8-shared SHARED) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8-shared SHARED " " " ") target_link_libraries (testhdf5_fortran_1_8-shared ${HDF5_F90_TEST_LIBSH_TARGET} @@ -316,7 +312,6 @@ add_executable (fortranlib_test_F03 tH5T_F03.F90 tHDF5_F03.F90 ) -TARGET_NAMING (fortranlib_test_F03 STATIC) TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 STATIC " " " ") target_link_libraries (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET} @@ -345,7 +340,6 @@ if (BUILD_SHARED_LIBS) tH5T_F03.F90 tHDF5_F03.F90 ) - TARGET_NAMING (fortranlib_test_F03-shared SHARED) TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03-shared SHARED " " " ") target_link_libraries (fortranlib_test_F03-shared ${HDF5_F90_TEST_LIBSH_TARGET} @@ -367,7 +361,6 @@ endif () #-- Adding test for fflush1 add_executable (fflush1 fflush1.F90) -TARGET_NAMING (fflush1 STATIC) TARGET_FORTRAN_PROPERTIES (fflush1 STATIC " " " ") target_link_libraries (fflush1 ${HDF5_F90_LIB_TARGET} @@ -387,7 +380,6 @@ add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_executable (fflush1-shared fflush1.F90) - TARGET_NAMING (fflush1-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush1-shared SHARED " " " ") target_link_libraries (fflush1-shared ${HDF5_F90_LIBSH_TARGET} @@ -408,7 +400,6 @@ endif () #-- Adding test for fflush2 add_executable (fflush2 fflush2.F90) -TARGET_NAMING (fflush2 STATIC) TARGET_FORTRAN_PROPERTIES (fflush2 STATIC " " " ") target_link_libraries (fflush2 ${HDF5_F90_TEST_LIB_TARGET} @@ -428,7 +419,6 @@ add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_executable (fflush2-shared fflush2.F90) - TARGET_NAMING (fflush2-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush2-shared SHARED " " " ") target_link_libraries (fflush2-shared ${HDF5_F90_TEST_LIBSH_TARGET} diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 4aa7f43..ed9d28c 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -16,7 +16,6 @@ add_executable (parallel_test hyper.f90 mdset.f90 ) -TARGET_NAMING (parallel_test STATIC) TARGET_FORTRAN_PROPERTIES (parallel_test STATIC " " " ") target_link_libraries (parallel_test ${HDF5_F90_TEST_LIB_TARGET} diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 33ad1e5..8c48795 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -11,7 +11,6 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_DIR}/src) # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- add_executable (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) -TARGET_NAMING (ptExampleFL STATIC) TARGET_C_PROPERTIES (ptExampleFL STATIC " " " ") target_link_libraries ( ptExampleFL diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index a2f9429..54afd7c 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -17,7 +17,6 @@ INCLUDE_DIRECTORIES (${HDF5_CPP_SRC_DIR}/src) add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) TARGET_C_PROPERTIES (hl_ptableTest STATIC " " " ") -TARGET_NAMING (hl_ptableTest STATIC) target_link_libraries ( hl_ptableTest ${HDF5_LIB_TARGET} diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 1144e0f..68f0128 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -28,7 +28,6 @@ set (examples foreach (example ${examples}) add_executable (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) - TARGET_NAMING (hl_ex_${example} STATIC) 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) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index dfe6102..d920d64 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -16,7 +16,6 @@ set (examples 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} ${HDF5_HL_F90_LIB_TARGET} diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index fbd31c5..b264d5f 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -8,7 +8,6 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ #-- Adding test for hl_f90_tstds add_executable (hl_f90_tstds tstds.F90) -TARGET_NAMING (hl_f90_tstds STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds STATIC " " " ") target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) target_include_directories (hl_f90_tstds PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) @@ -16,7 +15,6 @@ set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstds-shared tstds.F90) - TARGET_NAMING (hl_f90_tstds-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds-shared SHARED " " " ") target_link_libraries (hl_f90_tstds-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) target_include_directories (hl_f90_tstds-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) @@ -29,7 +27,6 @@ endif () #-- Adding test for hl_f90_tstlite add_executable (hl_f90_tstlite tstlite.F90) -TARGET_NAMING (hl_f90_tstlite STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite STATIC " " " ") target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}) target_include_directories (hl_f90_tstlite PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) @@ -37,7 +34,6 @@ set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstlite-shared tstlite.F90) - TARGET_NAMING (hl_f90_tstlite-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite-shared SHARED " " " ") target_link_libraries (hl_f90_tstlite-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}) target_include_directories (hl_f90_tstlite-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) @@ -50,7 +46,6 @@ endif () #-- Adding test for hl_f90_tstimage add_executable (hl_f90_tstimage tstimage.F90) -TARGET_NAMING (hl_f90_tstimage STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage STATIC " " " ") target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) target_include_directories (hl_f90_tstimage PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) @@ -58,7 +53,6 @@ set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstimage-shared tstimage.F90) - TARGET_NAMING (hl_f90_tstimage-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage-shared SHARED " " " ") target_link_libraries (hl_f90_tstimage-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) target_include_directories (hl_f90_tstimage-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) @@ -71,7 +65,6 @@ endif () #-- Adding test for hl_f90_tsttable add_executable (hl_f90_tsttable tsttable.F90) -TARGET_NAMING (hl_f90_tsttable STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable STATIC " " " ") target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}) target_include_directories (hl_f90_tsttable PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) @@ -79,7 +72,6 @@ set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) add_executable (hl_f90_tsttable-shared tsttable.F90) - TARGET_NAMING (hl_f90_tsttable-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable-shared SHARED " " " ") target_link_libraries (hl_f90_tsttable-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}) target_include_directories (hl_f90_tsttable-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 8845505..82a3c1b 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -22,7 +22,6 @@ include_directories (${HDF5_TEST_SRC_DIR}) # -------------------------------------------------------------------- MACRO (HL_ADD_EXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) - TARGET_NAMING (hl_${hl_name} STATIC) TARGET_C_PROPERTIES (hl_${hl_name} STATIC " " " ") target_link_libraries (hl_${hl_name} ${HDF5_HL_LIB_TARGET} @@ -34,7 +33,6 @@ ENDMACRO () MACRO (HL_ADD_SHEXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) - TARGET_NAMING (hl_${hl_name} SHARED) TARGET_C_PROPERTIES (hl_${hl_name} SHARED " " " ") target_link_libraries (hl_${hl_name} ${HDF5_HL_LIBSH_TARGET} @@ -55,7 +53,6 @@ HL_ADD_EXE (test_dset_append) # test_packet has two source files add_executable (hl_test_packet test_packet.c test_packet_vlen.c) -TARGET_NAMING (hl_test_packet STATIC) TARGET_C_PROPERTIES (hl_test_packet STATIC " " " ") target_link_libraries (hl_test_packet ${HDF5_HL_LIB_TARGET} @@ -70,7 +67,6 @@ set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (hl_gen_test_ds gen_test_ds.c) - TARGET_NAMING (hl_gen_test_ds STATIC) TARGET_C_PROPERTIES (hl_gen_test_ds STATIC " " " ") target_link_libraries (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} @@ -80,7 +76,6 @@ if (HDF5_BUILD_GENERATORS) set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) add_executable (hl_gen_test_ld gen_test_ld.c) - TARGET_NAMING (hl_gen_test_ld STATIC) TARGET_C_PROPERTIES (hl_gen_test_ld STATIC " " " ") target_link_libraries (hl_gen_test_ld ${HDF5_HL_LIB_TARGET} diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 9d7a406..34d7074 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -18,7 +18,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}) add_executable (gif2h5 ${GIF2H5_SOURCES}) -TARGET_NAMING (gif2h5 STATIC) TARGET_C_PROPERTIES (gif2h5 STATIC " " " ") target_link_libraries (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (gif2h5 PROPERTIES FOLDER tools/hl) @@ -30,7 +29,6 @@ set (hdf2gif_SOURCES ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdfgifwr.c ) add_executable (h52gif ${hdf2gif_SOURCES}) -TARGET_NAMING (h52gif STATIC) TARGET_C_PROPERTIES (h52gif STATIC " " " ") target_link_libraries (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h52gif PROPERTIES FOLDER tools/hl) @@ -44,7 +42,6 @@ if (BUILD_TESTING) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (hl_h52gifgentest ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/h52gifgentst.c) - TARGET_NAMING (hl_h52gifgentest STATIC) TARGET_C_PROPERTIES (hl_h52gifgentest STATIC " " " ") target_link_libraries (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index 6b8d5f2..d0764c9 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -14,7 +14,6 @@ include_directories (${HDF5_HL_TOOLS_DIR}/src) include_directories (${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}) add_executable (h5watch ${H5WATCH_SOURCES}) -TARGET_NAMING (h5watch STATIC) TARGET_C_PROPERTIES (h5watch STATIC " " " ") target_link_libraries (h5watch ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5watch PROPERTIES FOLDER tools/hl) @@ -27,7 +26,6 @@ if (BUILD_TESTING) ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/swmr_check_compat_vfd.c ) add_executable (hl_swmr_check_compat_vfd ${hl_swmr_check_compat_vfd_SOURCES}) - TARGET_NAMING (hl_swmr_check_compat_vfd STATIC) TARGET_C_PROPERTIES (hl_swmr_check_compat_vfd STATIC " " " ") target_link_libraries (hl_swmr_check_compat_vfd ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (hl_swmr_check_compat_vfd PROPERTIES FOLDER tools/hl) @@ -37,13 +35,11 @@ if (BUILD_TESTING) ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/extend_dset.c ) add_executable (extend_dset ${extend_dset_SOURCES}) - TARGET_NAMING (extend_dset STATIC) TARGET_C_PROPERTIES (extend_dset STATIC " " " ") target_link_libraries (extend_dset ${HDF5_HL_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (extend_dset PROPERTIES FOLDER tools/hl) add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c) - TARGET_NAMING (h5watchgentest STATIC) TARGET_C_PROPERTIES (h5watchgentest STATIC " " " ") target_link_libraries (h5watchgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5watchgentest PROPERTIES FOLDER generator/tools/hl) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index b95ede7..3e8bc8b 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -62,8 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$:_DEBUG>>;") add_test ( NAME JAVA_datasets-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 9c6e29f..b79ba64 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -62,8 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$:_DEBUG>>;") add_test ( NAME JAVA_datatypes-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 5bf5040..56c92fe 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -61,8 +61,7 @@ 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) - string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$:_DEBUG>>;") add_test ( NAME JAVA_groups-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 0e5ae79..495ec5e 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -63,8 +63,7 @@ foreach (example ${HDF_JAVA_OBJECT_EXAMPLES}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$:_DEBUG>>;") add_test ( NAME JAVA_intro-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 10d1b6d..ea9665b 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -57,9 +57,7 @@ SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED ${HDF5_JAVA_PACKAGE_SOVERSION}) if (WIN32) get_filename_component (HDF5_JAVA_JNI_DLL_NAME ${HDF5_JAVA_JNI_LIB_TARGET} NAME_WE) - if (CMAKE_BUILD_TYPE MATCHES Debug) - set (HDF5_JAVA_JNI_DLL_NAME "${HDF5_JAVA_JNI_DLL_NAME}_D") - endif () + set (HDF5_JAVA_JNI_DLL_NAME "${HDF5_JAVA_JNI_DLL_NAME}$<$:_D>") # message (STATUS "HDF5_JAVA_JNI_DLL_NAME: ${HDF5_JAVA_JNI_DLL_NAME}") if (BUILD_TESTING) add_custom_target (HDF5_JAVA_JNI-Test-Copy ALL diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 5c8fa8d..49cda32 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -88,8 +88,7 @@ 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)") -string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) -set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$:_DEBUG>>;") add_test ( NAME JUnit-interface-clearall-objects COMMAND ${CMAKE_COMMAND} diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index ecf972d..5993a0f 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.10.1. 2. You have installed the HDF5 library built with CMake, by executing the HDF Install Utility (the *.msi file in the binary package for @@ -101,10 +101,10 @@ These steps are described in more detail below. * Unix Makefiles * 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 + * Visual Studio 15 2017 + * Visual Studio 15 2017 Win64 is: * BUILD_TESTING:BOOL=ON @@ -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.10.1) project (HDF5MyApp C CXX) set (LIB_TYPE STATIC) # or SHARED @@ -194,7 +194,6 @@ set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_${LIB_TYPE}_LIBRARY}) set (example hdf_example) add_executable (${example} ${PROJECT_SOURCE_DIR}/${example}.c) -TARGET_NAMING (${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (${example} ${LIB_TYPE} " " " ") target_link_libraries (${example} ${LINK_LIBS}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 713f2bd..5e0c990 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -172,13 +172,11 @@ set (testhdf5_SOURCES #-- Adding test for testhdf5 add_executable (testhdf5 ${testhdf5_SOURCES}) -TARGET_NAMING (testhdf5 STATIC) TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET}) set_target_properties (testhdf5 PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (testhdf5-shared ${testhdf5_SOURCES}) - TARGET_NAMING (testhdf5-shared SHARED) TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (testhdf5-shared PROPERTIES FOLDER test) @@ -186,13 +184,11 @@ endif () MACRO (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) - TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET}) set_target_properties (${file} PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) - TARGET_NAMING (${file}-shared SHARED) TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (${file}-shared PROPERTIES FOLDER test) @@ -299,7 +295,6 @@ 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) @@ -308,7 +303,6 @@ if (BUILD_SHARED_LIBS) ${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) @@ -316,13 +310,11 @@ endif () #-- Adding test for hyperslab add_executable (hyperslab ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) -TARGET_NAMING (hyperslab STATIC) TARGET_C_PROPERTIES (hyperslab STATIC " " " ") target_link_libraries (hyperslab ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (hyperslab PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (hyperslab-shared ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) - TARGET_NAMING (hyperslab-shared SHARED) TARGET_C_PROPERTIES (hyperslab-shared SHARED " " " ") target_link_libraries (hyperslab-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (hyperslab-shared PROPERTIES FOLDER test) @@ -342,7 +334,6 @@ add_executable (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c ) -TARGET_NAMING (ttsafe STATIC) TARGET_C_PROPERTIES (ttsafe STATIC " " " ") target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (ttsafe PROPERTIES FOLDER test) @@ -354,7 +345,6 @@ if (BUILD_SHARED_LIBS) ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c ) - TARGET_NAMING (ttsafe-shared SHARED) TARGET_C_PROPERTIES (ttsafe-shared SHARED " " " ") target_link_libraries (ttsafe-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (ttsafe-shared PROPERTIES FOLDER test) @@ -386,7 +376,6 @@ endforeach () # This has to be copied to the test directory for execve() to find it # and it can't be renamed (i.e., no -shared). add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c) -TARGET_NAMING (accum_swmr_reader STATIC) TARGET_C_PROPERTIES (accum_swmr_reader STATIC " " " ") target_link_libraries (accum_swmr_reader ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (accum_swmr_reader PROPERTIES FOLDER test) @@ -414,13 +403,11 @@ endif () ############################################################################## if (BUILD_SHARED_LIBS) add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) - TARGET_NAMING (filter_plugin SHARED) TARGET_C_PROPERTIES (filter_plugin SHARED " " " ") target_link_libraries (filter_plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (filter_plugin PROPERTIES FOLDER test) else () add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) - TARGET_NAMING (filter_plugin STATIC) TARGET_C_PROPERTIES (filter_plugin STATIC " " " ") target_link_libraries (filter_plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (filter_plugin PROPERTIES FOLDER test) @@ -431,13 +418,11 @@ endif () ############################################################################## 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) @@ -445,13 +430,11 @@ 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) @@ -459,13 +442,11 @@ 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) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index fca2f27..165b6d8 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1345,7 +1345,6 @@ endif () if (HDF5_BUILD_GENERATORS) 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) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index db61d35..d0b74b0 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -28,7 +28,6 @@ set (testphdf5_SOURCES #-- Adding test for testhdf5 add_executable (testphdf5 ${testphdf5_SOURCES}) -TARGET_NAMING (testphdf5 STATIC) TARGET_C_PROPERTIES (testphdf5 STATIC " " " ") target_link_libraries (testphdf5 PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) @@ -38,7 +37,6 @@ set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) - TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 23c8fae..1d9c11e 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5copy and test executables # -------------------------------------------------------------------- add_executable (h5copy ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) -TARGET_NAMING (h5copy STATIC) TARGET_C_PROPERTIES (h5copy STATIC " " " ") target_link_libraries (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5copy PROPERTIES FOLDER tools) @@ -20,7 +19,6 @@ 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) diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index b0cf66e..a485de7 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -13,7 +13,6 @@ add_executable (h5diff ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c ) -TARGET_NAMING (h5diff STATIC) TARGET_C_PROPERTIES (h5diff STATIC " " " ") target_link_libraries (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5diff PROPERTIES FOLDER tools) @@ -26,7 +25,6 @@ if (BUILD_SHARED_LIBS) ${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) @@ -40,7 +38,6 @@ if (H5_HAVE_PARALLEL) ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) - TARGET_NAMING (ph5diff STATIC) TARGET_C_PROPERTIES (ph5diff STATIC " " " ") target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (ph5diff PROPERTIES FOLDER tools) diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index c58b20c..bcfa89c 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -14,7 +14,6 @@ add_executable (h5dump ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) -TARGET_NAMING (h5dump STATIC) TARGET_C_PROPERTIES (h5dump STATIC " " " ") target_link_libraries (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5dump PROPERTIES FOLDER tools) @@ -28,7 +27,6 @@ if (BUILD_SHARED_LIBS) ${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) diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 1e3e62f..0f6d8d9 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5format_convert executables # -------------------------------------------------------------------- add_executable (h5format_convert ${HDF5_TOOLS_SRC_H5FC_SOURCE_DIR}/h5format_convert.c) -TARGET_NAMING (h5format_convert STATIC) TARGET_C_PROPERTIES (h5format_convert STATIC " " " ") target_link_libraries (h5format_convert ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5format_convert PROPERTIES FOLDER tools) diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index bebc6d8..4aa8938 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5import executables # -------------------------------------------------------------------- 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) diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index 1075180..fbd4250 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -10,14 +10,12 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5jam executables # -------------------------------------------------------------------- add_executable (h5jam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5jam.c) -TARGET_NAMING (h5jam STATIC) TARGET_C_PROPERTIES (h5jam STATIC " " " ") target_link_libraries (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5jam PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5jam") add_executable (h5unjam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5unjam.c) -TARGET_NAMING (h5unjam STATIC) TARGET_C_PROPERTIES (h5unjam STATIC " " " ") target_link_libraries (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5unjam PROPERTIES FOLDER tools) diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index 0e3d57f..703e55e 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5ls executable #----------------------------------------------------------------------------- add_executable (h5ls ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) -TARGET_NAMING (h5ls STATIC) TARGET_C_PROPERTIES (h5ls STATIC " " " ") target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5ls PROPERTIES FOLDER tools) @@ -20,7 +19,6 @@ 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) diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index abf4c24..a646819 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -21,7 +21,6 @@ set (REPACK_COMMON_SOURCES ) add_executable (h5repack ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) -TARGET_NAMING (h5repack STATIC) TARGET_C_PROPERTIES (h5repack STATIC " " " ") target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5repack PROPERTIES FOLDER tools) @@ -31,7 +30,6 @@ 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) diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index 60d3f7c..cde81ee 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5stat executables # -------------------------------------------------------------------- add_executable (h5stat ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) -TARGET_NAMING (h5stat STATIC) TARGET_C_PROPERTIES (h5stat STATIC " " " ") target_link_libraries (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5stat PROPERTIES FOLDER tools) @@ -20,7 +19,6 @@ 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) diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 20c9171..313760f 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -11,28 +11,24 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- #-- Misc Executables add_executable (h5debug ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5debug.c) -TARGET_NAMING (h5debug STATIC) TARGET_C_PROPERTIES (h5debug STATIC " " " ") target_link_libraries (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5debug PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5debug") add_executable (h5repart ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5repart.c) -TARGET_NAMING (h5repart STATIC) TARGET_C_PROPERTIES (h5repart STATIC " " " ") target_link_libraries (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repart") add_executable (h5mkgrp ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5mkgrp.c) -TARGET_NAMING (h5mkgrp STATIC) TARGET_C_PROPERTIES (h5mkgrp STATIC " " " ") target_link_libraries (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5mkgrp PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5mkgrp") add_executable (h5clear ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5clear.c) -TARGET_NAMING (h5clear STATIC) TARGET_C_PROPERTIES (h5clear STATIC " " " ") target_link_libraries (h5clear ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5clear PROPERTIES FOLDER tools) diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index c57cd5e..35aee35 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -12,7 +12,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) 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) diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index 9a41fb3..def2e6d 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -11,7 +11,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (h5diffgentest ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/h5diffgentest.c) - TARGET_NAMING (h5diffgentest STATIC) TARGET_C_PROPERTIES (h5diffgentest STATIC " " " ") target_link_libraries (h5diffgentest ${HDF5_LIB_TARGET}) set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 89c7534..c4f2b95 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -39,7 +39,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) - TARGET_NAMING (h5dumpgentest STATIC) TARGET_C_PROPERTIES (h5dumpgentest STATIC " " " ") target_link_libraries (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 7e47b13..497f463 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -10,14 +10,12 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5format_convert test executables # -------------------------------------------------------------------- add_executable (h5fc_chk_idx ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_chk_idx.c) - TARGET_NAMING (h5fc_chk_idx STATIC) TARGET_C_PROPERTIES (h5fc_chk_idx STATIC " " " ") target_link_libraries (h5fc_chk_idx ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5fc_chk_idx PROPERTIES FOLDER tools) if (HDF5_BUILD_GENERATORS) add_executable (h5fc_gentest ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_gentest.c) - TARGET_NAMING (h5fc_gentest STATIC) TARGET_C_PROPERTIES (h5fc_gentest STATIC " " " ") target_link_libraries (h5fc_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools) diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 0d23e5d..36bfbdc 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5import executables # -------------------------------------------------------------------- add_executable (h5importtest ${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/h5importtest.c) - TARGET_NAMING (h5importtest STATIC) TARGET_C_PROPERTIES (h5importtest STATIC " " " ") target_link_libraries (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5importtest PROPERTIES FOLDER tools) diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index 562b4f3..dbac14b 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -11,7 +11,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (h5jamgentest ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/h5jamgentest.c) - TARGET_NAMING (h5jamgentest STATIC) TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) @@ -20,13 +19,11 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) endif () add_executable (getub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/getub.c) -TARGET_NAMING (getub STATIC) TARGET_C_PROPERTIES (getub STATIC " " " ") target_link_libraries (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (getub PROPERTIES FOLDER tools) add_executable (tellub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/tellub.c) -TARGET_NAMING (tellub STATIC) TARGET_C_PROPERTIES (tellub STATIC " " " ") target_link_libraries (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (tellub PROPERTIES FOLDER tools) diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index 9d67ec3..5996fff 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -12,7 +12,6 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) # Add h5Repack test executables # -------------------------------------------------------------------- add_executable (testh5repack_detect_szip ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) -TARGET_NAMING (testh5repack_detect_szip STATIC) TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC " " " ") target_link_libraries (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools) @@ -27,7 +26,6 @@ set (REPACK_COMMON_SOURCES ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.c ) add_executable (h5repacktest ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repacktst.c) -TARGET_NAMING (h5repacktest STATIC) TARGET_C_PROPERTIES (h5repacktest STATIC " " " ") target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5repacktest PROPERTIES FOLDER tools) diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index 10ac5e0..d2a1de2 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -11,7 +11,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (h5stat_gentest ${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/h5stat_gentest.c) - TARGET_NAMING (h5stat_gentest STATIC) TARGET_C_PROPERTIES (h5stat_gentest STATIC " " " ") target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET}) set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 5e3c0a2..48bc8ab 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -11,14 +11,12 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (h5repart_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5repart_gentest.c) - TARGET_NAMING (h5repart_gentest STATIC) TARGET_C_PROPERTIES (h5repart_gentest STATIC " " " ") target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) 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) @@ -29,13 +27,11 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) endif () add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c) - TARGET_NAMING (h5repart_test STATIC) TARGET_C_PROPERTIES (h5repart_test STATIC " " " ") target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart_test 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 " " " ") target_link_libraries (clear_open_chk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (clear_open_chk PROPERTIES FOLDER tools) diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index ec672e5..9092079 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -8,7 +8,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) MACRO (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TOOLS_TEST_MISC_VDS_SOURCE_DIR}/${genfile}.c) - TARGET_NAMING (${genfile} STATIC) TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/tools) diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index 20250c6..581a85e 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -21,7 +21,6 @@ set (h5perf_serial_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c ) add_executable (h5perf_serial ${h5perf_serial_SOURCES}) -TARGET_NAMING (h5perf_serial STATIC) TARGET_C_PROPERTIES (h5perf_serial STATIC " " " ") target_link_libraries (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5perf_serial PROPERTIES FOLDER perform) @@ -33,7 +32,6 @@ if (HDF5_BUILD_PERFORM_STANDALONE) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c ) add_executable (h5perf_serial_alone ${h5perf_serial_alone_SOURCES}) - TARGET_NAMING (h5perf_serial_alone STATIC) TARGET_C_PROPERTIES (h5perf_serial_alone STATIC " " " ") target_link_libraries (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform) @@ -47,7 +45,6 @@ set (chunk_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/chunk.c ) ADD_EXECUTABLE(chunk ${chunk_SOURCES}) -TARGET_NAMING (chunk STATIC) TARGET_C_PROPERTIES (chunk STATIC " " " ") TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (chunk PROPERTIES FOLDER perform) @@ -57,7 +54,6 @@ set (iopipe_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/iopipe.c ) add_executable (iopipe ${iopipe_SOURCES}) -TARGET_NAMING (iopipe STATIC) TARGET_C_PROPERTIES (iopipe STATIC " " " ") target_link_libraries (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (iopipe PROPERTIES FOLDER perform) @@ -67,7 +63,6 @@ set (overhead_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/overhead.c ) add_executable (overhead ${overhead_SOURCES}) -TARGET_NAMING (overhead STATIC) TARGET_C_PROPERTIES (overhead STATIC " " " ") target_link_libraries (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (overhead PROPERTIES FOLDER perform) @@ -77,7 +72,6 @@ set_target_properties (overhead PROPERTIES FOLDER perform) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf_meta.c ) add_executable (perf_meta ${perf_meta_SOURCES}) - TARGET_NAMING (perf_meta STATIC) TARGET_C_PROPERTIES (perf_meta STATIC " " " ") target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (perf_meta PROPERTIES FOLDER perform) @@ -87,7 +81,6 @@ set (zip_perf_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/zip_perf.c ) add_executable (zip_perf ${zip_perf_SOURCES}) -TARGET_NAMING (zip_perf STATIC) TARGET_C_PROPERTIES (zip_perf STATIC " " " ") target_link_libraries (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (zip_perf PROPERTIES FOLDER perform) @@ -99,7 +92,6 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c ) add_executable (h5perf ${h5perf_SOURCES}) - TARGET_NAMING (h5perf STATIC) TARGET_C_PROPERTIES (h5perf STATIC " " " ") target_link_libraries (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf PROPERTIES FOLDER perform) @@ -111,7 +103,6 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c ) add_executable (h5perf_alone ${h5perf_alone_SOURCES}) - TARGET_NAMING (h5perf_alone STATIC) TARGET_C_PROPERTIES (h5perf_alone STATIC " " " ") target_link_libraries (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf_alone PROPERTIES FOLDER perform) -- cgit v0.12 From 601ae0ebbc2b766ebf2662315b3143b0f903d76b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 17 Jan 2018 11:56:42 -0600 Subject: HDFFV-10392 change size of local array to 16 chars --- tools/src/h5repack/h5repack_parse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 05af197..03fcf0e 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -45,9 +45,9 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, 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}; - char stype[6] = {0, 0, 0, 0, 0, 0}; - char smask[3] = {0, 0, 0}; + char scomp[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + char stype[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + char smask[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; obj_list_t* obj_list = NULL; unsigned pixels_per_block; @@ -116,7 +116,6 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, if (c == '=' || i == len - 1) { if (c == '=') { /*one more parameter */ scomp[k] = '\0'; /*cut space */ - /*------------------------------------------------------------------------- * H5Z_FILTER_SZIP * szip has the format SZIP= @@ -236,8 +235,9 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, filt->cd_nelmts = HDstrtoull(stype, NULL, 0); p = 0; } - else + else { filt->cd_values[j++] = (unsigned)HDstrtoul(stype, NULL, 0); + } q = 0; u++; /* skip ',' */ } @@ -462,7 +462,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, return obj_list; } - + /*------------------------------------------------------------------------- * Function: parse_layout * -- cgit v0.12 From 3374818d14c11e9177370fe940c966240de34052 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 18 Jan 2018 14:21:41 -0600 Subject: HDFFV-10393 fix incorrect search for name in h5repack object table --- release_docs/RELEASE.txt | 26 ++++++++++++++++++++++++++ tools/src/h5repack/h5repack_filters.c | 12 +++++++----- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 04f2ce0..790313f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -300,6 +300,32 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5repack + + h5repack incorrectly searched internal object table for name. + + h5repack would search the table of objects for a name, if the + name did not match it tried to determine if the name without a + leading slash would match. The logic was flawed! The table + stored names(paths) without a leading slash and did a strstr + of the table path to the name. + The assumption was that if there was a difference of one then + it was a match, however "pressure" would match "/pressure" as + well as "/pressure1", "/pressure2", etc. Changed logic to remove + any leading slash and then do a full compare of the name. + + (ADB - 2018/01/18, HDFFV-10393) + + - h5repack + + h5repack failed to handle more then 9 chars for int conversion. + + User defined filter parameter conversions would fail for integers + larger then 9 characters. Increased local variable array for storing + the current command line parameter to prevent buffer overflows. + + (ADB - 2018/01/17, HDFFV-10392) + - h5diff h5diff seg faulted if comparing VL strings against fixed strings. diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index 067ebad..ae0bfd5 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -84,7 +84,8 @@ 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; + char *pdest = NULL; + char *pname = NULL; int result; unsigned int i; @@ -94,11 +95,12 @@ static int aux_find_obj(const char* name, /* object name from traverse list */ return (int) i; } - pdest = HDstrstr(name, options->op_tbl->objs[i].path); - result = (int) (pdest - name); + pdest = options->op_tbl->objs[i].path; + if (pdest[0] == '/') pdest++; + pname = name; + if (pname[0] == '/') pname++; - /* found at position 1, meaning without '/' */ - if (pdest != NULL && result == 1) { + if (HDstrcmp(pdest, pname) == 0) { *obj = options->op_tbl->objs[i]; return (int) i; } -- cgit v0.12 From f122d6f27f85245f2f559c85064eabf91a631b27 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Thu, 18 Jan 2018 14:26:13 -0600 Subject: Modify usage description for -j and -k options so that it is more informative. --- tools/src/h5repack/h5repack_main.c | 5 +++-- tools/test/h5repack/testfiles/h5repack-help.txt | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 9a24057..6121f81 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -87,9 +87,9 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n"); PRINTVALSTREAM(rawoutstream, " This option will take precedence over the -j and -k options\n"); PRINTVALSTREAM(rawoutstream, " -j BOUND, --low=BOUND The low bound for library release versions to use when creating\n"); - PRINTVALSTREAM(rawoutstream, " objects in the file\n"); + PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_EARLIEST)\n"); PRINTVALSTREAM(rawoutstream, " -k BOUND, --high=BOUND The high bound for library release versions to use when creating\n"); - PRINTVALSTREAM(rawoutstream, " objects in the file\n"); + PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_LATEST)\n"); PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n"); PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n"); PRINTVALSTREAM(rawoutstream, " -s S[:F], --ssize=S[:F] Shared object header message minimum size\n"); @@ -127,6 +127,7 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct\n"); PRINTVALSTREAM(rawoutstream, " 1: This is H5F_LIBVER_V18 in H5F_libver_t struct\n"); PRINTVALSTREAM(rawoutstream, " 2: This is H5F_LIBVER_V110 in H5F_libver_t struct\n"); + PRINTVALSTREAM(rawoutstream, " (H5F_LIBVER_LATEST is aliased to H5F_LIBVER_V110 for this release\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " FS_STRATEGY is a string indicating the file space strategy used:\n"); PRINTVALSTREAM(rawoutstream, " FSM_AGGR:\n"); diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index da75e9f..723711d 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -10,9 +10,9 @@ usage: h5repack [OPTIONS] file1 file2 -L, --latest Use latest version of file format This option will take precedence over the -j and -k options -j BOUND, --low=BOUND The low bound for library release versions to use when creating - objects in the file + objects in the file (default is H5F_LIBVER_EARLIEST) -k BOUND, --high=BOUND The high bound for library release versions to use when creating - objects in the file + objects in the file (default is H5F_LIBVER_LATEST) -c L1, --compact=L1 Maximum number of links in header messages -d L2, --indexed=L2 Minimum number of links in the indexed format -s S[:F], --ssize=S[:F] Shared object header message minimum size @@ -50,6 +50,7 @@ usage: h5repack [OPTIONS] file1 file2 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct 1: This is H5F_LIBVER_V18 in H5F_libver_t struct 2: This is H5F_LIBVER_V110 in H5F_libver_t struct + (H5F_LIBVER_LATEST is aliased to H5F_LIBVER_V110 for this release FS_STRATEGY is a string indicating the file space strategy used: FSM_AGGR: -- cgit v0.12 From 0f5ada2e0819bc107b2da0fc7d9a93bc4cd5b200 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 18 Jan 2018 16:54:55 -0600 Subject: HDFFV-10385 Refactor out CMAKE_BUILD_TYPE usage --- CMakeLists.txt | 2 +- config/cmake/HDFCompilerFlags.cmake | 4 ++-- config/cmake_ext_mod/HDFMacros.cmake | 19 ++++++------------- test/CMakeTests.cmake | 2 +- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb01cd4..1663df4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -584,7 +584,7 @@ option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF) #----------------------------------------------------------------------------- option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) mark_as_advanced (HDF5_ENABLE_TRACE) -if (CMAKE_BUILD_TYPE MATCHES Debug) +if (${HDF5_CFG_NAME} MATCHES "Debug") add_definitions (-DDEBUG) # Enable tracing of the API if (HDF5_ENABLE_TRACE) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 72d320c..c126b24 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -13,7 +13,7 @@ # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (${HDF5_CFG_NAME} MATCHES "Debug") set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") @@ -26,7 +26,7 @@ if (CMAKE_COMPILER_IS_GNUCC) endif () endif () if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (${HDF5_CFG_NAME} 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") diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 2813de6..d7d256f 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -104,35 +104,28 @@ endmacro () #------------------------------------------------------------------------------- macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) - set (LIB_DEBUG_PREFIX "") if (WIN32) set (LIB_DEBUG_SUFFIX "_D") else () set (LIB_DEBUG_SUFFIX "_debug") endif () if (${libtype} MATCHES "SHARED") - if (WIN32) - set (LIB_RELEASE_NAME "${libname}") - set (LIB_DEBUG_NAME "${libname}_D") - else () - set (LIB_RELEASE_NAME "${libname}") - set (LIB_DEBUG_NAME "${libname}_debug") - endif () + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}") else () if (WIN32) - set (LIB_DEBUG_PREFIX "lib") set (LIB_RELEASE_NAME "lib${libname}") - set (LIB_DEBUG_NAME "lib${libname}_D") + set (LIB_DEBUG_NAME "lib${libname}${LIB_DEBUG_SUFFIX}") else () set (LIB_RELEASE_NAME "${libname}") - set (LIB_DEBUG_NAME "${libname}_debug") + set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}") endif () endif () set_target_properties (${libtarget} PROPERTIES # OUTPUT_NAME -# ${LIB_DEBUG_PREFIX}${libname}$<$:${LIB_DEBUG_SUFFIX}> +# ${LIB_RELEASE_NAME}$<$:${LIB_DEBUG_SUFFIX}> OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} OUTPUT_NAME_RELEASE @@ -173,7 +166,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${HDF5_CFG_NAME} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 165b6d8..dd92065 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1133,7 +1133,7 @@ if (HDF5_TEST_VFD) 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) + if (NOT BUILD_SHARED_LIBS AND NOT ${HDF5_CFG_NAME} MATCHES "Debug") add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -- cgit v0.12 From 608a71200d4f70708c141790ec33f88e2e1a9993 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 19 Jan 2018 10:49:17 -0600 Subject: HDFFV-10385 rename vars and macros --- CMakeLists.txt | 12 +++++------- config/cmake/HDFCompilerFlags.cmake | 4 ++-- config/cmake_ext_mod/HDFMacros.cmake | 26 +++++++++++++------------- fortran/src/CMakeLists.txt | 4 ++-- fortran/test/CMakeLists.txt | 4 ++-- hl/fortran/src/CMakeLists.txt | 4 ++-- release_docs/RELEASE.txt | 4 ++-- test/CMakeTests.cmake | 2 +- 8 files changed, 29 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1663df4..ce0aadf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -409,7 +409,7 @@ include (${HDF_RESOURCES_EXT_DIR}/HDFMacros.cmake) include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake) include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake) -SET_HDF5_BUILD_TYPE() +SET_HDF_BUILD_TYPE() #----------------------------------------------------------------------------- # Setup output Directories @@ -553,11 +553,9 @@ endif () set (EXE_EXT "") if (WIN32) set (EXE_EXT ".exe") - if (NOT CYGWIN) - add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) - add_definitions (-D_CRT_SECURE_NO_WARNINGS) - add_definitions (-D_CONSOLE) - endif () + add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + add_definitions (-D_CONSOLE) endif () if (MSVC) @@ -584,7 +582,7 @@ option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF) #----------------------------------------------------------------------------- option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) mark_as_advanced (HDF5_ENABLE_TRACE) -if (${HDF5_CFG_NAME} MATCHES "Debug") +if (${HDF_CFG_NAME} MATCHES "Debug") add_definitions (-DDEBUG) # Enable tracing of the API if (HDF5_ENABLE_TRACE) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index c126b24..a414cea 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -13,7 +13,7 @@ # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) - if (${HDF5_CFG_NAME} MATCHES "Debug") + if (${HDF_CFG_NAME} MATCHES "Debug") set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") @@ -26,7 +26,7 @@ if (CMAKE_COMPILER_IS_GNUCC) endif () endif () if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - if (${HDF5_CFG_NAME} MATCHES "Debug") + if (${HDF_CFG_NAME} 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") diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index d7d256f..870ff5a 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -11,20 +11,20 @@ # #------------------------------------------------------------------------------- -macro (SET_HDF5_BUILD_TYPE) +macro (SET_HDF_BUILD_TYPE) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) - set(HDF5_CFG_NAME ${CTEST_CONFIGURATION_TYPE}) - set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR}) - set(HDF5_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) + set(HDF_CFG_NAME ${CTEST_CONFIGURATION_TYPE}) + set(HDF_BUILD_TYPE ${CMAKE_CFG_INTDIR}) + set(HDF_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) else() - set(HDF5_CFG_BUILD_TYPE ".") + set(HDF_CFG_BUILD_TYPE ".") if(CMAKE_BUILD_TYPE) - set(HDF5_CFG_NAME ${CMAKE_BUILD_TYPE}) - set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE}) + set(HDF_CFG_NAME ${CMAKE_BUILD_TYPE}) + set(HDF_BUILD_TYPE ${CMAKE_BUILD_TYPE}) else() - set(HDF5_CFG_NAME "Release") - set(HDF5_BUILD_TYPE "Release") + set(HDF_CFG_NAME "Release") + set(HDF_BUILD_TYPE "Release") endif() endif() if(NOT CMAKE_BUILD_TYPE) @@ -166,7 +166,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${HDF5_CFG_NAME} MATCHES "Debug") + if (${HDF_CFG_NAME} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) @@ -181,8 +181,8 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) ) else () set_target_properties (${libtarget} PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) endif () else () @@ -202,7 +202,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) else () if (WIN32 AND NOT MINGW) set_target_properties (${libtarget} PROPERTIES - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) else () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 7ed5fef..b664c50 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -66,10 +66,10 @@ set_target_properties (H5_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) INCLUDE_DIRECTORIES (${HDF5_F90_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index e9eed90..2990bcc 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -34,10 +34,10 @@ set_target_properties (H5_test_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- # Add Test Lib diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 9190354..b1a639a 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -38,10 +38,10 @@ set_target_properties (H5HL_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- # Setup include Directories diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 790313f..3f0ea92 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -59,7 +59,7 @@ New Features Refactor use of CMAKE_BUILD_TYPE for new variable, which understands the type of generator in use. - Added new configuration macros to use new HDF5_BUILD_TYPE variable. This + Added new configuration macros to use new HDF_BUILD_TYPE variable. This variable is set correctly for the type of generator being used for the build. (ADB - 2018/01/08, HDFFV-10385, HDFFV-10296) @@ -242,7 +242,7 @@ Bug Fixes since HDF5-1.10.1 release generators (Visual Studio and XCode) and is optional for single config generators. Created a new macro to check GLOBAL PROPERTY -> GENERATOR_IS_MULTI_CONFIG - Created two new HDF variable, HDF5_BUILD_TYPE and HDF5_CFG_BUILD_TYPE. + Created two new HDF variable, HDF_BUILD_TYPE and HDF_CFG_BUILD_TYPE. Defaults for these variables is "Release". (ADB - 2018/01/10, HDFFV-10385) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index dd92065..e6b364c 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1133,7 +1133,7 @@ if (HDF5_TEST_VFD) 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 ${HDF5_CFG_NAME} MATCHES "Debug") + if (NOT BUILD_SHARED_LIBS AND NOT ${HDF_CFG_NAME} MATCHES "Debug") add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -- cgit v0.12 From a87cf25f2d42f4822b2b62aa15dc1334b3de552c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 Jan 2018 07:59:12 -0600 Subject: HDFFV-10385 Correct name of var --- config/cmake/libhdf5.settings.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 28fb876..7bb426f 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -13,7 +13,7 @@ General Information: Compiling Options: ------------------ - Build Mode: @HDF5_BUILD_TYPE@ + Build Mode: @HDF_BUILD_TYPE@ Debugging Symbols: @SYMBOLS@ Asserts: @ASSERTS@ Profiling: @PROFILING@ -- cgit v0.12 From 7e33ee85b8bd4f9770d9ece1cc2187434e6b4ef9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 Jan 2018 08:55:30 -0600 Subject: HDFFV-10385 test OUTPUT_NAME var for mac --- config/cmake_ext_mod/HDFMacros.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 870ff5a..8584737 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -124,8 +124,8 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set_target_properties (${libtarget} PROPERTIES -# OUTPUT_NAME -# ${LIB_RELEASE_NAME}$<$:${LIB_DEBUG_SUFFIX}> + OUTPUT_NAME + ${LIB_RELEASE_NAME}$<$:${LIB_DEBUG_SUFFIX}> OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} OUTPUT_NAME_RELEASE -- cgit v0.12 From f22d8726707e26b97df38962b404754119e8abd7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 Jan 2018 11:09:58 -0600 Subject: HDFFV-10385 some platforms need this var --- config/cmake_ext_mod/HDFMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 8584737..1326420 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -125,7 +125,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME - ${LIB_RELEASE_NAME}$<$:${LIB_DEBUG_SUFFIX}> + ${LIB_RELEASE_NAME} OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} OUTPUT_NAME_RELEASE -- cgit v0.12 From 8427eefafe7af83dbc133975c3ac2368cf1b08d6 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 22 Jan 2018 17:40:44 -0600 Subject: Fix bounds check for the generation of cache image. --- src/H5Cimage.c | 5 ++++- src/H5Fint.c | 4 ---- src/H5Fsuper.c | 4 ---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/H5Cimage.c b/src/H5Cimage.c index 53d1712..be2560f 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -1382,9 +1382,12 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * Note that under some error conditions, the superblock will be * undefined in this case as well -- if so, assume that the * superblock does not support superblock extension messages. + * Also verify that the file's high_bound is at least release + * 1.10.x, otherwise cancel the request for a cache image */ if((NULL == f->shared->sblock) || - (f->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2)) { + (f->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2) || + (f->shared->high_bound < H5F_LIBVER_V110)) { H5C_cache_image_ctl_t default_image_ctl = H5C__DEFAULT_CACHE_IMAGE_CTL; cache_ptr->image_ctl = default_image_ctl; diff --git a/src/H5Fint.c b/src/H5Fint.c index 9d79481..86627ea 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -930,10 +930,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_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") - /* Format version high bound does not allow the generation of metadata cache image */ - if(f->shared->mdc_initCacheImageCfg.generate_image && f->shared->high_bound < H5F_LIBVER_V110) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "format version out of bound for cache image") - /* Get the VFD values to cache */ f->shared->maxaddr = H5FD_get_maxaddr(lf); if(!H5F_addr_defined(f->shared->maxaddr)) diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index d30434d..4250ff0 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -856,10 +856,6 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial hbool_t rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0); H5O_mdci_t mdci_msg; - /* Message exists but version high bound does not allow it */ - if(f->shared->high_bound < H5F_LIBVER_V110) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "format version out of bound for metadata cache image") - /* 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 -- cgit v0.12 From f0b0c35afb32fd7bb9370acdd01de0e1b3902fb6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 25 Jan 2018 09:58:16 -0600 Subject: HDFFV-10396 Eliminate overuse of h5tools_simple_prefix function --- tools/lib/h5tools_dump.c | 65 --------------- tools/src/h5dump/h5dump_ddl.c | 22 +---- tools/src/h5dump/h5dump_xml.c | 190 ------------------------------------------ 3 files changed, 3 insertions(+), 274 deletions(-) diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index ed7d38a..38ace81 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -2080,7 +2080,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); @@ -2091,7 +2090,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); @@ -2131,7 +2129,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); @@ -2170,7 +2167,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); @@ -2245,7 +2241,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); if(H5Tclose(str_type) < 0) @@ -2288,7 +2283,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_tag failed"); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";", ttag); @@ -2299,7 +2293,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->structblockend); @@ -2318,7 +2311,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ mname = H5Tget_member_name(type, i); if((mtype = H5Tget_member_type(type, i)) >= 0) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_print_datatype(stream, buffer, info, ctx, mtype, TRUE); @@ -2335,7 +2327,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->structblockend); @@ -2360,7 +2351,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE); @@ -2376,7 +2366,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->enumblockend); @@ -2792,7 +2781,6 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, ncols = info->line_ncols; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s %d %s", OBJID, BEGIN, oid, END); @@ -2820,7 +2808,6 @@ h5tools_print_virtual_selection(hid_t vspace, switch(H5Sget_select_type(vspace)) { case H5S_SEL_NONE: /* Nothing selected */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", VDS_NONE); @@ -2833,7 +2820,6 @@ h5tools_print_virtual_selection(hid_t vspace, break; case H5S_SEL_HYPERSLABS: /* "New-style" hyperslab selection defined */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0); h5tools_str_reset(buffer); if (H5Sis_regular_hyperslab(vspace)) { @@ -2856,14 +2842,12 @@ h5tools_print_virtual_selection(hid_t vspace, } h5tools_render_element(stream, info, ctx, buffer, curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->virtualselectionblockend); break; case H5S_SEL_ALL: /* Entire extent selected */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", VDS_ALL); @@ -2956,7 +2940,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, *------------------------------------------------------------------------- */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", STORAGE_LAYOUT, BEGIN); @@ -2967,7 +2950,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, case H5D_CHUNKED: ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s ", CHUNKED); @@ -2980,7 +2962,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); @@ -3036,14 +3017,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, case H5D_COMPACT: ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", COMPACT); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); @@ -3063,14 +3042,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; if (next) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", CONTIGUOUS); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", EXTERNAL, BEGIN); @@ -3081,7 +3058,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, H5Pget_external(dcpl_id, j, sizeof(name), name, &offset, &size); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILENAME %s SIZE " HSIZE_T_FORMAT, name, size); @@ -3091,7 +3067,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3101,21 +3076,18 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, haddr_t ioffset; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", CONTIGUOUS); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer,"SIZE " HSIZE_T_FORMAT, storage_size); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); ioffset = H5Dget_offset(obj_id); @@ -3143,7 +3115,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, hid_t virtual_srcspace = H5Pget_virtual_srcspace(dcpl_id, next); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %ld %s ", VDS_MAPPING, next, BEGIN); @@ -3152,7 +3123,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_VIRTUAL, BEGIN); @@ -3165,14 +3135,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_SOURCE, BEGIN); @@ -3190,7 +3158,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, H5Pget_virtual_dsetname(dcpl_id, next, dsetname, sizeof(dsetname)); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_SRC_FILE, h5tools_dump_header_format->virtualfilenamebegin); @@ -3199,7 +3166,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_SRC_DATASET, h5tools_dump_header_format->virtualdatasetnamebegin); @@ -3212,7 +3178,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3221,7 +3186,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3241,7 +3205,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, }/*switch*/ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3253,7 +3216,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, */ if (H5D_VIRTUAL != stl) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", FILTERS, BEGIN); @@ -3271,7 +3233,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, continue; /* nothing to print for invalid filter */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); switch(filtn) { @@ -3297,14 +3258,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "PIXELS_PER_BLOCK %d", szip_pixels_per_block); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); if(szip_options_mask & H5_SZIP_CHIP_OPTION_MASK) @@ -3314,7 +3273,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); if(szip_options_mask & H5_SZIP_EC_OPTION_MASK) @@ -3324,7 +3282,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); if(szip_options_mask & H5_SZIP_LSB_OPTION_MASK) @@ -3335,7 +3292,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, if(szip_options_mask & H5_SZIP_RAW_OPTION_MASK) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "HEADER %s", "RAW"); @@ -3345,7 +3301,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3366,7 +3321,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILTER_ID %d", filtn); @@ -3374,7 +3328,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, if(f_name[0] != '\0') { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "COMMENT %s", f_name); @@ -3382,7 +3335,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, } if (cd_nelmts) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ","PARAMS", BEGIN); @@ -3394,7 +3346,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s",END); @@ -3406,7 +3357,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, else { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "NONE"); @@ -3415,7 +3365,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s",END); @@ -3427,7 +3376,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, *------------------------------------------------------------------------- */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", FILLVALUE, BEGIN); @@ -3436,7 +3384,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILL_TIME "); @@ -3460,7 +3407,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s ", "VALUE "); @@ -3486,7 +3432,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3498,7 +3443,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, */ if (H5D_VIRTUAL != stl) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "ALLOCATION_TIME %s", BEGIN); @@ -3507,7 +3451,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); H5Pget_alloc_time(dcpl_id, &at); @@ -3532,7 +3475,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3626,7 +3568,6 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, ncols = info->line_ncols; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", @@ -3663,7 +3604,6 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, } ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); @@ -3782,7 +3722,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, ncols = info->line_ncols; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->subsettingbegin, h5tools_dump_header_format->subsettingblockbegin); @@ -3791,7 +3730,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->startbegin, h5tools_dump_header_format->startblockbegin); @@ -3800,7 +3738,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->stridebegin, h5tools_dump_header_format->strideblockbegin); @@ -3809,7 +3746,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->countbegin, h5tools_dump_header_format->countblockbegin); @@ -3823,7 +3759,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->blockbegin, h5tools_dump_header_format->blockblockbegin); diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index eecd113..6646626 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -155,7 +155,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED * return ret; } - + /*------------------------------------------------------------------------- * Function: dump_all_cb * @@ -291,7 +291,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -303,7 +302,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -327,7 +325,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR } else if(found_obj->displayed) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -348,7 +345,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -436,7 +432,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR /* 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); @@ -447,7 +442,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -472,7 +466,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -501,7 +494,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -509,7 +501,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR 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); @@ -522,7 +513,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR } /* end else */ } /* end else */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -544,7 +534,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR case H5L_TYPE_HARD: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -556,7 +545,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR 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, "LINKCLASS %d", linfo->type); @@ -565,7 +553,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR ctx.indent_level--; 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->udlinkblockend)) { @@ -926,7 +913,6 @@ dump_group(hid_t gid, const char *name) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1169,7 +1155,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) h5tools_dump_data(rawoutstream, outputformat, &ctx, obj_id, print_dataset, sset, display_index, display_char); } - + /*------------------------------------------------------------------------- * Function: dump_fcpl * @@ -1614,7 +1600,6 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H HDmemset(&buffer, 0, sizeof(h5tools_str_t)); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1626,7 +1611,6 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H error_msg("unable to open object \"%s\"\n", obj_name); 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->attributeblockend)) { @@ -2081,7 +2065,7 @@ handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED * data, int pe } } - + /*------------------------------------------------------------------------- * Function: dump_extlink * diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index a83ec08..4e13df3 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -231,7 +231,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -243,7 +242,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -278,7 +276,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -298,7 +295,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -310,7 +306,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -405,7 +400,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ 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); @@ -427,7 +421,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ 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); @@ -492,7 +485,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -539,7 +531,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -905,7 +896,6 @@ xml_print_datatype(hid_t type, unsigned in_group) as it's name. */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -918,7 +908,6 @@ xml_print_datatype(hid_t type, unsigned in_group) char *t_objname = xml_escape_the_name(found_obj->objname); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -931,7 +920,6 @@ xml_print_datatype(hid_t type, unsigned in_group) } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -944,7 +932,6 @@ xml_print_datatype(hid_t type, unsigned in_group) switch (H5Tget_class(type)) { case H5T_INTEGER: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -957,7 +944,6 @@ xml_print_datatype(hid_t type, unsigned in_group) sgn = H5Tget_sign(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1002,7 +988,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1018,7 +1003,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ord = H5Tget_order(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1027,7 +1011,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1061,7 +1044,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1071,7 +1053,6 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_TIME: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1080,7 +1061,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1090,7 +1070,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1106,7 +1085,6 @@ xml_print_datatype(hid_t type, unsigned in_group) is_vlstr = H5Tis_variable_str(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1116,7 +1094,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1144,7 +1121,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1157,7 +1133,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ord = H5Tget_order(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1166,7 +1141,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1193,7 +1167,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1205,7 +1178,6 @@ xml_print_datatype(hid_t type, unsigned in_group) /* */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1215,7 +1187,6 @@ xml_print_datatype(hid_t type, unsigned in_group) mname = H5Tget_tag(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1227,7 +1198,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1242,7 +1212,6 @@ xml_print_datatype(hid_t type, unsigned in_group) nmembers = (unsigned)H5Tget_nmembers(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1262,7 +1231,6 @@ xml_print_datatype(hid_t type, unsigned in_group) t_fname = xml_escape_the_name(mname); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1275,7 +1243,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1288,7 +1255,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1298,7 +1264,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1309,7 +1274,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1319,7 +1283,6 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_REFERENCE: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1329,7 +1292,6 @@ xml_print_datatype(hid_t type, unsigned in_group) /* Only Object references supported at this time */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1338,7 +1300,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1347,7 +1308,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1356,7 +1316,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1369,7 +1328,6 @@ xml_print_datatype(hid_t type, unsigned in_group) nmembs = H5Tget_nmembers(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1379,7 +1337,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1388,7 +1345,6 @@ xml_print_datatype(hid_t type, unsigned in_group) xml_print_enum(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1398,7 +1354,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1408,7 +1363,6 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_VLEN: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1419,7 +1373,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1432,7 +1385,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1442,7 +1394,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1458,7 +1409,6 @@ xml_print_datatype(hid_t type, unsigned in_group) /* Print lead-in */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1474,7 +1424,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; 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); @@ -1487,7 +1436,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1500,7 +1448,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1510,7 +1457,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1524,7 +1470,6 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_NCLASSES: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1606,7 +1551,6 @@ xml_dump_datatype(hid_t type) */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1619,7 +1563,6 @@ xml_dump_datatype(hid_t type) char *t_objname = xml_escape_the_name(found_obj->objname); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1632,7 +1575,6 @@ xml_dump_datatype(hid_t type) } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1642,7 +1584,6 @@ xml_dump_datatype(hid_t type) } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1655,7 +1596,6 @@ xml_dump_datatype(hid_t type) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1720,7 +1660,6 @@ xml_dump_dataspace(hid_t space) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1733,7 +1672,6 @@ xml_dump_dataspace(hid_t space) /* scalar dataspace (just a tag, no XML attrs. defined */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1746,7 +1684,6 @@ xml_dump_dataspace(hid_t space) /* */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1758,7 +1695,6 @@ xml_dump_dataspace(hid_t space) for (i = 0; i < ndims; i++) { if (maxsize[i] == H5S_UNLIMITED) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1768,7 +1704,6 @@ xml_dump_dataspace(hid_t space) } else if (maxsize[i] == (hsize_t) 0) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1778,7 +1713,6 @@ xml_dump_dataspace(hid_t space) } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1790,7 +1724,6 @@ xml_dump_dataspace(hid_t space) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1805,7 +1738,6 @@ xml_dump_dataspace(hid_t space) 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, "<%sNullDataspace />",xmlnsprefix); @@ -1817,7 +1749,6 @@ xml_dump_dataspace(hid_t space) case H5S_NO_CLASS: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1828,7 +1759,6 @@ xml_dump_dataspace(hid_t space) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1899,7 +1829,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, outputformat = &string_dataformat; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1909,7 +1838,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2005,7 +1933,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2031,7 +1958,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2092,7 +2018,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED outputformat = &string_dataformat; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2128,7 +2053,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2136,7 +2060,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED 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); @@ -2144,7 +2067,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED 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); @@ -2152,7 +2074,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED 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); @@ -2160,7 +2081,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED 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); @@ -2173,7 +2093,6 @@ 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); @@ -2184,7 +2103,6 @@ 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); @@ -2192,7 +2110,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); 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); @@ -2200,7 +2117,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED 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); @@ -2209,7 +2125,6 @@ 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); @@ -2219,7 +2134,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED xml_print_refs(attr_id, ATTRIBUTE_DATA); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2228,7 +2142,6 @@ 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); @@ -2238,7 +2151,6 @@ 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); @@ -2251,7 +2163,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED case H5T_NCLASSES: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2259,7 +2170,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED 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); @@ -2267,7 +2177,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED 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); @@ -2275,7 +2184,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED 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); @@ -2288,7 +2196,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED /* The case of an attribute never yet written ?? * 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); @@ -2298,7 +2205,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2308,7 +2214,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2323,7 +2228,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED H5Aclose(attr_id); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2338,7 +2242,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2348,7 +2251,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2435,7 +2337,6 @@ 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); @@ -2450,7 +2351,6 @@ xml_dump_named_datatype(hid_t type, const char *name) 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); @@ -2487,7 +2387,6 @@ xml_dump_named_datatype(hid_t type, const char *name) 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); @@ -2497,7 +2396,6 @@ xml_dump_named_datatype(hid_t type, const char *name) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2515,7 +2413,6 @@ xml_dump_named_datatype(hid_t type, const char *name) dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2529,7 +2426,6 @@ xml_dump_named_datatype(hid_t type, const char *name) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2540,7 +2436,6 @@ xml_dump_named_datatype(hid_t type, const char *name) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2680,7 +2575,6 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID("/", grpxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2695,7 +2589,6 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID(par, parentxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2715,7 +2608,6 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID(par, parentxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2739,7 +2631,6 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID("/", grpxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2755,7 +2646,6 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID(par, parentxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2825,7 +2715,6 @@ xml_dump_group(hid_t gid, const char *name) char *parentxid = (char *)HDmalloc((size_t)100); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2898,7 +2787,6 @@ xml_dump_group(hid_t gid, const char *name) } ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3025,7 +2913,6 @@ xml_print_refs(hid_t did, int source) if (!path) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3036,7 +2923,6 @@ xml_print_refs(hid_t did, int source) char *t_path = xml_escape_the_string(path, -1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3182,7 +3068,6 @@ xml_print_strs(hid_t did, int source) if (!onestring) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3290,7 +3175,6 @@ check_filters(hid_t dcpl) if (filter == H5Z_FILTER_DEFLATE) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3309,7 +3193,6 @@ check_filters(hid_t dcpl) else if (filter == H5Z_FILTER_FLETCHER32) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3320,7 +3203,6 @@ check_filters(hid_t dcpl) else if (filter == H5Z_FILTER_SHUFFLE) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3332,7 +3214,6 @@ check_filters(hid_t dcpl) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3426,7 +3307,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3444,7 +3324,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) const char * path = lookup_ref_path(*(hobj_ref_t *) buf); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3452,7 +3331,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); if (!path) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3463,7 +3341,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) char *t_path = xml_escape_the_string(path, -1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3473,7 +3350,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) } ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3483,7 +3359,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) else if (H5Tget_class(type) == H5T_STRING) { /* ????? */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3491,7 +3366,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) 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); @@ -3503,7 +3377,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) switch (H5Tget_class(type)) { case H5T_INTEGER: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3519,7 +3392,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) 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); @@ -3528,7 +3400,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_FLOAT: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3544,7 +3415,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) 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); @@ -3554,7 +3424,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) case H5T_BITFIELD: case H5T_OPAQUE: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3576,7 +3445,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) 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); @@ -3585,7 +3453,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_ENUM: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3603,7 +3470,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) if(name) H5free_memory(name); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3612,7 +3478,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_ARRAY: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3620,7 +3485,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) 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); @@ -3629,7 +3493,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_TIME: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3637,7 +3500,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) 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); @@ -3646,7 +3508,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_COMPOUND: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3654,7 +3515,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) 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); @@ -3663,7 +3523,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_VLEN: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3671,7 +3530,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) 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); @@ -3684,7 +3542,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) case H5T_REFERENCE: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3692,7 +3549,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) 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); @@ -3706,7 +3562,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3793,7 +3648,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s xml_name_to_XID(prefix, pstr, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3828,7 +3682,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3838,7 +3691,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3853,7 +3705,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s 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); @@ -3862,7 +3713,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s } ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3876,7 +3726,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3887,7 +3736,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3897,7 +3745,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3912,7 +3759,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3921,7 +3767,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3930,7 +3775,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3942,7 +3786,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3951,7 +3794,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3960,7 +3802,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3976,7 +3817,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4025,7 +3865,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4037,7 +3876,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4050,7 +3888,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s } ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4061,7 +3898,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4114,7 +3950,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4122,7 +3957,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s 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); @@ -4130,7 +3964,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s 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); @@ -4138,7 +3971,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s 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); @@ -4150,7 +3982,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s case H5T_COMPOUND: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4166,7 +3997,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s case H5T_REFERENCE: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4174,7 +4004,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); 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); @@ -4182,7 +4011,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s 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); @@ -4191,7 +4019,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4201,7 +4028,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s xml_print_refs(did, DATASET_DATA); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4210,7 +4036,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s } ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4222,7 +4047,6 @@ 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); /* Render the element */ h5tools_str_reset(&buffer); @@ -4241,7 +4065,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s case H5T_NCLASSES: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4249,7 +4072,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s 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); @@ -4257,7 +4079,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s 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); @@ -4265,7 +4086,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s 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); @@ -4279,7 +4099,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4288,7 +4107,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4297,7 +4115,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4311,7 +4128,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s H5Pclose(dcpl); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4377,7 +4193,6 @@ xml_print_enum(hid_t type) super = H5Tget_super(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4387,7 +4202,6 @@ xml_print_enum(hid_t type) xml_print_datatype(super,0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4438,7 +4252,6 @@ xml_print_enum(hid_t type) char *t_name = xml_escape_the_name(name[i]); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4456,7 +4269,6 @@ xml_print_enum(hid_t type) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4464,7 +4276,6 @@ xml_print_enum(hid_t type) 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); @@ -4494,7 +4305,6 @@ xml_print_enum(hid_t type) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); -- cgit v0.12 From ad4514ebee259eb8906cecd2c1fd2e20695fd6ea Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 25 Jan 2018 10:32:23 -0600 Subject: HDFFV-10396 Add note --- release_docs/RELEASE.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 3f0ea92..bdf9b9a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -300,6 +300,16 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5dump + + h5dump would output an indented blank line in the filters section. + + h5dump over used the h5tools_simple_prefix function, which is a + function intended to account for the data index (x,y,z) option. + Removed the function call for header information. + + (ADB - 2018/01/25, HDFFV-10396) + - h5repack h5repack incorrectly searched internal object table for name. -- cgit v0.12 From fbcaec3555b6fce1a6be92b019972f51b6a51439 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 25 Jan 2018 11:16:04 -0600 Subject: HDFFV-10396 typo fix --- 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 bdf9b9a..74b73a4 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -304,7 +304,7 @@ Bug Fixes since HDF5-1.10.1 release h5dump would output an indented blank line in the filters section. - h5dump over used the h5tools_simple_prefix function, which is a + h5dump overused the h5tools_simple_prefix function, which is a function intended to account for the data index (x,y,z) option. Removed the function call for header information. -- cgit v0.12 From 3ab1a073688453991b78df300067009cd0c5f610 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 25 Jan 2018 16:54:28 -0600 Subject: Fix missing ext libs references --- CMakeInstallation.cmake | 10 +++++----- CMakeLists.txt | 2 +- config/cmake/hdf5-config.cmake.in | 8 +++++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 8804964..0bfb2cc 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -41,7 +41,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) if (HDF5_EXPORTED_TARGETS) install ( EXPORT ${HDF5_EXPORTED_TARGETS} - DESTINATION ${HDF5_INSTALL_CMAKE_DIR} + DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/hdf5 FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake NAMESPACE ${HDF5_PACKAGE}:: COMPONENT configinstall @@ -84,7 +84,7 @@ set (CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" ) configure_package_config_file ( ${HDF_RESOURCES_DIR}/hdf5-config.cmake.in "${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake" - INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}" + INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}/hdf5" PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}" ) @@ -98,14 +98,14 @@ set (CURRENT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}" ) configure_package_config_file ( ${HDF_RESOURCES_DIR}/hdf5-config.cmake.in "${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake" - INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}" + INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}/hdf5" PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR ) if (NOT HDF5_EXTERNALLY_CONFIGURED) install ( FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake - DESTINATION ${HDF5_INSTALL_CMAKE_DIR} + DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/hdf5 COMPONENT configinstall ) endif () @@ -120,7 +120,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ) install ( FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake - DESTINATION ${HDF5_INSTALL_CMAKE_DIR} + DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/hdf5 COMPONENT configinstall ) endif () diff --git a/CMakeLists.txt b/CMakeLists.txt index ce0aadf..922ada8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,7 +233,7 @@ if (NOT HDF5_INSTALL_DATA_DIR) set (HDF5_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) endif () set (HDF5_INSTALL_DATA_DIR share) - set (HDF5_INSTALL_CMAKE_DIR share/cmake/hdf5) + set (HDF5_INSTALL_CMAKE_DIR share/cmake) else () set (HDF5_INSTALL_DATA_DIR ".") set (HDF5_INSTALL_CMAKE_DIR cmake) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 421f693..574f541 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -105,7 +105,13 @@ set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) # project which has already built hdf5 as a subproject #----------------------------------------------------------------------------- if (NOT TARGET "@HDF5_PACKAGE@") - include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) + if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib") + include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) + endif () + if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip") + include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) + endif () + include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) endif () # Handle default component(static) : -- cgit v0.12 From 707de0b92eb1abeea27350e5630990ff2a33f806 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 26 Jan 2018 15:41:13 -0600 Subject: Fix case of command --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 922ada8..fb1df12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -756,13 +756,13 @@ add_subdirectory (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) 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) + add_dependencies (${HDF5_LIB_TARGET} ZLIB) if (BUILD_SHARED_LIBS) add_dependencies (${HDF5_LIBSH_TARGET} ZLIB) endif () endif () if (SZIP_FOUND AND SZIP_USE_EXTERNAL) - ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP) + add_dependencies (${HDF5_LIB_TARGET} SZIP) if (BUILD_SHARED_LIBS) add_dependencies (${HDF5_LIBSH_TARGET} SZIP) endif () -- cgit v0.12 From 468fbc36f1b02087d6567da7b905b80019cda3bc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 29 Jan 2018 10:27:32 -0600 Subject: Fix windows compile errors abstract out common settings --- CMakeLists.txt | 84 ++-------------------------------- config/cmake/libhdf5.settings.cmake.in | 2 +- config/cmake_ext_mod/HDFMacros.cmake | 84 +++++++++++++++++++++++++++++++++- 3 files changed, 88 insertions(+), 82 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb1df12..3579f6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,51 +199,6 @@ set (HDF5_JAVA_LOGGING_JAR ${HDF5_SOURCE_DIR}/java/lib/slf4j-api-1.7.5.j set (HDF5_JAVA_LOGGING_NOP_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-nop-1.7.5.jar) set (HDF5_JAVA_LOGGING_SIMPLE_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-simple-1.7.5.jar) -if (APPLE) - option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE) -endif () - -if (NOT HDF5_INSTALL_BIN_DIR) - set (HDF5_INSTALL_BIN_DIR bin) -endif () -if (NOT HDF5_INSTALL_LIB_DIR) - if (APPLE) - if (HDF5_BUILD_FRAMEWORKS) - set (HDF5_INSTALL_JAR_DIR ../Java) - else () - set (HDF5_INSTALL_JAR_DIR lib) - endif () - set (HDF5_INSTALL_FMWK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - else () - set (HDF5_INSTALL_JAR_DIR lib) - endif () - set (HDF5_INSTALL_LIB_DIR lib) -endif () -if (NOT HDF5_INSTALL_INCLUDE_DIR) - set (HDF5_INSTALL_INCLUDE_DIR include) -endif () -if (NOT HDF5_INSTALL_DATA_DIR) - if (NOT WIN32) - if (APPLE) - if (HDF5_BUILD_FRAMEWORKS) - set (HDF5_INSTALL_EXTRA_DIR ../SharedSupport) - else () - set (HDF5_INSTALL_EXTRA_DIR share) - endif () - set (HDF5_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - endif () - set (HDF5_INSTALL_DATA_DIR share) - set (HDF5_INSTALL_CMAKE_DIR share/cmake) - else () - set (HDF5_INSTALL_DATA_DIR ".") - set (HDF5_INSTALL_CMAKE_DIR cmake) - endif () -endif () - -if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") - set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) -endif () - #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO #----------------------------------------------------------------------------- @@ -406,46 +361,15 @@ set (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") # Include some macros for reusable code #----------------------------------------------------------------------------- include (${HDF_RESOURCES_EXT_DIR}/HDFMacros.cmake) -include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake) -include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake) -SET_HDF_BUILD_TYPE() +HDF_DIR_PATHS(${HDF5_PACKAGE_NAME}) -#----------------------------------------------------------------------------- -# Setup output Directories -#----------------------------------------------------------------------------- -if (NOT HDF5_EXTERNALLY_CONFIGURED) - set (CMAKE_RUNTIME_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables." - ) - set (CMAKE_LIBRARY_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries" - ) - set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries." - ) - set (CMAKE_Fortran_MODULE_DIRECTORY - ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules." - ) - if (WIN32) - set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE}) - 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}/${CTEST_CONFIGURATION_TYPE}) - 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 () -endif () +include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake) +include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake) #----------------------------------------------------------------------------- # Targets built within this project are exported at Install time for use -# by other projects using FindHDF5. +# by other projects. #----------------------------------------------------------------------------- if (NOT HDF5_EXPORTED_TARGETS) set (HDF5_EXPORTED_TARGETS "hdf5-targets") diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 7bb426f..891e3a7 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -13,7 +13,7 @@ General Information: Compiling Options: ------------------ - Build Mode: @HDF_BUILD_TYPE@ + Build Mode: @CMAKE_BUILD_TYPE@ Debugging Symbols: @SYMBOLS@ Asserts: @ASSERTS@ Profiling: @PROFILING@ diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 1326420..4097ca9 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -166,7 +166,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${HDF_CFG_NAME} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) @@ -331,3 +331,85 @@ macro (HDFTEST_COPY_FILE src dest target) ) list (APPEND ${target}_list "${dest}") endmacro () + +macro (HDF_DIR_PATHS package_prefix) + if (APPLE) + option (${package_prefix}_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE) + endif () + + if (NOT ${package_prefix}_INSTALL_BIN_DIR) + set (${package_prefix}_INSTALL_BIN_DIR bin) + endif () + if (NOT ${package_prefix}_INSTALL_LIB_DIR) + if (APPLE) + if (${package_prefix}_BUILD_FRAMEWORKS) + set (${package_prefix}_INSTALL_JAR_DIR ../Java) + else () + set (${package_prefix}_INSTALL_JAR_DIR lib) + endif () + set (${package_prefix}_INSTALL_FMWK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) + else () + set (${package_prefix}_INSTALL_JAR_DIR lib) + endif () + set (${package_prefix}_INSTALL_LIB_DIR lib) + endif () + if (NOT ${package_prefix}_INSTALL_INCLUDE_DIR) + set (${package_prefix}_INSTALL_INCLUDE_DIR include) + endif () + if (NOT ${package_prefix}_INSTALL_DATA_DIR) + if (NOT WIN32) + if (APPLE) + if (${package_prefix}_BUILD_FRAMEWORKS) + set (${package_prefix}_INSTALL_EXTRA_DIR ../SharedSupport) + else () + set (${package_prefix}_INSTALL_EXTRA_DIR share) + endif () + set (${package_prefix}_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) + endif () + set (${package_prefix}_INSTALL_DATA_DIR share) + set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake) + else () + set (${package_prefix}_INSTALL_DATA_DIR ".") + set (${package_prefix}_INSTALL_CMAKE_DIR cmake) + endif () + endif () + + if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") + set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) + endif () + + SET_HDF_BUILD_TYPE() + +#----------------------------------------------------------------------------- +# Setup output Directories +#----------------------------------------------------------------------------- + if (NOT ${package_prefix}_EXTERNALLY_CONFIGURED) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables." + ) + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries" + ) + set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries." + ) + set (CMAKE_Fortran_MODULE_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules." + ) + if (WIN32) + set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE}) + 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}/${CTEST_CONFIGURATION_TYPE}) + 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 () + endif () +endmacro () + -- cgit v0.12 From f837afc8758c7c0394e2f40d636a8e6319b6b668 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 29 Jan 2018 12:40:52 -0600 Subject: Update reference files for CMake options --- COPYING | 2 +- config/cmake/CTestScript.cmake | 7 - config/cmake/scripts/CTestScript.cmake | 7 - config/cmake/scripts/HDF5config.cmake | 52 +------- config/cmake/scripts/HDF5options.cmake | 26 ++++ release_docs/INSTALL_CMake.txt | 8 -- release_docs/USING_HDF5_CMake.txt | 225 +++++++++++++++++++-------------- 7 files changed, 158 insertions(+), 169 deletions(-) diff --git a/COPYING b/COPYING index 51cb4e6..c668565 100644 --- a/COPYING +++ b/COPYING @@ -99,7 +99,7 @@ and/or accompanying materials: HDF5 is available with the SZIP compression library but SZIP is not part of HDF5 and has separate copyright and license terms. See “Szip Compression -in HDF Products†(www.hdfgroup.org/doc_resource/SZIP/) for further details. +in HDF Products†(https://support.hdfgroup.org/doc_resource/SZIP/) for further details. ----------------------------------------------------------------------------- diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index c59b10c..a8b7bbc 100755 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake @@ -63,13 +63,6 @@ if (APPLE) 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 () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") endif () diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 3cb9a5e..f826e31 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -64,13 +64,6 @@ if (APPLE) 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 () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") endif () diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index d32a6bdb..33d7868 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -32,10 +32,6 @@ 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 -# 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.11.2") @@ -47,10 +43,6 @@ 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 -#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) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 @@ -70,6 +62,7 @@ endif () ################################################################### ### Following Line is one of [Release, RelWithDebInfo, Debug] ##### +### (default use command line -C value) set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") ################################################################### @@ -86,21 +79,6 @@ 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 () -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 () set (CTEST_BINARY_NAME "build") set (CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") @@ -212,34 +190,6 @@ set (REPOSITORY_BRANCH "develop") #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") ################################################################### -################################################################### -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 () -################################################################### -#### 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}") ################################################################### diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index b090434..82ab04a 100755 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -21,6 +21,32 @@ #set(CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0") ############################################################################################# +#### Only build static libraries #### +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") +#### Add PICC option on linux/mac #### +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + +############################################################################################# +#### fortran enabled #### +#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") +#### fortran disabled #### +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") + +############################################################################################# +#### java enabled #### +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") +#### java disabled #### +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + +############################################################################################# +### change install prefix (default use INSTALLDIR value) +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") + +############################################################################################# #### ext libraries #### ### ext libs from tgz diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index f20ca43..8c72685 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -664,10 +664,6 @@ 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 -# 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.11.0") @@ -679,10 +675,6 @@ 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 -#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) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 5993a0f..fc62b75 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -219,129 +219,113 @@ NOTE: this file is available at the HDF web site: http://www.hdfgroup.org/HDF5/release/cmakebuild.html HDF5_Examples.cmake + HDF5_Examples_options.cmake Also available at the HDF web site is a CMake application framework template. You can quickly add files to the framework and execute the script to compile your application with an installed HDF5 binary. ======================================================================== -ctest +ctest use of HDF5_Examples.cmake and HDF5_Examples_options.cmake ======================================================================== 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@") -set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +if("@CMAKE_GENERATOR_TOOLSET@") + set(CMAKE_GENERATOR_TOOLSET "@CMAKE_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; HDF4Examples -#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) - # 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 () -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 () +#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() + +################################################################### +### 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}") +################################################################## + +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 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(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) -# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") -#endif () +#if(NOT DEFINED TAR_SOURCE) +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.5-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}") -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(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(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") +endif() +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org # ############################################################################################################### -#----------------------------------------------------------------------------- -# 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 () +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format for file: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# +if(WIN32) + include(${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) +else() + include(${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) +endif() #----------------------------------------------------------------------------- set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") @@ -415,6 +399,57 @@ endif () #----------------------------------------------------------------------------- ############################################################################################################## +############################################################################################################## +#### HDF5_Examples_options.cmake ### +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +############################################################################################################## +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +#### DEFAULT: ### +#### BUILD_SHARED_LIBS:BOOL=OFF ### +#### HDF_BUILD_C:BOOL=ON ### +#### HDF_BUILD_CXX:BOOL=OFF ### +#### HDF_BUILD_FORTRAN:BOOL=OFF ### +#### HDF_BUILD_JAVA:BOOL=OFF ### +#### BUILD_TESTING:BOOL=OFF ### +#### HDF_ENABLE_PARALLEL:BOOL=OFF ### +#### HDF_ENABLE_THREADSAFE:BOOL=OFF ### +############################################################################################# + +### uncomment/comment and change the following lines for other configuration options +### build with shared libraries +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON") + +############################################################################################# +#### languages #### +### disable C builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_C:BOOL=OFF") + +### enable C++ builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_CXX:BOOL=ON") + +### enable Fortran builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") + +### enable JAVA builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") + +############################################################################################# +### enable parallel program builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON") + +############################################################################################# +### enable threadsafe program builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_THREADSAFE:BOOL=ON") + +############################################################################################# +### enable test program builds, requires reference files in testfiles subdirectory +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=ON") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCOMPARE_TESTING:BOOL=ON") + +############################################################################################# + ======================================================================== -- cgit v0.12 From 6cc86417d5357e4fd018346cc332210ad410b203 Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 30 Jan 2018 09:56:21 -0600 Subject: Increase maximum number of retries to 30 for h5watch tests. --- hl/tools/h5watch/testh5watch.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in index 7514281..3f8f5ae 100644 --- a/hl/tools/h5watch/testh5watch.sh.in +++ b/hl/tools/h5watch/testh5watch.sh.in @@ -44,7 +44,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=20 # Try running the test again +TRY_MAX=30 # 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 -- cgit v0.12 From bd7bc909ed2c950e75772c3876f9a236799565c5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 12:05:22 -0600 Subject: HDFFV-10398 Honor CMAKE_MODULE_PATH when including check modules --- config/cmake_ext_mod/CheckTypeSize.cmake | 61 ------------------------------ config/cmake_ext_mod/ConfigureChecks.cmake | 22 +++++------ 2 files changed, 11 insertions(+), 72 deletions(-) delete mode 100644 config/cmake_ext_mod/CheckTypeSize.cmake diff --git a/config/cmake_ext_mod/CheckTypeSize.cmake b/config/cmake_ext_mod/CheckTypeSize.cmake deleted file mode 100644 index c14c2f2..0000000 --- a/config/cmake_ext_mod/CheckTypeSize.cmake +++ /dev/null @@ -1,61 +0,0 @@ -# -# 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. -# -# CHECK_TYPE_SIZE - macro which checks the size of type -# VARIABLE - variable to store size if the type exists. -# HAVE_${VARIABLE} - does the variable exists or not -# - -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 - "-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 () - - message (STATUS "Check size of ${TYPE}") - if (CMAKE_REQUIRED_LIBRARIES) - set (CHECK_TYPE_SIZE_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" - ) - endif () - try_run (${VARIABLE} HAVE_${VARIABLE} - ${CMAKE_BINARY_DIR} - ${HDF_RESOURCES_EXT_DIR}/CheckTypeSize.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS} - "${CHECK_TYPE_SIZE_ADD_LIBRARIES}" - OUTPUT_VARIABLE OUTPUT - ) - if (HAVE_${VARIABLE}) - message (STATUS "Check size of ${TYPE} - done") - file (APPEND - ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log - "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n" - ) - else () - message (STATUS "Check size of ${TYPE} - failed") - file (APPEND - ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n" - ) - endif () - endif () - set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) -endmacro () diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 56d45f9..e1b8853 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -12,18 +12,18 @@ #----------------------------------------------------------------------------- # Include all the necessary files for macros #----------------------------------------------------------------------------- -include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) -include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) -include (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake) -include (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake) -include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) -include (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) -include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) -include (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) -include (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) -include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) +include (CheckFunctionExists) +include (CheckIncludeFile) +include (CheckIncludeFileCXX) +include (CheckIncludeFiles) +include (CheckLibraryExists) +include (CheckSymbolExists) +include (CheckTypeSize) +include (CheckVariableExists) +include (CheckFortranFunctionExists) +include (TestBigEndian) if (CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER_LOADED) - include (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) + include (TestForSTDNamespace) endif () #----------------------------------------------------------------------------- -- cgit v0.12 From 2f18da435e537118e1405f7f9fef3f3e29a346f2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 12:21:01 -0600 Subject: HDFFV-10398 use the simpler add_subdirectory signature --- CMakeLists.txt | 24 ++++++++++++------------ MANIFEST | 1 - c++/CMakeLists.txt | 6 +++--- fortran/CMakeLists.txt | 8 ++++---- hl/CMakeLists.txt | 8 ++++---- hl/c++/CMakeLists.txt | 6 +++--- hl/fortran/CMakeLists.txt | 6 +++--- hl/tools/CMakeLists.txt | 4 ++-- java/CMakeLists.txt | 6 +++--- java/examples/CMakeLists.txt | 8 ++++---- java/src/CMakeLists.txt | 4 ++-- java/src/hdf/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 6 +++--- tools/src/CMakeLists.txt | 20 ++++++++++---------- tools/test/CMakeLists.txt | 22 +++++++++++----------- tools/test/misc/CMakeLists.txt | 2 +- 16 files changed, 66 insertions(+), 67 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3579f6c..ee5fc2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -676,7 +676,7 @@ endif () #----------------------------------------------------------------------------- # Add the HDF5 Library Target to the build #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) +add_subdirectory (src) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) @@ -721,12 +721,12 @@ if (BUILD_TESTING) if (NOT HDF5_EXTERNALLY_CONFIGURED) 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) + add_subdirectory (tools/lib) + add_subdirectory (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) + add_subdirectory (testpar) endif () endif () endif () @@ -738,7 +738,7 @@ endif () 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) + add_subdirectory (tools) endif () endif () @@ -748,7 +748,7 @@ endif () if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON) if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) + add_subdirectory (examples) endif () endif () @@ -759,7 +759,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" ON) if (HDF5_BUILD_HL_LIB) set (H5_INCLUDE_HL 1) - add_subdirectory (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) + add_subdirectory (hl) endif () endif () @@ -808,11 +808,11 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for # # set (FCFLAGS "${Fortran_DEFINES}") - add_subdirectory (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) + add_subdirectory (fortran) if (HDF5_BUILD_HL_LIB) 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) + add_subdirectory (hl/fortran) endif () endif () endif () @@ -835,11 +835,11 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") if (CMAKE_NO_STD_NAMESPACE) set (H5_NO_STD 1) endif () - add_subdirectory (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) + add_subdirectory (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++) + add_subdirectory (hl/c++) endif () endif () endif () @@ -861,7 +861,7 @@ endif () 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) + add_subdirectory (java) endif () endif () diff --git a/MANIFEST b/MANIFEST index 2db6d6b..a2a78c8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3093,7 +3093,6 @@ ./config/cmake/userblockTest.cmake ./config/cmake/vfdTest.cmake -./config/cmake_ext_mod/CheckTypeSize.cmake ./config/cmake_ext_mod/ConfigureChecks.cmake ./config/cmake_ext_mod/CTestCustom.cmake ./config/cmake_ext_mod/FindMPI.cmake diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index c9c4815..adbf1a4 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -27,18 +27,18 @@ if (H5_HAVE_PARALLEL) add_definitions ("-DMPICH_IGNORE_CXX_SEEK") endif () -add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) +add_subdirectory (src) #----------------------------------------------------------------------------- # Build the CPP Examples #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) + add_subdirectory (examples) endif () #----------------------------------------------------------------------------- # Build the CPP unit tests #----------------------------------------------------------------------------- if (BUILD_TESTING) - add_subdirectory (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) + add_subdirectory (test) endif () diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 075e1da..a0f92d3 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -10,21 +10,21 @@ endif () #----------------------------------------------------------------------------- # Traverse source subdirectory #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) +add_subdirectory (src) #----------------------------------------------------------------------------- # Build the Fortran Examples #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) + add_subdirectory (examples) endif () #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) - add_subdirectory (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) + add_subdirectory (test) if (MPI_Fortran_FOUND) - add_subdirectory (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) + add_subdirectory (testpar) endif () endif () diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index a47e023..d80b4f9 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -12,21 +12,21 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src ) -add_subdirectory (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src) +add_subdirectory (src) #-- Build the High level Tools if (HDF5_BUILD_TOOLS) - add_subdirectory (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) + add_subdirectory (tools) endif () #-- Add High Level Examples if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) + add_subdirectory (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) + add_subdirectory (test) endif () endif () diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 91bfa14..9a1d059 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -4,13 +4,13 @@ PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- # Main HL lib is in /src #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src) +add_subdirectory (src) # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) + add_subdirectory (examples) endif () # -------------------------------------------------------------------- @@ -18,5 +18,5 @@ endif () # -------------------------------------------------------------------- if (BUILD_TESTING) - add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) + add_subdirectory (test) endif () diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index c651ce9..00d7517 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -4,18 +4,18 @@ PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- # List Source files #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) +add_subdirectory (src) #----------------------------------------------------------------------------- # Build the HL Fortran Examples #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples) + add_subdirectory (examples) endif () #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) - add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) + add_subdirectory (test) endif () diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 9536517..43229e8 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,6 +1,6 @@ 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) +add_subdirectory (gif2h5) -add_subdirectory (${HDF5_HL_TOOLS_SOURCE_DIR}/h5watch ${HDF5_HL_TOOLS_BINARY_DIR}/h5watch) +add_subdirectory (h5watch) diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 68860be..9a5692f 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -36,20 +36,20 @@ set (CMAKE_JAVA_INCLUDE_PATH "") #----------------------------------------------------------------------------- # Traverse source subdirectory #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/src ${HDF5_JAVA_BINARY_DIR}/src) +add_subdirectory (src) #----------------------------------------------------------------------------- # Build the Java Examples #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/examples ${HDF5_JAVA_BINARY_DIR}/examples) + add_subdirectory (examples) endif () #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) - add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/test ${HDF5_JAVA_BINARY_DIR}/test) + add_subdirectory (test) endif () #----------------------------------------------------------------------------- diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt index a1a7483..3073918 100644 --- a/java/examples/CMakeLists.txt +++ b/java/examples/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.2.2) PROJECT (HDFJAVA_EXAMPLES) -add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/datasets datasets) -add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/datatypes datatypes) -add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/groups groups) -add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/intro intro) +add_subdirectory (datasets) +add_subdirectory (datatypes) +add_subdirectory (groups) +add_subdirectory (intro) diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index 3f93f39..9bdab4b 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -4,5 +4,5 @@ PROJECT ( HDF5_JAVA_SRC C Java ) #----------------------------------------------------------------------------- # Traverse source subdirectory #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_JAVA_SRC_SOURCE_DIR}/jni ${HDF5_JAVA_SRC_BINARY_DIR}/jni) -add_subdirectory (${HDF5_JAVA_SRC_SOURCE_DIR}/hdf ${HDF5_JAVA_SRC_BINARY_DIR}/hdf) +add_subdirectory (jni) +add_subdirectory (hdf) diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt index 84bda53..649f7d0 100644 --- a/java/src/hdf/CMakeLists.txt +++ b/java/src/hdf/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_JAVA_HDF) -add_subdirectory (${HDF5_JAVA_HDF_SOURCE_DIR}/hdf5lib hdf5lib) +add_subdirectory (hdf5lib) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 4b3b3d5..8d442e0 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -10,7 +10,7 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) # If testing was NOT enabled, then we need to build the tools library # -------------------------------------------------------------------- if (NOT BUILD_TESTING) - add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/lib) + add_subdirectory (lib) endif () #----------------------------------------------------------------------------- @@ -19,9 +19,9 @@ endif () INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) #-- Add the test sources -add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/src) +add_subdirectory (src) #-- Add the tests if (BUILD_TESTING) - add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/test) + add_subdirectory (test) endif () diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt index 37680dd..24e682a 100644 --- a/tools/src/CMakeLists.txt +++ b/tools/src/CMakeLists.txt @@ -7,31 +7,31 @@ PROJECT (HDF5_TOOLS_SRC) add_definitions (${HDF_EXTRA_C_FLAGS}) #-- Add the h5diff and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5diff) +add_subdirectory (h5diff) #-- Add the h5ls executable -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5ls) +add_subdirectory (h5ls) #-- Misc Executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/misc) +add_subdirectory (misc) #-- Add the h5import and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5import) +add_subdirectory (h5import) #-- h5Repack executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5repack) +add_subdirectory (h5repack) #-- Add the h5dump and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5jam) +add_subdirectory (h5jam) #-- Add the h5copy and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5copy) +add_subdirectory (h5copy) #-- Add the h5stat and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5stat) +add_subdirectory (h5stat) #-- Add the h5dump and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5dump) +add_subdirectory (h5dump) #-- Add the h5format_convert and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5format_convert) +add_subdirectory (h5format_convert) diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index a7dd11f..6877bfc 100644 --- a/tools/test/CMakeLists.txt +++ b/tools/test/CMakeLists.txt @@ -7,34 +7,34 @@ PROJECT (HDF5_TOOLS_TEST) add_definitions (${HDF_EXTRA_C_FLAGS}) #-- Add the h5diff tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5diff) +add_subdirectory (h5diff) #-- Add the h5ls tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5ls) +add_subdirectory (h5ls) #-- Misc tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/misc) +add_subdirectory (misc) #-- Add the h5import tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5import) +add_subdirectory (h5import) #-- h5Repack tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5repack) +add_subdirectory (h5repack) #-- Add the h5jam tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5jam) +add_subdirectory (h5jam) #-- Add the h5copy tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5copy) +add_subdirectory (h5copy) #-- Add the h5stat tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5stat) +add_subdirectory (h5stat) #-- Add the h5dump tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5dump) +add_subdirectory (h5dump) #-- Add the h5format_convert and test executables -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5format_convert) +add_subdirectory (h5format_convert) #-- Add the perform tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/perform) +add_subdirectory (perform) diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 48bc8ab..c014fad 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -22,7 +22,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) #add_test (NAME H5CLEAR-h5clear_gentest COMMAND $) - add_subdirectory (${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/vds) + add_subdirectory (vds) endif () -- cgit v0.12 From 0866bc0bb855fcfdde4608cc437c29d668634a67 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 12:29:51 -0600 Subject: HDFFV-10398 use the target name for custom commands --- fortran/src/CMakeLists.txt | 12 ++++-------- fortran/test/CMakeLists.txt | 6 ++---- hl/fortran/src/CMakeLists.txt | 6 ++---- src/CMakeLists.txt | 12 ++++-------- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index b664c50..5446616 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -78,22 +78,20 @@ add_executable (H5match_types ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c ) -set (CMD $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 - COMMAND ${CMD} + COMMAND $ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static DEPENDS H5match_types ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE) set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) - set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 - COMMAND ${CMDSH} + COMMAND $ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared DEPENDS H5match_types ) @@ -171,10 +169,9 @@ set (f90_F_GEN_SOURCES ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.F90 ) -set (CMD $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 - COMMAND ${CMD} + COMMAND $ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static DEPENDS ${f90_F_GEN_SOURCES} COMMENT "Generating the H5_gen.F90 file" @@ -185,10 +182,9 @@ add_custom_target (H5gen ALL set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) - set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 - COMMAND ${CMDSH} + COMMAND $ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared DEPENDS ${f90_F_GEN_SOURCES} COMMENT "Generating the H5_gen.F90 shared file" diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 2990bcc..86f7a12 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -74,10 +74,9 @@ if (BUILD_SHARED_LIBS) ) endif () -set (CMD $) add_custom_command ( OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 - COMMAND ${CMD} + COMMAND $ WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static DEPENDS H5_test_buildiface COMMENT "Generating the tf_gen.F90 file" @@ -88,10 +87,9 @@ add_custom_target (H5testgen ALL set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) - set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 - COMMAND ${CMDSH} + COMMAND $ WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared DEPENDS H5_test_buildiface COMMENT "Generating the tf_gen.F90 shared file" diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index b1a639a..5ad441c 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -109,10 +109,9 @@ set (HDF5_HL_F90_F_BASE_SOURCES ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.F90 ) -set (CMD $) add_custom_command ( OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 - COMMAND ${CMD} + COMMAND $ WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/static DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files" @@ -126,10 +125,9 @@ set_source_files_properties ( PROPERTIES GENERATED TRUE ) if (BUILD_SHARED_LIBS) - set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 - COMMAND ${CMD} + COMMAND $ WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/shared DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0552244..0cc68ac 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -853,10 +853,9 @@ if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") endif () -set (CMD $) add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c - COMMAND ${CMD} + COMMAND $ ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c DEPENDS H5detect ) @@ -867,10 +866,9 @@ if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") endif () -set (CMD $) add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c - COMMAND ${CMD} + COMMAND $ ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c DEPENDS H5make_libsettings WORKING_DIRECTORY ${HDF5_BINARY_DIR} @@ -905,18 +903,16 @@ set (install_targets ${HDF5_LIB_TARGET}) if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_BINARY_DIR}/shared") - set (CMD $) add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/shared/H5Tinit.c - COMMAND ${CMD} + COMMAND $ ARGS > ${HDF5_BINARY_DIR}/shared/H5Tinit.c DEPENDS H5detect WORKING_DIRECTORY ${HDF5_BINARY_DIR}/shared ) - set (CMD $) add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c - COMMAND ${CMD} + COMMAND $ ARGS > ${HDF5_BINARY_DIR}/shared/H5lib_settings.c DEPENDS H5make_libsettings WORKING_DIRECTORY ${HDF5_BINARY_DIR} -- cgit v0.12 From 98f8fd9603e085cf110df56192d657bc0dec164c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 12:43:01 -0600 Subject: HDFFV-10398 Suppress VS 2015 assertion failure popup during try_run --- config/cmake_ext_mod/HDFTests.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 60ac744..320fd5b 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -222,12 +222,26 @@ SIMPLE_TEST(struct stat sb; sb.st_blocks=0); #include #include +#if defined(_MSC_VER) && defined(_DEBUG) +# include +int DebugReport(int reportType, char* message, int* returnValue) +{ + (void)reportType; + (void)message; + (void)returnValue; + return 1; /* no further handling required */ +} +#endif + int main(void) { char *llwidthArgs[] = { "I64", "l64", "l", "L", "q", "ll", NULL }; char *s = malloc(128); char **currentArg = NULL; LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576; + #if defined(_MSC_VER) && defined(_DEBUG) + _CrtSetReportHook(DebugReport); + #endif for (currentArg = llwidthArgs; *currentArg != NULL; currentArg++) { char formatString[64]; -- cgit v0.12 From 6aee1578c39a58c073333bc62b2eb90f3aa4891e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 12:46:23 -0600 Subject: HDFFV-10398 msvc: use /W0 rather than /w --- config/cmake/HDFCompilerFlags.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index a414cea..56277fa 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -49,9 +49,9 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) if (MSVC) set (HDF5_WARNINGS_BLOCKED 1) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") endif () if (WIN32) add_definitions (-D_CRT_SECURE_NO_WARNINGS) -- cgit v0.12 From dc384f474d65116dc1b70db1aea9a671076a89b2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 14:47:43 -0600 Subject: HDFFV-10398 - avoid ubsan crashes --- config/cmake/ConversionTests.c | 167 ++++++++++++++++++++++------------------- 1 file changed, 89 insertions(+), 78 deletions(-) diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index 082dbd4..002bc88 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -9,12 +9,23 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ ++ +#if defined(__has_attribute) +#if __has_attribute(no_sanitize) +#define HDF_NO_UBSAN __attribute__((no_sanitize("undefined"))) +#else +#define HDF_NO_UBSAN +#endif +#else +#define HDF_NO_UBSAN +#endif + #ifdef H5_LDOUBLE_TO_LONG_SPECIAL_TEST #include #include -int main(void) +int main(void) HDF_NO_UBSAN { long double ld = 20041683600089727.779961L; long ll; @@ -24,44 +35,44 @@ int main(void) int ret = 1; if(sizeof(long double) == 16 && sizeof(long) == 8) { - /*make sure the long double type has 16 bytes in size and - * 11 bits of exponent. If it is, - *the bit sequence should be like below. It's not - *a decent way to check but this info isn't available. */ - memcpy(s, &ld, 16); - if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 && - s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 && - s[8]==0xbf && s[9]==0xcc && s[10]==0x2a && s[11]==0x3c) { - - /* Assign the hexadecimal value of long double type. */ - s[0]=0x43; s[1]=0x51; s[2]=0xcc; s[3]=0xf3; - s[4]=0x85; s[5]=0xeb; s[6]=0xc8; s[7]=0xa0; - s[8]=0xbf; s[9]=0xcc; s[10]=0x2a; s[11]=0x3c; - s[12]=0x3d; s[13]=0x85; s[14]=0x56; s[15]=0x20; - - memcpy(&ld, s, 16); - - ll = (long)ld; - memcpy(s2, &ll, 8); - - /* The library's algorithm converts it to 0x 00 47 33 ce 17 af 22 82 - * and gets wrong value 20041683600089730 on the IBM Power6 Linux. - * But the IBM Power6 Linux converts it to 0x00 47 33 ce 17 af 22 7f - * and gets the correct value 20041683600089727. It uses some special - * algorithm. We're going to define the macro and skip the test until - * we can figure out how they do it. */ - if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && - s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) - ret = 0; - - ull = (unsigned long)ld; - memcpy(s2, &ull, 8); - - /* The unsigned long is the same as signed long. */ - if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && - s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) - ret = 0; - } + /*make sure the long double type has 16 bytes in size and + * 11 bits of exponent. If it is, + *the bit sequence should be like below. It's not + *a decent way to check but this info isn't available. */ + memcpy(s, &ld, 16); + if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 && + s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 && + s[8]==0xbf && s[9]==0xcc && s[10]==0x2a && s[11]==0x3c) { + + /* Assign the hexadecimal value of long double type. */ + s[0]=0x43; s[1]=0x51; s[2]=0xcc; s[3]=0xf3; + s[4]=0x85; s[5]=0xeb; s[6]=0xc8; s[7]=0xa0; + s[8]=0xbf; s[9]=0xcc; s[10]=0x2a; s[11]=0x3c; + s[12]=0x3d; s[13]=0x85; s[14]=0x56; s[15]=0x20; + + memcpy(&ld, s, 16); + + ll = (long)ld; + memcpy(s2, &ll, 8); + + /* The library's algorithm converts it to 0x 00 47 33 ce 17 af 22 82 + * and gets wrong value 20041683600089730 on the IBM Power6 Linux. + * But the IBM Power6 Linux converts it to 0x00 47 33 ce 17 af 22 7f + * and gets the correct value 20041683600089727. It uses some special + * algorithm. We're going to define the macro and skip the test until + * we can figure out how they do it. */ + if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && + s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) + ret = 0; + + ull = (unsigned long)ld; + memcpy(s2, &ull, 8); + + /* The unsigned long is the same as signed long. */ + if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && + s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) + ret = 0; + } } done: @@ -75,7 +86,7 @@ done: #include #include -int main(void) +int main(void) HDF_NO_UBSAN { long double ld; long ll; @@ -86,46 +97,46 @@ int main(void) /*Determine if long double has 16 byte in size, 11 bit exponent, and *the bias is 0x3ff */ if(sizeof(long double) == 16) { - ld = 1.0L; - memcpy(s, &ld, 16); - if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && - s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) - flag = 1; + ld = 1.0L; + memcpy(s, &ld, 16); + if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && + s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) + flag = 1; } if(flag==1 && sizeof(long)==8) { - ll = 0x003fffffffffffffL; - ld = (long double)ll; - memcpy(s, &ld, 16); - /* The library converts the value to 0x434fffffffffffff8000000000000000. - * In decimal it is 18014398509481982.000000, one value short of the original. - * The IBM Power6 Linux converts it to 0x4350000000000000bff0000000000000. - * The value is correct in decimal. It uses some special - * algorithm. We're going to define the macro and skip the test until - * we can figure out how they do it. */ - if(s[0]==0x43 && s[1]==0x50 && s[2]==0x00 && s[3]==0x00 && - s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 && - s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && - s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) - ret = 0; + ll = 0x003fffffffffffffL; + ld = (long double)ll; + memcpy(s, &ld, 16); + /* The library converts the value to 0x434fffffffffffff8000000000000000. + * In decimal it is 18014398509481982.000000, one value short of the original. + * The IBM Power6 Linux converts it to 0x4350000000000000bff0000000000000. + * The value is correct in decimal. It uses some special + * algorithm. We're going to define the macro and skip the test until + * we can figure out how they do it. */ + if(s[0]==0x43 && s[1]==0x50 && s[2]==0x00 && s[3]==0x00 && + s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 && + s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && + s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) + ret = 0; } if(flag==1 && sizeof(unsigned long)==8) { - ull = 0xffffffffffffffffUL; - ld = (long double)ull; - memcpy(s, &ld, 16); - /* Use a different value from signed long to test. The problem is the same - * for both long and unsigned long. The value is 18446744073709551615. - * The library converts the value to 0x43effffffffffffffe000000000000000. - * In decimal it's 18446744073709548544.000000, very different from the original. - * The IBM Power6 Linux converts it to 0x43f0000000000000bff0000000000000. - * The value is correct in decimal. It uses some special - * algorithm. We're going to define the macro and skip the test until - * we can figure out how they do it. */ - if(s[0]==0x43 && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && - s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 && - s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && - s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) - ret = 0; + ull = 0xffffffffffffffffUL; + ld = (long double)ull; + memcpy(s, &ld, 16); + /* Use a different value from signed long to test. The problem is the same + * for both long and unsigned long. The value is 18446744073709551615. + * The library converts the value to 0x43effffffffffffffe000000000000000. + * In decimal it's 18446744073709548544.000000, very different from the original. + * The IBM Power6 Linux converts it to 0x43f0000000000000bff0000000000000. + * The value is correct in decimal. It uses some special + * algorithm. We're going to define the macro and skip the test until + * we can figure out how they do it. */ + if(s[0]==0x43 && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && + s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 && + s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && + s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) + ret = 0; } done: exit(ret); @@ -138,7 +149,7 @@ done: #include #include -int main(void) +int main(void) HDF_NO_UBSAN { long double ld = 20041683600089727.779961L; long long ll; @@ -181,7 +192,7 @@ done: #include #include -int main(void) +int main(void) HDF_NO_UBSAN { long double ld; long long ll; @@ -243,7 +254,7 @@ int FC_DUMMY_MAIN() #endif #endif int -main () +main () HDF_NO_UBSAN { char *chp = "beefs"; -- cgit v0.12 From 1711c3727e11d41268da1c6d4ae0204e081c5e1d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 15:21:07 -0600 Subject: HDFFV-10398 avoid sanitizer failures --- src/H5detect.c | 1038 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 527 insertions(+), 511 deletions(-) diff --git a/src/H5detect.c b/src/H5detect.c index 75a1dba..2cc8366 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -27,23 +27,23 @@ static const char *FileHeader = "\n\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"; /* * - * Created: H5detect.c - * 10 Aug 1997 - * Robb Matzke + * Created: H5detect.c + * 10 Aug 1997 + * Robb Matzke * - * Purpose: This code was borrowed heavily from the `detect.c' - * program in the AIO distribution from Lawrence - * Livermore National Laboratory. + * Purpose: This code was borrowed heavily from the `detect.c' + * program in the AIO distribution from Lawrence + * Livermore National Laboratory. * - * Detects machine byte order and floating point - * format and generates a C source file (H5Tinit.c) - * to describe those paramters. + * Detects machine byte order and floating point + * format and generates a C source file (H5Tinit.c) + * to describe those paramters. * * Assumptions: We have an ANSI compiler. We're on a Unix like - * system or configure has detected those Unix - * features which aren't available. We're not - * running on a Vax or other machine with mixed - * endianess. + * system or configure has detected those Unix + * features which aren't available. We're not + * running on a Vax or other machine with mixed + * endianess. * * Modifications: * @@ -54,9 +54,19 @@ static const char *FileHeader = "\n\ #include "H5Tpublic.h" #include "H5Rpublic.h" +#if defined(__has_attribute) +#if __has_attribute(no_sanitize) +#define HDF_NO_UBSAN __attribute__((no_sanitize("undefined"))) +#else +#define HDF_NO_UBSAN +#endif +#else +#define HDF_NO_UBSAN +#endif + #define MAXDETECT 64 -/* The ALIGNMENT test code may generate the SIGBUS, SIGSEGV, or SIGILL signals. +/* The ALIGNMENT test code may generate the SIGBUS, SIGSEGV, or SIGILL signals. * We use setjmp/longjmp in the signal handlers for recovery. But setjmp/longjmp * do not necessary restore the signal blocking status while sigsetjmp/siglongjmp * do. If sigsetjmp/siglongjmp are not supported, need to use sigprocmask to @@ -66,19 +76,19 @@ static const char *FileHeader = "\n\ /* supported. */ #if defined(H5_HAVE_SIGSETJMP) && defined(H5_HAVE_SIGLONGJMP) /* Always save blocked signals to be restore by siglongjmp. */ -#define H5JMP_BUF sigjmp_buf -#define H5SETJMP(buf) HDsigsetjmp(buf, 1) -#define H5LONGJMP(buf, val) HDsiglongjmp(buf, val) -#define H5HAVE_SIGJMP /* sigsetjmp/siglongjmp are supported. */ +#define H5JMP_BUF sigjmp_buf +#define H5SETJMP(buf) HDsigsetjmp(buf, 1) +#define H5LONGJMP(buf, val) HDsiglongjmp(buf, val) +#define H5HAVE_SIGJMP /* sigsetjmp/siglongjmp are supported. */ #elif defined(H5_HAVE_LONGJMP) -#define H5JMP_BUF jmp_buf -#define H5SETJMP(buf) HDsetjmp(buf) -#define H5LONGJMP(buf, val) HDlongjmp(buf, val) +#define H5JMP_BUF jmp_buf +#define H5SETJMP(buf) HDsetjmp(buf) +#define H5LONGJMP(buf, val) HDlongjmp(buf, val) #endif /* ALIGNMENT and signal-handling status codes */ -#define STA_NoALIGNMENT 0x0001 /* No ALIGNMENT Test */ -#define STA_NoHandlerVerify 0x0002 /* No signal handler Tests */ +#define STA_NoALIGNMENT 0x0001 /* No ALIGNMENT Test */ +#define STA_NoHandlerVerify 0x0002 /* No signal handler Tests */ /* @@ -133,11 +143,11 @@ static void detect_C99_integers32(void); static void detect_C99_integers64(void); static void detect_alignments(void); static unsigned int align_g[] = {1, 2, 4, 8, 16}; -static int align_status_g = 0; /* ALIGNMENT Signal Status */ -static int sigbus_handler_called_g = 0; /* how many times called */ +static int align_status_g = 0; /* ALIGNMENT Signal Status */ +static int sigbus_handler_called_g = 0; /* how many times called */ static int sigsegv_handler_called_g = 0;/* how many times called */ -static int sigill_handler_called_g = 0; /* how many times called */ -static int signal_handler_tested_g = 0; /* how many times tested */ +static int sigill_handler_called_g = 0; /* how many times called */ +static int signal_handler_tested_g = 0; /* how many times tested */ #if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL) static int verify_signal_handlers(int signum, void (*handler)(int)); #endif @@ -145,16 +155,16 @@ static int verify_signal_handlers(int signum, void (*handler)(int)); static H5JMP_BUF jbuf_g; #endif - + /*------------------------------------------------------------------------- - * Function: precision + * Function: precision * - * Purpose: Determine the precision and offset. + * Purpose: Determine the precision and offset. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Thursday, June 18, 1998 + * Programmer: Robb Matzke + * Thursday, June 18, 1998 * * Modifications: * @@ -167,7 +177,7 @@ precision (detected_t *d) if (0 == d->msize) { /* - * An integer. The permutation can have negative values at the + * An integer. The permutation can have negative values at the * beginning or end which represent padding of bytes. We must adjust * the precision and offset accordingly. */ @@ -201,36 +211,36 @@ precision (detected_t *d) } } - + /*------------------------------------------------------------------------- - * Function: DETECT_I/DETECT_BYTE + * Function: DETECT_I/DETECT_BYTE * - * Purpose: These macro takes a type like `int' and a base name like - * `nati' and detects the byte order. The VAR is used to - * construct the names of the C variables defined. + * Purpose: These macro takes a type like `int' and a base name like + * `nati' and detects the byte order. The VAR is used to + * construct the names of the C variables defined. * * DETECT_I is used for types that are larger than one byte, * DETECT_BYTE is used for types that are exactly one byte. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12 1996 * * Modifications: * - * Robb Matzke, 4 Nov 1996 - * The INFO.perm now contains `-1' for bytes that aren't used and - * are always zero. This happens on the Cray for `short' where - * sizeof(short) is 8, but only the low-order 4 bytes are ever used. + * Robb Matzke, 4 Nov 1996 + * The INFO.perm now contains `-1' for bytes that aren't used and + * are always zero. This happens on the Cray for `short' where + * sizeof(short) is 8, but only the low-order 4 bytes are ever used. * - * Robb Matzke, 4 Nov 1996 - * Added a `padding' field to indicate how many zero bytes appear to - * the left (N) or right (-N) of the value. + * Robb Matzke, 4 Nov 1996 + * Added a `padding' field to indicate how many zero bytes appear to + * the left (N) or right (-N) of the value. * - * Robb Matzke, 5 Nov 1996 - * Removed HFILE and CFILE arguments. + * Robb Matzke, 5 Nov 1996 + * Removed HFILE and CFILE arguments. * * Neil Fortner, 6 Sep 2013 * Split macro into DETECT_I and DETECT_BYTE macros, extracted @@ -273,27 +283,27 @@ precision (detected_t *d) DETECT_I_BYTE_CORE(TYPE,VAR,INFO,int) \ } -#define DETECT_I(TYPE,VAR,INFO) { \ +#define DETECT_I(TYPE,VAR,INFO) { \ HDcompile_assert(sizeof(TYPE) > 1); \ \ DETECT_I_BYTE_CORE(TYPE,VAR,INFO,TYPE) \ } - + /*------------------------------------------------------------------------- - * Function: DETECT_F + * Function: DETECT_F * - * Purpose: This macro takes a floating point type like `double' and - * a base name like `natd' and detects byte order, mantissa - * location, exponent location, sign bit location, presence or - * absence of implicit mantissa bit, and exponent bias and - * initializes a detected_t structure with those properties. + * Purpose: This macro takes a floating point type like `double' and + * a base name like `natd' and detects byte order, mantissa + * location, exponent location, sign bit location, presence or + * absence of implicit mantissa bit, and exponent bias and + * initializes a detected_t structure with those properties. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12 1996 * *------------------------------------------------------------------------- */ @@ -383,31 +393,31 @@ precision (detected_t *d) } \ } - + /*------------------------------------------------------------------------- - * Function: DETECT_M + * Function: DETECT_M * - * Purpose: This macro takes only miscellaneous structures or pointer + * Purpose: This macro takes only miscellaneous structures or pointer * (pointer, hvl_t, hobj_ref_t, hdset_reg_ref_t). It - * constructs the names and decides the alignment in structure. + * constructs the names and decides the alignment in structure. * - * Return: void + * Return: void * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu - * Dec 9, 2002 + * Programmer: Raymond Lu + * slu@ncsa.uiuc.edu + * Dec 9, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -#define DETECT_M(TYPE,VAR,INFO) { \ - INFO.name = #VAR; \ - COMP_ALIGNMENT(TYPE, INFO.comp_align); \ +#define DETECT_M(TYPE,VAR,INFO) { \ + INFO.name = #VAR; \ + COMP_ALIGNMENT(TYPE, INFO.comp_align); \ } /* Detect alignment for C structure */ -#define COMP_ALIGNMENT(TYPE,COMP_ALIGN) { \ +#define COMP_ALIGNMENT(TYPE,COMP_ALIGN) { \ struct { \ char c; \ TYPE x; \ @@ -417,67 +427,67 @@ precision (detected_t *d) } #if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL) -#define ALIGNMENT(TYPE,INFO) { \ - char *volatile _buf = NULL; \ - TYPE _val = 1, _val2; \ - volatile size_t _ano = 0; \ - void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \ - void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\ - void (*_handler3)(int) = HDsignal(SIGILL, sigill_handler); \ - \ - _buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \ - if(H5SETJMP(jbuf_g)) _ano++; \ - if(_ano < NELMTS(align_g)) { \ - *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \ - _val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/\ - /* Cray Check: This section helps detect alignment on Cray's */ \ +#define ALIGNMENT(TYPE,INFO) { \ + char *volatile _buf = NULL; \ + TYPE _val = 1, _val2; \ + volatile size_t _ano = 0; \ + void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \ + void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\ + void (*_handler3)(int) = HDsignal(SIGILL, sigill_handler); \ + \ + _buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \ + if(H5SETJMP(jbuf_g)) _ano++; \ + if(_ano < NELMTS(align_g)) { \ + *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \ + _val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/\ + /* Cray Check: This section helps detect alignment on Cray's */ \ /* vector machines (like the SV1) which mask off */ \ - /* pointer values when pointing to non-word aligned */ \ - /* locations with pointers that are supposed to be */ \ - /* word aligned. -QAK */ \ - HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \ + /* pointer values when pointing to non-word aligned */ \ + /* locations with pointers that are supposed to be */ \ + /* word aligned. -QAK */ \ + HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \ /*How to handle VAX types?*/ \ - if(INFO.perm[0]) /* Big-Endian */ \ - HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \ - else /* Little-Endian */ \ - HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ - _val2 = *((TYPE*)(_buf+align_g[_ano])); \ - H5_GCC_DIAG_OFF(float-equal) \ - if(_val!=_val2) \ - H5LONGJMP(jbuf_g, 1); \ - H5_GCC_DIAG_ON(float-equal) \ - /* End Cray Check */ \ - (INFO.align)=align_g[_ano]; \ - } else { \ - (INFO.align)=0; \ - fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \ - } \ - HDfree(_buf); \ - HDsignal(SIGBUS, _handler); /*restore original handler*/ \ - HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \ - HDsignal(SIGILL, _handler3); /*restore original handler*/ \ + if(INFO.perm[0]) /* Big-Endian */ \ + HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \ + else /* Little-Endian */ \ + HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ + _val2 = *((TYPE*)(_buf+align_g[_ano])); \ + H5_GCC_DIAG_OFF(float-equal) \ + if(_val!=_val2) \ + H5LONGJMP(jbuf_g, 1); \ + H5_GCC_DIAG_ON(float-equal) \ + /* End Cray Check */ \ + (INFO.align)=align_g[_ano]; \ + } else { \ + (INFO.align)=0; \ + fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \ + } \ + HDfree(_buf); \ + HDsignal(SIGBUS, _handler); /*restore original handler*/ \ + HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \ + HDsignal(SIGILL, _handler3); /*restore original handler*/ \ } #else -#define ALIGNMENT(TYPE,INFO) { \ - align_status_g |= STA_NoALIGNMENT; \ - (INFO.align)=0; \ +#define ALIGNMENT(TYPE,INFO) { \ + align_status_g |= STA_NoALIGNMENT; \ + (INFO.align)=0; \ } #endif - + #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) /*------------------------------------------------------------------------- - * Function: sigsegv_handler + * Function: sigsegv_handler * - * Purpose: Handler for SIGSEGV. We use signal() instead of sigaction() - * because it's more portable to non-Posix systems. Although - * it's not nearly as nice to work with, it does the job for - * this simple stuff. + * Purpose: Handler for SIGSEGV. We use signal() instead of sigaction() + * because it's more portable to non-Posix systems. Although + * it's not nearly as nice to work with, it does the job for + * this simple stuff. * - * Return: Returns via H5LONGJMP to jbuf_g. + * Return: Returns via H5LONGJMP to jbuf_g. * - * Programmer: Robb Matzke - * Thursday, March 18, 1999 + * Programmer: Robb Matzke + * Thursday, March 18, 1999 * * Modifications: * @@ -502,20 +512,20 @@ sigsegv_handler(int H5_ATTR_UNUSED signo) } #endif - + #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) /*------------------------------------------------------------------------- - * Function: sigbus_handler + * Function: sigbus_handler * - * Purpose: Handler for SIGBUS. We use signal() instead of sigaction() - * because it's more portable to non-Posix systems. Although - * it's not nearly as nice to work with, it does the job for - * this simple stuff. + * Purpose: Handler for SIGBUS. We use signal() instead of sigaction() + * because it's more portable to non-Posix systems. Although + * it's not nearly as nice to work with, it does the job for + * this simple stuff. * - * Return: Returns via H5LONGJMP to jbuf_g. + * Return: Returns via H5LONGJMP to jbuf_g. * - * Programmer: Robb Matzke - * Thursday, March 18, 1999 + * Programmer: Robb Matzke + * Thursday, March 18, 1999 * * Modifications: * @@ -540,20 +550,20 @@ sigbus_handler(int H5_ATTR_UNUSED signo) } #endif - + #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) /*------------------------------------------------------------------------- - * Function: sigill_handler + * Function: sigill_handler * - * Purpose: Handler for SIGILL. We use signal() instead of sigaction() - * because it's more portable to non-Posix systems. Although - * it's not nearly as nice to work with, it does the job for - * this simple stuff. + * Purpose: Handler for SIGILL. We use signal() instead of sigaction() + * because it's more portable to non-Posix systems. Although + * it's not nearly as nice to work with, it does the job for + * this simple stuff. * - * Return: Returns via H5LONGJMP to jbuf_g. + * Return: Returns via H5LONGJMP to jbuf_g. * - * Programmer: Raymond Lu - * 28 October 2013 + * Programmer: Raymond Lu + * 28 October 2013 * *------------------------------------------------------------------------- */ @@ -576,17 +586,17 @@ sigill_handler(int H5_ATTR_UNUSED signo) } #endif - + /*------------------------------------------------------------------------- - * Function: print_results + * Function: print_results * - * Purpose: Prints information about the detected data types. + * Purpose: Prints information about the detected data types. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 14, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 14, 1996 * * Modifications: * @@ -596,7 +606,7 @@ static void print_results(int nd, detected_t *d, int na, malign_t *misc_align) { int byte_order=0; /*byte order of data types*/ - int i, j; + int i, j; /* Include files */ printf("\ @@ -610,11 +620,11 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) /***********/\n\ /* Headers */\n\ /***********/\n\ -#include \"H5private.h\" /* Generic Functions */\n\ -#include \"H5Eprivate.h\" /* Error handling */\n\ -#include \"H5FLprivate.h\" /* Free Lists */\n\ -#include \"H5Iprivate.h\" /* IDs */\n\ -#include \"H5Tpkg.h\" /* Datatypes */\n\ +#include \"H5private.h\" /* Generic Functions */\n\ +#include \"H5Eprivate.h\" /* Error handling */\n\ +#include \"H5FLprivate.h\" /* Free Lists */\n\ +#include \"H5Iprivate.h\" /* IDs */\n\ +#include \"H5Tpkg.h\" /* Datatypes */\n\ \n\ \n\ /****************/\n\ @@ -663,15 +673,15 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) printf("\n\ \n\ /*-------------------------------------------------------------------------\n\ - * Function: H5T__init_native\n\ + * Function: H5T__init_native\n\ *\n\ - * Purpose: Initialize pre-defined native datatypes from code generated\n\ + * Purpose: Initialize pre-defined native datatypes from code generated\n\ * during the library configuration by H5detect.\n\ *\n\ - * Return: Success: non-negative\n\ - * Failure: negative\n\ + * Return: Success: non-negative\n\ + * Failure: negative\n\ *\n\ - * Programmer: Robb Matzke\n\ + * Programmer: Robb Matzke\n\ * Wednesday, December 16, 1998\n\ *\n\ *-------------------------------------------------------------------------\n\ @@ -679,8 +689,8 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) herr_t\n\ H5T__init_native(void)\n\ {\n\ - H5T_t *dt = NULL;\n\ - herr_t ret_value = SUCCEED;\n\ + H5T_t *dt = NULL;\n\ + herr_t ret_value = SUCCEED;\n\ \n\ FUNC_ENTER_PACKAGE\n"); @@ -702,20 +712,20 @@ H5T__init_native(void)\n\ } } - /* Print a comment to describe this section of definitions. */ - printf("\n /*\n"); - iprint(d+i); - printf(" */\n"); + /* Print a comment to describe this section of definitions. */ + printf("\n /*\n"); + iprint(d+i); + printf(" */\n"); - /* The part common to fixed and floating types */ - printf("\ + /* The part common to fixed and floating types */ + printf("\ if(NULL == (dt = H5T__alloc()))\n\ HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, \"datatype allocation failed\")\n\ dt->shared->state = H5T_STATE_IMMUTABLE;\n\ dt->shared->type = H5T_%s;\n\ dt->shared->size = %d;\n", - d[i].msize ? "FLOAT" : "INTEGER",/*class */ - d[i].size); /*size */ + d[i].msize ? "FLOAT" : "INTEGER",/*class */ + d[i].size); /*size */ if(byte_order==-1) printf("\ @@ -732,18 +742,18 @@ H5T__init_native(void)\n\ dt->shared->u.atomic.prec = %d;\n\ dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;\n\ dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;\n", - d[i].offset, /*offset */ - d[i].precision); /*precision */ + d[i].offset, /*offset */ + d[i].precision); /*precision */ /*HDassert((d[i].perm[0]>0)==(byte_order>0));*/ /* Double-check that byte-order doesn't change */ - if (0 == d[i].msize) { - /* The part unique to fixed point types */ - printf("\ + if (0 == d[i].msize) { + /* The part unique to fixed point types */ + printf("\ dt->shared->u.atomic.u.i.sign = H5T_SGN_%s;\n", - d[i].sign ? "2" : "NONE"); - } else { - /* The part unique to floating point types */ - printf("\ + d[i].sign ? "2" : "NONE"); + } else { + /* The part unique to floating point types */ + printf("\ dt->shared->u.atomic.u.f.sign = %d;\n\ dt->shared->u.atomic.u.f.epos = %d;\n\ dt->shared->u.atomic.u.f.esize = %d;\n\ @@ -752,22 +762,22 @@ H5T__init_native(void)\n\ dt->shared->u.atomic.u.f.msize = %d;\n\ dt->shared->u.atomic.u.f.norm = H5T_NORM_%s;\n\ dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO;\n", - d[i].sign, /*sign location */ - d[i].epos, /*exponent loc */ - d[i].esize, /*exponent size */ - (unsigned long)(d[i].bias), /*exponent bias */ - d[i].mpos, /*mantissa loc */ - d[i].msize, /*mantissa size */ - d[i].imp ? "IMPLIED" : "NONE"); /*normalization */ - } - - /* Atomize the type */ - printf("\ + d[i].sign, /*sign location */ + d[i].epos, /*exponent loc */ + d[i].esize, /*exponent size */ + (unsigned long)(d[i].bias), /*exponent bias */ + d[i].mpos, /*mantissa loc */ + d[i].msize, /*mantissa size */ + d[i].imp ? "IMPLIED" : "NONE"); /*normalization */ + } + + /* Atomize the type */ + printf("\ if((H5T_NATIVE_%s_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)\n\ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \"can't register ID for built-in datatype\")\n", - d[i].varname); - printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n", - d[i].varname, (unsigned long)(d[i].align)); + d[i].varname); + printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n", + d[i].varname, (unsigned long)(d[i].align)); /* Variables for alignment of compound datatype */ if(!HDstrcmp(d[i].varname, "SCHAR") || !HDstrcmp(d[i].varname, "SHORT") || @@ -809,69 +819,69 @@ done:\n\ /* Print the ALIGNMENT and signal-handling status as comments */ printf("\n" - "/****************************************/\n" - "/* ALIGNMENT and signal-handling status */\n" - "/****************************************/\n"); + "/****************************************/\n" + "/* ALIGNMENT and signal-handling status */\n" + "/****************************************/\n"); if (align_status_g & STA_NoALIGNMENT) - printf("/* ALIGNAMENT test is not available */\n"); + printf("/* ALIGNAMENT test is not available */\n"); if (align_status_g & STA_NoHandlerVerify) - printf("/* Signal handlers verify test is not available */\n"); + printf("/* Signal handlers verify test is not available */\n"); /* The following is available in H5pubconf.h. Printing them here for */ /* convenience. */ #ifdef H5_HAVE_SIGNAL - printf("/* Signal() support: yes */\n"); + printf("/* Signal() support: yes */\n"); #else - printf("/* Signal() support: no */\n"); + printf("/* Signal() support: no */\n"); #endif #ifdef H5_HAVE_SETJMP - printf("/* setjmp() support: yes */\n"); + printf("/* setjmp() support: yes */\n"); #else - printf("/* setjmp() support: no */\n"); + printf("/* setjmp() support: no */\n"); #endif #ifdef H5_HAVE_LONGJMP - printf("/* longjmp() support: yes */\n"); + printf("/* longjmp() support: yes */\n"); #else - printf("/* longjmp() support: no */\n"); + printf("/* longjmp() support: no */\n"); #endif #ifdef H5_HAVE_SIGSETJMP - printf("/* sigsetjmp() support: yes */\n"); + printf("/* sigsetjmp() support: yes */\n"); #else - printf("/* sigsetjmp() support: no */\n"); + printf("/* sigsetjmp() support: no */\n"); #endif #ifdef H5_HAVE_SIGLONGJMP - printf("/* siglongjmp() support: yes */\n"); + printf("/* siglongjmp() support: yes */\n"); #else - printf("/* siglongjmp() support: no */\n"); + printf("/* siglongjmp() support: no */\n"); #endif #ifdef H5_HAVE_SIGPROCMASK - printf("/* sigprocmask() support: yes */\n"); + printf("/* sigprocmask() support: yes */\n"); #else - printf("/* sigprocmask() support: no */\n"); + printf("/* sigprocmask() support: no */\n"); #endif /* Print the statics of signal handlers called for debugging */ printf("\n" - "/******************************/\n" - "/* signal handlers statistics */\n" - "/******************************/\n"); + "/******************************/\n" + "/* signal handlers statistics */\n" + "/******************************/\n"); printf("/* signal_handlers tested: %d times */\n", signal_handler_tested_g); printf("/* sigbus_handler called: %d times */\n", sigbus_handler_called_g); printf("/* sigsegv_handler called: %d times */\n", sigsegv_handler_called_g); printf("/* sigill_handler called: %d times */\n", sigill_handler_called_g); } /* end print_results() */ - + /*------------------------------------------------------------------------- - * Function: iprint + * Function: iprint * - * Purpose: Prints information about the fields of a floating point - * format. + * Purpose: Prints information about the fields of a floating point + * format. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * @@ -945,22 +955,22 @@ iprint(detected_t *d) } - + /*------------------------------------------------------------------------- - * Function: byte_cmp + * Function: byte_cmp * - * Purpose: Compares two chunks of memory A and B and returns the - * byte index into those arrays of the first byte that - * differs between A and B. Ignores differences where the + * Purpose: Compares two chunks of memory A and B and returns the + * byte index into those arrays of the first byte that + * differs between A and B. Ignores differences where the * corresponding bit in pad_mask is set to 0. * - * Return: Success: Index of differing byte. + * Return: Success: Index of differing byte. * - * Failure: -1 if all bytes are the same. + * Failure: -1 if all bytes are the same. * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12, 1996 * * Modifications: * @@ -980,17 +990,17 @@ byte_cmp(int n, const void *_a, const void *_b, const unsigned char *pad_mask) return -1; } - + /*------------------------------------------------------------------------- - * Function: bit_cmp + * Function: bit_cmp * - * Purpose: Compares two bit vectors and returns the index for the - * first bit that differs between the two vectors. The - * size of the vector is NBYTES. PERM is a mapping from - * actual order to little endian. Ignores differences where + * Purpose: Compares two bit vectors and returns the index for the + * first bit that differs between the two vectors. The + * size of the vector is NBYTES. PERM is a mapping from + * actual order to little endian. Ignores differences where * the corresponding bit in pad_mask is set to 0. * - * Return: Index of first differing bit. + * Return: Index of first differing bit. * *------------------------------------------------------------------------- */ @@ -1021,23 +1031,23 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b, return 0; } - + /*------------------------------------------------------------------------- - * Function: fix_order + * Function: fix_order * - * Purpose: Given an array PERM with elements FIRST through LAST - * initialized with zero origin byte numbers, this function - * creates a permutation vector that maps the actual order - * of a floating point number to little-endian. + * Purpose: Given an array PERM with elements FIRST through LAST + * initialized with zero origin byte numbers, this function + * creates a permutation vector that maps the actual order + * of a floating point number to little-endian. * - * This function assumes that the mantissa byte ordering - * implies the total ordering. + * This function assumes that the mantissa byte ordering + * implies the total ordering. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * @@ -1046,81 +1056,81 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b, static void fix_order(int n, int last, int *perm, const char **mesg) { - int i; + int i; if (last > 1) { - /* - * We have at least three points to consider. - */ - if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) { - /* - * Little endian. - */ - if (mesg) *mesg = "Little-endian"; - for (i = 0; i < n; i++) perm[i] = i; - - } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) { - /* - * Big endian. - */ - if (mesg) *mesg = "Big-endian"; - for (i = 0; i < n; i++) perm[i] = (n - 1) - i; - - } else { - /* - * Bi-endian machines like VAX. + /* + * We have at least three points to consider. + */ + if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) { + /* + * Little endian. + */ + if (mesg) *mesg = "Little-endian"; + for (i = 0; i < n; i++) perm[i] = i; + + } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) { + /* + * Big endian. + */ + if (mesg) *mesg = "Big-endian"; + for (i = 0; i < n; i++) perm[i] = (n - 1) - i; + + } else { + /* + * Bi-endian machines like VAX. * (NOTE: This is not an actual determination of the VAX-endianess. * It could have some other endianess and fall into this * case - JKM & QAK) - */ - HDassert(0 == n % 2); - if (mesg) *mesg = "VAX"; - for (i = 0; i < n; i += 2) { - perm[i] = (n - 2) - i; - perm[i + 1] = (n - 1) - i; - } - } + */ + HDassert(0 == n % 2); + if (mesg) *mesg = "VAX"; + for (i = 0; i < n; i += 2) { + perm[i] = (n - 2) - i; + perm[i + 1] = (n - 1) - i; + } + } } else { - fprintf(stderr, - "Failed to detect byte order of %d-byte floating point.\n", n); - HDexit(1); + fprintf(stderr, + "Failed to detect byte order of %d-byte floating point.\n", n); + HDexit(1); } } - + /*------------------------------------------------------------------------- - * Function: imp_bit + * Function: imp_bit * - * Purpose: Looks for an implicit bit in the mantissa. The value - * of _A should be 1.0 and the value of _B should be 0.5. - * Some floating-point formats discard the most significant - * bit of the mantissa after normalizing since it will always - * be a one (except for 0.0). If this is true for the native - * floating point values stored in _A and _B then the function - * returns non-zero. + * Purpose: Looks for an implicit bit in the mantissa. The value + * of _A should be 1.0 and the value of _B should be 0.5. + * Some floating-point formats discard the most significant + * bit of the mantissa after normalizing since it will always + * be a one (except for 0.0). If this is true for the native + * floating point values stored in _A and _B then the function + * returns non-zero. * - * This function assumes that the exponent occupies higher - * order bits than the mantissa and that the most significant - * bit of the mantissa is next to the least signficant bit - * of the exponent. + * This function assumes that the exponent occupies higher + * order bits than the mantissa and that the most significant + * bit of the mantissa is next to the least signficant bit + * of the exponent. * * - * Return: Success: Non-zero if the most significant bit - * of the mantissa is discarded (ie, the - * mantissa has an implicit `one' as the - * most significant bit). Otherwise, - * returns zero. + * Return: Success: Non-zero if the most significant bit + * of the mantissa is discarded (ie, the + * mantissa has an implicit `one' as the + * most significant bit). Otherwise, + * returns zero. * - * Failure: exit(1) + * Failure: exit(1) * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * - * Robb Matzke, 6 Nov 1996 - * Fixed a bug that occurs with non-implicit architectures. + * Robb Matzke, 6 Nov 1996 + * Fixed a bug that occurs with non-implicit architectures. * *------------------------------------------------------------------------- */ @@ -1150,26 +1160,26 @@ imp_bit(unsigned int n, int *perm, void *_a, void *_b, const unsigned char *pad_ return (a[perm[major]] >> minor) & 0x01 ? 0 : 1; } - + /*------------------------------------------------------------------------- - * Function: find_bias + * Function: find_bias * - * Purpose: Determines the bias of the exponent. This function should - * be called with _A having a value of `1'. + * Purpose: Determines the bias of the exponent. This function should + * be called with _A having a value of `1'. * - * Return: Success: The exponent bias. + * Return: Success: The exponent bias. * - * Failure: + * Failure: * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * - * Robb Matzke, 6 Nov 1996 - * Fixed a bug with non-implicit architectures returning the - * wrong exponent bias. + * Robb Matzke, 6 Nov 1996 + * Fixed a bug with non-implicit architectures returning the + * wrong exponent bias. * *------------------------------------------------------------------------- */ @@ -1193,17 +1203,17 @@ find_bias(unsigned int epos, unsigned int esize, int *perm, void *_a) return bias; } - + /*------------------------------------------------------------------------- - * Function: print_header + * Function: print_header * - * Purpose: Prints the C file header for the generated file. + * Purpose: Prints the C file header for the generated file. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Mar 12 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Mar 12 1997 * * Modifications: * @@ -1213,22 +1223,22 @@ static void print_header(void) { - time_t now = HDtime(NULL); - struct tm *tm = HDlocaltime(&now); - char real_name[30]; - char host_name[256]; - int i; - const char *s; + time_t now = HDtime(NULL); + struct tm *tm = HDlocaltime(&now); + char real_name[30]; + char host_name[256]; + int i; + const char *s; #ifdef H5_HAVE_GETPWUID - struct passwd *pwd = NULL; + struct passwd *pwd = NULL; #else - int pwd = 1; + int pwd = 1; #endif - static const char *month_name[] = + static const char *month_name[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; - static const char *purpose = "\ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; + static const char *purpose = "\ This machine-generated source code contains\n\ information about the various integer and\n\ floating point numeric formats found on this\n\ @@ -1240,7 +1250,7 @@ Each of the numeric formats listed below are\n\ printed from most significant bit to least\n\ significant bit even though the actual bytes\n\ might be stored in a different order in\n\ -memory. The integers above each binary byte\n\ +memory. The integers above each binary byte\n\ indicate the relative order of the bytes in\n\ memory; little-endian machines have\n\ decreasing numbers while big-endian machines\n\ @@ -1251,8 +1261,8 @@ letters with `S' for the mantissa sign bit,\n\ `M' for the mantissa magnitude, and `E' for\n\ the exponent. The exponent has an associated\n\ bias which can be subtracted to find the\n\ -true exponent. The radix point is assumed\n\ -to be before the first `M' bit. Any bit\n\ +true exponent. The radix point is assumed\n\ +to be before the first `M' bit. Any bit\n\ of a floating-point value not falling into one\n\ of these categories is printed as a question\n\ mark. Bits of integer types are printed as\n\ @@ -1271,20 +1281,20 @@ bit.\n"; */ #ifdef H5_HAVE_GETPWUID { - size_t n; - char *comma; - if ((pwd = HDgetpwuid(HDgetuid()))) { - if ((comma = HDstrchr(pwd->pw_gecos, ','))) { - n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); - HDstrncpy(real_name, pwd->pw_gecos, n); - real_name[n] = '\0'; - } else { - HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name)); - real_name[sizeof(real_name) - 1] = '\0'; - } - } else { - real_name[0] = '\0'; - } + size_t n; + char *comma; + if ((pwd = HDgetpwuid(HDgetuid()))) { + if ((comma = HDstrchr(pwd->pw_gecos, ','))) { + n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); + HDstrncpy(real_name, pwd->pw_gecos, n); + real_name[n] = '\0'; + } else { + HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name)); + real_name[sizeof(real_name) - 1] = '\0'; + } + } else { + real_name[0] = '\0'; + } } #else real_name[0] = '\0'; @@ -1295,7 +1305,7 @@ bit.\n"; */ #ifdef H5_HAVE_GETHOSTNAME if (HDgethostname(host_name, sizeof(host_name)) < 0) { - host_name[0] = '\0'; + host_name[0] = '\0'; } #else host_name[0] = '\0'; @@ -1305,24 +1315,24 @@ bit.\n"; * The file header: warning, copyright notice, build information. */ printf("/* Generated automatically by H5detect -- do not edit */\n\n\n"); - HDputs(FileHeader); /*the copyright notice--see top of this file */ + HDputs(FileHeader); /*the copyright notice--see top of this file */ printf(" *\n * Created:\t\t%s %2d, %4d\n", - month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year); + month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year); if (pwd || real_name[0] || host_name[0]) { - printf(" *\t\t\t"); - if (real_name[0]) printf("%s <", real_name); + printf(" *\t\t\t"); + if (real_name[0]) printf("%s <", real_name); #ifdef H5_HAVE_GETPWUID - if (pwd) HDfputs(pwd->pw_name, stdout); + if (pwd) HDfputs(pwd->pw_name, stdout); #endif - if (host_name[0]) printf("@%s", host_name); - if (real_name[0]) printf(">"); - HDputchar('\n'); + if (host_name[0]) printf("@%s", host_name); + if (real_name[0]) printf(">"); + HDputchar('\n'); } printf(" *\n * Purpose:\t\t"); for (s = purpose; *s; s++) { - HDputchar(*s); - if ('\n' == *s && s[1]) printf(" *\t\t\t"); + HDputchar(*s); + if ('\n' == *s && s[1]) printf(" *\t\t\t"); } printf(" *\n * Modifications:\n *\n"); @@ -1335,84 +1345,84 @@ bit.\n"; } - + /*------------------------------------------------------------------------- - * Function: detect_C89_integers + * Function: detect_C89_integers * - * Purpose: Detect C89 integer types + * Purpose: Detect C89 integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C89_integers(void) +detect_C89_integers(void) HDF_NO_UBSAN { - DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++; - DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++; - DETECT_I(short, SHORT, d_g[nd_g]); nd_g++; - DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++; - DETECT_I(int, INT, d_g[nd_g]); nd_g++; - DETECT_I(unsigned int, UINT, d_g[nd_g]); nd_g++; - DETECT_I(long, LONG, d_g[nd_g]); nd_g++; - DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++; + DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++; + DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++; + DETECT_I(short, SHORT, d_g[nd_g]); nd_g++; + DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++; + DETECT_I(int, INT, d_g[nd_g]); nd_g++; + DETECT_I(unsigned int, UINT, d_g[nd_g]); nd_g++; + DETECT_I(long, LONG, d_g[nd_g]); nd_g++; + DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++; } - + /*------------------------------------------------------------------------- - * Function: detect_C89_floats + * Function: detect_C89_floats * - * Purpose: Detect C89 floating point types + * Purpose: Detect C89 floating point types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C89_floats(void) +detect_C89_floats(void) HDF_NO_UBSAN { DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++; DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++; } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers8 + * Function: detect_C99_integers8 * - * Purpose: Detect C99 8 bit integer types + * Purpose: Detect C99 8 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers8(void) +detect_C99_integers8(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT8_T>0 #if H5_SIZEOF_INT8_T==1 DETECT_BYTE(int8_t, INT8, d_g[nd_g]); nd_g++; #else - DETECT_I(int8_t, INT8, d_g[nd_g]); nd_g++; + DETECT_I(int8_t, INT8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_UINT8_T>0 #if H5_SIZEOF_UINT8_T==1 - DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++; + DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++; #else DETECT_I(uint8_t, UINT8, d_g[nd_g]); nd_g++; #endif @@ -1421,147 +1431,147 @@ detect_C99_integers8(void) #if H5_SIZEOF_INT_LEAST8_T==1 DETECT_BYTE(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++; #else - DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++; + DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_UINT_LEAST8_T>0 #if H5_SIZEOF_UINT_LEAST8_T==1 DETECT_BYTE(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++; #else - DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++; + DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_INT_FAST8_T>0 #if H5_SIZEOF_INT_FAST8_T==1 DETECT_BYTE(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++; #else - DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++; + DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_UINT_FAST8_T>0 #if H5_SIZEOF_UINT_FAST8_T==1 - DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++; + DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++; #else DETECT_I(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++; #endif #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers16 + * Function: detect_C99_integers16 * - * Purpose: Detect C99 16 bit integer types + * Purpose: Detect C99 16 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers16(void) +detect_C99_integers16(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT16_T>0 - DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++; + DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT16_T>0 - DETECT_I(uint16_t, UINT16, d_g[nd_g]); nd_g++; + DETECT_I(uint16_t, UINT16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_LEAST16_T>0 - DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]); nd_g++; + DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_LEAST16_T>0 - DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]); nd_g++; + DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_FAST16_T>0 - DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]); nd_g++; + DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_FAST16_T>0 - DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]); nd_g++; + DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers32 + * Function: detect_C99_integers32 * - * Purpose: Detect C99 32 bit integer types + * Purpose: Detect C99 32 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers32(void) +detect_C99_integers32(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT32_T>0 - DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++; + DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT32_T>0 - DETECT_I(uint32_t, UINT32, d_g[nd_g]); nd_g++; + DETECT_I(uint32_t, UINT32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_LEAST32_T>0 - DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]); nd_g++; + DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_LEAST32_T>0 - DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]); nd_g++; + DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_FAST32_T>0 - DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]); nd_g++; + DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_FAST32_T>0 - DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]); nd_g++; + DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers64 + * Function: detect_C99_integers64 * - * Purpose: Detect C99 64 bit integer types + * Purpose: Detect C99 64 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers64(void) +detect_C99_integers64(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT64_T>0 - DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++; + DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT64_T>0 - DETECT_I(uint64_t, UINT64, d_g[nd_g]); nd_g++; + DETECT_I(uint64_t, UINT64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_LEAST64_T>0 - DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]); nd_g++; + DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_LEAST64_T>0 - DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]); nd_g++; + DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_FAST64_T>0 - DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]); nd_g++; + DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_FAST64_T>0 - DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++; + DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_LONG_LONG>0 - DETECT_I(long long, LLONG, d_g[nd_g]); nd_g++; + DETECT_I(long long, LLONG, d_g[nd_g]); nd_g++; DETECT_I(unsigned long long, ULLONG, d_g[nd_g]); nd_g++; #else /* @@ -1569,28 +1579,28 @@ detect_C99_integers64(void) * so we'll just make H5T_NATIVE_LLONG the same as H5T_NATIVE_LONG since * `long long' is probably equivalent to `long' here anyway. */ - DETECT_I(long, LLONG, d_g[nd_g]); nd_g++; - DETECT_I(unsigned long, ULLONG, d_g[nd_g]); nd_g++; + DETECT_I(long, LLONG, d_g[nd_g]); nd_g++; + DETECT_I(unsigned long, ULLONG, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers + * Function: detect_C99_integers * - * Purpose: Detect C99 integer types + * Purpose: Detect C99 integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers(void) +detect_C99_integers(void) HDF_NO_UBSAN { /* break it down to more subroutines so that each module subroutine */ /* is smaller and takes less time to compile with optimization on. */ @@ -1600,23 +1610,23 @@ detect_C99_integers(void) detect_C99_integers64(); } - + /*------------------------------------------------------------------------- - * Function: detect_C99_floats + * Function: detect_C99_floats * - * Purpose: Detect C99 floating point types + * Purpose: Detect C99 floating point types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_floats(void) +detect_C99_floats(void) HDF_NO_UBSAN { #if H5_SIZEOF_DOUBLE == H5_SIZEOF_LONG_DOUBLE /* @@ -1625,29 +1635,29 @@ detect_C99_floats(void) * some systems and `long double' is probably the same as `double' here * anyway. */ - DETECT_F(double, LDOUBLE, d_g[nd_g]); nd_g++; + DETECT_F(double, LDOUBLE, d_g[nd_g]); nd_g++; #elif H5_SIZEOF_LONG_DOUBLE !=0 - DETECT_F(long double, LDOUBLE, d_g[nd_g]); nd_g++; + DETECT_F(long double, LDOUBLE, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_alignments + * Function: detect_alignments * - * Purpose: Detect structure alignments + * Purpose: Detect structure alignments * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_alignments(void) +detect_alignments(void) HDF_NO_UBSAN { /* Detect structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */ DETECT_M(void *, POINTER, m_g[na_g]); na_g++; @@ -1656,7 +1666,7 @@ detect_alignments(void) DETECT_M(hdset_reg_ref_t, HDSETREGREF, m_g[na_g]); na_g++; } - + #if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL) /* Verify the signal handler for signal signum works correctly multiple times. * One possible cause of failure is that the signal handling is blocked or @@ -1664,64 +1674,70 @@ detect_alignments(void) * Return 0 for success, -1 for failure. */ static int verify_signal_handlers(int signum, void (*handler)(int)) -{ - void (*save_handler)(int) = HDsignal(signum, handler); +{ +#if defined(__has_feature) +#if __has_feature(address_sanitizer) || __has_feature(thread_sanitizer) + /* Under the address and thread sanitizers, don't raise any signals. */ + return 0; +#endif +#endif + void (*save_handler)(int) = HDsignal(signum, handler); volatile int i, val; int ntries=5; volatile int nfailures=0; volatile int nsuccesses=0; - - for (i=0;i0 || nsuccesses != ntries){ - fprintf(stderr, "verify_signal_handlers for signal %d did %d tries. " - "Found %d failures and %d successes\n", - signum, ntries, nfailures, nsuccesses); - return(-1); + fprintf(stderr, "verify_signal_handlers for signal %d did %d tries. " + "Found %d failures and %d successes\n", + signum, ntries, nfailures, nsuccesses); + return(-1); }else{ - /* all succeeded */ - return(0); + /* all succeeded */ + return(0); } -} +} #endif - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Main entry point. + * Purpose: Main entry point. * - * Return: Success: exit(0) + * Return: Success: exit(0) * - * Failure: exit(1) + * Failure: exit(1) * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12, 1996 * * Modifications: - * Albert Cheng, 2004/05/20 - * Some compilers, e.g., Intel C v7.0, took a long time to compile + * Albert Cheng, 2004/05/20 + * Some compilers, e.g., Intel C v7.0, took a long time to compile * with optimization when a module routine contains many code lines. * Divide up all those types detections macros into subroutines, both * to avoid the compiler optimization error and cleaner codes. @@ -1729,7 +1745,7 @@ static int verify_signal_handlers(int signum, void (*handler)(int)) *------------------------------------------------------------------------- */ int -main(void) +main(void) HDF_NO_UBSAN { #if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS) @@ -1738,12 +1754,12 @@ main(void) * Make sure unaligned access generates SIGBUS and doesn't print warning * messages so that we can detect alignment constraints on the DEC Alpha. */ - int nvpairs[2]; + int nvpairs[2]; nvpairs[0] = SSIN_UACPROC; nvpairs[1] = UAC_NOPRINT | UAC_SIGBUS; if (setsysinfo(SSI_NVPAIRS, nvpairs, 1, 0, 0)<0) { - fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n", - HDstrerror(errno)); + fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n", + HDstrerror(errno)); } #endif #endif -- cgit v0.12 From 435fd5afa57eb8c3157600431f0c8d4df6257cd4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 16:03:03 -0600 Subject: HDFFV-10398 add support for Emscriptem build system --- CMakeLists.txt | 10 +++++++--- src/CMakeLists.txt | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee5fc2a..00ec70a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -528,9 +528,13 @@ endif () #----------------------------------------------------------------------------- # Option to embed library info into executables #----------------------------------------------------------------------------- -option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) -if (HDF5_ENABLE_EMBEDDED_LIBINFO) - set (H5_HAVE_EMBEDDED_LIBINFO 1) +if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") + set (H5_HAVE_EMBEDDED_LIBINFO 0) +else () + option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) + if (HDF5_ENABLE_EMBEDDED_LIBINFO) + set (H5_HAVE_EMBEDDED_LIBINFO 1) + endif () endif () include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0cc68ac..aaedfda 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -852,6 +852,9 @@ TARGET_C_PROPERTIES (H5detect STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") endif () +if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") + set_property(TARGET H5detect PROPERTY LINK_FLAGS "-O0") +endif () add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c @@ -865,6 +868,9 @@ TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") endif () +if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") + set_property(TARGET H5make_libsettings PROPERTY LINK_FLAGS "-O0") +endif () add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c -- cgit v0.12 From b005c5653e3f74ff1548d1de10e3f065bd805982 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 16:22:18 -0600 Subject: HDFFV-10398 fix detection of repeat checks --- config/cmake/ConfigureChecks.cmake | 17 +---------------- config/cmake_ext_mod/ConfigureChecks.cmake | 6 +++--- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 0848e66..7d73c09 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -179,7 +179,7 @@ endif () # Macro to determine the various conversion capabilities #----------------------------------------------------------------------------- macro (H5ConversionTests TEST msg) - if ("${TEST}" MATCHES "^${TEST}$") + if (NOT DEFINED ${TEST}) # message (STATUS "===> ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE ${CMAKE_BINARY_DIR} @@ -210,21 +210,6 @@ macro (H5ConversionTests TEST msg) endmacro () #----------------------------------------------------------------------------- -# Macro to make some of the conversion tests easier to write/read -#----------------------------------------------------------------------------- -macro (H5MiscConversionTest VAR TEST msg) - if ("${TEST}" MATCHES "^${TEST}$") - if (${VAR}) - set (${TEST} 1 CACHE INTERNAL ${msg}) - message (STATUS "${msg}... yes") - else () - set (${TEST} "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") - endif () - endif () -endmacro () - -#----------------------------------------------------------------------------- # Check various conversion capabilities #----------------------------------------------------------------------------- diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index e1b8853..3797768 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -145,7 +145,7 @@ endif () # For other specific tests, use this MACRO. macro (HDF_FUNCTION_TEST OTHER_TEST) - if ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$") + if (NOT DEFINED ${HDF_PREFIX}_${OTHER_TEST}) set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") set (OTHER_TEST_ADD_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES) @@ -587,7 +587,7 @@ endif () # For other CXX specific tests, use this MACRO. macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) - if ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") + if (NOT DEFINED ${OTHER_TEST}) set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") set (OTHER_TEST_ADD_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES) @@ -656,7 +656,7 @@ endif () if (WINDOWS) if (NOT HDF_NO_IOEO_TEST) message (STATUS "Checking for InitOnceExecuteOnce:") - if ("${${HDF_PREFIX}_HAVE_IOEO}" MATCHES "^${${HDF_PREFIX}_HAVE_IOEO}$") + if (NOT DEFINED ${${HDF_PREFIX}_HAVE_IOEO}) if (LARGEFILE) set (CMAKE_REQUIRED_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" -- cgit v0.12 From 1bc7dc396a818d3f13624ab9386999db0c56aa71 Mon Sep 17 00:00:00 2001 From: lrknox Date: Wed, 31 Jan 2018 14:20:41 -0600 Subject: Correct AM_MAINTAINER_MODE default to 'enable'. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6bd650f..98c97cc 100644 --- a/configure.ac +++ b/configure.ac @@ -48,7 +48,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # use silent rules where a ## ## By default, it is enabled. Users can configure with ## --disable-maintainer-mode to prevent running the autotools. -AM_MAINTAINER_MODE([disable]) +AM_MAINTAINER_MODE([enable]) ## ---------------------------------------------------------------------- ## Set prefix default (install directory) to a directory in the build area. -- cgit v0.12 From b57c5490e0901c451a77a356ceb1f6071dc89123 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 1 Feb 2018 09:42:14 -0600 Subject: JHDFFV-10398 add note --- release_docs/RELEASE.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 74b73a4..c13b247 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -236,7 +236,17 @@ Bug Fixes since HDF5-1.10.1 release ------------- - CMake - Correct usuage of CMAKE_BUILD_TYPE variable. + Update CMake commands configuration. + + A number of improvements were made to the CMake commands. Most + changes simplify usage or eliminate unused constructs. Also, + some changes support better cross-platform support. + + (ADB - 2018/02/01, HDFFV-10398) + + - CMake + + Correct usage of CMAKE_BUILD_TYPE variable. The use of the CMAKE_BUILD_TYPE is incorrect for multi-config generators (Visual Studio and XCode) and is optional for single -- cgit v0.12 From 4c0440e61f5bc57f12406b523e9545980e9e6b70 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 1 Feb 2018 09:49:50 -0600 Subject: Added gen_bounds.c --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index 2db6d6b..7f4c377 100644 --- a/MANIFEST +++ b/MANIFEST @@ -981,6 +981,7 @@ ./test/gen_bad_ohdr.c ./test/gen_bad_compound.c ./test/gen_bogus.c +./test/gen_bounds.c ./test/gen_cross.c ./test/gen_deflate.c ./test/gen_file_image.c -- cgit v0.12 From a32b998b824a488c7822b0d607ab7f01ac9ccd23 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 1 Feb 2018 10:08:34 -0600 Subject: Added gen_bounds.c --- test/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index efdc1ca..ab81f50 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -95,7 +95,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_bad_offset + gen_sizes_lheap gen_file_image gen_plist gen_bad_offset gen_bounds if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) -- cgit v0.12 From f325002db905f7da14e66a3bb30ac508d0cfb7fa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Feb 2018 12:38:20 -0600 Subject: HDFFV-10345 spelling errors --- fortran/src/H5Df.c | 10 ++-- fortran/src/H5Gf.c | 42 +++++++------- fortran/src/H5Pf.c | 10 ++-- fortran/src/H5Pff.F90 | 2 +- fortran/src/H5Rff.F90 | 66 +++++++++++----------- hl/fortran/src/H5LTf90proto.h | 4 +- hl/fortran/src/H5TBfc.c | 6 +- hl/test/test_ds.c | 8 +-- src/H5Zscaleoffset.c | 112 +++++++++++++++++++------------------- src/H5detect.c | 4 +- tools/src/h5import/h5import.c | 4 +- tools/test/h5copy/h5copygentest.c | 2 +- 12 files changed, 135 insertions(+), 135 deletions(-) diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 588ea9f..14fac6b 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -567,7 +567,7 @@ DONE: * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH * dims[1] = number of elements of VL type - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -641,7 +641,7 @@ DONE: * dims[1] = number of elements of VL type * OUTPUTS * buf - data buffer - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -882,7 +882,7 @@ h5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH * dims[1] = number of elements of VL type - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -956,7 +956,7 @@ DONE: * dims[1] = number of elements of VL type * OUTPUTS * buf - data buffer - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -1209,7 +1209,7 @@ h5dwrite_f_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, * dims[1] = number of elements of VL type * OUTPUTS * buf - data buffer - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 720bd49..cbe4175 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -47,7 +47,7 @@ */ int_f h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, - hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id ) + hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id ) /******/ { hid_t c_gcpl_id = -1; /* Group creation property list */ @@ -69,11 +69,11 @@ h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, else { /* Create the group creation property list */ if((c_gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) - goto DONE; + goto DONE; /* Set the local heap size hint */ if(H5Pset_local_heap_size_hint(c_gcpl_id, (size_t)*size_hint) < 0) - goto DONE; + goto DONE; /* Create the group */ c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name, H5P_DEFAULT, c_gcpl_id, H5P_DEFAULT); @@ -308,9 +308,9 @@ h5gclose_c(hid_t_f *grp_id) * link_type - link type * current_name - name of the existing object for hard link, * anything for the soft link - * current_namelen - current name lenghth + * current_namelen - current name length * new_name - new name for the object - * new_namelen - new_name lenghth + * new_namelen - new_name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -365,7 +365,7 @@ h5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, goto DONE; break; /* End of the warnings fix */ - + default: /* Unknown/unhandled link type */ goto DONE; } /* end switch */ @@ -390,12 +390,12 @@ DONE: * cur_name - name of the existing object for hard link releative * to cur_loc_id location, * anything for the soft link - * current_namelen - current name lenghth + * current_namelen - current name length * link_type - link type * new_loc_id - location identifier * new_name - new name for the object releative to the new_loc_id * location - * new_namelen - new_name lenghth + * new_namelen - new_name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -515,9 +515,9 @@ DONE: * INPUTS * loc_id - identifier of file or group * src_name - name of the original object - * src_namelen - original name lenghth + * src_namelen - original name length * dst_name - new name for the object - * dst_namelen - new name lenghth + * dst_namelen - new name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -565,10 +565,10 @@ DONE: * INPUTS * src_loc_id - identifier of file or group * src_name - name of the original object relative to src_loc_id - * src_namelen - original name lenghth + * src_namelen - original name length * dst_loc_id - new location identifier * dst_name - new name for the object relative to dst_loc_id - * dst_namelen - new name lenghth + * dst_namelen - new name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -617,8 +617,8 @@ DONE: * INPUTS * loc_id - identifier of file or group * name - name of the object that symbolic link points to - * namelen - the name lenghth - * size - lenghth of retrurned value + * namelen - the name length + * size - length of retrurned value * OUTPUTS * value - name to be returned * RETURNS @@ -681,9 +681,9 @@ DONE: * INPUTS * loc_id - identifier of file or group * name - name of object whose comment is to be set or reset - * namelen - the name lenghth + * namelen - the name length * comment - the new comment - * commentlen - new comment lenghth + * commentlen - new comment length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -732,7 +732,7 @@ DONE: * INPUTS * loc_id - identifier of file or group * name - name of object whose comment is to be set or reset - * namelen - the name lenghth + * namelen - the name length * bufsize - at most bufsize characters * comment - the new comment * RETURNS @@ -948,8 +948,8 @@ done: */ int_f h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) + int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, + int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) /******/ { char *c_group_name = NULL; /* Buffer to hold group name C string */ @@ -965,7 +965,7 @@ h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, * Call H5Gget_info_by_idx function. */ if(H5Gget_info_by_idx((hid_t)*loc_id,c_group_name, (H5_index_t)*index_type,(H5_iter_order_t)*order,(hsize_t)*n, - &ginfo, (hid_t)*lapl_id) < 0) + &ginfo, (hid_t)*lapl_id) < 0) HGOTO_DONE(FAIL); /* Unpack the structure */ @@ -1018,7 +1018,7 @@ h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, */ int_f h5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted) + int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted) /******/ { char *c_group_name = NULL; /* Buffer to hold group name C string */ diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index a114e8b..9fdd19b 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -2638,7 +2638,7 @@ h5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) * INPUTS * parent - property list class identifier * name - name of the new class - * name_len - lenght of the "name" buffer + * name_len - length of the "name" buffer * OUTPUTS * class - new class identifier * RETURNS @@ -3415,8 +3415,8 @@ h5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) * mem_map - memory mapping array * memb_fapl - property list for each memory usage type * memb_name - array with members names - * len - array with the lenght of each name - * lenmax - lenght of the name a sdeclared in Fortran + * len - array with the length of each name + * lenmax - length of the name a sdeclared in Fortran * flag - flag allowing partila access when one of the files is missing * RETURNS * 0 on success, -1 on failure @@ -3537,12 +3537,12 @@ h5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) * Call H5Pget_fapl_multi to set multi file dirver * INPUTS * prp_id - file_creation property list identifier - * lenmax - lenght of the name a sdeclared in Fortran + * lenmax - length of the name a sdeclared in Fortran * OUTPUTS * memb_map - memory mapping array * memb_fapl - property list for each memory usage type * memb_name - array with members names - * len - array with the lenght of each name + * len - array with the length of each name * flag - flag allowing partila access when one of the files is missing * RETURNS * 0 on success, -1 on failure diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index b69d4d0..178aa80 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -5313,7 +5313,7 @@ CONTAINS ! ! expression - buffer to hold transform expression ! hdferr - Error code -! Success: Actual lenght of the expression +! Success: Actual length of the expression ! If provided buffer "expression" is ! smaller, than expression will be ! truncated to fit into diff --git a/fortran/src/H5Rff.F90 b/fortran/src/H5Rff.F90 index 6d6371b..f5a9c6e 100644 --- a/fortran/src/H5Rff.F90 +++ b/fortran/src/H5Rff.F90 @@ -38,7 +38,7 @@ ! !***** -MODULE H5R +MODULE H5R USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_SIGNED_CHAR USE H5GLOBAL @@ -62,7 +62,7 @@ MODULE H5R END INTERFACE - TYPE :: hdset_reg_ref_t_f03 + TYPE :: hdset_reg_ref_t_f03 INTEGER(C_SIGNED_CHAR), DIMENSION(1:H5R_DSET_REG_REF_BUF_SIZE_F) :: ref END TYPE hdset_reg_ref_t_f03 @@ -165,16 +165,16 @@ CONTAINS ! Retrieves the type of object that an object reference points to. ! ! INPUTS -! dset_id - identifier of the dataset containing +! dset_id - identifier of the dataset containing ! reference to the objects -! ref - reference to open +! ref - reference to open ! OUTPUTS -! obj_type - object_type, possible values: +! obj_type - object_type, possible values: ! H5G_UNKNOWN_F -! H5G_GROUP_F +! H5G_GROUP_F ! H5G_DATASET_F ! H5G_TYPE_F -! hdferr - Returns 0 if successful and -1 if fails +! hdferr - Returns 0 if successful and -1 if fails ! ! AUTHOR ! Elena Pourmal @@ -227,17 +227,17 @@ CONTAINS ! Retrieves a dataspace with the specified region selected ! ! INPUTS -! dset_id - identifier of the dataset containing +! dset_id - identifier of the dataset containing ! reference to the regions -! ref - reference to open +! ref - reference to open ! OUTPUTS -! space_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal ! August 12, 1999 ! -! HISTORY +! HISTORY ! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows ! port). February 28, 2001 @@ -276,16 +276,16 @@ CONTAINS ! h5rget_region_ptr_f ! ! PURPOSE -! Retrieves a dataspace with the specified region +! Retrieves a dataspace with the specified region ! selected using pointer ! ! INPUTS -! dset_id - identifier of the dataset containing +! dset_id - identifier of the dataset containing ! reference to the regions -! ref - reference to open +! ref - reference to open ! OUTPUTS -! space_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails ! AUTHOR ! M. Scot Breitenfeld ! August 4, 2012 @@ -319,7 +319,7 @@ CONTAINS ! loc_id - location identifier ! name - name of the object at the specified location ! Outputs: -! ref - reference to the specified object +! ref - reference to the specified object ! hdferr - returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal @@ -363,11 +363,11 @@ CONTAINS ! Creates reference to the dataset region ! ! INPUTS -! loc_id - location identifier -! name - name of the dataset at the specified location -! space_id - dataspace identifier that describes selected region +! loc_id - location identifier +! name - name of the dataset at the specified location +! space_id - dataspace identifier that describes selected region ! OUTPUTS -! ref - reference to the dataset region +! ref - reference to the dataset region ! hdferr - returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal @@ -424,12 +424,12 @@ CONTAINS ! ! Inputs: ! loc_id - location identifier -! name - name of the dataset at the specified location +! name - name of the dataset at the specified location ! ref_type - type of reference: ! H5R_OBJECT ! H5T_STD_REF_DSETREG ! Outputs: -! ref - reference created by the function call. +! ref - reference created by the function call. ! hdferr - returns 0 if successful and -1 if fails. ! OPTIONAL ! space_id - dataspace identifier that describes selected region @@ -474,7 +474,7 @@ CONTAINS ! Inputs: ! dset_id - identifier of the dataset containing ! reference -! ref - reference to open +! ref - reference to open ! Outputs: ! obj_id - object_identifier ! hdferr - returns 0 if successful and -1 if fails @@ -515,8 +515,8 @@ CONTAINS ! ! Inputs: ! dset_id - identifier of the dataset containing -! reference to teh regions -! ref - reference to open +! reference to the regions +! ref - reference to open ! Outputs: ! obj_id - dataspace identifier ! hdferr - returns 0 if successful and -1 if fails @@ -585,7 +585,7 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: ref_obj_id ! Identifier of referenced object INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** +!***** hdferr = h5rdereference_ptr_c(obj_id, ref_type, ref, ref_obj_id) END SUBROUTINE h5rdereference_ptr_f @@ -600,14 +600,14 @@ CONTAINS ! ! Inputs: ! loc_id - Identifier for the file containing the reference or for any object in that file. -! ref - An object or dataset region reference. +! ref - An object or dataset region reference. ! ! Outputs: ! name - A name associated with the referenced object or dataset region. ! hdferr - Returns 0 if successful and -1 if fails. ! ! Optional parameters: -! size - The size of the name buffer, returning 0 (zero) if no name is associated +! size - The size of the name buffer, returning 0 (zero) if no name is associated ! with the identifier. ! ! AUTHOR @@ -648,7 +648,7 @@ CONTAINS ! ! Inputs: ! loc_id - Identifier for the file containing the reference or for any object in that file. -! ref - An object or dataset region reference. +! ref - An object or dataset region reference. ! ! Outputs: ! name - A name associated with the referenced object or dataset region. @@ -747,12 +747,12 @@ CONTAINS ! ref - Reference to query. ! ! Outputs: - ! obj_type - Type of referenced object. + ! obj_type - Type of referenced object. ! H5G_UNKNOWN_F ! H5G_GROUP_F ! H5G_DATASET_F ! H5G_TYPE_F - ! + ! ! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 35b08a1..031db2c 100644 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -303,7 +303,7 @@ h5tbmake_table_c(size_t_f *namelen1, hid_t_f *field_types, hsize_t_f *chunk_size, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ _fcd buf); /* field_names */ @@ -334,7 +334,7 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, hsize_t_f *chunk_size, void *fill_data, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ char *field_names, /* field_names */ void *data); diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index c0d053f..331f0bc 100644 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -38,7 +38,7 @@ int_f h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, size_t_f *field_offset, hid_t_f *field_types, hsize_t_f *chunk_size, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ char *field_names) /* field_names */ { @@ -143,7 +143,7 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f * _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, size_t_f *field_offset, hid_t_f *field_types, hsize_t_f *chunk_size, void *fill_data, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ char *field_names, void *data) /* field_names */ @@ -638,7 +638,7 @@ done: int_f h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields, size_t_f *field_sizes, size_t_f *field_offsets, size_t_f *type_size, - size_t_f *namelen2, /* field_names lenghts */ + size_t_f *namelen2, /* field_names lengths */ size_t_f *lenmax, /* character len max */ _fcd field_names, /* field_names */ size_t_f *maxlen_out) diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 91f1505..49dc72f 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -3080,7 +3080,7 @@ static int test_simple(void) /*------------------------------------------------------------------------- - * get the label using a static buffer smaller than the string lenght + * get the label using a static buffer smaller than the string length *------------------------------------------------------------------------- */ @@ -3118,7 +3118,7 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - /* get the lenght of the scale name (pass NULL in name) */ + /* get the length of the scale name (pass NULL in name) */ if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) < 0) goto out; @@ -3151,7 +3151,7 @@ static int test_simple(void) goto out; /*------------------------------------------------------------------------- - * get the scale name using a static buffer smaller than the string lenght + * get the scale name using a static buffer smaller than the string length *------------------------------------------------------------------------- */ @@ -4925,7 +4925,7 @@ static int test_errors2(void) hsize_t dimd[2] = {3,3}; /* size of data dataset */ hsize_t dims[1] = {3}; /* size of scale dataset */ char lbuf[255]; /* label buffer */ - ssize_t label_len; /* label lenght */ + ssize_t label_len; /* label length */ int scale_idx; /* scale index */ int nscales; /* number of scales in DIM */ int count; /* visitor data */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index b86d785..37f5675 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -13,16 +13,16 @@ #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ #include "H5Oprivate.h" /* Object headers */ -#include "H5Sprivate.h" /* Dataspaces */ -#include "H5Tprivate.h" /* Datatypes */ -#include "H5Zpkg.h" /* Data filters */ +#include "H5Sprivate.h" /* Dataspaces */ +#include "H5Tprivate.h" /* Datatypes */ +#include "H5Zpkg.h" /* Data filters */ /* Struct of parameters needed for compressing/decompressing one atomic datatype */ typedef struct { @@ -78,13 +78,13 @@ static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, uns /* This message derives from H5Z */ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_SCALEOFFSET, /* Filter id number */ + H5Z_FILTER_SCALEOFFSET, /* Filter id number */ 1, /* Assume encoder present: check before registering */ 1, /* decoder_present flag (set to true) */ - "scaleoffset", /* Filter name for debugging */ - H5Z_can_apply_scaleoffset, /* The "can apply" callback */ + "scaleoffset", /* Filter name for debugging */ + H5Z_can_apply_scaleoffset, /* The "can apply" callback */ H5Z_set_local_scaleoffset, /* The "set local" callback */ - H5Z_filter_scaleoffset, /* The actual filter function */ + H5Z_filter_scaleoffset, /* The actual filter function */ }}; /* Local macros */ @@ -665,15 +665,15 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_modify_4(i, type, pow_fun, buf, d_nelmts, min, D_val) \ } - + /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_scaleoffset + * Function: H5Z_can_apply_scaleoffset * - * Purpose: Check the parameters for scaleoffset compression for + * Purpose: Check the parameters for scaleoffset compression for * validity and whether they fit a particular dataset. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Xiaowen Wu * Friday, February 4, 2005 @@ -685,7 +685,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ static htri_t H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { - const H5T_t *type; /* Datatype */ + const H5T_t *type; /* Datatype */ H5T_class_t dtype_class; /* Datatype's class */ H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ @@ -694,20 +694,20 @@ H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ /* Get datatype */ if(NULL == (type = (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") /* Get datatype's class, for checking the "datatype class" */ if((dtype_class = H5T_get_class(type, TRUE)) == H5T_NO_CLASS) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") /* Get datatype's size, for checking the "datatype size" */ if(H5T_get_size(type) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") if(dtype_class == H5T_INTEGER || dtype_class == H5T_FLOAT) { /* Get datatype's endianness order */ if((dtype_order = H5T_get_order(type)) == H5T_ORDER_ERROR) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") /* Range check datatype's endianness order */ if(dtype_order != H5T_ORDER_LE && dtype_order != H5T_ORDER_BE) @@ -719,17 +719,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_can_apply_scaleoffset() */ - + /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_get_type + * Function: H5Z_scaleoffset_get_type * - * Purpose: Get the specific integer type based on datatype size and sign + * Purpose: Get the specific integer type based on datatype size and sign * or floating-point type based on size * - * Return: Success: id number of integer type - * Failure: 0 + * Return: Success: id number of integer type + * Failure: 0 * - * Programmer: Xiaowen Wu + * Programmer: Xiaowen Wu * Wednesday, April 13, 2005 * * Modifications: @@ -784,14 +784,14 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_set_parms_fillval + * Function: H5Z_scaleoffset_set_parms_fillval * - * Purpose: Get the fill value of the dataset and store in cd_values[] + * Purpose: Get the fill value of the dataset and store in cd_values[] * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Xiaowen Wu * Monday, March 7, 2005 @@ -836,17 +836,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_scaleoffset_set_parms_fillval() */ - + /*------------------------------------------------------------------------- - * Function: H5Z_set_local_scaleoffset + * Function: H5Z_set_local_scaleoffset * - * Purpose: Set the "local" dataset parameters for scaleoffset + * Purpose: Set the "local" dataset parameters for scaleoffset * compression. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Xiaowen Wu + * Programmer: Xiaowen Wu * Friday, February 4, 2005 * * Modifications: @@ -857,8 +857,8 @@ static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ - H5T_t *type; /* Datatype */ - const H5S_t *ds; /* Dataspace */ + H5T_t *type; /* Datatype */ + const H5S_t *ds; /* Dataspace */ unsigned flags; /* Filter flags */ size_t cd_nelmts = H5Z_SCALEOFFSET_USER_NPARMS; /* Number of filter parameters */ unsigned cd_values[H5Z_SCALEOFFSET_TOTAL_NPARMS]; /* Filter parameters */ @@ -879,14 +879,14 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype */ if(NULL == (type = (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") /* Initialize the parameters to a known state */ HDmemset(cd_values, 0, sizeof(cd_values)); /* Get the filter's current parameters */ if(H5P_get_filter_by_id(dcpl_plist, H5Z_FILTER_SCALEOFFSET, &flags, &cd_nelmts, cd_values, (size_t)0, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters") /* Get dataspace */ if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) @@ -930,7 +930,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype's size */ if((dtype_size = H5T_get_size(type)) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") /* Set "local" parameter for datatype size */ H5_CHECK_OVERFLOW(dtype_size, size_t, unsigned); @@ -1008,23 +1008,23 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Modify the filter's parameters for this dataset */ if(H5P_modify_filter(dcpl_plist, H5Z_FILTER_SCALEOFFSET, flags, (size_t)H5Z_SCALEOFFSET_TOTAL_NPARMS, cd_values) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_set_local_scaleoffset() */ - + /*------------------------------------------------------------------------- - * Function: H5Z_filter_scaleoffset + * Function: H5Z_filter_scaleoffset * - * Purpose: Implement an I/O filter for storing packed integer + * Purpose: Implement an I/O filter for storing packed integer * data using scale and offset method. * - * Return: Success: Size of buffer filtered - * Failure: 0 + * Return: Success: Size of buffer filtered + * Failure: 0 * - * Programmer: Xiaowen Wu + * Programmer: Xiaowen Wu * Monday, February 7, 2005 * * Modifications: @@ -1051,13 +1051,13 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value unsigned char *outbuf = NULL; /* pointer to new output buffer */ unsigned buf_offset = 21; /* buffer offset because of parameters stored in file */ unsigned i; /* index */ - parms_atomic p; /* paramters needed for compress/decompress functions */ + parms_atomic p; /* parameters needed for compress/decompress functions */ FUNC_ENTER_NOAPI_NOINIT /* check arguments */ if(cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of paramters") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of parameters") /* Check if memory byte order matches dataset datatype byte order */ switch(H5T_native_order_g) { @@ -1107,7 +1107,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* if scale_factor is less than 0 for integer, library will reset it to 0 * in this case, library will calculate the minimum-bits */ - if(scale_factor < 0) scale_factor = 0; + if(scale_factor < 0) scale_factor = 0; } /* fixed-minimum-bits method is not implemented and is forbidden */ @@ -1128,7 +1128,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value minbits = (uint32_t)scale_factor; } - /* prepare paramters to pass to compress/decompress functions */ + /* prepare parameters to pass to compress/decompress functions */ p.size = cd_values[H5Z_SCALEOFFSET_PARM_SIZE]; p.mem_order = H5T_native_order_g; @@ -1310,7 +1310,7 @@ done: * atomic datatype is treated on byte basis */ - + /* change byte order of input buffer either from little-endian to big-endian * or from big-endian to little-endian 2/21/2005 */ diff --git a/src/H5detect.c b/src/H5detect.c index 2cc8366..ff163cf 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -37,7 +37,7 @@ static const char *FileHeader = "\n\ * * Detects machine byte order and floating point * format and generates a C source file (H5Tinit.c) - * to describe those paramters. + * to describe those parameters. * * Assumptions: We have an ANSI compiler. We're on a Unix like * system or configure has detected those Unix @@ -75,7 +75,7 @@ static const char *FileHeader = "\n\ /* Define H5SETJMP/H5LONGJMP depending on if sigsetjmp/siglongjmp are */ /* supported. */ #if defined(H5_HAVE_SIGSETJMP) && defined(H5_HAVE_SIGLONGJMP) -/* Always save blocked signals to be restore by siglongjmp. */ +/* Always save blocked signals to be restored by siglongjmp. */ #define H5JMP_BUF sigjmp_buf #define H5SETJMP(buf) HDsigsetjmp(buf, 1) #define H5LONGJMP(buf, val) HDsiglongjmp(buf, val) diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 36a8c21..76e78af 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -1405,7 +1405,7 @@ static int processConfigurationFile(char *infile, struct Input *in) const char *err14a = "COMPRESSION-PARAM keyword appears twice in %s.\n"; const char *err14b = "Error in retrieving the compression parameter from %s.\n"; const char *err15a = "EXTERNAL-STORAGE keyword appears twice in %s.\n"; - const char *err15b = "Error in retrieving the external storage paramters from %s.\n"; + const char *err15b = "Error in retrieving the external storage parameters from %s.\n"; const char *err16a = "MAXIMUM-DIMENSIONS keyword appears twice in %s.\n"; const char *err16b = "MAXIMUM-DIMENSIONS cannot appear before DIMENSION-SIZES are provided.\n"; const char *err16c = "Error in retrieving the maximum dimension sizes from %s.\n"; @@ -3690,7 +3690,7 @@ static int getCompressionParameter(struct Input *in, FILE *strm) { /* currently supports only GZIP */ /* can be extended by adding more values to COMPRESSION-TYPE and */ - /* handling the paramters here by adding more cases */ + /* handling the parameters here by adding more cases */ int ival; const char *err1 = "Unable to get integer value.\n"; diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index 35f9132..9f5d916 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -225,7 +225,7 @@ static void gent_compressed(hid_t loc_id) /*------------------------------------------------------------------------- * Function: gent_named_vl * - * Purpose: Generate a variable lenght named datatype for a dataset in + * Purpose: Generate a variable length named datatype for a dataset in LOC_ID * *------------------------------------------------------------------------- -- cgit v0.12 From d08f56e027762fde54be6959b9c4e76514578ae1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Feb 2018 12:47:31 -0600 Subject: HDFFV-10345 whitespace corrections --- fortran/src/H5Gf.c | 4 ++-- src/H5Zscaleoffset.c | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index cbe4175..b829b20 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -69,11 +69,11 @@ h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, else { /* Create the group creation property list */ if((c_gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) - goto DONE; + goto DONE; /* Set the local heap size hint */ if(H5Pset_local_heap_size_hint(c_gcpl_id, (size_t)*size_hint) < 0) - goto DONE; + goto DONE; /* Create the group */ c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name, H5P_DEFAULT, c_gcpl_id, H5P_DEFAULT); diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 37f5675..58bcf8b 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -694,20 +694,20 @@ H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ /* Get datatype */ if(NULL == (type = (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") /* Get datatype's class, for checking the "datatype class" */ if((dtype_class = H5T_get_class(type, TRUE)) == H5T_NO_CLASS) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") /* Get datatype's size, for checking the "datatype size" */ if(H5T_get_size(type) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") if(dtype_class == H5T_INTEGER || dtype_class == H5T_FLOAT) { /* Get datatype's endianness order */ if((dtype_order = H5T_get_order(type)) == H5T_ORDER_ERROR) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") /* Range check datatype's endianness order */ if(dtype_order != H5T_ORDER_LE && dtype_order != H5T_ORDER_BE) @@ -879,14 +879,14 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype */ if(NULL == (type = (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") /* Initialize the parameters to a known state */ HDmemset(cd_values, 0, sizeof(cd_values)); /* Get the filter's current parameters */ if(H5P_get_filter_by_id(dcpl_plist, H5Z_FILTER_SCALEOFFSET, &flags, &cd_nelmts, cd_values, (size_t)0, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters") /* Get dataspace */ if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) @@ -930,7 +930,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype's size */ if((dtype_size = H5T_get_size(type)) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") /* Set "local" parameter for datatype size */ H5_CHECK_OVERFLOW(dtype_size, size_t, unsigned); @@ -1008,7 +1008,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Modify the filter's parameters for this dataset */ if(H5P_modify_filter(dcpl_plist, H5Z_FILTER_SCALEOFFSET, flags, (size_t)H5Z_SCALEOFFSET_TOTAL_NPARMS, cd_values) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1057,7 +1057,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* check arguments */ if(cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of parameters") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of parameters") /* Check if memory byte order matches dataset datatype byte order */ switch(H5T_native_order_g) { @@ -1107,7 +1107,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* if scale_factor is less than 0 for integer, library will reset it to 0 * in this case, library will calculate the minimum-bits */ - if(scale_factor < 0) scale_factor = 0; + if(scale_factor < 0) scale_factor = 0; } /* fixed-minimum-bits method is not implemented and is forbidden */ -- cgit v0.12 From fbaa2192f8171ddb5af175d7f750c19dcad3ae4f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Feb 2018 16:14:00 -0600 Subject: Remove old dependency construct --- CMakeLists.txt | 1 - tools/CMakeLists.txt | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00ec70a..3c7bb38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -725,7 +725,6 @@ if (BUILD_TESTING) if (NOT HDF5_EXTERNALLY_CONFIGURED) if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") - add_subdirectory (tools/lib) add_subdirectory (test) endif () if (H5_HAVE_PARALLEL) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 8d442e0..41a9fdc 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -9,9 +9,7 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) # -------------------------------------------------------------------- # If testing was NOT enabled, then we need to build the tools library # -------------------------------------------------------------------- -if (NOT BUILD_TESTING) - add_subdirectory (lib) -endif () +add_subdirectory (lib) #----------------------------------------------------------------------------- # Setup include Directories -- cgit v0.12 From 2fbdfcc4574a141bc668795db9cb48678ba9e336 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 6 Feb 2018 21:42:02 -0600 Subject: Modifications made based on comments from pull request. --- src/H5Aint.c | 2 +- src/H5Dint.c | 1 + src/H5Fint.c | 8 +- src/H5Fprivate.h | 10 +- src/H5Fquery.c | 4 +- src/H5Ofill.c | 4 +- src/H5Pfapl.c | 36 +- src/H5Tcommit.c | 1 + src/H5trace.c | 1040 +++++++++++------------ test/testfiles/plist_files/dapl_32be | Bin 186 -> 199 bytes test/testfiles/plist_files/dapl_32le | Bin 186 -> 199 bytes test/testfiles/plist_files/dapl_64be | Bin 186 -> 199 bytes test/testfiles/plist_files/dapl_64le | Bin 186 -> 199 bytes test/testfiles/plist_files/def_dapl_32be | Bin 181 -> 194 bytes test/testfiles/plist_files/def_dapl_32le | Bin 181 -> 194 bytes test/testfiles/plist_files/def_dapl_64be | Bin 181 -> 194 bytes test/testfiles/plist_files/def_dapl_64le | Bin 181 -> 194 bytes test/testfiles/plist_files/def_fapl_32be | Bin 1697 -> 1711 bytes test/testfiles/plist_files/def_fapl_32le | Bin 1697 -> 1711 bytes test/testfiles/plist_files/def_fapl_64be | Bin 1697 -> 1711 bytes test/testfiles/plist_files/def_fapl_64le | Bin 1697 -> 1711 bytes test/testfiles/plist_files/fapl_32be | Bin 1699 -> 1713 bytes test/testfiles/plist_files/fapl_32le | Bin 1699 -> 1713 bytes test/testfiles/plist_files/fapl_64be | Bin 1699 -> 1713 bytes test/testfiles/plist_files/fapl_64le | Bin 1699 -> 1713 bytes test/testfiles/plist_files/lapl_32be | Bin 1802 -> 1816 bytes test/testfiles/plist_files/lapl_32le | Bin 1802 -> 1816 bytes test/testfiles/plist_files/lapl_64be | Bin 1802 -> 1816 bytes test/testfiles/plist_files/lapl_64le | Bin 1802 -> 1816 bytes tools/src/h5repack/h5repack_main.c | 8 +- tools/test/h5repack/testfiles/h5repack-help.txt | 8 +- 31 files changed, 562 insertions(+), 560 deletions(-) diff --git a/src/H5Aint.c b/src/H5Aint.c index 666f11d..55c46f6 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -215,7 +215,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, if(H5T_set_loc(attr->shared->dt, loc->oloc->file, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location") - /* Set the latest format for datatype, if requested */ + /* Set the version for datatype */ if(H5T_set_version(loc->oloc->file, attr->shared->dt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set version of datatype") diff --git a/src/H5Dint.c b/src/H5Dint.c index 9af1689..fc191ff 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -661,6 +661,7 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) if(H5T_set_loc(dset->shared->type, file, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't set datatype location") + /* Set the version for datatype */ if(H5T_set_version(file, dset->shared->type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype") diff --git a/src/H5Fint.c b/src/H5Fint.c index 86627ea..c41453a 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -161,9 +161,9 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't sieve buffer size") if(H5P_set(new_plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &(f->shared->sdata_aggr.alloc_size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' cache size") - if(H5P_set(new_plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, &f->shared->low_bound) < 0) + if(H5P_set(new_plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &f->shared->low_bound) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'low' bound for library format versions") - if(H5P_set(new_plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &f->shared->high_bound) < 0) + if(H5P_set(new_plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &f->shared->high_bound) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'high' bound for library format versions") if(H5P_set(new_plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, &(f->shared->read_attempts)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'read attempts ' flag") @@ -902,9 +902,9 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get garbage collect reference") if(H5P_get(plist, H5F_ACS_SIEVE_BUF_SIZE_NAME, &(f->shared->sieve_buf_size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get sieve buffer size") - if(H5P_get(plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, &(f->shared->low_bound)) < 0) + if(H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &(f->shared->low_bound)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'low' bound for library format versions") - if(H5P_get(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &(f->shared->high_bound)) < 0) + if(H5P_get(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &(f->shared->high_bound)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'high' bound for library format versions") 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") diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index e426a4b..856e618 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -484,8 +484,8 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" /* New member size of family driver. (private property only used by h5repart) */ #define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" /* Whether to convert family to sec2 driver. (private property only used by h5repart) */ #define H5F_ACS_MULTI_TYPE_NAME "multi_type" /* Data type in multi file driver */ -#define H5F_ACS_FORMAT_LOW_BOUND_NAME "low_bound" /* 'low' bound of library format versions */ -#define H5F_ACS_FORMAT_HIGH_BOUND_NAME "high_bound" /* 'high' bound of library format versions */ +#define H5F_ACS_LIBVER_LOW_BOUND_NAME "libver_low_bound" /* 'low' bound of library format versions */ +#define H5F_ACS_LIBVER_HIGH_BOUND_NAME "libver_high_bound" /* 'high' bound of library format versions */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ #define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ @@ -720,9 +720,9 @@ H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); H5_DLL herr_t H5F_try_close(H5F_t *f, hbool_t *was_closed/*out*/); -/* Functions than retrieve values from the file struct */ -H5_DLL unsigned H5F_get_low_bound(const H5F_t *f); -H5_DLL unsigned H5F_get_high_bound(const H5F_t *f); +/* Functions that retrieve values from the file struct */ +H5_DLL H5F_libver_t H5F_get_low_bound(const H5F_t *f); +H5_DLL H5F_libver_t H5F_get_high_bound(const H5F_t *f); H5_DLL unsigned H5F_get_intent(const H5F_t *f); H5_DLL char *H5F_get_open_name(const H5F_t *f); H5_DLL char *H5F_get_actual_name(const H5F_t *f); diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 32c893e..f7e222e 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -109,7 +109,7 @@ H5F_get_intent(const H5F_t *f) * *------------------------------------------------------------------------- */ -unsigned +H5F_libver_t H5F_get_low_bound(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -134,7 +134,7 @@ H5F_get_low_bound(const H5F_t *f) * *------------------------------------------------------------------------- */ -unsigned +H5F_libver_t H5F_get_high_bound(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 6dc3064..74f69d1 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -929,10 +929,10 @@ H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Data type:"); if(fill->type) { H5T_debug(fill->type, stream); - fprintf(stream, "\n"); + HDfprintf(stream, "\n"); } /* end if */ else - fprintf(stream, "\n"); + HDfprintf(stream, "\n"); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_fill_debug() */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 7b358a9..7802535 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -142,16 +142,16 @@ #define H5F_ACS_MULTI_TYPE_DEC H5P__facc_multi_type_dec /* Definition for "low" bound of library format versions */ -#define H5F_ACS_FORMAT_LOW_BOUND_SIZE sizeof(H5F_libver_t) -#define H5F_ACS_FORMAT_LOW_BOUND_DEF H5F_LIBVER_EARLIEST -#define H5F_ACS_FORMAT_LOW_BOUND_ENC H5P__facc_libver_type_enc -#define H5F_ACS_FORMAT_LOW_BOUND_DEC H5P__facc_libver_type_dec +#define H5F_ACS_LIBVER_LOW_BOUND_SIZE sizeof(H5F_libver_t) +#define H5F_ACS_LIBVER_LOW_BOUND_DEF H5F_LIBVER_EARLIEST +#define H5F_ACS_LIBVER_LOW_BOUND_ENC H5P__facc_libver_type_enc +#define H5F_ACS_LIBVER_LOW_BOUND_DEC H5P__facc_libver_type_dec /* Definition for "high" bound of library format versions */ -#define H5F_ACS_FORMAT_HIGH_BOUND_SIZE sizeof(H5F_libver_t) -#define H5F_ACS_FORMAT_HIGH_BOUND_DEF H5F_LIBVER_LATEST -#define H5F_ACS_FORMAT_HIGH_BOUND_ENC H5P__facc_libver_type_enc -#define H5F_ACS_FORMAT_HIGH_BOUND_DEC H5P__facc_libver_type_dec +#define H5F_ACS_LIBVER_HIGH_BOUND_SIZE sizeof(H5F_libver_t) +#define H5F_ACS_LIBVER_HIGH_BOUND_DEF H5F_LIBVER_LATEST +#define H5F_ACS_LIBVER_HIGH_BOUND_ENC H5P__facc_libver_type_enc +#define H5F_ACS_LIBVER_HIGH_BOUND_DEC H5P__facc_libver_type_dec /* Definition for whether to query the file descriptor from the core VFD * instead of the memory address. (Private to library) @@ -363,8 +363,8 @@ static const hsize_t H5F_def_family_newsize_g = H5F_ACS_FAMILY_NEWSIZE_DEF; static const hbool_t H5F_def_family_to_sec2_g = H5F_ACS_FAMILY_TO_SEC2_DEF; /* Default ?? for family VFD */ static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; /* Default file space type for multi VFD */ -static const H5F_libver_t H5F_def_format_low_bound_g = H5F_ACS_FORMAT_LOW_BOUND_DEF; /* Default setting for "low" bound of format version */ -static const H5F_libver_t H5F_def_format_high_bound_g = H5F_ACS_FORMAT_HIGH_BOUND_DEF; /* Default setting for "high" bound of format version */ +static const H5F_libver_t H5F_def_libver_low_bound_g = H5F_ACS_LIBVER_LOW_BOUND_DEF; /* Default setting for "low" bound of format version */ +static const H5F_libver_t H5F_def_libver_high_bound_g = H5F_ACS_LIBVER_HIGH_BOUND_DEF; /* Default setting for "high" bound of format version */ static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ @@ -505,14 +505,14 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'low' bound of library format versions */ - if(H5P_register_real(pclass, H5F_ACS_FORMAT_LOW_BOUND_NAME, H5F_ACS_FORMAT_LOW_BOUND_SIZE, &H5F_def_format_low_bound_g, - NULL, NULL, NULL, H5F_ACS_FORMAT_LOW_BOUND_ENC, H5F_ACS_FORMAT_LOW_BOUND_DEC, + if(H5P_register_real(pclass, H5F_ACS_LIBVER_LOW_BOUND_NAME, H5F_ACS_LIBVER_LOW_BOUND_SIZE, &H5F_def_libver_low_bound_g, + NULL, NULL, NULL, H5F_ACS_LIBVER_LOW_BOUND_ENC, H5F_ACS_LIBVER_LOW_BOUND_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'high' bound of library format versions */ - if(H5P_register_real(pclass, H5F_ACS_FORMAT_HIGH_BOUND_NAME, H5F_ACS_FORMAT_HIGH_BOUND_SIZE, &H5F_def_format_high_bound_g, - NULL, NULL, NULL, H5F_ACS_FORMAT_HIGH_BOUND_ENC, H5F_ACS_FORMAT_HIGH_BOUND_DEC, + if(H5P_register_real(pclass, H5F_ACS_LIBVER_HIGH_BOUND_NAME, H5F_ACS_LIBVER_HIGH_BOUND_SIZE, &H5F_def_libver_high_bound_g, + NULL, NULL, NULL, H5F_ACS_LIBVER_HIGH_BOUND_ENC, H5F_ACS_LIBVER_HIGH_BOUND_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -2374,9 +2374,9 @@ H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Set values */ - if(H5P_set(plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, &low) < 0) + if(H5P_set(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &low) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set low bound for library format versions") - if(H5P_set(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &high) < 0) + if(H5P_set(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &high) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set high bound for library format versions") done: FUNC_LEAVE_API(ret_value) @@ -2412,12 +2412,12 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low/*out*/, /* Get values */ if(low) { - if(H5P_get(plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, low) < 0) + if(H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, low) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get low bound for library format versions") } if(high) { - if(H5P_get(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, high) < 0) + if(H5P_get(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, high) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get high bound for library format versions") } diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 02a6add..cd0597c 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -349,6 +349,7 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize path") loc_init = TRUE; + /* Set the version for datatype */ if(H5T_set_version(file, type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype") diff --git a/src/H5trace.c b/src/H5trace.c index b1f05ba..32e05a7 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -174,26 +174,26 @@ H5_trace(const double *returning, const char *func, const char *type, ...) if(H5_debug_g.ttimes) { char tmp[128]; - sprintf(tmp, "%.6f", event_time.etime-first_time.etime); - fprintf(out, " %*s ", (int)HDstrlen(tmp), ""); + HDsprintf(tmp, "%.6f", event_time.etime-first_time.etime); + HDfprintf(out, " %*s ", (int)HDstrlen(tmp), ""); } /* end if */ for(i = 0; i < current_depth; i++) HDfputc('+', out); - fprintf(out, "%*s%s = ", 2*current_depth, "", func); + HDfprintf(out, "%*s%s = ", 2*current_depth, "", func); } /* end if */ else { /* Continue current line with return value */ - fprintf(out, " = "); + HDfprintf(out, " = "); } /* end else */ } /* end if */ else { if(current_depth>last_call_depth) HDfputs(" = \n", out); if(H5_debug_g.ttimes) - fprintf(out, "@%.6f ", event_time.etime - first_time.etime); + HDfprintf(out, "@%.6f ", event_time.etime - first_time.etime); for(i = 0; i < current_depth; i++) HDfputc('+', out); - fprintf(out, "%*s%s(", 2*current_depth, "", func); + HDfprintf(out, "%*s%s(", 2*current_depth, "", func); } /* end else */ /* Clear array sizes */ @@ -235,7 +235,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) buf[MIN((int)sizeof(buf) - 1, n)] = '\0'; argname = buf; } /* end if */ - fprintf(out, "%s%s=", argno?", ":"", argname); + HDfprintf(out, "%s%s=", argno?", ":"", argname); } /* end if */ else argname = ""; @@ -247,9 +247,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'a': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { haddr_t addr = va_arg(ap, haddr_t); @@ -261,33 +261,33 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'b': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { /* Can't pass hbool_t to va_arg() */ hbool_t bool_var = (hbool_t)va_arg(ap, int); if(TRUE == bool_var) - fprintf(out, "TRUE"); + HDfprintf(out, "TRUE"); else if(!bool_var) - fprintf(out, "FALSE"); + HDfprintf(out, "FALSE"); else - fprintf(out, "TRUE(%u)", (unsigned)bool_var); + HDfprintf(out, "TRUE(%u)", (unsigned)bool_var); } break; case 'd': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { double dbl = va_arg(ap, double); - fprintf(out, "%g", dbl); + HDfprintf(out, "%g", dbl); } /* end else */ break; @@ -296,36 +296,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'a': if(ptr) { if(vp) - fprintf (out, "0x%lx", (unsigned long)vp); + HDfprintf (out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_alloc_time_t alloc_time = (H5D_alloc_time_t)va_arg(ap, int); switch(alloc_time) { case H5D_ALLOC_TIME_ERROR: - fprintf(out, "H5D_ALLOC_TIME_ERROR"); + HDfprintf(out, "H5D_ALLOC_TIME_ERROR"); break; case H5D_ALLOC_TIME_DEFAULT: - fprintf(out, "H5D_ALLOC_TIME_DEFAULT"); + HDfprintf(out, "H5D_ALLOC_TIME_DEFAULT"); break; case H5D_ALLOC_TIME_EARLY: - fprintf(out, "H5D_ALLOC_TIME_EARLY"); + HDfprintf(out, "H5D_ALLOC_TIME_EARLY"); break; case H5D_ALLOC_TIME_LATE: - fprintf(out, "H5D_ALLOC_TIME_LATE"); + HDfprintf(out, "H5D_ALLOC_TIME_LATE"); break; case H5D_ALLOC_TIME_INCR: - fprintf(out, "H5D_ALLOC_TIME_INCR"); + HDfprintf(out, "H5D_ALLOC_TIME_INCR"); break; default: - fprintf(out, "%ld", (long)alloc_time); + HDfprintf(out, "%ld", (long)alloc_time); break; } /* end switch */ } /* end else */ @@ -334,24 +334,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5FD_mpio_collective_opt_t opt = (H5FD_mpio_collective_opt_t)va_arg(ap, int); switch(opt) { case H5FD_MPIO_COLLECTIVE_IO: - fprintf(out, "H5FD_MPIO_COLLECTIVE_IO"); + HDfprintf(out, "H5FD_MPIO_COLLECTIVE_IO"); break; case H5FD_MPIO_INDIVIDUAL_IO: - fprintf(out, "H5FD_MPIO_INDIVIDUAL_IO"); + HDfprintf(out, "H5FD_MPIO_INDIVIDUAL_IO"); break; default: - fprintf(out, "%ld", (long)opt); + HDfprintf(out, "%ld", (long)opt); break; } /* end switch */ } /* end else */ @@ -360,32 +360,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'f': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_fill_time_t fill_time = (H5D_fill_time_t)va_arg(ap, int); switch(fill_time) { case H5D_FILL_TIME_ERROR: - fprintf(out, "H5D_FILL_TIME_ERROR"); + HDfprintf(out, "H5D_FILL_TIME_ERROR"); break; case H5D_FILL_TIME_ALLOC: - fprintf(out, "H5D_FILL_TIME_ALLOC"); + HDfprintf(out, "H5D_FILL_TIME_ALLOC"); break; case H5D_FILL_TIME_NEVER: - fprintf(out, "H5D_FILL_TIME_NEVER"); + HDfprintf(out, "H5D_FILL_TIME_NEVER"); break; case H5D_FILL_TIME_IFSET: - fprintf(out, "H5D_FILL_TIME_IFSET"); + HDfprintf(out, "H5D_FILL_TIME_IFSET"); break; default: - fprintf(out, "%ld", (long)fill_time); + HDfprintf(out, "%ld", (long)fill_time); break; } /* end switch */ } /* end else */ @@ -394,32 +394,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'F': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_fill_value_t fill_value = (H5D_fill_value_t)va_arg(ap, int); switch(fill_value) { case H5D_FILL_VALUE_ERROR: - fprintf(out, "H5D_FILL_VALUE_ERROR"); + HDfprintf(out, "H5D_FILL_VALUE_ERROR"); break; case H5D_FILL_VALUE_UNDEFINED: - fprintf(out, "H5D_FILL_VALUE_UNDEFINED"); + HDfprintf(out, "H5D_FILL_VALUE_UNDEFINED"); break; case H5D_FILL_VALUE_DEFAULT: - fprintf(out, "H5D_FILL_VALUE_DEFAULT"); + HDfprintf(out, "H5D_FILL_VALUE_DEFAULT"); break; case H5D_FILL_VALUE_USER_DEFINED: - fprintf(out, "H5D_FILL_VALUE_USER_DEFINED"); + HDfprintf(out, "H5D_FILL_VALUE_USER_DEFINED"); break; default: - fprintf(out, "%ld", (long)fill_value); + HDfprintf(out, "%ld", (long)fill_value); break; } /* end switch */ } /* end else */ @@ -428,28 +428,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'h': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5FD_mpio_chunk_opt_t opt = (H5FD_mpio_chunk_opt_t)va_arg(ap, int); switch(opt) { case H5FD_MPIO_CHUNK_DEFAULT: - fprintf(out, "H5FD_MPIO_CHUNK_DEFAULT"); + HDfprintf(out, "H5FD_MPIO_CHUNK_DEFAULT"); break; case H5FD_MPIO_CHUNK_ONE_IO: - fprintf(out, "H5FD_MPIO_CHUNK_ONE_IO"); + HDfprintf(out, "H5FD_MPIO_CHUNK_ONE_IO"); break; case H5FD_MPIO_CHUNK_MULTI_IO: - fprintf(out, "H5FD_MPIO_CHUNK_MULTI_IO"); + HDfprintf(out, "H5FD_MPIO_CHUNK_MULTI_IO"); break; default: - fprintf(out, "%ld", (long)opt); + HDfprintf(out, "%ld", (long)opt); break; } /* end switch */ } /* end else */ @@ -458,36 +458,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'i': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_mpio_actual_io_mode_t actual_io_mode = (H5D_mpio_actual_io_mode_t)va_arg(ap, int); switch(actual_io_mode) { case H5D_MPIO_NO_COLLECTIVE: - fprintf(out, "H5D_MPIO_NO_COLLECTIVE"); + HDfprintf(out, "H5D_MPIO_NO_COLLECTIVE"); break; case H5D_MPIO_CHUNK_INDEPENDENT: - fprintf(out, "H5D_MPIO_CHUNK_INDEPENDENT"); + HDfprintf(out, "H5D_MPIO_CHUNK_INDEPENDENT"); break; case H5D_MPIO_CHUNK_COLLECTIVE: - fprintf(out, "H5D_MPIO_CHUNK_COLLECTIVE"); + HDfprintf(out, "H5D_MPIO_CHUNK_COLLECTIVE"); break; case H5D_MPIO_CHUNK_MIXED: - fprintf(out, "H5D_MPIO_CHUNK_MIXED"); + HDfprintf(out, "H5D_MPIO_CHUNK_MIXED"); break; case H5D_MPIO_CONTIGUOUS_COLLECTIVE: - fprintf(out, "H5D_MPIO_CONTIGUOUS_COLLECTIVE"); + HDfprintf(out, "H5D_MPIO_CONTIGUOUS_COLLECTIVE"); break; default: - fprintf(out, "%ld", (long)actual_io_mode); + HDfprintf(out, "%ld", (long)actual_io_mode); break; } /* end switch */ } /* end else */ @@ -496,44 +496,44 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'k': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_chunk_index_t idx = (H5D_chunk_index_t)va_arg(ap, int); switch(idx) { case H5D_CHUNK_IDX_BTREE: - fprintf(out, "H5D_CHUNK_IDX_BTREE"); + HDfprintf(out, "H5D_CHUNK_IDX_BTREE"); break; case H5D_CHUNK_IDX_NONE: - fprintf(out, "H5D_CHUNK_IDX_NONE"); + HDfprintf(out, "H5D_CHUNK_IDX_NONE"); break; case H5D_CHUNK_IDX_FARRAY: - fprintf(out, "H5D_CHUNK_IDX_FARRAY"); + HDfprintf(out, "H5D_CHUNK_IDX_FARRAY"); break; case H5D_CHUNK_IDX_EARRAY: - fprintf(out, "H5D_CHUNK_IDX_EARRAY"); + HDfprintf(out, "H5D_CHUNK_IDX_EARRAY"); break; case H5D_CHUNK_IDX_BT2: - fprintf(out, "H5D_CHUNK_IDX_BT2"); + HDfprintf(out, "H5D_CHUNK_IDX_BT2"); break; case H5D_CHUNK_IDX_SINGLE: - fprintf(out, "H5D_CHUNK_IDX_SINGLE"); + HDfprintf(out, "H5D_CHUNK_IDX_SINGLE"); break; case H5D_CHUNK_IDX_NTYPES: - fprintf(out, "ERROR: H5D_CHUNK_IDX_NTYPES (invalid value)"); + HDfprintf(out, "ERROR: H5D_CHUNK_IDX_NTYPES (invalid value)"); break; default: - fprintf(out, "UNKNOWN VALUE: %ld", (long)idx); + HDfprintf(out, "UNKNOWN VALUE: %ld", (long)idx); break; } /* end switch */ } /* end else */ @@ -542,40 +542,40 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'l': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_layout_t layout = (H5D_layout_t)va_arg(ap, int); switch(layout) { case H5D_LAYOUT_ERROR: - fprintf(out, "H5D_LAYOUT_ERROR"); + HDfprintf(out, "H5D_LAYOUT_ERROR"); break; case H5D_COMPACT: - fprintf(out, "H5D_COMPACT"); + HDfprintf(out, "H5D_COMPACT"); break; case H5D_CONTIGUOUS: - fprintf(out, "H5D_CONTIGUOUS"); + HDfprintf(out, "H5D_CONTIGUOUS"); break; case H5D_CHUNKED: - fprintf(out, "H5D_CHUNKED"); + HDfprintf(out, "H5D_CHUNKED"); break; case H5D_VIRTUAL: - fprintf(out, "H5D_VIRTUAL"); + HDfprintf(out, "H5D_VIRTUAL"); break; case H5D_NLAYOUTS: - fprintf(out, "H5D_NLAYOUTS"); + HDfprintf(out, "H5D_NLAYOUTS"); break; default: - fprintf(out, "%ld", (long)layout); + HDfprintf(out, "%ld", (long)layout); break; } /* end switch */ } /* end else */ @@ -584,9 +584,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'n': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_mpio_no_collective_cause_t nocol_cause_mode = (H5D_mpio_no_collective_cause_t)va_arg(ap, int); @@ -594,65 +594,65 @@ H5_trace(const double *returning, const char *func, const char *type, ...) /* Check for all bit-flags which might be set */ if(nocol_cause_mode & H5D_MPIO_COLLECTIVE) { - fprintf(out, "H5D_MPIO_COLLECTIVE"); + HDfprintf(out, "H5D_MPIO_COLLECTIVE"); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_SET_INDEPENDENT) { - fprintf(out, "%sH5D_MPIO_SET_INDEPENDENT", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_SET_INDEPENDENT", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_DATATYPE_CONVERSION) { - fprintf(out, "%sH5D_MPIO_DATATYPE_CONVERSION", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_DATATYPE_CONVERSION", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_DATA_TRANSFORMS) { - fprintf(out, "%sH5D_MPIO_DATA_TRANSFORMS", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_DATA_TRANSFORMS", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED) { - fprintf(out, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES) { - fprintf(out, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET) { - fprintf(out, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ /* Display '' if there's no flags set */ if(!flag_already_displayed) - fprintf(out, ""); + HDfprintf(out, ""); } /* end else */ break; case 'o': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_mpio_actual_chunk_opt_mode_t chunk_opt_mode = (H5D_mpio_actual_chunk_opt_mode_t)va_arg(ap, int); switch(chunk_opt_mode) { case H5D_MPIO_NO_CHUNK_OPTIMIZATION: - fprintf(out, "H5D_MPIO_NO_CHUNK_OPTIMIZATION"); + HDfprintf(out, "H5D_MPIO_NO_CHUNK_OPTIMIZATION"); break; case H5D_MPIO_LINK_CHUNK: - fprintf(out, "H5D_MPIO_LINK_CHUNK"); + HDfprintf(out, "H5D_MPIO_LINK_CHUNK"); break; case H5D_MPIO_MULTI_CHUNK: - fprintf(out, "H5D_MPIO_MULTI_CHUNK"); + HDfprintf(out, "H5D_MPIO_MULTI_CHUNK"); break; default: - fprintf(out, "%ld", (long)chunk_opt_mode); + HDfprintf(out, "%ld", (long)chunk_opt_mode); break; } /* end switch */ } /* end else */ @@ -661,32 +661,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_space_status_t space_status = (H5D_space_status_t)va_arg(ap, int); switch(space_status) { case H5D_SPACE_STATUS_NOT_ALLOCATED: - fprintf(out, "H5D_SPACE_STATUS_NOT_ALLOCATED"); + HDfprintf(out, "H5D_SPACE_STATUS_NOT_ALLOCATED"); break; case H5D_SPACE_STATUS_PART_ALLOCATED: - fprintf(out, "H5D_SPACE_STATUS_PART_ALLOCATED"); + HDfprintf(out, "H5D_SPACE_STATUS_PART_ALLOCATED"); break; case H5D_SPACE_STATUS_ALLOCATED: - fprintf(out, "H5D_SPACE_STATUS_ALLOCATED"); + HDfprintf(out, "H5D_SPACE_STATUS_ALLOCATED"); break; case H5D_SPACE_STATUS_ERROR: - fprintf(out, "H5D_SPACE_STATUS_ERROR"); + HDfprintf(out, "H5D_SPACE_STATUS_ERROR"); break; default: - fprintf(out, "%ld", (long)space_status); + HDfprintf(out, "%ld", (long)space_status); break; } /* end switch */ } /* end else */ @@ -695,24 +695,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5FD_mpio_xfer_t transfer = (H5FD_mpio_xfer_t)va_arg(ap, int); switch(transfer) { case H5FD_MPIO_INDEPENDENT: - fprintf(out, "H5FD_MPIO_INDEPENDENT"); + HDfprintf(out, "H5FD_MPIO_INDEPENDENT"); break; case H5FD_MPIO_COLLECTIVE: - fprintf(out, "H5FD_MPIO_COLLECTIVE"); + HDfprintf(out, "H5FD_MPIO_COLLECTIVE"); break; default: - fprintf(out, "%ld", (long)transfer); + HDfprintf(out, "%ld", (long)transfer); break; } /* end switch */ } /* end else */ @@ -721,35 +721,35 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'v': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_vds_view_t view = (H5D_vds_view_t)va_arg(ap, int); switch(view) { case H5D_VDS_ERROR: - fprintf(out, "H5D_VDS_ERROR"); + HDfprintf(out, "H5D_VDS_ERROR"); break; case H5D_VDS_FIRST_MISSING: - fprintf(out, "H5D_VDS_FIRST_MISSING"); + HDfprintf(out, "H5D_VDS_FIRST_MISSING"); break; case H5D_VDS_LAST_AVAILABLE: - fprintf(out, "H5D_VDS_LAST_AVAILABLE"); + HDfprintf(out, "H5D_VDS_LAST_AVAILABLE"); break; default: - fprintf(out, "%ld", (long)view); + HDfprintf(out, "%ld", (long)view); break; } /* end switch */ } /* end else */ break; default: - fprintf (out, "BADTYPE(D%c)", type[1]); + HDfprintf (out, "BADTYPE(D%c)", type[1]); goto error; } /* end switch */ break; @@ -757,17 +757,17 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'e': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { herr_t status = va_arg(ap, herr_t); if(status >= 0) - fprintf(out, "SUCCEED"); + HDfprintf(out, "SUCCEED"); else - fprintf(out, "FAIL"); + HDfprintf(out, "FAIL"); } /* end else */ break; @@ -776,24 +776,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'd': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5E_direction_t direction = (H5E_direction_t)va_arg(ap, int); switch(direction) { case H5E_WALK_UPWARD: - fprintf(out, "H5E_WALK_UPWARD"); + HDfprintf(out, "H5E_WALK_UPWARD"); break; case H5E_WALK_DOWNWARD: - fprintf(out, "H5E_WALK_DOWNWARD"); + HDfprintf(out, "H5E_WALK_DOWNWARD"); break; default: - fprintf(out, "%ld", (long)direction); + HDfprintf(out, "%ld", (long)direction); break; } /* end switch */ } /* end else */ @@ -802,45 +802,45 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'e': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5E_error2_t *error = va_arg(ap, H5E_error2_t *); - fprintf(out, "0x%lx", (unsigned long)error); + HDfprintf(out, "0x%lx", (unsigned long)error); } /* end else */ break; case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5E_type_t etype = (H5E_type_t)va_arg(ap, int); switch(etype) { case H5E_MAJOR: - fprintf(out, "H5E_MAJOR"); + HDfprintf(out, "H5E_MAJOR"); break; case H5E_MINOR: - fprintf(out, "H5E_MINOR"); + HDfprintf(out, "H5E_MINOR"); break; default: - fprintf(out, "%ld", (long)etype); + HDfprintf(out, "%ld", (long)etype); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(E%c)", type[1]); + HDfprintf(out, "BADTYPE(E%c)", type[1]); goto error; } /* end switch */ break; @@ -850,32 +850,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'd': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5F_close_degree_t degree = (H5F_close_degree_t)va_arg(ap, int); switch(degree) { case H5F_CLOSE_DEFAULT: - fprintf(out, "H5F_CLOSE_DEFAULT"); + HDfprintf(out, "H5F_CLOSE_DEFAULT"); break; case H5F_CLOSE_WEAK: - fprintf(out, "H5F_CLOSE_WEAK"); + HDfprintf(out, "H5F_CLOSE_WEAK"); break; case H5F_CLOSE_SEMI: - fprintf(out, "H5F_CLOSE_SEMI"); + HDfprintf(out, "H5F_CLOSE_SEMI"); break; case H5F_CLOSE_STRONG: - fprintf(out, "H5F_CLOSE_STRONG"); + HDfprintf(out, "H5F_CLOSE_STRONG"); break; default: - fprintf(out, "%ld", (long)degree); + HDfprintf(out, "%ld", (long)degree); break; } /* end switch */ } /* end else */ @@ -884,33 +884,33 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'f': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5F_fspace_strategy_t fs_strategy = (H5F_fspace_strategy_t)va_arg(ap, int); switch(fs_strategy) { case H5F_FSPACE_STRATEGY_FSM_AGGR: - fprintf(out, "H5F_FSPACE_STRATEGY_FSM_AGGR"); + HDfprintf(out, "H5F_FSPACE_STRATEGY_FSM_AGGR"); break; case H5F_FSPACE_STRATEGY_PAGE: - fprintf(out, "H5F_FSPACE_STRATEGY_PAGE"); + HDfprintf(out, "H5F_FSPACE_STRATEGY_PAGE"); break; case H5F_FSPACE_STRATEGY_AGGR: - fprintf(out, "H5F_FSPACE_STRATEGY_AGGR"); + HDfprintf(out, "H5F_FSPACE_STRATEGY_AGGR"); break; case H5F_FSPACE_STRATEGY_NONE: - fprintf(out, "H5F_FSPACE_STRATEGY_NONE"); + HDfprintf(out, "H5F_FSPACE_STRATEGY_NONE"); break; case H5F_FSPACE_STRATEGY_NTYPES: default: - fprintf(out, "%ld", (long)fs_strategy); + HDfprintf(out, "%ld", (long)fs_strategy); break; } /* end switch */ } /* end else */ @@ -919,49 +919,49 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'm': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5F_mem_t mem_type = (H5F_mem_t)va_arg(ap, int); switch(mem_type) { case H5FD_MEM_NOLIST: - fprintf(out, "H5FD_MEM_NOLIST"); + HDfprintf(out, "H5FD_MEM_NOLIST"); break; case H5FD_MEM_DEFAULT: - fprintf(out, "H5FD_MEM_DEFAULT"); + HDfprintf(out, "H5FD_MEM_DEFAULT"); break; case H5FD_MEM_SUPER: - fprintf(out, "H5FD_MEM_SUPER"); + HDfprintf(out, "H5FD_MEM_SUPER"); break; case H5FD_MEM_BTREE: - fprintf(out, "H5FD_MEM_BTREE"); + HDfprintf(out, "H5FD_MEM_BTREE"); break; case H5FD_MEM_DRAW: - fprintf(out, "H5FD_MEM_DRAW"); + HDfprintf(out, "H5FD_MEM_DRAW"); break; case H5FD_MEM_GHEAP: - fprintf(out, "H5FD_MEM_GHEAP"); + HDfprintf(out, "H5FD_MEM_GHEAP"); break; case H5FD_MEM_LHEAP: - fprintf(out, "H5FD_MEM_LHEAP"); + HDfprintf(out, "H5FD_MEM_LHEAP"); break; case H5FD_MEM_OHDR: - fprintf(out, "H5FD_MEM_OHDR"); + HDfprintf(out, "H5FD_MEM_OHDR"); break; case H5FD_MEM_NTYPES: default: - fprintf(out, "%ld", (long)mem_type); + HDfprintf(out, "%ld", (long)mem_type); break; } /* end switch */ } /* end else */ @@ -970,24 +970,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5F_scope_t scope = (H5F_scope_t)va_arg(ap, int); switch(scope) { case H5F_SCOPE_LOCAL: - fprintf(out, "H5F_SCOPE_LOCAL"); + HDfprintf(out, "H5F_SCOPE_LOCAL"); break; case H5F_SCOPE_GLOBAL: - fprintf(out, "H5F_SCOPE_GLOBAL"); + HDfprintf(out, "H5F_SCOPE_GLOBAL"); break; default: - fprintf(out, "%ld", (long)scope); + HDfprintf(out, "%ld", (long)scope); break; } /* end switch */ } /* end else */ @@ -996,47 +996,47 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ break; case 'v': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5F_libver_t libver_vers = (H5F_libver_t)va_arg(ap, int); switch(libver_vers) { case H5F_LIBVER_EARLIEST: - fprintf(out, "H5F_LIBVER_EARLIEST"); + HDfprintf(out, "H5F_LIBVER_EARLIEST"); break; case H5F_LIBVER_V18: - fprintf(out, "H5F_LIBVER_V18"); + HDfprintf(out, "H5F_LIBVER_V18"); break; case H5F_LIBVER_V110: - HDassert(H5F_LIBVER_LATEST == H5F_LIBVER_V110); - fprintf(out, "H5F_LIBVER_LATEST"); + HDcompile_assert(H5F_LIBVER_LATEST == H5F_LIBVER_V110); + HDfprintf(out, "H5F_LIBVER_LATEST"); break; case H5F_LIBVER_ERROR: case H5F_LIBVER_NBOUNDS: default: - fprintf(out, "%ld", (long)libver_vers); + HDfprintf(out, "%ld", (long)libver_vers); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(F%c)", type[1]); + HDfprintf(out, "BADTYPE(F%c)", type[1]); goto error; } /* end switch */ break; @@ -1047,46 +1047,46 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'o': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5G_obj_t obj_type = (H5G_obj_t)va_arg(ap, int); switch(obj_type) { case H5G_UNKNOWN: - fprintf(out, "H5G_UNKNOWN"); + HDfprintf(out, "H5G_UNKNOWN"); break; case H5G_GROUP: - fprintf(out, "H5G_GROUP"); + HDfprintf(out, "H5G_GROUP"); break; case H5G_DATASET: - fprintf(out, "H5G_DATASET"); + HDfprintf(out, "H5G_DATASET"); break; case H5G_TYPE: - fprintf(out, "H5G_TYPE"); + HDfprintf(out, "H5G_TYPE"); break; case H5G_LINK: - fprintf(out, "H5G_LINK"); + HDfprintf(out, "H5G_LINK"); break; case H5G_UDLINK: - fprintf(out, "H5G_UDLINK"); + HDfprintf(out, "H5G_UDLINK"); break; case H5G_RESERVED_5: case H5G_RESERVED_6: case H5G_RESERVED_7: - fprintf(out, "H5G_RESERVED(%ld)", (long)obj_type); + HDfprintf(out, "H5G_RESERVED(%ld)", (long)obj_type); break; default: - fprintf(out, "%ld", (long)obj_type); + HDfprintf(out, "%ld", (long)obj_type); break; } /* end switch */ } /* end else */ @@ -1095,20 +1095,20 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf (out, "0x%lx", (unsigned long)vp); + HDfprintf (out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5G_stat_t *statbuf = va_arg(ap, H5G_stat_t*); - fprintf(out, "0x%lx", (unsigned long)statbuf); + HDfprintf(out, "0x%lx", (unsigned long)statbuf); } break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ default: - fprintf(out, "BADTYPE(G%c)", type[1]); + HDfprintf(out, "BADTYPE(G%c)", type[1]); goto error; } break; @@ -1116,22 +1116,22 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'h': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { hsize_t *p = (hsize_t *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) { if(H5S_UNLIMITED == p[i]) HDfprintf(out, "%sH5S_UNLIMITED", (i ? ", " : "")); else HDfprintf(out, "%s%Hu", (i ? ", " : ""), p[i]); } /* end for */ - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { hsize_t hsize = va_arg(ap, hsize_t); @@ -1150,18 +1150,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { hssize_t *p = (hssize_t *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%Hd", (i ? ", " : ""), p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { hssize_t hssize = va_arg(ap, hssize_t); @@ -1172,7 +1172,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - fprintf (out, "BADTYPE(H%c)", type[1]); + HDfprintf (out, "BADTYPE(H%c)", type[1]); goto error; } /* end switch */ break; @@ -1180,130 +1180,130 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'i': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { hid_t obj = va_arg(ap, hid_t); if(H5P_DEFAULT == obj) - fprintf(out, "H5P_DEFAULT"); + HDfprintf(out, "H5P_DEFAULT"); else if(obj < 0) - fprintf(out, "FAIL"); + HDfprintf(out, "FAIL"); else { switch(H5I_TYPE(obj)) { /* Use internal H5I macro instead of function call */ case H5I_UNINIT: - fprintf(out, "%ld (uninit - error)", (long)obj); + HDfprintf(out, "%ld (uninit - error)", (long)obj); break; case H5I_BADID: - fprintf(out, "%ld (error)", (long)obj); + HDfprintf(out, "%ld (error)", (long)obj); break; case H5I_FILE: - fprintf(out, "%ld (file)", (long)obj); + HDfprintf(out, "%ld (file)", (long)obj); break; case H5I_GROUP: - fprintf(out, "%ld (group)", (long)obj); + HDfprintf(out, "%ld (group)", (long)obj); break; case H5I_DATATYPE: if(obj == H5T_NATIVE_SCHAR_g) - fprintf(out, "H5T_NATIVE_SCHAR"); + HDfprintf(out, "H5T_NATIVE_SCHAR"); else if(obj == H5T_NATIVE_UCHAR_g) - fprintf(out, "H5T_NATIVE_UCHAR"); + HDfprintf(out, "H5T_NATIVE_UCHAR"); else if(obj == H5T_NATIVE_SHORT_g) - fprintf(out, "H5T_NATIVE_SHORT"); + HDfprintf(out, "H5T_NATIVE_SHORT"); else if(obj == H5T_NATIVE_USHORT_g) - fprintf(out, "H5T_NATIVE_USHORT"); + HDfprintf(out, "H5T_NATIVE_USHORT"); else if(obj == H5T_NATIVE_INT_g) - fprintf(out, "H5T_NATIVE_INT"); + HDfprintf(out, "H5T_NATIVE_INT"); else if(obj == H5T_NATIVE_UINT_g) - fprintf(out, "H5T_NATIVE_UINT"); + HDfprintf(out, "H5T_NATIVE_UINT"); else if(obj == H5T_NATIVE_LONG_g) - fprintf(out, "H5T_NATIVE_LONG"); + HDfprintf(out, "H5T_NATIVE_LONG"); else if(obj == H5T_NATIVE_ULONG_g) - fprintf(out, "H5T_NATIVE_ULONG"); + HDfprintf(out, "H5T_NATIVE_ULONG"); else if(obj == H5T_NATIVE_LLONG_g) - fprintf(out, "H5T_NATIVE_LLONG"); + HDfprintf(out, "H5T_NATIVE_LLONG"); else if(obj == H5T_NATIVE_ULLONG_g) - fprintf(out, "H5T_NATIVE_ULLONG"); + HDfprintf(out, "H5T_NATIVE_ULLONG"); else if(obj == H5T_NATIVE_FLOAT_g) - fprintf(out, "H5T_NATIVE_FLOAT"); + HDfprintf(out, "H5T_NATIVE_FLOAT"); else if(obj == H5T_NATIVE_DOUBLE_g) - fprintf(out, "H5T_NATIVE_DOUBLE"); + HDfprintf(out, "H5T_NATIVE_DOUBLE"); #if H5_SIZEOF_LONG_DOUBLE !=0 else if(obj == H5T_NATIVE_LDOUBLE_g) - fprintf(out, "H5T_NATIVE_LDOUBLE"); + HDfprintf(out, "H5T_NATIVE_LDOUBLE"); #endif else if(obj == H5T_IEEE_F32BE_g) - fprintf(out, "H5T_IEEE_F32BE"); + HDfprintf(out, "H5T_IEEE_F32BE"); else if(obj == H5T_IEEE_F32LE_g) - fprintf(out, "H5T_IEEE_F32LE"); + HDfprintf(out, "H5T_IEEE_F32LE"); else if(obj == H5T_IEEE_F64BE_g) - fprintf(out, "H5T_IEEE_F64BE"); + HDfprintf(out, "H5T_IEEE_F64BE"); else if(obj == H5T_IEEE_F64LE_g) - fprintf(out, "H5T_IEEE_F64LE"); + HDfprintf(out, "H5T_IEEE_F64LE"); else if(obj == H5T_STD_I8BE_g) - fprintf(out, "H5T_STD_I8BE"); + HDfprintf(out, "H5T_STD_I8BE"); else if(obj == H5T_STD_I8LE_g) - fprintf(out, "H5T_STD_I8LE"); + HDfprintf(out, "H5T_STD_I8LE"); else if(obj == H5T_STD_I16BE_g) - fprintf(out, "H5T_STD_I16BE"); + HDfprintf(out, "H5T_STD_I16BE"); else if(obj == H5T_STD_I16LE_g) - fprintf(out, "H5T_STD_I16LE"); + HDfprintf(out, "H5T_STD_I16LE"); else if(obj == H5T_STD_I32BE_g) - fprintf(out, "H5T_STD_I32BE"); + HDfprintf(out, "H5T_STD_I32BE"); else if(obj == H5T_STD_I32LE_g) - fprintf(out, "H5T_STD_I32LE"); + HDfprintf(out, "H5T_STD_I32LE"); else if(obj == H5T_STD_I64BE_g) - fprintf(out, "H5T_STD_I64BE"); + HDfprintf(out, "H5T_STD_I64BE"); else if(obj == H5T_STD_I64LE_g) - fprintf(out, "H5T_STD_I64LE"); + HDfprintf(out, "H5T_STD_I64LE"); else if(obj == H5T_STD_U8BE_g) - fprintf(out, "H5T_STD_U8BE"); + HDfprintf(out, "H5T_STD_U8BE"); else if(obj == H5T_STD_U8LE_g) - fprintf(out, "H5T_STD_U8LE"); + HDfprintf(out, "H5T_STD_U8LE"); else if(obj == H5T_STD_U16BE_g) - fprintf(out, "H5T_STD_U16BE"); + HDfprintf(out, "H5T_STD_U16BE"); else if(obj == H5T_STD_U16LE_g) - fprintf(out, "H5T_STD_U16LE"); + HDfprintf(out, "H5T_STD_U16LE"); else if(obj == H5T_STD_U32BE_g) - fprintf(out, "H5T_STD_U32BE"); + HDfprintf(out, "H5T_STD_U32BE"); else if(obj == H5T_STD_U32LE_g) - fprintf(out, "H5T_STD_U32LE"); + HDfprintf(out, "H5T_STD_U32LE"); else if(obj == H5T_STD_U64BE_g) - fprintf(out, "H5T_STD_U64BE"); + HDfprintf(out, "H5T_STD_U64BE"); else if(obj == H5T_STD_U64LE_g) - fprintf(out, "H5T_STD_U64LE"); + HDfprintf(out, "H5T_STD_U64LE"); else if(obj == H5T_STD_B8BE_g) - fprintf(out, "H5T_STD_B8BE"); + HDfprintf(out, "H5T_STD_B8BE"); else if(obj == H5T_STD_B8LE_g) - fprintf(out, "H5T_STD_B8LE"); + HDfprintf(out, "H5T_STD_B8LE"); else if(obj == H5T_STD_B16BE_g) - fprintf(out, "H5T_STD_B16BE"); + HDfprintf(out, "H5T_STD_B16BE"); else if(obj == H5T_STD_B16LE_g) - fprintf(out, "H5T_STD_B16LE"); + HDfprintf(out, "H5T_STD_B16LE"); else if(obj == H5T_STD_B32BE_g) - fprintf(out, "H5T_STD_B32BE"); + HDfprintf(out, "H5T_STD_B32BE"); else if(obj == H5T_STD_B32LE_g) - fprintf(out, "H5T_STD_B32LE"); + HDfprintf(out, "H5T_STD_B32LE"); else if(obj == H5T_STD_B64BE_g) - fprintf(out, "H5T_STD_B64BE"); + HDfprintf(out, "H5T_STD_B64BE"); else if(obj == H5T_STD_B64LE_g) - fprintf(out, "H5T_STD_B64LE"); + HDfprintf(out, "H5T_STD_B64LE"); else if(obj == H5T_C_S1_g) - fprintf(out, "H5T_C_S1"); + HDfprintf(out, "H5T_C_S1"); else if(obj == H5T_FORTRAN_S1_g) - fprintf(out, "H5T_FORTRAN_S1"); + HDfprintf(out, "H5T_FORTRAN_S1"); else - fprintf(out, "%ld (dtype)", (long)obj); + HDfprintf(out, "%ld (dtype)", (long)obj); break; case H5I_DATASPACE: - fprintf(out, "%ld (dspace)", (long)obj); + HDfprintf(out, "%ld (dspace)", (long)obj); /* Save the rank of simple data spaces for arrays */ /* This may generate recursive call to the library... -QAK */ { @@ -1316,47 +1316,47 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case H5I_DATASET: - fprintf(out, "%ld (dset)", (long)obj); + HDfprintf(out, "%ld (dset)", (long)obj); break; case H5I_ATTR: - fprintf(out, "%ld (attr)", (long)obj); + HDfprintf(out, "%ld (attr)", (long)obj); break; case H5I_REFERENCE: - fprintf(out, "%ld (reference)", (long)obj); + HDfprintf(out, "%ld (reference)", (long)obj); break; case H5I_VFL: - fprintf(out, "%ld (file driver)", (long)obj); + HDfprintf(out, "%ld (file driver)", (long)obj); break; case H5I_GENPROP_CLS: - fprintf(out, "%ld (genprop class)", (long)obj); + HDfprintf(out, "%ld (genprop class)", (long)obj); break; case H5I_GENPROP_LST: - fprintf(out, "%ld (genprop list)", (long)obj); + HDfprintf(out, "%ld (genprop list)", (long)obj); break; case H5I_ERROR_CLASS: - fprintf(out, "%ld (err class)", (long)obj); + HDfprintf(out, "%ld (err class)", (long)obj); break; case H5I_ERROR_MSG: - fprintf(out, "%ld (err msg)", (long)obj); + HDfprintf(out, "%ld (err msg)", (long)obj); break; case H5I_ERROR_STACK: - fprintf(out, "%ld (err stack)", (long)obj); + HDfprintf(out, "%ld (err stack)", (long)obj); break; case H5I_NTYPES: - fprintf (out, "%ld (ntypes - error)", (long)obj); + HDfprintf (out, "%ld (ntypes - error)", (long)obj); break; default: - fprintf(out, "%ld (unknown class)", (long)obj); + HDfprintf(out, "%ld (unknown class)", (long)obj); break; } /* end switch */ } /* end else */ @@ -1368,32 +1368,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'i': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5_index_t idx_type = (H5_index_t)va_arg(ap, int); switch(idx_type) { case H5_INDEX_UNKNOWN: - fprintf(out, "H5_INDEX_UNKNOWN"); + HDfprintf(out, "H5_INDEX_UNKNOWN"); break; case H5_INDEX_NAME: - fprintf(out, "H5_INDEX_NAME"); + HDfprintf(out, "H5_INDEX_NAME"); break; case H5_INDEX_CRT_ORDER: - fprintf(out, "H5_INDEX_CRT_ORDER"); + HDfprintf(out, "H5_INDEX_CRT_ORDER"); break; case H5_INDEX_N: - fprintf(out, "H5_INDEX_N"); + HDfprintf(out, "H5_INDEX_N"); break; default: - fprintf(out, "%ld", (long)idx_type); + HDfprintf(out, "%ld", (long)idx_type); break; } /* end switch */ } /* end else */ @@ -1402,36 +1402,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'o': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5_iter_order_t order = (H5_iter_order_t)va_arg(ap, int); switch(order) { case H5_ITER_UNKNOWN: - fprintf(out, "H5_ITER_UNKNOWN"); + HDfprintf(out, "H5_ITER_UNKNOWN"); break; case H5_ITER_INC: - fprintf(out, "H5_ITER_INC"); + HDfprintf(out, "H5_ITER_INC"); break; case H5_ITER_DEC: - fprintf(out, "H5_ITER_DEC"); + HDfprintf(out, "H5_ITER_DEC"); break; case H5_ITER_NATIVE: - fprintf(out, "H5_ITER_NATIVE"); + HDfprintf(out, "H5_ITER_NATIVE"); break; case H5_ITER_N: - fprintf(out, "H5_ITER_N"); + HDfprintf(out, "H5_ITER_N"); break; default: - fprintf(out, "%ld", (long)order); + HDfprintf(out, "%ld", (long)order); break; } /* end switch */ } /* end else */ @@ -1440,23 +1440,23 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { int *p = (int*)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) - fprintf(out, "%s%d", (i ? ", " : ""), p[i]); - fprintf(out, "}"); + HDfprintf(out, "%s%d", (i ? ", " : ""), p[i]); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { int is = va_arg(ap, int); - fprintf (out, "%d", is); + HDfprintf (out, "%d", is); asize[argno] = is; } /* end else */ break; @@ -1464,80 +1464,80 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5I_type_t id_type = (H5I_type_t)va_arg(ap, int); switch (id_type) { case H5I_UNINIT: - fprintf(out, "H5I_UNINIT"); + HDfprintf(out, "H5I_UNINIT"); break; case H5I_BADID: - fprintf(out, "H5I_BADID"); + HDfprintf(out, "H5I_BADID"); break; case H5I_FILE: - fprintf(out, "H5I_FILE"); + HDfprintf(out, "H5I_FILE"); break; case H5I_GROUP: - fprintf(out, "H5I_GROUP"); + HDfprintf(out, "H5I_GROUP"); break; case H5I_DATATYPE: - fprintf(out, "H5I_DATATYPE"); + HDfprintf(out, "H5I_DATATYPE"); break; case H5I_DATASPACE: - fprintf(out, "H5I_DATASPACE"); + HDfprintf(out, "H5I_DATASPACE"); break; case H5I_DATASET: - fprintf(out, "H5I_DATASET"); + HDfprintf(out, "H5I_DATASET"); break; case H5I_ATTR: - fprintf(out, "H5I_ATTR"); + HDfprintf(out, "H5I_ATTR"); break; case H5I_REFERENCE: - fprintf(out, "H5I_REFERENCE"); + HDfprintf(out, "H5I_REFERENCE"); break; case H5I_VFL: - fprintf(out, "H5I_VFL"); + HDfprintf(out, "H5I_VFL"); break; case H5I_GENPROP_CLS: - fprintf(out, "H5I_GENPROP_CLS"); + HDfprintf(out, "H5I_GENPROP_CLS"); break; case H5I_GENPROP_LST: - fprintf(out, "H5I_GENPROP_LST"); + HDfprintf(out, "H5I_GENPROP_LST"); break; case H5I_ERROR_CLASS: - fprintf(out, "H5I_ERROR_CLASS"); + HDfprintf(out, "H5I_ERROR_CLASS"); break; case H5I_ERROR_MSG: - fprintf(out, "H5I_ERROR_MSG"); + HDfprintf(out, "H5I_ERROR_MSG"); break; case H5I_ERROR_STACK: - fprintf(out, "H5I_ERROR_STACK"); + HDfprintf(out, "H5I_ERROR_STACK"); break; case H5I_NTYPES: - fprintf(out, "H5I_NTYPES"); + HDfprintf(out, "H5I_NTYPES"); break; default: - fprintf(out, "%ld", (long)id_type); + HDfprintf(out, "%ld", (long)id_type); break; } /* end switch */ } /* end else */ @@ -1546,29 +1546,29 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'u': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { unsigned *p = (unsigned*)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%u", i?", ":"", p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { unsigned iu = va_arg(ap, unsigned); - fprintf(out, "%u", iu); + HDfprintf(out, "%u", iu); asize[argno] = iu; } /* end else */ break; default: - fprintf (out, "BADTYPE(I%c)", type[1]); + HDfprintf (out, "BADTYPE(I%c)", type[1]); goto error; } /* end switch */ break; @@ -1578,43 +1578,43 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'l': if(ptr) { if(vp) - fprintf (out, "0x%lx", (unsigned long)vp); + HDfprintf (out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5L_type_t link_type = (H5L_type_t)va_arg(ap, int); switch(link_type) { case H5L_TYPE_ERROR: - fprintf(out, "H5L_TYPE_ERROR"); + HDfprintf(out, "H5L_TYPE_ERROR"); break; case H5L_TYPE_HARD: - fprintf(out, "H5L_TYPE_HARD"); + HDfprintf(out, "H5L_TYPE_HARD"); break; case H5L_TYPE_SOFT: - fprintf(out, "H5L_TYPE_SOFT"); + HDfprintf(out, "H5L_TYPE_SOFT"); break; case H5L_TYPE_EXTERNAL: - fprintf(out, "H5L_TYPE_EXTERNAL"); + HDfprintf(out, "H5L_TYPE_EXTERNAL"); break; case H5L_TYPE_MAX: - fprintf(out, "H5L_TYPE_MAX"); + HDfprintf(out, "H5L_TYPE_MAX"); break; default: - fprintf(out, "%ld", (long)link_type); + HDfprintf(out, "%ld", (long)link_type); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(G%c)", type[1]); + HDfprintf(out, "BADTYPE(G%c)", type[1]); goto error; } /* end switch */ break; @@ -1624,15 +1624,15 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ #ifdef H5_HAVE_PARALLEL else { MPI_Comm comm = va_arg(ap, MPI_Comm); - fprintf(out, "%ld", (long)comm); + HDfprintf(out, "%ld", (long)comm); } /* end else */ #endif /* H5_HAVE_PARALLEL */ break; @@ -1640,15 +1640,15 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'i': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ #ifdef H5_HAVE_PARALLEL else { MPI_Info info = va_arg(ap, MPI_Info); - fprintf(out, "%ld", (long)info); + HDfprintf(out, "%ld", (long)info); } /* end else */ #endif /* H5_HAVE_PARALLEL */ break; @@ -1656,52 +1656,52 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5FD_mem_t mt = (H5FD_mem_t)va_arg(ap, int); switch(mt) { case H5FD_MEM_NOLIST: - fprintf(out, "H5FD_MEM_NOLIST"); + HDfprintf(out, "H5FD_MEM_NOLIST"); break; case H5FD_MEM_DEFAULT: - fprintf(out, "H5FD_MEM_DEFAULT"); + HDfprintf(out, "H5FD_MEM_DEFAULT"); break; case H5FD_MEM_SUPER: - fprintf(out, "H5FD_MEM_SUPER"); + HDfprintf(out, "H5FD_MEM_SUPER"); break; case H5FD_MEM_BTREE: - fprintf(out, "H5FD_MEM_BTREE"); + HDfprintf(out, "H5FD_MEM_BTREE"); break; case H5FD_MEM_DRAW: - fprintf(out, "H5FD_MEM_DRAW"); + HDfprintf(out, "H5FD_MEM_DRAW"); break; case H5FD_MEM_GHEAP: - fprintf(out, "H5FD_MEM_GHEAP"); + HDfprintf(out, "H5FD_MEM_GHEAP"); break; case H5FD_MEM_LHEAP: - fprintf(out, "H5FD_MEM_LHEAP"); + HDfprintf(out, "H5FD_MEM_LHEAP"); break; case H5FD_MEM_OHDR: - fprintf(out, "H5FD_MEM_OHDR"); + HDfprintf(out, "H5FD_MEM_OHDR"); break; case H5FD_MEM_NTYPES: - fprintf(out, "H5FD_MEM_NTYPES"); + HDfprintf(out, "H5FD_MEM_NTYPES"); break; default: - fprintf(out, "%ld", (long)mt); + HDfprintf(out, "%ld", (long)mt); break; } /* end switch */ } /* end else */ @@ -1715,14 +1715,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'o': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { off_t offset = va_arg(ap, off_t); - fprintf (out, "%ld", (long)offset); + HDfprintf (out, "%ld", (long)offset); } /* end else */ break; @@ -1731,43 +1731,43 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5O_type_t objtype = (H5O_type_t)va_arg(ap, int); switch(objtype) { case H5O_TYPE_UNKNOWN: - fprintf(out, "H5O_TYPE_UNKNOWN"); + HDfprintf(out, "H5O_TYPE_UNKNOWN"); break; case H5O_TYPE_GROUP: - fprintf(out, "H5O_TYPE_GROUP"); + HDfprintf(out, "H5O_TYPE_GROUP"); break; case H5O_TYPE_DATASET: - fprintf(out, "H5O_TYPE_DATASET"); + HDfprintf(out, "H5O_TYPE_DATASET"); break; case H5O_TYPE_NAMED_DATATYPE: - fprintf(out, "H5O_TYPE_NAMED_DATATYPE"); + HDfprintf(out, "H5O_TYPE_NAMED_DATATYPE"); break; case H5O_TYPE_NTYPES: - fprintf(out, "H5O_TYPE_TYPES"); + HDfprintf(out, "H5O_TYPE_TYPES"); break; default: - fprintf(out, "BADTYPE(%ld)", (long)objtype); + HDfprintf(out, "BADTYPE(%ld)", (long)objtype); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(S%c)", type[1]); + HDfprintf(out, "BADTYPE(S%c)", type[1]); goto error; } /* end switch */ break; @@ -1775,9 +1775,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'p': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { hid_t pclass_id = va_arg(ap, hid_t); @@ -1788,20 +1788,20 @@ H5_trace(const double *returning, const char *func, const char *type, ...) /* (This may generate recursive call to the library... -QAK) */ if(NULL != (pclass = (H5P_genclass_t *)H5I_object(pclass_id)) && NULL != (class_name = H5P_get_class_name(pclass))) { - fprintf(out, "%s", class_name); + HDfprintf(out, "%s", class_name); H5MM_xfree(class_name); } /* end if */ else - fprintf(out, "%ld", (long)pclass_id); + HDfprintf(out, "%ld", (long)pclass_id); } /* end else */ break; case 'r': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { hobj_ref_t ref = va_arg(ap, hobj_ref_t); @@ -1815,39 +1815,39 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5R_type_t reftype = (H5R_type_t)va_arg(ap, int); switch(reftype) { case H5R_BADTYPE: - fprintf(out, "H5R_BADTYPE"); + HDfprintf(out, "H5R_BADTYPE"); break; case H5R_OBJECT: - fprintf(out, "H5R_OBJECT"); + HDfprintf(out, "H5R_OBJECT"); break; case H5R_DATASET_REGION: - fprintf(out, "H5R_DATASET_REGION"); + HDfprintf(out, "H5R_DATASET_REGION"); break; case H5R_MAXTYPE: - fprintf(out, "H5R_MAXTYPE"); + HDfprintf(out, "H5R_MAXTYPE"); break; default: - fprintf(out, "BADTYPE(%ld)", (long)reftype); + HDfprintf(out, "BADTYPE(%ld)", (long)reftype); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(S%c)", type[1]); + HDfprintf(out, "BADTYPE(S%c)", type[1]); goto error; } break; @@ -1857,32 +1857,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5S_class_t cls = (H5S_class_t)va_arg(ap, int); switch(cls) { case H5S_NO_CLASS: - fprintf(out, "H5S_NO_CLASS"); + HDfprintf(out, "H5S_NO_CLASS"); break; case H5S_SCALAR: - fprintf(out, "H5S_SCALAR"); + HDfprintf(out, "H5S_SCALAR"); break; case H5S_SIMPLE: - fprintf(out, "H5S_SIMPLE"); + HDfprintf(out, "H5S_SIMPLE"); break; case H5S_NULL: - fprintf(out, "H5S_NULL"); + HDfprintf(out, "H5S_NULL"); break; default: - fprintf(out, "%ld", (long)cls); + HDfprintf(out, "%ld", (long)cls); break; } /* end switch */ } /* end else */ @@ -1891,56 +1891,56 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5S_seloper_t so = (H5S_seloper_t)va_arg(ap, int); switch(so) { case H5S_SELECT_NOOP: - fprintf(out, "H5S_NOOP"); + HDfprintf(out, "H5S_NOOP"); break; case H5S_SELECT_SET: - fprintf(out, "H5S_SELECT_SET"); + HDfprintf(out, "H5S_SELECT_SET"); break; case H5S_SELECT_OR: - fprintf(out, "H5S_SELECT_OR"); + HDfprintf(out, "H5S_SELECT_OR"); break; case H5S_SELECT_AND: - fprintf(out, "H5S_SELECT_AND"); + HDfprintf(out, "H5S_SELECT_AND"); break; case H5S_SELECT_XOR: - fprintf(out, "H5S_SELECT_XOR"); + HDfprintf(out, "H5S_SELECT_XOR"); break; case H5S_SELECT_NOTB: - fprintf(out, "H5S_SELECT_NOTB"); + HDfprintf(out, "H5S_SELECT_NOTB"); break; case H5S_SELECT_NOTA: - fprintf(out, "H5S_SELECT_NOTA"); + HDfprintf(out, "H5S_SELECT_NOTA"); break; case H5S_SELECT_APPEND: - fprintf(out, "H5S_SELECT_APPEND"); + HDfprintf(out, "H5S_SELECT_APPEND"); break; case H5S_SELECT_PREPEND: - fprintf(out, "H5S_SELECT_PREPEND"); + HDfprintf(out, "H5S_SELECT_PREPEND"); break; case H5S_SELECT_INVALID: - fprintf(out, "H5S_SELECT_INVALID"); + HDfprintf(out, "H5S_SELECT_INVALID"); break; default: - fprintf(out, "%ld", (long)so); + HDfprintf(out, "%ld", (long)so); break; } /* end switch */ } /* end else */ @@ -1949,47 +1949,47 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5S_sel_type st = (H5S_sel_type)va_arg(ap, int); switch(st) { case H5S_SEL_ERROR: - fprintf(out, "H5S_SEL_ERROR"); + HDfprintf(out, "H5S_SEL_ERROR"); break; case H5S_SEL_NONE: - fprintf(out, "H5S_SEL_NONE"); + HDfprintf(out, "H5S_SEL_NONE"); break; case H5S_SEL_POINTS: - fprintf(out, "H5S_SEL_POINTS"); + HDfprintf(out, "H5S_SEL_POINTS"); break; case H5S_SEL_HYPERSLABS: - fprintf(out, "H5S_SEL_HYPERSLABS"); + HDfprintf(out, "H5S_SEL_HYPERSLABS"); break; case H5S_SEL_ALL: - fprintf(out, "H5S_SEL_ALL"); + HDfprintf(out, "H5S_SEL_ALL"); break; case H5S_SEL_N: - fprintf(out, "H5S_SEL_N"); + HDfprintf(out, "H5S_SEL_N"); break; default: - fprintf(out, "%ld", (long)st); + HDfprintf(out, "%ld", (long)st); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(S%c)", type[1]); + HDfprintf(out, "BADTYPE(S%c)", type[1]); goto error; } /* end switch */ break; @@ -1997,14 +1997,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { const char *str = va_arg(ap, const char *); - fprintf(out, "\"%s\"", str); + HDfprintf(out, "\"%s\"", str); } /* end else */ break; @@ -2013,24 +2013,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_cset_t cset = (H5T_cset_t)va_arg(ap, int); switch(cset) { case H5T_CSET_ERROR: - fprintf(out, "H5T_CSET_ERROR"); + HDfprintf(out, "H5T_CSET_ERROR"); break; case H5T_CSET_ASCII: - fprintf(out, "H5T_CSET_ASCII"); + HDfprintf(out, "H5T_CSET_ASCII"); break; case H5T_CSET_UTF8: - fprintf(out, "H5T_CSET_UTF8"); + HDfprintf(out, "H5T_CSET_UTF8"); break; case H5T_CSET_RESERVED_2: @@ -2047,11 +2047,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case H5T_CSET_RESERVED_13: case H5T_CSET_RESERVED_14: case H5T_CSET_RESERVED_15: - fprintf(out, "H5T_CSET_RESERVED_%ld", (long)cset); + HDfprintf(out, "H5T_CSET_RESERVED_%ld", (long)cset); break; default: - fprintf(out, "%ld", (long)cset); + HDfprintf(out, "%ld", (long)cset); break; } /* end switch */ } /* end else */ @@ -2060,28 +2060,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'd': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_direction_t direct = (H5T_direction_t)va_arg(ap, int); switch(direct) { case H5T_DIR_DEFAULT: - fprintf(out, "H5T_DIR_DEFAULT"); + HDfprintf(out, "H5T_DIR_DEFAULT"); break; case H5T_DIR_ASCEND: - fprintf(out, "H5T_DIR_ASCEND"); + HDfprintf(out, "H5T_DIR_ASCEND"); break; case H5T_DIR_DESCEND: - fprintf(out, "H5T_DIR_DESCEND"); + HDfprintf(out, "H5T_DIR_DESCEND"); break; default: - fprintf(out, "%ld", (long)direct); + HDfprintf(out, "%ld", (long)direct); break; } /* end switch */ } /* end else */ @@ -2090,28 +2090,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'e': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_pers_t pers = (H5T_pers_t)va_arg(ap, int); switch(pers) { case H5T_PERS_DONTCARE: - fprintf(out, "H5T_PERS_DONTCARE"); + HDfprintf(out, "H5T_PERS_DONTCARE"); break; case H5T_PERS_SOFT: - fprintf(out, "H5T_PERS_SOFT"); + HDfprintf(out, "H5T_PERS_SOFT"); break; case H5T_PERS_HARD: - fprintf(out, "H5T_PERS_HARD"); + HDfprintf(out, "H5T_PERS_HARD"); break; default: - fprintf(out, "%ld", (long)pers); + HDfprintf(out, "%ld", (long)pers); break; } /* end switch */ } /* end else */ @@ -2120,32 +2120,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'n': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_norm_t norm = (H5T_norm_t)va_arg(ap, int); switch(norm) { case H5T_NORM_ERROR: - fprintf(out, "H5T_NORM_ERROR"); + HDfprintf(out, "H5T_NORM_ERROR"); break; case H5T_NORM_IMPLIED: - fprintf(out, "H5T_NORM_IMPLIED"); + HDfprintf(out, "H5T_NORM_IMPLIED"); break; case H5T_NORM_MSBSET: - fprintf(out, "H5T_NORM_MSBSET"); + HDfprintf(out, "H5T_NORM_MSBSET"); break; case H5T_NORM_NONE: - fprintf(out, "H5T_NORM_NONE"); + HDfprintf(out, "H5T_NORM_NONE"); break; default: - fprintf(out, "%ld", (long)norm); + HDfprintf(out, "%ld", (long)norm); break; } /* end switch */ } /* end else */ @@ -2154,40 +2154,40 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'o': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_order_t order = (H5T_order_t)va_arg(ap, int); switch(order) { case H5T_ORDER_ERROR: - fprintf(out, "H5T_ORDER_ERROR"); + HDfprintf(out, "H5T_ORDER_ERROR"); break; case H5T_ORDER_LE: - fprintf(out, "H5T_ORDER_LE"); + HDfprintf(out, "H5T_ORDER_LE"); break; case H5T_ORDER_BE: - fprintf(out, "H5T_ORDER_BE"); + HDfprintf(out, "H5T_ORDER_BE"); break; case H5T_ORDER_VAX: - fprintf(out, "H5T_ORDER_VAX"); + HDfprintf(out, "H5T_ORDER_VAX"); break; case H5T_ORDER_MIXED: - fprintf(out, "H5T_ORDER_MIXED"); + HDfprintf(out, "H5T_ORDER_MIXED"); break; case H5T_ORDER_NONE: - fprintf(out, "H5T_ORDER_NONE"); + HDfprintf(out, "H5T_ORDER_NONE"); break; default: - fprintf(out, "%ld", (long)order); + HDfprintf(out, "%ld", (long)order); break; } /* end switch */ } /* end else */ @@ -2196,36 +2196,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'p': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_pad_t pad = (H5T_pad_t)va_arg(ap, int); switch(pad) { case H5T_PAD_ERROR: - fprintf(out, "H5T_PAD_ERROR"); + HDfprintf(out, "H5T_PAD_ERROR"); break; case H5T_PAD_ZERO: - fprintf(out, "H5T_PAD_ZERO"); + HDfprintf(out, "H5T_PAD_ZERO"); break; case H5T_PAD_ONE: - fprintf(out, "H5T_PAD_ONE"); + HDfprintf(out, "H5T_PAD_ONE"); break; case H5T_PAD_BACKGROUND: - fprintf(out, "H5T_PAD_BACKGROUND"); + HDfprintf(out, "H5T_PAD_BACKGROUND"); break; case H5T_NPAD: - fprintf(out, "H5T_NPAD"); + HDfprintf(out, "H5T_NPAD"); break; default: - fprintf(out, "%ld", (long)pad); + HDfprintf(out, "%ld", (long)pad); break; } /* end switch */ } /* end else */ @@ -2234,32 +2234,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_sign_t sign = (H5T_sign_t)va_arg(ap, int); switch(sign) { case H5T_SGN_ERROR: - fprintf(out, "H5T_SGN_ERROR"); + HDfprintf(out, "H5T_SGN_ERROR"); break; case H5T_SGN_NONE: - fprintf(out, "H5T_SGN_NONE"); + HDfprintf(out, "H5T_SGN_NONE"); break; case H5T_SGN_2: - fprintf(out, "H5T_SGN_2"); + HDfprintf(out, "H5T_SGN_2"); break; case H5T_NSGN: - fprintf(out, "H5T_NSGN"); + HDfprintf(out, "H5T_NSGN"); break; default: - fprintf(out, "%ld", (long)sign); + HDfprintf(out, "%ld", (long)sign); break; } /* end switch */ } /* end else */ @@ -2268,68 +2268,68 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_class_t type_class = (H5T_class_t)va_arg(ap, int); switch(type_class) { case H5T_NO_CLASS: - fprintf(out, "H5T_NO_CLASS"); + HDfprintf(out, "H5T_NO_CLASS"); break; case H5T_INTEGER: - fprintf(out, "H5T_INTEGER"); + HDfprintf(out, "H5T_INTEGER"); break; case H5T_FLOAT: - fprintf(out, "H5T_FLOAT"); + HDfprintf(out, "H5T_FLOAT"); break; case H5T_TIME: - fprintf(out, "H5T_TIME"); + HDfprintf(out, "H5T_TIME"); break; case H5T_STRING: - fprintf(out, "H5T_STRING"); + HDfprintf(out, "H5T_STRING"); break; case H5T_BITFIELD: - fprintf(out, "H5T_BITFIELD"); + HDfprintf(out, "H5T_BITFIELD"); break; case H5T_OPAQUE: - fprintf(out, "H5T_OPAQUE"); + HDfprintf(out, "H5T_OPAQUE"); break; case H5T_COMPOUND: - fprintf(out, "H5T_COMPOUND"); + HDfprintf(out, "H5T_COMPOUND"); break; case H5T_REFERENCE: - fprintf(out, "H5T_REFERENCE"); + HDfprintf(out, "H5T_REFERENCE"); break; case H5T_ENUM: - fprintf(out, "H5T_ENUM"); + HDfprintf(out, "H5T_ENUM"); break; case H5T_VLEN: - fprintf(out, "H5T_VLEN"); + HDfprintf(out, "H5T_VLEN"); break; case H5T_ARRAY: - fprintf(out, "H5T_ARRAY"); + HDfprintf(out, "H5T_ARRAY"); break; case H5T_NCLASSES: - fprintf(out, "H5T_NCLASSES"); + HDfprintf(out, "H5T_NCLASSES"); break; default: - fprintf(out, "%ld", (long)type_class); + HDfprintf(out, "%ld", (long)type_class); break; } /* end switch */ } /* end else */ @@ -2338,28 +2338,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'z': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_str_t str = (H5T_str_t)va_arg(ap, int); switch(str) { case H5T_STR_ERROR: - fprintf(out, "H5T_STR_ERROR"); + HDfprintf(out, "H5T_STR_ERROR"); break; case H5T_STR_NULLTERM: - fprintf(out, "H5T_STR_NULLTERM"); + HDfprintf(out, "H5T_STR_NULLTERM"); break; case H5T_STR_NULLPAD: - fprintf(out, "H5T_STR_NULLPAD"); + HDfprintf(out, "H5T_STR_NULLPAD"); break; case H5T_STR_SPACEPAD: - fprintf(out, "H5T_STR_SPACEPAD"); + HDfprintf(out, "H5T_STR_SPACEPAD"); break; case H5T_STR_RESERVED_3: @@ -2375,18 +2375,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case H5T_STR_RESERVED_13: case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: - fprintf(out, "H5T_STR_RESERVED(%ld)",(long)str); + HDfprintf(out, "H5T_STR_RESERVED(%ld)",(long)str); break; default: - fprintf(out, "%ld", (long)str); + HDfprintf(out, "%ld", (long)str); break; } /* end switch */ } /* end else */ break; default: - fprintf (out, "BADTYPE(T%c)", type[1]); + HDfprintf (out, "BADTYPE(T%c)", type[1]); goto error; } /* end switch */ break; @@ -2394,19 +2394,19 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { htri_t tri_var = va_arg (ap, htri_t); if(tri_var>0) - fprintf (out, "TRUE"); + HDfprintf (out, "TRUE"); else if(!tri_var) - fprintf (out, "FALSE"); + HDfprintf (out, "FALSE"); else - fprintf(out, "FAIL(%d)", (int)tri_var); + HDfprintf(out, "FAIL(%d)", (int)tri_var); } /* end else */ break; @@ -2415,23 +2415,23 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'l': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { unsigned long *p = (unsigned long *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%lu", i?", ":"", p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { unsigned long iul = va_arg(ap, unsigned long); - fprintf(out, "%lu", iul); + HDfprintf(out, "%lu", iul); asize[argno] = (hssize_t)iul; } /* end else */ break; @@ -2439,29 +2439,29 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'L': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { unsigned long long *p = (unsigned long long *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%llu", i?", ":"", p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { unsigned long long iull = va_arg(ap, unsigned long long); - fprintf(out, "%llu", iull); + HDfprintf(out, "%llu", iull); asize[argno] = (hssize_t)iull; } /* end else */ break; default: - fprintf (out, "BADTYPE(U%c)", type[1]); + HDfprintf (out, "BADTYPE(U%c)", type[1]); goto error; } /* end switch */ break; @@ -2469,48 +2469,48 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'x': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { void **p = (void**)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) { if(p[i]) - fprintf(out, "%s0x%lx", (i ? ", " : ""), (unsigned long)(p[i])); + HDfprintf(out, "%s0x%lx", (i ? ", " : ""), (unsigned long)(p[i])); else - fprintf(out, "%sNULL", (i ? ", " : "")); + HDfprintf(out, "%sNULL", (i ? ", " : "")); } /* end for */ - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { vp = va_arg (ap, void *); if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end else */ break; case 'z': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { size_t *p = (size_t *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%Zu", (i ? ", " : ""), p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { size_t size = va_arg(ap, size_t); @@ -2525,28 +2525,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'a': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5Z_SO_scale_type_t scale_type = (H5Z_SO_scale_type_t)va_arg(ap, int); switch(scale_type) { case H5Z_SO_FLOAT_DSCALE: - fprintf(out, "H5Z_SO_FLOAT_DSCALE"); + HDfprintf(out, "H5Z_SO_FLOAT_DSCALE"); break; case H5Z_SO_FLOAT_ESCALE: - fprintf(out, "H5Z_SO_FLOAT_ESCALE"); + HDfprintf(out, "H5Z_SO_FLOAT_ESCALE"); break; case H5Z_SO_INT: - fprintf(out, "H5Z_SO_INT"); + HDfprintf(out, "H5Z_SO_INT"); break; default: - fprintf(out, "%ld", (long)scale_type); + HDfprintf(out, "%ld", (long)scale_type); break; } /* end switch */ } /* end else */ @@ -2555,68 +2555,68 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5Z_class2_t *filter = va_arg(ap, H5Z_class2_t*); - fprintf(out, "0x%lx", (unsigned long)filter); + HDfprintf(out, "0x%lx", (unsigned long)filter); } /* end else */ break; case 'e': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5Z_EDC_t edc = (H5Z_EDC_t)va_arg(ap, int); if(H5Z_DISABLE_EDC == edc) - fprintf(out, "H5Z_DISABLE_EDC"); + HDfprintf(out, "H5Z_DISABLE_EDC"); else if (H5Z_ENABLE_EDC == edc) - fprintf(out, "H5Z_ENABLE_EDC"); + HDfprintf(out, "H5Z_ENABLE_EDC"); else - fprintf(out, "%ld", (long)edc); + HDfprintf(out, "%ld", (long)edc); } /* end else */ break; case 'f': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5Z_filter_t id = va_arg(ap, H5Z_filter_t); if(H5Z_FILTER_DEFLATE == id) - fprintf(out, "H5Z_FILTER_DEFLATE"); + HDfprintf(out, "H5Z_FILTER_DEFLATE"); else - fprintf(out, "%ld", (long)id); + HDfprintf(out, "%ld", (long)id); } /* end else */ break; case 's': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { ssize_t *p = (ssize_t *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%Zd", (i ? ", " : ""), p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { ssize_t ssize = va_arg(ap, ssize_t); @@ -2627,32 +2627,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - fprintf(out, "BADTYPE(Z%c)", type[1]); + HDfprintf(out, "BADTYPE(Z%c)", type[1]); goto error; } /* end switch */ break; default: if(HDisupper(type[0])) - fprintf(out, "BADTYPE(%c%c)", type[0], type[1]); + HDfprintf(out, "BADTYPE(%c%c)", type[0], type[1]); else - fprintf(out, "BADTYPE(%c)", type[0]); + HDfprintf(out, "BADTYPE(%c)", type[0]); goto error; } /* end switch */ } /* end for */ /* Display event time for return */ if(returning && H5_debug_g.ttimes) - fprintf(out, " @%.6f [dt=%.6f]", (event_time.etime - first_time.etime), + HDfprintf(out, " @%.6f [dt=%.6f]", (event_time.etime - first_time.etime), (event_time.etime - *returning)); error: va_end(ap); if(returning) - fprintf(out, ";\n"); + HDfprintf(out, ";\n"); else { last_call_depth = current_depth++; - fprintf (out, ")"); + HDfprintf (out, ")"); } /* end else */ HDfflush(out); diff --git a/test/testfiles/plist_files/dapl_32be b/test/testfiles/plist_files/dapl_32be index 4dedda2..8dcf239 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..8dcf239 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..8dcf239 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..8dcf239 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..880eae5 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..880eae5 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..880eae5 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..880eae5 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_fapl_32be b/test/testfiles/plist_files/def_fapl_32be index 199f5c2..6e94011 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 199f5c2..6e94011 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 199f5c2..6e94011 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 199f5c2..6e94011 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/fapl_32be b/test/testfiles/plist_files/fapl_32be index 108d63f..237b291 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 108d63f..237b291 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 108d63f..237b291 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 108d63f..237b291 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/lapl_32be b/test/testfiles/plist_files/lapl_32be index 6423d30..9d81759 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 6423d30..9d81759 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 6423d30..9d81759 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 6423d30..9d81759 100644 Binary files a/test/testfiles/plist_files/lapl_64le and b/test/testfiles/plist_files/lapl_64le differ diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 6121f81..0fa268e 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -83,12 +83,12 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " -v, --verbose Verbose mode, print object information\n"); PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); PRINTVALSTREAM(rawoutstream, " -n, --native Use a native HDF5 type when repacking\n"); - PRINTVALSTREAM(rawoutstream, " -E --enable-error-stack Prints messages from the HDF5 error stack as they occur\n"); + PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n"); PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n"); PRINTVALSTREAM(rawoutstream, " This option will take precedence over the -j and -k options\n"); - PRINTVALSTREAM(rawoutstream, " -j BOUND, --low=BOUND The low bound for library release versions to use when creating\n"); + PRINTVALSTREAM(rawoutstream, " --low=BOUND The low bound for library release versions to use when creating\n"); PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_EARLIEST)\n"); - PRINTVALSTREAM(rawoutstream, " -k BOUND, --high=BOUND The high bound for library release versions to use when creating\n"); + PRINTVALSTREAM(rawoutstream, " --high=BOUND The high bound for library release versions to use when creating\n"); PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_LATEST)\n"); PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n"); PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n"); @@ -217,7 +217,7 @@ static void usage(const char *prog) { 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 -j 0 -k 1 file1 file2\n"); + PRINTVALSTREAM(rawoutstream, "5) h5repack --low=0 --high=1 file1 file2\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when\n"); PRINTVALSTREAM(rawoutstream, " creating the repacked file: file2\n"); diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index 723711d..0eef0f5 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -6,12 +6,12 @@ usage: h5repack [OPTIONS] file1 file2 -v, --verbose Verbose mode, print object information -V, --version Print version number and exit -n, --native Use a native HDF5 type when repacking - -E --enable-error-stack Prints messages from the HDF5 error stack as they occur + --enable-error-stack Prints messages from the HDF5 error stack as they occur -L, --latest Use latest version of file format This option will take precedence over the -j and -k options - -j BOUND, --low=BOUND The low bound for library release versions to use when creating + --low=BOUND The low bound for library release versions to use when creating objects in the file (default is H5F_LIBVER_EARLIEST) - -k BOUND, --high=BOUND The high bound for library release versions to use when creating + --high=BOUND The high bound for library release versions to use when creating objects in the file (default is H5F_LIBVER_LATEST) -c L1, --compact=L1 Maximum number of links in header messages -d L2, --indexed=L2 Minimum number of links in the indexed format @@ -140,7 +140,7 @@ Examples of use: Using latest file format with maximum compact group size of 10 and and minimum shared datatype size of 20 -5) h5repack -j 0 -k 1 file1 file2 +5) h5repack --low=0 --high=1 file1 file2 Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when creating the repacked file: file2 -- cgit v0.12 From 74f74f60bb92cc614616d8ae3d91ecc2921aade1 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 7 Feb 2018 11:33:31 -0600 Subject: Cleaned up per comments in PR# 876 Platforms tested: Linux/64 (jelly) Darwin (osx1010test) --- test/gen_bounds.c | 528 +++++++++++++++++++++++++++--------------------------- 1 file changed, 262 insertions(+), 266 deletions(-) diff --git a/test/gen_bounds.c b/test/gen_bounds.c index 50b4acc..b3ef0e3 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -12,9 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Oct 24, 2017 - * - * Purpose: This program is run to generate HDF5 data files used to test + * Purpose: This program is to generate HDF5 data files used to test * version bounds. * * Description @@ -25,10 +23,11 @@ * - bounds_latest_latest.h5 * - bounds_v18_latest.h5 * - bounds_v18_v18.h5 - * + * These files are copied to 1.6 and 1.8 libraries for verifying + * that they can or cannot read particular file format. */ -#include "hdf5.h" +#include "h5test.h" /*********************************************************************** * gen_earliest_latest() creates file "bounds_earliest_latest.h5" @@ -38,118 +37,121 @@ * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) * + * Return: SUCCEED/FAIL + * ***********************************************************************/ -#define FILENAME_E_L "bounds_earliest_latest.h5" + +/* File names for different file format */ +#define FILENAME_E_L "bounds_earliest_latest.h5" +#define FILENAME_E_18 "bounds_earliest_v18.h5" +#define FILENAME_L_L "bounds_latest_latest.h5" +#define FILENAME_18_L "bounds_v18_latest.h5" +#define FILENAME_18_18 "bounds_v18_v18.h5" /* 2-D dataset with fixed dimensions */ -#define RANK 2 -#define DIM1 100 -#define DIM2 200 -#define CHUNK_DIM1 50 -#define CHUNK_DIM2 50 +#define RANK 2 +#define DIM1 100 +#define DIM2 200 +#define CHK_DIM1 50 +#define CHK_DIM2 50 -int gen_earliest_latest() +static herr_t gen_earliest_latest(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hsize_t dims[RANK] = {DIM1, DIM2}; - hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; - float buf[DIM1][DIM2]; /* Buffer for writing data */ - int i, j; + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + float *buf = NULL; /* Buffer for writing data */ + float *bufp = NULL; /* Pointer to data buffer */ + hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ + hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */ + int i, j; + herr_t ret = SUCCEED; /* Generic return value */ /* Create file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR; /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set the "use the earliest/latest version of the format" bounds for creating objects in the file */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) - goto error; + TEST_ERROR; /* Create file */ if((fid = H5Fcreate(FILENAME_E_L, H5F_ACC_TRUNC, fcpl, fapl)) <0) - goto error; + TEST_ERROR; /* Close file property lists */ - if(H5Pclose(fapl) < 0) - goto error; - if(H5Pclose(fcpl) < 0) - goto error; + if(H5Pclose(fapl) < 0) TEST_ERROR; + if(H5Pclose(fcpl) < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 3 (default) */ + buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + if (buf == NULL) TEST_ERROR; /* Fill sample data */ + bufp = buf; for (i = 0; i < DIM1; i++) for (j = 0; j < DIM2; j++) - buf[i][j] = 100.0F; + *bufp = 100.0F; /* Create the dataspace */ - if((space = H5Screate_simple(RANK, dims, NULL)) < 0) - goto error; + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; /* Close property list and dataset, will reuse dataspace */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) */ /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Disable partial chunk filters, triggers layout version 4 */ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) - goto error; + TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; + + /* Release allocated buffer */ + HDfree(buf); + bufp = buf = NULL; /* Close everything */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; - if(H5Sclose(space) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; + if(H5Fclose(fid) < 0) TEST_ERROR; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -159,8 +161,9 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); + HDfree(buf); } H5E_END_TRY; - return 1; + return FAIL; } /* gen_earliest_latest */ /*********************************************************************** @@ -170,83 +173,83 @@ error: * - Version 0 superblock (default) * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) * + * Return: SUCCEED/FAIL + * ***********************************************************************/ -#define FILENAME_E_18 "bounds_earliest_v18.h5" - -int gen_earliest_v18() +static herr_t gen_earliest_v18(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hsize_t dims[RANK] = {DIM1, DIM2}; - hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; - float buf[DIM1][DIM2]; /* Buffer for writing data */ - int i, j; + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + float *buf = NULL; /* Buffer for writing data */ + float *bufp = NULL; /* Pointer to data buffer */ + hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ + hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */ + int i, j; + herr_t ret = SUCCEED; /* Generic return value */ /* Create file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR; /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set the "use the earliest/v18 version of the format" bounds for creating objects in the file */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0) - goto error; + TEST_ERROR; /* Create file */ if((fid = H5Fcreate(FILENAME_E_18, H5F_ACC_TRUNC, fcpl, fapl)) <0) - goto error; + TEST_ERROR; /* Close file property lists */ - if(H5Pclose(fapl) < 0) - goto error; - if(H5Pclose(fcpl) < 0) - goto error; + if(H5Pclose(fapl) < 0) TEST_ERROR; + if(H5Pclose(fcpl) < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 3 (default) */ + buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + if (buf == NULL) TEST_ERROR; + /* Fill sample data */ + bufp = buf; for (i = 0; i < DIM1; i++) for (j = 0; j < DIM2; j++) - buf[i][j] = 100.0F; + *bufp = 100.0F; /* Create the dataspace */ - if((space = H5Screate_simple(RANK, dims, NULL)) < 0) - goto error; + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; + + /* Release allocated buffer */ + HDfree(buf); + bufp = buf = NULL; /* Close everything */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; - if(H5Sclose(space) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; + if(H5Fclose(fid) < 0) TEST_ERROR; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -256,8 +259,9 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); + HDfree(buf); } H5E_END_TRY; - return 1; + return FAIL; } /* gen_earliest_v18 */ /*********************************************************************** @@ -267,66 +271,69 @@ error: * - Version 3 superblock (H5Fcreate with H5F_ACC_SWMR_WRITE) * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) * + * Return: SUCCEED/FAIL + * ***********************************************************************/ -#define FILENAME_L_L "bounds_latest_latest.h5" - -int gen_latest_latest() +static herr_t gen_latest_latest(void) { - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hsize_t dims[RANK] = {DIM1, DIM2}; - hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; - float buf[DIM1][DIM2]; /* Buffer for writing data */ - int i, j; + hid_t fid = -1; /* File ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + float *buf = NULL; /* Buffer for writing data */ + float *bufp = NULL; /* Pointer to data buffer */ + hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ + hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */ + int i, j; + herr_t ret = SUCCEED; /* Generic return value */ /* Create file with H5F_ACC_SWMR_WRITE, triggers version 3 superblock */ - if((fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, H5P_DEFAULT, H5P_DEFAULT)) <0) - goto error; + fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, H5P_DEFAULT, H5P_DEFAULT); + if (fid < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) */ + buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + if (buf == NULL) TEST_ERROR; + /* Fill sample data */ + bufp = buf; for (i = 0; i < DIM1; i++) for (j = 0; j < DIM2; j++) - buf[i][j] = 100.0F; + *bufp = 100.0F; /* Create the dataspace */ - if((space = H5Screate_simple(RANK, dims, NULL)) < 0) - goto error; + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Disable partial chunk filters, triggers layout version 4 */ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) - goto error; + TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; + + /* Release allocated buffer */ + HDfree(buf); + bufp = buf = NULL; /* Close everything */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; - if(H5Sclose(space) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; + if(H5Fclose(fid) < 0) TEST_ERROR; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -334,8 +341,9 @@ error: H5Sclose(space); H5Pclose(dcpl); H5Fclose(fid); + HDfree(buf); } H5E_END_TRY; - return 1; + return FAIL; } /* gen_latest_latest */ /*********************************************************************** @@ -345,83 +353,82 @@ error: * - Version 2 superblock * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) * + * Return: SUCCEED/FAIL + * ***********************************************************************/ -#define FILENAME_18_L "bounds_v18_latest.h5" - -int gen_v18_latest() +static herr_t gen_v18_latest(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hsize_t dims[RANK] = {DIM1, DIM2}; - hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; - float buf[DIM1][DIM2]; /* Buffer for writing data */ - int i, j; + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + float *buf = NULL; /* Buffer for writing data */ + float *bufp = NULL; /* Pointer to data buffer */ + hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ + hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */ + int i, j; + herr_t ret = SUCCEED; /* Generic return value */ /* Create file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR; /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set the "use the v18/latest version of the format" bounds for creating objects in the file, also trigger version 2 superblock */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) - goto error; + TEST_ERROR; /* Create file */ if((fid = H5Fcreate(FILENAME_18_L, H5F_ACC_TRUNC, fcpl, fapl)) <0) - goto error; + TEST_ERROR; /* Close file property lists */ - if(H5Pclose(fapl) < 0) - goto error; - if(H5Pclose(fcpl) < 0) - goto error; + if(H5Pclose(fapl) < 0) TEST_ERROR; + if(H5Pclose(fcpl) < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 3 (default) */ + buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + if (buf == NULL) TEST_ERROR; + /* Fill sample data */ + bufp = buf; for (i = 0; i < DIM1; i++) for (j = 0; j < DIM2; j++) - buf[i][j] = 100.0F; + *bufp = 100.0F; /* Create the dataspace */ - if((space = H5Screate_simple(RANK, dims, NULL)) < 0) - goto error; + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; + + /* Release allocated buffer */ + HDfree(buf); + bufp = buf = NULL; /* Close property list and dataset, will reuse dataspace */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; - if(H5Sclose(space) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; + if(H5Fclose(fid) < 0) TEST_ERROR; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -431,8 +438,9 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); + HDfree(buf); } H5E_END_TRY; - return 1; + return FAIL; } /* gen_v18_latest */ /*********************************************************************** @@ -443,128 +451,120 @@ error: * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) * + * Return: SUCCEED/FAIL + * ***********************************************************************/ -#define FILENAME_18_18 "bounds_v18_v18.h5" - -int gen_v18_v18() +static herr_t gen_v18_v18(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hsize_t dims[RANK] = {DIM1, DIM2}; - hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; - float buf[DIM1][DIM2]; /* Buffer for writing data */ - int i, j; + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + float *buf = NULL; /* Buffer for writing data */ + float *bufp = NULL; /* Pointer to data buffer */ + hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ + hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */ + int i, j; + herr_t ret = SUCCEED; /* Generic return value */ /* Create file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR; /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set the "use the v18 version of the format" bounds for creating objects in the file */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18) < 0) - goto error; + TEST_ERROR; /* Create file */ if((fid = H5Fcreate(FILENAME_18_18, H5F_ACC_TRUNC, fcpl, fapl)) <0) - goto error; + TEST_ERROR; /* Close file property lists */ - if(H5Pclose(fapl) < 0) - goto error; - if(H5Pclose(fcpl) < 0) - goto error; + if(H5Pclose(fapl) < 0) TEST_ERROR; + if(H5Pclose(fcpl) < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 3 (default) */ + buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + if (buf == NULL) TEST_ERROR; + /* Fill sample data */ + bufp = buf; for (i = 0; i < DIM1; i++) for (j = 0; j < DIM2; j++) - buf[i][j] = 100.0F; + *bufp = 100.0F; /* Create the dataspace */ - if((space = H5Screate_simple(RANK, dims, NULL)) < 0) - goto error; + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; /* Close property list and dataset, will reuse dataspace */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; /* Close the file, then reopen it with the latest version */ - if(H5Fclose(fid) < 0) - goto error; + if(H5Fclose(fid) < 0) TEST_ERROR; /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set the "use the v18/latest version of the format" bounds for creating a layout version 4 object in the file */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) - goto error; + TEST_ERROR; if((fid = H5Fopen(FILENAME_18_18, H5F_ACC_RDWR, fapl)) < 0) - goto error; + TEST_ERROR; /* * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) */ /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Disable partial chunk filters */ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) - goto error; + TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; + + /* Release allocated buffer */ + HDfree(buf); + bufp = buf = NULL; /* Close everything */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Pclose(fapl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; - if(H5Sclose(space) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; - return 0; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Pclose(fapl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; + if(H5Fclose(fid) < 0) TEST_ERROR; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -574,35 +574,31 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); + HDfree(buf); } H5E_END_TRY; - return 1; + return FAIL; } /* gen_v18_v18 */ int main(void) { /* Generate file bounds_earliest_latest.h5 */ - if (gen_earliest_latest() < 0) - goto error; + if (gen_earliest_latest() < 0) TEST_ERROR; /* Generate file bounds_earliest_v18.h5 */ - if (gen_earliest_v18() < 0) - goto error; + if (gen_earliest_v18() < 0) TEST_ERROR; /* Generate file bounds_latest_latest.h5 */ - if (gen_latest_latest() < 0) - goto error; + if (gen_latest_latest() < 0) TEST_ERROR; /* Generate file bounds_v18_latest.h5 */ - if (gen_v18_latest() < 0) - goto error; + if (gen_v18_latest() < 0) TEST_ERROR; /* Generate file bounds_v18_v18.h5 */ - if (gen_v18_v18() < 0) - goto error; + if (gen_v18_v18() < 0) TEST_ERROR; - return 0; + return EXIT_SUCCESS; error: - return 1; + return EXIT_FAILURE; } -- cgit v0.12 From ae2577ff5e1b985a498bb57fc69ab7e85347ec7f Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 8 Feb 2018 12:59:23 -0600 Subject: Added gen_bounds --- test/CMakeTests.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index e6b364c..06bbd06 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1355,6 +1355,7 @@ if (HDF5_BUILD_GENERATORS) gen_bad_offset gen_bad_ohdr gen_bogus + gen_bounds gen_cross gen_deflate gen_filters -- cgit v0.12 From 83211cf8f6051be2ea8dfd84637c195b2b0213c1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 8 Feb 2018 15:45:57 -0600 Subject: HDFFV-10403 Fix soname setting --- config/cmake/HDF5Macros.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index f08349e..c3dea9a 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -17,12 +17,12 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) if (ARGN) set (PACKAGE_SOVERSION ${ARGN}) else () - set (PACKAGE_SOVERSION ${HDF5_PACKAGE_SOVERSION}) + set (PACKAGE_SOVERSION ${H5_SOVERS_MAJOR}) endif () if (WIN32) set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) else () - set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) + set (LIBHDF_VERSION ${HDF5_PACKAGE_SOVERSION}) endif () set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) if (WIN32) -- cgit v0.12 From 0a61befddc6f93cec1aa669e3c348e40e83ff0e7 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 13 Feb 2018 11:05:08 -0600 Subject: Additional tests Description: - Revised and add more variety to version bound tests per review - Revised gen_bounds.c per review Platforms tested: Linux/64 (jelly) Linux/32 (jam) Darwin (osx1010test) --- test/dsets.c | 419 ++++++++++++++++++++++++++++++++++++++++++++++-------- test/objcopy.c | 199 ++++++++++++++++++++++++++ test/ohdr.c | 86 ++++++++--- test/set_extent.c | 31 +++- test/tfile.c | 130 +++++++++++++++++ test/th5o.c | 191 +++++++++++++------------ test/th5s.c | 149 +++++++++++++++++++ 7 files changed, 1026 insertions(+), 179 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 0fff2d1..09f553e 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -24,8 +24,31 @@ #define H5Z_FRIEND /*suppress error about including H5Zpkg */ -#include "h5test.h" +#include "hdf5.h" +#include "testhdf5.h" #include "H5srcdir.h" + +#include "H5Bprivate.h" +#include "H5Iprivate.h" +#include "H5Pprivate.h" + +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_TESTING +#include "H5Fpkg.h" /* File access */ + +#define H5S_FRIEND /*suppress error about including H5Spkg */ +#include "H5Spkg.h" /* Dataspace */ + +#define H5T_FRIEND /*suppress error about including H5Tpkg */ +#include "H5Tpkg.h" /* Datatype */ + +#define H5A_FRIEND /*suppress error about including H5Apkg */ +#include "H5Apkg.h" /* Attributes */ + +/* Use in version bound test */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#include "H5Opkg.h" /* Object headers */ + #include "H5Dpkg.h" #include "H5FDpkg.h" #include "H5VMprivate.h" @@ -60,8 +83,10 @@ const char *FILENAME[] = { "storage_size", /* 22 */ "dls_01_strings", /* 23 */ "power2up", /* 24 */ + "version_bounds", /* 25 */ NULL }; + #define FILENAME_BUF_SIZE 1024 #define KB 1024 @@ -722,10 +747,15 @@ static herr_t test_compact_io(hid_t fapl) { hid_t file, dataset, space, plist; + hid_t verfile = -1, new_fapl = -1; hsize_t dims[2]; int wbuf[16][8], rbuf[16][8]; char filename[FILENAME_BUF_SIZE]; + H5F_libver_t low, high; /* File format bounds */ + H5F_t *fp; /* Internal file pointer */ + H5D_t *dsetp; /* Internal dataset pointer */ int i, j, n; + herr_t ret; /* Generic return value */ TESTING("compact dataset I/O"); @@ -764,8 +794,6 @@ test_compact_io(hid_t fapl) if(H5Dget_offset(dataset)!=HADDR_UNDEF) TEST_ERROR /* Close file */ - if(H5Sclose(space) < 0) TEST_ERROR - if(H5Pclose(plist) < 0) TEST_ERROR if(H5Dclose(dataset) < 0) TEST_ERROR if(H5Fclose(file) < 0) TEST_ERROR @@ -789,16 +817,110 @@ test_compact_io(hid_t fapl) printf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]); printf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]); goto error; - } /* end if */ + } /* end */ if(H5Dclose(dataset) < 0) TEST_ERROR if(H5Fclose(file) < 0) TEST_ERROR - PASSED(); - return 0; + /************************************** + * Additional test for version bounds * + **************************************/ + + /* Create a copy of file access property list */ + if((new_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR + + /* Loop through all the combinations of low/high library format bounds, + skipping invalid combinations. + - Create a file, create and write a compact dataset, and verify its data + - Verify the dataset's layout and fill message versions */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + /* Set version bounds */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Create a file */ + h5_fixname(FILENAME[25], new_fapl, filename, sizeof filename); + if((verfile = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, new_fapl)) < 0) + TEST_ERROR + + /* Create the compact dataset */ + dataset = H5Dcreate2(verfile, DSET_DEFAULT_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT); + if(dataset < 0) TEST_ERROR + + /* Write the same data as of DSET_COMPACT_IO_NAME */ + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) + TEST_ERROR + + /* Close DSET_DEFAULT_NAME, then reopen it to read and verify + the data */ + if(H5Dclose(dataset) < 0) TEST_ERROR + if((dataset = H5Dopen2(verfile, DSET_DEFAULT_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) + TEST_ERROR + + /* Check that the values read are the same as the values written */ + for(i = 0; i < 16; i++) + for(j = 0; j < 8; j++) + if(rbuf[i][j] != wbuf[i][j]) { + H5_FAILED(); + printf(" Read different values than written.\n"); + printf(" At index %d,%d\n", i, j); + printf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]); + printf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]); + goto error; + } /* end */ + + /* Get the internal file pointer */ + if((fp = (H5F_t *)H5I_object(verfile)) == NULL) TEST_ERROR + + /* Get the internal dataset pointer */ + if((dsetp = (H5D_t *)H5I_object(dataset)) == NULL) TEST_ERROR + + /* Verify the dataset's layout and fill message versions */ + if(fp->shared->low_bound == H5F_LIBVER_EARLIEST) { + VERIFY(dsetp->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "layout_ver_bounds"); + VERIFY(dsetp->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "fill_ver_bounds"); + } else { + VERIFY(dsetp->shared->layout.version, H5O_layout_ver_bounds[fp->shared->low_bound], "layout_ver_bounds"); + VERIFY(dsetp->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[fp->shared->low_bound], "fill_ver_bounds"); + } + + /* Close the dataset and delete from the file */ + if(H5Dclose(dataset) < 0) TEST_ERROR + if(H5Ldelete(verfile, DSET_DEFAULT_NAME, H5P_DEFAULT) < 0) + TEST_ERROR + + /* Close the file */ + if(H5Fclose(verfile) < 0) TEST_ERROR + + } /* end for high */ + } /* end for low */ + + if(H5Pclose(new_fapl) < 0) TEST_ERROR + if(H5Sclose(space) < 0) TEST_ERROR + if(H5Pclose(plist) < 0) TEST_ERROR + + PASSED(); + return 0; error: - return -1; + H5E_BEGIN_TRY { + H5Sclose(space); + H5Pclose(plist); + H5Pclose(new_fapl); + H5Dclose(dataset); + H5Fclose(file); + H5Fclose(verfile); + } H5E_END_TRY; + + return -1; } @@ -5045,16 +5167,16 @@ error: /*------------------------------------------------------------------------- * 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 * *------------------------------------------------------------------------- @@ -5062,10 +5184,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}; + hsize_t tmp_size[1]; + static hsize_t max_size[1] = {H5S_UNLIMITED}; TESTING("multi-open with extending"); @@ -5085,9 +5207,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; @@ -9790,6 +9912,7 @@ test_single_chunk(hid_t fapl) } /* end for */ #endif /* H5_HAVE_FILTER_DEFLATE */ + /* Release buffers */ HDfree(wbuf); HDfree(rbuf); @@ -10152,7 +10275,7 @@ error: /*------------------------------------------------------------------------- * Function: test_zero_dim_dset * - * Purpose: Tests support for reading a 1D chunled dataset with + * Purpose: Tests support for reading a 1D chunked dataset with * dimension size = 0. * * Return: Success: 0 @@ -10173,40 +10296,59 @@ test_zero_dim_dset(hid_t fapl) hid_t dsid = -1; /* Dataset ID */ hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */ int data[1]; + H5F_libver_t low, high; /* File format bounds */ + herr_t ret; /* Generic return value */ - TESTING("shrinking large chunk"); + TESTING("chunked dataset with zero dimension"); - h5_fixname(FILENAME[16], fapl, filename, sizeof filename); + /* Loop through all the combinations of low/high library format bounds, + skipping invalid combination, and verify support for reading a 1D + chunked dataset with dimension size = 0 */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - /* Create file */ - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR + /* Set version bounds before opening the file */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; - /* Create dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR + if (ret < 0) /* Invalid low/high combinations */ + continue; - /* Set 1 chunk size */ - chunk_dim = 1; - if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR + h5_fixname(FILENAME[16], fapl, filename, sizeof filename); - /* Create 1D dataspace with 0 dim size */ - dim = 0; - if((sid = H5Screate_simple(1, &dim, NULL)) < 0) FAIL_STACK_ERROR + /* Create file */ + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR - /* Create chunked dataset */ - if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + /* Create dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - /* write 0 elements from dataset */ - if(H5Dwrite(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR + /* Set 1 chunk size */ + chunk_dim = 1; + if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR - /* Read 0 elements from dataset */ - if(H5Dread(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR + /* Create 1D dataspace with 0 dim size */ + dim = 0; + if((sid = H5Screate_simple(1, &dim, NULL)) < 0) FAIL_STACK_ERROR - /* Close everything */ - if(H5Sclose(sid) < 0) FAIL_STACK_ERROR - if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR - if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR - if(H5Fclose(fid) < 0) FAIL_STACK_ERROR + /* Create chunked dataset */ + if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* write 0 elements from dataset */ + if(H5Dwrite(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR + + /* Read 0 elements from dataset */ + if(H5Dread(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR + + /* Close everything */ + if(H5Sclose(sid) < 0) FAIL_STACK_ERROR + if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR + if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR + if(H5Fclose(fid) < 0) FAIL_STACK_ERROR + + } /* end for high */ + } /* end for low */ PASSED(); @@ -12728,34 +12870,186 @@ error: /*------------------------------------------------------------------------- - * Function: main + * Function: test_versionbounds * - * Purpose: Tests the dataset interface (H5D) + * Purpose: Tests various format versions. + * (Currently, only virtual dataset feature) + * + * Return: Success: 0 + * Failure: -1 + * Description: + * This function attempts to create a virtual dataset in all + * valid combinations of low/high library format bounds. Creation + * of virtual dataset should only succeed in H5F_LIBVER_V110. + * -BMR, January 2018 + * + *------------------------------------------------------------------------- + */ +#define VDS_FNAME1 "virtual_file1" +#define VDS_FNAME2 "virtual_file2" +#define SRC_FNAME "source_file" +#define SRC_DSET "src_dset" +#define V_DSET "v_dset" +static herr_t +test_versionbounds() +{ + hid_t fapl = -1; + hid_t srcfile = -1; /* Files with source dsets */ + hid_t vfile = -1; /* File with virtual dset */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t srcspace = -1; /* Source dataspaces */ + hid_t vspace = -1; /* Virtual dset dataspaces */ + hid_t srcdset = -1; /* Source datset */ + hid_t vdset = -1; /* Virtual dataset */ + hid_t null_dspace = -1; /* Data space of H5S_NULL */ + hsize_t dims[1] = {3}; /* Data space current size */ + char srcfilename[FILENAME_BUF_SIZE]; + char vfilename1[FILENAME_BUF_SIZE]; + char vfilename2[FILENAME_BUF_SIZE]; + H5F_libver_t low, high; /* File format bounds */ + herr_t ret; /* Generic return value */ + + TESTING("version bounds of datasets"); + + /* Create a copy of file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR + + h5_fixname(VDS_FNAME1, fapl, vfilename1, sizeof vfilename1); + h5_fixname(VDS_FNAME2, fapl, vfilename2, sizeof vfilename2); + h5_fixname(SRC_FNAME, fapl, srcfilename, sizeof srcfilename); + + /* Create DCPL */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + /* Clear virtual layout in DCPL */ + if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0) + TEST_ERROR + + /* Create source dataspace */ + if((srcspace = H5Screate_simple(1, dims, NULL)) < 0) + TEST_ERROR + + /* Create virtual dataspace */ + if((vspace = H5Screate_simple(1, dims, NULL)) < 0) + TEST_ERROR + + /* Add virtual layout mapping */ + if(H5Pset_virtual(dcpl, vspace, srcfilename, SRC_DSET, srcspace) < 0) + TEST_ERROR + + /* Loop through all the combinations of low/high library format bounds */ + /* Create a source file and a dataset in it. Create a virtual file and + virtual dataset. Creation of virtual dataset should only succeed in + H5F_LIBVER_V110 */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + /* Set version bounds, skip for invalid low/high combination */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Create a source file and dataset */ + if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + if((srcdset = H5Dcreate2(srcfile, SRC_DSET, H5T_NATIVE_INT, srcspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Create a virtual file */ + if((vfile = H5Fcreate(vfilename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Create the virtual dataset */ + H5E_BEGIN_TRY { + vdset = H5Dcreate2(vfile, V_DSET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + } H5E_END_TRY; + + if (vdset > 0) /* dataset created successfully */ + { + /* Virtual dataset is only available starting in V110 */ + VERIFY(high, H5F_LIBVER_V110, "virtual dataset"); + + if(H5Dclose(vdset) < 0) TEST_ERROR + vdset = -1; + } + + /* Close virtual file */ + if(H5Fclose(vfile) < 0) TEST_ERROR + vfile = -1; + + /* Close srcdset and srcfile */ + if(H5Dclose(srcdset) < 0) TEST_ERROR + srcdset = -1; + + if(H5Fclose(srcfile) < 0) TEST_ERROR + srcfile = -1; + + } /* for high */ + } /* for low */ + + /* Close dataspaces and properties */ + if(H5Sclose(srcspace) < 0) + TEST_ERROR + srcspace = -1; + if(H5Sclose(vspace) < 0) + TEST_ERROR + vspace = -1; + if(H5Pclose(fapl) < 0) + TEST_ERROR + fapl = -1; + if(H5Pclose(dcpl) < 0) + TEST_ERROR + dcpl = -1; + PASSED(); + return 0; + + error: + H5E_BEGIN_TRY { + H5Sclose(srcspace); + H5Sclose(vspace); + H5Pclose(dcpl); + H5Pclose(fapl); + H5Dclose(srcdset); + H5Dclose(vdset); + H5Fclose(srcfile); + H5Fclose(vfile); + } H5E_END_TRY; + return -1; +} /* test_versionbounds() */ + + +/*------------------------------------------------------------------------- + * Function: main * - * Return: Success: exit(EXIT_SUCCESS) + * Purpose: Tests the dataset interface (H5D) * - * Failure: exit(EXIT_FAILURE) + * Return: Success: exit(EXIT_SUCCESS) + * 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; - hid_t fcpl = -1, fcpl2 = -1; + char filename[FILENAME_BUF_SIZE]; + hid_t file, grp, fapl, fapl2; + hid_t fcpl = -1, fcpl2 = -1; unsigned new_format; unsigned paged; - int mdc_nelmts; - size_t rdcc_nelmts; - size_t rdcc_nbytes; - double rdcc_w0; - int nerrors = 0; + int mdc_nelmts; + size_t rdcc_nelmts; + size_t rdcc_nbytes; + double rdcc_w0; + int nerrors = 0; const char *envval; - hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ + 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"); @@ -12924,6 +13218,9 @@ main(void) nerrors += (test_scatter_error() < 0 ? 1 : 0); nerrors += (test_gather_error() < 0 ? 1 : 0); + /* Tests version bounds using its own file */ + nerrors += (test_versionbounds() < 0 ? 1 : 0); + /* Run misc tests */ nerrors += dls_01_main(); diff --git a/test/objcopy.c b/test/objcopy.c index 216d111..c4bcbf3 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -18,9 +18,18 @@ * Purpose: Test H5Ocopy(). */ +#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" +#include "H5Bprivate.h" +#include "H5Iprivate.h" +#include "H5Pprivate.h" + +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_TESTING +#include "H5Fpkg.h" /* File access */ + /* * This file needs to access private information from the H5S package. * This file also needs to access the dataspace testing code. @@ -45,12 +54,22 @@ #define H5D_TESTING #include "H5Dpkg.h" /* Datasets */ +/* + * This file needs to access private information from the H5O package. + * This file also needs to access the dataspace testing code. + */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#define H5O_TESTING +#include "H5Opkg.h" /* Object header */ + const char *FILENAME[] = { "objcopy_src", "objcopy_dst", "objcopy_ext", "objcopy_src2", + "verbound_src", + "verbound_dst", NULL }; @@ -127,6 +146,7 @@ const char *FILENAME[] = { #define NAME_LINK_EXTERN_DANGLE "/g_links/external_link_to_nowhere" #define NAME_LINK_EXTERN_DANGLE2 "/g_links2/external_link_to_nowhere" #define NAME_OLD_FORMAT "/dset1" +#define NAME_DSET_NULL "DSET_NULL" #define NAME_BUF_SIZE 1024 #define ATTR_NAME_LEN 80 @@ -2089,6 +2109,184 @@ error: /*------------------------------------------------------------------------- + * Function: test_copy_dataset_versionbounds + * + * Purpose: Verify copying dataset works as expected in various version + * bound combination. + * + * Description: + * Create a simple dataset in SRC file using default versions. + * For each valid version bound combination, create a DST file, + * and attempt to copy the SRC dataset to the DST file. + * When copying fails, verify that the failure is a result of + * the invalid bounds, that is, DST has lower bounds than SRC. + * + * Return: Success: 0 + * Failure: 1 + * + *------------------------------------------------------------------------- + */ +static int +test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src) +{ + hid_t fid_src = -1, fid_dst = -1; /* Source and destination file IDs */ + hid_t fapl_dst = -1; /* File access plist for dest file */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did_src = -1, did_dst = -1; /* Source and destination dataset IDs */ + int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + hsize_t dim2d[2]; /* Dataset dimensions */ + char src_fname[NAME_BUF_SIZE]; /* Name of source file */ + char dst_fname[NAME_BUF_SIZE]; /* Name of destination file */ + H5F_libver_t low, high; /* File format bounds */ + H5F_libver_t low_src, high_src; /* Source file format bounds */ + unsigned srcdset_fillversion; /* Fill version of source dataset */ + hbool_t valid_high = FALSE; /* TRUE if high bound is valid */ + int i, j; /* Local index variables */ + H5D_t *dsetp = NULL; /* Pointer to internal dset structure */ + herr_t ret; /* Generic return value */ + + TESTING("H5Ocopy(): simple dataset with version bounds"); + + /* Initialize write buffer */ + for (i=0; ishared->dcpl_cache.fill.version; + + /* Close dataspace */ + if(H5Sclose(sid) < 0) TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(did_src) < 0) TEST_ERROR + + /* Close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + /* Open the source file with read-only */ + fid_src = H5Fopen(src_fname, H5F_ACC_RDONLY, fapl_src); + if (fid_src < 0) TEST_ERROR + + /* Loop through all the combinations of low/high library format bounds, + skipping invalid combinations. Create a destination file and copy the + source dataset to it, then verify */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + /* Set version bounds */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl_dst, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Create destination file */ + fid_dst = H5Fcreate(dst_fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_dst); + if (fid_dst < 0) TEST_ERROR + + /* Create an uncopied object in destination file so that addresses + in source and destination files aren't the same */ + if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* Try to copy the dataset */ + H5E_BEGIN_TRY { + ret = H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT); + } H5E_END_TRY; + + /* If copy failed, check if the failure is expected */ + if (ret < 0) + { + /* Failure is valid if fill version of source dataset is + greater than destination */ + if (srcdset_fillversion <= H5O_fill_ver_bounds[high]) + TEST_ERROR + + /* Close the DST file before continue */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + continue; + } + + /* Close the DST file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* Open destination file */ + fid_dst = H5Fopen(dst_fname, H5F_ACC_RDWR, fapl_dst); + if (fid_dst < 0) TEST_ERROR + + /* Open the datasets to compare */ + did_src = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT); + if (did_src < 0) TEST_ERROR + did_dst = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT); + if (did_dst < 0) TEST_ERROR + + /* Check if the datasets are equal */ + if (compare_datasets(did_src, did_dst, H5P_DEFAULT, buf) != TRUE) + TEST_ERROR + + /* Close the datasets */ + if(H5Dclose(did_dst) < 0) TEST_ERROR + if(H5Dclose(did_src) < 0) TEST_ERROR + + /* Close the DST file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + } /* for high */ + } /* for low */ + + /* Close property list and source file */ + if (H5Pclose(fapl_dst) < 0) TEST_ERROR + if (H5Fclose(fid_src) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(did_dst); + H5Dclose(did_src); + H5Sclose(sid); + H5Pclose(fapl_dst); + H5Fclose(fid_dst); + H5Fclose(fid_src); + } H5E_END_TRY; + + return 1; +} /* end test_copy_dataset_versionbounds */ + + +/*------------------------------------------------------------------------- * Function: test_copy_dataset_simple_samefile * * Purpose: Create a simple dataset in SRC file and copy it to SRC file @@ -14017,6 +14215,7 @@ main(void) /* The tests... */ nerrors += test_copy_dataset_simple(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_versionbounds(fcpl_src, src_fapl); nerrors += test_copy_dataset_simple_samefile(fcpl_src, src_fapl); /* Test with dataset opened in the file or not */ diff --git a/test/ohdr.c b/test/ohdr.c index 3915b38..43346a5 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -738,6 +738,42 @@ error: return FAIL; } /* test_unknown() */ +#define STR_EARLIEST "earliest" +#define STR_V18 "v18" +#define STR_LATEST "latest" +char *version_string(H5F_libver_t libver) +{ + char *str = NULL; + + str = (char *) malloc(20 * sizeof(char)); + if (str == NULL) + { + fprintf(stderr, "Allocation failed\n"); + exit(1); + } + + switch(libver) { + case H5F_LIBVER_EARLIEST: + strcpy(str, STR_EARLIEST); + break; + + case H5F_LIBVER_V18: + strcpy(str, STR_V18); + break; + + case H5F_LIBVER_V110: + HDassert(H5F_LIBVER_LATEST == H5F_LIBVER_V110); + strcpy(str, STR_LATEST); + break; + + case H5F_LIBVER_ERROR: + case H5F_LIBVER_NBOUNDS: + default: + sprintf(str, "%ld", (long)libver); + break; + } /* end switch */ +} /* end of version_string */ + /*------------------------------------------------------------------------- * Function: main @@ -755,32 +791,40 @@ error: int main(void) { - hid_t fapl = -1, file = -1; - H5F_t *f = NULL; - char filename[1024]; - H5O_hdr_info_t hdr_info; /* Object info */ - H5O_loc_t oh_loc; /* Object header locations */ - time_t time_new, ro; - int i; /* Local index variable */ - unsigned b; /* Index for "new format" loop */ - herr_t ret; /* Generic return value */ + hid_t fapl = -1; + hid_t file = -1; + H5F_t *f = NULL; + char filename[1024]; + H5O_hdr_info_t hdr_info; /* Object info */ + H5O_loc_t oh_loc; /* Object header locations */ + H5F_libver_t low, high; /* File format bounds */ + time_t time_new, ro; + unsigned b; /* Index for "new format" loop */ + char msg[80]; /* Message for file format version */ + int i; /* Local index variable */ + herr_t ret; /* Generic return value */ /* Reset library */ h5_reset(); fapl = h5_fileaccess(); h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - /* Loop over old & new formats */ - for(b = FALSE; b <= TRUE; b++) { - /* Display info about testing */ - if(b) - HDputs("Using new file format:"); - else - HDputs("Using default file format:"); + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - /* Set the format to use for the file */ - if(H5Pset_libver_bounds(fapl, (b ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST) < 0) - FAIL_STACK_ERROR + /* Set version bounds before opening the file */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Display info about testing */ + sprintf(msg, "Using file format version: (%s, %s)", version_string(low), + version_string(high)); + HDputs(msg); /* test on object continuation block */ if(test_cont(filename, fapl) < 0) @@ -977,7 +1021,9 @@ main(void) /* Test object header creation metadata cache issues */ if(test_ohdr_cache(filename, fapl) < 0) TEST_ERROR - } /* end for */ + + } /* high */ + } /* low */ /* Verify symbol table messages are cached */ if(h5_verify_cached_stabs(FILENAME, fapl) < 0) TEST_ERROR diff --git a/test/set_extent.c b/test/set_extent.c index b9536e5..0467073 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -427,14 +427,35 @@ error: */ static int do_layouts( hid_t fapl ) { + H5F_libver_t low, high; /* Low and high bounds */ + herr_t ret; /* Generic return value */ - TESTING("storage layout use"); + TESTING("storage layout use - tested with all low/high library format bounds"); + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - if (test_layouts( H5D_COMPACT, fapl ) < 0) - goto error; + hid_t new_fapl; - if (test_layouts( H5D_CONTIGUOUS, fapl ) < 0) - goto error; + /* Copy plist to use locally to avoid modifying the original */ + new_fapl = H5Pcopy(fapl); + + /* Set version bounds */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + if (test_layouts( H5D_COMPACT, new_fapl ) < 0) + goto error; + + if (test_layouts( H5D_CONTIGUOUS, new_fapl ) < 0) + goto error; + + } /* end for high */ + } /* end for low */ PASSED(); diff --git a/test/tfile.c b/test/tfile.c index 03a5233..8b66603 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -4953,6 +4953,134 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, CHECK(ret, FAIL, "H5Pclose"); } /* end test_libver_bounds_real() */ + +/*------------------------------------------------------------------------- + * Function: test_libver_bounds_open + * + * Purpose: Tests opening latest file with various low/high bounds. + * + * Return: Success: 0 + * Failure: number of errors + * + *------------------------------------------------------------------------- + */ +#define VERBFNAME "tverbounds_dspace.h5" +#define VERBDSNAME "dataset 1" +#define SPACE1_DIM1 3 +static int +test_libver_bounds_open(void) +{ + hid_t file = -1; /* File ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t new_fapl = -1;/* File access property list ID for reopened file */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hsize_t dim[1] = {SPACE1_DIM1}; /* Dataset dimensions */ + H5F_libver_t low, high; /* File format bounds */ + hsize_t chunk_dim[1] = {SPACE1_DIM1}; /* Chunk dimensions */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Opening File in Various Version Bounds\n")); + + /* Create a file access property list */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + + /* Create dataspace */ + space = H5Screate_simple(1, dim, NULL); + CHECK(space, FAIL, "H5Screate_simple"); + + /* Create a dataset creation property list */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + + /* Create and set chunk plist */ + ret = H5Pset_chunk(dcpl, 1, chunk_dim); + CHECK(ret, FAIL, "H5Pset_chunk"); + ret = H5Pset_deflate(dcpl, 9); + CHECK(ret, FAIL, "H5Pset_deflate"); + ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + CHECK(ret, FAIL, "H5Pset_chunk_opts"); + + /* Create a file with (LATEST, LATEST) bounds, create a layout version 4 + dataset, then close the file */ + + /* Set version bounds to (LATEST, LATEST) */ + low = H5F_LIBVER_LATEST; + high = H5F_LIBVER_LATEST; + ret = H5Pset_libver_bounds(fapl, low, high); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); + + /* Create the file */ + file = H5Fcreate(VERBFNAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(file, FAIL, "H5Fcreate"); + + /* Create dataset */ + dset = H5Dcreate2(file, VERBDSNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); + + /* Close dataset and file */ + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Fclose(file); + CHECK(ret, FAIL, "H5Fclose"); + + /* Attempt to open latest file with (earliest, v18), should fail */ + ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18); + H5E_BEGIN_TRY { + file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl); + } H5E_END_TRY; + VERIFY(file, FAIL, "Attempted to open latest file with earliest version"); + + /* Attempt to open latest file with (v18, v18), should fail */ + ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18); + H5E_BEGIN_TRY { + file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl); + } H5E_END_TRY; + VERIFY(file, FAIL, "Attempted to open latest file with v18 bounds"); + + /* Opening VERBFNAME in these combination should succeed. + For each low bound, verify that it is upgraded properly */ + high = H5F_LIBVER_LATEST; + for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) + { + H5F_libver_t new_low = H5F_LIBVER_EARLIEST; + + /* Set version bounds for opening file */ + ret = H5Pset_libver_bounds(fapl, low, high); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); + + /* Open the file */ + file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl); + CHECK(file, FAIL, "H5Fopen"); + + /* Get the new file access property */ + new_fapl = H5Fget_access_plist(file); + CHECK(new_fapl, FAIL, "H5Fget_access_plist"); + + /* Get new low bound and verify that it has been upgraded properly */ + ret = H5Pget_libver_bounds(new_fapl, &new_low, NULL); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + VERIFY(new_low, H5F_LIBVER_LATEST, "Low bound should be upgraded to H5F_LIBVER_LATEST"); + + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Fclose(file); + CHECK(ret, FAIL, "H5Fclose"); + } /* for low */ + + /* Close dataspace and property lists */ + ret = H5Sclose(space); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); +} /* end test_libver_bounds_open() */ + + /**************************************************************** ** ** test_libver_bounds(): @@ -4970,6 +5098,7 @@ test_libver_bounds(void) /* Run the tests */ test_libver_bounds_real(H5F_LIBVER_EARLIEST, 1, H5F_LIBVER_LATEST, 2); test_libver_bounds_real(H5F_LIBVER_LATEST, 2, H5F_LIBVER_EARLIEST, 2); + test_libver_bounds_open(); } /* end test_libver_bounds() */ /************************************************************************************** @@ -6249,6 +6378,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: * --the library will only use basic version */ + if(dtype->shared->type == H5T_COMPOUND || dtype->shared->type == H5T_ENUM || dtype->shared->type == H5T_ARRAY) { diff --git a/test/th5o.c b/test/th5o.c index 144ea4c..00d706c 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -774,7 +774,7 @@ test_h5o_link(void) hid_t lcpl_id=-1; hsize_t dims[2] = {TEST6_DIM1, TEST6_DIM2}; htri_t committed; /* Whether the named datatype is committed */ - unsigned new_format; /* Whether to use the new format or not */ + H5F_libver_t low, high; /* File format bounds */ int *wdata; int *rdata; int i, n; @@ -801,98 +801,103 @@ test_h5o_link(void) ret = H5Pset_create_intermediate_group(lcpl_id, TRUE); CHECK(ret, FAIL, "H5Pset_create_intermediate_group"); - /* Loop over using new group format */ - for(new_format = FALSE; new_format <= TRUE; new_format++) { - - /* Make a FAPL that uses the "use the latest version of the format" bounds */ - fapl_id = H5Pcreate(H5P_FILE_ACCESS); - CHECK(fapl_id, FAIL, "H5Pcreate"); - - /* Set the "use the latest version of the format" bounds for creating objects in the file */ - ret = H5Pset_libver_bounds(fapl_id, (new_format ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST); - CHECK(ret, FAIL, "H5Pset_libver_bounds"); - - /* Create a new HDF5 file */ - file_id = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); - CHECK(file_id, FAIL, "H5Fcreate"); - - /* Close the FAPL */ - ret = H5Pclose(fapl_id); - CHECK(ret, FAIL, "H5Pclose"); - - - /* Create and commit a datatype with no name */ - type_id = H5Tcopy(H5T_NATIVE_INT); - CHECK(type_id, FAIL, "H5Fcreate"); - ret = H5Tcommit_anon(file_id, type_id, H5P_DEFAULT, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Tcommit_anon"); - committed = H5Tcommitted(type_id); - VERIFY(committed, TRUE, "H5Tcommitted"); - - /* Create a dataset with no name using the committed datatype*/ - dset_id = H5Dcreate_anon(file_id, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate_anon"); - - /* Verify that we can write to and read from the dataset */ - - /* Write the data to the dataset */ - ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - CHECK(ret, FAIL, "H5Dwrite"); - - /* Read the data back */ - ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); - CHECK(ret, FAIL, "H5Dread"); - - /* Verify the data */ - for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) - VERIFY(wdata[i], rdata[i], "H5Dread"); - - /* Create a group with no name*/ - group_id = H5Gcreate_anon(file_id, H5P_DEFAULT, H5P_DEFAULT); - CHECK(group_id, FAIL, "H5Gcreate_anon"); - - /* Link nameless datatype into nameless group */ - ret = H5Olink(type_id, group_id, "datatype", H5P_DEFAULT, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Olink"); - - /* Link nameless dataset into nameless group with intermediate group */ - ret = H5Olink(dset_id, group_id, "inter_group/dataset", lcpl_id, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Olink"); - - /* Close IDs for dataset and datatype */ - ret = H5Dclose(dset_id); - CHECK(ret, FAIL, "H5Dclose"); - ret = H5Tclose(type_id); - CHECK(ret, FAIL, "H5Tclose"); - - /* Re-open datatype using new link */ - type_id = H5Topen2(group_id, "datatype", H5P_DEFAULT); - CHECK(type_id, FAIL, "H5Topen2"); - - /* Link nameless group to root group and close the group ID*/ - ret = H5Olink(group_id, file_id, "/group", H5P_DEFAULT, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Olink"); - ret = H5Gclose(group_id); - CHECK(ret, FAIL, "H5Gclose"); - - /* Open dataset through root group and verify its data */ - dset_id = H5Dopen2(file_id, "/group/inter_group/dataset", H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dopen2"); - - /* Read data from dataset */ - ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); - CHECK(ret, FAIL, "H5Dread"); - for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) - VERIFY(wdata[i], rdata[i], "H5Dread"); - - /* Close open IDs */ - ret = H5Dclose(dset_id); - CHECK(ret, FAIL, "H5Dclose"); - ret = H5Tclose(type_id); - CHECK(ret, FAIL, "H5Tclose"); - ret = H5Fclose(file_id); - CHECK(ret, FAIL, "H5Fclose"); - } /* end for */ + /* Create a file access property list */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl_id, FAIL, "H5Pcreate"); + + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + /* Set version bounds */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl_id, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Create a new HDF5 file */ + file_id = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); + CHECK(file_id, FAIL, "H5Fcreate"); + + /* Close the FAPL */ + ret = H5Pclose(fapl_id); + CHECK(ret, FAIL, "H5Pclose"); + + /* Create and commit a datatype with no name */ + type_id = H5Tcopy(H5T_NATIVE_INT); + CHECK(type_id, FAIL, "H5Fcreate"); + ret = H5Tcommit_anon(file_id, type_id, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit_anon"); + committed = H5Tcommitted(type_id); + VERIFY(committed, TRUE, "H5Tcommitted"); + + /* Create a dataset with no name using the committed datatype*/ + dset_id = H5Dcreate_anon(file_id, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate_anon"); + + /* Verify that we can write to and read from the dataset */ + + /* Write the data to the dataset */ + ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + CHECK(ret, FAIL, "H5Dwrite"); + + /* Read the data back */ + ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); + CHECK(ret, FAIL, "H5Dread"); + + /* Verify the data */ + for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) + VERIFY(wdata[i], rdata[i], "H5Dread"); + + /* Create a group with no name*/ + group_id = H5Gcreate_anon(file_id, H5P_DEFAULT, H5P_DEFAULT); + CHECK(group_id, FAIL, "H5Gcreate_anon"); + + /* Link nameless datatype into nameless group */ + ret = H5Olink(type_id, group_id, "datatype", H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Olink"); + + /* Link nameless dataset into nameless group with intermediate group */ + ret = H5Olink(dset_id, group_id, "inter_group/dataset", lcpl_id, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Olink"); + + /* Close IDs for dataset and datatype */ + ret = H5Dclose(dset_id); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Tclose(type_id); + CHECK(ret, FAIL, "H5Tclose"); + + /* Re-open datatype using new link */ + type_id = H5Topen2(group_id, "datatype", H5P_DEFAULT); + CHECK(type_id, FAIL, "H5Topen2"); + + /* Link nameless group to root group and close the group ID*/ + ret = H5Olink(group_id, file_id, "/group", H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Olink"); + ret = H5Gclose(group_id); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open dataset through root group and verify its data */ + dset_id = H5Dopen2(file_id, "/group/inter_group/dataset", H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dopen2"); + + /* Read data from dataset */ + ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); + CHECK(ret, FAIL, "H5Dread"); + for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) + VERIFY(wdata[i], rdata[i], "H5Dread"); + + /* Close open IDs */ + ret = H5Dclose(dset_id); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Tclose(type_id); + CHECK(ret, FAIL, "H5Tclose"); + ret = H5Fclose(file_id); + CHECK(ret, FAIL, "H5Fclose"); + } /* for high */ + } /* for low */ /* Close remaining IDs */ ret = H5Sclose(space_id); diff --git a/test/th5s.c b/test/th5s.c index c63320a..81ac2ac 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -19,9 +19,29 @@ * *************************************************************/ +#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" +#include "H5Bprivate.h" +#include "H5Iprivate.h" +#include "H5Pprivate.h" + +/* + * This file needs to access private information from the H5S package. + * This file also needs to access the dataspace testing code. + */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ +#include "H5Spkg.h" /* Dataspaces */ + +/* + * This file needs to access private information from the H5O package. + * This file also needs to access the dataspace testing code. + */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#define H5O_TESTING +#include "H5Opkg.h" /* Object header */ + #include "H5private.h" #include "H5Bprivate.h" #include "H5Sprivate.h" @@ -2364,6 +2384,133 @@ test_h5s_bug1(void) CHECK(ret, FAIL, "H5Sclose"); } /* test_h5s_bug1() */ + +/*------------------------------------------------------------------------- + * Function: test_versionbounds + * + * Purpose: Tests version bounds with dataspace. + * + * Description: + * This function creates a file with lower bounds then later + * reopens it with higher bounds to show that the dataspace + * version is upgraded appropriately. + * + * Return: Success: 0 + * Failure: number of errors + * + *------------------------------------------------------------------------- + */ +#define VERBFNAME "tverbounds_dspace.h5" +#define BASIC_DSET "Basic Dataset" +#define LATEST_DSET "Latest Dataset" +static void +test_versionbounds(void) +{ + hid_t file = -1; /* File ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t dset_space = -1; /* Retrieved dataset's dataspace ID */ + hsize_t dim[1]; /* Dataset dimensions */ + H5F_libver_t low, high; /* File format bounds */ + H5S_t *spacep = NULL; /* Pointer to internal dataspace */ + herr_t ret = 0; /* Generic return value */ +hid_t sid = -1; +H5S_t *spaceptr = NULL; + + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Version Bounds\n")); + + /* Create a file access property list */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + + /* Create dataspace */ + dim[0] = 10; + space = H5Screate_simple(1, dim, NULL); + CHECK(space, FAIL, "H5Screate"); + + /* Its version should be H5O_SDSPACE_VERSION_1 */ + spacep = (H5S_t *)H5I_object(space); + CHECK(spacep, NULL, "H5I_object"); + VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound"); + + /* Set high bound to V18 */ + low = H5F_LIBVER_EARLIEST; + high = H5F_LIBVER_V18; + ret = H5Pset_libver_bounds(fapl, low, high); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); + + /* Create the file */ + file = H5Fcreate(VERBFNAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(file, FAIL, "H5Fcreate"); + + /* Create a basic dataset */ + dset = H5Dcreate2(file, BASIC_DSET, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (dset > 0) /* dataset created successfully */ + { + /* Get the internal dataspace pointer */ + dset_space = H5Dget_space(dset); + CHECK(dset_space, FAIL, "H5Dget_space"); + spacep = (H5S_t *)H5I_object(dset_space); + CHECK(spacep, NULL, "H5I_object"); + + /* Dataspace version should remain as H5O_SDSPACE_VERSION_1 */ + VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound"); + + /* Close dataspace */ + ret = H5Sclose(dset_space); + CHECK(ret, FAIL, "H5Sclose"); + } + + /* Close basic dataset and the file */ + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Fclose(file); + CHECK(ret, FAIL, "H5Fclose"); + + /* Set low and high bounds to latest to trigger the increment of the + dataspace version */ + low = H5F_LIBVER_LATEST; + high = H5F_LIBVER_LATEST; + ret = H5Pset_libver_bounds(fapl, low, high); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); + + /* Reopen the file with new version bounds, LATEST/LATEST */ + file = H5Fopen(VERBFNAME, H5F_ACC_RDWR, fapl); + + /* Create another dataset using the same dspace as the previous dataset */ + dset = H5Dcreate2(file, LATEST_DSET, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); + + /* Dataset created successfully. Verify that dataspace version has been + upgraded per the low bound */ + + /* Get the internal dataspace pointer */ + dset_space = H5Dget_space(dset); + CHECK(dset_space, FAIL, "H5Dget_space"); + spacep = (H5S_t *)H5I_object(dset_space); + CHECK(spacep, NULL, "H5I_object"); + + /* Verify the dataspace version */ + VERIFY(spacep->extent.version, H5O_sdspace_ver_bounds[low], "upgraded dataspace version"); + + /* Close everything */ + ret = H5Sclose(dset_space); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + + ret = H5Sclose(space); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Fclose(file); + CHECK(ret, FAIL, "H5Fclose"); +} /* end test_versionbounds() */ + + /**************************************************************** ** ** test_h5s(): Main H5S (dataspace) testing routine. @@ -2391,6 +2538,7 @@ test_h5s(void) test_h5s_extent_equal(); /* Test extent comparison code */ test_h5s_extent_copy(); /* Test extent copy code */ test_h5s_bug1(); /* Test bug in offset initialization */ + test_versionbounds(); /* Test version bounds with dataspace */ } /* test_h5s() */ @@ -2415,4 +2563,5 @@ cleanup_h5s(void) remove(NULLFILE); remove(BASICFILE); remove(ZEROFILE); + remove(VERBFNAME); } -- cgit v0.12 From 551e58e683e76af4aca68998aa718e7e03d8f4f1 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 13 Feb 2018 12:29:51 -0600 Subject: Fixed typos Platforms tested: Linux/32 (jam) --- test/th5s.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/th5s.c b/test/th5s.c index 81ac2ac..4154c5f 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -2400,7 +2400,7 @@ test_h5s_bug1(void) * *------------------------------------------------------------------------- */ -#define VERBFNAME "tverbounds_dspace.h5" +#define VERBFNAME "tverbounds_dspace.h5" #define BASIC_DSET "Basic Dataset" #define LATEST_DSET "Latest Dataset" static void @@ -2415,9 +2415,6 @@ test_versionbounds(void) H5F_libver_t low, high; /* File format bounds */ H5S_t *spacep = NULL; /* Pointer to internal dataspace */ herr_t ret = 0; /* Generic return value */ -hid_t sid = -1; -H5S_t *spaceptr = NULL; - /* Output message about test being performed */ MESSAGE(5, ("Testing Version Bounds\n")); -- cgit v0.12 From 9a480c34e5ea3df0c1f12df465fc96e5d9e092af Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 13 Feb 2018 15:24:41 -0600 Subject: Added comment for clarification about latest as 1.10. Platforms tested: Linux/64 (jelly) Linux/32 (jam) --- test/gen_bounds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/gen_bounds.c b/test/gen_bounds.c index b3ef0e3..9702176 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -268,9 +268,11 @@ error: * gen_latest_latest() creates file "bounds_latest_latest.h5" * * File contents: - * - Version 3 superblock (H5Fcreate with H5F_ACC_SWMR_WRITE) + * - Version 3 superblock (triggered by H5Fcreate with H5F_ACC_SWMR_WRITE) * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) * + * NOTE: As of Feb 2018, latest is 1.10. + * * Return: SUCCEED/FAIL * ***********************************************************************/ -- cgit v0.12 From 300b219d43b434631d334004ecc1e84be1c51d74 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 14 Feb 2018 09:40:39 -0600 Subject: Fixed DT failure Description: Added a missing return statement to a non-void function. Platforms tested: Linux/64 (jelly) Linux/32 (jam) Darwin (osx1010test) --- test/ohdr.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/ohdr.c b/test/ohdr.c index 43346a5..e886bf9 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -745,7 +745,7 @@ char *version_string(H5F_libver_t libver) { char *str = NULL; - str = (char *) malloc(20 * sizeof(char)); + str = (char *) HDmalloc(20); if (str == NULL) { fprintf(stderr, "Allocation failed\n"); @@ -772,6 +772,9 @@ char *version_string(H5F_libver_t libver) sprintf(str, "%ld", (long)libver); break; } /* end switch */ + + /* Return the formed version bound string */ + return(str); } /* end of version_string */ @@ -780,12 +783,16 @@ char *version_string(H5F_libver_t libver) * * Purpose: Exercise private object header behavior and routines * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * * Programmer: Robb Matzke * Tuesday, November 24, 1998 * + * Modification: + * - Added loop of combinations of low/high library format bounds + * (BMR, Feb 2018) + * *------------------------------------------------------------------------- */ int -- cgit v0.12 From 205d33f332bc6974b7698160ac6d399a36c93fcf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 14 Feb 2018 10:08:09 -0600 Subject: Cleanup overuse of include files --- test/chunk_info.c | 1 - test/dangle.c | 103 +- test/gen_cross.c | 45 +- test/gheap.c | 396 +++--- test/h5test.h | 5 + test/hyperslab.c | 412 +++---- test/istore.c | 500 ++++---- test/swmr.c | 1 - test/tattr.c | 96 +- test/testhdf5.h | 27 +- test/th5s.c | 272 ++-- test/ttsafe.h | 3 - testpar/t_cache.c | 2745 ++++++++++++++++++++--------------------- testpar/t_cache_image.c | 679 +++++----- testpar/t_pflush1.c | 113 +- testpar/t_pread.c | 73 +- testpar/t_shapesame.c | 1706 +++++++++++++------------ testpar/t_span_tree.c | 704 ++++++----- tools/test/perform/pio_perf.h | 25 +- tools/test/perform/sio_perf.h | 1 - 20 files changed, 3939 insertions(+), 3968 deletions(-) diff --git a/test/chunk_info.c b/test/chunk_info.c index 1f19963..e3006cc 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -21,7 +21,6 @@ */ -#include "hdf5.h" #include "h5test.h" #define PRINT_DATA diff --git a/test/dangle.c b/test/dangle.c index 1717d12..75e9c84 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -15,10 +15,9 @@ * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * - * Purpose: Test dangling IDs + * Purpose: Test dangling IDs */ #include "h5test.h" -#include "H5private.h" const char *FILENAME[] = { "dangle", @@ -32,17 +31,17 @@ const char *FILENAME[] = { #define TYPENAME "Type" #define ATTRNAME "Attribute" - + /*------------------------------------------------------------------------- - * Function: test_dangle_dataset + * Function: test_dangle_dataset * - * Purpose: Check for dangling dataset IDs causing problems on library + * Purpose: Check for dangling dataset IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -52,7 +51,7 @@ const char *FILENAME[] = { static int test_dangle_dataset(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t dsid; /* Dataset ID */ @@ -128,17 +127,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_group + * Function: test_dangle_group * - * Purpose: Check for dangling group IDs causing problems on library + * Purpose: Check for dangling group IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -148,7 +147,7 @@ error: static int test_dangle_group(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t gid; /* Group ID */ @@ -219,17 +218,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_datatype1 + * Function: test_dangle_datatype1 * - * Purpose: Check for dangling datatype IDs causing problems on library + * Purpose: Check for dangling datatype IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -239,7 +238,7 @@ error: static int test_dangle_datatype1(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t tid; /* Datatype ID */ @@ -315,17 +314,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_datatype2 + * Function: test_dangle_datatype2 * - * Purpose: Check for dangling datatype IDs causing problems on library + * Purpose: Check for dangling datatype IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 25, 2005 * * Modifications: @@ -335,7 +334,7 @@ error: static int test_dangle_datatype2(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t did; /* Dataset ID */ @@ -402,17 +401,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_attribute + * Function: test_dangle_attribute * - * Purpose: Check for dangling attribute IDs causing problems on library + * Purpose: Check for dangling attribute IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 18, 2003 * * Modifications: @@ -422,7 +421,7 @@ error: static int test_dangle_attribute(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t dsid; /* Dataset ID */ @@ -509,17 +508,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_force + * Function: test_dangle_force * - * Purpose: Shut down all danging IDs with generic file & ID routines, + * Purpose: Shut down all danging IDs with generic file & ID routines, * instead of letting library shut then down. * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, October 29, 2010 * *------------------------------------------------------------------------- @@ -527,7 +526,7 @@ error: static int test_dangle_force(void) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t gid, gid2; /* Group IDs */ hid_t dsid, dsid2; /* Dataset IDs */ @@ -625,7 +624,7 @@ test_dangle_force(void) /* Release object ID array */ HDfree(objs); - + PASSED(); return 0; @@ -635,16 +634,16 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Executes dangling ID tests + * Purpose: Executes dangling ID tests * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -654,7 +653,7 @@ error: int main(void) { - int nerrors=0; + int nerrors=0; /* Run tests w/weak file close */ puts("Testing dangling objects with weak file close:"); diff --git a/test/gen_cross.c b/test/gen_cross.c index cf3fc35..f7a1938 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -26,7 +26,6 @@ * worth keeping around for now. */ -#include #include "h5test.h" #define H5FILE_NAME "data.h5" @@ -79,7 +78,7 @@ int create_szip_dsets_float(hid_t fid, hid_t fsid, hid_t msid); int create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid); int create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid); - + /*------------------------------------------------------------------------- * Function: create_normal_dset * @@ -108,8 +107,8 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { - for (i = 0; i < NY; i++) - data[j][i] = ((float)(i + j + 1)) / 3; + for (i = 0; i < NY; i++) + data[j][i] = ((float)(i + j + 1)) / 3; } /* * 1/3 2/3 3/3 4/3 5/3 6/3 @@ -143,7 +142,7 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) TEST_ERROR - /* + /* * Close dataset */ if(H5Dclose(dataset) < 0) @@ -163,7 +162,7 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) TEST_ERROR - /* + /* * Close dataset */ if(H5Dclose(dataset) < 0) @@ -186,7 +185,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dsets_float * @@ -277,7 +276,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dsets_double * @@ -307,8 +306,8 @@ create_scale_offset_dsets_double(hid_t fid, hid_t fsid, hid_t msid) * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { - for (i = 0; i < NY; i++) - data[j][i] = ((double)(i + j + 1))/3; + for (i = 0; i < NY; i++) + data[j][i] = ((double)(i + j + 1))/3; } /* @@ -368,7 +367,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_char * @@ -467,7 +466,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_short * @@ -566,7 +565,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_int * @@ -596,8 +595,8 @@ create_scale_offset_dsets_int(hid_t fid, hid_t fsid, hid_t msid) * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { - for (i = 0; i < NY; i++) - data[j][i] = i + j; + for (i = 0; i < NY; i++) + data[j][i] = i + j; } /* * 0 1 2 3 4 5 @@ -665,7 +664,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_long_long * @@ -765,7 +764,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_fletcher_dsets_float * @@ -856,7 +855,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_deflate_dsets_float * @@ -957,7 +956,7 @@ error: } #ifdef H5_HAVE_FILTER_SZIP - + /*------------------------------------------------------------------------- * Function: create_szip_dsets_float * @@ -1049,7 +1048,7 @@ error: } #endif /* H5_HAVE_FILTER_SZIP */ - + /*------------------------------------------------------------------------- * Function: create_shuffle_dsets_float * @@ -1140,7 +1139,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_nbit_dsets_float * @@ -1225,7 +1224,7 @@ create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid) TEST_ERROR /* Now create a dataset with a big-endian type */ - if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) + if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) TEST_ERROR if((dataset = H5Dcreate2(fid, DATASETNAME23, datatype, fsid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -1252,7 +1251,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: main * diff --git a/test/gheap.c b/test/gheap.c index 7564afa..110255b 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -15,14 +15,12 @@ * Programmer: Robb Matzke * Tuesday, March 31, 1998 * - * Purpose: Tests the global heap. The global heap is the set of all - * collections but the collections are not related to one - * another by anything that appears in the file format. + * Purpose: Tests the global heap. The global heap is the set of all + * collections but the collections are not related to one + * another by anything that appears in the file format. */ #include "h5test.h" -#include "H5private.h" #include "H5ACprivate.h" -#include "H5Eprivate.h" #include "H5Fprivate.h" #include "H5Gprivate.h" #include "H5HGprivate.h" @@ -56,18 +54,18 @@ const char *FILENAME[] = { NULL }; - + /*------------------------------------------------------------------------- - * Function: test_1 + * Function: test_1 * - * Purpose: Writes a sequence of objects to the global heap where each - * object is larger than the one before. + * Purpose: Writes a sequence of objects to the global heap where each + * object is larger than the one before. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -77,16 +75,16 @@ const char *FILENAME[] = { static int test_1 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - uint8_t in[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + uint8_t in[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("monotonically increasing lengths"); @@ -97,11 +95,11 @@ test_1 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } /* @@ -110,37 +108,37 @@ test_1 (hid_t fapl) * be monotonically increasing. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = u + 1; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u); - if(status < 0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) { - H5_FAILED(); - puts(" Collection addresses are not monotonically increasing"); - nerrors++; - } + size = u + 1; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u); + if(status < 0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) { + H5_FAILED(); + puts(" Collection addresses are not monotonically increasing"); + nerrors++; + } } /* * Now try to read each object back. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = u + 1; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { - H5_FAILED(); - puts(" Unable to read object"); - nerrors++; - } else if(HDmemcmp(in, out, size)) { - H5_FAILED(); - puts(" Value read doesn't match value written"); - nerrors++; - } + size = u + 1; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { + H5_FAILED(); + puts(" Unable to read object"); + nerrors++; + } else if(HDmemcmp(in, out, size)) { + H5_FAILED(); + puts(" Value read doesn't match value written"); + nerrors++; + } } /* Release buffer */ @@ -155,25 +153,25 @@ test_1 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_2 + * Function: test_2 * - * Purpose: Writes a sequence of objects to the global heap where each - * object is smaller than the one before. + * Purpose: Writes a sequence of objects to the global heap where each + * object is smaller than the one before. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -183,15 +181,15 @@ error: static int test_2 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - uint8_t in[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + uint8_t in[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + int nerrors = 0; + char filename[1024]; TESTING("monotonically decreasing lengths"); @@ -202,43 +200,43 @@ test_2 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } /* * Write the objects, monotonically decreasing in length. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = GHEAP_TEST_NOBJS - u; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } + size = GHEAP_TEST_NOBJS - u; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } } /* * Now try to read each object back. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = GHEAP_TEST_NOBJS - u; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { - H5_FAILED(); - puts(" Unable to read object"); - nerrors++; - } else if (memcmp (in, out, size)) { - H5_FAILED(); - puts(" Value read doesn't match value written"); - nerrors++; - } + size = GHEAP_TEST_NOBJS - u; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { + H5_FAILED(); + puts(" Unable to read object"); + nerrors++; + } else if (memcmp (in, out, size)) { + H5_FAILED(); + puts(" Value read doesn't match value written"); + nerrors++; + } } /* Release buffer */ @@ -253,25 +251,25 @@ test_2 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_3 + * Function: test_3 * - * Purpose: Creates a few global heap objects and then removes them all. - * The collection should also be removed. + * Purpose: Creates a few global heap objects and then removes them all. + * The collection should also be removed. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -281,15 +279,15 @@ test_2 (hid_t fapl) static int test_3 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("complete object removal"); @@ -300,34 +298,34 @@ test_3 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[2], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } /* Create some stuff */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = u % 30 + 100; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); - if (status<0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } + size = u % 30 + 100; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); + if (status<0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } } /* Remove everything */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u); - if (status<0) { - H5_FAILED(); - puts(" Unable to remove object"); - nerrors++; - } + status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u); + if (status<0) { + H5_FAILED(); + puts(" Unable to remove object"); + nerrors++; + } } /* Release buffer */ @@ -342,26 +340,26 @@ test_3 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_4 + * Function: test_4 * - * Purpose: Tests the H5HG_remove() feature by writing lots of objects - * and occassionally removing some. When we're done they're all - * removed. + * Purpose: Tests the H5HG_remove() feature by writing lots of objects + * and occassionally removing some. When we're done they're all + * removed. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -371,15 +369,15 @@ test_3 (hid_t fapl) static int test_4 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("partial object removal"); @@ -390,40 +388,40 @@ test_4 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[3], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - /* Insert */ - size = u % 30 + 100; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); - if (status<0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } - - /* - * Remove every third one beginning with the second, but after the - * next one has already been inserted. That is, insert A, B, C; - * remove B, insert D, E, F; remove E; etc. - */ - if(1 == (u % 3)) { - H5Eclear2(H5E_DEFAULT); - status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1); - if (status<0) { - H5_FAILED(); - puts(" Unable to remove object"); - nerrors++; - } - HDmemset(obj + u - 1, 0, sizeof *obj); - } + /* Insert */ + size = u % 30 + 100; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); + if (status<0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } + + /* + * Remove every third one beginning with the second, but after the + * next one has already been inserted. That is, insert A, B, C; + * remove B, insert D, E, F; remove E; etc. + */ + if(1 == (u % 3)) { + H5Eclear2(H5E_DEFAULT); + status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1); + if (status<0) { + H5_FAILED(); + puts(" Unable to remove object"); + nerrors++; + } + HDmemset(obj + u - 1, 0, sizeof *obj); + } } /* Release buffer */ @@ -438,27 +436,27 @@ test_4 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_ooo_indices + * Function: test_ooo_indices * - * Purpose: Tests that indices can be stored out of order. This can + * Purpose: Tests that indices can be stored out of order. This can * happen when the indices "wrap around" due to many * insertions and deletions (for example, from rewriting a * VL dataset). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Monday, October 26, 2009 * * Modifications: @@ -468,13 +466,13 @@ test_4 (hid_t fapl) static int test_ooo_indices(hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - unsigned i, j; - H5HG_t *obj = NULL; - herr_t status; - int nerrors=0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + unsigned i, j; + H5HG_t *obj = NULL; + herr_t status; + int nerrors=0; + char filename[1024]; TESTING("out of order indices"); @@ -552,24 +550,24 @@ test_ooo_indices(hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } /* end test_ooo_indices */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests global heap. + * Purpose: Tests global heap. * - * Return: Success: zero + * Return: Success: zero * - * Failure: non-zero + * Failure: non-zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -579,8 +577,8 @@ test_ooo_indices(hid_t fapl) int main (void) { - int nerrors=0; - hid_t fapl; + int nerrors=0; + hid_t fapl; h5_reset(); fapl = h5_fileaccess(); diff --git a/test/h5test.h b/test/h5test.h index ce5c64d..8e87192 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -20,8 +20,13 @@ #ifndef _H5TEST_H #define _H5TEST_H +/* + * Include required headers. This file tests internal library functions, + * so we include the private headers here. + */ #include "hdf5.h" #include "H5private.h" +#include "H5Eprivate.h" /* * Predefined test verbosity levels. diff --git a/test/hyperslab.c b/test/hyperslab.c index c28d872..feb96bd 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -11,110 +11,108 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke - * Friday, October 10, 1997 +/* Programmer: Robb Matzke + * Friday, October 10, 1997 * - * Purpose: Hyperslab operations are rather complex, so this file - * attempts to test them extensively so we can be relatively - * sure they really work. We only test 1d, 2d, and 3d cases - * because testing general dimensionalities would require us to - * rewrite much of the hyperslab stuff. + * Purpose: Hyperslab operations are rather complex, so this file + * attempts to test them extensively so we can be relatively + * sure they really work. We only test 1d, 2d, and 3d cases + * because testing general dimensionalities would require us to + * rewrite much of the hyperslab stuff. */ #include "h5test.h" -#include "H5private.h" -#include "H5Eprivate.h" #include "H5VMprivate.h" -#define TEST_SMALL 0x0001 -#define TEST_MEDIUM 0x0002 +#define TEST_SMALL 0x0001 +#define TEST_MEDIUM 0x0002 -#define VARIABLE_SRC 0 -#define VARIABLE_DST 1 -#define VARIABLE_BOTH 2 +#define VARIABLE_SRC 0 +#define VARIABLE_DST 1 +#define VARIABLE_BOTH 2 #define ARRAY_FILL_SIZE 4 #define ARRAY_OFFSET_NDIMS 3 - + /*------------------------------------------------------------------------- - * Function: init_full + * Function: init_full * - * Purpose: Initialize full array. + * Purpose: Initialize full array. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ static unsigned init_full(uint8_t *array, size_t nx, size_t ny, size_t nz) { - uint8_t acc = 128; - unsigned total = 0; - size_t i, j, k; + uint8_t acc = 128; + unsigned total = 0; + size_t i, j, k; for(i = 0; i < nx; i++) - for(j = 0; j < ny; j++) - for(k = 0; k < nz; k++) { - total += acc; - *array = acc; - acc++; - array++; - } /* end for */ + for(j = 0; j < ny; j++) + for(k = 0; k < nz; k++) { + total += acc; + *array = acc; + acc++; + array++; + } /* end for */ return total; } /* end init_full() */ - + /*------------------------------------------------------------------------- - * Function: print_array + * Function: print_array * - * Purpose: Prints the values in an array + * Purpose: Prints the values in an array * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ static void print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) { - size_t i, j, k; + size_t i, j, k; for(i = 0; i < nx; i++) { - if(nz > 1) - printf("i=%lu:\n", (unsigned long)i); - else - printf("%03lu:", (unsigned long)i); - - for(j = 0; j < ny; j++) { - if(nz > 1) - printf("%03lu:", (unsigned long)j); - for(k = 0; k < nz; k++) - printf(" %3d", *array++); - if(nz > 1) - printf("\n"); - } /* end for */ - printf("\n"); + if(nz > 1) + printf("i=%lu:\n", (unsigned long)i); + else + printf("%03lu:", (unsigned long)i); + + for(j = 0; j < ny; j++) { + if(nz > 1) + printf("%03lu:", (unsigned long)j); + for(k = 0; k < nz; k++) + printf(" %3d", *array++); + if(nz > 1) + printf("\n"); + } /* end for */ + printf("\n"); } /* end for */ } /* end print_array() */ - + /*------------------------------------------------------------------------- - * Function: print_ref + * Function: print_ref * - * Purpose: Prints the reference value + * Purpose: Prints the reference value * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: + * Failure: * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ @@ -131,37 +129,37 @@ print_ref(size_t nx, size_t ny, size_t nz) } /* end if */ } /* end print_ref() */ - + /*------------------------------------------------------------------------- - * Function: test_fill + * Function: test_fill * - * Purpose: Tests the H5VM_hyper_fill() function. + * Purpose: Tests the H5VM_hyper_fill() function. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_fill(size_t nx, size_t ny, size_t nz, - size_t di, size_t dj, size_t dk, - size_t ddx, size_t ddy, size_t ddz) + size_t di, size_t dj, size_t dk, + size_t ddx, size_t ddy, size_t ddz) { - uint8_t *dst = NULL; /*destination array */ - hsize_t hs_size[3]; /*hyperslab size */ - hsize_t dst_size[3]; /*destination total size */ + uint8_t *dst = NULL; /*destination array */ + hsize_t hs_size[3]; /*hyperslab size */ + hsize_t dst_size[3]; /*destination total size */ hsize_t dst_offset[3]; /*offset of hyperslab in dest */ - unsigned ref_value; /*reference value */ - unsigned acc; /*accumulator */ - size_t i, j, k, dx, dy, dz; /*counters */ + unsigned ref_value; /*reference value */ + unsigned acc; /*accumulator */ + size_t i, j, k, dx, dy, dz; /*counters */ size_t u, v, w; - unsigned ndims; /*hyperslab dimensionality */ - char dim[64], s[256]; /*temp string */ - unsigned fill_value; /*fill value */ + unsigned ndims; /*hyperslab dimensionality */ + char dim[64], s[256]; /*temp string */ + unsigned fill_value; /*fill value */ /* * Dimensionality. @@ -190,7 +188,7 @@ test_fill(size_t nx, size_t ny, size_t nz, /* Allocate array */ if(NULL == (dst = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz))) TEST_ERROR - + init_full(dst, nx, ny, nz); for(i = 0; i < nx; i += di) { @@ -279,52 +277,52 @@ error: return FAIL; } /* end test_fill() */ - + /*------------------------------------------------------------------------- - * Function: test_copy + * Function: test_copy * - * Purpose: Tests H5VM_hyper_copy(). + * Purpose: Tests H5VM_hyper_copy(). * - * The NX, NY, and NZ arguments are the size for the source and - * destination arrays. You may pass zero for NZ or for NY and - * NZ to test the 2-d and 1-d cases respectively. + * The NX, NY, and NZ arguments are the size for the source and + * destination arrays. You may pass zero for NZ or for NY and + * NZ to test the 2-d and 1-d cases respectively. * - * A hyperslab is copied from/to (depending on MODE) various - * places in SRC and DST beginning at 0,0,0 and increasing - * location by DI,DJ,DK in the x, y, and z directions. + * A hyperslab is copied from/to (depending on MODE) various + * places in SRC and DST beginning at 0,0,0 and increasing + * location by DI,DJ,DK in the x, y, and z directions. * - * For each hyperslab location, various sizes of hyperslabs are - * tried beginning with 1x1x1 and increasing the size in each - * dimension by DDX,DDY,DDZ. + * For each hyperslab location, various sizes of hyperslabs are + * tried beginning with 1x1x1 and increasing the size in each + * dimension by DDX,DDY,DDZ. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ static herr_t test_copy(int mode, - size_t nx, size_t ny, size_t nz, - size_t di, size_t dj, size_t dk, - size_t ddx, size_t ddy, size_t ddz) + size_t nx, size_t ny, size_t nz, + size_t di, size_t dj, size_t dk, + size_t ddx, size_t ddy, size_t ddz) { - uint8_t *src = NULL; /*source array */ - uint8_t *dst = NULL; /*destination array */ - hsize_t hs_size[3]; /*hyperslab size */ - hsize_t dst_size[3]; /*destination total size */ - hsize_t src_size[3]; /*source total size */ - hsize_t dst_offset[3]; /*offset of hyperslab in dest */ + uint8_t *src = NULL; /*source array */ + uint8_t *dst = NULL; /*destination array */ + hsize_t hs_size[3]; /*hyperslab size */ + hsize_t dst_size[3]; /*destination total size */ + hsize_t src_size[3]; /*source total size */ + hsize_t dst_offset[3]; /*offset of hyperslab in dest */ hsize_t src_offset[3]; /*offset of hyperslab in source */ - unsigned ref_value; /*reference value */ - unsigned acc; /*accumulator */ - hsize_t i, j, k, dx, dy, dz; /*counters */ + unsigned ref_value; /*reference value */ + unsigned acc; /*accumulator */ + hsize_t i, j, k, dx, dy, dz; /*counters */ hsize_t u, v, w; - unsigned ndims; /*hyperslab dimensionality */ - char dim[64], s[256]; /*temp string */ + unsigned ndims; /*hyperslab dimensionality */ + char dim[64], s[256]; /*temp string */ const char *sub; /* @@ -493,7 +491,7 @@ test_copy(int mode, (unsigned long)dy, (unsigned long)dz); print_ref(nx, ny, nz); - printf("\n Destination array is:\n"); + printf("\n Destination array is:\n"); print_array(dst, nx, ny, nz); } /* end if */ goto error; @@ -535,7 +533,7 @@ test_copy(int mode, (unsigned long)dy, (unsigned long)dz); print_ref(nx, ny, nz); - printf("\n Destination array is:\n"); + printf("\n Destination array is:\n"); print_array(dst, nx, ny, nz); } /* end if */ goto error; @@ -563,38 +561,38 @@ error: return FAIL; } /* end test_copy() */ - + /*------------------------------------------------------------------------- - * Function: test_multifill + * Function: test_multifill * - * Purpose: Tests the H5VM_stride_copy() function by using it to fill a - * hyperslab by replicating a multi-byte sequence. This might - * be useful to initialize an array of structs with a default - * struct value, or to initialize an array of floating-point - * values with a default bit-pattern. + * Purpose: Tests the H5VM_stride_copy() function by using it to fill a + * hyperslab by replicating a multi-byte sequence. This might + * be useful to initialize an array of structs with a default + * struct value, or to initialize an array of floating-point + * values with a default bit-pattern. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_multifill(size_t nx) { - hsize_t size; - hsize_t src_stride; - hsize_t dst_stride; - char s[64]; + hsize_t size; + hsize_t src_stride; + hsize_t dst_stride; + char s[64]; struct a_struct { int left; double mid; int right; } fill, *src = NULL, *dst = NULL; - hsize_t i, j; + hsize_t i, j; printf("%-70s", "Testing multi-byte fill value"); fflush(stdout); @@ -615,7 +613,7 @@ test_multifill(size_t nx) } /* end for */ /* - * Describe the fill value. The zero stride says to read the same thing + * Describe the fill value. The zero stride says to read the same thing * over and over again. */ fill.left = 55555555; @@ -684,32 +682,32 @@ error: return FAIL; } /* end test_multifill() */ - + /*------------------------------------------------------------------------- - * Function: test_endian + * Function: test_endian * - * Purpose: Tests the H5VM_stride_copy() function by using it to copy an - * array of integers and swap the byte ordering from little - * endian to big endian or vice versa depending on the hardware. + * Purpose: Tests the H5VM_stride_copy() function by using it to copy an + * array of integers and swap the byte ordering from little + * endian to big endian or vice versa depending on the hardware. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_endian(size_t nx) { - uint8_t *src = NULL; /*source array */ - uint8_t *dst = NULL; /*destination array */ - hssize_t src_stride[2]; /*source strides */ - hssize_t dst_stride[2]; /*destination strides */ - hsize_t size[2]; /*size vector */ - hsize_t i, j; + uint8_t *src = NULL; /*source array */ + uint8_t *dst = NULL; /*destination array */ + hssize_t src_stride[2]; /*source strides */ + hssize_t dst_stride[2]; /*destination strides */ + hsize_t size[2]; /*size vector */ + hsize_t i, j; printf("%-70s", "Testing endian conversion by stride"); fflush(stdout); @@ -747,7 +745,7 @@ test_endian(size_t nx) printf(" i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j); printf(" Source array is:\n"); print_array(src, nx, (size_t)4, (size_t)1); - printf("\n Result is:\n"); + printf("\n Result is:\n"); print_array(dst, nx, (size_t)4, (size_t)1); } /* end if */ goto error; @@ -771,31 +769,31 @@ error: return FAIL; } /* end test_endian() */ - + /*------------------------------------------------------------------------- - * Function: test_transpose + * Function: test_transpose * - * Purpose: Copy a 2d array from here to there and transpose the elements - * as it's copied. + * Purpose: Copy a 2d array from here to there and transpose the elements + * as it's copied. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_transpose(size_t nx, size_t ny) { - int *src = NULL; - int *dst = NULL; - hsize_t src_stride[2], dst_stride[2]; - hsize_t size[2]; - char s[256]; - hsize_t i, j; + int *src = NULL; + int *dst = NULL; + hsize_t src_stride[2], dst_stride[2]; + hsize_t size[2]; + char s[256]; + hsize_t i, j; sprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx, (unsigned long)ny); @@ -843,7 +841,7 @@ test_transpose(size_t nx, size_t ny) printf(" %6d", src[i * ny + j]); printf("\n"); } /* end for */ - printf("\n Destination is:\n"); + printf("\n Destination is:\n"); for (i = 0; i < ny; i++) { printf("%3lu:", (unsigned long)i); for(j = 0; j < nx; j++) @@ -872,35 +870,35 @@ error: return FAIL; } /* end test_transpose() */ - + /*------------------------------------------------------------------------- - * Function: test_sub_super + * Function: test_sub_super * - * Purpose: Tests H5VM_stride_copy() to reduce the resolution of an image - * by copying half the pixels in the X and Y directions. Then - * we use the small image and duplicate every pixel to result in - * a 2x2 square. + * Purpose: Tests H5VM_stride_copy() to reduce the resolution of an image + * by copying half the pixels in the X and Y directions. Then + * we use the small image and duplicate every pixel to result in + * a 2x2 square. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Monday, October 13, 1997 + * Programmer: Robb Matzke + * Monday, October 13, 1997 * *------------------------------------------------------------------------- */ static herr_t test_sub_super(size_t nx, size_t ny) { - uint8_t *full = NULL; /*original image */ - uint8_t *half = NULL; /*image at 1/2 resolution */ - uint8_t *twice = NULL; /*2x2 pixels */ - hsize_t src_stride[4]; /*source stride info */ - hsize_t dst_stride[4]; /*destination stride info */ - hsize_t size[4]; /*number of sample points */ - hsize_t i, j; - char s[256]; + uint8_t *full = NULL; /*original image */ + uint8_t *half = NULL; /*image at 1/2 resolution */ + uint8_t *twice = NULL; /*2x2 pixels */ + hsize_t src_stride[4]; /*source stride info */ + hsize_t dst_stride[4]; /*destination stride info */ + hsize_t size[4]; /*number of sample points */ + hsize_t i, j; + char s[256]; sprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)(2 * nx), (unsigned long)(2 * ny), @@ -942,7 +940,7 @@ test_sub_super(size_t nx, size_t ny) (unsigned long)i, (unsigned long)j); printf(" full is:\n"); print_array(full, 2 * nx, 2 * ny, (size_t)1); - printf("\n half is:\n"); + printf("\n half is:\n"); print_array(half, nx, ny, (size_t)1); } /* end if */ goto error; @@ -1005,7 +1003,7 @@ test_sub_super(size_t nx, size_t ny) AT(); printf(" %s\n Half is:\n", s); print_array(half, nx, ny, (size_t)1); - printf("\n Twice is:\n"); + printf("\n Twice is:\n"); print_array(twice, 2 * nx, 2 * ny, (size_t)1); } /* end if */ goto error; @@ -1032,20 +1030,20 @@ error: return FAIL; } /* test_sub_super() */ - + /*------------------------------------------------------------------------- - * Function: test_array_fill + * Function: test_array_fill * - * Purpose: Tests H5VM_array_fill routine by copying a multibyte value + * Purpose: Tests H5VM_array_fill routine by copying a multibyte value * (an array of ints, in our case) into all the elements of an * array. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Quincey Koziol - * Monday, April 21, 2003 + * Programmer: Quincey Koziol + * Monday, April 21, 2003 * *------------------------------------------------------------------------- */ @@ -1054,8 +1052,8 @@ test_array_fill(size_t lo, size_t hi) { int *dst = NULL; /* Destination */ int src[ARRAY_FILL_SIZE]; /* Source to duplicate */ - size_t u, v, w; /* Local index variables */ - char s[256]; + size_t u, v, w; /* Local index variables */ + char s[256]; sprintf(s, "array filling %4lu-%-4lu elements", (unsigned long)lo,(unsigned long)hi); TESTING(s); @@ -1093,20 +1091,20 @@ error: return FAIL; } /* end test_array_fill() */ - + /*------------------------------------------------------------------------- - * Function: test_array_offset_n_calc + * Function: test_array_offset_n_calc * - * Purpose: Tests H5VM_array_offset and H5VM_array_calc routines by comparing + * Purpose: Tests H5VM_array_offset and H5VM_array_calc routines by comparing * computed array offsets against calculated ones and then going * back to the coordinates from the offset and checking those. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Quincey Koziol - * Monday, April 21, 2003 + * Programmer: Quincey Koziol + * Monday, April 21, 2003 * *------------------------------------------------------------------------- */ @@ -1116,11 +1114,11 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z) hsize_t *a = NULL; hsize_t *temp_a; /* Array for stored calculated offsets */ hsize_t off; /* Offset in array */ - size_t u, v, w; /* Local index variables */ + size_t u, v, w; /* Local index variables */ hsize_t dims[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of array to check */ hsize_t coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates to check offset of */ hsize_t new_coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of offset */ - char s[256]; + char s[256]; sprintf(s, "array offset %4lux%4lux%4lu elements", (unsigned long)z,(unsigned long)y,(unsigned long)x); TESTING(s); @@ -1178,29 +1176,29 @@ error: return FAIL; } /* end test_array_offset_n_calc() */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test various hyperslab operations. Give the words - * `small' and/or `medium' on the command line or only `small' - * is assumed. + * Purpose: Test various hyperslab operations. Give the words + * `small' and/or `medium' on the command line or only `small' + * is assumed. * - * Return: Success: exit(EXIT_SUCCESS) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(EXIT_FAILURE) + * Failure: exit(EXIT_FAILURE) * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ int main(int argc, char *argv[]) { - herr_t status; - int nerrors = 0; - unsigned size_of_test; + herr_t status; + int nerrors = 0; + unsigned size_of_test; /* Parse arguments or assume `small' & `medium' */ if(1 == argc) diff --git a/test/istore.c b/test/istore.c index c401e87..f100fe4 100644 --- a/test/istore.c +++ b/test/istore.c @@ -11,24 +11,22 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke - * Wednesday, October 15, 1997 +/* Programmer: Robb Matzke + * Wednesday, October 15, 1997 * - * Purpose: Tests various aspects of indexed raw data storage. + * Purpose: Tests various aspects of indexed raw data storage. */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "h5test.h" -#include "H5private.h" + #include "H5Dprivate.h" -#include "H5Eprivate.h" #include "H5Iprivate.h" #include "H5Pprivate.h" #include "H5Fpkg.h" #include "H5Gprivate.h" #include "H5Oprivate.h" -#include "H5Pprivate.h" #include "H5VMprivate.h" const char *FILENAME[] = { @@ -37,9 +35,9 @@ const char *FILENAME[] = { }; -#define TEST_SMALL 0x0001 -#define TEST_MEDIUM 0x0002 -#define TEST_LARGE 0x0004 +#define TEST_SMALL 0x0001 +#define TEST_MEDIUM 0x0002 +#define TEST_LARGE 0x0004 /* The datatype of the dataset operated on by this test */ #define TEST_DATATYPE H5T_NATIVE_UCHAR @@ -50,19 +48,19 @@ const char *FILENAME[] = { hsize_t chunk_dims[H5O_LAYOUT_NDIMS]; hsize_t zero[H5O_LAYOUT_NDIMS]; - + /*------------------------------------------------------------------------- - * Function: is_sparse + * Function: is_sparse * - * Purpose: Determines if the file system of the current working - * directory supports holes. + * Purpose: Determines if the file system of the current working + * directory supports holes. * - * Return: Success: Non-zero if holes are supported; zero - * otherwise. + * Return: Success: Non-zero if holes are supported; zero + * otherwise. * - * Failure: zero + * Failure: zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, July 15, 1998 * *------------------------------------------------------------------------- @@ -70,8 +68,8 @@ hsize_t zero[H5O_LAYOUT_NDIMS]; static int is_sparse(void) { - int fd; - h5_stat_t sb; + int fd; + h5_stat_t sb; 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; @@ -86,16 +84,16 @@ is_sparse(void) #endif } - + /*------------------------------------------------------------------------- - * Function: print_array + * Function: print_array * - * Purpose: Prints the values in an array + * Purpose: Prints the values in an array * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * * Modifications: * @@ -104,41 +102,41 @@ is_sparse(void) static void print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) { - size_t i, j, k; + size_t i, j, k; for (i = 0; i < nx; i++) { - if (nz > 1) { - fprintf(stderr,"i=%lu:\n", (unsigned long)i); - } else { - fprintf(stderr,"%03lu:", (unsigned long)i); - } - - for (j = 0; j < ny; j++) { - if (nz > 1) - fprintf(stderr,"%03lu:", (unsigned long)j); - for (k = 0; k < nz; k++) { - fprintf(stderr," %3d", *array++); - } - if (nz > 1) - fprintf(stderr,"\n"); - } - fprintf(stderr,"\n"); + if (nz > 1) { + fprintf(stderr,"i=%lu:\n", (unsigned long)i); + } else { + fprintf(stderr,"%03lu:", (unsigned long)i); + } + + for (j = 0; j < ny; j++) { + if (nz > 1) + fprintf(stderr,"%03lu:", (unsigned long)j); + for (k = 0; k < nz; k++) { + fprintf(stderr," %3d", *array++); + } + if (nz > 1) + fprintf(stderr,"\n"); + } + fprintf(stderr,"\n"); } } - + /*------------------------------------------------------------------------- - * Function: new_object + * Function: new_object * - * Purpose: Creates a new object that refers to a indexed storage of raw - * data. No raw data is stored. + * Purpose: Creates a new object that refers to a indexed storage of raw + * data. No raw data is stored. * - * Return: Success: ID of dataset + * Return: Success: ID of dataset * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * Converted to use datasets instead of directly messing with @@ -182,19 +180,19 @@ error: return -1; } - + /*------------------------------------------------------------------------- - * Function: test_create + * Function: test_create * - * Purpose: Creates a named object that refers to indexed storage of raw - * data. No raw data is stored. + * Purpose: Creates a named object that refers to indexed storage of raw + * data. No raw data is stored. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * @@ -217,9 +215,9 @@ test_create(hid_t f, const char *prefix) dims[u] = my_chunk_dims[u] = 2; /* Create chunked dataset of this dimensionality */ - HDsnprintf(name, sizeof name, "%s_%02u", prefix, u); - if ((dataset=new_object(f, name, (int)u, dims, my_chunk_dims)) < 0) - return FAIL; + HDsnprintf(name, sizeof name, "%s_%02u", prefix, u); + if ((dataset=new_object(f, name, (int)u, dims, my_chunk_dims)) < 0) + return FAIL; /* Close dataset created */ if(H5Dclose(dataset) < 0) @@ -230,20 +228,20 @@ test_create(hid_t f, const char *prefix) return SUCCEED; } - + /*------------------------------------------------------------------------- - * Function: test_extend + * Function: test_extend * - * Purpose: Creates an empty object and then writes to it in such a way - * as to always extend the object's domain without creating - * holes and without causing the object to become concave. + * Purpose: Creates an empty object and then writes to it in such a way + * as to always extend the object's domain without creating + * holes and without causing the object to become concave. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * @@ -251,35 +249,35 @@ test_create(hid_t f, const char *prefix) */ static herr_t test_extend(hid_t f, const char *prefix, - size_t nx, size_t ny, size_t nz) + size_t nx, size_t ny, size_t nz) { hid_t dataset; /* Dataset ID */ hid_t fspace; /* Dataset's file dataspace */ hid_t mspace; /* Dataset's memory dataspace */ - size_t i, j, k, ctr; - int ndims; - uint8_t *buf = NULL, *check = NULL, *whole = NULL; - char dims[64], s[256], name[256]; - hsize_t offset[3]; - hsize_t max_corner[3]; - hsize_t size[3]; - hsize_t whole_size[3]; - hsize_t nelmts; + size_t i, j, k, ctr; + int ndims; + uint8_t *buf = NULL, *check = NULL, *whole = NULL; + char dims[64], s[256], name[256]; + hsize_t offset[3]; + hsize_t max_corner[3]; + hsize_t size[3]; + hsize_t whole_size[3]; + hsize_t nelmts; if (!nz) { - if (!ny) { - ndims = 1; - ny = nz = 1; - sprintf(dims, "%lu", (unsigned long) nx); - } else { - ndims = 2; - nz = 1; - sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); - } + if (!ny) { + ndims = 1; + ny = nz = 1; + sprintf(dims, "%lu", (unsigned long) nx); } else { - ndims = 3; - sprintf(dims, "%lux%lux%lu", - (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); + ndims = 2; + nz = 1; + sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); + } + } else { + ndims = 3; + sprintf(dims, "%lux%lux%lu", + (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); } sprintf(s, "istore extend: %s", dims); @@ -298,57 +296,57 @@ test_extend(hid_t f, const char *prefix, /* Build the new empty object */ sprintf(name, "%s_%s", prefix, dims); if ((dataset=new_object(f, name, ndims, whole_size, whole_size)) < 0) { - fprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name); - goto error; + fprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name); + goto error; } /* Get dataset's dataspace */ if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR; for (ctr = 0; - H5VM_vector_lt_u((unsigned)ndims, max_corner, whole_size); - ctr++) { - - /* Size and location */ - if (0 == ctr) { - offset[0] = offset[1] = offset[2] = 0; - size[0] = size[1] = size[2] = 1; - nelmts = 1; - } else { - for (i=0, nelmts=1; i<(size_t)ndims; i++) { - if (ctr % (size_t)ndims == i) { - offset[i] = max_corner[i]; - size[i] = MIN(1, whole_size[i] - offset[i]); - } else { - offset[i] = 0; - size[i] = max_corner[i]; - } - nelmts *= size[i]; - } - } + H5VM_vector_lt_u((unsigned)ndims, max_corner, whole_size); + ctr++) { + + /* Size and location */ + if (0 == ctr) { + offset[0] = offset[1] = offset[2] = 0; + size[0] = size[1] = size[2] = 1; + nelmts = 1; + } else { + for (i=0, nelmts=1; i<(size_t)ndims; i++) { + if (ctr % (size_t)ndims == i) { + offset[i] = max_corner[i]; + size[i] = MIN(1, whole_size[i] - offset[i]); + } else { + offset[i] = 0; + size[i] = max_corner[i]; + } + nelmts *= size[i]; + } + } #if 0 - if (0 == ctr) - fprintf(stderr,"\n"); - fprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]); - if (ndims > 1) - fprintf(stderr,",%ld", (long)offset[1]); - if (ndims > 2) - fprintf(stderr,",%ld", (long)offset[2]); - fprintf(stderr,"), size=(%lu", (unsigned long)size[0]); - if (ndims > 1) - fprintf(stderr,",%lu", (unsigned long)size[1]); - if (ndims > 2) - fprintf(stderr,",%lu", (unsigned long)size[2]); - fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s"); - if (0 == nelmts) - fprintf(stderr," *SKIPPED*"); - fprintf(stderr,"\n"); + if (0 == ctr) + fprintf(stderr,"\n"); + fprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]); + if (ndims > 1) + fprintf(stderr,",%ld", (long)offset[1]); + if (ndims > 2) + fprintf(stderr,",%ld", (long)offset[2]); + fprintf(stderr,"), size=(%lu", (unsigned long)size[0]); + if (ndims > 1) + fprintf(stderr,",%lu", (unsigned long)size[1]); + if (ndims > 2) + fprintf(stderr,",%lu", (unsigned long)size[2]); + fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s"); + if (0 == nelmts) + fprintf(stderr," *SKIPPED*"); + fprintf(stderr,"\n"); #endif - /* Fill the source array */ - if (0 == nelmts) continue; - HDmemset(buf, (signed)(128+ctr), (size_t)nelmts); + /* Fill the source array */ + if (0 == nelmts) continue; + HDmemset(buf, (signed)(128+ctr), (size_t)nelmts); /* Create dataspace for selection in memory */ if((mspace=H5Screate_simple(1,&nelmts,NULL)) < 0) TEST_ERROR; @@ -356,72 +354,72 @@ test_extend(hid_t f, const char *prefix, /* Select region in file dataspace */ if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR; - /* Write to disk */ - if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { - H5_FAILED(); - fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr); - goto error; - } - - /* Read from disk */ - HDmemset(check, 0xff, (size_t)nelmts); - if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) { - H5_FAILED(); - fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr); - goto error; - } - if (HDmemcmp(buf, check, (size_t)nelmts)) { - H5_FAILED(); - fprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr); - fprintf(stderr," Wrote:\n"); - print_array(buf, (size_t)size[0], (size_t)size[1], - (size_t)size[2]); - fprintf(stderr," Read:\n"); - print_array(check, (size_t)size[0], (size_t)size[1], - (size_t)size[2]); - goto error; - } + /* Write to disk */ + if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { + H5_FAILED(); + fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr); + goto error; + } + + /* Read from disk */ + HDmemset(check, 0xff, (size_t)nelmts); + if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) { + H5_FAILED(); + fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr); + goto error; + } + if (HDmemcmp(buf, check, (size_t)nelmts)) { + H5_FAILED(); + fprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr); + fprintf(stderr," Wrote:\n"); + print_array(buf, (size_t)size[0], (size_t)size[1], + (size_t)size[2]); + fprintf(stderr," Read:\n"); + print_array(check, (size_t)size[0], (size_t)size[1], + (size_t)size[2]); + goto error; + } /* Close memory dataspace */ if(H5Sclose(mspace) < 0) TEST_ERROR; - /* Write to `whole' buffer for later checking */ - H5VM_hyper_copy((unsigned)ndims, size, - whole_size, offset, whole, /*dst*/ - size, H5VM_ZERO, buf); /*src*/ + /* Write to `whole' buffer for later checking */ + H5VM_hyper_copy((unsigned)ndims, size, + whole_size, offset, whole, /*dst*/ + size, H5VM_ZERO, buf); /*src*/ - /* Update max corner */ - for (i=0; i<(size_t)ndims; i++) - max_corner[i] = MAX(max_corner[i], offset[i]+size[i]); + /* Update max corner */ + for (i=0; i<(size_t)ndims; i++) + max_corner[i] = MAX(max_corner[i], offset[i]+size[i]); } /* Now read the entire array back out and check it */ HDmemset(buf, 0xff, nx * ny * nz); if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) { - H5_FAILED(); - fprintf(stderr," Read failed for whole array.\n"); - goto error; + H5_FAILED(); + fprintf(stderr," Read failed for whole array.\n"); + goto error; } for (i=0; i 1) { - fprintf(stderr,", j=%lu", (unsigned long)j); - } - if (ndims > 2) { - fprintf(stderr,", k=%lu", (unsigned long)k); - } - fprintf(stderr,"\n Check array is:\n"); - print_array(whole, nx, ny, nz); - fprintf(stderr," Value read is:\n"); - print_array(buf, nx, ny, nz); - goto error; - } - } - } + for (j=0; j 1) { + fprintf(stderr,", j=%lu", (unsigned long)j); + } + if (ndims > 2) { + fprintf(stderr,", k=%lu", (unsigned long)k); + } + fprintf(stderr,"\n Check array is:\n"); + print_array(whole, nx, ny, nz); + fprintf(stderr," Value read is:\n"); + print_array(buf, nx, ny, nz); + goto error; + } + } + } } /* Close dataset's dataspace */ @@ -445,19 +443,19 @@ error: return FAIL; } - + /*------------------------------------------------------------------------- - * Function: test_sparse + * Function: test_sparse * - * Purpose: Creates a sparse matrix consisting of NBLOCKS randomly placed - * blocks each of size NX,NY,NZ. + * Purpose: Creates a sparse matrix consisting of NBLOCKS randomly placed + * blocks each of size NX,NY,NZ. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Wednesday, October 22, 1997 + * Programmer: Robb Matzke + * Wednesday, October 22, 1997 * * Modifications: * @@ -465,34 +463,34 @@ error: */ static herr_t test_sparse(hid_t f, const char *prefix, size_t nblocks, - size_t nx, size_t ny, size_t nz, int skip_test) + size_t nx, size_t ny, size_t nz, int skip_test) { hid_t dataset; /* Dataset ID */ hid_t fspace; /* Dataset's file dataspace */ hid_t mspace; /* Dataset's memory dataspace */ - int ndims; - hsize_t ctr; - char dims[64], s[256], name[256]; - hsize_t offset[3]; - hsize_t size[3], total = 0; - uint8_t *buf = NULL; - hsize_t whole_size[3]; /* Size of dataset's dataspace */ + int ndims; + hsize_t ctr; + char dims[64], s[256], name[256]; + hsize_t offset[3]; + hsize_t size[3], total = 0; + uint8_t *buf = NULL; + hsize_t whole_size[3]; /* Size of dataset's dataspace */ size_t u; /* Local index variable */ if (!nz) { - if (!ny) { - ndims = 1; - ny = nz = 1; - sprintf(dims, "%lu", (unsigned long) nx); - } else { - ndims = 2; - nz = 1; - sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); - } + if (!ny) { + ndims = 1; + ny = nz = 1; + sprintf(dims, "%lu", (unsigned long) nx); } else { - ndims = 3; - sprintf(dims, "%lux%lux%lu", - (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); + ndims = 2; + nz = 1; + sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); + } + } else { + ndims = 3; + sprintf(dims, "%lux%lux%lu", + (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); } sprintf(s, "istore sparse: %s", dims); @@ -516,8 +514,8 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, /* Build the new empty object */ sprintf(name, "%s_%s", prefix, dims); if ((dataset=new_object(f, name, ndims, whole_size, chunk_dims)) < 0) { - printf(" Cannot create %u-d object `%s'\n", ndims, name); - goto error; + printf(" Cannot create %u-d object `%s'\n", ndims, name); + goto error; } /* Get dataset's dataspace */ @@ -534,29 +532,29 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, /* Select region in file dataspace */ if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR; - /* write to disk */ - if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { - H5_FAILED(); - printf(" Write failed: ctr=%lu\n", (unsigned long)ctr); - printf(" offset=(%lu", (unsigned long) (offset[0])); - if (ndims > 1) - printf(",%lu", (unsigned long) (offset[1])); - if (ndims > 2) - printf(",%lu", (unsigned long) (offset[2])); - printf("), size=(%lu", (unsigned long) (size[0])); - if (ndims > 1) - printf(",%lu", (unsigned long) (size[1])); - if (ndims > 2) - printf(",%lu", (unsigned long) (size[2])); - printf(")\n"); - goto error; - } - total += nx * ny * nz; + /* write to disk */ + if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { + H5_FAILED(); + printf(" Write failed: ctr=%lu\n", (unsigned long)ctr); + printf(" offset=(%lu", (unsigned long) (offset[0])); + if (ndims > 1) + printf(",%lu", (unsigned long) (offset[1])); + if (ndims > 2) + printf(",%lu", (unsigned long) (offset[2])); + printf("), size=(%lu", (unsigned long) (size[0])); + if (ndims > 1) + printf(",%lu", (unsigned long) (size[1])); + if (ndims > 2) + printf(",%lu", (unsigned long) (size[2])); + printf(")\n"); + goto error; + } + total += nx * ny * nz; #if 0 - HDfprintf(stderr,"ctr: ctr=%Zu, total=%Zu\n", ctr, total); + HDfprintf(stderr,"ctr: ctr=%Zu, total=%Zu\n", ctr, total); #endif - /* We don't test reading yet.... */ + /* We don't test reading yet.... */ } /* Close memory dataspace */ @@ -577,18 +575,18 @@ error: return FAIL; } - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests indexed storage stuff. + * Purpose: Tests indexed storage stuff. * - * Return: Success: exit(EXIT_SUCCESS) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(EXIT_FAILURE) + * Failure: exit(EXIT_FAILURE) * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * @@ -597,12 +595,12 @@ error: int main(int argc, char *argv[]) { - hid_t fapl=-1, file=-1, fcpl=-1; - herr_t status; - int nerrors = 0; - unsigned size_of_test; + hid_t fapl=-1, file=-1, fcpl=-1; + herr_t status; + int nerrors = 0; + unsigned size_of_test; unsigned u; /* Local index variable */ - char filename[1024]; + char filename[1024]; int skip_test = 0; int has_sparse_support = 0; @@ -610,7 +608,7 @@ main(int argc, char *argv[]) if (1 == argc) { size_of_test = TEST_SMALL | TEST_MEDIUM | TEST_LARGE; } else { - int i; + int i; for (i = 1, size_of_test = 0; i < argc; i++) { if (!strcmp(argv[i], "small")) { size_of_test |= TEST_SMALL; diff --git a/test/swmr.c b/test/swmr.c index 3b1bd09..0b352e2 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -24,7 +24,6 @@ * *************************************************************/ -#include "hdf5.h" #include "h5test.h" #include "H5Iprivate.h" diff --git a/test/tattr.c b/test/tattr.c index 2d333e9..525898d 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -20,8 +20,6 @@ *************************************************************/ #include "testhdf5.h" -#include "h5test.h" -#include "hdf5.h" /* * This file needs to access private information from the H5O package. @@ -153,7 +151,7 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *op_data); - + /**************************************************************** ** ** test_attr_basic_write(): Test basic H5A (attribute) code. @@ -393,7 +391,7 @@ test_attr_basic_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_basic_write() */ - + /**************************************************************** ** ** test_attr_basic_read(): Test basic H5A (attribute) code. @@ -484,7 +482,7 @@ test_attr_basic_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_basic_read() */ - + /**************************************************************** ** ** test_attr_flush(): Test H5A (attribute) code for performing @@ -551,7 +549,7 @@ test_attr_flush(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_flush() */ - + /**************************************************************** ** ** test_attr_plist(): Test Attribute Creation Property Lists @@ -664,7 +662,7 @@ test_attr_plist(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_plist() */ - + /**************************************************************** ** ** test_attr_compound_write(): Test H5A (attribute) code. @@ -753,7 +751,7 @@ test_attr_compound_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_compound_write() */ - + /**************************************************************** ** ** test_attr_compound_read(): Test basic H5A (attribute) code. @@ -903,7 +901,7 @@ test_attr_compound_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_compound_read() */ - + /**************************************************************** ** ** test_attr_scalar_write(): Test scalar H5A (attribute) writing code. @@ -969,7 +967,7 @@ test_attr_scalar_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_scalar_write() */ - + /**************************************************************** ** ** test_attr_scalar_read(): Test scalar H5A (attribute) reading code. @@ -1040,7 +1038,7 @@ test_attr_scalar_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_scalar_read() */ - + /**************************************************************** ** ** test_attr_mult_write(): Test basic H5A (attribute) code. @@ -1161,7 +1159,7 @@ test_attr_mult_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_mult_write() */ - + /**************************************************************** ** ** test_attr_mult_read(): Test basic H5A (attribute) code. @@ -1383,7 +1381,7 @@ test_attr_mult_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_mult_read() */ - + /**************************************************************** ** ** attr_op1(): Attribute operator @@ -1423,7 +1421,7 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR return(ret); } /* end attr_op1() */ - + /**************************************************************** ** ** test_attr_iterate(): Test H5A (attribute) iterator code. @@ -1495,7 +1493,7 @@ test_attr_iterate(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_iterate() */ - + /**************************************************************** ** ** test_attr_delete(): Test H5A (attribute) code for deleting objects. @@ -1615,7 +1613,7 @@ test_attr_delete(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_delete() */ - + /**************************************************************** ** ** test_attr_dtype_shared(): Test H5A (attribute) code for using @@ -1792,7 +1790,7 @@ test_attr_dtype_shared(hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dtype_shared() */ - + /**************************************************************** ** ** test_attr_duplicate_ids(): Test operations with more than @@ -2037,7 +2035,7 @@ test_attr_duplicate_ids(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_duplicate_ids() */ - + /**************************************************************** ** ** test_attr_dense_verify(): Test basic H5A (attribute) code. @@ -2107,7 +2105,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) return(-1); } /* test_attr_dense_verify() */ - + /**************************************************************** ** ** test_attr_dense_create(): Test basic H5A (attribute) code. @@ -2238,7 +2236,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_create() */ - + /**************************************************************** ** ** test_attr_dense_open(): Test basic H5A (attribute) code. @@ -2377,7 +2375,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_open() */ - + /**************************************************************** ** ** test_attr_dense_delete(): Test basic H5A (attribute) code. @@ -2555,7 +2553,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_delete() */ - + /**************************************************************** ** ** test_attr_dense_rename(): Test basic H5A (attribute) code. @@ -2714,7 +2712,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_rename() */ - + /**************************************************************** ** ** test_attr_dense_unlink(): Test basic H5A (attribute) code. @@ -2844,7 +2842,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_unlink() */ - + /**************************************************************** ** ** test_attr_dense_limits(): Test basic H5A (attribute) code. @@ -3009,7 +3007,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_limits() */ - + /**************************************************************** ** ** test_attr_dense_dup_ids(): Test operations with multiple ID @@ -3532,7 +3530,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_dense_dup_ids() */ - + /**************************************************************** ** ** test_attr_big(): Test basic H5A (attribute) code. @@ -3802,7 +3800,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_big() */ - + /**************************************************************** ** ** test_attr_null_space(): Test basic H5A (attribute) code. @@ -4020,7 +4018,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_null_space() */ - + /**************************************************************** ** ** test_attr_deprec(): Test basic H5A (attribute) code. @@ -4129,7 +4127,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* test_attr_deprec() */ - + /**************************************************************** ** ** test_attr_many(): Test basic H5A (attribute) code. @@ -4258,7 +4256,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_many() */ - + /**************************************************************** ** ** test_attr_corder_create_empty(): Test basic H5A (attribute) code. @@ -4374,7 +4372,7 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_basic() */ - + /**************************************************************** ** ** test_attr_corder_create_compact(): Test basic H5A (attribute) code. @@ -4572,7 +4570,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_compact() */ - + /**************************************************************** ** ** test_attr_corder_create_dense(): Test basic H5A (attribute) code. @@ -4799,7 +4797,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_dense() */ - + /**************************************************************** ** ** test_attr_corder_create_reopen(): Test basic H5A (attribute) code. @@ -4907,7 +4905,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_create_reopen() */ - + /**************************************************************** ** ** test_attr_corder_transition(): Test basic H5A (attribute) code. @@ -5313,7 +5311,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_transition() */ - + /**************************************************************** ** ** test_attr_corder_delete(): Test basic H5A (attribute) code. @@ -5514,7 +5512,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_delete() */ - + /*------------------------------------------------------------------------- * Function: attr_info_by_idx_check * @@ -5661,7 +5659,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, return(-1); } /* end attr_info_by_idx_check() */ - + /**************************************************************** ** ** test_attr_info_by_idx(): Test basic H5A (attribute) code. @@ -5871,7 +5869,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_info_by_idx() */ - + /**************************************************************** ** ** test_attr_delete_by_idx(): Test basic H5A (attribute) code. @@ -6403,7 +6401,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_delete_by_idx() */ - + /**************************************************************** ** ** attr_iterate2_cb(): Revised attribute operator @@ -6477,7 +6475,7 @@ HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr); } /* end attr_iterate2_cb() */ #ifndef H5_NO_DEPRECATED_SYMBOLS - + /**************************************************************** ** ** attr_iterate1_cb(): Attribute operator @@ -6490,7 +6488,7 @@ attr_iterate1_cb(hid_t loc_id, const char *attr_name, void *_op_data) } /* end attr_iterate1_cb() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /*------------------------------------------------------------------------- * Function: attr_iterate2_fail_cb * @@ -6512,7 +6510,7 @@ attr_iterate2_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED * return(H5_ITER_ERROR); } /* end attr_iterate2_fail_cb() */ - + /*------------------------------------------------------------------------- * Function: attr_iterate_check * @@ -6812,7 +6810,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, return(-1); } /* end attr_iterate_check() */ - + /**************************************************************** ** ** test_attr_iterate2(): Test basic H5A (attribute) code. @@ -7116,7 +7114,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) HDfree(visited); } /* test_attr_iterate2() */ - + /*------------------------------------------------------------------------- * Function: attr_open_by_idx_check * @@ -7176,7 +7174,7 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, return(-1); } /* end attr_open_by_idx_check() */ - + /**************************************************************** ** ** test_attr_open_by_idx(): Test basic H5A (attribute) code. @@ -7438,7 +7436,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_open_by_idx() */ - + /*------------------------------------------------------------------------- * Function: attr_open_check * @@ -7524,7 +7522,7 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, return(-1); } /* end attr_open_check() */ - + /**************************************************************** ** ** test_attr_open_by_name(): Test basic H5A (attribute) code. @@ -7779,7 +7777,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_open_by_name() */ - + /**************************************************************** ** ** test_attr_create_by_name(): Test basic H5A (attribute) code. @@ -10866,7 +10864,7 @@ test_attr(void) CHECK(ret, FAIL, "H5Pclose"); } /* test_attr() */ - + /*------------------------------------------------------------------------- * Function: cleanup_attr * diff --git a/test/testhdf5.h b/test/testhdf5.h index 127c687..1f3f6a0 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -18,13 +18,6 @@ #ifndef TESTHDF5_H #define TESTHDF5_H -/* - * Include required headers. This file tests internal library functions, - * so we include the private headers here. - */ -#include "H5private.h" -#include "H5Eprivate.h" - /* Include generic testing header also */ #include "h5test.h" @@ -204,12 +197,12 @@ void test_vlstrings(void); void test_iterate(void); void test_array(void); void test_genprop(void); -void test_configure(void); -void test_misc(void); -void test_ids(void); -void test_skiplist(void); -void test_sohm(void); -void test_unicode(void); +void test_configure(void); +void test_misc(void); +void test_ids(void); +void test_skiplist(void); +void test_sohm(void); +void test_unicode(void); /* Prototypes for the cleanup routines */ void cleanup_metadata(void); @@ -227,10 +220,10 @@ void cleanup_vlstrings(void); void cleanup_iterate(void); void cleanup_array(void); void cleanup_genprop(void); -void cleanup_configure(void); -void cleanup_sohm(void); -void cleanup_misc(void); -void cleanup_unicode(void); +void cleanup_configure(void); +void cleanup_sohm(void); +void cleanup_misc(void); +void cleanup_unicode(void); #ifdef __cplusplus } diff --git a/test/th5s.c b/test/th5s.c index 4154c5f..0b0a2e7 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -13,13 +13,12 @@ /*********************************************************** * -* Test program: th5s +* Test program: th5s * * Test the dataspace functionality * *************************************************************/ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -42,7 +41,6 @@ #define H5O_TESTING #include "H5Opkg.h" /* Object header */ -#include "H5private.h" #include "H5Bprivate.h" #include "H5Sprivate.h" #include "H5Pprivate.h" @@ -63,31 +61,31 @@ #define EXTFILE_NAME "ext_file" /* 3-D dataset with fixed dimensions */ -#define SPACE1_RANK 3 -#define SPACE1_DIM1 3 -#define SPACE1_DIM2 15 -#define SPACE1_DIM3 13 +#define SPACE1_RANK 3 +#define SPACE1_DIM1 3 +#define SPACE1_DIM2 15 +#define SPACE1_DIM3 13 /* 4-D dataset with one unlimited dimension */ -#define SPACE2_RANK 4 -#define SPACE2_DIM1 0 -#define SPACE2_DIM2 15 -#define SPACE2_DIM3 13 -#define SPACE2_DIM4 23 -#define SPACE2_MAX1 H5S_UNLIMITED -#define SPACE2_MAX2 15 -#define SPACE2_MAX3 13 -#define SPACE2_MAX4 23 +#define SPACE2_RANK 4 +#define SPACE2_DIM1 0 +#define SPACE2_DIM2 15 +#define SPACE2_DIM3 13 +#define SPACE2_DIM4 23 +#define SPACE2_MAX1 H5S_UNLIMITED +#define SPACE2_MAX2 15 +#define SPACE2_MAX3 13 +#define SPACE2_MAX4 23 /* Scalar dataset with simple datatype */ -#define SPACE3_RANK 0 +#define SPACE3_RANK 0 unsigned space3_data=65; /* Scalar dataset with compound datatype */ -#define SPACE4_FIELDNAME1 "c1" -#define SPACE4_FIELDNAME2 "u" -#define SPACE4_FIELDNAME3 "f" -#define SPACE4_FIELDNAME4 "c2" +#define SPACE4_FIELDNAME1 "c1" +#define SPACE4_FIELDNAME2 "u" +#define SPACE4_FIELDNAME3 "f" +#define SPACE4_FIELDNAME4 "c2" size_t space4_field1_off=0; size_t space4_field2_off=0; size_t space4_field3_off=0; @@ -107,21 +105,21 @@ struct space4_struct { static void test_h5s_basic(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t sid1, sid2; /* Dataspace ID */ - hid_t dset1; /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t sid1, sid2; /* Dataspace ID */ + hid_t dset1; /* Dataset ID */ hid_t aid1; /* Attribute ID */ - int rank; /* Logical rank of dataspace */ - 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 max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, - SPACE2_MAX4}; - hsize_t tdims[4]; /* Dimension array to test with */ - hsize_t tmax[4]; - hssize_t n; /* Number of dataspace elements */ - herr_t ret; /* Generic return value */ + int rank; /* Logical rank of dataspace */ + 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 max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, + SPACE2_MAX4}; + hsize_t tdims[4]; /* Dimension array to test with */ + hsize_t tmax[4]; + hssize_t n; /* Number of dataspace elements */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspace Manipulation\n")); @@ -132,7 +130,7 @@ test_h5s_basic(void) n = H5Sget_simple_extent_npoints(sid1); CHECK(n, FAIL, "H5Sget_simple_extent_npoints"); VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3, - "H5Sget_simple_extent_npoints"); + "H5Sget_simple_extent_npoints"); rank = H5Sget_simple_extent_ndims(sid1); CHECK(rank, FAIL, "H5Sget_simple_extent_ndims"); @@ -141,7 +139,7 @@ test_h5s_basic(void) rank = H5Sget_simple_extent_dims(sid1, tdims, NULL); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); sid2 = H5Screate_simple(SPACE2_RANK, dims2, max2); CHECK(sid2, FAIL, "H5Screate_simple"); @@ -149,7 +147,7 @@ test_h5s_basic(void) n = H5Sget_simple_extent_npoints(sid2); CHECK(n, FAIL, "H5Sget_simple_extent_npoints"); VERIFY(n, SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4, - "H5Sget_simple_extent_npoints"); + "H5Sget_simple_extent_npoints"); rank = H5Sget_simple_extent_ndims(sid2); CHECK(rank, FAIL, "H5Sget_simple_extent_ndims"); @@ -158,9 +156,9 @@ test_h5s_basic(void) rank = H5Sget_simple_extent_dims(sid2, tdims, tmax); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); /* Change max dims to be equal to the dimensions */ ret = H5Sset_extent_simple(sid1, SPACE1_RANK, dims1, NULL); @@ -168,9 +166,9 @@ test_h5s_basic(void) rank = H5Sget_simple_extent_dims(sid1, tdims, tmax); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tmax, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); @@ -183,7 +181,7 @@ test_h5s_basic(void) * dimensions. */ H5E_BEGIN_TRY { - sid1 = H5Screate_simple(H5S_MAX_RANK+1, dims3, NULL); + sid1 = H5Screate_simple(H5S_MAX_RANK+1, dims3, NULL); } H5E_END_TRY; VERIFY(sid1, FAIL, "H5Screate_simple"); @@ -306,7 +304,7 @@ test_h5s_basic(void) CHECK(ret, FAIL, "H5Sclose"); ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_basic() */ +} /* test_h5s_basic() */ /**************************************************************** ** @@ -366,16 +364,16 @@ test_h5s_null(void) hsize_t start[1]={0}; hsize_t count[1]={0}; - ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL); + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sselect_hyperslab"); /* Check to be sure we can't set a point selection on a null dataspace */ H5E_BEGIN_TRY { - hsize_t coord[1][1]; /* Coordinates for point selection */ + hsize_t coord[1][1]; /* Coordinates for point selection */ coord[0][0]=0; - ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord); + ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sselect_elements"); @@ -536,18 +534,18 @@ test_h5s_null(void) static void test_h5s_zero_dim(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t sid1, attr_sid; /* Dataspace ID */ - hid_t sid_chunk; /* Dataspace ID for chunked dataset */ - hid_t dset1; /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t sid1, attr_sid; /* Dataspace ID */ + hid_t sid_chunk; /* Dataspace ID for chunked dataset */ + hid_t dset1; /* Dataset ID */ hid_t plist_id; /* Dataset creation property list */ hid_t attr; /* Attribute ID */ - int rank; /* Logical rank of dataspace */ - hsize_t dims1[] = {0, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t max_dims[] = {SPACE1_DIM1+1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t extend_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + int rank; /* Logical rank of dataspace */ + hsize_t dims1[] = {0, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t max_dims[] = {SPACE1_DIM1+1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t extend_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hsize_t chunk_dims[] = {SPACE1_DIM1, SPACE1_DIM2/3, SPACE1_DIM3}; - hsize_t tdims[SPACE1_RANK]; /* Dimension array to test with */ + hsize_t tdims[SPACE1_RANK]; /* Dimension array to test with */ int wdata[SPACE1_DIM2][SPACE1_DIM3]; int rdata[SPACE1_DIM2][SPACE1_DIM3]; short wdata_short[SPACE1_DIM2][SPACE1_DIM3]; @@ -557,12 +555,12 @@ test_h5s_zero_dim(void) int val = 3; hsize_t start[] = {0, 0, 0}; hsize_t count[] = {3, 15, 13}; - hsize_t coord[1][3]; /* Coordinates for point selection */ + hsize_t coord[1][3]; /* Coordinates for point selection */ hssize_t nelem; /* Number of elements */ H5S_sel_type sel_type; /* Type of selection currently */ H5S_class_t stype; /* dataspace type */ H5D_alloc_time_t alloc_time; /* Space allocation time */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ unsigned int i, j, k; /* Output message about test being performed */ @@ -638,8 +636,8 @@ test_h5s_zero_dim(void) CHECK(sid_chunk, FAIL, "H5Screate_simple"); /*============================================ - * Make sure we can use 0-dimension to create - * contiguous, chunked, compact, and external + * Make sure we can use 0-dimension to create + * contiguous, chunked, compact, and external * datasets, and also attribute. *============================================ */ @@ -703,7 +701,7 @@ test_h5s_zero_dim(void) } } - /* Select a hyperslab beyond its current dimension sizes, then try to write + /* Select a hyperslab beyond its current dimension sizes, then try to write * the data. It should fail. */ ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -717,7 +715,7 @@ test_h5s_zero_dim(void) ret = H5Sselect_none(sid1); CHECK(ret, FAIL, "H5Sselect_none"); - /* Select a point beyond the dimension size, then try to write the data. + /* Select a point beyond the dimension size, then try to write the data. * It should fail. */ coord[0][0]=2; coord[0][1]=5; coord[0][2]=3; ret = H5Sselect_elements(sid1, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord); @@ -769,8 +767,8 @@ test_h5s_zero_dim(void) } } - /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure - * we can write data to it */ + /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure + * we can write data to it */ extend_dims[0] = SPACE1_DIM1; ret = H5Dset_extent(dset1, extend_dims); CHECK(ret, FAIL, "H5Dset_extent"); @@ -970,10 +968,10 @@ test_h5s_zero_dim(void) CHECK(ret, FAIL, "H5Aclose"); /*=============================================================== - * Extend the dimension to make it a normal dataspace (3x15x13). - * Verify that data can be written to and read from the chunked - * dataset now. - *=============================================================== + * Extend the dimension to make it a normal dataspace (3x15x13). + * Verify that data can be written to and read from the chunked + * dataset now. + *=============================================================== */ dims1[0]=SPACE1_DIM1; ret = H5Sset_extent_simple(sid_chunk,SPACE1_RANK,dims1,max_dims); @@ -1174,14 +1172,14 @@ test_h5s_zero_dim(void) static void test_h5s_encode(void) { - hid_t sid1, sid2, sid3; /* Dataspace ID */ + hid_t sid1, sid2, sid3; /* Dataspace ID */ hid_t decoded_sid1, decoded_sid2, decoded_sid3; - int rank; /* Logical rank of dataspace */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + int rank; /* Logical rank of dataspace */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; size_t sbuf_size=0, null_size=0, scalar_size=0; unsigned char *sbuf=NULL, *null_sbuf=NULL, *scalar_buf=NULL; - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ hsize_t start[] = {0, 0, 0}; hsize_t stride[] = {2, 5, 3}; hsize_t count[] = {2, 2, 2}; @@ -1189,8 +1187,8 @@ test_h5s_encode(void) H5S_sel_type sel_type; H5S_class_t space_type; hssize_t nblocks; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspace Encoding and Decoding\n")); @@ -1214,7 +1212,7 @@ test_h5s_encode(void) /* Try decoding bogus buffer */ H5E_BEGIN_TRY { - ret_id = H5Sdecode(sbuf); + ret_id = H5Sdecode(sbuf); } H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Sdecode"); @@ -1229,7 +1227,7 @@ test_h5s_encode(void) n = H5Sget_simple_extent_npoints(decoded_sid1); CHECK(n, FAIL, "H5Sget_simple_extent_npoints"); VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3, - "H5Sget_simple_extent_npoints"); + "H5Sget_simple_extent_npoints"); rank = H5Sget_simple_extent_ndims(decoded_sid1); CHECK(rank, FAIL, "H5Sget_simple_extent_ndims"); @@ -1238,7 +1236,7 @@ test_h5s_encode(void) rank = H5Sget_simple_extent_dims(decoded_sid1, tdims, NULL); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); /* Verify hyperslabe selection */ sel_type = H5Sget_select_type(decoded_sid1); @@ -1328,7 +1326,7 @@ test_h5s_encode(void) HDfree(sbuf); HDfree(null_sbuf); HDfree(scalar_buf); -} /* test_h5s_encode() */ +} /* test_h5s_encode() */ /**************************************************************** ** @@ -1338,14 +1336,14 @@ test_h5s_encode(void) static void test_h5s_scalar_write(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ H5S_class_t ext_type; /* Extent type */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Scalar Dataspace Manipulation during Writing\n")); @@ -1397,7 +1395,7 @@ test_h5s_scalar_write(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_scalar_write() */ +} /* test_h5s_scalar_write() */ /**************************************************************** ** @@ -1407,14 +1405,14 @@ test_h5s_scalar_write(void) static void test_h5s_scalar_read(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ - unsigned rdata; /* Scalar data read in */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ + unsigned rdata; /* Scalar data read in */ + herr_t ret; /* Generic return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ @@ -1461,7 +1459,7 @@ test_h5s_scalar_read(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_scalar_read() */ +} /* test_h5s_scalar_read() */ /**************************************************************** ** @@ -1472,14 +1470,14 @@ test_h5s_scalar_read(void) static void test_h5s_compound_scalar_write(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t tid1; /* Attribute datatype ID */ - hid_t sid1; /* Dataspace ID */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t tid1; /* Attribute datatype ID */ + hid_t sid1; /* Dataspace ID */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Scalar Dataspace Manipulation for Writing Compound Datatypes\n")); @@ -1493,19 +1491,19 @@ test_h5s_compound_scalar_write(void) CHECK(tid1, FAIL, "H5Tcreate"); space4_field1_off=HOFFSET(struct space4_struct, c1); ret = H5Tinsert(tid1, SPACE4_FIELDNAME1, space4_field1_off, - H5T_NATIVE_SCHAR); + H5T_NATIVE_SCHAR); CHECK(ret, FAIL, "H5Tinsert"); space4_field2_off=HOFFSET(struct space4_struct, u); ret = H5Tinsert(tid1, SPACE4_FIELDNAME2, space4_field2_off, - H5T_NATIVE_UINT); + H5T_NATIVE_UINT); CHECK(ret, FAIL, "H5Tinsert"); space4_field3_off=HOFFSET(struct space4_struct, f); ret = H5Tinsert(tid1, SPACE4_FIELDNAME3, space4_field3_off, - H5T_NATIVE_FLOAT); + H5T_NATIVE_FLOAT); CHECK(ret, FAIL, "H5Tinsert"); space4_field4_off=HOFFSET(struct space4_struct, c2); ret = H5Tinsert(tid1, SPACE4_FIELDNAME4, space4_field4_off, - H5T_NATIVE_SCHAR); + H5T_NATIVE_SCHAR); CHECK(ret, FAIL, "H5Tinsert"); /* Create scalar dataspace */ @@ -1545,7 +1543,7 @@ test_h5s_compound_scalar_write(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_compound_scalar_write() */ +} /* test_h5s_compound_scalar_write() */ /**************************************************************** ** @@ -1556,15 +1554,15 @@ test_h5s_compound_scalar_write(void) static void test_h5s_compound_scalar_read(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t type; /* Datatype */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ - struct space4_struct rdata; /* Scalar data read in */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t type; /* Datatype */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ + struct space4_struct rdata; /* Scalar data read in */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Scalar Dataspace Manipulation for Reading Compound Datatypes\n")); @@ -1618,7 +1616,7 @@ test_h5s_compound_scalar_read(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_compound_scalar_read() */ +} /* test_h5s_compound_scalar_read() */ /* Data arrays for chunk test */ double chunk_data_dbl[50000][3]; @@ -2384,7 +2382,7 @@ test_h5s_bug1(void) CHECK(ret, FAIL, "H5Sclose"); } /* test_h5s_bug1() */ - + /*------------------------------------------------------------------------- * Function: test_versionbounds * @@ -2395,8 +2393,8 @@ test_h5s_bug1(void) * reopens it with higher bounds to show that the dataspace * version is upgraded appropriately. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * *------------------------------------------------------------------------- */ @@ -2501,13 +2499,13 @@ test_versionbounds(void) ret = H5Sclose(space); CHECK(ret, FAIL, "H5Sclose"); - ret = H5Pclose(fapl); + ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); } /* end test_versionbounds() */ - + /**************************************************************** ** ** test_h5s(): Main H5S (dataspace) testing routine. @@ -2519,34 +2517,34 @@ test_h5s(void) /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspaces\n")); - test_h5s_basic(); /* Test basic H5S code */ - test_h5s_null(); /* Test Null dataspace H5S code */ + test_h5s_basic(); /* Test basic H5S code */ + test_h5s_null(); /* Test Null dataspace H5S code */ test_h5s_zero_dim(); /* Test dataspace with zero dimension size */ test_h5s_encode(); /* Test encoding and decoding */ - test_h5s_scalar_write(); /* Test scalar H5S writing code */ - test_h5s_scalar_read(); /* Test scalar H5S reading code */ + test_h5s_scalar_write(); /* Test scalar H5S writing code */ + test_h5s_scalar_read(); /* Test scalar H5S reading 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_compound_scalar_write(); /* Test compound datatype scalar H5S writing code */ + test_h5s_compound_scalar_read(); /* Test compound datatype scalar H5S reading code */ /* This test was added later to exercise a bug in chunked I/O */ - test_h5s_chunk(); /* Exercise bug fix for chunked I/O */ + test_h5s_chunk(); /* Exercise bug fix for chunked I/O */ - test_h5s_extent_equal(); /* Test extent comparison code */ + test_h5s_extent_equal(); /* Test extent comparison code */ test_h5s_extent_copy(); /* Test extent copy code */ test_h5s_bug1(); /* Test bug in offset initialization */ test_versionbounds(); /* Test version bounds with dataspace */ } /* 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/test/ttsafe.h b/test/ttsafe.h index 6cf449f..c29fadc 100644 --- a/test/ttsafe.h +++ b/test/ttsafe.h @@ -22,9 +22,6 @@ * Include required headers. This file tests internal library functions, * so we include the private headers here. */ -#include "hdf5.h" -#include "H5private.h" -#include "H5Eprivate.h" #include "testhdf5.h" diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 700e993..5768e35 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -16,12 +16,11 @@ * */ -#include "h5test.h" #include "testpar.h" -#define H5AC_FRIEND /*suppress error about including H5ACpkg */ -#define H5C_FRIEND /*suppress error about including H5Cpkg */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5AC_FRIEND /*suppress error about including H5ACpkg */ +#define H5C_FRIEND /*suppress error about including H5Cpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "H5ACpkg.h" #include "H5Cpkg.h" @@ -33,9 +32,9 @@ #define BASE_ADDR (haddr_t)1024 -int nerrors = 0; -int failures = 0; -hbool_t verbose = TRUE; /* used to control error messages */ +int nerrors = 0; +int failures = 0; +hbool_t verbose = TRUE; /* used to control error messages */ #define NFILENAME 2 #define PARATESTFILE filenames[0] @@ -45,23 +44,23 @@ const char *FILENAME[NFILENAME]={"CacheTestDummy", NULL}; #endif /* !PATH_MAX */ char filenames[NFILENAME][PATH_MAX]; hid_t fapl; /* file access property list */ -haddr_t max_addr = 0; /* used to store the end of - * the address space used by - * the data array (see below). - */ -hbool_t callbacks_verbose = FALSE; /* flag used to control whether - * the callback functions are in - * verbose mode. - */ +haddr_t max_addr = 0; /* used to store the end of + * the address space used by + * the data array (see below). + */ +hbool_t callbacks_verbose = FALSE; /* flag used to control whether + * the callback functions are in + * verbose mode. + */ -int world_mpi_size = -1; -int world_mpi_rank = -1; -int world_server_mpi_rank = -1; -MPI_Comm world_mpi_comm = MPI_COMM_NULL; -int file_mpi_size = -1; -int file_mpi_rank = -1; -MPI_Comm file_mpi_comm = MPI_COMM_NULL; +int world_mpi_size = -1; +int world_mpi_rank = -1; +int world_server_mpi_rank = -1; +MPI_Comm world_mpi_comm = MPI_COMM_NULL; +int file_mpi_size = -1; +int file_mpi_rank = -1; +MPI_Comm file_mpi_comm = MPI_COMM_NULL; /* the following globals are used to maintain rudementary statistics @@ -74,67 +73,67 @@ long datum_destroys = 0; long datum_flushes = 0; long datum_pinned_flushes = 0; long datum_loads = 0; -long global_pins = 0; -long global_dirty_pins = 0; -long local_pins = 0; +long global_pins = 0; +long global_dirty_pins = 0; +long local_pins = 0; /* the following fields are used by the server process only */ -int total_reads = 0; +int total_reads = 0; int total_writes = 0; /***************************************************************************** * struct datum * - * Instances of struct datum are used to store information on entries - * that may be loaded into the cache. The individual fields are - * discussed below: + * Instances of struct datum are used to store information on entries + * that may be loaded into the cache. The individual fields are + * discussed below: * - * header: Instance of H5C_cache_entry_t used by the for its data. - * This field is only used on the file processes, not on the - * server process. + * header: Instance of H5C_cache_entry_t used by the for its data. + * This field is only used on the file processes, not on the + * server process. * - * This field MUST be the first entry in this structure. + * This field MUST be the first entry in this structure. * - * base_addr: Base address of the entry. + * base_addr: Base address of the entry. * - * len: Length of the entry. + * len: Length of the entry. * - * local_len: Length of the entry according to the cache. This - * value must be positive, and may not be larger than len. + * local_len: Length of the entry according to the cache. This + * value must be positive, and may not be larger than len. * - * The field exists to allow us change the sizes of entries - * in the cache without upsetting the server. This value - * is only used locally, and is never sent to the server. + * The field exists to allow us change the sizes of entries + * in the cache without upsetting the server. This value + * is only used locally, and is never sent to the server. * - * ver: Version number of the entry. This number is initialize - * to zero, and incremented each time the entry is modified. + * ver: Version number of the entry. This number is initialize + * to zero, and incremented each time the entry is modified. * - * dirty: Boolean flag indicating whether the entry is dirty. + * dirty: Boolean flag indicating whether the entry is dirty. * - * For current purposes, an entry is clean until it is - * modified, and dirty until written to the server (cache - * on process 0) or until it is marked clean (all other - * caches). + * For current purposes, an entry is clean until it is + * modified, and dirty until written to the server (cache + * on process 0) or until it is marked clean (all other + * caches). * - * valid: Boolean flag indicating whether the entry contains - * valid data. Attempts to read an entry whose valid - * flag is not set should trigger an error. + * valid: Boolean flag indicating whether the entry contains + * valid data. Attempts to read an entry whose valid + * flag is not set should trigger an error. * - * locked: Boolean flag that is set to true iff the entry is in - * the cache and locked. + * locked: Boolean flag that is set to true iff the entry is in + * the cache and locked. * - * global_pinned: Boolean flag that is set to true iff the entry has - * been pinned collectively in all caches. Since writes must - * be collective across all processes, only entries pinned - * in this fashion may be marked dirty. + * global_pinned: Boolean flag that is set to true iff the entry has + * been pinned collectively in all caches. Since writes must + * be collective across all processes, only entries pinned + * in this fashion may be marked dirty. * - * local_pinned: Boolean flag that is set to true iff the entry - * has been pinned in the local cache, but probably not all - * caches. Such pins will typically not be consistant across - * processes, and thus cannot be marked as dirty unless they - * happen to overlap some collective operation. + * local_pinned: Boolean flag that is set to true iff the entry + * has been pinned in the local cache, but probably not all + * caches. Such pins will typically not be consistant across + * processes, and thus cannot be marked as dirty unless they + * happen to overlap some collective operation. * * cleared: Boolean flag that is set to true whenever the entry is * dirty, and is cleared via a call to datum_notify with the @@ -143,61 +142,61 @@ int total_writes = 0; * flushed: Boolean flag that is set to true whenever the entry is * dirty, and is flushed by the metadata cache. * - * reads: Integer field used to maintain a count of the number of - * times this entry has been read from the server since - * the last time the read and write counts were reset. + * reads: Integer field used to maintain a count of the number of + * times this entry has been read from the server since + * the last time the read and write counts were reset. * - * writes: Integer field used to maintain a count of the number of - * times this entry has been written to the server since - * the last time the read and write counts were reset. + * writes: Integer field used to maintain a count of the number of + * times this entry has been written to the server since + * the last time the read and write counts were reset. * - * index: Index of this instance of datum in the data_index[] array - * discussed below. + * index: Index of this instance of datum in the data_index[] array + * discussed below. * - * aux_ptr: Pointer to the instance of H5AC_aux_t associated with the - * instance of the metadata cache within which this entry - * resides. This field was added to allow us to pass this - * value to the notify callback from the serialize callback. - * It should be NULL when not in use. + * aux_ptr: Pointer to the instance of H5AC_aux_t associated with the + * instance of the metadata cache within which this entry + * resides. This field was added to allow us to pass this + * value to the notify callback from the serialize callback. + * It should be NULL when not in use. * *****************************************************************************/ struct datum { - H5C_cache_entry_t header; - haddr_t base_addr; - size_t len; - size_t local_len; - int ver; - hbool_t dirty; - hbool_t valid; - hbool_t locked; - hbool_t global_pinned; - hbool_t local_pinned; - hbool_t cleared; + H5C_cache_entry_t header; + haddr_t base_addr; + size_t len; + size_t local_len; + int ver; + hbool_t dirty; + hbool_t valid; + hbool_t locked; + hbool_t global_pinned; + hbool_t local_pinned; + hbool_t cleared; hbool_t flushed; - int reads; - int writes; - int index; + int reads; + int writes; + int index; struct H5AC_aux_t * aux_ptr; }; /***************************************************************************** * data array * - * The data array is an array of instances of datum of size - * NUM_DATA_ENTRIES that is used to track the particulars of all - * the entries that may be loaded into the cache. + * The data array is an array of instances of datum of size + * NUM_DATA_ENTRIES that is used to track the particulars of all + * the entries that may be loaded into the cache. * - * It exists on all processes, although the master copy is maintained - * by the server process. If the cache is performing correctly, all - * versions should be effectively identical. By that I mean that - * the data received from the server should always match that in - * the local version of the data array. + * It exists on all processes, although the master copy is maintained + * by the server process. If the cache is performing correctly, all + * versions should be effectively identical. By that I mean that + * the data received from the server should always match that in + * the local version of the data array. * *****************************************************************************/ -#define NUM_DATA_ENTRIES 100000 +#define NUM_DATA_ENTRIES 100000 struct datum data[NUM_DATA_ENTRIES]; @@ -216,10 +215,10 @@ struct datum data[NUM_DATA_ENTRIES]; * Further, this value must be consistant across all processes. */ -#define STD_VIRT_NUM_DATA_ENTRIES NUM_DATA_ENTRIES -#define EXPRESS_VIRT_NUM_DATA_ENTRIES (NUM_DATA_ENTRIES / 10) +#define STD_VIRT_NUM_DATA_ENTRIES NUM_DATA_ENTRIES +#define EXPRESS_VIRT_NUM_DATA_ENTRIES (NUM_DATA_ENTRIES / 10) /* Use a smaller test size to avoid creating huge MPE logfiles. */ -#define MPE_VIRT_NUM_DATA_ENTIES (NUM_DATA_ENTRIES / 100) +#define MPE_VIRT_NUM_DATA_ENTIES (NUM_DATA_ENTRIES / 100) int virt_num_data_entries = NUM_DATA_ENTRIES; @@ -227,14 +226,14 @@ int virt_num_data_entries = NUM_DATA_ENTRIES; /***************************************************************************** * data_index array * - * The data_index array is an array of integer used to maintain a list - * of instances of datum in the data array in increasing base_addr order. + * The data_index array is an array of integer used to maintain a list + * of instances of datum in the data array in increasing base_addr order. * - * This array is necessary, as move operations can swap the values - * of the base_addr fields of two instances of datum. Without this - * array, we would no longer be able to use a binary search on a sorted - * list to find the indexes of instances of datum given the values of - * their base_addr fields. + * This array is necessary, as move operations can swap the values + * of the base_addr fields of two instances of datum. Without this + * array, we would no longer be able to use a binary search on a sorted + * list to find the indexes of instances of datum given the values of + * their base_addr fields. * *****************************************************************************/ @@ -243,99 +242,99 @@ int data_index[NUM_DATA_ENTRIES]; /***************************************************************************** * The following two #defines are used to control code that is in turn used - * to force "POSIX" semantics on the server process used to simulate metadata - * reads and writes. Without some such mechanism, the test code contains + * to force "POSIX" semantics on the server process used to simulate metadata + * reads and writes. Without some such mechanism, the test code contains * race conditions that will frequently cause spurious failures. * * When set to TRUE, DO_WRITE_REQ_ACK forces the server to send an ack after - * each write request, and the client to wait until the ack is received + * each write request, and the client to wait until the ack is received * before proceeding. This was my first solution to the problem, and at * first glance, it would seem to have a lot of unnecessary overhead. * * In an attempt to reduce the overhead, I implemented a second solution - * in which no acks are sent after writes. Instead, the metadata cache is - * provided with a callback function to call after each sequence of writes. - * This callback simply causes the client to send the server process a + * in which no acks are sent after writes. Instead, the metadata cache is + * provided with a callback function to call after each sequence of writes. + * This callback simply causes the client to send the server process a * "sync" message and and await an ack in reply. * - * Strangely, at least on Phoenix, the first solution runs faster by a - * rather large margin. However, I can imagine this changing with + * Strangely, at least on Phoenix, the first solution runs faster by a + * rather large margin. However, I can imagine this changing with * different OS's and MPI implementatins. * - * Thus I have left code supporting the second solution in place. + * Thus I have left code supporting the second solution in place. * - * Note that while one of these two #defines must be set to TRUE, there - * should never be any need to set both of them to TRUE (although the + * Note that while one of these two #defines must be set to TRUE, there + * should never be any need to set both of them to TRUE (although the * tests will still function with this setting). *****************************************************************************/ -#define DO_WRITE_REQ_ACK TRUE -#define DO_SYNC_AFTER_WRITE FALSE +#define DO_WRITE_REQ_ACK TRUE +#define DO_SYNC_AFTER_WRITE FALSE /***************************************************************************** * struct mssg * - * The mssg structure is used as a generic container for messages to - * and from the server. Not all fields are used in all cases. + * The mssg structure is used as a generic container for messages to + * and from the server. Not all fields are used in all cases. * - * req: Integer field containing the type of the message. + * req: Integer field containing the type of the message. * - * src: World communicator MPI rank of the sending process. + * src: World communicator MPI rank of the sending process. * - * dest: World communicator MPI rank of the destination process. + * dest: World communicator MPI rank of the destination process. * - * mssg_num: Serial number assigned to the message by the sender. + * mssg_num: Serial number assigned to the message by the sender. * - * base_addr: Base address of a datum. Not used in all mssgs. + * base_addr: Base address of a datum. Not used in all mssgs. * - * len: Length of a datum (in bytes). Not used in all mssgs. + * len: Length of a datum (in bytes). Not used in all mssgs. * - * ver: Version number of a datum. Not used in all mssgs. + * ver: Version number of a datum. Not used in all mssgs. * - * count: Reported number of total/entry reads/writes. Not used - * in all mssgs. + * count: Reported number of total/entry reads/writes. Not used + * in all mssgs. * - * magic: Magic number for error detection. Must be set to - * MSSG_MAGIC. + * magic: Magic number for error detection. Must be set to + * MSSG_MAGIC. * *****************************************************************************/ -#define WRITE_REQ_CODE 0 -#define WRITE_REQ_ACK_CODE 1 -#define READ_REQ_CODE 2 -#define READ_REQ_REPLY_CODE 3 -#define SYNC_REQ_CODE 4 -#define SYNC_ACK_CODE 5 -#define REQ_TTL_WRITES_CODE 6 -#define REQ_TTL_WRITES_RPLY_CODE 7 -#define REQ_TTL_READS_CODE 8 -#define REQ_TTL_READS_RPLY_CODE 9 -#define REQ_ENTRY_WRITES_CODE 10 -#define REQ_ENTRY_WRITES_RPLY_CODE 11 -#define REQ_ENTRY_READS_CODE 12 -#define REQ_ENTRY_READS_RPLY_CODE 13 -#define REQ_RW_COUNT_RESET_CODE 14 -#define REQ_RW_COUNT_RESET_RPLY_CODE 15 -#define DONE_REQ_CODE 16 -#define MAX_REQ_CODE 16 - -#define MSSG_MAGIC 0x1248 +#define WRITE_REQ_CODE 0 +#define WRITE_REQ_ACK_CODE 1 +#define READ_REQ_CODE 2 +#define READ_REQ_REPLY_CODE 3 +#define SYNC_REQ_CODE 4 +#define SYNC_ACK_CODE 5 +#define REQ_TTL_WRITES_CODE 6 +#define REQ_TTL_WRITES_RPLY_CODE 7 +#define REQ_TTL_READS_CODE 8 +#define REQ_TTL_READS_RPLY_CODE 9 +#define REQ_ENTRY_WRITES_CODE 10 +#define REQ_ENTRY_WRITES_RPLY_CODE 11 +#define REQ_ENTRY_READS_CODE 12 +#define REQ_ENTRY_READS_RPLY_CODE 13 +#define REQ_RW_COUNT_RESET_CODE 14 +#define REQ_RW_COUNT_RESET_RPLY_CODE 15 +#define DONE_REQ_CODE 16 +#define MAX_REQ_CODE 16 + +#define MSSG_MAGIC 0x1248 struct mssg_t { - int req; - int src; - int dest; - long int mssg_num; - haddr_t base_addr; - unsigned len; - int ver; - unsigned count; - unsigned magic; + int req; + int src; + int dest; + long int mssg_num; + haddr_t base_addr; + unsigned len; + int ver; + unsigned count; + unsigned magic; }; -MPI_Datatype mpi_mssg_t; /* for MPI derived type created from mssg */ +MPI_Datatype mpi_mssg_t; /* for MPI derived type created from mssg */ /*****************************************************************************/ @@ -409,24 +408,24 @@ 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_OHDR_ID -#define NUMBER_OF_ENTRY_TYPES 1 +#define NUMBER_OF_ENTRY_TYPES 1 /* Note the use of the H5AC__CLASS_SKIP_READS and H5AC__CLASS_SKIP_WRITES * flags. As a result of these flags, the metadata cache does no file I/O * on metadata of the datum type. * - * Instead, this test uses a server process to keep track of who has + * Instead, this test uses a server process to keep track of who has * written and read what, and to verify that there are no messages from * the past / future. * - * In the callbacks for the version 2 cache, this activity was hidden in + * In the callbacks for the version 2 cache, this activity was hidden in * the load and flush callbacks. However, now we handle this function in * notify callbacks for the after load and after flush events. * - * JRM -- 1/13/15 + * JRM -- 1/13/15 */ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = { @@ -474,9 +473,9 @@ static void pin_protected_entry(int32_t idx, hbool_t global); static void move_entry(H5F_t * file_ptr, int32_t old_idx, int32_t new_idx); static hbool_t reset_server_counts(void); static void resize_entry(int32_t idx, size_t new_size); -static hbool_t setup_cache_for_test(hid_t * fid_ptr, +static hbool_t setup_cache_for_test(hid_t * fid_ptr, H5F_t ** file_ptr_ptr, - H5C_t ** cache_ptr_ptr, + H5C_t ** cache_ptr_ptr, int metadata_write_strategy); static void setup_rand(void); static hbool_t take_down_cache(hid_t fid, H5C_t * cache_ptr); @@ -550,17 +549,17 @@ print_stats(void) /***************************************************************************** * - * Function: reset_stats() + * Function: reset_stats() * - * Purpose: Reset the rudementary stats maintained by t_cache. + * Purpose: Reset the rudementary stats maintained by t_cache. * - * Return: void + * Return: void * - * Programmer: JRM -- 4/17/06 + * Programmer: JRM -- 4/17/06 * * Modifications: * - * None. + * None. * *****************************************************************************/ @@ -573,9 +572,9 @@ reset_stats(void) datum_flushes = 0; datum_pinned_flushes = 0; datum_loads = 0; - global_pins = 0; - global_dirty_pins = 0; - local_pins = 0; + global_pins = 0; + global_dirty_pins = 0; + local_pins = 0; return; @@ -588,20 +587,20 @@ reset_stats(void) /***************************************************************************** * - * Function: set_up_file_communicator() + * Function: set_up_file_communicator() * - * Purpose: Create the MPI communicator used to open a HDF5 file with. - * In passing, also initialize the file_mpi... globals. + * Purpose: Create the MPI communicator used to open a HDF5 file with. + * In passing, also initialize the file_mpi... globals. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 11/16/05 + * Programmer: JRM -- 11/16/05 * * Modifications: * - * None. + * None. * *****************************************************************************/ @@ -623,7 +622,7 @@ set_up_file_communicator(void) nerrors++; success = FALSE; - if ( verbose ) { + if ( verbose ) { fprintf(stdout, "%d:%s: MPI_Comm_group() failed with error %d.\n", world_mpi_rank, FUNC, mpi_result); @@ -740,16 +739,16 @@ set_up_file_communicator(void) /***************************************************************************** * - * Function: addr_to_datum_index() + * Function: addr_to_datum_index() * - * Purpose: Given the base address of a datum, find and return its index - * in the data array. + * Purpose: Given the base address of a datum, find and return its index + * in the data array. * - * Return: Success: index of target datum. + * Return: Success: index of target datum. * - * Failure: -1. + * Failure: -1. * - * Programmer: JRM -- 12/20/05 + * Programmer: JRM -- 12/20/05 * *****************************************************************************/ static int @@ -787,16 +786,16 @@ addr_to_datum_index(haddr_t base_addr) /***************************************************************************** * - * Function: init_data() + * Function: init_data() * - * Purpose: Initialize the data array, from which cache entries are - * loaded. + * Purpose: Initialize the data array, from which cache entries are + * loaded. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/20/05 + * Programmer: JRM -- 12/20/05 * *****************************************************************************/ static void @@ -831,14 +830,14 @@ init_data(void) data[i].dirty = FALSE; data[i].valid = FALSE; data[i].locked = FALSE; - data[i].global_pinned = FALSE; - data[i].local_pinned = FALSE; - data[i].cleared = FALSE; + data[i].global_pinned = FALSE; + data[i].local_pinned = FALSE; + data[i].cleared = FALSE; data[i].flushed = FALSE; data[i].reads = 0; data[i].writes = 0; - data[i].index = i; - data[i].aux_ptr = NULL; + data[i].index = i; + data[i].aux_ptr = NULL; data_index[i] = i; @@ -862,22 +861,22 @@ init_data(void) /***************************************************************************** * - * Function: do_express_test() + * Function: do_express_test() * - * Purpose: Do an MPI_Allreduce to obtain the maximum value returned - * by GetTestExpress() across all processes. Return this - * value. + * 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. + * 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. + * Return: Success: Maximum of the values returned by + * GetTestExpress() across all processes. * - * Failure: -1 + * Failure: -1 * - * Programmer: JRM -- 4/25/06 + * Programmer: JRM -- 4/25/06 * *****************************************************************************/ static int @@ -913,19 +912,19 @@ do_express_test(void) /***************************************************************************** * - * Function: do_sync() + * Function: do_sync() * - * Purpose: Ensure that all messages sent by this process have been - * processed before proceeding. + * Purpose: Ensure that all messages sent by this process have been + * processed before proceeding. * - * Do this by exchanging sync req / sync ack messages with - * the server. + * Do this by exchanging sync req / sync ack messages with + * the server. * - * Do nothing if nerrors is greater than zero. + * Do nothing if nerrors is greater than zero. * - * Return: void + * Return: void * - * Programmer: JRM -- 5/10/06 + * Programmer: JRM -- 5/10/06 * *****************************************************************************/ static void @@ -937,7 +936,7 @@ do_sync(void) if ( nerrors <= 0 ) { /* compose the message */ - mssg.req = SYNC_REQ_CODE; + mssg.req = SYNC_REQ_CODE; mssg.src = world_mpi_rank; mssg.dest = world_server_mpi_rank; mssg.mssg_num = -1; /* set by send function */ @@ -947,10 +946,10 @@ do_sync(void) mssg.count = 0; mssg.magic = MSSG_MAGIC; - if ( ! send_mssg(&mssg, FALSE) ) { + if ( ! send_mssg(&mssg, FALSE) ) { - nerrors++; - if ( verbose ) { + nerrors++; + if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, FUNC); } @@ -959,24 +958,24 @@ do_sync(void) if ( nerrors <= 0 ) { - if ( ! recv_mssg(&mssg, SYNC_ACK_CODE) ) { + if ( ! recv_mssg(&mssg, SYNC_ACK_CODE) ) { nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC); } - } else if ( ( mssg.req != SYNC_ACK_CODE ) || + } else if ( ( mssg.req != SYNC_ACK_CODE ) || ( mssg.src != world_server_mpi_rank ) || ( mssg.dest != world_mpi_rank ) || - ( mssg.magic != MSSG_MAGIC ) ) { + ( mssg.magic != MSSG_MAGIC ) ) { nerrors++; - if ( verbose ) { + if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad data in sync ack.\n", world_mpi_rank, FUNC); } - } + } } return; @@ -986,17 +985,17 @@ do_sync(void) /***************************************************************************** * - * Function: get_max_nerrors() + * Function: get_max_nerrors() * - * Purpose: Do an MPI_Allreduce to obtain the maximum value of nerrors - * across all processes. Return this value. + * Purpose: Do an MPI_Allreduce to obtain the maximum value of nerrors + * across all processes. Return this value. * - * Return: Success: Maximum of the nerrors global variables across - * all processes. + * Return: Success: Maximum of the nerrors global variables across + * all processes. * - * Failure: -1 + * Failure: -1 * - * Programmer: JRM -- 1/3/06 + * Programmer: JRM -- 1/3/06 * *****************************************************************************/ static int @@ -1033,29 +1032,29 @@ get_max_nerrors(void) /***************************************************************************** * - * Function: recv_mssg() + * Function: recv_mssg() * - * Purpose: Receive a message from any process in the provided instance - * of struct mssg. + * Purpose: Receive a message from any process in the provided instance + * of struct mssg. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * * Modifications: * - * JRM -- 5/10/06 - * Added mssg_tag_offset parameter and supporting code. + * JRM -- 5/10/06 + * Added mssg_tag_offset parameter and supporting code. * *****************************************************************************/ -#define CACHE_TEST_TAG 99 /* different from any used by the library */ +#define CACHE_TEST_TAG 99 /* different from any used by the library */ static hbool_t recv_mssg(struct mssg_t *mssg_ptr, - int mssg_tag_offset) + int mssg_tag_offset) { hbool_t success = TRUE; int mssg_tag = CACHE_TEST_TAG; @@ -1117,28 +1116,28 @@ recv_mssg(struct mssg_t *mssg_ptr, /***************************************************************************** * - * Function: send_mssg() + * Function: send_mssg() * - * Purpose: Send the provided instance of mssg to the indicated target. + * Purpose: Send the provided instance of mssg to the indicated target. * - * Note that all source and destination ranks are in the - * global communicator. + * Note that all source and destination ranks are in the + * global communicator. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * * Modifications: * - * JRM -- 5/10/06 - * Added the add_req_to_tag parameter and supporting code. + * JRM -- 5/10/06 + * Added the add_req_to_tag parameter and supporting code. * *****************************************************************************/ static hbool_t send_mssg(struct mssg_t *mssg_ptr, - hbool_t add_req_to_tag) + hbool_t add_req_to_tag) { hbool_t success = TRUE; int mssg_tag = CACHE_TEST_TAG; @@ -1166,10 +1165,10 @@ send_mssg(struct mssg_t *mssg_ptr, mssg_ptr->mssg_num = mssg_num++; - if ( add_req_to_tag ) { + if ( add_req_to_tag ) { - mssg_tag += mssg_ptr->req; - } + mssg_tag += mssg_ptr->req; + } result = MPI_Send((void *)mssg_ptr, 1, mpi_mssg_t, mssg_ptr->dest, mssg_tag, world_mpi_comm); @@ -1189,19 +1188,19 @@ send_mssg(struct mssg_t *mssg_ptr, } /* send_mssg() */ - + /***************************************************************************** * - * Function: setup_derived_types() + * Function: setup_derived_types() * - * Purpose: Set up the derived types used by the test bed. At present, - * only the mpi_mssg derived type is needed. + * Purpose: Set up the derived types used by the test bed. At present, + * only the mpi_mssg derived type is needed. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * *****************************************************************************/ static hbool_t @@ -1278,19 +1277,19 @@ setup_derived_types(void) } /* setup_derived_types */ - + /***************************************************************************** * - * Function: takedown_derived_types() + * Function: takedown_derived_types() * - * Purpose: take down the derived types used by the test bed. At present, - * only the mpi_mssg derived type is needed. + * Purpose: take down the derived types used by the test bed. At present, + * only the mpi_mssg derived type is needed. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * *****************************************************************************/ static hbool_t @@ -1322,16 +1321,16 @@ takedown_derived_types(void) /***************************************************************************** * - * Function: reset_server_counters() + * Function: reset_server_counters() * - * Purpose: Reset the counters maintained by the server, doing a - * sanity check in passing. + * Purpose: Reset the counters maintained by the server, doing a + * sanity check in passing. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -1363,7 +1362,7 @@ reset_server_counters(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: actual/total reads mismatch (%ld/%ld).\n", - world_mpi_rank, FUNC, + world_mpi_rank, FUNC, actual_total_reads, total_reads); } } @@ -1374,7 +1373,7 @@ reset_server_counters(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: actual/total writes mismatch (%ld/%ld).\n", - world_mpi_rank, FUNC, + world_mpi_rank, FUNC, actual_total_writes, total_writes); } } @@ -1389,25 +1388,25 @@ reset_server_counters(void) /***************************************************************************** * - * Function: server_main() + * Function: server_main() * - * Purpose: Main function for the server process. This process exists - * to provide an independant view of the data array. + * Purpose: Main function for the server process. This process exists + * to provide an independant view of the data array. * - * The function handles request from the other processes in - * the test until the count of done messages received equals - * the number of client processes. + * The function handles request from the other processes in + * the test until the count of done messages received equals + * the number of client processes. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * * Modifications: * - * JRM -- 5/10/06 - * Updated for sync message. + * JRM -- 5/10/06 + * Updated for sync message. * *****************************************************************************/ static hbool_t @@ -1437,98 +1436,98 @@ server_main(void) switch ( mssg.req ) { - case WRITE_REQ_CODE: - success = serve_write_request(&mssg); - break; + case WRITE_REQ_CODE: + success = serve_write_request(&mssg); + break; - case WRITE_REQ_ACK_CODE: + case WRITE_REQ_ACK_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received write ack?!?.\n", FUNC); - break; + break; - case READ_REQ_CODE: + case READ_REQ_CODE: success = serve_read_request(&mssg); - break; + break; - case READ_REQ_REPLY_CODE: + case READ_REQ_REPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received read req reply?!?.\n", FUNC); - break; + break; - case SYNC_REQ_CODE: + case SYNC_REQ_CODE: success = serve_sync_request(&mssg); - break; + break; - case SYNC_ACK_CODE: + case SYNC_ACK_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received sync ack?!?.\n", FUNC); - break; + break; - case REQ_TTL_WRITES_CODE: - success = serve_total_writes_request(&mssg); - break; + case REQ_TTL_WRITES_CODE: + success = serve_total_writes_request(&mssg); + break; - case REQ_TTL_WRITES_RPLY_CODE: + case REQ_TTL_WRITES_RPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received total writes reply?!?.\n", FUNC); - break; + break; - case REQ_TTL_READS_CODE: - success = serve_total_reads_request(&mssg); - break; + case REQ_TTL_READS_CODE: + success = serve_total_reads_request(&mssg); + break; - case REQ_TTL_READS_RPLY_CODE: + case REQ_TTL_READS_RPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received total reads reply?!?.\n", FUNC); - break; + break; - case REQ_ENTRY_WRITES_CODE: - success = serve_entry_writes_request(&mssg); - break; + case REQ_ENTRY_WRITES_CODE: + success = serve_entry_writes_request(&mssg); + break; - case REQ_ENTRY_WRITES_RPLY_CODE: + case REQ_ENTRY_WRITES_RPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received entry writes reply?!?.\n", FUNC); - break; + break; - case REQ_ENTRY_READS_CODE: - success = serve_entry_reads_request(&mssg); - break; + case REQ_ENTRY_READS_CODE: + success = serve_entry_reads_request(&mssg); + break; - case REQ_ENTRY_READS_RPLY_CODE: + case REQ_ENTRY_READS_RPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received entry reads reply?!?.\n", FUNC); - break; + break; - case REQ_RW_COUNT_RESET_CODE: - success = serve_rw_count_reset_request(&mssg); - break; + case REQ_RW_COUNT_RESET_CODE: + success = serve_rw_count_reset_request(&mssg); + break; - case REQ_RW_COUNT_RESET_RPLY_CODE: + case REQ_RW_COUNT_RESET_RPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received RW count reset reply?!?.\n", FUNC); - break; + break; - case DONE_REQ_CODE: - done_count++; - if(done_count >= file_mpi_size) - done = TRUE; - break; + case DONE_REQ_CODE: + done_count++; + if(done_count >= file_mpi_size) + done = TRUE; + break; - default: + default: nerrors++; success = FALSE; if(verbose) - HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, FUNC); - break; + HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, FUNC); + break; } } } @@ -1537,23 +1536,23 @@ server_main(void) } /* server_main() */ - + /***************************************************************************** * - * Function: serve_read_request() + * Function: serve_read_request() * - * Purpose: Serve a read request. + * Purpose: Serve a read request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends - * a copy of the indicated datum from the data array to - * the requesting process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends + * a copy of the indicated datum from the data array to + * the requesting process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * *****************************************************************************/ static hbool_t @@ -1609,8 +1608,8 @@ serve_read_request(struct mssg_t * mssg_ptr) "%d:%s: proc %d read invalid entry. idx/base_addr = %d/%a.\n", world_mpi_rank, FUNC, mssg_ptr->src, - target_index, - data[target_index].base_addr); + target_index, + data[target_index].base_addr); } } else { @@ -1622,11 +1621,11 @@ serve_read_request(struct mssg_t * mssg_ptr) reply.base_addr = data[target_index].base_addr; reply.len = data[target_index].len; reply.ver = data[target_index].ver; - reply.count = 0; + reply.count = 0; reply.magic = MSSG_MAGIC; - /* and update the counters */ - total_reads++; + /* and update the counters */ + total_reads++; (data[target_index].reads)++; } } @@ -1641,7 +1640,7 @@ serve_read_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d read 0x%llx. len = %d. ver = %d.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (int)(data[target_index].len), (int)(data[target_index].ver)); @@ -1649,38 +1648,38 @@ serve_read_request(struct mssg_t * mssg_ptr) } else { HDfprintf(stdout, "%d read 0x%llx FAILED. len = %d. ver = %d.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (int)(data[target_index].len), (int)(data[target_index].ver)); } - } + } return(success); } /* serve_read_request() */ - + /***************************************************************************** * - * Function: serve_sync_request() + * Function: serve_sync_request() * - * Purpose: Serve a sync request. + * Purpose: Serve a sync request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends a - * sync ack to the requesting process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends a + * sync ack to the requesting process. * - * This service exist to allow the sending process to ensure - * that all previous messages have been processed before - * proceeding. + * This service exist to allow the sending process to ensure + * that all previous messages have been processed before + * proceeding. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/10/06 + * Programmer: JRM -- 5/10/06 * *****************************************************************************/ static hbool_t @@ -1712,7 +1711,7 @@ serve_sync_request(struct mssg_t * mssg_ptr) reply.base_addr = 0; reply.len = 0; reply.ver = 0; - reply.count = 0; + reply.count = 0; reply.magic = MSSG_MAGIC; } @@ -1732,29 +1731,29 @@ serve_sync_request(struct mssg_t * mssg_ptr) HDfprintf(stdout, "%d sync FAILED.\n", (int)(mssg_ptr->src)); } - } + } return(success); } /* serve_sync_request() */ - + /***************************************************************************** * - * Function: serve_write_request() + * Function: serve_write_request() * - * Purpose: Serve a write request. + * Purpose: Serve a write request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it updates - * the version number of the target data array entry as - * specified in the message. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it updates + * the version number of the target data array entry as + * specified in the message. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/21/05 + * Programmer: JRM -- 12/21/05 * *****************************************************************************/ static hbool_t @@ -1812,7 +1811,7 @@ serve_write_request(struct mssg_t * mssg_ptr) new_ver_num = mssg_ptr->ver; /* this check should catch duplicate writes */ - if ( new_ver_num <= data[target_index].ver ) { + if ( new_ver_num <= data[target_index].ver ) { nerrors++; success = FALSE; @@ -1826,12 +1825,12 @@ serve_write_request(struct mssg_t * mssg_ptr) if ( success ) { - /* process the write */ + /* process the write */ data[target_index].ver = new_ver_num; data[target_index].valid = TRUE; /* and update the counters */ - total_writes++; + total_writes++; (data[target_index].writes)++; #if DO_WRITE_REQ_ACK @@ -1847,7 +1846,7 @@ serve_write_request(struct mssg_t * mssg_ptr) reply.count = 0; reply.magic = MSSG_MAGIC; - /* and send it */ + /* and send it */ success = send_mssg(&reply, TRUE); #endif /* DO_WRITE_REQ_ACK */ @@ -1859,7 +1858,7 @@ serve_write_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d write 0x%llx. len = %d. ver = %d.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (int)(data[target_index].len), (int)(data[target_index].ver)); @@ -1867,36 +1866,36 @@ serve_write_request(struct mssg_t * mssg_ptr) } else { HDfprintf(stdout, "%d write 0x%llx FAILED. len = %d. ver = %d.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (int)(data[target_index].len), (int)(data[target_index].ver)); } - } + } return(success); } /* serve_write_request() */ - + /***************************************************************************** * - * Function: serve_total_writes_request() + * Function: serve_total_writes_request() * - * Purpose: Serve a request for the total number of writes recorded since - * the last reset. + * Purpose: Serve a request for the total number of writes recorded since + * the last reset. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends - * the current value of the total_writes global variable to - * the requesting process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends + * the current value of the total_writes global variable to + * the requesting process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -1942,40 +1941,40 @@ serve_total_writes_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d request total writes %ld.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), total_writes); } else { HDfprintf(stdout, "%d request total writes %ld -- FAILED.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), total_writes); } - } + } return(success); } /* serve_total_writes_request() */ - + /***************************************************************************** * - * Function: serve_total_reads_request() + * Function: serve_total_reads_request() * - * Purpose: Serve a request for the total number of reads recorded since - * the last reset. + * Purpose: Serve a request for the total number of reads recorded since + * the last reset. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends - * the current value of the total_reads global variable to - * the requesting process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends + * the current value of the total_reads global variable to + * the requesting process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -2021,40 +2020,40 @@ serve_total_reads_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d request total reads %ld.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), total_reads); } else { HDfprintf(stdout, "%d request total reads %ld -- FAILED.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), total_reads); } - } + } return(success); } /* serve_total_reads_request() */ - + /***************************************************************************** * - * Function: serve_entry_writes_request() + * Function: serve_entry_writes_request() * - * Purpose: Serve an entry writes request. + * Purpose: Serve an entry writes request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends - * the number of times that the indicated datum has been - * written since the last counter reset to the requesting - * process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends + * the number of times that the indicated datum has been + * written since the last counter reset to the requesting + * process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -2101,7 +2100,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr) reply.base_addr = target_addr; reply.len = 0; reply.ver = 0; - reply.count = data[target_index].writes; + reply.count = data[target_index].writes; reply.magic = MSSG_MAGIC; } } @@ -2116,42 +2115,42 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d request entry 0x%llx writes = %ld.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (long)(data[target_index].writes)); } else { HDfprintf(stdout, "%d request entry 0x%llx writes = %ld FAILED.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (long)(data[target_index].writes)); } - } + } return(success); } /* serve_entry_writes_request() */ - + /***************************************************************************** * - * Function: serve_entry_reads_request() + * Function: serve_entry_reads_request() * - * Purpose: Serve an entry reads request. + * Purpose: Serve an entry reads request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends - * the number of times that the indicated datum has been - * read since the last counter reset to the requesting - * process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends + * the number of times that the indicated datum has been + * read since the last counter reset to the requesting + * process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -2198,7 +2197,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr) reply.base_addr = target_addr; reply.len = 0; reply.ver = 0; - reply.count = (long)(data[target_index].reads); + reply.count = (long)(data[target_index].reads); reply.magic = MSSG_MAGIC; } } @@ -2213,41 +2212,41 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d request entry 0x%llx reads = %ld.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (long)(data[target_index].reads)); } else { HDfprintf(stdout, "%d request entry 0x%llx reads = %ld FAILED.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (long)(data[target_index].reads)); } - } + } return(success); } /* serve_entry_reads_request() */ - + /***************************************************************************** * - * Function: serve_rw_count_reset_request() + * Function: serve_rw_count_reset_request() * - * Purpose: Serve read/write count reset request. + * Purpose: Serve read/write count reset request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it resets the - * read/write counters, and sends a confirmation message to - * the calling process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it resets the + * read/write counters, and sends a confirmation message to + * the calling process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -2272,7 +2271,7 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr) if ( success ) { success = reset_server_counters(); - } + } if ( success ) { @@ -2306,7 +2305,7 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr) (int)(mssg_ptr->src)); } - } + } return(success); @@ -2317,15 +2316,15 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr) /**************************** Call back functions ****************************/ /*****************************************************************************/ - + /*------------------------------------------------------------------------- - * Function: datum_get_initial_load_size + * Function: datum_get_initial_load_size * - * Purpose: Query the image size for an entry before deserializing it + * Purpose: Query the image size for an entry before deserializing it * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 5/18/10 * *------------------------------------------------------------------------- @@ -2355,9 +2354,9 @@ datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr) if ( callbacks_verbose ) { HDfprintf(stdout, - "%d: get_initial_load_size() idx = %d, addr = %ld, len = %d.\n", + "%d: get_initial_load_size() idx = %d, addr = %ld, len = %d.\n", world_mpi_rank, idx, (long)addr, (int)entry_ptr->local_len); - fflush(stdout); + fflush(stdout); } /* Set image length size */ @@ -2366,15 +2365,15 @@ datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr) return(SUCCEED); } /* get_initial_load_size() */ - + /*------------------------------------------------------------------------- - * Function: datum_deserialize + * Function: datum_deserialize * - * Purpose: deserialize the entry. + * Purpose: deserialize the entry. * - * Return: void * (pointer to the in core representation of the entry) + * Return: void * (pointer to the in core representation of the entry) * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/20/07 * *------------------------------------------------------------------------- @@ -2409,10 +2408,10 @@ datum_deserialize(const void * image_ptr, if ( callbacks_verbose ) { HDfprintf(stdout, - "%d: deserialize() idx = %d, addr = %ld, len = %d, is_dirty = %d.\n", - world_mpi_rank, idx, (long)addr, (int)len, - (int)(entry_ptr->header.is_dirty)); - fflush(stdout); + "%d: deserialize() idx = %d, addr = %ld, len = %d, is_dirty = %d.\n", + world_mpi_rank, idx, (long)addr, (int)len, + (int)(entry_ptr->header.is_dirty)); + fflush(stdout); } *dirty_ptr = FALSE; @@ -2427,18 +2426,18 @@ datum_deserialize(const void * image_ptr, } /* deserialize() */ - + /*------------------------------------------------------------------------- - * Function: datum_image_len + * Function: datum_image_len * - * Purpose: Return the real (and possibly reduced) length of the image. - * The helper functions verify that the correct version of - * deserialize is being called, and then call deserialize - * proper. + * Purpose: Return the real (and possibly reduced) length of the image. + * The helper functions verify that the correct version of + * deserialize is being called, and then call deserialize + * proper. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/19/07 * *------------------------------------------------------------------------- @@ -2465,10 +2464,10 @@ datum_image_len(const void *thing, size_t *image_len) if(callbacks_verbose) { HDfprintf(stdout, - "%d: image_len() idx = %d, addr = %ld, len = %d.\n", - world_mpi_rank, idx, (long)(entry_ptr->base_addr), - (int)(entry_ptr->local_len)); - fflush(stdout); + "%d: image_len() idx = %d, addr = %ld, len = %d.\n", + world_mpi_rank, idx, (long)(entry_ptr->base_addr), + (int)(entry_ptr->local_len)); + fflush(stdout); } HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); @@ -2478,15 +2477,15 @@ datum_image_len(const void *thing, size_t *image_len) return(SUCCEED); } /* datum_image_len() */ - + /*------------------------------------------------------------------------- - * Function: datum_serialize + * Function: datum_serialize * - * Purpose: Serialize the supplied entry. + * Purpose: Serialize the supplied entry. * - * Return: SUCCEED if successful, FAIL otherwise. + * Return: SUCCEED if successful, FAIL otherwise. * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/30/07 * *------------------------------------------------------------------------- @@ -2511,11 +2510,11 @@ datum_serialize(const H5F_t *f, HDassert( f ); HDassert( f->shared ); HDassert( f->shared->cache ); - + cache_ptr = f->shared->cache; HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->aux_ptr ); + HDassert( cache_ptr->aux_ptr ); aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr); @@ -2534,9 +2533,9 @@ datum_serialize(const H5F_t *f, if ( callbacks_verbose ) { HDfprintf(stdout, - "%d: serialize() idx = %d, addr = %ld, len = %d.\n", - world_mpi_rank, idx, (long)entry_ptr->header.addr, (int)len); - fflush(stdout); + "%d: serialize() idx = %d, addr = %ld, len = %d.\n", + world_mpi_rank, idx, (long)entry_ptr->header.addr, (int)len); + fflush(stdout); } HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); @@ -2557,16 +2556,16 @@ datum_serialize(const H5F_t *f, } /* datum_serialize() */ - + /*------------------------------------------------------------------------- - * Function: datum_notify + * Function: datum_notify * - * Purpose: Do the communication with the server we used to do in the - * flush and load callbacks in the version 2 cache. + * Purpose: Do the communication with the server we used to do in the + * flush and load callbacks in the version 2 cache. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer + * Programmer: John Mainzer * 1/12/15 * *------------------------------------------------------------------------- @@ -2596,7 +2595,7 @@ datum_notify(H5C_notify_action_t action, void *thing) HDfprintf(stdout, "%d: notify() action = %d, idx = %d, addr = %ld.\n", - world_mpi_rank, (int) action, idx, + world_mpi_rank, (int) action, idx, (long)entry_ptr->header.addr); fflush(stdout); } @@ -2685,62 +2684,62 @@ datum_notify(H5C_notify_action_t action, void *thing) } #if 0 /* This has been useful debugging code -- keep it for now. */ - if ( mssg.req != READ_REQ_REPLY_CODE ) { + if ( mssg.req != READ_REQ_REPLY_CODE ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n", - world_mpi_rank, FUNC); - HDfprintf(stdout, "%d:%s: mssg.req = %d.\n", - world_mpi_rank, FUNC, (int)(mssg.req)); - } + world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: mssg.req = %d.\n", + world_mpi_rank, FUNC, (int)(mssg.req)); + } - if ( mssg.src != world_server_mpi_rank ) { + if ( mssg.src != world_server_mpi_rank ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: mssg.src != world_server_mpi_rank.\n", - world_mpi_rank, FUNC); - } + world_mpi_rank, FUNC); + } - if ( mssg.dest != world_mpi_rank ) { + if ( mssg.dest != world_mpi_rank ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: mssg.dest != world_mpi_rank.\n", - world_mpi_rank, FUNC); + world_mpi_rank, FUNC); } - if ( mssg.base_addr != entry_ptr->base_addr ) { + if ( mssg.base_addr != entry_ptr->base_addr ) { - HDfprintf(stdout, - "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n", - world_mpi_rank, FUNC); - HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n", - world_mpi_rank, FUNC, mssg.base_addr); - HDfprintf(stdout, + HDfprintf(stdout, + "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n", + world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n", + world_mpi_rank, FUNC, mssg.base_addr); + HDfprintf(stdout, "%d:%s: entry_ptr->base_addr = %a.\n", - world_mpi_rank, FUNC, + world_mpi_rank, FUNC, entry_ptr->base_addr); } - if ( mssg.len != entry_ptr->len ) { + if ( mssg.len != entry_ptr->len ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: mssg.len != entry_ptr->len.\n", - world_mpi_rank, FUNC); - HDfprintf(stdout, "%d:%s: mssg.len = %a.\n", - world_mpi_rank, FUNC, mssg.len); + world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: mssg.len = %a.\n", + world_mpi_rank, FUNC, mssg.len); } - if ( mssg.ver < entry_ptr->ver ) { + if ( mssg.ver < entry_ptr->ver ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: mssg.ver < entry_ptr->ver.\n", - world_mpi_rank, FUNC); + world_mpi_rank, FUNC); } - if ( mssg.magic != MSSG_MAGIC ) { + if ( mssg.magic != MSSG_MAGIC ) { - HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n", + world_mpi_rank, FUNC); } #endif /* JRM */ @@ -2753,7 +2752,7 @@ datum_notify(H5C_notify_action_t action, void *thing) } break; - case H5C_NOTIFY_ACTION_AFTER_FLUSH: + case H5C_NOTIFY_ACTION_AFTER_FLUSH: if ( callbacks_verbose ) { HDfprintf(stdout, @@ -2767,11 +2766,11 @@ datum_notify(H5C_notify_action_t action, void *thing) aux_ptr = entry_ptr->aux_ptr; entry_ptr->aux_ptr = NULL; - HDassert(entry_ptr->header.is_dirty); /* JRM */ + HDassert(entry_ptr->header.is_dirty); /* JRM */ - if ( ( file_mpi_rank != 0 ) && + if ( ( file_mpi_rank != 0 ) && ( entry_ptr->dirty ) && - ( aux_ptr->metadata_write_strategy == + ( aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY ) ) { ret_value = FAIL; @@ -2784,8 +2783,8 @@ datum_notify(H5C_notify_action_t action, void *thing) if ( entry_ptr->header.is_dirty ) { - was_dirty = TRUE; /* so we will receive the ack - * if requested + was_dirty = TRUE; /* so we will receive the ack + * if requested */ /* compose the message */ @@ -2811,7 +2810,7 @@ datum_notify(H5C_notify_action_t action, void *thing) else { entry_ptr->dirty = FALSE; - entry_ptr->flushed = TRUE; + entry_ptr->flushed = TRUE; } } } @@ -2839,7 +2838,7 @@ datum_notify(H5C_notify_action_t action, void *thing) nerrors++; ret_value = FAIL; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n", world_mpi_rank, FUNC); } @@ -2855,7 +2854,7 @@ datum_notify(H5C_notify_action_t action, void *thing) datum_pinned_flushes++; HDassert(entry_ptr->global_pinned || entry_ptr->local_pinned); } - break; + break; case H5AC_NOTIFY_ACTION_BEFORE_EVICT: if ( callbacks_verbose ) { @@ -2950,33 +2949,33 @@ datum_notify(H5C_notify_action_t action, void *thing) /* do nothing */ break; - default: + default: nerrors++; ret_value = FAIL; if ( verbose ) { HDfprintf(stdout, "%d:%s: Unknown notify action.\n", world_mpi_rank, FUNC); } - break; + break; } return(ret_value); } /* datum_notify() */ - + /*------------------------------------------------------------------------- - * Function: datum_free_icr + * Function: datum_free_icr * - * Purpose: Nominally, this callback is supposed to free the - * in core representation of the entry. + * Purpose: Nominally, this callback is supposed to free the + * in core representation of the entry. * - * In the context of this test bed, we use it to do - * do all the processing we used to do on a destroy. + * In the context of this test bed, we use it to do + * do all the processing we used to do on a destroy. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/19/07 * *------------------------------------------------------------------------- @@ -3001,9 +3000,9 @@ datum_free_icr(void * thing) if ( callbacks_verbose ) { HDfprintf(stdout, - "%d: free_icr() idx = %d, dirty = %d.\n", - world_mpi_rank, idx, (int)(entry_ptr->dirty)); - fflush(stdout); + "%d: free_icr() idx = %d, dirty = %d.\n", + world_mpi_rank, idx, (int)(entry_ptr->dirty)); + fflush(stdout); } HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); @@ -3020,7 +3019,7 @@ datum_free_icr(void * thing) return(SUCCEED); } /* datum_free_icr() */ - + /*****************************************************************************/ /************************** test utility functions ***************************/ /*****************************************************************************/ @@ -3029,9 +3028,9 @@ datum_free_icr(void * thing) * Function: expunge_entry() * * Purpose: Expunge the entry indicated by the type and index, mark it - * as clean, and don't increment its version number. + * as clean, and don't increment its version number. * - * Do nothing if nerrors is non-zero on entry. + * Do nothing if nerrors is non-zero on entry. * * Return: void * @@ -3062,36 +3061,36 @@ expunge_entry(H5F_t * file_ptr, if ( nerrors == 0 ) { result = H5AC_expunge_entry(file_ptr, (hid_t)-1, &(types[0]), - entry_ptr->header.addr, H5AC__NO_FLAGS_SET); + entry_ptr->header.addr, H5AC__NO_FLAGS_SET); if ( result < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n", + world_mpi_rank, FUNC); } } HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); - HDassert( ! ((entry_ptr->header).is_dirty) ); + HDassert( ! ((entry_ptr->header).is_dirty) ); - result = H5C_get_entry_status(file_ptr, entry_ptr->base_addr, - NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + result = H5C_get_entry_status(file_ptr, entry_ptr->base_addr, + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if ( result < 0 ) { + if ( result < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n", + world_mpi_rank, FUNC); } } else if ( in_cache ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n", + world_mpi_rank, FUNC); } } } @@ -3100,14 +3099,14 @@ expunge_entry(H5F_t * file_ptr, } /* expunge_entry() */ - + /***************************************************************************** * Function: insert_entry() * * Purpose: Insert the entry indicated by the type and index, mark it - * as dirty, and increment its version number. + * as dirty, and increment its version number. * - * Do nothing if nerrors is non-zero on entry. + * Do nothing if nerrors is non-zero on entry. * * Return: void * @@ -3158,33 +3157,33 @@ insert_entry(H5C_t * cache_ptr, nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n", + world_mpi_rank, FUNC); } } if ( ! (entry_ptr->header.is_dirty) ) { - /* it is possible that we just exceeded the dirty bytes - * threshold, triggering a write of the newly inserted - * entry. Test for this, and only flag an error if this - * is not the case. - */ + /* it is possible that we just exceeded the dirty bytes + * threshold, triggering a write of the newly inserted + * entry. Test for this, and only flag an error if this + * is not the case. + */ - struct H5AC_aux_t * aux_ptr; + struct H5AC_aux_t * aux_ptr; - aux_ptr = ((H5AC_aux_t *)(cache_ptr->aux_ptr)); + aux_ptr = ((H5AC_aux_t *)(cache_ptr->aux_ptr)); - if ( ! ( ( aux_ptr != NULL ) && - ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) && - ( aux_ptr->dirty_bytes == 0 ) ) ) { + if ( ! ( ( aux_ptr != NULL ) && + ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) && + ( aux_ptr->dirty_bytes == 0 ) ) ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", - world_mpi_rank, FUNC, idx, + HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", + world_mpi_rank, FUNC, idx, (int)(data[idx].header.is_dirty)); - } + } } } @@ -3192,7 +3191,7 @@ insert_entry(H5C_t * cache_ptr, HDassert( entry_ptr->header.is_pinned ); entry_ptr->global_pinned = TRUE; - global_pins++; + global_pins++; } else { @@ -3209,7 +3208,7 @@ insert_entry(H5C_t * cache_ptr, } /* insert_entry() */ - + /***************************************************************************** * Function: local_pin_and_unpin_random_entries() * @@ -3228,8 +3227,8 @@ static void local_pin_and_unpin_random_entries(H5F_t * file_ptr, int min_idx, int max_idx, - int min_count, - int max_count) + int min_count, + int max_count) { if ( nerrors == 0 ) { @@ -3244,40 +3243,40 @@ local_pin_and_unpin_random_entries(H5F_t * file_ptr, HDassert( min_idx < max_idx ); HDassert( max_idx < NUM_DATA_ENTRIES ); HDassert( max_idx < virt_num_data_entries ); - HDassert( 0 <= min_count ); - HDassert( min_count < max_count ); + HDassert( 0 <= min_count ); + HDassert( min_count < max_count ); - count = (HDrand() % (max_count - min_count)) + min_count; + count = (HDrand() % (max_count - min_count)) + min_count; - HDassert( min_count <= count ); - HDassert( count <= max_count ); + HDassert( min_count <= count ); + HDassert( count <= max_count ); - for ( i = 0; i < count; i++ ) - { + for ( i = 0; i < count; i++ ) + { local_pin_random_entry(file_ptr, min_idx, max_idx); - } + } - count = (HDrand() % (max_count - min_count)) + min_count; + count = (HDrand() % (max_count - min_count)) + min_count; - HDassert( min_count <= count ); - HDassert( count <= max_count ); + HDassert( min_count <= count ); + HDassert( count <= max_count ); i = 0; - idx = 0; + idx = 0; - while ( ( i < count ) && ( idx >= 0 ) ) - { - via_unprotect = ( (((unsigned)i) & 0x0001) == 0 ); - idx = local_unpin_next_pinned_entry(file_ptr, idx, via_unprotect); - i++; - } + while ( ( i < count ) && ( idx >= 0 ) ) + { + via_unprotect = ( (((unsigned)i) & 0x0001) == 0 ); + idx = local_unpin_next_pinned_entry(file_ptr, idx, via_unprotect); + i++; + } } return; } /* local_pin_and_unpin_random_entries() */ - + /***************************************************************************** * Function: local_pin_random_entry() * @@ -3309,13 +3308,13 @@ local_pin_random_entry(H5F_t * file_ptr, HDassert( max_idx < NUM_DATA_ENTRIES ); HDassert( max_idx < virt_num_data_entries ); - do - { - idx = (HDrand() % (max_idx - min_idx)) + min_idx; + do + { + idx = (HDrand() % (max_idx - min_idx)) + min_idx; HDassert( min_idx <= idx ); HDassert( idx <= max_idx ); - } - while ( data[idx].global_pinned || data[idx].local_pinned ); + } + while ( data[idx].global_pinned || data[idx].local_pinned ); pin_entry(file_ptr, idx, FALSE, FALSE); } @@ -3324,7 +3323,7 @@ local_pin_random_entry(H5F_t * file_ptr, } /* local_pin_random_entry() */ - + /***************************************************************************** * Function: local_unpin_all_entries() * @@ -3340,7 +3339,7 @@ local_pin_random_entry(H5F_t * file_ptr, *****************************************************************************/ static void local_unpin_all_entries(H5F_t * file_ptr, - hbool_t via_unprotect) + hbool_t via_unprotect) { if ( nerrors == 0 ) { @@ -3349,25 +3348,25 @@ local_unpin_all_entries(H5F_t * file_ptr, HDassert( file_ptr ); - idx = 0; + idx = 0; - while ( idx >= 0 ) - { - idx = local_unpin_next_pinned_entry(file_ptr, - idx, via_unprotect); - } + while ( idx >= 0 ) + { + idx = local_unpin_next_pinned_entry(file_ptr, + idx, via_unprotect); + } } return; } /* local_unpin_all_entries() */ - + /***************************************************************************** * Function: local_unpin_next_pinned_entry() * * Purpose: Find the next locally pinned entry after the specified - * starting point, and unpin it. + * starting point, and unpin it. * * Do nothing if nerrors is non-zero on entry. * @@ -3382,7 +3381,7 @@ local_unpin_all_entries(H5F_t * file_ptr, static int local_unpin_next_pinned_entry(H5F_t * file_ptr, int start_idx, - hbool_t via_unprotect) + hbool_t via_unprotect) { int i = 0; int idx = -1; @@ -3394,39 +3393,39 @@ local_unpin_next_pinned_entry(H5F_t * file_ptr, HDassert( start_idx < NUM_DATA_ENTRIES ); HDassert( start_idx < virt_num_data_entries ); - idx = start_idx; + idx = start_idx; - while ( ( i < virt_num_data_entries ) && - ( ! ( data[idx].local_pinned ) ) ) - { - i++; - idx++; - if ( idx >= virt_num_data_entries ) { - idx = 0; - } - } + while ( ( i < virt_num_data_entries ) && + ( ! ( data[idx].local_pinned ) ) ) + { + i++; + idx++; + if ( idx >= virt_num_data_entries ) { + idx = 0; + } + } - if ( data[idx].local_pinned ) { + if ( data[idx].local_pinned ) { - unpin_entry(file_ptr, idx, FALSE, FALSE, via_unprotect); + unpin_entry(file_ptr, idx, FALSE, FALSE, via_unprotect); - } else { + } else { - idx = -1; - } + idx = -1; + } } return(idx); } /* local_unpin_next_pinned_entry() */ - + /***************************************************************************** * Function: lock_and_unlock_random_entries() * * Purpose: Obtain a random number in the closed interval [min_count, - * max_count]. Then protect and unprotect that number of - * random entries. + * max_count]. Then protect and unprotect that number of + * random entries. * * Do nothing if nerrors is non-zero on entry. * @@ -3467,12 +3466,12 @@ lock_and_unlock_random_entries(H5F_t * file_ptr, } /* lock_and_unlock_random_entries() */ - + /***************************************************************************** * Function: lock_and_unlock_random_entry() * * Purpose: Protect and then unprotect a random entry with index in - * the data[] array in the close interval [min_idx, max_idx]. + * the data[] array in the close interval [min_idx, max_idx]. * * Do nothing if nerrors is non-zero on entry. * @@ -3502,15 +3501,15 @@ lock_and_unlock_random_entry(H5F_t * file_ptr, HDassert( min_idx <= idx ); HDassert( idx <= max_idx ); - lock_entry(file_ptr, idx); - unlock_entry(file_ptr, idx, H5AC__NO_FLAGS_SET); + lock_entry(file_ptr, idx); + unlock_entry(file_ptr, idx, H5AC__NO_FLAGS_SET); } return; } /* lock_and_unlock_random_entry() */ - + /***************************************************************************** * Function: lock_entry() * @@ -3525,9 +3524,9 @@ lock_and_unlock_random_entry(H5F_t * file_ptr, * * Modifications: * - * JRM -- 7/11/06 - * Modified asserts to handle the new local_len field in - * datum. + * JRM -- 7/11/06 + * Modified asserts to handle the new local_len field in + * datum. * *****************************************************************************/ static void @@ -3544,30 +3543,30 @@ lock_entry(H5F_t * file_ptr, entry_ptr = &(data[idx]); - HDassert( ! (entry_ptr->locked) ); + HDassert( ! (entry_ptr->locked) ); - cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, + cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, H5AC_ind_read_dxpl_id, &(types[0]), entry_ptr->base_addr, - &entry_ptr->base_addr, + &entry_ptr->base_addr, H5AC__NO_FLAGS_SET); if ( ( cache_entry_ptr != (void *)(&(entry_ptr->header)) ) || ( entry_ptr->header.type != &(types[0]) ) || ( ( entry_ptr->len != entry_ptr->header.size ) && - ( entry_ptr->local_len != entry_ptr->header.size ) ) || + ( entry_ptr->local_len != entry_ptr->header.size ) ) || ( entry_ptr->base_addr != entry_ptr->header.addr ) ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n", + world_mpi_rank, FUNC); } } else { - entry_ptr->locked = TRUE; + entry_ptr->locked = TRUE; - } + } HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); } @@ -3604,33 +3603,33 @@ mark_entry_dirty(int32_t idx) entry_ptr = &(data[idx]); HDassert ( entry_ptr->locked || entry_ptr->global_pinned ); - HDassert ( ! (entry_ptr->local_pinned) ); + HDassert ( ! (entry_ptr->local_pinned) ); (entry_ptr->ver)++; entry_ptr->dirty = TRUE; - result = H5AC_mark_entry_dirty( (void *)entry_ptr); + result = H5AC_mark_entry_dirty( (void *)entry_ptr); if ( result < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: error in H5AC_mark_entry_dirty().\n", world_mpi_rank, FUNC); } } - else if ( ! ( entry_ptr->locked ) ) - { - global_dirty_pins++; - } + else if ( ! ( entry_ptr->locked ) ) + { + global_dirty_pins++; + } } return; } /* mark_entry_dirty() */ - + /***************************************************************************** * Function: pin_entry() * @@ -3647,8 +3646,8 @@ mark_entry_dirty(int32_t idx) static void pin_entry(H5F_t * file_ptr, int32_t idx, - hbool_t global, - hbool_t dirty) + hbool_t global, + hbool_t dirty) { unsigned int flags = H5AC__PIN_ENTRY_FLAG; struct datum * entry_ptr; @@ -3661,35 +3660,35 @@ pin_entry(H5F_t * file_ptr, entry_ptr = &(data[idx]); - HDassert ( ! (entry_ptr->global_pinned) ); - HDassert ( ! (entry_ptr->local_pinned) ); - HDassert ( ! ( dirty && ( ! global ) ) ); + HDassert ( ! (entry_ptr->global_pinned) ); + HDassert ( ! (entry_ptr->local_pinned) ); + HDassert ( ! ( dirty && ( ! global ) ) ); - lock_entry(file_ptr, idx); + lock_entry(file_ptr, idx); - if ( dirty ) { + if ( dirty ) { - flags |= H5AC__DIRTIED_FLAG; - } + flags |= H5AC__DIRTIED_FLAG; + } - unlock_entry(file_ptr, idx, flags); + unlock_entry(file_ptr, idx, flags); HDassert( (entry_ptr->header).is_pinned ); - HDassert( ( ! dirty ) || ( (entry_ptr->header).is_dirty ) ); + HDassert( ( ! dirty ) || ( (entry_ptr->header).is_dirty ) ); - if ( global ) { + if ( global ) { - entry_ptr->global_pinned = TRUE; + entry_ptr->global_pinned = TRUE; - global_pins++; + global_pins++; - } else { + } else { - entry_ptr->local_pinned = TRUE; + entry_ptr->local_pinned = TRUE; - local_pins++; + local_pins++; - } + } } return; @@ -3697,14 +3696,14 @@ pin_entry(H5F_t * file_ptr, } /* pin_entry() */ #ifdef H5_METADATA_TRACE_FILE - + /***************************************************************************** * Function: pin_protected_entry() * * Purpose: Insert the entry indicated by the type and index, mark it - * as dirty, and increment its version number. + * as dirty, and increment its version number. * - * Do nothing if nerrors is non-zero on entry. + * Do nothing if nerrors is non-zero on entry. * * Return: void * @@ -3714,7 +3713,7 @@ pin_entry(H5F_t * file_ptr, *****************************************************************************/ static void pin_protected_entry(int32_t idx, - hbool_t global) + hbool_t global) { herr_t result; struct datum * entry_ptr; @@ -3728,36 +3727,36 @@ pin_protected_entry(int32_t idx, if ( nerrors == 0 ) { - result = H5AC_pin_protected_entry((void *)entry_ptr); + result = H5AC_pin_protected_entry((void *)entry_ptr); if ( ( result < 0 ) || ( entry_ptr->header.type != &(types[0]) ) || ( ( entry_ptr->len != entry_ptr->header.size ) && - ( entry_ptr->local_len != entry_ptr->header.size ) )|| + ( entry_ptr->local_len != entry_ptr->header.size ) )|| ( entry_ptr->base_addr != entry_ptr->header.addr ) || - ( ! ( (entry_ptr->header).is_pinned ) ) ) { + ( ! ( (entry_ptr->header).is_pinned ) ) ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, - "%d:%s: Error in H5AC_pin_protected entry().\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, + "%d:%s: Error in H5AC_pin_protected entry().\n", + world_mpi_rank, FUNC); } } if ( global ) { - entry_ptr->global_pinned = TRUE; + entry_ptr->global_pinned = TRUE; - global_pins++; + global_pins++; - } else { + } else { - entry_ptr->local_pinned = TRUE; + entry_ptr->local_pinned = TRUE; - local_pins++; + local_pins++; - } + } HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); } @@ -3767,16 +3766,16 @@ pin_protected_entry(int32_t idx, } /* pin_protected_entry() */ #endif /* H5_METADATA_TRACE_FILE */ - + /***************************************************************************** * Function: move_entry() * * Purpose: Move the entry indicated old_idx to the entry indicated - * by new_idex. Touch up the data array so that flush will - * not choke. + * by new_idex. Touch up the data array so that flush will + * not choke. * - * Do nothing if nerrors isn't zero, or if old_idx equals - * new_idx. + * Do nothing if nerrors isn't zero, or if old_idx equals + * new_idx. * * Return: void * @@ -3790,8 +3789,8 @@ move_entry(H5F_t * file_ptr, int32_t new_idx) { herr_t result; - int tmp; - size_t tmp_len; + int tmp; + size_t tmp_len; haddr_t old_addr = HADDR_UNDEF; haddr_t new_addr = HADDR_UNDEF; struct datum * old_entry_ptr; @@ -3819,12 +3818,12 @@ move_entry(H5F_t * file_ptr, /* Moving will mark the entry dirty if it is not already */ old_entry_ptr->dirty = TRUE; - /* touch up versions, base_addrs, and data_index. Do this - * now as it is possible that the rename will trigger a + /* touch up versions, base_addrs, and data_index. Do this + * now as it is possible that the rename will trigger a * sync point. */ if(old_entry_ptr->ver < new_entry_ptr->ver) - old_entry_ptr->ver = new_entry_ptr->ver; + old_entry_ptr->ver = new_entry_ptr->ver; else (old_entry_ptr->ver)++; @@ -3838,11 +3837,11 @@ move_entry(H5F_t * file_ptr, old_entry_ptr->index = new_entry_ptr->index; new_entry_ptr->index = tmp; - if(old_entry_ptr->local_len != new_entry_ptr->local_len) { - tmp_len = old_entry_ptr->local_len; - old_entry_ptr->local_len = new_entry_ptr->local_len; - new_entry_ptr->local_len = tmp_len; - } /* end if */ + if(old_entry_ptr->local_len != new_entry_ptr->local_len) { + tmp_len = old_entry_ptr->local_len; + old_entry_ptr->local_len = new_entry_ptr->local_len; + new_entry_ptr->local_len = tmp_len; + } /* end if */ result = H5AC_move_entry(file_ptr, &(types[0]), old_addr, new_addr, H5AC_ind_read_dxpl_id); @@ -3850,8 +3849,8 @@ move_entry(H5F_t * file_ptr, nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n", + world_mpi_rank, FUNC); } } else { @@ -3860,27 +3859,27 @@ move_entry(H5F_t * file_ptr, if ( ! (old_entry_ptr->header.is_dirty) ) { - /* it is possible that we just exceeded the dirty bytes - * threshold, triggering a write of the newly inserted - * entry. Test for this, and only flag an error if this - * is not the case. - */ + /* it is possible that we just exceeded the dirty bytes + * threshold, triggering a write of the newly inserted + * entry. Test for this, and only flag an error if this + * is not the case. + */ - struct H5AC_aux_t * aux_ptr; + struct H5AC_aux_t * aux_ptr; - aux_ptr = ((H5AC_aux_t *)(file_ptr->shared->cache->aux_ptr)); + aux_ptr = ((H5AC_aux_t *)(file_ptr->shared->cache->aux_ptr)); - if ( ! ( ( aux_ptr != NULL ) && - ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) && - ( aux_ptr->dirty_bytes == 0 ) ) ) { + if ( ! ( ( aux_ptr != NULL ) && + ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) && + ( aux_ptr->dirty_bytes == 0 ) ) ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", - world_mpi_rank, FUNC, new_idx, + world_mpi_rank, FUNC, new_idx, (int)(data[new_idx].header.is_dirty)); - } + } } } else { @@ -3891,19 +3890,19 @@ move_entry(H5F_t * file_ptr, } /* move_entry() */ - + /***************************************************************************** * - * Function: reset_server_counts() + * Function: reset_server_counts() * - * Purpose: Send a message to the server process requesting it to reset - * its counters. Await confirmation message. + * Purpose: Send a message to the server process requesting it to reset + * its counters. Await confirmation message. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/6/10 + * Programmer: JRM -- 5/6/10 * *****************************************************************************/ static hbool_t @@ -3958,7 +3957,7 @@ reset_server_counts(void) nerrors++; success = FALSE; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: Bad data in req r/w counter reset reply.\n", world_mpi_rank, FUNC); } @@ -3969,15 +3968,15 @@ reset_server_counts(void) } /* reset_server_counts() */ - + /***************************************************************************** * Function: resize_entry() * * Purpose: Resize the pinned entry indicated by idx to the new_size. - * Note that new_size must be greater than 0, and must be - * less than or equal to the original size of the entry. + * Note that new_size must be greater than 0, and must be + * less than or equal to the original size of the entry. * - * Do nothing if nerrors isn't zero. + * Do nothing if nerrors isn't zero. * * Return: void * @@ -3987,7 +3986,7 @@ reset_server_counts(void) *****************************************************************************/ static void resize_entry(int32_t idx, - size_t new_size) + size_t new_size) { herr_t result; struct datum * entry_ptr; @@ -4001,21 +4000,21 @@ resize_entry(int32_t idx, HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); HDassert( !(entry_ptr->locked) ); - HDassert( ( entry_ptr->global_pinned ) && - ( ! entry_ptr->local_pinned ) ); - HDassert( ( entry_ptr->header.size == entry_ptr->len ) || - ( entry_ptr->header.size == entry_ptr->local_len ) ); - HDassert( new_size > 0 ); - HDassert( new_size <= entry_ptr->len ); + HDassert( ( entry_ptr->global_pinned ) && + ( ! entry_ptr->local_pinned ) ); + HDassert( ( entry_ptr->header.size == entry_ptr->len ) || + ( entry_ptr->header.size == entry_ptr->local_len ) ); + HDassert( new_size > 0 ); + HDassert( new_size <= entry_ptr->len ); - result = H5AC_resize_entry((void *)entry_ptr, new_size); + result = H5AC_resize_entry((void *)entry_ptr, new_size); if ( result < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n", + world_mpi_rank, FUNC); } } else { @@ -4025,7 +4024,7 @@ resize_entry(int32_t idx, HDassert( entry_ptr->header.size == new_size ); entry_ptr->dirty = TRUE; - entry_ptr->local_len = new_size; + entry_ptr->local_len = new_size; /* touch up version. */ @@ -4037,24 +4036,24 @@ resize_entry(int32_t idx, } /* resize_entry() */ - + /***************************************************************************** * - * Function: setup_cache_for_test() + * Function: setup_cache_for_test() * - * Purpose: Setup the parallel cache for a test, and return the file id - * and a pointer to the cache's internal data structures. + * Purpose: Setup the parallel cache for a test, and return the file id + * and a pointer to the cache's internal data structures. * - * To do this, we must create a file, flush it (so that we - * don't have to worry about entries in the metadata cache), - * look up the address of the metadata cache, and then instruct - * the cache to omit sanity checks on dxpl IDs. + * To do this, we must create a file, flush it (so that we + * don't have to worry about entries in the metadata cache), + * look up the address of the metadata cache, and then instruct + * the cache to omit sanity checks on dxpl IDs. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/4/06 + * Programmer: JRM -- 1/4/06 * *****************************************************************************/ static hbool_t @@ -4081,13 +4080,13 @@ setup_cache_for_test(hid_t * fid_ptr, if ( fid < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n", world_mpi_rank, FUNC); } } else if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC); } } else { @@ -4097,7 +4096,7 @@ setup_cache_for_test(hid_t * fid_ptr, if ( file_ptr == NULL ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n", + HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n", world_mpi_rank, FUNC); } } else { @@ -4107,13 +4106,13 @@ setup_cache_for_test(hid_t * fid_ptr, if ( cache_ptr == NULL ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n", + HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n", world_mpi_rank, FUNC); } } else if ( cache_ptr->magic != H5C__H5C_T_MAGIC ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Bad cache_ptr magic.\n", + HDfprintf(stdout, "%d:%s: Bad cache_ptr magic.\n", world_mpi_rank, FUNC); } } else { @@ -4132,7 +4131,7 @@ setup_cache_for_test(hid_t * fid_ptr, if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config) != SUCCEED ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config(1) failed.\n", world_mpi_rank, FUNC); @@ -4142,9 +4141,9 @@ setup_cache_for_test(hid_t * fid_ptr, config.metadata_write_strategy = metadata_write_strategy; if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config) - != SUCCEED ) { + != SUCCEED ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", world_mpi_rank, FUNC); @@ -4167,15 +4166,15 @@ setup_cache_for_test(hid_t * fid_ptr, nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n", + HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n", world_mpi_rank, FUNC); } - } else if ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != + } else if ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != H5AC__H5AC_AUX_T_MAGIC ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC.\n", world_mpi_rank, FUNC); } @@ -4184,14 +4183,14 @@ setup_cache_for_test(hid_t * fid_ptr, nerrors++; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: bad cache_ptr->aux_ptr->metadata_write_strategy\n", world_mpi_rank, FUNC); } } } - /* also verify that the expected metadata write strategy is reported + /* also verify that the expected metadata write strategy is reported * when we get the current configuration. */ @@ -4202,25 +4201,25 @@ setup_cache_for_test(hid_t * fid_ptr, if ( H5AC_get_cache_auto_resize_config(cache_ptr, &test_config) != SUCCEED ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config(2) failed.\n", world_mpi_rank, FUNC); - } else if ( test_config.metadata_write_strategy != + } else if ( test_config.metadata_write_strategy != metadata_write_strategy ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: unexpected metadata_write_strategy.\n", world_mpi_rank, FUNC); } } } - /* allocate space for test entries -- do this before we set the + /* allocate space for test entries -- do this before we set the * sync point done callback as it will dirty the superblock, requiring * another flush. If the sync point done callback is set, this will * cause a spurious failure. @@ -4233,10 +4232,10 @@ setup_cache_for_test(hid_t * fid_ptr, if ( actual_base_addr == HADDR_UNDEF ) { success = FALSE; - nerrors++; + nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5MF_alloc() failed.\n", + HDfprintf(stdout, "%d:%s: H5MF_alloc() failed.\n", world_mpi_rank, FUNC); } @@ -4247,10 +4246,10 @@ setup_cache_for_test(hid_t * fid_ptr, * if the size of the superblock is increase. */ success = FALSE; - nerrors++; + nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: actual_base_addr > BASE_ADDR.\n", + HDfprintf(stdout, "%d:%s: actual_base_addr > BASE_ADDR.\n", world_mpi_rank, FUNC); } } @@ -4263,7 +4262,7 @@ setup_cache_for_test(hid_t * fid_ptr, if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: second H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: second H5Fflush() failed.\n", world_mpi_rank, FUNC); } } @@ -4273,62 +4272,62 @@ setup_cache_for_test(hid_t * fid_ptr, if ( success ) { - if ( H5AC__set_write_done_callback(cache_ptr, do_sync) != SUCCEED ) { + if ( H5AC__set_write_done_callback(cache_ptr, do_sync) != SUCCEED ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, - "%d:%s: H5C_set_write_done_callback failed.\n", + HDfprintf(stdout, + "%d:%s: H5C_set_write_done_callback failed.\n", world_mpi_rank, FUNC); } - } + } } #endif /* DO_SYNC_AFTER_WRITE */ if ( success ) { - if ( H5AC__set_sync_point_done_callback(cache_ptr, verify_writes) != SUCCEED ) { + if ( H5AC__set_sync_point_done_callback(cache_ptr, verify_writes) != SUCCEED ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, - "%d:%s: H5AC__set_sync_point_done_callback failed.\n", + HDfprintf(stdout, + "%d:%s: H5AC__set_sync_point_done_callback failed.\n", world_mpi_rank, FUNC); } - } + } } return(success); } /* setup_cache_for_test() */ - + /***************************************************************************** * - * Function: verify_writes() + * Function: verify_writes() * - * Purpose: Verify that the indicated entries have been written exactly - * once each, and that the indicated total number of writes - * has been processed by the server process. Flag an error if - * discrepency is noted. Finally reset the counters maintained - * by the server process. + * Purpose: Verify that the indicated entries have been written exactly + * once each, and that the indicated total number of writes + * has been processed by the server process. Flag an error if + * discrepency is noted. Finally reset the counters maintained + * by the server process. * - * This function should only be called by the metadata cache - * as the "sync point done" function, as it must do some - * synchronization to avoid false positives. + * This function should only be called by the metadata cache + * as the "sync point done" function, as it must do some + * synchronization to avoid false positives. * - * Note that at present, this function does not allow for the - * case in which one or more of the indicated entries should - * have been written more than once since the last time the - * server process's counters were reset. That is fine for now, - * as with the current metadata write strategies, no entry - * should be written more than once per sync point. If this - * changes this limitation will have to be revisited. + * Note that at present, this function does not allow for the + * case in which one or more of the indicated entries should + * have been written more than once since the last time the + * server process's counters were reset. That is fine for now, + * as with the current metadata write strategies, no entry + * should be written more than once per sync point. If this + * changes this limitation will have to be revisited. * - * Return: void. + * Return: void. * - * Programmer: JRM -- 5/9/10 + * Programmer: JRM -- 5/9/10 * *****************************************************************************/ static void @@ -4404,7 +4403,7 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl) } /* final barrier to ensure that all processes think that the server - * counters have been reset before we leave the sync point. This + * counters have been reset before we leave the sync point. This * barrier is probaby not necessary at this point in time (5/9/10), * but I can think of at least one likely change to the metadata write * strategies that will require it -- hence its insertion now. @@ -4426,24 +4425,24 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl) } /* verify_writes() */ - + /***************************************************************************** * - * Function: setup_rand() + * Function: setup_rand() * - * Purpose: Use gettimeofday() to obtain a seed for rand(), print the - * seed to stdout, and then pass it to srand(). + * Purpose: Use gettimeofday() to obtain a seed for rand(), print the + * seed to stdout, and then pass it to srand(). * - * Increment nerrors if any errors are detected. + * Increment nerrors if any errors are detected. * - * Return: void. + * Return: void. * - * Programmer: JRM -- 1/12/06 + * Programmer: JRM -- 1/12/06 * * Modifications: * - * JRM -- 5/9/06 - * Modified function to facilitate setting predefined seeds. + * JRM -- 5/9/06 + * Modified function to facilitate setting predefined seeds. * *****************************************************************************/ static void @@ -4458,13 +4457,13 @@ setup_rand(void) if ( ( use_predefined_seeds ) && ( world_mpi_size == num_predefined_seeds ) ) { - HDassert( world_mpi_rank >= 0 ); - HDassert( world_mpi_rank < world_mpi_size ); + HDassert( world_mpi_rank >= 0 ); + HDassert( world_mpi_rank < world_mpi_size ); seed = predefined_seeds[world_mpi_rank]; - HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n", + HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n", world_mpi_rank, FUNC, seed); - fflush(stdout); + fflush(stdout); HDsrand(seed); } else { @@ -4473,7 +4472,7 @@ setup_rand(void) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n", + HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n", world_mpi_rank, FUNC); } } else { @@ -4491,21 +4490,21 @@ setup_rand(void) } /* setup_rand() */ - + /***************************************************************************** * - * Function: take_down_cache() + * Function: take_down_cache() * - * Purpose: Take down the parallel cache after a test. + * Purpose: Take down the parallel cache after a test. * - * To do this, we must close the file, and delete if if - * possible. + * To do this, we must close the file, and delete if if + * possible. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/4/06 + * Programmer: JRM -- 1/4/06 * *****************************************************************************/ static hbool_t @@ -4513,7 +4512,7 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr) { hbool_t success = TRUE; /* will set to FALSE if appropriate. */ - /* flush the file -- this should write out any remaining test + /* flush the file -- this should write out any remaining test * entries in the cache. */ if ( ( success ) && ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) ) { @@ -4526,7 +4525,7 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr) } } - /* Now reset the sync point done callback. Must do this as with + /* Now reset the sync point done callback. Must do this as with * the SWMR mods, the cache will do additional I/O on file close * un-related to the test entries, and thereby corrupt our counts * of entry writes. @@ -4557,7 +4556,7 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr) world_mpi_rank, FUNC); } - } + } if ( success ) { @@ -4574,11 +4573,11 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr) } } else { - /* verify that there have been no further writes of test + /* verify that there have been no further writes of test * entries during the close */ success = verify_total_writes(0); - + } } @@ -4586,19 +4585,19 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr) } /* take_down_cache() */ - + /***************************************************************************** * Function: verify_entry_reads * - * Purpose: Query the server to determine the number of times the - * indicated entry has been read since the last time the - * server counters were reset. + * Purpose: Query the server to determine the number of times the + * indicated entry has been read since the last time the + * server counters were reset. * - * Return TRUE if successful, and if the supplied expected - * number of reads matches the number of reads reported by - * the server process. + * Return TRUE if successful, and if the supplied expected + * number of reads matches the number of reads reported by + * the server process. * - * Return FALSE and flag an error otherwise. + * Return FALSE and flag an error otherwise. * * Return: TRUE if successful, FALSE otherwise. * @@ -4681,31 +4680,31 @@ verify_entry_reads(haddr_t addr, nerrors++; success = FALSE; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: rep/exp entry 0x%llx reads mismatch (%ld/%ld).\n", world_mpi_rank, FUNC, (long long)addr, reported_entry_reads, expected_entry_reads); } - } + } } return(success); } /* verify_entry_reads() */ - + /***************************************************************************** * Function: verify_entry_writes * - * Purpose: Query the server to determine the number of times the - * indicated entry has been written since the last time the - * server counters were reset. + * Purpose: Query the server to determine the number of times the + * indicated entry has been written since the last time the + * server counters were reset. * - * Return TRUE if successful, and if the supplied expected - * number of reads matches the number of reads reported by - * the server process. + * Return TRUE if successful, and if the supplied expected + * number of reads matches the number of reads reported by + * the server process. * - * Return FALSE and flag an error otherwise. + * Return FALSE and flag an error otherwise. * * Return: TRUE if successful, FALSE otherwise. * @@ -4788,36 +4787,36 @@ verify_entry_writes(haddr_t addr, nerrors++; success = FALSE; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: rep/exp entry 0x%llx writes mismatch (%ld/%ld).\n", world_mpi_rank, FUNC, (long long)addr, reported_entry_writes, expected_entry_writes); } - } + } } return(success); } /* verify_entry_writes() */ - + /***************************************************************************** * - * Function: verify_total_reads() + * Function: verify_total_reads() * - * Purpose: Query the server to obtain the total reads since the last - * server counter reset, and compare this value with the supplied - * expected value. + * Purpose: Query the server to obtain the total reads since the last + * server counter reset, and compare this value with the supplied + * expected value. * - * If the values match, return TRUE. + * If the values match, return TRUE. * - * If the values don't match, flag an error and return FALSE. + * If the values don't match, flag an error and return FALSE. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/6/10 + * Programmer: JRM -- 5/6/10 * *****************************************************************************/ static hbool_t @@ -4888,9 +4887,9 @@ verify_total_reads(int expected_total_reads) nerrors++; success = FALSE; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: reported/expected total reads mismatch (%ld/%ld).\n", - world_mpi_rank, FUNC, + world_mpi_rank, FUNC, reported_total_reads, expected_total_reads); } @@ -4901,24 +4900,24 @@ verify_total_reads(int expected_total_reads) } /* verify_total_reads() */ - + /***************************************************************************** * - * Function: verify_total_writes() + * Function: verify_total_writes() * - * Purpose: Query the server to obtain the total writes since the last - * server counter reset, and compare this value with the supplied - * expected value. + * Purpose: Query the server to obtain the total writes since the last + * server counter reset, and compare this value with the supplied + * expected value. * - * If the values match, return TRUE. + * If the values match, return TRUE. * - * If the values don't match, flag an error and return FALSE. + * If the values don't match, flag an error and return FALSE. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/6/10 + * Programmer: JRM -- 5/6/10 * *****************************************************************************/ static hbool_t @@ -4989,9 +4988,9 @@ verify_total_writes(unsigned expected_total_writes) nerrors++; success = FALSE; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: reported/expected total writes mismatch (%u/%u).\n", - world_mpi_rank, FUNC, + world_mpi_rank, FUNC, reported_total_writes, expected_total_writes); } } @@ -5001,7 +5000,7 @@ verify_total_writes(unsigned expected_total_writes) } /* verify_total_writes() */ - + /***************************************************************************** * Function: unlock_entry() * @@ -5016,8 +5015,8 @@ verify_total_writes(unsigned expected_total_writes) * * Modifications: * - * 7/11/06 - * Updated for the new local_len field in datum. + * 7/11/06 + * Updated for the new local_len field in datum. * *****************************************************************************/ static void @@ -5037,7 +5036,7 @@ unlock_entry(H5F_t * file_ptr, entry_ptr = &(data[idx]); - HDassert( entry_ptr->locked ); + HDassert( entry_ptr->locked ); dirtied = ((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG ); @@ -5053,7 +5052,7 @@ unlock_entry(H5F_t * file_ptr, if ( ( result < 0 ) || ( entry_ptr->header.type != &(types[0]) ) || ( ( entry_ptr->len != entry_ptr->header.size ) && - ( entry_ptr->local_len != entry_ptr->header.size ) ) || + ( entry_ptr->local_len != entry_ptr->header.size ) ) || ( entry_ptr->base_addr != entry_ptr->header.addr ) ) { nerrors++; @@ -5065,7 +5064,7 @@ unlock_entry(H5F_t * file_ptr, entry_ptr->locked = FALSE; - } + } HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); @@ -5086,7 +5085,7 @@ unlock_entry(H5F_t * file_ptr, } /* unlock_entry() */ - + /***************************************************************************** * Function: unpin_entry() * @@ -5101,8 +5100,8 @@ unlock_entry(H5F_t * file_ptr, * * Modifications: * - * JRM -- 8/15/06 - * Added assertion that entry is pinned on entry. + * JRM -- 8/15/06 + * Added assertion that entry is pinned on entry. * *****************************************************************************/ static void @@ -5124,54 +5123,54 @@ unpin_entry(H5F_t * file_ptr, entry_ptr = &(data[idx]); - HDassert( (entry_ptr->header).is_pinned ); - HDassert ( ! ( entry_ptr->global_pinned && entry_ptr->local_pinned) ); - HDassert ( ( global && entry_ptr->global_pinned ) || - ( ! global && entry_ptr->local_pinned ) ); - HDassert ( ! ( dirty && ( ! global ) ) ); + HDassert( (entry_ptr->header).is_pinned ); + HDassert ( ! ( entry_ptr->global_pinned && entry_ptr->local_pinned) ); + HDassert ( ( global && entry_ptr->global_pinned ) || + ( ! global && entry_ptr->local_pinned ) ); + HDassert ( ! ( dirty && ( ! global ) ) ); - if ( via_unprotect ) { + if ( via_unprotect ) { - lock_entry(file_ptr, idx); + lock_entry(file_ptr, idx); - if ( dirty ) { + if ( dirty ) { - flags |= H5AC__DIRTIED_FLAG; - } + flags |= H5AC__DIRTIED_FLAG; + } - unlock_entry(file_ptr, idx, flags); + unlock_entry(file_ptr, idx, flags); - } else { + } else { - if ( dirty ) { + if ( dirty ) { - mark_entry_dirty(idx); + mark_entry_dirty(idx); - } + } - result = H5AC_unpin_entry(entry_ptr); + result = H5AC_unpin_entry(entry_ptr); - if ( result < 0 ) { + if ( result < 0 ) { nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: error in H5AC_unpin_entry().\n", - world_mpi_rank, FUNC); + world_mpi_rank, FUNC); } - } - } + } + } HDassert( ! ((entry_ptr->header).is_pinned) ); - if ( global ) { + if ( global ) { - entry_ptr->global_pinned = FALSE; + entry_ptr->global_pinned = FALSE; - } else { + } else { - entry_ptr->local_pinned = FALSE; + entry_ptr->local_pinned = FALSE; - } + } } return; @@ -5183,18 +5182,18 @@ unpin_entry(H5F_t * file_ptr, /****************************** test functions *******************************/ /*****************************************************************************/ - + /***************************************************************************** * - * Function: server_smoke_check() + * Function: server_smoke_check() * - * Purpose: Quick smoke check for the server process. + * Purpose: Quick smoke check for the server process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/21/05 + * Programmer: JRM -- 12/21/05 * *****************************************************************************/ static hbool_t @@ -5215,12 +5214,12 @@ server_smoke_check(void) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -5286,9 +5285,9 @@ server_smoke_check(void) #endif /* DO_WRITE_REQ_ACK */ - do_sync(); + do_sync(); - /* barrier to allow all writes to complete */ + /* barrier to allow all writes to complete */ if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) { success = FALSE; @@ -5303,12 +5302,12 @@ server_smoke_check(void) if ( success ) { success = verify_entry_writes(data[world_mpi_rank].base_addr, 1); - } + } if ( success ) { success = verify_entry_reads(data[world_mpi_rank].base_addr, 0); - } + } if ( success ) { @@ -5320,7 +5319,7 @@ server_smoke_check(void) success = verify_total_reads(0); } - /* barrier to allow all writes to complete */ + /* barrier to allow all writes to complete */ if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) { success = FALSE; @@ -5392,7 +5391,7 @@ server_smoke_check(void) } } - /* barrier to allow all writes to complete */ + /* barrier to allow all writes to complete */ if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) { success = FALSE; @@ -5407,12 +5406,12 @@ server_smoke_check(void) if ( success ) { success = verify_entry_writes(data[world_mpi_rank].base_addr, 1); - } + } if ( success ) { success = verify_entry_reads(data[world_mpi_rank].base_addr, 1); - } + } if ( success ) { @@ -5456,12 +5455,12 @@ server_smoke_check(void) if ( success ) { success = verify_entry_writes(data[world_mpi_rank].base_addr, 0); - } + } if ( success ) { success = verify_entry_reads(data[world_mpi_rank].base_addr, 0); - } + } if ( success ) { @@ -5514,9 +5513,9 @@ server_smoke_check(void) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -5531,18 +5530,18 @@ server_smoke_check(void) } /* server_smoke_check() */ - + /***************************************************************************** * - * Function: smoke_check_1() + * Function: smoke_check_1() * - * Purpose: First smoke check for the parallel cache. + * Purpose: First smoke check for the parallel cache. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/4/06 + * Programmer: JRM -- 1/4/06 * *****************************************************************************/ static hbool_t @@ -5558,23 +5557,23 @@ smoke_check_1(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #1 -- process 0 only md write strategy"); + TESTING("smoke check #1 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #1 -- distributed md write strategy"); + TESTING("smoke check #1 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #1 -- unknown md write strategy"); + TESTING("smoke check #1 -- unknown md write strategy"); } - break; + break; } nerrors = 0; @@ -5583,12 +5582,12 @@ smoke_check_1(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -5602,7 +5601,7 @@ smoke_check_1(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -5614,24 +5613,24 @@ smoke_check_1(int metadata_write_strategy) for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); } /* Move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); } /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); } if ( fid >= 0 ) { @@ -5640,7 +5639,7 @@ smoke_check_1(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -5686,9 +5685,9 @@ smoke_check_1(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -5703,21 +5702,21 @@ smoke_check_1(int metadata_write_strategy) } /* smoke_check_1() */ - + /***************************************************************************** * - * Function: smoke_check_2() + * Function: smoke_check_2() * - * Purpose: Second smoke check for the parallel cache. + * Purpose: Second smoke check for the parallel cache. * - * Introduce random reads, but keep all processes with roughly - * the same work load. + * Introduce random reads, but keep all processes with roughly + * the same work load. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/12/06 + * Programmer: JRM -- 1/12/06 * *****************************************************************************/ static hbool_t @@ -5733,23 +5732,23 @@ smoke_check_2(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #2 -- process 0 only md write strategy"); + TESTING("smoke check #2 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #2 -- distributed md write strategy"); + TESTING("smoke check #2 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #2 -- unknown md write strategy"); + TESTING("smoke check #2 -- unknown md write strategy"); } - break; + break; } nerrors = 0; @@ -5758,12 +5757,12 @@ smoke_check_2(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -5777,7 +5776,7 @@ smoke_check_2(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -5788,73 +5787,73 @@ smoke_check_2(int metadata_write_strategy) if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, 0, 10); + lock_and_unlock_random_entries(file_ptr, (i - 100), i, 0, 10); } } - for ( i = 0; i < (virt_num_data_entries / 2); i+=61 ) - { - /* Make sure we don't step on any locally pinned entries */ - if ( data[i].local_pinned ) { - unpin_entry(file_ptr, i, FALSE, FALSE, FALSE); - } + for ( i = 0; i < (virt_num_data_entries / 2); i+=61 ) + { + /* Make sure we don't step on any locally pinned entries */ + if ( data[i].local_pinned ) { + unpin_entry(file_ptr, i, FALSE, FALSE, FALSE); + } - pin_entry(file_ptr, i, TRUE, FALSE); - } + pin_entry(file_ptr, i, TRUE, FALSE); + } for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-=2 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 20), - 0, 100); - local_pin_and_unpin_random_entries(file_ptr, 0, - (virt_num_data_entries / 4), - 0, 3); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 20), + 0, 100); + local_pin_and_unpin_random_entries(file_ptr, 0, + (virt_num_data_entries / 4), + 0, 3); } for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 10), - 0, 100); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 10), + 0, 100); } - /* we can't move pinned entries, so release any local pins now. */ - local_unpin_all_entries(file_ptr, FALSE); + /* we can't move pinned entries, so release any local pins now. */ + local_unpin_all_entries(file_ptr, FALSE); /* Move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - ((virt_num_data_entries / 50) - 1), + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + ((virt_num_data_entries / 50) - 1), 0, 100); } /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 100), - 0, 100); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 100), + 0, 100); } - for ( i = 0; i < (virt_num_data_entries / 2); i+=61 ) - { - hbool_t via_unprotect = ( (((unsigned)i) & 0x01) == 0 ); - hbool_t dirty = ( (((unsigned)i) & 0x02) == 0 ); + for ( i = 0; i < (virt_num_data_entries / 2); i+=61 ) + { + hbool_t via_unprotect = ( (((unsigned)i) & 0x01) == 0 ); + hbool_t dirty = ( (((unsigned)i) & 0x02) == 0 ); - unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect); - } + unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect); + } if ( fid >= 0 ) { @@ -5862,7 +5861,7 @@ smoke_check_2(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -5908,9 +5907,9 @@ smoke_check_2(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -5925,24 +5924,24 @@ smoke_check_2(int metadata_write_strategy) } /* smoke_check_2() */ - + /***************************************************************************** * - * Function: smoke_check_3() + * Function: smoke_check_3() * - * Purpose: Third smoke check for the parallel cache. + * Purpose: Third smoke check for the parallel cache. * - * Use random reads to vary the loads on the diffferent - * processors. Also force different cache size adjustments. + * Use random reads to vary the loads on the diffferent + * processors. Also force different cache size adjustments. * - * In this test, load process 0 heavily, and the other - * processes lightly. + * In this test, load process 0 heavily, and the other + * processes lightly. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/13/06 + * Programmer: JRM -- 1/13/06 * *****************************************************************************/ static hbool_t @@ -5962,23 +5961,23 @@ smoke_check_3(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #3 -- process 0 only md write strategy"); + TESTING("smoke check #3 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #3 -- distributed md write strategy"); + TESTING("smoke check #3 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #3 -- unknown md write strategy"); + TESTING("smoke check #3 -- unknown md write strategy"); } - break; + break; } nerrors = 0; @@ -5987,12 +5986,12 @@ smoke_check_3(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -6006,7 +6005,7 @@ smoke_check_3(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -6020,7 +6019,7 @@ smoke_check_3(int metadata_write_strategy) if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -6030,48 +6029,48 @@ smoke_check_3(int metadata_write_strategy) max_count = min_count + 50; for ( i = (virt_num_data_entries / 4); - i < (virt_num_data_entries / 2); - i++ ) + i < (virt_num_data_entries / 2); + i++ ) { insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - if ( i % 59 == 0 ) { + if ( i % 59 == 0 ) { - hbool_t dirty = ( (i % 2) == 0); + hbool_t dirty = ( (i % 2) == 0); - if ( data[i].local_pinned ) { - unpin_entry(file_ptr, i, FALSE, FALSE, FALSE); - } + if ( data[i].local_pinned ) { + unpin_entry(file_ptr, i, FALSE, FALSE, FALSE); + } - pin_entry(file_ptr, i, TRUE, dirty); + pin_entry(file_ptr, i, TRUE, dirty); - HDassert( !dirty || data[i].header.is_dirty ); - HDassert( data[i].header.is_pinned ); - HDassert( data[i].global_pinned ); - HDassert( ! data[i].local_pinned ); - } + HDassert( !dirty || data[i].header.is_dirty ); + HDassert( data[i].header.is_pinned ); + HDassert( data[i].global_pinned ); + HDassert( ! data[i].local_pinned ); + } if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } - local_pin_and_unpin_random_entries(file_ptr, 0, + local_pin_and_unpin_random_entries(file_ptr, 0, virt_num_data_entries / 4, - 0, (file_mpi_rank + 2)); + 0, (file_mpi_rank + 2)); - } + } - /* flush the file to be sure that we have no problems flushing - * pinned entries - */ + /* flush the file to be sure that we have no problems flushing + * pinned entries + */ if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC); } } @@ -6087,27 +6086,27 @@ smoke_check_3(int metadata_write_strategy) for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - if ( ( i >= (virt_num_data_entries / 4) ) && ( i % 59 == 0 ) ) { + if ( ( i >= (virt_num_data_entries / 4) ) && ( i % 59 == 0 ) ) { hbool_t via_unprotect = ( (((unsigned)i) & 0x02) == 0 ); - hbool_t dirty = ( (((unsigned)i) & 0x04) == 0 ); - - HDassert( data[i].global_pinned ); - HDassert( ! data[i].local_pinned ); - - unpin_entry(file_ptr, i, TRUE, dirty, - via_unprotect); - } - if ( i % 2 == 0 ) { - - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - local_pin_and_unpin_random_entries(file_ptr, 0, - virt_num_data_entries / 2, - 0, 2); - lock_and_unlock_random_entries(file_ptr, + hbool_t dirty = ( (((unsigned)i) & 0x04) == 0 ); + + HDassert( data[i].global_pinned ); + HDassert( ! data[i].local_pinned ); + + unpin_entry(file_ptr, i, TRUE, dirty, + via_unprotect); + } + if ( i % 2 == 0 ) { + + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + local_pin_and_unpin_random_entries(file_ptr, 0, + virt_num_data_entries / 2, + 0, 2); + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); - } + } } min_idx = 0; @@ -6120,9 +6119,9 @@ smoke_check_3(int metadata_write_strategy) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - lock_and_unlock_random_entries(file_ptr, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); } @@ -6135,22 +6134,22 @@ smoke_check_3(int metadata_write_strategy) /* move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 20), + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 20), min_count, max_count); } /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 40), + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 40), min_count, max_count); } @@ -6162,16 +6161,16 @@ smoke_check_3(int metadata_write_strategy) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - local_pin_and_unpin_random_entries(file_ptr, 0, - (virt_num_data_entries / 2), - 0, 5); + local_pin_and_unpin_random_entries(file_ptr, 0, + (virt_num_data_entries / 2), + 0, 5); - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -6185,7 +6184,7 @@ smoke_check_3(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -6232,9 +6231,9 @@ smoke_check_3(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -6249,24 +6248,24 @@ smoke_check_3(int metadata_write_strategy) } /* smoke_check_3() */ - + /***************************************************************************** * - * Function: smoke_check_4() + * Function: smoke_check_4() * - * Purpose: Fourth smoke check for the parallel cache. + * Purpose: Fourth smoke check for the parallel cache. * - * Use random reads to vary the loads on the diffferent - * processors. Also force different cache size adjustments. + * Use random reads to vary the loads on the diffferent + * processors. Also force different cache size adjustments. * - * In this test, load process 0 lightly, and the other - * processes heavily. + * In this test, load process 0 lightly, and the other + * processes heavily. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/13/06 + * Programmer: JRM -- 1/13/06 * *****************************************************************************/ static hbool_t @@ -6286,23 +6285,23 @@ smoke_check_4(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #4 -- process 0 only md write strategy"); + TESTING("smoke check #4 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #4 -- distributed md write strategy"); + TESTING("smoke check #4 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #4 -- unknown md write strategy"); + TESTING("smoke check #4 -- unknown md write strategy"); } - break; + break; } nerrors = 0; @@ -6311,12 +6310,12 @@ smoke_check_4(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -6330,7 +6329,7 @@ smoke_check_4(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -6345,7 +6344,7 @@ smoke_check_4(int metadata_write_strategy) if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -6354,23 +6353,23 @@ smoke_check_4(int metadata_write_strategy) max_count = min_count + 100; for ( i = (virt_num_data_entries / 4); - i < (virt_num_data_entries / 2); - i++ ) + i < (virt_num_data_entries / 2); + i++ ) { - if ( i % 2 == 0 ) { + if ( i % 2 == 0 ) { insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - } else { + } else { - /* Insert some entries pinned, and then unpin them - * immediately. We have tested pinned entries elsewhere, - * so it should be sufficient to verify that the - * entries are in fact pinned (which unpin_entry() should do). - */ + /* Insert some entries pinned, and then unpin them + * immediately. We have tested pinned entries elsewhere, + * so it should be sufficient to verify that the + * entries are in fact pinned (which unpin_entry() should do). + */ insert_entry(cache_ptr, file_ptr, i, H5C__PIN_ENTRY_FLAG); unpin_entry(file_ptr, i, TRUE, FALSE, FALSE); - } + } if ( i % 59 == 0 ) { @@ -6390,19 +6389,19 @@ smoke_check_4(int metadata_write_strategy) if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } local_pin_and_unpin_random_entries(file_ptr, 0, - (virt_num_data_entries / 4), + (virt_num_data_entries / 4), 0, (file_mpi_rank + 2)); } /* flush the file to be sure that we have no problems flushing - * pinned entries - */ + * pinned entries + */ if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { @@ -6429,13 +6428,13 @@ smoke_check_4(int metadata_write_strategy) unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect); } - if ( i % 2 == 0 ) { + if ( i % 2 == 0 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - lock_and_unlock_random_entries(file_ptr, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); - } + } } min_idx = 0; @@ -6444,14 +6443,14 @@ smoke_check_4(int metadata_write_strategy) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - lock_and_unlock_random_entries(file_ptr, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); } - /* we can't move pinned entries, so release any local pins now. */ - local_unpin_all_entries(file_ptr, FALSE); + /* we can't move pinned entries, so release any local pins now. */ + local_unpin_all_entries(file_ptr, FALSE); min_count = 10 * (file_mpi_rank % 4); max_count = min_count + 100; @@ -6459,22 +6458,22 @@ smoke_check_4(int metadata_write_strategy) /* move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 20), + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 20), min_count, max_count); } /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 40), + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 40), min_count, max_count); } @@ -6486,12 +6485,12 @@ smoke_check_4(int metadata_write_strategy) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -6502,7 +6501,7 @@ smoke_check_4(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -6549,9 +6548,9 @@ smoke_check_4(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -6566,19 +6565,19 @@ smoke_check_4(int metadata_write_strategy) } /* smoke_check_4() */ - + /***************************************************************************** * - * Function: smoke_check_5() + * Function: smoke_check_5() * - * Purpose: Similar to smoke check 1, but modified to verify that - * H5AC_mark_entry_dirty() works in the parallel case. + * Purpose: Similar to smoke check 1, but modified to verify that + * H5AC_mark_entry_dirty() works in the parallel case. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/18/06 + * Programmer: JRM -- 5/18/06 * *****************************************************************************/ static hbool_t @@ -6594,23 +6593,23 @@ smoke_check_5(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #5 -- process 0 only md write strategy"); + TESTING("smoke check #5 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #5 -- distributed md write strategy"); + TESTING("smoke check #5 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #5 -- unknown md write strategy"); + TESTING("smoke check #5 -- unknown md write strategy"); } - break; + break; } @@ -6620,12 +6619,12 @@ smoke_check_5(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -6640,7 +6639,7 @@ smoke_check_5(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -6650,60 +6649,60 @@ smoke_check_5(int metadata_write_strategy) insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); } - /* flush the file so we can lock known clean entries. */ + /* flush the file so we can lock known clean entries. */ if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC); } } for ( i = 0; i < (virt_num_data_entries / 4); i++ ) { - lock_entry(file_ptr, i); + lock_entry(file_ptr, i); - if ( i % 2 == 0 ) - { - mark_entry_dirty(i); - } + if ( i % 2 == 0 ) + { + mark_entry_dirty(i); + } - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - if ( i % 2 == 1 ) - { - if ( i % 4 == 1 ) { + if ( i % 2 == 1 ) + { + if ( i % 4 == 1 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - } + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + } - expunge_entry(file_ptr, i); - } + expunge_entry(file_ptr, i); + } } for ( i = (virt_num_data_entries / 2) - 1; i >= (virt_num_data_entries / 4); - i-- ) + i-- ) { - pin_entry(file_ptr, i, TRUE, FALSE); + pin_entry(file_ptr, i, TRUE, FALSE); - if ( i % 2 == 0 ) - { - if ( i % 8 <= 4 ) { + if ( i % 2 == 0 ) + { + if ( i % 8 <= 4 ) { - resize_entry(i, data[i].len / 2); - } + resize_entry(i, data[i].len / 2); + } mark_entry_dirty(i); - if ( i % 8 <= 4 ) { + if ( i % 8 <= 4 ) { - resize_entry(i, data[i].len); - } - } + resize_entry(i, data[i].len); + } + } - unpin_entry(file_ptr, i, TRUE, FALSE, FALSE); + unpin_entry(file_ptr, i, TRUE, FALSE, FALSE); } if ( fid >= 0 ) { @@ -6712,7 +6711,7 @@ smoke_check_5(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -6758,9 +6757,9 @@ smoke_check_5(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -6775,10 +6774,10 @@ smoke_check_5(int metadata_write_strategy) } /* smoke_check_5() */ - + /***************************************************************************** * - * Function: trace_file_check() + * Function: trace_file_check() * * Purpose: A basic test of the trace file capability. In essence, * we invoke all operations that generate trace file output, @@ -6808,11 +6807,11 @@ smoke_check_5(int metadata_write_strategy) * * This test is skipped if H5_METADATA_TRACE_FILE is undefined. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 6/13/06 + * Programmer: JRM -- 6/13/06 * *****************************************************************************/ static hbool_t @@ -6897,25 +6896,25 @@ trace_file_check(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: #ifdef H5_METADATA_TRACE_FILE expected_output = &expected_output_0; #endif /* H5_METADATA_TRACE_FILE */ if ( world_mpi_rank == 0 ) { - TESTING( - "trace file collection -- process 0 only md write strategy"); + TESTING( + "trace file collection -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: #ifdef H5_METADATA_TRACE_FILE expected_output = &expected_output_1; #endif /* H5_METADATA_TRACE_FILE */ if ( world_mpi_rank == 0 ) { - TESTING( - "trace file collection -- distributed md write strategy"); + TESTING( + "trace file collection -- distributed md write strategy"); } - break; + break; default: #ifdef H5_METADATA_TRACE_FILE @@ -6925,9 +6924,9 @@ trace_file_check(int metadata_write_strategy) expected_output = &expected_output_0; #endif /* H5_METADATA_TRACE_FILE */ if ( world_mpi_rank == 0 ) { - TESTING("trace file collection -- unknown md write strategy"); + TESTING("trace file collection -- unknown md write strategy"); } - break; + break; } #ifdef H5_METADATA_TRACE_FILE @@ -6938,12 +6937,12 @@ trace_file_check(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -6958,7 +6957,7 @@ trace_file_check(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -6970,58 +6969,58 @@ trace_file_check(int metadata_write_strategy) if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config) != SUCCEED ) { - nerrors++; - HDfprintf(stdout, + nerrors++; + HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n", world_mpi_rank, FUNC); } else { config.open_trace_file = TRUE; - strcpy(config.trace_file_name, "t_cache_trace.txt"); + strcpy(config.trace_file_name, "t_cache_trace.txt"); if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config) - != SUCCEED ) { + != SUCCEED ) { - nerrors++; - HDfprintf(stdout, + nerrors++; + HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", world_mpi_rank, FUNC); } } } - insert_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET); - insert_entry(cache_ptr, file_ptr, 1, H5AC__NO_FLAGS_SET); - insert_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET); - insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET); + insert_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET); + insert_entry(cache_ptr, file_ptr, 1, H5AC__NO_FLAGS_SET); + insert_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET); + insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET); - lock_entry(file_ptr, 0); - mark_entry_dirty(0); - unlock_entry(file_ptr, 0, H5AC__NO_FLAGS_SET); + lock_entry(file_ptr, 0); + mark_entry_dirty(0); + unlock_entry(file_ptr, 0, H5AC__NO_FLAGS_SET); - lock_entry(file_ptr, 1); + lock_entry(file_ptr, 1); pin_protected_entry(1, TRUE); - unlock_entry(file_ptr, 1, H5AC__NO_FLAGS_SET); + unlock_entry(file_ptr, 1, H5AC__NO_FLAGS_SET); unpin_entry(file_ptr, 1, TRUE, FALSE, FALSE); expunge_entry(file_ptr, 1); - lock_entry(file_ptr, 2); + lock_entry(file_ptr, 2); pin_protected_entry(2, TRUE); - unlock_entry(file_ptr, 2, H5AC__NO_FLAGS_SET); - mark_entry_dirty(2); + unlock_entry(file_ptr, 2, H5AC__NO_FLAGS_SET); + mark_entry_dirty(2); resize_entry(2, data[2].len / 2); resize_entry(2, data[2].len); unpin_entry(file_ptr, 2, TRUE, FALSE, FALSE); - move_entry(file_ptr, 0, 20); - move_entry(file_ptr, 0, 20); + move_entry(file_ptr, 0, 20); + move_entry(file_ptr, 0, 20); if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC); } } @@ -7033,8 +7032,8 @@ trace_file_check(int metadata_write_strategy) if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config) != SUCCEED ) { - nerrors++; - HDfprintf(stdout, + nerrors++; + HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n", world_mpi_rank, FUNC); @@ -7042,13 +7041,13 @@ trace_file_check(int metadata_write_strategy) config.open_trace_file = FALSE; config.close_trace_file = TRUE; - config.trace_file_name[0] = '\0'; + config.trace_file_name[0] = '\0'; if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config) - != SUCCEED ) { + != SUCCEED ) { - nerrors++; - HDfprintf(stdout, + nerrors++; + HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", world_mpi_rank, FUNC); } @@ -7061,7 +7060,7 @@ trace_file_check(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -7104,10 +7103,10 @@ trace_file_check(int metadata_write_strategy) if ( nerrors == 0 ) { - sprintf(trace_file_name, "t_cache_trace.txt.%d", - (int)file_mpi_rank); + sprintf(trace_file_name, "t_cache_trace.txt.%d", + (int)file_mpi_rank); - if ( (trace_file_ptr = HDfopen(trace_file_name, "r")) == NULL ) { + if ( (trace_file_ptr = HDfopen(trace_file_name, "r")) == NULL ) { nerrors++; if ( verbose ) { @@ -7115,59 +7114,59 @@ trace_file_check(int metadata_write_strategy) world_mpi_rank, FUNC); } } - } + } - i = 0; - while ( ( nerrors == 0 ) && ( ! done ) ) - { - if ( (*expected_output)[i] == NULL ) { + i = 0; + while ( ( nerrors == 0 ) && ( ! done ) ) + { + if ( (*expected_output)[i] == NULL ) { - expected_line_len = 0; + expected_line_len = 0; - } else { + } else { - expected_line_len = HDstrlen((*expected_output)[i]); - } + expected_line_len = HDstrlen((*expected_output)[i]); + } - if ( HDfgets(buffer, 255, trace_file_ptr) != NULL ) { + if ( HDfgets(buffer, 255, trace_file_ptr) != NULL ) { - actual_line_len = strlen(buffer); + actual_line_len = strlen(buffer); - } else { + } else { - actual_line_len = 0; - } + actual_line_len = 0; + } - if ( ( actual_line_len == 0 ) && ( expected_line_len == 0 ) ) { + if ( ( actual_line_len == 0 ) && ( expected_line_len == 0 ) ) { - done = TRUE; + done = TRUE; - } else if ( ( actual_line_len != expected_line_len ) || - ( HDstrcmp(buffer, (*expected_output)[i]) != 0 ) ) { + } else if ( ( actual_line_len != expected_line_len ) || + ( HDstrcmp(buffer, (*expected_output)[i]) != 0 ) ) { - nerrors++; + nerrors++; if ( verbose ) { HDfprintf(stdout, - "%d:%s: Unexpected data in trace file line %d.\n", + "%d:%s: Unexpected data in trace file line %d.\n", world_mpi_rank, FUNC, i); - HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n", - world_mpi_rank, FUNC, (*expected_output)[i], - expected_line_len); - HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n", - world_mpi_rank, FUNC, buffer, - actual_line_len); + HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n", + world_mpi_rank, FUNC, (*expected_output)[i], + expected_line_len); + HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n", + world_mpi_rank, FUNC, buffer, + actual_line_len); } - } else { - i++; - } - } + } else { + i++; + } + } - if ( trace_file_ptr != NULL ) { + if ( trace_file_ptr != NULL ) { - HDfclose(trace_file_ptr); - trace_file_ptr = NULL; + HDfclose(trace_file_ptr); + trace_file_ptr = NULL; #if 1 - HDremove(trace_file_name); + HDremove(trace_file_name); #endif } } @@ -7176,9 +7175,9 @@ trace_file_check(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -7204,18 +7203,18 @@ trace_file_check(int metadata_write_strategy) } /* trace_file_check() */ - + /***************************************************************************** * - * Function: smoke_check_6() + * Function: smoke_check_6() * - * Purpose: Sixth smoke check for the parallel cache. + * Purpose: Sixth smoke check for the parallel cache. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/13/06 + * Programmer: JRM -- 1/13/06 * *****************************************************************************/ static hbool_t @@ -7231,23 +7230,23 @@ smoke_check_6(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #6 -- process 0 only md write strategy"); + TESTING("smoke check #6 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #6 -- distributed md write strategy"); + TESTING("smoke check #6 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #6 -- unknown md write strategy"); + TESTING("smoke check #6 -- unknown md write strategy"); } - break; + break; } nerrors = 0; @@ -7256,12 +7255,12 @@ smoke_check_6(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -7277,7 +7276,7 @@ smoke_check_6(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -7327,11 +7326,11 @@ smoke_check_6(int metadata_write_strategy) HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); } - /* flush the file */ + /* flush the file */ if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC); } } @@ -7343,7 +7342,7 @@ smoke_check_6(int metadata_write_strategy) struct datum * entry_ptr; entry_ptr = &(data[i]); - lock_entry(file_ptr, i); + lock_entry(file_ptr, i); if(TRUE != entry_ptr->header.coll_access) { nerrors++; @@ -7364,7 +7363,7 @@ smoke_check_6(int metadata_write_strategy) struct datum * entry_ptr; entry_ptr = &(data[i]); - lock_entry(file_ptr, i); + lock_entry(file_ptr, i); if(FALSE != entry_ptr->header.coll_access) { nerrors++; @@ -7389,7 +7388,7 @@ smoke_check_6(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -7437,9 +7436,9 @@ smoke_check_6(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -7454,18 +7453,18 @@ smoke_check_6(int metadata_write_strategy) } /* smoke_check_6() */ - + /***************************************************************************** * - * Function: main() + * Function: main() * - * Purpose: Main function for the parallel cache test. + * Purpose: Main function for the parallel cache test. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: JRM -- 12/23/05 + * Programmer: JRM -- 12/23/05 * *****************************************************************************/ int @@ -7492,7 +7491,7 @@ main(int argc, char **argv) * calls. By then, MPI calls may not work. */ if (H5dont_atexit() < 0){ - printf("%d:Failed to turn off atexit processing. Continue.\n", + printf("%d:Failed to turn off atexit processing. Continue.\n", mpi_rank); }; H5open(); @@ -7503,32 +7502,32 @@ main(int argc, char **argv) #endif /* JRM */ if ( express_test ) { - virt_num_data_entries = EXPRESS_VIRT_NUM_DATA_ENTRIES; + virt_num_data_entries = EXPRESS_VIRT_NUM_DATA_ENTRIES; } else { - virt_num_data_entries = STD_VIRT_NUM_DATA_ENTRIES; + virt_num_data_entries = STD_VIRT_NUM_DATA_ENTRIES; } #ifdef H5_HAVE_MPE - if ( MAINPROCESS ) { printf(" Tests compiled for MPE.\n"); } + if ( MAINPROCESS ) { printf(" Tests compiled for MPE.\n"); } virt_num_data_entries = MPE_VIRT_NUM_DATA_ENTIES; #endif /* H5_HAVE_MPE */ if (MAINPROCESS){ - printf("===================================\n"); - printf("Parallel metadata cache tests\n"); - printf(" mpi_size = %d\n", mpi_size); - printf(" express_test = %d\n", express_test); - printf("===================================\n"); + printf("===================================\n"); + printf("Parallel metadata cache tests\n"); + printf(" mpi_size = %d\n", mpi_size); + printf(" express_test = %d\n", express_test); + printf("===================================\n"); } if ( mpi_size < 3 ) { if ( MAINPROCESS ) { - printf(" Need at least 3 processes. Exiting.\n"); + printf(" Need at least 3 processes. Exiting.\n"); } goto finish; } @@ -7547,8 +7546,8 @@ main(int argc, char **argv) /* setup file access property list with the world communicator */ if ( FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS)) ) { nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n", + if ( verbose ) { + HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n", world_mpi_rank, FUNC); } } @@ -7580,8 +7579,8 @@ main(int argc, char **argv) /* close the fapl before we set it up again */ if ( H5Pclose(fapl) < 0 ) { nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n", + if ( verbose ) { + HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n", world_mpi_rank, FUNC); } } @@ -7591,9 +7590,9 @@ main(int argc, char **argv) /* setup file access property list */ if ( FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS)) ) { - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n", + nerrors++; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n", world_mpi_rank, FUNC); } } @@ -7601,8 +7600,8 @@ main(int argc, char **argv) if ( H5Pset_fapl_mpio(fapl, file_mpi_comm, MPI_INFO_NULL) < 0 ) { nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n", + if ( verbose ) { + HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n", world_mpi_rank, FUNC); } } @@ -7620,7 +7619,7 @@ main(int argc, char **argv) HDfprintf(stdout, "Errors in test initialization. Exiting.\n"); } - goto finish; + goto finish; } /* run the tests */ @@ -7673,16 +7672,16 @@ finish: * and exit. */ MPI_Barrier(MPI_COMM_WORLD); - if (MAINPROCESS){ /* only process 0 reports */ - printf("===================================\n"); - if (failures){ - printf("***metadata cache tests detected %d failures***\n", + if (MAINPROCESS){ /* only process 0 reports */ + printf("===================================\n"); + if (failures){ + printf("***metadata cache tests detected %d failures***\n", failures); - } - else{ - printf("metadata cache tests finished with no failures\n"); - } - printf("===================================\n"); + } + else{ + printf("metadata cache tests finished with no failures\n"); + } + printf("===================================\n"); } takedown_derived_types(); diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index 524a63f..7fe0020 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -14,12 +14,11 @@ /* Programmer: John Mainzer * 7/13/15 * - * This file contains tests specific to the cache image - * feature implemented in H5C.c + * This file contains tests specific to the cache image + * feature implemented in H5C.c */ -#include "h5test.h" #include "testphdf5.h" -#include "testpar.h" + #include "cache_common.h" #include "genall5.h" @@ -28,7 +27,7 @@ #define DSET_SIZE (40 * CHUNK_SIZE) #define MAX_NUM_DSETS 256 #define PAR_NUM_DSETS 32 -#define PAGE_SIZE (4 * 1024) +#define PAGE_SIZE (4 * 1024) #define PB_SIZE (64 * PAGE_SIZE) /* global variable declarations: */ @@ -59,8 +58,8 @@ static void open_hdf5_file(const hbool_t create_file, hid_t * file_id_ptr, H5F_t ** file_ptr_ptr, H5C_t ** cache_ptr_ptr, - MPI_Comm comm, - MPI_Info info, + MPI_Comm comm, + MPI_Info info, int l_facc_type, const hbool_t all_coll_metadata_ops, const hbool_t coll_metadata_write, @@ -70,11 +69,11 @@ static void verify_data_sets(hid_t file_id, int min_dset, int max_dset); /* local test function declarations */ -static hbool_t parse_flags(int argc, char * argv[], hbool_t * setup_ptr, +static hbool_t parse_flags(int argc, char * argv[], hbool_t * setup_ptr, hbool_t * ici_ptr, int * file_idx_ptr, int * mpi_size_ptr, hbool_t display); static void usage(void); static unsigned construct_test_file(int test_file_index); -static void par_create_dataset(int dset_num, hid_t file_id, int mpi_rank, +static void par_create_dataset(int dset_num, hid_t file_id, int mpi_rank, int mpi_size); static void par_delete_dataset(int dset_num, hid_t file_id, int mpi_rank); static void par_verify_dataset(int dset_num, hid_t file_id, int mpi_rank); @@ -83,15 +82,15 @@ static hbool_t serial_insert_cache_image(int file_name_idx, int mpi_size); static void serial_verify_dataset(int dset_num, hid_t file_id, int mpi_size); /* top level test function declarations */ -static unsigned verify_cache_image_RO(int file_name_id, +static unsigned verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank); -static unsigned verify_cache_image_RW(int file_name_id, +static unsigned verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank); -static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, +static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size); - + /****************************************************************************/ /***************************** Utility Functions ****************************/ /****************************************************************************/ @@ -99,52 +98,52 @@ static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, /*------------------------------------------------------------------------- * Function: construct_test_file() * - * Purpose: This function attempts to mimic the typical "poor man's - * parallel use case in which the file is passed between - * processes, each of which open the file, write some data, - * close the file, and then pass control on to the next - * process. + * Purpose: This function attempts to mimic the typical "poor man's + * parallel use case in which the file is passed between + * processes, each of which open the file, write some data, + * close the file, and then pass control on to the next + * process. * - * In this case, we create one group for each process, and - * populate it with a "zoo" of HDF5 objects selected to - * (ideally) exercise all HDF5 on disk data structures. + * In this case, we create one group for each process, and + * populate it with a "zoo" of HDF5 objects selected to + * (ideally) exercise all HDF5 on disk data structures. * - * The end result is a test file used verify that PHDF5 - * can open a file with a cache image. + * The end result is a test file used verify that PHDF5 + * can open a file with a cache image. * - * Cycle of operation + * Cycle of operation * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create a data set in the file. + * 2) Create a data set in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file. + * 4) Open the file. * - * Verify that the metadata cache is instructed to load + * Verify that the metadata cache is instructed to load * the metadata cache image. * - * 5) Create a data set in the file. + * 5) Create a data set in the file. * - * 6) Close the file. If enough datasets have been created + * 6) Close the file. If enough datasets have been created * goto 7. Otherwise return to 4. * - * 7) Open the file R/O. + * 7) Open the file R/O. * * Verify that the file contains a metadata cache image * superblock extension message. - * - * 8) Verify all data sets. * - * Verify that the cache image has been loaded. + * 8) Verify all data sets. * - * 9) close the file. + * Verify that the cache image has been loaded. + * + * 9) close the file. * * Return: void * @@ -153,7 +152,7 @@ static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -175,7 +174,7 @@ construct_test_file(int test_file_index) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -184,7 +183,7 @@ construct_test_file(int test_file_index) HDassert(FILENAMES[test_file_index]); - if ( h5_fixname(FILENAMES[test_file_index], H5P_DEFAULT, + if ( h5_fixname(FILENAMES[test_file_index], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { @@ -193,13 +192,13 @@ construct_test_file(int test_file_index) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -210,7 +209,7 @@ construct_test_file(int test_file_index) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, + /* config_fsm */ TRUE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -225,7 +224,7 @@ construct_test_file(int test_file_index) /* md_write_strat */ 0); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -247,7 +246,7 @@ construct_test_file(int test_file_index) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -263,7 +262,7 @@ construct_test_file(int test_file_index) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -282,7 +281,7 @@ construct_test_file(int test_file_index) /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -356,7 +355,7 @@ construct_test_file(int test_file_index) /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -375,7 +374,7 @@ construct_test_file(int test_file_index) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 8) Open and close all data sets. + /* 8) Open and close all data sets. * * Verify that the cache image has been loaded. */ @@ -414,15 +413,15 @@ construct_test_file(int test_file_index) } /* construct_test_file() */ - + /*------------------------------------------------------------------------- * Function: create_data_sets() * * Purpose: If pass is TRUE on entry, create the specified data sets - * in the indicated file. + * in the indicated file. * - * Data sets and their contents must be well know, as we - * will verify that they contain the expected data later. + * Data sets and their contents must be well know, as we + * will verify that they contain the expected data later. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -436,15 +435,15 @@ construct_test_file(int test_file_index) * * Modifications: * - * Added min_dset and max_dset parameters and supporting - * code. This allows the caller to specify a range of - * datasets to create. - * JRM -- 8/20/15 + * Added min_dset and max_dset parameters and supporting + * code. This allows the caller to specify a range of + * datasets to create. + * JRM -- 8/20/15 * *------------------------------------------------------------------------- */ -static void +static void create_data_sets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "create_data_sets()"; @@ -666,8 +665,8 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) /* read the chunk from file */ if ( pass ) { - status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, - memspace_id, filespace_ids[m], + status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, + memspace_id, filespace_ids[m], H5P_DEFAULT, data_chunk); if ( status < 0 ) { @@ -692,7 +691,7 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) valid_chunk = FALSE; - if ( verbose ) { + if ( verbose ) { HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n", @@ -702,7 +701,7 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) HDfprintf(stdout, "m = %d, i = %d, j = %d, k = %d, l = %d\n", m, i, j, k, l); - } + } } } } @@ -712,12 +711,12 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) pass = FALSE; failure_mssg = "slab validation failed."; - if ( verbose ) { + if ( verbose ) { - fprintf(stdout, + fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", i, j, m); - } + } } } m++; @@ -768,16 +767,16 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) } /* create_data_sets() */ - + /*------------------------------------------------------------------------- * Function: delete_data_sets() * - * Purpose: If pass is TRUE on entry, verify and then delete the - * dataset(s) indicated by min_dset and max_dset in the - * indicated file. + * Purpose: If pass is TRUE on entry, verify and then delete the + * dataset(s) indicated by min_dset and max_dset in the + * indicated file. * - * Data sets and their contents must be well know, as we - * will verify that they contain the expected data later. + * Data sets and their contents must be well know, as we + * will verify that they contain the expected data later. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -792,17 +791,17 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) * Modifications: * * None. - * JRM -- 8/20/15 + * JRM -- 8/20/15 * *------------------------------------------------------------------------- */ -#if 0 +#if 0 /* this code will be needed to test full support of cache image * in parallel -- keep it around against that day. * * -- JRM */ -static void +static void delete_data_sets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "delete_data_sets()"; @@ -833,11 +832,11 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) { sprintf(dset_name, "/dset%03d", i); - if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) { + if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) { pass = FALSE; failure_mssg = "H5Ldelete() failed."; - } + } i++; } @@ -850,32 +849,32 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) } /* delete_data_sets() */ #endif - + /*------------------------------------------------------------------------- * Function: open_hdf5_file() * - * Purpose: If pass is true on entry, create or open the specified HDF5 - * and test to see if it has a metadata cache image superblock - * extension message. + * Purpose: If pass is true on entry, create or open the specified HDF5 + * and test to see if it has a metadata cache image superblock + * extension message. * - * Set pass to FALSE and issue a suitable failure - * message if either the file contains a metadata cache image - * superblock extension and mdci_sbem_expected is TRUE, or - * vise versa. + * Set pass to FALSE and issue a suitable failure + * message if either the file contains a metadata cache image + * superblock extension and mdci_sbem_expected is TRUE, or + * vise versa. * - * If mdci_sbem_expected is TRUE, also verify that the metadata - * cache has been advised of this. + * If mdci_sbem_expected is TRUE, also verify that the metadata + * cache has been advised of this. * - * If read_only is TRUE, open the file read only. Otherwise - * open the file read/write. + * If read_only is TRUE, open the file read only. Otherwise + * open the file read/write. * - * If set_mdci_fapl is TRUE, set the metadata cache image - * FAPL entry when opening the file, and verify that the - * metadata cache is notified. + * If set_mdci_fapl is TRUE, set the metadata cache image + * FAPL entry when opening the file, and verify that the + * metadata cache is notified. * - * If config_fsm is TRUE, setup the persistant free space - * manager. Note that this flag may only be set if - * create_file is also TRUE. + * If config_fsm is TRUE, setup the persistant free space + * manager. Note that this flag may only be set if + * create_file is also TRUE. * * Return pointers to the cache data structure and file data * structures. @@ -893,10 +892,10 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) * Modifications: * * Modified function to handle parallel file creates / opens. - * + * * JRM -- 2/1/17 * - * Modified function to handle + * Modified function to handle * *------------------------------------------------------------------------- */ @@ -904,17 +903,17 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) static void open_hdf5_file(const hbool_t create_file, const hbool_t mdci_sbem_expected, - const hbool_t read_only, - const hbool_t set_mdci_fapl, - const hbool_t config_fsm, + const hbool_t read_only, + const hbool_t set_mdci_fapl, + const hbool_t config_fsm, const hbool_t enable_page_buffer, - const char * hdf_file_name, + const char * hdf_file_name, const unsigned cache_image_flags, hid_t * file_id_ptr, H5F_t ** file_ptr_ptr, H5C_t ** cache_ptr_ptr, - MPI_Comm comm, - MPI_Info info, + MPI_Comm comm, + MPI_Info info, int l_facc_type, const hbool_t all_coll_metadata_ops, const hbool_t coll_metadata_write, @@ -941,8 +940,8 @@ open_hdf5_file(const hbool_t create_file, if ( pass ) { - /* opening the file both read only and with a cache image - * requested is a contradiction. We resolve it by ignoring + /* opening the file both read only and with a cache image + * requested is a contradiction. We resolve it by ignoring * the cache image request silently. */ if ( ( create_file && mdci_sbem_expected ) || @@ -969,7 +968,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* create a file access propertly list. */ @@ -984,13 +983,13 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* call H5Pset_libver_bounds() on the fapl_id */ if ( pass ) { - if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) + if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) { pass = FALSE; @@ -998,7 +997,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get metadata cache image config -- verify that it is the default */ @@ -1016,7 +1015,7 @@ open_hdf5_file(const hbool_t create_file, H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( cache_image_config.generate_image != FALSE ) || ( cache_image_config.save_resize_status != FALSE ) || - ( cache_image_config.entry_ageout != + ( cache_image_config.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ) { pass = FALSE; @@ -1024,7 +1023,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* set metadata cache image fapl entry if indicated */ @@ -1044,24 +1043,24 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the persistant free space manager if indicated */ if ( ( pass ) && ( config_fsm ) ) { - fcpl_id = H5Pcreate(H5P_FILE_CREATE); + fcpl_id = H5Pcreate(H5P_FILE_CREATE); - if ( fcpl_id <= 0 ) { + if ( fcpl_id <= 0 ) { - pass = FALSE; - failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed."; - } + pass = FALSE; + failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed."; + } } if ( ( pass ) && ( config_fsm ) ) { - if ( H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, + if ( H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) == FAIL ) { pass = FALSE; failure_mssg = "H5Pset_file_space_strategy() failed.\n"; @@ -1077,7 +1076,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the page buffer if indicated */ @@ -1087,10 +1086,10 @@ open_hdf5_file(const hbool_t create_file, pass = FALSE; failure_mssg = "H5Pset_page_buffer_size() failed.\n"; - } + } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -1098,13 +1097,13 @@ open_hdf5_file(const hbool_t create_file, /* set Parallel access with communicator */ if ( H5Pset_fapl_mpio(fapl_id, comm, info) < 0 ) { - + pass = FALSE; failure_mssg = "H5Pset_fapl_mpio() failed.\n"; } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( ( pass ) && ( l_facc_type == FACC_MPIO ) ) { @@ -1116,7 +1115,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( ( pass ) && ( l_facc_type == FACC_MPIO ) ) { @@ -1128,7 +1127,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( ( pass ) && ( l_facc_type == FACC_MPIO ) ) { @@ -1137,7 +1136,7 @@ open_hdf5_file(const hbool_t create_file, H5AC_cache_config_t mdc_config; mdc_config.version = H5C__CURR_AUTO_SIZE_CTL_VER; - + if ( H5Pget_mdc_config(fapl_id, &mdc_config) < 0 ) { pass = FALSE; @@ -1153,7 +1152,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* open the file */ @@ -1161,13 +1160,13 @@ open_hdf5_file(const hbool_t create_file, if ( create_file ) { - if ( fcpl_id != -1 ) + if ( fcpl_id != -1 ) - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, - fcpl_id, fapl_id); - else + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, + fcpl_id, fapl_id); + else - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); } else { @@ -1202,7 +1201,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get a pointer to the files internal data structure and then @@ -1221,12 +1220,12 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* verify expected page buffer status. At present, page buffering - * must be disabled in parallel -- hopefully this will change in the + /* verify expected page buffer status. At present, page buffering + * must be disabled in parallel -- hopefully this will change in the * future. */ if ( pass ) { @@ -1245,7 +1244,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -1265,7 +1264,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -1273,26 +1272,26 @@ open_hdf5_file(const hbool_t create_file, if ( set_mdci_fapl ) { - if ( read_only ) { + if ( read_only ) { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( image_ctl.generate_image != FALSE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { pass = FALSE; failure_mssg = "Unexpected image_ctl values(1).\n"; } - } else { + } else { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || - ( image_ctl.generate_image != TRUE ) || + ( image_ctl.generate_image != TRUE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { @@ -1302,11 +1301,11 @@ open_hdf5_file(const hbool_t create_file, } } else { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( image_ctl.generate_image != FALSE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { @@ -1316,7 +1315,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( ( pass ) && ( set_mdci_fapl ) ) { @@ -1330,7 +1329,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -1359,19 +1358,19 @@ open_hdf5_file(const hbool_t create_file, pass = FALSE; failure_mssg = "mdci sb extension message not present?\n"; } - } + } } else { - if ( ( cache_ptr->load_image == TRUE ) || + if ( ( cache_ptr->load_image == TRUE ) || ( cache_ptr->delete_image == TRUE ) ) { pass = FALSE; failure_mssg = "mdci sb extension message present?\n"; - } + } } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -1382,11 +1381,11 @@ open_hdf5_file(const hbool_t create_file, } if ( show_progress ) { - HDfprintf(stdout, "%s: cp = %d, pass = %d -- exiting.\n", + HDfprintf(stdout, "%s: cp = %d, pass = %d -- exiting.\n", fcn_name, cp++, pass); if ( ! pass ) - HDfprintf(stdout, "%s: failure_mssg = %s\n", + HDfprintf(stdout, "%s: failure_mssg = %s\n", fcn_name, failure_mssg); } @@ -1394,11 +1393,11 @@ open_hdf5_file(const hbool_t create_file, } /* open_hdf5_file() */ - + /*------------------------------------------------------------------------- * Function: par_create_dataset() * - * Purpose: Collectively create a chunked dataset, and fill it with + * Purpose: Collectively create a chunked dataset, and fill it with * known values. * * On failure, set pass to FALSE, and set failure_mssg @@ -1469,7 +1468,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* set the dataset creation plist to specify that the raw data is @@ -1487,7 +1486,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -1503,7 +1502,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* create the dataset */ @@ -1520,7 +1519,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get the file space ID */ @@ -1535,7 +1534,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* create the mem space to be used to read and write chunks */ @@ -1553,7 +1552,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* select in memory hyperslab */ @@ -1575,7 +1574,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the DXPL for collective I/O */ @@ -1590,7 +1589,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -1602,7 +1601,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* initialize the dataset with collective writes */ @@ -1613,8 +1612,8 @@ par_create_dataset(int dset_num, while ( ( pass ) && ( j < DSET_SIZE ) ) { - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d.0, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.0, pass = %d.\n", fcn_name, cp, pass); /* initialize the slab */ @@ -1628,8 +1627,8 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d.1, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.1, pass = %d.\n", fcn_name, cp, pass); /* select on disk hyperslab */ @@ -1637,7 +1636,7 @@ par_create_dataset(int dset_num, offset[1] = (hsize_t)i; offset[2] = (hsize_t)j; a_size[0] = (hsize_t)1; /* size of hyperslab */ - a_size[1] = CHUNK_SIZE; + a_size[1] = CHUNK_SIZE; a_size[2] = CHUNK_SIZE; status = H5Sselect_hyperslab(filespace_id, H5S_SELECT_SET, offset, NULL, a_size, NULL); @@ -1648,8 +1647,8 @@ par_create_dataset(int dset_num, failure_mssg = "disk H5Sselect_hyperslab() failed."; } - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d.2, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.2, pass = %d.\n", fcn_name, cp, pass); /* write the chunk to file */ @@ -1662,8 +1661,8 @@ par_create_dataset(int dset_num, failure_mssg = "H5Dwrite() failed."; } - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d.3, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.3, pass = %d.\n", fcn_name, cp, pass); j += CHUNK_SIZE; @@ -1673,7 +1672,7 @@ par_create_dataset(int dset_num, } cp++; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* read data from data sets and validate it */ @@ -1762,7 +1761,7 @@ par_create_dataset(int dset_num, i += CHUNK_SIZE; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* close the data space */ @@ -1807,14 +1806,14 @@ par_create_dataset(int dset_num, failure_mssg = "H5Pclose(dxpl) failed."; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); return; } /* par_create_dataset() */ - + /*------------------------------------------------------------------------- * Function: par_delete_dataset() * @@ -1862,7 +1861,7 @@ par_delete_dataset(int dset_num, par_verify_dataset(dset_num, file_id, mpi_rank); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* delete the target dataset */ @@ -1875,21 +1874,21 @@ par_delete_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); return; } /* par_delete_dataset() */ - + /*------------------------------------------------------------------------- * Function: par_insert_cache_image() * * Purpose: Insert a cache image in the supplied file. * - * At present, cache image is not enabled in the parallel - * so we have to insert the cache image with a serial + * At present, cache image is not enabled in the parallel + * so we have to insert the cache image with a serial * process. Do this via a fork and an execv from process 0. * All processes wait until the child process completes, and * then return. @@ -1935,22 +1934,22 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) /* fun and games to shutup the compiler */ char param0[32] = "t_cache_image"; char param1[32] = "ici"; - char * child_argv[] = {param0, - param1, - file_name_idx_str, - mpi_size_str, + char * child_argv[] = {param0, + param1, + file_name_idx_str, + mpi_size_str, NULL}; /* we may need to play with the path here */ if ( execv("t_cache_image", child_argv) == -1 ) { - HDfprintf(stdout, + HDfprintf(stdout, "execl() of ici process failed. errno = %d(%s)\n", errno, strerror(errno)); exit(1); } - } else if ( child_pid != -1 ) { + } else if ( child_pid != -1 ) { /* this is the parent process -- wait until child is done */ if ( -1 == waitpid(child_pid, &child_status, WUNTRACED)) { @@ -1973,7 +1972,7 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) } } else { /* fork failed */ - HDfprintf(stdout, + HDfprintf(stdout, "can't create process to insert cache image.\n"); pass = FALSE; } @@ -1982,8 +1981,8 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) if ( pass ) { - /* make sure insertion of the cache image is complete - * before proceeding + /* make sure insertion of the cache image is complete + * before proceeding */ MPI_Barrier(MPI_COMM_WORLD); } @@ -1992,7 +1991,7 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) } /* par_insert_cache_image() */ - + /*------------------------------------------------------------------------- * Function: par_verify_dataset() * @@ -2072,7 +2071,7 @@ par_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* create the mem space to be used to read */ @@ -2090,7 +2089,7 @@ par_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* select in memory hyperslab */ @@ -2112,7 +2111,7 @@ par_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the DXPL for collective I/O */ @@ -2127,7 +2126,7 @@ par_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -2139,7 +2138,7 @@ par_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* read data from data sets and validate it */ @@ -2228,7 +2227,7 @@ par_verify_dataset(int dset_num, i += CHUNK_SIZE; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* close the file space */ @@ -2259,23 +2258,23 @@ par_verify_dataset(int dset_num, failure_mssg = "H5Pclose(dxpl) failed."; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); return; } /* par_verify_dataset() */ - + /*------------------------------------------------------------------------- * Function: serial_insert_cache_image() * * Purpose: Insert a cache image in the supplied file. * - * To populate the cache image, validate the contents - * of the file before closing. + * To populate the cache image, validate the contents + * of the file before closing. * - * On failure, print an appropriate error message and + * On failure, print an appropriate error message and * return FALSE. * * Return: TRUE if succussful, FALSE otherwise. @@ -2329,7 +2328,7 @@ serial_insert_cache_image(int file_name_idx, int mpi_size ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 2) Open the PHDF5 file with the cache image FAPL entry. + /* 2) Open the PHDF5 file with the cache image FAPL entry. */ if ( pass ) { @@ -2388,7 +2387,7 @@ serial_insert_cache_image(int file_name_idx, int mpi_size ) } /* serial_insert_cache_image() */ - + /*------------------------------------------------------------------------- * Function: serial_verify_dataset() * @@ -2464,7 +2463,7 @@ serial_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* create the mem space to be used to read */ @@ -2482,7 +2481,7 @@ serial_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* select in memory hyperslab */ @@ -2504,7 +2503,7 @@ serial_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -2601,7 +2600,7 @@ serial_verify_dataset(int dset_num, } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* close the file space */ @@ -2625,18 +2624,18 @@ serial_verify_dataset(int dset_num, failure_mssg = "H5Sclose(memspace_id) failed."; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); return; } /* serial_verify_dataset() */ - + /*------------------------------------------------------------------------- * Function: parse_flags * - * Purpose: Parse the flags passed to this program, and load the + * Purpose: Parse the flags passed to this program, and load the * values into the supplied field. * * Return: Success: 1 @@ -2648,7 +2647,7 @@ serial_verify_dataset(int dset_num, *------------------------------------------------------------------------- */ static hbool_t -parse_flags(int argc, char * argv[], hbool_t * setup_ptr, +parse_flags(int argc, char * argv[], hbool_t * setup_ptr, hbool_t * ici_ptr, int * file_idx_ptr, int * mpi_size_ptr, hbool_t display) { const char * fcn_name = "parse_flags()"; @@ -2669,7 +2668,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr, } - if ( ( success ) && + if ( ( success ) && ( ( argc != 1 ) && ( argc != 2 ) && ( argc != 4 ) ) ) { success = FALSE; @@ -2716,7 +2715,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr, else if ( *ici_ptr ) - HDfprintf(stdout, "t_cache_image ici %d %d\n", + HDfprintf(stdout, "t_cache_image ici %d %d\n", *file_idx_ptr, *mpi_size_ptr); else @@ -2728,7 +2727,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr, } /* parse_flags() */ - + /*------------------------------------------------------------------------- * Function: usage * @@ -2738,7 +2737,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr, * Return: void * * Programmer: John Mainzer - * 4/28/11 + * 4/28/11 * * Modifications: * @@ -2792,17 +2791,17 @@ usage(void) return; } /* usage() */ - + /*------------------------------------------------------------------------- * Function: verify_data_sets() * - * Purpose: If pass is TRUE on entry, verify that the data sets in the - * file exist and contain the expected data. + * Purpose: If pass is TRUE on entry, verify that the data sets in the + * file exist and contain the expected data. * - * Note that these data sets were created by - * create_data_sets() above. Thus any changes in that - * function must be reflected in this function, and - * vise-versa. + * Note that these data sets were created by + * create_data_sets() above. Thus any changes in that + * function must be reflected in this function, and + * vise-versa. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -2816,15 +2815,15 @@ usage(void) * * Modifications: * - * Added min_dset and max_dset parameters and supporting - * code. This allows the caller to specify a range of - * datasets to verify. - * JRM -- 8/20/15 + * Added min_dset and max_dset parameters and supporting + * code. This allows the caller to specify a range of + * datasets to verify. + * JRM -- 8/20/15 * *------------------------------------------------------------------------- */ -static void +static void verify_data_sets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "verify_data_sets()"; @@ -2952,8 +2951,8 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) /* read the chunk from file */ if ( pass ) { - status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, - memspace_id, filespace_ids[m], + status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, + memspace_id, filespace_ids[m], H5P_DEFAULT, data_chunk); if ( status < 0 ) { @@ -2978,8 +2977,8 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) valid_chunk = FALSE; - if ( verbose ) { - + if ( verbose ) { + HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n", k, l, data_chunk[k][l], @@ -2988,7 +2987,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) HDfprintf(stdout, "m = %d, i = %d, j = %d, k = %d, l = %d\n", m, i, j, k, l); - } + } } } } @@ -2998,12 +2997,12 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) pass = FALSE; failure_mssg = "slab validation failed."; - if ( verbose ) { + if ( verbose ) { - fprintf(stdout, + fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", i, j, m); - } + } } } m++; @@ -3054,7 +3053,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) } /* verify_data_sets() */ - + /****************************************************************************/ /******************************* Test Functions *****************************/ /****************************************************************************/ @@ -3062,21 +3061,21 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) /*------------------------------------------------------------------------- * Function: verify_cache_image_RO() * - * Purpose: Verify that a HDF5 file containing a cache image is - * opened R/O and read correctly by PHDF5 with the specified + * Purpose: Verify that a HDF5 file containing a cache image is + * opened R/O and read correctly by PHDF5 with the specified * metadata write strategy. - * + * * Basic cycle of operation is as follows: * - * 1) Open the test file created at the beginning of this - * test read only. + * 1) Open the test file created at the beginning of this + * test read only. * - * Verify that the file contains a cache image. + * Verify that the file contains a cache image. * - * Verify that only process 0 reads the cache image. + * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache - * image block from process 0. + * Verify that all other processes receive the cache + * image block from process 0. * * 2) Verify that the file contains the expected data. * @@ -3096,7 +3095,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -3135,14 +3134,14 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) show_progress = ( ( show_progress ) && ( mpi_rank == 0 ) ); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the file name */ if ( pass ) { - if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT, + if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass = FALSE; @@ -3150,7 +3149,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3165,7 +3164,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -3180,15 +3179,15 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) /* md_write_strat */ md_write_strat); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 2) Verify that the file contains the expected data. + /* 2) Verify that the file contains the expected data. * * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache + * Verify that all other processes receive the cache * image block from process 0. */ @@ -3210,14 +3209,14 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* Verify that all other processes receive the cache image block + /* Verify that all other processes receive the cache image block * from process 0. - * - * Since we have alread verified that only process 0 has read the - * image, it is sufficient to verify that the image was loaded on + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on * all processes. */ #if H5C_COLLECT_CACHE_STATS @@ -3231,12 +3230,12 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 3) Close the file. */ - + if ( pass ) { if ( H5Fclose(file_id) < 0 ) { @@ -3247,7 +3246,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3259,7 +3258,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -3274,12 +3273,12 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) /* md_write_strat */ md_write_strat); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 5) Verify that the file contains the expected data. */ - + if ( pass ) { verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1); @@ -3298,7 +3297,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) /* 6) Close the file. */ - + if ( pass ) { if ( H5Fclose(file_id) < 0 ) { @@ -3309,7 +3308,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3324,7 +3323,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) H5_FAILED(); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", failure_mssg); } } @@ -3334,32 +3333,32 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } /* verify_cache_image_RO() */ - + /*------------------------------------------------------------------------- * Function: verify_cache_image_RW() * - * Purpose: Verify that a HDF5 file containing a cache image is - * opened and read correctly by PHDF5 with the specified + * Purpose: Verify that a HDF5 file containing a cache image is + * opened and read correctly by PHDF5 with the specified * metadata write strategy. - * + * * Basic cycle of operation is as follows: * - * 1) Open the test file created at the beginning of this - * test. + * 1) Open the test file created at the beginning of this + * test. * - * Verify that the file contains a cache image. + * Verify that the file contains a cache image. * * 2) Verify that the file contains the expected data. * - * Verify that only process 0 reads the cache image. + * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache - * image block from process 0. + * Verify that all other processes receive the cache + * image block from process 0. * * * 3) Close the file. * - * 4) Open the file, and verify that it doesn't contain + * 4) Open the file, and verify that it doesn't contain * a cache image. * * 5) Verify that the file contains the expected data. @@ -3375,7 +3374,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -3414,14 +3413,14 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) show_progress = ( ( show_progress ) && ( mpi_rank == 0 ) ); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the file name */ if ( pass ) { - if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT, + if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass = FALSE; @@ -3429,7 +3428,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3439,7 +3438,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) * * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache + * Verify that all other processes receive the cache * image block from process 0. */ @@ -3449,7 +3448,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -3464,7 +3463,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* md_write_strat */ md_write_strat); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3472,7 +3471,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) * * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache + * Verify that all other processes receive the cache * image block from process 0. */ if ( pass ) { @@ -3493,14 +3492,14 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* Verify that all other processes receive the cache image block + /* Verify that all other processes receive the cache image block * from process 0. - * - * Since we have alread verified that only process 0 has read the - * image, it is sufficient to verify that the image was loaded on + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on * all processes. */ #if H5C_COLLECT_CACHE_STATS @@ -3514,12 +3513,12 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 3) Close the file. */ - + if ( pass ) { if ( H5Fclose(file_id) < 0 ) { @@ -3530,7 +3529,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3542,7 +3541,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -3557,12 +3556,12 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* md_write_strat */ md_write_strat); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 5) Verify that the file contains the expected data. */ - + if ( pass ) { verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1); @@ -3581,7 +3580,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* 6) Close the file. */ - + if ( pass ) { if ( H5Fclose(file_id) < 0 ) { @@ -3592,7 +3591,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3622,7 +3621,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) H5_FAILED(); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", failure_mssg); } } @@ -3632,20 +3631,20 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } /* verify_cache_imageRW() */ - + /***************************************************************************** * * Function: smoke_check_1() * - * Purpose: Initial smoke check to verify correct behaviour of cache + * Purpose: Initial smoke check to verify correct behaviour of cache * image in combination with parallel. - * + * * As cache image is currently disabled in the parallel case, * we construct a test file in parallel, verify it in serial * and generate a cache image in passing, and then verify * it again in parallel. * - * In passing, also verify that page buffering is silently + * In passing, also verify that page buffering is silently * disabled in the parallel case. Needless to say, this part * of the test will have to be re-worked when and if page * buffering is supported in parallel. @@ -3700,7 +3699,7 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a PHDF5 file without the cache image FAPL entry. + /* 1) Create a PHDF5 file without the cache image FAPL entry. * * Verify that a cache image is not requested */ @@ -3807,11 +3806,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 7) Verify the datasets in the file backwards + /* 7) Verify the datasets in the file backwards * * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache + * Verify that all other processes receive the cache * image block from process 0. */ @@ -3841,11 +3840,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) if ( ( mpi_rank == 0 ) && ( show_progress ) ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* Verify that all other processes receive the cache image block + /* Verify that all other processes receive the cache image block * from process 0. - * - * Since we have alread verified that only process 0 has read the - * image, it is sufficient to verify that the image was loaded on + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on * all processes. */ #if H5C_COLLECT_CACHE_STATS @@ -3906,11 +3905,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 10) Verify the datasets in the file + /* 10) Verify the datasets in the file * * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache + * Verify that all other processes receive the cache * image block from process 0. */ @@ -3940,11 +3939,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) if ( ( mpi_rank == 0 ) && ( show_progress ) ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* Verify that all other processes receive the cache image block + /* Verify that all other processes receive the cache image block * from process 0. - * - * Since we have alread verified that only process 0 has read the - * image, it is sufficient to verify that the image was loaded on + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on * all processes. */ #if H5C_COLLECT_CACHE_STATS @@ -4047,28 +4046,28 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) H5_FAILED(); - HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", + HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", fcn_name, failure_mssg); } } return !pass; - + } /* smoke_check_1() */ - + /*------------------------------------------------------------------------- * Function: main * * Purpose: Run parallel tests on the cache image feature. - * - * At present, cache image is disabled in parallel, and - * thus these tests are restructed to verifying that a + * + * At present, cache image is disabled in parallel, and + * thus these tests are restructed to verifying that a * file with a cache image can be opened in the parallel - * case, and verifying that instructions to create a + * case, and verifying that instructions to create a * cache image are ignored in the parallel case. * - * WARNING: This test uses fork() and execve(), and + * WARNING: This test uses fork() and execve(), and * therefore will not run on Windows. * * Return: Success: 0 @@ -4106,14 +4105,14 @@ main(int argc, char **argv) HDfflush(stdout); i = 0; - while ( ( FILENAMES[i] != NULL ) && ( i < TEST_FILES_TO_CONSTRUCT ) ) { + while ( ( FILENAMES[i] != NULL ) && ( i < TEST_FILES_TO_CONSTRUCT ) ) { HDfprintf(stdout, " writing %s ... ", FILENAMES[i]); HDfflush(stdout); construct_test_file(i); if ( pass ) { - + printf("done.\n"); HDfflush(stdout); @@ -4194,13 +4193,13 @@ main(int argc, char **argv) /* we may need to play with the path here */ if ( execv("t_cache_image", child_argv) == -1 ) { - HDfprintf(stdout, + HDfprintf(stdout, "execl() of setup process failed. errno = %d(%s)\n", errno, strerror(errno)); exit(1); } - } else if ( child_pid != -1 ) { + } else if ( child_pid != -1 ) { /* this is the parent process -- wait until child is done */ if ( -1 == waitpid(child_pid, &child_status, WUNTRACED)) { @@ -4216,7 +4215,7 @@ main(int argc, char **argv) } else { - HDfprintf(stdout, + HDfprintf(stdout, "testfile construction complete -- proceeding with tests.\n"); } } else { /* fork failed */ @@ -4229,14 +4228,14 @@ main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); - nerrs += verify_cache_image_RO(0, + nerrs += verify_cache_image_RO(0, H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank); #if 1 - nerrs += verify_cache_image_RO(1, + nerrs += verify_cache_image_RO(1, H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank); - nerrs += verify_cache_image_RW(0, + nerrs += verify_cache_image_RW(0, H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank); - nerrs += verify_cache_image_RW(1, + nerrs += verify_cache_image_RW(1, H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank); nerrs += smoke_check_1(comm, info, mpi_rank, mpi_size); #endif diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c index 0782f3d..4677bfe 100644 --- a/testpar/t_pflush1.c +++ b/testpar/t_pflush1.c @@ -15,13 +15,12 @@ * Programmer: Leon Arber * Sept. 28, 2006. * - * Purpose: This is the first half of a two-part test that makes sure - * that a file can be read after a parallel application crashes as long - * as the file was flushed first. We simulate a crash by - * calling _exit(0) since this doesn't flush HDF5 caches but - * still exits with success. + * Purpose: This is the first half of a two-part test that makes sure + * that a file can be read after a parallel application crashes as long + * as the file was flushed first. We simulate a crash by + * calling _exit(0) since this doesn't flush HDF5 caches but + * still exits with success. */ -#include #include "h5test.h" const char *FILENAME[] = { @@ -30,18 +29,18 @@ const char *FILENAME[] = { NULL }; -static double the_data[100][100]; +static double the_data[100][100]; /*------------------------------------------------------------------------- - * Function: create_file + * Function: create_file * - * Purpose: Creates file used in part 1 of the test + * Purpose: Creates file used in part 1 of the test * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Leon Arber + * Programmer: Leon Arber * Sept. 26, 2006 * * Modifications: @@ -51,10 +50,10 @@ static double the_data[100][100]; static hid_t create_file(char* name, hid_t fapl) { - hid_t file, dcpl, space, dset, groups, grp, plist; - hsize_t ds_size[2] = {100, 100}; - hsize_t ch_size[2] = {5, 5}; - hsize_t i, j; + hid_t file, dcpl, space, dset, groups, grp, plist; + hsize_t ds_size[2] = {100, 100}; + hsize_t ch_size[2] = {5, 5}; + hsize_t i, j; @@ -65,7 +64,7 @@ create_file(char* name, hid_t fapl) if(H5Pset_chunk(dcpl, 2, ch_size) < 0) goto error; if((space = H5Screate_simple(2, ds_size, NULL)) < 0) goto error; if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + goto error; plist = H5Pcreate(H5P_DATASET_XFER); H5Pset_dxpl_mpio(plist, H5FD_MPIO_COLLECTIVE); @@ -73,22 +72,22 @@ create_file(char* name, hid_t fapl) /* Write some data */ for(i = 0; i < ds_size[0]; i++) { - /* - * The extra cast in the following statement is a bug workaround - * for the Win32 version 5.0 compiler. - * 1998-11-06 ptl - */ - for(j = 0; j < ds_size[1]; j++) - the_data[i][j] = (double)(hssize_t)i/(hssize_t)(j+1); + /* + * The extra cast in the following statement is a bug workaround + * for the Win32 version 5.0 compiler. + * 1998-11-06 ptl + */ + for(j = 0; j < ds_size[1]; j++) + the_data[i][j] = (double)(hssize_t)i/(hssize_t)(j+1); } if(H5Dwrite(dset, H5T_NATIVE_DOUBLE, space, space, plist, the_data) < 0) goto error; /* Create some groups */ if((groups = H5Gcreate2(file, "some_groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; for(i = 0; i < 100; i++) { - sprintf(name, "grp%02u", (unsigned)i); - if((grp = H5Gcreate2(groups, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - if(H5Gclose(grp) < 0) goto error; + sprintf(name, "grp%02u", (unsigned)i); + if((grp = H5Gcreate2(groups, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + if(H5Gclose(grp) < 0) goto error; } return file; @@ -98,20 +97,20 @@ error: } /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Part 1 of a two-part H5Fflush() test. + * Purpose: Part 1 of a two-part H5Fflush() test. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 23, 1998 * * Modifications: - * Leon Arber - * Sept. 26, 2006, expand test to check for failure if H5Fflush is not called. + * Leon Arber + * Sept. 26, 2006, expand test to check for failure if H5Fflush is not called. * * *------------------------------------------------------------------------- @@ -120,8 +119,8 @@ int main(int argc, char* argv[]) { hid_t file1, file2, fapl; - MPI_File *mpifh_p = NULL; - char name[1024]; + MPI_File *mpifh_p = NULL; + char name[1024]; const char *envval = NULL; int mpi_size, mpi_rank; MPI_Comm comm = MPI_COMM_WORLD; @@ -135,26 +134,26 @@ main(int argc, char* argv[]) H5Pset_fapl_mpio(fapl, comm, info); if(mpi_rank == 0) - TESTING("H5Fflush (part1)"); + TESTING("H5Fflush (part1)"); envval = HDgetenv("HDF5_DRIVER"); if(envval == NULL) envval = "nomatch"; if(HDstrcmp(envval, "split")) { - /* Create the file */ - h5_fixname(FILENAME[0], fapl, name, sizeof name); - file1 = create_file(name, fapl); - /* Flush and exit without closing the library */ - if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error; + /* Create the file */ + h5_fixname(FILENAME[0], fapl, name, sizeof name); + file1 = create_file(name, fapl); + /* Flush and exit without closing the library */ + if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error; - /* Create the other file which will not be flushed */ - h5_fixname(FILENAME[1], fapl, name, sizeof name); - file2 = create_file(name, fapl); + /* Create the other file which will not be flushed */ + h5_fixname(FILENAME[1], fapl, name, sizeof name); + file2 = create_file(name, fapl); - if(mpi_rank == 0) - PASSED(); - fflush(stdout); - fflush(stderr); + if(mpi_rank == 0) + PASSED(); + fflush(stdout); + fflush(stderr); } /* end if */ else { SKIPPED(); @@ -171,21 +170,21 @@ main(int argc, char* argv[]) /* close file1 */ if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0) { - printf("H5Fget_vfd_handle for file1 failed\n"); - goto error; + printf("H5Fget_vfd_handle for file1 failed\n"); + goto error; } /* end if */ if(MPI_File_close(mpifh_p) != MPI_SUCCESS) { - printf("MPI_File_close for file1 failed\n"); - goto error; + printf("MPI_File_close for file1 failed\n"); + goto error; } /* end if */ /* close file2 */ if(H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p) < 0) { - printf("H5Fget_vfd_handle for file2 failed\n"); - goto error; + printf("H5Fget_vfd_handle for file2 failed\n"); + goto error; } /* end if */ if(MPI_File_close(mpifh_p) != MPI_SUCCESS) { - printf("MPI_File_close for file2 failed\n"); - goto error; + printf("MPI_File_close for file2 failed\n"); + goto error; } /* end if */ fflush(stdout); diff --git a/testpar/t_pread.c b/testpar/t_pread.c index a527503..aac5bee 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -16,7 +16,6 @@ * */ -#include "h5test.h" #include "testpar.h" /* The collection of files is included below to aid @@ -42,7 +41,7 @@ const char *FILENAMES[NFILENAME + 1]={"t_pread_data_file", #define COUNT 1000 hbool_t pass = true; -static const char *random_hdf5_text = +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."; @@ -58,7 +57,7 @@ static int test_parallel_read(MPI_Comm comm, int mpi_rank, int group); static char *test_argv0 = NULL; extern char *dirname(char *path); /* Avoids additional includes */ - + /*------------------------------------------------------------------------- * Function: generate_test_file * @@ -79,7 +78,7 @@ extern char *dirname(char *path); /* Avoids additional includes */ * In the overall scheme of running the test, we'll call * 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 + * 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 @@ -93,7 +92,7 @@ extern char *dirname(char *path); /* Avoids additional includes */ * 10/1/17 * * Modifications: - * + * *------------------------------------------------------------------------- */ static int @@ -110,14 +109,14 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) int group_size; int group_rank; int local_failure = 0; - int global_failures = 0; + int global_failures = 0; hsize_t count = COUNT; hsize_t i; hsize_t offset; hsize_t dims[1] = {0}; hid_t file_id = -1; - hid_t memspace = -1; - hid_t filespace = -1; + hid_t memspace = -1; + hid_t filespace = -1; hid_t fapl_id = -1; hid_t dxpl_id = -1; hid_t dset_id = -1; @@ -153,7 +152,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) if ( pass ) { if ( comm == MPI_COMM_WORLD ) { /* Test 1 */ file_index = 0; - } + } else if ( group_id == 0 ) { /* Test 2 group 0 */ file_index = 3; } @@ -161,8 +160,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) file_index = 6; } - /* The 'group_filename' is just a temp variable and - * is used to call into the h5_fixname function. No + /* 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! */ group_filename = FILENAMES[file_index]; @@ -234,9 +233,9 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } } - /* create the data file */ + /* create the data file */ if ( pass ) { - if ( (file_id = H5Fcreate(data_filename, H5F_ACC_TRUNC, + if ( (file_id = H5Fcreate(data_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0 ) { pass = FALSE; failure_mssg = "H5Fcreate() failed.\n"; @@ -276,7 +275,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) if ( pass ) { offset = (hsize_t)group_rank * (hsize_t)COUNT; - if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, &offset, + if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, &offset, NULL, &count, NULL)) < 0 ) { pass = FALSE; failure_mssg = "H5Sselect_hyperslab() failed.\n"; @@ -284,8 +283,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } if ( pass ) { - if ( (dset_id = H5Dcreate2(file_id, "dataset0", H5T_NATIVE_FLOAT, - filespace, H5P_DEFAULT, H5P_DEFAULT, + if ( (dset_id = H5Dcreate2(file_id, "dataset0", H5T_NATIVE_FLOAT, + filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) { pass = false; failure_mssg = "H5Dcreate2() failed.\n"; @@ -293,7 +292,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } if ( pass ) { - if ( (H5Dwrite(dset_id, H5T_NATIVE_FLOAT, memspace, + if ( (H5Dwrite(dset_id, H5T_NATIVE_FLOAT, memspace, filespace, dxpl_id, data_slice)) < 0 ) { pass = false; failure_mssg = "H5Dwrite() failed.\n"; @@ -344,15 +343,15 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } /* Add a userblock to the head of the datafile. - * We will use this to for a functional test of the + * We will use this to for a functional test of the * 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 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. * @@ -361,7 +360,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) if ( group_rank == 0 ) { const char *text_to_write; - size_t bytes_to_write; + size_t bytes_to_write; if (group_id == 0) text_to_write = random_hdf5_text; @@ -406,7 +405,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) * if h5jam is co-located here. Otherwise, the autotools * put things into directories, hence the relative path. */ - if (test_argv0 != NULL) { + if (test_argv0 != NULL) { HDstrncpy(exe_path, test_argv0, sizeof(exe_path)); if ( (exe_dirname = (char *)dirname(exe_path)) != NULL) { HDsprintf(cmd, "%s/h5jam", exe_dirname); @@ -430,13 +429,13 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } /* collect results from other processes. - * Only overwrite the failure message if no preveious error + * Only overwrite the failure message if no preveious error * has been detected */ local_failure = ( pass ? 0 : 1 ); /* This is a global all reduce (NOT group specific) */ - if ( MPI_Allreduce(&local_failure, &global_failures, 1, + if ( MPI_Allreduce(&local_failure, &global_failures, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD) != MPI_SUCCESS ) { if ( pass ) { pass = FALSE; @@ -468,7 +467,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } /* generate_test_file() */ - + /*------------------------------------------------------------------------- * Function: test_parallel_read * @@ -511,7 +510,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) const char *group_filename = NULL; char reloc_data_filename[FILENAME_BUF_SIZE]; int local_failure = 0; - int global_failures = 0; + int global_failures = 0; int group_size; int group_rank; hid_t fapl_id = -1; @@ -597,7 +596,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) /* open the file -- should have user block, exercising the optimization */ if ( pass ) { - if ( (file_id = H5Fopen(reloc_data_filename, + if ( (file_id = H5Fopen(reloc_data_filename, H5F_ACC_RDONLY, fapl_id)) < 0 ) { pass = FALSE; failure_mssg = "H5Fopen() failed\n"; @@ -631,7 +630,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) if ( pass ) { offset = (hsize_t)group_rank * count; - if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, + if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, &offset, NULL, &count, NULL)) < 0 ) { pass = FALSE; failure_mssg = "H5Sselect_hyperslab() failed\n"; @@ -640,14 +639,14 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) /* read this processes section of the data */ if ( pass ) { - if ( (H5Dread(dset_id, H5T_NATIVE_FLOAT, memspace, + if ( (H5Dread(dset_id, H5T_NATIVE_FLOAT, memspace, filespace, H5P_DEFAULT, data_slice)) < 0 ) { pass = FALSE; failure_mssg = "H5Dread() failed\n"; } } - - /* verify the data */ + + /* verify the data */ if ( pass ) { nextValue = (float)((hsize_t)mpi_rank * count); i = 0; @@ -708,7 +707,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) */ local_failure = ( pass ? 0 : 1 ); - if ( MPI_Allreduce( &local_failure, &global_failures, 1, + if ( MPI_Allreduce( &local_failure, &global_failures, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD) != MPI_SUCCESS ) { if ( pass ) { pass = FALSE; @@ -739,11 +738,11 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) } - return( ! pass ); + return( ! pass ); } /* test_parallel_read() */ - + /*------------------------------------------------------------------------- * Function: main * @@ -830,7 +829,7 @@ main( int argc, char **argv) /* ------ Create two (2) MPI groups ------ * - * We split MPI_COMM_WORLD into 2 more or less equal sized + * 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. @@ -858,7 +857,7 @@ main( int argc, char **argv) } goto finish; } - + /* We generate the file used for test 2 */ nerrs += generate_test_file( group_comm, mpi_rank, which_group ); @@ -917,7 +916,7 @@ finish: HDfprintf(stdout, "===================================\n"); if ( nerrs > 0 ) { - + HDfprintf(stdout, "***%s detected %d failures***\n", header, nerrs); } else { diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 1052a69..e695bfc 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -12,7 +12,7 @@ /* This program will test independant and collective reads and writes between - selections of different rank that non-the-less are deemed as having the + selections of different rank that non-the-less are deemed as having the same shape by H5Sselect_shape_same(). */ @@ -22,8 +22,6 @@ #define H5S_TESTING -#include "hdf5.h" -#include "H5private.h" #include "testphdf5.h" #include "H5Spkg.h" /* Dataspaces */ @@ -31,24 +29,24 @@ /* On Lustre (and perhaps other parallel file systems?), we have severe * slow downs if two or more processes attempt to access the same file system * block. To minimize this problem, we set alignment in the shape same tests - * to the default Lustre block size -- which greatly reduces contention in + * to the default Lustre block size -- which greatly reduces contention in * the chunked dataset case. */ -#define SHAPE_SAME_TEST_ALIGNMENT ((hsize_t)(4 * 1024 * 1024)) +#define SHAPE_SAME_TEST_ALIGNMENT ((hsize_t)(4 * 1024 * 1024)) -#define PAR_SS_DR_MAX_RANK 5 /* must update code if this changes */ +#define PAR_SS_DR_MAX_RANK 5 /* must update code if this changes */ struct hs_dr_pio_test_vars_t { - int mpi_size; + int mpi_size; int mpi_rank; MPI_Comm mpi_comm; - MPI_Info mpi_info; + MPI_Info mpi_info; int test_num; int edge_size; - int checker_edge_size; + int checker_edge_size; int chunk_edge_size; int small_rank; int large_rank; @@ -64,13 +62,13 @@ struct hs_dr_pio_test_vars_t int small_ds_offset; int large_ds_offset; hid_t fid; /* HDF5 file ID */ - hid_t xfer_plist; + hid_t xfer_plist; hid_t full_mem_small_ds_sid; hid_t full_file_small_ds_sid; hid_t mem_small_ds_sid; hid_t file_small_ds_sid_0; hid_t file_small_ds_sid_1; - hid_t small_ds_slice_sid; + hid_t small_ds_slice_sid; hid_t full_mem_large_ds_sid; hid_t full_file_large_ds_sid; hid_t mem_large_ds_sid; @@ -78,7 +76,7 @@ struct hs_dr_pio_test_vars_t hid_t file_large_ds_sid_1; hid_t file_large_ds_process_slice_sid; hid_t mem_large_ds_process_slice_sid; - hid_t large_ds_slice_sid; + hid_t large_ds_slice_sid; hid_t small_dataset; /* Dataset ID */ hid_t large_dataset; /* Dataset ID */ size_t small_ds_size; @@ -96,25 +94,25 @@ struct hs_dr_pio_test_vars_t hsize_t * count_ptr; hsize_t * block_ptr; int skips; - int max_skips; - int64_t total_tests; - int64_t tests_run; - int64_t tests_skipped; + int max_skips; + int64_t total_tests; + int64_t tests_run; + int64_t tests_skipped; }; /*------------------------------------------------------------------------- - * Function: hs_dr_pio_test__setup() + * Function: hs_dr_pio_test__setup() * - * Purpose: Do setup for tests of I/O to/from hyperslab selections of - * different rank in the parallel case. + * Purpose: Do setup for tests of I/O to/from hyperslab selections of + * different rank in the parallel case. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/9/11 + * Programmer: JRM -- 8/9/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -133,21 +131,21 @@ hs_dr_pio_test__setup(const int test_num, const int express_test, struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG +#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG const char *fcnName = "hs_dr_pio_test__setup()"; #endif /* CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG */ const char *filename; - hbool_t mis_match = FALSE; - int i; + hbool_t mis_match = FALSE; + int i; int mrc; - int mpi_rank; /* needed by the VRFY macro */ - uint32_t expected_value; + int mpi_rank; /* needed by the VRFY macro */ + uint32_t expected_value; uint32_t * ptr_0; uint32_t * ptr_1; - hid_t acc_tpl; /* File access templates */ + hid_t acc_tpl; /* File access templates */ hid_t small_ds_dcpl_id = H5P_DEFAULT; hid_t large_ds_dcpl_id = H5P_DEFAULT; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ HDassert( edge_size >= 6 ); HDassert( edge_size >= chunk_edge_size ); @@ -219,7 +217,7 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->small_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size); VRFY((tv_ptr->small_ds_buf_2 != NULL), "malloc of small_ds_buf_2 succeeded"); - tv_ptr->small_ds_slice_buf = + tv_ptr->small_ds_slice_buf = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_slice_size); VRFY((tv_ptr->small_ds_slice_buf != NULL), "malloc of small_ds_slice_buf succeeded"); @@ -232,7 +230,7 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->large_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size); VRFY((tv_ptr->large_ds_buf_2 != NULL), "malloc of large_ds_buf_2 succeeded"); - tv_ptr->large_ds_slice_buf = + tv_ptr->large_ds_slice_buf = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_slice_size); VRFY((tv_ptr->large_ds_slice_buf != NULL), "malloc of large_ds_slice_buf succeeded"); @@ -256,21 +254,21 @@ hs_dr_pio_test__setup(const int test_num, filename = (const char *)GetTestParameters(); HDassert( filename != NULL ); -#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG +#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "%d: test num = %d.\n", tv_ptr->mpi_rank, tv_ptr->test_num); HDfprintf(stdout, "%d: mpi_size = %d.\n", tv_ptr->mpi_rank, tv_ptr->mpi_size); - HDfprintf(stdout, + HDfprintf(stdout, "%d: small/large rank = %d/%d, use_collective_io = %d.\n", - tv_ptr->mpi_rank, tv_ptr->small_rank, tv_ptr->large_rank, + tv_ptr->mpi_rank, tv_ptr->small_rank, tv_ptr->large_rank, (int)use_collective_io); HDfprintf(stdout, "%d: edge_size = %d, chunk_edge_size = %d.\n", tv_ptr->mpi_rank, tv_ptr->edge_size, tv_ptr->chunk_edge_size); HDfprintf(stdout, "%d: checker_edge_size = %d.\n", tv_ptr->mpi_rank, tv_ptr->checker_edge_size); HDfprintf(stdout, "%d: small_ds_size = %d, large_ds_size = %d.\n", - tv_ptr->mpi_rank, (int)(tv_ptr->small_ds_size), + tv_ptr->mpi_rank, (int)(tv_ptr->small_ds_size), (int)(tv_ptr->large_ds_size)); HDfprintf(stdout, "%d: filename = %s.\n", tv_ptr->mpi_rank, filename); } @@ -305,78 +303,78 @@ hs_dr_pio_test__setup(const int test_num, /* setup dims: */ tv_ptr->dims[0] = (hsize_t)(tv_ptr->mpi_size + 1); - tv_ptr->dims[1] = tv_ptr->dims[2] = + tv_ptr->dims[1] = tv_ptr->dims[2] = tv_ptr->dims[3] = tv_ptr->dims[4] = (hsize_t)(tv_ptr->edge_size); /* Create small ds dataspaces */ - tv_ptr->full_mem_small_ds_sid = + tv_ptr->full_mem_small_ds_sid = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->full_mem_small_ds_sid != 0), + VRFY((tv_ptr->full_mem_small_ds_sid != 0), "H5Screate_simple() full_mem_small_ds_sid succeeded"); - tv_ptr->full_file_small_ds_sid = + tv_ptr->full_file_small_ds_sid = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->full_file_small_ds_sid != 0), + VRFY((tv_ptr->full_file_small_ds_sid != 0), "H5Screate_simple() full_file_small_ds_sid succeeded"); tv_ptr->mem_small_ds_sid = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->mem_small_ds_sid != 0), + VRFY((tv_ptr->mem_small_ds_sid != 0), "H5Screate_simple() mem_small_ds_sid succeeded"); tv_ptr->file_small_ds_sid_0 = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->file_small_ds_sid_0 != 0), + VRFY((tv_ptr->file_small_ds_sid_0 != 0), "H5Screate_simple() file_small_ds_sid_0 succeeded"); /* used by checker board tests only */ tv_ptr->file_small_ds_sid_1 = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->file_small_ds_sid_1 != 0), + VRFY((tv_ptr->file_small_ds_sid_1 != 0), "H5Screate_simple() file_small_ds_sid_1 succeeded"); - tv_ptr->small_ds_slice_sid = + tv_ptr->small_ds_slice_sid = H5Screate_simple(tv_ptr->small_rank - 1, &(tv_ptr->dims[1]), NULL); - VRFY((tv_ptr->small_ds_slice_sid != 0), + VRFY((tv_ptr->small_ds_slice_sid != 0), "H5Screate_simple() small_ds_slice_sid succeeded"); /* Create large ds dataspaces */ - tv_ptr->full_mem_large_ds_sid = + tv_ptr->full_mem_large_ds_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->full_mem_large_ds_sid != 0), + VRFY((tv_ptr->full_mem_large_ds_sid != 0), "H5Screate_simple() full_mem_large_ds_sid succeeded"); - tv_ptr->full_file_large_ds_sid = + tv_ptr->full_file_large_ds_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->full_file_large_ds_sid != FAIL), + VRFY((tv_ptr->full_file_large_ds_sid != FAIL), "H5Screate_simple() full_file_large_ds_sid succeeded"); tv_ptr->mem_large_ds_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->mem_large_ds_sid != FAIL), + VRFY((tv_ptr->mem_large_ds_sid != FAIL), "H5Screate_simple() mem_large_ds_sid succeeded"); tv_ptr->file_large_ds_sid_0 = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->file_large_ds_sid_0 != FAIL), + VRFY((tv_ptr->file_large_ds_sid_0 != FAIL), "H5Screate_simple() file_large_ds_sid_0 succeeded"); /* used by checker board tests only */ tv_ptr->file_large_ds_sid_1 = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->file_large_ds_sid_1 != FAIL), + VRFY((tv_ptr->file_large_ds_sid_1 != FAIL), "H5Screate_simple() file_large_ds_sid_1 succeeded"); - tv_ptr->mem_large_ds_process_slice_sid = + tv_ptr->mem_large_ds_process_slice_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->mem_large_ds_process_slice_sid != FAIL), + VRFY((tv_ptr->mem_large_ds_process_slice_sid != FAIL), "H5Screate_simple() mem_large_ds_process_slice_sid succeeded"); - tv_ptr->file_large_ds_process_slice_sid = + tv_ptr->file_large_ds_process_slice_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->file_large_ds_process_slice_sid != FAIL), + VRFY((tv_ptr->file_large_ds_process_slice_sid != FAIL), "H5Screate_simple() file_large_ds_process_slice_sid succeeded"); - tv_ptr->large_ds_slice_sid = + tv_ptr->large_ds_slice_sid = H5Screate_simple(tv_ptr->large_rank - 1, &(tv_ptr->dims[1]), NULL); - VRFY((tv_ptr->large_ds_slice_sid != 0), + VRFY((tv_ptr->large_ds_slice_sid != 0), "H5Screate_simple() large_ds_slice_sid succeeded"); @@ -386,18 +384,18 @@ hs_dr_pio_test__setup(const int test_num, */ if ( tv_ptr->chunk_edge_size > 0 ) { - /* Under Lustre (and perhaps other parallel file systems?) we get - * locking delays when two or more processes attempt to access the + /* Under Lustre (and perhaps other parallel file systems?) we get + * locking delays when two or more processes attempt to access the * same file system block. * - * To minimize this problem, I have changed chunk_dims[0] + * To minimize this problem, I have changed chunk_dims[0] * from (mpi_size + 1) to just when any sort of express test is - * selected. Given the structure of the test, and assuming we - * set the alignment large enough, this avoids the contention - * issue by seeing to it that each chunk is only accessed by one + * selected. Given the structure of the test, and assuming we + * set the alignment large enough, this avoids the contention + * issue by seeing to it that each chunk is only accessed by one * process. * - * One can argue as to whether this is a good thing to do in our + * One can argue as to whether this is a good thing to do in our * tests, but for now it is necessary if we want the test to complete * in a reasonable amount of time. * @@ -411,8 +409,8 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->chunk_dims[0] = 1; } - tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] = - tv_ptr->chunk_dims[3] = + tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] = + tv_ptr->chunk_dims[3] = tv_ptr->chunk_dims[4] = (hsize_t)(tv_ptr->chunk_edge_size); small_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); @@ -511,7 +509,7 @@ hs_dr_pio_test__setup(const int test_num, /* write the initial value of the small data set to file */ - ret = H5Dwrite(tv_ptr->small_dataset, tv_ptr->dset_type, tv_ptr->mem_small_ds_sid, + ret = H5Dwrite(tv_ptr->small_dataset, tv_ptr->dset_type, tv_ptr->mem_small_ds_sid, tv_ptr->file_small_ds_sid_0, tv_ptr->xfer_plist, tv_ptr->small_ds_buf_0); VRFY((ret >= 0), "H5Dwrite() small_dataset initial write succeeded"); @@ -524,8 +522,8 @@ hs_dr_pio_test__setup(const int test_num, VRFY((mrc==MPI_SUCCESS), "Sync after small dataset writes"); } - /* read the small data set back to verify that it contains the - * expected data. Note that each process reads in the entire + /* read the small data set back to verify that it contains the + * expected data. Note that each process reads in the entire * data set and verifies it. */ ret = H5Dread(tv_ptr->small_dataset, @@ -574,7 +572,7 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->count, tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid_0, set) suceeded"); - + /* In passing, setup the process slice data spaces as well */ ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_process_slice_sid, @@ -583,7 +581,7 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->stride, tv_ptr->count, tv_ptr->block); - VRFY((ret >= 0), + VRFY((ret >= 0), "H5Sselect_hyperslab(mem_large_ds_process_slice_sid, set) suceeded"); ret = H5Sselect_hyperslab(tv_ptr->file_large_ds_process_slice_sid, @@ -592,7 +590,7 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->stride, tv_ptr->count, tv_ptr->block); - VRFY((ret >= 0), + VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_process_slice_sid, set) suceeded"); if ( MAINPROCESS ) { /* add an additional slice to the selections */ @@ -618,8 +616,8 @@ hs_dr_pio_test__setup(const int test_num, /* write the initial value of the large data set to file */ - ret = H5Dwrite(tv_ptr->large_dataset, tv_ptr->dset_type, - tv_ptr->mem_large_ds_sid, tv_ptr->file_large_ds_sid_0, + ret = H5Dwrite(tv_ptr->large_dataset, tv_ptr->dset_type, + tv_ptr->mem_large_ds_sid, tv_ptr->file_large_ds_sid_0, tv_ptr->xfer_plist, tv_ptr->large_ds_buf_0); if ( ret < 0 ) H5Eprint2(H5E_DEFAULT, stderr); VRFY((ret >= 0), "H5Dwrite() large_dataset initial write succeeded"); @@ -633,8 +631,8 @@ hs_dr_pio_test__setup(const int test_num, } - /* read the large data set back to verify that it contains the - * expected data. Note that each process reads in the entire + /* read the large data set back to verify that it contains the + * expected data. Note that each process reads in the entire * data set. */ ret = H5Dread(tv_ptr->large_dataset, @@ -678,18 +676,18 @@ hs_dr_pio_test__setup(const int test_num, /*------------------------------------------------------------------------- - * Function: hs_dr_pio_test__takedown() + * Function: hs_dr_pio_test__takedown() * - * Purpose: Do takedown after tests of I/O to/from hyperslab selections - * of different rank in the parallel case. + * Purpose: Do takedown after tests of I/O to/from hyperslab selections + * of different rank in the parallel case. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/18/09 + * Programmer: JRM -- 9/18/09 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -699,11 +697,11 @@ hs_dr_pio_test__setup(const int test_num, static void hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr) { -#if HS_DR_PIO_TEST__TAKEDOWN__DEBUG +#if HS_DR_PIO_TEST__TAKEDOWN__DEBUG const char *fcnName = "hs_dr_pio_test__takedown()"; #endif /* HS_DR_PIO_TEST__TAKEDOWN__DEBUG */ - int mpi_rank; /* needed by the VRFY macro */ - herr_t ret; /* Generic return value */ + int mpi_rank; /* needed by the VRFY macro */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; @@ -787,27 +785,27 @@ hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test__d2m_l2s() + * Function: contig_hs_dr_pio_test__d2m_l2s() * - * Purpose: Part one of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part one of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can read from disk correctly using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can read from disk correctly using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * In this function, we test this by reading small_rank - 1 - * slices from the on disk large cube, and verifying that the - * data read is correct. Verify that H5S_select_shape_same() - * returns true on the memory and file selections. + * In this function, we test this by reading small_rank - 1 + * slices from the on disk large cube, and verifying that the + * data read is correct. Verify that H5S_select_shape_same() + * returns true on the memory and file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/10/11 + * Programmer: JRM -- 9/10/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -817,24 +815,24 @@ hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr) static void contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG +#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG const char *fcnName = "contig_hs_dr_pio_test__run_test()"; #endif /* CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ - hbool_t mis_match = FALSE; - int i, j, k, l; - size_t n; - int mpi_rank; /* needed by the VRFY macro */ - uint32_t expected_value; + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ + uint32_t expected_value; uint32_t * ptr_1; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; - /* We have already done a H5Sselect_all() on the data space - * small_ds_slice_sid in the initialization phase, so no need to + /* We have already done a H5Sselect_all() on the data space + * small_ds_slice_sid in the initialization phase, so no need to * call H5Sselect_all() again. */ @@ -859,16 +857,16 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /* zero out the buffer we will be reading into */ HDmemset(tv_ptr->small_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->small_ds_slice_size); -#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG - HDfprintf(stdout, +#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG + HDfprintf(stdout, "%s reading slices from big cube on disk into small cube slice.\n", fcnName); #endif /* CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ /* in serial versions of this test, we loop through all the dimensions - * of the large data set. However, in the parallel version, each + * of the large data set. However, in the parallel version, each * process only works with that slice of the large cube indicated - * by its rank -- hence we set the most slowly changing index to + * by its rank -- hence we set the most slowly changing index to * mpi_rank, and don't itterate over it. */ @@ -881,9 +879,9 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -907,7 +905,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -921,14 +919,14 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) do { if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */ - (tv_ptr->tests_skipped)++; + (tv_ptr->tests_skipped)++; } else { /* run the test */ tv_ptr->skips = 0; /* reset the skips counter */ - /* we know that small_rank - 1 >= 1 and that - * large_rank > small_rank by the assertions at the head + /* we know that small_rank - 1 >= 1 and that + * large_rank > small_rank by the assertions at the head * of this function. Thus no need for another inner loop. */ tv_ptr->start[0] = (hsize_t)i; @@ -943,7 +941,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->stride_ptr, tv_ptr->count_ptr, tv_ptr->block_ptr); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Sselect_hyperslab(file_large_cube_sid) succeeded"); @@ -956,11 +954,11 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /* Read selection from disk */ -#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, (int)(tv_ptr->mpi_rank), - (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), - (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), +#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, (int)(tv_ptr->mpi_rank), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), (int)(tv_ptr->start[4])); HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n", fcnName, @@ -981,7 +979,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) mis_match = FALSE; ptr_1 = tv_ptr->small_ds_slice_buf; expected_value = (uint32_t)( - (i * tv_ptr->edge_size * tv_ptr->edge_size * + (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -1000,10 +998,10 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) expected_value++; } - VRFY((mis_match == FALSE), + VRFY((mis_match == FALSE), "small slice read from large ds data good."); - (tv_ptr->tests_run)++; + (tv_ptr->tests_run)++; } l++; @@ -1028,27 +1026,27 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test__d2m_s2l() + * Function: contig_hs_dr_pio_test__d2m_s2l() * - * Purpose: Part two of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part two of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can read from disk correctly using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can read from disk correctly using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * In this function, we test this by reading slices of the - * on disk small data set into slices through the in memory - * large data set, and verify that the correct data (and - * only the correct data) is read. + * In this function, we test this by reading slices of the + * on disk small data set into slices through the in memory + * large data set, and verify that the correct data (and + * only the correct data) is read. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/10/11 + * Programmer: JRM -- 8/10/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -1058,25 +1056,25 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) static void contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG +#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG const char *fcnName = "contig_hs_dr_pio_test__d2m_s2l()"; #endif /* CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ - hbool_t mis_match = FALSE; - int i, j, k, l; - size_t n; - int mpi_rank; /* needed by the VRFY macro */ + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; - /* Read slices of the on disk small data set into slices - * through the in memory large data set, and verify that the correct + /* Read slices of the on disk small data set into slices + * through the in memory large data set, and verify that the correct * data (and only the correct data) is read. */ @@ -1102,8 +1100,8 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid_0, set) suceeded"); -#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG - HDfprintf(stdout, +#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG + HDfprintf(stdout, "%s reading slices of on disk small data set into slices of big data set.\n", fcnName); #endif /* CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ @@ -1131,11 +1129,11 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /* in serial versions of this test, we loop through all the dimensions - * of the large data set that don't appear in the small data set. + * of the large data set that don't appear in the small data set. * - * However, in the parallel version, each process only works with that - * slice of the large (and small) data set indicated by its rank -- hence - * we set the most slowly changing index to mpi_rank, and don't itterate + * However, in the parallel version, each process only works with that + * slice of the large (and small) data set indicated by its rank -- hence + * we set the most slowly changing index to mpi_rank, and don't itterate * over it. */ @@ -1149,9 +1147,9 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -1175,7 +1173,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -1211,7 +1209,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->stride_ptr, tv_ptr->count_ptr, tv_ptr->block_ptr); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Sselect_hyperslab(mem_large_ds_sid) succeeded"); @@ -1224,11 +1222,11 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /* Read selection from disk */ -#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, (int)(tv_ptr->mpi_rank), - (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), - (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), +#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, (int)(tv_ptr->mpi_rank), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), (int)(tv_ptr->start[4])); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -1250,7 +1248,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) expected_value = (uint32_t) ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); start_index = (size_t)( - (i * tv_ptr->edge_size * tv_ptr->edge_size * + (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -1283,7 +1281,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1++; } - VRFY((mis_match == FALSE), + VRFY((mis_match == FALSE), "small slice read from large ds data good."); (tv_ptr->tests_run)++; @@ -1311,29 +1309,29 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test__m2d_l2s() + * Function: contig_hs_dr_pio_test__m2d_l2s() * - * Purpose: Part three of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part three of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can write from memory to file using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can write from memory to file using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * Do this by writing small_rank - 1 dimensional slices from - * the in memory large data set to the on disk small cube - * dataset. After each write, read the slice of the small - * dataset back from disk, and verify that it contains - * the expected data. Verify that H5S_select_shape_same() - * returns true on the memory and file selections. + * Do this by writing small_rank - 1 dimensional slices from + * the in memory large data set to the on disk small cube + * dataset. After each write, read the slice of the small + * dataset back from disk, and verify that it contains + * the expected data. Verify that H5S_select_shape_same() + * returns true on the memory and file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/10/11 + * Programmer: JRM -- 8/10/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -1343,19 +1341,19 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) static void contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG +#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG const char *fcnName = "contig_hs_dr_pio_test__m2d_l2s()"; #endif /* CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ - hbool_t mis_match = FALSE; - int i, j, k, l; - size_t n; - int mpi_rank; /* needed by the VRFY macro */ + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; @@ -1365,10 +1363,10 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) * from memory to file using selections of different rank that * H5S_select_shape_same() views as being of the same shape. * - * Start by writing small_rank - 1 dimensional slices from the in memory large - * data set to the on disk small cube dataset. After each write, read the - * slice of the small dataset back from disk, and verify that it contains - * the expected data. Verify that H5S_select_shape_same() returns true on + * Start by writing small_rank - 1 dimensional slices from the in memory large + * data set to the on disk small cube dataset. After each write, read the + * slice of the small dataset back from disk, and verify that it contains + * the expected data. Verify that H5S_select_shape_same() returns true on * the memory and file selections. */ @@ -1424,18 +1422,18 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) HDmemset(tv_ptr->small_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->small_ds_size); -#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG - HDfprintf(stdout, +#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG + HDfprintf(stdout, "%s writing slices from big ds to slices of small ds on disk.\n", fcnName); #endif /* CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ /* in serial versions of this test, we loop through all the dimensions - * of the large data set that don't appear in the small data set. + * of the large data set that don't appear in the small data set. * - * However, in the parallel version, each process only works with that - * slice of the large (and small) data set indicated by its rank -- hence - * we set the most slowly changing index to mpi_rank, and don't itterate + * However, in the parallel version, each process only works with that + * slice of the large (and small) data set indicated by its rank -- hence + * we set the most slowly changing index to mpi_rank, and don't itterate * over it. */ @@ -1449,9 +1447,9 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -1476,7 +1474,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -1525,7 +1523,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->stride_ptr, tv_ptr->count_ptr, tv_ptr->block_ptr); - VRFY((ret >= 0), + VRFY((ret >= 0), "H5Sselect_hyperslab() mem_large_ds_sid succeeded."); @@ -1538,13 +1536,13 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) VRFY((check == TRUE), "H5S_select_shape_same_test passed."); - /* write the slice from the in memory large data set to the + /* write the slice from the in memory large data set to the * slice of the on disk small dataset. */ -#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", +#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, (int)(tv_ptr->mpi_rank), - (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), - (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), (int)(tv_ptr->start[4])); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -1576,7 +1574,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1 = tv_ptr->small_ds_buf_1; expected_value = (uint32_t)( - (i * tv_ptr->edge_size * tv_ptr->edge_size * + (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -1611,7 +1609,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1++; } - VRFY((mis_match == FALSE), + VRFY((mis_match == FALSE), "small slice write from large ds data good."); (tv_ptr->tests_run)++; @@ -1639,31 +1637,31 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test__m2d_s2l() + * Function: contig_hs_dr_pio_test__m2d_s2l() * - * Purpose: Part four of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part four of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can write from memory to file using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can write from memory to file using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * Do this by writing the contents of the process's slice of - * the in memory small data set to slices of the on disk - * large data set. After each write, read the process's - * slice of the large data set back into memory, and verify - * that it contains the expected data. + * Do this by writing the contents of the process's slice of + * the in memory small data set to slices of the on disk + * large data set. After each write, read the process's + * slice of the large data set back into memory, and verify + * that it contains the expected data. * - * Verify that H5S_select_shape_same() returns true on the - * memory and file selections. + * Verify that H5S_select_shape_same() returns true on the + * memory and file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/10/11 + * Programmer: JRM -- 8/10/11 * * Modifications: * - * None + * None * *------------------------------------------------------------------------- */ @@ -1673,32 +1671,32 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) static void contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG const char *fcnName = "contig_hs_dr_pio_test__m2d_s2l()"; #endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ - hbool_t mis_match = FALSE; - int i, j, k, l; - size_t n; - int mpi_rank; /* needed by the VRFY macro */ + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; - /* Now write the contents of the process's slice of the in memory - * small data set to slices of the on disk large data set. After + /* Now write the contents of the process's slice of the in memory + * small data set to slices of the on disk large data set. After * each write, read the process's slice of the large data set back - * into memory, and verify that it contains the expected data. - * Verify that H5S_select_shape_same() returns true on the memory + * into memory, and verify that it contains the expected data. + * Verify that H5S_select_shape_same() returns true on the memory * and file selections. */ - /* select the slice of the in memory small data set associated with + /* select the slice of the in memory small data set associated with * the process's mpi rank. */ tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_rank); @@ -1745,8 +1743,8 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /* zero out the in memory large ds */ HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size); -#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG - HDfprintf(stdout, +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG + HDfprintf(stdout, "%s writing process slices of small ds to slices of large ds on disk.\n", fcnName); #endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ @@ -1760,9 +1758,9 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -1786,7 +1784,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -1802,18 +1800,18 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) (tv_ptr->tests_skipped)++; -#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG tv_ptr->start[0] = (hsize_t)i; tv_ptr->start[1] = (hsize_t)j; tv_ptr->start[2] = (hsize_t)k; tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - HDfprintf(stdout, - "%s:%d: skipping test with start = %d %d %d %d %d.\n", + HDfprintf(stdout, + "%s:%d: skipping test with start = %d %d %d %d %d.\n", fcnName, (int)(tv_ptr->mpi_rank), - (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), - (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), (int)(tv_ptr->start[4])); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -1857,7 +1855,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->stride_ptr, tv_ptr->count_ptr, tv_ptr->block_ptr); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Sselect_hyperslab() target large ds slice succeeded"); @@ -1871,14 +1869,14 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - /* write the small data set slice from memory to the - * target slice of the disk data set + /* write the small data set slice from memory to the + * target slice of the disk data set */ -#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, (int)(tv_ptr->mpi_rank), - (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), - (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), (int)(tv_ptr->start[4])); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -1891,11 +1889,11 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->file_large_ds_sid_0, tv_ptr->xfer_plist, tv_ptr->small_ds_buf_0); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Dwrite of small ds slice to large ds succeeded"); - /* read this processes slice on the on disk large + /* read this processes slice on the on disk large * data set into memory. */ @@ -1905,7 +1903,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->file_large_ds_process_slice_sid, tv_ptr->xfer_plist, tv_ptr->large_ds_buf_1); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Dread() of process slice of large ds succeeded"); @@ -1914,12 +1912,12 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) */ ptr_1 = tv_ptr->large_ds_buf_1; expected_value = (uint32_t) - ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); + ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); start_index = (size_t) - ((i * tv_ptr->edge_size * tv_ptr->edge_size * + ((i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + - (j * tv_ptr->edge_size * tv_ptr->edge_size * + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); @@ -1951,7 +1949,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1++; } - VRFY((mis_match == FALSE), + VRFY((mis_match == FALSE), "small ds slice write to large ds slice data good."); (tv_ptr->tests_run)++; @@ -1979,29 +1977,29 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test__run_test() + * Function: contig_hs_dr_pio_test__run_test() * - * Purpose: Test I/O to/from hyperslab selections of different rank in - * the parallel. + * Purpose: Test I/O to/from hyperslab selections of different rank in + * the parallel. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/18/09 + * Programmer: JRM -- 9/18/09 * * Modifications: * - * JRM -- 9/16/10 - * Added express_test parameter. Use it to control whether - * we set up the chunks so that no chunk is shared between - * processes, and also whether we set an alignment when we - * create the test file. + * JRM -- 9/16/10 + * Added express_test parameter. Use it to control whether + * we set up the chunks so that no chunk is shared between + * processes, and also whether we set an alignment when we + * create the test file. * - * JRM -- 8/11/11 - * Refactored function heavily & broke it into six functions. - * Added the skips_ptr, max_skips, total_tests_ptr, - * tests_run_ptr, and tests_skiped_ptr parameters to support - * skipping portions of the test according to the express - * test value. + * JRM -- 8/11/11 + * Refactored function heavily & broke it into six functions. + * Added the skips_ptr, max_skips, total_tests_ptr, + * tests_run_ptr, and tests_skiped_ptr parameters to support + * skipping portions of the test according to the express + * test value. * *------------------------------------------------------------------------- */ @@ -2023,13 +2021,13 @@ contig_hs_dr_pio_test__run_test(const int test_num, int64_t * tests_run_ptr, int64_t * tests_skipped_ptr) { -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG const char *fcnName = "contig_hs_dr_pio_test__run_test()"; #endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ - int mpi_rank; - struct hs_dr_pio_test_vars_t test_vars = + int mpi_rank; + struct hs_dr_pio_test_vars_t test_vars = { - /* int mpi_size = */ -1, + /* int mpi_size = */ -1, /* int mpi_rank = */ -1, /* MPI_Comm mpi_comm = */ MPI_COMM_NULL, /* MPI_Inf mpi_info = */ MPI_INFO_NULL, @@ -2045,7 +2043,7 @@ contig_hs_dr_pio_test__run_test(const int test_num, /* uint32_t * small_ds_buf_2 = */ NULL, /* uint32_t * small_ds_slice_buf = */ NULL, /* uint32_t * large_ds_buf_0 = */ NULL, - /* uint32_t * large_ds_buf_1 = */ NULL, + /* uint32_t * large_ds_buf_1 = */ NULL, /* uint32_t * large_ds_buf_2 = */ NULL, /* uint32_t * large_ds_slice_buf = */ NULL, /* int small_ds_offset = */ -1, @@ -2082,8 +2080,8 @@ contig_hs_dr_pio_test__run_test(const int test_num, /* hsize_t * stride_ptr = */ NULL, /* hsize_t * count_ptr = */ NULL, /* hsize_t * block_ptr = */ NULL, - /* int skips = */ 0, - /* int max_skips = */ 0, + /* int skips = */ 0, + /* int max_skips = */ 0, /* int64_t total_tests = */ 0, /* int64_t tests_run = */ 0, /* int64_t tests_skipped = */ 0 @@ -2101,7 +2099,7 @@ contig_hs_dr_pio_test__run_test(const int test_num, tv_ptr->skips = *skips_ptr; tv_ptr->max_skips = max_skips; -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: small rank = %d, large rank = %d.\n", test_num, small_rank, large_rank); @@ -2113,12 +2111,12 @@ contig_hs_dr_pio_test__run_test(const int test_num, * of different rank that H5S_select_shape_same() views as being of the * same shape. * - * Start by reading small_rank - 1 dimensional slice from the on disk - * large cube, and verifying that the data read is correct. Verify that + * Start by reading small_rank - 1 dimensional slice from the on disk + * large cube, and verifying that the data read is correct. Verify that * H5S_select_shape_same() returns true on the memory and file selections. */ -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__d2m_l2s.\n", test_num); } @@ -2126,12 +2124,12 @@ contig_hs_dr_pio_test__run_test(const int test_num, contig_hs_dr_pio_test__d2m_l2s(tv_ptr); - /* Second, read slices of the on disk small data set into slices - * through the in memory large data set, and verify that the correct + /* Second, read slices of the on disk small data set into slices + * through the in memory large data set, and verify that the correct * data (and only the correct data) is read. */ -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__d2m_s2l.\n", test_num); } @@ -2144,13 +2142,13 @@ contig_hs_dr_pio_test__run_test(const int test_num, * H5S_select_shape_same() views as being of the same shape. * * Start by writing small_rank - 1 D slices from the in memory large data - * set to the on disk small cube dataset. After each write, read the - * slice of the small dataset back from disk, and verify that it contains - * the expected data. Verify that H5S_select_shape_same() returns true on + * set to the on disk small cube dataset. After each write, read the + * slice of the small dataset back from disk, and verify that it contains + * the expected data. Verify that H5S_select_shape_same() returns true on * the memory and file selections. */ -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__m2d_l2s.\n", test_num); } @@ -2158,25 +2156,25 @@ contig_hs_dr_pio_test__run_test(const int test_num, contig_hs_dr_pio_test__m2d_l2s(tv_ptr); - /* Now write the contents of the process's slice of the in memory - * small data set to slices of the on disk large data set. After + /* Now write the contents of the process's slice of the in memory + * small data set to slices of the on disk large data set. After * each write, read the process's slice of the large data set back - * into memory, and verify that it contains the expected data. - * Verify that H5S_select_shape_same() returns true on the memory + * into memory, and verify that it contains the expected data. + * Verify that H5S_select_shape_same() returns true on the memory * and file selections. */ -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__m2d_s2l.\n", test_num); } #endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ contig_hs_dr_pio_test__m2d_s2l(tv_ptr); -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { - HDfprintf(stdout, - "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n", + HDfprintf(stdout, + "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n", test_num, (long long)(tv_ptr->tests_run), (long long)(tv_ptr->tests_skipped), (long long)(tv_ptr->total_tests)); } @@ -2184,7 +2182,7 @@ contig_hs_dr_pio_test__run_test(const int test_num, hs_dr_pio_test__takedown(tv_ptr); -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: Takedown complete.\n", test_num); } @@ -2201,28 +2199,28 @@ contig_hs_dr_pio_test__run_test(const int test_num, /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) + * Function: contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) * - * Purpose: Test I/O to/from hyperslab selections of different rank in - * the parallel case. + * Purpose: Test I/O to/from hyperslab selections of different rank in + * the parallel case. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/18/09 + * Programmer: JRM -- 9/18/09 * * Modifications: * - * Modified function to take a sample of the run times - * of the different tests, and skip some of them if - * run times are too long. + * Modified function to take a sample of the run times + * of the different tests, and skip some of them if + * run times are too long. * - * We need to do this because Lustre runns very slowly - * if two or more processes are banging on the same - * block of memory. - * JRM -- 9/10/10 + * We need to do this because Lustre runns very slowly + * if two or more processes are banging on the same + * block of memory. + * JRM -- 9/10/10 * Break this one big test into 4 smaller tests according * to {independent,collective}x{contigous,chunked} datasets. - * AKC -- 2010/01/14 + * AKC -- 2010/01/14 * *------------------------------------------------------------------------- */ @@ -2236,23 +2234,23 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) int local_express_test; int mpi_rank = -1; int mpi_size; - int test_num = 0; - int edge_size; - int chunk_edge_size = 0; - int small_rank; - int large_rank; - int mpi_result; - int skips = 0; - int max_skips = 0; - /* The following table list the number of sub-tests skipped between - * each test that is actually executed as a function of the express + int test_num = 0; + int edge_size; + int chunk_edge_size = 0; + int small_rank; + int large_rank; + int mpi_result; + int skips = 0; + int max_skips = 0; + /* The following table list the number of sub-tests skipped between + * each test that is actually executed as a function of the express * test level. Note that any value in excess of 4880 will cause all * sub tests to be skipped. */ int max_skips_tbl[4] = {0, 4, 64, 1024}; - hid_t dset_type = H5T_NATIVE_UINT; - int64_t total_tests = 0; - int64_t tests_run = 0; + hid_t dset_type = H5T_NATIVE_UINT; + int64_t total_tests = 0; + int64_t tests_run = 0; int64_t tests_skipped = 0; HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned)); @@ -2295,7 +2293,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) chunk_edge_size, small_rank, large_rank, - FALSE, + FALSE, dset_type, express_test, &skips, @@ -2316,7 +2314,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) chunk_edge_size, small_rank, large_rank, - TRUE, + TRUE, dset_type, express_test, &skips, @@ -2337,7 +2335,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) chunk_edge_size, small_rank, large_rank, - FALSE, + FALSE, dset_type, express_test, &skips, @@ -2358,7 +2356,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) chunk_edge_size, small_rank, large_rank, - TRUE, + TRUE, dset_type, express_test, &skips, @@ -2377,7 +2375,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) } /* end of switch(sstest_type) */ #if CONTIG_HS_DR_PIO_TEST__DEBUG if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) { - HDfprintf(stdout, " run/skipped/total = %lld/%lld/%lld.\n", + HDfprintf(stdout, " run/skipped/total = %lld/%lld/%lld.\n", tests_run, tests_skipped, total_tests); } #endif /* CONTIG_HS_DR_PIO_TEST__DEBUG */ @@ -2385,7 +2383,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) } if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) { - HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n", + HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n", tests_skipped, total_tests); } @@ -2396,24 +2394,24 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) /**************************************************************** ** -** ckrbrd_hs_dr_pio_test__slct_ckrbrd(): -** Given a data space of tgt_rank, and dimensions: +** ckrbrd_hs_dr_pio_test__slct_ckrbrd(): +** Given a data space of tgt_rank, and dimensions: ** -** (mpi_size + 1), edge_size, ... , edge_size +** (mpi_size + 1), edge_size, ... , edge_size ** -** edge_size, and a checker_edge_size, select a checker -** board selection of a sel_rank (sel_rank < tgt_rank) -** dimensional slice through the data space parallel to the +** edge_size, and a checker_edge_size, select a checker +** board selection of a sel_rank (sel_rank < tgt_rank) +** dimensional slice through the data space parallel to the ** sel_rank fastest changing indicies, with origin (in the -** higher indicies) as indicated by the start array. +** higher indicies) as indicated by the start array. ** -** Note that this function, like all its relatives, is -** hard coded to presume a maximum data space rank of 5. -** While this maximum is declared as a constant, increasing -** it will require extensive coding in addition to changing +** Note that this function, like all its relatives, is +** hard coded to presume a maximum data space rank of 5. +** While this maximum is declared as a constant, increasing +** it will require extensive coding in addition to changing ** the value of the constant. ** -** JRM -- 10/8/09 +** JRM -- 10/8/09 ** ****************************************************************/ @@ -2428,22 +2426,22 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, const int sel_rank, hsize_t sel_start[]) { -#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG - const char * fcnName = "ckrbrd_hs_dr_pio_test__slct_ckrbrd():"; -#endif - hbool_t first_selection = TRUE; +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG + const char * fcnName = "ckrbrd_hs_dr_pio_test__slct_ckrbrd():"; +#endif + hbool_t first_selection = TRUE; int i, j, k, l, m; - int n_cube_offset; - int sel_offset; - const int test_max_rank = PAR_SS_DR_MAX_RANK; /* must update code if */ + int n_cube_offset; + int sel_offset; + const int test_max_rank = PAR_SS_DR_MAX_RANK; /* must update code if */ /* this changes */ - hsize_t base_count; + hsize_t base_count; hsize_t offset_count; - hsize_t start[PAR_SS_DR_MAX_RANK]; - hsize_t stride[PAR_SS_DR_MAX_RANK]; - hsize_t count[PAR_SS_DR_MAX_RANK]; - hsize_t block[PAR_SS_DR_MAX_RANK]; - herr_t ret; /* Generic return value */ + hsize_t start[PAR_SS_DR_MAX_RANK]; + hsize_t stride[PAR_SS_DR_MAX_RANK]; + hsize_t count[PAR_SS_DR_MAX_RANK]; + hsize_t block[PAR_SS_DR_MAX_RANK]; + herr_t ret; /* Generic return value */ HDassert( edge_size >= 6 ); HDassert( 0 < checker_edge_size ); @@ -2460,14 +2458,14 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, HDassert( n_cube_offset >= 0 ); HDassert( n_cube_offset <= sel_offset ); -#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s:%d: edge_size/checker_edge_size = %d/%d\n", fcnName, mpi_rank, edge_size, checker_edge_size); - HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n", + HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n", fcnName, mpi_rank, sel_rank, sel_offset); - HDfprintf(stdout, "%s:%d: tgt_rank/n_cube_offset = %d/%d.\n", + HDfprintf(stdout, "%s:%d: tgt_rank/n_cube_offset = %d/%d.\n", fcnName, mpi_rank, tgt_rank, n_cube_offset); -#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ +#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ /* First, compute the base count (which assumes start == 0 * for the associated offset) and offset_count (which @@ -2497,7 +2495,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, } /* Now set up the stride and block arrays, and portions of the start - * and count arrays that will not be altered during the selection of + * and count arrays that will not be altered during the selection of * the checker board. */ i = 0; @@ -2529,7 +2527,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, i++; } - + i = 0; do { if ( 0 >= sel_offset ) { @@ -2548,7 +2546,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, } j = 0; - do { + do { if ( 1 >= sel_offset ) { if ( j == 0 ) { @@ -2617,62 +2615,62 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, if ( ((i + j + k + l + m) % 2) == 0 ) { -#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG - HDfprintf(stdout, "%s%d: *** first_selection = %d ***\n", +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG + HDfprintf(stdout, "%s%d: *** first_selection = %d ***\n", fcnName, mpi_rank, (int)first_selection); HDfprintf(stdout, "%s:%d: i/j/k/l/m = %d/%d/%d/%d/%d\n", fcnName, mpi_rank, i, j, k, l, m); - HDfprintf(stdout, - "%s:%d: start = %d %d %d %d %d.\n", - fcnName, mpi_rank, (int)start[0], (int)start[1], + HDfprintf(stdout, + "%s:%d: start = %d %d %d %d %d.\n", + fcnName, mpi_rank, (int)start[0], (int)start[1], (int)start[2], (int)start[3], (int)start[4]); - HDfprintf(stdout, - "%s:%d: stride = %d %d %d %d %d.\n", - fcnName, mpi_rank, (int)stride[0], (int)stride[1], + HDfprintf(stdout, + "%s:%d: stride = %d %d %d %d %d.\n", + fcnName, mpi_rank, (int)stride[0], (int)stride[1], (int)stride[2], (int)stride[3], (int)stride[4]); - HDfprintf(stdout, - "%s:%d: count = %d %d %d %d %d.\n", - fcnName, mpi_rank, (int)count[0], (int)count[1], + HDfprintf(stdout, + "%s:%d: count = %d %d %d %d %d.\n", + fcnName, mpi_rank, (int)count[0], (int)count[1], (int)count[2], (int)count[3], (int)count[4]); - HDfprintf(stdout, - "%s:%d: block = %d %d %d %d %d.\n", - fcnName, mpi_rank, (int)block[0], (int)block[1], + HDfprintf(stdout, + "%s:%d: block = %d %d %d %d %d.\n", + fcnName, mpi_rank, (int)block[0], (int)block[1], (int)block[2], (int)block[3], (int)block[4]); - HDfprintf(stdout, "%s:%d: n-cube extent dims = %d.\n", + HDfprintf(stdout, "%s:%d: n-cube extent dims = %d.\n", fcnName, mpi_rank, H5Sget_simple_extent_ndims(tgt_sid)); - HDfprintf(stdout, "%s:%d: selection rank = %d.\n", + HDfprintf(stdout, "%s:%d: selection rank = %d.\n", fcnName, mpi_rank, sel_rank); #endif if ( first_selection ) { - first_selection = FALSE; + first_selection = FALSE; ret = H5Sselect_hyperslab ( - tgt_sid, + tgt_sid, H5S_SELECT_SET, - &(start[n_cube_offset]), - &(stride[n_cube_offset]), - &(count[n_cube_offset]), + &(start[n_cube_offset]), + &(stride[n_cube_offset]), + &(count[n_cube_offset]), &(block[n_cube_offset]) ); - + VRFY((ret != FAIL), "H5Sselect_hyperslab(SET) succeeded"); } else { ret = H5Sselect_hyperslab ( - tgt_sid, + tgt_sid, H5S_SELECT_OR, - &(start[n_cube_offset]), - &(stride[n_cube_offset]), - &(count[n_cube_offset]), + &(start[n_cube_offset]), + &(stride[n_cube_offset]), + &(count[n_cube_offset]), &(block[n_cube_offset]) ); - + VRFY((ret != FAIL), "H5Sselect_hyperslab(OR) succeeded"); } @@ -2704,7 +2702,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, } while ( ( i <= 1 ) && ( 0 >= sel_offset ) ); -#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n", fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid)); #endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ @@ -2724,7 +2722,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, VRFY((ret != FAIL), "H5Sselect_hyperslab(AND) succeeded"); -#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n", fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid)); HDfprintf(stdout, "%s%d: done.\n", fcnName, mpi_rank); @@ -2737,57 +2735,57 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, /**************************************************************** ** -** ckrbrd_hs_dr_pio_test__verify_data(): +** ckrbrd_hs_dr_pio_test__verify_data(): ** -** Examine the supplied buffer to see if it contains the -** expected data. Return TRUE if it does, and FALSE +** Examine the supplied buffer to see if it contains the +** expected data. Return TRUE if it does, and FALSE ** otherwise. ** -** The supplied buffer is presumed to this process's slice -** of the target data set. Each such slice will be an -** n-cube of rank (rank -1) and the supplied edge_size with -** origin (mpi_rank, 0, ... , 0) in the target data set. +** The supplied buffer is presumed to this process's slice +** of the target data set. Each such slice will be an +** n-cube of rank (rank -1) and the supplied edge_size with +** origin (mpi_rank, 0, ... , 0) in the target data set. ** -** Further, the buffer is presumed to be the result of reading -** or writing a checker board selection of an m (1 <= m < +** Further, the buffer is presumed to be the result of reading +** or writing a checker board selection of an m (1 <= m < ** rank) dimensional slice through this processes slice -** of the target data set. Also, this slice must be parallel -** to the fastest changing indicies. +** of the target data set. Also, this slice must be parallel +** to the fastest changing indicies. ** -** It is further presumed that the buffer was zeroed before -** the read/write, and that the full target data set (i.e. -** the buffer/data set for all processes) was initialized -** with the natural numbers listed in order from the origin -** along the fastest changing axis. +** It is further presumed that the buffer was zeroed before +** the read/write, and that the full target data set (i.e. +** the buffer/data set for all processes) was initialized +** with the natural numbers listed in order from the origin +** along the fastest changing axis. ** ** Thus for a 20x10x10 dataset, the value stored in location -** (x, y, z) (assuming that z is the fastest changing index -** and x the slowest) is assumed to be: +** (x, y, z) (assuming that z is the fastest changing index +** and x the slowest) is assumed to be: ** -** (10 * 10 * x) + (10 * y) + z +** (10 * 10 * x) + (10 * y) + z ** -** Further, supposing that this is process 10, this process's -** slice of the dataset would be a 10 x 10 2-cube with origin -** (10, 0, 0) in the data set, and would be initialize (prior -** to the checkerboard selection) as follows: +** Further, supposing that this is process 10, this process's +** slice of the dataset would be a 10 x 10 2-cube with origin +** (10, 0, 0) in the data set, and would be initialize (prior +** to the checkerboard selection) as follows: ** -** 1000, 1001, 1002, ... 1008, 1009 -** 1010, 1011, 1012, ... 1018, 1019 -** . . . . . -** . . . . . -** . . . . . -** 1090, 1091, 1092, ... 1098, 1099 +** 1000, 1001, 1002, ... 1008, 1009 +** 1010, 1011, 1012, ... 1018, 1019 +** . . . . . +** . . . . . +** . . . . . +** 1090, 1091, 1092, ... 1098, 1099 ** -** In the case of a read from the processors slice of another -** data set of different rank, the values expected will have -** to be adjusted accordingly. This is done via the -** first_expected_val parameter. +** In the case of a read from the processors slice of another +** data set of different rank, the values expected will have +** to be adjusted accordingly. This is done via the +** first_expected_val parameter. ** -** Finally, the function presumes that the first element -** of the buffer resides either at the origin of either -** a selected or an unselected checker. (Translation: -** if partial checkers appear in the buffer, they will -** intersect the edges of the n-cube oposite the origin.) +** Finally, the function presumes that the first element +** of the buffer resides either at the origin of either +** a selected or an unselected checker. (Translation: +** if partial checkers appear in the buffer, they will +** intersect the edges of the n-cube oposite the origin.) ** ****************************************************************/ @@ -2802,7 +2800,7 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, hbool_t buf_starts_in_checker) { #if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG - const char * fcnName = "ckrbrd_hs_dr_pio_test__verify_data():"; + const char * fcnName = "ckrbrd_hs_dr_pio_test__verify_data():"; #endif hbool_t good_data = TRUE; hbool_t in_checker; @@ -2821,9 +2819,9 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, HDassert( checker_edge_size <= edge_size ); HDassert( test_max_rank <= PAR_SS_DR_MAX_RANK ); -#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG - int mpi_rank; + int mpi_rank; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); HDfprintf(stdout, "%s mpi_rank = %d.\n", fcnName, mpi_rank); @@ -2875,7 +2873,7 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, y = 0; start_in_checker[3] = start_in_checker[2]; do - { + { if ( y >= checker_edge_size ) { start_in_checker[3] = ! start_in_checker[3]; @@ -2884,13 +2882,13 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, m = 0; z = 0; -#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG HDfprintf(stdout, "%d, %d, %d, %d, %d:", i, j, k, l, m); #endif in_checker = start_in_checker[3]; do { -#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG HDfprintf(stdout, " %d", (int)(*val_ptr)); #endif if ( z >= checker_edge_size ) { @@ -2898,21 +2896,21 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, in_checker = ! in_checker; z = 0; } - + if ( in_checker ) { - + if ( *val_ptr != expected_value ) { good_data = FALSE; } - + /* zero out buffer for re-use */ *val_ptr = 0; } else if ( *val_ptr != 0 ) { good_data = FALSE; - + /* zero out buffer for re-use */ *val_ptr = 0; @@ -2922,10 +2920,10 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, expected_value++; m++; z++; - + } while ( ( rank >= (test_max_rank - 4) ) && ( m < edge_size ) ); -#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG HDfprintf(stdout, "\n"); #endif l++; @@ -2951,28 +2949,28 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test__d2m_l2s() + * Function: ckrbrd_hs_dr_pio_test__d2m_l2s() * - * Purpose: Part one of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part one of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can read from disk correctly using checker - * board selections of different rank that + * Verify that we can read from disk correctly using checker + * board selections of different rank that * H5S_select_shape_same() views as being of the same shape. * - * In this function, we test this by reading small_rank - 1 - * checker board slices from the on disk large cube, and - * verifying that the data read is correct. Verify that - * H5S_select_shape_same() returns true on the memory and - * file selections. + * In this function, we test this by reading small_rank - 1 + * checker board slices from the on disk large cube, and + * verifying that the data read is correct. Verify that + * H5S_select_shape_same() returns true on the memory and + * file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/15/11 + * Programmer: JRM -- 9/15/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -2982,17 +2980,17 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, static void ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__d2m_l2s()"; uint32_t * ptr_0; #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ - hbool_t data_ok = FALSE; - int i, j, k, l; - uint32_t expected_value; - int mpi_rank; /* needed by VRFY */ + hbool_t data_ok = FALSE; + int i, j, k, l; + uint32_t expected_value; + int mpi_rank; /* needed by VRFY */ hsize_t sel_start[PAR_SS_DR_MAX_RANK]; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; @@ -3002,9 +3000,9 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) * of different rank that H5S_select_shape_same() views as being of the * same shape. * - * Start by reading a (small_rank - 1)-D checker board slice from this - * processes slice of the on disk large data set, and verifying that the - * data read is correct. Verify that H5S_select_shape_same() returns + * Start by reading a (small_rank - 1)-D checker board slice from this + * processes slice of the on disk large data set, and verifying that the + * data read is correct. Verify that H5S_select_shape_same() returns * true on the memory and file selections. * * The first step is to set up the needed checker board selection in the @@ -3025,7 +3023,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /* zero out the buffer we will be reading into */ HDmemset(tv_ptr->small_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->small_ds_slice_size); -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG HDfprintf(stdout, "%s:%d: initial small_ds_slice_buf = ", fcnName, tv_ptr->mpi_rank); ptr_0 = tv_ptr->small_ds_slice_buf; @@ -3034,7 +3032,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_0++; } HDfprintf(stdout, "\n"); -#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ /* set up start, stride, count, and block -- note that we will * change start[] so as to read slices of the large cube. @@ -3054,15 +3052,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } } -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG - HDfprintf(stdout, +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG + HDfprintf(stdout, "%s:%d: reading slice from big ds on disk into small ds slice.\n", fcnName, tv_ptr->mpi_rank); -#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ /* in serial versions of this test, we loop through all the dimensions - * of the large data set. However, in the parallel version, each + * of the large data set. However, in the parallel version, each * process only works with that slice of the large cube indicated - * by its rank -- hence we set the most slowly changing index to + * by its rank -- hence we set the most slowly changing index to * mpi_rank, and don't itterate over it. */ @@ -3075,9 +3073,9 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -3101,7 +3099,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -3121,8 +3119,8 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->skips = 0; /* reset the skips counter */ - /* we know that small_rank - 1 >= 1 and that - * large_rank > small_rank by the assertions at the head + /* we know that small_rank - 1 >= 1 and that + * large_rank > small_rank by the assertions at the head * of this function. Thus no need for another inner loop. */ tv_ptr->start[0] = (hsize_t)i; @@ -3157,15 +3155,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /* Read selection from disk */ -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, - tv_ptr->mpi_rank, tv_ptr->start[0], tv_ptr->start[1], + tv_ptr->mpi_rank, tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], tv_ptr->start[3], tv_ptr->start[4]); HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n", fcnName, H5Sget_simple_extent_ndims(tv_ptr->small_ds_slice_sid), H5Sget_simple_extent_ndims(tv_ptr->file_large_ds_sid_0)); -#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ ret = H5Dread(tv_ptr->large_dataset, H5T_NATIVE_UINT32, @@ -3175,15 +3173,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->small_ds_slice_buf); VRFY((ret >= 0), "H5Dread() slice from large ds succeeded."); -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG - HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG + HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", fcnName, tv_ptr->mpi_rank); #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ /* verify that expected data is retrieved */ expected_value = (uint32_t) - ((i * tv_ptr->edge_size * tv_ptr->edge_size * + ((i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -3199,7 +3197,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) (hbool_t)TRUE ); - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "small slice read from large ds data good."); (tv_ptr->tests_run)++; @@ -3227,27 +3225,27 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test__d2m_s2l() + * Function: ckrbrd_hs_dr_pio_test__d2m_s2l() * - * Purpose: Part two of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part two of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can read from disk correctly using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can read from disk correctly using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * In this function, we test this by reading checker board - * slices of the on disk small data set into slices through - * the in memory large data set, and verify that the correct - * data (and only the correct data) is read. + * In this function, we test this by reading checker board + * slices of the on disk small data set into slices through + * the in memory large data set, and verify that the correct + * data (and only the correct data) is read. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/15/11 + * Programmer: JRM -- 8/15/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -3257,27 +3255,27 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) static void ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__d2m_s2l()"; #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ - hbool_t data_ok = FALSE; - int i, j, k, l; + hbool_t data_ok = FALSE; + int i, j, k, l; size_t u; size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; - int mpi_rank; /* needed by VRFY */ + int mpi_rank; /* needed by VRFY */ hsize_t sel_start[PAR_SS_DR_MAX_RANK]; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; - /* similarly, read slices of the on disk small data set into slices - * through the in memory large data set, and verify that the correct + /* similarly, read slices of the on disk small data set into slices + * through the in memory large data set, and verify that the correct * data (and only the correct data) is read. */ @@ -3292,8 +3290,8 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->small_rank - 1, sel_start); -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG - HDfprintf(stdout, +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG + HDfprintf(stdout, "%s reading slices of on disk small data set into slices of big data set.\n", fcnName); #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ @@ -3303,7 +3301,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /* set up start, stride, count, and block -- note that we will * change start[] so as to read the slice of the small data set - * into different slices of the process slice of the large data + * into different slices of the process slice of the large data * set. */ for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { @@ -3322,11 +3320,11 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } /* in serial versions of this test, we loop through all the dimensions - * of the large data set that don't appear in the small data set. + * of the large data set that don't appear in the small data set. * - * However, in the parallel version, each process only works with that - * slice of the large (and small) data set indicated by its rank -- hence - * we set the most slowly changing index to mpi_rank, and don't itterate + * However, in the parallel version, each process only works with that + * slice of the large (and small) data set indicated by its rank -- hence + * we set the most slowly changing index to mpi_rank, and don't itterate * over it. */ @@ -3340,9 +3338,9 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -3366,7 +3364,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -3423,11 +3421,11 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /* Read selection from disk */ -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, tv_ptr->mpi_rank, - tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], - tv_ptr->start[3], tv_ptr->start[4]); +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, tv_ptr->mpi_rank, + tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], + tv_ptr->start[3], tv_ptr->start[4]); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, H5Sget_simple_extent_ndims(tv_ptr->large_ds_slice_sid), @@ -3446,21 +3444,21 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) */ data_ok = TRUE; ptr_1 = tv_ptr->large_ds_buf_1; - expected_value = + expected_value = (uint32_t)((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); start_index = (size_t)( - (i * tv_ptr->edge_size * tv_ptr->edge_size * + (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); stop_index = start_index + tv_ptr->small_ds_slice_size - 1; -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG { int m, n; - HDfprintf(stdout, "%s:%d: expected_value = %d.\n", + HDfprintf(stdout, "%s:%d: expected_value = %d.\n", fcnName, tv_ptr->mpi_rank, expected_value); HDfprintf(stdout, "%s:%d: start/stop index = %d/%d.\n", fcnName, tv_ptr->mpi_rank, start_index, stop_index); @@ -3495,7 +3493,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1++; } - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "slice read from small to large ds data good(1)."); data_ok = ckrbrd_hs_dr_pio_test__verify_data @@ -3508,7 +3506,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) (hbool_t)TRUE ); - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "slice read from small to large ds data good(2)."); @@ -3527,7 +3525,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1++; } - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "slice read from small to large ds data good(3)."); (tv_ptr->tests_run)++; @@ -3555,31 +3553,31 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test__m2d_l2s() + * Function: ckrbrd_hs_dr_pio_test__m2d_l2s() * - * Purpose: Part three of a series of tests of I/O to/from checker - * board hyperslab selections of different rank in the - * parallel. + * Purpose: Part three of a series of tests of I/O to/from checker + * board hyperslab selections of different rank in the + * parallel. * - * Verify that we can write from memory to file using checker - * board selections of different rank that - * H5S_select_shape_same() views as being of the same shape. + * Verify that we can write from memory to file using checker + * board selections of different rank that + * H5S_select_shape_same() views as being of the same shape. * - * Do this by writing small_rank - 1 dimensional checker - * board slices from the in memory large data set to the on - * disk small cube dataset. After each write, read the - * slice of the small dataset back from disk, and verify - * that it contains the expected data. Verify that - * H5S_select_shape_same() returns true on the memory and - * file selections. + * Do this by writing small_rank - 1 dimensional checker + * board slices from the in memory large data set to the on + * disk small cube dataset. After each write, read the + * slice of the small dataset back from disk, and verify + * that it contains the expected data. Verify that + * H5S_select_shape_same() returns true on the memory and + * file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/15/11 + * Programmer: JRM -- 8/15/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -3589,21 +3587,21 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) static void ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_l2s()"; #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ - hbool_t data_ok = FALSE; - hbool_t mis_match = FALSE; - int i, j, k, l; + hbool_t data_ok = FALSE; + hbool_t mis_match = FALSE; + int i, j, k, l; size_t u; size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; - int mpi_rank; /* needed by VRFY */ + int mpi_rank; /* needed by VRFY */ hsize_t sel_start[PAR_SS_DR_MAX_RANK]; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; @@ -3614,9 +3612,9 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) * H5S_select_shape_same() views as being of the same shape. * * Start by writing small_rank - 1 D slices from the in memory large data - * set to the on disk small dataset. After each write, read the slice of - * the small dataset back from disk, and verify that it contains the - * expected data. Verify that H5S_select_shape_same() returns true on + * set to the on disk small dataset. After each write, read the slice of + * the small dataset back from disk, and verify that it contains the + * expected data. Verify that H5S_select_shape_same() returns true on * the memory and file selections. */ @@ -3684,18 +3682,18 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) HDmemset(tv_ptr->small_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->small_ds_size); -#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG - HDfprintf(stdout, +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG + HDfprintf(stdout, "%s writing checker boards selections of slices from big ds to slices of small ds on disk.\n", fcnName); #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ /* in serial versions of this test, we loop through all the dimensions - * of the large data set that don't appear in the small data set. + * of the large data set that don't appear in the small data set. * - * However, in the parallel version, each process only works with that - * slice of the large (and small) data set indicated by its rank -- hence - * we set the most slowly changing index to mpi_rank, and don't itterate + * However, in the parallel version, each process only works with that + * slice of the large (and small) data set indicated by its rank -- hence + * we set the most slowly changing index to mpi_rank, and don't itterate * over it. */ @@ -3709,9 +3707,9 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -3736,7 +3734,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -3760,7 +3758,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) * by the assertions at the head of this function. Thus no * need for another inner loop. */ - + /* zero out this rank's slice of the on disk small data set */ ret = H5Dwrite(tv_ptr->small_dataset, H5T_NATIVE_UINT32, @@ -3769,7 +3767,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->xfer_plist, tv_ptr->small_ds_buf_2); VRFY((ret >= 0), "H5Dwrite() zero slice to small ds succeeded."); - + /* select the portion of the in memory large cube from which we * are going to write data. */ @@ -3778,13 +3776,13 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->start[2] = (hsize_t)k; tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - + HDassert((tv_ptr->start[0] == 0)||(0 < tv_ptr->small_ds_offset + 1)); HDassert((tv_ptr->start[1] == 0)||(1 < tv_ptr->small_ds_offset + 1)); HDassert((tv_ptr->start[2] == 0)||(2 < tv_ptr->small_ds_offset + 1)); HDassert((tv_ptr->start[3] == 0)||(3 < tv_ptr->small_ds_offset + 1)); HDassert((tv_ptr->start[4] == 0)||(4 < tv_ptr->small_ds_offset + 1)); - + ckrbrd_hs_dr_pio_test__slct_ckrbrd ( tv_ptr->mpi_rank, @@ -3795,26 +3793,26 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->small_rank - 1, tv_ptr->start ); - - + + /* verify that H5S_select_shape_same() reports the in - * memory checkerboard selection of the slice through the + * memory checkerboard selection of the slice through the * large dataset and the checkerboard selection of the process * slice of the small data set as having the same shape. */ check = H5S_select_shape_same_test(tv_ptr->file_small_ds_sid_1, tv_ptr->mem_large_ds_sid); VRFY((check == TRUE), "H5S_select_shape_same_test passed."); - - - /* write the checker board selection of the slice from the in - * memory large data set to the slice of the on disk small - * dataset. + + + /* write the checker board selection of the slice from the in + * memory large data set to the slice of the on disk small + * dataset. */ -#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, tv_ptr->mpi_rank, - tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], + tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], tv_ptr->start[3], tv_ptr->start[4]); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -3828,8 +3826,8 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->xfer_plist, tv_ptr->large_ds_buf_0); VRFY((ret >= 0), "H5Dwrite() slice to large ds succeeded."); - - + + /* read the on disk process slice of the small dataset into memory */ ret = H5Dread(tv_ptr->small_dataset, H5T_NATIVE_UINT32, @@ -3838,30 +3836,30 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->xfer_plist, tv_ptr->small_ds_buf_1); VRFY((ret >= 0), "H5Dread() slice from small ds succeeded."); - - + + /* verify that expected data is retrieved */ - + mis_match = FALSE; - + expected_value = (uint32_t)( - (i * tv_ptr->edge_size * tv_ptr->edge_size * + (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); - + start_index = (size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size; stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - + HDassert( start_index < stop_index ); HDassert( stop_index <= tv_ptr->small_ds_size ); - + data_ok = TRUE; - + ptr_1 = tv_ptr->small_ds_buf_1; for ( u = 0; u < start_index; u++, ptr_1++ ) { - + if ( *ptr_1 != 0 ) { data_ok = FALSE; @@ -3890,7 +3888,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } } - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "large slice write slice to small slice data good."); (tv_ptr->tests_run)++; @@ -3918,31 +3916,31 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test__m2d_s2l() + * Function: ckrbrd_hs_dr_pio_test__m2d_s2l() * - * Purpose: Part four of a series of tests of I/O to/from checker - * board hyperslab selections of different rank in the parallel. + * Purpose: Part four of a series of tests of I/O to/from checker + * board hyperslab selections of different rank in the parallel. * - * Verify that we can write from memory to file using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can write from memory to file using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * Do this by writing checker board selections of the contents - * of the process's slice of the in memory small data set to - * slices of the on disk large data set. After each write, - * read the process's slice of the large data set back into - * memory, and verify that it contains the expected data. + * Do this by writing checker board selections of the contents + * of the process's slice of the in memory small data set to + * slices of the on disk large data set. After each write, + * read the process's slice of the large data set back into + * memory, and verify that it contains the expected data. * - * Verify that H5S_select_shape_same() returns true on the - * memory and file selections. + * Verify that H5S_select_shape_same() returns true on the + * memory and file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/15/11 + * Programmer: JRM -- 8/15/11 * * Modifications: * - * None + * None * *------------------------------------------------------------------------- */ @@ -3952,31 +3950,31 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) static void ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_s2l()"; #endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ - hbool_t data_ok = FALSE; - hbool_t mis_match = FALSE; - int i, j, k, l; + hbool_t data_ok = FALSE; + hbool_t mis_match = FALSE; + int i, j, k, l; size_t u; size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; - int mpi_rank; /* needed by VRFY */ + int mpi_rank; /* needed by VRFY */ hsize_t sel_start[PAR_SS_DR_MAX_RANK]; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; - /* Now write the contents of the process's slice of the in memory - * small data set to slices of the on disk large data set. After + /* Now write the contents of the process's slice of the in memory + * small data set to slices of the on disk large data set. After * each write, read the process's slice of the large data set back - * into memory, and verify that it contains the expected data. - * Verify that H5S_select_shape_same() returns true on the memory + * into memory, and verify that it contains the expected data. + * Verify that H5S_select_shape_same() returns true on the memory * and file selections. */ @@ -4009,7 +4007,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(tv_ptr->mem_large_ds_sid, set) suceeded"); - /* setup a checkerboard selection of the slice of the in memory small + /* setup a checkerboard selection of the slice of the in memory small * data set associated with the process's mpi rank. */ @@ -4025,7 +4023,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) sel_start); /* set up start, stride, count, and block -- note that we will - * change start[] so as to write checkerboard selections of slices + * change start[] so as to write checkerboard selections of slices * of the small data set to slices of the large data set. */ for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { @@ -4047,7 +4045,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size); #if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG - HDfprintf(stdout, + HDfprintf(stdout, "%s writing process checkerboard selections of slices of small ds to process slices of large ds on disk.\n", fcnName); #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ @@ -4061,9 +4059,9 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -4087,7 +4085,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -4162,13 +4160,13 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - /* write the small data set slice from memory to the - * target slice of the disk data set + /* write the small data set slice from memory to the + * target slice of the disk data set */ -#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, tv_ptr->mpi_rank, - tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], + tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], tv_ptr->start[3], tv_ptr->start[4]); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -4181,11 +4179,11 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->file_large_ds_sid_1, tv_ptr->xfer_plist, tv_ptr->small_ds_buf_0); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Dwrite of small ds slice to large ds succeeded"); - /* read this processes slice on the on disk large + /* read this processes slice on the on disk large * data set into memory. */ @@ -4195,18 +4193,18 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->file_large_ds_sid_0, tv_ptr->xfer_plist, tv_ptr->large_ds_buf_1); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Dread() of process slice of large ds succeeded"); /* verify that the expected data and only the * expected data was read. */ - expected_value = + expected_value = (uint32_t)((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); start_index = (size_t) - ((i * tv_ptr->edge_size * tv_ptr->edge_size * + ((i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -4252,7 +4250,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } } - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "small ds cb slice write to large ds slice data good."); (tv_ptr->tests_run)++; @@ -4280,22 +4278,22 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test__run_test() + * Function: ckrbrd_hs_dr_pio_test__run_test() * - * Purpose: Test I/O to/from checkerboard selections of hyperslabs of - * different rank in the parallel. + * Purpose: Test I/O to/from checkerboard selections of hyperslabs of + * different rank in the parallel. * - * Return: void + * Return: void * - * Programmer: JRM -- 10/10/09 + * Programmer: JRM -- 10/10/09 * * Modifications: * - * JRM -- 9/16/10 - * Added the express_test parameter. Use it to control - * whether we set an alignment, and whether we allocate - * chunks such that no two processes will normally touch - * the same chunk. + * JRM -- 9/16/10 + * Added the express_test parameter. Use it to control + * whether we set an alignment, and whether we allocate + * chunks such that no two processes will normally touch + * the same chunk. * *------------------------------------------------------------------------- */ @@ -4322,10 +4320,10 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, #if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__run_test()"; #endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ - int mpi_rank; /* needed by VRFY */ - struct hs_dr_pio_test_vars_t test_vars = + int mpi_rank; /* needed by VRFY */ + struct hs_dr_pio_test_vars_t test_vars = { - /* int mpi_size = */ -1, + /* int mpi_size = */ -1, /* int mpi_rank = */ -1, /* MPI_Comm mpi_comm = */ MPI_COMM_NULL, /* MPI_Inf mpi_info = */ MPI_INFO_NULL, @@ -4341,7 +4339,7 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, /* uint32_t * small_ds_buf_2 = */ NULL, /* uint32_t * small_ds_slice_buf = */ NULL, /* uint32_t * large_ds_buf_0 = */ NULL, - /* uint32_t * large_ds_buf_1 = */ NULL, + /* uint32_t * large_ds_buf_1 = */ NULL, /* uint32_t * large_ds_buf_2 = */ NULL, /* uint32_t * large_ds_slice_buf = */ NULL, /* int small_ds_offset = */ -1, @@ -4378,17 +4376,17 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, /* hsize_t * stride_ptr = */ NULL, /* hsize_t * count_ptr = */ NULL, /* hsize_t * block_ptr = */ NULL, - /* int skips = */ 0, - /* int max_skips = */ 0, + /* int skips = */ 0, + /* int max_skips = */ 0, /* int64_t total_tests = */ 0, /* int64_t tests_run = */ 0, /* int64_t tests_skipped = */ 0 }; struct hs_dr_pio_test_vars_t * tv_ptr = &test_vars; - hs_dr_pio_test__setup(test_num, edge_size, checker_edge_size, - chunk_edge_size, small_rank, large_rank, - use_collective_io, dset_type, express_test, + hs_dr_pio_test__setup(test_num, edge_size, checker_edge_size, + chunk_edge_size, small_rank, large_rank, + use_collective_io, dset_type, express_test, tv_ptr); @@ -4414,9 +4412,9 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, * of different rank that H5S_select_shape_same() views as being of the * same shape. * - * Start by reading a (small_rank - 1)-D slice from this processes slice - * of the on disk large data set, and verifying that the data read is - * correct. Verify that H5S_select_shape_same() returns true on the + * Start by reading a (small_rank - 1)-D slice from this processes slice + * of the on disk large data set, and verifying that the data read is + * correct. Verify that H5S_select_shape_same() returns true on the * memory and file selections. * * The first step is to set up the needed checker board selection in the @@ -4426,8 +4424,8 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, ckrbrd_hs_dr_pio_test__d2m_l2s(tv_ptr); - /* similarly, read slices of the on disk small data set into slices - * through the in memory large data set, and verify that the correct + /* similarly, read slices of the on disk small data set into slices + * through the in memory large data set, and verify that the correct * data (and only the correct data) is read. */ @@ -4439,20 +4437,20 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, * H5S_select_shape_same() views as being of the same shape. * * Start by writing small_rank - 1 D slices from the in memory large data - * set to the on disk small dataset. After each write, read the slice of - * the small dataset back from disk, and verify that it contains the - * expected data. Verify that H5S_select_shape_same() returns true on + * set to the on disk small dataset. After each write, read the slice of + * the small dataset back from disk, and verify that it contains the + * expected data. Verify that H5S_select_shape_same() returns true on * the memory and file selections. */ ckrbrd_hs_dr_pio_test__m2d_l2s(tv_ptr); - /* Now write the contents of the process's slice of the in memory - * small data set to slices of the on disk large data set. After + /* Now write the contents of the process's slice of the in memory + * small data set to slices of the on disk large data set. After * each write, read the process's slice of the large data set back - * into memory, and verify that it contains the expected data. - * Verify that H5S_select_shape_same() returns true on the memory + * into memory, and verify that it contains the expected data. + * Verify that H5S_select_shape_same() returns true on the memory * and file selections. */ @@ -4461,8 +4459,8 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, #if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { - HDfprintf(stdout, - "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n", + HDfprintf(stdout, + "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n", test_num, (long long)(tv_ptr->tests_run), (long long)(tv_ptr->tests_skipped), (long long)(tv_ptr->total_tests)); } @@ -4487,28 +4485,28 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test() + * Function: ckrbrd_hs_dr_pio_test() * - * Purpose: Test I/O to/from hyperslab selections of different rank in - * the parallel case. + * Purpose: Test I/O to/from hyperslab selections of different rank in + * the parallel case. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/18/09 + * Programmer: JRM -- 9/18/09 * * Modifications: * - * Modified function to take a sample of the run times - * of the different tests, and skip some of them if - * run times are too long. + * Modified function to take a sample of the run times + * of the different tests, and skip some of them if + * run times are too long. * - * We need to do this because Lustre runns very slowly - * if two or more processes are banging on the same - * block of memory. - * JRM -- 9/10/10 - * Break this one big test into 4 smaller tests according - * to {independent,collective}x{contigous,chunked} datasets. - * AKC -- 2010/01/17 + * We need to do this because Lustre runns very slowly + * if two or more processes are banging on the same + * block of memory. + * JRM -- 9/10/10 + * Break this one big test into 4 smaller tests according + * to {independent,collective}x{contigous,chunked} datasets. + * AKC -- 2010/01/17 * *------------------------------------------------------------------------- */ @@ -4518,16 +4516,16 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type) { int express_test; int local_express_test; - int mpi_size = -1; + int mpi_size = -1; int mpi_rank = -1; - int test_num = 0; - int edge_size; + int test_num = 0; + int edge_size; int checker_edge_size = 3; - int chunk_edge_size = 0; - int small_rank = 3; - int large_rank = 4; - int mpi_result; - hid_t dset_type = H5T_NATIVE_UINT; + int chunk_edge_size = 0; + int small_rank = 3; + int large_rank = 4; + int mpi_result; + hid_t dset_type = H5T_NATIVE_UINT; int skips = 0; int max_skips = 0; /* The following table list the number of sub-tests skipped between @@ -4566,13 +4564,13 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type) max_skips = max_skips_tbl[local_express_test]; } -#if 0 +#if 0 { int DebugWait = 1; - + while (DebugWait) ; } -#endif +#endif for ( large_rank = 3; large_rank <= PAR_SS_DR_MAX_RANK; large_rank++ ) { @@ -4702,15 +4700,15 @@ int dim0; int dim1; int chunkdim0; int chunkdim1; -int nerrors = 0; /* errors count */ -int ndatasets = 300; /* number of datasets to create*/ +int nerrors = 0; /* errors count */ +int ndatasets = 300; /* number of datasets to create*/ int ngroups = 512; /* number of groups to create in root * group. */ -int facc_type = FACC_MPIO; /*Test file access type */ +int facc_type = FACC_MPIO; /*Test file access type */ int dxfer_coll_type = DXFER_COLLECTIVE_IO; -H5E_auto2_t old_func; /* previous error handler */ -void *old_client_data; /* previous error handler arg.*/ +H5E_auto2_t old_func; /* previous error handler */ +void *old_client_data; /* previous error handler arg.*/ /* other option flags */ @@ -4722,10 +4720,10 @@ void *old_client_data; /* previous error handler arg.*/ #define NFILENAME 2 #define PARATESTFILE filenames[0] const char *FILENAME[NFILENAME]={ - "ShapeSameTest", - NULL}; -char filenames[NFILENAME][PATH_MAX]; -hid_t fapl; /* file access property list */ + "ShapeSameTest", + NULL}; +char filenames[NFILENAME][PATH_MAX]; +hid_t fapl; /* file access property list */ #ifdef USE_PAUSE /* pause the process for a moment to allow debugger to attach if desired. */ @@ -4738,7 +4736,7 @@ void pause_proc(void) { int pid; - h5_stat_t statbuf; + h5_stat_t statbuf; char greenlight[] = "go"; int maxloop = 10; int loops = 0; @@ -4755,15 +4753,15 @@ void pause_proc(void) MPI_Get_processor_name(mpi_name, &mpi_namelen); if (MAINPROCESS) - while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){ - if (!loops++){ - printf("Proc %d (%*s, %d): to debug, attach %d\n", - mpi_rank, mpi_namelen, mpi_name, pid, pid); - } - printf("waiting(%ds) for file %s ...\n", time_int, greenlight); - fflush(stdout); + while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){ + if (!loops++){ + printf("Proc %d (%*s, %d): to debug, attach %d\n", + mpi_rank, mpi_namelen, mpi_name, pid, pid); + } + printf("waiting(%ds) for file %s ...\n", time_int, greenlight); + fflush(stdout); HDsleep(time_int); - } + } MPI_Barrier(MPI_COMM_WORLD); } @@ -4775,7 +4773,7 @@ int MPI_Init(int *argc, char ***argv) pause_proc(); return (ret_code); } -#endif /* USE_PAUSE */ +#endif /* USE_PAUSE */ /* @@ -4785,15 +4783,15 @@ static void usage(void) { printf(" [-r] [-w] [-m] [-n] " - "[-o] [-f ] [-d ]\n"); + "[-o] [-f ] [-d ]\n"); printf("\t-m" - "\tset number of datasets for the multiple dataset test\n"); + "\tset number of datasets for the multiple dataset test\n"); printf("\t-n" "\tset number of groups for the multiple group test\n"); printf("\t-f \tfilename prefix\n"); printf("\t-2\t\tuse Split-file together with MPIO\n"); printf("\t-d \tdataset dimensions factors. Defaults (%d,%d)\n", - ROW_FACTOR, COL_FACTOR); + ROW_FACTOR, COL_FACTOR); printf("\t-c \tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n"); printf("\n"); } @@ -4805,7 +4803,7 @@ usage(void) static int parse_options(int argc, char **argv) { - int mpi_size, mpi_rank; /* mpi variables */ + int mpi_size, mpi_rank; /* mpi variables */ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); @@ -4816,107 +4814,107 @@ parse_options(int argc, char **argv) chunkdim1 = (dim1+9)/10; while (--argc){ - if (**(++argv) != '-'){ - break; - }else{ - switch(*(*argv+1)){ - case 'm': ndatasets = atoi((*argv+1)+1); - if (ndatasets < 0){ - nerrors++; - return(1); - } - break; - case 'n': ngroups = atoi((*argv+1)+1); - if (ngroups < 0){ + if (**(++argv) != '-'){ + break; + }else{ + switch(*(*argv+1)){ + case 'm': ndatasets = atoi((*argv+1)+1); + if (ndatasets < 0){ + nerrors++; + return(1); + } + break; + case 'n': ngroups = atoi((*argv+1)+1); + if (ngroups < 0){ nerrors++; return(1); - } + } break; - case 'f': if (--argc < 1) { - nerrors++; - return(1); - } - if (**(++argv) == '-') { - nerrors++; - return(1); - } - paraprefix = *argv; - break; - case 'i': /* Collective MPI-IO access with independent IO */ - dxfer_coll_type = DXFER_INDEPENDENT_IO; - break; - case '2': /* Use the split-file driver with MPIO access */ - /* Can use $HDF5_METAPREFIX to define the */ - /* meta-file-prefix. */ - facc_type = FACC_MPIO | FACC_SPLIT; - break; - case 'd': /* dimensizes */ - if (--argc < 2){ - nerrors++; - return(1); - } - dim0 = atoi(*(++argv))*mpi_size; - argc--; - dim1 = atoi(*(++argv))*mpi_size; - /* set default chunkdim sizes too */ - chunkdim0 = (dim0+9)/10; - chunkdim1 = (dim1+9)/10; - break; - case 'c': /* chunk dimensions */ - if (--argc < 2){ - nerrors++; - return(1); - } - chunkdim0 = atoi(*(++argv)); - argc--; - chunkdim1 = atoi(*(++argv)); - break; - case 'h': /* print help message--return with nerrors set */ - return(1); - default: printf("Illegal option(%s)\n", *argv); - nerrors++; - return(1); - } - } + case 'f': if (--argc < 1) { + nerrors++; + return(1); + } + if (**(++argv) == '-') { + nerrors++; + return(1); + } + paraprefix = *argv; + break; + case 'i': /* Collective MPI-IO access with independent IO */ + dxfer_coll_type = DXFER_INDEPENDENT_IO; + break; + case '2': /* Use the split-file driver with MPIO access */ + /* Can use $HDF5_METAPREFIX to define the */ + /* meta-file-prefix. */ + facc_type = FACC_MPIO | FACC_SPLIT; + break; + case 'd': /* dimensizes */ + if (--argc < 2){ + nerrors++; + return(1); + } + dim0 = atoi(*(++argv))*mpi_size; + argc--; + dim1 = atoi(*(++argv))*mpi_size; + /* set default chunkdim sizes too */ + chunkdim0 = (dim0+9)/10; + chunkdim1 = (dim1+9)/10; + break; + case 'c': /* chunk dimensions */ + if (--argc < 2){ + nerrors++; + return(1); + } + chunkdim0 = atoi(*(++argv)); + argc--; + chunkdim1 = atoi(*(++argv)); + break; + case 'h': /* print help message--return with nerrors set */ + return(1); + default: printf("Illegal option(%s)\n", *argv); + nerrors++; + return(1); + } + } } /*while*/ /* check validity of dimension and chunk sizes */ if (dim0 <= 0 || dim1 <= 0){ - printf("Illegal dim sizes (%d, %d)\n", dim0, dim1); - nerrors++; - return(1); + printf("Illegal dim sizes (%d, %d)\n", dim0, dim1); + nerrors++; + return(1); } if (chunkdim0 <= 0 || chunkdim1 <= 0){ - printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1); - nerrors++; - return(1); + printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1); + nerrors++; + return(1); } /* Make sure datasets can be divided into equal portions by the processes */ if ((dim0 % mpi_size) || (dim1 % mpi_size)){ - if (MAINPROCESS) - printf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n", - dim0, dim1, mpi_size); - nerrors++; - return(1); + if (MAINPROCESS) + printf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n", + dim0, dim1, mpi_size); + nerrors++; + return(1); } /* compose the test filenames */ { - int i, n; - - n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */ - - for (i=0; i < n; i++) - if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i])) - == NULL){ - printf("h5_fixname failed\n"); - nerrors++; - return(1); - } - printf("Test filenames are:\n"); - for (i=0; i < n; i++) - printf(" %s\n", filenames[i]); + int i, n; + + n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */ + + for (i=0; i < n; i++) + if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i])) + == NULL){ + printf("h5_fixname failed\n"); + nerrors++; + return(1); + } + printf("Test filenames are:\n"); + for (i=0; i < n; i++) + printf(" %s\n", filenames[i]); } return(0); @@ -4931,7 +4929,7 @@ 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 */ + int mpi_rank; /* mpi variables */ /* need the rank for error checking macros */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); @@ -4940,36 +4938,36 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) VRFY((ret_pl >= 0), "H5P_FILE_ACCESS"); if (l_facc_type == FACC_DEFAULT) - return (ret_pl); + 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), ""); + /* 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), ""); + VRFY((ret >= 0), ""); ret = H5Pset_coll_metadata_write(ret_pl, TRUE); - VRFY((ret >= 0), ""); - return(ret_pl); + 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); + 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 */ @@ -5037,7 +5035,7 @@ sschecker4(void) int main(int argc, char **argv) { - int mpi_size, mpi_rank; /* mpi variables */ + int mpi_size, mpi_rank; /* mpi variables */ #ifndef H5_HAVE_WIN32_API /* Un-buffer the stdout and stderr */ @@ -5053,10 +5051,10 @@ int main(int argc, char **argv) dim1 = COL_FACTOR*mpi_size; if (MAINPROCESS){ - printf("===================================\n"); - printf("Shape Same Tests Start\n"); - printf(" express_test = %d.\n", GetTestExpress()); - printf("===================================\n"); + printf("===================================\n"); + printf("Shape Same Tests Start\n"); + printf(" express_test = %d.\n", GetTestExpress()); + printf("===================================\n"); } /* Attempt to turn off atexit post processing so that in case errors @@ -5065,7 +5063,7 @@ int main(int argc, char **argv) * calls. By then, MPI calls may not work. */ if (H5dont_atexit() < 0){ - printf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank); + printf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank); }; H5open(); h5_show_hostname(); @@ -5075,23 +5073,23 @@ int main(int argc, char **argv) /* Shape Same tests using contigous hyperslab */ AddTest("sscontig1", sscontig1, NULL, - "Cntg hslab, ind IO, cntg dsets", PARATESTFILE); + "Cntg hslab, ind IO, cntg dsets", PARATESTFILE); AddTest("sscontig2", sscontig2, NULL, - "Cntg hslab, col IO, cntg dsets", PARATESTFILE); + "Cntg hslab, col IO, cntg dsets", PARATESTFILE); AddTest("sscontig3", sscontig3, NULL, - "Cntg hslab, ind IO, chnk dsets", PARATESTFILE); + "Cntg hslab, ind IO, chnk dsets", PARATESTFILE); AddTest("sscontig4", sscontig4, NULL, - "Cntg hslab, col IO, chnk dsets", PARATESTFILE); + "Cntg hslab, col IO, chnk dsets", PARATESTFILE); /* Shape Same tests using checker board hyperslab */ AddTest("sschecker1", sschecker1, NULL, - "Check hslab, ind IO, cntg dsets", PARATESTFILE); + "Check hslab, ind IO, cntg dsets", PARATESTFILE); AddTest("sschecker2", sschecker2, NULL, - "Check hslab, col IO, cntg dsets", PARATESTFILE); + "Check hslab, col IO, cntg dsets", PARATESTFILE); AddTest("sschecker3", sschecker3, NULL, - "Check hslab, ind IO, chnk dsets", PARATESTFILE); + "Check hslab, ind IO, chnk dsets", PARATESTFILE); AddTest("sschecker4", sschecker4, NULL, - "Check hslab, col IO, chnk dsets", PARATESTFILE); + "Check hslab, col IO, chnk dsets", PARATESTFILE); /* Display testing information */ TestInfo(argv[0]); @@ -5104,9 +5102,9 @@ int main(int argc, char **argv) TestParseCmdLine(argc, argv); if (dxfer_coll_type == DXFER_INDEPENDENT_IO && MAINPROCESS){ - printf("===================================\n" - " Using Independent I/O with file set view to replace collective I/O \n" - "===================================\n"); + printf("===================================\n" + " Using Independent I/O with file set view to replace collective I/O \n" + "===================================\n"); } @@ -5131,16 +5129,16 @@ int main(int argc, char **argv) { int temp; MPI_Allreduce(&nerrors, &temp, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); - nerrors=temp; + nerrors=temp; } - if (MAINPROCESS){ /* only process 0 reports */ - printf("===================================\n"); - if (nerrors) - printf("***Shape Same tests detected %d errors***\n", nerrors); - else - printf("Shape Same tests finished with no errors\n"); - printf("===================================\n"); + if (MAINPROCESS){ /* only process 0 reports */ + printf("===================================\n"); + if (nerrors) + printf("***Shape Same tests detected %d errors***\n", nerrors); + else + printf("Shape Same tests finished with no errors\n"); + printf("===================================\n"); } /* close HDF5 library */ diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index a42df95..20bc4ac 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -23,17 +23,15 @@ 2) We will read two datasets with the same hyperslab selection settings, 1. independent read to read independent output, independent read to read collecive output, - Compare the result, - If the result is the same, then collective write succeeds. + Compare the result, + If the result is the same, then collective write succeeds. 2. collective read to read independent output, independent read to read independent output, - Compare the result, - If the result is the same, then collective read succeeds. + Compare the result, + If the result is the same, then collective read succeeds. */ -#include "hdf5.h" -#include "H5private.h" #include "testphdf5.h" @@ -42,17 +40,17 @@ static void coll_read_test(int chunk_factor); /*------------------------------------------------------------------------- - * Function: coll_irregular_cont_write + * Function: coll_irregular_cont_write * - * Purpose: Wrapper to test the collectively irregular hyperslab write in + * Purpose: Wrapper to test the collectively irregular hyperslab write in contiguous storage * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -69,17 +67,17 @@ coll_irregular_cont_write(void) /*------------------------------------------------------------------------- - * Function: coll_irregular_cont_read + * Function: coll_irregular_cont_read * - * Purpose: Wrapper to test the collectively irregular hyperslab read in + * Purpose: Wrapper to test the collectively irregular hyperslab read in contiguous storage * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -95,17 +93,17 @@ coll_irregular_cont_read(void) /*------------------------------------------------------------------------- - * Function: coll_irregular_simple_chunk_write + * Function: coll_irregular_simple_chunk_write * - * Purpose: Wrapper to test the collectively irregular hyperslab write in + * Purpose: Wrapper to test the collectively irregular hyperslab write in chunk storage(1 chunk) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -122,17 +120,17 @@ coll_irregular_simple_chunk_write(void) /*------------------------------------------------------------------------- - * Function: coll_irregular_simple_chunk_read + * Function: coll_irregular_simple_chunk_read * - * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk + * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk storage(1 chunk) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -147,17 +145,17 @@ coll_irregular_simple_chunk_read(void) } /*------------------------------------------------------------------------- - * Function: coll_irregular_complex_chunk_write + * Function: coll_irregular_complex_chunk_write * - * Purpose: Wrapper to test the collectively irregular hyperslab write in chunk + * Purpose: Wrapper to test the collectively irregular hyperslab write in chunk storage(4 chunks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -174,17 +172,17 @@ coll_irregular_complex_chunk_write(void) /*------------------------------------------------------------------------- - * Function: coll_irregular_complex_chunk_read + * Function: coll_irregular_complex_chunk_read * - * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk + * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk storage(1 chunk) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -200,18 +198,18 @@ coll_irregular_complex_chunk_read(void) /*------------------------------------------------------------------------- - * Function: coll_write_test + * Function: coll_write_test * - * Purpose: To test the collectively irregular hyperslab write in chunk + * Purpose: To test the collectively irregular hyperslab write in chunk storage * Input: number of chunks on each dimension if number is equal to 0, contiguous storage - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: Oct 18th, 2005 * @@ -229,14 +227,14 @@ void coll_write_test(int chunk_factor) #if 0 hsize_t mdim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset - (in memory) */ + (in memory) */ hsize_t fsdim[] = {FSPACE_DIM1, FSPACE_DIM2}; /* Dimension sizes of the dataset (on disk) */ hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the - dataset in memory when we - read selection from the - dataset on the disk */ + dataset in memory when we + read selection from the + dataset on the disk */ #endif hsize_t start[2]; /* Start of hyperslab */ @@ -252,7 +250,7 @@ void coll_write_test(int chunk_factor) #if 0 int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the - dataset */ + dataset */ int vector[MSPACE1_DIM]; #endif @@ -616,12 +614,12 @@ void coll_write_test(int chunk_factor) */ ret = H5Dread(datasetc, H5T_NATIVE_INT, mspaceid, fspaceid, - H5P_DEFAULT, matrix_out); + H5P_DEFAULT, matrix_out); VRFY((ret >= 0),"H5D independent read succeed"); ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid, - H5P_DEFAULT, matrix_out1); + H5P_DEFAULT, matrix_out1); VRFY((ret >= 0),"H5D independent read succeed"); ret = 0; @@ -668,18 +666,18 @@ void coll_write_test(int chunk_factor) } /*------------------------------------------------------------------------- - * Function: coll_read_test + * Function: coll_read_test * - * Purpose: To test the collectively irregular hyperslab read in chunk + * Purpose: To test the collectively irregular hyperslab read in chunk storage * Input: number of chunks on each dimension if number is equal to 0, contiguous storage - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: Oct 18th, 2005 * Note: This test must be used with the correpsonding @@ -699,9 +697,9 @@ coll_read_test(int chunk_factor) /* Dimension sizes of the dataset (on disk) */ #if 0 hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the - dataset in memory when we - read selection from the - dataset on the disk */ + dataset in memory when we + read selection from the + dataset on the disk */ #endif hsize_t mdim[2]; @@ -718,7 +716,7 @@ coll_read_test(int chunk_factor) #if 0 int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the - dataset */ + dataset */ #endif int mpi_size,mpi_rank; @@ -882,7 +880,7 @@ coll_read_test(int chunk_factor) /* Collective read */ ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid1, - dxfer_plist, matrix_out); + dxfer_plist, matrix_out); VRFY((ret >= 0),"H5D collecive read succeed"); ret = H5Pclose(dxfer_plist); @@ -890,7 +888,7 @@ coll_read_test(int chunk_factor) /* Independent read */ ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid1, - H5P_DEFAULT, matrix_out1); + H5P_DEFAULT, matrix_out1); VRFY((ret >= 0),"H5D independent read succeed"); ret = 0; @@ -933,30 +931,30 @@ coll_read_test(int chunk_factor) /**************************************************************** ** -** lower_dim_size_comp_test__select_checker_board(): +** lower_dim_size_comp_test__select_checker_board(): ** -** Given a data space of tgt_rank, and dimensions: +** Given a data space of tgt_rank, and dimensions: ** -** (mpi_size + 1), edge_size, ... , edge_size +** (mpi_size + 1), edge_size, ... , edge_size ** -** edge_size, and a checker_edge_size, select a checker -** board selection of a sel_rank (sel_rank < tgt_rank) -** dimensional slice through the data space parallel to the +** edge_size, and a checker_edge_size, select a checker +** board selection of a sel_rank (sel_rank < tgt_rank) +** dimensional slice through the data space parallel to the ** sel_rank fastest changing indicies, with origin (in the -** higher indicies) as indicated by the start array. +** higher indicies) as indicated by the start array. ** -** Note that this function, is hard coded to presume a -** maximum data space rank of 5. +** Note that this function, is hard coded to presume a +** maximum data space rank of 5. ** -** While this maximum is declared as a constant, increasing -** it will require extensive coding in addition to changing +** While this maximum is declared as a constant, increasing +** it will require extensive coding in addition to changing ** the value of the constant. ** -** JRM -- 11/11/09 +** JRM -- 11/11/09 ** ****************************************************************/ -#define LDSCT_DS_RANK 5 +#define LDSCT_DS_RANK 5 #define LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK 0 #define LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG 0 @@ -971,32 +969,32 @@ lower_dim_size_comp_test__select_checker_board( const int sel_rank, hsize_t sel_start[]) { -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG - const char * fcnName = - "lower_dim_size_comp_test__select_checker_board():"; -#endif - hbool_t first_selection = TRUE; +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG + const char * fcnName = + "lower_dim_size_comp_test__select_checker_board():"; +#endif + hbool_t first_selection = TRUE; int i, j, k, l, m; - int ds_offset; - int sel_offset; - const int test_max_rank = LDSCT_DS_RANK; /* must update code if */ + int ds_offset; + int sel_offset; + const int test_max_rank = LDSCT_DS_RANK; /* must update code if */ /* this changes */ - hsize_t base_count; + hsize_t base_count; hsize_t offset_count; - hsize_t start[LDSCT_DS_RANK]; - hsize_t stride[LDSCT_DS_RANK]; - hsize_t count[LDSCT_DS_RANK]; - hsize_t block[LDSCT_DS_RANK]; - herr_t ret; /* Generic return value */ + hsize_t start[LDSCT_DS_RANK]; + hsize_t stride[LDSCT_DS_RANK]; + hsize_t count[LDSCT_DS_RANK]; + hsize_t block[LDSCT_DS_RANK]; + herr_t ret; /* Generic return value */ -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: dims/checker_edge_size = %d %d %d %d %d / %d\n", fcnName, mpi_rank, (int)dims[0], (int)dims[1], (int)dims[2], (int)dims[3], (int)dims[4], checker_edge_size); } -#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ +#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ HDassert( 0 < checker_edge_size ); HDassert( 0 < sel_rank ); @@ -1014,14 +1012,14 @@ lower_dim_size_comp_test__select_checker_board( HDassert( (hsize_t)checker_edge_size <= dims[sel_offset] ); HDassert( dims[sel_offset] == 10 ); -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n", + HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n", fcnName, mpi_rank, sel_rank, sel_offset); - HDfprintf(stdout, "%s:%d: tgt_rank/ds_offset = %d/%d.\n", + HDfprintf(stdout, "%s:%d: tgt_rank/ds_offset = %d/%d.\n", fcnName, mpi_rank, tgt_rank, ds_offset); } -#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ +#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ /* First, compute the base count (which assumes start == 0 * for the associated offset) and offset_count (which @@ -1043,25 +1041,25 @@ lower_dim_size_comp_test__select_checker_board( base_count++; } - offset_count = - (hsize_t)((dims[sel_offset] - (hsize_t)checker_edge_size) / + offset_count = + (hsize_t)((dims[sel_offset] - (hsize_t)checker_edge_size) / ((hsize_t)(checker_edge_size * 2))); - if ( ((dims[sel_rank] - (hsize_t)checker_edge_size) % + if ( ((dims[sel_rank] - (hsize_t)checker_edge_size) % ((hsize_t)(checker_edge_size * 2))) > 0 ) { offset_count++; } -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, "%s:%d: base_count/offset_count = %d/%d.\n", + HDfprintf(stdout, "%s:%d: base_count/offset_count = %d/%d.\n", fcnName, mpi_rank, base_count, offset_count); } -#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ +#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ /* Now set up the stride and block arrays, and portions of the start - * and count arrays that will not be altered during the selection of + * and count arrays that will not be altered during the selection of * the checker board. */ i = 0; @@ -1093,7 +1091,7 @@ lower_dim_size_comp_test__select_checker_board( i++; } - + i = 0; do { if ( 0 >= sel_offset ) { @@ -1112,7 +1110,7 @@ lower_dim_size_comp_test__select_checker_board( } j = 0; - do { + do { if ( 1 >= sel_offset ) { if ( j == 0 ) { @@ -1181,78 +1179,78 @@ lower_dim_size_comp_test__select_checker_board( if ( ((i + j + k + l + m) % 2) == 0 ) { -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG - if ( mpi_rank == +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s%d: *** first_selection = %d ***\n", + HDfprintf(stdout, + "%s%d: *** first_selection = %d ***\n", fcnName, mpi_rank, (int)first_selection); - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: i/j/k/l/m = %d/%d/%d/%d/%d\n", fcnName, mpi_rank, i, j, k, l, m); - HDfprintf(stdout, - "%s:%d: start = %d %d %d %d %d.\n", - fcnName, mpi_rank, - (int)start[0], (int)start[1], - (int)start[2], (int)start[3], + HDfprintf(stdout, + "%s:%d: start = %d %d %d %d %d.\n", + fcnName, mpi_rank, + (int)start[0], (int)start[1], + (int)start[2], (int)start[3], (int)start[4]); - HDfprintf(stdout, - "%s:%d: stride = %d %d %d %d %d.\n", - fcnName, mpi_rank, - (int)stride[0], (int)stride[1], - (int)stride[2], (int)stride[3], + HDfprintf(stdout, + "%s:%d: stride = %d %d %d %d %d.\n", + fcnName, mpi_rank, + (int)stride[0], (int)stride[1], + (int)stride[2], (int)stride[3], (int)stride[4]); - HDfprintf(stdout, - "%s:%d: count = %d %d %d %d %d.\n", - fcnName, mpi_rank, - (int)count[0], (int)count[1], - (int)count[2], (int)count[3], + HDfprintf(stdout, + "%s:%d: count = %d %d %d %d %d.\n", + fcnName, mpi_rank, + (int)count[0], (int)count[1], + (int)count[2], (int)count[3], (int)count[4]); - HDfprintf(stdout, - "%s:%d: block = %d %d %d %d %d.\n", - fcnName, mpi_rank, - (int)block[0], (int)block[1], - (int)block[2], (int)block[3], + HDfprintf(stdout, + "%s:%d: block = %d %d %d %d %d.\n", + fcnName, mpi_rank, + (int)block[0], (int)block[1], + (int)block[2], (int)block[3], (int)block[4]); - HDfprintf(stdout, - "%s:%d: n-cube extent dims = %d.\n", + HDfprintf(stdout, + "%s:%d: n-cube extent dims = %d.\n", fcnName, mpi_rank, H5Sget_simple_extent_ndims(tgt_sid)); - HDfprintf(stdout, - "%s:%d: selection rank = %d.\n", + HDfprintf(stdout, + "%s:%d: selection rank = %d.\n", fcnName, mpi_rank, sel_rank); } #endif if ( first_selection ) { - first_selection = FALSE; + first_selection = FALSE; ret = H5Sselect_hyperslab ( - tgt_sid, + tgt_sid, H5S_SELECT_SET, - &(start[ds_offset]), - &(stride[ds_offset]), - &(count[ds_offset]), + &(start[ds_offset]), + &(stride[ds_offset]), + &(count[ds_offset]), &(block[ds_offset]) ); - + VRFY((ret != FAIL), "H5Sselect_hyperslab(SET) succeeded"); } else { ret = H5Sselect_hyperslab ( - tgt_sid, + tgt_sid, H5S_SELECT_OR, - &(start[ds_offset]), - &(stride[ds_offset]), - &(count[ds_offset]), + &(start[ds_offset]), + &(stride[ds_offset]), + &(count[ds_offset]), &(block[ds_offset]) ); - + VRFY((ret != FAIL), "H5Sselect_hyperslab(OR) succeeded"); } @@ -1284,7 +1282,7 @@ lower_dim_size_comp_test__select_checker_board( } while ( ( i <= 1 ) && ( 0 >= sel_offset ) ); -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n", fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid)); @@ -1306,7 +1304,7 @@ lower_dim_size_comp_test__select_checker_board( VRFY((ret != FAIL), "H5Sselect_hyperslab(AND) succeeded"); -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n", fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid)); @@ -1321,57 +1319,57 @@ lower_dim_size_comp_test__select_checker_board( /**************************************************************** ** -** lower_dim_size_comp_test__verify_data(): +** lower_dim_size_comp_test__verify_data(): ** -** Examine the supplied buffer to see if it contains the -** expected data. Return TRUE if it does, and FALSE +** Examine the supplied buffer to see if it contains the +** expected data. Return TRUE if it does, and FALSE ** otherwise. ** -** The supplied buffer is presumed to this process's slice -** of the target data set. Each such slice will be an -** n-cube of rank (rank -1) and the supplied edge_size with -** origin (mpi_rank, 0, ... , 0) in the target data set. +** The supplied buffer is presumed to this process's slice +** of the target data set. Each such slice will be an +** n-cube of rank (rank -1) and the supplied edge_size with +** origin (mpi_rank, 0, ... , 0) in the target data set. ** -** Further, the buffer is presumed to be the result of reading -** or writing a checker board selection of an m (1 <= m < +** Further, the buffer is presumed to be the result of reading +** or writing a checker board selection of an m (1 <= m < ** rank) dimensional slice through this processes slice -** of the target data set. Also, this slice must be parallel -** to the fastest changing indicies. +** of the target data set. Also, this slice must be parallel +** to the fastest changing indicies. ** -** It is further presumed that the buffer was zeroed before -** the read/write, and that the full target data set (i.e. -** the buffer/data set for all processes) was initialized -** with the natural numbers listed in order from the origin -** along the fastest changing axis. +** It is further presumed that the buffer was zeroed before +** the read/write, and that the full target data set (i.e. +** the buffer/data set for all processes) was initialized +** with the natural numbers listed in order from the origin +** along the fastest changing axis. ** ** Thus for a 20x10x10 dataset, the value stored in location -** (x, y, z) (assuming that z is the fastest changing index -** and x the slowest) is assumed to be: +** (x, y, z) (assuming that z is the fastest changing index +** and x the slowest) is assumed to be: ** -** (10 * 10 * x) + (10 * y) + z +** (10 * 10 * x) + (10 * y) + z ** -** Further, supposing that this is process 10, this process's -** slice of the dataset would be a 10 x 10 2-cube with origin -** (10, 0, 0) in the data set, and would be initialize (prior -** to the checkerboard selection) as follows: +** Further, supposing that this is process 10, this process's +** slice of the dataset would be a 10 x 10 2-cube with origin +** (10, 0, 0) in the data set, and would be initialize (prior +** to the checkerboard selection) as follows: ** -** 1000, 1001, 1002, ... 1008, 1009 -** 1010, 1011, 1012, ... 1018, 1019 -** . . . . . -** . . . . . -** . . . . . -** 1090, 1091, 1092, ... 1098, 1099 +** 1000, 1001, 1002, ... 1008, 1009 +** 1010, 1011, 1012, ... 1018, 1019 +** . . . . . +** . . . . . +** . . . . . +** 1090, 1091, 1092, ... 1098, 1099 ** -** In the case of a read from the processors slice of another -** data set of different rank, the values expected will have -** to be adjusted accordingly. This is done via the -** first_expected_val parameter. +** In the case of a read from the processors slice of another +** data set of different rank, the values expected will have +** to be adjusted accordingly. This is done via the +** first_expected_val parameter. ** -** Finally, the function presumes that the first element -** of the buffer resides either at the origin of either -** a selected or an unselected checker. (Translation: -** if partial checkers appear in the buffer, they will -** intersect the edges of the n-cube oposite the origin.) +** Finally, the function presumes that the first element +** of the buffer resides either at the origin of either +** a selected or an unselected checker. (Translation: +** if partial checkers appear in the buffer, they will +** intersect the edges of the n-cube oposite the origin.) ** ****************************************************************/ @@ -1379,7 +1377,7 @@ lower_dim_size_comp_test__select_checker_board( static hbool_t lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, -#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG const int mpi_rank, #endif /* LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG */ const int rank, @@ -1389,8 +1387,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, hbool_t buf_starts_in_checker) { #if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG - const char * fcnName = - "lower_dim_size_comp_test__verify_data():"; + const char * fcnName = + "lower_dim_size_comp_test__verify_data():"; #endif hbool_t good_data = TRUE; hbool_t in_checker; @@ -1409,16 +1407,16 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, HDassert( checker_edge_size <= edge_size ); HDassert( test_max_rank <= LDSCT_DS_RANK ); -#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s mpi_rank = %d.\n", fcnName, mpi_rank); HDfprintf(stdout, "%s rank = %d.\n", fcnName, rank); HDfprintf(stdout, "%s edge_size = %d.\n", fcnName, edge_size); - HDfprintf(stdout, "%s checker_edge_size = %d.\n", + HDfprintf(stdout, "%s checker_edge_size = %d.\n", fcnName, checker_edge_size); - HDfprintf(stdout, "%s first_expected_val = %d.\n", + HDfprintf(stdout, "%s first_expected_val = %d.\n", fcnName, (int)first_expected_val); - HDfprintf(stdout, "%s starts_in_checker = %d.\n", + HDfprintf(stdout, "%s starts_in_checker = %d.\n", fcnName, (int)buf_starts_in_checker); } #endif @@ -1463,7 +1461,7 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, y = 0; start_in_checker[3] = start_in_checker[2]; do - { + { if ( y >= checker_edge_size ) { start_in_checker[3] = ! start_in_checker[3]; @@ -1472,8 +1470,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, m = 0; z = 0; -#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG - if ( mpi_rank == +#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%d, %d, %d, %d, %d:", i, j, k, l, m); } @@ -1481,8 +1479,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, in_checker = start_in_checker[3]; do { -#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG - if ( mpi_rank == +#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, " %d", (int)(*val_ptr)); } @@ -1492,21 +1490,21 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, in_checker = ! in_checker; z = 0; } - + if ( in_checker ) { - + if ( *val_ptr != expected_value ) { good_data = FALSE; } - + /* zero out buffer for re-use */ *val_ptr = 0; } else if ( *val_ptr != 0 ) { good_data = FALSE; - + /* zero out buffer for re-use */ *val_ptr = 0; @@ -1516,11 +1514,11 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, expected_value++; m++; z++; - + } while ( ( rank >= (test_max_rank - 4) ) && ( m < edge_size ) ); -#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG - if ( mpi_rank == +#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "\n"); } @@ -1548,22 +1546,22 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, /*------------------------------------------------------------------------- - * Function: lower_dim_size_comp_test__run_test() + * Function: lower_dim_size_comp_test__run_test() * - * Purpose: Verify that a bug in the computation of the size of the - * lower dimensions of a data space in H5S_obtain_datatype() - * has been corrected. + * Purpose: Verify that a bug in the computation of the size of the + * lower dimensions of a data space in H5S_obtain_datatype() + * has been corrected. * - * Return: void + * Return: void * - * Programmer: JRM -- 11/11/09 + * Programmer: JRM -- 11/11/09 * * Modifications: * *------------------------------------------------------------------------- */ -#define LDSCT_DS_RANK 5 +#define LDSCT_DS_RANK 5 #define LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG 0 static void @@ -1571,21 +1569,21 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_collective_io, const hid_t dset_type) { -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG const char *fcnName = "lower_dim_size_comp_test__run_test()"; - int rank; - hsize_t dims[32]; - hsize_t max_dims[32]; + int rank; + hsize_t dims[32]; + hsize_t max_dims[32]; #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ const char *filename; - hbool_t data_ok = FALSE; - hbool_t mis_match = FALSE; + hbool_t data_ok = FALSE; + hbool_t mis_match = FALSE; int i; int start_index; int stop_index; - int mrc; - int mpi_rank; - int mpi_size; + int mrc; + int mpi_rank; + int mpi_size; MPI_Comm mpi_comm = MPI_COMM_NULL; MPI_Info mpi_info = MPI_INFO_NULL; hid_t fid; /* HDF5 file ID */ @@ -1635,7 +1633,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, mpi_comm = MPI_COMM_WORLD; mpi_info = MPI_INFO_NULL; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: chunk_edge_size = %d.\n", fcnName, mpi_rank, (int)chunk_edge_size); @@ -1650,13 +1648,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, large_ds_size = (size_t)((mpi_size + 1) * 10 * 10 * 10 * 10); large_ds_slice_size = (size_t) (10 * 10 * 10 * 10); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: small ds size / slice size = %d / %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)small_ds_size, (int)small_ds_slice_size); HDfprintf(stdout, "%s:%d: large ds size / slice size = %d / %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)large_ds_size, (int)large_ds_slice_size); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ @@ -1739,7 +1737,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, large_dims[3] = 10; large_dims[4] = 10; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: small_dims[] = %d %d %d %d %d\n", fcnName, mpi_rank, (int)small_dims[0], (int)small_dims[1], @@ -1748,41 +1746,41 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, fcnName, mpi_rank, (int)large_dims[0], (int)large_dims[1], (int)large_dims[2], (int)large_dims[3], (int)large_dims[4]); } -#endif +#endif /* create data spaces */ full_mem_small_ds_sid = H5Screate_simple(5, small_dims, NULL); - VRFY((full_mem_small_ds_sid != 0), + VRFY((full_mem_small_ds_sid != 0), "H5Screate_simple() full_mem_small_ds_sid succeeded"); full_file_small_ds_sid = H5Screate_simple(5, small_dims, NULL); - VRFY((full_file_small_ds_sid != 0), + VRFY((full_file_small_ds_sid != 0), "H5Screate_simple() full_file_small_ds_sid succeeded"); mem_small_ds_sid = H5Screate_simple(5, small_dims, NULL); - VRFY((mem_small_ds_sid != 0), + VRFY((mem_small_ds_sid != 0), "H5Screate_simple() mem_small_ds_sid succeeded"); file_small_ds_sid = H5Screate_simple(5, small_dims, NULL); - VRFY((file_small_ds_sid != 0), + VRFY((file_small_ds_sid != 0), "H5Screate_simple() file_small_ds_sid succeeded"); full_mem_large_ds_sid = H5Screate_simple(5, large_dims, NULL); - VRFY((full_mem_large_ds_sid != 0), + VRFY((full_mem_large_ds_sid != 0), "H5Screate_simple() full_mem_large_ds_sid succeeded"); full_file_large_ds_sid = H5Screate_simple(5, large_dims, NULL); - VRFY((full_file_large_ds_sid != 0), + VRFY((full_file_large_ds_sid != 0), "H5Screate_simple() full_file_large_ds_sid succeeded"); mem_large_ds_sid = H5Screate_simple(5, large_dims, NULL); - VRFY((mem_large_ds_sid != 0), + VRFY((mem_large_ds_sid != 0), "H5Screate_simple() mem_large_ds_sid succeeded"); file_large_ds_sid = H5Screate_simple(5, large_dims, NULL); - VRFY((file_large_ds_sid != 0), + VRFY((file_large_ds_sid != 0), "H5Screate_simple() file_large_ds_sid succeeded"); @@ -1812,14 +1810,14 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, small_chunk_dims[1] = small_chunk_dims[2] = (hsize_t)1; small_chunk_dims[3] = small_chunk_dims[4] = (hsize_t)chunk_edge_size; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: small chunk dims[] = %d %d %d %d %d\n", - fcnName, mpi_rank, (int)small_chunk_dims[0], - (int)small_chunk_dims[1], (int)small_chunk_dims[2], + fcnName, mpi_rank, (int)small_chunk_dims[0], + (int)small_chunk_dims[1], (int)small_chunk_dims[2], (int)small_chunk_dims[3], (int)small_chunk_dims[4]); } -#endif +#endif small_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); VRFY((ret != FAIL), "H5Pcreate() small_ds_dcpl_id succeeded"); @@ -1831,18 +1829,18 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, VRFY((ret != FAIL), "H5Pset_chunk() small_ds_dcpl_id succeeded"); large_chunk_dims[0] = (hsize_t)(1); - large_chunk_dims[1] = large_chunk_dims[2] = - large_chunk_dims[3] = large_chunk_dims[4] = (hsize_t)chunk_edge_size; + large_chunk_dims[1] = large_chunk_dims[2] = + large_chunk_dims[3] = large_chunk_dims[4] = (hsize_t)chunk_edge_size; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: large chunk dims[] = %d %d %d %d %d\n", - fcnName, mpi_rank, (int)large_chunk_dims[0], - (int)large_chunk_dims[1], (int)large_chunk_dims[2], + fcnName, mpi_rank, (int)large_chunk_dims[0], + (int)large_chunk_dims[1], (int)large_chunk_dims[2], (int)large_chunk_dims[3], (int)large_chunk_dims[4]); } -#endif +#endif large_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); VRFY((ret != FAIL), "H5Pcreate() large_ds_dcpl_id succeeded"); @@ -1868,11 +1866,11 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, large_ds_dcpl_id, H5P_DEFAULT); VRFY((ret >= 0), "H5Dcreate2() large_dataset succeeded"); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s:%d: small/large ds id = %d / %d.\n", - fcnName, mpi_rank, (int)small_dataset, + HDfprintf(stdout, + "%s:%d: small/large ds id = %d / %d.\n", + fcnName, mpi_rank, (int)small_dataset, (int)large_dataset); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ @@ -1906,10 +1904,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, block[0] = block[1] = block[2] = 1; block[3] = block[4] = 10; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s:%d: settings for small data set initialization.\n", + HDfprintf(stdout, + "%s:%d: settings for small data set initialization.\n", fcnName, mpi_rank); HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n", fcnName, mpi_rank, (int)start[0], (int)start[1], @@ -1947,10 +1945,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, start[0] = 0; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s:%d: added settings for main process.\n", + HDfprintf(stdout, + "%s:%d: added settings for main process.\n", fcnName, mpi_rank); HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n", fcnName, mpi_rank, (int)start[0], (int)start[1], @@ -1992,23 +1990,23 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, /* write the initial value of the small data set to file */ -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: writing init value of small ds to file.\n", fcnName, mpi_rank); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ - ret = H5Dwrite(small_dataset, - dset_type, - mem_small_ds_sid, + ret = H5Dwrite(small_dataset, + dset_type, + mem_small_ds_sid, file_small_ds_sid, - xfer_plist, + xfer_plist, small_ds_buf_0); VRFY((ret >= 0), "H5Dwrite() small_dataset initial write succeeded"); - /* read the small data set back to verify that it contains the - * expected data. Note that each process reads in the entire + /* read the small data set back to verify that it contains the + * expected data. Note that each process reads in the entire * data set and verifies it. */ ret = H5Dread(small_dataset, @@ -2061,10 +2059,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, block[0] = (hsize_t)1; block[1] = block[2] = block[3] = block[4] = (hsize_t)10; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s:%d: settings for large data set initialization.\n", + HDfprintf(stdout, + "%s:%d: settings for large data set initialization.\n", fcnName, mpi_rank); HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n", fcnName, mpi_rank, (int)start[0], (int)start[1], @@ -2097,15 +2095,15 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, block); VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid, set) suceeded"); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, + HDfprintf(stdout, "%s%d: H5Sget_select_npoints(mem_large_ds_sid) = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)H5Sget_select_npoints(mem_large_ds_sid)); - HDfprintf(stdout, + HDfprintf(stdout, "%s%d: H5Sget_select_npoints(file_large_ds_sid) = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)H5Sget_select_npoints(file_large_ds_sid)); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ @@ -2114,10 +2112,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, start[0] = (hsize_t)0; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s:%d: added settings for main process.\n", + HDfprintf(stdout, + "%s:%d: added settings for main process.\n", fcnName, mpi_rank); HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n", fcnName, mpi_rank, (int)start[0], (int)start[1], @@ -2150,15 +2148,15 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, block); VRFY((ret>= 0), "H5Sselect_hyperslab(file_large_ds_sid, or) suceeded"); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, + HDfprintf(stdout, "%s%d: H5Sget_select_npoints(mem_large_ds_sid) = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)H5Sget_select_npoints(mem_large_ds_sid)); - HDfprintf(stdout, + HDfprintf(stdout, "%s%d: H5Sget_select_npoints(file_large_ds_sid) = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)H5Sget_select_npoints(file_large_ds_sid)); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ @@ -2183,19 +2181,19 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, start, stride, count, block); VRFY((ret != FAIL),"H5Sselect_hyperslab(file_large_ds_sid, and) succeeded"); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG - if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { rank = H5Sget_simple_extent_dims(mem_large_ds_sid, dims, max_dims); - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: mem_large_ds_sid dims[%d] = %d %d %d %d %d\n", - fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1], + fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1], (int)dims[2], (int)dims[3], (int)dims[4]); rank = H5Sget_simple_extent_dims(file_large_ds_sid, dims, max_dims); - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: file_large_ds_sid dims[%d] = %d %d %d %d %d\n", - fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1], + fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1], (int)dims[2], (int)dims[3], (int)dims[4]); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ @@ -2208,26 +2206,26 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, /* write the initial value of the large data set to file */ -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG - if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: writing init value of large ds to file.\n", fcnName, mpi_rank); - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: large_dataset = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)large_dataset); - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: mem_large_ds_sid = %d, file_large_ds_sid = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)mem_large_ds_sid, (int)file_large_ds_sid); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ - ret = H5Dwrite(large_dataset, - dset_type, - mem_large_ds_sid, + ret = H5Dwrite(large_dataset, + dset_type, + mem_large_ds_sid, file_large_ds_sid, - xfer_plist, + xfer_plist, large_ds_buf_0); if ( ret < 0 ) H5Eprint2(H5E_DEFAULT, stderr); @@ -2238,8 +2236,8 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, mrc = MPI_Barrier(MPI_COMM_WORLD); VRFY((mrc==MPI_SUCCESS), "Sync after large dataset writes"); - /* read the large data set back to verify that it contains the - * expected data. Note that each process reads in the entire + /* read the large data set back to verify that it contains the + * expected data. Note that each process reads in the entire * data set. */ ret = H5Dread(large_dataset, @@ -2278,13 +2276,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, /***********************************/ - /* read a checkerboard selection of the process slice of the - * small on disk data set into the process slice of the large + /* read a checkerboard selection of the process slice of the + * small on disk data set into the process slice of the large * in memory data set, and verify the data read. */ small_sel_start[0] = (hsize_t)(mpi_rank + 1); - small_sel_start[1] = small_sel_start[2] = + small_sel_start[1] = small_sel_start[2] = small_sel_start[3] = small_sel_start[4] = 0; lower_dim_size_comp_test__select_checker_board(mpi_rank, @@ -2296,9 +2294,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, small_sel_start); expected_value = (uint32_t) - ((small_sel_start[0] * small_dims[1] * small_dims[2] * + ((small_sel_start[0] * small_dims[1] * small_dims[2] * small_dims[3] * small_dims[4]) + - (small_sel_start[1] * small_dims[2] * small_dims[3] * + (small_sel_start[1] * small_dims[2] * small_dims[3] * small_dims[4]) + (small_sel_start[2] * small_dims[3] * small_dims[4]) + (small_sel_start[3] * small_dims[4]) + @@ -2335,7 +2333,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, VRFY((ret >= 0), "H5Sread() slice from small ds succeeded."); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", fcnName, mpi_rank); } @@ -2345,9 +2343,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, data_ok = TRUE; - start_index = (int)((large_sel_start[0] * large_dims[1] * large_dims[2] * + start_index = (int)((large_sel_start[0] * large_dims[1] * large_dims[2] * large_dims[3] * large_dims[4]) + - (large_sel_start[1] * large_dims[2] * large_dims[3] * + (large_sel_start[1] * large_dims[2] * large_dims[3] * large_dims[4]) + (large_sel_start[2] * large_dims[3] * large_dims[4]) + (large_sel_start[3] * large_dims[4]) + @@ -2409,13 +2407,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, - /* read a checkerboard selection of a slice of the process slice of - * the large on disk data set into the process slice of the small + /* read a checkerboard selection of a slice of the process slice of + * the large on disk data set into the process slice of the small * in memory data set, and verify the data read. */ small_sel_start[0] = (hsize_t)(mpi_rank + 1); - small_sel_start[1] = small_sel_start[2] = + small_sel_start[1] = small_sel_start[2] = small_sel_start[3] = small_sel_start[4] = 0; lower_dim_size_comp_test__select_checker_board(mpi_rank, @@ -2456,7 +2454,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, VRFY((ret >= 0), "H5Sread() slice from large ds succeeded."); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", fcnName, mpi_rank); } @@ -2467,9 +2465,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, data_ok = TRUE; expected_value = (uint32_t) - ((large_sel_start[0] * large_dims[1] * large_dims[2] * + ((large_sel_start[0] * large_dims[1] * large_dims[2] * large_dims[3] * large_dims[4]) + - (large_sel_start[1] * large_dims[2] * large_dims[3] * + (large_sel_start[1] * large_dims[2] * large_dims[3] * large_dims[4]) + (large_sel_start[2] * large_dims[3] * large_dims[4]) + (large_sel_start[3] * large_dims[4]) + @@ -2522,7 +2520,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, #if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, "%s:%d: unexpected value at index %d: %d.\n", + HDfprintf(stdout, "%s:%d: unexpected value at index %d: %d.\n", fcnName, mpi_rank, (int)i, (int)(*ptr_1)); } #endif /* LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG */ @@ -2590,15 +2588,15 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, /*------------------------------------------------------------------------- - * Function: lower_dim_size_comp_test() + * Function: lower_dim_size_comp_test() * - * Purpose: Test to see if an error in the computation of the size - * of the lower dimensions in H5S_obtain_datatype() has - * been corrected. + * Purpose: Test to see if an error in the computation of the size + * of the lower dimensions in H5S_obtain_datatype() has + * been corrected. * - * Return: void + * Return: void * - * Programmer: JRM -- 11/11/09 + * Programmer: JRM -- 11/11/09 * * Modifications: * @@ -2609,15 +2607,15 @@ void lower_dim_size_comp_test(void) { /* const char *fcnName = "lower_dim_size_comp_test()"; */ - int chunk_edge_size = 0; - int use_collective_io = 1; - hid_t dset_type = H5T_NATIVE_UINT; + int chunk_edge_size = 0; + int use_collective_io = 1; + hid_t dset_type = H5T_NATIVE_UINT; #if 0 HDsleep(60); #endif HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned)); - for ( use_collective_io = (hbool_t)0; - (int)use_collective_io <= 1; + for ( use_collective_io = (hbool_t)0; + (int)use_collective_io <= 1; (hbool_t)(use_collective_io++) ) { chunk_edge_size = 0; @@ -2638,37 +2636,37 @@ lower_dim_size_comp_test(void) /*------------------------------------------------------------------------- - * Function: link_chunk_collective_io_test() + * Function: link_chunk_collective_io_test() * - * Purpose: Test to verify that an error in MPI type management in - * H5D_link_chunk_collective_io() has been corrected. - * In this bug, we used to free MPI types regardless of - * whether they were basic or derived. + * Purpose: Test to verify that an error in MPI type management in + * H5D_link_chunk_collective_io() has been corrected. + * In this bug, we used to free MPI types regardless of + * whether they were basic or derived. * - * This test is based on a bug report kindly provided by - * Rob Latham of the MPICH team and ANL. + * This test is based on a bug report kindly provided by + * Rob Latham of the MPICH team and ANL. * - * The basic thrust of the test is to cause a process - * to participate in a collective I/O in which it: + * The basic thrust of the test is to cause a process + * to participate in a collective I/O in which it: * - * 1) Reads or writes exactly one chunk, + * 1) Reads or writes exactly one chunk, * - * 2) Has no in memory buffer for any other chunk. + * 2) Has no in memory buffer for any other chunk. * - * The test differers from Rob Latham's bug report in - * that is runs with an arbitrary number of proceeses, - * and uses a 1 dimensional dataset. + * The test differers from Rob Latham's bug report in + * that is runs with an arbitrary number of proceeses, + * and uses a 1 dimensional dataset. * - * Return: void + * Return: void * - * Programmer: JRM -- 12/16/09 + * Programmer: JRM -- 12/16/09 * * Modifications: * *------------------------------------------------------------------------- */ -#define LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE 16 +#define LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE 16 void link_chunk_collective_io_test(void) @@ -2676,8 +2674,8 @@ link_chunk_collective_io_test(void) /* const char *fcnName = "link_chunk_collective_io_test()"; */ const char *filename; hbool_t mis_match = FALSE; - int i; - int mrc; + int i; + int mrc; int mpi_rank; int mpi_size; MPI_Comm mpi_comm = MPI_COMM_WORLD; @@ -2767,8 +2765,8 @@ link_chunk_collective_io_test(void) for ( i = 0; i < LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE; i++ ) { local_data_written[i] = expected_value; - local_data_read[i] = 0.0; - expected_value += 1.0; + local_data_read[i] = 0.0; + expected_value += 1.0; } /* select the file and mem spaces */ @@ -2794,15 +2792,15 @@ link_chunk_collective_io_test(void) VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); /* write the data set */ - ret = H5Dwrite(dset_id, - H5T_NATIVE_DOUBLE, - write_mem_ds_sid, + ret = H5Dwrite(dset_id, + H5T_NATIVE_DOUBLE, + write_mem_ds_sid, file_ds_sid, - xfer_plist, + xfer_plist, local_data_written); VRFY((ret >= 0), "H5Dwrite() dataset initial write succeeded"); - + /* sync with the other processes before checking data */ mrc = MPI_Barrier(MPI_COMM_WORLD); VRFY((mrc==MPI_SUCCESS), "Sync after dataset write"); @@ -2830,7 +2828,7 @@ link_chunk_collective_io_test(void) if ( diff >= 0.001 ) { mis_match = TRUE; - } + } } VRFY( (mis_match == FALSE), "dataset data good."); diff --git a/tools/test/perform/pio_perf.h b/tools/test/perform/pio_perf.h index b595c90..7605f20 100644 --- a/tools/test/perform/pio_perf.h +++ b/tools/test/perform/pio_perf.h @@ -15,7 +15,6 @@ #include "io_timer.h" #ifndef STANDALONE -#include "H5private.h" #include "h5test.h" #include "h5tools.h" #include "h5tools_utils.h" @@ -36,22 +35,22 @@ typedef enum iotype_ { } iotype; typedef struct parameters_ { - iotype io_type; /* The type of IO test to perform */ - int num_procs; /* Maximum number of processes to use */ - long num_files; /* Number of files to create */ - long num_dsets; /* Number of datasets to create */ - off_t num_bytes; /* Number of bytes in each dset */ + iotype io_type; /* The type of IO test to perform */ + int num_procs; /* Maximum number of processes to use */ + long num_files; /* Number of files to create */ + long num_dsets; /* Number of datasets to create */ + off_t num_bytes; /* Number of bytes in each dset */ int num_iters; /* Number of times to loop doing the IO */ - size_t buf_size; /* Buffer size */ - size_t blk_size; /* Block size */ + size_t buf_size; /* Buffer size */ + size_t blk_size; /* Block size */ unsigned interleaved; /* Interleaved vs. contiguous blocks */ unsigned collective; /* Collective vs. independent I/O */ unsigned dim2d; /* 1D vs. 2D */ - hsize_t h5_align; /* HDF5 object alignment */ - hsize_t h5_thresh; /* HDF5 object alignment threshold */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ - int verify; /* Verify data correctness */ + hsize_t h5_align; /* HDF5 object alignment */ + hsize_t h5_thresh; /* HDF5 object alignment threshold */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ + int verify; /* Verify data correctness */ } parameters; typedef struct results_ { diff --git a/tools/test/perform/sio_perf.h b/tools/test/perform/sio_perf.h index 366b791..83caf54 100644 --- a/tools/test/perform/sio_perf.h +++ b/tools/test/perform/sio_perf.h @@ -15,7 +15,6 @@ #include "io_timer.h" #ifndef STANDALONE -#include "H5private.h" #include "h5test.h" #include "h5tools.h" #include "h5tools_utils.h" -- cgit v0.12 From 41d541f1c21389702014ccaf8a1546b9673d5981 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 14 Feb 2018 11:14:26 -0600 Subject: More includes cleanup --- test/dsets.c | 155 +++--- test/objcopy.c | 1623 +++++++++++++++++++++++++++---------------------------- test/tarray.c | 40 +- test/tconfig.c | 57 +- test/tfile.c | 827 ++++++++++++++-------------- test/tgenprop.c | 154 +++--- test/tid.c | 273 +++++----- test/titerate.c | 44 +- test/tmisc.c | 103 ++-- test/trefer.c | 178 +++--- test/ttime.c | 14 +- test/tvlstr.c | 58 +- test/tvltypes.c | 137 +++-- 13 files changed, 1823 insertions(+), 1840 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 09f553e..17cf23c 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -24,7 +24,6 @@ #define H5Z_FRIEND /*suppress error about including H5Zpkg */ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -316,7 +315,7 @@ const H5Z_class2_t H5Z_COUNT[1] = {{ filter_count, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: filter_count * @@ -341,7 +340,7 @@ filter_count(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, return nbytes; } - + /*------------------------------------------------------------------------- * Function: test_create * @@ -488,7 +487,7 @@ test_create(hid_t file) return -1; } - + /*------------------------------------------------------------------------- * Function: test_simple_io * @@ -624,7 +623,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_userblock_offset * @@ -730,7 +729,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_compact_io * @@ -823,7 +822,7 @@ test_compact_io(hid_t fapl) if(H5Fclose(file) < 0) TEST_ERROR /************************************** - * Additional test for version bounds * + * Additional test for version bounds * **************************************/ /* Create a copy of file access property list */ @@ -923,7 +922,7 @@ test_compact_io(hid_t fapl) return -1; } - + /*------------------------------------------------------------------------- * Function: test_max_compact * @@ -1076,7 +1075,7 @@ error: return -1; } /* end test_max_compact() */ - + /*------------------------------------------------------------------------- * Function: test_layout_extend * @@ -1199,7 +1198,7 @@ error: return -1; } /* end test_layout_extend() */ - + /*------------------------------------------------------------------------- * Function: test_conv_buffer * @@ -1338,7 +1337,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_tconv * @@ -1433,7 +1432,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ filter_bogus, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: can_apply_bogus * @@ -1455,7 +1454,7 @@ can_apply_bogus(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSE return -1; } - + /*------------------------------------------------------------------------- * Function: filter_bogus * @@ -1473,7 +1472,7 @@ filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, return nbytes; } - + /*------------------------------------------------------------------------- * Function: set_local_bogus2 * @@ -1519,7 +1518,7 @@ set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) return(SUCCEED); } /* end set_local_bogus2() */ - + /*------------------------------------------------------------------------- * Function: filter_bogus2 * @@ -1573,7 +1572,7 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts, return(nbytes); } - + /*------------------------------------------------------------------------- * Function: filter_bogus3 * @@ -1602,7 +1601,7 @@ const H5Z_class2_t H5Z_CORRUPT[1] = {{ filter_corrupt, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: filter_corrupt * @@ -1661,7 +1660,7 @@ error: return ret_value; } /* end filter_corrupt() */ - + /*------------------------------------------------------------------------- * Function: filter_cb_cont * @@ -1680,7 +1679,7 @@ filter_cb_cont(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU return H5Z_CB_FAIL; } - + /*------------------------------------------------------------------------- * Function: filter_cb_fail * @@ -1699,7 +1698,7 @@ filter_cb_fail(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU return H5Z_CB_CONT; } - + /*------------------------------------------------------------------------- * Function: test_filter_internal * @@ -2510,7 +2509,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_missing_filter * @@ -2838,7 +2837,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_int * @@ -2956,7 +2955,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_float * @@ -3074,7 +3073,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_double * @@ -3206,7 +3205,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_array * @@ -3333,7 +3332,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_compound * @@ -3550,7 +3549,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_compound_2 * @@ -3895,7 +3894,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_compound_3 * @@ -4075,7 +4074,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_int_size * @@ -4242,7 +4241,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_flt_size * @@ -4438,7 +4437,7 @@ test_nbit_flt_size(hid_t file) error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_int * @@ -4550,7 +4549,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_int_2 * @@ -4678,7 +4677,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_float * @@ -4791,7 +4790,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_float_2 * @@ -4920,7 +4919,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_double * @@ -5033,7 +5032,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_double_2 * @@ -5163,7 +5162,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_multiopen * @@ -5230,7 +5229,7 @@ test_multiopen (hid_t file) return -1; } - + /*------------------------------------------------------------------------- * Function: test_types * @@ -5337,7 +5336,7 @@ const H5Z_class2_t H5Z_CAN_APPLY_TEST[1] = {{ filter_bogus, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_can_apply * @@ -5518,7 +5517,7 @@ const H5Z_class2_t H5Z_CAN_APPLY_TEST2[1] = {{ filter_bogus3, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_can_apply2 * @@ -5667,7 +5666,7 @@ error: } /* end test_can_apply2() */ - + /*------------------------------------------------------------------------- * Function: test_can_apply_szip * @@ -5872,7 +5871,7 @@ const H5Z_class2_t H5Z_SET_LOCAL_TEST[1] = {{ filter_bogus2, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_set_local * @@ -6137,7 +6136,7 @@ error: return -1; } /* end test_set_local() */ - + /*------------------------------------------------------------------------- * Function: test_compare_dcpl * @@ -6222,7 +6221,7 @@ error: return -1; } /* end test_compare_dcpl() */ - + /*------------------------------------------------------------------------- * Function: test_copy_dcpl * @@ -6354,7 +6353,7 @@ error: return -1; } /* end test_copy_dcpl() */ - + /*------------------------------------------------------------------------- * Function: test_filter_delete * @@ -6481,7 +6480,7 @@ error: } /* end test_filter_delete() */ - + /*------------------------------------------------------------------------- * Function: auxread_fdata * @@ -6565,7 +6564,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_filters_endianess * @@ -6635,7 +6634,7 @@ error: return -1; } /* end test_filters_endianess() */ - + /*------------------------------------------------------------------------- * Function: test_zero_dims * @@ -6799,7 +6798,7 @@ error: return -1; } /* end test_zero_dims() */ - + /*------------------------------------------------------------------------- * Function: test_missing_chunk * @@ -6991,7 +6990,7 @@ error: return -1; } /* end test_missing_chunk() */ - + /*------------------------------------------------------------------------- * Function: test_random_chunks_real * @@ -7359,7 +7358,7 @@ error: return -1; } /* end test_random_chunks_real() */ - + /*------------------------------------------------------------------------- * Function: test_random_chunks * @@ -7419,7 +7418,7 @@ const H5Z_class1_t H5Z_DEPREC[1] = {{ filter_bogus, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_deprec * @@ -7610,7 +7609,7 @@ test_deprec(hid_t file) } /* end test_deprec() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /*------------------------------------------------------------------------- * Function: test_huge_chunks * @@ -7722,7 +7721,7 @@ error: return -1; } /* end test_huge_chunks() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_cache * @@ -7930,7 +7929,7 @@ error: return -1; } /* end test_chunk_cache() */ - + /*------------------------------------------------------------------------- * Function: test_big_chunks_bypass_cache * @@ -8223,7 +8222,7 @@ error: return -1; } /* end test_big_chunks_bypass_cache() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_fast * @@ -8570,7 +8569,7 @@ error: return -1; } /* end test_chunk_fast() */ - + /*------------------------------------------------------------------------- * Function: test_reopen_chunk_fast * @@ -8693,7 +8692,7 @@ error: return -1; } /* end test_reopen_chunk_fast() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_fast_bug1 * @@ -8815,7 +8814,7 @@ const H5Z_class2_t H5Z_EXPAND[1] = {{ /* Global "expansion factor" for filter_expand() routine */ static size_t filter_expand_factor_g = 0; - + /*------------------------------------------------------------------------- * Function: filter_expand * @@ -8864,7 +8863,7 @@ filter_expand(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, return ret_value; } /* end filter_expand() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_expand * @@ -9260,7 +9259,7 @@ error: return -1; } /* end test_chunk_expand() */ - + /*------------------------------------------------------------------------- * Function: test_fixed_array * @@ -9679,7 +9678,7 @@ error: return -1; } /* end test_fixed_array() */ - + /*------------------------------------------------------------------------- * Function: test_single_chunk * @@ -9943,7 +9942,7 @@ error: return -1; } /* end test_single_chunk() */ - + /*------------------------------------------------------------------------- * * test_idx_compatible(): @@ -10156,7 +10155,7 @@ error: return -1; } /* test_unfiltered_edge_chunks */ - + /*------------------------------------------------------------------------- * Function: test_large_chunk_shrink * @@ -10271,7 +10270,7 @@ error: return -1; } /* end test_large_chunk_shrink() */ - + /*------------------------------------------------------------------------- * Function: test_zero_dim_dset * @@ -10364,7 +10363,7 @@ error: return -1; } /* end test_zero_dim_dset() */ - + /*------------------------------------------------------------------------- * Function: test_swmr_non_latest * @@ -10613,7 +10612,7 @@ error: return -1; } /* test_swmr_non_latest() */ - + /*------------------------------------------------------------------------- * Function: test_earray_hdr_fd * @@ -10733,7 +10732,7 @@ error: return -1; } /* test_earray_hdr_fd() */ - + /*------------------------------------------------------------------------- * Function: test_farray_hdr_fd * @@ -10853,7 +10852,7 @@ error: return -1; } /* test_farray_hdr_fd() */ - + /*------------------------------------------------------------------------- * Function: test_bt2_hdr_fd * @@ -10973,7 +10972,7 @@ error: return -1; } /* test_bt2_hdr_fd() */ - + /*------------------------------------------------------------------------- * Function: test_storage_size * @@ -11367,7 +11366,7 @@ error: return -1; } /* end test_storage_size() */ - + /*------------------------------------------------------------------------- * Function: test_power2up * @@ -11458,7 +11457,7 @@ error: return -1; } /* end test_power2up() */ - + /*------------------------------------------------------------------------- * Function: test_scatter * @@ -11776,7 +11775,7 @@ error: return -1; } /* end test_scatter() */ - + /*------------------------------------------------------------------------- * Function: test_gather * @@ -12138,7 +12137,7 @@ error: return -1; } /* end test_gather() */ - + /*------------------------------------------------------------------------- * Function: test_scatter_error * @@ -12341,7 +12340,7 @@ error: return -1; } /* end test_scatter_error() */ - + /*------------------------------------------------------------------------- * Function: test_gather_error * @@ -12868,7 +12867,7 @@ error: return -1; } /* test_compact_open_close_dirty() */ - + /*------------------------------------------------------------------------- * Function: test_versionbounds * @@ -12940,7 +12939,7 @@ test_versionbounds() /* Loop through all the combinations of low/high library format bounds */ /* Create a source file and a dataset in it. Create a virtual file and - virtual dataset. Creation of virtual dataset should only succeed in + virtual dataset. Creation of virtual dataset should only succeed in H5F_LIBVER_V110 */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { @@ -13021,7 +13020,7 @@ test_versionbounds() return -1; } /* test_versionbounds() */ - + /*------------------------------------------------------------------------- * Function: main * diff --git a/test/objcopy.c b/test/objcopy.c index c4bcbf3..5d9d426 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -12,13 +12,12 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Peter X. Cao - * May 01, 2005 + * Programmer: Peter X. Cao + * May 01, 2005 * - * Purpose: Test H5Ocopy(). + * Purpose: Test H5Ocopy(). */ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -34,33 +33,33 @@ * This file needs to access private information from the H5S package. * This file also needs to access the dataspace testing code. */ -#define H5S_FRIEND /*suppress error about including H5Spkg */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ #define H5S_TESTING -#include "H5Spkg.h" /* Dataspaces */ +#include "H5Spkg.h" /* Dataspaces */ /* * This file needs to access private information from the H5P package. * This file also needs to access the property list testing code. */ -#define H5P_FRIEND /*suppress error about including H5Ppkg */ +#define H5P_FRIEND /*suppress error about including H5Ppkg */ #define H5P_TESTING -#include "H5Ppkg.h" /* Property Lists */ +#include "H5Ppkg.h" /* Property Lists */ /* * This file needs to access private information from the H5D package. * This file also needs to access the dataset testing code. */ -#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ #define H5D_TESTING -#include "H5Dpkg.h" /* Datasets */ +#include "H5Dpkg.h" /* Datasets */ /* * This file needs to access private information from the H5O package. * This file also needs to access the dataspace testing code. */ -#define H5O_FRIEND /*suppress error about including H5Opkg */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ #define H5O_TESTING -#include "H5Opkg.h" /* Object header */ +#include "H5Opkg.h" /* Object header */ const char *FILENAME[] = { @@ -83,77 +82,77 @@ const char *FILENAME[] = { #define CONFIG_DENSE 16 #define MAX_CONFIGURATION 31 -#define FILE_EXT "objcopy_ext.dat" +#define FILE_EXT "objcopy_ext.dat" /* The fill_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory * for version 1.4(after 1.4.3). To get this data file, simply compile * gen_old_fill.c with HDF5 library (before v1.5) and run it. */ #define FILE_OLD_LAYOUT "fill_old.h5" -#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT" -#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2" -#define NAME_DATATYPE_VL "vlen of int" -#define NAME_DATATYPE_VL_VL "vlen of vlen of int" -#define NAME_DATASET_SIMPLE "dataset_simple" +#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT" +#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2" +#define NAME_DATATYPE_VL "vlen of int" +#define NAME_DATATYPE_VL_VL "vlen of vlen of int" +#define NAME_DATASET_SIMPLE "dataset_simple" #define NAME_DATASET_SIMPLE2 "dataset_simple_copy" #define NAME_DATASET_SIMPLE3 "dataset_simple_another_copy" -#define NAME_DATASET_COMPOUND "dataset_compound" -#define NAME_DATASET_CHUNKED "dataset_chunked" -#define NAME_DATASET_CHUNKED_SINGLE "dataset_chunked_single" -#define NAME_DATASET_CHUNKED2 "dataset_chunked2" -#define NAME_DATASET_CHUNKED2_SINGLE "dataset_chunked2_single" -#define NAME_DATASET_CHUNKED3 "dataset_chunked3" -#define NAME_DATASET_CHUNKED3_SINGLE "dataset_chunked3_single" -#define NAME_DATASET_CHUNKED4 "dataset_chunked4" -#define NAME_DATASET_CHUNKED4_SINGLE "dataset_chunked4_single" -#define NAME_DATASET_COMPACT "dataset_compact" -#define NAME_DATASET_EXTERNAL "dataset_ext" -#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype" -#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2" -#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr" -#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2" -#define NAME_DATASET_VL "dataset_vl" -#define NAME_DATASET_VL2 "dataset_vl2" -#define NAME_DATASET_VL_VL "dataset_vl_vl" -#define NAME_DATASET_VL_VL2 "dataset_vl_vl2" -#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl" -#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple" -#define NAME_GROUP_UNCOPIED "/uncopied" -#define NAME_GROUP_EMPTY "/empty" -#define NAME_GROUP_TOP "/g0" +#define NAME_DATASET_COMPOUND "dataset_compound" +#define NAME_DATASET_CHUNKED "dataset_chunked" +#define NAME_DATASET_CHUNKED_SINGLE "dataset_chunked_single" +#define NAME_DATASET_CHUNKED2 "dataset_chunked2" +#define NAME_DATASET_CHUNKED2_SINGLE "dataset_chunked2_single" +#define NAME_DATASET_CHUNKED3 "dataset_chunked3" +#define NAME_DATASET_CHUNKED3_SINGLE "dataset_chunked3_single" +#define NAME_DATASET_CHUNKED4 "dataset_chunked4" +#define NAME_DATASET_CHUNKED4_SINGLE "dataset_chunked4_single" +#define NAME_DATASET_COMPACT "dataset_compact" +#define NAME_DATASET_EXTERNAL "dataset_ext" +#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype" +#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2" +#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr" +#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2" +#define NAME_DATASET_VL "dataset_vl" +#define NAME_DATASET_VL2 "dataset_vl2" +#define NAME_DATASET_VL_VL "dataset_vl_vl" +#define NAME_DATASET_VL_VL2 "dataset_vl_vl2" +#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl" +#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple" +#define NAME_GROUP_UNCOPIED "/uncopied" +#define NAME_GROUP_EMPTY "/empty" +#define NAME_GROUP_TOP "/g0" #define NAME_GROUP_TOP2 "/g1" #define NAME_GROUP_TOP3 "/g2" #define NAME_GROUP_TOP4 "/g3" -#define NAME_GROUP_SUB "/g0/g00" -#define NAME_GROUP_SUB_2 "/g0/g01" -#define NAME_GROUP_SUB_SUB "/g0/g00/g000" -#define NAME_GROUP_SUB_SUB2 "g000" -#define NAME_GROUP_DATASET "/g0/dataset_simple" -#define NAME_GROUP_LINK "/g_links" -#define NAME_GROUP_LINK2 "/g_links2" -#define NAME_GROUP_LOOP "g_loop" -#define NAME_GROUP_LOOP2 "g_loop2" -#define NAME_GROUP_LOOP3 "g_loop3" -#define NAME_GROUP_REF "ref_grp" -#define NAME_LINK_DATASET "/g_links/dataset_simple" -#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple" -#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple" -#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple" -#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple" +#define NAME_GROUP_SUB "/g0/g00" +#define NAME_GROUP_SUB_2 "/g0/g01" +#define NAME_GROUP_SUB_SUB "/g0/g00/g000" +#define NAME_GROUP_SUB_SUB2 "g000" +#define NAME_GROUP_DATASET "/g0/dataset_simple" +#define NAME_GROUP_LINK "/g_links" +#define NAME_GROUP_LINK2 "/g_links2" +#define NAME_GROUP_LOOP "g_loop" +#define NAME_GROUP_LOOP2 "g_loop2" +#define NAME_GROUP_LOOP3 "g_loop3" +#define NAME_GROUP_REF "ref_grp" +#define NAME_LINK_DATASET "/g_links/dataset_simple" +#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple" +#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple" +#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple" +#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple" #define NAME_LINK_EXTERN2 "/g_links2/external_link_to_dataset_simple" -#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere" -#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere" +#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere" +#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere" #define NAME_LINK_EXTERN_DANGLE "/g_links/external_link_to_nowhere" #define NAME_LINK_EXTERN_DANGLE2 "/g_links2/external_link_to_nowhere" -#define NAME_OLD_FORMAT "/dset1" +#define NAME_OLD_FORMAT "/dset1" #define NAME_DSET_NULL "DSET_NULL" #define NAME_BUF_SIZE 1024 #define ATTR_NAME_LEN 80 #define DIM_SIZE_1 12 #define DIM_SIZE_2 6 -#define MAX_DIM_SIZE_1 100 -#define MAX_DIM_SIZE_2 80 +#define MAX_DIM_SIZE_1 100 +#define MAX_DIM_SIZE_2 80 #define CHUNK_SIZE_1 5 /* Not an even fraction of dimension sizes, so we test copying partial chunks */ #define CHUNK_SIZE_2 5 #define NUM_SUB_GROUPS 20 @@ -180,7 +179,7 @@ static int compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf); static int compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags); -static int +static int compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_index_t old_type); static int @@ -190,7 +189,7 @@ attach_attribute_compound_vlstr(hid_t loc_id); static int compare_attribute_compound_vlstr(hid_t loc, hid_t loc2); - + /*------------------------------------------------------------------------- * Function: addr_insert * @@ -224,7 +223,7 @@ addr_insert(H5O_info_t *oi) idtab_g.obj[n] = oi->addr; } /* end addr_insert() */ - + /*------------------------------------------------------------------------- * Function: addr_lookup * @@ -253,7 +252,7 @@ addr_lookup(H5O_info_t *oi) return FALSE; } /* end addr_lookup() */ - + /*------------------------------------------------------------------------- * Function: addr_reset * @@ -275,7 +274,7 @@ addr_reset(void) idtab_g.nalloc = idtab_g.nobjs = 0; } /* end addr_reset() */ - + /*------------------------------------------------------------------------- * Function: attach_ref_attr * @@ -336,7 +335,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: attach_reg_ref_attr * @@ -413,7 +412,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: create_reg_ref_dataset * @@ -508,7 +507,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: attach_attribute_vl * @@ -570,13 +569,13 @@ done: } /* end of attach_attribute_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_attach_attributes * * Purpose: Attach NUM_ATTRIBUTES attributes to the object to be copied * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Peter Cao * Friday, September 30, 2005 @@ -644,13 +643,13 @@ done: return ret_value; } - + /*------------------------------------------------------------------------- * Function: test_copy_attach_paired_attributes * * Purpose: Attach NUM_ATTRIBUTES attributes to a pair of objects to be copied * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Tuesday, November 1, 2005 @@ -713,7 +712,7 @@ done: return -1; } /* end test_copy_attach_paired_attributes() */ - + /*------------------------------------------------------------------------- * Function: compare_attribute * @@ -844,18 +843,18 @@ error: return FALSE; } /* end compare_attribute() */ - + /*------------------------------------------------------------------------- * Function: compare_std_attributes * * Purpose: Compare "standard" attributes on two objects to check that they are equal * - * Return: TRUE if objects have same attributes/FALSE if they are different + * Return: TRUE if objects have same attributes/FALSE if they are different * * Programmer: Quincey Koziol * Monday, October 31, 2005 * - * Note: This isn't very general, the attributes are assumed to be + * Note: This isn't very general, the attributes are assumed to be * those written in test_copy_attach_attributes(). * * Modifier: Peter Cao @@ -916,19 +915,19 @@ compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid) error: H5E_BEGIN_TRY { - H5Aclose(aid2); - H5Aclose(aid); + H5Aclose(aid2); + H5Aclose(aid); } H5E_END_TRY; return FALSE; } /* end compare_std_attributes() */ - + /*------------------------------------------------------------------------- * Function: compare_data * * Purpose: Compare two buffers of data to check that they are equal * - * Return: TRUE if buffer are equal/FALSE if they are different + * Return: TRUE if buffer are equal/FALSE if they are different * * Programmer: Quincey Koziol * Monday, November 21, 2005 @@ -1189,13 +1188,13 @@ error: return FALSE; } /* end compare_data() */ - + /*------------------------------------------------------------------------- * Function: compare_datasets * * Purpose: Compare two datasets to check that they are equal * - * Return: TRUE if datasets are equal/FALSE if they are different + * Return: TRUE if datasets are equal/FALSE if they are different * * Programmer: Quincey Koziol * Tuesday, October 25, 2005 @@ -1352,23 +1351,23 @@ error: HDfree(rbuf); if(rbuf2) HDfree(rbuf2); - H5Pclose(dcpl2); - H5Pclose(dcpl); - H5Sclose(sid2); - H5Sclose(sid); - H5Tclose(tid2); - H5Tclose(tid); + H5Pclose(dcpl2); + H5Pclose(dcpl); + H5Sclose(sid2); + H5Sclose(sid); + H5Tclose(tid2); + H5Tclose(tid); } H5E_END_TRY; return FALSE; } /* end compare_datasets() */ - + /*------------------------------------------------------------------------- * Function: compare_groups * * Purpose: Compare two groups to check that they are "equal" * - * Return: TRUE if group are equal/FALSE if they are different + * Return: TRUE if group are equal/FALSE if they are different * * Programmer: Quincey Koziol * Monday, October 31, 2005 @@ -1518,48 +1517,48 @@ error: return FALSE; } /* end compare_groups() */ - + /*------------------------------------------------------------------------- * Function: compare_idx_type * * Purpose: If using new format, the index array type should be NEW_TYPE - * If not, the index array type should be OLD_TYPE + * If not, the index array type should be OLD_TYPE * - * Return: TRUE if the index type retrieved for the dataset DID is - * as expected - * FALSE if not + * Return: TRUE if the index type retrieved for the dataset DID is + * as expected + * FALSE if not * * Programmer: Vailin Choi; August 2009 * *------------------------------------------------------------------------- */ -static int +static int compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_index_t old_type) { H5D_chunk_index_t idx_type; /* Dataset chunk index type */ H5F_libver_t low; /* File format low bound */ /* Get the chunk index type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) - FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(did, &idx_type) < 0) + FAIL_STACK_ERROR /* Check if we are using the latest version of the format */ - if(H5Pget_libver_bounds(fapl, &low, NULL) < 0) - FAIL_STACK_ERROR + if(H5Pget_libver_bounds(fapl, &low, NULL) < 0) + FAIL_STACK_ERROR /* Verify index type */ if(low == H5F_LIBVER_LATEST) { - if(idx_type != new_type) - TEST_ERROR - } else if(idx_type != old_type) - TEST_ERROR + if(idx_type != new_type) + TEST_ERROR + } else if(idx_type != old_type) + TEST_ERROR return TRUE; error: return FALSE; } /* compare_idx_type() */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype * @@ -1580,8 +1579,8 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named datatype"); @@ -1646,15 +1645,15 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_vl * @@ -1673,8 +1672,8 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named vlen datatype"); @@ -1739,15 +1738,15 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_vl_vl * @@ -1766,8 +1765,8 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named nested vlen datatype"); @@ -1838,15 +1837,15 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_attr_self * @@ -1989,7 +1988,7 @@ error: return 1; } /* end test_copy_named_datatype_attr_self */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_simple * @@ -2098,16 +2097,16 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_versionbounds * @@ -2274,18 +2273,18 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src) error: H5E_BEGIN_TRY { - H5Dclose(did_dst); - H5Dclose(did_src); - H5Sclose(sid); - H5Pclose(fapl_dst); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did_dst); + H5Dclose(did_src); + H5Sclose(sid); + H5Pclose(fapl_dst); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_versionbounds */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_simple_samefile * @@ -2383,22 +2382,22 @@ test_copy_dataset_simple_samefile(hid_t fcpl, hid_t fapl) error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple_samefile */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_simple_empty * * 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 + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -2501,16 +2500,16 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple_empty */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compound * @@ -2632,17 +2631,17 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compound */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked * @@ -2724,10 +2723,10 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * Create 1-D dataset: chunked, non-filterd, with data - * dims=max dims=chunk dims - * H5D_ALLOC_TIME_INC (default) + * dims=max dims=chunk dims + * H5D_ALLOC_TIME_INC (default) */ /* create 1-D dataspace */ if((sid = H5Screate_simple(1, dim1d, dim1d)) < 0) TEST_ERROR @@ -2799,9 +2798,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * Create 2-D dataset: chunked, non-filterd, with data, dims=chunk dims, - * H5D_ALLOC_TIME_INC (default) + * H5D_ALLOC_TIME_INC (default) */ /* create 2-D dataspace */ @@ -2823,9 +2822,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * Create 2-D dataset: chunked, non-filterd, with data, dims=chunk dims, - * H5D_ALLOC_TIME_EARLY + * H5D_ALLOC_TIME_EARLY */ if(H5Pset_alloc_time(pid, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR @@ -2847,9 +2846,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close chunk plist */ if(H5Pclose(pid) < 0) TEST_ERROR - /* + /* * Create 2-D dataset: chunked, non-filterd, with data, dims=max dims=chunk dims, - * H5D_ALLOC_TIME_LATE + * H5D_ALLOC_TIME_LATE */ /* create 2-D dataspace */ if((sid = H5Screate_simple(2, dim2d, dim2d)) < 0) TEST_ERROR @@ -2908,7 +2907,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf1d) != TRUE) TEST_ERROR @@ -2928,7 +2927,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf1d) != TRUE) TEST_ERROR @@ -2947,7 +2946,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -2967,7 +2966,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -2986,7 +2985,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -3005,7 +3004,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -3024,7 +3023,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -3046,17 +3045,17 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_empty * @@ -3124,9 +3123,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 1-D dataset: chunked, empty, non-filtered, - * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) + * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) */ /* Set 1-D dataspace dimensions */ @@ -3194,9 +3193,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, empty, non-filtered, - * dims=chunk dims, H5D_ALLOC_TIME_INC (default) + * dims=chunk dims, H5D_ALLOC_TIME_INC (default) */ /* Set 2-D dataspace dimensions */ @@ -3219,9 +3218,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, empty, non-filtered, dims=chunk dims - * H5D_ALLOC_TIME_EARLY + * H5D_ALLOC_TIME_EARLY */ /* Set allocation time to early */ if(H5Pset_alloc_time(pid, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR @@ -3241,9 +3240,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* - * create 2-D dataset: chunked, empty, non-filtered, - * dims=max dims=chunk dims, H5D_ALLOC_TIME_LATE + /* + * create 2-D dataset: chunked, empty, non-filtered, + * dims=max dims=chunk dims, H5D_ALLOC_TIME_LATE */ /* Set 2-D dataspace dimensions */ @@ -3305,7 +3304,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3324,7 +3323,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3343,7 +3342,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3362,7 +3361,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3382,7 +3381,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3402,7 +3401,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3421,7 +3420,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3443,17 +3442,17 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_empty */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_sparse * @@ -3677,7 +3676,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3697,7 +3696,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_BT2, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3717,7 +3716,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3737,7 +3736,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3760,17 +3759,17 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_sparse */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed * @@ -3867,9 +3866,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, filtered, with data - * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) + * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) */ /* create dataspace */ if((sid = H5Screate_simple(2, dim2d, dim2d)) < 0) TEST_ERROR @@ -3891,9 +3890,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, filtered, with data - * dims=chunk dims, H5D_ALLOC_TIME_EARLY + * dims=chunk dims, H5D_ALLOC_TIME_EARLY */ /* create dataspace */ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR @@ -3919,9 +3918,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, filtered, with data - * dims=chunk dims, H5D_ALLOC_TIME_LATE + * dims=chunk dims, H5D_ALLOC_TIME_LATE */ /* create dataspace */ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR @@ -3986,7 +3985,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4005,7 +4004,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4023,7 +4022,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4041,7 +4040,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED3_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4059,7 +4058,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED4_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4083,24 +4082,24 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid #ifdef H5_HAVE_FILTER_DEFLATE error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_compressed */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_no_edge_filt * * 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 + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -4251,13 +4250,13 @@ error: #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_no_edge_filt */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact * * 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 + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -4377,17 +4376,17 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_external * @@ -4504,17 +4503,17 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_external */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_named_dtype * @@ -4625,17 +4624,17 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hi error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_named_dtype */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_named_dtype_hier * @@ -4762,18 +4761,18 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_named_dtype_hier */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_named_dtype_hier_outside * @@ -4901,18 +4900,18 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_named_dtype_hier_outside */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_multi_ohdr_chunks * @@ -5023,7 +5022,7 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa /* close the second dataset */ if(H5Dclose(did2) < 0) TEST_ERROR - } else + } else /* open the group for copy */ if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -5050,18 +5049,18 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_multi_ohdr_chunks */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_attr_named_dtype * @@ -5191,19 +5190,19 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_attr_named_dtype */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_vl * @@ -5327,19 +5326,19 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_vl * @@ -5510,20 +5509,20 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Pclose(pid); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_vl * @@ -5655,19 +5654,19 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_attribute_vl * @@ -5773,11 +5772,11 @@ error: H5E_BEGIN_TRY { H5Aclose(aid2); H5Aclose(aid); - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple_empty */ @@ -5796,18 +5795,18 @@ error: static int attach_attribute_compound_vlstr(hid_t loc_id) { - hid_t aid = -1; /* Attribute ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t vl_str_tid = -1; /* Variable length string datatype ID */ - hid_t cmpd_tid = -1; /* Compound datatype ID */ - hsize_t dim1 = 1; /* Dimension size */ - typedef struct { /* Compound structure for the attribute */ + hid_t aid = -1; /* Attribute ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t tid = -1; /* Datatype ID */ + hid_t vl_str_tid = -1; /* Variable length string datatype ID */ + hid_t cmpd_tid = -1; /* Compound datatype ID */ + hsize_t dim1 = 1; /* Dimension size */ + typedef struct { /* Compound structure for the attribute */ int i; char *v; } s1; s1 buf; /* Buffer */ - int ret_value = -1; /* Return value */ + int ret_value = -1; /* Return value */ /* Create dataspace */ if((sid = H5Screate_simple(1, &dim1, NULL)) < 0 ) @@ -5861,7 +5860,7 @@ done: * Function: compare_attribute_compound_vlstr * * Purpose: Compare data of the attributes attached to the two objects. - * The attribute is a compound datatype with a variable length string. + * The attribute is a compound datatype with a variable length string. * * Return: Non-negative on success/Negative on failure * @@ -5872,46 +5871,46 @@ done: static int compare_attribute_compound_vlstr(hid_t loc, hid_t loc2) { - hid_t aid = -1, aid2 = -1; /* Attribute IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - typedef struct { /* Compound structure for the attribute */ - int i; - char *v; + hid_t aid = -1, aid2 = -1; /* Attribute IDs */ + hid_t tid = -1, tid2 = -1; /* Datatype IDs */ + typedef struct { /* Compound structure for the attribute */ + int i; + char *v; } s1; - s1 rbuf; /* Buffer for data read */ - s1 rbuf2; /* Buffer for data read */ - + s1 rbuf; /* Buffer for data read */ + s1 rbuf2; /* Buffer for data read */ + /* Open the attributes attached to the objects */ if((aid = H5Aopen_by_idx(loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if((aid2 = H5Aopen_by_idx(loc2, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Get the attributes' datatypes */ - if((tid = H5Aget_type(aid)) < 0) - FAIL_STACK_ERROR + if((tid = H5Aget_type(aid)) < 0) + FAIL_STACK_ERROR if((tid2 = H5Aget_type(aid2)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Read the attributes */ if(H5Aread(aid, tid, &rbuf) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Aread(aid2, tid2, &rbuf2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Compare the attributes' data */ if(rbuf.i != rbuf2.i) - FAIL_STACK_ERROR - if(HDstrlen(rbuf.v) != HDstrlen(rbuf2.v)) - FAIL_STACK_ERROR - if(HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v))) - FAIL_STACK_ERROR + FAIL_STACK_ERROR + if(HDstrlen(rbuf.v) != HDstrlen(rbuf2.v)) + FAIL_STACK_ERROR + if(HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v))) + FAIL_STACK_ERROR /* Close the attributes */ if(H5Aclose(aid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Aclose(aid2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR return TRUE; error: @@ -5929,15 +5928,15 @@ error: * Function: test_copy_attribute_compound_vlstr * * Purpose: Create a simple dataset and a group in SRC file. - * Both has an attribute with a compound datatype consisting + * Both has an attribute with a compound datatype consisting * of a variable length string * Copy the dataset and the group to DST file - * This is for HDFFV-7991 + * This is for HDFFV-7991 * * Return: Success: 0 * Failure: number of errors * - * Programmer: + * Programmer: * *------------------------------------------------------------------------- */ @@ -5948,10 +5947,10 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap hid_t sid = -1; /* Dataspace ID */ hid_t did = -1, did2 = -1; /* Dataset IDs */ hid_t aid = -1, aid2 = -1; /* Attribute IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ hsize_t dim2d[2]; /* Dataset dimensions */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ TESTING("H5Ocopy(): attribute with compound datatype consisting of variable length string"); @@ -5964,7 +5963,7 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* create source file */ if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* set dataspace dimensions */ dim2d[0] = DIM_SIZE_1; @@ -5972,103 +5971,103 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* create 2D dataspace */ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* create 2D int dataset at SRC file */ if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close dataspace */ if(H5Sclose(sid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* attach an attribute to the dataset */ if(attach_attribute_compound_vlstr(did) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the dataset */ if(H5Dclose(did) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* create a group */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* attach attribute to the group */ if(attach_attribute_compound_vlstr(gid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the group */ if(H5Gclose(gid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the SRC file */ if(H5Fclose(fid_src) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* open the source file with read-only */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* create destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* copy the dataset from SRC to DST */ if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* open the src dataset */ if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* open the destination dataset */ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* compare the data of the attributes attached to the two datasets */ if(compare_attribute_compound_vlstr(did, did2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the datasets */ if(H5Dclose(did2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Dclose(did) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Copy the group */ if(H5Ocopy(fid_src, NAME_GROUP_EMPTY, fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Open the src group */ if((gid = H5Gopen2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Open the destination group */ if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* compare the data of the attributes attached to the two groups */ if(compare_attribute_compound_vlstr(gid, gid2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the groups */ - if(H5Gclose(gid) < 0) - FAIL_STACK_ERROR - if(H5Gclose(gid2) < 0) - FAIL_STACK_ERROR + if(H5Gclose(gid) < 0) + FAIL_STACK_ERROR + if(H5Gclose(gid2) < 0) + FAIL_STACK_ERROR /* close the SRC file */ if(H5Fclose(fid_src) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the DST file */ if(H5Fclose(fid_dst) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR PASSED(); return 0; @@ -6077,18 +6076,18 @@ error: H5E_BEGIN_TRY { H5Aclose(aid2); H5Aclose(aid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid); - H5Gclose(gid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid); + H5Gclose(gid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_attribute_compound_vlstr() */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed_vl * @@ -6232,21 +6231,21 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, #ifdef H5_HAVE_FILTER_DEFLATE error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_compressed_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_empty * @@ -6333,15 +6332,15 @@ test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_ error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_empty */ - + /*------------------------------------------------------------------------- * Function: test_copy_root_group * @@ -6474,7 +6473,7 @@ error: return 1; } /* end test_copy_root_group */ - + /*------------------------------------------------------------------------- * Function: test_copy_group * @@ -6597,18 +6596,18 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_deep * @@ -6739,18 +6738,18 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_deep */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_loop * @@ -6850,17 +6849,17 @@ test_copy_group_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f error: H5E_BEGIN_TRY { - H5Gclose(gid_sub2); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Gclose(gid_sub2); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_loop */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_wide_loop * @@ -6979,17 +6978,17 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Gclose(gid_sub2); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Gclose(gid_sub2); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_wide_loop */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_links * @@ -7237,20 +7236,20 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_ error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_ext); - H5Fclose(fid_dst); - H5Fclose(fid_src); - H5Pclose(plid); + H5Sclose(sid); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_ext); + H5Fclose(fid_dst); + H5Fclose(fid_src); + H5Pclose(plid); } H5E_END_TRY; return 1; } /* end test_copy_group_links */ - + /*------------------------------------------------------------------------- * Function: test_copy_soft_link * @@ -7376,17 +7375,17 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fa error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_soft_link */ - + /*------------------------------------------------------------------------- * Function: test_copy_ext_link * @@ -7510,17 +7509,17 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_ext_link */ - + /*------------------------------------------------------------------------- * Function: test_copy_exist * @@ -7620,15 +7619,15 @@ test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_exist */ - + /*------------------------------------------------------------------------- * Function: test_copy_path * @@ -7754,17 +7753,17 @@ test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_path */ - + /*------------------------------------------------------------------------- * Function: test_copy_same_file_named_datatype * @@ -7826,21 +7825,21 @@ test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end test_copy_same_file_named_datatype */ - + /*------------------------------------------------------------------------- * Function: test_copy_old_layout * * Purpose: Copy dataset that uses the "old" layout version (pre version 3) * format. * - * Note: This test uses the "fill_old.h5" file for convenience, since it + * Note: This test uses the "fill_old.h5" file for convenience, since it * has a dataset with the old layout format. * * Return: Success: 0 @@ -7916,15 +7915,15 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open) error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_old_layout */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_named_vl * @@ -8065,21 +8064,21 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_named_vl * @@ -8212,27 +8211,27 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_named_vl * * Purpose: Create a dataset that uses a named variable length datatype * in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -8379,21 +8378,21 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed_named_vl * @@ -8536,21 +8535,21 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_ error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compressed_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_vl_vl * @@ -8699,28 +8698,28 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Pclose(pid); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_vl_vl * * Purpose: Create a compact dataset w/nested VLEN datatype * in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -8872,21 +8871,21 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Pclose(pid); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_vl_vl * @@ -8905,7 +8904,7 @@ static int test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2=-1; /* Datatype ID */ + hid_t tid = -1, tid2=-1; /* Datatype ID */ hid_t sid = -1; /* Dataspace ID */ hid_t pid = -1; /* Dataset creation property list ID */ hid_t did = -1, did2 = -1; /* Dataset IDs */ @@ -9073,28 +9072,28 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed_vl_vl * * Purpose: Create a dataset that uses a named variable length datatype * in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -9196,7 +9195,7 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* 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 @@ -9249,16 +9248,16 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compressed_vl_vl */ @@ -9272,7 +9271,7 @@ typedef struct cmpd_vl_t { double c; } cmpd_vl_t; - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_cmpd_vl * @@ -9405,20 +9404,20 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); H5Pclose(dxpl_id); H5Tclose(tid2); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_cmpd_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_cmpd_vl * @@ -9558,21 +9557,21 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); H5Pclose(dxpl_id); H5Pclose(pid); H5Tclose(tid2); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_cmpd_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_cmpd_vl * @@ -9711,21 +9710,21 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); + H5Pclose(dxpl_id); + H5Pclose(pid); H5Tclose(tid2); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_cmpd_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_null_ref * @@ -9887,7 +9886,7 @@ error: return 1; } /* end test_copy_null_ref */ - + /*------------------------------------------------------------------------- * Function: test_copy_null_ref_open * @@ -10070,7 +10069,7 @@ error: return 1; } /* end test_copy_null_ref_open */ - + /*------------------------------------------------------------------------- * Function: test_copy_attr_crt_order * @@ -10192,7 +10191,7 @@ error: return 1; } /* end test_copy_attr_crt_order */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_datatype_merge * @@ -10429,7 +10428,7 @@ error: return 1; } /* end test_copy_committed_datatype_merge */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_datatype_merge_same_file * @@ -10701,7 +10700,7 @@ error: } /* end test_copy_committed_datatype_merge_same_file */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_dt_merge_sugg * @@ -10930,7 +10929,7 @@ error: return 1; } /* end test_copy_committed_dt_merge_sugg */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_dt_merge_attr * @@ -11123,27 +11122,27 @@ error: #define ROOT_NDT_INT "root_ndt_int" #define GROUP_NDT_SHORT "group_ndt_short" -#define SRC_GRP "src_grp" -#define DST_GRP "dst_grp" -#define DST_GRP2 "dst_grp2" +#define SRC_GRP "src_grp" +#define DST_GRP "dst_grp" +#define DST_GRP2 "dst_grp2" -#define SRC_NDT_SHORT "src_ndt_short" -#define SRC_NDT_INT "src_ndt_int" -#define SRC_NDT_INT2 "src_ndt_int2" -#define SRC_NDT_FLOAT "src_ndt_float" -#define SRC_NDT_DOUBLE "src_ndt_double" +#define SRC_NDT_SHORT "src_ndt_short" +#define SRC_NDT_INT "src_ndt_int" +#define SRC_NDT_INT2 "src_ndt_int2" +#define SRC_NDT_FLOAT "src_ndt_float" +#define SRC_NDT_DOUBLE "src_ndt_double" -#define DST_NDT_SHORT "dst_ndt_short" -#define DST_NDT_INT "dst_ndt_int" -#define DST_NDT_FLOAT "dst_ndt_float" -#define DST_NDT_DOUBLE "dst_ndt_double" +#define DST_NDT_SHORT "dst_ndt_short" +#define DST_NDT_INT "dst_ndt_int" +#define DST_NDT_FLOAT "dst_ndt_float" +#define DST_NDT_DOUBLE "dst_ndt_double" -#define SRC_NDT_DSET "src_ndt_dset" -#define SRC_NDT_DSET2 "src_ndt_dset2" -#define SRC_NDT_DSET3 "src_ndt_dset3" +#define SRC_NDT_DSET "src_ndt_dset" +#define SRC_NDT_DSET2 "src_ndt_dset2" +#define SRC_NDT_DSET3 "src_ndt_dset3" -#define SRC_DSET "src_dset" -#define SRC_DSET1 "src_dset1" +#define SRC_DSET "src_dset" +#define SRC_DSET1 "src_dset1" #define SRC_ATTR "src_attr" @@ -11152,21 +11151,21 @@ error: #define DST_ATTR "dst_attr" #define DST_ATTR2 "dst_attr2" - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_hier_merge * * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy: - * SRC file: - * Create committed datatypes at / and /g0 - * Create datasets with native type and committed datatypes at /g0 - * DST file: - * Create attributes with anonymous committed datatypes at /uncopied + * SRC file: + * Create committed datatypes at / and /g0 + * Create datasets with native type and committed datatypes at /g0 + * DST file: + * Create attributes with anonymous committed datatypes at /uncopied * - * Copy / at SRC to DST - * Copy /g0 at SRC to DST - * Copy the datasets in /g0 at SRC to DST /uncopied - * Verify that committed datatypes are copied and merged correctly + * Copy / at SRC to DST + * Copy /g0 at SRC to DST + * Copy the datasets in /g0 at SRC to DST /uncopied + * Verify that committed datatypes are copied and merged correctly * * Return: Success: 0 * Failure: number of errors @@ -11182,19 +11181,19 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d hid_t tid = -1; /* Datatype ID */ hid_t sid = -1; /* Dataspace ID */ hid_t did = -1; /* Dataset ID */ - hid_t gid = -1; /* Group IDs */ - hid_t f_tid = -1; /* Datatype ID for root group */ - hid_t g_tid = -1; /* Datatype ID for group */ - hid_t anon_tid = -1; /* Anonymous datatype */ - hid_t aid = -1; /* Attribute ID */ + hid_t gid = -1; /* Group IDs */ + hid_t f_tid = -1; /* Datatype ID for root group */ + hid_t g_tid = -1; /* Datatype ID for group */ + hid_t anon_tid = -1; /* Anonymous datatype */ + hid_t aid = -1; /* Attribute ID */ hid_t ocpypl_id = -1; /* Object copy plist ID */ - int i; /* Local index variable */ - hsize_t dim1d[1]; /* dimension sizes */ - int buf[DIM_SIZE_1]; /* Buffer for data */ - haddr_t exp_addr_int, exp_addr_short; /* Expected object addresses */ + int i; /* Local index variable */ + hsize_t dim1d[1]; /* dimension sizes */ + int buf[DIM_SIZE_1]; /* Buffer for data */ + haddr_t exp_addr_int, exp_addr_short; /* Expected object addresses */ H5O_info_t oinfo; /* Object info */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ if(reopen) TESTING("H5Ocopy(): hier. of committed datatypes and merging with reopen") @@ -11212,8 +11211,8 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* Reset file address checking info */ addr_reset(); - /* - * Populate source file + /* + * Populate source file */ if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR @@ -11271,8 +11270,8 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* close the SRC file */ if(H5Fclose(fid_src) < 0) TEST_ERROR - /* - * Populate destination file + /* + * Populate destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR @@ -11285,7 +11284,7 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* create attribute of anon ndt (short) in /uncopied */ if((aid = H5Acreate2(gid, DST_ATTR_ANON_SHORT, anon_tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR /* close the attribute */ if(H5Aclose(aid) < 0) TEST_ERROR @@ -11299,7 +11298,7 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* create attribute of anon ndt (int) in /uncopied */ if((aid = H5Acreate2(gid, DST_ATTR_ANON_INT, anon_tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR /* close the attribute */ if(H5Aclose(aid) < 0) TEST_ERROR @@ -11460,17 +11459,17 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d error: H5E_BEGIN_TRY { - H5Tclose(tid); - H5Tclose(f_tid); - H5Tclose(g_tid); - H5Tclose(anon_tid); - H5Pclose(ocpypl_id); - H5Aclose(aid); - H5Dclose(did); - H5Sclose(sid); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Tclose(f_tid); + H5Tclose(g_tid); + H5Tclose(anon_tid); + H5Pclose(ocpypl_id); + H5Aclose(aid); + H5Dclose(did); + H5Sclose(sid); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_cdt_hier_merge */ @@ -11480,22 +11479,22 @@ error: * Function: test_copy_cdt_merge_cdt * * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy: - * SRC file: - * Create committed datatype (short) - * Create committed datatype (float) - * Create committed datatype (int), with attribute of ndt int - * Create committed datatype (double), with attribute of anon ndt short - * DST file: - * Create committed datatype (int) - * Create committed datatype (float), with attribute of native int - * Create committed datatype (double), with attribute of anon ndt short - * - * Copy / at SRC to DST - * Verify that committed datatypes are copied and merged correctly - * - * NOTE: - * Comparison of attributes are not implemented yet. - * Further tests will be added in the future. + * SRC file: + * Create committed datatype (short) + * Create committed datatype (float) + * Create committed datatype (int), with attribute of ndt int + * Create committed datatype (double), with attribute of anon ndt short + * DST file: + * Create committed datatype (int) + * Create committed datatype (float), with attribute of native int + * Create committed datatype (double), with attribute of anon ndt short + * + * Copy / at SRC to DST + * Verify that committed datatypes are copied and merged correctly + * + * NOTE: + * Comparison of attributes are not implemented yet. + * Further tests will be added in the future. * * Return: Success: 0 * Failure: number of errors @@ -11510,15 +11509,15 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ hid_t tid3 = -1, tid4 = -1; /* Datatype IDs */ - hid_t tid5 = -1, tid = -1; /* Datatype IDs */ + hid_t tid5 = -1, tid = -1; /* Datatype IDs */ hid_t sid = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ + hid_t aid = -1; /* Attribute ID */ hid_t ocpypl_id = -1; /* Object copy plist ID */ - hsize_t dim1d[1]; /* dimension sizes */ + hsize_t dim1d[1]; /* dimension sizes */ H5O_info_t oinfo; /* Object info */ - haddr_t exp_addr; /* Expected object addresses */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + haddr_t exp_addr; /* Expected object addresses */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ if(reopen) TESTING("H5Ocopy(): merging various committed datatypes with reopen") @@ -11532,8 +11531,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds /* Reset file address checking info */ addr_reset(); - /* - * Populate source file + /* + * Populate source file */ if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR @@ -11583,8 +11582,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds /* close the SRC file */ if(H5Fclose(fid_src) < 0) TEST_ERROR - /* - * Populate destination file + /* + * Populate destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR @@ -11639,8 +11638,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds /* copy everything in SRC to DST */ if(H5Ocopy(fid_src, "/", fid_dst, SRC_ROOT_GROUP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR - /* - * Verification + /* + * Verification */ /* get address of committed datatype: /src_root/src_ndt_double */ if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_DOUBLE, H5P_DEFAULT)) < 0) TEST_ERROR @@ -11704,29 +11703,29 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds error: H5E_BEGIN_TRY { - H5Pclose(ocpypl_id); - H5Tclose(tid); - H5Tclose(tid1); - H5Tclose(tid2); - H5Tclose(tid3); - H5Tclose(tid4); - H5Tclose(tid5); - H5Aclose(aid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(ocpypl_id); + H5Tclose(tid); + H5Tclose(tid1); + H5Tclose(tid2); + H5Tclose(tid3); + H5Tclose(tid4); + H5Tclose(tid5); + H5Aclose(aid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_cdt_merge_cdt */ - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_merge_suggs * * Purpose: Tests the suggested searching paths feature (H5Padd_merge_committed_dtype_path) - * is correctly applied in merging the committed datatypes. - * + * is correctly applied in merging the committed datatypes. + * * Return: Success: 0 * Failure: number of errors * @@ -11795,7 +11794,7 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Fclose(fid_dst) < 0) TEST_ERROR /* - * Test 1 + * Test 1 */ /* open the source file with read-only */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR @@ -11831,8 +11830,8 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 2 + /* + * Test 2 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -11864,14 +11863,14 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 3 + /* + * Test 3 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR /* remove "/uncopied/src_ndt_int" from DST file */ - if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT) < 0) TEST_ERROR /* copy "/src_ndt_int" from SRC file to "/uncopied/src_ndt_int" at DST file */ /* use default ocpypl_id -- without merging and suggestion */ @@ -11880,7 +11879,7 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* copy "/src_ndt_int" from SRC file to "/src_ndt_int2" at DST file */ /* copy with merging and search suggestion: "/uncopied/src_ndt_int" */ if(H5Ocopy(fid_src, SRC_NDT_INT, fid_dst, SRC_NDT_INT2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR - + if(reopen) { /* Reopen file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR @@ -11902,8 +11901,8 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 4 + /* + * Test 4 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -11955,13 +11954,13 @@ error: return 1; } /* end test_copy_cdt_merge_suggs */ - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_merge_dset_suggs * * Purpose: Tests the suggested searching paths feature (H5Padd_merge_committed_dtype_path) - * is correctly applied in merging the committed datatypes of datasets. - * + * is correctly applied in merging the committed datatypes of datasets. + * * Return: Success: 0 * Failure: number of errors * @@ -12056,7 +12055,7 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Sclose(sid) < 0) TEST_ERROR /* - * Test 1 + * Test 1 */ /* open the source file with read-only */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR @@ -12094,8 +12093,8 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 2 + /* + * Test 2 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12131,14 +12130,14 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 3 + /* + * Test 3 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR /* remove "/uncopied/src_ndt_dset" */ - if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT) < 0) TEST_ERROR /* copy "src_ndt_dset" from SRC file to "/uncopied/src_ndt_dset" at DST file */ /* use default ocpypl_id -- without merging and suggestion */ @@ -12147,7 +12146,7 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* copy "src_ndt_dset" from SRC file to "/src_ndt_dset2" at DST file */ /* use merging and suggested searching path: "/uncopied/src_ndt_dset" */ if(H5Ocopy(fid_src, SRC_NDT_DSET, fid_dst, SRC_NDT_DSET2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR - + if(reopen) { /* Reopen file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR @@ -12173,8 +12172,8 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 4 + /* + * Test 4 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12232,12 +12231,12 @@ error: return 1; } /* end test_copy_cdt_merge_dset_suggs */ - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_merge_all_suggs * * Purpose: Tests the merging committed datatype + search suggestion feature. - * + * * Return: Success: 0 * Failure: number of errors * @@ -12256,8 +12255,8 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t aid = -1; /* Attribute ID */ hid_t did = -1; /* Dataset ID */ hid_t exp_did = -1; /* Dataset ID */ - hid_t tid_short = -1; /* Datatype ID */ - hid_t exp_tid = -1; /* Expected datatype ID */ + hid_t tid_short = -1; /* Datatype ID */ + hid_t exp_tid = -1; /* Expected datatype ID */ hid_t ocpypl_id = -1; /* Object copy plist ID */ hsize_t dim1d[1]; /* Dataset dimensions */ char src_filename[NAME_BUF_SIZE]; @@ -12313,7 +12312,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create third dataset in group */ if((did = H5Dcreate2(gid, SRC_DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - + /* get datatype */ if((tid_short = H5Topen2(fid_src, "/" SRC_GRP "/" SRC_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -12442,7 +12441,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 1 */ /* open the source file with read-only */ @@ -12483,7 +12482,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 2 */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12520,7 +12519,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 3 */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12555,7 +12554,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 4 */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12608,7 +12607,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 5 */ /* open destination file */ @@ -12646,7 +12645,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 6 */ /* open destination file */ @@ -12707,7 +12706,7 @@ error: return 1; } /* end test_copy_cdt_merge_all_suggs */ - + /*------------------------------------------------------------------------- * Function: test_copy_set_mcdt_search_cb * @@ -12892,7 +12891,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Continue the global search */ if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cb, &cb_udata) < 0) - TEST_ERROR + TEST_ERROR /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12927,7 +12926,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Stop the search, default action is to create an anonymous committed datatype */ cb_udata.search_action = H5O_MCDT_SEARCH_STOP; @@ -13063,7 +13062,7 @@ error: return 1; } /* end test_copy_set_mcdt_search_cb */ - + /*------------------------------------------------------------------------- * Function: test_copy_set_get_mcdt_cb * @@ -13109,10 +13108,10 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, int buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; - H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */ - H5O_mcdt_search_ret_t mcdt_udataA; /* User data for callback */ - H5O_mcdt_search_ret_t mcdt_udataB; /* User data for callback */ - H5O_mcdt_search_ret_t *mcdt_udata_p = NULL; /* Pointer to user data for callback */ + H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */ + H5O_mcdt_search_ret_t mcdt_udataA; /* User data for callback */ + H5O_mcdt_search_ret_t mcdt_udataB; /* User data for callback */ + H5O_mcdt_search_ret_t *mcdt_udata_p = NULL; /* Pointer to user data for callback */ if(reopen) TESTING("H5Ocopy(): H5Pset/get_mcdt_search_cb and reopen") @@ -13242,7 +13241,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Continue the global search */ if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataA) < 0) - TEST_ERROR + TEST_ERROR /* open the destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -13275,7 +13274,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, mcdt_udataB = H5O_MCDT_SEARCH_STOP; if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataB) < 0) - TEST_ERROR + TEST_ERROR /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -13305,7 +13304,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Pfree_merge_committed_dtype_paths(ocpypl_id) < 0) TEST_ERROR if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbB, &mcdt_udataB) < 0) - TEST_ERROR + TEST_ERROR /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -13358,7 +13357,7 @@ error: return 1; } /* end test_copy_set_get_mcdt_search_cb */ - + /*------------------------------------------------------------------------- * Function: test_copy_iterate * @@ -13456,7 +13455,7 @@ error: return 1; } /* end test_copy_iterate */ - + /*------------------------------------------------------------------------- * Function: test_copy_option * @@ -13481,7 +13480,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, hid_t did = -1; /* Dataset ID */ hid_t gid=-1, gid2=-1, gid_ref=-1; /* Group IDs */ hid_t gid_sub=-1, gid_sub_sub=-1; /* Sub-group ID */ - hid_t pid=-1, lcpl_id=-1; /* Property IDs */ + hid_t pid=-1, lcpl_id=-1; /* Property IDs */ unsigned cpy_flags; /* Object copy flags */ int depth = -1; /* Copy depth */ hsize_t dim2d[2]; @@ -13734,51 +13733,51 @@ error: H5E_BEGIN_TRY { H5Pclose(lcpl_id); H5Pclose(pid); - H5Sclose(sid); - H5Dclose(did); - H5Gclose(gid_ref); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); - H5Fclose(fid_ext); + H5Sclose(sid); + H5Dclose(did); + H5Gclose(gid_ref); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); + H5Fclose(fid_ext); } H5E_END_TRY; return 1; } /* end test_copy_option */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_open * * Purpose: To ensure that H5Ocopy() copies data of opened dataset correctly. - * This is for bug fix HDFFV-7853. - * - * Test Case 1: - * Create a dataset with attributes in SRC file - * Copy the opened dataset to another location in the same file - * Copy the opened dataset to DST file - * Close the dataset - * - * Test Case 2: - * Reopen the dataset, write new data to the dataset - * Copy the opened dataset to another location in the same file - * Copy the opened dataset to to DST file - * Close the dataset - * - * Test Case 3: - * Create a committed datatype - * Create a dataset with the committed datatype in SRC file - * Open the committed datatype - * Copy the opened dataset (with the opened committed datatype) to another location in the same file - * Copy the opened dataset (with the opened committed datatype) to DST file - * Close the dataset and the committed datatype - * - * Test Case 4: - * Create a group with attributes, create a dataset in the group - * Copy the opened group (together with the opened dataset) to another location in the same file - * Copy the opened group (together with the opened dataset) to DST file - * Close the group and the dataset + * This is for bug fix HDFFV-7853. + * + * Test Case 1: + * Create a dataset with attributes in SRC file + * Copy the opened dataset to another location in the same file + * Copy the opened dataset to DST file + * Close the dataset + * + * Test Case 2: + * Reopen the dataset, write new data to the dataset + * Copy the opened dataset to another location in the same file + * Copy the opened dataset to to DST file + * Close the dataset + * + * Test Case 3: + * Create a committed datatype + * Create a dataset with the committed datatype in SRC file + * Open the committed datatype + * Copy the opened dataset (with the opened committed datatype) to another location in the same file + * Copy the opened dataset (with the opened committed datatype) to DST file + * Close the dataset and the committed datatype + * + * Test Case 4: + * Create a group with attributes, create a dataset in the group + * Copy the opened group (together with the opened dataset) to another location in the same file + * Copy the opened group (together with the opened dataset) to DST file + * Close the group and the dataset * * Return: Success: 0 * Failure: number of errors @@ -13856,16 +13855,16 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* write data to the dataset */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR - + /* attach attributes to the dataset */ if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR if(test_copy_attach_attributes(did2, H5T_NATIVE_INT) < 0) TEST_ERROR - /* - * Test case 1 + /* + * Test case 1 */ - /* + /* * Copy within the same file */ /* copy the opened dataset to another location in SRC file */ @@ -13884,7 +13883,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dclose(did3) < 0) TEST_ERROR if(H5Dclose(did4) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened dataset from SRC to DST */ @@ -13907,8 +13906,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dclose(did) < 0) TEST_ERROR if(H5Dclose(did2) < 0) TEST_ERROR - /* - * Test case 2 + /* + * Test case 2 */ /* reopen the dataset in SRC file */ if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR @@ -13918,7 +13917,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, newbuf) < 0) TEST_ERROR if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, newbuf) < 0) TEST_ERROR - /* + /* * Copy within the same file */ /* copy the opened dataset to another location in SRC file */ @@ -13936,7 +13935,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the copied dataset in SRC file */ if(H5Dclose(did3) < 0) TEST_ERROR if(H5Dclose(did4) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened dataset from SRC to DST */ @@ -13959,8 +13958,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dclose(did) < 0) TEST_ERROR if(H5Dclose(did2) < 0) TEST_ERROR - /* - * Test case 3 + /* + * Test case 3 */ /* make a copy of the datatype */ @@ -13981,7 +13980,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* write data to the dataset */ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR - /* + /* * Copy within the same file */ /* copy the opened dataset (with the opened committed datatype) to another location in SRC file */ @@ -13996,7 +13995,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the copied dataset in SRC file */ if(H5Dclose(did2) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened dataset (with the opened committed datatype) from SRC to DST */ @@ -14017,8 +14016,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the committed datatype at SRC file */ if(H5Tclose(tid) < 0) TEST_ERROR - /* - * Test case 4 + /* + * Test case 4 */ /* create a group in SRC file */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -14031,7 +14030,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* write data to the dataset */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR - /* + /* * Copy within the same file */ /* copy the opened group (together with opened dataset) to another location in SRC file */ @@ -14046,7 +14045,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the DST dataset */ if(H5Gclose(gid2) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened group (together with opened dataset) to DST file */ @@ -14081,20 +14080,20 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Dclose(did2); - H5Sclose(sid); - H5Gclose(gid); - H5Gclose(gid2); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Dclose(did2); + H5Sclose(sid); + H5Gclose(gid); + H5Gclose(gid2); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_open */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: Test H5Ocopy() * @@ -14115,11 +14114,11 @@ int main(void) { int nerrors = 0; - hid_t fapl, fapl2; + hid_t fapl, fapl2; hid_t fcpl_shared, ocpl; unsigned max_compact, min_dense; int configuration; /* Configuration of tests. */ - int ExpressMode; + int ExpressMode; hbool_t same_file; /* Whether to run tests that only use one file */ /* Setup */ @@ -14197,7 +14196,7 @@ main(void) } } /* end if */ else { - puts("Testing with oldest file format for source file:"); + puts("Testing with oldest file format for source file:"); src_fapl = fapl; num_attributes_g = 4; } /* end else */ diff --git a/test/tarray.c b/test/tarray.c index b2e0ee7..99f7bf8 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: tarray +* Test program: tarray * * Test the Array Datatype functionality * @@ -22,13 +22,11 @@ #include "testhdf5.h" #include "H5srcdir.h" -#include "hdf5.h" - #define FILENAME "tarray1.h5" #define TESTFILE "tarrold.h5" /* 1-D array datatype */ -#define ARRAY1_RANK 1 +#define ARRAY1_RANK 1 #define ARRAY1_DIM1 4 /* 3-D array datatype */ @@ -67,7 +65,7 @@ typedef struct void *test_array_alloc_custom(size_t size, void *info); void test_array_free_custom(void *mem, void *info); - + /*------------------------------------------------------------------------- * Function: test_array_atomic_1d * @@ -191,7 +189,7 @@ test_array_atomic_1d(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_atomic_1d() */ - + /*------------------------------------------------------------------------- * Function: test_array_funcs * @@ -254,7 +252,7 @@ test_array_funcs(void) CHECK(ret, FAIL, "H5Tclose"); } /* end test_array_funcs() */ - + /*------------------------------------------------------------------------- * Function: test_array_atomic_3d * @@ -383,7 +381,7 @@ test_array_atomic_3d(void) } /* end test_array_atomic_3d() */ - + /*------------------------------------------------------------------------- * Function: test_array_array_atomic * @@ -542,7 +540,7 @@ test_array_array_atomic(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_array_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_compound_atomic * @@ -749,7 +747,7 @@ test_array_compound_atomic(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_compound_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_compound_array * @@ -1008,7 +1006,7 @@ test_array_compound_array(void) ** allocated. ** ****************************************************************/ - + /*------------------------------------------------------------------------- * Function: test_array_alloc_custom * @@ -1047,7 +1045,7 @@ test_array_alloc_custom(size_t size, void *info) return ret_value; } /* end test_array_alloc_custom() */ - + /*------------------------------------------------------------------------- * Function: test_array_free_custom * @@ -1083,7 +1081,7 @@ test_array_free_custom(void *_mem, void *info) return; } /* end test_array_free_custom() */ - + /*------------------------------------------------------------------------- * Function: test_array_vlen_atomic * @@ -1298,7 +1296,7 @@ test_array_vlen_atomic(void) } /* end test_array_vlen_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_vlen_array * @@ -1553,7 +1551,7 @@ test_array_vlen_array(void) } /* end test_array_vlen_array() */ - + /*------------------------------------------------------------------------- * Function: test_array_bkg * @@ -1582,9 +1580,9 @@ test_array_bkg(void) unsigned ndims[3] = {1,1,1}; typedef struct { - int a[ALEN]; - float b[ALEN]; - double c[ALEN]; + int a[ALEN]; + float b[ALEN]; + double c[ALEN]; } CmpField; CmpField cf[LENGTH]; @@ -1857,7 +1855,7 @@ test_array_bkg(void) HDfree(dtsinfo); } /* end test_array_bkg() */ - + /*------------------------------------------------------------------------- * Function: test_compat * @@ -2152,7 +2150,7 @@ test_compat(void) } /* end test_compat() */ - + /*------------------------------------------------------------------------- * Function: test_array * @@ -2185,7 +2183,7 @@ test_array(void) } /* end test_array() */ - + /*------------------------------------------------------------------------- * Function: cleanup_array * diff --git a/test/tconfig.c b/test/tconfig.c index a9f3378..b652ca4 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -19,7 +19,6 @@ * *************************************************************/ -#include "hdf5.h" #include "testhdf5.h" /* macros definitions */ @@ -40,22 +39,22 @@ /* Needs this extra step so that we can print the macro name. */ #define vrfy_macrosize(type, macro, macroname) \ if (sizeof(type) != macro) \ - TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", \ - #type, sizeof(type), macroname, (int)macro); + TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", \ + #type, sizeof(type), macroname, (int)macro); /* local routine prototypes */ void test_config_ctypes(void); void test_exit_definitions(void); - + /*------------------------------------------------------------------------- - * Function: test_configure + * Function: test_configure * - * Purpose: Main configure definitions testing routine + * Purpose: Main configure definitions testing routine * - * Return: none (error is fed back via global variable num_errs) + * Return: none (error is fed back via global variable num_errs) * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * September 25, 2001 * *------------------------------------------------------------------------- @@ -69,15 +68,15 @@ test_configure(void) test_exit_definitions(); } - + /*------------------------------------------------------------------------- - * Function: cleanup_configure + * Function: cleanup_configure * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * September 25, 2001 * * Modifications: @@ -90,20 +89,20 @@ cleanup_configure(void) /* no file to clean */ } - + /*------------------------------------------------------------------------- - * Function: test_config_ctypes + * Function: test_config_ctypes * - * Purpose: test C language data type sizes + * Purpose: test C language data type sizes * - * Return: none (error is fed back via global variable num_errs) + * Return: none (error is fed back via global variable num_errs) * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * September 25, 2001 * * Modifications: - * Albert Cheng, 2004/10/14 - * Verified both signed and unsigned int types. + * Albert Cheng, 2004/10/14 + * Verified both signed and unsigned int types. * *------------------------------------------------------------------------- */ @@ -201,15 +200,15 @@ test_config_ctypes(void) } - + /*------------------------------------------------------------------------- - * Function: test_exit_definitions + * Function: test_exit_definitions * - * Purpose: test the exit macros values + * Purpose: test the exit macros values * - * Return: none (error is fed back via global variable num_errs) + * Return: none (error is fed back via global variable num_errs) * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * October 12, 2009 * * Modifications: @@ -222,9 +221,9 @@ test_exit_definitions(void) /* Verify the EXIT_SUCCESS and EXIT_FAILURE are 0 and 1 respectively. */ /* This should be true for POSIX compliant systems. */ if (EXIT_SUCCESS != 0) \ - TestErrPrintf("Error: EXIT_SUCCESS is %d, should be %d\n", \ - EXIT_SUCCESS, 0); + TestErrPrintf("Error: EXIT_SUCCESS is %d, should be %d\n", \ + EXIT_SUCCESS, 0); if (EXIT_FAILURE != 1) \ - TestErrPrintf("Error: EXIT_FAILURE is %d, should be %d\n", \ - EXIT_FAILURE, 1); + TestErrPrintf("Error: EXIT_FAILURE is %d, should be %d\n", \ + EXIT_FAILURE, 1); } diff --git a/test/tfile.c b/test/tfile.c index 8b66603..8869ba8 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -13,13 +13,12 @@ /*********************************************************** * -* Test program: tfile +* Test program: tfile * * Test the low-level file I/O features. * *************************************************************/ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -31,9 +30,9 @@ * This file needs to access private information from the H5F package. * This file also needs to access the file testing code. */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING -#include "H5Fpkg.h" /* File access */ +#include "H5Fpkg.h" /* File access */ #define H5D_FRIEND /*suppress error about including H5Dpkg */ #include "H5Dpkg.h" /* Dataset access */ @@ -59,46 +58,46 @@ #define BAD_USERBLOCK_SIZE7 (hsize_t)6144 #define F1_USERBLOCK_SIZE (hsize_t)0 -#define F1_OFFSET_SIZE sizeof(haddr_t) -#define F1_LENGTH_SIZE sizeof(hsize_t) -#define F1_SYM_LEAF_K 4 -#define F1_SYM_INTERN_K 16 -#define FILE1 "tfile1.h5" -#define SFILE1 "sys_file1" +#define F1_OFFSET_SIZE sizeof(haddr_t) +#define F1_LENGTH_SIZE sizeof(hsize_t) +#define F1_SYM_LEAF_K 4 +#define F1_SYM_INTERN_K 16 +#define FILE1 "tfile1.h5" +#define SFILE1 "sys_file1" #define REOPEN_FILE "tfile_reopen.h5" #define REOPEN_DSET "dset" #define F2_USERBLOCK_SIZE (hsize_t)512 -#define F2_OFFSET_SIZE 8 -#define F2_LENGTH_SIZE 8 -#define F2_SYM_LEAF_K 8 -#define F2_SYM_INTERN_K 32 +#define F2_OFFSET_SIZE 8 +#define F2_LENGTH_SIZE 8 +#define F2_SYM_LEAF_K 8 +#define F2_SYM_INTERN_K 32 #define F2_RANK 2 #define F2_DIM0 4 #define F2_DIM1 6 #define F2_DSET "dset" -#define FILE2 "tfile2.h5" +#define FILE2 "tfile2.h5" #define F3_USERBLOCK_SIZE (hsize_t)0 -#define F3_OFFSET_SIZE F2_OFFSET_SIZE -#define F3_LENGTH_SIZE F2_LENGTH_SIZE -#define F3_SYM_LEAF_K F2_SYM_LEAF_K -#define F3_SYM_INTERN_K F2_SYM_INTERN_K -#define FILE3 "tfile3.h5" +#define F3_OFFSET_SIZE F2_OFFSET_SIZE +#define F3_LENGTH_SIZE F2_LENGTH_SIZE +#define F3_SYM_LEAF_K F2_SYM_LEAF_K +#define F3_SYM_INTERN_K F2_SYM_INTERN_K +#define FILE3 "tfile3.h5" #define GRP_NAME "/group" #define DSET_NAME "dataset" #define ATTR_NAME "attr" #define TYPE_NAME "type" -#define FILE4 "tfile4.h5" +#define FILE4 "tfile4.h5" #define OBJ_ID_COUNT_0 0 #define OBJ_ID_COUNT_1 1 #define OBJ_ID_COUNT_2 2 #define OBJ_ID_COUNT_3 3 #define OBJ_ID_COUNT_4 4 -#define OBJ_ID_COUNT_6 6 +#define OBJ_ID_COUNT_6 6 #define OBJ_ID_COUNT_8 8 #define GROUP1 "Group1" @@ -128,22 +127,22 @@ #define FSP_SIZE1G 1024*1024*1024 /* File space page size */ /* Declaration for test_libver_macros2() */ -#define FILE6 "tfile6.h5" /* Test file */ +#define FILE6 "tfile6.h5" /* Test file */ /* Declaration for test_get_obj_ids() */ -#define FILE7 "tfile7.h5" /* Test file */ -#define NGROUPS 2 -#define NDSETS 4 +#define FILE7 "tfile7.h5" /* Test file */ +#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[] = { - "filespace_1_6.h5", /* 1.6 HDF5 file */ - "filespace_1_8.h5" /* 1.8 HDF5 file */ +const char *OLD_FILENAME[] = { + "filespace_1_6.h5", /* 1.6 HDF5 file */ + "filespace_1_8.h5" /* 1.8 HDF5 file */ }; /* Files created in 1.10.0 release --used in test_filespace_1.10.0_compatible() */ /* These files are copied from release 1.10.0 tools/h5format_convert/testfiles */ -const char *OLD_1_10_0_FILENAME[] = { +const char *OLD_1_10_0_FILENAME[] = { "h5fc_ext1_i.h5", /* 0 */ "h5fc_ext1_f.h5", /* 1 */ "h5fc_ext2_if.h5", /* 2 */ @@ -179,13 +178,13 @@ static void test_libver_bounds_datatype(hid_t fapl); static void test_libver_bounds_datatype_check(hid_t fapl, hid_t tid); static void test_libver_bounds_attributes(hid_t fapl); -#define FILE8 "tfile8.h5" /* Test file */ +#define FILE8 "tfile8.h5" /* Test file */ -#define DSET_NULL "DSET_NULL" -#define DSET "DSET" -#define DSETA "DSETA" -#define DSETB "DSETB" -#define DSETC "DSETC" +#define DSET_NULL "DSET_NULL" +#define DSET "DSET" +#define DSETA "DSETA" +#define DSETB "DSETB" +#define DSETC "DSETC" static void create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *); @@ -207,14 +206,14 @@ static void test_rw_noupdate(void); static void test_file_create(void) { - hid_t fid1, fid2, fid3; /* HDF5 File IDs */ - hid_t tmpl1, tmpl2; /*file creation templates */ - hsize_t ublock; /*sizeof userblock */ - size_t parm; /*file-creation parameters */ - size_t parm2; /*file-creation parameters */ - unsigned iparm; - unsigned iparm2; - herr_t ret; /*generic return value */ + hid_t fid1, fid2, fid3; /* HDF5 File IDs */ + hid_t tmpl1, tmpl2; /*file creation templates */ + hsize_t ublock; /*sizeof userblock */ + size_t parm; /*file-creation parameters */ + size_t parm2; /*file-creation parameters */ + unsigned iparm; + unsigned iparm2; + herr_t ret; /*generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Low-Level File Creation I/O\n")); @@ -466,7 +465,7 @@ test_file_create(void) /* Close third file */ ret = H5Fclose(fid3); CHECK(ret, FAIL, "H5Fclose"); -} /* test_file_create() */ +} /* test_file_create() */ /**************************************************************** ** @@ -476,17 +475,17 @@ test_file_create(void) static void test_file_open(void) { - hid_t fid1, fid2; /*HDF5 File IDs */ + hid_t fid1, fid2; /*HDF5 File IDs */ hid_t did; /*dataset ID */ hid_t fapl_id; /*file access property list ID */ - hid_t tmpl1; /*file creation templates */ - hsize_t ublock; /*sizeof user block */ - size_t parm; /*file-creation parameters */ - size_t parm2; /*file-creation parameters */ - unsigned iparm; - unsigned iparm2; - unsigned intent; - herr_t ret; /*generic return value */ + hid_t tmpl1; /*file creation templates */ + hsize_t ublock; /*sizeof user block */ + size_t parm; /*file-creation parameters */ + size_t parm2; /*file-creation parameters */ + unsigned iparm; + unsigned iparm2; + unsigned intent; + herr_t ret; /*generic return value */ /* * Test single file open @@ -650,7 +649,7 @@ test_file_close(void) { hid_t fid1, fid2; hid_t fapl_id, access_id; - hid_t dataset_id, group_id1, group_id2, group_id3; + hid_t dataset_id, group_id1, group_id2, group_id3; H5F_close_degree_t fc_degree; herr_t ret; @@ -840,7 +839,7 @@ test_file_close(void) /* Create more new files and test object count and ID list functions */ test_obj_count_and_id(fid1, fid2, dataset_id, group_id1, - group_id2, group_id3); + group_id2, group_id3); /* Close first open */ ret = H5Fclose(fid1); @@ -896,22 +895,22 @@ test_file_close(void) CHECK(ret, FAIL, "H5Pget_fclose_degree"); switch(fc_degree) { - case H5F_CLOSE_STRONG: - /* Close first open */ - ret = H5Fclose(fid1); - CHECK(ret, FAIL, "H5Fclose"); - /* Close second open */ - ret = H5Fclose(fid2); - CHECK(ret, FAIL, "H5Fclose"); - break; - case H5F_CLOSE_SEMI: + case H5F_CLOSE_STRONG: /* Close first open */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); - ret = H5Dclose(dataset_id); + /* Close second open */ + ret = H5Fclose(fid2); + CHECK(ret, FAIL, "H5Fclose"); + break; + case H5F_CLOSE_SEMI: + /* Close first open */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Dclose(dataset_id); CHECK(ret, FAIL, "H5Dclose"); ret = H5Gclose(group_id1); - CHECK(ret, FAIL, "H5Gclose"); + CHECK(ret, FAIL, "H5Gclose"); ret = H5Gclose(group_id2); CHECK(ret, FAIL, "H5Gclose"); ret = H5Gclose(group_id3); @@ -919,8 +918,8 @@ test_file_close(void) /* Close second open */ ret = H5Fclose(fid2); CHECK(ret, FAIL, "H5Fclose"); - break; - case H5F_CLOSE_WEAK: + break; + case H5F_CLOSE_WEAK: /* Close first open */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -935,7 +934,7 @@ test_file_close(void) CHECK(ret, FAIL, "H5Gclose"); ret = H5Gclose(group_id3); CHECK(ret, FAIL, "H5Gclose"); - break; + break; case H5F_CLOSE_DEFAULT: default: CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree"); @@ -957,10 +956,10 @@ test_file_close(void) ****************************************************************/ static void create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1, - hid_t *ret_gid2, hid_t *ret_gid3) + hid_t *ret_gid2, hid_t *ret_gid3) { - ssize_t oid_count; - herr_t ret; + ssize_t oid_count; + herr_t ret; /* Check reference counts of file IDs and opened object IDs. * The verification is hard-coded. If in any case, this testing @@ -1062,7 +1061,7 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1, /**************************************************************** ** ** test_get_obj_ids(): Test the bug and the fix for Jira 8528. -** H5Fget_obj_ids overfilled the list of +** H5Fget_obj_ids overfilled the list of ** object IDs by one. This is an enhancement ** for test_obj_count_and_id(). ** @@ -1109,14 +1108,14 @@ test_get_obj_ids(void) oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t)); CHECK_PTR(oid_list, "HDcalloc"); - /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here. - * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in + /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here. + * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in * (oid_list_size) */ ret_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, (size_t)oid_list_size, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); VERIFY(ret_count, oid_list_size, "H5Fget_obj_count"); - /* Close all object IDs on the list except the file ID. The first ID is supposed to be file ID according + /* Close all object IDs on the list except the file ID. The first ID is supposed to be file ID according * to the library design */ for(i = 0; i< ret_count; i++) { if(fid != oid_list[i]) { @@ -1131,7 +1130,7 @@ test_get_obj_ids(void) CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, NGROUPS + 2, "H5Fget_obj_count"); - /* Get the IDs of the left opend objects */ + /* Get the IDs of the left opend objects */ ret_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, (size_t)oid_list_size, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); VERIFY(ret_count, oid_list_size, "H5Fget_obj_count"); @@ -1143,14 +1142,14 @@ test_get_obj_ids(void) CHECK(ret, FAIL, "H5Oclose"); } } - + H5Sclose(filespace); H5Fclose(fid); HDfree(oid_list); - /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works - * when the file is closed first */ + /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works + * when the file is closed first */ fid = H5Fopen(FILE7, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); @@ -1193,7 +1192,7 @@ static void test_get_file_id(void) { hid_t fid, fid2, fid3; - hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id; + hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id; hid_t plist; hsize_t dims[F2_RANK]; unsigned intent; @@ -1351,7 +1350,7 @@ check_file_id(hid_t fid, hid_t object_id) ****************************************************************/ static void test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, - hid_t gid2, hid_t gid3) + hid_t gid2, hid_t gid3) { hid_t fid3, fid4; ssize_t oid_count, ret_count; @@ -1392,7 +1391,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_8, "H5Fget_obj_count"); - + if(oid_count > 0) { hid_t *oid_list; @@ -1400,8 +1399,8 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, if(oid_list != NULL) { int i; - ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); - CHECK(ret_count, FAIL, "H5Fget_obj_ids"); + ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); + CHECK(ret_count, FAIL, "H5Fget_obj_ids"); for(i = 0; i < oid_count; i++) { H5I_type_t id_type; @@ -1515,11 +1514,11 @@ test_file_perm(void) /**************************************************************** ** ** test_file_perm2(): low-level file test routine. -** This test verifies that no object can be created in a +** This test verifies that no object can be created in a ** file that is opened for read-only. ** *****************************************************************/ -static void +static void test_file_perm2(void) { hid_t file; /* File opened with read-write permission */ @@ -1529,7 +1528,7 @@ test_file_perm2(void) hid_t dset; /* Dataset ID */ hid_t type; /* Datatype ID */ hid_t attr; /* Attribute ID */ - herr_t ret; + herr_t ret; /* Output message about test being performed */ MESSAGE(5, ("Testing Low-Level File Permissions again\n")); @@ -2121,35 +2120,35 @@ test_file_double_dataset_open(void) /**************************************************************** ** ** test_file_double_file_dataset_open(): -** This test checks multi-opens of files & datasets: -** It simulates the multi-thread test program from DLS -** which exposes the file pointer segmentation fault failure. -** NOTE: The order on when the files and datasets are open/close -** is important. +** This test checks multi-opens of files & datasets: +** It simulates the multi-thread test program from DLS +** which exposes the file pointer segmentation fault failure. +** NOTE: The order on when the files and datasets are open/close +** is important. ** *****************************************************************/ static void test_file_double_file_dataset_open(hbool_t new_format) { - hid_t fapl = -1; /* File access property list */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t did1 = -1, did2 = -1; /* Dataset IDs */ - hid_t sid1 = -1, sid2 = -1; /* Dataspace IDs */ - hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ - hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */ - hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */ - hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */ - hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */ - hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */ - hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes for v2 B-tree index */ - hsize_t chunks[1] = {2}, chunks2[2] = {4, 5}; /* Chunk dimension sizes */ + hid_t fapl = -1; /* File access property list */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t fid1 = -1, fid2 = -1; /* File IDs */ + hid_t did1 = -1, did2 = -1; /* Dataset IDs */ + hid_t sid1 = -1, sid2 = -1; /* Dataspace IDs */ + hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ + hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */ + hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */ + hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */ + hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */ + hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */ + hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes for v2 B-tree index */ + hsize_t chunks[1] = {2}, chunks2[2] = {4, 5}; /* Chunk dimension sizes */ hsize_t size; /* File size */ - const char* data[] = {"String 1", "String 2", "String 3", "String 4", "String 5"}; /* Input Data */ - const char* e_data[] = {"String 1", "String 2", "String 3", "String 4", "String 5", "String 6", "String 7"}; /* Input Data */ - char* buffer[5]; /* Output buffer */ - int wbuf[4] = {1, 2, 3, 4}; /* Input data */ - herr_t ret; /* Generic return value */ + const char* data[] = {"String 1", "String 2", "String 3", "String 4", "String 5"}; /* Input Data */ + const char* e_data[] = {"String 1", "String 2", "String 3", "String 4", "String 5", "String 6", "String 7"}; /* Input Data */ + char* buffer[5]; /* Output buffer */ + int wbuf[4] = {1, 2, 3, 4}; /* Input data */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing double file and dataset open/close\n")); @@ -2252,8 +2251,8 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); - /* - * Scenario 1 + /* + * Scenario 1 */ /* First file open */ @@ -2308,8 +2307,8 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Tclose(tid2); CHECK(ret, FAIL, "H5Tclose"); - /* - * Scenario 2 + /* + * Scenario 2 */ /* First file open */ @@ -2373,7 +2372,7 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Tclose(tid2); CHECK(ret, FAIL, "H5Tclose"); - /* + /* * Scenario 3 */ @@ -2417,10 +2416,10 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Fclose(fid2); CHECK(ret, FAIL, "H5Fclose"); - /* + /* * Scenario 4 * --trigger H5AC_protect: Assertion `f->shared' failed - * from second call to H5Dset_extent->...H5D__earray_idx_remove->H5EA_get...H5EA__iblock_protect...H5AC_protect + * from second call to H5Dset_extent->...H5D__earray_idx_remove->H5EA_get...H5EA__iblock_protect...H5AC_protect */ /* First file open */ fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); @@ -2729,9 +2728,9 @@ cal_chksum(const char *file, uint32_t *chksum) ** This test checks to ensure that opening and closing a file ** with read/write permissions does not write anything to the ** file if the file does not change. -** Due to the implementation of file locking (status_flags in -** the superblock is used), this test is changed to use checksum -** instead of timestamp to verify the file is not changed. +** Due to the implementation of file locking (status_flags in +** the superblock is used), this test is changed to use checksum +** instead of timestamp to verify the file is not changed. ** ** Programmer: Vailin Choi; July 2013 ** @@ -2740,8 +2739,8 @@ static void test_rw_noupdate(void) { herr_t ret; /* Generic return value */ - hid_t fid; /* File ID */ - uint32_t chksum1, chksum2; /* Checksum value */ + hid_t fid; /* File ID */ + uint32_t chksum1, chksum2; /* Checksum value */ /* Output message about test being performed */ MESSAGE(5, ("Testing to verify that nothing is written if nothing is changed.\n")); @@ -3130,8 +3129,8 @@ test_userblock_alignment(void) ** test_userblock_alignment_paged(): low-level file test routine. ** This test checks to ensure that files with both a userblock and ** alignment interact properly: -** -- alignment via H5Pset_alignment -** -- alignment via paged aggregation +** -- alignment via H5Pset_alignment +** -- alignment via paged aggregation ** ** Programmer: Vailin Choi; March 2013 ** @@ -3147,14 +3146,14 @@ test_userblock_alignment_paged(void) /* Output message about test being performed */ MESSAGE(5, ("Testing interaction between userblock and alignment (via paged aggregation and H5Pset_alignment)\n")); - /* + /* * Case 1: * Userblock size = 0 * Alignment in use = 4096 * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 4096 * Outcome: - * Should succeed: - * userblock is 0 and alignment != 0 + * Should succeed: + * userblock is 0 and alignment != 0 */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3185,14 +3184,14 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 2a: * Userblock size = 1024 * Alignment in use = 512 - * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 + * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 * H5Pset_alignment() is 3 * Outcome: - * Should succeed: + * Should succeed: * userblock (1024) is integral mult. of alignment (512) */ /* Create file creation property list with user block */ @@ -3221,16 +3220,16 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 2b: * Userblock size = 1024 * Alignment in use = 3 - * Strategy = H5F_FILE_SPACE_AGGR; fsp_size = 512 - * (via default file creation property) + * Strategy = H5F_FILE_SPACE_AGGR; fsp_size = 512 + * (via default file creation property) * H5Pset_alignment() is 3 * Outcome: - * Should fail at file creation: - * userblock (1024) is non-integral mult. of alignment (3) + * Should fail at file creation: + * userblock (1024) is non-integral mult. of alignment (3) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3257,15 +3256,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 3a: * Userblock size = 512 * Alignment in use = 512 - * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 + * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 * H5Pset_alignment() is 3 * Outcome: - * Should succeed: - * userblock (512) is equal to alignment (512) + * Should succeed: + * userblock (512) is equal to alignment (512) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3295,15 +3294,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 3b: * Userblock size = 512 * Alignment in use = 3 - * Strategy is H5F_FILE_SPACE_NONE; fsp_size = 512 + * Strategy is H5F_FILE_SPACE_NONE; fsp_size = 512 * H5Pset_alignment() is 3 * Outcome: - * Should fail at file creation: - * userblock (512) is non-integral mult. of alignment (3) + * Should fail at file creation: + * userblock (512) is non-integral mult. of alignment (3) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3333,15 +3332,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 4a: * Userblock size = 1024 * Alignment in use = 1023 * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 1023 * H5Pset_alignment() is 16 * Outcome: - * Should fail at file creation: - * userblock (1024) is non-integral multiple of alignment (1023) + * Should fail at file creation: + * userblock (1024) is non-integral multiple of alignment (1023) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3371,15 +3370,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 4b: * Userblock size = 1024 * Alignment in use = 16 * Strategy is H5F_FILE_SPACE_FSM_AGGR; fsp_size = 1023 * H5Pset_alignment() is 16 * Outcome: - * Should succeed: - * userblock (512) is integral multiple of alignment (16) + * Should succeed: + * userblock (512) is integral multiple of alignment (16) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3409,15 +3408,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 5a: * Userblock size = 512 * Alignment in use = 1024 * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 1024 * H5Pset_alignment() is 16 * Outcome: - * Should fail at file creation: - * userblock (512) is less than alignment (1024) + * Should fail at file creation: + * userblock (512) is less than alignment (1024) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3447,7 +3446,7 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 5b: * Userblock size = 512 * Alignment in use = 16 @@ -3455,7 +3454,7 @@ test_userblock_alignment_paged(void) * H5Pset_alignment() is 16 * Outcome: * Should succed: - * userblock (512) is integral multiple of alignment (16) + * userblock (512) is integral multiple of alignment (16) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3485,16 +3484,16 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 6: * Userblock size = 512 * Alignment in use = 512 * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 * H5Pset_alignment() is 3 - * Reopen the file; H5Pset_alignment() is 1024 + * Reopen the file; H5Pset_alignment() is 1024 * Outcome: * Should succed: - * Userblock (512) is the same as alignment (512); + * Userblock (512) is the same as alignment (512); * The H5Pset_alignment() calls have no effect */ /* Create file creation property list with user block */ @@ -3538,19 +3537,19 @@ test_userblock_alignment_paged(void) /**************************************************************** ** ** test_filespace_info(): -** Verify the following public routines retrieve and set file space -** information correctly: -** (1) H5Pget/set_file_space_strategy(): -** Retrieve and set file space strategy, persisting free-space, -** and free-space section threshold as specified -** (2) H5Pget/set_file_space_page_size(): -** Retrieve and set the page size for paged aggregation +** Verify the following public routines retrieve and set file space +** information correctly: +** (1) H5Pget/set_file_space_strategy(): +** Retrieve and set file space strategy, persisting free-space, +** and free-space section threshold as specified +** (2) H5Pget/set_file_space_page_size(): +** Retrieve and set the page size for paged aggregation ** ****************************************************************/ static void test_filespace_info(const char *env_h5_drvr) { - hid_t fid; /* File IDs */ + hid_t fid; /* File IDs */ hid_t fapl, new_fapl; /* File access property lists */ hid_t fcpl, fcpl1, fcpl2; /* File creation property lists */ H5F_fspace_strategy_t strategy; /* File space strategy */ @@ -3563,7 +3562,7 @@ test_filespace_info(const char *env_h5_drvr) hsize_t fsp_size; /* File space page size */ char filename[FILENAME_LEN]; /* Filename to use */ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ - herr_t ret; /* Return value */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing file creation public routines: H5Pget/set_file_space_strategy & H5Pget/set_file_space_page_size\n")); @@ -3581,14 +3580,14 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); CHECK(ret, FAIL, "H5Pset_libver_bounds"); - /* + /* * Case (1) * Check file space information from a default file creation property list. * Values expected: - * strategy--H5F_FILE_SPACE_AGGR - * persist--FALSE - * threshold--1 - * file space page size--4096 + * strategy--H5F_FILE_SPACE_AGGR + * persist--FALSE + * threshold--1 + * file space page size--4096 */ /* Create file creation property list template */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3611,7 +3610,7 @@ test_filespace_info(const char *env_h5_drvr) /* Close property list */ H5Pclose(fcpl); - /* + /* * Case (2) * File space page size has a minimum size of 512. * Setting value less than 512 will return an error; @@ -3660,14 +3659,14 @@ test_filespace_info(const char *env_h5_drvr) /* Close property list */ H5Pclose(fcpl); - /* + /* * Case (3) * Check file space information when creating a file with default properties. * Values expected: - * strategy--H5F_FILE_SPACE_AGGR - * persist--FALSE - * threshold--1 - * file space page size--4096 + * strategy--H5F_FILE_SPACE_AGGR + * persist--FALSE + * threshold--1 + * file space page size--4096 */ /* Create a file with default file creation and access property lists */ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -3697,15 +3696,15 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pclose(fcpl1); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case (4) * Check file space information when creating a file with the * latest library format and default properties. * Values expected: - * strategy--H5F_FILE_SPACE_AGGR - * persist--FALSE - * threshold--1 - * file space page size--4096 + * strategy--H5F_FILE_SPACE_AGGR + * persist--FALSE + * threshold--1 + * file space page size--4096 */ /* Create a file with the latest library format */ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, new_fapl); @@ -3735,21 +3734,21 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pclose(fcpl1); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case (5) * Check file space information with the following combinations: - * Create file with -- - * New or old format - * Persist or not persist free-space - * Different sizes for free-space section threshold (0 to 10) - * The four file space strategies: - * H5F_FSPACE_STRATEGY_FSM_AGGR, H5F_FSPACE_STRATEGY_PAGE, + * Create file with -- + * New or old format + * Persist or not persist free-space + * Different sizes for free-space section threshold (0 to 10) + * The four file space strategies: + * H5F_FSPACE_STRATEGY_FSM_AGGR, H5F_FSPACE_STRATEGY_PAGE, * H5F_FSPACE_STRATEGY_AGGR, H5F_FSPACE_STRATEGY_NONE - * File space page size: set to 512 - * + * File space page size: set to 512 + * */ for(new_format = FALSE; new_format <= TRUE; new_format++) { - hid_t my_fapl; + hid_t my_fapl; /* Set the FAPL for the type of format */ if(new_format) { @@ -3783,7 +3782,7 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE512); CHECK(ret, FAIL, "H5Pset_file_space_strategy"); - + /* Retrieve file space information */ ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold); CHECK(ret, FAIL, "H5Pget_file_space_strategy"); @@ -3942,13 +3941,13 @@ error: ** returned by the public routine H5Fget_freespace(). ** ** Modifications: -** Vailin Choi; July 2012 -** Remove datasets in reverse order so that all file spaces are shrunk. -** (A change due to H5FD_FLMAP_DICHOTOMY.) +** Vailin Choi; July 2012 +** Remove datasets in reverse order so that all file spaces are shrunk. +** (A change due to H5FD_FLMAP_DICHOTOMY.) ** -** Vailin Choi; Dec 2012 -** Add changes due to paged aggregation via new format: -** the amount of freespace is different. +** Vailin Choi; Dec 2012 +** Add changes due to paged aggregation via new format: +** the amount of freespace is different. ** *****************************************************************/ static void @@ -4088,9 +4087,9 @@ test_file_freespace(const char *env_h5_drvr) /* Check that there is the right amount of free space in the file */ free_space = H5Fget_freespace(file); CHECK(free_space, FAIL, "H5Fget_freespace"); - if(new_format) + if(new_format) VERIFY(free_space, expected_fs_del, "H5Fget_freespace"); - else + else VERIFY(free_space, expected_fs_del, "H5Fget_freespace"); /* Close file */ @@ -4114,7 +4113,7 @@ test_file_freespace(const char *env_h5_drvr) ** ** test_sects_freespace(): ** This routine checks free-space section information for the -** file as returned by the public routine H5Fget_free_sections(). +** file as returned by the public routine H5Fget_free_sections(). ** *****************************************************************/ static void @@ -4136,9 +4135,9 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) H5F_sect_info_t all_sect_info[15]; /* Array to hold free-space information for all types of data */ H5F_sect_info_t meta_sect_info[15]; /* Array to hold free-space information for metadata */ H5F_sect_info_t raw_sect_info[15]; /* Array to hold free-space information for raw data */ - hsize_t total = 0; /* sum of the free-space section sizes */ + hsize_t total = 0; /* sum of the free-space section sizes */ hsize_t tmp_tot = 0; /* Sum of the free-space section sizes */ - hsize_t last_size; /* Size of last free-space section */ + hsize_t last_size; /* Size of last free-space section */ hsize_t dims[1]; /* Dimension sizes */ unsigned u; /* Local index variable */ H5FD_mem_t type; @@ -4177,7 +4176,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) } else { ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1); CHECK(ret, FAIL, "H5Pget_file_space_strategy"); - } + } /* Create the file */ file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); @@ -4301,7 +4300,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) HDmemset(meta_sect_info, 0, sizeof(meta_sect_info)); if(multi_vfd) { - hssize_t ntmp; + hssize_t ntmp; for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) { if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP) @@ -4353,7 +4352,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) CHECK(fcpl, FAIL, "H5Pclose"); h5_clean_files(FILESPACE_NAME, fapl); - } + } } /* end test_sects_freespace() */ @@ -4361,29 +4360,29 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) /**************************************************************** ** ** test_filespace_compatible(): -** Verify that the trunk with the latest file space management -** can open, read and modify 1.6 HDF5 file and 1.8 HDF5 file. -** Also verify the correct file space handling information -** and the amount of free space. +** Verify that the trunk with the latest file space management +** can open, read and modify 1.6 HDF5 file and 1.8 HDF5 file. +** Also verify the correct file space handling information +** and the amount of free space. ** ****************************************************************/ 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 */ - 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 */ - hbool_t persist; /* Persist free-space or not */ - hsize_t threshold; /* Free-space section threshold */ - H5F_fspace_strategy_t strategy; /* File space handling strategy */ - herr_t ret; /* Return value */ + 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 */ + hbool_t persist; /* Persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ + H5F_fspace_strategy_t strategy; /* File space handling strategy */ + 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")); @@ -4392,31 +4391,31 @@ 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); - CHECK(fd_old, FAIL, "HDopen"); - fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); - CHECK(fd_new, FAIL, "HDopen"); + fd_old = HDopen(filename, O_RDONLY); + CHECK(fd_old, FAIL, "HDopen"); + fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); + CHECK(fd_new, FAIL, "HDopen"); - /* Copy data */ + /* 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 */ - /* Close the files */ - ret = HDclose(fd_old); - CHECK(ret, FAIL, "HDclose"); - ret = HDclose(fd_new); - CHECK(ret, FAIL, "HDclose"); + /* Close the files */ + ret = HDclose(fd_old); + CHECK(ret, FAIL, "HDclose"); + ret = HDclose(fd_new); + CHECK(ret, FAIL, "HDclose"); /* Open the temporary test file */ - fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(fid, FAIL, "H5Fopen"); + fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); - /* There should not be any free space in the file */ - free_space = H5Fget_freespace(fid); - CHECK(free_space, FAIL, "H5Fget_freespace"); - VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); + /* There should not be any free space in the file */ + free_space = H5Fget_freespace(fid); + 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); @@ -4433,27 +4432,27 @@ test_filespace_compatible(void) VERIFY(persist, FALSE, "H5Pget_file_space_strategy"); VERIFY(threshold, 1, "H5Pget_file_space_strategy"); - /* Generate raw data */ - for(i = 0; i < 100; i++) - check[i] = (int)i; + /* Generate raw data */ + for(i = 0; i < 100; i++) + check[i] = (int)i; - /* Open and read the dataset */ - did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); - ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdbuf); - CHECK(ret, FAIL, "H5Dread"); + /* Open and read the dataset */ + did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dopen"); + ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdbuf); + CHECK(ret, FAIL, "H5Dread"); - /* Verify the data read is correct */ - for(i = 0; i < 100; i++) - VERIFY(rdbuf[i], check[i], "test_compatible"); + /* Verify the data read is correct */ + for(i = 0; i < 100; i++) + VERIFY(rdbuf[i], check[i], "test_compatible"); - /* Close the dataset */ - ret = H5Dclose(did); - CHECK(ret, FAIL, "H5Dclose"); + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); - /* Remove the dataset */ - ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Ldelete"); + /* Remove the dataset */ + ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); /* Close the plist */ ret = H5Pclose(fcpl); @@ -4463,30 +4462,30 @@ test_filespace_compatible(void) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Re-Open the file */ - fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT); - CHECK(fid, FAIL, "H5Fopen"); + /* Re-Open the file */ + fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); - /* The dataset should not be there */ - did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); - VERIFY(did, FAIL, "H5Dopen"); + /* The dataset should not be there */ + did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); + VERIFY(did, FAIL, "H5Dopen"); - /* There should not be any free space in the file */ - free_space = H5Fget_freespace(fid); - CHECK(free_space, FAIL, "H5Fget_freespace"); - VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); + /* There should not be any free space in the file */ + free_space = H5Fget_freespace(fid); + CHECK(free_space, FAIL, "H5Fget_freespace"); + VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); } /* end for */ } /* test_filespace_compatible */ /**************************************************************** ** ** test_filespace_1.10.0_compatible(): -** Verify that the latest file space management can open, read and -** modify 1.10.0 HDF5 files : +** Verify that the latest file space management can open, read and +** modify 1.10.0 HDF5 files : ** h5fc_ext1_i.h5: H5F_FILE_SPACE_ALL, default threshold; has superblock extension but no fsinfo message ** h5fc_ext1_f.h5: H5F_FILE_SPACE_ALL_PERSIST, default threshold; has superblock extension with fsinfo message ** h5fc_ext2_if.h5: H5F_FILE_SPACE_ALL, non-default threshold; has superblock extension with fsinfo message @@ -4500,16 +4499,16 @@ static void test_filespace_1_10_0_compatible(void) { hid_t fid = -1; /* File id */ - hid_t did = -1; /* Dataset id */ + hid_t did = -1; /* Dataset id */ hid_t fcpl; /* File creation property list */ - hbool_t persist; /* Persist free-space or not */ - hsize_t threshold; /* Free-space section threshold */ + hbool_t persist; /* Persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ H5F_fspace_strategy_t strategy; /* File space handling strategy */ - int wbuf[24]; /* Buffer for dataset data */ - int rdbuf[24]; /* Buffer for dataset data */ + int wbuf[24]; /* Buffer for dataset data */ + int rdbuf[24]; /* Buffer for dataset data */ int status; /* Status from copying the existing file */ unsigned i, j; /* Local index variable */ - herr_t ret; /* Return value */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("File space compatibility testing for 1.10.0 files\n")); @@ -4517,7 +4516,7 @@ test_filespace_1_10_0_compatible(void) for(j = 0; j < NELMTS(OLD_1_10_0_FILENAME); j++) { /* Make a copy of the test file */ status = h5_make_local_copy(OLD_1_10_0_FILENAME[j], FILE5); - CHECK(status, FAIL, "h5_make_local_copy"); + CHECK(status, FAIL, "h5_make_local_copy"); /* Open the temporary test file */ fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); @@ -4551,7 +4550,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 1: VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); @@ -4572,7 +4571,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 2: VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); @@ -4593,7 +4592,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 3: VERIFY(strategy, H5F_FSPACE_STRATEGY_NONE, "H5Pget_file_space_strategy"); @@ -4614,7 +4613,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 4: VERIFY(strategy, H5F_FSPACE_STRATEGY_AGGR, "H5Pget_file_space_strategy"); @@ -4635,7 +4634,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 5: VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); VERIFY(persist, H5F_FREE_SPACE_PERSIST_DEF, "H5Pget_file_space_strategy"); @@ -4655,10 +4654,10 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; default: - break; + break; } /* Close the plist */ @@ -4689,7 +4688,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 1: /* Open and read the dataset */ @@ -4706,7 +4705,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 2: /* Open and read the dataset */ @@ -4723,7 +4722,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 3: /* Open and read the dataset */ @@ -4740,7 +4739,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 4: @@ -4758,7 +4757,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 5: @@ -4776,10 +4775,10 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; default: - break; + break; } /* Close the file */ @@ -4792,36 +4791,36 @@ test_filespace_1_10_0_compatible(void) /**************************************************************** ** ** test_filespace_round_compatible(): -** Verify that the trunk can open, read and modify these files-- -** 1) They are initially created (via gen_filespace.c) in the trunk -** with combinations of file space strategies, default/non-default -** threshold, and file spacing paging enabled/disbled. -** The library creates the file space info message with -** "mark if unknown" in these files. -** 2) They are copied to the 1.8 branch, and are opened/read/modified -** there via test_filespace_compatible() in test/tfile.c. -** The 1.8 library marks the file space info message as "unknown" -** in these files. -** 3) They are then copied back from the 1.8 branch to the trunk for -** compatibility testing via this routine. -** 4) Upon encountering the file space info message which is marked -** as "unknown", the library will use the default file space management -** from then on: non-persistent free-space managers, default threshold, -** and non-paging file space. +** Verify that the trunk can open, read and modify these files-- +** 1) They are initially created (via gen_filespace.c) in the trunk +** with combinations of file space strategies, default/non-default +** threshold, and file spacing paging enabled/disbled. +** The library creates the file space info message with +** "mark if unknown" in these files. +** 2) They are copied to the 1.8 branch, and are opened/read/modified +** there via test_filespace_compatible() in test/tfile.c. +** The 1.8 library marks the file space info message as "unknown" +** in these files. +** 3) They are then copied back from the 1.8 branch to the trunk for +** compatibility testing via this routine. +** 4) Upon encountering the file space info message which is marked +** as "unknown", the library will use the default file space management +** from then on: non-persistent free-space managers, default threshold, +** and non-paging file space. ** ****************************************************************/ static void test_filespace_round_compatible(void) { - hid_t fid = -1; /* File id */ - hid_t fcpl = -1; /* File creation property list ID */ - unsigned j; /* Local index variable */ - H5F_fspace_strategy_t strategy; /* File space strategy */ - hbool_t persist; /* Persist free-space or not */ - hsize_t threshold; /* Free-space section threshold */ - hssize_t free_space; /* Amount of free space in the file */ + hid_t fid = -1; /* File id */ + hid_t fcpl = -1; /* File creation property list ID */ + unsigned j; /* Local index variable */ + H5F_fspace_strategy_t strategy; /* File space strategy */ + hbool_t persist; /* Persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ + hssize_t free_space; /* Amount of free space in the file */ int status; /* Status from copying the existing file */ - herr_t ret; /* Return value */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("File space compatibility testing for files from trunk to 1_8 to trunk\n")); @@ -4829,31 +4828,31 @@ test_filespace_round_compatible(void) for(j = 0; j < NELMTS(FSPACE_FILENAMES); j++) { /* Make a copy of the test file */ status = h5_make_local_copy(FSPACE_FILENAMES[j], FILE5); - CHECK(status, FAIL, "h5_make_local_copy"); - - /* Open the temporary test file */ - fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(fid, FAIL, "H5Fopen"); - - /* Get the file's creation property list */ - fcpl = H5Fget_create_plist(fid); - CHECK(fcpl, FAIL, "H5Fget_create_plist"); - - ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold); - CHECK(ret, FAIL, "H5Pget_file_space_strategy"); - VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); - VERIFY(persist, FALSE, "H5Pget_file_space_strategy"); - VERIFY(threshold, 1, "H5Pget_file_space_strategy"); - - /* There should not be any free space in the file */ - free_space = H5Fget_freespace(fid); - CHECK(free_space, FAIL, "H5Fget_freespace"); - VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); - - /* Closing */ - ret = H5Fclose(fid); - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Fclose"); + CHECK(status, FAIL, "h5_make_local_copy"); + + /* Open the temporary test file */ + fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + /* Get the file's creation property list */ + fcpl = H5Fget_create_plist(fid); + CHECK(fcpl, FAIL, "H5Fget_create_plist"); + + ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold); + CHECK(ret, FAIL, "H5Pget_file_space_strategy"); + VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); + VERIFY(persist, FALSE, "H5Pget_file_space_strategy"); + VERIFY(threshold, 1, "H5Pget_file_space_strategy"); + + /* There should not be any free space in the file */ + free_space = H5Fget_freespace(fid); + CHECK(free_space, FAIL, "H5Fget_freespace"); + VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); + + /* Closing */ + ret = H5Fclose(fid); + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Fclose"); } /* end for */ } /* test_filespace_round_compatible */ @@ -4953,14 +4952,14 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, CHECK(ret, FAIL, "H5Pclose"); } /* end test_libver_bounds_real() */ - + /*------------------------------------------------------------------------- * Function: test_libver_bounds_open * * Purpose: Tests opening latest file with various low/high bounds. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * *------------------------------------------------------------------------- */ @@ -5065,22 +5064,22 @@ test_libver_bounds_open(void) CHECK(ret, FAIL, "H5Pget_libver_bounds"); VERIFY(new_low, H5F_LIBVER_LATEST, "Low bound should be upgraded to H5F_LIBVER_LATEST"); - ret = H5Pclose(new_fapl); + ret = H5Pclose(new_fapl); CHECK(ret, FAIL, "H5Pclose"); - ret = H5Fclose(file); + ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); } /* for low */ /* Close dataspace and property lists */ ret = H5Sclose(space); CHECK(ret, FAIL, "H5Sclose"); - ret = H5Pclose(dcpl); + ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - ret = H5Pclose(fapl); + ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); } /* end test_libver_bounds_open() */ - + /**************************************************************** ** ** test_libver_bounds(): @@ -5112,7 +5111,7 @@ test_libver_bounds(void) ** (4) (v18, v110) ** (5) (v110, v110) ** -** For each pair of setting in fapl, verify format versions with the following +** For each pair of setting in fapl, verify format versions with the following ** six tests: ** (1) test_libver_bounds_super(fapl): superblock versions ** (2) test_libver_bounds_obj(fapl): object header versions @@ -5139,7 +5138,7 @@ test_libver_bounds_low_high(void) /* Loop through all the combinations of low/high version bounds */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - + H5E_BEGIN_TRY { /* Set the low/high version bounds */ ret = H5Pset_libver_bounds(fapl, low, high); @@ -5179,15 +5178,15 @@ test_libver_bounds_low_high(void) ** ** test_libver_bounds_super(): ** Verify superblock version with the following two tests: -** (1) test_libver_bounds_super_create(): -** --when creating a file with the input fapl and the fcpl +** (1) test_libver_bounds_super_create(): +** --when creating a file with the input fapl and the fcpl ** that has the following feature enabled: ** (A) default fcpl ** (B) fcpl with v1-btee K value enabled ** (C) fcpl with shared messages enabled ** (D) fcpl with persistent free-space manager enabled ** -** (2) test_libver_bounds_super_open(): +** (2) test_libver_bounds_super_open(): ** --when opening a file which is created with the input fapl ** and the fcpl setting as #A to #D above. ** @@ -5205,7 +5204,7 @@ test_libver_bounds_super(hid_t fapl) fcpl = H5Pcreate(H5P_FILE_CREATE); CHECK(fcpl, FAIL, "H5Pcreate"); - /* Verify superblock version when creating a file with input fapl, + /* Verify superblock version when creating a file with input fapl, fcpl #A and with/without SWMR access */ test_libver_bounds_super_create(fapl, fcpl, TRUE); test_libver_bounds_super_create(fapl, fcpl, FALSE); @@ -5249,7 +5248,7 @@ test_libver_bounds_super(hid_t fapl) ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - /* Verify superblock version when creating a file with input fapl, + /* Verify superblock version when creating a file with input fapl, fcpl #C and with/without SWMR access */ test_libver_bounds_super_create(fapl, fcpl, TRUE); test_libver_bounds_super_create(fapl, fcpl, FALSE); @@ -5329,11 +5328,11 @@ test_libver_bounds_super(hid_t fapl) static void test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) { - hid_t fid = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file pointer */ + hid_t fid = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file pointer */ H5F_libver_t low, high; /* Low and high bounds */ - hbool_t ok; /* The result is ok or not */ - herr_t ret; /* The return value */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* The return value */ /* Try to create the file */ H5E_BEGIN_TRY { @@ -5477,13 +5476,13 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) static void test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) { - hid_t fid = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file pointer */ + hid_t fid = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file pointer */ hid_t new_fapl = -1; /* File access property list */ - unsigned super_vers; /* Superblock version */ + unsigned super_vers; /* Superblock version */ H5F_libver_t low, high; /* Low and high bounds */ - hbool_t ok; /* The result is ok or not */ - herr_t ret; /* Return value */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* Return value */ /* Create the file with the input fcpl and fapl */ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); @@ -5594,7 +5593,7 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) ** Close the file. ** ** (c) Reopen the same file in (b) with a new fapl. -** The new fapl is set to the 5 pairs of low/high +** The new fapl is set to the 5 pairs of low/high ** bounds in a "for" loop. For each setting in fapl: ** --Create a group in the file ** --Verify the group's object header version @@ -5670,7 +5669,7 @@ test_libver_bounds_obj(hid_t fapl) CHECK(new_fapl, FAIL, "H5Pcreate"); /* Loop through all the combinations of low/high bounds in new_fapl */ - /* Open the file with the fapl; create a group and verify the + /* Open the file with the fapl; create a group and verify the object header version, then delete the group and close the file.*/ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { @@ -5746,13 +5745,13 @@ test_libver_bounds_obj(hid_t fapl) ** Create the following two datasets: ** --A contiguous dataset ** --A chunked dataset with "no filter edge chunks" -** For both datasets, verify the versions for the layout, +** For both datasets, verify the versions for the layout, ** fill value and filter pipeline messages. ** Close the file. ** -** (b) Create a new fapl that is set to the 5 pairs of low/high -** bounds in a "for" loop. For each pair of setting in the -** new fapl: +** (b) Create a new fapl that is set to the 5 pairs of low/high +** bounds in a "for" loop. For each pair of setting in the +** new fapl: ** --Open the same file in (a) with the fapl ** --Create a chunked dataset with 2 unlimited ** dimensions @@ -5803,7 +5802,7 @@ test_libver_bounds_dataset(hid_t fapl) /* Verify version for layout and fill value messages */ if(low == H5F_LIBVER_EARLIEST) { /* For layout message: the earliest version the library will set is 3 */ - /* For fill value message: the earliest version the library will set is 2 */ + /* For fill value message: the earliest version the library will set is 2 */ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds"); VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds"); } else { @@ -5823,7 +5822,7 @@ test_libver_bounds_dataset(hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Set up dataspace and dcpl for creating a chunked dataset - with "no filter edge chunks" enabled. + with "no filter edge chunks" enabled. This will result in a version 4 layout message */ sid = H5Screate_simple(2, fix_dims2, NULL); CHECK(sid, FAIL, "H5Screate_simple"); @@ -5866,12 +5865,12 @@ test_libver_bounds_dataset(hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Create a default file access property list which is used + /* Create a default file access property list which is used to open the file in the 'for' loop */ new_fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(new_fapl, FAIL, "H5Pcreate"); - /* Set up dataspace and dcpl for creating a chunked dataset with + /* Set up dataspace and dcpl for creating a chunked dataset with 2 unlimited dimensions in the 'for' loop */ sid = H5Screate_simple(2, dims2, max_dims2); CHECK(sid, FAIL, "H5Screate_simple"); @@ -5915,7 +5914,7 @@ test_libver_bounds_dataset(hid_t fapl) /* Also verify the chunk indexing type */ if(f->shared->low_bound == H5F_LIBVER_EARLIEST) { /* For layout message: the earliest version the library will set is 3 */ - /* For fill value message: the earliest version the library will set is 2 */ + /* For fill value message: the earliest version the library will set is 2 */ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds"); VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds"); } else { @@ -5975,7 +5974,7 @@ test_libver_bounds_dataset(hid_t fapl) ** Close the file. ** ** (b) Create a new fapl that is set to the 5 pairs of low/high -** bounds in a "for" loop. For each pair of setting in the +** bounds in a "for" loop. For each pair of setting in the ** new fapl: ** --Open the same file in (a) with the fapl ** --Create a chunked dataset, a compact dataset and @@ -6228,7 +6227,7 @@ static void test_libver_bounds_datatype(hid_t fapl) { hid_t tid = -1, tid_enum = -1, tid_array = -1; /* Datatype IDs */ - hid_t tid_compound = -1, tid_vlen = -1; /* Datatype IDs */ + hid_t tid_compound = -1, tid_vlen = -1; /* Datatype IDs */ int enum_value; /* Value for enum datatype */ typedef struct s1 { /* Data structure for compound datatype */ char c; @@ -6296,12 +6295,12 @@ test_libver_bounds_datatype(hid_t fapl) ** test_libver_bounds_datatype_check(): ** Helper routine called by test_libver_bounds_datatype() ** to verify the datatype message version for the input tid: -** +** ** (a) Create a file with default fcpl and the input fapl. ** Create a contiguous dataset with the input tid. -** Verify the datatype message version. +** Verify the datatype message version. ** Create a committed datatype of string to be -** used later. +** used later. ** Close the file. ** ** (b) Create a new fapl that is set to the 5 pairs of low/high @@ -6319,13 +6318,13 @@ test_libver_bounds_datatype(hid_t fapl) static void test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) { - hid_t fid = -1; /* File ID */ + hid_t fid = -1; /* File ID */ hid_t new_fapl = -1; /* File acess property list */ hid_t dcpl = -1; /* Dataset creation property list */ hid_t dtid = -1; /* Datatype ID for the dataset */ hid_t str_tid = -1; /* String datatype ID */ - hid_t did = -1; /* Dataset ID */ - hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ hsize_t dims[1] = {1}; /* Dimension sizes */ hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ @@ -6336,7 +6335,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) H5F_libver_t low, high; /* Low and high bounds */ herr_t ret; /* Return value */ - /* Retrieve the low/high version bounds from the input fapl */ + /* Retrieve the low/high version bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); @@ -6373,14 +6372,14 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) /* Verify the datatype message version */ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: - * --the library will set version according to low_bound - * --H5T_ARRAY: the earliest version the library will set is 2 + * --the library will set version according to low_bound + * --H5T_ARRAY: the earliest version the library will set is 2 * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: - * --the library will only use basic version + * --the library will only use basic version */ - if(dtype->shared->type == H5T_COMPOUND || - dtype->shared->type == H5T_ENUM || + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || dtype->shared->type == H5T_ARRAY) { if(dtype->shared->type == H5T_ARRAY && low == H5F_LIBVER_EARLIEST) VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); @@ -6469,15 +6468,15 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) /* Verify the dataset's datatype message version */ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: - * --the library will set version according to low_bound - * --H5T_ARRAY: the earliest version the library will set is 2 + * --the library will set version according to low_bound + * --H5T_ARRAY: the earliest version the library will set is 2 * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: - * --the library will only use basic version + * --the library will only use basic version */ - if(dtype->shared->type == H5T_COMPOUND || - dtype->shared->type == H5T_ENUM || + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || dtype->shared->type == H5T_ARRAY) { - if(dtype->shared->type == H5T_ARRAY && + if(dtype->shared->type == H5T_ARRAY && f->shared->low_bound == H5F_LIBVER_EARLIEST) VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); else @@ -6525,7 +6524,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) ** Verify the attribute message versions: ** ** (a) Create a file with default fcpl and the input fapl. -** Create a group and attach the following three attributes +** Create a group and attach the following three attributes ** to the group: ** (1) Attribute with a committed datatype ** (2) Attribute with integer type @@ -6535,7 +6534,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) ** ** (b) Create a fcpl that has shared datatype message enabled. ** Create a file with the fcpl and the input fapl. -** Create a group and attach an attribute with shared +** Create a group and attach an attribute with shared ** integer type to the group. ** Verify the attribute message version. ** Close the file @@ -6567,7 +6566,7 @@ test_libver_bounds_attributes(hid_t fapl) H5F_libver_t low, high; /* Low and high bounds */ herr_t ret; /* Return value */ - /* Retrieve the low/high bounds from the input fapl */ + /* Retrieve the low/high bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); @@ -6810,7 +6809,7 @@ test_libver_bounds_attributes(hid_t fapl) /**************************************************************** ** ** test_libver_macros(): -** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly. +** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly. ** ****************************************************************/ static void @@ -6859,7 +6858,7 @@ test_libver_macros(void) /**************************************************************** ** ** test_libver_macros2(): -** Verify that H5_VERSION_GE works correactly and show how +** Verify that H5_VERSION_GE works correactly and show how ** to use it. ** ****************************************************************/ @@ -6892,9 +6891,9 @@ test_libver_macros2(void) ret = H5Gclose(grp); CHECK(ret, FAIL, "H5Gclose"); - /* + /* * Delete the group using different function based on the library version. - * And verify the action. + * And verify the action. */ #if H5_VERSION_GE(1,8,0) ret = H5Ldelete(file, "Group", H5P_DEFAULT); @@ -6923,7 +6922,7 @@ test_libver_macros2(void) /**************************************************************** ** ** test_deprec(): -** Test deprecated functionality. +** Test deprecated functionality. ** ****************************************************************/ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -6939,7 +6938,7 @@ test_deprec(void) unsigned freelist; /* Free list version # */ unsigned stab; /* Symbol table entry version # */ unsigned shhdr; /* Shared object header version # */ - H5F_info1_t finfo; /* global information about file */ + H5F_info1_t finfo; /* global information about file */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -7155,7 +7154,7 @@ test_deprec(void) void test_file(void) { - const char *env_h5_drvr; /* File Driver value from environment */ + const char *env_h5_drvr; /* File Driver value from environment */ /* Output message about test being performed */ MESSAGE(5, ("Testing Low-Level File I/O\n")); @@ -7211,15 +7210,15 @@ test_file(void) #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* test_file() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_file + * Function: cleanup_file * - * 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/test/tgenprop.c b/test/tgenprop.c index 0e6b5c9..5031846 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -13,21 +13,21 @@ /*********************************************************** * -* Test program: tgenprop +* Test program: tgenprop * * Test the Generic Property functionality * *************************************************************/ -#define H5P_FRIEND /*suppress error about including H5Ppkg */ +#define H5P_FRIEND /*suppress error about including H5Ppkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5P_TESTING #include "testhdf5.h" -#include "hdf5.h" + #include "H5Dprivate.h" /* For Dataset creation property list names */ -#include "H5Ppkg.h" /* Generic Properties */ +#include "H5Ppkg.h" /* Generic Properties */ #define FILENAME "tgenprop.h5" @@ -80,11 +80,11 @@ typedef struct count_data_t { static void test_genprop_basic_class(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t cid3; /* Generic Property class ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t cid3; /* Generic Property class ID */ char *name; /* Name of class */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Creation Functionality\n")); @@ -169,10 +169,10 @@ test_genprop_basic_class(void) static void test_genprop_basic_class_prop(void) { - hid_t cid1; /* Generic Property class ID */ - size_t size; /* Size of property */ - size_t nprops; /* Number of properties in class */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + size_t size; /* Size of property */ + size_t nprops; /* Number of properties in class */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Properties Functionality\n")); @@ -311,8 +311,8 @@ test_genprop_iter1(hid_t H5_ATTR_UNUSED id, const char *name, static void test_genprop_class_iter(void) { - hid_t cid1; /* Generic Property class ID */ - size_t nprops; /* Number of properties in class */ + hid_t cid1; /* Generic Property class ID */ + size_t nprops; /* Number of properties in class */ int idx; /* Index to start iteration at */ struct { /* Struct for iterations */ int iter_count; @@ -323,7 +323,7 @@ test_genprop_class_iter(void) PROP2_NAME, PROP3_NAME, PROP4_NAME}; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Property Iteration Functionality\n")); @@ -417,17 +417,17 @@ test_genprop_cls_cls_cb1(hid_t list_id, void *create_data) static void test_genprop_class_callback(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* Generic Property list ID */ - hid_t lid3; /* Generic Property list ID */ - size_t nprops; /* Number of properties in class */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* Generic Property list ID */ + hid_t lid3; /* Generic Property list ID */ + size_t nprops; /* Number of properties in class */ struct { /* Struct for callbacks */ int count; hid_t id; } crt_cb_struct, cpy_cb_struct, cls_cb_struct; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Callback Functionality\n")); @@ -596,14 +596,14 @@ test_genprop_class_callback(void) static void test_genprop_basic_list(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ - size_t size; /* Size of property */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ + size_t size; /* Size of property */ int prop1_value; /* Value for property #1 */ float prop2_value; /* Value for property #2 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Creation Functionality\n")); @@ -678,8 +678,8 @@ test_genprop_basic_list(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Close list */ @@ -702,14 +702,14 @@ test_genprop_basic_list(void) static void test_genprop_basic_list_prop(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ int prop1_value; /* Value for property #1 */ float prop2_value; /* Value for property #2 */ char prop3_value[10];/* Property #3 value */ double prop4_value; /* Property #4 value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Property Functionality\n")); @@ -770,8 +770,8 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ @@ -783,8 +783,8 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Delete permanent property */ ret = H5Premove(lid1, PROP2_NAME); @@ -820,8 +820,8 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Close list */ ret = H5Pclose(lid1); @@ -856,9 +856,9 @@ test_genprop_iter2(hid_t H5_ATTR_UNUSED id, const char *name, static void test_genprop_list_iter(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ int idx; /* Index to start iteration at */ struct { /* Struct for iterations */ int iter_count; @@ -870,7 +870,7 @@ test_genprop_list_iter(void) PROP1_NAME, PROP2_NAME }; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Iteration Functionality\n")); @@ -1144,10 +1144,10 @@ test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *v static void test_genprop_list_callback(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* 2nd Generic Property list ID */ - size_t nprops; /* Number of properties in class */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* 2nd Generic Property list ID */ + size_t nprops; /* Number of properties in class */ int prop1_value; /* Value for property #1 */ int prop1_new_value=20; /* Property #1 new value */ float prop2_value; /* Value for property #2 */ @@ -1158,7 +1158,7 @@ test_genprop_list_callback(void) int count; hid_t id; } cop_cb_struct; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Property Callback Functionality\n")); @@ -1225,8 +1225,8 @@ test_genprop_list_callback(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ ret = H5Pget(lid1, PROP3_NAME,&prop3_value); @@ -1240,8 +1240,8 @@ test_genprop_list_callback(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Verify get callback information for properties tracked */ VERIFY(prop1_cb_info.get_count, 1, "H5Pget"); @@ -1373,7 +1373,7 @@ test_genprop_list_addprop(void) hid_t sid; /* Dataspace ID */ hid_t pid; /* Property List ID */ int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1448,7 +1448,7 @@ test_genprop_class_addprop(void) hid_t cid; /* Property Class ID */ hid_t pid; /* Property List ID */ int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1570,7 +1570,7 @@ static void test_genprop_list_add_remove_prop(void) { hid_t pid; /* Property List ID */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create a dataset creation property list */ pid = H5Pcreate(H5P_DATASET_CREATE); @@ -1607,11 +1607,11 @@ test_genprop_list_add_remove_prop(void) static void test_genprop_equal(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* Generic Property list ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* Generic Property list ID */ int prop1_new_value = 20; /* Property #1 new value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Equal Functionality\n")); @@ -1756,11 +1756,11 @@ test_genprop_equal(void) static void test_genprop_path(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t cid3; /* Generic Property class ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t cid3; /* Generic Property class ID */ char *path; /* Class path */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Class Path Functionality\n")); @@ -1828,10 +1828,10 @@ test_genprop_path(void) static void test_genprop_refcount(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property class ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property class ID */ char *name; /* Name of class */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Reference Count Functionality\n")); @@ -1901,10 +1901,10 @@ test_genprop_refcount(void) static void test_genprop_deprec_class(void) { - hid_t cid1; /* Generic Property class ID */ - size_t size; /* Size of property */ - size_t nprops; /* Number of properties in class */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + size_t size; /* Size of property */ + size_t nprops; /* Number of properties in class */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deprecated Generic Property List Functions\n")); @@ -2034,7 +2034,7 @@ test_genprop_deprec_list(void) hid_t sid; /* Dataspace ID */ hid_t pid; /* Property List ID */ int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2130,15 +2130,15 @@ test_genprop(void) } /* test_genprop() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_genprop + * Function: cleanup_genprop * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June 8, 1999 * * Modifications: diff --git a/test/tid.c b/test/tid.c index 7d6757f..ba8af03 100644 --- a/test/tid.c +++ b/test/tid.c @@ -14,10 +14,9 @@ /* Test user-created identifiers (hid_t's) and identifier types. */ #include "testhdf5.h" -#include "hdf5.h" /* Include H5Ipkg.h to calculate max number of groups */ -#define H5I_FRIEND /*suppress error about including H5Ipkg */ +#define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" /* Test basic functionality of registering and deleting types and IDs */ @@ -238,97 +237,97 @@ out: } - /* A dummy search function for the next test */ + /* A dummy search function for the next test */ static int test_search_func(void H5_ATTR_UNUSED * ptr1, void H5_ATTR_UNUSED * ptr2) { return 0; } - /* Ensure that public functions cannot access "predefined" ID types */ + /* Ensure that public functions cannot access "predefined" ID types */ static int id_predefined_test(void ) { - void * testObj; - hid_t testID; - hid_t typeID = H5I_INVALID_HID; - void * testPtr; - herr_t testErr; + void * testObj; + hid_t testID; + hid_t typeID = H5I_INVALID_HID; + void * testPtr; + herr_t testErr; - testObj = HDmalloc(sizeof(int)); + testObj = HDmalloc(sizeof(int)); - /* Try to perform illegal functions on various predefined types */ - H5E_BEGIN_TRY - testID = H5Iregister(H5I_FILE, testObj); - H5E_END_TRY + /* Try to perform illegal functions on various predefined types */ + H5E_BEGIN_TRY + testID = H5Iregister(H5I_FILE, testObj); + H5E_END_TRY - VERIFY(testID, H5I_INVALID_HID, "H5Iregister"); - if(testID != H5I_INVALID_HID) - goto out; + VERIFY(testID, H5I_INVALID_HID, "H5Iregister"); + if(testID != H5I_INVALID_HID) + goto out; - H5E_BEGIN_TRY - testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); - H5E_END_TRY + H5E_BEGIN_TRY + testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); + H5E_END_TRY - CHECK_PTR_NULL(testPtr, "H5Isearch"); - if(testPtr != NULL) - goto out; + CHECK_PTR_NULL(testPtr, "H5Isearch"); + if(testPtr != NULL) + goto out; - H5E_BEGIN_TRY - testErr = H5Inmembers(H5I_ERROR_STACK, NULL); - H5E_END_TRY + H5E_BEGIN_TRY + testErr = H5Inmembers(H5I_ERROR_STACK, NULL); + H5E_END_TRY - VERIFY(testErr, -1, "H5Inmembers"); - if(testErr != -1) - goto out; + VERIFY(testErr, -1, "H5Inmembers"); + if(testErr != -1) + goto out; - H5E_BEGIN_TRY - testErr = H5Iclear_type(H5I_FILE, 0); - H5E_END_TRY + H5E_BEGIN_TRY + testErr = H5Iclear_type(H5I_FILE, 0); + H5E_END_TRY - VERIFY((testErr >= 0), 0, "H5Iclear_type"); - if(testErr >= 0) - goto out; + VERIFY((testErr >= 0), 0, "H5Iclear_type"); + if(testErr >= 0) + goto out; - H5E_BEGIN_TRY - testErr = H5Idestroy_type(H5I_DATASET); - H5E_END_TRY + H5E_BEGIN_TRY + testErr = H5Idestroy_type(H5I_DATASET); + H5E_END_TRY - VERIFY((testErr >= 0), 0, "H5Idestroy_type"); - if(testErr >= 0) - goto out; + VERIFY((testErr >= 0), 0, "H5Idestroy_type"); + if(testErr >= 0) + goto out; - /* Create a datatype ID and try to perform illegal functions on it */ - typeID = H5Tcreate(H5T_OPAQUE, (size_t)42); - CHECK(typeID, H5I_INVALID_HID, "H5Tcreate"); - if(typeID == H5I_INVALID_HID) - goto out; + /* Create a datatype ID and try to perform illegal functions on it */ + typeID = H5Tcreate(H5T_OPAQUE, (size_t)42); + CHECK(typeID, H5I_INVALID_HID, "H5Tcreate"); + if(typeID == H5I_INVALID_HID) + goto out; - H5E_BEGIN_TRY - testPtr = H5Iremove_verify(typeID, H5I_DATATYPE); - H5E_END_TRY + H5E_BEGIN_TRY + testPtr = H5Iremove_verify(typeID, H5I_DATATYPE); + H5E_END_TRY - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - H5E_BEGIN_TRY - testPtr = H5Iobject_verify(typeID, H5I_DATATYPE); - H5E_END_TRY + H5E_BEGIN_TRY + testPtr = H5Iobject_verify(typeID, H5I_DATATYPE); + H5E_END_TRY - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - H5Tclose(typeID); + H5Tclose(typeID); - /* testObj was never registered as an atom, so it will not be + /* testObj was never registered as an atom, so it will not be * automatically freed. */ - HDfree(testObj); - return 0; + HDfree(testObj); + return 0; out: - if(typeID != H5I_INVALID_HID) - H5Tclose(typeID); + if(typeID != H5I_INVALID_HID) + H5Tclose(typeID); if(testObj != NULL) - HDfree(testObj); + HDfree(testObj); - return -1; + return -1; } @@ -444,12 +443,12 @@ static int test_get_type(void) out: if(dtype != H5I_INVALID_HID) - H5Tclose(dtype); + H5Tclose(dtype); return -1; } - /* Test boundary cases with lots of types */ + /* Test boundary cases with lots of types */ /* Type IDs range from H5I_NTYPES to H5I_MAX_NUM_TYPES. The system will assign */ /* IDs in sequential order until H5I_MAX_NUM_TYPES IDs have been given out, at which */ @@ -459,78 +458,78 @@ out: /* to low values successfully, ensure that an error is thrown when all possible */ /* type IDs are taken, then ensure that deleting types frees up their IDs. */ /* Note that this test depends on the implementation of IDs, so may break */ -/* if the implementation changes. */ +/* if the implementation changes. */ /* Also note that if someone else registered a user-defined type and forgot to */ /* destroy it, this test will mysteriously fail (because it will expect there to */ /* be one more "free" type ID than there is). */ /* H5I_NTYPES is defined in h5public.h, H5I_MAX_NUM_TYPES is defined in h5pkg.h */ static int test_id_type_list(void) { - H5I_type_t startType; /* The first type ID we were assigned in this test */ - H5I_type_t currentType; - H5I_type_t testType; - int i; /* Just a counter variable */ - - startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - CHECK(startType, H5I_BADID, "H5Iregister_type"); - if(startType == H5I_BADID) - goto out; - - /* Sanity check */ - if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) - { - /* Error condition, throw an error */ - CHECK(1, 1, "H5Iregister_type"); - goto out; - } - /* Create types up to H5I_MAX_NUM_TYPES */ - for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++) - { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - CHECK(currentType, H5I_BADID, "H5Iregister_type"); - if(currentType == H5I_BADID) - goto out; - } - - /* Wrap around to low type ID numbers */ - for(i = H5I_NTYPES; i < startType; i++) - { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - CHECK(currentType, H5I_BADID, "H5Iregister_type"); - if(currentType == H5I_BADID) - goto out; - } - - /* There should be no room at the inn for a new ID type*/ - H5E_BEGIN_TRY - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - H5E_END_TRY - - VERIFY(testType, H5I_BADID, "H5Iregister_type"); - if(testType != H5I_BADID) - goto out; - - /* Now delete a type and try to insert again */ - H5Idestroy_type(H5I_NTYPES); - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - - VERIFY(testType, H5I_NTYPES, "H5Iregister_type"); - if(testType != H5I_NTYPES) - goto out; - - /* Cleanup. Destroy all types. */ - for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) - H5Idestroy_type((H5I_type_t) i); - - return 0; + H5I_type_t startType; /* The first type ID we were assigned in this test */ + H5I_type_t currentType; + H5I_type_t testType; + int i; /* Just a counter variable */ + + startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + CHECK(startType, H5I_BADID, "H5Iregister_type"); + if(startType == H5I_BADID) + goto out; + + /* Sanity check */ + if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) + { + /* Error condition, throw an error */ + CHECK(1, 1, "H5Iregister_type"); + goto out; + } + /* Create types up to H5I_MAX_NUM_TYPES */ + for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++) + { + currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + CHECK(currentType, H5I_BADID, "H5Iregister_type"); + if(currentType == H5I_BADID) + goto out; + } + + /* Wrap around to low type ID numbers */ + for(i = H5I_NTYPES; i < startType; i++) + { + currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + CHECK(currentType, H5I_BADID, "H5Iregister_type"); + if(currentType == H5I_BADID) + goto out; + } + + /* There should be no room at the inn for a new ID type*/ + H5E_BEGIN_TRY + testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + H5E_END_TRY + + VERIFY(testType, H5I_BADID, "H5Iregister_type"); + if(testType != H5I_BADID) + goto out; + + /* Now delete a type and try to insert again */ + H5Idestroy_type(H5I_NTYPES); + testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + + VERIFY(testType, H5I_NTYPES, "H5Iregister_type"); + if(testType != H5I_NTYPES) + goto out; + + /* Cleanup. Destroy all types. */ + for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) + H5Idestroy_type((H5I_type_t) i); + + return 0; out: /* Cleanup. For simplicity, just destroy all types and ignore errors. */ - H5E_BEGIN_TRY - for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) - H5Idestroy_type((H5I_type_t) i); - H5E_END_TRY - return -1; + H5E_BEGIN_TRY + for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) + H5Idestroy_type((H5I_type_t) i); + H5E_END_TRY + return -1; } /* Test removing ids in callback for H5Iclear_type */ @@ -733,11 +732,11 @@ void test_ids(void) /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); - if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n"); - if (id_predefined_test() < 0) TestErrPrintf("Predefined ID type test failed\n"); - if (test_is_valid() < 0) TestErrPrintf("H5Iis_valid test failed\n"); - if (test_get_type() < 0) TestErrPrintf("H5Iget_type test failed\n"); - if (test_id_type_list() < 0) TestErrPrintf("ID type list test failed\n"); - if (test_remove_clear_type() < 0) TestErrPrintf("ID remove during H5Iclear_type test failed\n"); + if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n"); + if (id_predefined_test() < 0) TestErrPrintf("Predefined ID type test failed\n"); + if (test_is_valid() < 0) TestErrPrintf("H5Iis_valid test failed\n"); + if (test_get_type() < 0) TestErrPrintf("H5Iget_type test failed\n"); + if (test_id_type_list() < 0) TestErrPrintf("ID type list test failed\n"); + if (test_remove_clear_type() < 0) TestErrPrintf("ID remove during H5Iclear_type test failed\n"); } diff --git a/test/titerate.c b/test/titerate.c index 231bd2e..82c26eb 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: titerate +* Test program: titerate * * Test the Group & Attribute functionality * @@ -21,8 +21,6 @@ #include "testhdf5.h" -#include "hdf5.h" - #define DATAFILE "titerate.h5" /* Number of datasets for group iteration test */ @@ -38,8 +36,8 @@ #define NAMELEN 80 /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 typedef enum { RET_ZERO, @@ -131,7 +129,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) char dataset_name[NAMELEN]; /* dataset name */ iter_info info; /* Custom iteration information */ H5G_info_t ginfo; /* Buffer for querying object's info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Group Iteration Functionality\n")); @@ -390,7 +388,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format) char name[NAMELEN]; /* temporary name buffer */ char *anames[NATTR]; /* Names of the attributes 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 */ MESSAGE(5, ("Testing Attribute Iteration Functionality\n")); @@ -545,7 +543,7 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_ { const iter_info *test_info = (const iter_info *)opdata; H5O_info_t oinfo; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ if(HDstrcmp(name, test_info->name)) { TestErrPrintf("name = '%s', test_info = '%s'\n", name, test_info->name); @@ -575,13 +573,13 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_ static void test_iter_group_large(hid_t fapl) { - hid_t file; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hsize_t dims[] = {SPACE1_DIM1}; - herr_t ret; /* Generic return value */ + hid_t file; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t dims[] = {SPACE1_DIM1}; + herr_t ret; /* Generic return value */ char gname[20]; /* Temporary group name */ iter_info *names; /* Names of objects in the root group */ iter_info *curr_name; /* Pointer to the current name in the root group */ @@ -711,7 +709,7 @@ static void test_grp_memb_funcs(hid_t fapl) char dataset_name[NAMELEN]; /* dataset name */ ssize_t name_len; /* Length of object's name */ H5G_info_t ginfo; /* Buffer for querying object's info */ - herr_t ret = SUCCEED; /* Generic return value */ + herr_t ret = SUCCEED; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Group Member Information Functionality\n")); @@ -851,7 +849,7 @@ static void test_links(hid_t fapl) hid_t gid, gid1; H5G_info_t ginfo; /* Buffer for querying object's info */ hsize_t i; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Soft and Hard Link Iteration Functionality\n")); @@ -927,7 +925,7 @@ test_iterate(void) { hid_t fapl, fapl2; /* File access property lists */ unsigned new_format; /* Whether to use the new format or not */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Iteration Operations\n")); @@ -960,15 +958,15 @@ test_iterate(void) CHECK(ret, FAIL, "H5Pclose"); } /* test_iterate() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_iterate + * Function: cleanup_iterate * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 5, 2000 * * Modifications: diff --git a/test/tmisc.c b/test/tmisc.c index f0e595b..4a77b51 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -21,12 +21,11 @@ * *************************************************************/ -#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5D_TESTING -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" #include "H5Dpkg.h" /* Datasets */ @@ -1816,11 +1815,11 @@ test_misc11(void) unsigned sym_ik; /* Symbol table B-tree initial 'K' value */ unsigned istore_ik; /* Indexed storage B-tree initial 'K' value */ unsigned sym_lk; /* Symbol table B-tree leaf 'K' value */ - unsigned nindexes; /* Shared message number of indexes */ + unsigned nindexes; /* Shared message number of indexes */ H5F_info2_t finfo; /* global information about file */ H5F_fspace_strategy_t strategy; /* File space strategy */ - hsize_t threshold; /* Free-space section threshold */ - hbool_t persist; /* To persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ + hbool_t persist; /* To persist free-space or not */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1859,7 +1858,7 @@ test_misc11(void) /* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */ H5E_BEGIN_TRY { - ret=H5Pset_sym_k(fcpl, 32770, 0); + ret=H5Pset_sym_k(fcpl, 32770, 0); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Pset_sym_k"); @@ -1868,7 +1867,7 @@ test_misc11(void) /* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */ H5E_BEGIN_TRY { - ret=H5Pset_istore_k(fcpl, 32770); + ret=H5Pset_istore_k(fcpl, 32770); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Pset_istore_k"); @@ -1980,19 +1979,19 @@ test_misc12(void) "las palabras del que murio en la cruz." }; char *rdata [MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE]; /* Information read in */ - hid_t fid1; - hid_t dataset; - hid_t sid1, space, memspace; - hid_t tid1, cparms; - hsize_t dims1[] = {MISC12_SPACE1_DIM1}; - hsize_t dimsn[] = {MISC12_APPEND_SIZE}; - hsize_t maxdims1[1] = {H5S_UNLIMITED}; - hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE}; + hid_t fid1; + hid_t dataset; + hid_t sid1, space, memspace; + hid_t tid1, cparms; + hsize_t dims1[] = {MISC12_SPACE1_DIM1}; + hsize_t dimsn[] = {MISC12_APPEND_SIZE}; + hsize_t maxdims1[1] = {H5S_UNLIMITED}; + hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE}; hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE}; - hsize_t offset[1] = {MISC12_SPACE1_DIM1}; + hsize_t offset[1] = {MISC12_SPACE1_DIM1}; hsize_t count[1] = {MISC12_APPEND_SIZE}; int i; /* counting variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL-type in chunked dataset\n")); @@ -2746,10 +2745,10 @@ test_misc16(void) herr_t ret; /* Generic return value */ char wdata[MISC16_SPACE_DIM][MISC16_STR_SIZE]; char rdata[MISC16_SPACE_DIM][MISC16_STR_SIZE]; /* Information read in */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hsize_t dims[] = {MISC16_SPACE_DIM}; + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t dims[] = {MISC16_SPACE_DIM}; int i; /* Initialize the data */ @@ -2831,10 +2830,10 @@ test_misc17(void) herr_t ret; /* Generic return value */ char wdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2]; char rdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2]; /* Information read in */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hsize_t dims[] = {MISC17_SPACE_DIM1, MISC17_SPACE_DIM2}; + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t dims[] = {MISC17_SPACE_DIM1, MISC17_SPACE_DIM2}; int i; /* Initialize the data */ @@ -3798,13 +3797,13 @@ test_misc22(void) /* compute the correct PPB that should be set by SZIP */ if(offsets[k] == 0) - correct = prec[j]; + correct = prec[j]; else correct = H5Tget_size(idts[i]) * 8; if(correct > 24) { - if(correct <= 32) + if(correct <= 32) correct = 32; - else if(correct <= 64) + else if(correct <= 64) correct = 64; } /* end if */ @@ -4757,7 +4756,7 @@ test_misc25b(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc25b() */ - + /**************************************************************** ** ** test_misc25c(): Exercise another null object header message merge bug. @@ -4891,7 +4890,7 @@ test_misc25c(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc25c() */ - + /**************************************************************** ** ** test_misc26(): Regression test: ensure that copying filter @@ -4977,7 +4976,7 @@ test_misc26(void) CHECK_I(ret, "H5Pclose"); } - + /**************************************************************** ** ** test_misc27(): Ensure that objects with incorrect # of object @@ -5022,7 +5021,7 @@ test_misc27(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc27() */ - + /**************************************************************** ** ** test_misc28(): Ensure that the dataset chunk cache will hold @@ -5199,7 +5198,7 @@ test_misc28(void) CHECK_I(ret, "H5Pclose"); } /* end test_misc28() */ - + /**************************************************************** ** ** test_misc29(): Ensure that speculative metadata reads don't @@ -5239,7 +5238,7 @@ test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR { H5O_info_t object_info; - return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT); + return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT); } static int @@ -5248,7 +5247,7 @@ test_misc30_get_info(hid_t loc_id) return H5Literate(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, test_misc30_get_info_cb, NULL); } - + /**************************************************************** ** ** test_misc30(): Exercise local heap code that loads prefix @@ -5280,15 +5279,15 @@ test_misc30(void) CHECK(ret, FAIL, "H5Gclose"); ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - + for(i = 0; i < 20; i++) { char gname[32]; fid = H5Fopen(MISC30_FILE, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); - + if(get_info) { - ret = test_misc30_get_info(fid); + ret = test_misc30_get_info(fid); CHECK(ret, FAIL, "test_misc30_get_info"); } @@ -5300,20 +5299,20 @@ test_misc30(void) CHECK(ret, FAIL, "H5Gclose"); ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - } - + } + fid = H5Fopen(MISC30_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); ret = H5Fget_filesize(fid, &file_size[get_info]); CHECK(fid, FAIL, "H5Fget_filesize"); ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - } - + } + VERIFY(file_size[0], file_size[1], "test_misc30"); } /* end test_misc30() */ - + /**************************************************************** ** ** test_misc31(): Test reentering library through deprecated @@ -5404,14 +5403,14 @@ test_misc31(void) CHECK(ret, FAIL, "H5Fclose"); ret = H5Tclose(dtype_id); CHECK(ret, FAIL, "H5Tclose"); - + #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Output message about test being skipped */ MESSAGE(5, (" ...Skipped")); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end test_misc31() */ - + /**************************************************************** * * test_misc32(): Simple test of filter memory allocation @@ -5475,7 +5474,7 @@ test_misc32(void) resized = H5resize_memory(NULL, 0); CHECK_PTR_NULL(resized, "H5resize_memory"); /*BAD*/ #endif /* NDEBUG */ - + } /* end test_misc32() */ /**************************************************************** @@ -5585,7 +5584,7 @@ test_misc34(void) } /* end test_misc34() */ - + /**************************************************************** ** ** test_misc(): Main misc. test routine. @@ -5638,15 +5637,15 @@ test_misc(void) } /* test_misc() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_misc + * Function: cleanup_misc * - * 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/test/trefer.c b/test/trefer.c index 05c0130..7cbb77f 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: trefer +* Test program: trefer * * Test the Reference functionality * @@ -21,24 +21,22 @@ #include "testhdf5.h" -#include "hdf5.h" - #define FILE1 "trefer1.h5" -#define FILE2 "trefer2.h5" -#define FILE3 "trefer3.h5" +#define FILE2 "trefer2.h5" +#define FILE3 "trefer3.h5" /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 /* 2-D dataset with fixed dimensions */ -#define SPACE2_RANK 2 -#define SPACE2_DIM1 10 -#define SPACE2_DIM2 10 +#define SPACE2_RANK 2 +#define SPACE2_DIM1 10 +#define SPACE2_DIM2 10 /* Larger 1-D dataset with fixed dimensions */ -#define SPACE3_RANK 1 -#define SPACE3_DIM1 100 +#define SPACE3_RANK 1 +#define SPACE3_DIM1 100 /* Element selection information */ #define POINT1_NPOINTS 10 @@ -81,7 +79,7 @@ test_reference_params(void) unsigned *tu32; /* Temporary pointer to uint32 data */ int i; /* counting variables */ const char *write_comment = "Foo!"; /* Comments for group */ - hid_t ret_id; /* Generic hid_t return value */ + hid_t ret_id; /* Generic hid_t return value */ ssize_t name_size; /* Size of reference name */ herr_t ret; /* Generic return value */ @@ -104,7 +102,7 @@ test_reference_params(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a group */ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group, FAIL, "H5Gcreate2"); @@ -247,13 +245,13 @@ test_reference_params(void) static void test_reference_obj(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ dset2; /* Dereferenced dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hid_t group; /* Group ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}; hid_t dapl_id; /* Dataset access property list */ hobj_ref_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ @@ -265,7 +263,7 @@ test_reference_obj(void) char read_comment[10]; H5O_type_t obj_type; /* Object type */ ssize_t size; /* Comment length */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Object Reference Functions\n")); @@ -286,7 +284,7 @@ test_reference_obj(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a group */ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group, FAIL, "H5Gcreate2"); @@ -496,23 +494,23 @@ test_reference_obj(void) static void test_reference_region(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dset1, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid2; /* Dataspace ID #2 */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dset1, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ + hid_t sid1, /* Dataspace ID #1 */ + sid2; /* Dataspace ID #2 */ hid_t dapl_id; /* Dataset access property list */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE2_RANK]; /* Selection bounds */ - hsize_t high[SPACE2_RANK]; /* Selection bounds */ - hdset_reg_ref_t *wbuf, /* buffer to write to disk */ + hsize_t dims1[] = {SPACE1_DIM1}, + dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t * coords; /* Coordinate buffer */ + hsize_t low[SPACE2_RANK]; /* Selection bounds */ + hsize_t high[SPACE2_RANK]; /* Selection bounds */ + hdset_reg_ref_t *wbuf, /* buffer to write to disk */ *rbuf; /* buffer read from disk */ hdset_reg_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ @@ -522,7 +520,7 @@ test_reference_region(void) int i, j; /* counting variables */ hssize_t hssize_ret; /* hssize_t return value */ htri_t tri_ret; /* htri_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ hid_t dset_NA; /* Dataset id for undefined reference */ hid_t space_NA; /* Dataspace id for undefined reference */ @@ -550,7 +548,7 @@ test_reference_region(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a dataset */ dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset2, FAIL, "H5Dcreate2"); @@ -659,7 +657,7 @@ test_reference_region(void) /* Close and release resources for undefined region reference tests */ ret = H5Dclose(dset_NA); CHECK(ret, FAIL, "H5Dclose"); - ret = H5Sclose(space_NA); + ret = H5Sclose(space_NA); CHECK(ret, FAIL, "H5Sclose"); /* Close disk dataspace */ @@ -682,10 +680,10 @@ test_reference_region(void) fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid1, FAIL, "H5Fopen"); - /* - * Start the test of an undefined reference + /* + * Start the test of an undefined reference */ - + /* Open the dataset of the undefined references */ dset_NA = H5Dopen2(fid1, "DS_NA", H5P_DEFAULT); CHECK(dset_NA, FAIL, "H5Dopen2"); @@ -693,28 +691,28 @@ test_reference_region(void) /* Read the data */ ret = H5Dread(dset_NA, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_NA); CHECK(ret, FAIL, "H5Dread"); - + /* * Dereference an undefined reference (should fail) */ H5E_BEGIN_TRY { dset2 = H5Rdereference2(dset_NA, H5P_DEFAULT, H5R_DATASET_REGION, &rdata_NA[0]); - } H5E_END_TRY; - VERIFY(dset2, FAIL, "H5Rdereference2"); + } H5E_END_TRY; + VERIFY(dset2, FAIL, "H5Rdereference2"); /* Close and release resources. */ ret = H5Dclose(dset_NA); CHECK(ret, FAIL, "H5Dclose"); - /* This close should fail since H5Rdereference2 never created + /* This close should fail since H5Rdereference2 never created * the id of the referenced object. */ H5E_BEGIN_TRY { ret = H5Dclose(dset2); - } H5E_END_TRY; - VERIFY(ret, FAIL, "H5Dclose"); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Dclose"); - /* - * End the test of an undefined reference + /* + * End the test of an undefined reference */ /* Open the dataset */ @@ -893,22 +891,22 @@ test_reference_region(void) static void test_reference_region_1D(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dset1, /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dset1, /* Dataset ID */ dset3; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid3; /* Dataspace ID #3 */ + hid_t sid1, /* Dataspace ID #1 */ + sid3; /* Dataspace ID #3 */ hid_t dapl_id; /* Dataset access property list */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims3[] = {SPACE3_DIM1}; - 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 dims1[] = {SPACE1_DIM1}, + dims3[] = {SPACE3_DIM1}; + 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 */ 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 */ @@ -916,7 +914,7 @@ test_reference_region_1D(void) uint8_t *tu8; /* Temporary pointer to uint8 data */ H5O_type_t obj_type; /* Object type */ int i; /* counting variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n")); @@ -938,7 +936,7 @@ test_reference_region_1D(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a dataset */ dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset3, FAIL, "H5Dcreate2"); @@ -1178,14 +1176,14 @@ test_reference_region_1D(void) static void test_reference_obj_deleted(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ dset2; /* Dereferenced dataset ID */ - hid_t sid1; /* Dataspace ID */ + hid_t sid1; /* Dataspace ID */ hobj_ref_t oref; /* Object Reference to test */ H5O_type_t obj_type; /* Object type */ - haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ - herr_t ret; /* Generic return value */ + haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ + herr_t ret; /* Generic return value */ /* Create file */ fid1 = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1444,25 +1442,25 @@ test_reference_group(void) static void test_reference_compat(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, dset2; /* Dataset ID */ - hid_t group, group2; /* Group ID */ - hid_t sid1, /* Dataspace IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, dset2; /* Dataset ID */ + hid_t group, group2; /* Group ID */ + hid_t sid1, /* Dataspace IDs */ sid2; - hid_t tid1, tid2; /* Datatype ID */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hid_t tid1, tid2; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}, + dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ hobj_ref_t *wbuf_obj, /* Buffer to write to disk */ *rbuf_obj; /* Buffer read from disk */ hdset_reg_ref_t *wbuf_reg, /* Buffer to write to disk */ *rbuf_reg; /* Buffer read from disk */ H5G_obj_t obj_type; /* Object type */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deprecated Object Reference Functions\n")); @@ -1750,15 +1748,15 @@ test_reference(void) } /* test_reference() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_reference + * Function: cleanup_reference * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * September 8, 1998 * * Modifications: diff --git a/test/ttime.c b/test/ttime.c index 2eb2117..48c9ba8 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: ttime +* Test program: ttime * * Test the Time Datatype functionality * @@ -21,8 +21,6 @@ #include "testhdf5.h" -#include "hdf5.h" - #define DATAFILE "ttime.h5" #ifdef NOT_YET #define DATASETNAME "Dataset" @@ -215,15 +213,15 @@ test_time(void) } /* test_time() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_time + * Function: cleanup_time * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * October 19, 2000 * * Modifications: diff --git a/test/tvlstr.c b/test/tvlstr.c index 7b520f2..3315d68 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: tvlstr +* Test program: tvlstr * * Test the Variable-Length String functionality * @@ -21,14 +21,12 @@ #include "testhdf5.h" -#include "hdf5.h" - #define DATAFILE "tvlstr.h5" #define DATAFILE2 "tvlstr2.h5" /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 #define VLSTR_TYPE "vl_string_type" @@ -115,17 +113,17 @@ test_vlstrings_basic(void) char *rdata[SPACE1_DIM1]; /* Information read in */ char *wdata2; hid_t dataspace, dataset2; - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ hid_t xfer_pid; /* Dataset transfer property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i; /* counting variable */ size_t str_used; /* String data in memory */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic VL String Functionality\n")); @@ -247,14 +245,14 @@ test_vlstrings_special(void) const char *wdata2[SPACE1_DIM1] = {NULL, NULL, NULL, NULL}; char *rdata[SPACE1_DIM1]; /* Information read in */ char *fill; /* Fill value */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hid_t dcpl; /* Dataset creation property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hid_t dcpl; /* Dataset creation property list ID */ + hsize_t dims1[] = {SPACE1_DIM1}; unsigned i; /* counting variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Special VL Strings\n")); @@ -477,14 +475,14 @@ test_compact_vlstring(void) { const char *wdata[SPACE1_DIM1] = {"one", "two", "three", "four"}; char *rdata[SPACE1_DIM1]; /* Information read in */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hid_t plist; /* Dataset creation property list */ - hsize_t dims1[] = {SPACE1_DIM1}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hid_t plist; /* Dataset creation property list */ + hsize_t dims1[] = {SPACE1_DIM1}; unsigned i; /* counting variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL Strings in compact dataset\n")); @@ -873,15 +871,15 @@ test_vlstrings(void) test_vl_rewrite(); } /* test_vlstrings() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_vlstrings + * Function: cleanup_vlstrings * - * 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/test/tvltypes.c b/test/tvltypes.c index 0c4cb9d..e5a3d34 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: tvltypes +* Test program: tvltypes * * Test the Variable-Length Datatype functionality * @@ -21,24 +21,23 @@ #include "testhdf5.h" -#include "hdf5.h" #include "H5Dprivate.h" #define FILENAME "tvltypes.h5" /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 +#define SPACE1_RANK 1 #define SPACE1_DIM1 4 /* 1-D dataset with fixed dimensions */ -#define SPACE3_RANK 1 +#define SPACE3_RANK 1 #define SPACE3_DIM1 128 #define L1_INCM 16 #define L2_INCM 8 #define L3_INCM 3 /* 1-D dataset with fixed dimensions */ -#define SPACE4_RANK 1 +#define SPACE4_RANK 1 #define SPACE4_DIM_SMALL 128 #define SPACE4_DIM_LARGE (H5D_TEMP_BUF_SIZE / 64) @@ -104,7 +103,7 @@ static void test_vltypes_dataset_create(void) { hid_t fid1; /* HDF5 File IDs */ - hid_t dcpl; /* Dataset Property list */ + hid_t dcpl; /* Dataset Property list */ hid_t dataset; /* Dataset ID */ hsize_t dims1[] = {SPACE1_DIM1}; hid_t sid1; /* Dataspace ID */ @@ -136,7 +135,7 @@ test_vltypes_dataset_create(void) /* Create a dataset, supposed to fail */ H5E_BEGIN_TRY { - dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT); } H5E_END_TRY; VERIFY(dataset, FAIL, "H5Dcreate2"); @@ -230,18 +229,18 @@ test_vltypes_vlen_atomic(void) hvl_t wdata2[SPACE1_DIM1]; /* Information to write */ hvl_t rdata[SPACE1_DIM1]; /* Information read in */ hvl_t fill; /* Fill value */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ hid_t sid2; /* ID of bad dataspace (no extent set) */ - hid_t tid1; /* Datatype ID */ + hid_t tid1; /* Datatype ID */ hid_t dcpl_pid; /* Dataset creation property list ID */ hid_t xfer_pid; /* Dataset transfer property list ID */ hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Atomic VL Datatype Functionality\n")); @@ -556,7 +555,7 @@ rewrite_vltypes_vlen_atomic(void) hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=4; + unsigned increment=4; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -709,16 +708,16 @@ test_vltypes_vlen_compound(void) } s1; hvl_t wdata[SPACE1_DIM1]; /* Information to write */ hvl_t rdata[SPACE1_DIM1]; /* Information read in */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2; /* Datatype IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Compound VL Datatype Functionality\n")); @@ -863,7 +862,7 @@ rewrite_vltypes_vlen_compound(void) hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=4; + unsigned increment=4; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1001,14 +1000,14 @@ test_vltypes_compound_vlen_vlen(void) } s1; s1 *wdata; /* data to write */ s1 *rdata; /* data to read */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2, tid3; /* Datatype IDs */ - hsize_t dims1[] = {SPACE3_DIM1}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2, tid3; /* Datatype IDs */ + hsize_t dims1[] = {SPACE3_DIM1}; unsigned i,j,k; /* counting variables */ hvl_t *t1, *t2; /* Temporary pointer to VL information */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n")); @@ -1182,21 +1181,21 @@ test_vltypes_compound_vlstr(void) s1 wdata2[SPACE1_DIM1]; /* data to write */ s1 rdata[SPACE1_DIM1]; /* data to read */ s1 rdata2[SPACE1_DIM1]; /* data to read */ - char str[64] = "a\0"; - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, dset2; /* Dataset ID */ - hid_t sid1, sid2, filespace, filespace2; /* Dataspace ID */ - hid_t tid1, tid2, tid3, tid4, tid5; /* Datatype IDs */ - hid_t cparms; - hsize_t dims1[] = {SPACE1_DIM1}; - hsize_t chunk_dims[] = {SPACE1_DIM1/2}; - hsize_t maxdims[] = {H5S_UNLIMITED}; - hsize_t size[] = {SPACE1_DIM1}; - hsize_t offset[] = {0}; + char str[64] = "a\0"; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, dset2; /* Dataset ID */ + hid_t sid1, sid2, filespace, filespace2; /* Dataspace ID */ + hid_t tid1, tid2, tid3, tid4, tid5; /* Datatype IDs */ + hid_t cparms; + hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t chunk_dims[] = {SPACE1_DIM1/2}; + hsize_t maxdims[] = {H5S_UNLIMITED}; + hsize_t size[] = {SPACE1_DIM1}; + hsize_t offset[] = {0}; unsigned i,j; /* counting variables */ s2 *t1, *t2; /* Temporary pointer to VL information */ - int val; - herr_t ret; /* Generic return value */ + int val; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL Datatype of Compound Datatype with VL String Functionality\n")); @@ -1374,10 +1373,10 @@ test_vltypes_compound_vlstr(void) wdata2[i].v.p=(s2*)HDmalloc((i+1)*sizeof(s2)); wdata2[i].v.len=i+1; for(t1=(s2*)(wdata2[i].v).p, j=0; jstring = (char*)HDmalloc(strlen(str)*sizeof(char)+1); + strcat(str, "pp"); + t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1); strcpy(t1->string, str); - t1->color = green; + t1->color = green; } } /* end for */ @@ -1467,17 +1466,17 @@ test_vltypes_compound_vlen_atomic(void) s1 wdata[SPACE1_DIM1]; /* Information to write */ s1 rdata[SPACE1_DIM1]; /* Information read in */ s1 fill; /* Fill value */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2; /* Datatype IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ hid_t dcpl_pid; /* Dataset creation property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n")); @@ -1671,9 +1670,9 @@ test_vltypes_compound_vlen_atomic(void) /**************************************************************** ** ** rewrite_vltypes_compound_vlen_atomic(): Check memory leak for -** basic VL datatype code. +** basic VL datatype code. ** Check memory leak for compound datatypes with VL datatypes -** of atomic datatypes. +** of atomic datatypes. ** ****************************************************************/ static void @@ -1694,7 +1693,7 @@ rewrite_vltypes_compound_vlen_atomic(void) hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=4; + unsigned increment=4; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1855,16 +1854,16 @@ test_vltypes_vlen_vlen_atomic(void) hvl_t wdata[SPACE1_DIM1]; /* Information to write */ hvl_t rdata[SPACE1_DIM1]; /* Information read in */ hvl_t *t1, *t2; /* Temporary pointer to VL information */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2; /* Datatype IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j,k; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL Datatypes with VL Atomic Datatype Component Functionality\n")); @@ -2049,12 +2048,12 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void) hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1; /* Dataspace ID */ - hid_t tid2; /* Datatype IDs */ + hid_t tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ hsize_t size; /* Number of bytes which will be used */ unsigned i,j,k; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=1; + unsigned increment=1; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -3171,15 +3170,15 @@ test_vltypes(void) /* These next tests use the same file */ test_vltypes_dataset_create(); /* Check dataset of VL when fill value - * won't be rewritten to it.*/ + * won't be rewritten to it.*/ test_vltypes_funcs(); /* Test functions with VL types */ test_vltypes_vlen_atomic(); /* Test VL atomic datatypes */ - rewrite_vltypes_vlen_atomic(); /* Check VL memory leak */ + rewrite_vltypes_vlen_atomic(); /* Check VL memory leak */ test_vltypes_vlen_compound(); /* Test VL compound datatypes */ - rewrite_vltypes_vlen_compound(); /* Check VL memory leak */ + rewrite_vltypes_vlen_compound(); /* Check VL memory leak */ test_vltypes_compound_vlen_atomic(); /* Test compound datatypes with VL atomic components */ - rewrite_vltypes_compound_vlen_atomic();/* Check VL memory leak */ - test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */ + rewrite_vltypes_compound_vlen_atomic();/* Check VL memory leak */ + test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */ rewrite_longer_vltypes_vlen_vlen_atomic(); /*overwrite with VL data of longer sequence*/ rewrite_shorter_vltypes_vlen_vlen_atomic(); /*overwrite with VL data of shorted sequence*/ test_vltypes_compound_vlen_vlen();/* Test compound datatypes with VL atomic components */ @@ -3187,15 +3186,15 @@ test_vltypes(void) test_vltypes_fill_value(); /* Test fill value for VL data */ } /* test_vltypes() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_vltypes + * Function: cleanup_vltypes * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June 8, 1999 * * Modifications: -- cgit v0.12 From 2ee6908b6ab3e497b54cd2c739f78c222f1c27eb Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 14 Feb 2018 12:03:32 -0600 Subject: Fix for daily test failure for configuration with --disable-deprecated-symbols --- test/tfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tfile.c b/test/tfile.c index 8b66603..f1a4a1d 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -5267,7 +5267,7 @@ test_libver_bounds_super(hid_t fapl) /* This will result in superblock version 2 */ fcpl = H5Pcreate(H5P_FILE_CREATE); CHECK(fcpl, FAIL, "H5Pcreate"); - ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0); + ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, 1, (hsize_t)1); CHECK(ret, FAIL, "H5Pset_file_space"); /* Verify superblock version when creating a file with input fapl, -- cgit v0.12 From e277d537d2ab99e2294b8312a40d162cb38ba0b7 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 14 Feb 2018 14:30:51 -0600 Subject: Fix for daily test failures Move the declarations for the three arrays of versions from H5Opkg.h: (1) H5O_layout_vers_bounds to H5Dpkg.h (2) H5O_dtype_ver_bounds to H5Tpkg.h (3) H5O_sdspace_ver_bounds to H5Spkg.h This is to fix Windows' complaint for unresolved symbols. --- src/H5Dpkg.h | 3 +++ src/H5Opkg.h | 6 ++---- src/H5Spkg.h | 3 +++ src/H5Tpkg.h | 3 +++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 45f2d3a..78705c7 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -562,6 +562,9 @@ H5_DLLVAR const H5D_chunk_ops_t H5D_COPS_BT2[1]; H5_DLLVAR const H5B2_class_t H5D_BT2[1]; H5_DLLVAR const H5B2_class_t H5D_BT2_FILT[1]; +/* Array of versions for Layout */ +H5_DLLVAR const unsigned H5O_layout_ver_bounds[H5F_LIBVER_NBOUNDS]; + /******************************/ /* Package Private Prototypes */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 498938a..649ee3b 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -642,14 +642,12 @@ H5_DLL herr_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs); /* Arrays of versions for: - Object header, Layout/Attribute/Datatype/Fill value/Filter pipeline/Dataspace messages */ + Object header, Attribute/Fill value/Filter pipeline messages */ +/* Layout/Datatype/Dataspace arrays of versions are in H5Dpkg.h, H5Tpkg.h and H5Spkg.h */ H5_DLLVAR const unsigned H5O_obj_ver_bounds[H5F_LIBVER_NBOUNDS]; -H5_DLLVAR const unsigned H5O_layout_ver_bounds[H5F_LIBVER_NBOUNDS]; H5_DLLVAR const unsigned H5O_attr_ver_bounds[H5F_LIBVER_NBOUNDS]; -H5_DLLVAR const unsigned H5O_dtype_ver_bounds[H5F_LIBVER_NBOUNDS]; H5_DLLVAR const unsigned H5O_fill_ver_bounds[H5F_LIBVER_NBOUNDS]; H5_DLLVAR const unsigned H5O_pline_ver_bounds[H5F_LIBVER_NBOUNDS]; -H5_DLLVAR const unsigned H5O_sdspace_ver_bounds[H5F_LIBVER_NBOUNDS]; /* Testing functions */ #ifdef H5O_TESTING diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 315af29..5312ce7 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -262,6 +262,9 @@ H5_DLLVAR const H5S_select_class_t H5S_sel_none[1]; */ H5_DLLVAR const H5S_select_class_t H5S_sel_point[1]; +/* Array of versions for Dataspace */ +H5_DLLVAR const unsigned H5O_sdspace_ver_bounds[H5F_LIBVER_NBOUNDS]; + /* Extent functions */ H5_DLL herr_t H5S_extent_release(H5S_extent_t *extent); H5_DLL herr_t H5S_extent_copy_real(H5S_extent_t *dst, const H5S_extent_t *src, diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index d075127..f05c021 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -332,6 +332,9 @@ typedef struct { /* Typedef for datatype iteration operations */ typedef herr_t (*H5T_operator_t)(H5T_t *dt, void *op_data/*in,out*/); +/* Array of versions for Datatype */ +H5_DLLVAR const unsigned H5O_dtype_ver_bounds[H5F_LIBVER_NBOUNDS]; + /* * Alignment information for native types. A value of N indicates that the * data must be aligned on an address ADDR such that 0 == ADDR mod N. When -- cgit v0.12 From 76d70073c60163e97db98d3adfb745f2c561fdb2 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 14 Feb 2018 16:11:12 -0600 Subject: Fix for daily test failure Fix for test/testhdf5.sh for configuration with --enable-using-memchecker. --- test/tfile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/tfile.c b/test/tfile.c index 1678fb6..de1f362 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -5518,7 +5518,12 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) H5E_BEGIN_TRY { fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl); } H5E_END_TRY; - ok = fid >= 0; + + /* Get the internal file pointer if the open succeeds */ + if((ok = fid >= 0)) { + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + } /* Verify the file open succeeds or fails */ switch(super_vers) { -- cgit v0.12 From a77a08b02fb31e87f451a39640e4376e49878097 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 14 Feb 2018 16:14:48 -0600 Subject: HDFFV-10384 Add optional arg to enable-error-stack --- tools/lib/h5tools.c | 22 +++++++++++++---- tools/lib/h5tools.h | 2 +- tools/src/h5copy/h5copy.c | 4 ++-- tools/src/h5diff/h5diff_common.c | 2 +- tools/src/h5diff/h5diff_main.c | 2 +- tools/src/h5dump/h5dump.c | 49 ++++++++++++++++++++------------------ tools/src/h5repack/h5repack_main.c | 4 ++-- 7 files changed, 50 insertions(+), 35 deletions(-) diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 89cb524..11888bc 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -43,7 +43,7 @@ unsigned packed_bits_num; /* number of packed bits to display */ unsigned packed_data_offset; /* offset of packed bits to display */ 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 */ +int enable_error_stack = 0; /* re-enable error stack; disable=0 enable=1 */ /* sort parameters */ H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ @@ -548,9 +548,15 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, if ((my_fapl = h5tools_get_fapl(fapl, driver, &drivernum)) < 0) goto done; - H5E_BEGIN_TRY { + /* allow error stack display if enable-error-stack has optional arg number */ + if (enable_error_stack > 1) { fid = H5Fopen(fname, flags, my_fapl); - } H5E_END_TRY; + } + else { + H5E_BEGIN_TRY { + fid = H5Fopen(fname, flags, my_fapl); + } H5E_END_TRY; + } if (fid == FAIL) goto done; @@ -563,9 +569,15 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, if((my_fapl = h5tools_get_fapl(fapl, drivernames[drivernum], NULL)) < 0) goto done; - H5E_BEGIN_TRY { + /* allow error stack display if enable-error-stack has optional arg number */ + if (enable_error_stack > 1) { fid = H5Fopen(fname, flags, my_fapl); - } H5E_END_TRY; + } + else { + H5E_BEGIN_TRY { + fid = H5Fopen(fname, flags, my_fapl); + } H5E_END_TRY; + } if (fid != FAIL) break; diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 6383df5..c360230 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -573,7 +573,7 @@ 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 */ +H5TOOLS_DLLVAR int enable_error_stack; /* re-enable error stack; disable=0 enable=1 */ /* Strings for output */ #define H5_TOOLS_GROUP "GROUP" diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 1d15d12..1800810 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -293,7 +293,7 @@ main (int argc, const char *argv[]) break; case 'E': - enable_error_stack = TRUE; + enable_error_stack = 1; break; default: @@ -330,7 +330,7 @@ main (int argc, const char *argv[]) leave(EXIT_FAILURE); } - if (enable_error_stack) { + if (enable_error_stack > 0) { H5Eset_auto2(H5E_DEFAULT, func, edata); H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); } diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index ce5df78..8f09c81 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -178,7 +178,7 @@ void parse_command_line(int argc, break; case 'S': - enable_error_stack = TRUE; + enable_error_stack = 1; break; case 'E': diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index ad488a4..c5a0cbf 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -100,7 +100,7 @@ int main(int argc, const char *argv[]) */ parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); - if (enable_error_stack) { + if (enable_error_stack > 0) { H5Eset_auto2(H5E_DEFAULT, func, edata); H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); } diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index b90d60f..62f0ed0 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -67,7 +67,7 @@ struct handler_t { */ /* The following initialization makes use of C language cancatenating */ /* "xxx" "yyy" into "xxxyyy". */ -static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RECM:O*N:vG:"; +static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RE*CM:O*N:vG:"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, @@ -181,7 +181,7 @@ static struct long_options l_opts[] = { { "sort_order", require_arg, 'z' }, { "format", require_arg, 'm' }, { "region", no_arg, 'R' }, - { "enable-error-stack", no_arg, 'E' }, + { "enable-error-stack", optional_arg, 'E' }, { "packed-bits", require_arg, 'M' }, { "no-compact-subset", no_arg, 'C' }, { "ddl", optional_arg, 'O' }, @@ -191,7 +191,7 @@ static struct long_options l_opts[] = { { NULL, 0, '\0' } }; - + /*------------------------------------------------------------------------- * Function: leave * @@ -214,7 +214,7 @@ leave(int ret) HDexit(ret); } - + /*------------------------------------------------------------------------- * Function: usage * @@ -366,7 +366,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, "\n"); } - + /*------------------------------------------------------------------------- * Function: table_list_add * @@ -419,7 +419,7 @@ table_list_add(hid_t oid, unsigned long file_no) return((ssize_t) idx); } /* end table_list_add() */ - + /*------------------------------------------------------------------------- * Function: table_list_visited * @@ -449,7 +449,7 @@ table_list_visited(unsigned long file_no) return(-1); } /* end table_list_visited() */ - + /*------------------------------------------------------------------------- * Function: table_list_free * @@ -817,7 +817,7 @@ parse_mask_list(const char *h_list) } } - + /*------------------------------------------------------------------------- * Function: free_handler * @@ -865,7 +865,7 @@ free_handler(struct handler_t *hand, int len) } } - + /*------------------------------------------------------------------------- * Function: parse_command_line * @@ -920,9 +920,8 @@ parse_start: case 'n': display_fi = TRUE; last_was_dset = FALSE; - if ( opt_arg != NULL) { + if (opt_arg != NULL) h5trav_set_verbose(HDatoi(opt_arg)); - } break; case 'p': display_dcpl = TRUE; @@ -939,8 +938,9 @@ parse_start: last_was_dset = FALSE; break; case 'A': - if ( opt_arg != NULL) { - if(0 == HDatoi(opt_arg)) include_attrs = FALSE; + if (opt_arg != NULL) { + if(0 == HDatoi(opt_arg)) + include_attrs = FALSE; } else { display_data = FALSE; @@ -1059,7 +1059,7 @@ parse_start: break; case 'o': - if ( bin_output ) { + if (bin_output) { if (h5tools_set_data_output_file(opt_arg, 1) < 0) { usage(h5tools_getprogname()); goto error; @@ -1086,8 +1086,8 @@ parse_start: break; case 'b': - if ( opt_arg != NULL) { - if ( ( bin_form = set_binary_form(opt_arg)) < 0) { + if (opt_arg != NULL) { + if ((bin_form = set_binary_form(opt_arg)) < 0) { /* failed to set binary form */ usage(h5tools_getprogname()); goto error; @@ -1106,7 +1106,7 @@ parse_start: break; case 'q': - if ( ( sort_by = set_sort_by(opt_arg)) < 0) { + if ((sort_by = set_sort_by(opt_arg)) < 0) { /* failed to set "sort by" form */ usage(h5tools_getprogname()); goto error; @@ -1114,7 +1114,7 @@ parse_start: break; case 'z': - if ( ( sort_order = set_sort_order(opt_arg)) < 0) { + if ((sort_order = set_sort_order(opt_arg)) < 0) { /* failed to set "sort order" form */ usage(h5tools_getprogname()); goto error; @@ -1268,7 +1268,10 @@ end_collect: /** end subsetting parameters **/ case 'E': - enable_error_stack = TRUE; + if (opt_arg != NULL) + enable_error_stack = HDatoi(opt_arg); + else + enable_error_stack = 1; break; case 'C': disable_compact_subset = TRUE; @@ -1306,7 +1309,7 @@ error: return hand; } - + /*------------------------------------------------------------------------- * Function: main * @@ -1388,7 +1391,7 @@ main(int argc, const char *argv[]) goto done; } - if (enable_error_stack) { + if (enable_error_stack > 0) { H5Eset_auto2(H5E_DEFAULT, func, edata); H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); } @@ -1764,7 +1767,7 @@ h5_fileaccess(void) return fapl; } - + /*------------------------------------------------------------------------- * Function: init_prefix * @@ -1785,7 +1788,7 @@ init_prefix(char **prfx, size_t prfx_len) error_msg("unable to allocate prefix buffer\n"); } - + /*------------------------------------------------------------------------- * Function: add_prefix * diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 0fa268e..226f58e 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -667,7 +667,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'E': - enable_error_stack = TRUE; + enable_error_stack = 1; break; default: @@ -760,7 +760,7 @@ int main(int argc, const char **argv) } } - if (enable_error_stack) { + if (enable_error_stack > 0) { H5Eset_auto2(H5E_DEFAULT, func, edata); H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); } -- cgit v0.12 From ebb3bb0cfc08f3674606d78ec8c18cb7132650cd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Feb 2018 16:58:51 -0600 Subject: HDFFV-10384 Add opt arg to help --- release_docs/RELEASE.txt | 12 ++++++++++++ tools/src/h5dump/h5dump.c | 4 ++-- tools/testfiles/h5dump-help.txt | 4 ++-- tools/testfiles/pbits/tnofilename-with-packed-bits.ddl | 4 ++-- tools/testfiles/pbits/tpbitsIncomplete.ddl | 4 ++-- tools/testfiles/pbits/tpbitsLengthExceeded.ddl | 4 ++-- tools/testfiles/pbits/tpbitsLengthPositive.ddl | 4 ++-- tools/testfiles/pbits/tpbitsMaxExceeded.ddl | 4 ++-- tools/testfiles/pbits/tpbitsOffsetExceeded.ddl | 4 ++-- tools/testfiles/pbits/tpbitsOffsetNegative.ddl | 4 ++-- 10 files changed, 30 insertions(+), 18 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index c13b247..e7186c5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -312,6 +312,18 @@ Bug Fixes since HDF5-1.10.1 release ----- - h5dump + the tools library will hide the error stack during file open. + + While this is preferable almost always, there are reasons to enable + display of the error stack when a tool will not open a file. Adding an + optional argument to the --enable-error-stack will provide this use case. + As an optional argument it will not affect the operation of the + --enable-error-stack. h5dump is the only tool to implement this change. + + (ADB - 2018/02/15, HDFFV-10384) + + - h5dump + h5dump would output an indented blank line in the filters section. h5dump overused the h5tools_simple_prefix function, which is a diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 62f0ed0..25e4858 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -273,8 +273,8 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " -m T, --format=T Set the floating point output format\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, " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); - PRINTVALSTREAM(rawoutstream, " occur.\n"); + PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n"); + PRINTVALSTREAM(rawoutstream, " Optional value 2 also prints file open errors.\n"); PRINTVALSTREAM(rawoutstream, " --no-compact-subset Disable compact form of subsetting and allow the use\n"); PRINTVALSTREAM(rawoutstream, " of \"[\" in dataset names.\n"); PRINTVALSTREAM(rawoutstream, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n"); diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index fe22a1b..19de76f 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl index 767cbbf..0a3beb0 100644 --- a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl index d791b41..b353065 100644 --- a/tools/testfiles/pbits/tpbitsIncomplete.ddl +++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl index 5235aa7..ffe0da9 100644 --- a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl index 697bff8..4502143 100644 --- a/tools/testfiles/pbits/tpbitsLengthPositive.ddl +++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl index 900c0b5..011f6c9 100644 --- a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl index 65123d0..857fe62 100644 --- a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl index d352e34..9ac1160 100644 --- a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) -- cgit v0.12 From b65ec9d05b9301ec639fac03b26c6ec06e463888 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 16 Feb 2018 22:55:42 -0600 Subject: Fixed daily test failure Description: Added missing H5Pclose that caused daily test failure. Platforms tested: Linux/64 (jelly) Linux/64 (moohan) Darwin (osx1010test) --- test/set_extent.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/set_extent.c b/test/set_extent.c index 0467073..5d11819 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -427,6 +427,7 @@ error: */ static int do_layouts( hid_t fapl ) { + hid_t new_fapl = -1; H5F_libver_t low, high; /* Low and high bounds */ herr_t ret; /* Generic return value */ @@ -435,8 +436,6 @@ static int do_layouts( hid_t fapl ) for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - hid_t new_fapl; - /* Copy plist to use locally to avoid modifying the original */ new_fapl = H5Pcopy(fapl); @@ -446,7 +445,11 @@ static int do_layouts( hid_t fapl ) } H5E_END_TRY; if (ret < 0) /* Invalid low/high combinations */ + { + if (H5Pclose(new_fapl) < 0) + goto error; continue; + } if (test_layouts( H5D_COMPACT, new_fapl ) < 0) goto error; @@ -454,6 +457,8 @@ static int do_layouts( hid_t fapl ) if (test_layouts( H5D_CONTIGUOUS, new_fapl ) < 0) goto error; + if (H5Pclose(new_fapl) < 0) + goto error; } /* end for high */ } /* end for low */ @@ -462,6 +467,10 @@ static int do_layouts( hid_t fapl ) return 0; error: + H5E_BEGIN_TRY + { + H5Pclose(new_fapl); + } H5E_END_TRY; return -1; } -- cgit v0.12 From 39e3da756333d5c0e5f024d9067edbadea4a018b Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sat, 17 Feb 2018 16:18:37 -0600 Subject: Improving tests Description: - Added test for version bounds with nested datatypes - Added script for additional version bound test in h5repack - Cleaned up tests for consistency - Removed extra included header files Platforms tested: Linux/64 (jelly) Linux/64 (moohan) Darwin (osx1010test) --- test/dsets.c | 8 +- test/dtypes.c | 655 +++++++++++++++++++++++++++++-------- test/objcopy.c | 4 +- test/th5s.c | 4 - tools/test/h5repack/h5repack.sh.in | 96 +++++- 5 files changed, 616 insertions(+), 151 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 17cf23c..0788bc8 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -750,10 +750,10 @@ test_compact_io(hid_t fapl) hsize_t dims[2]; int wbuf[16][8], rbuf[16][8]; char filename[FILENAME_BUF_SIZE]; - H5F_libver_t low, high; /* File format bounds */ - H5F_t *fp; /* Internal file pointer */ - H5D_t *dsetp; /* Internal dataset pointer */ - int i, j, n; + H5F_libver_t low, high; /* File format bounds */ + H5F_t *fp; /* Internal file pointer */ + H5D_t *dsetp; /* Internal dataset pointer */ + int i, j, n; /* Indices */ herr_t ret; /* Generic return value */ TESTING("compact dataset I/O"); diff --git a/test/dtypes.c b/test/dtypes.c index 7e8047d..e480682 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -19,6 +19,7 @@ */ #include "h5test.h" +#include "testhdf5.h" #include "H5srcdir.h" #include "H5Iprivate.h" /* For checking that datatype id's don't leak */ @@ -46,6 +47,16 @@ #define H5T_FRIEND /*suppress error about including H5Tpkg */ #include "H5Tpkg.h" #endif + +/* Use in version bound test */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_TESTING +#include "H5Fpkg.h" /* File access */ + +/* Use in version bound test */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#include "H5Opkg.h" /* Object headers */ + #define SET_ALIGNMENT(TYPE,VAL) \ H5T_NATIVE_##TYPE##_ALIGN_g=MAX(H5T_NATIVE_##TYPE##_ALIGN_g, VAL) @@ -92,7 +103,15 @@ typedef enum dtype_t { INT_SCHAR, INT_UCHAR, INT_SHORT, INT_USHORT, INT_INT, INT_UINT, INT_LONG, INT_ULONG, INT_LLONG, INT_ULLONG, FLT_FLOAT, FLT_DOUBLE, FLT_LDOUBLE, OTHER -} dtype_t; +} dtype_t; /* This doesn't seem to be used anywhere... -BMR */ + +typedef enum { + E1_RED, + E1_GREEN, + E1_BLUE, + E1_ORANGE, + E1_YELLOW +} color_t; /* Constant for size of conversion buffer for int <-> float exception test */ #define CONVERT_SIZE 4 @@ -1678,7 +1697,7 @@ test_compound_9(void) { typedef struct cmpd_struct { int i1; - char* str; + const char* str; int i2; } cmpd_struct; @@ -2526,7 +2545,7 @@ test_compound_14(void) typedef struct cmpd_struct_1 { char c1; char c2; - char* str; + const char* str; } cmpd_struct_1; typedef struct cmpd_struct_2 { @@ -3299,7 +3318,7 @@ test_compound_18(void) /* Create compound datatype, but don't insert fields */ tid = H5Tcreate(H5T_COMPOUND, (size_t)8); - assert(tid > 0); + HDassert(tid > 0); /* Attempt to create file with compound datatype that has no fields */ /* Create File */ @@ -3308,7 +3327,7 @@ test_compound_18(void) /* Create a dataspace to use */ sid = H5Screate_simple(1, &dim, NULL); - assert(sid > 0); + HDassert(sid > 0); /* Create a dataset with the bad compound datatype */ H5E_BEGIN_TRY { @@ -3321,7 +3340,7 @@ test_compound_18(void) /* Create a group */ gid = H5Gcreate2(file, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(gid > 0); + HDassert(gid > 0); /* Create an attribute with the bad compound datatype */ H5E_BEGIN_TRY { @@ -4672,7 +4691,7 @@ test_conv_enum_2(void) /* Destination enum type */ dsttype = H5Tenum_create(H5T_NATIVE_INT); - assert(H5Tget_size(dsttype) > H5Tget_size(srctype)); + HDassert(H5Tget_size(dsttype) > H5Tget_size(srctype)); for (i=0; i<8; i++) H5Tenum_insert(dsttype, mname[i], &i); @@ -6682,7 +6701,7 @@ error: } /* end test_named_indirect_reopen() */ static void create_del_obj_named_test_file(const char *filename, hid_t fapl, - hbool_t new_format) + H5F_libver_t low, H5F_libver_t high) { hid_t file; /* File ID */ hid_t type; /* Datatype ID */ @@ -6692,93 +6711,97 @@ static void create_del_obj_named_test_file(const char *filename, hid_t fapl, hid_t fcpl; /* File creation property list ID */ hid_t my_fapl; /* Copy of file access property list ID */ hid_t dcpl; /* Dataset creation property list ID */ + unsigned use_at_least_v18;/* Whether to use old or new format */ herr_t status; /* Generic return value */ /* Make copy of FAPL */ my_fapl = H5Pcopy(fapl); - assert(my_fapl > 0); + HDassert(my_fapl > 0); - if(new_format) { - /* Use latest version of file format */ - status = H5Pset_libver_bounds(my_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - assert(status >= 0); - } /* end if */ + /* Use low/high version of file format */ + status = H5Pset_libver_bounds(my_fapl, low, high); + HDassert(status >= 0); + + /* Set new format flag. Note: the case high < low should be caught in the caller */ + use_at_least_v18 = 0; + if (low >= H5F_LIBVER_V18) + use_at_least_v18 = 1; /* Create a file creation property list (used for the root group's creation property list) */ fcpl = H5Pcreate(H5P_FILE_CREATE); - assert(fcpl > 0); + HDassert(fcpl > 0); - if(new_format) { + if(use_at_least_v18) { /* Use dense link storage for all links in root group */ status = H5Pset_link_phase_change(fcpl, 0, 0); - assert(status >= 0); + HDassert(status >= 0); } /* end if */ /* Create file with attribute that uses committed datatype */ file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, my_fapl); - assert(file > 0); + HDassert(file > 0); /* Close FCPL */ status = H5Pclose(fcpl); - assert(status >= 0); + HDassert(status >= 0); /* Close FAPL */ status = H5Pclose(my_fapl); - assert(status >= 0); + HDassert(status >= 0); /* Create datatype to commit */ type = H5Tvlen_create(H5T_NATIVE_INT); - assert(type > 0); + HDassert(type > 0); /* Commit datatype */ status = H5Tcommit2(file, DEL_OBJ_NAMED_NAMED_DTYPE, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(status >= 0); + HDassert(status >= 0); /* Create scalar dataspace */ space = H5Screate(H5S_SCALAR); - assert(space > 0); + HDassert(space > 0); /* Create a dataset creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - assert(dcpl > 0); + HDassert(dcpl > 0); - if(new_format) { + if(use_at_least_v18) { /* Use dense attribute storage for all attributes on dataset */ status = H5Pset_attr_phase_change(dcpl, 0, 0); - assert(status >= 0); + HDassert(status >= 0); } /* end if */ /* Create dataset */ dset = H5Dcreate2(file, DEL_OBJ_NAMED_DATASET, type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); - assert(dset > 0); + HDassert(dset > 0); /* Close DCPL */ status = H5Pclose(dcpl); - assert(status >= 0); + HDassert(status >= 0); /* Close dataset */ status = H5Dclose(dset); - assert(status >= 0); + HDassert(status >= 0); /* Create attribute */ attr = H5Acreate_by_name(file, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(attr > 0); + HDassert(attr > 0); /* Close dataspace */ status = H5Sclose(space); - assert(status >= 0); + HDassert(status >= 0); /* Close datatype */ status = H5Tclose(type); - assert(status >= 0); + HDassert(status >= 0); /* Close attribute */ status = H5Aclose(attr); - assert(status >= 0); + HDassert(status >= 0); /* Close file */ status = H5Fclose(file); - assert(status >= 0); + HDassert(status >= 0); } /* end create_del_obj_named_test_file() */ @@ -6803,7 +6826,7 @@ test_delete_obj_named(hid_t fapl) hid_t attr = -1; /* Attribute ID */ hid_t dset = -1; /* Dataset ID */ hid_t fapl2 = -1; /* File access property list ID */ - unsigned new_format; /* Whether to use old or new format */ + H5F_libver_t low, high; /* File format bounds */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); @@ -6813,47 +6836,54 @@ test_delete_obj_named(hid_t fapl) h5_fixname(FILENAME[8], fapl, filename, sizeof filename); h5_fixname(FILENAME[9], fapl2, filename2, sizeof filename2); - /* Loop over old & new format files */ - for(new_format = FALSE; new_format <= TRUE; new_format++) { - /* Create test file, with attribute that uses committed datatype */ - create_del_obj_named_test_file(filename, fapl, new_format); + /* Loop through all valid the combinations of low/high library format bounds, + to test delete objects that use named datatypes through different file IDs */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { -/* Test deleting dataset opened through different file ID */ - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + /* Skip invalid low/high combination */ + if ((high == H5F_LIBVER_EARLIEST) || (low > high)) + continue; - if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, low, high); - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + /* Test deleting dataset opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR - if(H5Ldelete(filea2, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR - if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + if(H5Ldelete(filea2, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT) < 0) FAIL_STACK_ERROR - /* Create test file, with attribute that uses committed datatype */ - create_del_obj_named_test_file(filename, fapl, new_format); + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR -/* Test deleting attribute opened through different file ID */ - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, low, high); - if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Aclose(attr) < 0) FAIL_STACK_ERROR + /* Test deleting attribute opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Aclose(attr) < 0) FAIL_STACK_ERROR - if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if(H5Adelete_by_name(filea2, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR - if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR - if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR - } /* end for */ + if(H5Adelete_by_name(filea2, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + } /* end high */ + } /* end low */ if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR @@ -6898,7 +6928,7 @@ test_delete_obj_named_fileid(hid_t fapl) hid_t attr = -1; /* Attribute ID */ hid_t dset = -1; /* Dataset ID */ hid_t fapl2 = -1; /* File access property list ID */ - unsigned new_format; /* Whether to use old or new format */ + H5F_libver_t low, high; /* File format bounds */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); @@ -6908,108 +6938,115 @@ test_delete_obj_named_fileid(hid_t fapl) h5_fixname(FILENAME[8], fapl, filename, sizeof filename); h5_fixname(FILENAME[9], fapl2, filename2, sizeof filename2); - /* Loop over old & new format files */ - for(new_format = FALSE; new_format <= TRUE; new_format++) { - /* Create test file, with attribute that uses committed datatype */ - create_del_obj_named_test_file(filename, fapl, new_format); + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { -/* Test getting file ID for dataset opened through different file ID */ - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + /* Skip invalid low/high combination */ + if ((high == H5F_LIBVER_EARLIEST) || (low > high)) + continue; - if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, low, high); - if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + /* Test getting file ID for dataset opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - /* Verify file ID from dataset matches correct file */ - dset_fid = H5Iget_file_id(dset); - if(dset_fid != filea1) TEST_ERROR - H5Fclose(dset_fid); + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - /* Verify file ID from datatype (from dataset) matches correct file */ - type = H5Dget_type(dset); - type_fid = H5Iget_file_id(type); - if(type_fid != filea1) TEST_ERROR - H5Fclose(type_fid); - H5Tclose(type); + if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + /* Verify file ID from dataset matches correct file */ + dset_fid = H5Iget_file_id(dset); + if(dset_fid != filea1) TEST_ERROR + H5Fclose(dset_fid); - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Dget_type(dset); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); - if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR - /* Verify file ID from dataset matches correct file */ - dset_fid = H5Iget_file_id(dset); - if(dset_fid != filea1) TEST_ERROR - H5Fclose(dset_fid); + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - /* Verify file ID from datatype (from dataset) matches correct file */ - type = H5Dget_type(dset); - type_fid = H5Iget_file_id(type); - if(type_fid != filea1) TEST_ERROR - H5Fclose(type_fid); - H5Tclose(type); + if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + /* Verify file ID from dataset matches correct file */ + dset_fid = H5Iget_file_id(dset); + if(dset_fid != filea1) TEST_ERROR + H5Fclose(dset_fid); - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR - if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Dget_type(dset); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR - /* Create test file, with attribute that uses committed datatype */ - create_del_obj_named_test_file(filename, fapl, new_format); + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR -/* Test getting file ID for attribute opened through different file ID */ - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, low, high); - /* Verify file ID from dataset matches correct file */ - attr_fid = H5Iget_file_id(attr); - if(attr_fid != filea1) TEST_ERROR - H5Fclose(attr_fid); + /* Test getting file ID for attribute opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - /* Verify file ID from datatype (from dataset) matches correct file */ - type = H5Aget_type(attr); - type_fid = H5Iget_file_id(type); - if(type_fid != filea1) TEST_ERROR - H5Fclose(type_fid); - H5Tclose(type); + if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Aclose(attr) < 0) FAIL_STACK_ERROR + /* Verify file ID from dataset matches correct file */ + attr_fid = H5Iget_file_id(attr); + if(attr_fid != filea1) TEST_ERROR + H5Fclose(attr_fid); - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Aget_type(attr); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); - if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + if(H5Aclose(attr) < 0) FAIL_STACK_ERROR - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR - /* Verify file ID from dataset matches correct file */ - attr_fid = H5Iget_file_id(attr); - if(attr_fid != filea1) TEST_ERROR - H5Fclose(attr_fid); + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - /* Verify file ID from datatype (from dataset) matches correct file */ - type = H5Aget_type(attr); - type_fid = H5Iget_file_id(type); - if(type_fid != filea1) TEST_ERROR - H5Fclose(type_fid); - H5Tclose(type); + if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Aclose(attr) < 0) FAIL_STACK_ERROR + /* Verify file ID from dataset matches correct file */ + attr_fid = H5Iget_file_id(attr); + if(attr_fid != filea1) TEST_ERROR + H5Fclose(attr_fid); - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR - if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR - } /* end for */ + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Aget_type(attr); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); + + if(H5Aclose(attr) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + } /* end high */ + } /* end low */ if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR @@ -7018,12 +7055,15 @@ test_delete_obj_named_fileid(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(attr); + H5Aclose(attr); + H5Tclose(type); H5Dclose(dset); H5Pclose(fapl2); H5Fclose(filea1); H5Fclose(filea2); H5Fclose(fileb); + H5Fclose(attr_fid); + H5Fclose(type_fid); } H5E_END_TRY; return 1; } /* end test_delete_obj_named_fileid() */ @@ -7388,7 +7428,344 @@ error: return 1; } +/*------------------------------------------------------------------------- + * Function: verify_version + * + * Purpose: Utility function to verify the datatype versions of nested + * datatype. + * + * Description: + * Verify the datatype message version + * --H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: + * the library will set version according to low_bound + * --H5T_ARRAY: + * the earliest version the library will set is 2 + * --H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, + * H5T_OPAQUE, H5T_REFERENCE: + * the library will only use basic version + * + *************************************************************************/ +static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_shared_low_bound, unsigned *highest_version) +{ + H5T_t *dtypep = NULL; /* Internal structure of a datatype */ + H5T_class_t type_cls = H5T_NO_CLASS; /* Temporary var for datatype class */ + hid_t base_dtype = -1; + hid_t mem_dtype = -1; + int nmembers = 0; + unsigned i; + H5F_libver_t highest = H5F_LIBVER_EARLIEST; + herr_t ret = SUCCEED; /* Generic return value */ + + dtypep = (H5T_t *)H5I_object(dtype); + if (dtypep == NULL) TEST_ERROR + + /* Carry out the verification according to the class of the datatype. + For compound datatype, its members will be verified, recursively. + For array datatype, its element datatype will be verified, recursively.*/ + type_cls = dtypep->shared->type; + switch (type_cls) + { + case H5T_ARRAY: + + if (low == H5F_LIBVER_EARLIEST) + VERIFY(dtypep->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); + else + VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "H5O_dtype_ver_bounds"); + + /* Get the base datatype of this array type */ + base_dtype = H5Tget_super(dtype); + CHECK(base_dtype, FAIL, "H5Tget_super"); + + /* Verify the base datatype recursively */ + ret = verify_version(base_dtype, low, f_shared_low_bound, highest_version); + + /* Close the member datatype before checking for failure */ + if ((H5Tclose(base_dtype)) < 0) TEST_ERROR + + /* Check if verify_version fails */ + if (ret < 0) TEST_ERROR + + break; + case H5T_COMPOUND: + /* Get the number of members of this compound type */ + if ((nmembers = H5Tget_nmembers(dtype)) < 0) TEST_ERROR + + /* Go through all its member datatypes */ + for (i = 0; i < (unsigned)nmembers; i++) + { + /* Get the member datatype and verify it recursively */ + mem_dtype = H5Tget_member_type(dtype, i); + if (mem_dtype < 0) TEST_ERROR + ret = verify_version(mem_dtype, low, f_shared_low_bound, highest_version); + + /* Close the member datatype before checking for failure */ + if ((H5Tclose(mem_dtype)) < 0) TEST_ERROR + + /* Check if verify_version fails */ + if (ret < 0) TEST_ERROR + } + /* If this compound datatype contains a datatype of higher version, it + will be promoted to that version */ + if (*highest_version > H5O_dtype_ver_bounds[low]) + VERIFY(dtypep->shared->version, *highest_version, "verify_version"); + else + VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "verify_version"); + break; + case H5T_ENUM: + VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "verify_version"); + break; + case H5T_VLEN: + case H5T_FLOAT: + case H5T_INTEGER: + VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "verify_version"); + break; + case H5T_NCLASSES: + case H5T_NO_CLASS: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + default: + TEST_ERROR + } /* end switch */ + +error: + H5E_BEGIN_TRY { + H5Tclose(base_dtype); + H5Tclose(mem_dtype); + } H5E_END_TRY; + return ret; +} /* end of verify_version */ + + +/*------------------------------------------------------------------------- + * Function: test_versionbounds + * + * Purpose: Tests version bounds. + * + * Description: + * This function creates a datatype for a dataset as followed: + * outer_arr_type + * outer_cmp_type + * inner_cmp_type + * inner_arr_type + * simple_cmp_type + * H5T_NATIVE_INT + * H5T_ARRAY of H5T_NATIVE_CHAR + * vlen_floattype + * enum_type + * It then loops through all valid combination of the library version + * bounds to verify each datatype's version. + * + * Return: Success: 0 + * Failure: number of errors + * + *------------------------------------------------------------------------- + */ +#define VERFNAME "tverbounds_dtype.h5" +#define VERDSNAME "dataset 1" +#define ARRAY_RANK 1 +#define ARRAY_LEN 10 +static int +test_versionbounds(void) +{ + typedef struct { /* Struct for the simple compound type */ + int single_int; + char char_arr[ARRAY_LEN]; + } simple_cmp_t; + + typedef struct { /* Struct for the inner compound type */ + simple_cmp_t inner_arr[ARRAY_LEN]; + hvl_t vlen_float; + } inner_cmp_t; + + typedef struct { /* Struct for the outer compound type */ + inner_cmp_t inner_cmp; + color_t enum_color; + } outer_cmp_t; + + hid_t file = -1; /* File ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t fapl = -1; /* Copy of file access property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t dset_dtype = -1; /* Dataset's datatype */ + hid_t arr_chartype = -1; /* Array of characters datatype */ + hid_t vlen_floattype = -1; /* Vlen of float datatype */ + hid_t enum_type = -1; /* Enumeration datatype */ + hid_t outer_cmp_type = -1; /* Outer compound datatype */ + hid_t inner_cmp_type = -1; /* Inner compound datatype */ + hid_t simple_cmp_type = -1;/* Simple cmpd dtype, contains no other cmpd */ + hid_t outer_arr_type = -1; /* Outermost array datatype */ + hid_t inner_arr_type = -1; /* Inner array datatype */ + H5F_t *filep = NULL; /* Pointer to internal structure of a file */ + H5T_t *dtypep = NULL; /* Pointer to internal structure of a datatype */ + hsize_t arr_dim[] = {ARRAY_LEN}; /* Length of the array */ + H5F_libver_t low, high; /* File format bounds */ + unsigned highest_version; /* Highest version in nested datatypes */ + color_t enum_val; /* Enum type index */ + herr_t ret = 0; /* Generic return value */ + + TESTING("version bounds with nested datatypes"); + + /* Create a file access property list */ + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR + + /* Create a file creation property list */ + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR + + /* Create a scalar dataspace */ + if ((space = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR + + /* Create a dataset creation property list */ + if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR + + /* Create an array datatype of chars */ + arr_chartype = H5Tarray_create2(H5T_NATIVE_CHAR, ARRAY_RANK, arr_dim); + if (arr_chartype < 0) TEST_ERROR + + /* Create the simple compound datatype that has an integer and an + array of chars */ + simple_cmp_type = H5Tcreate(H5T_COMPOUND, sizeof(simple_cmp_t)); + if (simple_cmp_type < 0) TEST_ERROR + + /* Insert integer field */ + ret = H5Tinsert(simple_cmp_type, "single_int", HOFFSET(simple_cmp_t, single_int), H5T_NATIVE_INT); + if (ret < 0) TEST_ERROR + /* Insert array field */ + ret = H5Tinsert(simple_cmp_type, "char_arr", HOFFSET(simple_cmp_t, char_arr), arr_chartype); + if (ret < 0) TEST_ERROR + + /* Create an array datatype containing simple compound datatype */ + inner_arr_type = H5Tarray_create2(simple_cmp_type, ARRAY_RANK, arr_dim); + if (inner_arr_type < 0) TEST_ERROR + + /* Create a VL datatype of floats */ + vlen_floattype = H5Tvlen_create(H5T_NATIVE_FLOAT); + if (vlen_floattype < 0) TEST_ERROR + + /* Create the innermost compound datatype that houses inner_arr_type and vlen_floattype */ + inner_cmp_type = H5Tcreate(H5T_COMPOUND, sizeof(inner_cmp_t)); + if (inner_cmp_type < 0) TEST_ERROR + + /* Insert integer field */ + ret = H5Tinsert(inner_cmp_type, "inner_arr", HOFFSET(inner_cmp_t, inner_arr), inner_arr_type); + if (ret < 0) TEST_ERROR + + /* Insert integer field */ + ret = H5Tinsert(inner_cmp_type, "vlen_float", HOFFSET(inner_cmp_t, vlen_float), vlen_floattype); + if (ret < 0) TEST_ERROR + + /* Create a enumerate datatype */ + enum_type = H5Tcreate(H5T_ENUM, sizeof(short)); + if (enum_type < 0) TEST_ERROR + + enum_val = E1_RED; + ret = H5Tenum_insert(enum_type, "RED", &enum_val); + if (ret < 0) TEST_ERROR + + enum_val++; + ret = H5Tenum_insert(enum_type, "GREEN", &enum_val); + if (ret < 0) TEST_ERROR + + enum_val++; + ret = H5Tenum_insert(enum_type, "BLUE", &enum_val); + if (ret < 0) TEST_ERROR + + enum_val++; + ret = H5Tenum_insert(enum_type, "ORANGE", &enum_val); + if (ret < 0) TEST_ERROR + + enum_val++; + ret = H5Tenum_insert(enum_type, "YELLOW", &enum_val); + if (ret < 0) TEST_ERROR + + /* Create the outer compound datatype that contains the inner compound datatype and the enum datatype */ + outer_cmp_type = H5Tcreate(H5T_COMPOUND, sizeof(outer_cmp_t)); + if (ret < 0) TEST_ERROR + + /* Insert integer field */ + ret = H5Tinsert(outer_cmp_type, "inner_cmp", HOFFSET(outer_cmp_t, inner_cmp), inner_cmp_type); + if (ret < 0) TEST_ERROR + + /* Insert enum field */ + ret = H5Tinsert(outer_cmp_type, "enum_color", HOFFSET(outer_cmp_t, enum_color), enum_type); + if (ret < 0) TEST_ERROR + + /* Create an array datatype containing the outer compound datatype */ + if ((outer_arr_type = H5Tarray_create2(outer_cmp_type, ARRAY_RANK, arr_dim)) < 0) + TEST_ERROR + + /* Loop through all the combinations of low/high library format bounds, + skipping invalid combinations */ + /* Create the file, create and write to a dataset with compound datatype */ + /* Verify the dataset's datatype and its members */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + /* Set version bounds */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Create a file */ + file = H5Fcreate(VERFNAME, H5F_ACC_TRUNC, fcpl, fapl); + if (file < 0) TEST_ERROR + + /* Get the internal file pointer if the create succeeds */ + if ((filep = (H5F_t *)H5I_object(file)) == NULL) TEST_ERROR + + /* Create dataset using the array type */ + dset = H5Dcreate2(file, VERDSNAME, outer_arr_type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR + + /* Get the dataset's datatype */ + if ((dset_dtype = H5Dget_type(dset)) < 0) TEST_ERROR + + /* Get the version of this datatype */ + dtypep = (H5T_t *)H5I_object(dset_dtype); + if (dtypep == NULL) TEST_ERROR + highest_version = dtypep->shared->version; + + /* Verify version of the datatype recursevily */ + ret = verify_version(dset_dtype, low, filep->shared->low_bound, &highest_version); + + /* Close the dataset's datatype */ + if (H5Tclose(dset_dtype) < 0) TEST_ERROR + + /* Close dataset and file */ + if (H5Dclose(dset) < 0) TEST_ERROR + if (H5Fclose(file) < 0) TEST_ERROR + + } /* for high */ + } /* for low */ + + /* Close dataspace and property lists */ + if (H5Sclose(space) < 0) TEST_ERROR + if (H5Pclose(fcpl) < 0) TEST_ERROR + if (H5Pclose(fapl) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Tclose(dset_dtype); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(file); + } H5E_END_TRY; + return 1; +} /* end test_versionbounds() */ /*------------------------------------------------------------------------- @@ -7411,7 +7788,7 @@ int main(void) { long nerrors = 0; - hid_t fapl = -1; + hid_t fapl = -1; /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); @@ -7428,7 +7805,6 @@ main(void) nerrors += test_detect(); nerrors += test_compound_1(); nerrors += test_query(); - nerrors += test_transient(fapl); nerrors += test_named(fapl); nerrors += test_encode(); @@ -7473,6 +7849,7 @@ main(void) nerrors += test_opaque(); nerrors += test_set_order(); nerrors += test_utf_ascii_conv(); + nerrors += test_versionbounds(); if(nerrors) { printf("***** %lu FAILURE%s! *****\n", diff --git a/test/objcopy.c b/test/objcopy.c index 5d9d426..e88d508 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -14271,10 +14271,10 @@ main(void) FALSE, "H5Ocopy(): expand soft link"); nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_EXPAND_EXT_LINK_FLAG, - FALSE, "H5Ocopy: expand external link"); + FALSE, "H5Ocopy(): expand external link"); nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_EXPAND_SOFT_LINK_FLAG | H5O_COPY_EXPAND_EXT_LINK_FLAG, - FALSE, "H5Ocopy: expand soft and external links"); + FALSE, "H5Ocopy(): expand soft and external links"); nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_SHALLOW_HIERARCHY_FLAG, FALSE, "H5Ocopy(): shallow group copy"); diff --git a/test/th5s.c b/test/th5s.c index 0b0a2e7..0619571 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -41,10 +41,6 @@ #define H5O_TESTING #include "H5Opkg.h" /* Object header */ -#include "H5Bprivate.h" -#include "H5Sprivate.h" -#include "H5Pprivate.h" - #define TESTFILE "th5s.h5" #define DATAFILE "th5s1.h5" #define NULLFILE "th5s2.h5" diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index e474bc3..a34b75c 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -340,8 +340,8 @@ VERIFY_LAYOUT_DSET() fi # clean up tmp files - rm -f $outfile - rm -f $layoutfile +# rm -f $outfile +# rm -f $layoutfile } #------------------------------------------ @@ -513,6 +513,86 @@ VERIFY_LAYOUT_ALL() rm -f $layoutfile } +#-------------------------------------------------------------- +# Verifying superblock of a file with different version bounds +VERIFY_SUPERBLOCK() +{ + lowbound=$1 + highbound=$2 + superblock=$3 + infile=$4 + layoutfile=verbounds-low$lowbound-high$highbound.$4 + outfile=out-verbounds-low$lowbound-high$highbound.$infile + expectedsuperblock="SUPERBLOCK_VERSION $superblock" + + shift + shift + shift + shift + + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile +echo "$RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile" + ) + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi + + #--------------------------------- + # check the layout from a dataset + VERIFY "superblock" + ( + cd $TESTDIR + $RUNSERIAL $H5DUMP_BIN -H -B $outfile > $layoutfile + ) + $GREP "$expectedsuperblock" $TESTDIR/$layoutfile > /dev/null + if [ $? -eq 0 ]; then + echo " PASSED" + else + echo " FAILED" + nerrors="`expr $nerrors + 1`" + fi + + # clean up tmp files + rm -f $outfile + rm -f $layoutfile + +} # end of VERIFY_SUPERBLOCK + +#------------------------------------------------------------------ +# Verifying that a latest file cannot be opened with earlier bounds +VERIFY_INVALIDBOUNDS() +{ + lowbound=$1 + highbound=$2 + infile=$3 + outfile=out-verbounds-low$lowbound-high$highbound.$infile + + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile + ) + RET=$? + if [ $RET != 0 ] ; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + fi + + # clean up tmp files + rm -f $outfile + +} # end of VERIFY_INVALIDBOUNDS + # same as TOOLTEST, but it uses the old syntax -i input_file -o output_file # TOOLTEST0() @@ -1365,6 +1445,18 @@ else VERIFY_LAYOUT_VDS vds_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI fi +######################################################### +# Testing version bounds +######################################################### +# -j 0 -k 2, superblock will be 0 +VERIFY_SUPERBLOCK 0 2 0 h5repack_layout.h5 -j 0 -k 2 h5repack_layout.h5 +# -j 1 -k 2, superblock will be 2 +VERIFY_SUPERBLOCK 1 2 2 h5repack_layout.h5 -j 1 -k 2 h5repack_layout.h5 +# -j 2 -k 2, superblock will be 3 +VERIFY_SUPERBLOCK 2 2 3 h5repack_layout.h5 -j 2 -k 2 h5repack_layout.h5 +# -j 0 -k 1, file cannot be opened +VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5 + # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR -- cgit v0.12 From 2fb0b8c3538df641deca73a8a694996bb5e61cdd Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Sun, 18 Feb 2018 20:24:15 -0600 Subject: Fix for daily test failure for test/fheap.c The failure occurs when HDF5TestExpress is set to 0. The check for file size check fails due to persisting free-space when creating the file. The fix is to set libver bounds (v18, latest) when creating the test file. --- test/fheap.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/fheap.c b/test/fheap.c index 6c3a8ac..1be952f 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -16458,6 +16458,33 @@ main(void) if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) TEST_ERROR fapl = def_fapl; + /* This is a fix for the daily test failure from the checkin for libver bounds. */ + /* + * Many tests failed the file size check when comparing (a) and (b) as below: + * --Create a file and close the file. Got the initial file size (a). + * --Reopen the file, perform fractal heap operations, and close the file. + * Got the file size (b). + * The cause for the file size differences: + * When the file is initially created with persisting free-space and with + * (earliest, latest) libver bounds, the file will have version 2 superblock + * due to non-default free-space handling. As the low bound is earliest, + * the library uses version 1 object header when creating the superblock + * extension message. + * When the file is reopened with the same libver bounds, the file's low + * bound is upgraded to v18 because the file has version 2 superblock. + * When the library creates the superblock extension message on file close, + * the library uses version 2 object header for the superblock extension + * message since the low bound is v18. + * This leads to the discrepancy in file sizes as the file is persisting + * free-space and there is object header version differences. + * The fix: + * Set libver bounds in fapl to (v18, latest) so that the file created in the + * test routines will have low bound set to v18. This will cause the + * library to use version 2 object header for the superblock extension + * message. + */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) + TEST_ERROR break; case 2: if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0) -- cgit v0.12 From 30166fed18a9b0754d56b3454176e3a5111a1e21 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Feb 2018 08:32:15 -0600 Subject: Fix indentation --- 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 226f58e..8f0178f 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -667,8 +667,8 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'E': - enable_error_stack = 1; - break; + enable_error_stack = 1; + break; default: break; -- cgit v0.12 From 0d912d463206762d8dfe5fa46fd2318b1ee50123 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Feb 2018 16:23:07 -0600 Subject: HDFFV-10412 moved check back into normal path --- release_docs/RELEASE.txt | 12 +++++++++++ tools/src/h5repack/h5repack_filters.c | 40 +++++++++++++++++------------------ 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e7186c5..4675423 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -310,6 +310,18 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5repack + + h5repack changes the chunk parameters when a change of layout is not + specified and a filter is applied. + + HDFFV-10297, HDFFV-10319 reworked code for h5repack and h5diff code + in the tools library. The check for an existing layout was incorrectly + placed into an if block and not executed. The check was moved into + the normal path of the function. + + (ADB - 2018/02/21, HDFFV-10412) + - h5dump the tools library will hide the error stack during file open. diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index ae0bfd5..253be6d 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -280,33 +280,33 @@ int apply_filters(const char* name, /* object name from traverse list */ *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]; - } - } } else if(nfilters) { - *has_filter = 1; + *has_filter = 1; if (aux_copy_obj(dcpl_id, name, &filtobj) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "aux_copy_obj 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]; + } + } + + /*------------------------------------------------------------------------- * the type of filter and additional parameter * type can be one of the filters * H5Z_FILTER_NONE 0 , uncompress if compressed -- cgit v0.12 From b996ee29726b820869776620c6a9f496c4823762 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Feb 2018 16:29:41 -0600 Subject: HDFFV-10412 fix typo --- tools/src/h5repack/h5repack_filters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index 253be6d..0092abc 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -282,7 +282,7 @@ int apply_filters(const char* name, /* object name from traverse list */ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); } else if(nfilters) { - *has_filter = 1; + *has_filter = 1; if (aux_copy_obj(dcpl_id, name, &filtobj) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "aux_copy_obj failed"); } -- cgit v0.12 From 76a0003f96f8e1336062089380adc95f8b3dee56 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 22 Feb 2018 10:18:17 -0600 Subject: HDFFV-10412 update test ref files --- tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl | 4 ++-- tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl | 2 +- .../h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 1dcc742..75f54fa 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 ( 40, 20 ) - SIZE 1150 (2.783:1 COMPRESSION) + CHUNKED ( 20, 10 ) + SIZE 1283 (2.494:1 COMPRESSION) } FILTERS { COMPRESSION DEFLATE { LEVEL 1 } 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 4856f84..a8b4562 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 ( 40, 20 ) + CHUNKED ( 20, 10 ) 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 5a1ebe7..a1fc0cb 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 ( 40, 20 ) + CHUNKED ( 20, 10 ) SIZE 3200 (1.000:1 COMPRESSION) } FILTERS { -- cgit v0.12 From 1e5b67c1dc8672206f2489854188f43a590aea14 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 26 Feb 2018 12:22:32 -0800 Subject: Fix for HDFFV-10354 (CVE-2017-17505). --- release_docs/RELEASE.txt | 23 +++++++++++++++++++++++ src/H5Opline.c | 44 +++++++++++++++++++++++++++++--------------- 2 files changed, 52 insertions(+), 15 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4675423..1917fb2 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -232,6 +232,29 @@ Bug Fixes since HDF5-1.10.1 release (DER - 2017/11/21, HDFFV-10330) + - If an HDF5 file contains a filter pipeline message with a 'number of + filters' field that exceeds the maximum number of allowed filters, + the error handling code will attempt to dereference a NULL pointer. + + This issue was reported to The HDF Group as issue #CVE-2017-17505. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + This problem arose because the error handling code assumed that + the 'number of filters' field implied that a dynamic array of that + size had already been created and that the cleanup code should + iterate over that array and clean up each element's resources. If + an error occurred before the array has been allocated, this will + not be true. + + This has been changed so that the number of filters is set to + zero on errors. Additionally, the filter array traversal in the + error handling code now requires that the filter array not be NULL. + + (DER - 2018/02/06, HDFFV-10354) + Configuration ------------- - CMake diff --git a/src/H5Opline.c b/src/H5Opline.c index e817f9a..5e2f9b6 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -139,8 +139,15 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 /* Number of filters */ pline->nused = *p++; - if(pline->nused > H5Z_MAX_NFILTERS) - HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "filter pipeline message has too many filters") + if(pline->nused > H5Z_MAX_NFILTERS) { + + /* Reset the number of filters used to avoid array traversal in error + * handling code. + */ + pline->nused = 0; + + HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "filter pipeline message has too many filters") + } /* Reserved */ if(pline->version == H5O_PLINE_VERSION_1) @@ -502,23 +509,30 @@ H5O_pline_reset(void *mesg) FUNC_ENTER_NOAPI_NOINIT_NOERR + /* NOTE: This function can be called during error processing from + * other API calls so DO NOT ASSUME THAT ANY VALUES ARE SANE. + */ + HDassert(pline); - /* Free information for each filter */ - for(i = 0; i < pline->nused; i++) { - if(pline->filter[i].name && pline->filter[i].name != pline->filter[i]._name) - HDassert((HDstrlen(pline->filter[i].name) + 1) > H5Z_COMMON_NAME_LEN); - if(pline->filter[i].name != pline->filter[i]._name) - pline->filter[i].name = (char *)H5MM_xfree(pline->filter[i].name); - if(pline->filter[i].cd_values && pline->filter[i].cd_values != pline->filter[i]._cd_values) - HDassert(pline->filter[i].cd_nelmts > H5Z_COMMON_CD_VALUES); - if(pline->filter[i].cd_values != pline->filter[i]._cd_values) - pline->filter[i].cd_values = (unsigned *)H5MM_xfree(pline->filter[i].cd_values); - } /* end for */ + /* Free the filter information and array */ + if (pline->filter) { + + /* Free information for each filter */ + for(i = 0; i < pline->nused; i++) { + if(pline->filter[i].name && pline->filter[i].name != pline->filter[i]._name) + HDassert((HDstrlen(pline->filter[i].name) + 1) > H5Z_COMMON_NAME_LEN); + if(pline->filter[i].name != pline->filter[i]._name) + pline->filter[i].name = (char *)H5MM_xfree(pline->filter[i].name); + if(pline->filter[i].cd_values && pline->filter[i].cd_values != pline->filter[i]._cd_values) + HDassert(pline->filter[i].cd_nelmts > H5Z_COMMON_CD_VALUES); + if(pline->filter[i].cd_values != pline->filter[i]._cd_values) + pline->filter[i].cd_values = (unsigned *)H5MM_xfree(pline->filter[i].cd_values); + } /* end for */ - /* Free filter array */ - if(pline->filter) + /* Free filter array */ pline->filter = (H5Z_filter_info_t *)H5MM_xfree(pline->filter); + } /* Reset # of filters */ pline->nused = pline->nalloc = 0; -- cgit v0.12 From a4f0666ecdd0f48081e43eef2e792d791044e549 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 26 Feb 2018 16:13:25 -0600 Subject: Update list --- release_docs/INSTALL_CMake.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 8c72685..64eb1d2 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -564,7 +564,6 @@ HDF5_BUILD_TOOLS "Build HDF5 Tools" ON 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 HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF @@ -584,6 +583,8 @@ HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" HDF5_NO_PACKAGES "Do not include CPack Packaging" OFF HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF HDF5_PACK_MACOSX_FRAMEWORK "Package the HDF5 Library in a Frameworks" OFF +HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, + FALSE to build according to BUILD_SHARED_LIBS" FALSE HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF HDF_TEST_EXPRESS "Control testing framework (0-3)" "0" @@ -597,7 +598,7 @@ HDF5_ENABLE_THREADSAFE "Enable Threadsafety" if (APPLE) HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF if (CMAKE_BUILD_TYPE MATCHES Debug) - HDF5_ENABLE_TRACE "Enable API tracing capability" ON + HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF if (HDF5_TEST_VFD) HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON -- cgit v0.12 From 302053f978e38a8d4306a7c1233cdf8fd2ec28dd Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 26 Feb 2018 18:31:40 -0800 Subject: Fix for HDFFV-10355 (CVE-2017-17506). --- release_docs/RELEASE.txt | 19 ++++++++++++++++++ src/H5Abtree2.c | 4 ++-- src/H5Adense.c | 4 ++-- src/H5Gbtree2.c | 4 ++-- src/H5Gdense.c | 20 +++++++++---------- src/H5HFcache.c | 2 +- src/H5Oainfo.c | 5 +++-- src/H5Oattr.c | 8 ++++---- src/H5Obogus.c | 5 +++-- src/H5Obtreek.c | 5 +++-- src/H5Ocache.c | 4 ++-- src/H5Ocache_image.c | 4 ++-- src/H5Ocont.c | 5 +++-- src/H5Odrvinfo.c | 5 +++-- src/H5Odtype.c | 4 ++-- src/H5Oefl.c | 5 +++-- src/H5Ofill.c | 10 ++++++---- src/H5Ofsinfo.c | 6 ++++-- src/H5Oginfo.c | 5 +++-- src/H5Olayout.c | 5 +++-- src/H5Olinfo.c | 5 +++-- src/H5Olink.c | 5 +++-- src/H5Omessage.c | 4 ++-- src/H5Omtime.c | 10 ++++++---- src/H5Oname.c | 5 +++-- src/H5Opkg.h | 4 ++-- src/H5Opline.c | 51 +++++++++++++++++++++++++++--------------------- src/H5Oprivate.h | 2 +- src/H5Orefcount.c | 5 +++-- src/H5Osdspace.c | 5 +++-- src/H5Oshared.c | 2 +- src/H5Oshared.h | 8 ++++---- src/H5Oshmesg.c | 5 +++-- src/H5Ostab.c | 5 +++-- src/H5Pdcpl.c | 2 +- src/H5S.c | 4 ++-- src/H5SM.c | 16 +++++++++------ src/H5T.c | 13 ++++++++---- src/H5Tprivate.h | 2 +- 39 files changed, 169 insertions(+), 113 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4675423..d52f6a5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -232,6 +232,25 @@ Bug Fixes since HDF5-1.10.1 release (DER - 2017/11/21, HDFFV-10330) + - If an HDF5 file contains a filter pipeline message which contains + a 'number of filters' field that exceeds the actual number of + filters in the message, the HDF5 C library will read off the end of + the read buffer. + + This issue was reported to The HDF Group as issue #CVE-2017-17506. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + The problem was fixed by passing the buffer size with the buffer + and ensuring that the pointer cannot be incremented off the end + of the buffer. A mismatch between the number of filters declared + and the actual number of filters will now invoke normal HDF5 + error handling. + + (DER - 2018/02/26, HDFFV-10355) + Configuration ------------- - CMake diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index ed67e0f..8b79aa5 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -158,7 +158,7 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */ *------------------------------------------------------------------------- */ static herr_t -H5A__dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5A__dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) { H5A_fh_ud_cmp_t *udata = (H5A_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */ H5A_t *attr = NULL; /* Pointer to attribute created from heap object */ @@ -168,7 +168,7 @@ H5A__dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud FUNC_ENTER_STATIC /* Decode attribute information */ - if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) + if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "can't decode attribute") /* Compare the string values */ diff --git a/src/H5Adense.c b/src/H5Adense.c index b1903a4..ba0578e 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -843,7 +843,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A__dense_copy_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5A__dense_copy_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5A_fh_ud_cp_t *udata = (H5A_fh_ud_cp_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -857,7 +857,7 @@ H5A__dense_copy_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_uda * HDF5 routine, it could attempt to re-protect that direct block for the * heap, causing the HDF5 routine called to fail) */ - if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) + if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, FAIL, "can't decode attribute") /* Set the creation order index for the attribute */ diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 71d15e5..4702c46 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -155,7 +155,7 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */ *------------------------------------------------------------------------- */ static herr_t -H5G_dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_cmp_t *udata = (H5G_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */ H5O_link_t *lnk; /* Pointer to link created from heap object */ @@ -164,7 +164,7 @@ H5G_dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_uda FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Compare the string values */ diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 4ae6800..de11541 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -599,7 +599,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_lbi_t *udata = (H5G_fh_ud_lbi_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *tmp_lnk = NULL; /* Temporary pointer to link */ @@ -608,7 +608,7 @@ H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, vo FUNC_ENTER_NOAPI_NOINIT /* Decode link information & keep a copy */ - if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Copy link information */ @@ -889,7 +889,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_iterate_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_it_t *udata = (H5G_fh_ud_it_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -903,7 +903,7 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_u * HDF5 routine, it could attempt to re-protect that direct block for the * heap, causing the HDF5 routine called to fail - QAK) */ - if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") done: @@ -1101,7 +1101,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_gnbi_t *udata = (H5G_fh_ud_gnbi_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *lnk; /* Pointer to link created from heap object */ @@ -1110,7 +1110,7 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Get the length of the name */ @@ -1308,7 +1308,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_rm_t *udata = (H5G_fh_ud_rm_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *lnk = NULL; /* Pointer to link created from heap object */ @@ -1318,7 +1318,7 @@ H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Check for removing the link from the creation order index */ @@ -1485,7 +1485,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_rmbi_t *udata = (H5G_fh_ud_rmbi_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1493,7 +1493,7 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, vo FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, H5_ITER_ERROR, "can't decode link") /* Can't operate on link here because the fractal heap block is locked */ diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 069bf17..c940161 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -572,7 +572,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, UINT32DECODE(image, hdr->pline_root_direct_filter_mask); /* Decode I/O filter information */ - if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, udata->dxpl_id, NULL, H5O_PLINE_ID, image))) + if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, udata->dxpl_id, NULL, H5O_PLINE_ID, len, image))) HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, NULL, "can't decode I/O pipeline filters") /* Advance past filter info to checksum */ diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index d8298a4..b85337a 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -35,7 +35,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_ainfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_ainfo_copy(const void *_mesg, void *_dest); static size_t H5O_ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -105,7 +105,8 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t); */ static void * H5O_ainfo_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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_ainfo_t *ainfo = NULL; /* Attribute info */ unsigned char flags; /* Flags for encoding attribute info */ diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 773a16b..79a0a52 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -26,7 +26,7 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg); static void *H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static void *H5O_attr_copy(const void *_mesg, void *_dest); static size_t H5O_attr_size(const H5F_t *f, const void *_mesg); static herr_t H5O_attr_free(void *mesg); @@ -121,7 +121,7 @@ H5FL_EXTERN(H5S_extent_t); --------------------------------------------------------------------------*/ static void * H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned *ioflags, const uint8_t *p) + unsigned *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5A_t *attr = NULL; H5S_extent_t *extent; /*extent dimensionality information */ @@ -185,7 +185,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED /* Decode the attribute's datatype */ if(NULL == (attr->shared->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)(f, dxpl_id, open_oh, - ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p))) + ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, attr->shared->dt_size, p))) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype") if(attr->shared->version < H5O_ATTR_VERSION_2) p += H5O_ALIGN_OLD(attr->shared->dt_size); @@ -200,7 +200,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED /* Decode attribute's dataspace extent */ if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, dxpl_id, open_oh, - ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p)) == NULL) + ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, attr->shared->ds_size, p)) == NULL) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace") /* Copy the extent information to the dataspace */ diff --git a/src/H5Obogus.c b/src/H5Obogus.c index a3531ed..02e0e6a 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -38,7 +38,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_bogus_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O_bogus_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, @@ -111,7 +111,8 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ */ static void * H5O_bogus_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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_bogus_t *mesg = NULL; void *ret_value; /* Return value */ diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index 4fd0577..1d2b607 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -28,7 +28,7 @@ #include "H5MMprivate.h" /* Memory management */ static void *H5O_btreek_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_btreek_copy(const void *_mesg, void *_dest); static size_t H5O_btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -79,7 +79,8 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ */ static void * H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_btreek_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 8f4c155..94049ef 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -1515,7 +1515,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image H5O_cont_t *cont; /* Decode continuation message */ - cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw); + cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw_size, mesg->raw); H5_CHECKED_ASSIGN(cont->chunkno, unsigned, udata->cont_msg_info->nmsgs + 1, size_t); /* the next continuation message/chunk */ /* Save 'native' form of continuation message */ @@ -1531,7 +1531,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image /* Decode ref. count message */ HDassert(oh->version > H5O_VERSION_1); - refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw); + refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw_size, mesg->raw); /* Save 'native' form of ref. count message */ mesg->native = refcount; diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index a427b49..d2b65bb 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -38,7 +38,7 @@ /* Callbacks for message class */ static void *H5O__mdci_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O__mdci_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O__mdci_copy(const void *_mesg, void *_dest); @@ -99,7 +99,7 @@ H5FL_DEFINE(H5O_mdci_t); static void * H5O__mdci_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) + unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_mdci_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Ocont.c b/src/H5Ocont.c index b002a32..f9a9768 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -37,7 +37,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_cont_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_cont_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_cont_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O_cont_free(void *mesg); @@ -90,7 +90,8 @@ H5FL_DEFINE(H5O_cont_t); */ static void * H5O_cont_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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_cont_t *cont = NULL; void *ret_value = NULL; /* Return value */ diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index b9dea26..5921be3 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -28,7 +28,7 @@ #include "H5MMprivate.h" /* Memory management */ static void *H5O_drvinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_drvinfo_copy(const void *_mesg, void *_dest); static size_t H5O_drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -80,7 +80,8 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ */ static void * H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_drvinfo_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index c51e31d..c557b5c 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -30,7 +30,7 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg); static void *H5O_dtype_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static void *H5O_dtype_copy(const void *_mesg, void *_dest); static size_t H5O_dtype_size(const H5F_t *f, const void *_mesg); static herr_t H5O_dtype_reset(void *_mesg); @@ -1094,7 +1094,7 @@ done: --------------------------------------------------------------------------*/ static void * H5O_dtype_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 *ioflags/*in,out*/, const uint8_t *p) + unsigned *ioflags/*in,out*/, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5T_t *dt = NULL; void *ret_value = NULL; /* Return value */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index ba7a6ee..f066964 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -28,7 +28,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_efl_copy(const void *_mesg, void *_dest); static size_t H5O_efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -88,7 +88,8 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ */ 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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_efl_t *mesg = NULL; int version; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 74f69d1..849435c 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -33,11 +33,11 @@ static void *H5O_fill_old_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_fill_old_size(const H5F_t *f, const void *_mesg); static void *H5O_fill_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg); static void *H5O_fill_copy(const void *_mesg, void *_dest); @@ -193,7 +193,8 @@ H5FL_BLK_EXTERN(type_conv); */ static void * H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_fill_t *fill = NULL; void *ret_value = NULL; /* Return value */ @@ -307,7 +308,8 @@ done: */ static void * H5O_fill_old_decode(H5F_t H5_ATTR_UNUSED *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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_fill_t *fill = NULL; /* Decoded fill value message */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 4d62f49..8369ae1 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -32,7 +32,8 @@ #include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_fsinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_fsinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_fsinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_fsinfo_copy(const void *_mesg, void *_dest); static size_t H5O_fsinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -86,7 +87,8 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t); */ static void * 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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_fsinfo_t *fsinfo = NULL; /* File space info message */ H5F_mem_page_t ptype; /* Memory type for iteration */ diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 468e07a..e551f28 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -33,7 +33,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_ginfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_ginfo_copy(const void *_mesg, void *_dest); static size_t H5O_ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -95,7 +95,8 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); */ static void * H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_ginfo_t *ginfo = NULL; /* Pointer to group information message */ unsigned char flags; /* Flags for encoding group info */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 85d7791..553013c 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -39,7 +39,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O__layout_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O__layout_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O__layout_copy(const void *_mesg, void *_dest); static size_t H5O__layout_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -101,7 +101,8 @@ H5FL_DEFINE(H5O_layout_t); */ static void * H5O__layout_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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_layout_t *mesg = NULL; uint8_t *heap_block = NULL; diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index cac4ed1..9917927 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -37,7 +37,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_linfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_linfo_copy(const void *_mesg, void *_dest); static size_t H5O_linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -114,7 +114,8 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); */ static void * H5O_linfo_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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_linfo_t *linfo = NULL; /* Link info */ unsigned char index_flags; /* Flags for encoding link index info */ diff --git a/src/H5Olink.c b/src/H5Olink.c index 77872ad..7e7885c 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -39,7 +39,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_link_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_link_copy(const void *_mesg, void *_dest); static size_t H5O_link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -118,7 +118,8 @@ H5FL_DEFINE_STATIC(H5O_link_t); */ static void * H5O_link_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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_link_t *lnk = NULL; /* Pointer to link message */ size_t len = 0; /* Length of a string in the message */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 158701b..809c6e9 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1811,7 +1811,7 @@ done: */ void * H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, - const unsigned char *buf) + size_t buf_size, const unsigned char *buf) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ unsigned ioflags = 0; /* Flags for decode routine */ @@ -1826,7 +1826,7 @@ H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, HDassert(type); /* decode */ - if((ret_value = (type->decode)(f, dxpl_id, open_oh, 0, &ioflags, buf)) == NULL) + if((ret_value = (type->decode)(f, dxpl_id, open_oh, 0, &ioflags, buf_size, buf)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode message") done: diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 7e7baea..47bc0b1 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -28,12 +28,12 @@ static void *H5O_mtime_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static void *H5O_mtime_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_mtime_copy(const void *_mesg, void *_dest); static size_t H5O_mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -119,7 +119,8 @@ H5FL_DEFINE(time_t); */ static void * H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { time_t *mesg; uint32_t tmp_time; /* Temporary copy of the time */ @@ -175,7 +176,8 @@ done: */ static void * H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { time_t *mesg, the_time; struct tm tm; diff --git a/src/H5Oname.c b/src/H5Oname.c index 6292883..627a0f5 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -33,7 +33,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_name_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_name_copy(const void *_mesg, void *_dest); static size_t H5O_name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -84,7 +84,8 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ */ static void * H5O_name_decode(H5F_t H5_ATTR_UNUSED *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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_name_t *mesg; void *ret_value = NULL; /* Return value */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 649ee3b..e970406 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -186,7 +186,7 @@ \ /* Decode the message */ \ HDassert(msg_type->decode); \ - if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw))) \ + if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw_size, (MSG)->raw))) \ HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \ \ /* Mark the message dirty if it was changed by decoding */ \ @@ -228,7 +228,7 @@ struct H5O_msg_class_t { const char *name; /*for debugging */ size_t native_size; /*size of native message */ unsigned share_flags; /* Message sharing settings */ - void *(*decode)(H5F_t *, hid_t, H5O_t *, unsigned, unsigned *, const uint8_t *); + void *(*decode)(H5F_t *, hid_t, H5O_t *, unsigned, unsigned *, size_t, const uint8_t *); herr_t (*encode)(H5F_t *, hbool_t, uint8_t *, const void *); void *(*copy)(const void *, void *); /*copy native value */ size_t (*raw_size)(const H5F_t *, hbool_t, const void *);/*sizeof encoded message */ diff --git a/src/H5Opline.c b/src/H5Opline.c index e817f9a..7bc8f19 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -34,7 +34,7 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_pline_encode(H5F_t *f, uint8_t *p, const void *mesg); static void *H5O_pline_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static void *H5O_pline_copy(const void *_mesg, void *_dest); static size_t H5O_pline_size(const H5F_t *f, const void *_mesg); static herr_t H5O_pline_reset(void *_mesg); @@ -115,12 +115,14 @@ H5FL_DEFINE(H5O_pline_t); */ static void * H5O_pline_decode(H5F_t H5_ATTR_UNUSED *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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t p_size, const uint8_t *p) { H5O_pline_t *pline = NULL; /* Pipeline message */ H5Z_filter_info_t *filter; /* Filter to decode */ size_t name_length; /* Length of filter name */ size_t i; /* Local index variable */ + const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -130,17 +132,17 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 /* Allocate space for I/O pipeline message */ if(NULL == (pline = H5FL_CALLOC(H5O_pline_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Version */ pline->version = *p++; if(pline->version < H5O_PLINE_VERSION_1 || pline->version > H5O_PLINE_VERSION_LATEST) - HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "bad version number for filter pipeline message") + HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "bad version number for filter pipeline message") /* Number of filters */ pline->nused = *p++; if(pline->nused > H5Z_MAX_NFILTERS) - HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "filter pipeline message has too many filters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "filter pipeline message has too many filters") /* Reserved */ if(pline->version == H5O_PLINE_VERSION_1) @@ -149,12 +151,12 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 /* Allocate array for filters */ pline->nalloc = pline->nused; if(NULL == (pline->filter = (H5Z_filter_info_t *)H5MM_calloc(pline->nalloc * sizeof(pline->filter[0])))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Decode filters */ for(i = 0, filter = &pline->filter[0]; i < pline->nused; i++, filter++) { /* Filter ID */ - UINT16DECODE(p, filter->id); + UINT16DECODE(p, filter->id); /* Length of filter name */ if(pline->version > H5O_PLINE_VERSION_1 && filter->id < H5Z_FILTER_RESERVED) @@ -166,18 +168,18 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 } /* end if */ /* Filter flags */ - UINT16DECODE(p, filter->flags); + UINT16DECODE(p, filter->flags); /* Number of filter parameters ("client data elements") */ - UINT16DECODE(p, filter->cd_nelmts); + UINT16DECODE(p, filter->cd_nelmts); /* Filter name, if there is one */ - if(name_length) { + if(name_length) { size_t actual_name_length; /* Actual length of name */ /* Determine actual name length (without padding, but with null terminator) */ - actual_name_length = HDstrlen((const char *)p) + 1; - HDassert(actual_name_length <= name_length); + actual_name_length = HDstrlen((const char *)p) + 1; + HDassert(actual_name_length <= name_length); /* Allocate space for the filter name, or use the internal buffer */ if(actual_name_length > H5Z_COMMON_NAME_LEN) { @@ -188,12 +190,12 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 else filter->name = filter->_name; - HDstrncpy(filter->name, (const char *)p, actual_name_length); - p += name_length; - } /* end if */ + HDstrncpy(filter->name, (const char *)p, actual_name_length); + p += name_length; + } /* end if */ /* Filter parameters */ - if(filter->cd_nelmts) { + if(filter->cd_nelmts) { size_t j; /* Local index variable */ /* Allocate space for the client data elements, or use the internal buffer */ @@ -205,15 +207,20 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 else filter->cd_values = filter->_cd_values; - /* - * Read the client data values and the padding - */ - for(j = 0; j < filter->cd_nelmts; j++) - UINT32DECODE(p, filter->cd_values[j]); + /* + * Read the client data values and the padding + */ + for (j = 0; j < filter->cd_nelmts; j++) { + if (p + 4 - 1 <= p_end) + UINT32DECODE(p, filter->cd_values[j]) + else + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "ran off the end of the buffer: current p = %p, p_size = %zu, p_end = %p", p, p_size, p_end) + } + if(pline->version == H5O_PLINE_VERSION_1) if(filter->cd_nelmts % 2) p += 4; /*padding*/ - } /* end if */ + } /* end if */ } /* end for */ /* Set return value */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 2253bb2..9f01a9a 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -935,7 +935,7 @@ H5_DLL herr_t H5O_msg_get_crt_index(unsigned type_id, const void *mesg, H5_DLL herr_t H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared, unsigned char *buf, const void *obj); H5_DLL void* H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned type_id, const unsigned char *buf); + unsigned type_id, size_t buf_size, const unsigned char *buf); H5_DLL herr_t H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, void *mesg); H5_DLL herr_t H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id, uint8_t *flags); diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index af68417..6f052ce 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -33,7 +33,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_refcount_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_refcount_copy(const void *_mesg, void *_dest); static size_t H5O_refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -90,7 +90,8 @@ H5FL_DEFINE_STATIC(H5O_refcount_t); */ static void * H5O_refcount_decode(H5F_t H5_ATTR_UNUSED *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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_refcount_t *refcount = NULL; /* Reference count */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 12a9bb6..f5d3c61 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -26,7 +26,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_sdspace_copy(const void *_mesg, void *_dest); static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg); @@ -110,7 +110,8 @@ H5FL_ARR_EXTERN(hsize_t); --------------------------------------------------------------------------*/ static void * H5O_sdspace_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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5S_extent_t *sdim = NULL;/* New extent dimensionality structure */ unsigned flags, version; diff --git a/src/H5Oshared.c b/src/H5Oshared.c index db2d0cc..9217d3d 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -156,7 +156,7 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "can't read message from fractal heap.") /* Decode the message */ - if(NULL == (ret_value = (type->decode)(f, dxpl_id, open_oh, 0, ioflags, mesg_ptr))) + if(NULL == (ret_value = (type->decode)(f, dxpl_id, open_oh, 0, ioflags, mesg_size, mesg_ptr))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "can't decode shared message.") } /* end if */ else { diff --git a/src/H5Oshared.h b/src/H5Oshared.h index 2465e65..93cc11f 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -47,7 +47,7 @@ */ static H5_INLINE void * H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p) + unsigned *ioflags, size_t p_size, const uint8_t *p) { void *ret_value = NULL; /* Return value */ @@ -67,7 +67,7 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, if(mesg_flags & H5O_MSG_FLAG_SHARED) { /* Retrieve native message info indirectly through shared message */ if(NULL == (ret_value = H5O_shared_decode(f, dxpl_id, open_oh, ioflags, p, H5O_SHARED_TYPE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message") + HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message") /* We currently do not support automatically fixing shared messages */ #ifdef H5_STRICT_FORMAT_CHECKS @@ -79,8 +79,8 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, } /* end if */ else { /* Decode native message directly */ - if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, open_oh, mesg_flags, ioflags, p))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode native message") + if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, open_oh, mesg_flags, ioflags, p_size, p))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode native message") } /* end else */ done: diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 1cbfb05..f3fe9d1 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -28,7 +28,7 @@ #include "H5MMprivate.h" /* Memory management */ static void *H5O_shmesg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_shmesg_copy(const void *_mesg, void *_dest); static size_t H5O_shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -76,7 +76,8 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ */ static void * H5O_shmesg_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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_shmesg_table_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 5c840a6..6f02d72 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -36,7 +36,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_stab_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_stab_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_stab_copy(const void *_mesg, void *_dest); static size_t H5O_stab_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -97,7 +97,8 @@ H5FL_DEFINE_STATIC(H5O_stab_t); */ static void * H5O_stab_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) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_stab_t *stab = NULL; void *ret_value = NULL; /* Return value */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 3b4c159..894f6cb 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1115,7 +1115,7 @@ H5P__dcrt_fill_value_dec(const void **_pp, void *_value) dt_size = (size_t)enc_value; /* Decode type */ - if(NULL == (fill->type = H5T_decode(*pp))) + if(NULL == (fill->type = H5T_decode(dt_size, *pp))) HGOTO_ERROR(H5E_PLIST, H5E_CANTDECODE, FAIL, "can't decode fill value datatype") *pp += dt_size; } /* end if */ diff --git a/src/H5S.c b/src/H5S.c index 8f3e132..c2f7d3f 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1730,8 +1730,8 @@ H5S_decode(const unsigned char **p) /* Decode the extent part of dataspace */ /* (pass mostly bogus file pointer and bogus DXPL) */ - if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, NULL, H5O_SDSPACE_ID, pp))==NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object") + if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, NULL, H5O_SDSPACE_ID, extent_size, pp)) == NULL) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object") pp += extent_size; /* Copy the extent into dataspace structure */ diff --git a/src/H5SM.c b/src/H5SM.c index d5ede7e..8e28529 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -70,7 +70,7 @@ static herr_t H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, static herr_t H5SM_decr_ref(void *record, void *op_data, hbool_t *changed); static herr_t H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5SM_index_header_t *header, const H5O_shared_t * mesg, - unsigned *cache_flags, void ** /*out*/ encoded_mesg); + unsigned *cache_flags, size_t * /*out*/ mesg_size, void ** /*out*/ encoded_mesg); static herr_t H5SM_type_to_flag(unsigned type_id, unsigned *type_flag); static herr_t H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, unsigned *oh_modified, void *_udata); @@ -1549,6 +1549,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) unsigned cache_flags = H5AC__NO_FLAGS_SET; H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ ssize_t index_num; + size_t mesg_size = 0; void *mesg_buf = NULL; void *native_mesg = NULL; unsigned type_id; /* Message type ID to operate on */ @@ -1578,8 +1579,8 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) * zero and any file space it uses needs to be freed. mesg_buf holds the * serialized form of the message. */ - if(H5SM_delete_from_index(f, dxpl_id, open_oh, &(table->indexes[index_num]), sh_mesg, &cache_flags, &mesg_buf) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete mesage from SOHM index") + if(H5SM_delete_from_index(f, dxpl_id, open_oh, &(table->indexes[index_num]), sh_mesg, &cache_flags, &mesg_size, &mesg_buf) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete mesage from SOHM index") /* Release the master SOHM table */ if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) @@ -1591,7 +1592,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) * master table needs to be unprotected when we do this. */ if(mesg_buf) { - if(NULL == (native_mesg = H5O_msg_decode(f, dxpl_id, open_oh, type_id, (const unsigned char *)mesg_buf))) + if(NULL == (native_mesg = H5O_msg_decode(f, dxpl_id, open_oh, type_id, mesg_size, (const unsigned char *)mesg_buf))) HGOTO_ERROR(H5E_SOHM, H5E_CANTDECODE, FAIL, "can't decode shared message.") if(H5O_msg_delete(f, dxpl_id, open_oh, type_id, native_mesg) < 0) @@ -1778,7 +1779,7 @@ H5SM_decr_ref(void *record, void *op_data, hbool_t *changed) static herr_t H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5SM_index_header_t *header, const H5O_shared_t *mesg, - unsigned *cache_flags, void ** /*out*/ encoded_mesg) + unsigned *cache_flags, size_t * /*out*/ mesg_size, void ** /*out*/ encoded_mesg) { H5SM_list_t *list = NULL; H5SM_mesg_key_t key; @@ -1910,6 +1911,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Return the message's encoding so anything it references can be freed */ *encoded_mesg = encoding_buf; + *mesg_size = buf_size; /* If there are no messages left in the index, delete it */ if(header->num_messages == 0) { @@ -1951,8 +1953,10 @@ done: /* Free the message encoding, if we're not returning it in encoded_mesg * or if there's been an error. */ - if(encoding_buf && (NULL == *encoded_mesg || ret_value < 0)) + if(encoding_buf && (NULL == *encoded_mesg || ret_value < 0)) { encoding_buf = H5MM_xfree(encoding_buf); + *mesg_size = 0; + } FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5SM_delete_from_index() */ diff --git a/src/H5T.c b/src/H5T.c index eca0132..f06ac18 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -2822,8 +2822,13 @@ H5Tdecode(const void *buf) if(buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty buffer") - /* Create datatype by decoding buffer */ - if(NULL == (dt = H5T_decode((const unsigned char *)buf))) + /* Create datatype by decoding buffer + * There is no way to get the size of the buffer, so we pass in + * SIZE_MAX and assume the caller knows what they are doing. + * Really fixing this will require an H5Tdecode2() call that + * takes a size parameter. + */ + if(NULL == (dt = H5T_decode(SIZE_MAX, (const unsigned char *)buf))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object") /* Register the type and return the ID */ @@ -2912,7 +2917,7 @@ done: *------------------------------------------------------------------------- */ H5T_t * -H5T_decode(const unsigned char *buf) +H5T_decode(size_t buf_size, const unsigned char *buf) { H5F_t *f = NULL; /* Fake file structure*/ H5T_t *ret_value = NULL; /* Return value */ @@ -2932,7 +2937,7 @@ H5T_decode(const unsigned char *buf) 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))) + if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, H5AC_noio_dxpl_id, NULL, H5O_DTYPE_ID, buf_size, buf))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object") /* Mark datatype as being in memory now */ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 5272361..61e7c79 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -114,7 +114,7 @@ H5_DLL htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_ap H5_DLL size_t H5T_get_size(const H5T_t *dt); H5_DLL int H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset); H5_DLL herr_t H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc); -H5_DLL H5T_t *H5T_decode(const unsigned char *buf); +H5_DLL H5T_t *H5T_decode(size_t buf_size, const unsigned char *buf); H5_DLL herr_t H5T_debug(const H5T_t *dt, FILE * stream); H5_DLL struct H5O_loc_t *H5T_oloc(H5T_t *dt); H5_DLL H5G_name_t *H5T_nameof(H5T_t *dt); -- cgit v0.12 From ce005900d6ad539cc7556ab225b771d24632f4f1 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 26 Feb 2018 20:16:13 -0800 Subject: Fix for HDFFV-10357 (CVE-2017-17508). --- release_docs/RELEASE.txt | 15 +++++++++++++++ src/H5T.c | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4675423..480bb14 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -232,6 +232,21 @@ Bug Fixes since HDF5-1.10.1 release (DER - 2017/11/21, HDFFV-10330) + - If an HDF5 file contains a malformed compound type which contains + a member of size zero, a division by zero error will occur while + processing the type. + + This issue was reported to The HDF Group as issue #CVE-2017-17508. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + Checking for zero before dividing fixes the problem. Instead of the + division by zero, the normal HDF5 error handling is invoked. + + (DER - 2018/02/26, HDFFV-10357) + Configuration ------------- - CMake diff --git a/src/H5T.c b/src/H5T.c index eca0132..ffa7bcb 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -5211,6 +5211,11 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) /* Check if the field changed size */ if(old_size != memb_type->shared->size) { + + /* Fail if the old_size is zero */ + if (0 == old_size) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "old_size of zero would cause division by zero"); + /* 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; -- cgit v0.12 From b36bad53d9d5930ef1339d0db1bd7152c0e9b75d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 27 Feb 2018 12:57:07 -0600 Subject: Inc CMake min, Add new tests, rework test CMake files --- CMakeLists.txt | 2 +- MANIFEST | 1 + c++/CMakeLists.txt | 2 +- c++/examples/CMakeLists.txt | 2 +- c++/examples/CMakeTests.cmake | 4 +- c++/src/CMakeLists.txt | 2 +- c++/test/CMakeLists.txt | 2 +- config/cmake/CTestScript.cmake | 2 +- config/cmake/HDF518_Examples.cmake.in | 2 +- config/cmake/HDF5_Examples.cmake.in | 2 +- config/cmake/scripts/CTestScript.cmake | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- examples/CMakeLists.txt | 2 +- fortran/CMakeLists.txt | 2 +- fortran/examples/CMakeLists.txt | 2 +- fortran/src/CMakeLists.txt | 2 +- fortran/test/CMakeLists.txt | 2 +- fortran/testpar/CMakeLists.txt | 2 +- hl/CMakeLists.txt | 2 +- hl/c++/CMakeLists.txt | 2 +- hl/c++/examples/CMakeLists.txt | 2 +- hl/c++/src/CMakeLists.txt | 2 +- hl/c++/test/CMakeLists.txt | 2 +- hl/examples/CMakeLists.txt | 2 +- hl/fortran/CMakeLists.txt | 2 +- hl/fortran/examples/CMakeLists.txt | 2 +- hl/fortran/src/CMakeLists.txt | 2 +- hl/fortran/test/CMakeLists.txt | 2 +- hl/src/CMakeLists.txt | 2 +- hl/test/CMakeLists.txt | 2 +- hl/tools/CMakeLists.txt | 2 +- hl/tools/gif2h5/CMakeLists.txt | 2 +- hl/tools/h5watch/CMakeLists.txt | 2 +- java/CMakeLists.txt | 2 +- java/examples/CMakeLists.txt | 2 +- java/examples/datasets/CMakeLists.txt | 2 +- java/examples/datatypes/CMakeLists.txt | 2 +- java/examples/groups/CMakeLists.txt | 2 +- java/examples/intro/CMakeLists.txt | 2 +- java/src/CMakeLists.txt | 2 +- java/src/hdf/CMakeLists.txt | 2 +- java/src/hdf/hdf5lib/CMakeLists.txt | 2 +- java/src/jni/CMakeLists.txt | 2 +- java/test/CMakeLists.txt | 2 +- java/test/TestH5Pfapl.java | 7 + release_docs/INSTALL_CMake.txt | 2 +- release_docs/USING_HDF5_CMake.txt | 2 +- src/CMakeLists.txt | 2 +- test/CMakeLists.txt | 225 ++++++----- test/CMakeTests.cmake | 578 ++++++----------------------- test/CMakeVFDTests.cmake | 303 +++++++++++++++ testpar/CMakeLists.txt | 3 +- tools/CMakeLists.txt | 2 +- tools/lib/CMakeLists.txt | 2 +- tools/src/CMakeLists.txt | 2 +- tools/src/h5copy/CMakeLists.txt | 2 +- tools/src/h5diff/CMakeLists.txt | 2 +- tools/src/h5dump/CMakeLists.txt | 2 +- tools/src/h5format_convert/CMakeLists.txt | 2 +- tools/src/h5import/CMakeLists.txt | 2 +- tools/src/h5jam/CMakeLists.txt | 2 +- tools/src/h5ls/CMakeLists.txt | 2 +- tools/src/h5repack/CMakeLists.txt | 2 +- tools/src/h5stat/CMakeLists.txt | 2 +- tools/src/misc/CMakeLists.txt | 2 +- tools/test/CMakeLists.txt | 2 +- tools/test/h5copy/CMakeLists.txt | 2 +- tools/test/h5diff/CMakeLists.txt | 2 +- tools/test/h5dump/CMakeLists.txt | 2 +- tools/test/h5format_convert/CMakeLists.txt | 2 +- tools/test/h5import/CMakeLists.txt | 2 +- tools/test/h5jam/CMakeLists.txt | 2 +- tools/test/h5ls/CMakeLists.txt | 2 +- tools/test/h5repack/CMakeLists.txt | 2 +- tools/test/h5repack/CMakeTests.cmake | 161 +++++--- tools/test/h5stat/CMakeLists.txt | 2 +- tools/test/misc/CMakeLists.txt | 2 +- tools/test/misc/vds/CMakeLists.txt | 2 +- tools/test/perform/CMakeLists.txt | 2 +- 79 files changed, 729 insertions(+), 695 deletions(-) create mode 100644 test/CMakeVFDTests.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c7bb38..e7dda17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5 C CXX) #----------------------------------------------------------------------------- diff --git a/MANIFEST b/MANIFEST index 8e79458..f365884 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3176,6 +3176,7 @@ ./src/CMakeLists.txt ./test/CMakeLists.txt ./test/CMakeTests.cmake +./test/CMakeVFDTests.cmake ./testpar/CMakeLists.txt ./testpar/CMakeTests.cmake ./tools/CMakeLists.txt diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index adbf1a4..2d3ab0f 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.3.2) PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 300f6bc..397c300 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_CPP_EXAMPLES) # -------------------------------------------------------------------- diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index 264a7e7..bd1f95b 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -51,7 +51,7 @@ endif () set (last_test "CPP_ex_${example}") endforeach () -#the following dependicies are handled by the order of the files +#the following dependencies 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) @@ -91,7 +91,7 @@ endif () set (last_test "CPP_ex_${example}") endforeach () -#the following dependicies are handled by the order of the files +#the following dependencies 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) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 3b9a0c3..921497f 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.3.2) PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 4930626..5194865 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.3.2) PROJECT (HDF5_CPP_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index a8b7bbc..27ae3a0 100755 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake @@ -9,7 +9,7 @@ # 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) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ######################################################## # For any comments please contact cdashhelp@hdfgroup.org # diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 6af0b09..0e81217 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -9,7 +9,7 @@ # 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) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index bede701..6453b16 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -9,7 +9,7 @@ # 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) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index f826e31..cfad6f1 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -9,7 +9,7 @@ # 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) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 33d7868..88843fa 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -15,7 +15,7 @@ ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# -cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 43c6d63..e9430d9 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.3.2) PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index a0f92d3..7864f2d 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.3.2) PROJECT (HDF5_F90 C CXX Fortran) if (H5_HAVE_PARALLEL) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index a48b3bd..9adf8bd 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.3.2) PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 5446616..9bf1719 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.3.2) PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 86f7a12..67d377f 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.3.2) PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index ed9d28c..b1cf9d2 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index d80b4f9..eac6df0 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.3.2) PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 9a1d059..c5b4a72 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.3.2) PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 8c48795..bf96fba 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.3.2) PROJECT (HDF5_HL_CPP_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 70f0a79..0f187c5 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.3.2) PROJECT (HDF5_HL_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 54afd7c..28b5eb8 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.3.2) PROJECT (HDF5_HL_CPP_TEST) #----------------------------------------------------------------------------- diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 68f0128..dd94da0 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.3.2) PROJECT (HDF5_HL_EXAMPLES ) #----------------------------------------------------------------------------- diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 00d7517..37c5cc9 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.3.2) PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index d920d64..ff0403a 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.3.2) PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 5ad441c..7a2eff1 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.3.2) PROJECT(HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index b264d5f..1ec4b93 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.3.2) PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 3dd6ce8..d21a3ea 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.3.2) PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 82a3c1b..1f2ea17 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.3.2) PROJECT (HDF5_HL_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 43229e8..ab71a7e 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.3.2) PROJECT (HDF5_HL_TOOLS C CXX) add_subdirectory (gif2h5) diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 34d7074..b50bbf7 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.3.2) PROJECT (HDF5_HL_TOOLS_GIF2H5) #----------------------------------------------------------------------------- diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index d0764c9..a1697cd 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.3.2) PROJECT (HDF5_HL_TOOLS_H5WATCH) #----------------------------------------------------------------------------- diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 9a5692f..d8cd358 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.3.2) PROJECT ( HDF5_JAVA C Java ) set (CMAKE_MODULE_PATH "${HDF_RESOURCES_DIR};${HDF_RESOURCES_EXT_DIR}") diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt index 3073918..d43b49f 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.3.2) PROJECT (HDFJAVA_EXAMPLES) add_subdirectory (datasets) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 3e8bc8b..ed4559c 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.3.2) PROJECT (HDFJAVA_EXAMPLES_DATASETS Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index b79ba64..71cf83e 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.3.2) PROJECT (HDFJAVA_EXAMPLES_DATATYPES Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 56c92fe..dc5d834 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.3.2) PROJECT (HDFJAVA_EXAMPLES_GROUPS Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 495ec5e..59fe48b 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.3.2) PROJECT (HDFJAVA_EXAMPLES_INTRO Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index 9bdab4b..7075d32 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.3.2) PROJECT ( HDF5_JAVA_SRC C Java ) #----------------------------------------------------------------------------- diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt index 649f7d0..35b436d 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.3.2) PROJECT (HDF5_JAVA_HDF) add_subdirectory (hdf5lib) diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt index c856c04..1f2587e 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.3.2) PROJECT (HDF5_JAVA_HDF_HDF5 Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index ea9665b..8ab275e 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.3.2) PROJECT (HDF5_JAVA_JNI C CXX) set (HDF5_JAVA_JNI_CSRCS diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 49cda32..329c602 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.3.2) PROJECT (HDF5_JAVA_TEST Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index 48a5986..ac54405 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1385,6 +1385,13 @@ public class TestH5Pfapl { ret_val_id = H5.H5Pget_evict_on_close(fapl_id); assertTrue("H5P_evict_on_close", ret_val_id); } + catch (HDF5PropertyListInterfaceException err) { + // parallel is not supported + if (err.getMinorErrorNumber() != HDF5Constants.H5E_CANTSET) { + err.printStackTrace(); + fail("H5P_evict_on_close: " + err); + } + } catch (Throwable err) { err.printStackTrace(); fail("H5P_evict_on_close: " + err); diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 64eb1d2..99efb6a 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -648,7 +648,7 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# -cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index fc62b75..8dd47c2 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -229,7 +229,7 @@ your application with an installed HDF5 binary. ctest use of HDF5_Examples.cmake and HDF5_Examples_options.cmake ======================================================================== -cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aaedfda..bf7fb07 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.3.2) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5e0c990..cdab4f5 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.3.2) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- @@ -13,9 +13,9 @@ set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) -#----------------------------------------------------------------------------- +################################################################################# # Define Test Library Sources -#----------------------------------------------------------------------------- +################################################################################# set (TEST_LIB_SOURCES ${HDF5_TEST_SOURCE_DIR}/h5test.c ${HDF5_TEST_SOURCE_DIR}/testframe.c @@ -71,9 +71,9 @@ if (BUILD_SHARED_LIBS) endif () endif () -#----------------------------------------------------------------------------- +################################################################################# # If filter plugin tests can be tested -#----------------------------------------------------------------------------- +################################################################################# # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir1") file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir2") @@ -116,7 +116,7 @@ endif () ) endforeach () - foreach ( plugin_name ${FILTER_PLUGINS_FOR_DIR2}) + foreach (plugin_name ${FILTER_PLUGINS_FOR_DIR2}) set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}") set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}") set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) @@ -142,6 +142,10 @@ endif () ) endforeach () +################################################################################# +# Test program sources +################################################################################# + set (testhdf5_SOURCES ${HDF5_TEST_SOURCE_DIR}/testhdf5.c ${HDF5_TEST_SOURCE_DIR}/tarray.c @@ -170,34 +174,24 @@ set (testhdf5_SOURCES ${HDF5_TEST_SOURCE_DIR}/tvlstr.c ) -#-- Adding test for testhdf5 -add_executable (testhdf5 ${testhdf5_SOURCES}) -TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") -target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET}) -set_target_properties (testhdf5 PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (testhdf5-shared ${testhdf5_SOURCES}) - TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") - target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) - set_target_properties (testhdf5-shared PROPERTIES FOLDER test) -endif () +set (cache_image_SOURCES + ${HDF5_TEST_SOURCE_DIR}/cache_image.c + ${HDF5_TEST_SOURCE_DIR}/genall5.c +) -MACRO (ADD_H5_EXE file) - add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) - TARGET_C_PROPERTIES (${file} STATIC " " " ") - target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET}) - set_target_properties (${file} PROPERTIES FOLDER test) - if (BUILD_SHARED_LIBS) - add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) - TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") - target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) - set_target_properties (${file}-shared PROPERTIES FOLDER test) - endif () -ENDMACRO () +set (ttsafe_SOURCES + ${HDF5_TEST_SOURCE_DIR}/ttsafe.c + ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c + ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c + ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c + ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c +) set (H5_TESTS + testhdf5 # multiple source cache cache_api + cache_image # multiple source cache_tagging lheap ohdr @@ -210,9 +204,11 @@ set (H5_TESTS fheap pool accum + hyperslab istore bittests dt_arith + page_buffer dtypes dsets cmpd_dset @@ -233,6 +229,7 @@ set (H5_TESTS app_ref enum set_extent + ttsafe # multiple source enc_dec_plist enc_dec_plist_cross_platform getname @@ -244,7 +241,6 @@ set (H5_TESTS cross_read freespace mf - page_buffer vds file_image unregister @@ -253,98 +249,66 @@ set (H5_TESTS swmr ) -foreach (test ${H5_TESTS}) - ADD_H5_EXE(${test}) -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 () +macro (ADD_H5_EXE file) + add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) + TARGET_C_PROPERTIES (${file} STATIC " " " ") + target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET}) + set_target_properties (${file} PROPERTIES FOLDER test) + if (BUILD_SHARED_LIBS) + add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) + TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") + target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) + set_target_properties (${file}-shared PROPERTIES FOLDER test) + endif () +endmacro () -set (H5_VDS_SWMR_TESTS - vds_swmr_gen - vds_swmr_reader - vds_swmr_writer +set (H5_TESTS_MULTIPLE + testhdf5 + cache_image + ttsafe ) - -foreach (test ${H5_VDS_SWMR_TESTS}) - ADD_H5_EXE(${test}) +# Only build single source tests here +foreach (test ${H5_TESTS}) + if (NOT "${test}" IN_LIST ${H5_TESTS_MULTIPLE}) + ADD_H5_EXE(${test}) + endif () endforeach () ############################################################################## +### M U L T I P L E S O U R C E T E S T S ### ############################################################################## -### A D D I T I O N A L T E S T S ### -############################################################################## -############################################################################## + +#-- Adding test for testhdf5 +add_executable (testhdf5 ${testhdf5_SOURCES}) +TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") +target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET}) +set_target_properties (testhdf5 PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (testhdf5-shared ${testhdf5_SOURCES}) + TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") + target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) + set_target_properties (testhdf5-shared PROPERTIES FOLDER test) +endif () #-- Adding test for cache_image -add_executable (cache_image - ${HDF5_TEST_SOURCE_DIR}/cache_image.c - ${HDF5_TEST_SOURCE_DIR}/genall5.c -) +add_executable (cache_image ${cache_image_SOURCES}) 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 - ) + add_executable (cache_image-shared ${cache_image_SOURCES}) 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_C_PROPERTIES (hyperslab STATIC " " " ") -target_link_libraries (hyperslab ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (hyperslab PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (hyperslab-shared ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) - TARGET_C_PROPERTIES (hyperslab-shared SHARED " " " ") - target_link_libraries (hyperslab-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (hyperslab-shared PROPERTIES FOLDER test) - if (HDF5_ENABLE_THREADSAFE) - set_property (TARGET hyperslab-shared - APPEND PROPERTY COMPILE_DEFINITIONS - "H5_HAVE_THREADSAFE" - ) - endif () -endif () - #-- Adding test for ttsafe -add_executable (ttsafe - ${HDF5_TEST_SOURCE_DIR}/ttsafe.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c -) +add_executable (ttsafe ${ttsafe_SOURCES}) TARGET_C_PROPERTIES (ttsafe STATIC " " " ") target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (ttsafe PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) - add_executable (ttsafe-shared - ${HDF5_TEST_SOURCE_DIR}/ttsafe.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c - ) + add_executable (ttsafe-shared ${ttsafe_SOURCES}) TARGET_C_PROPERTIES (ttsafe-shared SHARED " " " ") target_link_libraries (ttsafe-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (ttsafe-shared PROPERTIES FOLDER test) @@ -356,6 +320,10 @@ if (BUILD_SHARED_LIBS) endif () endif () +############################################################################## +### A D D I T I O N A L T E S T S ### +############################################################################## + set (H5_CHECK_TESTS error_test err_compat @@ -364,14 +332,57 @@ set (H5_CHECK_TESTS atomic_writer atomic_reader links_env - flushrefresh filenotclosed + flushrefresh ) foreach (test ${H5_CHECK_TESTS}) ADD_H5_EXE(${test}) endforeach () +#-- Adding test for libinfo +set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) +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 () + message (STATUS \"COMMAND Result: \${TEST_RESULT}\") +endif () +" +) + +############################################################################## +### S W I M M E R T E S T S ### +############################################################################## + +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 () + #-- Adding test for accum_swmr_reader # This has to be copied to the test directory for execve() to find it # and it can't be renamed (i.e., no -shared). @@ -386,18 +397,6 @@ if (BUILD_SHARED_LIBS) set_target_properties (accum-shared PROPERTIES DEPENDS accum_swmr_reader) endif () -#-- Adding test for libinfo -set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) -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 () - message (STATUS \"COMMAND Result: \${TEST_RESULT}\") -endif () -" -) - ############################################################################## ### P L U G I N T E S T S ############################################################################## diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 06bbd06..9b1ea6b 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -26,27 +26,6 @@ if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files") endif () -if (HDF5_TEST_VFD) - set (VFD_LIST - sec2 - stdio - core - core_paged - split - multi - family - ) - if (DIRECT_VFD) - set (VFD_LIST ${VFD_LIST} direct) - 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 () - endforeach () -endif () - # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- @@ -75,16 +54,6 @@ foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${h5_tfile}" "HDF5_TEST_LIBSH_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 () - endforeach () - endforeach () -endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory @@ -103,16 +72,6 @@ foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${ref_file}" "HDF5_TEST_LIBSH_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 () - endforeach () - endforeach () -endif () # -------------------------------------------------------------------- # Copy test files from test/testfiles/plist_files dir to test dir @@ -238,16 +197,7 @@ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST-shared/${h5_file}" "HDF5_TEST_LIBSH_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 () - 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}) @@ -593,97 +543,42 @@ add_test (NAME H5TEST-clear-objects ${HDF5_TEST_BINARY_DIR}/H5TEST ) -set (H5TEST_TESTS - #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 - set_extent - ttsafe - enc_dec_plist - enc_dec_plist_cross_platform - getname - vfd - ntypes - dangle - dtransform - reserved - cross_read - freespace - mf - page_buffer - vds - file_image - unregister - cache_logging - cork - swmr +set (H5TEST_SEPARATE_TESTS + cache + cache_image ) - 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 - ) - else () - if ("${test}" STREQUAL "big" AND CYGWIN) - add_test (NAME H5TEST-${test} - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" + if (NOT "${test}" IN_LIST ${H5TEST_SEPARATE_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 ) 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" + 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 () - 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 () @@ -704,27 +599,29 @@ if (BUILD_SHARED_LIBS) ) foreach (test ${H5TEST_TESTS}) - if ("${test}" STREQUAL "big" AND CYGWIN) - 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" + if (NOT "${test}" IN_LIST ${H5TEST_SEPARATE_TESTS}) + if ("${test}" STREQUAL "big" AND CYGWIN) + 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 () + 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 ) 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 () set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1) @@ -734,12 +631,6 @@ if (BUILD_SHARED_LIBS) set_tests_properties (H5TEST-shared-objcopy PROPERTIES TIMEOUT 1800) endif () -############################################################################## -############################################################################## -### A D D I T I O N A L T E S T S ### -############################################################################## -############################################################################## - #-- Adding test for cache if (NOT CYGWIN) add_test (NAME H5TEST-clear-cache-objects @@ -787,6 +678,73 @@ set_tests_properties (H5TEST-cache_image PROPERTIES WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) +if (BUILD_SHARED_LIBS) + #-- Adding test for cache + if (NOT CYGWIN AND NOT WIN32) + add_test (NAME H5TEST-shared-clear-cache-objects + COMMAND ${CMAKE_COMMAND} + -E remove + cache_test.h5 + 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 () + 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 () + + +############################################################################## +############################################################################## +### A D D I T I O N A L T E S T S ### +############################################################################## +############################################################################## +# H5_CHECK_TESTS +#--------------- +# error_test +# err_compat +# tcheck_version +# testmeta +# atomic_writer +# atomic_reader +# links_env +# filenotclosed +# flushrefresh +############################################################################## +# autotools script tests +# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. +# NOT CONVERTED tcheck_version is used by testcheck_version.sh. +# NOT CONVERTED accum_swmr_reader is used by accum.c. +# NOT CONVERTED atomic_writer and atomic_reader are standalone programs. +# links_env is used by testlinks_env.sh +# filenotclosed is used by test_filenotclosed.sh +# NOT CONVERTED flushrefresh is used by testflushrefresh.sh. +# NOT CONVERTED use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh +# NOT CONVERTED swmr_* files (besides swmr.c) are used by testswmr.sh. +# NOT CONVERTED vds_swmr_* files are used by testvdsswmr.sh +# NOT CONVERTED 'make check' doesn't run them directly, so they are not included in TEST_PROG. +# NOT CONVERTED Also build testmeta, which is used for timings test. It builds quickly, +# NOT CONVERTED and this lets automake keep all its test programs in one place. +############################################################################## + #-- Adding test for filenotclosed add_test ( NAME H5TEST-clear-filenotclosed-objects @@ -899,37 +857,6 @@ add_test (NAME H5TEST-testlibinfo ) if (BUILD_SHARED_LIBS) - #-- Adding test for cache - if (NOT CYGWIN AND NOT WIN32) - add_test (NAME H5TEST-shared-clear-cache-objects - COMMAND ${CMAKE_COMMAND} - -E remove - cache_test.h5 - 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 () - 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 () - #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) add_test (NAME H5TEST-shared-clear-err_compat-objects @@ -1068,272 +995,7 @@ set_tests_properties (H5PLUGIN-filter_plugin PROPERTIES ############################################################################## if (HDF5_TEST_VFD) - - set (H5_VFD_TESTS - testhdf5 -# cache - cache_api - cache_tagging - lheap - ohdr - stab - gheap - evict_on_close - pool -# accum - farray - earray - btree2 -# fheap - 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 - set_extent - ttsafe - getname -# vfd - ntypes - dangle - dtransform - reserved - cross_read - freespace - mf -# error_test -# err_compat - #tcheck_version -# testmeta -# links_env - unregister - ) - if (NOT CYGWIN) - set (H5_VFD_TESTS ${H5_VFD_TESTS} big cache) - endif () - - # 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 ${HDF_CFG_NAME} MATCHES "Debug") - add_test (NAME VFD-${vfdname}-${vfdtest} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () - else () - add_test (NAME VFD-${vfdname}-${vfdtest} - COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" - ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" - ) - endif () - endif () - else () - add_test (NAME VFD-${vfdname}-${vfdtest} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () - endif () - else () - add_test (NAME VFD-${vfdname}-${vfdtest} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - 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") - add_test (NAME VFD-${vfdname}-${vfdtest}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () - endif () - endmacro () - - macro (ADD_VFD_TEST vfdname resultcode) - foreach (test ${H5_VFD_TESTS}) - if (WIN32) - CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) - else () - add_test (NAME VFD-${vfdname}-${test} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${test}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${test} PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${test}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${test}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - 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 () - 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) - set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) - endif () - endif () - if (HDF5_TEST_FHEAP_VFD) - add_test (NAME VFD-${vfdname}-fheap - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-fheap" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-fheap PROPERTIES - TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-fheap-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-fheap-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES - TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () - endif () - endmacro () - - # Run test with different Virtual File Driver - foreach (vfd ${VFD_LIST}) - ADD_VFD_TEST (${vfd} 0) - endforeach () - + include (CMakeVFDTests.cmake) endif () ############################################################################## diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake new file mode 100644 index 0000000..9897f3f --- /dev/null +++ b/test/CMakeVFDTests.cmake @@ -0,0 +1,303 @@ + +# 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. +# + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## +# included from CMakeTEsts.cmake + +set (VFD_LIST + sec2 + stdio + core + core_paged + split + multi + family +) +if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) +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 () +endforeach () + +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_VFDTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}" "HDF5_VFDTEST_LIBSH_files") + endif () + endforeach () +endforeach () + +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_VFDTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}" "HDF5_VFDTEST_LIBSH_files") + endif () + endforeach () +endforeach () + +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_VFDTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}" "HDF5_VFDTEST_LIBSH_files") + endif () + endforeach () +endforeach () + +add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIB tests" DEPENDS ${HDF5_VFDTEST_LIB_files_list}) +if (BUILD_SHARED_LIBS) + add_custom_target(HDF5_VFDTEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIBSH tests" DEPENDS ${HDF5_VFDTEST_LIBSH_files_list}) +endif () + +############################################################################## +############################################################################## +### V F D T E S T S ### +############################################################################## +############################################################################## + + set (H5_VFD_SKIP_TESTS + cache + accum + fheap + big + vfd + error_test + err_compat + tcheck_version + testmeta + links_env + ) + if (NOT CYGWIN) + list(REMOVE_ITEM ${H5_VFD_SKIP_TESTS} big cache) + endif () + + # 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 ${HDF_CFG_NAME} MATCHES "Debug") + add_test (NAME VFD-${vfdname}-${vfdtest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VFD-${vfdname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () + else () + add_test (NAME VFD-${vfdname}-${vfdtest} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VFD-${vfdname}-${test}-shared + COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" + ) + endif () + endif () + else () + add_test (NAME VFD-${vfdname}-${vfdtest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VFD-${vfdname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () + endif () + else () + add_test (NAME VFD-${vfdname}-${vfdtest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES + 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") + add_test (NAME VFD-${vfdname}-${vfdtest}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () + endif () + endmacro () + + macro (DO_VFD_TEST vfdtest vfdname resultcode) + add_test (NAME VFD-${vfdname}-${vfdtest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VFD-${vfdname}-${vfdtest}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () + endmacro () + + macro (ADD_VFD_TEST vfdname resultcode) + foreach (test ${H5_TESTS}) + if (NOT "${test}" IN_LIST ${H5_VFD_SKIP_TESTS}) + if (WIN32) + CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) + else () + DO_VFD_TEST (${test} ${vfdname} ${resultcode}) + 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 () + 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) + set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) + endif () + endif () + if (HDF5_TEST_FHEAP_VFD) + add_test (NAME VFD-${vfdname}-fheap + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-fheap" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-fheap PROPERTIES + TIMEOUT 1800 + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VFD-${vfdname}-fheap-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-fheap-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES + TIMEOUT 1800 + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () + endif () + endif () + endmacro () + + # Run test with different Virtual File Driver + foreach (vfd ${VFD_LIST}) + ADD_VFD_TEST (${vfd} 0) + endforeach () diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index d0b74b0..3cee808 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.3.2) PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- @@ -49,6 +49,7 @@ set (H5P_TESTS t_mpi t_bigio t_cache + t_cache_image t_pflush1 t_pflush2 t_pread diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 41a9fdc..e02d3eb 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.3.2) PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 0fc1981..addaf2e 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.3.2) PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt index 24e682a..5a25f76 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.3.2) PROJECT (HDF5_TOOLS_SRC) #----------------------------------------------------------------------------- diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 1d9c11e..606516f 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.3.2) PROJECT (HDF5_TOOLS_SRC_H5COPY) #----------------------------------------------------------------------------- diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index a485de7..2ff5817 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.3.2) PROJECT (HDF5_TOOLS_SRC_H5DIFF) #----------------------------------------------------------------------------- diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index bcfa89c..491ec4b 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.3.2) PROJECT (HDF5_TOOLS_SRC_H5DUMP) #----------------------------------------------------------------------------- diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 0f6d8d9..712dd87 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.3.2) PROJECT (HDF5_TOOLS_SRC_H5FC) #----------------------------------------------------------------------------- diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index 4aa8938..efb0ad2 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.3.2) PROJECT (HDF5_TOOLS_SRC_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index fbd4250..9035ed9 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.3.2) PROJECT (HDF5_TOOLS_SRC_H5JAM) #----------------------------------------------------------------------------- diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index 703e55e..71b3d1d 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.3.2) PROJECT (HDF5_TOOLS_SRC_H5LS) #----------------------------------------------------------------------------- diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index a646819..3fefd24 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.3.2) PROJECT (HDF5_TOOLS_SRC_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index cde81ee..cc8bee2 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.3.2) PROJECT (HDF5_TOOLS_SRC_H5STAT) #----------------------------------------------------------------------------- diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 313760f..78ba238 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.3.2) PROJECT (HDF5_TOOLS_SRC_MISC) #----------------------------------------------------------------------------- diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index 6877bfc..54dd5a2 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.3.2) PROJECT (HDF5_TOOLS_TEST) #----------------------------------------------------------------------------- diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 35aee35..2f5f314 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.3.2) PROJECT (HDF5_TOOLS_TEST_H5COPY) #----------------------------------------------------------------------------- diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index def2e6d..cedc932 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.3.2) PROJECT (HDF5_TOOLS_TEST_H5DIFF) #----------------------------------------------------------------------------- diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index c4f2b95..1941764 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.3.2) PROJECT (HDF5_TOOLS_TEST_H5DUMP) #----------------------------------------------------------------------------- diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 497f463..5287ae0 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.3.2) PROJECT (HDF5_TOOLS_TEST_H5FC) #----------------------------------------------------------------------------- diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 36bfbdc..5492363 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.3.2) PROJECT (HDF5_TOOLS_TEST_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index dbac14b..17dda3c 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.3.2) PROJECT (HDF5_TOOLS_TEST_H5JAM) #----------------------------------------------------------------------------- diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index c21ca92..e92533f 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.3.2) PROJECT (HDF5_TOOLS_TEST_H5LS) #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index 5996fff..a606ac6 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.3.2) PROJECT (HDF5_TOOLS_TEST_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 13ebd17..17081a7 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 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/bounds_latest_latest.h5 # fsm ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_aggr.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fsm_aggr_nopersist.h5 @@ -464,60 +465,52 @@ endif () endmacro () - 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}" - ) + macro (ADD_H5_VERIFY_TEST testname resultcode testfile testdset testfilter) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + 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}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () - 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} + ) + 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} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) + if ("${resultcode}" STREQUAL "0") add_test ( - 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 + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testfile}-${testname}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=${testfilter}" + -D "TEST_REFERENCE=${testfilter}" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + else () + if ("${testfilter}" STREQUAL "CHUNKED") + set (nottestfilter "(CONTIGUOUS|COMPACT)") 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} - ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) - if ("${resultcode}" STREQUAL "0") - add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testfile}-${testname}-v.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=${testfilter}" - -D "TEST_REFERENCE=${testfilter}" - -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" - ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - else () - if ("${testfilter}" STREQUAL "CHUNKED") - set (nottestfilter "(CONTIGUOUS|COMPACT)") - endif () - if ("${testfilter}" STREQUAL "CONTIGUOUS") - set (nottestfilter "(CHUNK|COMPACT)") - endif () - if ("${testfilter}" STREQUAL "COMPACT") - set (nottestfilter "(CONTIGUOUS|CHUNK)") + if ("${testfilter}" STREQUAL "CONTIGUOUS") + set (nottestfilter "(CHUNK|COMPACT)") + endif () + if ("${testfilter}" STREQUAL "COMPACT") + set (nottestfilter "(CONTIGUOUS|CHUNK)") endif () add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP @@ -582,6 +575,62 @@ endif () endmacro () + macro (ADD_H5_VERIFY_SUPERBLOCK testname testfile lowbound highbound superblock) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${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_SUPERBLOCK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname} + COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects) + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testfile}-${testname}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=SUPERBLOCK_VERSION ${superblock}" + -D "TEST_REFERENCE=SUPERBLOCK_VERSION ${superblock}" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}) + endif () + endmacro () + + macro (ADD_H5_VERIFY_INVALIDBOUNDS testname resultcode lowbound highbound) + add_test ( + NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME ADD_H5_VERIFY_INVALIDBOUNDS-${testname} + COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties ( + ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES + DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects + WILL_FAIL "true" + ) + endif () + endmacro () + macro (ADD_H5_TEST_META testname testfile) # Remove any output file left over from previous test run add_test ( @@ -1371,6 +1420,18 @@ ADD_H5_VERIFY_VDS (vds_conti ${TESTTYPE} 0 ${FILEV4} vds_dset CONTIGUOUS -l vds_dset:CONTI) ############################################################################## +### V E R S I O N B O U N D S T E S T S +############################################################################## +# -j 0 -k 2, superblock will be 0 +ADD_H5_VERIFY_SUPERBLOCK SB_IS_0 h5repack_layout.h5 0 2 0 +# -j 1 -k 2, superblock will be 2 +ADD_H5_VERIFY_SUPERBLOCK SB_IS_2 h5repack_layout.h5 1 2 2 +# -j 2 -k 2, superblock will be 3 +ADD_H5_VERIFY_SUPERBLOCK SB_IS_3 h5repack_layout.h5 2 2 3 +# -j 0 -k 1, file cannot be opened +ADD_H5_VERIFY_INVALIDBOUNDS latest_latest_invalid bounds_latest_latest.h5 0 1 + +############################################################################## ### 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,0,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index d2a1de2..0d07753 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.3.2) PROJECT (HDF5_TOOLS_TEST_H5STAT) #----------------------------------------------------------------------------- diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index c014fad..178767a 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.3.2) PROJECT (HDF5_TOOLS_TEST_MISC) #----------------------------------------------------------------------------- diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index 9092079..5b34c43 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.3.2) PROJECT (HDF5_TOOLS_TEST_MISC_VDS) #----------------------------------------------------------------------------- diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index 581a85e..b7452e0 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.3.2) PROJECT (HDF5_TOOLS_TEST_PERFORM ) #----------------------------------------------------------------------------- -- cgit v0.12 From 90f01d5b160e0cbf950a9378d0a2625918a6eeb8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 27 Feb 2018 13:33:38 -0600 Subject: Fix IN_LIST usage --- test/CMakeLists.txt | 2 +- test/CMakeTests.cmake | 4 ++-- test/CMakeVFDTests.cmake | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cdab4f5..fd16f20 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -269,7 +269,7 @@ set (H5_TESTS_MULTIPLE ) # Only build single source tests here foreach (test ${H5_TESTS}) - if (NOT "${test}" IN_LIST ${H5_TESTS_MULTIPLE}) + if (NOT "${test}" IN_LIST H5_TESTS_MULTIPLE) ADD_H5_EXE(${test}) endif () endforeach () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 9b1ea6b..67bb502 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -548,7 +548,7 @@ set (H5TEST_SEPARATE_TESTS cache_image ) foreach (test ${H5TEST_TESTS}) - if (NOT "${test}" IN_LIST ${H5TEST_SEPARATE_TESTS}) + if (NOT "${test}" IN_LIST H5TEST_SEPARATE_TESTS) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5TEST-${test} COMMAND $) set_tests_properties (H5TEST-${test} PROPERTIES @@ -599,7 +599,7 @@ if (BUILD_SHARED_LIBS) ) foreach (test ${H5TEST_TESTS}) - if (NOT "${test}" IN_LIST ${H5TEST_SEPARATE_TESTS}) + if (NOT "${test}" IN_LIST H5TEST_SEPARATE_TESTS) if ("${test}" STREQUAL "big" AND CYGWIN) add_test (NAME H5TEST-shared-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 9897f3f..20020f8 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -237,7 +237,7 @@ endif () macro (ADD_VFD_TEST vfdname resultcode) foreach (test ${H5_TESTS}) - if (NOT "${test}" IN_LIST ${H5_VFD_SKIP_TESTS}) + if (NOT "${test}" IN_LIST H5_VFD_SKIP_TESTS) if (WIN32) CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) else () -- cgit v0.12 From 93744615f930324c04cef2543d272996e09acf56 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 27 Feb 2018 14:04:34 -0600 Subject: Fix list var --- test/CMakeLists.txt | 2 +- test/CMakeTests.cmake | 9 +- test/CMakeVFDTests.cmake | 2 +- tools/test/h5repack/CMakeTests.cmake | 161 +++++++++++------------------------ 4 files changed, 57 insertions(+), 117 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fd16f20..fd88b5f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -269,7 +269,7 @@ set (H5_TESTS_MULTIPLE ) # Only build single source tests here foreach (test ${H5_TESTS}) - if (NOT "${test}" IN_LIST H5_TESTS_MULTIPLE) + if (NOT ${test} IN_LIST H5_TESTS_MULTIPLE) ADD_H5_EXE(${test}) endif () endforeach () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 67bb502..221b857 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -544,11 +544,12 @@ add_test (NAME H5TEST-clear-objects ) set (H5TEST_SEPARATE_TESTS + testhdf5 cache cache_image ) -foreach (test ${H5TEST_TESTS}) - if (NOT "${test}" IN_LIST H5TEST_SEPARATE_TESTS) +foreach (test ${H5_TESTS}) + if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5TEST-${test} COMMAND $) set_tests_properties (H5TEST-${test} PROPERTIES @@ -598,8 +599,8 @@ if (BUILD_SHARED_LIBS) ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - foreach (test ${H5TEST_TESTS}) - if (NOT "${test}" IN_LIST H5TEST_SEPARATE_TESTS) + foreach (test ${H5_TESTS}) + if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS) if ("${test}" STREQUAL "big" AND CYGWIN) add_test (NAME H5TEST-shared-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 20020f8..944b163 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -237,7 +237,7 @@ endif () macro (ADD_VFD_TEST vfdname resultcode) foreach (test ${H5_TESTS}) - if (NOT "${test}" IN_LIST H5_VFD_SKIP_TESTS) + if (NOT ${test} IN_LIST H5_VFD_SKIP_TESTS) if (WIN32) CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) else () diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 17081a7..13ebd17 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -76,7 +76,6 @@ ${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/bounds_latest_latest.h5 # fsm ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_aggr.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fsm_aggr_nopersist.h5 @@ -465,52 +464,60 @@ endif () endmacro () - macro (ADD_H5_VERIFY_TEST testname resultcode testfile testdset testfilter) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - 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}-clear-objects PROPERTIES DEPENDS ${last_test}) + 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 () - 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} - ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) - if ("${resultcode}" STREQUAL "0") + else () + if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testfile}-${testname}-v.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=${testfilter}" - -D "TEST_REFERENCE=${testfilter}" - -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" + 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 ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - else () - if ("${testfilter}" STREQUAL "CHUNKED") - set (nottestfilter "(CONTIGUOUS|COMPACT)") - endif () - if ("${testfilter}" STREQUAL "CONTIGUOUS") - set (nottestfilter "(CHUNK|COMPACT)") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () - if ("${testfilter}" STREQUAL "COMPACT") - set (nottestfilter "(CONTIGUOUS|CHUNK)") + 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} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) + if ("${resultcode}" STREQUAL "0") + add_test ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testfile}-${testname}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=${testfilter}" + -D "TEST_REFERENCE=${testfilter}" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + else () + if ("${testfilter}" STREQUAL "CHUNKED") + set (nottestfilter "(CONTIGUOUS|COMPACT)") + endif () + if ("${testfilter}" STREQUAL "CONTIGUOUS") + set (nottestfilter "(CHUNK|COMPACT)") + endif () + if ("${testfilter}" STREQUAL "COMPACT") + set (nottestfilter "(CONTIGUOUS|CHUNK)") endif () add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP @@ -575,62 +582,6 @@ endif () endmacro () - macro (ADD_H5_VERIFY_SUPERBLOCK testname testfile lowbound highbound superblock) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME H5REPACK_VERIFY_SUPERBLOCK-${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_SUPERBLOCK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - add_test ( - NAME H5REPACK_VERIFY_SUPERBLOCK-${testname} - COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects) - add_test ( - NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testfile}-${testname}-v.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=SUPERBLOCK_VERSION ${superblock}" - -D "TEST_REFERENCE=SUPERBLOCK_VERSION ${superblock}" - -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" - ) - set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}) - endif () - endmacro () - - macro (ADD_H5_VERIFY_INVALIDBOUNDS testname resultcode lowbound highbound) - add_test ( - NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${testfile} - ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - add_test ( - NAME ADD_H5_VERIFY_INVALIDBOUNDS-${testname} - COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - set_tests_properties ( - ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES - DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects - WILL_FAIL "true" - ) - endif () - endmacro () - macro (ADD_H5_TEST_META testname testfile) # Remove any output file left over from previous test run add_test ( @@ -1420,18 +1371,6 @@ ADD_H5_VERIFY_VDS (vds_conti ${TESTTYPE} 0 ${FILEV4} vds_dset CONTIGUOUS -l vds_dset:CONTI) ############################################################################## -### V E R S I O N B O U N D S T E S T S -############################################################################## -# -j 0 -k 2, superblock will be 0 -ADD_H5_VERIFY_SUPERBLOCK SB_IS_0 h5repack_layout.h5 0 2 0 -# -j 1 -k 2, superblock will be 2 -ADD_H5_VERIFY_SUPERBLOCK SB_IS_2 h5repack_layout.h5 1 2 2 -# -j 2 -k 2, superblock will be 3 -ADD_H5_VERIFY_SUPERBLOCK SB_IS_3 h5repack_layout.h5 2 2 3 -# -j 0 -k 1, file cannot be opened -ADD_H5_VERIFY_INVALIDBOUNDS latest_latest_invalid bounds_latest_latest.h5 0 1 - -############################################################################## ### 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,0,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) -- cgit v0.12 From 032f680919cd67202c6b5817c327139c09dacb05 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 27 Feb 2018 14:09:27 -0600 Subject: Add import --- java/test/TestH5Pfapl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index ac54405..51fa4df 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -26,6 +26,7 @@ import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import hdf.hdf5lib.exceptions.HDF5PropertyListInterfaceException; import hdf.hdf5lib.structs.H5AC_cache_config_t; import org.junit.After; -- cgit v0.12 From 4899c9ab47b3e543a40dee3729a31c54807f0e9f Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 27 Feb 2018 18:04:29 -0600 Subject: Misc improvement Description: - Added test file for h5repack test VERIFY_INVALIDBOUNDS - Updated MANIFEST - Removed unnecessary header file in test - Update h5repack script to copy the new file to the test location Platforms tested: Linux/64 (jelly) Darwin (osx1010test) --- MANIFEST | 1 + test/dtypes.c | 1 - tools/test/h5repack/h5repack.sh.in | 4 +++- tools/test/h5repack/testfiles/bounds_latest_latest.h5 | Bin 0 -> 82048 bytes 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 tools/test/h5repack/testfiles/bounds_latest_latest.h5 diff --git a/MANIFEST b/MANIFEST index 8e79458..fba4fa8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2441,6 +2441,7 @@ #test files for h5repack ./tools/test/h5repack/testfiles/README +./tools/test/h5repack/testfiles/bounds_latest_latest.h5 ./tools/test/h5repack/testfiles/h5repack_aggr.h5 ./tools/test/h5repack/testfiles/h5repack_attr.h5 ./tools/test/h5repack/testfiles/h5repack_attr_refs.h5 diff --git a/test/dtypes.c b/test/dtypes.c index e480682..e98f6be 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -18,7 +18,6 @@ * Purpose: Tests the datatype interface (H5T) */ -#include "h5test.h" #include "testhdf5.h" #include "H5srcdir.h" #include "H5Iprivate.h" /* For checking that datatype id's don't leak */ diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index a34b75c..b0a2f99 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -82,6 +82,7 @@ test -d $TESTDIR || mkdir $TESTDIR # Comment '#' without space can be used. # -------------------------------------------------------------------- LIST_HDF5_TEST_FILES=" +$SRC_H5REPACK_TESTFILES/bounds_latest_latest.h5 $SRC_H5REPACK_TESTFILES/h5repack_attr.h5 $SRC_H5REPACK_TESTFILES/h5repack_attr_refs.h5 $SRC_H5REPACK_TESTFILES/h5repack_deflate.h5 @@ -534,7 +535,6 @@ VERIFY_SUPERBLOCK() ( cd $TESTDIR $RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile -echo "$RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile" ) RET=$? if [ $RET != 0 ] ; then @@ -575,6 +575,8 @@ VERIFY_INVALIDBOUNDS() infile=$3 outfile=out-verbounds-low$lowbound-high$highbound.$infile + #-------------------------------------- + # check for failure with invalid bounds TESTING $H5REPACK $@ ( cd $TESTDIR diff --git a/tools/test/h5repack/testfiles/bounds_latest_latest.h5 b/tools/test/h5repack/testfiles/bounds_latest_latest.h5 new file mode 100644 index 0000000..6e8bcad Binary files /dev/null and b/tools/test/h5repack/testfiles/bounds_latest_latest.h5 differ -- cgit v0.12 From 23ceda33b3f6b6903ce7bd4373347af5e0a33cd6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Feb 2018 09:01:38 -0600 Subject: Correct use of LIST var --- test/CMakeVFDTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 944b163..a17efbb 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -88,7 +88,7 @@ endif () links_env ) if (NOT CYGWIN) - list(REMOVE_ITEM ${H5_VFD_SKIP_TESTS} big cache) + list (REMOVE_ITEM H5_VFD_SKIP_TESTS big cache) endif () # Windows only macro -- cgit v0.12 From bf9b73e877302948a54a9a4129ffb265f39b574f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Feb 2018 09:26:11 -0600 Subject: Remove t_cache_image test on Windows --- testpar/CMakeTests.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 87470f3..cd9acda 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -18,6 +18,10 @@ add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) +if (WIN32) + # t_cache_imagee uses fork() and execve(), will not run on Windows + list (REMOVE_ITEM H5P_TESTS t_cache_image) +endif () foreach (testp ${H5P_TESTS}) add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endforeach () -- cgit v0.12 From 81b96fb01a706d88f973516efb1c0a78878a004b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Feb 2018 11:47:17 -0600 Subject: Remove option from list in doc --- release_docs/INSTALL_CMake.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 99efb6a..f54ca4b 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -571,7 +571,6 @@ HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" OFF HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON -HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON 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 -- cgit v0.12 From f2ff00bd7a21d86301dad00f851db72719e1a634 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 28 Feb 2018 14:40:13 -0600 Subject: Added bounds_latest_latest.h5 --- tools/test/h5repack/CMakeTests.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 13ebd17..4300228 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -53,6 +53,7 @@ # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- set (LIST_HDF5_TEST_FILES + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/bounds_latest_latest.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr_refs.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5 -- cgit v0.12 From cecb59f93f1345b2a667c996304e2430a716cfeb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 1 Mar 2018 08:26:33 -0600 Subject: Correct if-endif block --- java/src/jni/h5dImp.c | 2 +- test/CMakeVFDTests.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index 66efed0..9784055 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -1019,7 +1019,7 @@ Java_hdf_hdf5lib_H5_H5DreadVL } /* end else */ return (jint)status; -} /* end Java_hdf_hdf5lib_H5_H5Dread_1VLStrings */ +} /* end Java_hdf_hdf5lib_H5_H5Dread_1VL */ herr_t H5DreadVL_asstr diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index a17efbb..cbf944e 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -243,7 +243,7 @@ endif () else () DO_VFD_TEST (${test} ${vfdname} ${resultcode}) endif () - endforeach () + endif () 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) -- cgit v0.12 From 5a8ac1fb6c13e776bc17fa52c4cdf353c907907b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 1 Mar 2018 08:33:24 -0600 Subject: Fix test loop --- test/CMakeVFDTests.cmake | 78 ++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index cbf944e..995f4e0 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -244,55 +244,55 @@ endif () DO_VFD_TEST (${test} ${vfdname} ${resultcode}) endif () endif () - 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) + 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 () + 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) + set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) endif () + endif () + if (HDF5_TEST_FHEAP_VFD) + add_test (NAME VFD-${vfdname}-fheap + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-fheap" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-fheap PROPERTIES + TIMEOUT 1800 + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ) 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) - set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) - endif () - endif () - if (HDF5_TEST_FHEAP_VFD) - add_test (NAME VFD-${vfdname}-fheap + add_test (NAME VFD-${vfdname}-fheap-shared COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" -D "TEST_VFD:STRING=${vfdname}" -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-fheap" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -D "TEST_OUTPUT=${vfdname}-fheap-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) - set_tests_properties (VFD-${vfdname}-fheap PROPERTIES + set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-fheap-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-fheap-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES - TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () endif () endif () endmacro () -- cgit v0.12 From c0aafa78e52fcea5bfc4252fc2c0285b9b983646 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Fri, 2 Mar 2018 11:32:13 -0500 Subject: Fixed t_pread.c to remove the use of h5jam, etc.. This fixes HDFFV-8839 and should merge into develop --- testpar/t_pread.c | 155 +++++++++++++++++------------------------------------- 1 file changed, 47 insertions(+), 108 deletions(-) diff --git a/testpar/t_pread.c b/testpar/t_pread.c index aac5bee..53701b9 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -25,16 +25,10 @@ * 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", +#define NFILENAME 3 +const char *FILENAMES[NFILENAME + 1]={"reloc_t_pread_data_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 @@ -55,18 +49,13 @@ 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); static char *test_argv0 = NULL; -extern char *dirname(char *path); /* Avoids additional includes */ - + /*------------------------------------------------------------------------- * Function: generate_test_file * * 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. + * whose superblock is relocated to a power-of-2 boundary. * * Since data will be read back and validated, we generate * data in a predictable manner rather than randomly. @@ -98,13 +87,11 @@ extern char *dirname(char *path); /* Avoids additional includes */ static int generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) { - FILE *header = NULL; + int header = -1; const char *fcn_name = "generate_test_file()"; const char *failure_mssg = 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 = 0; int group_size; int group_rank; @@ -117,6 +104,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) hid_t file_id = -1; hid_t memspace = -1; hid_t filespace = -1; + hid_t fctmpl = -1; hid_t fapl_id = -1; hid_t dxpl_id = -1; hid_t dset_id = -1; @@ -154,10 +142,10 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) file_index = 0; } else if ( group_id == 0 ) { /* Test 2 group 0 */ - file_index = 3; + file_index = 1; } else { /* Test 2 group 1 */ - file_index = 6; + file_index = 2; } /* The 'group_filename' is just a temp variable and @@ -175,32 +163,6 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } } - if ( pass ) { - - group_filename = FILENAMES[file_index+1]; - HDassert( group_filename ); - - /* Assign the 'reloc_data_filename' */ - if ( h5_fixname(group_filename, H5P_DEFAULT, reloc_data_filename, - sizeof(reloc_data_filename)) == NULL ) { - - pass = FALSE; - failure_mssg = "h5_fixname(1) failed.\n"; - } - } - - if ( pass ) { - group_filename = FILENAMES[file_index+2]; - HDassert( group_filename ); - - /* Assign 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"; - } - } - /* setup data to write */ if ( pass ) { if ( (data_slice = (float *)HDmalloc(COUNT * sizeof(float))) == NULL ) { @@ -218,6 +180,17 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } } + /* Initialize a file creation template */ + if (pass) { + if ((fctmpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { + pass = FALSE; + failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n"; + } + else if (H5Pset_userblock(fctmpl, 512) != SUCCEED) { + pass = FALSE; + failure_mssg = "H5Pset_userblock(,size) failed.\n"; + } + } /* setup FAPL */ if ( pass ) { if ( (fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0 ) { @@ -236,7 +209,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) /* create the data file */ if ( pass ) { if ( (file_id = H5Fcreate(data_filename, H5F_ACC_TRUNC, - H5P_DEFAULT, fapl_id)) < 0 ) { + fctmpl, fapl_id)) < 0 ) { pass = FALSE; failure_mssg = "H5Fcreate() failed.\n"; } @@ -342,6 +315,13 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } } + if (pass || (fctmpl != -1)) { + if (H5Pclose(fctmpl) < 0) { + pass = false; + failure_mssg = "H5Pclose(fctmpl) failed.\n"; + } + } + /* Add a userblock to the head of the datafile. * We will use this to for a functional test of the * file open optimization. This is superblock @@ -354,11 +334,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) * group_rank(0) processes. Each parallel group * will create a unique file with different text * headers and different data. - * - * We also delete files that are no longer needed. */ - if ( group_rank == 0 ) { - + if (group_rank == 0) { const char *text_to_write; size_t bytes_to_write; @@ -367,69 +344,33 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) else text_to_write = hitchhiker_quote; - bytes_to_write = strlen(text_to_write); - - if ( pass ) { - if ( (header = HDfopen(prolog_filename, "w+")) == NULL ) { - pass = FALSE; - failure_mssg = "HDfopen(prolog_filename, \"w+\") failed.\n"; - } - } - - if ( pass ) { + bytes_to_write = HDstrlen(text_to_write); - if ( HDfwrite(text_to_write, 1, bytes_to_write, header) != - bytes_to_write ) { + if (pass) { + if ((header = HDopen(data_filename, O_WRONLY)) < 0) { pass = FALSE; - failure_mssg = "Unable to write header file.\n"; + failure_mssg = "HDopen(data_filename, O_WRONLY) failed.\n"; } } - if ( pass || (header != NULL) ) { - if ( HDfclose(header) != 0 ) { + if (pass) { + HDlseek(header, 0, SEEK_SET); + if (HDwrite(header, text_to_write, bytes_to_write) < 0) { pass = FALSE; - failure_mssg = "HDfclose() failed.\n"; - } + failure_mssg = "Unable to write user text into file.\n"; + } } - if ( pass ) { - char cmd[256]; - char exe_path[256]; - char *relative_path = "../tools/src/h5jam"; - char *exe_dirname = relative_path; - - /* We're checking for the existance of the h5jam utility - * With Cmake testing, all binaries are in the same directory - * e.g. the same location where this executable is found. - * We've copied the argv[0] argument and check to see - * if h5jam is co-located here. Otherwise, the autotools - * put things into directories, hence the relative path. - */ - if (test_argv0 != NULL) { - HDstrncpy(exe_path, test_argv0, sizeof(exe_path)); - if ( (exe_dirname = (char *)dirname(exe_path)) != NULL) { - HDsprintf(cmd, "%s/h5jam", exe_dirname); - if ( HDaccess(cmd, F_OK) != 0) - exe_dirname = relative_path; - } - } - HDsprintf(cmd, "%s/h5jam -i %s -u %s -o %s", - exe_dirname, - data_filename, - prolog_filename, reloc_data_filename); - - if ( system(cmd) != 0 ) { + if (pass || (header > 0)) { + if (HDclose(header) < 0) { pass = FALSE; - failure_mssg = "invocation of h5jam failed.\n"; + failure_mssg = "HDclose() failed.\n"; } } - - HDremove(prolog_filename); - HDremove(data_filename); } /* collect results from other processes. - * Only overwrite the failure message if no preveious error + * Only overwrite the failure message if no previous error * has been detected */ local_failure = ( pass ? 0 : 1 ); @@ -467,7 +408,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } /* generate_test_file() */ - + /*------------------------------------------------------------------------- * Function: test_parallel_read * @@ -564,11 +505,11 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) if ( pass ) { if ( comm == MPI_COMM_WORLD ) /* test 1 */ - group_filename = FILENAMES[1]; + group_filename = FILENAMES[0]; else if ( group_id == 0 ) /* test 2 group 0 */ - group_filename = FILENAMES[4]; + group_filename = FILENAMES[1]; else /* test 2 group 1 */ - group_filename = FILENAMES[7]; + group_filename = FILENAMES[2]; HDassert(group_filename); if ( h5_fixname(group_filename, H5P_DEFAULT, reloc_data_filename, @@ -742,7 +683,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) } /* test_parallel_read() */ - + /*------------------------------------------------------------------------- * Function: main * @@ -781,7 +722,7 @@ main( int argc, char **argv) int mpi_rank; int mpi_size; int split_size; - MPI_Comm group_comm = MPI_COMM_WORLD; + MPI_Comm group_comm = MPI_COMM_NULL; /* I don't believe that argv[0] can ever be NULL. * It should thus be safe to dup and save as a check @@ -905,7 +846,6 @@ finish: HDfprintf(stderr, "MPI_Comm_free failed!\n"); } - /* make sure all processes are finished before final report, cleanup * and exit. */ @@ -916,7 +856,6 @@ finish: HDfprintf(stdout, "===================================\n"); if ( nerrs > 0 ) { - HDfprintf(stdout, "***%s detected %d failures***\n", header, nerrs); } else { -- cgit v0.12 From 9364df1c6d6d4661b6c32278268ccbe1640a082c Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Fri, 2 Mar 2018 13:50:23 -0600 Subject: Fix CMake build type if none was specified to be cached Restrict CMAKE_BUILD_TYPE to default ones --- config/cmake_ext_mod/HDFMacros.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 4097ca9..bdc52b9 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -27,8 +27,12 @@ macro (SET_HDF_BUILD_TYPE) set(HDF_BUILD_TYPE "Release") endif() endif() - if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") + set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + "MinSizeRel" "RelWithDebInfo") endif() endmacro () -- cgit v0.12 From b3142a85fda8670a5780e6d3d080d54a71e0fc1d Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 5 Mar 2018 08:17:39 -0600 Subject: Update install file for configure revisions. --- release_docs/INSTALL | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/release_docs/INSTALL b/release_docs/INSTALL index 2dcb9be..3709a58 100644 --- a/release_docs/INSTALL +++ b/release_docs/INSTALL @@ -305,7 +305,7 @@ CONTENTS to enable symbolic debugging of a production version of HDF5, one might say: - $ CFLAGS=-g ./configure --enable-production + $ CFLAGS=-g ./configure --enable-build-mode=production 4.3.5. Compiling HDF5 wrapper libraries One can optionally build the Fortran and/or C++ interfaces to the @@ -414,35 +414,35 @@ CONTENTS The library can be compiled to provide symbolic debugging support so it can be debugged with gdb, dbx, ddd, etc., or it can be compiled with various optimizations. To compile for symbolic - debugging (the default for snapshots), say `--disable-production'; - to compile with optimizations (the default for supported public - releases), say `--enable-production'. On some systems the library - can also be compiled for profiling with gprof by saying + debugging (the default for snapshots), say + `--enable-build-mode=production'; to compile with optimizations + (the default for supported public releases), + say `--enable-build-mode=production'. On some systems the + library can also be compiled for profiling with gprof by saying `--enable-production=profile'. - $ ./configure --disable-production #symbolic debugging - $ ./configure --enable-production #optimized code - $ ./configure --enable-production=profile #for use with gprof + $ ./configure --enable-build-mode=debug #symbolic debugging + $ ./configure --enable-build-mode=production #optimized code + $ ./configure --enable-production=profile #for use with gprof Regardless of whether support for symbolic debugging is enabled, the library can also perform runtime debugging of certain packages (such as type conversion execution times and extensive invariant - condition checking). To enable this debugging, supply a - comma-separated list of package names to to the `--enable-debug' - switch. See "Debugging HDF5 Applications" for a list of package - names: + condition checking). To enable this debugging, supply a + comma-separated list of package names to the `--enable-internal-debug' + switch. See "Debugging HDF5 Applications" for a list of package names: http://www.hdfgroup.org/HDF5/doc/H5.user/Debugging.html - Debugging can be disabled by saying `--disable-debug'. + Debugging can be disabled by saying `--disable-internal-debug'. The default debugging level for snapshots is a subset of the available packages; the default for supported releases is no debugging (debugging can incur a significant runtime penalty). - $ ./configure --enable-debug=s,t #debug only H5S and H5T - $ ./configure --enable-debug #debug normal packages - $ ./configure --enable-debug=all #debug all packages - $ ./configure --disable-debug #no debugging + $ ./configure --enable-internal-debug=s,t #debug only H5S and H5T + $ ./configure --enable-internal-debug #debug normal packages + $ ./configure --enable-internal-debug=all #debug all packages + $ ./configure --disable-internal-debug #no debugging HDF5 can also print a trace of all API function calls, their arguments, and the return values. To enable or disable the @@ -466,15 +466,17 @@ CONTENTS http://www.hdfgroup.org/HDF5/doc/TechNotes/ThreadSafeLibrary.html 4.3.12. Backward compatibility - The 1.8 version of the HDF5 Library can be configured to operate - identically to the v1.6 library with the + The 1.10 version of the HDF5 Library can be configured to operate + identically to the v1.8 library with the + --with-default-api-version=v18 + configure flag, or identically to the v1.6 library with the --with-default-api-version=v16 configure flag. This allows existing code to be compiled with the - v1.8 library without requiring immediate changes to the application + v1.10 library without requiring immediate changes to the application source code. For addtional configuration options and other details, see "API Compatibility Macros in HDF5": - http://www.hdfgroup.org/HDF5/doc/RM/APICompatMacros.html + https://support.hdfgroup.org/HDF5/doc/RM/APICompatMacros.html 4.4. Building The library, confidence tests, and programs can be built by -- cgit v0.12 From 58603849053dceb81ae8a63e05a7862fac72ff3c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Mar 2018 11:47:09 -0600 Subject: HDFFV-10414 change minor error_number --- java/test/TestH5Pfapl.java | 2 +- src/H5Pfapl.c | 202 ++++++++++++++++++++++----------------------- 2 files changed, 102 insertions(+), 102 deletions(-) diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index 51fa4df..0651502 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1388,7 +1388,7 @@ public class TestH5Pfapl { } catch (HDF5PropertyListInterfaceException err) { // parallel is not supported - if (err.getMinorErrorNumber() != HDF5Constants.H5E_CANTSET) { + if (err.getMinorErrorNumber() != HDF5Constants.H5E_UNSUPPORTED) { err.printStackTrace(); fail("H5P_evict_on_close: " + err); } diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 7802535..d37d352 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -387,7 +387,7 @@ static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; static const unsigned H5F_def_page_buf_min_meta_perc_g = H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEF; /* Default page buffer minimum metadata size */ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEF; /* Default page buffer minumum raw data size */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_reg_prop * @@ -627,7 +627,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_reg_prop() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_alignment * @@ -685,7 +685,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_alignment * @@ -726,7 +726,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_alignment() */ - + /*------------------------------------------------------------------------- * Function: H5P_set_driver * @@ -774,7 +774,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_set_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_driver * @@ -817,7 +817,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver * @@ -861,7 +861,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver * @@ -902,7 +902,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver_info * @@ -944,7 +944,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver_info * @@ -984,7 +984,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_copy * @@ -1050,7 +1050,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_free * @@ -1102,7 +1102,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_create * @@ -1131,7 +1131,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_create() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_set * @@ -1164,7 +1164,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_get * @@ -1197,7 +1197,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_del * @@ -1226,7 +1226,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_copy * @@ -1255,7 +1255,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_cmp * @@ -1314,7 +1314,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_close * @@ -1343,7 +1343,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_family_offset * @@ -1382,7 +1382,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_family_offset * @@ -1423,7 +1423,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_multi_type * @@ -1462,7 +1462,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_multi_type * @@ -1503,7 +1503,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_cache * @@ -1557,7 +1557,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_cache * @@ -1609,7 +1609,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_image_config * @@ -1653,7 +1653,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_image_config * @@ -1704,7 +1704,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * @@ -1748,7 +1748,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_config * @@ -1799,7 +1799,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_gc_references * @@ -1852,7 +1852,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_gc_references * @@ -1895,7 +1895,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_fclose_degree * @@ -1931,7 +1931,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_fclose_degree * @@ -1966,7 +1966,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_meta_block_size * @@ -2017,7 +2017,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_meta_block_size * @@ -2061,7 +2061,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_sieve_buf_size * @@ -2112,7 +2112,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_sieve_buf_size * @@ -2155,7 +2155,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_small_data_block_size * @@ -2201,7 +2201,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_small_data_block_size * @@ -2240,7 +2240,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_libver_bounds * @@ -2338,7 +2338,7 @@ done: * 5) H5F_LIBVER_LATEST, H5F_LIBVER_LATEST * See detailed description in the RFC: Setting Bounds for Object Creation in HDF5 1.10.0. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Sunday, December 30, 2007 @@ -2382,11 +2382,11 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_libver_bounds * - * Purpose: Returns the current settings for the library version format bounds + * Purpose: Returns the current settings for the library version format bounds * from a file access property list. * * Return: Non-negative on success/Negative on failure @@ -2409,7 +2409,7 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low/*out*/, /* 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") - + /* Get values */ if(low) { if(H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, low) < 0) @@ -2425,7 +2425,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_elink_file_cache_size * @@ -2463,7 +2463,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_elink_file_cache_size * @@ -2502,7 +2502,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image * @@ -2583,7 +2583,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image * @@ -2672,7 +2672,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image_callbacks * @@ -2749,7 +2749,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image_callbacks * @@ -2805,7 +2805,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_copy * @@ -2883,7 +2883,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_free * @@ -2938,7 +2938,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_cmp * @@ -2981,7 +2981,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_enc * @@ -3027,7 +3027,7 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_image_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_dec * @@ -3079,7 +3079,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_set * @@ -3112,7 +3112,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_get * @@ -3145,7 +3145,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_del * @@ -3176,7 +3176,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_copy * @@ -3206,7 +3206,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_cmp * @@ -3265,7 +3265,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_close * @@ -3295,7 +3295,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_close() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_cmp * @@ -3407,7 +3407,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_enc * @@ -3552,7 +3552,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_dec * @@ -3687,7 +3687,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_enc * @@ -3725,7 +3725,7 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_dec * @@ -3760,7 +3760,7 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_multi_type_enc * @@ -3798,7 +3798,7 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_multi_type_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_multi_type_dec * @@ -3833,7 +3833,7 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_multi_type_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_enc * @@ -3841,10 +3841,10 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) * 'high' bound of library format versions property in the * file access property list is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer + * Programmer * *------------------------------------------------------------------------- */ @@ -3870,7 +3870,7 @@ H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_dec * @@ -3878,10 +3878,10 @@ H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size) * 'high' bound of library format versions property in the * file access property list is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: + * Programmer: * *------------------------------------------------------------------------- */ @@ -3904,9 +3904,9 @@ H5P__facc_libver_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_dec() */ - + /*------------------------------------------------------------------------- - * Function: H5Pset_core_write_tracking + * Function: H5Pset_core_write_tracking * * Purpose: Enables/disables core VFD write tracking and page * aggregation size. @@ -3945,7 +3945,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_core_write_tracking * @@ -3987,7 +3987,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_metadata_read_attempts * @@ -4030,7 +4030,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_metadata_read_attempts * @@ -4071,7 +4071,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_obj_flush_cb * @@ -4115,7 +4115,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_obj_flush_cb * @@ -4156,7 +4156,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_log_options * @@ -4208,7 +4208,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_log_options * @@ -4263,7 +4263,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_enc * @@ -4316,7 +4316,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_dec * @@ -4370,7 +4370,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_del * @@ -4393,7 +4393,7 @@ H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_del() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_copy * @@ -4415,7 +4415,7 @@ H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_cmp * @@ -4447,7 +4447,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_close * @@ -4470,7 +4470,7 @@ H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_evict_on_close * @@ -4509,7 +4509,7 @@ H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close) #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") + HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, 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 */ @@ -4518,7 +4518,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_evict_on_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_evict_on_close * @@ -4562,7 +4562,7 @@ done: } /* end H5Pget_evict_on_close() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- * Function: H5P__encode_coll_md_read_flag_t * @@ -4600,7 +4600,7 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__encode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5P__decode_coll_md_read_flag_t * @@ -4634,7 +4634,7 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__decode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_all_coll_metadata_ops * @@ -4693,7 +4693,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_all_coll_metadata_ops() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_all_coll_metadata_ops * @@ -4751,7 +4751,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_all_coll_metadata_ops */ - + /*------------------------------------------------------------------------- * Function: H5Pset_coll_metadata_write * @@ -4790,7 +4790,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_coll_metadata_write() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_coll_metadata_write * @@ -4828,7 +4828,7 @@ done: } /* end H5Pget_coll_metadata_write() */ #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- * Function: H5Pset_page_buffer_size * @@ -4876,7 +4876,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_page_buffer_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_page_buffer_size * -- cgit v0.12 From 58094b4f808e7a00d533f7b19a3fafb744ef6d77 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Mar 2018 12:22:48 -0600 Subject: HDFFV-10414 restore Ctl char - do we really need these anymore --- src/H5Pfapl.c | 178 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index d37d352..490e647 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -387,7 +387,7 @@ static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; static const unsigned H5F_def_page_buf_min_meta_perc_g = H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEF; /* Default page buffer minimum metadata size */ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEF; /* Default page buffer minumum raw data size */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_reg_prop * @@ -627,7 +627,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_reg_prop() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_alignment * @@ -685,7 +685,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_alignment * @@ -726,7 +726,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_alignment() */ - + /*------------------------------------------------------------------------- * Function: H5P_set_driver * @@ -774,7 +774,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_set_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_driver * @@ -817,7 +817,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver * @@ -861,7 +861,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver * @@ -902,7 +902,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver_info * @@ -944,7 +944,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver_info * @@ -984,7 +984,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_copy * @@ -1050,7 +1050,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_free * @@ -1102,7 +1102,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_create * @@ -1131,7 +1131,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_create() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_set * @@ -1164,7 +1164,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_get * @@ -1197,7 +1197,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_del * @@ -1226,7 +1226,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_copy * @@ -1255,7 +1255,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_cmp * @@ -1314,7 +1314,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_close * @@ -1343,7 +1343,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_family_offset * @@ -1382,7 +1382,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_family_offset * @@ -1423,7 +1423,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_multi_type * @@ -1462,7 +1462,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_multi_type * @@ -1503,7 +1503,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_cache * @@ -1557,7 +1557,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_cache * @@ -1609,7 +1609,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_image_config * @@ -1653,7 +1653,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_image_config * @@ -1704,7 +1704,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * @@ -1748,7 +1748,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_config * @@ -1799,7 +1799,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_gc_references * @@ -1852,7 +1852,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_gc_references * @@ -1895,7 +1895,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_fclose_degree * @@ -1931,7 +1931,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_fclose_degree * @@ -1966,7 +1966,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_meta_block_size * @@ -2017,7 +2017,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_meta_block_size * @@ -2061,7 +2061,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_sieve_buf_size * @@ -2112,7 +2112,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_sieve_buf_size * @@ -2155,7 +2155,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_small_data_block_size * @@ -2201,7 +2201,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_small_data_block_size * @@ -2240,7 +2240,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_libver_bounds * @@ -2382,7 +2382,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_libver_bounds * @@ -2425,7 +2425,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_elink_file_cache_size * @@ -2463,7 +2463,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_elink_file_cache_size * @@ -2502,7 +2502,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image * @@ -2583,7 +2583,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image * @@ -2672,7 +2672,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image_callbacks * @@ -2749,7 +2749,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image_callbacks * @@ -2805,7 +2805,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_copy * @@ -2883,7 +2883,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_free * @@ -2938,7 +2938,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_cmp * @@ -2981,7 +2981,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_enc * @@ -3027,7 +3027,7 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_image_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_dec * @@ -3079,7 +3079,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_set * @@ -3112,7 +3112,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_get * @@ -3145,7 +3145,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_del * @@ -3176,7 +3176,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_copy * @@ -3206,7 +3206,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_cmp * @@ -3265,7 +3265,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_close * @@ -3295,7 +3295,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_close() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_cmp * @@ -3407,7 +3407,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_enc * @@ -3552,7 +3552,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_dec * @@ -3687,7 +3687,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_enc * @@ -3725,7 +3725,7 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_dec * @@ -3760,7 +3760,7 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_multi_type_enc * @@ -3833,7 +3833,7 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_multi_type_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_enc * @@ -3870,7 +3870,7 @@ H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_dec * @@ -3904,7 +3904,7 @@ H5P__facc_libver_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_dec() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_core_write_tracking * @@ -3945,7 +3945,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_core_write_tracking * @@ -3987,7 +3987,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_metadata_read_attempts * @@ -4030,7 +4030,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_metadata_read_attempts * @@ -4071,7 +4071,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_obj_flush_cb * @@ -4115,7 +4115,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_obj_flush_cb * @@ -4156,7 +4156,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_log_options * @@ -4208,7 +4208,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_log_options * @@ -4263,7 +4263,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_enc * @@ -4316,7 +4316,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_dec * @@ -4370,7 +4370,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_del * @@ -4393,7 +4393,7 @@ H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_del() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_copy * @@ -4415,7 +4415,7 @@ H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_cmp * @@ -4447,7 +4447,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_close * @@ -4470,7 +4470,7 @@ H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_evict_on_close * @@ -4518,7 +4518,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_evict_on_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_evict_on_close * @@ -4562,7 +4562,7 @@ done: } /* end H5Pget_evict_on_close() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- * Function: H5P__encode_coll_md_read_flag_t * @@ -4600,7 +4600,7 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__encode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5P__decode_coll_md_read_flag_t * @@ -4634,7 +4634,7 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__decode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_all_coll_metadata_ops * @@ -4693,7 +4693,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_all_coll_metadata_ops() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_all_coll_metadata_ops * @@ -4751,7 +4751,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_all_coll_metadata_ops */ - + /*------------------------------------------------------------------------- * Function: H5Pset_coll_metadata_write * @@ -4790,7 +4790,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_coll_metadata_write() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_coll_metadata_write * @@ -4828,7 +4828,7 @@ done: } /* end H5Pget_coll_metadata_write() */ #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- * Function: H5Pset_page_buffer_size * @@ -4876,7 +4876,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_page_buffer_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_page_buffer_size * -- cgit v0.12 From 8ae5f6804186e3121dfe933d6bf9c9044f8ae9d6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Mar 2018 12:43:51 -0600 Subject: HDFFV-10292 Windows drive letters cause issues in paths --- release_docs/INSTALL_CMake.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index f54ca4b..923bba3 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -165,8 +165,9 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: III. Quick Step Building HDF5 C Static Libraries and Tools with CMake ======================================================================== Notes: This short set of instructions is written for users who want to - quickly build the just the HDF5 C static library and tools from + quickly build just the HDF5 C static library and tools from the HDF5 source code package using the CMake command line tools. + Avoid the use of drive letters in paths on Windows. Go through these steps: -- cgit v0.12 From 2b50dc9855cfc096675698eda084830ea73427b8 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 6 Mar 2018 09:02:32 -0600 Subject: Added h5repack tests Description: Added tests SUPERBLOCK and INVALIDBOUNDS, composed by ADB. Platforms tested: Linux/64 (jelly) - cmake --- tools/test/h5repack/CMakeTests.cmake | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 4300228..6e98ee4 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -149,6 +149,8 @@ ${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 + # versionbounds + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/bounds_latest_latest.h5 # fsm ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/STG.h5repack_none.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SPT.h5repack_aggr.h5 @@ -583,6 +585,63 @@ endif () endmacro () +# VERIFY_SUPERBLOCK + macro (ADD_H5_VERIFY_SUPERBLOCK testname testfile lowbound highbound superblock) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${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_SUPERBLOCK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname} + COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects) + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testfile}-${testname}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=SUPERBLOCK_VERSION ${superblock}" + -D "TEST_REFERENCE=SUPERBLOCK_VERSION ${superblock}" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}) + endif () + endmacro () + + macro (ADD_H5_VERIFY_INVALIDBOUNDS testname resultcode lowbound highbound) + add_test ( + NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME ADD_H5_VERIFY_INVALIDBOUNDS-${testname} + COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties ( + ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES + DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects + WILL_FAIL "true" + ) + endif () + endmacro () + macro (ADD_H5_TEST_META testname testfile) # Remove any output file left over from previous test run add_test ( @@ -1372,6 +1431,18 @@ ADD_H5_VERIFY_VDS (vds_conti ${TESTTYPE} 0 ${FILEV4} vds_dset CONTIGUOUS -l vds_dset:CONTI) ############################################################################## +### V E R S I O N B O U N D S T E S T S +############################################################################## +# -j 0 -k 2, superblock will be 0 +ADD_H5_VERIFY_SUPERBLOCK (SB_IS_0 h5repack_layout.h5 0 2 0) +# -j 1 -k 2, superblock will be 2 +ADD_H5_VERIFY_SUPERBLOCK (SB_IS_2 h5repack_layout.h5 1 2 2) +# -j 2 -k 2, superblock will be 3 +ADD_H5_VERIFY_SUPERBLOCK (SB_IS_3 h5repack_layout.h5 2 2 3) +# -j 0 -k 1, file cannot be opened +ADD_H5_VERIFY_INVALIDBOUNDS latest_latest_invalid bounds_latest_latest.h5 0 1 + +############################################################################## ### 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,0,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) -- cgit v0.12 From 960a1d55eed8b30350d7a87e1a9a7da72e86d270 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Mar 2018 09:45:26 -0600 Subject: plist testfiles need to be copied into VFD test folders as well --- test/CMakeVFDTests.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 995f4e0..be02110 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -32,8 +32,12 @@ endif () foreach (vfdtest ${VFD_LIST}) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files") if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files") endif () endforeach () @@ -64,6 +68,17 @@ foreach (vfdtest ${VFD_LIST}) endforeach () endforeach () +foreach (vfdtest ${VFD_LIST}) + foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files/${plistfile}" "HDF5_VFDTEST_LIB_files") + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files/def_${plistfile}" "HDF5_VFDTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files/${plistfile}" "HDF5_VFDTEST_LIBSH_files") + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files/def_${plistfile}" "HDF5_VFDTEST_LIBSH_files") + endif () + endforeach () +endforeach () + add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIB tests" DEPENDS ${HDF5_VFDTEST_LIB_files_list}) if (BUILD_SHARED_LIBS) add_custom_target(HDF5_VFDTEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIBSH tests" DEPENDS ${HDF5_VFDTEST_LIBSH_files_list}) -- cgit v0.12 From f05f9d4cffab5e008c67e19034c1b248e1b01b3c Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 6 Mar 2018 11:41:33 -0600 Subject: Miscellaneous test fixes Description: - dtypes.c: added the use of highest version of nested datatypes to verify the datatype's version. - miscellaneous typos Platforms tested: Linux/64 (jelly) Darwin (osx1010test) --- test/dtypes.c | 43 ++++++++++++++++++++++++++++-------- test/tfile.c | 2 +- tools/test/h5repack/CMakeTests.cmake | 2 -- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/test/dtypes.c b/test/dtypes.c index e98f6be..426f3b9 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -7444,15 +7444,14 @@ error: * the library will only use basic version * *************************************************************************/ -static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_shared_low_bound, unsigned *highest_version) +static herr_t verify_version(hid_t dtype, H5F_libver_t low, unsigned *highest_version) { - H5T_t *dtypep = NULL; /* Internal structure of a datatype */ - H5T_class_t type_cls = H5T_NO_CLASS; /* Temporary var for datatype class */ hid_t base_dtype = -1; hid_t mem_dtype = -1; + H5T_t *dtypep = NULL; /* Internal structure of a datatype */ + H5T_class_t type_cls = H5T_NO_CLASS; /* Temporary var for datatype class */ int nmembers = 0; unsigned i; - H5F_libver_t highest = H5F_LIBVER_EARLIEST; herr_t ret = SUCCEED; /* Generic return value */ dtypep = (H5T_t *)H5I_object(dtype); @@ -7465,6 +7464,8 @@ static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_share switch (type_cls) { case H5T_ARRAY: + { + H5T_t *base_dtypep = NULL; /* Internal structure of a datatype */ if (low == H5F_LIBVER_EARLIEST) VERIFY(dtypep->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); @@ -7475,8 +7476,17 @@ static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_share base_dtype = H5Tget_super(dtype); CHECK(base_dtype, FAIL, "H5Tget_super"); + /* Get the base type's internal structure for version */ + base_dtypep = (H5T_t *)H5I_object(base_dtype); + if (base_dtypep == NULL) TEST_ERROR + + /* Reset highest version if this datatype has higher version than + its outer type */ + if (*highest_version < base_dtypep->shared->version) + *highest_version = base_dtypep->shared->version; + /* Verify the base datatype recursively */ - ret = verify_version(base_dtype, low, f_shared_low_bound, highest_version); + ret = verify_version(base_dtype, low, highest_version); /* Close the member datatype before checking for failure */ if ((H5Tclose(base_dtype)) < 0) TEST_ERROR @@ -7485,17 +7495,31 @@ static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_share if (ret < 0) TEST_ERROR break; + } case H5T_COMPOUND: + { + H5T_t *mem_dtypep = NULL; /* Internal structure of a datatype */ /* Get the number of members of this compound type */ if ((nmembers = H5Tget_nmembers(dtype)) < 0) TEST_ERROR /* Go through all its member datatypes */ for (i = 0; i < (unsigned)nmembers; i++) { - /* Get the member datatype and verify it recursively */ + /* Get the member datatype to verify it recursively */ mem_dtype = H5Tget_member_type(dtype, i); if (mem_dtype < 0) TEST_ERROR - ret = verify_version(mem_dtype, low, f_shared_low_bound, highest_version); + + /* Get the member type's internal structure for version */ + mem_dtypep = (H5T_t *)H5I_object(mem_dtype); + if (mem_dtypep == NULL) TEST_ERROR + + /* Reset highest version if this datatype has higher version than + its outer type */ + if (*highest_version < mem_dtypep->shared->version) + *highest_version = mem_dtypep->shared->version; + + /* Verify the datatype recursively */ + ret = verify_version(mem_dtype, low, highest_version); /* Close the member datatype before checking for failure */ if ((H5Tclose(mem_dtype)) < 0) TEST_ERROR @@ -7504,12 +7528,13 @@ static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_share if (ret < 0) TEST_ERROR } /* If this compound datatype contains a datatype of higher version, it - will be promoted to that version */ + will be promoted to that version, thus, verify with highest version */ if (*highest_version > H5O_dtype_ver_bounds[low]) VERIFY(dtypep->shared->version, *highest_version, "verify_version"); else VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "verify_version"); break; + } case H5T_ENUM: VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "verify_version"); break; @@ -7733,7 +7758,7 @@ test_versionbounds(void) highest_version = dtypep->shared->version; /* Verify version of the datatype recursevily */ - ret = verify_version(dset_dtype, low, filep->shared->low_bound, &highest_version); + ret = verify_version(dset_dtype, low, &highest_version); /* Close the dataset's datatype */ if (H5Tclose(dset_dtype) < 0) TEST_ERROR diff --git a/test/tfile.c b/test/tfile.c index de1f362..f3d5a8f 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -4966,7 +4966,7 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, #define VERBFNAME "tverbounds_dspace.h5" #define VERBDSNAME "dataset 1" #define SPACE1_DIM1 3 -static int +static void test_libver_bounds_open(void) { hid_t file = -1; /* File ID */ diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 6e98ee4..607d5b5 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -149,8 +149,6 @@ ${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 - # versionbounds - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/bounds_latest_latest.h5 # fsm ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/STG.h5repack_none.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SPT.h5repack_aggr.h5 -- cgit v0.12 From e5b602fafe301d9ab8fa1c870ab18fd59c03370c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Mar 2018 15:40:15 -0600 Subject: Add #ifdef H5_HAVE_FORK --- testpar/t_cache_image.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index 7fe0020..d23548a 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -4056,6 +4056,13 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) } /* smoke_check_1() */ +/* This test uses many POSIX things that are not available on + * Windows. We're using a check for fork(2) here as a proxy for + * all POSIX/Unix/Linux things until this test can be made + * more platform-independent. + */ +#ifdef H5_HAVE_FORK + /*------------------------------------------------------------------------- * Function: main * @@ -4271,4 +4278,14 @@ finish: return(nerrs > 0); } /* main() */ +#else /* H5_HAVE_FORK */ + +int +main(void) +{ + HDfprintf(stderr, "Non-POSIX platform. Skipping.\n"); + return EXIT_SUCCESS; +} /* end main() */ + +#endif /* H5_HAVE_FORK */ -- cgit v0.12 From b8b0afc4c3e532c07c1284eddb0c5cb7834ea86a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Mar 2018 15:41:51 -0600 Subject: Add #ifdef H5_HAVE_FORK eliminates special handling --- testpar/CMakeTests.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index cd9acda..87470f3 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -18,10 +18,6 @@ add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) -if (WIN32) - # t_cache_imagee uses fork() and execve(), will not run on Windows - list (REMOVE_ITEM H5P_TESTS t_cache_image) -endif () foreach (testp ${H5P_TESTS}) add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endforeach () -- cgit v0.12 From 2db84441d742433c0aee26624a7b3fd05c2dbbf2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Mar 2018 16:51:31 -0600 Subject: ifdef around another function --- testpar/t_cache_image.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index d23548a..fc88c61 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -1882,6 +1882,14 @@ par_delete_dataset(int dset_num, } /* par_delete_dataset() */ +/* This test uses many POSIX things that are not available on + * Windows. We're using a check for fork(2) here as a proxy for + * all POSIX/Unix/Linux things until this test can be made + * more platform-independent. + */ +#ifdef H5_HAVE_FORK + + /*------------------------------------------------------------------------- * Function: par_insert_cache_image() * @@ -1907,6 +1915,10 @@ par_delete_dataset(int dset_num, * * None. * + *-------------------------------------- + return; + +} /* par_insert_cache_image() */ *------------------------------------------------------------------------- */ @@ -1990,6 +2002,15 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) return; } /* par_insert_cache_image() */ +#else /* H5_HAVE_FORK */ + +static void +par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) +{ + return; +} /* par_insert_cache_image() */ + +#endif /* H5_HAVE_FORK */ /*------------------------------------------------------------------------- -- cgit v0.12 From d981692e63f6ea1d9987e6cb08ca6587c173dc95 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 10:52:26 -0600 Subject: HDDFV-10414 correct location of error change --- release_docs/RELEASE.txt | 6 ++ src/H5Pfapl.c | 182 +++++++++++++++++++++++------------------------ 2 files changed, 97 insertions(+), 91 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 199265c..9707a18 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -195,6 +195,12 @@ Bug Fixes since HDF5-1.10.1 release Library ------- + - H5Pset_evict_on_close in H5Pfapl.c + + Changed the minor error number from H5E_CANTSET to H5E_UNSUPPORTED for + parallel library. + (ADB - 2018/03/6, HDFFV-104148) + - filter plugin handling in H5PL.c and H5Z.c It was discovered that the dynamic loading process used by diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 490e647..148c247 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -387,7 +387,7 @@ static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; static const unsigned H5F_def_page_buf_min_meta_perc_g = H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEF; /* Default page buffer minimum metadata size */ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEF; /* Default page buffer minumum raw data size */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_reg_prop * @@ -627,7 +627,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_reg_prop() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_alignment * @@ -685,7 +685,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_alignment * @@ -726,7 +726,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_alignment() */ - + /*------------------------------------------------------------------------- * Function: H5P_set_driver * @@ -774,7 +774,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_set_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_driver * @@ -817,7 +817,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver * @@ -861,7 +861,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver * @@ -902,7 +902,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver_info * @@ -944,7 +944,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver_info * @@ -984,7 +984,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_copy * @@ -1050,7 +1050,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_free * @@ -1102,7 +1102,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_create * @@ -1131,7 +1131,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_create() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_set * @@ -1164,7 +1164,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_get * @@ -1197,7 +1197,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_del * @@ -1226,7 +1226,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_copy * @@ -1255,7 +1255,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_cmp * @@ -1314,7 +1314,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_close * @@ -1343,7 +1343,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_family_offset * @@ -1382,7 +1382,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_family_offset * @@ -1423,7 +1423,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_multi_type * @@ -1462,7 +1462,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_multi_type * @@ -1503,7 +1503,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_cache * @@ -1557,7 +1557,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_cache * @@ -1609,7 +1609,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_image_config * @@ -1653,7 +1653,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_image_config * @@ -1704,7 +1704,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * @@ -1748,7 +1748,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_config * @@ -1799,7 +1799,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_gc_references * @@ -1852,7 +1852,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_gc_references * @@ -1895,7 +1895,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_fclose_degree * @@ -1931,7 +1931,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_fclose_degree * @@ -1966,7 +1966,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_meta_block_size * @@ -2017,7 +2017,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_meta_block_size * @@ -2061,7 +2061,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_sieve_buf_size * @@ -2112,7 +2112,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_sieve_buf_size * @@ -2155,7 +2155,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_small_data_block_size * @@ -2201,7 +2201,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_small_data_block_size * @@ -2240,7 +2240,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_libver_bounds * @@ -2382,7 +2382,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_libver_bounds * @@ -2425,7 +2425,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_elink_file_cache_size * @@ -2463,7 +2463,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_elink_file_cache_size * @@ -2502,7 +2502,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image * @@ -2583,7 +2583,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image * @@ -2672,7 +2672,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image_callbacks * @@ -2749,7 +2749,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image_callbacks * @@ -2805,7 +2805,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_copy * @@ -2883,7 +2883,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_free * @@ -2938,7 +2938,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_cmp * @@ -2981,7 +2981,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_enc * @@ -3027,7 +3027,7 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_image_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_dec * @@ -3079,7 +3079,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_set * @@ -3112,7 +3112,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_get * @@ -3145,7 +3145,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_del * @@ -3176,7 +3176,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_copy * @@ -3206,7 +3206,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_cmp * @@ -3265,7 +3265,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_close * @@ -3295,7 +3295,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_close() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_cmp * @@ -3407,7 +3407,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_enc * @@ -3552,7 +3552,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_dec * @@ -3687,7 +3687,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_enc * @@ -3725,7 +3725,7 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_dec * @@ -3760,7 +3760,7 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_multi_type_enc * @@ -3833,7 +3833,7 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_multi_type_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_enc * @@ -3870,7 +3870,7 @@ H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_dec * @@ -3904,7 +3904,7 @@ H5P__facc_libver_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_dec() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_core_write_tracking * @@ -3945,7 +3945,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_core_write_tracking * @@ -3987,7 +3987,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_metadata_read_attempts * @@ -4030,7 +4030,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_metadata_read_attempts * @@ -4071,7 +4071,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_obj_flush_cb * @@ -4115,7 +4115,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_obj_flush_cb * @@ -4156,7 +4156,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_log_options * @@ -4208,7 +4208,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_log_options * @@ -4263,7 +4263,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_enc * @@ -4316,7 +4316,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_dec * @@ -4370,7 +4370,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_del * @@ -4393,7 +4393,7 @@ H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_del() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_copy * @@ -4415,7 +4415,7 @@ H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_cmp * @@ -4447,7 +4447,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_close * @@ -4470,7 +4470,7 @@ H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_evict_on_close * @@ -4509,16 +4509,16 @@ H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close) #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_UNSUPPORTED, FAIL, "can't set evict on close property") + 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") + HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "evict on close is currently not supported in parallel HDF5") #endif /* H5_HAVE_PARALLEL */ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_evict_on_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_evict_on_close * @@ -4562,7 +4562,7 @@ done: } /* end H5Pget_evict_on_close() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- * Function: H5P__encode_coll_md_read_flag_t * @@ -4600,7 +4600,7 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__encode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5P__decode_coll_md_read_flag_t * @@ -4634,7 +4634,7 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__decode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_all_coll_metadata_ops * @@ -4693,7 +4693,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_all_coll_metadata_ops() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_all_coll_metadata_ops * @@ -4751,7 +4751,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_all_coll_metadata_ops */ - + /*------------------------------------------------------------------------- * Function: H5Pset_coll_metadata_write * @@ -4790,7 +4790,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_coll_metadata_write() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_coll_metadata_write * @@ -4828,7 +4828,7 @@ done: } /* end H5Pget_coll_metadata_write() */ #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- * Function: H5Pset_page_buffer_size * @@ -4876,7 +4876,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_page_buffer_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_page_buffer_size * -- cgit v0.12 From 1428e57fbf03d5ee58e6e4bbc2cdf71c2200607d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 10:53:07 -0600 Subject: HDFFV-10414 fix note --- 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 9707a18..6df26d7 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -199,7 +199,7 @@ Bug Fixes since HDF5-1.10.1 release Changed the minor error number from H5E_CANTSET to H5E_UNSUPPORTED for parallel library. - (ADB - 2018/03/6, HDFFV-104148) + (ADB - 2018/03/6, HDFFV-10414) - filter plugin handling in H5PL.c and H5Z.c -- cgit v0.12 From 36bf5edfc91777891d041939d697fa130cc779a4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 11:41:49 -0600 Subject: Add missing note --- release_docs/RELEASE.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6df26d7..6f16aa2 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -201,6 +201,12 @@ Bug Fixes since HDF5-1.10.1 release parallel library. (ADB - 2018/03/6, HDFFV-10414) + - Utility function can not handle lowercase Windows drive letters + + Added call to toupper function for drive letter. + + (ADB - 2017/12/18, HDFFV-10307) + - filter plugin handling in H5PL.c and H5Z.c It was discovered that the dynamic loading process used by -- cgit v0.12 From 08fc36b0ca10abb9960c6543b4bc854d8d8aaf31 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 12:23:04 -0600 Subject: Correct cutnpaste --- testpar/t_cache_image.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index fc88c61..5b512d6 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -1915,10 +1915,6 @@ par_delete_dataset(int dset_num, * * None. * - *-------------------------------------- - return; - -} /* par_insert_cache_image() */ *------------------------------------------------------------------------- */ -- cgit v0.12 From 8347a31871e9526c93451cec5f1d8861da3a2aa4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 15:46:58 -0600 Subject: Fix CMake missing parens --- 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 607d5b5..d7f9f10 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -1438,7 +1438,7 @@ ADD_H5_VERIFY_SUPERBLOCK (SB_IS_2 h5repack_layout.h5 1 2 2) # -j 2 -k 2, superblock will be 3 ADD_H5_VERIFY_SUPERBLOCK (SB_IS_3 h5repack_layout.h5 2 2 3) # -j 0 -k 1, file cannot be opened -ADD_H5_VERIFY_INVALIDBOUNDS latest_latest_invalid bounds_latest_latest.h5 0 1 +ADD_H5_VERIFY_INVALIDBOUNDS (latest_latest_invalid bounds_latest_latest.h5 0 1) ############################################################################## ### P L U G I N T E S T S -- cgit v0.12 From 6d75a3ffb4b1451ff80b7fdddafa5859376bee77 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 15:55:33 -0600 Subject: Fix misaligned macro --- tools/test/h5repack/CMakeTests.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index d7f9f10..f40c0b1 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -629,7 +629,7 @@ set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( - NAME ADD_H5_VERIFY_INVALIDBOUNDS-${testname} + NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties ( @@ -637,7 +637,6 @@ DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects WILL_FAIL "true" ) - endif () endmacro () macro (ADD_H5_TEST_META testname testfile) -- cgit v0.12 From 3712738877a14c3257155acd1f558cfe039f3625 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 8 Mar 2018 15:54:40 -0600 Subject: HDFFV-4359 Add C,HL,CXX files --- CMakeInstallation.cmake | 18 ----------------- MANIFEST | 2 ++ c++/src/CMakeLists.txt | 47 +++++++++++++++++++++++++++++++++++++++++++++ config/cmake/libh5cc.in | 32 +++++++++++++++++++++++++++++++ config/cmake/libhdf5.pc.in | 14 ++++++++++++++ hl/src/CMakeLists.txt | 46 ++++++++++++++++++++++++++++++++++++++++++++ src/CMakeLists.txt | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 189 insertions(+), 18 deletions(-) create mode 100755 config/cmake/libh5cc.in create mode 100755 config/cmake/libhdf5.pc.in diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 0bfb2cc..4a09d2d 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -144,24 +144,6 @@ install ( ) #----------------------------------------------------------------------------- -# Create pkgconfig files -#----------------------------------------------------------------------------- -#foreach (libs ${LINK_LIBS}) -# set (LIBS "${LIBS} -l${libs}") -#endforeach () -#foreach (libs ${HDF5_LIBRARIES_TO_EXPORT}) -# set (HDF5LIBS "${HDF5LIBS} -l${libs}") -#endforeach () -#configure_file ( -# ${HDF_RESOURCES_DIR}/libhdf5.pc.in -# ${HDF5_BINARY_DIR}/CMakeFiles/libhdf5.pc @ONLY -#) -#install ( -# FILES ${HDF5_BINARY_DIR}/CMakeFiles/libhdf5.pc -# DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig -#) - -#----------------------------------------------------------------------------- # Configure the HDF518_Examples.cmake file and the examples #----------------------------------------------------------------------------- option (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF) diff --git a/MANIFEST b/MANIFEST index 229a5ec..4e35691 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3084,6 +3084,8 @@ ./config/cmake/HDF5Macros.cmake ./config/cmake/HDF5UseFortran.cmake ./config/cmake/jrunTest.cmake +./config/cmake/libh5cc.in +./config/cmake/libhdf5.pc.in ./config/cmake/libhdf5.settings.cmake.in ./config/cmake/mccacheinit.cmake ./config/cmake/patch.xml diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 921497f..e685491 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -139,3 +139,50 @@ if (HDF5_EXPORTED_TARGETS) INCLUDES DESTINATION include ) endif () + +#----------------------------------------------------------------------------- +# Create pkgconfig files +#----------------------------------------------------------------------------- +set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) +set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) +set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib) +set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include) +set (_PKG_CONFIG_LIBNAME "${HDF5_CPP_LIB_CORENAME}") +set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") + +set (_PKG_CONFIG_LIBS_PRIVATE) + +set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_CPP_LIB_CORENAME}") +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_CPP_LIB_CORENAME}") +endif () + +set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}") + +configure_file ( + ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + @ONLY +) +install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig + COMPONENT libraries +) + +if (NOT WIN32) + set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5c++ + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5c++ + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT libraries + ) +endif () + diff --git a/config/cmake/libh5cc.in b/config/cmake/libh5cc.in new file mode 100755 index 0000000..f462d56 --- /dev/null +++ b/config/cmake/libh5cc.in @@ -0,0 +1,32 @@ +#! /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. +## + +prg=$0 +if [ ! -e "$prg" ]; then + case $prg in + (*/*) exit 1;; + (*) prg=$(command -v -- "$prg") || exit;; + esac +fi +dir=$( + cd -P -- "$(dirname -- "$prg")/.." && pwd -P +) || exit +prg=$dir/$(basename -- "$prg") || exit + +printf '%s\n' "$prg" +printf 'dir is %s\n' "$dir" + +export PKG_CONFIG_PATH=$dir/lib/pkgconfig + +@_PKG_CONFIG_COMPILER@ `pkg-config --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@-@_PKG_CONFIG_VERSION@` $@ diff --git a/config/cmake/libhdf5.pc.in b/config/cmake/libhdf5.pc.in new file mode 100755 index 0000000..4a2ebaa --- /dev/null +++ b/config/cmake/libhdf5.pc.in @@ -0,0 +1,14 @@ +prefix=@_PKG_CONFIG_PREFIX@ +exec_prefix=@_PKG_CONFIG_EXEC_PREFIX@ +libdir=@_PKG_CONFIG_LIBDIR@ +includedir=@_PKG_CONFIG_INCLUDEDIR@ + +Name: @_PKG_CONFIG_LIBNAME@ +Description: HDF5 (Hierarchical Data Format 5) Software Library +Version: @_PKG_CONFIG_VERSION@ + +Cflags: -I${includedir} +Libs: -L${libdir} @_PKG_CONFIG_SH_LIBS@ +Requires: @_PKG_CONFIG_REQUIRES@ +Libs.private: @_PKG_CONFIG_LIBS_PRIVATE@ @_PKG_CONFIG_LIBS@ +Requires.private: @_PKG_CONFIG_REQUIRES_PRIVATE@ diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index d21a3ea..e9216bd 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -88,3 +88,49 @@ if (HDF5_EXPORTED_TARGETS) INCLUDES DESTINATION include ) endif () + +#----------------------------------------------------------------------------- +# Create pkgconfig files +#----------------------------------------------------------------------------- +set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) +set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) +set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib) +set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include) +set (_PKG_CONFIG_LIBNAME "${HDF5_HL_LIB_CORENAME}") +set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") + +set (_PKG_CONFIG_LIBS_PRIVATE) + +set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_HL_LIB_CORENAME}") +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_LIB_CORENAME}") +endif () + +set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}") + +configure_file ( + ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + @ONLY +) +install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig + COMPONENT libraries +) + +if (NOT WIN32) + set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5chl + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5chl + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT libraries + ) +endif () diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bf7fb07..d10870d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -991,3 +991,51 @@ if (HDF5_EXPORTED_TARGETS) INCLUDES DESTINATION include ) endif () + +#----------------------------------------------------------------------------- +# Create pkgconfig files +#----------------------------------------------------------------------------- +set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) +set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) +set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib) +set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include) +set (_PKG_CONFIG_LIBNAME "${HDF5_LIB_CORENAME}") +set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") + +foreach (libs ${LINK_LIBS} ${LINK_COMP_LIBS}) + set (_PKG_CONFIG_LIBS_PRIVATE "${_PKG_CONFIG_LIBS_PRIVATE} -l${libs}") +endforeach () + +set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_LIB_CORENAME}") +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_LIB_CORENAME}") +endif () + +set (_PKG_CONFIG_REQUIRES) +set (_PKG_CONFIG_REQUIRES_PRIVATE) + +configure_file ( + ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + @ONLY +) +install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig + COMPONENT libraries +) + +if (NOT WIN32) + set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5cc + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5cc + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT libraries + ) +endif () -- cgit v0.12 From 13f5388149a0dd39a6f67d30d63c6d622e249fd9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 8 Mar 2018 16:39:35 -0600 Subject: HDFFV-4359 Add HL C++ and fix install parameters --- c++/src/CMakeLists.txt | 4 ++-- hl/c++/src/CMakeLists.txt | 47 +++++++++++++++++++++++++++++++++++++++++++++++ hl/src/CMakeLists.txt | 4 ++-- release_docs/RELEASE.txt | 10 ++++++++++ 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index e685491..350bdf7 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -168,7 +168,7 @@ configure_file ( install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig - COMPONENT libraries + COMPONENT cpplibraries ) if (NOT WIN32) @@ -182,7 +182,7 @@ if (NOT WIN32) FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5c++ DESTINATION ${HDF5_INSTALL_BIN_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - COMPONENT libraries + COMPONENT cpplibraries ) endif () diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 0f187c5..28f860f 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -69,3 +69,50 @@ if (HDF5_EXPORTED_TARGETS) INCLUDES DESTINATION include ) endif () + +#----------------------------------------------------------------------------- +# Create pkgconfig files +#----------------------------------------------------------------------------- +set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) +set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) +set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib) +set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include) +set (_PKG_CONFIG_LIBNAME "${HDF5_HL_CPP_LIB_CORENAME}") +set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") + +set (_PKG_CONFIG_LIBS_PRIVATE) + +set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_HL_CPP_LIB_CORENAME}") +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_CPP_LIB_CORENAME}") +endif () + +set (_PKG_CONFIG_REQUIRES "${HDF5_HL_LIB_CORENAME}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_HL_LIB_CORENAME}") + +configure_file ( + ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + @ONLY +) +install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig + COMPONENT hlcpplibraries +) + +if (NOT WIN32) + set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5hlc++ + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5hlc++ + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT hlcpplibraries + ) +endif () + diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index e9216bd..62e8c21 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -117,7 +117,7 @@ configure_file ( install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig - COMPONENT libraries + COMPONENT hllibraries ) if (NOT WIN32) @@ -131,6 +131,6 @@ if (NOT WIN32) FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5chl DESTINATION ${HDF5_INSTALL_BIN_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - COMPONENT libraries + COMPONENT hllibraries ) endif () diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6f16aa2..0061910 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -56,6 +56,16 @@ New Features ------------- - CMake + Add pkg-config file generation + + Added pkg-config file generation for the C, C++, HL, and HL C++ libraries. + In addition, builds on linux will create h5cXXX scripts that use the pkg-config + files. This is a limited implementation of a script like autotools h5cc. + + (ADB - 2018/03/08, HDFFV-4359) + + - CMake + Refactor use of CMAKE_BUILD_TYPE for new variable, which understands the type of generator in use. -- cgit v0.12 From 7c293908a772dd19d69872b4dbf1fdcbbbf5f94f Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 9 Mar 2018 00:35:42 -0600 Subject: Improving tests Description: Fixed typos that caused daily test failure on Ostrich Platforms tested: Linux/64 (jelly) Linux/ppc64 (ostrich) --- test/dtypes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dtypes.c b/test/dtypes.c index 426f3b9..1a27634 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -7684,7 +7684,7 @@ test_versionbounds(void) if (ret < 0) TEST_ERROR /* Create a enumerate datatype */ - enum_type = H5Tcreate(H5T_ENUM, sizeof(short)); + enum_type = H5Tcreate(H5T_ENUM, sizeof(color_t)); if (enum_type < 0) TEST_ERROR enum_val = E1_RED; -- cgit v0.12 From 8ba788ca891f56792bbbbc5a40f9bc2e86a663b5 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Fri, 9 Mar 2018 01:25:40 -0600 Subject: Fix for HDFFV-10209 VDS SWMR test failure Free the object header when there are chksum retries. --- src/H5Ocache.c | 39 ++++++++++++++++++++++++++++++++------- src/H5Oint.c | 1 + src/H5Opkg.h | 1 + 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 94049ef..2260e12 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -262,12 +262,23 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - /* Get stored and computed checksums */ - H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); - - if(stored_chksum != computed_chksum) - ret_value = FALSE; + /* Get stored and computed checksums */ + H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); + + if(stored_chksum != computed_chksum) { + /* These fields are not deserialized yet in H5O__prefix_deserialize() */ + HDassert(udata->oh->chunk == NULL); + HDassert(udata->oh->mesg == NULL); + HDassert(udata->oh->proxy == NULL); + + /* Indicate that udata->oh is to be freed later + in H5O__prefix_deserialize() */ + udata->free_oh = TRUE; + ret_value = FALSE; + } /* end if */ } /* end if */ + else + HDassert(!(udata->common.file_intent & H5F_ACC_SWMR_WRITE)); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__cache_verify_chksum() */ @@ -1263,8 +1274,22 @@ H5O__prefix_deserialize(const uint8_t *_image, H5O_cache_ud_t *udata) /* Verify object header prefix length */ HDassert((size_t)(image - _image) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); - /* Save the object header for later use in 'deserialize' callback */ - udata->oh = oh; + /* If udata->oh is to be freed (see H5O__cache_verify_chksum), + save the pointer to udata->oh and free it later after setting + udata->oh with the new object header */ + if(udata->free_oh) { + H5O_t *saved_oh = udata->oh; + HDassert(udata->oh); + + /* Save the object header for later use in 'deserialize' callback */ + udata->oh = oh; + if(H5O__free(saved_oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't destroy object header") + udata->free_oh = FALSE; + } else + /* Save the object header for later use in 'deserialize' callback */ + udata->oh = oh; + oh = NULL; done: diff --git a/src/H5Oint.c b/src/H5Oint.c index 08eb28d..2351779 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -875,6 +875,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, udata.v1_pfx_nmesgs = 0; udata.chunk0_size = 0; udata.oh = NULL; + udata.free_oh = FALSE; udata.common.f = loc->file; udata.common.dxpl_id = dxpl_id; udata.common.file_intent = file_intent; diff --git a/src/H5Opkg.h b/src/H5Opkg.h index e970406..9392fa8 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -379,6 +379,7 @@ typedef struct H5O_cache_ud_t { unsigned v1_pfx_nmesgs; /* Number of messages from v1 prefix header */ size_t chunk0_size; /* Size of serialized first chunk */ H5O_t *oh; /* Partially deserialized object header, for later use */ + hbool_t free_oh; /* Whether to free the object header or not */ H5O_common_cache_ud_t common; /* Common object header cache callback info */ } H5O_cache_ud_t; -- cgit v0.12 From 24c62ba7fefcd48cafec79385011cbd89be5d182 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 9 Mar 2018 12:31:58 -0600 Subject: Change CMake min to 3.10 --- CMakeLists.txt | 2 +- c++/CMakeLists.txt | 2 +- c++/examples/CMakeLists.txt | 2 +- c++/src/CMakeLists.txt | 2 +- c++/test/CMakeLists.txt | 2 +- config/cmake/CTestScript.cmake | 2 +- config/cmake/HDF518_Examples.cmake.in | 2 +- config/cmake/HDF5_Examples.cmake.in | 2 +- config/cmake/UseJava.cmake | 74 +- config/cmake/scripts/CTestScript.cmake | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- config/cmake_ext_mod/FindMPI.cmake | 1514 -------------------- .../cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in | 4 - config/cmake_ext_mod/FindMPI/libver_mpi.c | 19 - config/cmake_ext_mod/FindMPI/libver_mpi.f90.in | 7 - config/cmake_ext_mod/FindMPI/mpiver.f90.in | 10 - config/cmake_ext_mod/FindMPI/test_mpi.c | 37 - config/cmake_ext_mod/FindMPI/test_mpi.f90.in | 6 - examples/CMakeLists.txt | 2 +- fortran/CMakeLists.txt | 2 +- fortran/examples/CMakeLists.txt | 2 +- fortran/src/CMakeLists.txt | 2 +- fortran/test/CMakeLists.txt | 2 +- fortran/testpar/CMakeLists.txt | 2 +- hl/CMakeLists.txt | 2 +- hl/c++/CMakeLists.txt | 2 +- hl/c++/examples/CMakeLists.txt | 2 +- hl/c++/src/CMakeLists.txt | 2 +- hl/c++/test/CMakeLists.txt | 2 +- hl/examples/CMakeLists.txt | 2 +- hl/fortran/CMakeLists.txt | 2 +- hl/fortran/examples/CMakeLists.txt | 2 +- hl/fortran/src/CMakeLists.txt | 2 +- hl/fortran/test/CMakeLists.txt | 2 +- hl/src/CMakeLists.txt | 2 +- hl/test/CMakeLists.txt | 2 +- hl/tools/CMakeLists.txt | 2 +- hl/tools/gif2h5/CMakeLists.txt | 2 +- hl/tools/h5watch/CMakeLists.txt | 2 +- java/CMakeLists.txt | 2 +- java/examples/CMakeLists.txt | 2 +- java/examples/datasets/CMakeLists.txt | 2 +- java/examples/datatypes/CMakeLists.txt | 2 +- java/examples/groups/CMakeLists.txt | 2 +- java/examples/intro/CMakeLists.txt | 2 +- java/src/CMakeLists.txt | 2 +- java/src/hdf/CMakeLists.txt | 2 +- java/src/hdf/hdf5lib/CMakeLists.txt | 2 +- java/src/jni/CMakeLists.txt | 2 +- java/test/CMakeLists.txt | 2 +- release_docs/INSTALL_CMake.txt | 2 +- release_docs/USING_HDF5_CMake.txt | 4 +- src/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- testpar/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 2 +- tools/lib/CMakeLists.txt | 2 +- tools/src/CMakeLists.txt | 2 +- tools/src/h5copy/CMakeLists.txt | 2 +- tools/src/h5diff/CMakeLists.txt | 2 +- tools/src/h5dump/CMakeLists.txt | 2 +- tools/src/h5format_convert/CMakeLists.txt | 2 +- tools/src/h5import/CMakeLists.txt | 2 +- tools/src/h5jam/CMakeLists.txt | 2 +- tools/src/h5ls/CMakeLists.txt | 2 +- tools/src/h5repack/CMakeLists.txt | 2 +- tools/src/h5stat/CMakeLists.txt | 2 +- tools/src/misc/CMakeLists.txt | 2 +- tools/test/CMakeLists.txt | 2 +- tools/test/h5copy/CMakeLists.txt | 2 +- tools/test/h5diff/CMakeLists.txt | 2 +- tools/test/h5dump/CMakeLists.txt | 2 +- tools/test/h5format_convert/CMakeLists.txt | 2 +- tools/test/h5import/CMakeLists.txt | 2 +- tools/test/h5jam/CMakeLists.txt | 2 +- tools/test/h5ls/CMakeLists.txt | 2 +- tools/test/h5repack/CMakeLists.txt | 2 +- tools/test/h5stat/CMakeLists.txt | 2 +- tools/test/misc/CMakeLists.txt | 2 +- tools/test/misc/vds/CMakeLists.txt | 2 +- tools/test/perform/CMakeLists.txt | 2 +- 81 files changed, 147 insertions(+), 1672 deletions(-) delete mode 100644 config/cmake_ext_mod/FindMPI.cmake delete mode 100644 config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in delete mode 100644 config/cmake_ext_mod/FindMPI/libver_mpi.c delete mode 100644 config/cmake_ext_mod/FindMPI/libver_mpi.f90.in delete mode 100644 config/cmake_ext_mod/FindMPI/mpiver.f90.in delete mode 100644 config/cmake_ext_mod/FindMPI/test_mpi.c delete mode 100644 config/cmake_ext_mod/FindMPI/test_mpi.f90.in diff --git a/CMakeLists.txt b/CMakeLists.txt index e7dda17..ebbeda5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5 C CXX) #----------------------------------------------------------------------------- diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 2d3ab0f..2c161f1 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 397c300..22ecb19 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_CPP_EXAMPLES) # -------------------------------------------------------------------- diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 350bdf7..d24a3a6 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 5194865..b4fb0fc 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_CPP_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index 27ae3a0..0269ba8 100755 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ######################################################## # For any comments please contact cdashhelp@hdfgroup.org # diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 0e81217..1f4f479 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 6453b16..eb57685 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index c70f52e..60b1758 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -19,6 +19,7 @@ # [VERSION version] # [OUTPUT_NAME name] # [OUTPUT_DIR dir] +# [GENERATE_NATIVE_HEADERS target [DESTINATION dir]] # ) # # This command creates a .jar. It compiles the given @@ -34,6 +35,14 @@ # The default OUTPUT_DIR can also be changed by setting the variable # CMAKE_JAVA_TARGET_OUTPUT_DIR. # +# Optionally, using option GENERATE_NATIVE_HEADERS, native header files can be generated +# for methods declared as native. These files provide the connective glue that allow your +# Java and C code to interact. An INTERFACE target will be created for an easy usage +# of generated files. Sub-option DESTINATION can be used to specify output directory for +# generated header files. +# +# GENERATE_NATIVE_HEADERS option requires, at least, version 1.8 of the JDK. +# # Additional instructions: # # :: @@ -167,6 +176,22 @@ # # # +# :: +# +# For an optimum usage of option GENERATE_NATIVE_HEADERS, it is recommended to +# include module JNI before any call to add_jar. The produced target for native +# headers can then be used to compile C/C++ sources with command +# target_link_libraries. +# +# +# :: +# +# find_package(JNI) +# add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native) +# add_library(bar bar.cpp) +# target_link_libraries(bar PRIVATE foo-native) +# +# # Target Properties: # # :: @@ -358,6 +383,10 @@ # Create C header files from java classes. These files provide the connective glue # that allow your Java and C code to interact. # +# This command will no longer be supported starting with version 1.10 of the JDK due +# to the `suppression of javah tool `_. +# Command ``add_jar(GENERATE_NATIVE_HEADERS)`` must be used instead. +# # There are two main signatures for create_javah. The first signature # returns generated files through variable specified by GENERATED_FILES option: # @@ -449,7 +478,7 @@ function(add_jar _TARGET_NAME) cmake_parse_arguments(_add_jar "" "VERSION;OUTPUT_DIR;OUTPUT_NAME;ENTRY_POINT;MANIFEST" - "SOURCES;INCLUDE_JARS" + "SOURCES;INCLUDE_JARS;GENERATE_NATIVE_HEADERS" ${ARGN} ) @@ -495,6 +524,31 @@ function(add_jar _TARGET_NAME) get_filename_component (_MANIFEST_VALUE "${_add_jar_MANIFEST}" ABSOLUTE) endif () + unset (_GENERATE_NATIVE_HEADERS) + if (_add_jar_GENERATE_NATIVE_HEADERS) + # Raise an error if JDK version is less than 1.8 because javac -h is not supported + # by earlier versions. + if ("${Java_VERSION}" VERSION_LESS 1.8) + message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS is not supported with this version of Java.") + endif() + cmake_parse_arguments (_add_jar_GENERATE_NATIVE_HEADERS "" "DESTINATION" "" ${_add_jar_GENERATE_NATIVE_HEADERS}) + if (NOT _add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS) + message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS: missing required argument.") + endif() + list (LENGTH _add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS length) + if (length GREATER 1) + list (REMOVE_AT _add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS 0) + message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS: ${_add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS}: unexpected argument(s).") + endif() + if (NOT _add_jar_GENERATE_NATIVE_HEADERS_DESTINATION) + set (_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir/native_headers") + endif() + + set (_GENERATE_NATIVE_HEADERS_TARGET ${_add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS}) + set (_GENERATE_NATIVE_HEADERS_OUTPUT_DIR "${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION}") + set (_GENERATE_NATIVE_HEADERS -h "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}") + endif() + if (LIBRARY_OUTPUT_PATH) set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH}) else () @@ -626,6 +680,7 @@ function(add_jar _TARGET_NAME) ${CMAKE_JAVA_COMPILE_FLAGS} -classpath "${CMAKE_JAVA_INCLUDE_PATH_FINAL}" -d ${CMAKE_JAVA_CLASS_OUTPUT_PATH} + ${_GENERATE_NATIVE_HEADERS} ${_JAVA_SOURCES_FILELISTS} COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME} DEPENDS ${_JAVA_COMPILE_FILES} ${_JAVA_COMPILE_FILELISTS} ${_JAVA_COMPILE_DEPENDS} @@ -736,6 +791,17 @@ function(add_jar _TARGET_NAME) ${CMAKE_JAVA_CLASS_OUTPUT_PATH} ) + if (_GENERATE_NATIVE_HEADERS) + # create an INTERFACE library encapsulating include directory for generated headers + add_library (${_GENERATE_NATIVE_HEADERS_TARGET} INTERFACE) + target_include_directories (${_GENERATE_NATIVE_HEADERS_TARGET} INTERFACE + "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}" + ${JNI_INCLUDE_DIRS}) + # this INTERFACE library depends on jar generation + add_dependencies (${_GENERATE_NATIVE_HEADERS_TARGET} ${_TARGET_NAME}) + + set_property (DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}") + endif() endfunction() function(INSTALL_JAR _TARGET_NAME) @@ -1307,6 +1373,12 @@ function(create_javadoc _target) endfunction() function (create_javah) + if ("${Java_VERSION}" VERSION_GREATER_EQUAL 1.10) + message (FATAL_ERROR "create_javah: not supported with this Java version. Use add_jar(GENERATE_NATIVE_HEADERS) instead.") + elseif ("${Java_VERSION}" VERSION_GREATER_EQUAL 1.8) + message (DEPRECATION "create_javah: this command will no longer be supported starting with version 1.10 of JDK. Update your project by using command add_jar(GENERATE_NATIVE_HEADERS) instead.") + endif() + cmake_parse_arguments(_create_javah "" "TARGET;GENERATED_FILES;OUTPUT_NAME;OUTPUT_DIR" diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index cfad6f1..670196b 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 88843fa..7eaf80a 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -15,7 +15,7 @@ ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake deleted file mode 100644 index d01dd35..0000000 --- a/config/cmake_ext_mod/FindMPI.cmake +++ /dev/null @@ -1,1514 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details. - -#.rst: -# FindMPI -# ------- -# -# Find a Message Passing Interface (MPI) implementation. -# -# 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. -# -# Variables for using MPI -# ^^^^^^^^^^^^^^^^^^^^^^^ -# -# The module exposes the components ``C``, ``CXX``, ``MPICXX`` and ``Fortran``. -# Each of these controls the various MPI languages to search for. -# The difference between ``CXX`` and ``MPICXX`` is that ``CXX`` refers to the -# MPI C API being usable from C++, whereas ``MPICXX`` refers to the MPI-2 C++ API -# that was removed again in MPI-3. -# -# Depending on the enabled components the following variables will be set: -# -# ``MPI_FOUND`` -# Variable indicating that MPI settings for all requested languages have been found. -# If no components are specified, this is true if MPI settings for all enabled languages -# were detected. Note that the ``MPICXX`` component does not affect this variable. -# ``MPI_VERSION`` -# Minimal version of MPI detected among the requested languages, or all enabled languages -# if no components were specified. -# -# This module will set the following variables per language in your -# project, where ```` is one of C, CXX, or Fortran: -# -# ``MPI__FOUND`` -# Variable indicating the MPI settings for ```` were found and that -# simple MPI test programs compile with the provided settings. -# ``MPI__COMPILER`` -# MPI compiler for ```` if such a program exists. -# ``MPI__COMPILE_OPTIONS`` -# Compilation options for MPI programs in ````, given as a :ref:`;-list `. -# ``MPI__COMPILE_DEFINITIONS`` -# Compilation definitions for MPI programs in ````, given as a :ref:`;-list `. -# ``MPI__INCLUDE_DIRS`` -# 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 ````. -# -# The following variables indicating which bindings are present will be defined: -# -# ``MPI_MPICXX_FOUND`` -# Variable indicating whether the MPI-2 C++ bindings are present (introduced in MPI-2, removed with MPI-3). -# ``MPI_Fortran_HAVE_F77_HEADER`` -# True if the Fortran 77 header ``mpif.h`` is available. -# ``MPI_Fortran_HAVE_F90_MODULE`` -# True if the Fortran 90 module ``mpi`` can be used for accessing MPI (MPI-2 and higher only). -# ``MPI_Fortran_HAVE_F08_MODULE`` -# True if the Fortran 2008 ``mpi_f08`` is available to MPI programs (MPI-3 and higher only). -# -# If possible, the MPI version will be determined by this module. The facilities to detect the MPI version -# were introduced with MPI-1.2, and therefore cannot be found for older MPI versions. -# -# ``MPI__VERSION_MAJOR`` -# Major version of MPI implemented for ```` by the MPI distribution. -# ``MPI__VERSION_MINOR`` -# Minor version of MPI implemented for ```` by the MPI distribution. -# ``MPI__VERSION`` -# MPI version implemented for ```` by the MPI distribution. -# -# Note that there's no variable for the C bindings being accessible through ``mpi.h``, since the MPI standards -# always have required this binding to work in both C and C++ code. -# -# For running MPI programs, the module sets the following variables -# -# ``MPIEXEC_EXECUTABLE`` -# Executable for running MPI programs, if such exists. -# ``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. -# -# Variables for locating MPI -# ^^^^^^^^^^^^^^^^^^^^^^^^^^ -# -# This module performs a three step search for an MPI implementation: -# -# 1. Check if the compiler has MPI support built-in. This is the case if the user passed a -# compiler wrapper as ``CMAKE__COMPILER`` or if they're on a Cray system. -# 2. Attempt to find an MPI compiler wrapper and determine the compiler information from it. -# 3. Try to find an MPI implementation that does not ship such a wrapper by guessing settings. -# Currently, only Microsoft MPI and MPICH2 on Windows are supported. -# -# For controlling the second step, the following variables may be set: -# -# ``MPI__COMPILER`` -# Search for the specified compiler wrapper and use it. -# ``MPI__COMPILER_FLAGS`` -# Flags to pass to the MPI compiler wrapper during interrogation. Some compiler wrappers -# support linking debug or tracing libraries if a specific flag is passed and this variable -# may be used to obtain them. -# ``MPI_COMPILER_FLAGS`` -# Used to initialize ``MPI__COMPILER_FLAGS`` if no language specific flag has been given. -# Empty by default. -# ``MPI_EXECUTABLE_SUFFIX`` -# A suffix which is appended to all names that are being looked for. For instance you may set this -# to ``.mpich`` or ``.openmpi`` to prefer the one or the other on Debian and its derivatives. -# -# In order to control the guessing step, the following variable may be set: -# -# ``MPI_GUESS_LIBRARY_NAME`` -# Valid values are ``MSMPI`` and ``MPICH2``. If set, only the given library will be searched for. -# By default, ``MSMPI`` will be preferred over ``MPICH2`` if both are available. -# This also sets ``MPI_SKIP_COMPILER_WRAPPER`` to ``true``, which may be overridden. -# -# Each of the search steps may be skipped with the following control variables: -# -# ``MPI_ASSUME_NO_BUILTIN_MPI`` -# If true, the module assumes that the compiler itself does not provide an MPI implementation and -# skips to step 2. -# ``MPI_SKIP_COMPILER_WRAPPER`` -# If true, no compiler wrapper will be searched for. -# ``MPI_SKIP_GUESSING`` -# If true, the guessing step will be skipped. -# -# Additionally, the following control variable is available to change search behavior: -# -# ``MPI_CXX_SKIP_MPICXX`` -# Add some definitions that will disable the MPI-2 C++ bindings. -# Currently supported are MPICH, Open MPI, Platform MPI and derivatives thereof, -# for example MVAPICH or Intel MPI. -# -# If the find procedure fails for a variable ``MPI__WORKS``, then the settings detected by or passed to -# the module did not work and even a simple MPI test program failed to compile. -# -# If all of these parameters were not sufficient to find the right MPI implementation, a user may -# disable the entire autodetection process by specifying both a list of libraries in ``MPI__LIBRARIES`` -# and a list of include directories in ``MPI__ADDITIONAL_INCLUDE_DIRS``. -# Any other variable may be set in addition to these two. The module will then validate the MPI settings and store the -# settings in the cache. -# -# Cache variables for MPI -# ^^^^^^^^^^^^^^^^^^^^^^^ -# -# The variable ``MPI__INCLUDE_DIRS`` will be assembled from the following variables. -# For C and CXX: -# -# ``MPI__HEADER_DIR`` -# Location of the ``mpi.h`` header on disk. -# -# For Fortran: -# -# ``MPI_Fortran_F77_HEADER_DIR`` -# Location of the Fortran 77 header ``mpif.h``, if it exists. -# ``MPI_Fortran_MODULE_DIR`` -# Location of the ``mpi`` or ``mpi_f08`` modules, if available. -# -# For all languages the following variables are additionally considered: -# -# ``MPI__ADDITIONAL_INCLUDE_DIRS`` -# A :ref:`;-list ` of paths needed in addition to the normal include directories. -# ``MPI__INCLUDE_DIR`` -# Path variables for include folders referred to by ````. -# ``MPI__ADDITIONAL_INCLUDE_VARS`` -# A :ref:`;-list ` of ```` that will be added to the include locations of ````. -# -# The variable ``MPI__LIBRARIES`` will be assembled from the following variables: -# -# ``MPI__LIBRARY`` -# The location of a library called ```` for use with MPI. -# ``MPI__LIB_NAMES`` -# A :ref:`;-list ` of ```` that will be added to the include locations of ````. -# -# Usage of mpiexec -# ^^^^^^^^^^^^^^^^ -# -# When using ``MPIEXEC_EXECUTABLE`` to execute MPI applications, you should typically -# use all of the ``MPIEXEC_EXECUTABLE`` flags as follows: -# -# :: -# -# ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} -# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS -# -# where ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to -# pass to the MPI program. -# -# Advanced variables for using MPI -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# -# The module can perform some advanced feature detections upon explicit request. -# -# **Important notice:** The following checks cannot be performed without *executing* an MPI test program. -# Consider the special considerations for the behavior of :command:`try_run` during cross compilation. -# Moreover, running an MPI program can cause additional issues, like a firewall notification on some systems. -# You should only enable these detections if you absolutely need the information. -# -# If the following variables are set to true, the respective search will be performed: -# -# ``MPI_DETERMINE_Fortran_CAPABILITIES`` -# Determine for all available Fortran bindings what the values of ``MPI_SUBARRAYS_SUPPORTED`` and -# ``MPI_ASYNC_PROTECTS_NONBLOCKING`` are and make their values available as ``MPI_Fortran__SUBARRAYS`` -# and ``MPI_Fortran__ASYNCPROT``, where ```` is one of ``F77_HEADER``, ``F90_MODULE`` and -# ``F08_MODULE``. -# ``MPI_DETERMINE_LIBRARY_VERSION`` -# For each language, find the output of ``MPI_Get_library_version`` and make it available as ``MPI__LIBRARY_VERSION``. -# This information is usually tied to the runtime component of an MPI implementation and might differ depending on ````. -# Note that the return value is entirely implementation defined. This information might be used to identify -# the MPI vendor and for example pick the correct one of multiple third party binaries that matches the MPI vendor. -# -# Backward Compatibility -# ^^^^^^^^^^^^^^^^^^^^^^ -# -# For backward compatibility with older versions of FindMPI, these -# variables are set, but deprecated: -# -# :: -# -# MPI_COMPILER MPI_LIBRARY MPI_EXTRA_LIBRARY -# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_LINK_FLAGS -# MPI_LIBRARIES -# -# In new projects, please use the ``MPI__XXX`` equivalents. -# Additionally, the following variables are deprecated: -# -# ``MPI__COMPILE_FLAGS`` -# Use ``MPI__COMPILE_OPTIONS`` and ``MPI__COMPILE_DEFINITIONS`` instead. -# ``MPI__INCLUDE_PATH`` -# For consumption use ``MPI__INCLUDE_DIRS`` and for specifying folders use ``MPI__ADDITIONAL_INCLUDE_DIRS`` instead. -# ``MPIEXEC`` -# Use ``MPIEXEC_EXECUTABLE`` instead. - -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - -# include this to handle the QUIETLY and REQUIRED arguments -include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -include(GetPrerequisites) - -# Generic compiler names -set(_MPI_C_GENERIC_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) -set(_MPI_CXX_GENERIC_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ - mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) -set(_MPI_Fortran_GENERIC_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r - mpif90 mpif90_r mpf90 mpf90_r - mpif77 mpif77_r mpf77 mpf77_r - mpifc) - -# GNU compiler names -set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r) -set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r mpigxx) -set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpgfortran_r - mpig77 mpig77_r mpg77 mpg77_r) - -# Intel MPI compiler names on Windows -if(WIN32) - list(APPEND _MPI_C_GENERIC_COMPILER_NAMES mpicc.bat) - list(APPEND _MPI_CXX_GENERIC_COMPILER_NAMES mpicxx.bat) - list(APPEND _MPI_Fortran_GENERIC_COMPILER_NAMES mpifc.bat) - - # Intel MPI compiler names - set(_MPI_Intel_C_COMPILER_NAMES mpiicc.bat) - set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc.bat) - set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort.bat mpif77.bat mpif90.bat) - - # Intel MPI compiler names for MSMPI - set(_MPI_MSVC_C_COMPILER_NAMES mpicl.bat) - set(_MPI_MSVC_CXX_COMPILER_NAMES mpicl.bat) -else() - # Intel compiler names - set(_MPI_Intel_C_COMPILER_NAMES mpiicc) - set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++) - set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) -endif() - -# PGI compiler names -set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) -set(_MPI_PGI_CXX_COMPILER_NAMES mpipgCC mppgCC) -set(_MPI_PGI_Fortran_COMPILER_NAMES mpipgf95 mpipgf90 mppgf95 mppgf90 mpipgf77 mppgf77) - -# XLC MPI Compiler names -set(_MPI_XL_C_COMPILER_NAMES mpxlc mpxlc_r mpixlc mpixlc_r) -set(_MPI_XL_CXX_COMPILER_NAMES mpixlcxx mpixlC mpixlc++ mpxlcxx mpxlc++ mpixlc++ mpxlCC - mpixlcxx_r mpixlC_r mpixlc++_r mpxlcxx_r mpxlc++_r mpixlc++_r mpxlCC_r) -set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95_r - mpixlf90 mpixlf90_r mpxlf90 mpxlf90_r - mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r - mpixlf mpixlf_r mpxlf mpxlf_r) - -# Prepend vendor-specific compiler wrappers to the list. If we don't know the compiler, -# attempt all of them. -# By attempting vendor-specific compiler names first, we should avoid situations where the compiler wrapper -# stems from a proprietary MPI and won't know which compiler it's being used for. For instance, Intel MPI -# controls its settings via the I_MPI_CC environment variables if the generic name is being used. -# If we know which compiler we're working with, we can use the most specialized wrapper there is in order to -# pick up the right settings for it. -foreach (LANG IN ITEMS C CXX Fortran) - set(_MPI_${LANG}_COMPILER_NAMES "") - foreach (id IN ITEMS GNU Intel MSVC PGI XL) - if (NOT CMAKE_${LANG}_COMPILER_ID OR CMAKE_${LANG}_COMPILER_ID STREQUAL id) - list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${id}_${LANG}_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) - endif() - unset(_MPI_${id}_${LANG}_COMPILER_NAMES) - endforeach() - list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${LANG}_GENERIC_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) - unset(_MPI_${LANG}_GENERIC_COMPILER_NAMES) -endforeach() - -# Names to try for mpiexec -# Only mpiexec commands are guaranteed to behave as described in the standard, -# mpirun commands are not covered by the standard in any way whatsoever. -# lamexec is the executable for LAM/MPI, srun is for SLURM or Open MPI with SLURM support. -# srun -n X is however a valid command, so it behaves 'like' mpiexec. -set(_MPIEXEC_NAMES_BASE mpiexec mpiexec.hydra mpiexec.mpd mpirun lamexec srun) - -unset(_MPIEXEC_NAMES) -foreach(_MPIEXEC_NAME IN LISTS _MPIEXEC_NAMES_BASE) - list(APPEND _MPIEXEC_NAMES "${_MPIEXEC_NAME}${MPI_EXECUTABLE_SUFFIX}") -endforeach() -unset(_MPIEXEC_NAMES_BASE) - -function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) - if(DEFINED MPI_${LANG}_COMPILER_FLAGS) - separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_${LANG}_COMPILER_FLAGS}") - else() - separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_COMPILER_FLAGS}") - endif() - execute_process( - COMMAND ${MPI_${LANG}_COMPILER} ${_MPI_COMPILER_WRAPPER_OPTIONS} ${QUERY_FLAG} - OUTPUT_VARIABLE WRAPPER_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE WRAPPER_OUTPUT ERROR_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE WRAPPER_RETURN) - # Some compiler wrappers will yield spurious zero return values, for example - # Intel MPI tolerates unknown arguments and if the MPI wrappers loads a shared - # library that has invalid or missing version information there would be warning - # messages emitted by ld.so in the compiler output. In either case, we'll treat - # the output as invalid. - if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found") - set(WRAPPER_RETURN 255) - endif() - # Ensure that no error output might be passed upwards. - if(NOT WRAPPER_RETURN EQUAL 0) - unset(WRAPPER_OUTPUT) - endif() - set(${OUTPUT_VARIABLE} "${WRAPPER_OUTPUT}" PARENT_SCOPE) - set(${RESULT_VARIABLE} "${WRAPPER_RETURN}" PARENT_SCOPE) -endfunction() - -function (_MPI_interrogate_compiler lang) - unset(MPI_COMPILE_CMDLINE) - unset(MPI_LINK_CMDLINE) - - unset(MPI_COMPILE_OPTIONS_WORK) - unset(MPI_COMPILE_DEFINITIONS_WORK) - unset(MPI_INCLUDE_DIRS_WORK) - unset(MPI_LINK_FLAGS_WORK) - unset(MPI_LIB_NAMES_WORK) - unset(MPI_LIB_FULLPATHS_WORK) - - # Check whether the -showme:compile option works. This indicates that we have either Open MPI - # or a newer version of LAM/MPI, and implies that -showme:link will also work. - # Open MPI also supports -show, but separates linker and compiler information - _MPI_check_compiler(${LANG} "-showme:compile" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - if (MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-showme:link" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) - - if (NOT MPI_COMPILER_RETURN EQUAL 0) - unset(MPI_COMPILE_CMDLINE) - endif() - endif() - - # MPICH and MVAPICH offer -compile-info and -link-info. - # For modern versions, both do the same as -show. However, for old versions, they do differ - # when called for mpicxx and mpif90 and it's necessary to use them over -show in order to find the - # removed MPI C++ bindings. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-compile-info" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - - if (MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-link-info" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) - - if (NOT MPI_COMPILER_RETURN EQUAL 0) - unset(MPI_COMPILE_CMDLINE) - endif() - endif() - endif() - - # MPICH, MVAPICH2 and Intel MPI just use "-show". Open MPI also offers this, but the - # -showme commands are more specialized. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-show" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - endif() - - # Older versions of LAM/MPI have "-showme". Open MPI also supports this. - # Unknown to MPICH, MVAPICH and Intel MPI. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-showme" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - endif() - - if (NOT (MPI_COMPILER_RETURN EQUAL 0) OR NOT (DEFINED MPI_COMPILE_CMDLINE)) - # Cannot interrogate this compiler, so exit. - set(MPI_${LANG}_WRAPPER_FOUND FALSE PARENT_SCOPE) - return() - endif() - unset(MPI_COMPILER_RETURN) - - # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE - # into MPI_LINK_CMDLINE, if we didn't find the link line. - if (NOT DEFINED MPI_LINK_CMDLINE) - set(MPI_LINK_CMDLINE "${MPI_COMPILE_CMDLINE}") - endif() - - # At this point, we obtained some output from a compiler wrapper that works. - # We'll now try to parse it into variables with meaning to us. - if("${LANG}" STREQUAL "Fortran") - # Some MPICH-1 and MVAPICH-1 versions return a three command answer for Fortran, consisting - # out of a symlink command for mpif.h, the actual compiler command and a deletion of the - # created symlink. We need to detect that case, remember the include path and drop the - # symlink/deletion operation to obtain the link/compile lines we'd usually expect. - if("${MPI_COMPILE_CMDLINE}" MATCHES "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h") - get_filename_component(MPI_INCLUDE_DIRS_WORK "${CMAKE_MATCH_1}" DIRECTORY) - string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") - string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") - string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") - string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") - endif() - endif() - - # The Intel MPI wrapper on Linux will emit some objcopy commands after its compile command - # if -static_mpi was passed to the wrapper. To avoid spurious matches, we need to drop these lines. - if(UNIX) - string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") - string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") - endif() - - # Extract compile options from the compile command line. - string(REGEX MATCHALL "(^| )-f([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_OPTIONS "${MPI_COMPILE_CMDLINE}") - - foreach(_MPI_COMPILE_OPTION IN LISTS MPI_ALL_COMPILE_OPTIONS) - string(REGEX REPLACE "^ " "" _MPI_COMPILE_OPTION "${_MPI_COMPILE_OPTION}") - # Ignore -fstack-protector directives: These occur on MPICH and MVAPICH when the libraries - # themselves were built with this flag. However, this flag is unrelated to using MPI, and - # we won't match the accompanying --param-ssp-size and -Wp,-D_FORTIFY_SOURCE flags and therefore - # produce inconsistent results with the regularly flags. - # Similarly, aliasing flags do not belong into our flag array. - if(NOT "${_MPI_COMPILE_OPTION}" MATCHES "^-f(stack-protector|(no-|)strict-aliasing|PI[CE]|pi[ce])") - list(APPEND MPI_COMPILE_OPTIONS_WORK "${_MPI_COMPILE_OPTION}") - endif() - endforeach() - - # Same deal, with the definitions. We also treat arguments passed to the preprocessor directly. - string(REGEX MATCHALL "(^| )(-Wp,|-Xpreprocessor |)[-/]D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_DEFINITIONS "${MPI_COMPILE_CMDLINE}") - - foreach(_MPI_COMPILE_DEFINITION IN LISTS MPI_ALL_COMPILE_DEFINITIONS) - string(REGEX REPLACE "^ ?(-Wp,|-Xpreprocessor )?[-/]D" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") - string(REPLACE "\"" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") - if(NOT "${_MPI_COMPILE_DEFINITION}" MATCHES "^_FORTIFY_SOURCE.*") - list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${_MPI_COMPILE_DEFINITION}") - endif() - endforeach() - - # Extract include paths from compile command line - string(REGEX MATCHALL "(^| )[-/]I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") - - # If extracting failed to work, we'll try using -showme:incdirs. - if (NOT MPI_ALL_INCLUDE_PATHS) - _MPI_check_compiler(${LANG} "-showme:incdirs" MPI_INCDIRS_CMDLINE MPI_INCDIRS_COMPILER_RETURN) - if(MPI_INCDIRS_COMPILER_RETURN) - separate_arguments(MPI_ALL_INCLUDE_PATHS NATIVE_COMMAND "${MPI_INCDIRS_CMDLINE}") - endif() - endif() - - foreach(_MPI_INCLUDE_PATH IN LISTS MPI_ALL_INCLUDE_PATHS) - string(REGEX REPLACE "^ ?[-/]I" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") - string(REPLACE "\"" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") - get_filename_component(_MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}" REALPATH) - list(APPEND MPI_INCLUDE_DIRS_WORK "${_MPI_INCLUDE_PATH}") - endforeach() - - # Extract linker paths from the link command line - string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker |)(-L|[/-]LIBPATH:|[/-]libpath:)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") - - # If extracting failed to work, we'll try using -showme:libdirs. - if (NOT MPI_ALL_LINK_PATHS) - _MPI_check_compiler(${LANG} "-showme:libdirs" MPI_LIBDIRS_CMDLINE MPI_LIBDIRS_COMPILER_RETURN) - if(MPI_LIBDIRS_COMPILER_RETURN) - separate_arguments(MPI_ALL_LINK_PATHS NATIVE_COMMAND "${MPI_LIBDIRS_CMDLINE}") - endif() - endif() - - foreach(_MPI_LPATH IN LISTS MPI_ALL_LINK_PATHS) - string(REGEX REPLACE "^ ?(-Wl,|-Xlinker )?(-L|[/-]LIBPATH:|[/-]libpath:)" "" _MPI_LPATH "${_MPI_LPATH}") - string(REPLACE "\"" "" _MPI_LPATH "${_MPI_LPATH}") - get_filename_component(_MPI_LPATH "${_MPI_LPATH}" REALPATH) - list(APPEND MPI_LINK_DIRECTORIES_WORK "${_MPI_LPATH}") - endforeach() - - # Extract linker flags from the link command line - string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") - - foreach(_MPI_LINK_FLAG IN LISTS MPI_ALL_LINK_FLAGS) - string(STRIP "${_MPI_LINK_FLAG}" _MPI_LINK_FLAG) - # MPI might be marked to build with non-executable stacks but this should not propagate. - if (NOT "${_MPI_LINK_FLAG}" MATCHES "(-Wl,|-Xlinker )-z,noexecstack") - if (MPI_LINK_FLAGS_WORK) - string(APPEND MPI_LINK_FLAGS_WORK " ${_MPI_LINK_FLAG}") - else() - set(MPI_LINK_FLAGS_WORK "${_MPI_LINK_FLAG}") - endif() - endif() - endforeach() - - # Extract the set of libraries to link against from the link command - # line - string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") - - foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) - string(REGEX REPLACE "^ ?-l" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) - if(NOT "${_MPI_LIB_PATH}" STREQUAL "") - list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") - else() - list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") - endif() - endforeach() - - if(WIN32) - # A compiler wrapper on Windows will just have the name of the - # library to link on its link line, potentially with a full path - string(REGEX MATCHALL "(^| )([^\" ]+\\.lib|\"[^\"]+\\.lib\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") - foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) - string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) - if(NOT "${_MPI_LIB_PATH}" STREQUAL "") - list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") - else() - list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") - endif() - endforeach() - else() - # On UNIX platforms, archive libraries can be given with full path. - string(REGEX MATCHALL "(^| )([^\" ]+\\.a|\"[^\"]+\\.a\")" MPI_LIBFULLPATHS "${MPI_LINK_CMDLINE}") - foreach(_MPI_LIB_NAME IN LISTS MPI_LIBFULLPATHS) - string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) - if(NOT "${_MPI_LIB_PATH}" STREQUAL "") - list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") - else() - list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") - endif() - endforeach() - endif() - - # An MPI compiler wrapper could have its MPI libraries in the implictly - # linked directories of the compiler itself. - if(DEFINED CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) - list(APPEND MPI_LINK_DIRECTORIES_WORK "${CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES}") - endif() - - # Determine full path names for all of the libraries that one needs - # to link against in an MPI program - unset(MPI_PLAIN_LIB_NAMES_WORK) - foreach(_MPI_LIB_NAME IN LISTS MPI_LIB_NAMES_WORK) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_NAME}" NAME_WE) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${MPI_LINK_DIRECTORIES_WORK} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endforeach() - - # Deal with the libraries given with full path next - unset(MPI_DIRECT_LIB_NAMES_WORK) - foreach(_MPI_LIB_FULLPATH IN LISTS MPI_LIB_FULLPATHS_WORK) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME) - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_FULLPATH}" DIRECTORY) - list(APPEND MPI_DIRECT_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_PATH} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endforeach() - if(MPI_DIRECT_LIB_NAMES_WORK) - set(MPI_PLAIN_LIB_NAMES_WORK "${MPI_DIRECT_LIB_NAMES_WORK};${MPI_PLAIN_LIB_NAMES_WORK}") - endif() - - # MPI might require pthread to work. The above mechanism wouldn't detect it, but we need to - # link it in that case. -lpthread is covered by the normal library treatment on the other hand. - if("${MPI_COMPILE_CMDLINE}" MATCHES "-pthread") - list(APPEND MPI_COMPILE_OPTIONS_WORK "-pthread") - if(MPI_LINK_FLAGS_WORK) - string(APPEND MPI_LINK_FLAGS_WORK " -pthread") - else() - set(MPI_LINK_FLAGS_WORK "-pthread") - endif() - endif() - - if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) - list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}") - endif() - if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) - list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}") - endif() - if(MPI_${LANG}_EXTRA_LIB_NAMES) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}") - endif() - - # If we found MPI, set up all of the appropriate cache entries - if(NOT MPI_${LANG}_COMPILE_OPTIONS) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) - endif() - if(NOT MPI_${LANG}_COMPILE_DEFINITIONS) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_COMPILE_DEFINITIONS_WORK} CACHE STRING "MPI ${LANG} compilation definitions" FORCE) - endif() - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_INCLUDE_DIRS_WORK} CACHE STRING "MPI ${LANG} additional include directories" FORCE) - endif() - if(NOT MPI_${LANG}_LINK_FLAGS) - set(MPI_${LANG}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${LANG} linker flags" FORCE) - endif() - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES ${MPI_PLAIN_LIB_NAMES_WORK} CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - set(MPI_${LANG}_WRAPPER_FOUND TRUE PARENT_SCOPE) -endfunction() - -function(_MPI_guess_settings LANG) - set(MPI_GUESS_FOUND FALSE) - # Currently only MSMPI and MPICH2 on Windows are supported, so we can skip this search if we're not targeting that. - if(WIN32) - # MSMPI - - # The environment variables MSMPI_INC and MSMPILIB32/64 are the only ways of locating the MSMPI_SDK, - # which is installed separately from the runtime. Thus it's possible to have mpiexec but not MPI headers - # or import libraries and vice versa. - if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MSMPI") - # We first attempt to locate the msmpi.lib. Should be find it, we'll assume that the MPI present is indeed - # Microsoft MPI. - if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) - set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB64}") - set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x64") - else() - set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB32}") - set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x86") - endif() - - find_library(MPI_msmpi_LIBRARY - NAMES msmpi - HINTS ${MPI_MSMPI_LIB_PATH} - DOC "Location of the msmpi library for Microsoft MPI") - mark_as_advanced(MPI_msmpi_LIBRARY) - - if(MPI_msmpi_LIBRARY) - # Next, we attempt to locate the MPI header. Note that for Fortran we know that mpif.h is a way - # MSMPI can be used and therefore that header has to be present. - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - get_filename_component(MPI_MSMPI_INC_DIR "$ENV{MSMPI_INC}" REALPATH) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MSMPI_INC_DIR}" CACHE STRING "MPI ${LANG} additional include directories" FORCE) - unset(MPI_MSMPI_INC_DIR) - endif() - - # For MSMPI, one can compile the MPI module by building the mpi.f90 shipped with the MSMPI SDK, - # thus it might be present or provided by the user. Figuring out which is supported is done later on. - # The PGI Fortran compiler for instance ships a prebuilt set of modules in its own include folder. - # Should a user be employing PGI or have built its own set and provided it via cache variables, the - # splitting routine would have located the module files. - - # For C and C++, we're done here (MSMPI does not ship the MPI-2 C++ bindings) - however, for Fortran - # we need some extra library to glue Fortran support together: - # MSMPI ships 2-4 Fortran libraries, each for different Fortran compiler behaviors. The library names - # ending with a c are using the cdecl calling convention, whereas those ending with an s are for Fortran - # implementations using stdcall. Therefore, the 64-bit MSMPI only ships those ending in 'c', whereas the 32-bit - # has both variants available. - # The second difference is the last but one letter, if it's an e(nd), the length of a string argument is - # passed by the Fortran compiler after all other arguments on the parameter list, if it's an m(ixed), - # it's passed immediately after the string address. - - # To summarize: - # - msmpifec: CHARACTER length passed after the parameter list and using cdecl calling convention - # - msmpifmc: CHARACTER length passed directly after string address and using cdecl calling convention - # - msmpifes: CHARACTER length passed after the parameter list and using stdcall calling convention - # - msmpifms: CHARACTER length passed directly after string address and using stdcall calling convention - # 32-bit MSMPI ships all four libraries, 64-bit MSMPI ships only the first two. - - # As is, Intel Fortran and PGI Fortran both use the 'ec' variant of the calling convention, whereas - # the old Compaq Visual Fortran compiler defaulted to the 'ms' version. It's possible to make Intel Fortran - # use the CVF calling convention using /iface:cvf, but we assume - and this is also assumed in FortranCInterface - - # this isn't the case. It's also possible to make CVF use the 'ec' variant, using /iface=(cref,nomixed_str_len_arg). - - # Our strategy is now to locate all libraries, but enter msmpifec into the LIB_NAMES array. - # Should this not be adequate it's a straightforward way for a user to change the LIB_NAMES array and - # have his library found. Still, this should not be necessary outside of exceptional cases, as reasoned. - if ("${LANG}" STREQUAL "Fortran") - set(MPI_MSMPI_CALLINGCONVS c) - if("${CMAKE_SIZEOF_VOID_P}" EQUAL 4) - list(APPEND MPI_MSMPI_CALLINGCONVS s) - endif() - foreach(mpistrlenpos IN ITEMS e m) - foreach(mpicallingconv IN LISTS MPI_MSMPI_CALLINGCONVS) - find_library(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY - NAMES msmpif${mpistrlenpos}${mpicallingconv} - HINTS "${MPI_MSMPI_LIB_PATH}" - DOC "Location of the msmpi${mpistrlenpos}${mpicallingconv} library for Microsoft MPI") - mark_as_advanced(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY) - endforeach() - endforeach() - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES "msmpi;msmpifec" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - - # At this point we're *not* done. MSMPI requires an additional include file for Fortran giving the value - # of MPI_AINT. This file is called mpifptr.h located in the x64 and x86 subfolders, respectively. - find_path(MPI_mpifptr_INCLUDE_DIR - NAMES "mpifptr.h" - HINTS "${MPI_MSMPI_INC_PATH_EXTRA}" - DOC "Location of the mpifptr.h extra header for Microsoft MPI") - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS "mpifptr" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) - endif() - mark_as_advanced(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS MPI_mpifptr_INCLUDE_DIR) - else() - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES "msmpi" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - endif() - mark_as_advanced(MPI_${LANG}_LIB_NAMES) - set(MPI_GUESS_FOUND TRUE) - endif() - endif() - - # At this point there's not many MPIs that we could still consider. - # OpenMPI 1.6.x and below supported Windows, but these ship compiler wrappers that still work. - # The only other relevant MPI implementation without a wrapper is MPICH2, which had Windows support in 1.4.1p1 and older. - if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MPICH2") - set(MPI_MPICH_PREFIX_PATHS - "$ENV{ProgramW6432}/MPICH2/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/../lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]/lib" - ) - - # All of C, C++ and Fortran will need mpi.lib, so we'll look for this first - find_library(MPI_mpi_LIBRARY - NAMES mpi - HINTS ${MPI_MPICH_PREFIX_PATHS}) - mark_as_advanced(MPI_mpi_LIBRARY) - # If we found mpi.lib, we detect the rest of MPICH2 - if(MPI_mpi_LIBRARY) - set(MPI_MPICH_LIB_NAMES "mpi") - # If MPI-2 C++ bindings are requested, we need to locate cxx.lib as well. - # Otherwise, MPICH_SKIP_MPICXX will be defined and these bindings aren't needed. - if("${LANG}" STREQUAL "CXX" AND NOT MPI_CXX_SKIP_MPICXX) - find_library(MPI_cxx_LIBRARY - NAMES cxx - HINTS ${MPI_MPICH_PREFIX_PATHS}) - mark_as_advanced(MPI_cxx_LIBRARY) - list(APPEND MPI_MPICH_LIB_NAMES "cxx") - # For Fortran, MPICH2 provides three different libraries: - # fmpich2.lib which uses uppercase symbols and cdecl, - # fmpich2s.lib which uses uppercase symbols and stdcall (32-bit only), - # fmpich2g.lib which uses lowercase symbols with double underscores and cdecl. - # fmpich2s.lib would be useful for Compaq Visual Fortran, fmpich2g.lib has to be used with GNU g77 and is also - # provided in the form of an .a archive for MinGW and Cygwin. From our perspective, fmpich2.lib is the only one - # we need to try, and if it doesn't work with the given Fortran compiler we'd find out later on during validation - elseif("${LANG}" STREQUAL "Fortran") - find_library(MPI_fmpich2_LIBRARY - NAMES fmpich2 - HINTS ${MPI_MPICH_PREFIX_PATHS}) - find_library(MPI_fmpich2s_LIBRARY - NAMES fmpich2s - HINTS ${MPI_MPICH_PREFIX_PATHS}) - find_library(MPI_fmpich2g_LIBRARY - NAMES fmpich2g - HINTS ${MPI_MPICH_PREFIX_PATHS}) - mark_as_advanced(MPI_fmpich2_LIBRARY MPI_fmpich2s_LIBRARY MPI_fmpich2g_LIBRARY) - list(APPEND MPI_MPICH_LIB_NAMES "fmpich2") - endif() - - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES "${MPI_MPICH_LIB_NAMES}" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - unset(MPI_MPICH_LIB_NAMES) - - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - # For MPICH2, the include folder would be in ../include relative to the library folder. - get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_mpi_LIBRARY}" DIRECTORY) - get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_MPICH_ROOT_DIR}" DIRECTORY) - if(IS_DIRECTORY "${MPI_MPICH_ROOT_DIR}/include") - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MPICH_ROOT_DIR}/include" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) - endif() - unset(MPI_MPICH_ROOT_DIR) - endif() - set(MPI_GUESS_FOUND TRUE) - endif() - unset(MPI_MPICH_PREFIX_PATHS) - endif() - endif() - set(MPI_${LANG}_GUESS_FOUND "${MPI_GUESS_FOUND}" PARENT_SCOPE) -endfunction() - -function(_MPI_adjust_compile_definitions LANG) - if("${LANG}" STREQUAL "CXX") - # To disable the C++ bindings, we need to pass some definitions since the mpi.h header has to deal with both C and C++ - # bindings in MPI-2. - if(MPI_CXX_SKIP_MPICXX AND NOT MPI_${LANG}_COMPILE_DEFINITIONS MATCHES "SKIP_MPICXX") - # MPICH_SKIP_MPICXX is being used in MPICH and derivatives like MVAPICH or Intel MPI - # OMPI_SKIP_MPICXX is being used in Open MPI - # _MPICC_H is being used for IBM Platform MPI - list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX" "OMPI_SKIP_MPICXX" "_MPICC_H") - set(MPI_${LANG}_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}" CACHE STRING "MPI ${LANG} compilation definitions" FORCE) - endif() - endif() -endfunction() - -macro(_MPI_assemble_libraries LANG) - set(MPI_${LANG}_LIBRARIES "") - # Only for libraries do we need to check whether the compiler's linking stage is separate. - if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT) - foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) - endforeach() - endif() -endmacro() - -macro(_MPI_assemble_include_dirs LANG) - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - set(MPI_${LANG}_INCLUDE_DIRS "") - else() - set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") - if("${LANG}" MATCHES "(C|CXX)") - if(MPI_${LANG}_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - else() # Fortran - if(MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") - endif() - if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") - endif() - endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}") - endforeach() - endif() - endif() -endmacro() - -function(_MPI_split_include_dirs LANG) - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - return() - endif() - # Backwards compatibility: Search INCLUDE_PATH if given. - if(MPI_${LANG}_INCLUDE_PATH) - list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") - endif() - - # We try to find the headers/modules among those paths (and system paths) - # For C/C++, we just need to have a look for mpi.h. - if("${LANG}" MATCHES "(C|CXX)") - find_path(MPI_${LANG}_HEADER_DIR "mpi.h" - HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} - ) - mark_as_advanced(MPI_${LANG}_HEADER_DIR) - if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - # Fortran is more complicated here: An implementation could provide - # any of the Fortran 77/90/2008 APIs for MPI. For example, MSMPI - # only provides Fortran 77 and - if mpi.f90 is built - potentially - # a Fortran 90 module. - elseif("${LANG}" STREQUAL "Fortran") - find_path(MPI_${LANG}_F77_HEADER_DIR "mpif.h" - HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} - ) - find_path(MPI_${LANG}_MODULE_DIR - NAMES "mpi.mod" "mpi_f08.mod" - HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} - ) - if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS - "${MPI_${LANG}_F77_HEADER_DIR}" - "${MPI_${LANG}_MODULE_DIR}" - ) - endif() - mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) - endif() - # Remove duplicates and default system directories from the list. - if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) - list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR}) - endforeach() - endif() - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) -endfunction() - -macro(_MPI_create_imported_target LANG) - if(NOT TARGET MPI::MPI_${LANG}) - add_library(MPI::MPI_${LANG} INTERFACE IMPORTED) - endif() - - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}") - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}") - - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "") - if(MPI_${LANG}_LINK_FLAGS) - set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LINK_FLAGS}") - endif() - # If the compiler links MPI implicitly, no libraries will be found as they're contained within - # CMAKE__IMPLICIT_LINK_LIBRARIES already. - if(MPI_${LANG}_LIBRARIES) - set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LIBRARIES}") - endif() - # Given the new design of FindMPI, INCLUDE_DIRS will always be located, even under implicit linking. - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${MPI_${LANG}_INCLUDE_DIRS}") -endmacro() - -function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY) - set(WORK_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI") - set(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/FindMPI") - set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI/${MPI_TEST_FILE_NAME}_${LANG}.bin") - unset(MPI_TEST_COMPILE_DEFINITIONS) - if("${LANG}" STREQUAL "Fortran") - if("${MODE}" STREQUAL "F90_MODULE") - set(MPI_Fortran_INCLUDE_LINE "use mpi\n implicit none") - elseif("${MODE}" STREQUAL "F08_MODULE") - set(MPI_Fortran_INCLUDE_LINE "use mpi_f08\n implicit none") - else() # F77 header - set(MPI_Fortran_INCLUDE_LINE "implicit none\n include 'mpif.h'") - endif() - configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.f90.in" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90" @ONLY) - set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90") - elseif("${LANG}" STREQUAL "CXX") - configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.c" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp" COPYONLY) - set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp") - if("${MODE}" STREQUAL "TEST_MPICXX") - set(MPI_TEST_COMPILE_DEFINITIONS TEST_MPI_MPICXX) - endif() - else() # C - set(MPI_TEST_SOURCE_FILE "${SRC_DIR}/${MPI_TEST_FILE_NAME}.c") - endif() - if(RUN_BINARY) - try_run(MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} - "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" - COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} - LINK_LIBRARIES MPI::MPI_${LANG} - RUN_OUTPUT_VARIABLE MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}) - set(MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} "${MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}}" PARENT_SCOPE) - else() - try_compile(MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} - "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" - COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} - LINK_LIBRARIES MPI::MPI_${LANG} - COPY_FILE "${BIN_FILE}") - endif() -endfunction() - -macro(_MPI_check_lang_works LANG) - # For Fortran we may have by the MPI-3 standard an implementation that provides: - # - the mpi_f08 module - # - *both*, the mpi module and 'mpif.h' - # Since older MPI standards (MPI-1) did not define anything but 'mpif.h', we need to check all three individually. - if( NOT MPI_${LANG}_WORKS ) - if("${LANG}" STREQUAL "Fortran") - set(MPI_Fortran_INTEGER_LINE "(kind=MPI_INTEGER_KIND)") - _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER FALSE) - _MPI_try_staged_settings(${LANG} test_mpi F90_MODULE FALSE) - _MPI_try_staged_settings(${LANG} test_mpi F08_MODULE FALSE) - - set(MPI_${LANG}_WORKS FALSE) - - foreach(mpimethod IN ITEMS F77_HEADER F08_MODULE F90_MODULE) - if(MPI_RESULT_${LANG}_test_mpi_${mpimethod}) - set(MPI_${LANG}_WORKS TRUE) - set(MPI_${LANG}_HAVE_${mpimethod} TRUE) - else() - set(MPI_${LANG}_HAVE_${mpimethod} FALSE) - endif() - endforeach() - # MPI-1 versions had no MPI_INTGER_KIND defined, so we need to try without it. - # However, MPI-1 also did not define the Fortran 90 and 08 modules, so we only try the F77 header. - unset(MPI_Fortran_INTEGER_LINE) - if(NOT MPI_${LANG}_WORKS) - _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER_NOKIND FALSE) - if(MPI_RESULT_${LANG}_test_mpi_F77_HEADER_NOKIND) - set(MPI_${LANG}_WORKS TRUE) - set(MPI_${LANG}_HAVE_F77_HEADER TRUE) - endif() - endif() - else() - _MPI_try_staged_settings(${LANG} test_mpi normal FALSE) - # If 'test_mpi' built correctly, we've found valid MPI settings. There might not be MPI-2 C++ support, but there can't - # be MPI-2 C++ support without the C bindings being present, so checking for them is sufficient. - set(MPI_${LANG}_WORKS "${MPI_RESULT_${LANG}_test_mpi_normal}") - endif() - endif() -endmacro() - -# Some systems install various MPI implementations in separate folders in some MPI prefix -# This macro enumerates all such subfolders and adds them to the list of hints that will be searched. -macro(MPI_search_mpi_prefix_folder PREFIX_FOLDER) - if(EXISTS "${PREFIX_FOLDER}") - file(GLOB _MPI_folder_children RELATIVE "${PREFIX_FOLDER}" "${PREFIX_FOLDER}/*") - foreach(_MPI_folder_child IN LISTS _MPI_folder_children) - if(IS_DIRECTORY "${PREFIX_FOLDER}/${_MPI_folder_child}") - list(APPEND MPI_HINT_DIRS "${PREFIX_FOLDER}/${_MPI_folder_child}") - endif() - endforeach() - endif() -endmacro() - -set(MPI_HINT_DIRS ${MPI_HOME} $ENV{MPI_HOME} $ENV{I_MPI_ROOT}) -if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") - # SUSE Linux Enterprise Server stores its MPI implementations under /usr/lib64/mpi/gcc/ - # We enumerate the subfolders and append each as a prefix - MPI_search_mpi_prefix_folder("/usr/lib64/mpi/gcc") -elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") - # MSMPI stores its runtime in a special folder, this adds the possible locations to the hints. - list(APPEND MPI_HINT_DIRS $ENV{MSMPI_BIN} "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]") -elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") - # FreeBSD ships mpich under the normal system paths - but available openmpi implementations - # will be found in /usr/local/mpi/ - MPI_search_mpi_prefix_folder("/usr/local/mpi") -endif() - -# Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. -# The MPI standard does not mandate the existence of either, but instead only makes requirements if a distribution -# ships an mpiexec program (mpirun executables are not regulated by the standard). -find_program(MPIEXEC_EXECUTABLE - NAMES ${_MPIEXEC_NAMES} - PATH_SUFFIXES bin sbin - HINTS ${MPI_HINT_DIRS} - DOC "Executable for running MPI programs.") - -# call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin). -# This gives us a fairly reliable base directory to search for /bin /lib and /include from. -get_filename_component(_MPI_BASE_DIR "${MPIEXEC_EXECUTABLE}" PATH) -get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH) - -# 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 be placed after all flags passed to mpiexec.") - -# Set the number of processes to the physical processor count -cmake_host_system_information(RESULT _MPIEXEC_NUMPROCS QUERY NUMBER_OF_PHYSICAL_CORES) -set(MPIEXEC_MAX_NUMPROCS "${_MPIEXEC_NUMPROCS}" CACHE STRING "Maximum number of processors available to run MPI applications.") -unset(_MPIEXEC_NUMPROCS) -mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) - -#============================================================================= -# Backward compatibility input hacks. Propagate the FindMPI hints to C and -# CXX if the respective new versions are not defined. Translate the old -# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${LANG}_LIBRARIES. -# -# Once we find the new variables, we translate them back into their old -# equivalents below. -if(NOT MPI_IGNORE_LEGACY_VARIABLES) - foreach (LANG IN ITEMS C CXX) - # Old input variables. - set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) - - # Set new vars based on their old equivalents, if the new versions are not already set. - foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${LANG}_${var} AND MPI_${var}) - set(MPI_${LANG}_${var} "${MPI_${var}}") - endif() - endforeach() - - # Chop the old compile flags into options and definitions - - unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) - unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) - if(MPI_${LANG}_COMPILE_FLAGS) - separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") - foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) - if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") - list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") - else() - list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}") - endif() - endforeach() - unset(MPI_SEPARATE_FLAGS) - endif() - - # If a list of libraries was given, we'll split it into new-style cache variables - unset(MPI_${LANG}_EXTRA_LIB_NAMES) - if(NOT MPI_${LANG}_LIB_NAMES) - foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) - if(_MPI_LIB) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) - get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) - list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endif() - endforeach() - endif() - endforeach() -endif() -#============================================================================= - -unset(MPI_VERSION) -unset(MPI_VERSION_MAJOR) -unset(MPI_VERSION_MINOR) - -unset(_MPI_MIN_VERSION) - -# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. -if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) - set(MPI_SKIP_COMPILER_WRAPPER TRUE) -endif() - -# This loop finds the compilers and sends them off for interrogation. -foreach(LANG IN ITEMS C CXX Fortran) - if(CMAKE_${LANG}_COMPILER_LOADED) - if(NOT MPI_FIND_COMPONENTS) - set(_MPI_FIND_${LANG} TRUE) - elseif( ${LANG} IN_LIST MPI_FIND_COMPONENTS) - set(_MPI_FIND_${LANG} TRUE) - elseif( ${LANG} STREQUAL CXX AND NOT MPI_CXX_SKIP_MPICXX AND MPICXX IN_LIST MPI_FIND_COMPONENTS ) - set(_MPI_FIND_${LANG} TRUE) - else() - set(_MPI_FIND_${LANG} FALSE) - endif() - else() - set(_MPI_FIND_${LANG} FALSE) - endif() - if(_MPI_FIND_${LANG}) - if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS ) - set(MPI_CXX_SKIP_MPICXX FALSE CACHE BOOL "If true, the MPI-2 C++ bindings are disabled using definitions.") - mark_as_advanced(MPI_CXX_SKIP_MPICXX) - endif() - if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) - set(MPI_${LANG}_TRIED_IMPLICIT FALSE) - set(MPI_${LANG}_WORKS_IMPLICIT FALSE) - if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) - # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. - # Cray PrgEnv. - _MPI_create_imported_target(${LANG}) - _MPI_check_lang_works(${LANG}) - - # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. - if(MPI_${LANG}_WORKS) - set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) - set(MPI_${LANG}_WORKS_IMPLICIT TRUE) - endif() - set(MPI_${LANG}_TRIED_IMPLICIT TRUE) - endif() - - if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS) - set(MPI_${LANG}_WRAPPER_FOUND FALSE) - set(MPI_PINNED_COMPILER FALSE) - - if(NOT MPI_SKIP_COMPILER_WRAPPER) - if(MPI_${LANG}_COMPILER) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") - unset(MPI_${LANG}_COMPILER CACHE) - endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(MPI_PINNED_COMPILER TRUE) - endif() - - # If we have an MPI base directory, we'll try all compiler names in that one first. - # This should prevent mixing different MPI environments - if(_MPI_BASE_DIR) - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - HINTS ${_MPI_BASE_DIR} - NO_DEFAULT_PATH - DOC "MPI compiler for ${LANG}" - ) - endif() - - # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), - # we shall try searching in the default paths. - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - DOC "MPI compiler for ${LANG}" - ) - - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - set(MPI_PINNED_COMPILER TRUE) - - # If we haven't made the implicit compiler test yet, perform it now. - if(NOT MPI_${LANG}_TRIED_IMPLICIT) - _MPI_create_imported_target(${LANG}) - _MPI_check_lang_works(${LANG}) - endif() - - # Should the MPI compiler not work implicitly for MPI, still interrogate it. - # Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used - # directly during linkage instead of CMAKE__COMPILER will not work. - if(NOT MPI_${LANG}_WORKS) - set(MPI_${LANG}_WORKS_IMPLICIT FALSE) - _MPI_interrogate_compiler(${LANG}) - else() - set(MPI_${LANG}_WORKS_IMPLICIT TRUE) - endif() - elseif(MPI_${LANG}_COMPILER) - _MPI_interrogate_compiler(${LANG}) - endif() - endif() - - if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) - # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the - # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. - if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) - else() - _MPI_guess_settings(${LANG}) - endif() - endif() - endif() - endif() - - _MPI_split_include_dirs(${LANG}) - _MPI_assemble_include_dirs(${LANG}) - _MPI_assemble_libraries(${LANG}) - - _MPI_adjust_compile_definitions(${LANG}) - # We always create imported targets even if they're empty - _MPI_create_imported_target(${LANG}) - - if(NOT MPI_${LANG}_WORKS) - _MPI_check_lang_works(${LANG}) - endif() - - # Next, we'll initialize the MPI variables that have not been previously set. - set(MPI_${LANG}_COMPILE_OPTIONS "" CACHE STRING "MPI ${LANG} compilation flags" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) - if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) - endif() - mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS - MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) - - # If we've found MPI, then we'll perform additional analysis: Determine the MPI version, MPI library version, supported - # MPI APIs (i.e. MPI-2 C++ bindings). For Fortran we also need to find specific parameters if we're under MPI-3. - if(MPI_${LANG}_WORKS) - if("${LANG}" STREQUAL "CXX" AND NOT DEFINED MPI_MPICXX_FOUND) - if(NOT MPI_CXX_SKIP_MPICXX AND NOT MPI_CXX_VALIDATE_SKIP_MPICXX) - _MPI_try_staged_settings(${LANG} test_mpi MPICXX FALSE) - if(MPI_RESULT_${LANG}_test_mpi_MPICXX) - set(MPI_MPICXX_FOUND TRUE) - else() - set(MPI_MPICXX_FOUND FALSE) - endif() - else() - set(MPI_MPICXX_FOUND FALSE) - endif() - endif() - - # At this point, we know the bindings present but not the MPI version or anything else. - if(NOT DEFINED MPI_${LANG}_VERSION) - unset(MPI_${LANG}_VERSION_MAJOR) - unset(MPI_${LANG}_VERSION_MINOR) - endif() - set(MPI_BIN_FOLDER ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI) - - # For Fortran, we'll want to use the most modern MPI binding to test capabilities other than the - # Fortran parameters, since those depend on the method of consumption. - # For C++, we can always use the C bindings, and should do so, since the C++ bindings do not exist in MPI-3 - # whereas the C bindings do, and the C++ bindings never offered any feature advantage over their C counterparts. - if("${LANG}" STREQUAL "Fortran") - if(MPI_${LANG}_HAVE_F08_MODULE) - set(MPI_${LANG}_HIGHEST_METHOD F08_MODULE) - elseif(MPI_${LANG}_HAVE_F90_MODULE) - set(MPI_${LANG}_HIGHEST_METHOD F90_MODULE) - else() - set(MPI_${LANG}_HIGHEST_METHOD F77_HEADER) - endif() - - # Another difference between C and Fortran is that we can't use the preprocessor to determine whether MPI_VERSION - # and MPI_SUBVERSION are provided. These defines did not exist in MPI 1.0 and 1.1 and therefore might not - # exist. For C/C++, test_mpi.c will handle the MPI_VERSION extraction, but for Fortran, we need mpiver.f90. - if(NOT DEFINED MPI_${LANG}_VERSION) - _MPI_try_staged_settings(${LANG} mpiver ${MPI_${LANG}_HIGHEST_METHOD} FALSE) - if(MPI_RESULT_${LANG}_mpiver_${MPI_${LANG}_HIGHEST_METHOD}) - file(STRINGS ${MPI_BIN_FOLDER}/mpiver_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") - if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") - set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") - set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") - set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") - endif() - endif() - endif() - - # Finally, we want to find out which capabilities a given interface supports, compare the MPI-3 standard. - # This is determined by interface specific parameters MPI_SUBARRAYS_SUPPORTED and MPI_ASYNC_PROTECTS_NONBLOCKING - # and might vary between the different methods of consumption. - if(MPI_DETERMINE_Fortran_CAPABILITIES AND NOT MPI_Fortran_CAPABILITIES_DETERMINED) - foreach(mpimethod IN ITEMS F08_MODULE F90_MODULE F77_HEADER) - if(MPI_${LANG}_HAVE_${mpimethod}) - set(MPI_${LANG}_${mpimethod}_SUBARRAYS FALSE) - set(MPI_${LANG}_${mpimethod}_ASYNCPROT FALSE) - _MPI_try_staged_settings(${LANG} fortranparam_mpi ${mpimethod} TRUE) - if(MPI_RESULT_${LANG}_fortranparam_mpi_${mpimethod} AND - NOT "${MPI_RUN_RESULT_${LANG}_fortranparam_mpi_${mpimethod}}" STREQUAL "FAILED_TO_RUN") - if("${MPI_RUN_OUTPUT_${LANG}_fortranparam_mpi_${mpimethod}}" MATCHES - ".*INFO:SUBARRAYS\\[ *([TF]) *\\]-ASYNCPROT\\[ *([TF]) *\\].*") - if("${CMAKE_MATCH_1}" STREQUAL "T") - set(MPI_${LANG}_${mpimethod}_SUBARRAYS TRUE) - endif() - if("${CMAKE_MATCH_2}" STREQUAL "T") - set(MPI_${LANG}_${mpimethod}_ASYNCPROT TRUE) - endif() - endif() - endif() - endif() - endforeach() - set(MPI_Fortran_CAPABILITIES_DETERMINED TRUE) - endif() - else() - set(MPI_${LANG}_HIGHEST_METHOD normal) - - # By the MPI-2 standard, MPI_VERSION and MPI_SUBVERSION are valid for both C and C++ bindings. - if(NOT DEFINED MPI_${LANG}_VERSION) - file(STRINGS ${MPI_BIN_FOLDER}/test_mpi_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") - if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") - set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") - set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") - set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") - endif() - endif() - endif() - - unset(MPI_BIN_FOLDER) - - # At this point, we have dealt with determining the MPI version and parameters for each Fortran method available. - # The one remaining issue is to determine which MPI library is installed. - # Determining the version and vendor of the MPI library is only possible via MPI_Get_library_version() at runtime, - # and therefore we cannot do this while cross-compiling (a user may still define MPI__LIBRARY_VERSION_STRING - # themselves and we'll attempt splitting it, which is equivalent to provide the try_run output). - # It's also worth noting that the installed version string can depend on the language, or on the system the binary - # runs on if MPI is not statically linked. - if(MPI_DETERMINE_LIBRARY_VERSION AND NOT MPI_${LANG}_LIBRARY_VERSION_STRING) - _MPI_try_staged_settings(${LANG} libver_mpi ${MPI_${LANG}_HIGHEST_METHOD} TRUE) - if(MPI_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD} AND - "${MPI_RUN_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" EQUAL "0") - string(STRIP "${MPI_RUN_OUTPUT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" - MPI_${LANG}_LIBRARY_VERSION_STRING) - else() - set(MPI_${LANG}_LIBRARY_VERSION_STRING "NOTFOUND") - endif() - endif() - endif() - - set(MPI_${LANG}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) - set(MPI_${LANG}_FIND_VERSION ${MPI_FIND_VERSION}) - set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) - - unset(MPI_${LANG}_REQUIRED_VARS) - if (NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") - endforeach() - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_LIB_NAMES") - if("${LANG}" STREQUAL "Fortran") - # For Fortran we only need one of the module or header directories to have *some* support for MPI. - if(NOT MPI_${LANG}_MODULE_DIR) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_F77_HEADER_DIR") - endif() - if(NOT MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_MODULE_DIR") - endif() - else() - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_HEADER_DIR") - endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(mpiincvar IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpiincvar}_INCLUDE_DIR") - endforeach() - endif() - # Append the works variable now. If the settings did not work, this will show up properly. - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") - else() - # If the compiler worked implicitly, use its path as output. - # Should the compiler variable be set, we also require it to work. - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_COMPILER") - if(MPI_${LANG}_COMPILER) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") - endif() - endif() - find_package_handle_standard_args(MPI_${LANG} REQUIRED_VARS ${MPI_${LANG}_REQUIRED_VARS} - VERSION_VAR MPI_${LANG}_VERSION) - - if(DEFINED MPI_${LANG}_VERSION) - if(NOT _MPI_MIN_VERSION OR _MPI_MIN_VERSION VERSION_GREATER MPI_${LANG}_VERSION) - set(_MPI_MIN_VERSION MPI_${LANG}_VERSION) - endif() - endif() - endif() -endforeach() - -unset(_MPI_REQ_VARS) -foreach(LANG IN ITEMS C CXX Fortran) - if((NOT MPI_FIND_COMPONENTS AND CMAKE_${LANG}_COMPILER_LOADED) OR LANG IN_LIST MPI_FIND_COMPONENTS) - list(APPEND _MPI_REQ_VARS "MPI_${LANG}_FOUND") - endif() -endforeach() - -if(MPICXX IN_LIST MPI_FIND_COMPONENTS) - list(APPEND _MPI_REQ_VARS "MPI_MPICXX_FOUND") -endif() - -find_package_handle_standard_args(MPI - REQUIRED_VARS ${_MPI_REQ_VARS} - VERSION_VAR ${_MPI_MIN_VERSION} - HANDLE_COMPONENTS) - -#============================================================================= -# More backward compatibility stuff - -# For compatibility reasons, we also define MPIEXEC -set(MPIEXEC "${MPIEXEC_EXECUTABLE}") - -# Copy over MPI__INCLUDE_PATH from the assembled INCLUDE_DIRS. -foreach(LANG IN ITEMS C CXX Fortran) - if(MPI_${LANG}_FOUND) - set(MPI_${LANG}_INCLUDE_PATH "${MPI_${LANG}_INCLUDE_DIRS}") - unset(MPI_${LANG}_COMPILE_FLAGS) - if(MPI_${LANG}_COMPILE_OPTIONS) - set(MPI_${LANG}_COMPILE_FLAGS "${MPI_${LANG}_COMPILE_OPTIONS}") - endif() - if(MPI_${LANG}_COMPILE_DEFINITIONS) - foreach(_MPI_DEF IN LISTS MPI_${LANG}_COMPILE_DEFINITIONS) - string(APPEND MPI_${LANG}_COMPILE_FLAGS " -D${_MPI_DEF}") - endforeach() - endif() - endif() -endforeach() - -# Bare MPI sans ${LANG} vars are set to CXX then C, depending on what was found. -# This mimics the behavior of the old language-oblivious FindMPI. -set(_MPI_OLD_VARS COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES) -if (MPI_CXX_FOUND) - foreach (var ${_MPI_OLD_VARS}) - set(MPI_${var} ${MPI_CXX_${var}}) - endforeach() -elseif (MPI_C_FOUND) - foreach (var ${_MPI_OLD_VARS}) - set(MPI_${var} ${MPI_C_${var}}) - endforeach() -endif() - -# Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and MPI_EXTRA_LIBRARY, and set them in cache. -if (MPI_LIBRARIES) - list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK) - set(MPI_LIBRARY "${MPI_LIBRARY_WORK}") - unset(MPI_LIBRARY_WORK) -else() - set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND") -endif() - -list(LENGTH MPI_LIBRARIES MPI_NUMLIBS) -if (MPI_NUMLIBS GREATER 1) - set(MPI_EXTRA_LIBRARY_WORK "${MPI_LIBRARIES}") - list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0) - set(MPI_EXTRA_LIBRARY "${MPI_EXTRA_LIBRARY_WORK}") - unset(MPI_EXTRA_LIBRARY_WORK) -else() - set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") -endif() -set(MPI_IGNORE_LEGACY_VARIABLES TRUE) -#============================================================================= - -# unset these vars to cleanup namespace -unset(_MPI_OLD_VARS) -unset(_MPI_PREFIX_PATH) -unset(_MPI_BASE_DIR) -foreach (lang C CXX Fortran) - unset(_MPI_${LANG}_COMPILER_NAMES) -endforeach() - -cmake_policy(POP) diff --git a/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in b/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in deleted file mode 100644 index 30f912c..0000000 --- a/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in +++ /dev/null @@ -1,4 +0,0 @@ - program mpi_ver - @MPI_Fortran_INCLUDE_LINE@ - print *, 'INFO:SUBARRAYS[', MPI_SUBARRAYS_SUPPORTED, ']-ASYNCPROT[', MPI_ASYNC_PROTECTS_NONBLOCKING, ']' - end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/libver_mpi.c b/config/cmake_ext_mod/FindMPI/libver_mpi.c deleted file mode 100644 index be9d19d..0000000 --- a/config/cmake_ext_mod/FindMPI/libver_mpi.c +++ /dev/null @@ -1,19 +0,0 @@ -#include - -#ifdef __cplusplus -#include -#else -#include -#endif - -int main(int argc, char* argv[]) -{ - char mpilibver_str[MPI_MAX_LIBRARY_VERSION_STRING]; - int mpilibver_len; - MPI_Get_library_version(mpilibver_str, &mpilibver_len); -#ifdef __cplusplus - std::puts(mpilibver_str); -#else - puts(mpilibver_str); -#endif -} diff --git a/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in b/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in deleted file mode 100644 index 7938587..0000000 --- a/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in +++ /dev/null @@ -1,7 +0,0 @@ - program mpi_ver - @MPI_Fortran_INCLUDE_LINE@ - character(len=MPI_MAX_LIBRARY_VERSION_STRING) :: mpilibver_str - integer(kind=MPI_INTEGER_KIND) :: ierror, reslen - call MPI_GET_LIBRARY_VERSION(mpilibver_str, reslen, ierror) - print *, mpilibver_str - end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/mpiver.f90.in b/config/cmake_ext_mod/FindMPI/mpiver.f90.in deleted file mode 100644 index a254523..0000000 --- a/config/cmake_ext_mod/FindMPI/mpiver.f90.in +++ /dev/null @@ -1,10 +0,0 @@ - program mpi_ver - @MPI_Fortran_INCLUDE_LINE@ - integer(kind=kind(MPI_VERSION)), parameter :: zero = ichar('0') - character, dimension(17), parameter :: mpiver_str =& - (/ 'I', 'N', 'F', 'O', ':', 'M', 'P', 'I', '-', 'V', 'E', 'R', '[', & - char(zero + MPI_VERSION), & - '.', & - char(zero + MPI_SUBVERSION), ']' /) - print *, mpiver_str - end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/test_mpi.c b/config/cmake_ext_mod/FindMPI/test_mpi.c deleted file mode 100644 index b8a308a..0000000 --- a/config/cmake_ext_mod/FindMPI/test_mpi.c +++ /dev/null @@ -1,37 +0,0 @@ -#include - -#ifdef __cplusplus -#include -#else -#include -#endif - -#if defined(MPI_VERSION) && defined(MPI_SUBVERSION) -const char mpiver_str[] = { 'I', 'N', - 'F', 'O', - ':', 'M', - 'P', 'I', - '-', 'V', - 'E', 'R', - '[', ('0' + MPI_VERSION), - '.', ('0' + MPI_SUBVERSION), - ']', '\0' }; -#endif - -int main(int argc, char* argv[]) -{ -#if defined(MPI_VERSION) && defined(MPI_SUBVERSION) -#ifdef __cplusplus - std::puts(mpiver_str); -#else - puts(mpiver_str); -#endif -#endif -#ifdef TEST_MPI_MPICXX - MPI::MPI_Init(&argc, &argv); - MPI::MPI_Finalize(); -#else - MPI_Init(&argc, &argv); - MPI_Finalize(); -#endif -} diff --git a/config/cmake_ext_mod/FindMPI/test_mpi.f90.in b/config/cmake_ext_mod/FindMPI/test_mpi.f90.in deleted file mode 100644 index 4d43a04..0000000 --- a/config/cmake_ext_mod/FindMPI/test_mpi.f90.in +++ /dev/null @@ -1,6 +0,0 @@ - program hello - @MPI_Fortran_INCLUDE_LINE@ - integer@MPI_Fortran_INTEGER_LINE@ ierror - call MPI_INIT(ierror) - call MPI_FINALIZE(ierror) - end program diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e9430d9..4da8405 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 7864f2d..8c7b8f6 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_F90 C CXX Fortran) if (H5_HAVE_PARALLEL) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 9adf8bd..8b7333a 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 9bf1719..64cf739 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 67d377f..b71a8eb 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index b1cf9d2..979d305 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index eac6df0..54d5976 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index c5b4a72..71e5bb3 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index bf96fba..25158f2 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_CPP_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 28f860f..c0cc09e 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 28b5eb8..b48d147 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_CPP_TEST) #----------------------------------------------------------------------------- diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index dd94da0..79dfee1 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_EXAMPLES ) #----------------------------------------------------------------------------- diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 37c5cc9..7955de2 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index ff0403a..411ceea 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 7a2eff1..82be551 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT(HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 1ec4b93..5c83d03 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 62e8c21..0daa86e 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 1f2ea17..6b3c764 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index ab71a7e..67e0ccb 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_TOOLS C CXX) add_subdirectory (gif2h5) diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index b50bbf7..2697dfd 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_TOOLS_GIF2H5) #----------------------------------------------------------------------------- diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index a1697cd..5de655e 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_TOOLS_H5WATCH) #----------------------------------------------------------------------------- diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index d8cd358..fc057f7 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT ( HDF5_JAVA C Java ) set (CMAKE_MODULE_PATH "${HDF_RESOURCES_DIR};${HDF_RESOURCES_EXT_DIR}") diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt index d43b49f..3d1e30e 100644 --- a/java/examples/CMakeLists.txt +++ b/java/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDFJAVA_EXAMPLES) add_subdirectory (datasets) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index ed4559c..6a90cd1 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDFJAVA_EXAMPLES_DATASETS Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 71cf83e..73111ed 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDFJAVA_EXAMPLES_DATATYPES Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index dc5d834..6b55359 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDFJAVA_EXAMPLES_GROUPS Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 59fe48b..65db3fe 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDFJAVA_EXAMPLES_INTRO Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index 7075d32..0c00923 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT ( HDF5_JAVA_SRC C Java ) #----------------------------------------------------------------------------- diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt index 35b436d..ecff984 100644 --- a/java/src/hdf/CMakeLists.txt +++ b/java/src/hdf/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_JAVA_HDF) add_subdirectory (hdf5lib) diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt index 1f2587e..9506fc1 100644 --- a/java/src/hdf/hdf5lib/CMakeLists.txt +++ b/java/src/hdf/hdf5lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_JAVA_HDF_HDF5 Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 8ab275e..96e7035 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_JAVA_JNI C CXX) set (HDF5_JAVA_JNI_CSRCS diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 329c602..6158055 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_JAVA_TEST Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 923bba3..f30c1b3 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -648,7 +648,7 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 8dd47c2..b516056 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -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.10.1) +cmake_minimum_required (VERSION 3.10) project (HDF5MyApp C CXX) set (LIB_TYPE STATIC) # or SHARED @@ -229,7 +229,7 @@ your application with an installed HDF5 binary. ctest use of HDF5_Examples.cmake and HDF5_Examples_options.cmake ======================================================================== -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d10870d..c506ebb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fd88b5f..b3b6f5c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 3cee808..b1b9ce1 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index e02d3eb..5576f5c 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index addaf2e..db06b9a 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt index 5a25f76..9364658 100644 --- a/tools/src/CMakeLists.txt +++ b/tools/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC) #----------------------------------------------------------------------------- diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 606516f..8423e5a 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5COPY) #----------------------------------------------------------------------------- diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 2ff5817..9e9f1ea 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5DIFF) #----------------------------------------------------------------------------- diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index 491ec4b..1133218 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5DUMP) #----------------------------------------------------------------------------- diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 712dd87..4acc999 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5FC) #----------------------------------------------------------------------------- diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index efb0ad2..d628c9b 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index 9035ed9..59caf44 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5JAM) #----------------------------------------------------------------------------- diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index 71b3d1d..e9ecd44 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5LS) #----------------------------------------------------------------------------- diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index 3fefd24..211c947 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index cc8bee2..7842aa8 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5STAT) #----------------------------------------------------------------------------- diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 78ba238..948c6d4 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_MISC) #----------------------------------------------------------------------------- diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index 54dd5a2..f194d7a 100644 --- a/tools/test/CMakeLists.txt +++ b/tools/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST) #----------------------------------------------------------------------------- diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 2f5f314..1f817fb 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5COPY) #----------------------------------------------------------------------------- diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index cedc932..aae6327 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5DIFF) #----------------------------------------------------------------------------- diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 1941764..6a12f5e 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5DUMP) #----------------------------------------------------------------------------- diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 5287ae0..a27c78a 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5FC) #----------------------------------------------------------------------------- diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 5492363..2cb212a 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index 17dda3c..b623860 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5JAM) #----------------------------------------------------------------------------- diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index e92533f..8549046 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5LS) #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index a606ac6..50eb0af 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index 0d07753..5f645097 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5STAT) #----------------------------------------------------------------------------- diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 178767a..084751a 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_MISC) #----------------------------------------------------------------------------- diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index 5b34c43..50aade4 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_MISC_VDS) #----------------------------------------------------------------------------- diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index b7452e0..5104b90 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_PERFORM ) #----------------------------------------------------------------------------- -- cgit v0.12 From 2d0a0859b22d81cb82d7ff7b6f6481d272d9db71 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 9 Mar 2018 12:45:22 -0600 Subject: Remove obsolete comments --- CMakeLists.txt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ebbeda5..5ac4c60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -671,12 +671,6 @@ if (HDF5_ENABLE_THREADSAFE) endif () endif () -# ----------------------------------------------------------------------- -# wrapper script variables -# -#set (CFLAGS "${C_DEFINES}") -#set (CXXFLAGS "${CXX_DEFINES}") - #----------------------------------------------------------------------------- # Add the HDF5 Library Target to the build #----------------------------------------------------------------------------- @@ -806,11 +800,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for endif () endif () - # ----------------------------------------------------------------------- - # wrapper script variables - # -# set (FCFLAGS "${Fortran_DEFINES}") - add_subdirectory (fortran) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") -- cgit v0.12 From 75db73efc514aff2af63618cc7be357fc4e77cb6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 9 Mar 2018 12:49:26 -0600 Subject: 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 0061910..a70802e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -56,6 +56,16 @@ New Features ------------- - CMake + Change minimum version to 3.10. + + This change removes the need to support a copy of the FindMPI.cmake module, + which has been removed, along with its subfolder in the config/cmake_ext_mod + location. + + (ADB - 2018/03/09) + + - CMake + Add pkg-config file generation Added pkg-config file generation for the C, C++, HL, and HL C++ libraries. -- cgit v0.12 From 4731819b0e4f6e13aff9d040ba89c0bd6d4d67ca Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 9 Mar 2018 20:44:37 -0600 Subject: Improve code Description: Added notes and changed argument to H5Fcreate to clarify the latest situation Platforms tested: Linux/64 (jelly) --- test/gen_bounds.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/test/gen_bounds.c b/test/gen_bounds.c index 9702176..7b670f7 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -267,11 +267,13 @@ error: /*********************************************************************** * gen_latest_latest() creates file "bounds_latest_latest.h5" * - * File contents: - * - Version 3 superblock (triggered by H5Fcreate with H5F_ACC_SWMR_WRITE) - * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) + * NOTE: As of March 2018, latest is 1.10. * - * NOTE: As of Feb 2018, latest is 1.10. + * File contents: + * - Version 3 superblock (NOTE: this can also be triggered by passing in + * H5F_ACC_SWMR_WRITE, in place of H5F_ACC_TRUNC, to H5Fcreate) + * - A chunked dataset with layout version 4, "DS_chunked_layout_4". + * (triggered by H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) * * Return: SUCCEED/FAIL * @@ -279,6 +281,7 @@ error: static herr_t gen_latest_latest(void) { hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ hid_t dcpl = -1; /* Dataset creation property list ID */ hid_t space = -1; /* Dataspace ID */ hid_t dset = -1; /* Dataset ID */ @@ -289,8 +292,16 @@ static herr_t gen_latest_latest(void) int i, j; herr_t ret = SUCCEED; /* Generic return value */ - /* Create file with H5F_ACC_SWMR_WRITE, triggers version 3 superblock */ - fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, H5P_DEFAULT, H5P_DEFAULT); + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; + + /* Set the "use the latest/latest version of the format" bounds + for creating objects in the file */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + TEST_ERROR; + + /* Create the file with version 3 superblock */ + fid = H5Fcreate(FILENAME_L_L, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); if (fid < 0) TEST_ERROR; /* @@ -351,6 +362,8 @@ error: /*********************************************************************** * gen_v18_latest() creates file "bounds_v18_latest.h5" * + * NOTE: As of March 2018, latest is 1.10. + * * File contents: * - Version 2 superblock * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) -- cgit v0.12 From 539f4691fa1cd9e86965106ce69b08d3e18a80a9 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 9 Mar 2018 21:29:28 -0600 Subject: Added C++ wrappers - HDFFV-10149 Description: Added the following wrappers to class H5::Group: + H5Lcreate_soft: // Creates a soft link from link_name to target_name. void newLink(const char *target_name, const char *link_name,...) void newLink(const H5std_string& target_name,...) + H5Lcreate_hard: // Creates a hard link from new_name to curr_name. void newLink(const char *curr_name, const Group& new_loc,...) void newLink(const H5std_string& curr_name, const Group& new_loc,...) // Creates a hard link from new_name to curr_name in same location. void newLink(const char *curr_name, const hid_t same_loc,...) void newLink(const H5std_string& curr_name, const hid_t same_loc,...) + H5Lcopy: // Copy an object from a group of file to another. void copyLink(const char *src_name, const Group& dst,...) void copyLink(const H5std_string& src_name, const Group& dst,...) // Copy an object from a group of file to the same location. void copyLink(const char *src_name, const char *dst_name,...) void copyLink(const H5std_string& src_name,...) + H5Lmove: // Rename an object in a group or file to a new location. void moveLink(const char* src_name, const Group& dst,...) void moveLink(const H5std_string& src_name, const Group& dst,...) // Rename an object in a group or file to the same location. void moveLink(const char* src_name, const char* dst_name,...) void moveLink(const H5std_string& src_name,...) Platforms tested: Linux/64 (jelly) Linux/ppc64 (ostrich) Darwin (osx1010test) --- c++/src/H5Group.cpp | 311 ++++++++++++++++++++++++++++++++++++--- c++/src/H5Group.h | 69 +++++++++ c++/src/H5Location.cpp | 3 + c++/test/tlinks.cpp | 391 +++++++++++++++++++++++++++++++++---------------- 4 files changed, 628 insertions(+), 146 deletions(-) diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index c0e0dd1..aa27a18 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -76,6 +76,297 @@ void Group::closeObjId(hid_t obj_id) const } } +/*** For H5L API ***/ + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\brief Creates a soft link from \a link_name to \a target_name. +///\param target_name - IN: Name of object, can be a non-existing object +///\param link_name - IN: Link name for the target name +///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT +///\param lapl - IN: Link access plist - default to PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the current +/// location. +/// For information on creating a soft link, please refer to the +/// H5Lcreate_soft APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const char *target_name, const char *link_name, + const PropList& lcpl, const PropList& lapl) const +{ + herr_t ret_value = -1; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_soft(target_name, id, link_name, lcpl_id, lapl_id); + if (ret_value < 0) + throwException("newLink", "creating soft link failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\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 target_name and \a link_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const H5std_string& target_name, const H5std_string& + link_name, const PropList& lcpl, const PropList& lapl) const +{ + newLink(target_name.c_str(), link_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\brief Creates a hard link from \a new_name to \a curr_name. +///\param curr_name - IN: Name of the existing object +///\param new_name - IN: New name for the object +///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT +///\param lapl - IN: Link access plist - default to PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the +/// specified location. +/// For information on creating a hard link, please refer to the +/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const char *curr_name, const Group& new_loc, + const char *new_name, const PropList& lcpl, const PropList& lapl) const +{ + herr_t ret_value = -1; + hid_t new_loc_id = new_loc.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_hard(getId(), curr_name, new_loc.getId(), new_name, H5P_DEFAULT, H5P_DEFAULT); + if (ret_value < 0) + throwException("newLink", "creating link failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\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. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const H5std_string& curr_name, const Group& new_loc, + const H5std_string& new_name, const PropList& lcpl, const PropList& lapl) const +{ + newLink(curr_name.c_str(), new_loc, new_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\brief Creates a hard link from \a new_name to \a curr_name - can be +/// used to pass in H5L_SAME_LOC. +///\param curr_name - IN: Name of the existing object +///\param new_name - IN: New name for the object +///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT +///\param lapl - IN: Link access plist - default to PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the +/// specified location. +/// For information on creating a hard link, please refer to the +/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const char *curr_name, const hid_t same_loc, + const char *new_name, const PropList& lcpl, const PropList& lapl) const +{ + herr_t ret_value = -1; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_hard(getId(), curr_name, same_loc, new_name, H5P_DEFAULT, H5P_DEFAULT); + + if (ret_value < 0) + throwException("newLink", "creating link failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\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. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const H5std_string& curr_name, const hid_t same_loc, + const H5std_string& new_name, const PropList& lcpl, const PropList& lapl) const +{ + newLink(curr_name.c_str(), same_loc, new_name.c_str(), lcpl, lapl); +} + + +//-------------------------------------------------------------------------- +// Function: Group::copyLink +///\brief Copies a link from one location to another. +///\param src - IN: Source location +///\param src_name - IN: Original name +///\param dst - IN: Destination location +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default PropList::DEFAULT +///\param lapl - IN: Link access plist - default PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::copyLink(const char *src_name, + const Group& dst, const char *dst_name, const PropList& lcpl, + const PropList& lapl) const +{ + herr_t ret_value; + hid_t dst_id = dst.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcopy(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); + if(ret_value < 0) + throwException("copyLink", "H5Lcopy failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::copyLink +///\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_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::copyLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, const PropList& lcpl, + const PropList& lapl) const +{ + copyLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: Group::copyLink +///\brief Copies a link to the same location. +///\param src - IN: Source location +///\param src_name - IN: Original name +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default PropList::DEFAULT +///\param lapl - IN: Link access plist - default PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::copyLink(const char *src_name, + const char *dst_name, const PropList& lcpl, + const PropList& lapl) const +{ + herr_t ret_value; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcopy(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); + if(ret_value < 0) + throwException("copyLink", "H5Lcopy H5L_SAME_LOC failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::copyLink +///\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_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::copyLink(const H5std_string& src_name, + const H5std_string& dst_name, const PropList& lcpl, + const PropList& lapl) const +{ + copyLink(src_name.c_str(), dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: Group::moveLink +///\brief Renames an object in a group/file and moves it to a new location. +///\param src - IN: Source location +///\param src_name - IN: Original name +///\param dst - IN: Destination location +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default PropList::DEFAULT +///\param lapl - IN: Link access plist - default PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\note +/// Exercise care in moving groups as it is possible to render +/// data in a file inaccessible with Group::moveLink. Please refer +/// to the Group Interface in the HDF5 User's Guide for details. +// March, 2018 +//-------------------------------------------------------------------------- +void Group::moveLink(const char* src_name, const Group& dst, const char* dst_name, const PropList& lcpl, const PropList& lapl) const +{ + herr_t ret_value; + hid_t dst_id = dst.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lmove(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); + if (ret_value < 0) + throwException("moveLink", "H5Lmove failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::moveLink +///\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_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::moveLink(const H5std_string& src_name, const Group& dst, const H5std_string& dst_name, const PropList& lcpl, const PropList& lapl) const +{ + moveLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: Group::moveLink +///\brief Renames an object in a group or file to the same location. +///\param src - IN: Source location +///\param src_name - IN: Original name +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default PropList::DEFAULT +///\param lapl - IN: Link access plist - default PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\note +/// Exercise care in moving groups as it is possible to render +/// data in a file inaccessible with Group::moveLink. Please refer +/// to the Group Interface in the HDF5 User's Guide for details. +// March, 2018 +//-------------------------------------------------------------------------- +void Group::moveLink(const char* src_name, const char* dst_name, const PropList& lcpl, const PropList& lapl) const +{ + herr_t ret_value; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lmove(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); + if (ret_value < 0) + throwException("moveLink", "H5Lmove H5L_SAME_LOC failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::moveLink +///\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_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::moveLink(const H5std_string& src_name, const H5std_string& dst_name, const PropList& lcpl, const PropList& lapl) const +{ + moveLink(src_name.c_str(), H5L_SAME_LOC, dst_name.c_str(), lcpl, lapl); +} + +/*** End of H5L API section ***/ + //-------------------------------------------------------------------------- // Function: Group::getLocId // Purpose: Get the id of this group @@ -123,26 +414,6 @@ 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 objec -// param attr - IN: Specifying location where the referenced object is i -// 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 -// Mar, 2017 -// Removed in 1.10.1 because H5Location is Attribute's baseclass -// now. -BMR -//-------------------------------------------------------------------------- -/* Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) -{ - id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); -} - */ - -//-------------------------------------------------------------------------- // Function: Group::getNumObjs ///\brief Returns the number of objects in this group. ///\return Number of objects diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index b3a9007..d95d996 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -50,6 +50,75 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // Closes an object opened by getObjId(). void closeObjId(hid_t obj_id) const; + /*** For H5L API ***/ + + // Creates a soft link from link_name to target_name. + void newLink(const char *target_name, const char *link_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void newLink(const H5std_string& target_name, + const H5std_string& link_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Creates a hard link from new_name to curr_name. + void newLink(const char *curr_name, + const Group& new_loc, const char *new_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void newLink(const H5std_string& curr_name, + const Group& new_loc, const H5std_string& new_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Creates a hard link from new_name to curr_name in same location. + void newLink(const char *curr_name, + const hid_t same_loc, const char *new_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void newLink(const H5std_string& curr_name, + const hid_t same_loc, const H5std_string& new_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Copy an object from a group of file to another. + void copyLink(const char *src_name, + const Group& dst, const char *dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void copyLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Copy an object from a group of file to the same location. + void copyLink(const char *src_name, const char *dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void copyLink(const H5std_string& src_name, + const H5std_string& dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Rename an object in a group or file to a new location. + void moveLink(const char* src_name, + const Group& dst, const char* dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void moveLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Rename an object in a group or file to the same location. + void moveLink(const char* src_name, const char* dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void moveLink(const H5std_string& src_name, + const H5std_string& dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + // default constructor Group(); diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 95c96ad..3ca080e 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -951,6 +951,9 @@ DataSet H5Location::openDataSet(const H5std_string& name) const // Programmer Binh-Minh Ribler - 2000 // Modification // 2007: QAK modified to use H5L APIs - BMR +// Mar 2018: Inadequate functionality, new hard link is only in +// H5L_SAME_LOC. This function will be retired in favor of +// its replacement, Group::newLink(). - BMR //-------------------------------------------------------------------------- void H5Location::link(H5L_type_t link_type, const char* curr_name, const char* new_name) const { diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index e348d64..93bd0266 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -323,11 +323,9 @@ static const char *FILENAME[] = { * Purpose Test building a file with assorted links. * * Return Success: 0 - * * Failure: -1 * - * Programmer Binh-Minh Ribler - * October 16, 2009 + * October 16, 2009 *------------------------------------------------------------------------- */ static void test_basic_links(hid_t fapl_id, hbool_t new_format) @@ -438,16 +436,267 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) /*------------------------------------------------------------------------- + * Function: test_move + * + * Purpose: Tests wrappers of H5Lmove() + * + * Return: Success: 0 + * Failure: number of errors + * March, 2018 + *------------------------------------------------------------------------- + */ +const H5std_string GROUP1NAME("First_group"); +const H5std_string GROUP2NAME("Second_group"); +static void +test_move(hid_t fapl_id, hbool_t new_format) +{ + char filename[1024]; + + if(new_format) + SUBTEST("Group::moveLink (w/new group format)") + else + SUBTEST("Group::moveLink") + + try + { + // Create two new files + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + H5File file_a(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + h5_fixname(FILENAME[1], fapl_id, filename, sizeof filename); + H5File file_b(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + + // Create groups in first file + Group grp_1(file_a.createGroup(GROUP1NAME)); + Group grp_2(file_a.createGroup(GROUP2NAME)); + Group grp_move(grp_1.createGroup("group_move")); + + // Create hard and soft links + grp_1.link(H5L_TYPE_HARD, "group_move", "hard"); + grp_2.link(H5L_TYPE_SOFT, "/First_group/group_copy", "soft"); + + // Move a group across files, should fail + try { + grp_1.moveLink("group_move", file_b, "group_new_name"); + + // Should throw an exception but didn't + H5_FAILED(); + cerr << " Group group_move should not be moved across files" << endl; + } catch (Exception& E) { + // expected + } + + // Move a soft link across files, should succeed + grp_2.moveLink("soft", file_b, "soft_new_name"); + if(file_b.exists("soft_new_name") != TRUE) + throw InvalidActionException("H5File::exists", "grp1/soft doesn't exist"); + + // Move a group across groups in the same file while renaming it + grp_1.moveLink("group_move", grp_2, "group_new_name"); + + // Open the group just moved to the new location. */ + Group moved_grp = grp_2.openGroup("group_new_name"); + moved_grp.close(); + + // Verify that the group is no longer in the original location + try { + moved_grp = grp_1.openGroup("group_move"); + + // Should throw an exception but didn't + H5_FAILED(); + cerr << " Group group_move should not be in original location" << endl; + } catch (Exception& E) { + // expected + } + + // Use H5Lmove to rename a group without moving it + H5std_string new_name("group_new_name"); + H5std_string newer_name("group_newer_name"); + grp_2.moveLink(new_name, newer_name); + + // Open the group + moved_grp = grp_2.openGroup("group_newer_name"); + moved_grp.close(); + + // Use H5Lmove to move a group without renaming it + grp_2.moveLink(newer_name, grp_1, newer_name); + + // Open the group + moved_grp = grp_1.openGroup("group_newer_name"); + moved_grp.close(); + + // Move the group while giving long paths + file_a.moveLink("/First_group/group_newer_name", grp_2, "/Second_group/group_newest_name"); + + // Open the group just moved to the new location + moved_grp = grp_2.openGroup("group_newest_name"); + moved_grp.close(); + + // Verify that the groups are not in previous locations + try { + moved_grp = grp_1.openGroup("group_newer_name"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_newer_name should not be in GROUP1NAME" << endl; + } catch (Exception& E) { + // expected + } + try { + moved_grp = grp_2.openGroup("group_newer_name"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_newer_name should not be in GROUP2NAME" << endl; + } catch (Exception& E) { + // expected + } + try { + moved_grp = grp_2.openGroup("group_new_name"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_new_name should not be in GROUP2NAME" << endl; + } catch (Exception& E) { + // expected + } + try { + moved_grp = grp_1.openGroup("group_copy"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_copy should not be in GROUP1NAME" << endl; + } catch (Exception& E) { + // expected + } + PASSED(); + } // end of try block + catch (Exception& E) + { + issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} + +/*------------------------------------------------------------------------- + * Function: test_copy + * + * Purpose: Tests wrappers of H5Lcopy() + * + * Return: Success: 0 + * Failure: number of errors + * March, 2018 + *------------------------------------------------------------------------- + */ +static void test_copy(hid_t fapl_id, hbool_t new_format) +{ + char filename[1024]; + + if(new_format) + SUBTEST("Group::copyLink (w/new group format)") + else + SUBTEST("Group::copyLink") + + try + { + // Create two new files + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + H5File file_a(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + h5_fixname(FILENAME[1], fapl_id, filename, sizeof filename); + H5File file_b(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + + // Create groups in first file + Group grp_1(file_a.createGroup(GROUP1NAME)); + Group grp_2(file_a.createGroup(GROUP2NAME)); + Group grp_move(grp_1.createGroup("group_copy")); + + // Create hard and soft links + grp_1.newLink("group_copy", H5L_SAME_LOC, "hard"); + grp_2.newLink("/First_group/group_copy", "soft"); + + // Copy a group across files, should fail + try { + grp_1.copyLink("group_copy", file_b, "group_new_name"); + } catch (Exception& E) { + // expected + } + + // Copy a soft link across files, should succeed + grp_2.copyLink("soft", file_b, "soft_new_name"); + if (file_b.exists("soft_new_name") != TRUE) + throw InvalidActionException("H5File::exists", "soft_new_name doesn't exist"); + + // Move a group across groups in the same file while renaming it + H5std_string copy_name("group_copy"); + H5std_string new_name("group_new_name"); + grp_1.copyLink(copy_name, grp_2, new_name); + + // Open the group just moved to the new location. + Group moved_grp(grp_2.openGroup("group_new_name")); + moved_grp.close(); + + // Verify that the group is also in the original location + moved_grp = grp_1.openGroup("group_copy"); + moved_grp.close(); + + // Create a group in the same location with a different name + grp_2.copyLink("group_new_name", "group_newer_name"); + + // Open the group + moved_grp = grp_2.openGroup("group_newer_name"); + moved_grp.close(); + + // Verify that the group is also in the original location + moved_grp = grp_2.openGroup("group_new_name"); + moved_grp.close(); + + // Use H5Lcopy to copy to a different location with the same name + grp_2.copyLink("group_newer_name", grp_1, "group_newer_name"); + + // Open the group + moved_grp = grp_1.openGroup("group_newer_name"); + moved_grp.close(); + + // Verify that the group is still in the previous location + moved_grp = grp_2.openGroup("group_new_name"); + moved_grp.close(); + + // Copy the group while giving long paths + file_a.copyLink("/First_group/group_newer_name", grp_2, "/Second_group/group_newest_name"); + + // Open the newest group just moved to the new location + moved_grp = grp_2.openGroup("group_newest_name"); + moved_grp.close(); + + // Verify that the group is still in all previous original locations + moved_grp = grp_1.openGroup("group_newer_name"); + moved_grp.close(); + + moved_grp = grp_2.openGroup("group_newer_name"); + moved_grp.close(); + + moved_grp = grp_2.openGroup("group_new_name"); + moved_grp.close(); + + moved_grp = grp_1.openGroup("group_copy"); + moved_grp.close(); + + PASSED(); + } // end of try block + catch (Exception& E) + { + issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} + + +/*------------------------------------------------------------------------- * Function: test_num_links * * Purpose Test setting and getting limit of number of links * * Return Success: 0 - * * Failure: -1 * - * Programmer Binh-Minh Ribler - * October 16, 2009 + * October 16, 2009 *------------------------------------------------------------------------- */ static void test_num_links(hid_t fapl_id, hbool_t new_format) @@ -491,8 +740,7 @@ static void test_num_links(hid_t fapl_id, hbool_t new_format) * * Return None * - * Programmer Binh-Minh Ribler - * October 16, 2009 + * October 16, 2009 *------------------------------------------------------------------------- */ extern "C" @@ -516,9 +764,10 @@ void test_links() 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 */ + /* 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"); + throw Exception("test_links", "H5Pset_libver_bounds failed"); /* Loop over using new group format */ for(new_format = FALSE; new_format <= TRUE; new_format++) @@ -534,124 +783,10 @@ void test_links() /* 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_move(my_fapl, new_format); - nerrors += test_copy(my_fapl, new_format); - nerrors += test_move_preserves(my_fapl, new_format); -#ifndef H5_NO_DEPRECATED_SYMBOLS - nerrors += test_deprec(my_fapl, new_format); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - nerrors += external_link_root(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_path(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_mult(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_self(envval, my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_pingpong(envval, my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_toomany(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_dangling(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_recursive(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_query(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_unlink_compact(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_unlink_dense(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_move(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_ride(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_closing(envval, my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_endian(new_format) < 0 ? 1 : 0; - nerrors += external_link_strong(my_fapl, new_format) < 0 ? 1 : 0; - - /* tests for external link */ - nerrors += external_link_env(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_prefix(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_abs_mainpath(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_rel_mainpath(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_cwd(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_abstar(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_abstar_cur(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_reltar(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_chdir(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_set_elink_fapl1(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_set_elink_fapl2(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_set_elink_fapl3(new_format) < 0 ? 1 : 0; - nerrors += external_set_elink_acc_flags(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_set_elink_cb(my_fapl, new_format) < 0 ? 1 : 0; - -#ifdef H5_HAVE_WINDOW_PATH - nerrors += external_link_win1(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win2(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win3(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win4(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win5(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win6(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win7(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win8(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win9(my_fapl, new_format) < 0 ? 1 : 0; -#endif - /* These tests assume that external links are a form of UD links, - * so assume that everything that passed for external links - * above has already been tested for UD links. - */ - if(new_format == TRUE) { - nerrors += ud_hard_links(fapl2) < 0 ? 1 : 0; /* requires new format groups */ - nerrors += ud_link_reregister(fapl2) < 0 ? 1 : 0; /* requires new format groups */ - } /* end if */ - - nerrors += ud_callbacks(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += ud_link_errors(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += lapl_udata(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += lapl_nlinks(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += linkinfo(my_fapl, new_format) < 0 ? 1 : 0; - - /* Misc. extra tests, useful for both new & old format files */ - nerrors += link_visit(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += link_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += obj_visit(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += obj_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += obj_visit_stop(my_fapl, new_format) < 0 ? 1 : 0; - - /* Keep this test last, it's testing files that are used above */ - /* 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 + test_move(my_fapl_id, new_format); + test_copy(my_fapl_id, new_format); } /* end for */ -#if 0 - /* New group revision feature tests */ - nerrors += corder_create_empty(fapl2) < 0 ? 1 : 0; -/* XXX: when creation order indexing is fully working, go back and add checks -* to these tests to make certain that the creation order values are -* correct. -*/ - nerrors += corder_create_compact(fapl2) < 0 ? 1 : 0; - nerrors += corder_create_dense(fapl2) < 0 ? 1 : 0; - nerrors += corder_transition(fapl2) < 0 ? 1 : 0; - nerrors += corder_delete(fapl2) < 0 ? 1 : 0; - nerrors += link_info_by_idx(fapl2) < 0 ? 1 : 0; - nerrors += delete_by_idx(fapl2) < 0 ? 1 : 0; - nerrors += link_iterate(fapl2) < 0 ? 1 : 0; - nerrors += open_by_idx(fapl2) < 0 ? 1 : 0; - nerrors += object_info(fapl2) < 0 ? 1 : 0; - nerrors += group_info(fapl2) < 0 ? 1 : 0; - nerrors += timestamps(fapl2) < 0 ? 1 : 0; - - /* Test new API calls on old-style groups */ - nerrors += link_info_by_idx_old(fapl) < 0 ? 1 : 0; - nerrors += delete_by_idx_old(fapl) < 0 ? 1 : 0; - nerrors += link_iterate_old(fapl) < 0 ? 1 : 0; - nerrors += open_by_idx_old(fapl) < 0 ? 1 : 0; - nerrors += object_info_old(fapl) < 0 ? 1 : 0; - nerrors += group_info_old(fapl) < 0 ? 1 : 0; - -#endif /* Close 2nd FAPL */ H5Pclose(fapl2_id); @@ -683,5 +818,9 @@ extern "C" void cleanup_links() { HDremove(FILENAME[0]); + HDremove(FILENAME[1]); } + + + -- cgit v0.12 From 801191b4c374adc462345f2c068f1cfc6f4adf97 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 9 Mar 2018 21:38:59 -0600 Subject: Upated cpp doc. --- c++/src/cpp_doc_config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 6a9f171..3943f7b 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = "1.11.2" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- cgit v0.12 From 4823abf3ee0d9df1c3f23ae7e36ce4d1d146afd6 Mon Sep 17 00:00:00 2001 From: mainzer Date: Sun, 11 Mar 2018 22:32:09 -0500 Subject: Removed commented out code from H5FDmpio.c, H5FDprivate.h and H5Fint.c Tested parallel (debug and production) and serial (production) --- src/H5FDmpio.c | 88 ------------------------------------------------------- src/H5FDprivate.h | 2 -- src/H5Fint.c | 2 -- 3 files changed, 92 deletions(-) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 3fe6ed9..08b1a3f 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -56,20 +56,6 @@ static char H5FD_mpi_native_g[] = "native"; * library to determine whether the file is empty, truncated, or okay. The MPIO * driver doesn't bother to keep it updated since it's an expensive operation. */ -#if 0 /* original version */ /* JRM */ -typedef struct H5FD_mpio_t { - H5FD_t pub; /*public stuff, must be first */ - MPI_File f; /*MPIO file handle */ - MPI_Comm comm; /*communicator */ - MPI_Info info; /*file information */ - int mpi_rank; /* This process's rank */ - int mpi_size; /* Total number of processes */ - haddr_t eof; /*end-of-file marker */ - haddr_t eoa; /*end-of-address marker */ - haddr_t last_eoa; /* Last known end-of-address marker */ - haddr_t local_eof; /* Local end-of-file address for each process */ -} H5FD_mpio_t; -#else /* modified version */ /* JRM */ typedef struct H5FD_mpio_t { H5FD_t pub; /*public stuff, must be first */ MPI_File f; /*MPIO file handle */ @@ -88,7 +74,6 @@ typedef struct H5FD_mpio_t { /* as soon as be make the necessary */ /* VFD API change. */ } H5FD_mpio_t; -#endif /* modified version */ /* JRM */ /* Private Prototypes */ @@ -1060,10 +1045,8 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, file->eof = H5FD_mpi_MPIOff_to_haddr(size); file->local_eof = file->eof; -#if 1 /* JRM */ /* Mark initial barriers in H5FD_mpio_truncate() as necessary */ file->do_pre_trunc_barrier = TRUE; -#endif /* JRM */ /* Set return value */ ret_value=(H5FD_t*)file; @@ -1956,75 +1939,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_mpio_flush() */ -#if 0 /* original version */ - -/*------------------------------------------------------------------------- - * Function: H5FD_mpio_truncate - * - * Purpose: Make certain the file's size matches it's allocated size - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * January 31, 2008 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) -{ - H5FD_mpio_t *file = (H5FD_mpio_t*)_file; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#ifdef H5FDmpio_DEBUG - if(H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "Entering %s\n", FUNC); -#endif - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); - - /* Extend the file to make sure it's large enough, then sync. - * Unfortunately, keeping track of EOF is an expensive operation, so - * we can't just check whether EOFeoa > file->last_eoa) { - int mpi_code; /* mpi return code */ - MPI_Offset mpi_off; - - if(H5FD_mpi_haddr_to_MPIOff(file->eoa, &mpi_off) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "cannot convert from haddr_t to MPI_Offset") - - /* Extend the file's size */ - if(MPI_SUCCESS != (mpi_code = MPI_File_set_size(file->f, mpi_off))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code) - - /* Don't let any proc return until all have extended the file. - * (Prevents race condition where some processes go ahead and write - * more data to the file before all the processes have finished making - * it the shorter length, potentially truncating the file and dropping - * the new data written) - */ - if(MPI_SUCCESS != (mpi_code = MPI_Barrier(file->comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code) - - /* Update the 'last' eoa value */ - file->last_eoa = file->eoa; - } /* end if */ - -done: -#ifdef H5FDmpio_DEBUG - if(H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "Leaving %s\n", FUNC); -#endif - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mpio_truncate() */ - -#else /* modified versin */ - /*------------------------------------------------------------------------- * Function: H5FD_mark_pre_trunc_barrier_unecessary @@ -2192,8 +2106,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_mpio_truncate() */ -#endif /* modified version */ - /*------------------------------------------------------------------------- * Function: H5FD_mpio_mpi_rank diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index f7be327..f7cd931 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -203,9 +203,7 @@ H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file); H5_DLL int H5FD_mpi_get_size(const H5FD_t *file); H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file); H5_DLL herr_t H5FD_get_mpi_info(H5FD_t *file, void** file_info); -#if 1 /* JRM */ H5_DLL void H5FD_mpio_mark_pre_trunc_barrier_unecessary(H5FD_t *_file); -#endif /* JRM */ #endif /* H5_HAVE_PARALLEL */ #endif /* !_H5FDprivate_H */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 135d878..cc5931a 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1788,7 +1788,6 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") /* Truncate the file to the current allocated size */ -#if 1 /* JRM */ #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { /* Since we just returned from a call to H5AC_flush(), we just @@ -1798,7 +1797,6 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi H5FD_mpio_mark_pre_trunc_barrier_unecessary(f->shared->lf); } #endif /* H5_HAVE_PARALLEL */ -#endif /* JRM */ if(H5FD_truncate(f->shared->lf, meta_dxpl_id, closing) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") -- cgit v0.12 From 3494282d42bf6147b32a10162353920f9e8b5a6a Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 11 Mar 2018 23:36:48 -0500 Subject: HDFFV-10149 continued Description: - Moved the new wrappers committed on Mar 9: 43158f3bb352f374c31556a5d0dc463a09e0b32e to H5Location and renamed some of them for overloading. This is because the loc_id in the C APIs can be file, group, dataset, named datatype, and attribute. Previous implementation was wrong following some inaccurate C API reference manual. - Only the following wrappers are modified or added: + H5Lcreate_soft: changed name from newLink to link // Creates a soft link from link_name to target_name. void link(const char *target_name, const char *link_name,...) void link(const H5std_string& target_name,...) + H5Lcreate_hard: changed name from newLink to link // Creates a hard link from new_name to curr_name. void link(const char *curr_name, const Group& new_loc,...) void link(const H5std_string& curr_name, const Group& new_loc,...) // Creates a hard link from new_name to curr_name in same location. void link(const char *curr_name, const hid_t same_loc,...) void link(const H5std_string& curr_name, const hid_t same_loc,...) + H5Ldelete: modified existing functions to add 2nd argument // Removes the specified link from this location. void unlink(const char *link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) void unlink(const H5std_string& link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) - copyLink and moveLink were only moved from Group to H5Location, no change - Added class LinkCreatPropList - Added overloaded functions H5Location::createGroup to take a link creation property list Group createGroup(const char* name, const LinkCreatPropList& lcpl) Group createGroup(const H5std_string& name, const LinkCreatPropList& lcpl) - Added wrapper for H5Lget_info() to H5Location H5L_info_t getLinkInfo(const H5std_string& link_name,...) Platforms tested: Linux/64 (jelly) Linux/ppc64 (ostrich) Darwin (osx1010test) --- c++/src/H5AbstractDs.cpp | 1 + c++/src/H5ArrayType.cpp | 1 + c++/src/H5AtomType.cpp | 1 + c++/src/H5Attribute.cpp | 1 + c++/src/H5CommonFG.cpp | 1 + c++/src/H5CompType.cpp | 1 + c++/src/H5Cpp.h | 1 + c++/src/H5DataSet.cpp | 1 + c++/src/H5DataType.cpp | 3 + c++/src/H5DcreatProp.cpp | 1 + c++/src/H5EnumType.cpp | 1 + c++/src/H5File.cpp | 1 + c++/src/H5FloatType.cpp | 1 + c++/src/H5Group.cpp | 292 +----------------------------- c++/src/H5Group.h | 69 -------- c++/src/H5IntType.cpp | 1 + c++/src/H5LcreatProp.cpp | 146 +++++++++++++++ c++/src/H5LcreatProp.h | 71 ++++++++ c++/src/H5Library.cpp | 1 + c++/src/H5Location.cpp | 451 +++++++++++++++++++++++++++++++++++++++++++---- c++/src/H5Location.h | 86 ++++++++- c++/src/H5Object.cpp | 1 + c++/src/H5PredType.cpp | 1 + c++/src/H5StrType.cpp | 1 + c++/src/H5VarLenType.cpp | 1 + c++/src/Makefile.am | 34 ++-- c++/test/tlinks.cpp | 127 ++++++++++++- 27 files changed, 875 insertions(+), 422 deletions(-) create mode 100644 c++/src/H5LcreatProp.cpp create mode 100644 c++/src/H5LcreatProp.h diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index b900b90..823e873 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -22,6 +22,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 76e7532..49c31d2 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -19,6 +19,7 @@ #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 4e19850..5c24cf9 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -19,6 +19,7 @@ #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index cbf3029..d90857f 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -27,6 +27,7 @@ #include "H5FcreatProp.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index af5ba0e..979816b 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -22,6 +22,7 @@ #include "H5DxferProp.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index d357fbc..28aa6cd 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -20,6 +20,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5Cpp.h b/c++/src/H5Cpp.h index 09914e8..b9da80a 100644 --- a/c++/src/H5Cpp.h +++ b/c++/src/H5Cpp.h @@ -25,6 +25,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 9e0f9ff..fb9b57e 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -28,6 +28,7 @@ #include "H5OcreatProp.h" #include "H5DxferProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 4b06c0a..032937d 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -28,6 +28,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" @@ -244,6 +245,7 @@ void DataType::copy(const DataSet& dset) throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); } +#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: DataType::p_decode // Purpose Returns an id of a type by decoding the binary object @@ -272,6 +274,7 @@ hid_t DataType::p_decode() const return(encoded_dtype_id); } } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: DataType::decode diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 2946730..6ed77e3 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -20,6 +20,7 @@ #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 02ae5a3..91866d7 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -22,6 +22,7 @@ #include "H5DcreatProp.h" #include "H5DxferProp.h" #include "H5DataSpace.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 57ee4d5..2c7ac51 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -27,6 +27,7 @@ #include "H5OcreatProp.h" #include "H5DxferProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 794c27d..9703149 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -20,6 +20,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index aa27a18..c4c7017 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -27,6 +27,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" @@ -76,297 +77,6 @@ void Group::closeObjId(hid_t obj_id) const } } -/*** For H5L API ***/ - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\brief Creates a soft link from \a link_name to \a target_name. -///\param target_name - IN: Name of object, can be a non-existing object -///\param link_name - IN: Link name for the target name -///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT -///\param lapl - IN: Link access plist - default to PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -///\par Description -/// Note that both names are interpreted relative to the current -/// location. -/// For information on creating a soft link, please refer to the -/// H5Lcreate_soft APIs in the HDF5 C Reference Manual. -// March 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const char *target_name, const char *link_name, - const PropList& lcpl, const PropList& lapl) const -{ - herr_t ret_value = -1; - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lcreate_soft(target_name, id, link_name, lcpl_id, lapl_id); - if (ret_value < 0) - throwException("newLink", "creating soft link failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\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 target_name and \a link_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const H5std_string& target_name, const H5std_string& - link_name, const PropList& lcpl, const PropList& lapl) const -{ - newLink(target_name.c_str(), link_name.c_str(), lcpl, lapl); -} - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\brief Creates a hard link from \a new_name to \a curr_name. -///\param curr_name - IN: Name of the existing object -///\param new_name - IN: New name for the object -///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT -///\param lapl - IN: Link access plist - default to PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -///\par Description -/// Note that both names are interpreted relative to the -/// specified location. -/// For information on creating a hard link, please refer to the -/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. -// March 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const char *curr_name, const Group& new_loc, - const char *new_name, const PropList& lcpl, const PropList& lapl) const -{ - herr_t ret_value = -1; - hid_t new_loc_id = new_loc.getId(); - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lcreate_hard(getId(), curr_name, new_loc.getId(), new_name, H5P_DEFAULT, H5P_DEFAULT); - if (ret_value < 0) - throwException("newLink", "creating link failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\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. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const H5std_string& curr_name, const Group& new_loc, - const H5std_string& new_name, const PropList& lcpl, const PropList& lapl) const -{ - newLink(curr_name.c_str(), new_loc, new_name.c_str(), lcpl, lapl); -} - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\brief Creates a hard link from \a new_name to \a curr_name - can be -/// used to pass in H5L_SAME_LOC. -///\param curr_name - IN: Name of the existing object -///\param new_name - IN: New name for the object -///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT -///\param lapl - IN: Link access plist - default to PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -///\par Description -/// Note that both names are interpreted relative to the -/// specified location. -/// For information on creating a hard link, please refer to the -/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. -// March 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const char *curr_name, const hid_t same_loc, - const char *new_name, const PropList& lcpl, const PropList& lapl) const -{ - herr_t ret_value = -1; - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lcreate_hard(getId(), curr_name, same_loc, new_name, H5P_DEFAULT, H5P_DEFAULT); - - if (ret_value < 0) - throwException("newLink", "creating link failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\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. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const H5std_string& curr_name, const hid_t same_loc, - const H5std_string& new_name, const PropList& lcpl, const PropList& lapl) const -{ - newLink(curr_name.c_str(), same_loc, new_name.c_str(), lcpl, lapl); -} - - -//-------------------------------------------------------------------------- -// Function: Group::copyLink -///\brief Copies a link from one location to another. -///\param src - IN: Source location -///\param src_name - IN: Original name -///\param dst - IN: Destination location -///\param dst_name - IN: New name -///\param lcpl - IN: Link creation plist - default PropList::DEFAULT -///\param lapl - IN: Link access plist - default PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::copyLink(const char *src_name, - const Group& dst, const char *dst_name, const PropList& lcpl, - const PropList& lapl) const -{ - herr_t ret_value; - hid_t dst_id = dst.getId(); - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lcopy(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); - if(ret_value < 0) - throwException("copyLink", "H5Lcopy failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::copyLink -///\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_name and \a dst_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::copyLink(const H5std_string& src_name, - const Group& dst, const H5std_string& dst_name, const PropList& lcpl, - const PropList& lapl) const -{ - copyLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); -} - -//-------------------------------------------------------------------------- -// Function: Group::copyLink -///\brief Copies a link to the same location. -///\param src - IN: Source location -///\param src_name - IN: Original name -///\param dst_name - IN: New name -///\param lcpl - IN: Link creation plist - default PropList::DEFAULT -///\param lapl - IN: Link access plist - default PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::copyLink(const char *src_name, - const char *dst_name, const PropList& lcpl, - const PropList& lapl) const -{ - herr_t ret_value; - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lcopy(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); - if(ret_value < 0) - throwException("copyLink", "H5Lcopy H5L_SAME_LOC failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::copyLink -///\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_name and \a dst_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::copyLink(const H5std_string& src_name, - const H5std_string& dst_name, const PropList& lcpl, - const PropList& lapl) const -{ - copyLink(src_name.c_str(), dst_name.c_str(), lcpl, lapl); -} - -//-------------------------------------------------------------------------- -// Function: Group::moveLink -///\brief Renames an object in a group/file and moves it to a new location. -///\param src - IN: Source location -///\param src_name - IN: Original name -///\param dst - IN: Destination location -///\param dst_name - IN: New name -///\param lcpl - IN: Link creation plist - default PropList::DEFAULT -///\param lapl - IN: Link access plist - default PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -///\note -/// Exercise care in moving groups as it is possible to render -/// data in a file inaccessible with Group::moveLink. Please refer -/// to the Group Interface in the HDF5 User's Guide for details. -// March, 2018 -//-------------------------------------------------------------------------- -void Group::moveLink(const char* src_name, const Group& dst, const char* dst_name, const PropList& lcpl, const PropList& lapl) const -{ - herr_t ret_value; - hid_t dst_id = dst.getId(); - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lmove(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); - if (ret_value < 0) - throwException("moveLink", "H5Lmove failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::moveLink -///\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_name and \a dst_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::moveLink(const H5std_string& src_name, const Group& dst, const H5std_string& dst_name, const PropList& lcpl, const PropList& lapl) const -{ - moveLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); -} - -//-------------------------------------------------------------------------- -// Function: Group::moveLink -///\brief Renames an object in a group or file to the same location. -///\param src - IN: Source location -///\param src_name - IN: Original name -///\param dst_name - IN: New name -///\param lcpl - IN: Link creation plist - default PropList::DEFAULT -///\param lapl - IN: Link access plist - default PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -///\note -/// Exercise care in moving groups as it is possible to render -/// data in a file inaccessible with Group::moveLink. Please refer -/// to the Group Interface in the HDF5 User's Guide for details. -// March, 2018 -//-------------------------------------------------------------------------- -void Group::moveLink(const char* src_name, const char* dst_name, const PropList& lcpl, const PropList& lapl) const -{ - herr_t ret_value; - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lmove(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); - if (ret_value < 0) - throwException("moveLink", "H5Lmove H5L_SAME_LOC failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::moveLink -///\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_name and \a dst_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::moveLink(const H5std_string& src_name, const H5std_string& dst_name, const PropList& lcpl, const PropList& lapl) const -{ - moveLink(src_name.c_str(), H5L_SAME_LOC, dst_name.c_str(), lcpl, lapl); -} - -/*** End of H5L API section ***/ - //-------------------------------------------------------------------------- // Function: Group::getLocId // Purpose: Get the id of this group diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index d95d996..b3a9007 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -50,75 +50,6 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // Closes an object opened by getObjId(). void closeObjId(hid_t obj_id) const; - /*** For H5L API ***/ - - // Creates a soft link from link_name to target_name. - void newLink(const char *target_name, const char *link_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void newLink(const H5std_string& target_name, - const H5std_string& link_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Creates a hard link from new_name to curr_name. - void newLink(const char *curr_name, - const Group& new_loc, const char *new_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void newLink(const H5std_string& curr_name, - const Group& new_loc, const H5std_string& new_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Creates a hard link from new_name to curr_name in same location. - void newLink(const char *curr_name, - const hid_t same_loc, const char *new_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void newLink(const H5std_string& curr_name, - const hid_t same_loc, const H5std_string& new_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Copy an object from a group of file to another. - void copyLink(const char *src_name, - const Group& dst, const char *dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void copyLink(const H5std_string& src_name, - const Group& dst, const H5std_string& dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Copy an object from a group of file to the same location. - void copyLink(const char *src_name, const char *dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void copyLink(const H5std_string& src_name, - const H5std_string& dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Rename an object in a group or file to a new location. - void moveLink(const char* src_name, - const Group& dst, const char* dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void moveLink(const H5std_string& src_name, - const Group& dst, const H5std_string& dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Rename an object in a group or file to the same location. - void moveLink(const char* src_name, const char* dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void moveLink(const H5std_string& src_name, - const H5std_string& dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - // default constructor Group(); diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index f68e858..38191bc 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -20,6 +20,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5LcreatProp.cpp b/c++/src/H5LcreatProp.cpp new file mode 100644 index 0000000..4f8bffc --- /dev/null +++ b/c++/src/H5LcreatProp.cpp @@ -0,0 +1,146 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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 + +#include "H5Include.h" +#include "H5Exception.h" +#include "H5IdComponent.h" +#include "H5PropList.h" +#include "H5LcreatProp.h" + +namespace H5 { + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +// This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control +// the order of creation and deletion of the global constants. See Design Notes +// in "H5PredType.cpp" for information. + +// Initialize a pointer for the constant +LinkCreatPropList* LinkCreatPropList::DEFAULT_ = 0; + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList::getConstant +// Creates a LinkCreatPropList object representing the HDF5 constant +// H5P_LINK_CREATE, pointed to by LinkCreatPropList::DEFAULT_ +// exception H5::PropListIException +// Description +// If LinkCreatPropList::DEFAULT_ already points to an allocated +// object, throw a PropListIException. This scenario should not +// happen. +// December, 2016 +//-------------------------------------------------------------------------- +LinkCreatPropList* LinkCreatPropList::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; + } + + // If the constant pointer is not allocated, allocate it. Otherwise, + // throw because it shouldn't be. + if (DEFAULT_ == 0) + DEFAULT_ = new LinkCreatPropList(H5P_LINK_CREATE); + else + throw PropListIException("LinkCreatPropList::getConstant", "LinkCreatPropList::getConstant is being invoked on an allocated DEFAULT_"); + return(DEFAULT_); +} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList::deleteConstants +// Purpose: Deletes the constant object that LinkCreatPropList::DEFAULT_ +// points to. +// exception H5::PropListIException +// December, 2016 +//-------------------------------------------------------------------------- +void LinkCreatPropList::deleteConstants() +{ + if (DEFAULT_ != 0) + delete DEFAULT_; +} + +//-------------------------------------------------------------------------- +// Purpose: Constant for default property +//-------------------------------------------------------------------------- +const LinkCreatPropList& LinkCreatPropList::DEFAULT = *getConstant(); + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +//-------------------------------------------------------------------------- +// Function: Default Constructor +///\brief Creates a file access property list +// December, 2016 +//-------------------------------------------------------------------------- +LinkCreatPropList::LinkCreatPropList() : PropList(H5P_LINK_CREATE) {} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList copy constructor +///\brief Copy Constructor: makes a copy of the original +///\param original - IN: LinkCreatPropList instance to copy +// December, 2016 +//-------------------------------------------------------------------------- +LinkCreatPropList::LinkCreatPropList(const LinkCreatPropList& original) : PropList(original) {} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList overloaded constructor +///\brief Creates a file access property list using the id of an +/// existing one. +// December, 2016 +//-------------------------------------------------------------------------- +LinkCreatPropList::LinkCreatPropList(const hid_t plist_id) : PropList(plist_id) {} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList::setCharEncoding +///\brief Sets the character encoding of the string. +///\exception H5::PropListIException +// March, 2018 +//-------------------------------------------------------------------------- +void LinkCreatPropList::setCharEncoding(H5T_cset_t encoding) const +{ + herr_t ret_value = H5Pset_char_encoding(id, encoding); + // Throw exception if H5Pset_char_encoding returns failure + if (ret_value < 0) + { + throw PropListIException("setCharEncoding", "H5Pset_char_encoding failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList::getCharEncoding +///\brief Gets the character encoding of the string. +///\exception H5::PropListIException +// March, 2018 +//-------------------------------------------------------------------------- +H5T_cset_t LinkCreatPropList::getCharEncoding() const +{ + H5T_cset_t encoding; + herr_t ret_value = H5Pget_char_encoding(id, &encoding); + // Throw exception if H5Pget_char_encoding returns failure + if (ret_value < 0) + { + throw PropListIException("getCharEncoding", "H5Pget_char_encoding failed"); + } + return(encoding); +} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList destructor +///\brief Noop destructor +// December, 2016 +//-------------------------------------------------------------------------- +LinkCreatPropList::~LinkCreatPropList() {} + +} // end namespace diff --git a/c++/src/H5LcreatProp.h b/c++/src/H5LcreatProp.h new file mode 100644 index 0000000..4ac2191 --- /dev/null +++ b/c++/src/H5LcreatProp.h @@ -0,0 +1,71 @@ +// C++ informative line for the emacs editor: -*- C++ -*- +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// Class LinkCreatPropList represents the HDF5 file access property list and +// inherits from DataType. + +#ifndef __H5LinkCreatPropList_H +#define __H5LinkCreatPropList_H + +namespace H5 { + +/*! \class LinkCreatPropList + \brief Class LinkCreatPropList inherits from PropList and provides + wrappers for the HDF5 file access property list. +*/ +// Inheritance: PropList -> IdComponent +class H5_DLLCPP LinkCreatPropList : public PropList { + public: + ///\brief Default file access property list. + static const LinkCreatPropList& DEFAULT; + + // Creates a file access property list. + LinkCreatPropList(); + + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("LinkCreatPropList"); } + + // Copy constructor: creates a copy of a LinkCreatPropList object. + LinkCreatPropList(const LinkCreatPropList& original); + + // Creates a copy of an existing file access property list + // using the property list id. + LinkCreatPropList (const hid_t plist_id); + + // Sets the character encoding of the string. + void setCharEncoding(H5T_cset_t encoding) const; + + // Gets the character encoding of the string. + H5T_cset_t getCharEncoding() const; + + // Noop destructor + virtual ~LinkCreatPropList(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + + // Deletes the global constant, should only be used by the library + static void deleteConstants(); + + private: + static LinkCreatPropList* DEFAULT_; + + // Creates the global constant, should only be used by the library + static LinkCreatPropList* getConstant(); + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +}; // end of LinkCreatPropList +} // namespace H5 + +#endif // __H5LinkCreatPropList_H diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 214c5b2..55f82f5 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -24,6 +24,7 @@ #include "H5OcreatProp.h" #include "H5DxferProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 3ca080e..c82df2c 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -12,6 +12,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include +#include +using namespace std; #include "H5private.h" // for HDmemset #include "H5Include.h" @@ -24,6 +26,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" @@ -750,7 +753,53 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const //-------------------------------------------------------------------------- // Function: H5Location::createGroup -///\brief Creates a new group at this location. +///\brief Creates a new group at this location, which can be a file, +/// group, dataset, attribute, or named datatype. +///\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/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 +/// 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, const LinkCreatPropList& lcpl) 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, lcpl.getId(), H5P_DEFAULT, H5P_DEFAULT); + + // 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; + 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 +//-------------------------------------------------------------------------- +Group H5Location::createGroup(const H5std_string& name, const LinkCreatPropList& lcpl) const +{ + return(createGroup( name.c_str(), lcpl)); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::createGroup +///\brief Creates a new group at this location, which can be a file, +/// group, dataset, attribute, or named datatype. ///\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 @@ -795,7 +844,6 @@ Group H5Location::createGroup(const char* name, size_t size_hint) const // 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); @@ -933,6 +981,134 @@ DataSet H5Location::openDataSet(const H5std_string& name) const //-------------------------------------------------------------------------- // Function: H5Location::link +///\brief Creates a soft link from \a link_name to \a target_name. +///\param target_name - IN: Name of object, can be a non-existing object +///\param link_name - IN: Link name for the target name +///\param lcpl - IN: Link creation plist - default to LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default to LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the current +/// location. +/// For information on creating a soft link, please refer to the +/// H5Lcreate_soft APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const char *target_name, const char *link_name, + const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + herr_t ret_value = -1; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_soft(target_name, getId(), link_name, lcpl_id, lapl_id); + if (ret_value < 0) + throwException("link", "creating soft 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 target_name and \a link_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const H5std_string& target_name, const H5std_string& + link_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + link(target_name.c_str(), link_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::link +///\brief Creates a hard link from \a new_name to \a curr_name. +///\param curr_name - IN: Name of the existing object +///\param new_loc - IN: New group or root group +///\param new_name - IN: New name for the object +///\param lcpl - IN: Link creation plist - default to LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default to LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the +/// specified location. +/// For information on creating a hard link, please refer to the +/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const char *curr_name, const Group& new_loc, + const char *new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + herr_t ret_value = -1; + hid_t new_loc_id = new_loc.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_hard(getId(), curr_name, new_loc.getId(), new_name, H5P_DEFAULT, H5P_DEFAULT); + 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. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const H5std_string& curr_name, const Group& new_loc, + const H5std_string& new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + link(curr_name.c_str(), new_loc, new_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::link +///\brief Creates a hard link from \a new_name to \a curr_name - can be +/// used to pass in H5L_SAME_LOC. +///\param curr_name - IN: Name of the existing object +///\param loc_id - IN: Group or root group ID, or H5L_SAME_LOC +///\param new_name - IN: New name for the link +///\param lcpl - IN: Link creation plist - default to LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default to LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the +/// specified location. +/// For information on creating a hard link, please refer to the +/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const char *curr_name, const hid_t same_loc, + const char *new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + herr_t ret_value = -1; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_hard(getId(), curr_name, same_loc, new_name, H5P_DEFAULT, H5P_DEFAULT); + + 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. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const H5std_string& curr_name, const hid_t same_loc, + const H5std_string& new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + link(curr_name.c_str(), same_loc, new_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// 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 @@ -953,7 +1129,7 @@ DataSet H5Location::openDataSet(const H5std_string& name) const // 2007: QAK modified to use H5L APIs - BMR // Mar 2018: Inadequate functionality, new hard link is only in // H5L_SAME_LOC. This function will be retired in favor of -// its replacement, Group::newLink(). - BMR +// its replacement. - BMR //-------------------------------------------------------------------------- void H5Location::link(H5L_type_t link_type, const char* curr_name, const char* new_name) const { @@ -993,36 +1169,164 @@ 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/H5::GroupIException/H5::LocationException -// Programmer Binh-Minh Ribler - 2000 -// Modification -// 2007: QAK modified to use H5L APIs - BMR +// Function: H5Location::copyLink +///\brief Copies a link from one group to another. +///\param src_name - IN: Original name +///\param dst - IN: Destination location +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +// March, 2018 //-------------------------------------------------------------------------- -void H5Location::unlink(const char* name) const +void H5Location::copyLink(const char *src_name, + const Group& dst, const char *dst_name, const LinkCreatPropList& lcpl, + const LinkAccPropList& lapl) const { - herr_t ret_value = H5Ldelete(getId(), name, H5P_DEFAULT); + herr_t ret_value; + hid_t dst_id = dst.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcopy(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); + if(ret_value < 0) + throwException("copyLink", "H5Lcopy failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::copyLink +///\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_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::copyLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, const LinkCreatPropList& lcpl, + const LinkAccPropList& lapl) const +{ + copyLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::copyLink +///\brief Copies a link from a group in the same location. +///\param src_name - IN: Original name +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::copyLink(const char *src_name, + const char *dst_name, const LinkCreatPropList& lcpl, + const LinkAccPropList& lapl) const +{ + herr_t ret_value; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcopy(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); + if(ret_value < 0) + throwException("copyLink", "H5Lcopy H5L_SAME_LOC failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::copyLink +///\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_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::copyLink(const H5std_string& src_name, + const H5std_string& dst_name, const LinkCreatPropList& lcpl, + const LinkAccPropList& lapl) const +{ + copyLink(src_name.c_str(), dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::moveLink +///\brief Renames a link in this group and moves it to a new location. +///\param src_name - IN: Original name +///\param dst - IN: Destination location +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default LinkAccPropList::DEFAULT +///\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::moveLink. Please refer +/// to the Group Interface in the HDF5 User's Guide for details. +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::moveLink(const char* src_name, const Group& dst, const char* dst_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + herr_t ret_value; + hid_t dst_id = dst.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lmove(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); if (ret_value < 0) - throwException("unlink", "H5Ldelete failed"); + throwException("moveLink", "H5Lmove failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::unlink +// Function: H5Location::moveLink ///\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 +/// \c H5std_string for \a src_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::moveLink(const H5std_string& src_name, const Group& dst, const H5std_string& dst_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + moveLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::moveLink +///\brief Renames a link in this group. +///\param src_name - IN: Original name +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default LinkAccPropList::DEFAULT +///\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::moveLink. Please refer +/// to the Group Interface in the HDF5 User's Guide for details. +// March, 2018 //-------------------------------------------------------------------------- -void H5Location::unlink(const H5std_string& name) const +void H5Location::moveLink(const char* src_name, const char* dst_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const { - unlink(name.c_str()); + herr_t ret_value; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lmove(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); + if (ret_value < 0) + throwException("moveLink", "H5Lmove H5L_SAME_LOC failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::moveLink +///\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_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::moveLink(const H5std_string& src_name, const H5std_string& dst_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + moveLink(src_name.c_str(), dst_name.c_str(), lcpl, lapl); } //-------------------------------------------------------------------------- // Function: H5Location::move -///\brief Renames an object at this location. +///\brief Renames an object at this location. - Deprecated due to inadequate functionality ///\param src - IN: Object's original name ///\param dst - IN: Object's new name ///\exception H5::FileIException/H5::GroupIException/H5::LocationException @@ -1030,27 +1334,80 @@ void H5Location::unlink(const H5std_string& name) const /// 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. -// Programmer Binh-Minh Ribler - 2000 // Modification -// 2007: QAK modified to use H5L APIs - BMR +// 2007: QAK modified to use H5L APIs - BMR +// 2018: Will be replaced by H5Location::moveLink() -BMR //-------------------------------------------------------------------------- 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"); + moveLink(src, dst, LinkCreatPropList::DEFAULT, LinkAccPropList::DEFAULT); } //-------------------------------------------------------------------------- // 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 +/// \c H5std_string for \a src and \a dst. - Deprecated due to inadequate functionality +// Modification +// 2018: Will be replaced by H5Location::moveLink() -BMR //-------------------------------------------------------------------------- void H5Location::move(const H5std_string& src, const H5std_string& dst) const { - move(src.c_str(), dst.c_str()); + moveLink(src.c_str(), dst.c_str(), LinkCreatPropList::DEFAULT, LinkAccPropList::DEFAULT); +} + +#if 0 +//-------------------------------------------------------------------------- +// Function: H5Location::deleteLink +///\brief Removes the specified link from this group. +///\param name - IN: Name of the object to be removed +///\exception H5::FileIException/H5::GroupIException/H5::LocationException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::deleteLink(const char* name, const LinkAccPropList& lapl) const +{ + herr_t ret_value = H5Ldelete(getId(), name, H5P_DEFAULT); + if (ret_value < 0) + throwException("deleteLink", "H5Ldelete failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::deleteLink +///\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. +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::deleteLink(const H5std_string& name, const LinkAccPropList& lapl) const +{ + deleteLink(name.c_str()); +} + +#endif +//-------------------------------------------------------------------------- +// Function: H5Location::unlink +///\brief Removes the specified link from this group. +///\param name - IN: Name of the object to be removed +///\exception H5::FileIException/H5::GroupIException/H5::LocationException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::unlink(const char* name, const LinkAccPropList& lapl) const +{ + herr_t ret_value = H5Ldelete(getId(), name, lapl.getId()); + 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. +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::unlink(const H5std_string& name, const LinkAccPropList& lapl) const +{ + unlink(name.c_str(), lapl); } #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -1064,7 +1421,7 @@ void H5Location::move(const H5std_string& src, const H5std_string& dst) const ///\par Description /// For information, please refer to the H5Gget_objinfo API in /// the HDF5 C Reference Manual. -// Programmer Binh-Minh Ribler - 2000 +// 2000 //-------------------------------------------------------------------------- void H5Location::getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const { @@ -1090,8 +1447,7 @@ void H5Location::getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_s ///\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 +// Nov, 2005 //-------------------------------------------------------------------------- void H5Location::getObjinfo(const char* name, H5G_stat_t& statbuf) const { @@ -1114,13 +1470,44 @@ void H5Location::getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- +// Function: H5Location::getLinkInfo +///\brief Returns the name of the object that the symbolic link points to. +///\param link_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/H5::GroupIException/H5::LocationException +// 2000 +//-------------------------------------------------------------------------- +H5L_info_t H5Location::getLinkInfo(const char* link_name, const LinkAccPropList& lapl) const +{ + H5L_info_t linkinfo; // link info structure + + herr_t ret_value = H5Lget_info(getId(), link_name, &linkinfo, lapl.getId()); + if (ret_value < 0) + throwException("getLinkInfo", "H5Lget_info to find buffer size failed"); + + return(linkinfo); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::getLinkInfo +///\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 link_name. +//-------------------------------------------------------------------------- +H5L_info_t H5Location::getLinkInfo(const H5std_string& link_name, const LinkAccPropList& lapl) const +{ + return(getLinkInfo(link_name.c_str(), lapl)); +} + +//-------------------------------------------------------------------------- // 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/H5::GroupIException/H5::LocationException -// Programmer Binh-Minh Ribler - 2000 +// 2000 //-------------------------------------------------------------------------- H5std_string H5Location::getLinkval(const char* name, size_t size) const { @@ -1670,7 +2057,7 @@ H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) cons // Programmer Binh-Minh Ribler - 2000 // Modification // August 2017 - BMR -// Keep Group::throwException and H5File::throwException to +// Keep H5Location::throwException and H5File::throwException to // maintain backward compatibility. For other subclasses, throw // LocationException. //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index e5fbc84..19c49ea 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -90,6 +90,10 @@ class H5_DLLCPP H5Location : public IdComponent { // Retrieves a dataspace with the region pointed to selected. DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; + // Create a new group with using link create property list. + Group createGroup(const char* name, const LinkCreatPropList& lcpl) const; + Group createGroup(const H5std_string& name, const LinkCreatPropList& lcpl) const; + // From CommonFG // Creates a new group at this location which can be a file // or another group. @@ -109,6 +113,9 @@ class H5_DLLCPP H5Location : public IdComponent { DataSet openDataSet(const char* name) const; DataSet openDataSet(const H5std_string& name) const; + H5L_info_t getLinkInfo(const char* link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + H5L_info_t getLinkInfo(const H5std_string& link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) 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; @@ -154,26 +161,95 @@ class H5_DLLCPP H5Location : public IdComponent { int iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op, void *op_data); #endif /* H5_NO_DEPRECATED_SYMBOLS */ + // Creates a soft link from link_name to target_name. + void link(const char *target_name, const char *link_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void link(const H5std_string& target_name, + const H5std_string& link_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Creates a hard link from new_name to curr_name. + void link(const char *curr_name, + const Group& new_loc, const char *new_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void link(const H5std_string& curr_name, + const Group& new_loc, const H5std_string& new_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Creates a hard link from new_name to curr_name in same location. + void link(const char *curr_name, + const hid_t same_loc, const char *new_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void link(const H5std_string& curr_name, + const hid_t same_loc, const H5std_string& new_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + // Creates a link of the specified type from new_name to current_name; // both names are interpreted relative to the specified location id. + // Deprecated due to inadequate functionality. 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 link from this location. + void unlink(const char *link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void unlink(const H5std_string& link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) 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 // Unmounts the file named 'name' from this parent location. void unmount(const char* name) const; void unmount(const H5std_string& name) const; + // Copies a link from a group to another. + void copyLink(const char *src_name, + const Group& dst, const char *dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void copyLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Makes a copy of a link in the same group. + void copyLink(const char *src_name, const char *dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void copyLink(const H5std_string& src_name, + const H5std_string& dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Renames a link in this group and moves to a new location. + void moveLink(const char* src_name, + const Group& dst, const char* dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void moveLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Renames a link in this group. + void moveLink(const char* src_name, const char* dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void moveLink(const H5std_string& src_name, + const H5std_string& dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + // Renames an object at this location. + // Deprecated due to inadequate functionality. void move(const char* src, const char* dst) const; void move(const H5std_string& src, const H5std_string& dst) const; diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index fcdfd59..27881c4 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -23,6 +23,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 53d525c..704a617 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -19,6 +19,7 @@ #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 7125676..4c0b3d2 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -20,6 +20,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 5b29682..188ee41 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -19,6 +19,7 @@ #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/Makefile.am b/c++/src/Makefile.am index efe17dc..c02a9e7 100644 --- a/c++/src/Makefile.am +++ b/c++/src/Makefile.am @@ -32,27 +32,29 @@ bin_SCRIPTS=h5c++ # Source files for the library libhdf5_cpp_la_SOURCES=H5Exception.cpp H5IdComponent.cpp \ - H5DataSpace.cpp H5PropList.cpp H5Library.cpp \ - H5FaccProp.cpp H5FcreatProp.cpp H5LaccProp.cpp \ - H5DxferProp.cpp H5DcreatProp.cpp H5Location.cpp \ - H5AbstractDs.cpp H5Attribute.cpp H5Object.cpp \ - H5OcreatProp.cpp H5DataType.cpp H5AtomType.cpp \ - H5PredType.cpp H5EnumType.cpp H5IntType.cpp \ - H5FloatType.cpp H5StrType.cpp H5ArrayType.cpp \ - H5VarLenType.cpp H5CompType.cpp H5DataSet.cpp \ - H5CommonFG.cpp H5Group.cpp H5File.cpp + H5DataSpace.cpp H5PropList.cpp H5Library.cpp \ + H5FaccProp.cpp H5FcreatProp.cpp H5LcreatProp.cpp \ + H5LaccProp.cpp H5DxferProp.cpp H5DcreatProp.cpp \ + H5Location.cpp H5AbstractDs.cpp H5Attribute.cpp \ + H5Object.cpp H5OcreatProp.cpp H5DataType.cpp \ + H5AtomType.cpp H5PredType.cpp H5EnumType.cpp \ + H5IntType.cpp H5FloatType.cpp H5StrType.cpp \ + H5ArrayType.cpp H5VarLenType.cpp H5CompType.cpp \ + H5DataSet.cpp H5CommonFG.cpp H5Group.cpp H5File.cpp # HDF5 C++ library depends on HDF5 Library. libhdf5_cpp_la_LIBADD=$(LIBHDF5) # Public headers -include_HEADERS=H5Cpp.h H5AbstractDs.h H5AtomType.h H5Attribute.h H5Classes.h \ - H5CommonFG.h H5CompType.h H5DataSet.h H5DataSpace.h H5DataType.h \ - H5OcreatProp.h H5DcreatProp.h H5DxferProp.h H5EnumType.h \ - H5Exception.h H5FaccProp.h H5FcreatProp.h H5File.h H5FloatType.h \ - H5Group.h H5IdComponent.h H5Include.h H5IntType.h H5LaccProp.h \ - H5Library.h H5Location.h H5Object.h H5PredType.h H5PropList.h \ - H5StrType.h H5CppDoc.h H5ArrayType.h H5VarLenType.h +include_HEADERS=H5Cpp.h H5AbstractDs.h H5AtomType.h H5Attribute.h \ + H5Classes.h H5CommonFG.h H5CompType.h H5DataSet.h \ + H5DataSpace.h H5DataType.h H5OcreatProp.h H5DcreatProp.h\ + H5DxferProp.h H5EnumType.h H5Exception.h H5FaccProp.h \ + H5FcreatProp.h H5File.h H5FloatType.h H5Group.h \ + H5IdComponent.h H5Include.h H5IntType.h H5LcreatProp.h \ + H5LaccProp.h H5Library.h H5Location.h H5Object.h \ + H5PredType.h H5PropList.h H5StrType.h H5CppDoc.h \ + H5ArrayType.h H5VarLenType.h # h5c++ and libhdf5.settings are generated during configure. Remove only when # distclean. diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 93bd0266..87fffc4 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -432,7 +432,92 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) { issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); } -} +} // test_basic_links + + +/*------------------------------------------------------------------------- + * Function: test_lcpl + * + * Purpose: Tests link creation property lists, specifically, the + * character encoding property. + * + * Return: Success: 0 + * Failure: number of errors + * March, 2018 + *------------------------------------------------------------------------- + */ +const H5std_string GROUP1NAME("First_group"); +const H5std_string GROUP2NAME("Second_group"); +static int +test_lcpl(hid_t fapl_id, hbool_t new_format) +{ + H5L_info_t linfo; + char filename[1024]; + hsize_t dims[2]; + + if(new_format) + TESTING("link creation property lists (w/new group format)") + else + TESTING("link creation property lists") + + try + { + FileAccPropList fapl(fapl_id); + + // Create a new file. + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + + // Create and link a group with the default LCPL. + Group grp_1(file.createGroup(GROUP1NAME)); + grp_1.close(); + + // Check that its character encoding is the default. + linfo = file.getLinkInfo(GROUP1NAME); + if(linfo.cset != H5T_CSET_ASCII) + throw InvalidActionException("H5Lget_info", "Character encoding is not default"); + + // Create and commit a datatype with the default LCPL. + IntType dtype; + dtype.commit(file, "/type"); + dtype.close(); + + // Check that its character encoding is the default. + linfo = file.getLinkInfo("type"); + verify_val(linfo.cset, H5T_CSET_ASCII, "Character encoding is not default", __LINE__, __FILE__); + + // Create a simple dataspace. + dims[0] = H5L_DIM1; + dims[1] = H5L_DIM2; + DataSpace dspace(2 ,dims); + + // Create a dataset using the default LCPL. + DataSet dset(file.createDataSet("/dataset", PredType::NATIVE_INT, dspace)); + dset.close(); + + // Check that its character encoding is the default. + linfo = file.getLinkInfo("/dataset"); + verify_val(linfo.cset, H5T_CSET_ASCII, "Character encoding is not default", __LINE__, __FILE__); + + // Create a link creation property list with the UTF-8 character encoding. + LinkCreatPropList lcpl; + lcpl.setCharEncoding(H5T_CSET_UTF8); + + // Create and link a group with the new LCPL. + Group grp_2(file.createGroup(GROUP2NAME, lcpl)); + grp_2.close(); + + // Check that its character encoding is UTF-8. + linfo = file.getLinkInfo(GROUP2NAME); + verify_val(linfo.cset, H5T_CSET_UTF8, "Character encoding is not UTF-8", __LINE__, __FILE__); + + PASSED(); + } // end of try block + catch (Exception& E) + { + issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} // end test_lcpl() /*------------------------------------------------------------------------- @@ -445,8 +530,6 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) * March, 2018 *------------------------------------------------------------------------- */ -const H5std_string GROUP1NAME("First_group"); -const H5std_string GROUP2NAME("Second_group"); static void test_move(hid_t fapl_id, hbool_t new_format) { @@ -459,11 +542,13 @@ test_move(hid_t fapl_id, hbool_t new_format) try { + FileAccPropList fapl(fapl_id); + // Create two new files h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); - H5File file_a(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + H5File file_a(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); h5_fixname(FILENAME[1], fapl_id, filename, sizeof filename); - H5File file_b(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + H5File file_b(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); // Create groups in first file Group grp_1(file_a.createGroup(GROUP1NAME)); @@ -574,7 +659,7 @@ test_move(hid_t fapl_id, hbool_t new_format) { issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); } -} +} // test_move /*------------------------------------------------------------------------- * Function: test_copy @@ -609,8 +694,8 @@ static void test_copy(hid_t fapl_id, hbool_t new_format) Group grp_move(grp_1.createGroup("group_copy")); // Create hard and soft links - grp_1.newLink("group_copy", H5L_SAME_LOC, "hard"); - grp_2.newLink("/First_group/group_copy", "soft"); + grp_1.link("group_copy", H5L_SAME_LOC, "hard"); + grp_2.link("/First_group/group_copy", "soft"); // Copy a group across files, should fail try { @@ -679,13 +764,37 @@ static void test_copy(hid_t fapl_id, hbool_t new_format) moved_grp = grp_1.openGroup("group_copy"); moved_grp.close(); + // Delete "group_newer_name" from group 2, then try to open it. + grp_2.unlink("group_newer_name"); + try { + moved_grp = grp_2.openGroup("group_newer_name"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_newer_name should not be in GROUP2NAME" << endl; + } catch (Exception& E) { + // expected + } + + // Delete "group_copy" from group 1, then try to open it. + grp_1.unlink("group_copy"); + try { + moved_grp = grp_1.openGroup("group_copy"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_copy should not be in GROUP1NAME" << endl; + } catch (Exception& E) { + // expected + } + PASSED(); } // end of try block catch (Exception& E) { issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); } -} +} // test_copy /*------------------------------------------------------------------------- -- cgit v0.12 From 784165335992b4b58eca3fd91cc313bbca345c9f Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 11 Mar 2018 23:39:46 -0500 Subject: Updated MANIFEST for H5LcreatProp.[h,cpp] --- MANIFEST | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST b/MANIFEST index 4e35691..805c8d9 100644 --- a/MANIFEST +++ b/MANIFEST @@ -374,6 +374,8 @@ ./c++/src/H5IntType.h ./c++/src/H5LaccProp.cpp ./c++/src/H5LaccProp.h +./c++/src/H5LcreatProp.cpp +./c++/src/H5LcreatProp.h ./c++/src/H5Library.cpp ./c++/src/H5Library.h ./c++/src/H5Location.cpp -- cgit v0.12 From 17af6bcb791ae8fa1027717bc155c56bc7d17640 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 11 Mar 2018 23:43:52 -0500 Subject: Updated for H5LcreatProp.[h,cpp] --- c++/src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 350bdf7..5d0d6b6 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -33,6 +33,7 @@ set (CPP_SOURCES ${HDF5_CPP_SRC_SOURCE_DIR}/H5IdComponent.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5IntType.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5LaccProp.cpp + ${HDF5_CPP_SRC_SOURCE_DIR}/H5LcreatProp.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5Library.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5Location.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5Object.cpp @@ -70,6 +71,7 @@ set (CPP_HDRS ${HDF5_CPP_SRC_SOURCE_DIR}/H5Include.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5IntType.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5LaccProp.h + ${HDF5_CPP_SRC_SOURCE_DIR}/H5LcreatProp.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Library.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Location.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Object.h -- cgit v0.12 From 5a0d8d0d16fad83346089ab160a2d3b128a2373d Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 12 Mar 2018 00:03:46 -0500 Subject: Updated RELEASE.txt Description: - Wrappers for H5Lcreate_soft, H5Lcreate_hard, H5Lcopy, H5Lmove, H5Ldelete, and H5Lget_info - Class LinkCreatPropList - Fixed typo in source file Platforms tested: Linux/64 (jelly) --- c++/src/H5Location.cpp | 2 +- release_docs/RELEASE.txt | 58 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index c82df2c..2dceb6e 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -1471,7 +1471,7 @@ void H5Location::getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const //-------------------------------------------------------------------------- // Function: H5Location::getLinkInfo -///\brief Returns the name of the object that the symbolic link points to. +///\brief Returns the information of the named link. ///\param link_name - IN: Symbolic link to the object ///\param size - IN: Maximum number of characters of value to be returned ///\return Name of the object diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 0061910..12776eb 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -151,7 +151,63 @@ New Features C++ Library: ------------ - - + - The following wrappers are added: + + + H5Lcreate_soft: + // Creates a soft link from link_name to target_name. + void link(const char *target_name, const char *link_name,...) + void link(const H5std_string& target_name,...) + + + H5Lcreate_hard: + // Creates a hard link from new_name to curr_name. + void link(const char *curr_name, const Group& new_loc,...) + void link(const H5std_string& curr_name, const Group& new_loc,...) + + // Creates a hard link from new_name to curr_name in same location. + void link(const char *curr_name, const hid_t same_loc,...) + void link(const H5std_string& curr_name, const hid_t same_loc,...) + + Note: previous version of H5Location::link will be deprecated. + + + H5Lcopy: + // Copy an object from a group of file to another. + void copyLink(const char *src_name, const Group& dst,...) + void copyLink(const H5std_string& src_name, const Group& dst,...) + + // Copy an object from a group of file to the same location. + void copyLink(const char *src_name, const char *dst_name,...) + void copyLink(const H5std_string& src_name,...) + + + H5Lmove: + // Rename an object in a group or file to a new location. + void moveLink(const char* src_name, const Group& dst,...) + void moveLink(const H5std_string& src_name, const Group& dst,...) + + // Rename an object in a group or file to the same location. + void moveLink(const char* src_name, const char* dst_name,...) + void moveLink(const H5std_string& src_name,...) + + Note: previous version H5Location::move will be deprecated. + + + H5Ldelete: + // Removes the specified link from this location. + void unlink(const char *link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) + void unlink(const H5std_string& link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) + + - Added class LinkCreatPropList + + - Added overloaded functions H5Location::createGroup to take a link + creation property list + Group createGroup(const char* name, const LinkCreatPropList& lcpl) + Group createGroup(const H5std_string& name, const LinkCreatPropList& lcpl) + - Added wrapper for H5Lget_info() to H5Location + // Returns the information of the named link. + H5L_info_t getLinkInfo(const H5std_string& link_name,...) + + (BMR - 2018/03/11, HDFFV-10149) + Java Library: ---------------- -- cgit v0.12 From b638bbd74b79f935a43aa6a804492e035ec315f6 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 12 Mar 2018 00:53:16 -0500 Subject: Code improvement Description: - Removed memory leaks caused by accidentally invoking p_get_member_type - Added the call to test_lcpl, missed previously Platforms tested: Linux/64 (jelly) Linux/ppc64 (ostrich) Darwin (osx1010test) --- c++/src/H5CompType.cpp | 38 +++++++++++++++++++------------------- c++/test/tlinks.cpp | 13 +++++++------ 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 28aa6cd..3731fd4 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -304,7 +304,7 @@ DataType CompType::getMemberDataType(unsigned member_num) const ArrayType CompType::getMemberArrayType(unsigned member_num) const { try { - ArrayType arraytype(p_get_member_type(member_num)); + ArrayType arraytype; f_DataType_setId(&arraytype, p_get_member_type(member_num)); return(arraytype); } @@ -324,10 +324,10 @@ ArrayType CompType::getMemberArrayType(unsigned member_num) const //-------------------------------------------------------------------------- CompType CompType::getMemberCompType(unsigned member_num) const { - try { - CompType comptype(p_get_member_type(member_num)); + try { + CompType comptype; f_DataType_setId(&comptype, p_get_member_type(member_num)); - return(comptype); + return(comptype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg()); @@ -345,10 +345,10 @@ CompType CompType::getMemberCompType(unsigned member_num) const //-------------------------------------------------------------------------- EnumType CompType::getMemberEnumType(unsigned member_num) const { - try { - EnumType enumtype(p_get_member_type(member_num)); + try { + EnumType enumtype; f_DataType_setId(&enumtype, p_get_member_type(member_num)); - return(enumtype); + return(enumtype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberEnumType", E.getDetailMsg()); @@ -366,10 +366,10 @@ EnumType CompType::getMemberEnumType(unsigned member_num) const //-------------------------------------------------------------------------- IntType CompType::getMemberIntType(unsigned member_num) const { - try { - IntType inttype(p_get_member_type(member_num)); + try { + IntType inttype; f_DataType_setId(&inttype, p_get_member_type(member_num)); - return(inttype); + return(inttype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberIntType", E.getDetailMsg()); @@ -387,10 +387,10 @@ IntType CompType::getMemberIntType(unsigned member_num) const //-------------------------------------------------------------------------- FloatType CompType::getMemberFloatType(unsigned member_num) const { - try { - FloatType floatype(p_get_member_type(member_num)); + try { + FloatType floatype; f_DataType_setId(&floatype, p_get_member_type(member_num)); - return(floatype); + return(floatype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberFloatType", E.getDetailMsg()); @@ -408,10 +408,10 @@ FloatType CompType::getMemberFloatType(unsigned member_num) const //-------------------------------------------------------------------------- StrType CompType::getMemberStrType(unsigned member_num) const { - try { - StrType strtype(p_get_member_type(member_num)); + try { + StrType strtype; f_DataType_setId(&strtype, p_get_member_type(member_num)); - return(strtype); + return(strtype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg()); @@ -429,10 +429,10 @@ StrType CompType::getMemberStrType(unsigned member_num) const //-------------------------------------------------------------------------- VarLenType CompType::getMemberVarLenType(unsigned member_num) const { - try { - VarLenType varlentype(p_get_member_type(member_num)); + try { + VarLenType varlentype; f_DataType_setId(&varlentype, p_get_member_type(member_num)); - return(varlentype); + return(varlentype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberVarLenType", E.getDetailMsg()); diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 87fffc4..b8560aa 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -448,7 +448,7 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) */ const H5std_string GROUP1NAME("First_group"); const H5std_string GROUP2NAME("Second_group"); -static int +static void test_lcpl(hid_t fapl_id, hbool_t new_format) { H5L_info_t linfo; @@ -456,9 +456,9 @@ test_lcpl(hid_t fapl_id, hbool_t new_format) hsize_t dims[2]; if(new_format) - TESTING("link creation property lists (w/new group format)") + SUBTEST("Link creation property lists (w/new group format)") else - TESTING("link creation property lists") + SUBTEST("Link creation property lists") try { @@ -466,7 +466,7 @@ test_lcpl(hid_t fapl_id, hbool_t new_format) // Create a new file. h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); - H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); // Create and link a group with the default LCPL. Group grp_1(file.createGroup(GROUP1NAME)); @@ -478,12 +478,12 @@ test_lcpl(hid_t fapl_id, hbool_t new_format) throw InvalidActionException("H5Lget_info", "Character encoding is not default"); // Create and commit a datatype with the default LCPL. - IntType dtype; + IntType dtype(PredType::NATIVE_INT); dtype.commit(file, "/type"); dtype.close(); // Check that its character encoding is the default. - linfo = file.getLinkInfo("type"); + linfo = file.getLinkInfo("/type"); verify_val(linfo.cset, H5T_CSET_ASCII, "Character encoding is not default", __LINE__, __FILE__); // Create a simple dataspace. @@ -894,6 +894,7 @@ void test_links() test_basic_links(my_fapl_id, new_format); test_move(my_fapl_id, new_format); test_copy(my_fapl_id, new_format); + test_lcpl(my_fapl_id, new_format); } /* end for */ /* Close 2nd FAPL */ -- cgit v0.12 From f08b8fa10e7bac5ae26e3b06f938d38ebb3f28e1 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 12 Mar 2018 09:02:15 -0500 Subject: Enhancement to the tool h5clear (HDFFV-10360) --- MANIFEST | 23 ++ src/H5F.c | 94 +++++- src/H5Fint.c | 41 ++- src/H5Fpkg.h | 3 +- src/H5Fprivate.h | 4 + src/H5Fpublic.h | 2 + src/H5Fsuper.c | 112 +++++-- src/H5Pfapl.c | 21 ++ test/tfile.c | 128 +++++++ tools/src/misc/h5clear.c | 158 ++++++++- tools/test/misc/CMakeTestsClear.cmake | 100 +++++- tools/test/misc/h5clear_gentest.c | 369 +++++++++++++++++++-- .../misc/testfiles/h5clear_equal_after_size.ddl | 1 + .../misc/testfiles/h5clear_equal_before_size.ddl | 1 + .../misc/testfiles/h5clear_fsm_persist_equal.h5 | Bin 0 -> 2565 bytes .../misc/testfiles/h5clear_fsm_persist_greater.h5 | Bin 0 -> 2565 bytes .../misc/testfiles/h5clear_fsm_persist_less.h5 | Bin 0 -> 2565 bytes .../misc/testfiles/h5clear_fsm_persist_noclose.h5 | Bin 0 -> 2448 bytes .../testfiles/h5clear_fsm_persist_user_equal.h5 | Bin 0 -> 3077 bytes .../testfiles/h5clear_fsm_persist_user_greater.h5 | Bin 0 -> 3077 bytes .../testfiles/h5clear_fsm_persist_user_less.h5 | Bin 0 -> 3077 bytes .../misc/testfiles/h5clear_greater_after_size.ddl | 1 + .../misc/testfiles/h5clear_greater_before_size.ddl | 1 + .../misc/testfiles/h5clear_less_after_size.ddl | 1 + .../misc/testfiles/h5clear_less_before_size.ddl | 1 + tools/test/misc/testfiles/h5clear_missing_file.ddl | 10 +- .../misc/testfiles/h5clear_noclose_after_size.ddl | 1 + .../misc/testfiles/h5clear_noclose_before_size.ddl | 1 + .../test/misc/testfiles/h5clear_status_noclose.h5 | Bin 0 -> 2448 bytes .../h5clear_status_noclose_after_size.ddl | 1 + tools/test/misc/testfiles/h5clear_usage.ddl | 10 +- .../testfiles/h5clear_user_equal_after_size.ddl | 1 + .../testfiles/h5clear_user_equal_before_size.ddl | 1 + .../testfiles/h5clear_user_greater_after_size.ddl | 1 + .../testfiles/h5clear_user_greater_before_size.ddl | 1 + .../testfiles/h5clear_user_less_after_size.ddl | 1 + .../testfiles/h5clear_user_less_before_size.ddl | 1 + tools/test/misc/testh5clear.sh.in | 122 ++++++- 38 files changed, 1114 insertions(+), 98 deletions(-) create mode 100644 tools/test/misc/testfiles/h5clear_equal_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_equal_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_equal.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_greater.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_less.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_noclose.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_user_equal.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_user_greater.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_user_less.h5 create mode 100644 tools/test/misc/testfiles/h5clear_greater_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_greater_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_less_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_less_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_noclose_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_noclose_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_status_noclose.h5 create mode 100644 tools/test/misc/testfiles/h5clear_status_noclose_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_equal_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_equal_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_greater_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_greater_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_less_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_less_before_size.ddl diff --git a/MANIFEST b/MANIFEST index 229a5ec..2646d0f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1486,15 +1486,38 @@ ./tools/test/misc/testh5mkgrp.sh.in ./tools/test/misc/testh5repart.sh.in ./tools/test/misc/talign.c +./tools/test/misc/testfiles/h5clear_equal_after_size.ddl +./tools/test/misc/testfiles/h5clear_equal_before_size.ddl +./tools/test/misc/testfiles/h5clear_greater_after_size.ddl +./tools/test/misc/testfiles/h5clear_greater_before_size.ddl +./tools/test/misc/testfiles/h5clear_less_after_size.ddl +./tools/test/misc/testfiles/h5clear_less_before_size.ddl ./tools/test/misc/testfiles/h5clear_missing_file.ddl +./tools/test/misc/testfiles/h5clear_noclose_after_size.ddl +./tools/test/misc/testfiles/h5clear_noclose_before_size.ddl ./tools/test/misc/testfiles/h5clear_no_mdc_image.ddl ./tools/test/misc/testfiles/h5clear_open_fail.ddl +./tools/test/misc/testfiles/h5clear_status_noclose_after_size.ddl ./tools/test/misc/testfiles/h5clear_usage.ddl +./tools/test/misc/testfiles/h5clear_user_equal_after_size.ddl +./tools/test/misc/testfiles/h5clear_user_equal_before_size.ddl +./tools/test/misc/testfiles/h5clear_user_greater_after_size.ddl +./tools/test/misc/testfiles/h5clear_user_greater_before_size.ddl +./tools/test/misc/testfiles/h5clear_user_less_after_size.ddl +./tools/test/misc/testfiles/h5clear_user_less_before_size.ddl +./tools/test/misc/testfiles/h5clear_fsm_persist_equal.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_greater.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_less.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_noclose.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_user_equal.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_user_greater.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_user_less.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/h5clear_status_noclose.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 diff --git a/src/H5F.c b/src/H5F.c index 8e5f65a..2cd65cb 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -845,8 +845,6 @@ herr_t H5Fget_filesize(hid_t file_id, hsize_t *size) { H5F_t *file; /* File object for file ID */ - haddr_t eof; /* End of file address */ - haddr_t eoa; /* End of allocation address */ haddr_t max_eof_eoa; /* Maximum of the EOA & EOF */ haddr_t base_addr; /* Base address for the file */ herr_t ret_value = SUCCEED; /* Return value */ @@ -859,11 +857,9 @@ H5Fget_filesize(hid_t file_id, hsize_t *size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Go get the actual file size */ - eof = H5FD_get_eof(file->shared->lf, H5FD_MEM_DEFAULT); - eoa = H5FD_get_eoa(file->shared->lf, H5FD_MEM_DEFAULT); - max_eof_eoa = MAX(eof, eoa); - if(HADDR_UNDEF == max_eof_eoa) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file get eof/eoa requests failed") + if(H5F__get_max_eof_eoa(file, &max_eof_eoa) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file can't get max eof/eoa ") + base_addr = H5FD_get_base_addr(file->shared->lf); if(size) @@ -1949,3 +1945,87 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Fget_mdc_image_info() */ + +/*------------------------------------------------------------------------- + * Function: H5Fget_eoa + * + * Purpose: Returns the address of the first byte after the last + * allocated memory in the file. + * (See H5FDget_eoa() in H5FD.c) + * + * Return: Success: First byte after allocated memory. + * Failure: HADDR_UNDEF + * + * Return: Non-negative on success/Negative on errors + *------------------------------------------------------------------------- + */ +herr_t +H5Fget_eoa(hid_t file_id, haddr_t *eoa) +{ + H5F_t *file; /* File object for file ID */ + haddr_t rel_eoa; /* Relative address of EOA */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*a", file_id, eoa); + + /* Check args */ + if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hid_t identifier is not a file ID") + + /* This public routine will work only for drivers with this feature enabled.*/ + /* We might introduce a new feature flag in the future */ + if(!H5F_HAS_FEATURE(file, H5FD_FEAT_SUPPORTS_SWMR_IO)) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "must use a SWMR-compatible VFD for this public routine") + + /* The real work */ + if(HADDR_UNDEF == (rel_eoa = H5FD_get_eoa(file->shared->lf, H5FD_MEM_DEFAULT))) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "get_eoa request failed") + + /* (Note compensating for base address subtraction in internal routine) */ + if(eoa) + *eoa = rel_eoa + H5FD_get_base_addr(file->shared->lf); +done: + FUNC_LEAVE_API(ret_value) +} /* H5Fget_eoa() */ + + +/*------------------------------------------------------------------------- + * Function: H5Fincrement_filesize + * + * Purpose: Set the EOA for the file to the maximum of (EOA, EOF) + increment + * + * Return: Non-negative on success/Negative on errors + *------------------------------------------------------------------------- + */ +herr_t +H5Fincrement_filesize(hid_t file_id, hsize_t increment) +{ + H5F_t *file; /* File object for file ID */ + haddr_t max_eof_eoa; /* Maximum of the relative EOA & EOF */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "ih", file_id, increment); + + /* Check args */ + if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hid_t identifier is not a file ID") + + /* This public routine will work only for drivers with this feature enabled.*/ + /* We might introduce a new feature flag in the future */ + if(!H5F_HAS_FEATURE(file, H5FD_FEAT_SUPPORTS_SWMR_IO)) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "must use a SWMR-compatible VFD for this public routine") + + /* Get the maximum of EOA and EOF */ + if(H5F__get_max_eof_eoa(file, &max_eof_eoa) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file can't get max eof/eoa ") + + /* Set EOA to the maximum value + increment */ + /* H5FD_set_eoa() will add base_addr to max_eof_eoa */ + if(H5FD_set_eoa(file->shared->lf, H5FD_MEM_DEFAULT, max_eof_eoa + increment) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_eoa request failed") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Fincrement_filesize() */ diff --git a/src/H5Fint.c b/src/H5Fint.c index c41453a..24eb761 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -124,7 +124,6 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */ hbool_t driver_prop_copied = FALSE; /* Whether the driver property has been set up */ unsigned efc_size = 0; - hbool_t latest_format = FALSE; /* Always use the latest format? */ hid_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -820,7 +819,6 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t else { H5P_genplist_t *plist; /* Property list */ unsigned efc_size; /* External file cache size */ - hbool_t latest_format; /* Always use the latest format? */ size_t u; /* Local index variable */ HDassert(lf != NULL); @@ -1602,7 +1600,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, } /* end if */ else if (1 == shared->nrefs) { /* Read the superblock if it hasn't been read before. */ - if(H5F__super_read(file, meta_dxpl_id, raw_dxpl_id, TRUE) < 0) + if(H5F__super_read(file, meta_dxpl_id, raw_dxpl_id, fapl_id, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") /* Create the page buffer before initializing the superblock */ @@ -2912,6 +2910,43 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__set_paged_aggr() */ +/*------------------------------------------------------------------------- + * Function: H5F__get_max_eof_eoa + * + * Purpose: Determine the maximum of (EOA, EOF) for the file + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5F__get_max_eof_eoa(const H5F_t *f, haddr_t *max_eof_eoa) +{ + haddr_t eof; /* Relative address for EOF */ + haddr_t eoa; /* Relative address for EOA */ + haddr_t tmp_max; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + + /* Get the relative EOA and EOF */ + eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT); + eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT); + + /* Determine the maximum */ + tmp_max = MAX(eof, eoa); + if(HADDR_UNDEF == tmp_max) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file get eof/eoa requests failed") + + *max_eof_eoa = tmp_max; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__get_max_eof_eoa() */ + #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index c9aba56..a4c1a24 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -412,7 +412,7 @@ H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nop /* Superblock related routines */ H5_DLL herr_t H5F__super_init(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, +H5_DLL herr_t H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id, hbool_t initial_read); H5_DLL herr_t H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_size); H5_DLL herr_t H5F__super_free(H5F_super_t *sblock); @@ -457,6 +457,7 @@ H5_DLL htri_t H5F_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, H5_DLL herr_t H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr); H5_DLL herr_t H5F__set_base_addr(const H5F_t *f, haddr_t addr); H5_DLL herr_t H5F__set_paged_aggr(const H5F_t *f, hbool_t paged); +H5_DLL herr_t H5F__get_max_eof_eoa(const H5F_t *f, haddr_t *max_eof_eoa); /* Functions that flush or evict */ H5_DLL herr_t H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 856e618..28ebbd2 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -492,6 +492,10 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ +#define H5F_ACS_NULL_FSM_ADDR_NAME "null_fsm_addr" /* Nullify addresses of free-space managers */ + /* Private property used only by h5clear */ +#define H5F_ACS_SKIP_EOF_CHECK_NAME "skip_eof_check" /* Skip EOF check */ + /* Private property used only by h5clear */ #define H5F_ACS_USE_MDC_LOGGING_NAME "use_mdc_logging" /* Whether to use metadata cache logging */ #define H5F_ACS_MDC_LOG_LOCATION_NAME "mdc_log_location" /* Name of metadata cache log location */ #define H5F_ACS_START_MDC_LOG_ON_ACCESS_NAME "start_mdc_log_on_access" /* Whether logging starts on file create/open */ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index d333fa7..73c59f5 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -241,6 +241,8 @@ H5_DLL herr_t H5Fmount(hid_t loc, const char *name, hid_t child, hid_t plist); H5_DLL herr_t H5Funmount(hid_t loc, const char *name); H5_DLL hssize_t H5Fget_freespace(hid_t file_id); H5_DLL herr_t H5Fget_filesize(hid_t file_id, hsize_t *size); +H5_DLL herr_t H5Fget_eoa(hid_t file_id, haddr_t *eoa); +H5_DLL herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment); H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void * buf_ptr, size_t buf_len); H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t * config_ptr); diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 4250ff0..3db9b2f 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -324,7 +324,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial_read) +H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id, hbool_t initial_read) { H5P_genplist_t *dxpl = NULL; /* DXPL object */ H5AC_ring_t ring, orig_ring = H5AC_RING_INV; @@ -337,7 +337,8 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial 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 */ - herr_t ret_value = SUCCEED; /* Return value */ + H5P_genplist_t *a_plist; /* File access property list */ + herr_t ret_value = SUCCEED; /* Return value */ #ifdef H5_HAVE_PARALLEL int mpi_rank = 0, mpi_size = 1; int mpi_result; @@ -595,6 +596,20 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial * as the file can appear truncated if only part of it has been * been flushed to disk by the SWMR writer process. */ + /* The EOF check is also skipped when the private property + * H5F_ACS_SKIP_EOF_CHECK_NAME exists in the fapl. + * This property is enabled by the tool h5clear with these + * two options: (1) --filesize (2) --increment + */ + + /* Check if this private property exists in fapl */ + if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file access property list") + if(H5P_exist_plist(a_plist, H5F_ACS_SKIP_EOF_CHECK_NAME) > 0) { + if(H5P_get(a_plist, H5F_ACS_SKIP_EOF_CHECK_NAME, &skip_eof_check) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get clearance for persisting fsm addr") + } + if(H5F_INTENT(f) & H5F_ACC_SWMR_READ) { /* * When the file is opened for SWMR read access, skip the check if: @@ -757,6 +772,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if(status) { H5O_fsinfo_t fsinfo; /* File space info message from superblock extension */ uint8_t flags; /* Message flags */ + hbool_t null_fsm_addr = FALSE; /* Whether to drop free-space to the floor */ /* Get message flags */ if(H5O_msg_get_flags(&ext_loc, H5O_FSINFO_ID, meta_dxpl_id, &flags) < 0) @@ -765,6 +781,13 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial /* If message is NOT marked "unknown"--set up file space info */ if(!(flags & H5O_MSG_FLAG_WAS_UNKNOWN)) { + /* The tool h5clear uses this property to tell the library + to drop free-space to the floor */ + if(H5P_exist_plist(a_plist, H5F_ACS_NULL_FSM_ADDR_NAME) > 0) { + if(H5P_get(a_plist, H5F_ACS_NULL_FSM_ADDR_NAME, &null_fsm_addr) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get clearance for persisting fsm addr") + } + /* Retrieve the 'file space info' structure */ if(NULL == H5O_msg_read(&ext_loc, H5O_FSINFO_ID, &fsinfo, meta_dxpl_id)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get free-space manager info message") @@ -808,13 +831,30 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if(f->shared->eoa_pre_fsm_fsalloc != fsinfo.eoa_pre_fsm_fsalloc) f->shared->eoa_pre_fsm_fsalloc = fsinfo.eoa_pre_fsm_fsalloc; - /* f->shared->eoa_pre_fsm_fsalloc must always be HADDR_UNDEF - * in the absence of persistant free space managers. + /* f->shared->eoa_pre_fsm_fsalloc must always be HADDR_UNDEF + * in the absence of persistant free space managers. + */ + /* If the following two conditions are true: + * (1) skipping EOF check (skip_eof_check) + * (2) dropping free-space to the floor (null_fsm_addr) + * skip the asserts as "eoa_pre_fsm_fsalloc" may be undefined + * for a crashed file with persistant free space managers. + * #1 and #2 are enabled when the tool h5clear --increment + * option is used. */ - HDassert((!f->shared->fs_persist) || (f->shared->eoa_pre_fsm_fsalloc != HADDR_UNDEF)); - HDassert(!f->shared->first_alloc_dealloc); + if(!skip_eof_check && !null_fsm_addr) { + HDassert((!f->shared->fs_persist) || (f->shared->eoa_pre_fsm_fsalloc != HADDR_UNDEF)); + HDassert(!f->shared->first_alloc_dealloc); + } - if((f->shared->eoa_pre_fsm_fsalloc != HADDR_UNDEF) && + /* As "eoa_pre_fsm_fsalloc" may be undefined for a crashed file + * with persistant free space managers, therefore, set + * "first_alloc_dealloc" when the condition + * "dropping free-space to the floor is true. + * This will ensure that no action is done to settle things on file + * close via H5MF_settle_meta_data_fsm() and H5MF_settle_raw_data_fsm(). + */ + if((f->shared->eoa_pre_fsm_fsalloc != HADDR_UNDEF || null_fsm_addr) && (H5F_INTENT(f) & H5F_ACC_RDWR)) f->shared->first_alloc_dealloc = TRUE; @@ -822,7 +862,20 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial for(u = 1; u < NELMTS(f->shared->fs_addr); u++) f->shared->fs_addr[u] = fsinfo.fs_addr[u - 1]; - if(fsinfo.mapped && (rw_flags & H5AC__READ_ONLY_FLAG) == 0) { + /* If the following two conditions are true: + * (1) file is persisting free-space + * (2) dropping free-space to the floor (null_fsm_addr) + * nullify the addresses of the FSMs + */ + if(f->shared->fs_persist && null_fsm_addr) { + for(u = 0; u < NELMTS(fsinfo.fs_addr); u++) + f->shared->fs_addr[u] = fsinfo.fs_addr[u] = HADDR_UNDEF; + } + + /* For fsinfo.mapped: remove the FSINFO message from the superblock extension + and write a new message to the extension */ + /* For null_fsm_addr: just update FSINFO message in the superblock extension */ + if(((fsinfo.mapped || null_fsm_addr) && (rw_flags & H5AC__READ_ONLY_FLAG) == 0)) { /* Do the same kluge until we know for sure. VC */ #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ @@ -836,11 +889,16 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial f->shared->sblock = sblock; #endif /* JRM */ - if(H5F_super_ext_remove_msg(f, meta_dxpl_id, H5O_FSINFO_ID) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTDELETE, FAIL, "error in removing message from superblock extension") + if(null_fsm_addr) { + if(H5F_super_ext_write_msg(f, meta_dxpl_id, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") + } else { + if(H5F_super_ext_remove_msg(f, meta_dxpl_id, H5O_FSINFO_ID) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDELETE, FAIL, "error in removing message from superblock extension") - if(H5F_super_ext_write_msg(f, meta_dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) - HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") + if(H5F_super_ext_write_msg(f, meta_dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") + } #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ f->shared->sblock = NULL; #endif /* JRM */ @@ -1637,13 +1695,13 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, /* Open/create the superblock extension object header */ if(H5F_addr_defined(f->shared->sblock->ext_addr)) { - if(H5F_super_ext_open(f, f->shared->sblock->ext_addr, &ext_loc) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open file's superblock extension") + if(H5F_super_ext_open(f, f->shared->sblock->ext_addr, &ext_loc) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open file's superblock extension") } /* end if */ else { HDassert(may_create); - if(H5F_super_ext_create(f, dxpl_id, &ext_loc) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create file's superblock extension") + if(H5F_super_ext_create(f, dxpl_id, &ext_loc) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create file's superblock extension") ext_created = TRUE; } /* end else */ HDassert(H5F_addr_defined(ext_loc.addr)); @@ -1651,24 +1709,24 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, /* Check if message with ID does not exist in the object header */ if((status = H5O_msg_exists(&ext_loc, id, dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check object header for message or message exists") + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check object header for message or message exists") /* Check for creating vs. writing */ if(may_create) { - if(status) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should not exist") + if(status) + 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) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to create the message in object header") + /* 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) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to create the message in object header") } /* end if */ else { - if(!status) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should exist") + if(!status) + 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) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to write the message in object header") + /* 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) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to write the message in object header") } /* end else */ done: diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 148c247..eded286 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -193,6 +193,14 @@ /* Definition for status_flags in the superblock */ #define H5F_ACS_CLEAR_STATUS_FLAGS_SIZE sizeof(hbool_t) #define H5F_ACS_CLEAR_STATUS_FLAGS_DEF FALSE + +/* Definition for dropping free-space to the floor when reading in the superblock */ +#define H5F_ACS_NULL_FSM_ADDR_SIZE sizeof(hbool_t) +#define H5F_ACS_NULL_FSM_ADDR_DEF FALSE +/* Definition for skipping EOF check when reading in the superblock */ +#define H5F_ACS_SKIP_EOF_CHECK_SIZE sizeof(hbool_t) +#define H5F_ACS_SKIP_EOF_CHECK_DEF FALSE + /* Definition for 'use metadata cache logging' flag */ #define H5F_ACS_USE_MDC_LOGGING_SIZE sizeof(hbool_t) #define H5F_ACS_USE_MDC_LOGGING_DEF FALSE @@ -374,6 +382,9 @@ static const size_t H5F_def_core_write_tracking_page_size_g = H5F_ACS_CORE_WRITE static const unsigned H5F_def_metadata_read_attempts_g = H5F_ACS_METADATA_READ_ATTEMPTS_DEF; /* Default setting for the # of metadata read attempts */ static const H5F_object_flush_t H5F_def_object_flush_cb_g = H5F_ACS_OBJECT_FLUSH_CB_DEF; /* Default setting for object flush callback */ static const hbool_t H5F_def_clear_status_flags_g = H5F_ACS_CLEAR_STATUS_FLAGS_DEF; /* Default to clear the superblock status_flags */ +static const hbool_t H5F_def_skip_eof_check_g = H5F_ACS_SKIP_EOF_CHECK_DEF; /* Default setting for skipping EOF check */ +static const hbool_t H5F_def_null_fsm_addr_g = H5F_ACS_NULL_FSM_ADDR_DEF; /* Default setting for dropping free-space to the floor */ + static const hbool_t H5F_def_use_mdc_logging_g = H5F_ACS_USE_MDC_LOGGING_DEF; /* Default metadata cache logging flag */ static const char *H5F_def_mdc_log_location_g = H5F_ACS_MDC_LOG_LOCATION_DEF; /* Default mdc log location */ static const hbool_t H5F_def_start_mdc_log_on_access_g = H5F_ACS_START_MDC_LOG_ON_ACCESS_DEF; /* Default mdc log start on access flag */ @@ -565,6 +576,16 @@ H5P__facc_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 private property of whether to skip EOF check. It's used by h5clear only. */ + if(H5P_register_real(pclass, H5F_ACS_SKIP_EOF_CHECK_NAME, H5F_ACS_SKIP_EOF_CHECK_SIZE, &H5F_def_skip_eof_check_g, + 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 private property of whether to drop free-space to the floor. It's used by h5clear only. */ + if(H5P_register_real(pclass, H5F_ACS_NULL_FSM_ADDR_NAME, H5F_ACS_NULL_FSM_ADDR_SIZE, &H5F_def_null_fsm_addr_g, + 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 metadata cache logging flag. */ if(H5P_register_real(pclass, H5F_ACS_USE_MDC_LOGGING_NAME, H5F_ACS_USE_MDC_LOGGING_SIZE, &H5F_def_use_mdc_logging_g, NULL, NULL, NULL, H5F_ACS_USE_MDC_LOGGING_ENC, H5F_ACS_USE_MDC_LOGGING_DEC, NULL, NULL, NULL, NULL) < 0) diff --git a/test/tfile.c b/test/tfile.c index f3d5a8f..80c1e11 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -134,6 +134,9 @@ #define NGROUPS 2 #define NDSETS 4 +/* Declaration for test_incr_filesize() */ +#define FILE8 "tfile8.h5" /* Test file */ + /* 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 */ @@ -6926,6 +6929,130 @@ test_libver_macros2(void) /**************************************************************** ** +** test_filesize(): +** Verify H5Fincrement_filesize() and H5Fget_eoa() works as +** indicated in the "RFC: Enhancement to the tool h5clear". +** +****************************************************************/ +static void +test_incr_filesize(const char *env_h5_drvr) +{ + hid_t fid; /* File opened with read-write permission */ + h5_stat_size_t filesize; /* Size of file when empty */ + hid_t fcpl; /* File creation property list */ + hid_t fapl; /* File access property list */ + hid_t dspace; /* Dataspace ID */ + hid_t dset; /* Dataset ID */ + hid_t dcpl; /* Dataset creation property list */ + unsigned u; /* Local index variable */ + char filename[FILENAME_LEN]; /* Filename to use */ + char name[32]; /* Dataset name */ + haddr_t stored_eoa; /* The stored EOA value */ + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ + herr_t ret; /* Return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing H5Fincrement_filesize() and H5Fget_eoa())\n")); + + fapl = h5_fileaccess(); + h5_fixname(FILE8, fapl, filename, sizeof filename); + + /* Get the VFD feature flags */ + driver_id = H5Pget_driver(fapl); + CHECK(driver_id, FAIL, "H5Pget_driver"); + + ret = H5FDdriver_query(driver_id, &driver_flags); + CHECK(ret, FAIL, "H5PDdriver_query"); + + /* Check whether the VFD feature flag supports these two public routines */ + if(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO) { + + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + + /* Set file space strategy */ + ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, FALSE, (hsize_t)1); + CHECK(ret, FAIL, "H5P_set_file_space_strategy"); + + /* Create the test file */ + fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create dataspace for datasets */ + dspace = H5Screate(H5S_SCALAR); + CHECK(dspace, FAIL, "H5Screate"); + + /* Create a dataset creation property list */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + + /* Set the space allocation time to early */ + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); + CHECK(ret, FAIL, "H5Pset_alloc_time"); + + /* Create datasets in file */ + for(u = 0; u < 10; u++) { + sprintf(name, "Dataset %u", u); + dset = H5Dcreate2(fid, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); + + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + } /* end for */ + + /* Close dataspace */ + ret = H5Sclose(dspace); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close dataset creation property list */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Get the file size */ + filesize = h5_get_file_size(filename, fapl); + + /* Open the file */ + fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Get the stored EOA */ + ret = H5Fget_eoa(fid, &stored_eoa); + CHECK(ret, FAIL, "H5Fget_eoa"); + + /* Verify the stored EOA is the same as filesize */ + VERIFY(filesize, stored_eoa, "file size"); + + /* Set the EOA to the MAX(EOA, EOF) + 512 */ + ret = H5Fincrement_filesize(fid, 512); + CHECK(ret, FAIL, "H5Fincrement_filesize"); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Get the file size */ + filesize = h5_get_file_size(filename, fapl); + + /* Verify the filesize is the previous stored_eoa + 512 */ + VERIFY(filesize, stored_eoa+512, "file size"); + + /* Close the file access property list */ + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close the file creation property list */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); + } +} /* end test_incr_filesize() */ + +/**************************************************************** +** ** test_deprec(): ** Test deprecated functionality. ** @@ -7210,6 +7337,7 @@ test_file(void) test_libver_bounds_low_high(); test_libver_macros(); /* Test the macros for library version comparison */ test_libver_macros2(); /* Test the macros for library version comparison */ + test_incr_filesize(env_h5_drvr); /* Test H5Fincrement_filesize() and H5Fget_eoa() */ #ifndef H5_NO_DEPRECATED_SYMBOLS test_deprec(); /* Test deprecated routines */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index e3b989d..5724e1b 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -12,9 +12,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Purpose: A tool to clear the status_flags field from the file's superblock via -s option. - * A tool to remove cache image from the file via -m option. - * + * Purpose: A tool used to do the following: + * (1) -s, --status: clear the status_flags field from the file's superblock + * (2) -m, --image: remove the metadata cache image from the file + * (3) --increment=C: set the file's EOA to the maximum of (EOA, EOF) + C + * (4) --filesize: print the file's EOA and EOF */ #include "hdf5.h" #include "H5private.h" @@ -24,18 +26,25 @@ /* Name of tool */ #define PROGRAMNAME "h5clear" -/* Make this private property (defined in H5Fprivate.h) available to h5clear. */ -#define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" +/* Make these private properties (defined in H5Fprivate.h) available to h5clear. */ +#define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" +#define H5F_ACS_NULL_FSM_ADDR_NAME "null_fsm_addr" +#define H5F_ACS_SKIP_EOF_CHECK_NAME "skip_eof_check" + +/* Default increment is 1 megabytes for the --increment option */ +#define DEFAULT_INCREMENT 1024*1024 static char *fname_g = NULL; static hbool_t clear_status_flags = FALSE; static hbool_t remove_cache_image = FALSE; +static hbool_t print_filesize = FALSE; +static hbool_t increment_eoa_eof = FALSE; +static hsize_t increment = DEFAULT_INCREMENT; /* - * Command-line options: The user can specify short or long-named - * parameters. + * Command-line options: only publicize long options */ -static const char *s_opts = "hVsm"; +static const char *s_opts = "hVsmzi*"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h'}, @@ -54,6 +63,21 @@ static struct long_options l_opts[] = { { "imag", no_arg, 'm' }, { "ima", no_arg, 'm' }, { "im", no_arg, 'm' }, + { "filesize", no_arg, 'z' }, + { "filesiz", no_arg, 'z' }, + { "filesi", no_arg, 'z' }, + { "files", no_arg, 'z' }, + { "file", no_arg, 'z' }, + { "fil", no_arg, 'z' }, + { "fi", no_arg, 'z' }, + { "increment", optional_arg, 'i' }, + { "incremen", optional_arg, 'i' }, + { "increme", optional_arg, 'i' }, + { "increm", optional_arg, 'i' }, + { "incre", optional_arg, 'i' }, + { "incr", optional_arg, 'i' }, + { "inc", optional_arg, 'i' }, + { "in", optional_arg, 'i' }, { NULL, 0, '\0' } }; @@ -76,6 +100,9 @@ static void usage(const char *prog) HDfprintf(stdout, " -V, --version Print version number and exit\n"); HDfprintf(stdout, " -s, --status Clear the status_flags field in the file's superblock\n"); HDfprintf(stdout, " -m, --image Remove the metadata cache image from the file\n"); + HDfprintf(stdout, " --filesize Print the file's EOA and EOF\n"); + HDfprintf(stdout, " --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for the file \n"); + HDfprintf(stdout, " C is >= 0; C is optional and will default to 1M when not set"); HDfprintf(stdout, "\n"); HDfprintf(stdout, "Examples of use:\n"); HDfprintf(stdout, "\n"); @@ -84,6 +111,12 @@ static void usage(const char *prog) HDfprintf(stdout, "\n"); HDfprintf(stdout, "h5clear -m file_name\n"); HDfprintf(stdout, " Remove the metadata cache image from the HDF5 file .\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, "h5clear --increment file_name\n"); + HDfprintf(stdout, " Set the EOA to the maximum of (EOA, EOF) + 1M for the file .\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, "h5clear --increment=512 file_name\n"); + HDfprintf(stdout, " Set the EOA to the maximum of (EOA, EOF) + 512 for the file .\n"); } /* usage() */ @@ -131,6 +164,18 @@ parse_command_line(int argc, const char **argv) remove_cache_image = TRUE; break; + case 'z': + print_filesize = TRUE; + break; + + case 'i': + increment_eoa_eof = TRUE; + if(opt_arg != NULL && (increment = HDatoi(opt_arg)) < 0) { + usage(h5tools_getprogname()); + goto done; + } + break; + default: usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); @@ -176,8 +221,24 @@ leave(int ret) /*------------------------------------------------------------------------- * Function: main * - * Purpose: To clear the status_flags field in the file's superblock (-s option). - * To remove the cache image from the file (-m option). + * Purpose: The options are: + * (1) -s, --status: clear the status_flags field from the file's superblock + * (2) -m, --image: remove the metadata cache image from the file + * (3) --increment=C: set the file's EOA to the maximum of (EOA, EOF) + C + * (4) --filesize: print the file's EOA and EOF + * + * The three options: -s, -m, and --increment will modify the file + * so the file is opened with write access. + * The --filesize option just prints the EOA and EOF, so the file + * is opened with read access. + * + * The -s option will activate the private property: + * --H5F_ACS_CLEAR_STATUS_FLAGS_NAME + * The --increment option will active these two private properties: + * --H5F_ACS_NULL_FSM_ADDR_NAME + * --H5F_ACS_SKIP_EOF_CHECK_NAME + * The --filesize will activate the private property: + * --H5F_ACS_SKIP_EOF_CHECK_NAME * * Return: Success: 0 * Failure: 1 @@ -187,11 +248,12 @@ leave(int ret) int main (int argc, const char *argv[]) { - char *fname = NULL; /* File name */ - hid_t fapl = -1; /* File access property list */ - hid_t fid = -1; /* File ID */ + char *fname = NULL; /* File name */ + hid_t fapl = -1; /* File access property list */ + hid_t fid = -1; /* File ID */ haddr_t image_addr; hsize_t image_len; + unsigned flags = H5F_ACC_RDWR; /* file access flags */ h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -209,12 +271,22 @@ main (int argc, const char *argv[]) if(fname_g == NULL) goto done; - if(!clear_status_flags && !remove_cache_image) { + /* Print usage/exit if not using at least one of the options */ + if(!clear_status_flags && !remove_cache_image && + !increment_eoa_eof && !print_filesize) { usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); goto done; } + /* Cannot combine the --filesize option with other options */ + if(print_filesize && + (clear_status_flags || remove_cache_image || increment_eoa_eof)) { + error_msg("Cannot combine --filesize with other options\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + /* Duplicate the file name */ fname = HDstrdup(fname_g); @@ -228,7 +300,7 @@ main (int argc, const char *argv[]) /* -s option */ if(clear_status_flags) { /* Set to clear the status_flags in the file's superblock */ - /* This is a private property used by h5clear only */ + /* Activate this private property */ if(H5Pset(fapl, H5F_ACS_CLEAR_STATUS_FLAGS_NAME, &clear_status_flags) < 0) { error_msg("H5Pset\n"); h5tools_setstatus(EXIT_FAILURE); @@ -236,12 +308,64 @@ main (int argc, const char *argv[]) } } - if((fid = h5tools_fopen(fname, H5F_ACC_RDWR, fapl, NULL, NULL, (size_t)0)) < 0) { + /* --increment option */ + if(increment_eoa_eof) { + /* Activate this private property */ + if(H5Pset(fapl, H5F_ACS_SKIP_EOF_CHECK_NAME, &increment_eoa_eof) < 0) { + error_msg("H5Pset\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + /* Activate this private property */ + if(H5Pset(fapl, H5F_ACS_NULL_FSM_ADDR_NAME, &increment_eoa_eof) < 0) { + error_msg("H5Pset\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + } + + /* --filesize option; open the file read-only */ + if(print_filesize) { + /* Activate this private property */ + if(H5Pset(fapl, H5F_ACS_SKIP_EOF_CHECK_NAME, &print_filesize) < 0) { + error_msg("H5Pset\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + flags = H5F_ACC_RDONLY; + } + + /* Open the file */ + if((fid = h5tools_fopen(fname, flags, fapl, NULL, NULL, (size_t)0)) < 0) { error_msg("h5tools_fopen\n"); h5tools_setstatus(EXIT_FAILURE); goto done; } + /* --filesize option */ + if(print_filesize) { + h5_stat_t st; /* Stat info call */ + haddr_t eoa; /* The EOA value */ + + /* Get the file's EOA and EOF */ + if(H5Fget_eoa(fid, &eoa) < 0 || HDstat(fname, &st) < 0) { + error_msg("H5Fget_eoa or HDstat\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + HDfprintf(stdout, "EOA is %a; EOF is %a \n", eoa, st.st_size); + } + + /* --increment option */ + if(increment_eoa_eof) { + /* Set the file's EOA to the maximum of (EOA, EOF) + increment */ + if(H5Fincrement_filesize(fid, increment) < 0) { + error_msg("H5Fset_eoa\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + } + /* -m option */ if(remove_cache_image) { if(H5Fget_mdc_image_info(fid, &image_addr, &image_len) < 0) { @@ -253,7 +377,9 @@ main (int argc, const char *argv[]) warn_msg("No cache image in the file\n"); } + h5tools_setstatus(EXIT_SUCCESS); + done: if(fname) HDfree(fname); diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 942ae7a..5efce0a 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -20,11 +20,19 @@ # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- set (HDF5_TEST_FILES + h5clear_fsm_persist_equal.h5 + h5clear_fsm_persist_greater.h5 + h5clear_fsm_persist_less.h5 + h5clear_fsm_persist_noclose.h5 + h5clear_fsm_persist_user_equal.h5 + h5clear_fsm_persist_user_greater.h5 + h5clear_fsm_persist_user_less.h5 h5clear_log_v3.h5 h5clear_mdc_image.h5 - mod_h5clear_mdc_image.h5 + h5clear_status_noclose.h5 latest_h5clear_log_v3.h5 latest_h5clear_sec2_v3.h5 + mod_h5clear_mdc_image.h5 ) set (HDF5_SEC2_TEST_FILES h5clear_sec2_v0.h5 @@ -32,10 +40,25 @@ h5clear_sec2_v3.h5 ) set (HDF5_REFERENCE_TEST_FILES - h5clear_usage.ddl - h5clear_open_fail.ddl + h5clear_equal_after_size.ddl + h5clear_equal_before_size.ddl + h5clear_greater_after_size.ddl + h5clear_greater_before_size.ddl + h5clear_less_after_size.ddl + h5clear_less_before_size.ddl h5clear_missing_file.ddl + h5clear_noclose_after_size.ddl + h5clear_noclose_before_size.ddl h5clear_no_mdc_image.ddl + h5clear_open_fail.ddl + h5clear_status_noclose_after_size.ddl + h5clear_usage.ddl + h5clear_user_equal_after_size.ddl + h5clear_user_equal_before_size.ddl + h5clear_user_greater_after_size.ddl + h5clear_user_greater_before_size.ddl + h5clear_user_less_after_size.ddl + h5clear_user_less_before_size.ddl ) foreach (h5_file ${HDF5_TEST_FILES} ${HDF5_SEC2_TEST_FILES} ${HDF5_REFERENCE_TEST_FILES}) @@ -270,3 +293,74 @@ endif() 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") +# +# +# +# The following tests verify the filesize, increment the filesize, then verify the filesize again. +# +# (1) h5clear_status_noclose.h5 +# "h5clear --filesize h5clear_status_noclose.h5" (unable to open the file because status_flags is enabled) +# "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0) +# (no output, check exit code) +# "h5clear --filesize h5clear_status_noclose.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_open_fail_s h5clear_open_fail 1 "--filesize" h5clear_status_noclose.h5) + ADD_H5_RETTEST (h5clr_mdc_image "false" "-s" "--increment=0" h5clear_status_noclose.h5) + ADD_H5_CMP (h5clr_no_mdc_image_m h5clear_status_noclose_after_size 0 "--filesize" h5clear_status_noclose.h5) +# +# (2) h5clear_fsm_persist_noclose.h5 +# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_noclose.h5" (EOA = MAX(EOA, EOF)) (no output, just check exit code) +# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_open_fail_s h5clear_noclose_before_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) + ADD_H5_RETTEST (h5clr_mdc_image "false" "--increment=0" h5clear_fsm_persist_noclose.h5) + ADD_H5_CMP (h5clr_no_mdc_image_m h5clear_noclose_after_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) +# +# (3) h5clear_fsm_persist_equal.h5 +# "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF before the next action) +# "h5clear --increment h5clear_fsm_persist_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_equal_before_size h5clear_equal_before_size 0 "--filesize" h5clear_fsm_persist_equal.h5) + ADD_H5_RETTEST (h5clr_equal_incr "false" "--increment" h5clear_fsm_persist_equal.h5) + ADD_H5_CMP (h5clr_equal_after_size h5clear_equal_after_size 0 "--filesize" h5clear_fsm_persist_equal.h5) +# +# (4) h5clear_fsm_persist_greater.h5 +# "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_greater_before_size h5clear_greater_before_size 0 "--filesize" h5clear_fsm_persist_greater.h5) + ADD_H5_RETTEST (h5clr_greater_incr "false" "--increment=0" h5clear_fsm_persist_greater.h5) + ADD_H5_CMP (h5clr_greater_after_size h5clear_greater_after_size 0 "--filesize" h5clear_fsm_persist_greater.h5) +# +# (5) h5clear_fsm_persist_less.h5 +# "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF before the next action) +# "h5clear --increment=200 h5clear_fsm_persist_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_less_before_size h5clear_less_before_size 0 "--filesize" h5clear_fsm_persist_less.h5) + ADD_H5_RETTEST (h5clr_less_incr "false" "--increment=200" h5clear_fsm_persist_less.h5) + ADD_H5_CMP (h5clr_less_after_size h5clear_less_after_size 0 "--filesize" h5clear_fsm_persist_less.h5) +# +# (6) h5clear_fsm_persist_user_equal.h5 +# "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF before the next action) +# "h5clear --increment h5clear_fsm_persist_user_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_user_equal_before_size h5clear_user_equal_before_size 0 "--filesize" h5clear_fsm_persist_user_equal.h5) + ADD_H5_RETTEST (h5clr_user_equal_incr "false" "--increment" h5clear_fsm_persist_user_equal.h5) + ADD_H5_CMP (h5clr_user_equal_after_size h5clear_user_equal_after_size 0 "--filesize" h5clear_fsm_persist_user_equal.h5) +# +# (7) h5clear_fsm_persist_user_greater.h5 +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_user_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_user_greater_before_size h5clear_user_greater_before_size 0 "--filesize" h5clear_fsm_persist_user_greater.h5) + ADD_H5_RETTEST (h5clr_user_greater_incr "false" "--increment=0" h5clear_fsm_persist_user_greater.h5) + ADD_H5_CMP (h5clr_user_greater_after_size h5clear_user_greater_after_size 0 "--filesize" h5clear_fsm_persist_user_greater.h5) +# +# (8) h5clear_fsm_persist_user_less.h5 +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_user_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_user_less_before_size h5clear_user_less_before_size 0 "--filesize" h5clear_fsm_persist_user_less.h5) + ADD_H5_RETTEST (h5clr_user_less_incr "false" "--increment=0" h5clear_fsm_persist_user_less.h5) + ADD_H5_CMP (h5clr_user_less_after_size h5clear_user_less_after_size 0 "--filesize" h5clear_fsm_persist_user_less.h5) +# +# diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 326109c..ccb510f 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -21,10 +21,25 @@ const char *FILENAME[] = { "h5clear_sec2_v2.h5" /* 3 -- sec2 file with superblock version 2 */ }; +const char *FILENAME_ENHANCE[] = { + "h5clear_fsm_persist_equal.h5", /* 0: persisting free-space, stored EOA = actual EOF */ + "h5clear_fsm_persist_greater.h5", /* 1: persisting free-space, stored EOA > actual EOF */ + "h5clear_fsm_persist_less.h5", /* 2: persisting free-space, stored EOA < actual EOF */ + "h5clear_fsm_persist_user_equal.h5", /* 3: user block, persisting free-space, stored EOA = actual EOF */ + "h5clear_fsm_persist_user_greater.h5", /* 4: user block, persisting free-space, stored EOA > actual EOF */ + "h5clear_fsm_persist_user_less.h5", /* 5: user block, persisting free-space, stored EOA < actual EOF */ + "h5clear_status_noclose.h5", /* 6 -- v3 superblock, nonzero status_flags, no flush, exit, + stored EOA < actual EOF */ + "h5clear_fsm_persist_noclose.h5" /* 7 -- persisting free-space, no flush, exit, stored EOA < actual EOF */ +}; + #define KB 1024U #define CACHE_IMAGE_FILE "h5clear_mdc_image.h5" #define DSET "DSET" +#define DATASET "dset" +#define NUM_ELMTS 100 +#define USERBLOCK 512 /*------------------------------------------------------------------------- * Function: gen_cache_image_file @@ -118,26 +133,224 @@ error: H5Pclose(dcpl); } H5E_END_TRY; return 1; -} +} /* gen_cache_image_file() */ + +/*------------------------------------------------------------------------- + * Function: gen_enhance_files + * + * Purpose: To create the first 6 files in FILENAME_ENHANCE[]: + * (0) FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5" + * (1) FILENAME_ENHANCE[1]: "h5clear_fsm_persist_greater.h5" + * (2) FILENAME_ENHANCE[2]: "h5clear_fsm_persist_less.h5" + * (3) FILENAME_ENHANCE[3]: "h5clear_user_fsm_persist_equal.h5" + * (4) FILENAME_ENHANCE[4]: "h5clear_user_fsm_persist_greater.h5" + * (5) FILENAME_ENHANCE[5]: "h5clear_user_fsm_persist_less.h5" + * After creating the files for #1, #2, #4 #5, write invalid EOA + * value to the location where the EOA is stored in the superblock. + * Also modify the chksum in the superblock due to this change. + * + * The first call to this routine (without user block) will generate + * the first 3 files. + * The second call to this routine (with user block) will generate + * the last 3 files. + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: Vailin Choi; March 2017 + * + *------------------------------------------------------------------------- + */ +static int +gen_enhance_files(hbool_t user) +{ + hid_t fid = -1; /* File ID */ + hid_t fcpl = -1; /* File creation property list */ + hid_t fapl = -1; /* File access property list */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hsize_t dim[1]; /* Dimension sizes */ + int data[NUM_ELMTS]; /* Buffer for data */ + int fd = -1; /* The file descriptor ID */ + int64_t eoa; /* The EOA value */ + int32_t chksum; /* The chksum value */ + int i = 0 , j = 0, u = 0; /* Local index variable */ + + /* Get a copy of the default file creation property */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Check to see if user block will be added */ + if(user) { + if(H5Pset_userblock(fcpl, (hsize_t)USERBLOCK) < 0) + goto error; + u = 3; + } + + /* Set file space strategy and persisting free-space */ + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) + goto error; + + /* + * Create the file, then write invalid EOA to the file. + */ + for(i = 0+u; i < 3+u; i++) { + + /* Create the file with the file space strategy and persisting free-space */ + if((fid = H5Fcreate(FILENAME_ENHANCE[i], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) + goto error; + + /* Create the dataset */ + dim[0] = NUM_ELMTS; + if((sid = H5Screate_simple(1, dim, NULL)) < 0) + goto error; + if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + for(j = 0; j < NUM_ELMTS; j++) + data[j] = j; + + /* Write the dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) + goto error; + + /* Closing */ + if(H5Dclose(did) < 0) + goto error; + if(H5Sclose(sid) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + + /* + * No further action for: + * --FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5" + * --FILENAME_ENHANCE[3]: "h5clear_fsm_persist_user_equal.h5", + */ + if(!(i % 3)) + continue; + /* + * For the following files: + * --FILENAME_ENHANCE[1]: "h5clear_fsm_persist_greater.h5" + * --FILENAME_ENHANCE[2]: "h5clear_fsm_persist_less.h5" + * --FILENAME_ENHANCE[4]: "h5clear_fsm_persist_greater.h5" + * --FILENAME_ENHANCE[5]: "h5clear_fsm_persist_less.h5" + * + * Write invalid value to the location for stored eoa and + * update the chksum value. + */ + /* Open the file */ + if((fd = open(FILENAME_ENHANCE[i], O_RDWR, 0663)) < 0) + goto error; + + switch(i) { + case 1: /* stored EOA is > EOF */ + eoa = 3048; + chksum = 268376587; + break; + + case 2: /* stored EOA is < EOF */ + eoa = 512; + chksum = 372920305; + break; + + case 4: /* with userblock, stored EOA > EOF */ + eoa = 4000; + chksum = 4168810027; + break; + + case 5: /* with userblock, stored EOA < EOF */ + eoa = 3000; + chksum = 3716054346; + break; + + default: + break; + } + + /* location of "end of file address" */ + if(lseek(fd, (off_t)(28+(user?USERBLOCK:0)), SEEK_SET) < 0) + goto error; + + /* Write the bad eoa value to the file */ + if(write(fd, &eoa, sizeof(eoa)) < 0) + goto error; + + /* location of "superblock checksum" */ + if(lseek(fd, (off_t)(44+(user?USERBLOCK:0)), SEEK_SET) < 0) + goto error; + + /* Write the chksum value to the file */ + if(write(fd, &chksum, sizeof(chksum)) < 0) + goto error; + + /* Close the file */ + if(close(fd) < 0) + goto error; + + } /* end for */ + + /* Close the property list */ + if(H5Pclose(fcpl) < 0) + goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Sclose(sid); + H5Dclose(did); + H5Fclose(fid); + H5Pclose(fcpl); + } H5E_END_TRY; + return 1; +} /* gen_enhance_files() */ /*------------------------------------------------------------------------- * Function: main * - * Purpose: To create HDF5 files with non-zero status_flags in the superblock - * via flushing and exiting without closing the library. + * Purpose: Generate test files used by h5clear. * - * Due to file locking, status_flags in the superblock will be - * nonzero after H5Fcreate. The library will clear status_flags - * on file closing. This program, after "H5Fcreate" the files, - * exits without going through library closing. Thus, status_flags - * for these files are not cleared. - * The library will check consistency of status_flags when opening - * a file with superblock >= v3 and will return error accordingly. - * The library will not check status_flags when opening a file - * with < v3 superblock. + * (A) gen_cache_image_file(): + * --generate a file with cache image feature + * --"h5clear_mdc_image.h5" + * (B) gen_enhance_files(): + * --generate the first 6 files in FILENAME_ENHANCE[]: + * (0) "h5clear_fsm_persist_equal.h5" + * (1) "h5clear_fsm_persist_greater.h5" + * (2) "h5clear_fsm_persist_less.h5" + * (3) "h5clear_fsm_persist_user_equal.h5" + * (4) "h5clear_fsm_persist_user_greater.h5" + * (5) "h5clear_fsm_persist_user_less.h5" * - * These files are used by "h5clear" to see if the tool clears - * status_flags properly so users can open the files afterwards. + * (C) Generate the following FILENAME[] files in main(): + * (0a) "h5clear_sec2_v3.h5" + * (0b) "latest_h5clear_sec2_v3.h5" + * (1a) "h5clear_log_v3.h5", + * (1b) "latest_h5clear_log_v3.h5" + * (2) "h5clear_sec2_v0.h5" + * (3) "h5clear_sec2_v2.h5" + * + * These HDF5 files are created with non-zero status_flags in + * the superblock via flushing and exiting without closing the + * library. + * Due to file locking, status_flags in the superblock will be + * nonzero after H5Fcreate. The library will clear status_flags + * on file closing. + * This program, after "H5Fcreate" the files, exits without + * going through library closing. Thus, status_flags for these + * files are not cleared. + * The library will check consistency of status_flags when + * opening a file with superblock >= v3 and will return error + * accordingly. + * The library will not check status_flags when opening a file + * with < v3 superblock. + * These files are used by "h5clear" to see if the tool clears + * status_flags properly so users can open the files afterwards. + * + * (D) Generate the last two files in FILENAME_ENHANCE[] in main(): + * (6) "h5clear_status_noclose.h5", + * (7) "h5clear_fsm_persist_noclose.h5" * * Return: Success: 0 * Failure: 1 @@ -149,20 +362,30 @@ error: int main(void) { - hid_t fid; /* File ID */ - hid_t fcpl; /* File creation property list */ - hid_t fapl, new_fapl; /* File access property lists */ + hid_t fid = -1; /* File ID */ + hid_t fcpl = -1; /* File creation property list */ + hid_t fapl = -1, new_fapl = -1; /* File access property lists */ char fname[512]; /* File name */ - unsigned new_format; /* To use latest library format or not */ + unsigned new_format; /* To use latest library format or not */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hsize_t dim[1]; /* Dimension sizes */ + int data[NUM_ELMTS]; /* Buffer for data */ + int i; /* Local index variables */ /* Generate a file with cache image feature enabled */ if(gen_cache_image_file(CACHE_IMAGE_FILE) < 0) goto error; + /* Generate the first 6 files in FILENAME_ENHANCE[] */ + if(gen_enhance_files(FALSE) < 0) + goto error; + if(gen_enhance_files(TRUE) < 0) + goto error; + /* - * Generate files with invalid status_flags + * Generate files in FILENAME[] */ - /* Create a copy of the file access property list */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error; @@ -174,7 +397,11 @@ main(void) if(H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) goto error; - /* Files created within this for loop will have v3 superblock and nonzero status_flags */ + /* + * Files created within this for loop will have v3 superblock and nonzero status_flags + * --FILENAME[0]: "h5clear_sec2_v3.h5", "latest_h5clear_sec2_v3.h5" + * --FILENAME[1]: "h5clear_log_v3.h5", "latest_h5clear_log_v3.h5" + */ for(new_format = FALSE; new_format <= TRUE; new_format++) { hid_t fapl2, my_fapl; /* File access property lists */ @@ -228,7 +455,8 @@ main(void) } /* end for */ /* - * Create a sec2 file with v0 superblock but nonzero status_flags + * Create a sec2 file with v0 superblock but nonzero status_flags: + * FILENAME[2]: "h5clear_sec2_v0.h5" */ if((fid = H5Fcreate(FILENAME[2], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; @@ -239,7 +467,8 @@ main(void) /* - * Create a sec2 file with v2 superblock but nonzero status_flags + * Create a sec2 file with v2 superblock but nonzero status_flags: + * FILENAME[3]: "h5clear_sec2_v2.h5" */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) goto error; @@ -264,6 +493,100 @@ main(void) if(H5Pclose(fcpl) < 0) goto error; + /* + * Create the last two files in FILENAME_ENHANCE[]: + * --FILENAME_ENHANCE[6]: h5clear_status_noclose.h5 + * --FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5 + */ + /* + * FILENAME_ENHANCE[6]: h5clear_status_noclose.h5 + * --stored EOA < actual EOF + * --version 3 superblock + * --nonzero status_flags + * --does not persist free-space + * --does not flush the file, just exit without closing file: + * --this file is similar to the user-suppplied test file attached with HDFFV-10347 + */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set to latest format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto error; + + /* Create file with SWMR-write access */ + if((fid = H5Fcreate(FILENAME_ENHANCE[6], H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0) + goto error; + + /* Create the dataset */ + dim[0] = NUM_ELMTS; + if((sid = H5Screate_simple(1, dim, NULL)) < 0) + goto error; + if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + for(i = 0; i < NUM_ELMTS; i++) + data[i] = i; + + /* Write the dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) + goto error; + + /* Closing */ + if(H5Dclose(did) < 0) + goto error; + if(H5Sclose(sid) < 0) + goto error; + if(H5Pclose(fapl) < 0) + goto error; + + /* Does not flush and does not close the file */ + + + /* + * FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5 + * --stored EOA < actual EOF + * --persisting free-space + * --undefined fsinfo.eoa_pre_fsm_fsalloc + * --undefined fsinfo.fs_addr + * --does not flush the file, just exit without closing + */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Set file space strategy and persisting free-space */ + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) + goto error; + + /* Create the file with the set file space info */ + if((fid = H5Fcreate(FILENAME_ENHANCE[7], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) + goto error; + + /* Create the dataset */ + dim[0] = NUM_ELMTS; + if((sid = H5Screate_simple(1, dim, NULL)) < 0) + goto error; + if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + for(i = 0; i < NUM_ELMTS; i++) + data[i] = i; + + /* Write the dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) + goto error; + + /* Closing */ + if(H5Dclose(did) < 0) + goto error; + if(H5Sclose(sid) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* Does not flush and does not close the file */ + + fflush(stdout); fflush(stderr); diff --git a/tools/test/misc/testfiles/h5clear_equal_after_size.ddl b/tools/test/misc/testfiles/h5clear_equal_after_size.ddl new file mode 100644 index 0000000..1b9a4e4 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_equal_after_size.ddl @@ -0,0 +1 @@ +EOA is 1051141; EOF is 1051141 diff --git a/tools/test/misc/testfiles/h5clear_equal_before_size.ddl b/tools/test/misc/testfiles/h5clear_equal_before_size.ddl new file mode 100644 index 0000000..9beed42 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_equal_before_size.ddl @@ -0,0 +1 @@ +EOA is 2565; EOF is 2565 diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_equal.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_equal.h5 new file mode 100644 index 0000000..0577690 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_equal.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_greater.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_greater.h5 new file mode 100644 index 0000000..6358878 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_greater.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_less.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_less.h5 new file mode 100644 index 0000000..c1f3221 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_less.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_noclose.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_noclose.h5 new file mode 100644 index 0000000..57462db Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_noclose.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_user_equal.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_user_equal.h5 new file mode 100644 index 0000000..5389c41 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_user_equal.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_user_greater.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_user_greater.h5 new file mode 100644 index 0000000..f40e760 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_user_greater.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_user_less.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_user_less.h5 new file mode 100644 index 0000000..55d0cc5 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_user_less.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_greater_after_size.ddl b/tools/test/misc/testfiles/h5clear_greater_after_size.ddl new file mode 100644 index 0000000..74c8f19 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_greater_after_size.ddl @@ -0,0 +1 @@ +EOA is 3048; EOF is 3048 diff --git a/tools/test/misc/testfiles/h5clear_greater_before_size.ddl b/tools/test/misc/testfiles/h5clear_greater_before_size.ddl new file mode 100644 index 0000000..03b22fb --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_greater_before_size.ddl @@ -0,0 +1 @@ +EOA is 3048; EOF is 2565 diff --git a/tools/test/misc/testfiles/h5clear_less_after_size.ddl b/tools/test/misc/testfiles/h5clear_less_after_size.ddl new file mode 100644 index 0000000..bedf0d2 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_less_after_size.ddl @@ -0,0 +1 @@ +EOA is 2765; EOF is 2765 diff --git a/tools/test/misc/testfiles/h5clear_less_before_size.ddl b/tools/test/misc/testfiles/h5clear_less_before_size.ddl new file mode 100644 index 0000000..50ba4c4 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_less_before_size.ddl @@ -0,0 +1 @@ +EOA is 512; EOF is 2565 diff --git a/tools/test/misc/testfiles/h5clear_missing_file.ddl b/tools/test/misc/testfiles/h5clear_missing_file.ddl index 1e5150c..13eb2c9 100644 --- a/tools/test/misc/testfiles/h5clear_missing_file.ddl +++ b/tools/test/misc/testfiles/h5clear_missing_file.ddl @@ -4,7 +4,9 @@ usage: h5clear [OPTIONS] file_name -V, --version Print version number and exit -s, --status Clear the status_flags field in the file's superblock -m, --image Remove the metadata cache image from the file - + --filesize Print the file's EOA and EOF + --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for the file + C is >= 0; C is optional and will default to 1M when not set Examples of use: h5clear -s file_name @@ -12,4 +14,10 @@ h5clear -s file_name h5clear -m file_name Remove the metadata cache image from the HDF5 file . + +h5clear --increment file_name + Set the EOA to the maximum of (EOA, EOF) + 1M for the file . + +h5clear --increment=512 file_name + Set the EOA to the maximum of (EOA, EOF) + 512 for the file . h5clear error: missing file name diff --git a/tools/test/misc/testfiles/h5clear_noclose_after_size.ddl b/tools/test/misc/testfiles/h5clear_noclose_after_size.ddl new file mode 100644 index 0000000..7846b47 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_noclose_after_size.ddl @@ -0,0 +1 @@ +EOA is 2448; EOF is 2448 diff --git a/tools/test/misc/testfiles/h5clear_noclose_before_size.ddl b/tools/test/misc/testfiles/h5clear_noclose_before_size.ddl new file mode 100644 index 0000000..f294a6d --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_noclose_before_size.ddl @@ -0,0 +1 @@ +EOA is 2048; EOF is 2448 diff --git a/tools/test/misc/testfiles/h5clear_status_noclose.h5 b/tools/test/misc/testfiles/h5clear_status_noclose.h5 new file mode 100644 index 0000000..94a950d Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_status_noclose.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_status_noclose_after_size.ddl b/tools/test/misc/testfiles/h5clear_status_noclose_after_size.ddl new file mode 100644 index 0000000..7846b47 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_status_noclose_after_size.ddl @@ -0,0 +1 @@ +EOA is 2448; EOF is 2448 diff --git a/tools/test/misc/testfiles/h5clear_usage.ddl b/tools/test/misc/testfiles/h5clear_usage.ddl index a399ae7..32dd549 100644 --- a/tools/test/misc/testfiles/h5clear_usage.ddl +++ b/tools/test/misc/testfiles/h5clear_usage.ddl @@ -4,7 +4,9 @@ usage: h5clear [OPTIONS] file_name -V, --version Print version number and exit -s, --status Clear the status_flags field in the file's superblock -m, --image Remove the metadata cache image from the file - + --filesize Print the file's EOA and EOF + --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for the file + C is >= 0; C is optional and will default to 1M when not set Examples of use: h5clear -s file_name @@ -12,3 +14,9 @@ h5clear -s file_name h5clear -m file_name Remove the metadata cache image from the HDF5 file . + +h5clear --increment file_name + Set the EOA to the maximum of (EOA, EOF) + 1M for the file . + +h5clear --increment=512 file_name + Set the EOA to the maximum of (EOA, EOF) + 512 for the file . diff --git a/tools/test/misc/testfiles/h5clear_user_equal_after_size.ddl b/tools/test/misc/testfiles/h5clear_user_equal_after_size.ddl new file mode 100644 index 0000000..028e134 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_equal_after_size.ddl @@ -0,0 +1 @@ +EOA is 1051653; EOF is 1051653 diff --git a/tools/test/misc/testfiles/h5clear_user_equal_before_size.ddl b/tools/test/misc/testfiles/h5clear_user_equal_before_size.ddl new file mode 100644 index 0000000..ef7c391 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_equal_before_size.ddl @@ -0,0 +1 @@ +EOA is 3077; EOF is 3077 diff --git a/tools/test/misc/testfiles/h5clear_user_greater_after_size.ddl b/tools/test/misc/testfiles/h5clear_user_greater_after_size.ddl new file mode 100644 index 0000000..9d7de6f --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_greater_after_size.ddl @@ -0,0 +1 @@ +EOA is 4000; EOF is 4000 diff --git a/tools/test/misc/testfiles/h5clear_user_greater_before_size.ddl b/tools/test/misc/testfiles/h5clear_user_greater_before_size.ddl new file mode 100644 index 0000000..c3fe625 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_greater_before_size.ddl @@ -0,0 +1 @@ +EOA is 4000; EOF is 3077 diff --git a/tools/test/misc/testfiles/h5clear_user_less_after_size.ddl b/tools/test/misc/testfiles/h5clear_user_less_after_size.ddl new file mode 100644 index 0000000..02c0d2a --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_less_after_size.ddl @@ -0,0 +1 @@ +EOA is 3277; EOF is 3277 diff --git a/tools/test/misc/testfiles/h5clear_user_less_before_size.ddl b/tools/test/misc/testfiles/h5clear_user_less_before_size.ddl new file mode 100644 index 0000000..0651c2b --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_less_before_size.ddl @@ -0,0 +1 @@ +EOA is 3000; EOF is 3077 diff --git a/tools/test/misc/testh5clear.sh.in b/tools/test/misc/testh5clear.sh.in index 2966b2c..11c2ff9 100644 --- a/tools/test/misc/testh5clear.sh.in +++ b/tools/test/misc/testh5clear.sh.in @@ -66,6 +66,21 @@ $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/h5clear_status_noclose_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_noclose_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_noclose_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_equal_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_equal_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_greater_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_greater_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_less_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_less_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_equal_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_equal_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_greater_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_greater_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_less_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_less_after_size.ddl $SRC_H5CLEAR_TESTFILES/h5clear_sec2_v0.h5 $SRC_H5CLEAR_TESTFILES/h5clear_sec2_v2.h5 $SRC_H5CLEAR_TESTFILES/h5clear_sec2_v3.h5 @@ -74,6 +89,14 @@ $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 +$SRC_H5CLEAR_TESTFILES/h5clear_status_noclose.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_noclose.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_equal.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_greater.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_less.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_user_equal.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_user_greater.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_user_less.h5 " COPY_TESTFILES_TO_TESTDIR() @@ -152,7 +175,8 @@ TOOLTEST_OUT() { fname=$1 option1=$2 option2=$3 - expected=$4 + option3=$4 + expected=$5 # Prepare expected and actual output expect="$TESTDIR/$expected" actual="$TESTDIR/`basename $expected .ddl`.out" @@ -161,10 +185,10 @@ TOOLTEST_OUT() { actual_err_sav=${actual_err}-sav # Run test. - TESTING $H5CLEAR $option1 $option2 $fname + TESTING $H5CLEAR $option1 $option2 $option3 $option4 $fname ( cd $TESTDIR - $RUNSERIAL $H5CLEAR_BIN $option1 $option2 $fname + $RUNSERIAL $H5CLEAR_BIN $option1 $option2 $option3 $option4 $fname ) >$actual 2>$actual_err cp $actual $actual_sav cp $actual_err $actual_err_sav @@ -245,17 +269,16 @@ $CP -f $TESTDIR/h5clear_sec2_v3.h5 $TESTDIR/orig_h5clear_sec2_v3.h5 # "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 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 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 -# +TOOLTEST_OUT "" -h "" "" h5clear_usage.ddl +TOOLTEST_OUT "" "" "" "" h5clear_usage.ddl +TOOLTEST_OUT junk.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 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: @@ -285,8 +308,8 @@ 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 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 +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 # # # @@ -319,6 +342,73 @@ OPEN_CHK h5clear_sec2_v2.h5 $SUCCEED # # # +# (1) h5clear_status_noclose.h5 +# "h5clear --filesize h5clear_status_noclose.h5" (unable to open the file because status_flag is on) +# "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0) +# (no output, check exit code) +# "h5clear --filesize h5clear_status_noclose_user.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_status_noclose.h5 --filesize "" "" h5clear_open_fail.ddl +TOOLTEST h5clear_status_noclose.h5 -s --increment=0 $SUCCEED +TOOLTEST_OUT h5clear_status_noclose.h5 --filesize "" "" h5clear_status_noclose_after_size.ddl +# +# (2) h5clear_fsm_persist_noclose.h5 +# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_noclose.h5" (EOA = MAX(EOA, EOF)) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_noclose.h5 --filesize "" "" h5clear_noclose_before_size.ddl +TOOLTEST h5clear_fsm_persist_noclose.h5 --increment=0 "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_noclose.h5 --filesize "" "" h5clear_noclose_after_size.ddl +# +# (3) h5clear_fsm_persist_equal.h5 +# "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF before the next action) +# "h5clear --increment h5clear_fsm_persist_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_equal.h5 --filesize "" "" h5clear_equal_before_size.ddl +TOOLTEST h5clear_fsm_persist_equal.h5 --increment "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_equal.h5 --filesize "" "" h5clear_equal_after_size.ddl +# +# (4) h5clear_fsm_persist_greater.h5 +# "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_greater.h5 --filesize "" "" h5clear_greater_before_size.ddl +TOOLTEST h5clear_fsm_persist_greater.h5 --increment=0 "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_greater.h5 --filesize "" "" h5clear_greater_after_size.ddl +# +# (5) h5clear_fsm_persist_less.h5 +# "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF before the next action) +# "h5clear --increment=200 h5clear_fsm_persist_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_less.h5 --filesize "" "" h5clear_less_before_size.ddl +TOOLTEST h5clear_fsm_persist_less.h5 --increment=200 "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_less.h5 --filesize "" "" h5clear_less_after_size.ddl +# +# (6) h5clear_fsm_persist_user_equal.h5 +# "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF before the next action) +# "h5clear --increment h5clear_fsm_persist_user_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_user_equal.h5 --filesize "" "" h5clear_user_equal_before_size.ddl +TOOLTEST h5clear_fsm_persist_user_equal.h5 --increment "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_user_equal.h5 --filesize "" "" h5clear_user_equal_after_size.ddl +# +# (7) h5clear_fsm_persist_user_greater.h5 +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_user_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_user_greater.h5 --filesize "" "" h5clear_user_greater_before_size.ddl +TOOLTEST h5clear_fsm_persist_user_greater.h5 --increment=0 "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_user_greater.h5 --filesize "" "" h5clear_user_greater_after_size.ddl +# +# (8) h5clear_fsm_persist_user_less.h5 +# "h5clear --filesize h5clear_fsm_persist_user_less.h5" (print EOA/EOF before the next action) +# "h5clear --increment=200 h5clear_fsm_persist_user_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_less.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_user_less.h5 --filesize "" "" h5clear_user_less_before_size.ddl +TOOLTEST h5clear_fsm_persist_user_less.h5 --increment=200 "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_user_less.h5 --filesize "" "" h5clear_user_less_after_size.ddl +# +# +# # Clean up test files if test -z "$HDF5_NOCLEANUP"; then rm -f h5clear_*.h5 latest_h5clear*.h5 -- cgit v0.12 From 1651db060844acd4203f066e539f380318a7f70f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 12 Mar 2018 10:59:07 -0500 Subject: HDFFV-10418 adjust build commands to match main library build --- fortran/src/CMakeLists.txt | 4 ++-- hl/fortran/src/CMakeLists.txt | 44 ++++++++++++++++++++++++++----------------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 64cf739..3abab4e 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_F90_SRC C CXX Fortran) +project (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- # configure def file for shared libs on windows @@ -295,7 +295,7 @@ if (BUILD_SHARED_LIBS) ) if (WIN32) set_property (TARGET ${HDF5_F90_LIBSH_TARGET} - APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_DLL;HDF5F90_WINDOWS" + APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_DLL;HDF5F90_WINDOWS" ) endif () set (install_targets ${install_targets} ${HDF5_F90_LIBSH_TARGET}) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 82be551..6dd94fe 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT(HDF5_HL_F90_SRC C CXX Fortran) +project (HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- # configure def file for shared libs on windows @@ -37,10 +37,10 @@ set_target_properties (H5HL_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") + file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/shared") set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE}) endif () -file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") +file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- @@ -110,34 +110,34 @@ set (HDF5_HL_F90_F_BASE_SOURCES ) add_custom_command ( - OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + OUTPUT ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/H5TBff_gen.F90 COMMAND $ - WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/static + WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/static DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files" ) add_custom_target (H5HLgen ALL - DEPENDS ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + DEPENDS ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/H5TBff_gen.F90 ) set_source_files_properties ( - ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5TBff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90 PROPERTIES GENERATED TRUE ) if (BUILD_SHARED_LIBS) add_custom_command ( - OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 + OUTPUT ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 COMMAND $ - WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/shared + WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/shared DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files" ) add_custom_target (H5HLgenSH ALL - DEPENDS ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 + DEPENDS ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 ) set_source_files_properties ( - ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 PROPERTIES GENERATED TRUE ) endif () @@ -146,8 +146,8 @@ set (HDF5_HL_F90_F_SOURCES ${HDF5_HL_F90_F_BASE_SOURCES} # generated files - ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5TBff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90 ) set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran) @@ -156,8 +156,8 @@ if (BUILD_SHARED_LIBS) ${HDF5_HL_F90_F_BASE_SOURCES} # generated files - ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 ) set_source_files_properties (${HDF5_HL_F90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran) endif () @@ -165,6 +165,10 @@ endif () add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES}) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +target_include_directories (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + target_include_directories (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) +endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC) set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES @@ -189,11 +193,17 @@ if (BUILD_SHARED_LIBS) endif () TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) + target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS}) + target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) + endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_LIB_NAME} SHARED ${HDF5_HL_F_PACKAGE_SOVERSION}) set_target_properties (${HDF5_HL_F90_LIBSH_TARGET} PROPERTIES FOLDER libraries/hl/fortran LINKER_LANGUAGE Fortran + COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB" INTERFACE_INCLUDE_DIRECTORIES "$/include>" INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared -- cgit v0.12 From 2adf6c741fcd984a3067373e03023e71a8d721a9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 12 Mar 2018 13:40:38 -0500 Subject: Remove obsolete files --- MANIFEST | 7 ------- 1 file changed, 7 deletions(-) diff --git a/MANIFEST b/MANIFEST index 805c8d9..7d28f12 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3101,7 +3101,6 @@ ./config/cmake_ext_mod/ConfigureChecks.cmake ./config/cmake_ext_mod/CTestCustom.cmake -./config/cmake_ext_mod/FindMPI.cmake ./config/cmake_ext_mod/FindSZIP.cmake ./config/cmake_ext_mod/GetTimeOfDayTest.cpp ./config/cmake_ext_mod/grepTest.cmake @@ -3117,12 +3116,6 @@ ./config/cmake_ext_mod/NSIS.template.in ./config/cmake_ext_mod/runTest.cmake ./config/cmake_ext_mod/version.plist.in -./config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in -./config/cmake_ext_mod/FindMPI/libver_mpi.c -./config/cmake_ext_mod/FindMPI/libver_mpi.f90.in -./config/cmake_ext_mod/FindMPI/mpiver.f90.in -./config/cmake_ext_mod/FindMPI/test_mpi.c -./config/cmake_ext_mod/FindMPI/test_mpi.f90.in # CMake-specific User Files ./config/cmake/UserMacros/Windows_MT.cmake -- cgit v0.12 From 6a53c14240872fcc82504fffaa010d754a8c73e0 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 12 Mar 2018 13:47:27 -0500 Subject: Add HDfree of vector, matrix_out and matrix_out1 previously HDmalloced in coll_write_test(). --- testpar/t_span_tree.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index 20bc4ac..f4de133 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -255,7 +255,7 @@ void coll_write_test(int chunk_factor) #endif - int *matrix_out, *matrix_out1, *vector; + int *matrix_out = NULL, *matrix_out1 = NULL, *vector = NULL; int mpi_size,mpi_rank; @@ -662,6 +662,13 @@ void coll_write_test(int chunk_factor) ret = H5Fclose(file); VRFY((ret >= 0),""); + if (vector != NULL) + HDfree(vector); + if (matrix_out != NULL) + HDfree(matrix_out); + if (matrix_out1 != NULL) + HDfree(matrix_out1); + return ; } -- cgit v0.12 From 5d7c18fcfc14a53f4d6321460463357fbda61f4b Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 12 Mar 2018 14:10:59 -0500 Subject: Remove comparison to NULL for variables to be freed. --- testpar/t_span_tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index f4de133..3c836ad 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -662,11 +662,11 @@ void coll_write_test(int chunk_factor) ret = H5Fclose(file); VRFY((ret >= 0),""); - if (vector != NULL) + if (vector) HDfree(vector); - if (matrix_out != NULL) + if (matrix_out) HDfree(matrix_out); - if (matrix_out1 != NULL) + if (matrix_out1) HDfree(matrix_out1); return ; -- cgit v0.12 From 1a3beaadce81ad257d186c9dca8906577cce58b0 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Mon, 12 Mar 2018 16:17:10 -0400 Subject: Unify the test (t_bigio.c) between hdf5_1_10 and develop --- testpar/t_bigio.c | 395 +++++++++++------------------------------------------- 1 file changed, 79 insertions(+), 316 deletions(-) diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 611ff1a..fdd3488 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -3,7 +3,10 @@ #include "testphdf5.h" #include "H5Dprivate.h" /* For Chunk tests */ -// int TestVerbosity = VERBO_LO; /* Default Verbosity is Low */ +/* FILENAME and filenames must have the same number of names */ +const char *FILENAME[2]={ "bigio_test.h5", + NULL + }; /* Constants definitions */ #define MAX_ERR_REPORT 10 /* Maximum number of errors reported */ @@ -38,7 +41,6 @@ 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; @@ -506,7 +508,7 @@ dataset_big_write(void) 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); + fid = H5Fcreate(FILENAME[0], H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ @@ -515,7 +517,8 @@ dataset_big_write(void) /* Each process takes a slabs of rows. */ - printf("\nTesting Dataset1 write by ROW\n"); + if (mpi_rank == 0) + HDprintf("\nTesting Dataset1 write by ROW\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = mpi_size; @@ -563,21 +566,6 @@ dataset_big_write(void) 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"); @@ -591,9 +579,9 @@ dataset_big_write(void) VRFY((ret >= 0), "H5Dclose1 succeeded"); - /* Each process takes a slabs of cols. */ - printf("\nTesting Dataset2 write by COL\n"); + if (mpi_rank == 0) + HDprintf("\nTesting Dataset2 write by COL\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = mpi_size; @@ -641,21 +629,6 @@ dataset_big_write(void) 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"); @@ -671,7 +644,8 @@ dataset_big_write(void) /* ALL selection */ - printf("\nTesting Dataset3 write select ALL proc 0, NONE others\n"); + if (mpi_rank == 0) + HDprintf("\nTesting Dataset3 write select ALL proc 0, NONE others\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = 1; @@ -685,7 +659,7 @@ dataset_big_write(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if(MAINPROCESS) { + if(mpi_rank == 0) { ret = H5Sselect_all(file_dataspace); VRFY((ret >= 0), "H5Sset_all succeeded"); } @@ -697,7 +671,7 @@ dataset_big_write(void) /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, dims, NULL); VRFY((mem_dataspace >= 0), ""); - if(!MAINPROCESS) { + if(!mpi_rank == 0) { ret = H5Sselect_none(mem_dataspace); VRFY((ret >= 0), "H5Sset_none succeeded"); } @@ -719,21 +693,6 @@ dataset_big_write(void) 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"); @@ -747,7 +706,8 @@ dataset_big_write(void) VRFY((ret >= 0), "H5Dclose1 succeeded"); /* Point selection */ - printf("\nTesting Dataset4 write point selection\n"); + if (mpi_rank == 0) + HDprintf("\nTesting Dataset4 write point selection\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = mpi_size * 4; @@ -818,101 +778,7 @@ dataset_big_write(void) 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); } @@ -960,15 +826,16 @@ dataset_big_read(void) H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); /* open the file collectively */ - fid=H5Fopen(filename,H5F_ACC_RDONLY,acc_tpl); + fid=H5Fopen(FILENAME[0],H5F_ACC_RDONLY,acc_tpl); VRFY((fid >= 0), "H5Fopen succeeded"); /* Release file-access template */ ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); + if (mpi_rank == 0) + HDprintf("\nRead Testing Dataset1 by COL\n"); - printf("\nRead Testing Dataset1 by COL\n"); dataset = H5Dopen2(fid, DATASET1, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dopen2 succeeded"); @@ -1016,18 +883,6 @@ dataset_big_read(void) 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);} @@ -1040,7 +895,8 @@ dataset_big_read(void) VRFY((ret >= 0), "H5Dclose1 succeeded"); - printf("\nRead Testing Dataset2 by ROW\n"); + if (mpi_rank == 0) + HDprintf("\nRead Testing Dataset2 by ROW\n"); memset(rdata, 0, bigcount*sizeof(B_DATATYPE)); dataset = H5Dopen2(fid, DATASET2, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dopen2 succeeded"); @@ -1089,18 +945,6 @@ dataset_big_read(void) 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);} @@ -1112,8 +956,8 @@ dataset_big_read(void) ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose1 succeeded"); - - printf("\nRead Testing Dataset3 read select ALL proc 0, NONE others\n"); + if (mpi_rank == 0) + HDprintf("\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"); @@ -1124,7 +968,7 @@ dataset_big_read(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if(MAINPROCESS) { + if(mpi_rank == 0) { ret = H5Sselect_all(file_dataspace); VRFY((ret >= 0), "H5Sset_all succeeded"); } @@ -1136,7 +980,7 @@ dataset_big_read(void) /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, dims, NULL); VRFY((mem_dataspace >= 0), ""); - if(!MAINPROCESS) { + if(!mpi_rank == 0) { ret = H5Sselect_none(mem_dataspace); VRFY((ret >= 0), "H5Sset_none succeeded"); } @@ -1163,19 +1007,7 @@ dataset_big_read(void) 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) { + if(mpi_rank == 0) { /* 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);} @@ -1188,7 +1020,8 @@ dataset_big_read(void) ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose1 succeeded"); - printf("\nRead Testing Dataset4 with Point selection\n"); + if (mpi_rank == 0) + HDprintf("\nRead Testing Dataset4 with Point selection\n"); dataset = H5Dopen2(fid, DATASET4, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dopen2 succeeded"); @@ -1258,131 +1091,33 @@ dataset_big_read(void) 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 */ - 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"); - + if (file_dataspace != -1) H5Sclose(file_dataspace); + if (mem_dataspace != -1) H5Sclose(mem_dataspace); + if (xfer_plist != -1) H5Pclose(xfer_plist); + if (dataset != -1) { + ret = H5Dclose(dataset); + VRFY((ret >= 0), "H5Dclose1 succeeded"); + } H5Fclose(fid); /* release data buffers */ if(rdata) free(rdata); if(wdata) free(wdata); -#endif + } /* dataset_large_readAll */ @@ -1478,7 +1213,8 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) void coll_chunk1(void) { - if (MAINPROCESS) + const char *filename = FILENAME[0]; + if (mpi_rank == 0) printf("coll_chunk1\n"); coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); @@ -1531,7 +1267,8 @@ coll_chunk1(void) void coll_chunk2(void) { - if (MAINPROCESS) + const char *filename = FILENAME[0]; + if (mpi_rank == 0) printf("coll_chunk2\n"); coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); @@ -1585,8 +1322,9 @@ coll_chunk2(void) void coll_chunk3(void) { - if (MAINPROCESS) - printf("coll_chunk3\n"); + const char *filename = FILENAME[0]; + if (mpi_rank == 0) + 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); @@ -1956,7 +1694,7 @@ coll_chunktest(const char* filename, 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); + file = H5Fopen(FILENAME[0],H5F_ACC_RDONLY,acc_plist); VRFY((file >= 0),"H5Fcreate succeeded"); status = H5Pclose(acc_plist); @@ -2134,16 +1872,34 @@ int main(int argc, char **argv) { int ExpressMode = 0; hsize_t newsize = 1048576; + /* Set the bigio processing limit to be 'newsize' bytes */ hsize_t oldsize = H5S_mpio_set_bigio_count(newsize); + /* Having set the bigio handling to a size that is managable, + * we'll set our 'bigcount' variable to be 2X that limit so + * that we try to ensure that our bigio handling is actually + * envoked and tested. + */ if (newsize != oldsize) { - bigcount = newsize * 2; + bigcount = newsize * 2; } MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + /* Attempt to turn off atexit post processing so that in case errors + * happen during the test and the process is aborted, it will not get + * hang in the atexit post processing in which it may try to make MPI + * calls. By then, MPI calls may not work. + */ + if (H5dont_atexit() < 0){ + HDprintf("Failed to turn off atexit processing. Continue.\n"); + }; + + /* set alarm. */ + ALARM_ON; + ExpressMode = do_express_test(mpi_rank); dataset_big_write(); @@ -2153,7 +1909,8 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); if (ExpressMode > 0) { - printf("***Express test mode on. Several tests are skipped\n"); + if (mpi_rank == 0) + HDprintf("***Express test mode on. Several tests are skipped\n"); } else { coll_chunk1(); @@ -2163,6 +1920,12 @@ int main(int argc, char **argv) coll_chunk3(); } + /* turn off alarm */ + ALARM_OFF; + + if (mpi_rank == 0) + HDremove(FILENAME[0]); + /* close HDF5 library */ H5close(); -- cgit v0.12 From 2d4d39d15763042661347e5a16de6cf154537dda Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 12 Mar 2018 19:39:20 -0500 Subject: Fixed documentation Description: - Updated the description of copy constructor for clarification. - Removed unnecessary comments. Platforms tested: Linux/64 (jelly) --- c++/src/H5AbstractDs.h | 12 ---------- c++/src/H5ArrayType.cpp | 2 +- c++/src/H5ArrayType.h | 2 +- c++/src/H5AtomType.cpp | 2 +- c++/src/H5AtomType.h | 2 +- c++/src/H5Attribute.cpp | 2 +- c++/src/H5Attribute.h | 2 +- c++/src/H5CompType.cpp | 2 +- c++/src/H5CompType.h | 2 +- c++/src/H5DataSet.cpp | 2 +- c++/src/H5DataSet.h | 2 +- c++/src/H5DataSpace.cpp | 2 +- c++/src/H5DataSpace.h | 2 +- c++/src/H5DataType.cpp | 2 +- c++/src/H5DataType.h | 2 +- c++/src/H5DcreatProp.cpp | 2 +- c++/src/H5DcreatProp.h | 2 +- c++/src/H5DxferProp.cpp | 2 +- c++/src/H5DxferProp.h | 2 +- c++/src/H5EnumType.cpp | 2 +- c++/src/H5EnumType.h | 2 +- c++/src/H5Exception.cpp | 2 +- c++/src/H5FaccProp.cpp | 2 +- c++/src/H5FaccProp.h | 2 +- c++/src/H5FcreatProp.cpp | 2 +- c++/src/H5FcreatProp.h | 2 +- c++/src/H5File.cpp | 57 +++++++++++++++++++++++------------------------- c++/src/H5File.h | 6 ++--- c++/src/H5FloatType.cpp | 2 +- c++/src/H5FloatType.h | 2 +- c++/src/H5Group.cpp | 2 +- c++/src/H5Group.h | 2 +- c++/src/H5IdComponent.h | 13 ----------- c++/src/H5IntType.cpp | 2 +- c++/src/H5IntType.h | 2 +- c++/src/H5LaccProp.cpp | 2 +- c++/src/H5LaccProp.h | 2 +- c++/src/H5LcreatProp.cpp | 2 +- c++/src/H5LcreatProp.h | 2 +- c++/src/H5Object.cpp | 29 ------------------------ c++/src/H5Object.h | 13 ----------- c++/src/H5OcreatProp.cpp | 2 +- c++/src/H5OcreatProp.h | 2 +- c++/src/H5PredType.cpp | 2 +- c++/src/H5PredType.h | 2 +- c++/src/H5PropList.cpp | 2 +- c++/src/H5PropList.h | 2 +- c++/src/H5StrType.cpp | 2 +- c++/src/H5StrType.h | 2 +- c++/src/H5VarLenType.cpp | 2 +- c++/src/H5VarLenType.h | 2 +- release_docs/RELEASE.txt | 7 +++++- 52 files changed, 81 insertions(+), 146 deletions(-) diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 16bef66..399e033 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -74,18 +74,6 @@ class H5_DLLCPP AbstractDs { // Default constructor AbstractDs(); - // *** 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. - - // Mar 2016 -BMR, AbstractDs(const hid_t h5_id); - - // 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; diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 49c31d2..836c837 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -46,7 +46,7 @@ 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. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType(const ArrayType& original) : DataType(original) {} diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 5443ae6..d99b936 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -50,7 +50,7 @@ class H5_DLLCPP ArrayType : public DataType { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("ArrayType"); } - // Copy constructor: makes copy of the original object. + // Copy constructor: same as the original ArrayType. ArrayType(const ArrayType& original); // Constructor that takes an existing id diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 5c24cf9..a9f6f36 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -47,7 +47,7 @@ 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. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AtomType::AtomType(const AtomType& original) : DataType(original) {} diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index 7ce66a0..80271ac 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -60,7 +60,7 @@ class H5_DLLCPP AtomType : public DataType { virtual H5std_string fromClass () const { return("AtomType"); } #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Copy constructor - makes copy of the original object + // Copy constructor: same as the original AtomType. AtomType(const AtomType& original); // Noop destructor diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index d90857f..ccba623 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -51,7 +51,7 @@ Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: Attribute copy constructor -///\brief Copy constructor: makes a copy of the original Attribute object. +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: Original Attribute object to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 823947e..c6fdaec 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -29,7 +29,7 @@ namespace H5 { class H5_DLLCPP Attribute : public AbstractDs, public H5Location { public: - // Copy constructor: makes a copy of an existing Attribute object. + // Copy constructor: same as the original Attribute. Attribute(const Attribute& original); // Default constructor diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 3731fd4..8252d76 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -40,7 +40,7 @@ CompType::CompType() : DataType() {} //-------------------------------------------------------------------------- // Function: CompType copy constructor -///\brief Copy constructor: makes copy of the original CompType object +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: Original CompType instance // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index a811b4a..d85e2ed 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -36,7 +36,7 @@ class H5_DLLCPP CompType : public DataType { // Gets the compound datatype of the specified dataset CompType(const DataSet& dataset); // H5Dget_type - // Copy constructor - makes a copy of original object + // Copy constructor - same as the original CompType. CompType(const CompType& original); // Constructors that open a compound datatype, given a location. diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index fb9b57e..fbddd8d 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -68,7 +68,7 @@ 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. +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: DataSet instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index f9d2ec3..104ccea 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -93,7 +93,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { // Default constructor. DataSet(); - // Copy constructor. + // Copy constructor - same as the original DataSet. DataSet(const DataSet& original); // Creates a copy of an existing DataSet using its id. diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index b563da4..e8e5712 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -133,7 +133,7 @@ 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. +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: DataSpace object to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index ed141a3..54c68ac 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -36,7 +36,7 @@ class H5_DLLCPP DataSpace : public IdComponent { // 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. + // Copy constructor - same as the original DataSpace. DataSpace(const DataSpace& original); // Assignment operator diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 032937d..a6b8c24 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -125,7 +125,7 @@ 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 +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType::DataType(const DataType& original) : H5Object(), id(original.id), encoded_buf(NULL), buf_size(0) diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 906ccef..52fd4de 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -30,7 +30,7 @@ class H5_DLLCPP DataType : public H5Object { // 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 + // Copy constructor - same as the original DataType. DataType(const DataType& original); // Creates a copy of a predefined type diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 6ed77e3..0c2a8c0 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -95,7 +95,7 @@ DSetCreatPropList::DSetCreatPropList() : ObjCreatPropList(H5P_DATASET_CREATE) {} //-------------------------------------------------------------------------- // Function: DSetCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original /// DSetCreatPropList object // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 89318e8..9f54e8d 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -122,7 +122,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DSetCreatPropList"); } - // Copy constructor: creates a copy of a DSetCreatPropList object. + // Copy constructor - same as the original DSetCreatPropList. DSetCreatPropList(const DSetCreatPropList& orig); // Creates a copy of an existing dataset creation property list diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 21e18e7..90ecf88 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -101,7 +101,7 @@ DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET //-------------------------------------------------------------------------- // Function DSetMemXferPropList copy constructor -///\brief Copy constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original /// DSetMemXferPropList object ///\param original - IN: Original dataset memory and transfer property /// list object to copy diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 75205cf..6955778 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -102,7 +102,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DSetMemXferPropList"); } - // Copy constructor: makes a copy of a DSetMemXferPropList object. + // Copy constructor - same as the original DSetMemXferPropList. DSetMemXferPropList(const DSetMemXferPropList& orig); // Creates a copy of an existing dataset memory and transfer diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 91866d7..00b726c 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -53,7 +53,7 @@ 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. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::EnumType(const EnumType& original) : DataType( original ) {} diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index e0d5b88..4797ee7 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -75,7 +75,7 @@ class H5_DLLCPP EnumType : public DataType { // Creates an enumeration datatype using an existing id EnumType(const hid_t existing_id); - // Copy constructor: makes a copy of the original EnumType object. + // Copy constructor: same as the original EnumType. EnumType(const EnumType& original); virtual ~EnumType(); diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index c52a279..cf9e577 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -39,7 +39,7 @@ Exception::Exception(const H5std_string& func, const H5std_string& message) : de //-------------------------------------------------------------------------- // Function: Exception copy constructor -///\brief Copy constructor: makes a copy of the original Exception object. +///\brief Copy constructor: same HDF5 object as \a original ///\param orig - IN: Exception instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 9e1098b..286f6e7 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -88,7 +88,7 @@ FileAccPropList::FileAccPropList() : PropList(H5P_FILE_ACCESS) {} //-------------------------------------------------------------------------- // Function: FileAccPropList copy constructor -///\brief Copy Constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: FileAccPropList instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 1df8fc8..58f049e 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -136,7 +136,7 @@ class H5_DLLCPP FileAccPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("FileAccPropList"); } - // Copy constructor: creates a copy of a FileAccPropList object. + // Copy constructor: same as the original FileAccPropList. FileAccPropList(const FileAccPropList& original); // Creates a copy of an existing file access property list diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 98a35cb..9b0fecc 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -86,7 +86,7 @@ FileCreatPropList::FileCreatPropList() : PropList(H5P_FILE_CREATE) {} //-------------------------------------------------------------------------- // Function: FileCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original /// FileCreatPropList object. ///\param original - IN: FileCreatPropList instance to copy // Programmer Binh-Minh Ribler - 2000 diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 31a944c..cc28920 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -79,7 +79,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass() const { return("FileCreatPropList"); } - // Copy constructor: creates a copy of a FileCreatPropList object. + // Copy constructor: same as the original FileCreatPropList. FileCreatPropList(const FileCreatPropList& orig); // Creates a copy of an existing file create property list diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 2c7ac51..f5246f9 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -46,7 +46,7 @@ namespace H5 { //-------------------------------------------------------------------------- // Function H5File default constructor ///\brief Default constructor: creates a stub H5File object. -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- H5File::H5File() : Group(), id(H5I_INVALID_HID) {} @@ -78,7 +78,7 @@ H5File::H5File() : Group(), id(H5I_INVALID_HID) {} // 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 +// December 2000 //-------------------------------------------------------------------------- H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { @@ -103,7 +103,7 @@ H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& cr // 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 +// December 2000 //-------------------------------------------------------------------------- H5File::H5File(const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { @@ -118,7 +118,6 @@ 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 // Modification // - removed H5F_ACC_CREAT because H5Fcreate will fail with // H5F_ACC_CREAT. - BMR, Sep 17, 2014 @@ -153,7 +152,6 @@ 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 // Description // Mar 29, 2015 // Added in responding to a request from user Jason Newton. @@ -172,10 +170,10 @@ H5File::H5File(hid_t existing_id) : Group() //-------------------------------------------------------------------------- // Function: H5File copy constructor -///\brief Copy constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original /// H5File object. ///\param original - IN: H5File instance to copy -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- H5File::H5File(const H5File& original) : Group() { @@ -189,7 +187,7 @@ H5File::H5File(const H5File& original) : Group() ///\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 +// December 2000 //-------------------------------------------------------------------------- bool H5File::isHdf5(const char* name) { @@ -211,7 +209,7 @@ bool H5File::isHdf5(const char* name) ///\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 +// December 2000 //-------------------------------------------------------------------------- bool H5File::isHdf5(const H5std_string& name) { @@ -234,7 +232,7 @@ bool H5File::isHdf5(const H5std_string& name) /// /// H5F_ACC_RDONLY: Open with read only access. - default /// -// Programmer Binh-Minh Ribler - Oct, 2005 +// October 2005 //-------------------------------------------------------------------------- void H5File::openFile(const char* name, unsigned int flags, const FileAccPropList& access_plist) { @@ -261,7 +259,7 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis ///\param flags - IN: File access flags ///\param access_plist - IN: File access property list. Default to /// FileAccPropList::DEFAULT -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAccPropList& access_plist) { @@ -276,7 +274,6 @@ void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAc // Description // 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 @@ -303,10 +300,10 @@ void H5File::reOpen() //-------------------------------------------------------------------------- // Function: H5File::getCreatePlist -///\brief Returns the creation property list of this file +///\brief Returns a copy of the creation property list of this file ///\return FileCreatPropList object ///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- FileCreatPropList H5File::getCreatePlist() const { @@ -327,10 +324,10 @@ FileCreatPropList H5File::getCreatePlist() const //-------------------------------------------------------------------------- // Function: H5File::getAccessPlist -///\brief Returns the access property list of this file +///\brief Returns a copy of the access property list of this file ///\return FileAccPropList object ///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- FileAccPropList H5File::getAccessPlist() const { @@ -357,7 +354,7 @@ FileAccPropList H5File::getAccessPlist() const ///\par Description /// The retrieved information may include information about /// superblock extension, free space management, and shared object -// Programmer Binh-Minh Ribler - February 2017 +// February 2017 //-------------------------------------------------------------------------- void H5File::getFileInfo(H5F_info2_t& file_info) const { @@ -373,7 +370,7 @@ void H5File::getFileInfo(H5F_info2_t& file_info) const ///\brief Returns the amount of free space in the file. ///\return Amount of free space ///\exception H5::FileIException -// Programmer Binh-Minh Ribler - May 2004 +// May 2004 //-------------------------------------------------------------------------- hssize_t H5File::getFreeSpace() const { @@ -405,7 +402,7 @@ hssize_t H5File::getFreeSpace() const /// | \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 +// May 2004 //-------------------------------------------------------------------------- ssize_t H5File::getObjCount(unsigned types) const { @@ -440,7 +437,7 @@ ssize_t H5File::getObjCount(unsigned types) const /// Multiple object types can be combined with the logical OR operator (|). // // Notes: will do the overload for this one after hearing from Quincey??? -// Programmer Binh-Minh Ribler - May 2004 +// May 2004 //-------------------------------------------------------------------------- void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const { @@ -468,7 +465,7 @@ void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const /// 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 +// May 2004 //-------------------------------------------------------------------------- void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const { @@ -489,7 +486,7 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const // 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 +// May 2004 // Modification // Planned for removal. -BMR, 2014/04/16 // Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 @@ -508,7 +505,7 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const ///\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 +// May 2004 //-------------------------------------------------------------------------- void H5File::getVFDHandle(void **file_handle) const { @@ -550,7 +547,7 @@ hsize_t H5File::getFileSize() const // 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 +// May, 2008 //-------------------------------------------------------------------------- hid_t H5File::getId() const { @@ -564,7 +561,7 @@ hid_t H5File::getId() const // Exception H5::FileIException // Description // This function is replaced by the above function reOpen. -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- void H5File::reopen() { @@ -577,7 +574,7 @@ void H5File::reopen() // 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 +// December 2000 // Deprecated: // Aug 18, 2016 -BMR // After HDFFV-9920, the Group's methods can use getId() and @@ -598,7 +595,7 @@ hid_t H5File::getLocId() const // 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 +// December 2000 //-------------------------------------------------------------------------- void H5File::p_setId(const hid_t new_id) { @@ -619,7 +616,7 @@ void H5File::p_setId(const hid_t new_id) ///\brief Closes this HDF5 file. /// ///\exception H5::FileIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +// March 2005 //-------------------------------------------------------------------------- void H5File::close() { @@ -646,7 +643,7 @@ void H5File::close() // 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 +// December 2000 //-------------------------------------------------------------------------- void H5File::throwException(const H5std_string& func_name, const H5std_string& msg) const { @@ -658,7 +655,7 @@ void H5File::throwException(const H5std_string& func_name, const H5std_string& m //-------------------------------------------------------------------------- // Function: H5File destructor ///\brief Properly terminates access to this file. -// Programmer Binh-Minh Ribler - 2000 +// December 2000 // Modification // - Replaced resetIdComponent() with decRefCount() to use C // library ID reference counting mechanism - BMR, Feb 20, 2005 diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 214feb0..473428a 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -41,10 +41,10 @@ class H5_DLLCPP H5File : public Group { // Close this file. virtual void close(); - // Gets the access property list of this file. + // Gets a copy of the access property list of this file. FileAccPropList getAccessPlist() const; - // Gets the creation property list of this file. + // Gets a copy of the creation property list of this file. FileCreatPropList getCreatePlist() const; // Gets general information about this file. @@ -97,7 +97,7 @@ class H5_DLLCPP H5File : public Group { // Default constructor H5File(); - // Copy constructor: makes a copy of the original H5File object. + // Copy constructor: same as the original H5File. H5File(const H5File& original); // Gets the HDF5 file id. diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 9703149..0a2c107 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -66,7 +66,7 @@ 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. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::FloatType(const FloatType& original) : AtomType( original ){} diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index d26df5c..f74a9ae 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -71,7 +71,7 @@ class H5_DLLCPP FloatType : public AtomType { // 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. + // Copy constructor: same as the original FloatType. FloatType(const FloatType& original); // Noop destructor. diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index c4c7017..25e67d3 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -53,7 +53,7 @@ Group::Group() : H5Object(), CommonFG(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: Group copy constructor -///\brief Copy constructor: makes a copy of the original Group object. +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: Original group to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index b3a9007..70b6bff 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -53,7 +53,7 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // default constructor Group(); - // Copy constructor: makes a copy of the original object + // Copy constructor: same as the original Group. Group(const Group& original); // Gets the group id. diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index baf939e..b4070b0 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -60,21 +60,8 @@ class H5_DLLCPP IdComponent { // 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 - // Gets the identifier of this object. virtual hid_t getId () const = 0; diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 38191bc..dd9d042 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -43,7 +43,7 @@ IntType::IntType() {} //-------------------------------------------------------------------------- // Function: IntType copy constructor -///\brief Copy constructor: makes a copy of the original IntType object. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::IntType(const IntType& original) : AtomType( original ) {} diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index a9ebad0..496872b 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -53,7 +53,7 @@ class H5_DLLCPP IntType : public AtomType { // Creates a integer datatype using an existing id IntType(const hid_t existing_id); - // Copy constructor: makes copy of IntType object + // Copy constructor: same as the original IntType. IntType(const IntType& original); // Noop destructor. diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp index 1267286..49ffa2b 100644 --- a/c++/src/H5LaccProp.cpp +++ b/c++/src/H5LaccProp.cpp @@ -88,7 +88,7 @@ LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {} //-------------------------------------------------------------------------- // Function: LinkAccPropList copy constructor -///\brief Copy Constructor: makes a copy of the original +///\brief Copy Constructor: same HDF5 object as \a original ///\param original - IN: LinkAccPropList instance to copy // Programmer Binh-Minh Ribler - December, 2016 //-------------------------------------------------------------------------- diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index 6c86a85..70890b3 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -36,7 +36,7 @@ class H5_DLLCPP LinkAccPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("LinkAccPropList"); } - // Copy constructor: creates a copy of a LinkAccPropList object. + // Copy constructor: same as the original LinkAccPropList. LinkAccPropList(const LinkAccPropList& original); // Creates a copy of an existing file access property list diff --git a/c++/src/H5LcreatProp.cpp b/c++/src/H5LcreatProp.cpp index 4f8bffc..8bece44 100644 --- a/c++/src/H5LcreatProp.cpp +++ b/c++/src/H5LcreatProp.cpp @@ -88,7 +88,7 @@ LinkCreatPropList::LinkCreatPropList() : PropList(H5P_LINK_CREATE) {} //-------------------------------------------------------------------------- // Function: LinkCreatPropList copy constructor -///\brief Copy Constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: LinkCreatPropList instance to copy // December, 2016 //-------------------------------------------------------------------------- diff --git a/c++/src/H5LcreatProp.h b/c++/src/H5LcreatProp.h index 4ac2191..12cb479 100644 --- a/c++/src/H5LcreatProp.h +++ b/c++/src/H5LcreatProp.h @@ -36,7 +36,7 @@ class H5_DLLCPP LinkCreatPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("LinkCreatPropList"); } - // Copy constructor: creates a copy of a LinkCreatPropList object. + // Copy constructor: same as the original LinkCreatPropList. LinkCreatPropList(const LinkCreatPropList& original); // Creates a copy of an existing file access property list diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 27881c4..5d102d7 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -58,35 +58,6 @@ extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name, 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 -// *** 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 -// removal does not raise any problems in 1.10, it will be removed from 1.8 in -// subsequent releases. -// Removed in 1.10.1 - Aug 2016 -//-------------------------------------------------------------------------- -//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 -// *** 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 -// 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() {} - -//-------------------------------------------------------------------------- // Function: f_Attribute_setId - friend // Purpose: This function is friend to class H5::Attribute so that it // can set Attribute::id in order to work around a problem diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 3772e08..10b3865 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -104,19 +104,6 @@ class H5_DLLCPP H5Object : public H5Location { // 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. - - // 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); - // 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; diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index 121198c..0542d5e 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -88,7 +88,7 @@ ObjCreatPropList::ObjCreatPropList() : PropList(H5P_OBJECT_CREATE) {} //-------------------------------------------------------------------------- // Function: ObjCreatPropList copy constructor -///\brief Copy Constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: ObjCreatPropList instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index d1eae86..1d5dd55 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -46,7 +46,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("ObjCreatPropList"); } - // Copy constructor: creates a copy of a ObjCreatPropList object. + // Copy constructor: same as the original ObjCreatPropList. ObjCreatPropList(const ObjCreatPropList& original); // Creates a copy of an existing object creation property list diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 704a617..3f153e5 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -55,7 +55,7 @@ PredType::PredType() : AtomType() {} //-------------------------------------------------------------------------- // Function: PredType copy constructor -///\brief Copy constructor: makes a copy of the original PredType object. +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: PredType instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index c631fb9..0978384 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -34,7 +34,7 @@ class H5_DLLCPP PredType : public AtomType { // id in the left hand side object. PredType& operator=(const PredType& rhs); - // Copy constructor - makes copy of the original object + // Copy constructor: same as the original PredType. PredType(const PredType& original); // Noop destructor diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index 16a6316..ef9e16d 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -94,7 +94,7 @@ PropList::PropList() : IdComponent(), id(H5P_DEFAULT) {} //-------------------------------------------------------------------------- // Function: PropList copy constructor -///\brief Copy constructor +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: The original property list to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 6e1e287..e0244c1 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -106,7 +106,7 @@ class H5_DLLCPP PropList : public IdComponent { // Default constructor: creates a stub PropList object. PropList(); - // Copy constructor: creates a copy of a PropList object. + // Copy constructor: same as the original PropList. PropList(const PropList& original); // Gets the property list id. diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 4c0b3d2..a067d6c 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -120,7 +120,7 @@ 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. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::StrType(const StrType& original) : AtomType ( original ) {} diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index 24c9ca3..38974da 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -65,7 +65,7 @@ class H5_DLLCPP StrType : public AtomType { // Creates a string datatype using an existing id StrType(const hid_t existing_id); - // Copy constructor - makes a copy of the original object + // Copy constructor: same as the original StrType. StrType(const StrType& original); // Noop destructor. diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 188ee41..e70d42f 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -45,7 +45,7 @@ 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. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const VarLenType& original) : DataType(original) {} diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 078b534..ab3c14c 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -38,7 +38,7 @@ class H5_DLLCPP VarLenType : public DataType { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("VarLenType"); } - // Copy constructor: makes copy of the original object. + // Copy constructor: same as the original VarLenType. VarLenType(const VarLenType& original); // Constructor that takes an existing id diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 12776eb..0d739a5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -628,7 +628,12 @@ Bug Fixes since HDF5-1.10.1 release C++ APIs -------- - - + - Removal of memomry leaks + + A private function was inadvertently called, causing memory leaks. This + is now fixed. + + (BMR - 2018/03/12 - User's reported in email) Testing ------- -- cgit v0.12 From b877534a330a201e3b5c51d97daa8e01a5c1cd3a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 12 Mar 2018 17:56:54 -0700 Subject: Added a fix for HDFFV-10358. --- release_docs/RELEASE.txt | 17 +++++++++++++++++ src/H5Gcache.c | 3 ++- src/H5Gent.c | 7 +++++-- src/H5Gpkg.h | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a70802e..4ac4545 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -321,6 +321,23 @@ Bug Fixes since HDF5-1.10.1 release (DER - 2018/02/26, HDFFV-10357) + - If an HDF5 file contains a malformed symbol table node that declares + it contains more symbols than it actually contains, the library + can run off the end of the metadata cache buffer while processing + the symbol table node. + + This issue was reported to The HDF Group as issue #CVE-2017-17509. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + Performing bounds checks on the buffer while processing fixes the + problem. Instead of the segmentation fault, the normal HDF5 error + handling is invoked. + + (DER - 2018/03/12, HDFFV-10358) + Configuration ------------- - CMake diff --git a/src/H5Gcache.c b/src/H5Gcache.c index 65115a5..b447cad 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -170,6 +170,7 @@ H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, H5F_t *f = (H5F_t *)_udata; /* User data for callback */ H5G_node_t *sym = NULL; /* Symbol table node created */ const uint8_t *image = (const uint8_t *)_image; /* Pointer to image to deserialize */ + const uint8_t *image_end = image + len - 1; /* Pointer to end of image buffer */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -203,7 +204,7 @@ H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, UINT16DECODE(image, sym->nsyms); /* entries */ - if(H5G__ent_decode_vec(f, &image, sym->entry, sym->nsyms) < 0) + if(H5G__ent_decode_vec(f, &image, image_end, sym->entry, sym->nsyms) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "unable to decode symbol table entries") /* Set return value */ diff --git a/src/H5Gent.c b/src/H5Gent.c index 7987850..6e076ae 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -91,7 +91,7 @@ H5FL_BLK_EXTERN(str_buf); *------------------------------------------------------------------------- */ herr_t -H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsigned n) +H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, const uint8_t *p_end, H5G_entry_t *ent, unsigned n) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -104,9 +104,12 @@ H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsign HDassert(ent); /* decode entries */ - for(u = 0; u < n; u++) + for(u = 0; u < n; u++) { + if(*pp > p_end) + HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "ran off the end of the image buffer") if(H5G_ent_decode(f, pp, ent + u) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode") + } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 76bf08b..20e595f 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -395,7 +395,7 @@ H5_DLL void H5G__ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5_copy_depth_t depth); H5_DLL void H5G__ent_reset(H5G_entry_t *ent); H5_DLL herr_t H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, - H5G_entry_t *ent, unsigned n); + const uint8_t *p_end, H5G_entry_t *ent, unsigned n); H5_DLL herr_t H5G__ent_encode_vec(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent, unsigned n); H5_DLL herr_t H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, -- cgit v0.12 From 86890ac84ba74a437f87d98e7d7931dccc0fe856 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 12 Mar 2018 20:39:03 -0500 Subject: Add release note for HDFFFV-10397. --- release_docs/RELEASE.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 81a052a..bb8168f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -642,7 +642,11 @@ Bug Fixes since HDF5-1.10.1 release Testing ------- - - + - Memory for three variables in testphdf5's coll_write_test was malloced + but not freed, leaking memory when running the test. The variables' + memory is now freed. + + (LRK - 2018/03/12, HDFFV-10397) Supported Platforms =================== -- cgit v0.12 From 19d54162ce7e43f04572b7cea12695df11ba7bea Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 12 Mar 2018 21:07:24 -0500 Subject: Fixed typo --- 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 36bf869..0093f3b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -638,7 +638,7 @@ Bug Fixes since HDF5-1.10.1 release C++ APIs -------- - - Removal of memomry leaks + - Removal of memory leaks A private function was inadvertently called, causing memory leaks. This is now fixed. -- cgit v0.12 From cbe8171f67870598d8829e9105de890cf6b8cb0e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 13 Mar 2018 10:26:10 -0500 Subject: Fix CMake test names --- tools/test/misc/CMakeTestsClear.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 5efce0a..3104c1d 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -303,17 +303,17 @@ endif() # "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0) # (no output, check exit code) # "h5clear --filesize h5clear_status_noclose.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_open_fail_s h5clear_open_fail 1 "--filesize" h5clear_status_noclose.h5) - ADD_H5_RETTEST (h5clr_mdc_image "false" "-s" "--increment=0" h5clear_status_noclose.h5) - ADD_H5_CMP (h5clr_no_mdc_image_m h5clear_status_noclose_after_size 0 "--filesize" h5clear_status_noclose.h5) + ADD_H5_CMP (h5clr_open_fail_nc_s h5clear_open_fail 1 "--filesize" h5clear_status_noclose.h5) + ADD_H5_RETTEST (h5clr_mdc_image_nc "false" "-s" "--increment=0" h5clear_status_noclose.h5) + ADD_H5_CMP (h5clr_no_mdc_image_nc_m h5clear_status_noclose_after_size 0 "--filesize" h5clear_status_noclose.h5) # # (2) h5clear_fsm_persist_noclose.h5 # "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action) # "h5clear --increment=0 h5clear_fsm_persist_noclose.h5" (EOA = MAX(EOA, EOF)) (no output, just check exit code) # "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_open_fail_s h5clear_noclose_before_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) - ADD_H5_RETTEST (h5clr_mdc_image "false" "--increment=0" h5clear_fsm_persist_noclose.h5) - ADD_H5_CMP (h5clr_no_mdc_image_m h5clear_noclose_after_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) + ADD_H5_CMP (h5clr_open_fail_fsm_s h5clear_noclose_before_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) + ADD_H5_RETTEST (h5clr_mdc_image_fsm "false" "--increment=0" h5clear_fsm_persist_noclose.h5) + ADD_H5_CMP (h5clr_no_mdc_image_fsm_m h5clear_noclose_after_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) # # (3) h5clear_fsm_persist_equal.h5 # "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF before the next action) -- cgit v0.12 From 5c2473a01e8ece7f77836afef885cffed2638970 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 13 Mar 2018 10:10:14 -0700 Subject: Added a "won't fix" RELEASE.txt entry for HDFFV-10356. --- release_docs/RELEASE.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e108ed8..9dc7f3a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -362,6 +362,26 @@ Bug Fixes since HDF5-1.10.1 release (DER - 2018/02/26, HDFFV-10355) + - If an HDF5 file contains a malformed compound datatype with a + suitably large offset, the type conversion code can run off + the end of the type conversion buffer, causing a segmentation + fault. + + This issue was reported to The HDF Group as issue #CVE-2017-17507. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + THE HDF GROUP WILL NOT FIX THIS BUG AT THIS TIME + + Fixing this problem would involve updating the publicly visible + H5T_conv_t function pointer typedef and versioning the API calls + which use it. We normally only modify the public API during + major releases, so this bug will not be fixed at this time. + + (DER - 2018/02/26, HDFFV-10356) + - If an HDF5 file contains a malformed compound type which contains a member of size zero, a division by zero error will occur while processing the type. -- cgit v0.12 From 6287bac6e5916d69f1df3f3907f2c530c8ba5ada Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 13 Mar 2018 12:26:24 -0500 Subject: Rework new tests into one macro --- tools/test/misc/CMakeTestsClear.cmake | 137 +++++++++++++++++++++++++++------- 1 file changed, 112 insertions(+), 25 deletions(-) diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 3104c1d..a51d0e9 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -108,6 +108,42 @@ endif () endmacro () + macro (ADD_H5_CMP_WITH_COPY testname resultcode resultfile testfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5CLEAR_CMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${testname}.out + testfiles/${testname}.out.err + testfiles/${testfile} + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5CLEAR_CMP-copy_${testname} + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/${testfile}" "${PROJECT_BINARY_DIR}/testfiles/${testfile}" + ) + set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects) + add_test ( + NAME H5CLEAR_CMP-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN};${testfile}" + -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_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-copy_${testname}) + set (last_test "H5CLEAR_CMP-${testname}") + endif () + endmacro () + macro (ADD_H5_RETTEST testname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -123,6 +159,70 @@ endif () endmacro () + macro (ADD_H5_FILESIZE_TEST testname resultcode resultfile incr_size) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5CLEAR_FILESIZE_TEST-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${testname}_before_size.out + testfiles/${testname}_before_size.out.err + testfiles/${testname}_after_size.out + testfiles/${testname}_after_size.out.err + testfiles/${testname}.h5 + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR_FILESIZE_TEST-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5CLEAR_FILESIZE_TEST-copy_${testname} + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/${testname}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testname}.h5" + ) + set_tests_properties (H5CLEAR_FILESIZE_TEST-copy_${testname} PROPERTIES DEPENDS H5CLEAR_FILESIZE_TEST-${testname}-clear-objects) + add_test ( + NAME H5CLEAR_FILESIZE_CMP-${testname}_before_size + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--filesize;${testname}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}_before_size.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}_before_size.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_before_size PROPERTIES DEPENDS H5CLEAR_FILESIZE_TEST-copy_${testname}) + if (NOT ${incr_size} MATCHES "NONE") + add_test ( + NAME H5CLEAR_FILESIZE_INCR-${testname} + COMMAND $ --increment=${incr_size} ${testname}.h5 + ) + else () + add_test ( + NAME H5CLEAR_FILESIZE_INCR-${testname} + COMMAND $ --increment ${testname}.h5 + ) + endif () + set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES WILL_FAIL "${resultcode}") + set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES DEPENDS H5CLEAR_FILESIZE_CMP-${testname}_before_size) + add_test ( + NAME H5CLEAR_FILESIZE_CMP-${testname}_after_size + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--filesize;${testname}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}_after_size.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}_after_size.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_after_size PROPERTIES DEPENDS H5CLEAR_FILESIZE_INCR-${testname}) + set (last_test "H5CLEAR_FILESIZE_CMP-${testname}_after_size") + endif () + endmacro () + macro (ADD_H5_TEST testname testfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -183,6 +283,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) latest_h5clear_sec2_v3.h5 mod_h5clear_mdc_image.h5 mod_h5clear_mdc_image2.h5 + ${HDF5_TEST_FILES} ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5CLEAR-clearall-objects PROPERTIES DEPENDS ${last_test}) @@ -303,7 +404,7 @@ endif() # "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0) # (no output, check exit code) # "h5clear --filesize h5clear_status_noclose.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_open_fail_nc_s h5clear_open_fail 1 "--filesize" h5clear_status_noclose.h5) + ADD_H5_CMP_WITH_COPY (h5clr_open_fail_nc_s 1 h5clear_open_fail h5clear_status_noclose.h5 "--filesize") ADD_H5_RETTEST (h5clr_mdc_image_nc "false" "-s" "--increment=0" h5clear_status_noclose.h5) ADD_H5_CMP (h5clr_no_mdc_image_nc_m h5clear_status_noclose_after_size 0 "--filesize" h5clear_status_noclose.h5) # @@ -311,56 +412,42 @@ endif() # "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action) # "h5clear --increment=0 h5clear_fsm_persist_noclose.h5" (EOA = MAX(EOA, EOF)) (no output, just check exit code) # "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_open_fail_fsm_s h5clear_noclose_before_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) - ADD_H5_RETTEST (h5clr_mdc_image_fsm "false" "--increment=0" h5clear_fsm_persist_noclose.h5) - ADD_H5_CMP (h5clr_no_mdc_image_fsm_m h5clear_noclose_after_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_noclose 0 h5clear_noclose 0) # # (3) h5clear_fsm_persist_equal.h5 # "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF before the next action) # "h5clear --increment h5clear_fsm_persist_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) # "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_equal_before_size h5clear_equal_before_size 0 "--filesize" h5clear_fsm_persist_equal.h5) - ADD_H5_RETTEST (h5clr_equal_incr "false" "--increment" h5clear_fsm_persist_equal.h5) - ADD_H5_CMP (h5clr_equal_after_size h5clear_equal_after_size 0 "--filesize" h5clear_fsm_persist_equal.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_equal 0 h5clear_equal NONE) # # (4) h5clear_fsm_persist_greater.h5 # "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF before the next action) # "h5clear --increment=0 h5clear_fsm_persist_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) # "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_greater_before_size h5clear_greater_before_size 0 "--filesize" h5clear_fsm_persist_greater.h5) - ADD_H5_RETTEST (h5clr_greater_incr "false" "--increment=0" h5clear_fsm_persist_greater.h5) - ADD_H5_CMP (h5clr_greater_after_size h5clear_greater_after_size 0 "--filesize" h5clear_fsm_persist_greater.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_greater 0 h5clear_greater 0) # # (5) h5clear_fsm_persist_less.h5 # "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF before the next action) # "h5clear --increment=200 h5clear_fsm_persist_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code) # "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_less_before_size h5clear_less_before_size 0 "--filesize" h5clear_fsm_persist_less.h5) - ADD_H5_RETTEST (h5clr_less_incr "false" "--increment=200" h5clear_fsm_persist_less.h5) - ADD_H5_CMP (h5clr_less_after_size h5clear_less_after_size 0 "--filesize" h5clear_fsm_persist_less.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_less 0 h5clear_less 200) # # (6) h5clear_fsm_persist_user_equal.h5 # "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF before the next action) # "h5clear --increment h5clear_fsm_persist_user_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) # "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_user_equal_before_size h5clear_user_equal_before_size 0 "--filesize" h5clear_fsm_persist_user_equal.h5) - ADD_H5_RETTEST (h5clr_user_equal_incr "false" "--increment" h5clear_fsm_persist_user_equal.h5) - ADD_H5_CMP (h5clr_user_equal_after_size h5clear_user_equal_after_size 0 "--filesize" h5clear_fsm_persist_user_equal.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_user_equal 0 h5clear_user_equal NONE) # # (7) h5clear_fsm_persist_user_greater.h5 # "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF before the next action) # "h5clear --increment=0 h5clear_fsm_persist_user_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) # "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_user_greater_before_size h5clear_user_greater_before_size 0 "--filesize" h5clear_fsm_persist_user_greater.h5) - ADD_H5_RETTEST (h5clr_user_greater_incr "false" "--increment=0" h5clear_fsm_persist_user_greater.h5) - ADD_H5_CMP (h5clr_user_greater_after_size h5clear_user_greater_after_size 0 "--filesize" h5clear_fsm_persist_user_greater.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_user_greater 0 h5clear_user_greater 0) # # (8) h5clear_fsm_persist_user_less.h5 -# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF before the next action) -# "h5clear --increment=0 h5clear_fsm_persist_user_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) -# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_user_less_before_size h5clear_user_less_before_size 0 "--filesize" h5clear_fsm_persist_user_less.h5) - ADD_H5_RETTEST (h5clr_user_less_incr "false" "--increment=0" h5clear_fsm_persist_user_less.h5) - ADD_H5_CMP (h5clr_user_less_after_size h5clear_user_less_after_size 0 "--filesize" h5clear_fsm_persist_user_less.h5) +# "h5clear --filesize h5clear_fsm_persist_user_less.h5" (print EOA/EOF before the next action) +# "h5clear --increment=200 h5clear_fsm_persist_user_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_less.h5" (print EOA/EOF after the last action) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_user_less 0 h5clear_user_less 200) # # -- cgit v0.12 From b5867a05a7adf5d1c89721bf42a5bbaddb47dbd9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 13 Mar 2018 17:21:02 -0500 Subject: HDFFV-10412 add error on function for Java --- java/src/hdf/hdf5lib/H5.java | 8 +++++++- java/src/jni/exceptionImp.c | 17 +++++++++++++++++ java/src/jni/exceptionImp.h | 10 ++++++++++ java/src/jni/h5util.c | 3 +++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 20aa634..9d1aed1 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -424,7 +424,7 @@ public class H5 implements java.io.Serializable { private synchronized static native int H5dont_atexit() throws HDF5LibraryException; /** - * Turn off error handling By default, the C library prints the error stack of the HDF-5 C library on stdout. This + * Turn off error handling. By default, the C library prints the error stack of the HDF-5 C library on stdout. This * behavior may be disabled by calling H5error_off(). * * @return a non-negative value if successful @@ -432,6 +432,12 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5error_off(); /** + * Turn on error handling. By default, the C library prints the error stack of the HDF-5 C library on stdout. This + * behavior may be reenabled by calling H5error_on(). + */ + public synchronized static native void H5error_on(); + + /** * H5garbage_collect collects on all free-lists of all types. * * @return a non-negative value if successful diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c index 05c193f..afad5d5 100644 --- a/java/src/jni/exceptionImp.c +++ b/java/src/jni/exceptionImp.c @@ -33,6 +33,9 @@ extern "C" { #include "h5jni.h" #include "exceptionImp.h" +extern H5E_auto2_t efunc; +extern void *edata; + /*******************/ /* Local Variables */ @@ -122,10 +125,24 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5error_1off (JNIEnv *env, jclass clss) { + H5Eget_auto2(H5E_DEFAULT, &efunc, &edata); H5Eset_auto2(H5E_DEFAULT, NULL, NULL); return 0; } /* end Java_hdf_hdf5lib_H5_H5error_1off() */ +/* + * Class: hdf_hdf5lib_exceptions_HDF5Library + * Method: H5error_on + * Signature: ()V + * + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5error_1on + (JNIEnv *env, jclass clss) +{ + H5Eset_auto2(H5E_DEFAULT, efunc, edata); +} /* end Java_hdf_hdf5lib_H5_H5error_1on() */ + /* * Class: hdf_hdf5lib_exceptions_HDFLibraryException diff --git a/java/src/jni/exceptionImp.h b/java/src/jni/exceptionImp.h index cb74602..423e537 100644 --- a/java/src/jni/exceptionImp.h +++ b/java/src/jni/exceptionImp.h @@ -31,6 +31,16 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5error_1off (JNIEnv *env, jclass clss ); +/* + * Class: hdf_hdf5lib_exceptions_HDF5Library + * Method: H5error_on + * Signature: ()V + * + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5error_1on + (JNIEnv *env, jclass clss ); + /* * Class: hdf_hdf5lib_exceptions_HDFLibraryException diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index bd9fc0f..fdabd76 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -41,6 +41,9 @@ jobject get_callback; jobject set_callback; jobject delete_callback; +H5E_auto2_t efunc; +void *edata; + /********************/ /* Local Prototypes */ /********************/ -- cgit v0.12 From 0d5c1153f1e8b55784512a3cb722bda94e1b2080 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 14 Mar 2018 11:13:16 -0500 Subject: Add info to release notes for: (1) library version bounds (2) HDFFV-10360 (h5clear) (3) HDFFV-10209 (VDS SWMR test failure) --- release_docs/RELEASE.txt | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9dc7f3a..cfa0b1c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -86,6 +86,19 @@ New Features Library: -------- + - Add an enumerated value to H5F_libver_t for H5Pset_libver_bounds(). + + Currently, the library defines two values for H5F_libver_t and supports + only two pairs of (low, high) combinations as derived from these values. + Thus the bounds setting via H5Pset_libver_bounds() is rather restricted. + + Add an enumerated value (H5F_LIBVER_V18) to H5F_libver_t and + H5Pset_libver_bounds() now supports five pairs of (low, high) combinations + as derived from these values. This addition provides the user more + flexibility in setting bounds for object creation. + + (VC - 2018/03/14) + - Add prefix option to VDS files. Currently, VDS source files must be in the active directory to be @@ -271,6 +284,17 @@ Bug Fixes since HDF5-1.10.1 release Library ------- + - Freeing of object header in H5Ocache.c + + It was discovered that the object header was not released properly + when the checksum verification failed and a re-load of the object + header was needed. + + Free the object header that failed the chksum verification only + after the new object header is reloaded, deserialized and set up. + + (VC - 2018/03/14, HDFFV-10209) + - H5Pset_evict_on_close in H5Pfapl.c Changed the minor error number from H5E_CANTSET to H5E_UNSUPPORTED for @@ -492,6 +516,20 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5clear + + An enhancement to the tool in setting a file's stored EOA. + + It was discovered that a crashed file's stored EOA in the superblock + was smaller than the actual file's EOF. When the file was reopened + and closed, the library truncated the file to the stored EOA. + + Add an option to the tool in setting the file's stored EOA in the + superblock to the maximum of (EOA, EOF) + increment. + Another option is also added to print the file's EOA and EOF. + + (VC - 2018/03/14, HDFFV-10360) + - h5repack h5repack changes the chunk parameters when a change of layout is not -- cgit v0.12 From 6cbc1104197358b7f56830f5362b24fad5e96631 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 14 Mar 2018 15:57:51 -0500 Subject: HDFFV-10412 add note for new H5error_on Java API --- release_docs/RELEASE.txt | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index cfa0b1c..e6fd8d3 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -89,12 +89,12 @@ New Features - Add an enumerated value to H5F_libver_t for H5Pset_libver_bounds(). Currently, the library defines two values for H5F_libver_t and supports - only two pairs of (low, high) combinations as derived from these values. + only two pairs of (low, high) combinations as derived from these values. Thus the bounds setting via H5Pset_libver_bounds() is rather restricted. - Add an enumerated value (H5F_LIBVER_V18) to H5F_libver_t and - H5Pset_libver_bounds() now supports five pairs of (low, high) combinations - as derived from these values. This addition provides the user more + Add an enumerated value (H5F_LIBVER_V18) to H5F_libver_t and + H5Pset_libver_bounds() now supports five pairs of (low, high) combinations + as derived from these values. This addition provides the user more flexibility in setting bounds for object creation. (VC - 2018/03/14) @@ -234,6 +234,14 @@ New Features Java Library: ---------------- + - Wrapper added for enabling the error stack. + + H5error_off would disable the error stack reporting. In order + to re-enable the reporting, the error stack info needs to be + saved so that H5error_on can revert state. + + (ADB - 2018/03/13, HDFFV-10412) + - Wrappers added for the following APIs: H5Pset_evict_on_close H5Pget_evict_on_close @@ -525,7 +533,7 @@ Bug Fixes since HDF5-1.10.1 release and closed, the library truncated the file to the stored EOA. Add an option to the tool in setting the file's stored EOA in the - superblock to the maximum of (EOA, EOF) + increment. + superblock to the maximum of (EOA, EOF) + increment. Another option is also added to print the file's EOA and EOF. (VC - 2018/03/14, HDFFV-10360) @@ -722,8 +730,8 @@ Bug Fixes since HDF5-1.10.1 release Testing ------- - - Memory for three variables in testphdf5's coll_write_test was malloced - but not freed, leaking memory when running the test. The variables' + - Memory for three variables in testphdf5's coll_write_test was malloced + but not freed, leaking memory when running the test. The variables' memory is now freed. (LRK - 2018/03/12, HDFFV-10397) -- cgit v0.12 From 8f5be458f4284f763ef30c5bf665740d69c5ec16 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 15 Mar 2018 09:06:16 -0500 Subject: Fixed memory leak Description: Added LinkCreatPropList to initH5cpp to cleaning up resource at exit. Platforms tested: Linux/64 (jelly) Linux/ppc64 (ostrich) --- c++/src/H5Library.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 55f82f5..2cbdfba 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -188,6 +188,10 @@ void H5Library::initH5cpp() if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating LinkAccPropList::deleteConstants failed"); + ret_value = std::atexit(LinkCreatPropList::deleteConstants); + if (ret_value != 0) + throw LibraryIException("H5Library::initH5cpp", "Registrating LinkCreatPropList::deleteConstants failed"); + ret_value = std::atexit(FileAccPropList::deleteConstants); if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating FileAccPropList::deleteConstants failed"); -- cgit v0.12 From 4b6d3193e1392b64b401e1b4de60a2b0ef586f23 Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 15 Mar 2018 11:18:47 -0500 Subject: Add 2 parallel test files to CHECK-CLEANFILES so that if their tests fail before removing them, make check-clean will remove them. --- testpar/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testpar/Makefile.am b/testpar/Makefile.am index 1f15830..5c7cb26 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -37,9 +37,12 @@ LDADD = $(LIBH5TEST) $(LIBHDF5) # Temporary files # MPItest.h5 is from t_mpi # Para*.h5 are from testphdf +# bigio_test.h5 is from t_bigio +# ShapeSameTest.h5 is from t_shapesame # shutdown.h5 is from t_pshutdown # after_mpi_fin.h5 is from t_init_term # go is used for debugging. See testphdf5.c. -CHECK_CLEANFILES+=MPItest.h5 Para*.h5 CacheTestDummy.h5 shutdown.h5 after_mpi_fin.h5 go +CHECK_CLEANFILES+=MPItest.h5 Para*.h5 bigio_test.h5 CacheTestDummy.h5 \ + ShapeSameTest.h5 shutdown.h5 after_mpi_fin.h5 go include $(top_srcdir)/config/conclude.am -- cgit v0.12 From 7399997968b3521afb08e62880a3be586bd21cec Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 13:41:25 -0500 Subject: Java constants for new lib verbounds values --- java/src/hdf/hdf5lib/HDF5Constants.java | 12 ++++++++++++ java/src/jni/h5Constants.c | 8 ++++++++ java/src/jni/h5pImp.c | 14 +++----------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 3e43ba2..eb4055d 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -206,7 +206,11 @@ public class HDF5Constants { public static final int H5F_CLOSE_SEMI = H5F_CLOSE_SEMI(); public static final int H5F_CLOSE_STRONG = H5F_CLOSE_STRONG(); public static final int H5F_CLOSE_WEAK = H5F_CLOSE_WEAK(); + public static final int H5F_LIBVER_ERROR = H5F_LIBVER_ERROR(); public static final int H5F_LIBVER_EARLIEST = H5F_LIBVER_EARLIEST(); + public static final int H5F_LIBVER_V18 = H5F_LIBVER_V18(); + public static final int H5F_LIBVER_V110 = H5F_LIBVER_V110(); + public static final int H5F_LIBVER_NBOUNDS = H5F_LIBVER_NBOUNDS(); public static final int H5F_LIBVER_LATEST = H5F_LIBVER_LATEST(); public static final int H5F_OBJ_ALL = H5F_OBJ_ALL(); public static final int H5F_OBJ_ATTR = H5F_OBJ_ATTR(); @@ -999,8 +1003,16 @@ public class HDF5Constants { private static native final int H5F_CLOSE_WEAK(); + private static native final int H5F_LIBVER_ERROR(); + private static native final int H5F_LIBVER_EARLIEST(); + private static native final int H5F_LIBVER_V18(); + + private static native final int H5F_LIBVER_V110(); + + private static native final int H5F_LIBVER_NBOUNDS(); + private static native final int H5F_LIBVER_LATEST(); private static native final int H5F_OBJ_ALL(); diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 5a4b53e..fbbd332 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -380,8 +380,16 @@ Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1STRONG(JNIEnv *env, jclass cls) { ret JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1WEAK(JNIEnv *env, jclass cls) { return H5F_CLOSE_WEAK; } JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_ERROR;} +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_EARLIEST;} JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_V18;} +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_V110;} +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_NBOUNDS;} +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1LATEST(JNIEnv *env, jclass cls){return H5F_LIBVER_LATEST;} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1ALL(JNIEnv *env, jclass cls) { return H5F_OBJ_ALL; } diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index cf27341..49cfeb9 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -2794,17 +2794,9 @@ Java_hdf_hdf5lib_H5_H5Pset_1libver_1bounds { herr_t retVal = -1; - if ((H5F_libver_t)high != H5F_LIBVER_LATEST) { - h5badArgument(env, "H5Pset_libver_bounds: invalid high library version bound"); - } /* end if */ - else if(((H5F_libver_t)low !=H5F_LIBVER_EARLIEST) && ((H5F_libver_t)low != H5F_LIBVER_LATEST)) { - h5badArgument(env, "H5Pset_libver_bounds: invalid low library version bound"); - } /* end else if */ - else { - retVal = H5Pset_libver_bounds((hid_t)fapl_id, (H5F_libver_t)low, (H5F_libver_t)high); - if(retVal < 0) - h5libraryError(env); - } /* end else */ + retVal = H5Pset_libver_bounds((hid_t)fapl_id, (H5F_libver_t)low, (H5F_libver_t)high); + if(retVal < 0) + h5libraryError(env); return (jint)retVal; } /* end Java_hdf_hdf5lib_H5_H5Pset_1libver_1bounds */ -- cgit v0.12 From 3f221c1347fbce0342f7e726bf00fe577d7c4422 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 14:11:15 -0500 Subject: Correct constant var names --- java/src/jni/h5Constants.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index fbbd332..900316e 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -380,15 +380,15 @@ Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1STRONG(JNIEnv *env, jclass cls) { ret JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1WEAK(JNIEnv *env, jclass cls) { return H5F_CLOSE_WEAK; } JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_ERROR;} +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1ERROR(JNIEnv *env, jclass cls){return H5F_LIBVER_ERROR;} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_EARLIEST;} JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_V18;} +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1V18(JNIEnv *env, jclass cls){return H5F_LIBVER_V18;} JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_V110;} +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1V110(JNIEnv *env, jclass cls){return H5F_LIBVER_V110;} JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_NBOUNDS;} +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1NBOUNDS(JNIEnv *env, jclass cls){return H5F_LIBVER_NBOUNDS;} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1LATEST(JNIEnv *env, jclass cls){return H5F_LIBVER_LATEST;} JNIEXPORT jint JNICALL -- cgit v0.12 From 692c7867ef243bfbf28c2064e6b3c09070c29175 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 14:14:29 -0500 Subject: Exception type changed --- java/test/TestH5P.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index 9e45e4c..cfe7c33 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -211,7 +211,7 @@ public class TestH5P { H5.H5Pset_libver_bounds(fapl_id, 5, HDF5Constants.H5F_LIBVER_LATEST); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = HDF5FunctionArgumentException.class) public void testH5Pset_libver_bounds_invalidhigh() throws Throwable { H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_LATEST, 5); } -- cgit v0.12 From fe22bb8e44b89468849f5a70f014215a459c9d5b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 14:15:45 -0500 Subject: Exception changed --- java/test/TestH5P.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index cfe7c33..f713063 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -206,7 +206,7 @@ public class TestH5P { assertEquals(nlinks, 20L); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = HDF5FunctionArgumentException.class) public void testH5Pset_libver_bounds_invalidlow() throws Throwable { H5.H5Pset_libver_bounds(fapl_id, 5, HDF5Constants.H5F_LIBVER_LATEST); } -- cgit v0.12 From b2d739ef39633ed688ce855fba72aa3ddcbaf43d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 14:28:36 -0500 Subject: Chnage values so test will fail when new latest is added --- java/test/TestH5P.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index f713063..d69403c 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -213,7 +213,7 @@ public class TestH5P { @Test(expected = HDF5FunctionArgumentException.class) public void testH5Pset_libver_bounds_invalidhigh() throws Throwable { - H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_LATEST, 5); + H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_V110, HDF5Constants.H5F_LIBVER_LATEST+1); } @Test -- cgit v0.12 From 57e468aba7ba66bba1f9a1736450ed4295a6c25d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 14:35:03 -0500 Subject: Change max value --- java/test/TestH5P.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index d69403c..521a53c 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -213,7 +213,7 @@ public class TestH5P { @Test(expected = HDF5FunctionArgumentException.class) public void testH5Pset_libver_bounds_invalidhigh() throws Throwable { - H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_V110, HDF5Constants.H5F_LIBVER_LATEST+1); + H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_V110, HDF5Constants.H5F_LIBVER_V110+1); } @Test -- cgit v0.12 From 4a17aff4085ad6ee265b95730aca3f493056dec8 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 15 Mar 2018 16:54:30 -0500 Subject: Add API context interface and use it throughout the library. --- MANIFEST | 3 + examples/h5_elink_unix2win.c | 2 +- examples/h5_extlink.c | 8 +- fortran/src/H5Lf.c | 169 - fortran/src/H5Lff.F90 | 286 -- java/src/hdf/hdf5lib/H5.java | 16 - src/H5.c | 14 +- src/H5A.c | 467 +-- src/H5AC.c | 331 +- src/H5ACmpio.c | 61 +- src/H5ACpkg.h | 4 +- src/H5ACprivate.h | 62 +- src/H5ACproxy_entry.c | 5 +- src/H5Abtree2.c | 6 +- src/H5Adense.c | 355 +-- src/H5Adeprec.c | 106 +- src/H5Aint.c | 980 ++++-- src/H5Apkg.h | 157 +- src/H5Aprivate.h | 6 +- src/H5Atest.c | 26 +- src/H5B.c | 224 +- src/H5B2.c | 146 +- src/H5B2dbg.c | 26 +- src/H5B2hdr.c | 29 +- src/H5B2int.c | 194 +- src/H5B2internal.c | 172 +- src/H5B2leaf.c | 84 +- src/H5B2pkg.h | 148 +- src/H5B2private.h | 45 +- src/H5B2stat.c | 4 +- src/H5B2test.c | 29 +- src/H5Bdbg.c | 16 +- src/H5Bpkg.h | 3 +- src/H5Bprivate.h | 46 +- src/H5C.c | 669 ++-- src/H5CX.c | 3308 ++++++++++++++++++++ src/H5CXmodule.h | 33 + src/H5CXprivate.h | 142 + src/H5Cepoch.c | 12 +- src/H5Cimage.c | 75 +- src/H5Cmpio.c | 139 +- src/H5Cpkg.h | 30 +- src/H5Cprefetched.c | 16 +- src/H5Cprivate.h | 57 +- src/H5Ctag.c | 42 +- src/H5D.c | 247 +- src/H5Dbtree.c | 66 +- src/H5Dbtree2.c | 61 +- src/H5Dchunk.c | 493 ++- src/H5Dcompact.c | 38 +- src/H5Dcontig.c | 113 +- src/H5Ddbg.c | 10 +- src/H5Ddeprec.c | 192 +- src/H5Dearray.c | 81 +- src/H5Defl.c | 4 +- src/H5Dfarray.c | 82 +- src/H5Dfill.c | 47 +- src/H5Dint.c | 727 ++--- src/H5Dio.c | 481 +-- src/H5Dlayout.c | 64 +- src/H5Dmpio.c | 432 +-- src/H5Dnone.c | 8 +- src/H5Doh.c | 81 +- src/H5Dpkg.h | 176 +- src/H5Dprivate.h | 32 +- src/H5Dpublic.h | 4 +- src/H5Dscatgath.c | 131 +- src/H5Dselect.c | 11 +- src/H5Dsingle.c | 14 +- src/H5Dvirtual.c | 226 +- src/H5EA.c | 95 +- src/H5EAcache.c | 4 +- src/H5EAdbg.c | 56 +- src/H5EAdblkpage.c | 20 +- src/H5EAdblock.c | 36 +- src/H5EAhdr.c | 27 +- src/H5EAiblock.c | 32 +- src/H5EApkg.h | 62 +- src/H5EAprivate.h | 18 +- src/H5EAsblock.c | 32 +- src/H5EAtest.c | 4 +- src/H5Eprivate.h | 8 +- src/H5F.c | 483 ++- src/H5FA.c | 72 +- src/H5FAcache.c | 4 +- src/H5FAdbg.c | 30 +- src/H5FAdblkpage.c | 19 +- src/H5FAdblock.c | 31 +- src/H5FAhdr.c | 28 +- src/H5FApkg.h | 41 +- src/H5FAprivate.h | 18 +- src/H5FAtest.c | 5 +- src/H5FD.c | 114 +- src/H5FDfamily.c | 8 +- src/H5FDint.c | 110 +- src/H5FDmpi.c | 47 +- src/H5FDmpio.c | 68 +- src/H5FDpkg.h | 8 +- src/H5FDprivate.h | 46 +- src/H5FDspace.c | 36 +- src/H5FO.c | 4 +- src/H5FOprivate.h | 2 +- src/H5FS.c | 74 +- src/H5FScache.c | 62 +- src/H5FSdbg.c | 18 +- src/H5FSpkg.h | 5 +- src/H5FSprivate.h | 63 +- src/H5FSsection.c | 116 +- src/H5Faccum.c | 153 +- src/H5Fcwfs.c | 6 +- src/H5Fdeprec.c | 25 +- src/H5Fefc.c | 131 +- src/H5Fint.c | 691 +++- src/H5Fio.c | 70 +- src/H5Fmount.c | 86 +- src/H5Fmpi.c | 31 +- src/H5Fpkg.h | 73 +- src/H5Fprivate.h | 38 +- src/H5Fquery.c | 2 +- src/H5Fspace.c | 34 +- src/H5Fsuper.c | 280 +- src/H5Ftest.c | 15 +- src/H5G.c | 253 +- src/H5Gbtree2.c | 7 +- src/H5Gcompact.c | 63 +- src/H5Gdense.c | 231 +- src/H5Gdeprec.c | 754 +++-- src/H5Gent.c | 26 +- src/H5Gint.c | 464 ++- src/H5Glink.c | 5 +- src/H5Gloc.c | 106 +- src/H5Gname.c | 19 +- src/H5Gnode.c | 131 +- src/H5Gobj.c | 225 +- src/H5Goh.c | 116 +- src/H5Gpkg.h | 161 +- src/H5Gprivate.h | 58 +- src/H5Groot.c | 16 +- src/H5Gstab.c | 160 +- src/H5Gtest.c | 181 +- src/H5Gtraverse.c | 192 +- src/H5HF.c | 77 +- src/H5HFbtree2.c | 8 +- src/H5HFcache.c | 222 +- src/H5HFdbg.c | 63 +- src/H5HFdblock.c | 144 +- src/H5HFhdr.c | 109 +- src/H5HFhuge.c | 162 +- src/H5HFiblock.c | 662 ++-- src/H5HFiter.c | 18 +- src/H5HFman.c | 105 +- src/H5HFpkg.h | 181 +- src/H5HFprivate.h | 39 +- src/H5HFsection.c | 755 ++--- src/H5HFspace.c | 125 +- src/H5HFstat.c | 12 +- src/H5HG.c | 106 +- src/H5HGdbg.c | 7 +- src/H5HGpkg.h | 2 +- src/H5HGprivate.h | 15 +- src/H5HL.c | 68 +- src/H5HLdbg.c | 4 +- src/H5HLdblk.c | 10 +- src/H5HLpkg.h | 2 +- src/H5HLprivate.h | 18 +- src/H5I.c | 62 +- src/H5Itest.c | 12 +- src/H5L.c | 1377 +++++--- src/H5Lexternal.c | 132 +- src/H5Lpkg.h | 9 +- src/H5Lprivate.h | 33 +- src/H5Lpublic.h | 21 +- src/H5MF.c | 810 ++--- src/H5MFaggr.c | 74 +- src/H5MFdbg.c | 22 +- src/H5MFpkg.h | 13 +- src/H5MFprivate.h | 38 +- src/H5MFsection.c | 21 +- src/H5O.c | 321 +- src/H5Oainfo.c | 108 +- src/H5Oalloc.c | 219 +- src/H5Oattr.c | 147 +- src/H5Oattribute.c | 393 ++- src/H5Obogus.c | 36 +- src/H5Obtreek.c | 20 +- src/H5Ocache.c | 68 +- src/H5Ocache_image.c | 25 +- src/H5Ochunk.c | 106 +- src/H5Ocont.c | 50 +- src/H5Ocopy.c | 322 +- src/H5Odbg.c | 20 +- src/H5Odrvinfo.c | 32 +- src/H5Odtype.c | 99 +- src/H5Oefl.c | 66 +- src/H5Ofill.c | 106 +- src/H5Oflush.c | 208 +- src/H5Ofsinfo.c | 35 +- src/H5Oginfo.c | 34 +- src/H5Oint.c | 776 +++-- src/H5Olayout.c | 146 +- src/H5Olinfo.c | 128 +- src/H5Olink.c | 95 +- src/H5Omessage.c | 236 +- src/H5Omtime.c | 89 +- src/H5Oname.c | 44 +- src/H5Opkg.h | 162 +- src/H5Opline.c | 74 +- src/H5Oprivate.h | 105 +- src/H5Orefcount.c | 44 +- src/H5Osdspace.c | 75 +- src/H5Oshared.c | 104 +- src/H5Oshared.h | 48 +- src/H5Oshmesg.c | 28 +- src/H5Ostab.c | 100 +- src/H5Otest.c | 152 +- src/H5Ounknown.c | 14 +- src/H5P.c | 15 + src/H5PB.c | 127 +- src/H5PBprivate.h | 12 +- src/H5Pdcpl.c | 28 +- src/H5Pdxpl.c | 73 - src/H5Pint.c | 107 +- src/H5Pprivate.h | 7 +- src/H5R.c | 94 +- src/H5Rdeprec.c | 43 +- src/H5Rint.c | 142 +- src/H5Rpkg.h | 9 + src/H5Rprivate.h | 9 - src/H5S.c | 79 +- src/H5SM.c | 500 ++- src/H5SMmessage.c | 4 +- src/H5SMpkg.h | 5 +- src/H5SMprivate.h | 33 +- src/H5SMtest.c | 15 +- src/H5Sdbg.c | 6 +- src/H5Sprivate.h | 14 +- src/H5T.c | 1209 +++---- src/H5TS.c | 16 + src/H5TSprivate.h | 1 + src/H5Tarray.c | 42 +- src/H5Tcommit.c | 518 ++- src/H5Tcompound.c | 25 +- src/H5Tconv.c | 1381 +++----- src/H5Tdeprec.c | 76 +- src/H5Tenum.c | 15 +- src/H5Tnative.c | 193 +- src/H5Toh.c | 54 +- src/H5Tpkg.h | 546 ++-- src/H5Tprivate.h | 14 +- src/H5Tvlen.c | 152 +- src/H5Z.c | 104 +- src/H5Znbit.c | 12 +- src/H5Zpkg.h | 3 + src/H5Zprivate.h | 1 - src/H5Zscaleoffset.c | 46 +- src/H5err.txt | 1 + src/H5private.h | 95 +- src/Makefile.am | 7 +- test/accum.c | 270 +- test/accum_swmr_reader.c | 10 +- test/btree2.c | 1832 ++++++----- test/cache.c | 116 +- test/cache_common.c | 101 +- test/cache_tagging.c | 34 +- test/dsets.c | 6 +- test/earray.c | 158 +- test/efc.c | 1107 +++---- test/farray.c | 132 +- test/fheap.c | 2606 ++++++++------- test/freespace.c | 440 ++- test/gheap.c | 55 +- test/lheap.c | 23 +- test/links.c | 16 +- test/mf.c | 859 ++--- test/ohdr.c | 129 +- test/page_buffer.c | 277 +- test/stab.c | 2 +- test/tattr.c | 242 +- test/testfiles/error_test_1 | 2 +- test/ttsafe_error.c | 4 +- test/unregister.c | 7 + testpar/t_cache.c | 11 +- testpar/t_file.c | 101 +- testpar/t_pread.c | 2 +- testpar/t_shapesame.c | 2 +- testpar/t_span_tree.c | 6 + tools/src/misc/h5debug.c | 59 +- tools/test/h5diff/h5diffgentest.c | 7 +- tools/test/h5dump/errfiles/filter_fail.err | 2 +- tools/test/h5dump/errfiles/tall-1.err | 17 +- tools/test/h5dump/errfiles/tall-2A.err | 17 +- tools/test/h5dump/errfiles/tall-2A0.err | 17 +- tools/test/h5dump/errfiles/tall-2B.err | 17 +- tools/test/h5dump/errfiles/tarray1_big.err | 12 +- tools/test/h5dump/errfiles/tattr-3.err | 7 +- tools/test/h5dump/errfiles/tattrregR.err | 8 +- tools/test/h5dump/errfiles/tcomp-3.err | 13 +- tools/test/h5dump/errfiles/tdataregR.err | 8 +- tools/test/h5dump/errfiles/tdset-2.err | 21 +- tools/test/h5dump/errfiles/textlink.err | 34 +- tools/test/h5dump/errfiles/textlinkfar.err | 103 +- tools/test/h5dump/errfiles/textlinksrc.err | 103 +- tools/test/h5dump/errfiles/tgroup-2.err | 4 +- tools/test/h5dump/errfiles/torderlinks1.err | 17 +- tools/test/h5dump/errfiles/torderlinks2.err | 17 +- tools/test/h5dump/errfiles/tperror.err | 21 +- tools/test/h5dump/errfiles/tslink-D.err | 8 +- tools/test/h5dump/h5dumpgentest.c | 3 +- tools/test/h5jam/h5jamgentest.c | 3 +- ...h5repack_layout.h5-dset2_chunk_20x10-errstk.tst | 10 +- 310 files changed, 24250 insertions(+), 20317 deletions(-) create mode 100644 src/H5CX.c create mode 100644 src/H5CXmodule.h create mode 100644 src/H5CXprivate.h diff --git a/MANIFEST b/MANIFEST index 9b91c78..ea3d775 100644 --- a/MANIFEST +++ b/MANIFEST @@ -518,6 +518,9 @@ ./src/H5Ctest.c ./src/H5CS.c ./src/H5CSprivate.h +./src/H5CX.c +./src/H5CXprivate.h +./src/H5CXmodule.h ./src/H5D.c ./src/H5Dbtree.c ./src/H5Dbtree2.c diff --git a/examples/h5_elink_unix2win.c b/examples/h5_elink_unix2win.c index df52015..c29e7db 100644 --- a/examples/h5_elink_unix2win.c +++ b/examples/h5_elink_unix2win.c @@ -38,7 +38,7 @@ * understand Unix paths. */ static hid_t elink_unix2win_trav(const char *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t lapl_id) + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id) { hid_t fid; const char *file_name; diff --git a/examples/h5_extlink.c b/examples/h5_extlink.c index ba632f5..1a07656 100644 --- a/examples/h5_extlink.c +++ b/examples/h5_extlink.c @@ -310,7 +310,7 @@ static herr_t UD_hard_create(const char *link_name, hid_t loc_group, static herr_t UD_hard_delete(const char *link_name, hid_t loc_group, const void *udata, size_t udata_size); static hid_t UD_hard_traverse(const char *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t lapl_id); + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id); static void hard_link_example(void) { @@ -490,7 +490,7 @@ done: * return its ID. */ static hid_t UD_hard_traverse(const char *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t lapl_id) + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id) { haddr_t addr; hid_t ret_value = -1; @@ -527,7 +527,7 @@ static hid_t UD_hard_traverse(const char *link_name, hid_t cur_group, * These links have no udata, so they don't need a query function. */ static hid_t UD_plist_traverse(const char *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t lapl_id); + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id); static void plist_link_example(void) { @@ -618,7 +618,7 @@ static void plist_link_example(void) * Open a path passed in through the property list. */ static hid_t UD_plist_traverse(const char *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t lapl_id) + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id) { char * path; hid_t ret_value = -1; diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index 32de037..4776e77 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -746,172 +746,6 @@ done: } -/* /\****if* H5Lf/h5lget_val_c */ -/* * NAME */ -/* * h5lget_val_c */ -/* * PURPOSE */ -/* * Call H5Lget_val */ -/* * INPUTS */ -/* * */ -/* * link_loc_id - File or group identifier. */ -/* * link_name - Name of the link for which valrmation is being sought */ -/* * link_namelen - Name length */ -/* * size - Maximum number of characters of link value to be returned. */ -/* * lapl_id - Link access property list */ -/* * OUTPUTS */ -/* * */ -/* * linkval_buff - The buffer to hold the returned link value. */ -/* * */ -/* * RETURNS */ -/* * 0 on success, -1 on failure */ -/* * AUTHOR */ -/* * M. Scot Breitenfeld */ -/* * March 3, 2008 */ -/* * HISTORY */ -/* * N/A */ -/* * SOURCE */ -/* *\/ */ -/* int_f */ -/* h5lget_val_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, */ -/* size_t_f *size, _fcd linkval_buff, */ -/* hid_t_f *lapl_id) */ -/* { */ -/* char *c_link_name = NULL; /\* Buffer to hold C string *\/ */ -/* int_f ret_value = 0; /\* Return value *\/ */ -/* void *c_linkval_buff = NULL; */ - -/* /\* */ -/* * Convert FORTRAN name to C name */ -/* *\/ */ -/* if((c_link_name = HD5f2cstring(link_name, (size_t)*link_namelen)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* /\* */ -/* * Call H5Lval function. */ -/* *\/ */ -/* if(H5Lget_val((hid_t)*link_loc_id, c_link_name, &linkval_buff, (size_t)*size, (hid_t)*lapl_id) < 0) */ -/* HGOTO_DONE(FAIL); */ -/* /\* */ -/* * Convert C name to FORTRAN */ -/* *\/ */ -/* HD5packFstring(c_buf, _fcdtocp(buf), c_bufsize-1); */ - - -/* done: */ -/* return ret_value; */ -/* } */ - - -/* /\****if* H5Lf/ */ -/* * NAME */ -/* * H5Lregistered_c */ -/* * PURPOSE */ -/* * Call H5Lregistered */ -/* * INPUTS */ -/* * */ -/* * */ -/* * INPUTS */ -/* * */ -/* * version - Version number of this struct */ -/* * class_id - Link class identifier */ -/* * comment - Comment for debugging */ -/* * comment_len - Comment for debugging */ -/* * create_func - Callback during link creation */ -/* * create_func_len - length */ -/* * move_func - Callback after moving link */ -/* * move_func_len - length */ -/* * copy_func - Callback after copying link */ -/* * copy_func_len - length */ -/* * trav_func - The main traversal function */ -/* * trav_func_len - length */ -/* * del_func - Callback for link deletion */ -/* * del_func_len - length */ -/* * query_func - Callback for queries */ -/* * query_func_len - length */ -/* * */ -/* * RETURNS */ -/* * 0 on success, -1 on failure */ -/* * AUTHOR */ -/* * M. Scot Breitenfeld */ -/* * February 3, 2008 */ -/* * HISTORY */ -/* * */ -/* * SOURCE */ -/* *\/ */ - -/* int_f */ - -/* h5lregistered_c(int_f *version, int_f *class_id, */ -/* _fcd comment, size_t_f *comment_len, */ -/* _fcd create_func, size_t_f *create_func_len, */ -/* _fcd move_func, size_t_f *move_func_len, */ -/* _fcd copy_func, size_t_f *copy_func_len, */ -/* _fcd trav_func, size_t_f *trav_func_len, */ -/* _fcd del_func , size_t_f *del_func_len, */ -/* _fcd query_func, size_t_f *query_func_len) */ -/* { */ -/* char *c_comment = NULL; */ -/* char *c_create_func = NULL; */ -/* char *c_move_func = NULL; */ -/* char *c_copy_func = NULL; */ -/* char *c_trav_func = NULL; */ -/* char *c_del_func = NULL; */ -/* char *c_query_func = NULL; */ - -/* H5L_class_t class_t; */ - -/* int_f ret_value = 0; */ - -/* /\* */ -/* * Convert FORTRAN name to C name */ -/* *\/ */ -/* if((c_comment = HD5f2cstring(c_comment, (size_t)*sc_comment_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_create_func = HD5f2cstring(c_create_func, (size_t)*c_create_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_move_func = HD5f2cstring(c_move_func, (size_t)*sc_move_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_copy_func = HD5f2cstring(c_copy_func, (size_t)*c_copy_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_trav_func = HD5f2cstring(c_trav_func, (size_t)*sc_trav_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_del_func = HD5f2cstring(c_del_func, (size_t)*c_del_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_query_func = HD5f2cstring(c_query_func, (size_t)*c_query_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* /\* */ -/* * Pack into C struct H5L_class_t */ -/* *\/ */ -/* int version; /\* Version number of this struct *\/ */ -/* H5L_type_t class_id; /\* Link class identifier *\/ */ -/* const char *comment; /\* Comment for debugging *\/ */ -/* H5L_create_func_t create_func; /\* Callback during link creation *\/ */ -/* H5L_move_func_t move_func; /\* Callback after moving link *\/ */ -/* H5L_copy_func_t copy_func; /\* Callback after copying link *\/ */ -/* H5L_traverse_func_t trav_func; /\* The main traversal function *\/ */ -/* H5L_delete_func_t del_func; /\* Callback for link deletion *\/ */ -/* H5L_query_func_t query_func; /\* Callback for queries *\/ */ - -/* class_t.version = (int)*version; */ -/* class_t.class_id = (H5L_type_t)*class_id; */ -/* class_t.comment = c_comment; */ -/* class_t. */ - -/* /\* */ -/* * Call H5Lcopy function. */ -/* *\/ */ -/* if( H5Lcopy( (hid_t)*src_loc_id, c_src_name, (hid_t) *dest_loc_id, */ -/* c_dest_name, (hid_t)*lcpl_id, (hid_t)*lapl_id ) < 0) */ -/* HGOTO_DONE(FAIL); */ - -/* done: */ -/* if(c_src_name) */ -/* HDfree(c_src_name); */ -/* if(c_dest_name) */ -/* HDfree(c_dest_name); */ - -/* return ret_value; */ -/* } */ - /****if* H5Lf/h5lget_val_c * NAME * h5lget_val_c @@ -1068,6 +902,3 @@ h5literate_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, int_f *index return ret_value; } - - - diff --git a/fortran/src/H5Lff.F90 b/fortran/src/H5Lff.F90 index d5bb1d1..9775a7d 100644 --- a/fortran/src/H5Lff.F90 +++ b/fortran/src/H5Lff.F90 @@ -1020,292 +1020,6 @@ CONTAINS END SUBROUTINE h5lget_name_by_idx_f -! HAS PROBLEM WITH void pointer in C -!!$! -!!$!****s* H5L/ -!!$! -!!$! NAME -!!$! h5lget_val_by_idx_f -!!$! -!!$! PURPOSE -!!$! Returns the link value of a link, according to the order of -!!$! an index. For symbolic links, this is the path to which the -!!$! link points, including the null terminator. For user-defined -!!$! links, it is the link buffer. -!!$! INPUTS -!!$! loc_id - File or group identifier specifying location of subject group -!!$! group_name - Name of subject group -!!$! index_field - Index or field which determines the order -!!$! order - Order within field or index -!!$! n - Link for which to retrieve information -!!$! size - Maximum number of characters of link value to be returned. -!!$! -!!$! OUTPUTS NOTE: In C these are defined as a structure: H5L_info_t -!!$! corder_valid - indicates whether the creation order data is valid for this attribute -!!$! corder - is a positive integer containing the creation order of the attribute -!!$! cset - indicates the character set used for the attribute’s name -!!$! data_size - indicates the size, in the number of characters, of the attribute -!!$! hdferr - error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! OPTIONAL PARAMETERS -!!$! lapl_id - List access property list identifier. -!!$! -!!$! AUTHOR -!!$! M. Scot Breitenfeld -!!$! March 3, 2008 -!!$! -!!$! HISTORY N/A -!!$! -!!$! -!!$! SOURCE -!!$ SUBROUTINE h5lget_val_by_idx_f(loc_id, group_name, index_field, order, n, & -!!$ f_corder_valid, corder, cset, data_size, hdferr, lapl_id) -!!$ IMPLICIT NONE -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group -!!$ CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group -!!$ INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order -!!$ ! H5_INDEX_UNKNOWN_F - Unknown index type -!!$ ! H5_INDEX_NAME_F - Index on names -!!$ ! H5_INDEX_CRT_ORDER_F - Index on creation order -!!$ ! H5_INDEX_N_F - Number of indices defined -!!$ INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: -!!$ ! H5_ITER_UNKNOWN_F - Unknown order -!!$ ! H5_ITER_INC_F - Increasing order -!!$ ! H5_ITER_DEC_F - Decreasing order -!!$ ! H5_ITER_NATIVE_F - No particular order, whatever is fastest -!!$ INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index -!!$ LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute -!!$ INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute -!!$ INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name -!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: corder_valid -!!$ INTEGER(SIZE_T) :: group_namelen -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$ INTERFACE -!!$ INTEGER FUNCTION h5lget_val_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & -!!$ corder_valid, corder, cset, data_size, lapl_id_default) -!!$ USE H5GLOBAL -!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_BY_IDX_C'::h5lget_val_by_idx_c -!!$ !DEC$ENDIF -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name -!!$ INTEGER(SIZE_T) :: group_namelen -!!$ INTEGER, INTENT(IN) :: index_field -!!$ INTEGER, INTENT(IN) :: order -!!$ INTEGER(HSIZE_T), INTENT(IN) :: n -!!$ INTEGER :: corder_valid -!!$ INTEGER, INTENT(OUT) :: corder -!!$ INTEGER, INTENT(OUT) :: cset -!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ END FUNCTION h5lget_val_by_idx_c -!!$ END INTERFACE -!!$ -!!$ group_namelen = LEN(group_name) -!!$ -!!$ lapl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id -!!$ -!!$ hdferr = h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & -!!$ corder_valid, corder, cset, data_size, lapl_id_default) -!!$ -!!$ f_corder_valid =.FALSE. -!!$ IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. -!!$ -!!$ END SUBROUTINE h5lget_val_by_idx_f - -!!$! -!!$!****s* H5L/h5lget_val_f -!!$! -!!$! NAME -!!$! h5lget_val_f -!!$! -!!$! PURPOSE -!!$! Returns the value of a symbolic link. -!!$! -!!$! INPUTS -!!$! link_loc_id - File or group identifier. -!!$! link_name - Link whose value is to be returned. -!!$! size - Maximum number of characters of link value to be returned. -!!$! -!!$! OUTPUTS -!!$! linkval_buff - The buffer to hold the returned link value. -!!$! hdferr - error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! OPTIONAL PARAMETERS -!!$! lapl_id - List access property list identifier. -!!$! -!!$! AUTHOR -!!$! M. Scot Breitenfeld -!!$! March 3, 2008 -!!$! SOURCE -!!$ SUBROUTINE h5lget_val_f(link_loc_id, link_name, size, linkval_buff, & -!!$ hdferr, lapl_id) -!!$ IMPLICIT NONE -!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. -!!$ CHARACTER(LEN=*), INTENT(IN) :: link_name ! Link whose value is to be returned. -!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. -!!$ -!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ INTEGER :: corder_valid -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$! MS FORTRAN needs explicit interface for C functions called here. -!!$! -!!$ INTERFACE -!!$ INTEGER FUNCTION h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & -!!$ lapl_id_default) -!!$ USE H5GLOBAL -!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_C'::h5lget_val_c -!!$ !DEC$ENDIF -!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: link_name ! Link whose value is to be returned. -!!$ INTEGER :: link_namelen -!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. -!!$ -!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$ END FUNCTION h5lget_val_c -!!$ END INTERFACE -!!$ -!!$ link_namelen = LEN(link_name) -!!$ -!!$ lapl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id -!!$ -!!$ hdferr = h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & -!!$ lapl_id_default) -!!$ -!!$ END SUBROUTINE h5lget_val_f - -!!$! -!!$!****s* H5L/H5Lregistered_f -!!$! -!!$! NAME -!!$! H5Lregistered_f -!!$! -!!$! PURPOSE -!!$! Registers user-defined link class or changes behavior of existing class. -!!$! -!!$! INPUTS NOTE: In C the following represents struct H5L_class_t: -!!$! version - Version number of this struct -!!$! class_id - Link class identifier -!!$! comment - Comment for debugging -!!$! create_func - Callback during link creation -!!$! move_func - Callback after moving link -!!$! copy_func - Callback after copying link -!!$! trav_func - The main traversal function -!!$! del_func - Callback for link deletion -!!$! query_func - Callback for queries -!!$! -!!$! OUTPUTS -!!$! hdferr - Error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! OPTIONAL PARAMETERS -!!$! None -!!$! -!!$! AUTHOR -!!$! M. Scot Breitenfeld -!!$! February 29, 2008 -!!$! -!!$! HISTORY N/A -!!$! -!!$! -!!$! SOURCE -!!$ SUBROUTINE H5Lregistered_f(version, class_id, comment, create_func, & -!!$ move_func, copy_func, trav_func, del_func, query_func, hdferr) -!!$ IMPLICIT NONE -!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct -!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier -!!$ CHARACTER(LEN=*), INTENT(IN) :: comment ! Comment for debugging -!!$ CHARACTER(LEN=*), INTENT(IN) :: create_func ! Callback during link creation -!!$ CHARACTER(LEN=*), INTENT(IN) :: move_func ! Callback after moving link -!!$ CHARACTER(LEN=*), INTENT(IN) :: copy_func ! Callback after copying link -!!$ CHARACTER(LEN=*), INTENT(IN) :: trav_func ! The main traversal function -!!$ CHARACTER(LEN=*), INTENT(IN) :: del_func ! Callback for link deletion -!!$ CHARACTER(LEN=*), INTENT(IN) :: query_func ! Callback for queries -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: comment_len -!!$ INTEGER :: create_func_len -!!$ INTEGER :: move_func_len -!!$ INTEGER :: copy_func_len -!!$ INTEGER :: trav_func_len -!!$ INTEGER :: del_func_len -!!$ INTEGER :: query_func_len -!!$ -!!$ INTERFACE -!!$ INTEGER FUNCTION H5Lregistered_c(version, class_id, comment, & -!!$ create_func, create_func_len, & -!!$ move_func, move_func_len, & -!!$ copy_func, copy_func_len, & -!!$ trav_func, trav_func_len, & -!!$ del_func, del_func_len, & -!!$ query_func,query_func_len) -!!$ USE H5GLOBAL -!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LREGISTERED_C'::H5Lregistered_c -!!$ !DEC$ENDIF -!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct -!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: comment ! Comment for debugging -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: create_func ! Callback during link creation -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: move_func ! Callback after moving link -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: copy_func ! Callback after copying link -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: trav_func ! The main traversal function -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: del_func ! Callback for link deletion -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: query_func ! Callback for queries -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: comment_len -!!$ INTEGER :: create_func_len -!!$ INTEGER :: move_func_len -!!$ INTEGER :: copy_func_len -!!$ INTEGER :: trav_func_len -!!$ INTEGER :: del_func_len -!!$ INTEGER :: query_func_len -!!$ -!!$ END FUNCTION H5Lregistered_c -!!$ END INTERFACE -!!$ -!!$ comment_len = LEN(comment) -!!$ create_func_len = LEN(create_func) -!!$ move_func_len = LEN(move_func) -!!$ copy_func_len = LEN(copy_func) -!!$ trav_func_len = LEN(trav_func) -!!$ del_func_len = LEN(del_func) -!!$ query_func_len = LEN(query_func) -!!$ -!!$ hdferr = H5Lregistered_c(version, class_id, comment, & -!!$ create_func, create_func_len, & -!!$ move_func, move_func_len, & -!!$ copy_func, copy_func_len, & -!!$ trav_func, trav_func_len, & -!!$ del_func, del_func_len, & -!!$ query_func, query_func_len) -!!$ -!!$ END SUBROUTINE H5Lregistered_f - !****s* H5L (F03)/h5literate_f ! ! NAME diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 7b5b5c9..3d87c28 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -4012,22 +4012,6 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Lunregister(int link_cls_id) throws HDF5LibraryException; - // /////// unimplemented //////// - // herr_t H5Lcreate_ud(hid_t link_loc_id, const char *link_name, - // H5L_type_t link_type, const void *udata, size_t udata_size, hid_t lcpl_id, - // hid_t lapl_id); - - // herr_t H5Lregister(const H5L_class_t *cls); - - // herr_t H5Lunpack_elink_val(const void *ext_linkval/*in*/, size_t link_size, - // unsigned *flags, const char **filename/*out*/, const char **obj_path /*out*/); - // herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, - // size_t size, hid_t lapl_id); - // herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name, - // H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - // void *buf/*out*/, size_t size, hid_t lapl_id); - - // //////////////////////////////////////////////////////////// // // // H5O: HDF5 1.8 Object Interface API Functions // diff --git a/src/H5.c b/src/H5.c index f0a222d..d67c346 100644 --- a/src/H5.c +++ b/src/H5.c @@ -21,6 +21,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ @@ -224,7 +225,7 @@ H5_init_library(void) 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") + HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize FS interface") /* Debugging? */ H5_debug_mask("-all"); @@ -267,6 +268,9 @@ H5_term_library(void) /* Indicate that the library is being shut down */ H5_TERM_GLOBAL = TRUE; + /* Push the API context without checking for errors */ + H5CX_push_special(); + /* Check if we should display error output */ (void)H5Eget_auto2(H5E_DEFAULT, &func, NULL); @@ -351,9 +355,12 @@ H5_term_library(void) /* Don't shut down the skip list code until everything that uses it is down */ if(pending == 0) pending += DOWN(SL); - /* Don't shut down the free list code until _everything_ else is down */ + /* Don't shut down the free list code until everything that uses it is down */ if(pending == 0) pending += DOWN(FL); + /* Don't shut down the API context code until _everything_ else is down */ + if(pending == 0) + pending += DOWN(CX); } /* end if */ } while(pending && ntries++ < 100); @@ -409,6 +416,9 @@ H5_term_library(void) /* Mark library as closed */ H5_INIT_GLOBAL = FALSE; + /* Don't pop the API context, since it's been shut down already */ + /* H5CX_pop_special(); */ + done: #ifdef H5_HAVE_THREADSAFE H5_API_UNLOCK diff --git a/src/H5A.c b/src/H5A.c index 07aca92..1b42106 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -24,6 +24,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ @@ -91,7 +92,7 @@ static const H5I_class_t H5I_ATTR_CLS[1] = {{ H5I_ATTR, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5A_close /* Callback routine for closing objects of this class */ + (H5I_free_t)H5A__close_cb /* Callback routine for closing objects of this class */ }}; /* Flag indicating "top" of interface has been initialized */ @@ -250,7 +251,7 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, H5G_loc_t loc; /* Object location */ H5T_t *type; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -270,12 +271,16 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Go do the real work for attaching the attribute to the object */ - if(NULL == (attr = H5A_create(&loc, attr_name, type, space, acpl_id, dxpl_id))) + if(NULL == (attr = H5A__create(&loc, attr_name, type, space, acpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create attribute") /* Register the new attribute and get an ID for it */ @@ -284,8 +289,10 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, done: /* Cleanup on failure */ - if(ret_value < 0 && attr && H5A_close(attr) < 0) + if(ret_value < 0 && attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Acreate2() */ @@ -328,13 +335,9 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5A_t *attr = NULL; /* Attribute created */ H5G_loc_t loc; /* Object location */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ H5T_t *type; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -357,33 +360,34 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; + if(H5P_DEFAULT != lapl_id) { + if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") + H5CX_set_lapl(lapl_id); + } /* end if */ - /* Go do the real work for attaching the attribute to the dataset */ - if(NULL == (attr = H5A_create(&obj_loc, attr_name, type, space, acpl_id, dxpl_id))) + /* Create the attribute on the object */ + if(NULL == (attr = H5A__create_by_name(&loc, obj_name, attr_name, type, space, acpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create attribute") /* Register the new attribute and get an ID for it */ if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID") + done: - /* Release resources */ - if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") - if(ret_value < 0 && attr && H5A_close(attr) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") + /* Cleanup on failure */ + if(ret_value < 0 && attr && H5A__close(attr) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Acreate_by_name() */ @@ -413,7 +417,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -427,17 +431,17 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Read in attribute from object header */ - if(NULL == (attr = H5O_attr_open_by_name(loc.oloc, attr_name, dxpl_id))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from object header for attribute: '%s'", attr_name) - - /* Finish initializing attribute */ - if(H5A__open_common(&loc, attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to initialize attribute") + if(NULL == (attr = H5A__open(&loc, attr_name))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to load attribute info from object header for attribute: '%s'", attr_name) /* Register the attribute and get an ID for it */ if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) @@ -446,8 +450,10 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) done: /* Cleanup on failure */ if(ret_value < 0) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen() */ @@ -480,7 +486,7 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -495,18 +501,23 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name") if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") - if(H5P_DEFAULT == lapl_id) - lapl_id = H5P_LINK_ACCESS_DEFAULT; - else + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + + if(H5P_DEFAULT != lapl_id) { if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") - - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") + H5CX_set_lapl(lapl_id); + } /* end if */ /* Open the attribute on the object header */ - if(NULL == (attr = H5A_open_by_name(&loc, obj_name, attr_name, lapl_id, dxpl_id))) + if(NULL == (attr = H5A__open_by_name(&loc, obj_name, attr_name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Register the attribute and get an ID for it */ @@ -516,8 +527,10 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, done: /* Cleanup on failure */ if(ret_value < 0) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_by_name() */ @@ -553,7 +566,7 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5A_t *attr = NULL; /* Attribute opened */ H5G_loc_t loc; /* Object location */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -571,18 +584,23 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - if(H5P_DEFAULT == lapl_id) - lapl_id = H5P_LINK_ACCESS_DEFAULT; - else + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + + if(H5P_DEFAULT != lapl_id) { if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") - - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") + H5CX_set_lapl(lapl_id); + } /* end if */ /* Open the attribute in the object header */ - if(NULL == (attr = H5A_open_by_idx(&loc, obj_name, idx_type, order, n, lapl_id, dxpl_id))) + if(NULL == (attr = H5A__open_by_idx(&loc, obj_name, idx_type, order, n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open attribute") /* Register the attribute and get an ID for it */ @@ -592,8 +610,10 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, done: /* Cleanup on failure */ if(ret_value < 0) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_by_idx() */ @@ -620,8 +640,7 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) { H5A_t *attr; /* Attribute object for ID */ H5T_t *mem_type; /* Memory datatype */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - hid_t aapl_id = H5P_DEFAULT; /* temp access plist */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -635,15 +654,21 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, attr_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(attr_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") /* Go write the actual data to the attribute */ - if((ret_value = H5A__write(attr, mem_type, buf, dxpl_id)) < 0) + if((ret_value = H5A__write(attr, mem_type, buf)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Awrite() */ @@ -669,8 +694,7 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) { H5A_t *attr; /* Attribute object for ID */ H5T_t *mem_type; /* Memory datatype */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - hid_t aapl_id = H5P_DEFAULT; /* temp access plist */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -684,15 +708,18 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, attr_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Go write the actual data to the attribute */ - if((ret_value = H5A__read(attr, mem_type, buf, dxpl_id)) < 0) + if((ret_value = H5A__read(attr, mem_type, buf)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aread() */ @@ -752,8 +779,9 @@ done: hid_t H5Aget_type(hid_t attr_id) { - H5A_t *attr; /* Attribute object for ID */ - hid_t ret_value; /* Return value */ + H5A_t *attr; /* Attribute object for ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", attr_id); @@ -762,9 +790,17 @@ H5Aget_type(hid_t attr_id) if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - if((ret_value = H5A_get_type(attr)) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + if((ret_value = H5A__get_type(attr)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of attribute") + done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aget_type() */ @@ -803,7 +839,7 @@ H5Aget_create_plist(hid_t attr_id) if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - if((ret_value = H5A_get_create_plist(attr)) < 0) + if((ret_value = H5A__get_create_plist(attr)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get creation property list for attr") done: @@ -880,7 +916,7 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -899,12 +935,16 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ - if(NULL == (attr = H5A_open_by_idx(&loc, obj_name, idx_type, order, n, lapl_id, dxpl_id))) + if(NULL == (attr = H5A__open_by_idx(&loc, obj_name, idx_type, order, n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Get the length of the name */ @@ -919,8 +959,10 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, done: /* Release resources */ - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_name_by_idx() */ @@ -1018,7 +1060,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1036,12 +1078,16 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, if(NULL == ainfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ - if(NULL == (attr = H5A_open_by_name(&loc, obj_name, attr_name, lapl_id, dxpl_id))) + if(NULL == (attr = H5A__open_by_name(&loc, obj_name, attr_name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Get the attribute information */ @@ -1049,9 +1095,11 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info") done: - /* Cleanup on failure */ - if(attr && H5A_close(attr) < 0) + /* Release resources */ + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_info_by_name() */ @@ -1077,7 +1125,7 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1098,12 +1146,16 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(NULL == ainfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ - if(NULL == (attr = H5A_open_by_idx(&loc, obj_name, idx_type, order, n, lapl_id, dxpl_id))) + if(NULL == (attr = H5A__open_by_idx(&loc, obj_name, idx_type, order, n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Get the attribute information */ @@ -1112,8 +1164,10 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, done: /* Release resources */ - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_info_by_idx() */ @@ -1135,6 +1189,7 @@ done: herr_t H5Arename(hid_t loc_id, const char *old_name, const char *new_name) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1153,12 +1208,22 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") + /* Call private attribute rename routine */ - if(H5O_attr_rename(loc.oloc, H5AC_ind_read_dxpl_id, old_name, new_name) < 0) + if(H5A__rename(&loc, old_name, new_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Arename() */ @@ -1180,6 +1245,7 @@ herr_t H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, const char *new_attr_name, hid_t lapl_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1199,21 +1265,26 @@ H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, /* Avoid thrashing things if the names are the same */ if(HDstrcmp(old_attr_name, new_attr_name)) { H5G_loc_t loc; /* Object location */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by the library */ - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Call private attribute rename routine */ - if(H5A_rename_by_name(loc, obj_name, old_attr_name, new_attr_name, lapl_id, dxpl_id) < 0) + if(H5A__rename_by_name(loc, obj_name, old_attr_name, new_attr_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Arename_by_name() */ @@ -1263,9 +1334,7 @@ herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data) { - H5A_attr_iter_op_t attr_op; /* Attribute operator */ - hsize_t start_idx; /* Index of attribute to start iterating at */ - hsize_t last_attr; /* Index of last attribute examined */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1279,20 +1348,18 @@ H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Build attribute operator info */ - attr_op.op_type = H5A_ATTR_OP_APP2; - attr_op.u.app_op2 = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Call attribute iteration routine */ - last_attr = start_idx = (idx ? *idx : 0); - if((ret_value = H5O_attr_iterate(loc_id, H5AC_ind_read_dxpl_id, idx_type, order, start_idx, &last_attr, &attr_op, op_data)) < 0) + if((ret_value = H5A__iterate(loc_id, idx_type, order, idx, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); - /* Set the last attribute information */ - if(idx) - *idx = last_attr; - done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate2() */ @@ -1346,15 +1413,7 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - hid_t obj_loc_id = (-1); /* ID for object located */ - H5A_attr_iter_op_t attr_op; /* Attribute operator */ - hsize_t start_idx; /* Index of attribute to start iterating at */ - hsize_t last_attr; /* Index of last attribute examined */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1373,46 +1432,21 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; - - /* Open the object */ - if((obj_loc_id = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, TRUE)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open object") - - /* Build attribute operator info */ - attr_op.op_type = H5A_ATTR_OP_APP2; - attr_op.u.app_op2 = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") - /* Call attribute iteration routine */ - last_attr = start_idx = (idx ? *idx : 0); - if((ret_value = H5O_attr_iterate(obj_loc_id, dxpl_id, idx_type, order, start_idx, &last_attr, &attr_op, op_data)) < 0) + /* Call attribute iteration by name routine */ + if((ret_value = H5A__iterate_by_name(&loc, obj_name, idx_type, order, idx, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); - /* Set the last attribute information */ - if(idx) - *idx = last_attr; - done: - /* Release resources */ - if(obj_loc_id > 0) { - if(H5I_dec_app_ref(obj_loc_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") - } /* end if */ - else if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate_by_name() */ @@ -1435,6 +1469,7 @@ herr_t H5Adelete(hid_t loc_id, const char *name) { H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1448,11 +1483,21 @@ H5Adelete(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") + /* Delete the attribute from the location */ - if(H5O_attr_remove(loc.oloc, name, H5AC_ind_read_dxpl_id) < 0) + if(H5A__delete(&loc, name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete() */ @@ -1478,11 +1523,7 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1498,29 +1539,21 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Delete the attribute from the location */ - if(H5O_attr_remove(obj_loc.oloc, attr_name, dxpl_id) < 0) + if(H5A__delete_by_name(&loc, obj_name, attr_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: - /* Release resources */ - if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete_by_name() */ @@ -1554,11 +1587,7 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1576,29 +1605,21 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Delete the attribute from the location */ - if(H5O_attr_remove_by_idx(obj_loc.oloc, idx_type, order, n, dxpl_id) < 0) + if(H5A__delete_by_idx(&loc, obj_name, idx_type, order, n) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: - /* Release resources */ - if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete_by_idx() */ @@ -1621,6 +1642,7 @@ done: herr_t H5Aclose(hid_t attr_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1629,12 +1651,17 @@ H5Aclose(hid_t attr_id) /* check arguments */ if(NULL == H5I_object_verify(attr_id, H5I_ATTR)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Decrement references to that atom (and close it) */ if(H5I_dec_app_ref(attr_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "can't close attribute") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aclose() */ @@ -1657,6 +1684,7 @@ htri_t H5Aexists(hid_t obj_id, const char *attr_name) { H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1670,11 +1698,18 @@ H5Aexists(hid_t obj_id, const char *attr_name) if (!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Check if the attribute exists */ - if((ret_value = H5O_attr_exists(loc.oloc, attr_name, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5A__exists(&loc, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aexists() */ @@ -1697,7 +1732,7 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1713,14 +1748,20 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, if (!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") - /* Verify access property list and get correct dxpl */ - if (H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") - if ((ret_value = H5A_exists_by_name(loc, obj_name, attr_name, lapl_id, dxpl_id)) < 0) + if ((ret_value = H5A__exists_by_name(loc, obj_name, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aexists_by_name() */ diff --git a/src/H5AC.c b/src/H5AC.c index 4223158..55434b7 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -39,6 +39,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACpkg.h" /* Metadata cache */ #include "H5Cprivate.h" /* Cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5FDprivate.h" /* File drivers */ @@ -66,7 +67,7 @@ static herr_t H5AC__check_if_write_permitted(const H5F_t *f, static herr_t H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr, H5C_auto_size_ctl_t *int_conf_ptr); #if H5AC_DO_TAGGING_SANITY_CHECKS -static herr_t H5AC__verify_tag(hid_t dxpl_id, const H5AC_class_t * type); +static herr_t H5AC__verify_tag(const H5AC_class_t * type); #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ @@ -81,20 +82,6 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Library Private Variables */ /*****************************/ -/* Default dataset transfer property list for metadata I/O calls (coll write, ind read) */ -hid_t H5AC_ind_read_dxpl_id = (-1); -#ifdef H5_HAVE_PARALLEL -/* collective metadata read property */ -hid_t H5AC_coll_read_dxpl_id = (-1); -#endif /* H5_HAVE_PARALLEL */ - -/* DXPL to be used in operations that will not result in I/O calls */ -hid_t H5AC_noio_dxpl_id = (-1); - -/* Default DXPL to be used for raw data I/O operations when one is not - provided by the user (fill values in H5Dcreate) */ -hid_t H5AC_rawdata_dxpl_id = (-1); - #ifdef H5_HAVE_PARALLEL /* Environment variable for collective API sanity checks */ hbool_t H5_coll_api_sanity_check_g = false; @@ -187,18 +174,7 @@ done: herr_t H5AC__init_package(void) { -#if defined H5_DEBUG_BUILD | defined H5_HAVE_PARALLEL - H5P_genplist_t *xfer_plist; /* Dataset transfer property list object */ -#endif /* defined H5_DEBUG_BUILD | defined H5_HAVE_PARALLEL */ -#ifdef H5_DEBUG_BUILD - H5FD_dxpl_type_t dxpl_type; /* Property indicating the type of the internal dxpl */ -#endif /* H5_DEBUG_BUILD */ -#ifdef H5_HAVE_PARALLEL - H5P_coll_md_read_flag_t coll_meta_read; -#endif /* H5_HAVE_PARALLEL */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_NOERR #ifdef H5_HAVE_PARALLEL /* check whether to enable strict collective function calling @@ -212,81 +188,7 @@ H5AC__init_package(void) } #endif /* H5_HAVE_PARALLEL */ -#if defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) - /* Get an ID for the internal independent metadata dxpl */ - if((H5AC_ind_read_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") - - /* Get an ID for the no I/O internal dxpl */ - if((H5AC_noio_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") - - /* Get an ID for the raw data (H5AC) dxpl */ - if((H5AC_rawdata_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") - - /* if this is a debug build, set the dxpl type flag on the - independent metadata dxpl and create the noio and raw data internal dxpls */ -#ifdef H5_DEBUG_BUILD - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - /* Insert the dxpl type property */ - dxpl_type = H5FD_METADATA_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set dxpl type property") - - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_noio_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - /* Insert the dxpl type property */ - dxpl_type = H5FD_NOIO_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set dxpl type property") - - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - /* Insert the dxpl type property */ - dxpl_type = H5FD_RAWDATA_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set dxpl type property") -#endif /* H5_DEBUG_BUILD */ - - /* if this is a parallel build, create an internal dxpl for - collective metadata reads */ -#ifdef H5_HAVE_PARALLEL - /* Get an ID for H5AC_coll_read_dxpl_id */ - if((H5AC_coll_read_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_coll_read_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - /* set 'collective metadata read' property */ - coll_meta_read = H5P_USER_TRUE; - if(H5P_set(xfer_plist, H5_COLL_MD_READ_FLAG_NAME, &coll_meta_read) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set collective metadata read flag") - - /* if we have a debug build, set the dxpl type to metadata on the - collective metadata dxpl */ -#ifdef H5_DEBUG_BUILD - /* set metadata dxpl type */ - dxpl_type = H5FD_METADATA_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set dxpl type property") -#endif /* H5_DEBUG_BUILD */ -#endif /* H5_HAVE_PARALLEL */ - -#else /* defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) */ - H5AC_ind_read_dxpl_id = H5P_DATASET_XFER_DEFAULT; - H5AC_noio_dxpl_id = H5P_DATASET_XFER_DEFAULT; - H5AC_rawdata_dxpl_id = H5P_DATASET_XFER_DEFAULT; -#endif /* defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) */ - -#if defined(H5_DEBUG_BUILD) | defined(H5_HAVE_PARALLEL) -done: -#endif /* defined(H5_DEBUG_BUILD) | defined(H5_HAVE_PARALLEL) */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5AC__init_package() */ @@ -307,46 +209,13 @@ done: int H5AC_term_package(void) { - int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_PKG_INIT_VAR) { - if(H5AC_ind_read_dxpl_id > 0 || H5AC_noio_dxpl_id > 0 || H5AC_rawdata_dxpl_id > 0 -#ifdef H5_HAVE_PARALLEL - || H5AC_coll_read_dxpl_id > 0 -#endif /* H5_HAVE_PARALLEL */ - ) { -#if defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) - /* Indicate more work to do */ - n = 1; /* H5I */ - - /* Close H5AC dxpls */ - if(H5I_dec_ref(H5AC_ind_read_dxpl_id) < 0 || - H5I_dec_ref(H5AC_noio_dxpl_id) < 0 || - H5I_dec_ref(H5AC_rawdata_dxpl_id) < 0 -#ifdef H5_HAVE_PARALLEL - || H5I_dec_ref(H5AC_coll_read_dxpl_id) < 0 -#endif /* H5_HAVE_PARALLEL */ - ) - H5E_clear_stack(NULL); /*ignore error*/ -#endif /* defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) */ - - /* Reset static IDs */ - H5AC_ind_read_dxpl_id = (-1); - H5AC_noio_dxpl_id = (-1); - H5AC_rawdata_dxpl_id = (-1); -#ifdef H5_HAVE_PARALLEL - H5AC_coll_read_dxpl_id = (-1); -#endif /* H5_HAVE_PARALLEL */ - } /* end if */ - + if(H5_PKG_INIT_VAR) /* Reset interface initialization flag */ - if(0 == n) - H5_PKG_INIT_VAR = FALSE; - } /* end if */ + H5_PKG_INIT_VAR = FALSE; - FUNC_LEAVE_NOAPI(n) + FUNC_LEAVE_NOAPI(0) } /* end H5AC_term_package() */ @@ -598,7 +467,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_dest(H5F_t *f, hid_t dxpl_id) +H5AC_dest(H5F_t *f) { #ifdef H5_HAVE_PARALLEL H5AC_aux_t * aux_ptr = NULL; @@ -646,15 +515,14 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) * Must not flush in the R/O case, as this will trigger the * free space manager settle routines. */ - if ( ( H5F_ACC_RDWR & H5F_INTENT(f) ) && - ( H5AC__flush_entries(f, dxpl_id) < 0 ) ) - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") + if(H5F_ACC_RDWR & H5F_INTENT(f)) + if(H5AC__flush_entries(f) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") #endif /* H5_HAVE_PARALLEL */ /* Destroy the cache */ - if(H5C_dest(f, dxpl_id) < 0) + if(H5C_dest(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't destroy cache") f->shared->cache = NULL; @@ -696,7 +564,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_evict(H5F_t *f, hid_t dxpl_id) +H5AC_evict(H5F_t *f) { hbool_t log_enabled; /* TRUE if logging was set up */ hbool_t curr_logging; /* TRUE if currently logging */ @@ -714,7 +582,7 @@ H5AC_evict(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to get logging status") /* Evict all entries in the cache except the pinned superblock entry */ - if(H5C_evict(f, dxpl_id) < 0) + if(H5C_evict(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't evict cache") done: @@ -743,8 +611,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, - haddr_t addr, unsigned flags) +H5AC_expunge_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, + unsigned flags) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -781,7 +649,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) + if(H5C_expunge_entry(f, type, addr, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed") done: @@ -820,7 +688,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_flush(H5F_t *f, hid_t dxpl_id) +H5AC_flush(H5F_t *f) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -855,13 +723,13 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id) 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) + if(H5AC__flush_entries(f) < 0) 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) + if(H5C_flush_cache(f, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache") done: @@ -900,7 +768,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_force_cache_image_load(H5F_t *f, hid_t dxpl_id) +H5AC_force_cache_image_load(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -911,7 +779,7 @@ H5AC_force_cache_image_load(H5F_t *f, hid_t dxpl_id) HDassert(f->shared); HDassert(f->shared->cache); - if(H5C_force_cache_image_load(f, dxpl_id) < 0) + if(H5C_force_cache_image_load(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "Can't load cache image") done: @@ -1003,8 +871,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, - void *thing, unsigned int flags) +H5AC_insert_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, + unsigned int flags) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -1048,12 +916,12 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add #endif /* H5AC__TRACE_FILE_ENABLED */ #if H5AC_DO_TAGGING_SANITY_CHECKS - if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(dxpl_id, type) < 0) + if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(type) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Bad tag value") #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ /* Insert entry into metadata cache */ - if(H5C_insert_entry(f, dxpl_id, type, addr, thing, flags) < 0) + if(H5C_insert_entry(f, type, addr, thing, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C_insert_entry() failed") #if H5AC__TRACE_FILE_ENABLED @@ -1073,7 +941,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) + if(H5AC__run_sync_point(f, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") } /* end if */ } @@ -1431,12 +1299,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, - haddr_t new_addr, hid_t -#ifndef H5_HAVE_PARALLEL -H5_ATTR_UNUSED -#endif /* H5_HAVE_PARALLEL */ - dxpl_id) +H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -1486,7 +1349,7 @@ H5_ATTR_UNUSED #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) + if(H5AC__run_sync_point(f, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") #endif /* H5_HAVE_PARALLEL */ @@ -1591,7 +1454,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_prep_for_file_close(H5F_t *f, hid_t dxpl_id) +H5AC_prep_for_file_close(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1602,7 +1465,7 @@ H5AC_prep_for_file_close(H5F_t *f, hid_t dxpl_id) HDassert(f->shared); HDassert(f->shared->cache); - if(H5C_prep_for_file_close(f, dxpl_id) < 0) + if(H5C_prep_for_file_close(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cache prep for file close failed") done: @@ -1701,8 +1564,8 @@ done: *------------------------------------------------------------------------- */ void * -H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, - void *udata, unsigned flags) +H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *udata, + unsigned flags) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -1755,11 +1618,11 @@ H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #endif /* H5AC__TRACE_FILE_ENABLED */ #if H5AC_DO_TAGGING_SANITY_CHECKS - if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(dxpl_id, type) < 0) + if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(type) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, NULL, "Bad tag value") #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ - if(NULL == (thing = H5C_protect(f, dxpl_id, type, addr, udata, flags))) + if(NULL == (thing = H5C_protect(f, type, addr, udata, flags))) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed") #if H5AC__TRACE_FILE_ENABLED @@ -2039,8 +1902,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, - void *thing, unsigned flags) +H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, + unsigned flags) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -2111,13 +1974,13 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, } /* end if */ #endif /* H5_HAVE_PARALLEL */ - if(H5C_unprotect(f, dxpl_id, addr, thing, flags) < 0) + if(H5C_unprotect(f, addr, thing, flags) < 0) 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) + if(H5AC__run_sync_point(f, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") #endif /* H5_HAVE_PARALLEL */ @@ -2765,33 +2628,19 @@ done: * *------------------------------------------------------------------------------ */ -herr_t -H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag) +void +H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag) { - H5P_genplist_t *dxpl; /* Dataset transfer property list */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check Arguments */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a property list") + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Get the current tag value and return that (if prev_tag is NOT null) */ - if(prev_tag) { - haddr_t tag; /* Tag value */ + if(prev_tag) + *prev_tag = H5CX_get_tag(); - if((H5P_get(dxpl, H5AC_TAG_NAME, &tag)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query dxpl") - *prev_tag = tag; - } /* end if */ + /* Set the provided tag */ + H5CX_set_tag(metadata_tag); - /* Set the provided tag in the dxpl_id. */ - if(H5P_set(dxpl, H5AC_TAG_NAME, &metadata_tag) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set tag in dxpl") - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOID } /* H5AC_tag */ @@ -2843,7 +2692,7 @@ done: *------------------------------------------------------------------------------ */ herr_t -H5AC_flush_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id) +H5AC_flush_tagged_metadata(H5F_t *f, haddr_t metadata_tag) { /* Variable Declarations */ herr_t ret_value = SUCCEED; @@ -2856,7 +2705,7 @@ H5AC_flush_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id) HDassert(f->shared); /* Call cache level function to flush metadata entries with specified tag */ - if(H5C_flush_tagged_entries(f, dxpl_id, metadata_tag) < 0) + if(H5C_flush_tagged_entries(f, metadata_tag) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cannot flush metadata") done: @@ -2878,7 +2727,7 @@ done: *------------------------------------------------------------------------------ */ herr_t -H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hbool_t match_global, hid_t dxpl_id) +H5AC_evict_tagged_metadata(H5F_t *f, haddr_t metadata_tag, hbool_t match_global) { /* Variable Declarations */ herr_t ret_value = SUCCEED; @@ -2891,7 +2740,7 @@ H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hbool_t match_global HDassert(f->shared); /* Call cache level function to evict metadata entries with specified tag */ - if(H5C_evict_tagged_entries(f, dxpl_id, metadata_tag, match_global) < 0) + if(H5C_evict_tagged_entries(f, metadata_tag, match_global) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cannot evict metadata") done: @@ -2912,7 +2761,7 @@ done: *------------------------------------------------------------------------------ */ herr_t -H5AC_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id, unsigned flags) +H5AC_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags) { /* Variable Declarations */ herr_t ret_value = SUCCEED; @@ -2925,7 +2774,7 @@ H5AC_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id HDassert(f->shared); /* Call cache level function to expunge entries with specified tag and type id */ - if(H5C_expunge_tag_type_metadata(f, dxpl_id, tag, type_id, flags)<0) + if(H5C_expunge_tag_type_metadata(f, tag, type_id, flags)<0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cannot expunge tagged type entries") done: @@ -3019,21 +2868,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__verify_tag(hid_t dxpl_id, const H5AC_class_t *type) +H5AC__verify_tag(const H5AC_class_t *type) { - H5P_genplist_t *dxpl; /* DXPL for operation */ haddr_t tag; /* Entry tag to validate */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - - /* Get the tag from the DXPL */ - if((H5P_get(dxpl, H5AC_TAG_NAME, &tag)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query property value") + /* Get the current tag */ + tag = H5CX_get_tag(); /* Verify legal tag value */ if(H5C_verify_tag(type->id, tag) < 0) @@ -3095,67 +2938,23 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5AC_set_ring(hid_t dxpl_id, H5AC_ring_t ring, H5P_genplist_t **dxpl, - H5AC_ring_t *orig_ring) +void +H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring) { - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR - /* Sanity checks */ - HDassert(dxpl); - HDassert(orig_ring); + /* Get the current ring value and return that (if orig_ring is NOT null) */ + if(orig_ring) + *orig_ring = H5CX_get_ring(); - /* Set the ring type in the DXPL */ - if(NULL == ((*dxpl) = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - if((H5P_get((*dxpl), H5AC_RING_NAME, orig_ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get original ring value") - if((H5P_set((*dxpl), H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the provided ring */ + H5CX_set_ring(ring); -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOID } /* end H5AC_set_ring() */ /*------------------------------------------------------------------------- - * Function: H5AC_reset_ring - * - * Purpose: Routine to reset the original ring on a DXPL (after passing - * through to the metadata cache). - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Tuesday, September 8, 2015 - * - *------------------------------------------------------------------------- - */ -herr_t -H5AC_reset_ring(H5P_genplist_t *dxpl, H5AC_ring_t orig_ring) -{ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Reset the ring in the DXPL, if it's been changed */ - if(orig_ring) { - /* Sanity check */ - HDassert(dxpl); - - if((H5P_set(dxpl, H5AC_RING_NAME, &orig_ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5AC_reset_ring() */ - - -/*------------------------------------------------------------------------- * Function: H5AC_unsettle_entry_ring() * * Purpose: Advise the metadata cache that the specified entry's metadata diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index d03c17b..03e31b4 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -94,20 +94,19 @@ 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); -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__propagate_and_apply_candidate_list(H5F_t *f); +static herr_t H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f); 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, 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__receive_and_apply_clean_list(H5F_t *f); 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); -static herr_t H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id); -static herr_t H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id); +static herr_t H5AC__rsp__dist_md_write__flush(H5F_t *f); +static herr_t H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f); +static herr_t H5AC__rsp__p0_only__flush(H5F_t *f); +static herr_t H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f); /*********************/ @@ -1226,7 +1225,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id) +H5AC__propagate_and_apply_candidate_list(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1275,7 +1274,7 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Apply the candidate list */ - result = H5C_apply_candidate_list(f, dxpl_id, cache_ptr, num_candidates, + result = H5C_apply_candidate_list(f, cache_ptr, num_candidates, candidates_list_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size); /* Disable writes again */ @@ -1393,7 +1392,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, hid_t dxpl_id) +H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1416,7 +1415,7 @@ H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, hid_t dxpl_id) HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); } /* end if */ else { - if(H5AC__receive_and_apply_clean_list(f, dxpl_id) < 0) + if(H5AC__receive_and_apply_clean_list(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't receive and/or process clean slist broadcast.") } /* end else */ @@ -1516,7 +1515,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t dxpl_id) +H5AC__receive_and_apply_clean_list(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1541,7 +1540,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, 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 @@ -1659,7 +1658,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id) +H5AC__rsp__dist_md_write__flush(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1702,7 +1701,7 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Apply the candidate list */ - result = H5C_apply_candidate_list(f, dxpl_id, cache_ptr, num_entries, + result = H5C_apply_candidate_list(f, cache_ptr, num_entries, haddr_buf_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size); /* Disable writes again */ @@ -1801,7 +1800,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) +H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1830,7 +1829,7 @@ H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate list.") /* propagate and apply candidate list -- all processes */ - if(H5AC__propagate_and_apply_candidate_list(f, dxpl_id) < 0) + if(H5AC__propagate_and_apply_candidate_list(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate and apply candidate list.") } /* evictions enabled */ @@ -1876,7 +1875,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id) +H5AC__rsp__p0_only__flush(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1909,7 +1908,7 @@ H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Flush the cache */ - result = H5C_flush_cache(f, dxpl_id, H5AC__NO_FLAGS_SET); + result = H5C_flush_cache(f, H5AC__NO_FLAGS_SET); /* Disable writes again */ aux_ptr->write_permitted = FALSE; @@ -1927,7 +1926,7 @@ H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id) } /* end if */ /* Propagate cleaned entries to other ranks. */ - if(H5AC__propagate_flushed_and_still_clean_entries_list(f, dxpl_id) < 0) + if(H5AC__propagate_flushed_and_still_clean_entries_list(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.") done: @@ -1978,7 +1977,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) +H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -2030,7 +2029,7 @@ H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Flush the cache */ - result = H5C_flush_to_min_clean(f, dxpl_id); + result = H5C_flush_to_min_clean(f); /* Disable writes again */ aux_ptr->write_permitted = FALSE; @@ -2047,7 +2046,7 @@ H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) (aux_ptr->write_done)(); } /* end if */ - if(H5AC__propagate_flushed_and_still_clean_entries_list(f, dxpl_id) < 0) + if(H5AC__propagate_flushed_and_still_clean_entries_list(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.") } /* end if */ @@ -2088,7 +2087,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC__run_sync_point(H5F_t *f, hid_t dxpl_id, int sync_point_op) +H5AC__run_sync_point(H5F_t *f, int sync_point_op) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -2130,12 +2129,12 @@ HDfprintf(stdout, "%d:H5AC_propagate...:%u: (u/uu/i/iu/r/ru) = %zu/%u/%zu/%u/%zu case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: switch(sync_point_op) { case H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN: - if(H5AC__rsp__p0_only__flush_to_min_clean(f, dxpl_id) < 0) + if(H5AC__rsp__p0_only__flush_to_min_clean(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__p0_only__flush_to_min_clean() failed.") break; case H5AC_SYNC_POINT_OP__FLUSH_CACHE: - if(H5AC__rsp__p0_only__flush(f, dxpl_id) < 0) + if(H5AC__rsp__p0_only__flush(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__p0_only__flush() failed.") break; @@ -2148,12 +2147,12 @@ HDfprintf(stdout, "%d:H5AC_propagate...:%u: (u/uu/i/iu/r/ru) = %zu/%u/%zu/%u/%zu case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: switch(sync_point_op) { case H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN: - if(H5AC__rsp__dist_md_write__flush_to_min_clean(f, dxpl_id) < 0) + if(H5AC__rsp__dist_md_write__flush_to_min_clean(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__dist_md_write__flush_to_min_clean() failed.") break; case H5AC_SYNC_POINT_OP__FLUSH_CACHE: - if(H5AC__rsp__dist_md_write__flush(f, dxpl_id) < 0) + if(H5AC__rsp__dist_md_write__flush(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__dist_md_write__flush() failed.") break; @@ -2284,7 +2283,7 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, *------------------------------------------------------------------------- */ herr_t -H5AC__flush_entries(H5F_t *f, hid_t dxpl_id) +H5AC__flush_entries(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2296,7 +2295,7 @@ H5AC__flush_entries(H5F_t *f, hid_t dxpl_id) /* Check if we have >1 ranks */ if(H5C_get_aux_ptr(f->shared->cache)) - if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_CACHE) < 0) + if(H5AC__run_sync_point(f, H5AC_SYNC_POINT_OP__FLUSH_CACHE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") done: diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index ea7f0bf..409d914 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -425,8 +425,8 @@ H5_DLL herr_t H5AC__log_flushed_entry(H5C_t *cache_ptr, haddr_t addr, H5_DLL herr_t H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr); H5_DLL herr_t H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_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__flush_entries(H5F_t *f); +H5_DLL herr_t H5AC__run_sync_point(H5F_t *f, 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)); H5_DLL herr_t H5AC__set_write_done_callback(H5C_t * cache_ptr, diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 083ee5b..99cc0e9 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -50,11 +50,6 @@ #define H5AC__SOHM_TAG (haddr_t)5 #define H5AC__GLOBALHEAP_TAG (haddr_t)6 -/* Definitions for cache "tag" property */ -#define H5AC_TAG_NAME "H5AC_tag" -#define H5AC_TAG_SIZE sizeof(haddr_t) -#define H5AC_TAG_DEF (H5AC__INVALID_TAG) - /* Types of metadata objects cached */ typedef enum { H5AC_BT_ID = 0, /* ( 0) B-tree nodes */ @@ -230,22 +225,6 @@ 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 */ -H5_DLLVAR hid_t H5AC_ind_read_dxpl_id; -#ifdef H5_HAVE_PARALLEL -H5_DLLVAR hid_t H5AC_coll_read_dxpl_id; -#endif /* H5_HAVE_PARALLEL */ - -/* DXPL to be used in operations that will not result in I/O calls */ -H5_DLLVAR hid_t H5AC_noio_dxpl_id; - -/* DXPL to be used for raw data I/O operations when one is not - provided by the user (fill values in H5Dcreate) */ -H5_DLLVAR hid_t H5AC_rawdata_dxpl_id; - /* Default cache configuration. */ #define H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED @@ -410,29 +389,29 @@ 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, +H5_DLL herr_t H5AC_insert_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags); H5_DLL herr_t H5AC_pin_protected_entry(void *thing); -H5_DLL herr_t H5AC_prep_for_file_close(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5AC_prep_for_file_close(H5F_t *f); H5_DLL herr_t H5AC_create_flush_dependency(void *parent_thing, void *child_thing); -H5_DLL void * H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, - haddr_t addr, void *udata, unsigned flags); +H5_DLL void * H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, + void *udata, unsigned flags); H5_DLL herr_t H5AC_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5AC_unpin_entry(void *thing); H5_DLL herr_t H5AC_destroy_flush_dependency(void *parent_thing, void *child_thing); -H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, - haddr_t addr, void *thing, unsigned flags); -H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, + void *thing, unsigned flags); +H5_DLL herr_t H5AC_flush(H5F_t *f); H5_DLL herr_t H5AC_mark_entry_dirty(void *thing); H5_DLL herr_t H5AC_mark_entry_clean(void *thing); H5_DLL herr_t H5AC_mark_entry_unserialized(void *thing); H5_DLL herr_t H5AC_mark_entry_serialized(void *thing); H5_DLL herr_t H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, - haddr_t old_addr, haddr_t new_addr, hid_t dxpl_id); -H5_DLL herr_t H5AC_dest(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5AC_evict(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, - const H5AC_class_t *type, haddr_t addr, unsigned flags); + haddr_t old_addr, haddr_t new_addr); +H5_DLL herr_t H5AC_dest(H5F_t *f); +H5_DLL herr_t H5AC_evict(H5F_t *f); +H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, const H5AC_class_t *type, + haddr_t addr, unsigned flags); 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); @@ -449,24 +428,23 @@ 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); H5_DLL hbool_t H5AC_cache_image_pending(const H5F_t *f); -H5_DLL herr_t H5AC_force_cache_image_load(H5F_t * f, hid_t dxpl_id); +H5_DLL herr_t H5AC_force_cache_image_load(H5F_t * f); H5_DLL herr_t H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len); /* 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); -H5_DLL herr_t H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hbool_t match_global, hid_t dxpl_id); +H5_DLL void H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag); +H5_DLL herr_t H5AC_flush_tagged_metadata(H5F_t *f, haddr_t metadata_tag); +H5_DLL herr_t H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hbool_t match_global); H5_DLL herr_t H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag); H5_DLL herr_t H5AC_ignore_tags(const H5F_t *f); H5_DLL herr_t H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, hbool_t *corked); H5_DLL herr_t H5AC_get_entry_ring(const H5F_t *f, haddr_t addr, H5AC_ring_t *ring); -H5_DLL herr_t H5AC_set_ring(hid_t dxpl_id, H5AC_ring_t ring, H5P_genplist_t **dxpl, - H5AC_ring_t *orig_ring); -H5_DLL herr_t H5AC_reset_ring(H5P_genplist_t *dxpl, H5AC_ring_t orig_ring); +H5_DLL void H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring); H5_DLL herr_t H5AC_unsettle_entry_ring(void *entry); H5_DLL herr_t H5AC_unsettle_ring(H5F_t * f, H5AC_ring_t ring); -H5_DLL herr_t H5AC_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id, unsigned flags); +H5_DLL herr_t H5AC_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, + unsigned flags); H5_DLL herr_t H5AC_get_tag(const void *thing, /*OUT*/ haddr_t *tag); /* Virtual entry routines */ @@ -474,7 +452,7 @@ H5_DLL H5AC_proxy_entry_t *H5AC_proxy_entry_create(void); H5_DLL herr_t H5AC_proxy_entry_add_parent(H5AC_proxy_entry_t *pentry, void *parent); H5_DLL herr_t H5AC_proxy_entry_remove_parent(H5AC_proxy_entry_t *pentry, void *parent); H5_DLL herr_t H5AC_proxy_entry_add_child(H5AC_proxy_entry_t *pentry, H5F_t *f, - hid_t dxpl_id, void *child); + void *child); H5_DLL herr_t H5AC_proxy_entry_remove_child(H5AC_proxy_entry_t *pentry, void *child); H5_DLL herr_t H5AC_proxy_entry_dest(H5AC_proxy_entry_t *pentry); diff --git a/src/H5ACproxy_entry.c b/src/H5ACproxy_entry.c index 105a531..498d023 100644 --- a/src/H5ACproxy_entry.c +++ b/src/H5ACproxy_entry.c @@ -284,8 +284,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_proxy_entry_add_child(H5AC_proxy_entry_t *pentry, H5F_t *f, hid_t dxpl_id, - void *child) +H5AC_proxy_entry_add_child(H5AC_proxy_entry_t *pentry, H5F_t *f, void *child) { herr_t ret_value = SUCCEED; /* Return value */ @@ -303,7 +302,7 @@ H5AC_proxy_entry_add_child(H5AC_proxy_entry_t *pentry, H5F_t *f, hid_t dxpl_id, HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "temporary file space allocation failed for proxy entry") /* Insert the proxy entry into the cache */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_PROXY_ENTRY, pentry->addr, pentry, H5AC__PIN_ENTRY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_PROXY_ENTRY, pentry->addr, pentry, H5AC__PIN_ENTRY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "unable to cache proxy entry") /* Proxies start out clean (insertions are automatically marked dirty) */ diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index ed67e0f..a3f7bba 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -54,7 +54,6 @@ typedef struct H5A_fh_ud_cmp_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ const char *name; /* Name of attribute to compare */ const H5A_dense_bt2_name_rec_t *record; /* v2 B-tree record for attribute */ H5A_bt2_found_t found_op; /* Callback when correct attribute is found */ @@ -168,7 +167,7 @@ H5A__dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud FUNC_ENTER_STATIC /* Decode attribute information */ - if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) + if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "can't decode attribute") /* Compare the string values */ @@ -270,7 +269,6 @@ H5A__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.name = bt2_udata->name; fh_udata.record = bt2_rec; fh_udata.found_op = bt2_udata->found_op; @@ -287,7 +285,7 @@ H5A__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int HDassert(fheap); /* Check if the user's attribute and the B-tree's attribute have the same name */ - if(H5HF_op(fheap, bt2_udata->dxpl_id, &bt2_rec->id, H5A__dense_fh_name_cmp, &fh_udata) < 0) + if(H5HF_op(fheap, &bt2_rec->id, H5A__dense_fh_name_cmp, &fh_udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") /* Callback will set comparison value */ diff --git a/src/H5Adense.c b/src/H5Adense.c index b1903a4..f76e106 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -72,7 +72,6 @@ typedef struct H5A_bt2_od_wrt_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle to operate on */ H5HF_t *shared_fheap; /* Fractal heap handle for shared messages */ H5A_t *attr; /* Attribute to write */ @@ -86,7 +85,6 @@ typedef struct H5A_bt2_od_wrt_t { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ H5HF_t *shared_fheap; /* Fractal heap handle for shared messages */ hsize_t count; /* # of attributes examined */ @@ -109,7 +107,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ const H5A_dense_bt2_name_rec_t *record; /* v2 B-tree record for attribute */ /* upward */ @@ -133,7 +130,6 @@ typedef struct H5A_bt2_ud_rm_t { typedef struct H5A_bt2_ud_rmbi_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ H5HF_t *shared_fheap; /* Fractal heap handle for shared messages */ H5_index_t idx_type; /* Index type for operation */ @@ -168,7 +164,7 @@ typedef struct H5A_bt2_ud_rmbi_t { /*------------------------------------------------------------------------- - * Function: H5A_dense_create + * Function: H5A__dense_create * * Purpose: Creates dense attribute storage structures for an object * @@ -181,7 +177,7 @@ typedef struct H5A_bt2_ud_rmbi_t { *------------------------------------------------------------------------- */ herr_t -H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) +H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo) { H5HF_create_t fheap_cparam; /* Fractal heap creation parameters */ H5B2_create_t bt2_cparam; /* v2 B-tree creation parameters */ @@ -190,7 +186,7 @@ H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -210,7 +206,7 @@ H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) fheap_cparam.max_man_size = H5O_FHEAP_MAX_MAN_SIZE; /* Create fractal heap for storing attributes */ - if(NULL == (fheap = H5HF_create(f, dxpl_id, &fheap_cparam))) + if(NULL == (fheap = H5HF_create(f, &fheap_cparam))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create fractal heap") /* Retrieve the heap's address in the file */ @@ -244,7 +240,7 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); H5O_FHEAP_ID_LEN; /* Fractal heap ID */ bt2_cparam.split_percent = H5A_NAME_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5A_NAME_BT2_MERGE_PERC; - if(NULL == (bt2_name = H5B2_create(f, dxpl_id, &bt2_cparam, NULL))) + if(NULL == (bt2_name = H5B2_create(f, &bt2_cparam, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for name index") /* Retrieve the v2 B-tree's address in the file */ @@ -265,7 +261,7 @@ HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr) H5O_FHEAP_ID_LEN; /* Fractal heap ID */ bt2_cparam.split_percent = H5A_CORDER_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5A_CORDER_BT2_MERGE_PERC; - if(NULL == (bt2_corder = H5B2_create(f, dxpl_id, &bt2_cparam, NULL))) + if(NULL == (bt2_corder = H5B2_create(f, &bt2_cparam, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for creation order index") /* Retrieve the v2 B-tree's address in the file */ @@ -278,15 +274,15 @@ HDfprintf(stderr, "%s: ainfo->corder_bt2_addr = %a\n", FUNC, ainfo->corder_bt2_a done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_create() */ +} /* end H5A__dense_create() */ /*------------------------------------------------------------------------- @@ -324,7 +320,7 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) /*------------------------------------------------------------------------- - * Function: H5A_dense_open + * Function: H5A__dense_open * * Purpose: Open an attribute in dense storage structures for an object * @@ -337,7 +333,7 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) *------------------------------------------------------------------------- */ H5A_t * -H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *name) +H5A__dense_open(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) { H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -347,7 +343,7 @@ H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *na htri_t attr_exists; /* Attribute exists in v2 B-tree */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -357,11 +353,11 @@ H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *na HDassert(name); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open fractal heap") /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -369,24 +365,23 @@ H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *na haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open v2 B-tree for name index") /* Create the "udata" information for v2 B-tree record find */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.name = name; @@ -397,26 +392,26 @@ H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *na udata.found_op_data = &ret_value; /* Find & copy the attribute in the 'name' index */ - if((attr_exists = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((attr_exists = H5B2_find(bt2_name, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't search for attribute in name index") else if(attr_exists == FALSE) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't locate attribute in name index") done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, NULL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, NULL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, NULL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_open() */ +} /* end H5A__dense_open() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_insert + * Function: H5A__dense_insert * * Purpose: Insert an attribute into dense storage structures for an object * @@ -429,7 +424,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) +H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) { H5A_bt2_ud_ins_t udata; /* User data for v2 B-tree insertion */ H5HF_t *fheap = NULL; /* Fractal heap handle for attributes */ @@ -442,7 +437,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) htri_t attr_sharable; /* Flag indicating attributes are sharable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -452,7 +447,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) HDassert(attr); /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -468,7 +463,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) mesg_flags |= H5O_MSG_FLAG_SHARED; else { /* Should this attribute be written as a SOHM? */ - if(H5SM_try_share(f, dxpl_id, NULL, 0, H5O_ATTR_ID, attr, &mesg_flags) < 0) + if(H5SM_try_share(f, NULL, 0, H5O_ATTR_ID, attr, &mesg_flags) < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") /* Attributes can't be "unique be shareable" yet */ @@ -476,19 +471,19 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) } /* end else */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Check for inserting shared attribute */ @@ -521,17 +516,16 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) /* Insert the serialized attribute into the fractal heap */ /* (sets the heap ID in the user data) */ - if(H5HF_insert(fheap, dxpl_id, attr_size, attr_ptr, &udata.id) < 0) + if(H5HF_insert(fheap, attr_size, attr_ptr, &udata.id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to insert attribute into fractal heap") } /* end else */ /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Create the callback information for v2 B-tree record insertion */ udata.common.f = f; - udata.common.dxpl_id = dxpl_id; udata.common.fheap = fheap; udata.common.shared_fheap = shared_fheap; udata.common.name = attr->shared->name; @@ -543,36 +537,36 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) /* udata.id already set */ /* Insert attribute into 'name' tracking v2 B-tree */ - if(H5B2_insert(bt2_name, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_name, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") /* Check if we should create a creation order index v2 B-tree record */ if(ainfo->index_corder) { /* Open the creation order index v2 B-tree */ HDassert(H5F_addr_defined(ainfo->corder_bt2_addr)); - if(NULL == (bt2_corder = H5B2_open(f, dxpl_id, ainfo->corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(f, ainfo->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Insert the record into the creation order index v2 B-tree */ - if(H5B2_insert(bt2_corder, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_corder, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") } /* end if */ done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") if(wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_insert() */ +} /* end H5A__dense_insert() */ /*------------------------------------------------------------------------- @@ -647,7 +641,7 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) /* Check for modifying shared attribute */ if(record->flags & H5O_MSG_FLAG_SHARED) { /* Update the shared attribute in the SOHM info */ - if(H5O_attr_update_shared(op_data->f, op_data->dxpl_id, NULL, op_data->attr, NULL) < 0) + if(H5O__attr_update_shared(op_data->f, NULL, op_data->attr, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute in shared storage") /* Update record's heap ID */ @@ -658,12 +652,11 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(op_data->f, op_data->dxpl_id, op_data->corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(op_data->f, op_data->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Create the "udata" information for v2 B-tree record modify */ udata.f = op_data->f; - udata.dxpl_id = op_data->dxpl_id; udata.fheap = NULL; udata.shared_fheap = NULL; udata.name = NULL; @@ -674,7 +667,7 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) udata.found_op_data = NULL; /* Modify record for creation order index */ - if(H5B2_modify(bt2_corder, op_data->dxpl_id, &udata, H5A__dense_write_bt2_cb2, &op_data->attr->sh_loc.u.heap_id) < 0) + if(H5B2_modify(bt2_corder, &udata, H5A__dense_write_bt2_cb2, &op_data->attr->sh_loc.u.heap_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to modify record in v2 B-tree") } /* end if */ @@ -706,20 +699,20 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) { size_t obj_len; /* Length of existing encoded attribute */ - if(H5HF_get_obj_len(op_data->fheap, op_data->dxpl_id, &record->id, &obj_len) < 0) + if(H5HF_get_obj_len(op_data->fheap, &record->id, &obj_len) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get object size") HDassert(obj_len == attr_size); } #endif /* NDEBUG */ /* Update existing attribute in heap */ /* (might be more efficient as fractal heap 'op' callback, but leave that for later -QAK) */ - if(H5HF_write(op_data->fheap, op_data->dxpl_id, &record->id, changed, attr_ptr) < 0) + if(H5HF_write(op_data->fheap, &record->id, changed, attr_ptr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute in heap") } /* end else */ done: /* Release resources */ - if(bt2_corder && H5B2_close(bt2_corder, op_data->dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") if(wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") @@ -729,7 +722,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_write + * Function: H5A__dense_write * * Purpose: Modify an attribute in dense storage structures for an object * @@ -742,7 +735,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) +H5A__dense_write(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) { H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ H5A_bt2_od_wrt_t op_data; /* "Op data" for v2 B-tree modify */ @@ -752,7 +745,7 @@ H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) htri_t attr_sharable; /* Flag indicating attributes are sharable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -764,7 +757,7 @@ H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) HDassert(attr); /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -772,28 +765,27 @@ H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Create the "udata" information for v2 B-tree record modify */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.name = attr->shared->name; @@ -805,27 +797,26 @@ H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) /* Create the "op_data" for the v2 B-tree record 'modify' callback */ op_data.f = f; - op_data.dxpl_id = dxpl_id; op_data.fheap = fheap; op_data.shared_fheap = shared_fheap; op_data.attr = attr; op_data.corder_bt2_addr = ainfo->corder_bt2_addr; /* Modify attribute through 'name' tracking v2 B-tree */ - if(H5B2_modify(bt2_name, dxpl_id, &udata, H5A__dense_write_bt2_cb, &op_data) < 0) + if(H5B2_modify(bt2_name, &udata, H5A__dense_write_bt2_cb, &op_data) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to modify record in v2 B-tree") done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_write() */ +} /* end H5A__dense_write() */ /*------------------------------------------------------------------------- @@ -857,7 +848,7 @@ H5A__dense_copy_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_uda * HDF5 routine, it could attempt to re-protect that direct block for the * heap, causing the HDF5 routine called to fail) */ - if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) + if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, FAIL, "can't decode attribute") /* Set the creation order index for the attribute */ @@ -873,7 +864,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_rename + * Function: H5A__dense_rename * * Purpose: Rename an attribute in dense storage structures for an object * @@ -886,7 +877,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *old_name, +H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, const char *new_name) { H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ @@ -899,7 +890,7 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * htri_t attr_exists; /* Attribute exists in v2 B-tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -910,7 +901,7 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * HDassert(new_name); /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -918,28 +909,27 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Create the "udata" information for v2 B-tree record modify */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.name = old_name; @@ -950,7 +940,7 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * udata.found_op_data = &attr_copy; /* Get copy of attribute through 'name' tracking v2 B-tree */ - if((attr_exists = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((attr_exists = H5B2_find(bt2_name, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index") else if(attr_exists == FALSE) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute in name index") @@ -970,12 +960,12 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * attr_copy->shared->name = H5MM_xstrdup(new_name); /* Recompute the version to encode the attribute with */ - if(H5A_set_version(f, attr_copy) < 0) + if(H5A__set_version(f, attr_copy) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "unable to update attribute version") /* Insert renamed attribute back into dense storage */ /* (Possibly making it shared) */ - if(H5A_dense_insert(f, dxpl_id, ainfo, attr_copy) < 0) + if(H5A__dense_insert(f, ainfo, attr_copy) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to add to dense storage") /* Was this attribute shared? */ @@ -983,7 +973,7 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * hsize_t attr_rc; /* Attribute's ref count in shared message storage */ /* Retrieve ref count for shared attribute */ - if(H5SM_get_refcount(f, dxpl_id, H5O_ATTR_ID, &attr_copy->sh_loc, &attr_rc) < 0) + if(H5SM_get_refcount(f, H5O_ATTR_ID, &attr_copy->sh_loc, &attr_rc) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") /* If the newly shared attribute needs to share "ownership" of the shared @@ -995,36 +985,36 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * */ if(attr_rc == 1) { /* Increment reference count on attribute components */ - if(H5O_attr_link(f, dxpl_id, NULL, attr_copy) < 0) + if(H5O__attr_link(f, NULL, attr_copy) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count") } /* end if */ } /* end if */ else if(shared_mesg == 0) { /* Increment reference count on attribute components */ /* (so that they aren't deleted when the attribute is removed shortly) */ - if(H5O_attr_link(f, dxpl_id, NULL, attr_copy) < 0) + if(H5O__attr_link(f, NULL, attr_copy) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count") } /* end if */ else if(shared_mesg < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") /* Delete old attribute from dense storage */ - if(H5A_dense_remove(f, dxpl_id, ainfo, old_name) < 0) + if(H5A__dense_remove(f, ainfo, old_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage") done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") if(attr_copy) H5O_msg_free(H5O_ATTR_ID, attr_copy); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_rename() */ +} /* end H5A__dense_rename() */ /*------------------------------------------------------------------------- @@ -1065,12 +1055,11 @@ H5A__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.record = record; fh_udata.attr = NULL; /* Call fractal heap 'op' routine, to copy the attribute information */ - if(H5HF_op(fheap, bt2_udata->dxpl_id, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) + if(H5HF_op(fheap, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPERATE, H5_ITER_ERROR, "heap op callback failed") /* Check which type of callback to make */ @@ -1125,7 +1114,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_iterate + * Function: H5A__dense_iterate * * Purpose: Iterate over attributes in dense storage structures for an object * @@ -1138,7 +1127,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainfo, +H5A__dense_iterate(H5F_t *f, hid_t loc_id, const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data) { @@ -1149,7 +1138,7 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1189,11 +1178,11 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf htri_t attr_sharable; /* Flag indicating attributes are sharable */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -1201,24 +1190,23 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Construct the user data for v2 B-tree iterator callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.loc_id = loc_id; @@ -1229,7 +1217,7 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf /* Iterate over the records in the v2 B-tree's "native" order */ /* (by hash of name) */ - if((ret_value = H5B2_iterate(bt2, dxpl_id, H5A__dense_iterate_bt2_cb, &udata)) < 0) + if((ret_value = H5B2_iterate(bt2, H5A__dense_iterate_bt2_cb, &udata)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "attribute iteration failed"); /* Update the last attribute examined, if requested */ @@ -1239,27 +1227,27 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf else { /* Build the table of attributes for this object */ /* (build table using the name index, but sort according to idx_type) */ - if(H5A_dense_build_table(f, dxpl_id, ainfo, idx_type, order, &atable) < 0) + if(H5A__dense_build_table(f, ainfo, idx_type, order, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "error building table of attributes") /* Iterate over attributes in table */ - if((ret_value = H5A_attr_iterate_table(&atable, skip, last_attr, loc_id, attr_op, op_data)) < 0) + if((ret_value = H5A__attr_iterate_table(&atable, skip, last_attr, loc_id, attr_op, op_data)) < 0) HERROR(H5E_ATTR, H5E_CANTNEXT, "iteration operator failed"); } /* end else */ done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") - if(atable.attrs && H5A_attr_release_table(&atable) < 0) + if(atable.attrs && H5A__attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_iterate() */ +} /* end H5A__dense_iterate() */ /*------------------------------------------------------------------------- @@ -1289,37 +1277,37 @@ H5A__dense_remove_bt2_cb(const void *_record, void *_udata) /* Check for removing the link from the creation order index */ if(H5F_addr_defined(udata->corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(udata->common.f, udata->common.dxpl_id, udata->corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(udata->common.f, udata->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata->common.corder = attr->shared->crt_idx; /* Remove the record from the creation order index v2 B-tree */ - if(H5B2_remove(bt2_corder, udata->common.dxpl_id, udata, NULL, NULL) < 0) + if(H5B2_remove(bt2_corder, udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from creation order index v2 B-tree") } /* end if */ /* Check for removing shared attribute */ if(record->flags & H5O_MSG_FLAG_SHARED) { /* Decrement the reference count on the shared attribute message */ - if(H5SM_delete(udata->common.f, udata->common.dxpl_id, NULL, &(attr->sh_loc)) < 0) + if(H5SM_delete(udata->common.f, NULL, &(attr->sh_loc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to delete shared attribute") } /* end if */ else { /* Perform the deletion action on the attribute */ /* (takes care of shared & committed datatype/dataspace components) */ - if(H5O_attr_delete(udata->common.f, udata->common.dxpl_id, NULL, attr) < 0) + if(H5O__attr_delete(udata->common.f, NULL, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") /* Remove record from fractal heap */ - if(H5HF_remove(udata->common.fheap, udata->common.dxpl_id, &record->id) < 0) + if(H5HF_remove(udata->common.fheap, &record->id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from fractal heap") } /* end else */ done: /* Release resources */ - if(bt2_corder && H5B2_close(bt2_corder, udata->common.dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") FUNC_LEAVE_NOAPI(ret_value) @@ -1327,7 +1315,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_remove + * Function: H5A__dense_remove * * Purpose: Remove an attribute from the dense storage of an object * @@ -1340,7 +1328,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *name) +H5A__dense_remove(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) { H5A_bt2_ud_rm_t udata; /* User data for v2 B-tree record removal */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -1350,7 +1338,7 @@ H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * htri_t attr_sharable; /* Flag indicating attributes are sharable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1360,11 +1348,11 @@ H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * HDassert(name && *name); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -1372,24 +1360,23 @@ H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata.common.f = f; - udata.common.dxpl_id = dxpl_id; udata.common.fheap = fheap; udata.common.shared_fheap = shared_fheap; udata.common.name = name; @@ -1399,22 +1386,22 @@ H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * udata.corder_bt2_addr = ainfo->corder_bt2_addr; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove(bt2_name, dxpl_id, &udata, H5A__dense_remove_bt2_cb, &udata) < 0) + if(H5B2_remove(bt2_name, &udata, H5A__dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from name index v2 B-tree") done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") if(attr_copy) - H5O_msg_free_real(H5O_MSG_ATTR, attr_copy); + H5O__msg_free_real(H5O_MSG_ATTR, attr_copy); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_remove() */ +} /* end H5A__dense_remove() */ /*------------------------------------------------------------------------- @@ -1446,7 +1433,6 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Set up the user data for fractal heap 'op' callback */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.record = record; fh_udata.attr = NULL; @@ -1459,7 +1445,7 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Check whether to make a copy of the attribute or just need the shared location info */ if(H5F_addr_defined(bt2_udata->other_bt2_addr) || !(record->flags & H5O_MSG_FLAG_SHARED)) { /* Call fractal heap 'op' routine, to make copy of attribute to remove */ - if(H5HF_op(fheap, bt2_udata->dxpl_id, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) + if(H5HF_op(fheap, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPERATE, FAIL, "attribute removal callback failed") HDassert(fh_udata.attr); @@ -1488,7 +1474,6 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Set up the user data for the v2 B-tree 'record remove' callback */ other_bt2_udata.f = bt2_udata->f; - other_bt2_udata.dxpl_id = bt2_udata->dxpl_id; other_bt2_udata.fheap = bt2_udata->fheap; other_bt2_udata.shared_fheap = bt2_udata->shared_fheap; other_bt2_udata.name = fh_udata.attr->shared->name; @@ -1498,13 +1483,13 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) } /* end else */ /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(bt2_udata->f, bt2_udata->dxpl_id, bt2_udata->other_bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(bt2_udata->f, bt2_udata->other_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Set the common information for the v2 B-tree remove operation */ /* Remove the record from the "other" index v2 B-tree */ - if(H5B2_remove(bt2, bt2_udata->dxpl_id, &other_bt2_udata, NULL, NULL) < 0) + if(H5B2_remove(bt2, &other_bt2_udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove record from 'other' index v2 B-tree") } /* end if */ @@ -1519,23 +1504,23 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) sh_loc_ptr = &(fh_udata.attr->sh_loc); /* Decrement the reference count on the shared attribute message */ - if(H5SM_delete(bt2_udata->f, bt2_udata->dxpl_id, NULL, sh_loc_ptr) < 0) + if(H5SM_delete(bt2_udata->f, NULL, sh_loc_ptr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to delete shared attribute") } /* end if */ else { /* Perform the deletion action on the attribute */ /* (takes care of shared & committed datatype/dataspace components) */ - if(H5O_attr_delete(bt2_udata->f, bt2_udata->dxpl_id, NULL, fh_udata.attr) < 0) + if(H5O__attr_delete(bt2_udata->f, NULL, fh_udata.attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") /* Remove record from fractal heap */ - if(H5HF_remove(fheap, bt2_udata->dxpl_id, &record->id) < 0) + if(H5HF_remove(fheap, &record->id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from fractal heap") } /* end else */ done: /* Release resources */ - if(bt2 && H5B2_close(bt2, bt2_udata->dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") if(fh_udata.attr) H5O_msg_free(H5O_ATTR_ID, fh_udata.attr); @@ -1545,7 +1530,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_remove_by_idx + * Function: H5A__dense_remove_by_idx * * Purpose: Remove an attribute from the dense storage of an object, * according to the order within an index @@ -1559,8 +1544,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n) +H5A__dense_remove_by_idx(H5F_t *f, const H5O_ainfo_t *ainfo, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5HF_t *shared_fheap = NULL; /* Fractal heap handle for shared header messages */ @@ -1569,7 +1554,7 @@ H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, haddr_t bt2_addr; /* Address of v2 B-tree to use for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1606,11 +1591,11 @@ H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, htri_t attr_sharable; /* Flag indicating attributes are sharable */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -1618,37 +1603,36 @@ H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.idx_type = idx_type; udata.other_bt2_addr = idx_type == H5_INDEX_NAME ? ainfo->corder_bt2_addr : ainfo->name_bt2_addr; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_by_idx(bt2, dxpl_id, order, n, H5A__dense_remove_by_idx_bt2_cb, &udata) < 0) + if(H5B2_remove_by_idx(bt2, order, n, H5A__dense_remove_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from v2 B-tree index") } /* end if */ else { /* Build the table of attributes for this object */ /* (build table using the name index, but sort according to idx_type) */ - if(H5A_dense_build_table(f, dxpl_id, ainfo, idx_type, order, &atable) < 0) + if(H5A__dense_build_table(f, ainfo, idx_type, order, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "error building table of attributes") /* Check for skipping too many attributes */ @@ -1656,27 +1640,27 @@ H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") /* Delete appropriate attribute from dense storage */ - if(H5A_dense_remove(f, dxpl_id, ainfo, ((atable.attrs[n])->shared)->name) < 0) + if(H5A__dense_remove(f, ainfo, ((atable.attrs[n])->shared)->name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage") } /* end else */ done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") - if(atable.attrs && H5A_attr_release_table(&atable) < 0) + if(atable.attrs && H5A__attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_remove_by_idx() */ +} /* end H5A__dense_remove_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_exists + * Function: H5A__dense_exists * * Purpose: Check if an attribute exists in dense storage structures for * an object @@ -1690,7 +1674,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *name) +H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) { H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -1699,7 +1683,7 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * htri_t attr_sharable; /* Flag indicating attributes are sharable */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1709,11 +1693,11 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * HDassert(name); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -1721,24 +1705,23 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Create the "udata" information for v2 B-tree record 'find' */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.name = name; @@ -1749,20 +1732,20 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * udata.found_op_data = NULL; /* Find the attribute in the 'name' index */ - if((ret_value = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((ret_value = H5B2_find(bt2_name, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index") done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_exists() */ +} /* end H5A__dense_exists() */ /*------------------------------------------------------------------------- @@ -1796,7 +1779,7 @@ H5A__dense_delete_bt2_cb(const void *_record, void *_bt2_udata) H5SM_reconstitute(&sh_mesg, bt2_udata->f, H5O_ATTR_ID, record->id); /* Decrement the reference count on the shared attribute message */ - if(H5SM_delete(bt2_udata->f, bt2_udata->dxpl_id, NULL, &sh_mesg) < 0) + if(H5SM_delete(bt2_udata->f, NULL, &sh_mesg) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to delete shared attribute") } /* end if */ else { @@ -1805,33 +1788,32 @@ H5A__dense_delete_bt2_cb(const void *_record, void *_bt2_udata) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.record = record; /* up */ fh_udata.attr = NULL; /* Call fractal heap 'op' routine, to copy the attribute information */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPERATE, FAIL, "heap op callback failed") attr = fh_udata.attr; /* Perform the deletion action on the attribute */ /* (takes care of shared/committed datatype & dataspace components) */ - if(H5O_attr_delete(bt2_udata->f, bt2_udata->dxpl_id, NULL, fh_udata.attr) < 0) + if(H5O__attr_delete(bt2_udata->f, NULL, fh_udata.attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") } /* end else */ done: /* Release resources */ if(attr) - H5O_msg_free_real(H5O_MSG_ATTR, attr); + H5O__msg_free_real(H5O_MSG_ATTR, attr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__dense_delete_bt2_cb() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_delete + * Function: H5A__dense_delete * * Purpose: Delete all dense storage structures for attributes on an object * @@ -1844,13 +1826,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) +H5A__dense_delete(H5F_t *f, H5O_ainfo_t *ainfo) { H5A_bt2_ud_common_t udata; /* v2 B-tree user data for deleting attributes */ H5HF_t *fheap = NULL; /* Fractal heap handle */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1859,12 +1841,11 @@ H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) HDassert(ainfo); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Create the "udata" information for v2 B-tree 'delete' */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = NULL; udata.name = NULL; @@ -1874,33 +1855,33 @@ H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) udata.found_op_data = NULL; /* Delete name index v2 B-tree */ - if(H5B2_delete(f, dxpl_id, ainfo->name_bt2_addr, NULL, H5A__dense_delete_bt2_cb, &udata) < 0) + if(H5B2_delete(f, ainfo->name_bt2_addr, NULL, H5A__dense_delete_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for name index") ainfo->name_bt2_addr = HADDR_UNDEF; /* Release resources */ - if(H5HF_close(fheap, dxpl_id) < 0) + if(H5HF_close(fheap) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") fheap = NULL; /* Check if we should delete the creation order index v2 B-tree */ if(H5F_addr_defined(ainfo->corder_bt2_addr)) { /* Delete the creation order index, without adjusting the ref. count on the attributes */ - if(H5B2_delete(f, dxpl_id, ainfo->corder_bt2_addr, NULL, NULL, NULL) < 0) + if(H5B2_delete(f, ainfo->corder_bt2_addr, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for creation order index") ainfo->corder_bt2_addr = HADDR_UNDEF; } /* end if */ /* Delete fractal heap */ - if(H5HF_delete(f, dxpl_id, ainfo->fheap_addr) < 0) + if(H5HF_delete(f, ainfo->fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete fractal heap") ainfo->fheap_addr = HADDR_UNDEF; done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_delete() */ +} /* end H5A__dense_delete() */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 9221254..1e031f7 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -38,6 +38,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ @@ -87,12 +88,12 @@ PURPOSE Creates an attribute on an object USAGE - hid_t H5Acreate1(loc_id, name, type_id, space_id, plist_id) + hid_t H5Acreate1(loc_id, name, type_id, space_id, acpl_id) hid_t loc_id; IN: Object (dataset or group) to be attached to const char *name; IN: Name of attribute to create hid_t type_id; IN: ID of datatype for attribute hid_t space_id; IN: ID of dataspace for attribute - hid_t plist_id; IN: ID of creation property list (currently not used) + hid_t acpl_id; IN: ID of creation property list (currently not used) RETURNS Non-negative on success/Negative on failure @@ -110,16 +111,17 @@ --------------------------------------------------------------------------*/ hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, - hid_t plist_id) + hid_t acpl_id) { - H5A_t *attr = NULL; /* Attribute created */ - H5G_loc_t loc; /* Object location */ - H5T_t *type; /* Datatype to use for attribute */ - H5S_t *space; /* Dataspace to use for attribute */ - hid_t ret_value; /* Return value */ + H5A_t *attr = NULL; /* Attribute created */ + H5G_loc_t loc; /* Object location */ + H5T_t *type; /* Datatype to use for attribute */ + H5S_t *space; /* Dataspace to use for attribute */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, plist_id); + H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, acpl_id); /* check arguments */ if(H5I_ATTR == H5I_get_type(loc_id)) @@ -135,8 +137,16 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read") + /* Go do the real work for attaching the attribute to the dataset */ - if(NULL==(attr = H5A_create(&loc, name, type, space, plist_id, H5AC_ind_read_dxpl_id))) + if(NULL == (attr = H5A__create(&loc, name, type, space, acpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create attribute") /* Register the new attribute and get an ID for it */ @@ -144,6 +154,12 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID") done: + /* Cleanup on failure */ + if(ret_value < 0 && attr && H5A__close(attr) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* H5Acreate1() */ @@ -173,9 +189,10 @@ done: hid_t H5Aopen_name(hid_t loc_id, const char *name) { - H5G_loc_t loc; /* Object location */ - H5A_t *attr = NULL; /* Attribute opened */ - hid_t ret_value; + H5G_loc_t loc; /* Object location */ + H5A_t *attr = NULL; /* Attribute opened */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); @@ -188,8 +205,13 @@ H5Aopen_name(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + /* Open the attribute on the object header */ - if(NULL == (attr = H5A_open_by_name(&loc, ".", name, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id))) + if(NULL == (attr = H5A__open_by_name(&loc, ".", name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute: '%s'", name) /* Register the attribute and get an ID for it */ @@ -199,8 +221,10 @@ H5Aopen_name(hid_t loc_id, const char *name) done: /* Cleanup on failure */ if(ret_value < 0) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_name() */ @@ -233,6 +257,7 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -244,9 +269,14 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + /* Open the attribute in the object header */ - if(NULL == (attr = H5A_open_by_idx(&loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)idx, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open attribute") + if(NULL == (attr = H5A__open_by_idx(&loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)idx))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute") /* Register the attribute and get an ID for it */ if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) @@ -255,8 +285,10 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) done: /* Cleanup on failure */ if(ret_value < 0) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_idx() */ @@ -283,9 +315,10 @@ done: int H5Aget_num_attrs(hid_t loc_id) { - H5O_loc_t *loc; /* Object location for attribute */ - void *obj; - int ret_value; + H5O_loc_t *loc; /* Object location for attribute */ + void *obj; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + int ret_value; FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", loc_id); @@ -330,11 +363,18 @@ H5Aget_num_attrs(hid_t loc_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "inappropriate attribute target") } /*lint !e788 All appropriate cases are covered */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + /* Look up the # of attributes for the object */ - if((ret_value = H5O_attr_count(loc, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5A__get_num_attrs(loc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "can't get attribute count for object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aget_num_attrs() */ @@ -379,10 +419,8 @@ done: herr_t H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data) { - H5A_attr_iter_op_t attr_op; /* Attribute operator */ - hsize_t start_idx; /* Index of attribute to start iterating at */ - hsize_t last_attr; /* Index of last attribute examined */ - herr_t ret_value; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*Iux*x", loc_id, attr_num, op, op_data); @@ -391,20 +429,18 @@ H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data) if(H5I_ATTR == H5I_get_type(loc_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") - /* Build attribute operator info */ - attr_op.op_type = H5A_ATTR_OP_APP; - attr_op.u.app_op = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Call attribute iteration routine */ - last_attr = start_idx = (hsize_t)(attr_num ? *attr_num : 0); - if((ret_value = H5O_attr_iterate(loc_id, H5AC_ind_read_dxpl_id, H5_INDEX_CRT_ORDER, H5_ITER_INC, start_idx, &last_attr, &attr_op, op_data)) < 0) + if((ret_value = H5A__iterate_old(loc_id, attr_num, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); - /* Set the last attribute information */ - if(attr_num) - *attr_num = (unsigned)last_attr; - done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate1() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Aint.c b/src/H5Aint.c index f1dd41e..a02dcc9 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -35,6 +35,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ @@ -55,7 +56,6 @@ /* Data exchange structure to use when building table of compact attributes for an object */ typedef struct { H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5A_attr_table_t *atable; /* Pointer to attribute table to build */ size_t curr_attr; /* Current attribute to operate on */ hbool_t bogus_crt_idx; /* Whether bogus creation index values need to be set */ @@ -73,7 +73,6 @@ typedef struct { H5F_t *file; /* file */ hbool_t *recompute_size; /* Flag to indicate if size changed */ H5O_copy_t *cpy_info; /* Information on copying options */ - hid_t dxpl_id; /* DXPL for operation */ const H5O_loc_t *oloc_src; H5O_loc_t *oloc_dst; } H5A_dense_file_cp_ud_t; @@ -88,6 +87,9 @@ typedef struct { /* Local Prototypes */ /********************/ +static H5A_t *H5A__create_common(const H5G_loc_t *loc, const char *name, + const H5T_t *type, const H5S_t *space, hid_t acpl_id); +static herr_t H5A__open_common(const H5G_loc_t *loc, H5A_t *attr); static herr_t H5A__compact_build_table_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned *oh_flags_ptr, void *_udata/*in,out*/); static herr_t H5A__dense_build_table_cb(const H5A_t *attr, void *_udata); @@ -97,6 +99,8 @@ static int H5A__attr_cmp_corder_inc(const void *attr1, const void *attr2); static int H5A__attr_cmp_corder_dec(const void *attr1, const void *attr2); static herr_t H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, H5_iter_order_t order); +static herr_t H5A__iterate_common(hid_t loc_id, H5_index_t idx_type, + H5_iter_order_t order, hsize_t *idx, H5A_attr_iter_op_t *attr_op, void *op_data); /*********************/ /* Package Variables */ @@ -117,28 +121,20 @@ H5FL_SEQ_DEFINE(H5A_t_ptr); /*------------------------------------------------------------------------- - * Function: H5A_create + * Function: H5A__create_common * - * Purpose: - * This is the guts of creating an attribute. - * Usage: - * hid_t H5A_create(ent, name, type, space) - * const H5G_entry_t *ent; IN: Pointer to symbol table entry for object to attribute - * const char *name; IN: Name of attribute - * H5T_t *type; IN: Datatype of attribute - * H5S_t *space; IN: Dataspace of attribute - * hid_t acpl_id IN: Attribute creation property list + * Purpose: This is the guts of creating an attribute. * - * Return: attribute structure on success, NULL on Failure. + * Return: Attribute structure on success, NULL on Failure. * * Programmer: Quincey Koziol * April 2, 1998 * *------------------------------------------------------------------------- */ -H5A_t * -H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, - const H5S_t *space, hid_t acpl_id, hid_t dxpl_id) +static H5A_t * +H5A__create_common(const H5G_loc_t *loc, const char *name, const H5T_t *type, + const H5S_t *space, hid_t acpl_id) { H5A_t *attr = NULL; /* Attribute created */ hssize_t snelmts; /* elements in attribute */ @@ -146,9 +142,9 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, htri_t exists; /* Whether attribute exists */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->oloc->addr, NULL) + FUNC_ENTER_STATIC_TAG(loc->oloc->addr) - /* check args */ + /* Check args */ HDassert(loc); HDassert(name); HDassert(type); @@ -159,7 +155,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, * name, but it's going to be hard to unwind all the special cases on * failure, so just check first, for now - QAK) */ - if((exists = H5O_attr_exists(loc->oloc, name, dxpl_id)) < 0) + if((exists = H5O__attr_exists(loc->oloc, name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "error checking attributes") else if(exists > 0) HGOTO_ERROR(H5E_ATTR, H5E_ALREADYEXISTS, NULL, "attribute already exists") @@ -233,20 +229,19 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, /* Check if any of the pieces should be (or are already) shared in the * SOHM table */ - if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, 0, H5O_DTYPE_ID, attr->shared->dt, NULL) < 0) + if(H5SM_try_share(attr->oloc.file, NULL, 0, H5O_DTYPE_ID, attr->shared->dt, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, NULL, "trying to share datatype failed") - if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, 0, H5O_SDSPACE_ID, attr->shared->ds, NULL) < 0) + if(H5SM_try_share(attr->oloc.file, NULL, 0, H5O_SDSPACE_ID, attr->shared->ds, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, NULL, "trying to share dataspace failed") /* Check whether datatype is committed & increment ref count * (to maintain ref. count incr/decr similarity with "shared message" * type of datatype sharing) */ - if(H5T_committed(attr->shared->dt)) { + if(H5T_committed(attr->shared->dt)) /* Increment the reference count on the shared datatype */ - if(H5T_link(attr->shared->dt, 1, dxpl_id) < 0) + if(H5T_link(attr->shared->dt, 1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, NULL, "unable to adjust shared datatype link count") - } /* end if */ /* Compute the size of pieces on disk. This is either the size of the * datatype and dataspace messages themselves, or the size of the "shared" @@ -270,19 +265,123 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, attr->obj_opened = TRUE; /* Set the version to encode the attribute with */ - if(H5A_set_version(attr->oloc.file, attr) < 0) + if(H5A__set_version(attr->oloc.file, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, NULL, "unable to update attribute version") /* Insert the attribute into the object header */ - if(H5O_attr_create(&(attr->oloc), dxpl_id, attr) < 0) + if(H5O__attr_create(&(attr->oloc), attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, NULL, "unable to create attribute in object header") + /* Set return value */ ret_value = attr; + done: - if(NULL == ret_value && attr && H5A_close(attr)) + /* Cleanup on failure */ + if(NULL == ret_value && attr && H5A__close(attr)) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* H5A_create() */ + + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* H5A__create_common() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__create + * + * Purpose: Entry point for creating attribute on an object + * + * Note: This routine is needed so that there's a non-API routine for + * creating attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Attribute structure on success, NULL on Failure. + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +H5A_t * +H5A__create(const H5G_loc_t *loc, const char *name, const H5T_t *type, + const H5S_t *space, hid_t acpl_id) +{ + H5A_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check args */ + HDassert(loc); + HDassert(name); + HDassert(type); + HDassert(space); + + /* Go do the real work for attaching the attribute to the object */ + if(NULL == (ret_value = H5A__create_common(loc, name, type, space, acpl_id))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCREATE, NULL, "unable to create attribute") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__create() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__create_by_name + * + * Purpose: Create an attribute on object, according to it's name + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +H5A_t * +H5A__create_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name, + const H5T_t *type, const H5S_t *space, hid_t acpl_id) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + H5A_t *attr = NULL; /* Attribute from object header */ + H5A_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* check args */ + HDassert(loc); + HDassert(obj_name); + HDassert(attr_name); + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "object not found") + loc_found = TRUE; + + /* Go do the real work for attaching the attribute to the object */ + if(NULL == (attr = H5A__create_common(&obj_loc, attr_name, type, space, acpl_id))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to create attribute") + + /* Set return value */ + ret_value = attr; + +done: + /* Release resources */ + if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't free location") + + /* Cleanup on failure */ + if(ret_value == NULL) + if(attr && H5A__close(attr) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__create_by_name() */ /*------------------------------------------------------------------------- @@ -292,7 +391,7 @@ done: * Finishes initializing an attributes the open * * Usage: - * herr_t H5A__open_common(loc, name, dxpl_id) + * herr_t H5A__open_common(loc, name) * const H5G_loc_t *loc; IN: Pointer to group location for object * H5A_t *attr; IN/OUT: Pointer to attribute to initialize * @@ -303,12 +402,12 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5A__open_common(const H5G_loc_t *loc, H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* check args */ HDassert(loc); @@ -343,7 +442,56 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_open_by_idx + * Function: H5A__open + * + * Purpose: Open an attribute in an object header + * + * Note: This routine is needed so that there's a non-API routine for + * creating attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * December 9, 2017 + * + *------------------------------------------------------------------------- + */ +H5A_t * +H5A__open(const H5G_loc_t *loc, const char *attr_name) +{ + H5A_t *attr = NULL; /* Attribute from object header */ + H5A_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* check args */ + HDassert(loc); + HDassert(attr_name); + + /* Read in attribute from object header */ + if(NULL == (attr = H5O__attr_open_by_name(loc->oloc, attr_name))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to load attribute info from object header for attribute: '%s'", attr_name) + + /* Finish initializing attribute */ + if(H5A__open_common(loc, attr) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to initialize attribute") + + /* Set return value */ + ret_value = attr; + +done: + /* Cleanup on failure */ + if(ret_value == NULL) + if(attr && H5A__close(attr) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__open() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__open_by_idx * * Purpose: Open an attribute according to its index order * @@ -355,8 +503,8 @@ done: *------------------------------------------------------------------------- */ H5A_t * -H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, hid_t lapl_id, hid_t dxpl_id) +H5A__open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ @@ -365,7 +513,7 @@ H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5A_t *attr = NULL; /* Attribute from object header */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* check args */ HDassert(loc); @@ -377,12 +525,12 @@ H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5G_loc_reset(&obj_loc); /* Find the object's location */ - if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "object not found") loc_found = TRUE; /* Read in attribute from object header */ - if(NULL == (attr = H5O_attr_open_by_idx(obj_loc.oloc, idx_type, order, n, dxpl_id))) + if(NULL == (attr = H5O__attr_open_by_idx(obj_loc.oloc, idx_type, order, n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to load attribute info from object header") /* Finish initializing attribute */ @@ -399,15 +547,15 @@ done: /* Cleanup on failure */ if(ret_value == NULL) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_open_by_idx() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__open_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5A_open_by_name + * Function: H5A__open_by_name * * Purpose: Open an attribute in an object header, according to it's name * @@ -419,8 +567,7 @@ done: *------------------------------------------------------------------------- */ H5A_t * -H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name, - hid_t lapl_id, hid_t dxpl_id) +H5A__open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ @@ -429,7 +576,7 @@ H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_na H5A_t *attr = NULL; /* Attribute from object header */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE_VOL /* check args */ HDassert(loc); @@ -442,12 +589,12 @@ H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_na H5G_loc_reset(&obj_loc); /* Find the object's location */ - if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "object not found") loc_found = TRUE; /* Read in attribute from object header */ - if(NULL == (attr = H5O_attr_open_by_name(obj_loc.oloc, attr_name, dxpl_id))) + if(NULL == (attr = H5O__attr_open_by_name(obj_loc.oloc, attr_name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to load attribute info from object header") /* Finish initializing attribute */ @@ -464,11 +611,11 @@ done: /* Cleanup on failure */ if(ret_value == NULL) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_open_by_name() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__open_by_name() */ /*-------------------------------------------------------------------------- @@ -488,7 +635,7 @@ done: This function reads a complete attribute from disk. --------------------------------------------------------------------------*/ herr_t -H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) +H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) { uint8_t *tconv_buf = NULL; /* datatype conv buffer*/ uint8_t *bkg_buf = NULL; /* background buffer */ @@ -501,7 +648,7 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) size_t buf_size; /* desired buffer size */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL_TAG(attr->oloc.addr) HDassert(attr); HDassert(mem_type); @@ -523,7 +670,7 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) else { /* Attribute exists and has a value */ /* Convert memory buffer into disk buffer */ /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(attr->shared->dt, mem_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(attr->shared->dt, mem_type))) HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") /* Check for type conversion required */ @@ -543,7 +690,7 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) HDmemcpy(tconv_buf, attr->shared->data, (src_type_size * nelmts)); /* Perform datatype conversion. */ - if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") /* Copy the converted data into the user's buffer */ @@ -570,7 +717,7 @@ done: if(bkg_buf) bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* H5A__read() */ @@ -591,7 +738,7 @@ done: This function writes a complete attribute to disk. --------------------------------------------------------------------------*/ herr_t -H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) +H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) { uint8_t *tconv_buf = NULL; /* datatype conv buffer */ hbool_t tconv_owned = FALSE; /* Whether the datatype conv buffer is owned by attribute */ @@ -605,7 +752,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) size_t buf_size; /* desired buffer size */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, attr->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_VOL_TAG(attr->oloc.addr) HDassert(attr); HDassert(mem_type); @@ -624,7 +771,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) /* Convert memory buffer into disk buffer */ /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(mem_type, attr->shared->dt, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(mem_type, attr->shared->dt))) HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") /* Check for type conversion required */ @@ -644,7 +791,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) HDmemcpy(tconv_buf, buf, (src_type_size * nelmts)); /* Perform datatype conversion */ - if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") /* Free the previous attribute data buffer, if there is one */ @@ -669,7 +816,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) } /* end else */ /* Modify the attribute in the object header */ - if(H5O_attr_write(&(attr->oloc), dxpl_id, attr) < 0) + if(H5O__attr_write(&(attr->oloc), attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to modify attribute") } /* end if */ @@ -684,7 +831,7 @@ done: if(bkg_buf) bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* H5A__write() */ @@ -710,7 +857,7 @@ H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) size_t copy_len, nbytes; ssize_t ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* get the real attribute length */ nbytes = HDstrlen(attr->shared->name); @@ -772,7 +919,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_get_type + * Function: H5A__get_type * * Purpose: Returns an ID for the datatype of an attribute * @@ -783,12 +930,12 @@ done: *------------------------------------------------------------------------- */ hid_t -H5A_get_type(H5A_t *attr) +H5A__get_type(H5A_t *attr) { H5T_t *dt = NULL; hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL HDassert(attr); @@ -816,16 +963,16 @@ H5A_get_type(H5A_t *attr) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype") done: - if (H5I_INVALID_HID == ret_value && dt && (H5T_close(dt) < 0)) + if(H5I_INVALID_HID == ret_value && dt && (H5T_close(dt) < 0)) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release datatype") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_get_type() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5A__get_type() */ /*-------------------------------------------------------------------------- NAME - H5A_get_create_plist + H5A__get_create_plist PURPOSE private version of H5Aget_create_plist RETURNS @@ -840,14 +987,14 @@ done: resource leaks will occur. --------------------------------------------------------------------------*/ hid_t -H5A_get_create_plist(H5A_t* attr) +H5A__get_create_plist(H5A_t* attr) { H5P_genplist_t *plist; /* Default property list */ hid_t new_plist_id; /* ID of ACPL to return */ H5P_genplist_t *new_plist; /* ACPL to return */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE if(NULL == (plist = (H5P_genplist_t *)H5I_object(H5P_LST_ATTRIBUTE_CREATE_ID_g))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get default ACPL") @@ -866,7 +1013,7 @@ H5A_get_create_plist(H5A_t* attr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Aget_create_plist() */ +} /* end H5A__get_create_plist() */ /*------------------------------------------------------------------------- @@ -911,7 +1058,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_copy + * Function: H5A__copy * * Purpose: Copies attribute OLD_ATTR. * @@ -929,13 +1076,13 @@ done: *------------------------------------------------------------------------- */ H5A_t * -H5A_copy(H5A_t *_new_attr, const H5A_t *old_attr) +H5A__copy(H5A_t *_new_attr, const H5A_t *old_attr) { H5A_t *new_attr = NULL; hbool_t allocated_attr = FALSE; /* Whether the attribute was allocated */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(old_attr); @@ -970,15 +1117,15 @@ H5A_copy(H5A_t *_new_attr, const H5A_t *old_attr) done: if(ret_value == NULL) - if(allocated_attr && new_attr && H5A_close(new_attr) < 0) + if(allocated_attr && new_attr && H5A__close(new_attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_copy() */ +} /* end H5A__copy() */ /*------------------------------------------------------------------------- - * Function: H5A_free + * Function: H5A__free * * Purpose: Frees all memory associated with an attribute, but does not * free the H5A_t structure (which should be done in H5T_close). @@ -993,11 +1140,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_free(H5A_t *attr) +H5A__free(H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(attr); @@ -1007,7 +1154,7 @@ H5A_free(H5A_t *attr) attr->shared->name = NULL; } if(attr->shared->dt) { - if(H5T_close(attr->shared->dt) < 0) + if(H5T_close_real(attr->shared->dt) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release datatype info") attr->shared->dt = NULL; } @@ -1021,11 +1168,43 @@ H5A_free(H5A_t *attr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_free() */ +} /* end H5A__free() */ /*------------------------------------------------------------------------- - * Function: H5A_close + * Function: H5A__close_cb + * + * Purpose: Frees an attribute and all associated memory. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Sunday, February 18, 1997 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__close_cb(H5A_t *attr) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(attr); + HDassert(attr->shared); + + /* Call the actual close routine */ + if(H5A__close(attr) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "problem closing attribute") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5A__close_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__close * * Purpose: Frees an attribute and all associated memory. * @@ -1034,18 +1213,14 @@ done: * Programmer: Robb Matzke * Monday, December 8, 1997 * - * Modifications: - * Raymond Lu - * 4 June 2008 - * Changed some attribute object information to be shared. *------------------------------------------------------------------------- */ herr_t -H5A_close(H5A_t *attr) +H5A__close(H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(attr); HDassert(attr->shared); @@ -1054,10 +1229,10 @@ H5A_close(H5A_t *attr) if(attr->obj_opened && (H5O_close(&(attr->oloc), NULL) < 0)) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release object header info") - /* Reference count can be 0. It only happens when H5A_create fails. */ + /* Reference count can be 0. It only happens when H5A__create fails. */ if(attr->shared->nrefs <= 1) { /* Free dynamicly allocated items */ - if(H5A_free(attr) < 0) + if(H5A__free(attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release attribute info") /* Destroy shared attribute struct */ @@ -1078,7 +1253,7 @@ H5A_close(H5A_t *attr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_close() */ +} /* end H5A__close() */ /*------------------------------------------------------------------------- @@ -1176,7 +1351,40 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_exists_by_name + * Function: H5A__exists + * + * Purpose: Private version of H5Aexists + * + * Note: This routine is needed so that there's a non-API routine for + * detecting attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: TRUE/FALSE + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +htri_t +H5A__exists(const H5G_loc_t *loc, const char *name) +{ + htri_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check if the attribute exists */ + if((ret_value = H5O__attr_exists(loc->oloc, name)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__exists() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__exists_by_name * * Purpose: Private version of H5Aexists_by_name * @@ -1189,8 +1397,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, - hid_t lapl_id, hid_t dxpl_id) +H5A__exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ @@ -1198,7 +1405,7 @@ H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Set up opened group location to fill in */ obj_loc.oloc = &obj_oloc; @@ -1206,12 +1413,12 @@ H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, H5G_loc_reset(&obj_loc); /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) + if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") loc_found = TRUE; /* Check if the attribute exists */ - if((ret_value = H5O_attr_exists(obj_loc.oloc, attr_name, dxpl_id)) < 0) + if((ret_value = H5O__attr_exists(obj_loc.oloc, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: @@ -1219,8 +1426,8 @@ done: if(loc_found && H5G_loc_free(&obj_loc) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_exists_by_name() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__exists_by_name() */ /*------------------------------------------------------------------------- @@ -1269,7 +1476,7 @@ H5A__compact_build_table_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/ } /* end if */ /* Copy attribute into table */ - if(NULL == (udata->atable->attrs[udata->curr_attr] = H5A_copy(NULL, (const H5A_t *)mesg->native))) + if(NULL == (udata->atable->attrs[udata->curr_attr] = H5A__copy(NULL, (const H5A_t *)mesg->native))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") /* Assign [somewhat arbitrary] creation order value, if requested */ @@ -1285,7 +1492,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_compact_build_table + * Function: H5A__compact_build_table * * Purpose: Builds a table containing a sorted list of attributes for * an object @@ -1302,14 +1509,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_index_t idx_type, +H5A__compact_build_table(H5F_t *f, H5O_t *oh, H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable) { H5A_compact_bt_ud_t udata; /* User data for iteration callback */ H5O_mesg_operator_t op; /* Wrapper for operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(f); @@ -1322,7 +1529,6 @@ H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_index_t idx_type, /* Set up user data for iteration */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.atable = atable; udata.curr_attr = 0; udata.bogus_crt_idx = (hbool_t)((oh->version == H5O_VERSION_1 || @@ -1331,7 +1537,7 @@ H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_index_t idx_type, /* Iterate over existing attributes, checking for attribute with same name */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5A__compact_build_table_cb; - if(H5O_msg_iterate_real(f, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(f, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error building attribute table") /* Correct # of attributes in table */ @@ -1346,7 +1552,7 @@ H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_index_t idx_type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_compact_build_table() */ +} /* end H5A__compact_build_table() */ /*------------------------------------------------------------------------- @@ -1382,7 +1588,7 @@ H5A__dense_build_table_cb(const H5A_t *attr, void *_udata) HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, H5_ITER_ERROR, "can't allocate attribute") /* Copy attribute information. Share the attribute object in copying. */ - if(NULL == H5A_copy(udata->atable->attrs[udata->curr_attr], attr)) + if(NULL == H5A__copy(udata->atable->attrs[udata->curr_attr], attr)) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") /* Increment number of attributes stored */ @@ -1394,7 +1600,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_build_table + * Function: H5A__dense_build_table * * Purpose: Builds a table containing a sorted list of attributes for * an object @@ -1412,14 +1618,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, +H5A__dense_build_table(H5F_t *f, const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable) { H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ hsize_t nrec; /* # of records in v2 B-tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(f); @@ -1429,7 +1635,7 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, HDassert(atable); /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in "name" B-tree */ @@ -1459,8 +1665,8 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, attr_op.u.lib_op = H5A__dense_build_table_cb; /* Iterate over the links in the group, building a table of the link messages */ - if(H5A_dense_iterate(f, dxpl_id, (hid_t)0, ainfo, H5_INDEX_NAME, - H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, &udata) < 0) + if(H5A__dense_iterate(f, (hid_t)0, ainfo, H5_INDEX_NAME, H5_ITER_NATIVE, + (hsize_t)0, NULL, &attr_op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") /* Sort attribute table in correct iteration order */ @@ -1472,11 +1678,11 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_build_table() */ +} /* end H5A__dense_build_table() */ /*------------------------------------------------------------------------- @@ -1651,7 +1857,7 @@ H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, /*------------------------------------------------------------------------- - * Function: H5A_attr_iterate_table + * Function: H5A__attr_iterate_table * * Purpose: Iterate over table containing a list of attributes for an object, * making appropriate callbacks @@ -1665,14 +1871,14 @@ H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, *------------------------------------------------------------------------- */ herr_t -H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, +H5A__attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, hsize_t *last_attr, hid_t loc_id, const H5A_attr_iter_op_t *attr_op, void *op_data) { size_t u; /* Local index variable */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(atable); @@ -1730,11 +1936,11 @@ H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_attr_iterate_table() */ +} /* end H5A__attr_iterate_table() */ /*------------------------------------------------------------------------- - * Function: H5A_attr_release_table + * Function: H5A__attr_release_table * * Purpose: Release table containing a list of attributes for an object * @@ -1747,11 +1953,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_attr_release_table(H5A_attr_table_t *atable) +H5A__attr_release_table(H5A_attr_table_t *atable) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(atable); @@ -1762,7 +1968,7 @@ H5A_attr_release_table(H5A_attr_table_t *atable) /* Free attribute message information */ for(u = 0; u < atable->nattrs; u++) - if(atable->attrs[u] && H5A_close(atable->attrs[u]) < 0) + if(atable->attrs[u] && H5A__close(atable->attrs[u]) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute") } /* end if */ else @@ -1772,11 +1978,11 @@ H5A_attr_release_table(H5A_attr_table_t *atable) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_attr_release_table() */ +} /* end H5A__attr_release_table() */ /*------------------------------------------------------------------------- - * Function: H5A_get_ainfo + * Function: H5A__get_ainfo * * Purpose: Retrieves the "attribute info" message for an object. Also * sets the number of attributes correctly, if it isn't set up yet. @@ -1791,12 +1997,12 @@ done: *------------------------------------------------------------------------- */ htri_t -H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) +H5A__get_ainfo(H5F_t *f, H5O_t *oh, H5O_ainfo_t *ainfo) { H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_TAG(oh->cache_info.addr, FAIL) /* check arguments */ HDassert(f); @@ -1808,7 +2014,7 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "unable to check object header") if(ret_value > 0) { /* Retrieve the "attribute info" structure */ - if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_AINFO_ID, ainfo)) + if(NULL == H5O_msg_read_oh(f, oh, H5O_AINFO_ID, ainfo)) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't read AINFO message") /* Check if we don't know how many attributes there are */ @@ -1816,7 +2022,7 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) /* Check if we are using "dense" attribute storage */ if(H5F_addr_defined(ainfo->fheap_addr)) { /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in "name" B-tree */ @@ -1832,15 +2038,15 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5A_get_ainfo() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5A__get_ainfo() */ /*------------------------------------------------------------------------- - * Function: H5A_set_version + * Function: H5A__set_version * * Purpose: Sets the correct version to encode attribute with. * Chooses the oldest version possible, unless the "use the @@ -1856,13 +2062,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_set_version(const H5F_t *f, H5A_t *attr) +H5A__set_version(const H5F_t *f, H5A_t *attr) { hbool_t type_shared, space_shared; /* Flags to indicate that shared messages are used for this attribute */ hbool_t use_latest_format; /* Flag indicating the latest attribute version support is enabled */ - herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE_NOERR /* check arguments */ HDassert(f); @@ -1892,13 +2097,12 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) else attr->shared->version = H5O_ATTR_VERSION_1; /* Write out basic version */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_set_version() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5A__set_version() */ /*------------------------------------------------------------------------- - * Function: H5A_attr_copy_file + * Function: H5A__attr_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -1918,8 +2122,8 @@ done: *------------------------------------------------------------------------- */ H5A_t * -H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, hid_t dxpl_id) +H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, + H5O_copy_t *cpy_info) { H5A_t *attr_dst = NULL; /* Destination attribute */ hid_t tid_src = -1; /* Datatype ID for source datatype */ @@ -1934,7 +2138,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si size_t dst_dt_size; /* Size of destination attribute datatype */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(attr_src); @@ -1999,9 +2203,9 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si * final size of the messages. This does nothing if the datatype is * committed or sharing is disabled. */ - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_DEFER, H5O_DTYPE_ID, attr_dst->shared->dt, NULL) < 0) + if(H5SM_try_share(file_dst, NULL, H5SM_DEFER, H5O_DTYPE_ID, attr_dst->shared->dt, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, NULL, "can't share attribute datatype") - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_DEFER, H5O_SDSPACE_ID, attr_dst->shared->ds, NULL) < 0) + if(H5SM_try_share(file_dst, NULL, H5SM_DEFER, H5O_SDSPACE_ID, attr_dst->shared->ds, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, NULL, "can't share attribute dataspace") /* Compute the sizes of the datatype and dataspace. This is their raw @@ -2061,9 +2265,9 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register destination file datatype") /* Set up the conversion functions */ - if(NULL == (tpath_src_mem = H5T_path_find(attr_src->shared->dt, dt_mem, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_src_mem = H5T_path_find(attr_src->shared->dt, dt_mem))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to convert between src and mem datatypes") - if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, attr_dst->shared->dt, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, attr_dst->shared->dt))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to convert between mem and dst datatypes") /* Determine largest datatype size */ @@ -2112,7 +2316,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, NULL, "memory allocation failed") /* 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_buf, dxpl_id) < 0) + if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg_buf) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "datatype conversion NULLed") HDmemcpy(reclaim_buf, buf, buf_size); @@ -2122,12 +2326,12 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si HDmemset(bkg_buf, 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_buf, dxpl_id) < 0) + if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg_buf) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "datatype conversion NULLed") HDmemcpy(attr_dst->shared->data, buf, attr_dst->shared->data_size); - if(H5D_vlen_reclaim(tid_mem, buf_space, dxpl_id, reclaim_buf) < 0) + if(H5D_vlen_reclaim(tid_mem, buf_space, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, NULL, "unable to reclaim variable-length data") } /* end if */ else { @@ -2140,7 +2344,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si attr_dst->shared->crt_idx = attr_src->shared->crt_idx; /* Recompute the version to encode the destination attribute */ - if(H5A_set_version(file_dst, attr_dst) < 0) + if(H5A__set_version(file_dst, attr_dst) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, NULL, "unable to update attribute version") /* Recompute the destination attribute's size, if it's a different version */ @@ -2173,15 +2377,15 @@ done: bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); /* Release destination attribute information on failure */ - if(!ret_value && attr_dst && H5A_close(attr_dst) < 0) + if(!ret_value && attr_dst && H5A__close(attr_dst) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_attr_copy_file() */ +} /* H5A__attr_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5A_attr_post_copy_file + * Function: H5A__attr_post_copy_file * * Purpose: Finish copying a message from between files. * We have to copy the values of a reference attribute in the @@ -2197,13 +2401,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, - H5O_loc_t *dst_oloc, const H5A_t *attr_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) +H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, + H5O_loc_t *dst_oloc, const H5A_t *attr_dst, H5O_copy_t *cpy_info) { H5F_t *file_src, *file_dst; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(src_oloc); @@ -2232,7 +2436,7 @@ H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, dst_oloc_dt->file = file_dst; /* Copy the shared object from source to destination */ - if(H5O_copy_header_map(src_oloc_dt, dst_oloc_dt, dxpl_id, cpy_info, FALSE, NULL, NULL) < 0) + if(H5O_copy_header_map(src_oloc_dt, dst_oloc_dt, cpy_info, FALSE, NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Update shared message info from named datatype info */ @@ -2242,9 +2446,9 @@ H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, /* Try to share both the datatype and dataset. This does nothing if the * datatype is committed or sharing is disabled. */ - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_WAS_DEFERRED, H5O_DTYPE_ID, attr_dst->shared->dt, NULL) < 0) + if(H5SM_try_share(file_dst, NULL, H5SM_WAS_DEFERRED, H5O_DTYPE_ID, attr_dst->shared->dt, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "can't share attribute datatype") - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_WAS_DEFERRED, H5O_SDSPACE_ID, attr_dst->shared->ds, NULL) < 0) + if(H5SM_try_share(file_dst, NULL, H5SM_WAS_DEFERRED, H5O_SDSPACE_ID, attr_dst->shared->ds, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "can't share attribute dataspace") /* Only need to fix reference attribute with real data being copied to @@ -2264,8 +2468,7 @@ H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, ref_count = attr_dst->shared->data_size / H5T_get_size(attr_dst->shared->dt); /* Copy objects referenced in source buffer to destination file and set destination elements */ - if(H5O_copy_expand_ref(file_src, attr_dst->shared->data, dxpl_id, - file_dst, attr_dst->shared->data, ref_count, H5T_get_ref_type(attr_dst->shared->dt), cpy_info) < 0) + if(H5O_copy_expand_ref(file_src, attr_dst->shared->data, file_dst, attr_dst->shared->data, ref_count, H5T_get_ref_type(attr_dst->shared->dt), cpy_info) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "unable to copy reference attribute") } /* end if */ else @@ -2275,7 +2478,7 @@ H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_attr_post_copy_file() */ +} /* H5A__attr_post_copy_file() */ /*------------------------------------------------------------------------- @@ -2308,12 +2511,10 @@ H5A__dense_post_copy_file_cb(const H5A_t *attr_src, void *_udata) HDassert(udata->file); HDassert(udata->cpy_info); - if(NULL == (attr_dst = H5A_attr_copy_file(attr_src, udata->file, - udata->recompute_size, udata->cpy_info, udata->dxpl_id))) + if(NULL == (attr_dst = H5A__attr_copy_file(attr_src, udata->file, udata->recompute_size, udata->cpy_info))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") - if(H5A_attr_post_copy_file(udata->oloc_src, attr_src, udata->oloc_dst, attr_dst, - udata->dxpl_id, udata->cpy_info) < 0) + if(H5A__attr_post_copy_file(udata->oloc_src, attr_src, udata->oloc_dst, attr_dst, udata->cpy_info) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") /* Reset shared location information */ @@ -2321,17 +2522,17 @@ H5A__dense_post_copy_file_cb(const H5A_t *attr_src, void *_udata) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to reset attribute sharing") /* Set COPIED tag for destination object's metadata */ - H5_BEGIN_TAG(udata->dxpl_id, H5AC__COPIED_TAG, H5_ITER_ERROR); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Insert attribute into dense storage */ - if(H5A_dense_insert(udata->file, udata->dxpl_id, udata->ainfo, attr_dst) < 0) + if(H5A__dense_insert(udata->file, udata->ainfo, attr_dst) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to add to dense storage") /* Reset metadata tag */ - H5_END_TAG(H5_ITER_ERROR); + H5_END_TAG done: - if(attr_dst && H5A_close(attr_dst) < 0) + if(attr_dst && H5A__close(attr_dst) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close destination attribute") FUNC_LEAVE_NOAPI(ret_value) @@ -2339,7 +2540,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_post_copy_file_all + * Function: H5A__dense_post_copy_file_all * * Purpose: Copy all dense attributes from SRC to DST. * @@ -2353,15 +2554,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainfo_src, - H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) +H5A__dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainfo_src, + H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, H5O_copy_t *cpy_info) { H5A_dense_file_cp_ud_t udata; /* User data for iteration callback */ H5A_attr_iter_op_t attr_op; /* Attribute operator */ hbool_t recompute_size = FALSE; /* recompute the size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(ainfo_src); @@ -2371,24 +2572,56 @@ H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainfo udata.file = dst_oloc->file; /* Destination file */ udata.recompute_size = &recompute_size; /* Flag to indicate if size changed */ udata.cpy_info = cpy_info; /* Information on copying options */ - udata.dxpl_id = dxpl_id; /* DXPL for operation */ udata.oloc_src = src_oloc; udata.oloc_dst = dst_oloc; attr_op.op_type = H5A_ATTR_OP_LIB; attr_op.u.lib_op = H5A__dense_post_copy_file_cb; - if(H5A_dense_iterate(src_oloc->file, dxpl_id, (hid_t)0, ainfo_src, H5_INDEX_NAME, + if(H5A__dense_iterate(src_oloc->file, (hid_t)0, ainfo_src, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_post_copy_file_all */ +} /* end H5A__dense_post_copy_file_all */ + + +/*------------------------------------------------------------------------- + * Function: H5A__rename + * + * Purpose: Private version of H5Arename + * + * Note: This routine is needed so that there's a non-API routine for + * renaming attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__rename(const H5G_loc_t *loc, const char *old_name, const char *new_name) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Call object header attribute rename routine */ + if(H5O__attr_rename(loc->oloc, old_name, new_name) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__rename() */ /*------------------------------------------------------------------------- - * Function: H5A_rename_by_name + * Function: H5A__rename_by_name * * Purpose: Private version of H5Arename_by_name * @@ -2401,8 +2634,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_name, - const char *new_attr_name, hid_t lapl_id, hid_t dxpl_id) +H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_name, + const char *new_attr_name) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ @@ -2410,29 +2643,376 @@ H5A_rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_nam hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL - /* Avoid thrashing things if the names are the same */ - if(HDstrcmp(old_attr_name, new_attr_name)) { - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; - - /* Call attribute rename routine */ - if(H5O_attr_rename(obj_loc.oloc, dxpl_id, old_attr_name, new_attr_name) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") - } /* end if */ + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Call attribute rename routine */ + if(H5O__attr_rename(obj_loc.oloc, old_attr_name, new_attr_name) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") done: /* Release resources */ if(loc_found && H5G_loc_free(&obj_loc) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__rename_by_name() */ + +#ifndef H5_NO_DEPRECATED_SYMBOLS + +/*------------------------------------------------------------------------- + * Function: H5A__get_num_attrs + * + * Purpose: Private version of deprecated H5Aget_num_attrs + * + * Note: This routine is needed so that there's a non-API routine for + * querying the attribute count that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +int +H5A__get_num_attrs(const H5O_loc_t *loc) +{ + int ret_value = FAIL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Look up the # of attributes for the object */ + if((ret_value = H5O__attr_count(loc)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "can't get attribute count for object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__get_num_attrs() */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + +/*------------------------------------------------------------------------- + * Function: H5A__iterate_common + * + * Purpose: Internal common version of H5Aiterate + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5A__iterate_common(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, + hsize_t *idx, H5A_attr_iter_op_t *attr_op, void *op_data) +{ + hsize_t start_idx; /* Index of attribute to start iterating at */ + hsize_t last_attr; /* Index of last attribute examined */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_NOERR + + /* Call attribute iteration routine */ + last_attr = start_idx = (idx ? *idx : 0); + if((ret_value = H5O__attr_iterate(loc_id, idx_type, order, start_idx, &last_attr, attr_op, op_data)) < 0) + HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); + + /* Set the last attribute information */ + if(idx) + *idx = last_attr; + FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_rename_by_name() */ +} /* H5A__iterate_common() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__iterate + * + * Purpose: Private version of H5Aiterate2 + * + * Note: This routine is needed so that there's a non-API routine for + * iterating over attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__iterate(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, + hsize_t *idx, H5A_operator2_t op, void *op_data) +{ + H5A_attr_iter_op_t attr_op; /* Attribute operator */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Build attribute operator info */ + attr_op.op_type = H5A_ATTR_OP_APP2; + attr_op.u.app_op2 = op; + + /* Call internal attribute iteration routine */ + if((ret_value = H5A__iterate_common(loc_id, idx_type, order, idx, &attr_op, op_data)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error iterating over attributes") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__iterate() */ + +#ifndef H5_NO_DEPRECATED_SYMBOLS + +/*------------------------------------------------------------------------- + * Function: H5A__iterate_old + * + * Purpose: Private version of H5Aiterate1 + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__iterate_old(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, + void *op_data) +{ + H5A_attr_iter_op_t attr_op; /* Attribute operator */ + hsize_t idx; /* Index of attribute to start iterating at */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Build attribute operator info */ + attr_op.op_type = H5A_ATTR_OP_APP; + attr_op.u.app_op = op; + + /* Set up index */ + idx = (hsize_t)(attr_num ? *attr_num : 0); + + /* Call internal attribute iteration routine */ + if((ret_value = H5A__iterate_common(loc_id, H5_INDEX_CRT_ORDER, H5_ITER_INC, &idx, &attr_op, op_data)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error iterating over attributes") + + /* Translate hsize_t index value to legacy unsigned index value*/ + if(attr_num) + *attr_num = (unsigned)idx; + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__iterate_old() */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + +/*------------------------------------------------------------------------- + * Function: H5A__iterate_by_name + * + * Purpose: Private version of H5Aiterate_by_name + * + * Note: This routine is needed so that there's a non-API routine for + * iterating over attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__iterate_by_name(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, + void *op_data) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + hid_t obj_loc_id = (-1); /* ID for object located */ + H5A_attr_iter_op_t attr_op; /* Attribute operator */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Open the object */ + if((obj_loc_id = H5O__open_by_loc(&obj_loc, TRUE)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open object") + + /* Build attribute operator info */ + attr_op.op_type = H5A_ATTR_OP_APP2; + attr_op.u.app_op2 = op; + + /* Call attribute iteration routine */ + if((ret_value = H5A__iterate_common(obj_loc_id, idx_type, order, idx, &attr_op, op_data)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error iterating over attributes") + +done: + /* Release resources */ + if(obj_loc_id > 0) { + if(H5I_dec_app_ref(obj_loc_id) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") + } /* end if */ + else if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__iterate_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__delete + * + * Purpose: Private version of H5Adelete + * + * Note: This routine is needed so that there's a non-API routine for + * deleting attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__delete(const H5G_loc_t *loc, const char *name) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Call object header attribute delete attribute routine */ + if(H5O__attr_remove(loc->oloc, name) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__delete() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__delete_by_name + * + * Purpose: Private version of H5Adelete_by_name + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__delete_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Delete the attribute from the location */ + if(H5O__attr_remove(obj_loc.oloc, attr_name) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") + +done: + /* Release resources */ + if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__delete_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__delete_by_idx + * + * Purpose: Private version of H5Adelete_by_idx + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__delete_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Delete the attribute from the location */ + if(H5O__attr_remove_by_idx(obj_loc.oloc, idx_type, order, n) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") + +done: + /* Release resources */ + if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__delete_by_idx() */ + diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 6d5a83a..3315cc1 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -129,7 +129,6 @@ typedef herr_t (*H5A_bt2_found_t)(const H5A_t *attr, hbool_t *took_ownership, vo typedef struct H5A_bt2_ud_common_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ H5HF_t *shared_fheap; /* Fractal heap handle for shared messages */ const char *name; /* Name of attribute to compare */ @@ -182,93 +181,111 @@ H5_DLLVAR const H5B2_class_t H5A_BT2_CORDER[1]; /******************************/ /* Function prototypes for H5A package scope */ -H5_DLL H5A_t *H5A_create(const H5G_loc_t *loc, const char *name, - const H5T_t *type, const H5S_t *space, hid_t acpl_id, hid_t dxpl_id); -H5_DLL H5A_t *H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, - const char *attr_name, hid_t lapl_id, hid_t dxpl_id); -H5_DLL H5A_t *H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5A__open_common(const H5G_loc_t *loc, H5A_t *attr); -H5_DLL H5A_t *H5A_copy(H5A_t *new_attr, const H5A_t *old_attr); +H5_DLL H5A_t *H5A__create(const H5G_loc_t *loc, const char *attr_name, + const H5T_t *type, const H5S_t *space, hid_t acpl_id); +H5_DLL H5A_t *H5A__create_by_name(const H5G_loc_t *loc, const char *obj_name, + const char *attr_name, const H5T_t *type, const H5S_t *space, + hid_t acpl_id); +H5_DLL H5A_t *H5A__open(const H5G_loc_t *loc, const char *attr_name); +H5_DLL H5A_t *H5A__open_by_name(const H5G_loc_t *loc, const char *obj_name, + const char *attr_name); +H5_DLL H5A_t *H5A__open_by_idx(const H5G_loc_t *loc, const char *obj_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); +H5_DLL H5A_t *H5A__copy(H5A_t *new_attr, const H5A_t *old_attr); +H5_DLL hid_t H5A__get_type(H5A_t *attr); H5_DLL herr_t H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo); -H5_DLL hid_t H5A_get_create_plist(H5A_t* attr); -H5_DLL herr_t H5A_free(H5A_t *attr); -H5_DLL herr_t H5A_close(H5A_t *attr); -H5_DLL htri_t H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo); -H5_DLL herr_t H5A_set_version(const H5F_t *f, H5A_t *attr); -H5_DLL herr_t H5A_rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_name, - const char *new_attr_name, hid_t lapl_id, hid_t dxpl_id); -H5_DLL htri_t H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, - hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id); -H5_DLL herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id); +H5_DLL hid_t H5A__get_create_plist(H5A_t* attr); +H5_DLL herr_t H5A__free(H5A_t *attr); +H5_DLL herr_t H5A__close(H5A_t *attr); +H5_DLL herr_t H5A__close_cb(H5A_t *attr); +H5_DLL htri_t H5A__get_ainfo(H5F_t *f, H5O_t *oh, H5O_ainfo_t *ainfo); +H5_DLL herr_t H5A__set_version(const H5F_t *f, H5A_t *attr); +H5_DLL herr_t H5A__rename(const H5G_loc_t *loc, const char *old_name, + const char *new_name); +H5_DLL herr_t H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_name, + const char *new_attr_name); +#ifndef H5_NO_DEPRECATED_SYMBOLS +H5_DLL int H5A__get_num_attrs(const H5O_loc_t *loc); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ +H5_DLL herr_t H5A__iterate(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, + hsize_t *idx, H5A_operator2_t op, void *op_data); +H5_DLL herr_t H5A__iterate_by_name(const H5G_loc_t *loc, const char *obj_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, + void *op_data); +#ifndef H5_NO_DEPRECATED_SYMBOLS +H5_DLL herr_t H5A__iterate_old(hid_t loc_id, unsigned *attr_num, + H5A_operator1_t op, void *op_data); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ +H5_DLL herr_t H5A__delete(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5A__delete_by_name(const H5G_loc_t *loc, const char *obj_name, + const char *attr_name); +H5_DLL herr_t H5A__delete_by_idx(const H5G_loc_t *loc, const char *obj_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); +H5_DLL htri_t H5A__exists(const H5G_loc_t *loc, const char *name); +H5_DLL htri_t H5A__exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name); +H5_DLL herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf); +H5_DLL herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf); H5_DLL ssize_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf); /* Attribute "dense" storage routines */ -H5_DLL herr_t H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo); -H5_DLL H5A_t *H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, - const char *name); -H5_DLL herr_t H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, - H5A_t *attr); -H5_DLL herr_t H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, - H5A_t *attr); -H5_DLL herr_t H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, +H5_DLL herr_t H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo); +H5_DLL H5A_t *H5A__dense_open(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name); +H5_DLL herr_t H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr); +H5_DLL herr_t H5A__dense_write(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr); +H5_DLL herr_t H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, const char *new_name); -H5_DLL herr_t H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, - const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, - hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, - void *op_data); -H5_DLL herr_t H5A_dense_remove(H5F_t *f, hid_t dxpl_id, - const H5O_ainfo_t *ainfo, const char *name); -H5_DLL herr_t H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, - const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, - hsize_t n); -H5_DLL htri_t H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, +H5_DLL herr_t H5A__dense_iterate(H5F_t *f, hid_t loc_id, const H5O_ainfo_t *ainfo, + H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, + const H5A_attr_iter_op_t *attr_op, void *op_data); +H5_DLL herr_t H5A__dense_remove(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name); -H5_DLL herr_t H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo); +H5_DLL herr_t H5A__dense_remove_by_idx(H5F_t *f, const H5O_ainfo_t *ainfo, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); +H5_DLL htri_t H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, + const char *name); +H5_DLL herr_t H5A__dense_delete(H5F_t *f, H5O_ainfo_t *ainfo); /* Attribute table operations */ -H5_DLL herr_t H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, +H5_DLL herr_t H5A__compact_build_table(H5F_t *f, H5O_t *oh, H5_index_t idx_type, + H5_iter_order_t order, H5A_attr_table_t *atable); +H5_DLL herr_t H5A__dense_build_table(H5F_t *f, const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable); -H5_DLL herr_t H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, - const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, - H5A_attr_table_t *atable); -H5_DLL herr_t H5A_attr_iterate_table(const H5A_attr_table_t *atable, +H5_DLL herr_t H5A__attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, hsize_t *last_attr, hid_t loc_id, const H5A_attr_iter_op_t *attr_op, void *op_data); -H5_DLL herr_t H5A_attr_release_table(H5A_attr_table_t *atable); +H5_DLL herr_t H5A__attr_release_table(H5A_attr_table_t *atable); /* Attribute operations */ -H5_DLL herr_t H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr); -H5_DLL H5A_t *H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, - hid_t dxpl_id); -H5_DLL H5A_t *H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, hid_t dxpl_id); -H5_DLL herr_t H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - H5A_t *attr, H5O_shared_t *sh_mesg); -H5_DLL herr_t H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, - H5A_t *attr); -H5_DLL herr_t H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, - const char *old_name, const char *new_name); -H5_DLL herr_t H5O_attr_remove(const H5O_loc_t *loc, const char *name, - hid_t dxpl_id); -H5_DLL herr_t H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, hid_t dxpl_id); -H5_DLL htri_t H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id); +H5_DLL herr_t H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr); +H5_DLL H5A_t *H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name); +H5_DLL H5A_t *H5O__attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n); +H5_DLL herr_t H5O__attr_update_shared(H5F_t *f, H5O_t *oh, H5A_t *attr, + H5O_shared_t *sh_mesg); +H5_DLL herr_t H5O__attr_write(const H5O_loc_t *loc, H5A_t *attr); +H5_DLL herr_t H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, + const char *new_name); +H5_DLL herr_t H5O__attr_iterate(hid_t loc_id, H5_index_t idx_type, + H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, + const H5A_attr_iter_op_t *op, void *op_data); +H5_DLL herr_t H5O__attr_remove(const H5O_loc_t *loc, const char *name); +H5_DLL herr_t H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n); +H5_DLL htri_t H5O__attr_exists(const H5O_loc_t *loc, const char *name); #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL int H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id); +H5_DLL int H5O__attr_count(const H5O_loc_t *loc); #endif /* H5_NO_DEPRECATED_SYMBOLS */ -H5_DLL H5A_t *H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, hid_t dxpl_id); -H5_DLL herr_t H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src, - H5O_loc_t *dst_oloc, const H5A_t *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); -H5_DLL herr_t H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t * ainfo_src, - H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); +H5_DLL H5A_t *H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, + H5O_copy_t *cpy_info); +H5_DLL herr_t H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src, + H5O_loc_t *dst_oloc, const H5A_t *mesg_dst, H5O_copy_t *cpy_info); +H5_DLL herr_t H5A__dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t * ainfo_src, + H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, H5O_copy_t *cpy_info); /* Testing functions */ #ifdef H5A_TESTING -H5_DLL htri_t H5A_is_shared_test(hid_t aid); -H5_DLL herr_t H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count); +H5_DLL htri_t H5A__is_shared_test(hid_t aid); +H5_DLL herr_t H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count); #endif /* H5A_TESTING */ #endif /* _H5Apkg_H */ diff --git a/src/H5Aprivate.h b/src/H5Aprivate.h index 9826859..342ffc8 100644 --- a/src/H5Aprivate.h +++ b/src/H5Aprivate.h @@ -76,14 +76,10 @@ typedef struct H5A_attr_iter_op_t { H5_DLL struct H5O_loc_t *H5A_oloc(H5A_t *attr); H5_DLL H5G_name_t *H5A_nameof(H5A_t *attr); H5_DLL H5T_t *H5A_type(const H5A_t *attr); -H5_DLL hid_t H5A_get_type(H5A_t *attr); H5_DLL hid_t H5A_get_space(H5A_t *attr); H5_DLL herr_t H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, - hid_t dxpl_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, + H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data); -H5_DLL herr_t H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, H5_index_t idx_type, - H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, - const H5A_attr_iter_op_t *op, void *op_data); #endif /* _H5Aprivate_H */ diff --git a/src/H5Atest.c b/src/H5Atest.c index b923637..f7b7fd3 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -36,6 +36,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5SMprivate.h" /* Shared object header messages */ @@ -77,7 +78,7 @@ /*------------------------------------------------------------------------- - * Function: H5A_is_shared_test + * Function: H5A__is_shared_test * * Purpose: Check if an attribute is shared * @@ -90,12 +91,12 @@ *------------------------------------------------------------------------- */ htri_t -H5A_is_shared_test(hid_t attr_id) +H5A__is_shared_test(hid_t attr_id) { H5A_t *attr; /* Attribute object for ID */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -106,11 +107,11 @@ H5A_is_shared_test(hid_t attr_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_is_shared_test() */ +} /* end H5A__is_shared_test() */ /*------------------------------------------------------------------------- - * Function: H5A_get_shared_rc_test + * Function: H5A__get_shared_rc_test * * Purpose: Retrieve the refcount for a shared attribute * @@ -123,26 +124,31 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) +H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) { H5A_t *attr; /* Attribute object for ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Sanity check */ HDassert(H5O_msg_is_shared(H5O_ATTR_ID, attr)); /* Retrieve ref count for shared or shareable attribute */ - if(H5SM_get_refcount(attr->oloc.file, H5AC_ind_read_dxpl_id, H5O_ATTR_ID, - &attr->sh_loc, ref_count) < 0) + if(H5SM_get_refcount(attr->oloc.file, H5O_ATTR_ID, &attr->sh_loc, ref_count) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_get_shared_rc_test() */ +} /* end H5A__get_shared_rc_test() */ diff --git a/src/H5B.c b/src/H5B.c index e64a695..fe09b42 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -103,7 +103,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Bpkg.h" /* B-link trees */ -#include "H5Dprivate.h" /* Datasets */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File memory management */ @@ -143,20 +143,15 @@ typedef struct H5B_ins_ud_t { /********************/ /* Local Prototypes */ /********************/ -static H5B_ins_t H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, - const H5B_class_t *type, - uint8_t *lt_key, - hbool_t *lt_key_changed, - uint8_t *md_key, void *udata, - uint8_t *rt_key, - hbool_t *rt_key_changed, - H5B_ins_ud_t *split_bt_ud/*out*/); +static H5B_ins_t H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, + const H5B_class_t *type, uint8_t *lt_key, hbool_t *lt_key_changed, + uint8_t *md_key, void *udata, uint8_t *rt_key, hbool_t *rt_key_changed, + H5B_ins_ud_t *split_bt_ud/*out*/); static herr_t H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5B_ins_t anchor, const void *md_key); -static herr_t H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, - unsigned idx, void *udata, - H5B_ins_ud_t *split_bt_ud/*out*/); +static herr_t H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx, + void *udata, H5B_ins_ud_t *split_bt_ud/*out*/); static H5B_t * H5B__copy(const H5B_t *old_bt); @@ -216,8 +211,7 @@ H5FL_SEQ_DEFINE_STATIC(size_t); *------------------------------------------------------------------------- */ herr_t -H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, - haddr_t *addr_p/*out*/) +H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p/*out*/) { H5B_t *bt = NULL; H5B_shared_t *shared=NULL; /* Pointer to shared B-tree info */ @@ -250,23 +244,23 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, if(NULL == (bt->native = H5FL_BLK_MALLOC(native_block, shared->sizeof_keys)) || NULL == (bt->child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for B-tree root node") - if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)shared->sizeof_rnode))) + if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)shared->sizeof_rnode))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "file allocation failed for B-tree root node") /* * Cache the new B-tree node. */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree root node to cache") #ifdef H5B_DEBUG - H5B__assert(f, dxpl_id, *addr_p, shared->type, udata); + H5B__assert(f, *addr_p, shared->type, udata); #endif done: if(ret_value < 0) { if(shared && shared->sizeof_rnode>0) { H5_CHECK_OVERFLOW(shared->sizeof_rnode,size_t,hsize_t); - (void)H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, *addr_p, (hsize_t)shared->sizeof_rnode); + (void)H5MF_xfree(f, H5FD_MEM_BTREE, *addr_p, (hsize_t)shared->sizeof_rnode); } /* end if */ if(bt) /* Destroy B-tree node */ @@ -302,7 +296,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata) +H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) { H5B_t *bt = NULL; H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -337,7 +331,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") rt = bt->nchildren; @@ -359,16 +353,16 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u HDassert(idx < bt->nchildren); if(bt->level > 0) { - if((ret_value = H5B_find(f, dxpl_id, type, bt->child[idx], udata)) < 0) + if((ret_value = H5B_find(f, type, bt->child[idx], udata)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "can't lookup key in subtree") } /* end if */ else { - if((ret_value = (type->found)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt, shared, idx), udata)) < 0) + if((ret_value = (type->found)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), udata)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "can't lookup key in leaf node") } /* end else */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) @@ -398,10 +392,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, +H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx, void *udata, H5B_ins_ud_t *split_bt_ud/*out*/) { - H5P_genplist_t *dx_plist; /* Data transfer property list */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ unsigned nleft, nright; /* Number of keys in left & right halves */ @@ -427,12 +420,8 @@ H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, HDassert(shared); HDassert(bt_ud->bt->nchildren == shared->two_k); - /* Get the dataset transfer property list */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_BTREE, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - /* Get B-tree split ratios */ - if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &split_ratios[0]) < 0) + if(H5CX_get_btree_split_ratios(split_ratios) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree split ratios") #ifdef H5B_DEBUG @@ -481,12 +470,12 @@ H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, /* * Create the new B-tree node. */ - if(H5B_create(f, dxpl_id, shared->type, udata, &split_bt_ud->addr/*out*/) < 0) + if(H5B_create(f, shared->type, udata, &split_bt_ud->addr/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create B-tree") cache_udata.f = f; cache_udata.type = shared->type; cache_udata.rc_shared = bt_ud->bt->rc_shared; - if(NULL == (split_bt_ud->bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, split_bt_ud->addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (split_bt_ud->bt = (H5B_t *)H5AC_protect(f, H5AC_BT, split_bt_ud->addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree") split_bt_ud->bt->level = bt_ud->bt->level; @@ -519,12 +508,12 @@ H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, if(H5F_addr_defined(bt_ud->bt->right)) { H5B_t *tmp_bt; - if(NULL == (tmp_bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt_ud->bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (tmp_bt = (H5B_t *)H5AC_protect(f, H5AC_BT, bt_ud->bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load right sibling") tmp_bt->left = split_bt_ud->addr; - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt_ud->bt->right, tmp_bt, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt_ud->bt->right, tmp_bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } /* end if */ @@ -533,7 +522,7 @@ H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, done: if(ret_value < 0) { - if(split_bt_ud->bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, split_bt_ud->addr, split_bt_ud->bt, split_bt_ud->cache_flags) < 0) + if(split_bt_ud->bt && H5AC_unprotect(f, H5AC_BT, split_bt_ud->addr, split_bt_ud->bt, split_bt_ud->cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") split_bt_ud->bt = NULL; split_bt_ud->addr = HADDR_UNDEF; @@ -558,7 +547,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata) +H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) { /* * These are defined this way to satisfy alignment constraints. @@ -599,11 +588,11 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void cache_udata.type = type; cache_udata.rc_shared = rc_shared; bt_ud.addr = addr; - if(NULL == (bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (bt_ud.bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to locate root of B-tree") /* Insert the object */ - if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &bt_ud, type, lt_key, + if((int)(my_ins = H5B__insert_helper(f, &bt_ud, type, lt_key, <_key_changed, md_key, udata, rt_key, &rt_key_changed, &split_bt_ud/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to insert key") @@ -633,7 +622,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void * "moving". */ H5_CHECK_OVERFLOW(shared->sizeof_rnode,size_t,hsize_t); - if(HADDR_UNDEF == (old_root_addr = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)shared->sizeof_rnode))) + if(HADDR_UNDEF == (old_root_addr = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)shared->sizeof_rnode))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move root") /* @@ -646,12 +635,12 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void /* Unprotect the old root so we can move it. Also force it to be marked * dirty so it is written to the new location. */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt_ud.addr, bt_ud.bt, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt_ud.addr, bt_ud.bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release old root") bt_ud.bt = NULL; /* Make certain future references will be caught */ /* Move the location of the old root on the disk */ - if(H5AC_move_entry(f, H5AC_BT, bt_ud.addr, old_root_addr, dxpl_id) < 0) + if(H5AC_move_entry(f, H5AC_BT, bt_ud.addr, old_root_addr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node") bt_ud.addr = old_root_addr; @@ -675,7 +664,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HDmemcpy(H5B_NKEY(new_root_bt, shared, 2), rt_key, shared->type->sizeof_nkey); /* Insert the modified copy of the old root into the file again */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_BT, addr, new_root_bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_BT, addr, new_root_bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to add old B-tree root node to cache") done: @@ -684,16 +673,16 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, FAIL, "unable to free B-tree root node"); if(bt_ud.bt) - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt_ud.addr, bt_ud.bt, bt_ud.cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt_ud.addr, bt_ud.bt, bt_ud.cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to unprotect old root") if(split_bt_ud.bt) - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, split_bt_ud.addr, split_bt_ud.bt, split_bt_ud.cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_BT, split_bt_ud.addr, split_bt_ud.bt, split_bt_ud.cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to unprotect new child") #ifdef H5B_DEBUG if(ret_value >= 0) - H5B__assert(f, dxpl_id, addr, type, udata); + H5B__assert(f, addr, type, udata); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -805,12 +794,9 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, *------------------------------------------------------------------------- */ static H5B_ins_t -H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, - const H5B_class_t *type, - uint8_t *lt_key, hbool_t *lt_key_changed, - uint8_t *md_key, void *udata, - uint8_t *rt_key, hbool_t *rt_key_changed, - H5B_ins_ud_t *split_bt_ud/*out*/) +H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, + uint8_t *lt_key, hbool_t *lt_key_changed, uint8_t *md_key, void *udata, + uint8_t *rt_key, hbool_t *rt_key_changed, H5B_ins_ud_t *split_bt_ud/*out*/) { H5B_t *bt; /* Convenience pointer to B-tree */ H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -882,7 +868,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * must necessarily be at level zero. */ HDassert(0 == bt->level); - if((type->new_node)(f, dxpl_id, H5B_INS_FIRST, H5B_NKEY(bt, shared, 0), udata, + if((type->new_node)(f, H5B_INS_FIRST, H5B_NKEY(bt, shared, 0), udata, H5B_NKEY(bt, shared, 1), bt->child + 0/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, H5B_INS_ERROR, "unable to create leaf node") bt->nchildren = 1; @@ -890,7 +876,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, idx = 0; if(type->follow_min) { - if((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt, shared, idx), + if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud.addr/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "unable to insert first leaf node") @@ -904,10 +890,10 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * Follow the minimum branch out of this node to a subtree. */ child_bt_ud.addr = bt->child[idx]; - if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, &child_bt_ud, type, H5B_NKEY(bt,shared,idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) @@ -918,7 +904,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * current node. Follow the minimum branch to a leaf node and let * the subclass handle the problem. */ - if((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt, shared, idx), + if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud.addr/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert minimum leaf node") @@ -930,7 +916,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, */ my_ins = H5B_INS_LEFT; HDmemcpy(md_key, H5B_NKEY(bt,shared,idx), type->sizeof_nkey); - if((type->new_node)(f, dxpl_id, H5B_INS_LEFT, H5B_NKEY(bt, shared, idx), udata, + if((type->new_node)(f, H5B_INS_LEFT, H5B_NKEY(bt, shared, idx), udata, md_key, &new_child_bt_ud.addr/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert minimum leaf node") *lt_key_changed = TRUE; @@ -950,10 +936,10 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, */ idx = bt->nchildren - 1; child_bt_ud.addr = bt->child[idx]; - if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, &child_bt_ud, type, H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) @@ -965,7 +951,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * the subclass handle the problem. */ idx = bt->nchildren - 1; - if((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt, shared, idx), + if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud.addr/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert maximum leaf node") @@ -978,7 +964,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, idx = bt->nchildren - 1; my_ins = H5B_INS_RIGHT; HDmemcpy(md_key, H5B_NKEY(bt, shared, idx + 1), type->sizeof_nkey); - if((type->new_node)(f, dxpl_id, H5B_INS_RIGHT, md_key, udata, + if((type->new_node)(f, H5B_INS_RIGHT, md_key, udata, H5B_NKEY(bt, shared, idx + 1), &new_child_bt_ud.addr/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert maximum leaf node") *rt_key_changed = TRUE; @@ -1005,10 +991,10 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, */ HDassert(idx < bt->nchildren); child_bt_ud.addr = bt->child[idx]; - if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, &child_bt_ud, type, H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert subtree") @@ -1017,7 +1003,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * Follow a branch out of this node to a leaf node of some other type. */ HDassert(idx < bt->nchildren); - if((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt, shared, idx), + if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud.addr/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert leaf node") @@ -1068,7 +1054,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * If this node is full then split it before inserting the new child. */ if(bt->nchildren == shared->two_k) { - if(H5B__split(f, dxpl_id, bt_ud, idx, udata, split_bt_ud/*out*/) < 0) + if(H5B__split(f, bt_ud, idx, udata, split_bt_ud/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, H5B_INS_ERROR, "unable to split node") if(idx < bt->nchildren) { tmp_bt = bt; @@ -1111,11 +1097,11 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, done: if(child_bt_ud.bt) - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, child_bt_ud.bt, child_bt_ud.cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_BT, child_bt_ud.addr, child_bt_ud.bt, child_bt_ud.cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to unprotect child") if(new_child_bt_ud.bt) - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, new_child_bt_ud.addr, new_child_bt_ud.bt, new_child_bt_ud.cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_BT, new_child_bt_ud.addr, new_child_bt_ud.bt, new_child_bt_ud.cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to unprotect new child") FUNC_LEAVE_NOAPI(ret_value) @@ -1137,7 +1123,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B__iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B__iterate_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, void *udata) { H5B_t *bt = NULL; /* Pointer to current B-tree node */ @@ -1168,21 +1154,21 @@ H5B__iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load B-tree node") /* Iterate over node's children */ for(u = 0; u < bt->nchildren && ret_value == H5_ITER_CONT; u++) { if(bt->level > 0) - ret_value = H5B__iterate_helper(f, dxpl_id, type, bt->child[u], op, udata); + ret_value = H5B__iterate_helper(f, type, bt->child[u], op, udata); else - ret_value = (*op)(f, dxpl_id, H5B_NKEY(bt, shared, u), bt->child[u], H5B_NKEY(bt, shared, u + 1), udata); + ret_value = (*op)(f, H5B_NKEY(bt, shared, u), bt->child[u], H5B_NKEY(bt, shared, u + 1), udata); if(ret_value < 0) HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed"); } /* end for */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1204,7 +1190,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B_iterate(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, void *udata) { herr_t ret_value = FAIL; /* Return value */ @@ -1221,7 +1207,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, HDassert(udata); /* Iterate over the B-tree records */ - if((ret_value = H5B__iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) + if((ret_value = H5B__iterate_helper(f, type, addr, op, udata)) < 0) HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed"); FUNC_LEAVE_NOAPI(ret_value) @@ -1253,10 +1239,9 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, *------------------------------------------------------------------------- */ static H5B_ins_t -H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, - int level, uint8_t *lt_key/*out*/, - hbool_t *lt_key_changed/*out*/, void *udata, - uint8_t *rt_key/*out*/, hbool_t *rt_key_changed/*out*/) +H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, + uint8_t *lt_key/*out*/, hbool_t *lt_key_changed/*out*/, void *udata, + uint8_t *rt_key/*out*/, hbool_t *rt_key_changed/*out*/) { H5B_t *bt = NULL, *sibling = NULL; unsigned bt_flags = H5AC__NO_FLAGS_SET; @@ -1291,7 +1276,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load B-tree node") rt = bt->nchildren; @@ -1312,9 +1297,9 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ HDassert(idx < bt->nchildren); if(bt->level > 0) { /* We're at an internal node -- call recursively */ - if((int)(ret_value = H5B__remove_helper(f, dxpl_id, - bt->child[idx], type, level + 1, H5B_NKEY(bt, shared, idx)/*out*/, - lt_key_changed/*out*/, udata, H5B_NKEY(bt, shared, idx + 1)/*out*/, + if((int)(ret_value = H5B__remove_helper(f, bt->child[idx], type, + level + 1, H5B_NKEY(bt, shared, idx)/*out*/, + lt_key_changed/*out*/, udata, H5B_NKEY(bt, shared, idx + 1)/*out*/, rt_key_changed/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in subtree") } else if(type->remove) { @@ -1323,9 +1308,9 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ * has a removal method. Pass the removal request to the pointed-to * object and let it decide how to progress. */ - if((int)(ret_value = (type->remove)(f, dxpl_id, - bt->child[idx], H5B_NKEY(bt, shared, idx), lt_key_changed, udata, - H5B_NKEY(bt, shared, idx + 1), rt_key_changed)) < 0) + if((int)(ret_value = (type->remove)(f, bt->child[idx], + H5B_NKEY(bt, shared, idx), lt_key_changed, udata, + H5B_NKEY(bt, shared, idx + 1), rt_key_changed)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in leaf node") } else { /* @@ -1391,7 +1376,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ * "critical" for any child in its node to maintain this * consistency (and avoid breaking key/child consistency) */ if(H5F_addr_defined(bt->left)) { - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->left, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, H5AC_BT, bt->left, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node from tree") /* Copy right-most key from deleted node to right-most key @@ -1403,12 +1388,12 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ sibling->right = bt->right; - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end if */ if(H5F_addr_defined(bt->right)) { - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, H5AC_BT, bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to unlink node from tree") /* Copy left-most key from deleted node to left-most key in @@ -1420,7 +1405,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ sibling->left = bt->left; - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end if */ @@ -1433,7 +1418,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ /* Delete the node from disk (via the metadata cache) */ bt_flags |= H5AC__DIRTIED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; H5_CHECK_OVERFLOW(shared->sizeof_rnode, size_t, hsize_t); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags | H5AC__DELETED_FLAG) < 0) { + if(H5AC_unprotect(f, H5AC_BT, addr, bt, bt_flags | H5AC__DELETED_FLAG) < 0) { bt = NULL; bt_flags = H5AC__NO_FLAGS_SET; HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to free B-tree node") @@ -1528,13 +1513,13 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ HDassert(level > 0); /* Update the rightmost key in the left sibling */ - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->left, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, H5AC_BT, bt->left, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to protect node") HDmemcpy(H5B_NKEY(sibling, shared, sibling->nchildren), H5B_NKEY(bt, shared, 0), type->sizeof_nkey); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end if */ @@ -1543,19 +1528,19 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ HDassert(level > 0); /* Update the lefttmost key in the right sibling */ - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, H5AC_BT, bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to protect node") HDmemcpy(H5B_NKEY(sibling, shared, 0), H5B_NKEY(bt, shared, bt->nchildren), type->sizeof_nkey); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end else */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, bt_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) @@ -1579,7 +1564,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata) +H5B_remove(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) { /* These are defined this way to satisfy alignment constraints */ uint64_t _lt_key[128], _rt_key[128]; @@ -1598,16 +1583,15 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HDassert(H5F_addr_defined(addr)); /* The actual removal */ - if(H5B__remove_helper(f, dxpl_id, addr, type, 0, lt_key, <_key_changed, - udata, rt_key, &rt_key_changed) == H5B_INS_ERROR) + if(H5B_INS_ERROR == H5B__remove_helper(f, addr, type, 0, lt_key, <_key_changed, udata, rt_key, &rt_key_changed)) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to remove entry from B-tree") #ifdef H5B_DEBUG - H5B__assert(f, dxpl_id, addr, type, udata); + H5B__assert(f, addr, type, udata); #endif done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5B_remove() */ /*------------------------------------------------------------------------- @@ -1624,7 +1608,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata) +H5B_delete(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) { H5B_t *bt = NULL; /* B-tree node being operated on */ H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -1650,14 +1634,14 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") /* Iterate over all children in tree, deleting them */ if(bt->level > 0) { /* Iterate over all children in node, deleting them */ for(u = 0; u < bt->nchildren; u++) - if(H5B_delete(f, dxpl_id, type, bt->child[u], udata) < 0) + if(H5B_delete(f, type, bt->child[u], udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "unable to delete B-tree node") } /* end if */ @@ -1669,16 +1653,16 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void /* Iterate over all entries in node, calling callback */ for(u = 0; u < bt->nchildren; u++) { /* Call user's callback for each entry */ - if((type->remove)(f, dxpl_id, - bt->child[u], H5B_NKEY(bt, shared, u), <_key_changed, udata, - H5B_NKEY(bt, shared, u + 1), &rt_key_changed) < H5B_INS_NOOP) + if((type->remove)(f, bt->child[u], H5B_NKEY(bt, shared, u), + <_key_changed, udata, H5B_NKEY(bt, shared, u + 1), + &rt_key_changed) < H5B_INS_NOOP) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "can't remove B-tree node") } /* end for */ } /* end if */ } /* end else */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node in cache") FUNC_LEAVE_NOAPI(ret_value) @@ -1873,7 +1857,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B__get_info_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, const H5B_info_ud_t *info_udata) { H5B_t *bt = NULL; /* Pointer to current B-tree node */ @@ -1911,7 +1895,7 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") /* Cache information from this node */ @@ -1924,7 +1908,7 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a info_udata->bt_info->num_nodes++; /* Release current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") bt = NULL; @@ -1935,7 +1919,7 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a while(H5F_addr_defined(next_addr)) { /* Protect the next node to the right */ addr = next_addr; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "B-tree node") /* Cache information from this node */ @@ -1946,7 +1930,7 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a info_udata->bt_info->num_nodes++; /* Unprotect node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") bt = NULL; } /* end while */ @@ -1954,12 +1938,12 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a /* Check for another "row" of B-tree nodes to iterate over */ if(level > 0) { /* Keep following the left-most child until we reach a leaf node. */ - if(H5B__get_info_helper(f, dxpl_id, type, left_child, info_udata) < 0) + if(H5B__get_info_helper(f, type, left_child, info_udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "unable to list B-tree node") } /* end if */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1979,7 +1963,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_get_info(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B_get_info(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_info_t *bt_info, H5B_operator_t op, void *udata) { H5B_info_ud_t info_udata; /* User-data for B-tree size iteration */ @@ -2004,13 +1988,13 @@ H5B_get_info(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, info_udata.udata = udata; /* Iterate over the B-tree nodes */ - if(H5B__get_info_helper(f, dxpl_id, type, addr, &info_udata) < 0) + if(H5B__get_info_helper(f, type, addr, &info_udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_BADITER, FAIL, "B-tree iteration failed") /* Iterate over the B-tree records, making any "leaf" callbacks */ /* (Only if operator defined) */ if(op) - if((ret_value = H5B__iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) + if((ret_value = H5B__iterate_helper(f, type, addr, op, udata)) < 0) HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed"); done: @@ -2031,7 +2015,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr) +H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr) { H5B_t *bt = NULL; /* The B-tree */ H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -2062,12 +2046,12 @@ H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr) cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree node") done: /* Release the node */ - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2.c b/src/H5B2.c index 7e679cd..1f964b8 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -135,7 +135,7 @@ H5FL_DEFINE_STATIC(H5B2_t); *------------------------------------------------------------------------- */ H5B2_t * -H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udata) +H5B2_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata) { H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ @@ -154,7 +154,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat HDcompile_assert(H5B2_NUM_BTREE_ID == NELMTS(H5B2_client_class_g)); /* Create shared v2 B-tree header */ - if(HADDR_UNDEF == (hdr_addr = H5B2__hdr_create(f, dxpl_id, cparam, ctx_udata))) + if(HADDR_UNDEF == (hdr_addr = H5B2__hdr_create(f, cparam, ctx_udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't create v2 B-tree header") /* Create v2 B-tree wrapper */ @@ -162,7 +162,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for v2 B-tree info") /* Look up the B-tree header */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, hdr_addr, ctx_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5B2__hdr_protect(f, hdr_addr, ctx_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to protect v2 B-tree header") /* Point v2 B-tree wrapper at header and bump it's ref count */ @@ -181,10 +181,10 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat ret_value = bt2; done: - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, NULL, "unable to release v2 B-tree header") if(!ret_value && bt2) - if(H5B2_close(bt2, dxpl_id) < 0) + if(H5B2_close(bt2) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, NULL, "unable to close v2 B-tree") FUNC_LEAVE_NOAPI(ret_value) @@ -206,7 +206,7 @@ done: *------------------------------------------------------------------------- */ H5B2_t * -H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata) +H5B2_open(H5F_t *f, haddr_t addr, void *ctx_udata) { H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ @@ -219,7 +219,7 @@ H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata) HDassert(H5F_addr_defined(addr)); /* Look up the B-tree header */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, addr, ctx_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5B2__hdr_protect(f, addr, ctx_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to protect v2 B-tree header") /* Check for pending heap deletion */ @@ -246,10 +246,10 @@ H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata) ret_value = bt2; done: - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, NULL, "unable to release v2 B-tree header") if(!ret_value && bt2) - if(H5B2_close(bt2, dxpl_id) < 0) + if(H5B2_close(bt2) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, NULL, "unable to close v2 B-tree") FUNC_LEAVE_NOAPI(ret_value) @@ -270,7 +270,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata) +H5B2_insert(H5B2_t *bt2, void *udata) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -288,7 +288,7 @@ H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata) hdr = bt2->hdr; /* Insert the record */ - if(H5B2__insert(hdr, dxpl_id, udata) < 0) + if(H5B2__insert(hdr, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree") done: @@ -313,7 +313,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_update(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, void *op_data) +H5B2_update(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_update_status_t status = H5B2_UPDATE_UNKNOWN; /* Whether the record was inserted/modified */ @@ -334,17 +334,17 @@ H5B2_update(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, void *op_ /* Check if the root node is allocated yet */ if(!H5F_addr_defined(hdr->root.addr)) { /* Create root node as leaf node in B-tree */ - if(H5B2__create_leaf(hdr, dxpl_id, hdr, &(hdr->root)) < 0) + if(H5B2__create_leaf(hdr, hdr, &(hdr->root)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create root node") } /* end if */ /* Attempt to insert record into B-tree */ if(hdr->depth > 0) { - if(H5B2__update_internal(hdr, dxpl_id, hdr->depth, NULL, &hdr->root, &status, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) + if(H5B2__update_internal(hdr, hdr->depth, NULL, &hdr->root, &status, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update record in B-tree internal node") } /* end if */ else { - if(H5B2__update_leaf(hdr, dxpl_id, &hdr->root, &status, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) + if(H5B2__update_leaf(hdr, &hdr->root, &status, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update record in B-tree leaf node") } /* end else */ @@ -353,7 +353,7 @@ H5B2_update(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, void *op_ /* Use insert algorithm if nodes to leaf full */ if(H5B2_UPDATE_INSERT_CHILD_FULL == status) { - if(H5B2__insert(hdr, dxpl_id, udata) < 0) + if(H5B2__insert(hdr, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree") } /* end if */ else if(H5B2_UPDATE_SHADOW_DONE == status || H5B2_UPDATE_INSERT_DONE == status) { @@ -420,7 +420,7 @@ H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr_p) *------------------------------------------------------------------------- */ herr_t -H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data) +H5B2_iterate(H5B2_t *bt2, H5B2_operator_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -438,11 +438,10 @@ H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data) hdr = bt2->hdr; /* Iterate through records */ - if(hdr->root.node_nrec > 0) { + if(hdr->root.node_nrec > 0) /* Iterate through nodes */ - if((ret_value = H5B2__iterate_node(hdr, dxpl_id, hdr->depth, &hdr->root, hdr, op, op_data)) < 0) + if((ret_value = H5B2__iterate_node(hdr, hdr->depth, &hdr->root, hdr, op, op_data)) < 0) HERROR(H5E_BTREE, H5E_CANTLIST, "node iteration failed"); - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_iterate() */ @@ -472,8 +471,7 @@ H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data) *------------------------------------------------------------------------- */ htri_t -H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, - void *op_data) +H5B2_find(H5B2_t *bt2, void *udata, H5B2_found_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ @@ -543,7 +541,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Unpin parent if necessary */ @@ -556,7 +554,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, /* Locate node pointer for child */ if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx, &cmp) < 0) { /* Unlock current node before failing */ - H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET); + H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET); HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ @@ -585,7 +583,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Keep track of parent if necessary */ @@ -599,14 +597,14 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, /* Make callback for current record */ if(op && (op)(H5B2_INT_NREC(internal, hdr, idx), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Indicate record found */ @@ -621,7 +619,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Unpin parent if necessary */ @@ -634,13 +632,13 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, /* Locate record */ if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0) { /* Unlock current node before failing */ - H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET); + H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET); HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ if(cmp != 0) { /* Unlock leaf node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Record not found */ @@ -650,7 +648,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, /* Make callback for current record */ if(op && (op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") @@ -679,7 +677,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, } /* end else */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } /* end block */ @@ -713,8 +711,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, - H5B2_found_t op, void *op_data) +H5B2_index(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, + void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ @@ -763,7 +761,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, unsigned u; /* Local index variable */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Unpin parent if necessary */ @@ -781,7 +779,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, next_node_ptr = internal->node_ptrs[u]; /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Keep track of parent if necessary */ @@ -800,14 +798,14 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, /* Make callback for current record */ if((op)(H5B2_INT_NREC(internal, hdr, u), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_DONE(SUCCEED); @@ -827,7 +825,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, next_node_ptr = internal->node_ptrs[u]; /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Keep track of parent if necessary */ @@ -850,7 +848,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Unpin parent if necessary */ @@ -866,14 +864,14 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, /* Make callback for correct record */ if((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } /* end block */ @@ -902,8 +900,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, - void *op_data) +H5B2_remove(H5B2_t *bt2, void *udata, H5B2_remove_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -927,7 +924,7 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, if(hdr->depth > 0) { hbool_t depth_decreased = FALSE; /* Flag to indicate whether the depth of the B-tree decreased */ - if(H5B2__remove_internal(hdr, dxpl_id, &depth_decreased, NULL, NULL, + if(H5B2__remove_internal(hdr, &depth_decreased, NULL, NULL, hdr->depth, &(hdr->cache_info), NULL, H5B2_POS_ROOT, &hdr->root, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") @@ -947,7 +944,7 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, } /* end for */ } /* end if */ else { - if(H5B2__remove_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) + if(H5B2__remove_leaf(hdr, &hdr->root, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -977,8 +974,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, - hsize_t idx, H5B2_remove_t op, void *op_data) +H5B2_remove_by_idx(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, + H5B2_remove_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1010,7 +1007,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, if(hdr->depth > 0) { hbool_t depth_decreased = FALSE; /* Flag to indicate whether the depth of the B-tree decreased */ - if(H5B2__remove_internal_by_idx(hdr, dxpl_id, &depth_decreased, NULL, NULL, + if(H5B2__remove_internal_by_idx(hdr, &depth_decreased, NULL, NULL, hdr->depth, &(hdr->cache_info), NULL, &hdr->root, H5B2_POS_ROOT, idx, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") @@ -1030,7 +1027,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, } /* end for */ } /* end if */ else { - if(H5B2__remove_leaf_by_idx(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, hdr, (unsigned)idx, op, op_data) < 0) + if(H5B2__remove_leaf_by_idx(hdr, &hdr->root, H5B2_POS_ROOT, hdr, (unsigned)idx, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -1101,7 +1098,7 @@ H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec) *------------------------------------------------------------------------- */ herr_t -H5B2_neighbor(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, void *udata, +H5B2_neighbor(H5B2_t *bt2, H5B2_compare_t range, void *udata, H5B2_found_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ @@ -1125,11 +1122,11 @@ H5B2_neighbor(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, void *udata, /* Attempt to find neighbor record in B-tree */ if(hdr->depth > 0) { - if(H5B2__neighbor_internal(hdr, dxpl_id, hdr->depth, &hdr->root, NULL, range, hdr, udata, op, op_data) < 0) + if(H5B2__neighbor_internal(hdr, hdr->depth, &hdr->root, NULL, range, hdr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree internal node") } /* end if */ else { - if(H5B2__neighbor_leaf(hdr, dxpl_id, &hdr->root, NULL, range, hdr, udata, op, op_data) < 0) + if(H5B2__neighbor_leaf(hdr, &hdr->root, NULL, range, hdr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree leaf node") } /* end else */ @@ -1159,8 +1156,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, - void *op_data) +H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ @@ -1206,7 +1202,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, &curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Unpin parent if necessary */ @@ -1219,7 +1215,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, /* Locate node pointer for child */ if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx, &cmp) < 0) { /* Unlock current node before failing */ - H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET); + H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET); HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ @@ -1249,7 +1245,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Keep track of parent if necessary */ @@ -1268,7 +1264,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, HDassert(changed == FALSE); /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree find operation") @@ -1278,7 +1274,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, internal_flags |= changed ? H5AC__DIRTIED_FLAG : 0; /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, internal_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, internal_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_DONE(SUCCEED); @@ -1294,7 +1290,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, hbool_t changed = FALSE;/* Whether the 'modify' callback changed the record */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, &curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Unpin parent if necessary */ @@ -1307,13 +1303,13 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, /* Locate record */ if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0) { /* Unlock current node before failing */ - H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET); + H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET); HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ if(cmp != 0) { /* Unlock leaf node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Note: don't push error on stack, leave that to next higher level, @@ -1333,7 +1329,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, HDassert(changed == FALSE); /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree find operation") @@ -1365,7 +1361,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, leaf_flags |= (changed ? H5AC__DIRTIED_FLAG : 0); /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, leaf_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, leaf_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } /* end block */ @@ -1394,7 +1390,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_close(H5B2_t *bt2, hid_t dxpl_id) +H5B2_close(H5B2_t *bt2) { haddr_t bt2_addr = HADDR_UNDEF; /* Address of v2 B-tree (for deletion) */ hbool_t pending_delete = FALSE; /* Whether the v2 B-tree is pending deletion */ @@ -1445,7 +1441,7 @@ H5B2_close(H5B2_t *bt2, hid_t dxpl_id) /* Lock the v2 B-tree header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ - if(NULL == (hdr = H5B2__hdr_protect(bt2->f, dxpl_id, bt2_addr, NULL, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5B2__hdr_protect(bt2->f, bt2_addr, NULL, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header") /* Set the shared v2 B-tree header's file context for this operation */ @@ -1459,7 +1455,7 @@ H5B2_close(H5B2_t *bt2, hid_t dxpl_id) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEC, FAIL, "can't decrement reference count on shared v2 B-tree header") /* Delete v2 B-tree, starting with header (unprotects header) */ - if(H5B2__hdr_delete(hdr, dxpl_id) < 0) + if(H5B2__hdr_delete(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree") } /* end if */ else { @@ -1503,8 +1499,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata, - H5B2_remove_t op, void *op_data) +H5B2_delete(H5F_t *f, haddr_t addr, void *ctx_udata, H5B2_remove_t op, + void *op_data) { H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1519,7 +1515,7 @@ H5B2_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata, #ifdef QAK HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); #endif /* QAK */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, addr, ctx_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5B2__hdr_protect(f, addr, ctx_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header") /* Remember the callback & context for later */ @@ -1534,14 +1530,14 @@ HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); hdr->f = f; /* Delete v2 B-tree now, starting with header (unprotects header) */ - if(H5B2__hdr_delete(hdr, dxpl_id) < 0) + if(H5B2__hdr_delete(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree") hdr = NULL; } /* end if */ done: /* Unprotect the header, if an error occurred */ - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release v2 B-tree header") FUNC_LEAVE_NOAPI(ret_value) @@ -1562,7 +1558,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_depend(H5B2_t *bt2, hid_t dxpl_id, H5AC_proxy_entry_t *parent) +H5B2_depend(H5B2_t *bt2, H5AC_proxy_entry_t *parent) { /* Local variables */ H5B2_hdr_t *hdr = bt2->hdr; /* Header for B-tree */ @@ -1591,7 +1587,7 @@ H5B2_depend(H5B2_t *bt2, hid_t dxpl_id, H5AC_proxy_entry_t *parent) hdr->f = bt2->f; /* Add the v2 B-tree as a child of the parent (proxy) */ - if(H5AC_proxy_entry_add_child(parent, hdr->f, dxpl_id, hdr->top_proxy) < 0) + if(H5AC_proxy_entry_add_child(parent, hdr->f, hdr->top_proxy) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, FAIL, "unable to add v2 B-tree as child of proxy") hdr->parent = parent; } /* end if */ diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index 3890ae0..dc079f1 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -86,7 +86,7 @@ *------------------------------------------------------------------------- */ herr_t -H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, +H5B2__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header info */ @@ -108,7 +108,7 @@ H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(type); /* Load the B-tree header */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5B2__hdr_protect(f, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header") /* Set file pointer for this B-tree operation */ @@ -160,7 +160,7 @@ H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end for */ done: - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release v2 B-tree header") FUNC_LEAVE_NOAPI(ret_value) @@ -181,7 +181,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, +H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, unsigned depth, haddr_t obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header */ @@ -207,7 +207,7 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(nrec > 0); /* Load the B-tree header */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, hdr_addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5B2__hdr_protect(f, hdr_addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load v2 B-tree header") /* Set file pointer for this B-tree operation */ @@ -219,7 +219,7 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, H5_CHECK_OVERFLOW(depth, unsigned, uint16_t); node_ptr.addr = addr; H5_CHECKED_ASSIGN(node_ptr.node_nrec, unsigned, nrec, uint16_t) - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, NULL, &node_ptr, (uint16_t)depth, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (internal = H5B2__protect_internal(hdr, NULL, &node_ptr, (uint16_t)depth, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node") /* Print opening message */ @@ -270,9 +270,9 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, internal->node_ptrs[u].addr); done: - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release v2 B-tree header") - if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(internal && H5AC_unprotect(f, H5AC_BT2_INT, addr, internal, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree internal node") FUNC_LEAVE_NOAPI(ret_value) @@ -293,7 +293,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, +H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, haddr_t obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header */ @@ -319,7 +319,7 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent HDassert(nrec > 0); /* Load the B-tree header */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, hdr_addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5B2__hdr_protect(f, hdr_addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header") /* Set file pointer for this B-tree operation */ @@ -331,7 +331,7 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent H5_CHECK_OVERFLOW(nrec, unsigned, uint16_t); node_ptr.addr = addr; H5_CHECKED_ASSIGN(node_ptr.node_nrec, unsigned, nrec, uint16_t) - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, NULL, &node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, NULL, &node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Print opening message */ @@ -366,9 +366,9 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent } /* end for */ done: - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header") - if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(leaf && H5AC_unprotect(f, H5AC_BT2_LEAF, addr, leaf, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index ab017c6..e9b6810 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -282,8 +282,7 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, - void *ctx_udata) +H5B2__hdr_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata) { H5B2_hdr_t *hdr = NULL; /* The new v2 B-tree header information */ hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ @@ -306,7 +305,7 @@ H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, HADDR_UNDEF, "can't create shared B-tree info") /* Allocate space for the header on disk */ - if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->hdr_size))) + if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)hdr->hdr_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "file allocation failed for B-tree header") /* Create 'top' proxy for extensible array entries */ @@ -315,13 +314,13 @@ H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, HGOTO_ERROR(H5E_BTREE, H5E_CANTCREATE, HADDR_UNDEF, "can't create v2 B-tree proxy") /* Cache the new B-tree node */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_BT2_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_BT2_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, HADDR_UNDEF, "can't add B-tree header to cache") inserted = TRUE; /* Add header as child of 'top' proxy */ if(hdr->top_proxy) - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, HADDR_UNDEF, "unable to add v2 B-tree header as child of array proxy") /* Set address of v2 B-tree header to return */ @@ -336,7 +335,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTREMOVE, HADDR_UNDEF, "unable to remove v2 B-tree header from cache") /* Release header's disk space */ - if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, hdr->addr, (hsize_t)hdr->hdr_size) < 0) + if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_BTREE, hdr->addr, (hsize_t)hdr->hdr_size) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, HADDR_UNDEF, "unable to free v2 B-tree header") /* Destroy header */ @@ -524,7 +523,7 @@ done: *------------------------------------------------------------------------- */ H5B2_hdr_t * -H5B2__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t hdr_addr, void *ctx_udata, +H5B2__hdr_protect(H5F_t *f, haddr_t hdr_addr, void *ctx_udata, unsigned flags) { H5B2_hdr_cache_ud_t udata; /* User data for cache callbacks */ @@ -546,7 +545,7 @@ H5B2__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t hdr_addr, void *ctx_udata, udata.ctx_udata = ctx_udata; /* Protect the header */ - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, &udata, flags))) + if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, H5AC_BT2_HDR, hdr_addr, &udata, flags))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to load v2 B-tree header, address = %llu", (unsigned long long)hdr_addr) hdr->f = f; /* (Must be set again here, in case the header was already in the cache -QAK) */ @@ -557,7 +556,7 @@ H5B2__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t hdr_addr, void *ctx_udata, HGOTO_ERROR(H5E_BTREE, H5E_CANTCREATE, NULL, "can't create v2 B-tree proxy") /* Add header as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, NULL, "unable to add v2 B-tree header as child of proxy") } /* end if */ @@ -568,7 +567,7 @@ done: /* Clean up on error */ if(!ret_value) { /* Release the header, if it was protected */ - if(hdr && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(hdr->f, H5AC_BT2_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, NULL, "unable to unprotect v2 B-tree header, address = %llu", (unsigned long long)hdr_addr) } /* end if */ @@ -590,7 +589,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__hdr_unprotect(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags) +H5B2__hdr_unprotect(H5B2_hdr_t *hdr, unsigned cache_flags) { herr_t ret_value = SUCCEED; /* Return value */ @@ -600,7 +599,7 @@ H5B2__hdr_unprotect(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags) HDassert(hdr); /* Unprotect the header */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_HDR, hdr->addr, hdr, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_HDR, hdr->addr, hdr, cache_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to unprotect v2 B-tree header, address = %llu", (unsigned long long)hdr->addr) done: @@ -699,7 +698,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) +H5B2__hdr_delete(H5B2_hdr_t *hdr) { unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting v2 B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -725,7 +724,7 @@ H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) /* Delete all nodes in B-tree */ if(H5F_addr_defined(hdr->root.addr)) - if(H5B2__delete_node(hdr, dxpl_id, hdr->depth, &hdr->root, hdr, hdr->remove_op, hdr->remove_op_data) < 0) + if(H5B2__delete_node(hdr, hdr->depth, &hdr->root, hdr, hdr->remove_op, hdr->remove_op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete B-tree nodes") /* Indicate that the heap header should be deleted & file space freed */ @@ -733,7 +732,7 @@ H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) done: /* Unprotect the header with appropriate flags */ - if(H5B2__hdr_unprotect(hdr, dxpl_id, cache_flags) < 0) + if(H5B2__hdr_unprotect(hdr, cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release v2 B-tree header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2int.c b/src/H5B2int.c index c72bc98..b3f855f 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -56,7 +56,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, unsigned depth, const H5B2_node_ptr_t *node_ptrs, unsigned start_idx, unsigned end_idx, void *old_parent, void *new_parent); @@ -146,9 +146,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) +H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ @@ -180,7 +180,7 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Create new internal node */ internal->node_ptrs[idx + 1].all_nrec = internal->node_ptrs[idx + 1].node_nrec = 0; - if(H5B2__create_internal(hdr, dxpl_id, internal, &(internal->node_ptrs[idx + 1]), (uint16_t)(depth - 1)) < 0) + if(H5B2__create_internal(hdr, internal, &(internal->node_ptrs[idx + 1]), (uint16_t)(depth - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create new internal node") /* Setup information for unlocking child nodes */ @@ -188,10 +188,10 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Protect both leaves */ /* (Shadow left node if doing SWMR writes) */ - if(NULL == (left_int = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_int = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_int = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_int = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -210,7 +210,7 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Create new leaf node */ internal->node_ptrs[idx + 1].all_nrec = internal->node_ptrs[idx + 1].node_nrec = 0; - if(H5B2__create_leaf(hdr, dxpl_id, internal, &(internal->node_ptrs[idx + 1])) < 0) + if(H5B2__create_leaf(hdr, internal, &(internal->node_ptrs[idx + 1])) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create new leaf node") /* Setup information for unlocking child nodes */ @@ -218,10 +218,10 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Protect both leaves */ /* (Shadow the left node if doing SWMR writes) */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -299,7 +299,7 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, right_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, right_node_ptrs, 0, (unsigned)(*right_nrec + 1), left_child, right_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -317,9 +317,9 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Release child nodes (marked as dirty) */ - if(left_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, left_addr, left_child, left_child_flags) < 0) + if(left_child && H5AC_unprotect(hdr->f, child_class, left_addr, left_child, left_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node") - if(right_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, right_addr, right_child, right_child_flags) < 0) + if(right_child && H5AC_unprotect(hdr->f, child_class, right_addr, right_child, right_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) @@ -341,7 +341,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) +H5B2__split_root(H5B2_hdr_t *hdr) { H5B2_internal_t *new_root = NULL; /* Pointer to new root node */ unsigned new_root_flags = H5AC__NO_FLAGS_SET; /* Cache flags for new root node */ @@ -381,23 +381,23 @@ H5B2__split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) /* Create new internal node to use as root */ hdr->root.node_nrec = 0; - if(H5B2__create_internal(hdr, dxpl_id, hdr, &(hdr->root), hdr->depth) < 0) + if(H5B2__create_internal(hdr, hdr, &(hdr->root), hdr->depth) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create new internal node") /* Protect new root node */ - if(NULL == (new_root = H5B2__protect_internal(hdr, dxpl_id, hdr, &hdr->root, hdr->depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (new_root = H5B2__protect_internal(hdr, hdr, &hdr->root, hdr->depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set first node pointer in root node to old root node pointer info */ new_root->node_ptrs[0] = old_root_ptr; /* Split original root node */ - if(H5B2__split1(hdr, dxpl_id, hdr->depth, &(hdr->root), NULL, new_root, &new_root_flags, 0) < 0) + if(H5B2__split1(hdr, hdr->depth, &(hdr->root), NULL, new_root, &new_root_flags, 0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split old root node") done: /* Release new root node (marked as dirty) */ - if(new_root && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, hdr->root.addr, new_root, new_root_flags) < 0) + if(new_root && H5AC_unprotect(hdr->f, H5AC_BT2_INT, hdr->root.addr, new_root, new_root_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree internal node") FUNC_LEAVE_NOAPI(ret_value) @@ -419,8 +419,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_internal_t *internal, unsigned idx) +H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, + unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ @@ -448,10 +448,10 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock left & right B-tree child nodes */ /* (Shadow both nodes if doing SWMR writes) */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -474,10 +474,10 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock left & right B-tree child nodes */ /* (Shadow both nodes if doing SWMR writes) */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -542,7 +542,7 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, left_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, left_node_ptrs, (unsigned)(*left_nrec + 1), (unsigned)(*left_nrec + move_nrec + 1), right_child, left_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -598,7 +598,7 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, right_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, right_node_ptrs, 0, (unsigned)move_nrec, left_child, right_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -639,9 +639,9 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Release child nodes (marked as dirty) */ - if(left_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, left_addr, left_child, left_child_flags) < 0) + if(left_child && H5AC_unprotect(hdr->f, child_class, left_addr, left_child, left_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(right_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, right_addr, right_child, right_child_flags) < 0) + if(right_child && H5AC_unprotect(hdr->f, child_class, right_addr, right_child, right_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) @@ -663,8 +663,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) +H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx) { H5B2_node_ptr_t *left_node_ptrs = NULL, *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ H5B2_node_ptr_t *middle_node_ptrs = NULL; /* Pointers to childs' node pointer info */ @@ -701,13 +701,13 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock B-tree child nodes */ /* (Shadow all nodes if doing SWMR writes) */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx - 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx - 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") left_addr = internal->node_ptrs[idx - 1].addr; - if(NULL == (middle_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (middle_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") middle_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -735,13 +735,13 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock B-tree child nodes */ /* (Shadow all nodes if doing SWMR writes) */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx - 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx - 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx - 1].addr; - if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") middle_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -812,7 +812,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, left_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, left_node_ptrs, (unsigned)(*left_nrec + 1), (unsigned)(*left_nrec + moved_middle_nrec + 1), middle_child, left_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -861,7 +861,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, right_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, right_node_ptrs, 0, (unsigned)right_nrec_move, middle_child, right_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -910,7 +910,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, middle_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, middle_node_ptrs, 0, (unsigned)left_nrec_move, left_child, middle_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -958,7 +958,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, middle_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, middle_node_ptrs, (unsigned)(curr_middle_nrec + 1), (unsigned)(curr_middle_nrec + right_nrec_move + 1), right_child, middle_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -1010,11 +1010,11 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Unlock child nodes (marked as dirty) */ - if(left_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, left_addr, left_child, left_child_flags) < 0) + if(left_child && H5AC_unprotect(hdr->f, child_class, left_addr, left_child, left_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(middle_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, middle_addr, middle_child, middle_child_flags) < 0) + if(middle_child && H5AC_unprotect(hdr->f, child_class, middle_addr, middle_child, middle_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(right_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, right_addr, right_child, right_child_flags) < 0) + if(right_child && H5AC_unprotect(hdr->f, child_class, right_addr, right_child, right_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) @@ -1037,9 +1037,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) +H5B2__merge2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ @@ -1068,10 +1068,10 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock left & right B-tree child nodes */ /* (Shadow the left node if doing SWMR writes) */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -1094,10 +1094,10 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock left & right B-tree child nodes */ /* (Shadow the left node if doing SWMR writes) */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -1124,7 +1124,7 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, left_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, left_node_ptrs, (unsigned)(*left_nrec + 1), (unsigned)(*left_nrec + *right_nrec + 2), right_child, left_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -1173,11 +1173,11 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Unlock left node (marked as dirty) */ - if(left_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, left_addr, left_child, left_child_flags) < 0) + if(left_child && H5AC_unprotect(hdr->f, child_class, left_addr, left_child, left_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") /* Delete right node & remove from cache (marked as dirty) */ - if(right_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, right_addr, right_child, right_child_flags) < 0) + if(right_child && H5AC_unprotect(hdr->f, child_class, right_addr, right_child, right_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) @@ -1200,9 +1200,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) +H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ @@ -1239,13 +1239,13 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock B-tree child nodes */ /* (Shadow left and middle nodes if doing SWMR writes) */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx - 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx - 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") left_addr = internal->node_ptrs[idx - 1].addr; - if(NULL == (middle_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (middle_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") middle_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -1273,13 +1273,13 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock B-tree child nodes */ /* (Shadow left and middle nodes if doing SWMR writes) */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx - 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx - 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx - 1].addr; - if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") middle_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -1332,7 +1332,7 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, left_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, left_node_ptrs, (unsigned)(*left_nrec + 1), (unsigned)(*left_nrec + middle_nrec_move + 1), middle_child, left_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -1360,7 +1360,7 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, middle_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, middle_node_ptrs, (unsigned)(*middle_nrec + 1), (unsigned)(*middle_nrec + *right_nrec + 2), right_child, middle_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -1415,13 +1415,13 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Unlock left & middle nodes (marked as dirty) */ - if(left_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, left_addr, left_child, left_child_flags) < 0) + if(left_child && H5AC_unprotect(hdr->f, child_class, left_addr, left_child, left_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(middle_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, middle_addr, middle_child, middle_child_flags) < 0) + if(middle_child && H5AC_unprotect(hdr->f, child_class, middle_addr, middle_child, middle_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") /* Delete right node & remove from cache (marked as dirty) */ - if(right_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, right_addr, right_child, right_child_flags) < 0) + if(right_child && H5AC_unprotect(hdr->f, child_class, right_addr, right_child, right_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) @@ -1442,7 +1442,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__insert(H5B2_hdr_t *hdr, hid_t dxpl_id, void *udata) +H5B2__insert(H5B2_hdr_t *hdr, void *udata) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1455,23 +1455,23 @@ H5B2__insert(H5B2_hdr_t *hdr, hid_t dxpl_id, void *udata) /* Check if the root node is allocated yet */ if(!H5F_addr_defined(hdr->root.addr)) { /* Create root node as leaf node in B-tree */ - if(H5B2__create_leaf(hdr, dxpl_id, hdr, &(hdr->root)) < 0) + if(H5B2__create_leaf(hdr, hdr, &(hdr->root)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create root node") } /* end if */ /* Check if we need to split the root node (equiv. to a 1->2 node split) */ else if(hdr->root.node_nrec == hdr->node_info[hdr->depth].split_nrec) { /* Split root node */ - if(H5B2__split_root(hdr, dxpl_id) < 0) + if(H5B2__split_root(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split root node") } /* end if */ /* Attempt to insert record into B-tree */ if(hdr->depth > 0) { - if(H5B2__insert_internal(hdr, dxpl_id, hdr->depth, NULL, &hdr->root, H5B2_POS_ROOT, hdr, udata) < 0) + if(H5B2__insert_internal(hdr, hdr->depth, NULL, &hdr->root, H5B2_POS_ROOT, hdr, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree internal node") } /* end if */ else { - if(H5B2__insert_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, hdr, udata) < 0) + if(H5B2__insert_leaf(hdr, &hdr->root, H5B2_POS_ROOT, hdr, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree leaf node") } /* end else */ @@ -1502,9 +1502,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - const H5B2_node_ptr_t *curr_node, void *parent, H5B2_operator_t op, - void *op_data) +H5B2__iterate_node(H5B2_hdr_t *hdr, uint16_t depth, const H5B2_node_ptr_t *curr_node, + void *parent, H5B2_operator_t op, void *op_data) { const H5AC_class_t *curr_node_class = NULL; /* Pointer to current node's class info */ void *node = NULL; /* Pointers to current node */ @@ -1527,7 +1526,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_internal_t *internal; /* Pointer to internal node */ /* Lock the current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ + if(NULL == (internal = H5B2__protect_internal(hdr, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set up information about current node */ @@ -1546,7 +1545,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_leaf_t *leaf; /* Pointer to leaf node */ /* Lock the current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, (H5B2_node_ptr_t *)curr_node, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, (H5B2_node_ptr_t *)curr_node, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Set up information about current node */ @@ -1563,7 +1562,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDmemcpy(native, node_native, (hdr->cls->nrec_size * curr_node->node_nrec)); /* Unlock the node */ - if(H5AC_unprotect(hdr->f, dxpl_id, curr_node_class, curr_node->addr, node, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, curr_node_class, curr_node->addr, node, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") if(hdr->swmr_write) node_pinned = TRUE; @@ -1574,7 +1573,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, for(u = 0; u < curr_node->node_nrec && !ret_value; u++) { /* Descend into child node, if current node is an internal node */ if(depth > 0) { - if((ret_value = H5B2__iterate_node(hdr, dxpl_id, (uint16_t)(depth - 1), &(node_ptrs[u]), node, op, op_data)) < 0) + if((ret_value = H5B2__iterate_node(hdr, (uint16_t)(depth - 1), &(node_ptrs[u]), node, op, op_data)) < 0) HERROR(H5E_BTREE, H5E_CANTLIST, "node iteration failed"); } /* end if */ @@ -1587,7 +1586,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Descend into last child node, if current node is an internal node */ if(!ret_value && depth > 0) { - if((ret_value = H5B2__iterate_node(hdr, dxpl_id, (uint16_t)(depth - 1), &(node_ptrs[u]), node, op, op_data)) < 0) + if((ret_value = H5B2__iterate_node(hdr, (uint16_t)(depth - 1), &(node_ptrs[u]), node, op, op_data)) < 0) HERROR(H5E_BTREE, H5E_CANTLIST, "node iteration failed"); } /* end if */ @@ -1621,9 +1620,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - const H5B2_node_ptr_t *curr_node, void *parent, H5B2_remove_t op, - void *op_data) +H5B2__delete_node(H5B2_hdr_t *hdr, uint16_t depth, const H5B2_node_ptr_t *curr_node, + void *parent, H5B2_remove_t op, void *op_data) { const H5AC_class_t *curr_node_class = NULL; /* Pointer to current node's class info */ void *node = NULL; /* Pointers to current node */ @@ -1641,7 +1639,7 @@ H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, unsigned u; /* Local index */ /* Lock the current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ + if(NULL == (internal = H5B2__protect_internal(hdr, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set up information about current node */ @@ -1651,14 +1649,14 @@ H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Descend into children */ for(u = 0; u < internal->nrec + (unsigned)1; u++) - if(H5B2__delete_node(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[u]), internal, op, op_data) < 0) + if(H5B2__delete_node(hdr, (uint16_t)(depth - 1), &(internal->node_ptrs[u]), internal, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node descent failed") } /* end if */ else { H5B2_leaf_t *leaf; /* Pointer to leaf node */ /* Lock the current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, (H5B2_node_ptr_t *)curr_node, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, (H5B2_node_ptr_t *)curr_node, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Set up information about current node */ @@ -1681,7 +1679,7 @@ H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Unlock & delete current node */ - if(node && H5AC_unprotect(hdr->f, dxpl_id, curr_node_class, curr_node->addr, node, (unsigned)(H5AC__DELETED_FLAG | (hdr->swmr_write ? 0 : H5AC__FREE_FILE_SPACE_FLAG))) < 0) + if(node && H5AC_unprotect(hdr->f, curr_node_class, curr_node->addr, node, (unsigned)(H5AC__DELETED_FLAG | (hdr->swmr_write ? 0 : H5AC__FREE_FILE_SPACE_FLAG))) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1702,8 +1700,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - const H5B2_node_ptr_t *curr_node, void *parent, hsize_t *btree_size) +H5B2__node_size(H5B2_hdr_t *hdr, uint16_t depth, const H5B2_node_ptr_t *curr_node, + void *parent, hsize_t *btree_size) { H5B2_internal_t *internal = NULL; /* Pointer to internal node */ herr_t ret_value = SUCCEED; /* Iterator return value */ @@ -1717,7 +1715,7 @@ H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDassert(depth > 0); /* Lock the current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ + if(NULL == (internal = H5B2__protect_internal(hdr, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Recursively descend into child nodes, if we are above the "twig" level in the B-tree */ @@ -1726,7 +1724,7 @@ H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Descend into children */ for(u = 0; u < internal->nrec + (unsigned)1; u++) - if(H5B2__node_size(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[u]), internal, btree_size) < 0) + if(H5B2__node_size(hdr, (uint16_t)(depth - 1), &(internal->node_ptrs[u]), internal, btree_size) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed") } /* end if */ else /* depth is 1: count all the leaf nodes from this node */ @@ -1736,7 +1734,7 @@ H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, *btree_size += hdr->node_size; done: - if(internal && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node->addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(internal && H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node->addr, internal, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1789,7 +1787,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__update_flush_depend(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, const H5B2_node_ptr_t *node_ptr, void *old_parent, void *new_parent) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -1820,7 +1818,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_internal_t *child_int; /* Protect child */ - if(NULL == (child_int = H5B2__protect_internal(hdr, dxpl_id, new_parent, (H5B2_node_ptr_t *)node_ptr, (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ + if(NULL == (child_int = H5B2__protect_internal(hdr, new_parent, (H5B2_node_ptr_t *)node_ptr, (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") child_class = H5AC_BT2_INT; child = child_int; @@ -1836,7 +1834,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_leaf_t *child_leaf; /* Protect child */ - if(NULL == (child_leaf = H5B2__protect_leaf(hdr, dxpl_id, new_parent, (H5B2_node_ptr_t *)node_ptr, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ + if(NULL == (child_leaf = H5B2__protect_leaf(hdr, new_parent, (H5B2_node_ptr_t *)node_ptr, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") child_class = H5AC_BT2_LEAF; child = child_leaf; @@ -1866,7 +1864,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, done: /* Unprotect the child */ if(child) - if(H5AC_unprotect(hdr->f, dxpl_id, child_class, node_ptr->addr, child, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, child_class, node_ptr->addr, child, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1887,7 +1885,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, unsigned depth, const H5B2_node_ptr_t *node_ptrs, unsigned start_idx, unsigned end_idx, void *old_parent, void *new_parent) { @@ -1907,7 +1905,7 @@ H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Loop over children */ for(u = start_idx; u < end_idx; u++) /* Update parent for children */ - if(H5B2__update_flush_depend(hdr, dxpl_id, depth - 1, &node_ptrs[u], old_parent, new_parent) < 0) + if(H5B2__update_flush_depend(hdr, depth - 1, &node_ptrs[u], old_parent, new_parent) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child node to new parent") done: diff --git a/src/H5B2internal.c b/src/H5B2internal.c index 1716c44..95ed769 100644 --- a/src/H5B2internal.c +++ b/src/H5B2internal.c @@ -56,8 +56,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5B2__shadow_internal(H5B2_internal_t *internal, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr); +static herr_t H5B2__shadow_internal(H5B2_internal_t *internal, H5B2_node_ptr_t *curr_node_ptr); /*********************/ @@ -94,8 +93,8 @@ H5FL_DEFINE(H5B2_internal_t); *------------------------------------------------------------------------- */ herr_t -H5B2__create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, - H5B2_node_ptr_t *node_ptr, uint16_t depth) +H5B2__create_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, + uint16_t depth) { H5B2_internal_t *internal = NULL; /* Pointer to new internal node created */ hbool_t inserted = FALSE; /* Whether the internal node was inserted into cache */ @@ -139,17 +138,17 @@ H5B2__create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, internal->shadow_epoch = hdr->shadow_epoch; /* Allocate space on disk for the internal node */ - if(HADDR_UNDEF == (node_ptr->addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->node_size))) + if(HADDR_UNDEF == (node_ptr->addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, (hsize_t)hdr->node_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for B-tree internal node") /* Cache the new B-tree node */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_BT2_INT, node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_BT2_INT, node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree internal node to cache") inserted = TRUE; /* Add internal node as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, internal) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, internal) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, FAIL, "unable to add v2 B-tree node as child of proxy") internal->top_proxy = hdr->top_proxy; } /* end if */ @@ -163,7 +162,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTREMOVE, FAIL, "unable to remove v2 B-tree internal node from cache") /* Release internal node's disk space */ - if(H5F_addr_defined(node_ptr->addr) && H5MF_xfree(hdr->f, H5FD_MEM_BTREE, dxpl_id, node_ptr->addr, (hsize_t)hdr->node_size) < 0) + if(H5F_addr_defined(node_ptr->addr) && H5MF_xfree(hdr->f, H5FD_MEM_BTREE, node_ptr->addr, (hsize_t)hdr->node_size) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release file space for v2 B-tree internal node") /* Destroy internal node */ @@ -190,8 +189,8 @@ done: *------------------------------------------------------------------------- */ H5B2_internal_t * -H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, - H5B2_node_ptr_t *node_ptr, uint16_t depth, hbool_t shadow, unsigned flags) +H5B2__protect_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, + uint16_t depth, hbool_t shadow, unsigned flags) { H5B2_internal_cache_ud_t udata; /* User data to pass through to cache 'deserialize' callback */ H5B2_internal_t *internal = NULL; /* v2 B-tree internal node */ @@ -216,20 +215,20 @@ H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, udata.depth = depth; /* Protect the internal node */ - if(NULL == (internal = (H5B2_internal_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_BT2_INT, node_ptr->addr, &udata, flags))) + if(NULL == (internal = (H5B2_internal_t *)H5AC_protect(hdr->f, H5AC_BT2_INT, node_ptr->addr, &udata, flags))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to protect B-tree internal node") /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == internal->top_proxy) { /* Add internal node as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, internal) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, internal) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, NULL, "unable to add v2 B-tree internal node as child of proxy") internal->top_proxy = hdr->top_proxy; } /* end if */ /* Shadow the node, if requested */ if(shadow) - if(H5B2__shadow_internal(internal, dxpl_id, node_ptr) < 0) + if(H5B2__shadow_internal(internal, node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, NULL, "unable to shadow internal node") /* Set return value */ @@ -248,7 +247,7 @@ done: } /* end if */ /* Unprotect internal node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, NULL, "unable to unprotect v2 B-tree internal node, address = %llu", (unsigned long long)node_ptr->addr) } /* end if */ } /* end if */ @@ -284,9 +283,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, H5B2_compare_t comp, - void *parent, void *udata, H5B2_found_t op, void *op_data) +H5B2__neighbor_internal(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + void *neighbor_loc, H5B2_compare_t comp, void *parent, void *udata, + H5B2_found_t op, void *op_data) { H5B2_internal_t *internal; /* Pointer to internal node */ unsigned idx = 0; /* Location of record which matches key */ @@ -303,7 +302,7 @@ H5B2__neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDassert(op); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Locate node pointer for child */ @@ -326,17 +325,17 @@ H5B2__neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Attempt to find neighboring record */ if(depth > 1) { - if(H5B2__neighbor_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &internal->node_ptrs[idx], neighbor_loc, comp, internal, udata, op, op_data) < 0) + if(H5B2__neighbor_internal(hdr, (uint16_t)(depth - 1), &internal->node_ptrs[idx], neighbor_loc, comp, internal, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree internal node") } /* end if */ else { - if(H5B2__neighbor_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], neighbor_loc, comp, internal, udata, op, op_data) < 0) + if(H5B2__neighbor_leaf(hdr, &internal->node_ptrs[idx], neighbor_loc, comp, internal, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree leaf node") } /* end else */ done: /* Release the B-tree internal node */ - if(internal && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(internal && H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -357,9 +356,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, - H5B2_nodepos_t curr_pos, void *parent, void *udata) +H5B2__insert_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, + void *udata) { H5B2_internal_t *internal = NULL; /* Pointer to internal node */ unsigned internal_flags = H5AC__NO_FLAGS_SET; @@ -376,7 +375,7 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Sanity check number of records */ @@ -413,35 +412,32 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Attempt to redistribute records among children */ if(idx == 0) { /* Left-most child */ if(retries > 0 && (internal->node_ptrs[idx + 1].node_nrec < split_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) + if(H5B2__redistribute2(hdr, depth, internal, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__split1(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__split1(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split child node") } /* end else */ } /* end if */ else if(idx == internal->nrec) { /* Right-most child */ if(retries > 0 && (internal->node_ptrs[idx - 1].node_nrec < split_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) + if(H5B2__redistribute2(hdr, depth, internal, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__split1(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__split1(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split child node") } /* end else */ } /* end if */ else { /* Middle child */ if(retries > 0 && ((internal->node_ptrs[idx + 1].node_nrec < split_nrec) || (internal->node_ptrs[idx - 1].node_nrec < split_nrec))) { - if(H5B2__redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) + if(H5B2__redistribute3(hdr, depth, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__split1(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__split1(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split child node") } /* end else */ } /* end else */ @@ -475,11 +471,11 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Attempt to insert node */ if(depth > 1) { - if(H5B2__insert_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &internal_flags, &internal->node_ptrs[idx], next_pos, internal, udata) < 0) + if(H5B2__insert_internal(hdr, (uint16_t)(depth - 1), &internal_flags, &internal->node_ptrs[idx], next_pos, internal, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree internal node") } /* end if */ else { - if(H5B2__insert_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], next_pos, internal, udata) < 0) + if(H5B2__insert_leaf(hdr, &internal->node_ptrs[idx], next_pos, internal, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree leaf node") } /* end else */ @@ -494,11 +490,11 @@ done: if(internal) { /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write && (internal_flags & H5AC__DIRTIED_FLAG)) - if(H5B2__shadow_internal(internal, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_internal(internal, curr_node_ptr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal B-tree node") /* Unprotect node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") } /* end if */ @@ -523,7 +519,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, +H5B2__update_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_status_t *status, H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_modify_t op, void *op_data) @@ -544,7 +540,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Sanity check number of records */ @@ -591,11 +587,11 @@ H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Attempt to update record in child */ if(depth > 1) { - if(H5B2__update_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &internal_flags, &internal->node_ptrs[idx], status, next_pos, internal, udata, op, op_data) < 0) + if(H5B2__update_internal(hdr, (uint16_t)(depth - 1), &internal_flags, &internal->node_ptrs[idx], status, next_pos, internal, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update record in internal B-tree node") } /* end if */ else { - if(H5B2__update_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], status, next_pos, internal, udata, op, op_data) < 0) + if(H5B2__update_leaf(hdr, &internal->node_ptrs[idx], status, next_pos, internal, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update record in leaf B-tree node") } /* end else */ @@ -656,7 +652,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, */ if(could_split) { /* Release the internal B-tree node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") internal = NULL; @@ -666,7 +662,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, } /* end if */ /* Release the internal B-tree node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") internal = NULL; @@ -674,7 +670,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, *status = H5B2_UPDATE_INSERT_DONE; /* Dodge sideways into inserting a record into this node */ - if(H5B2__insert_internal(hdr, dxpl_id, depth, parent_cache_info_flags_ptr, curr_node_ptr, curr_pos, parent, udata) < 0) + if(H5B2__insert_internal(hdr, depth, parent_cache_info_flags_ptr, curr_node_ptr, curr_pos, parent, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into internal B-tree node") break; @@ -691,7 +687,7 @@ done: /* Check if we should shadow this node */ if(hdr->swmr_write && (internal_flags & H5AC__DIRTIED_FLAG)) { /* Attempt to shadow the node if doing SWMR writes */ - if(H5B2__shadow_internal(internal, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_internal(internal, curr_node_ptr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal B-tree node") /* Change the state to "shadowed" if only modified currently */ @@ -701,7 +697,7 @@ done: } /* end if */ /* Unprotect node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") } /* end if */ @@ -726,8 +722,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__shadow_internal(H5B2_internal_t *internal, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr) +H5B2__shadow_internal(H5B2_internal_t *internal, H5B2_node_ptr_t *curr_node_ptr) { H5B2_hdr_t *hdr; /* B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -758,11 +753,11 @@ H5B2__shadow_internal(H5B2_internal_t *internal, hid_t dxpl_id, * shadowed node. Remove it from cache but do not mark it free on disk. */ /* Allocate space for the cloned node */ - if(HADDR_UNDEF == (new_node_addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->node_size))) + if(HADDR_UNDEF == (new_node_addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, (hsize_t)hdr->node_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move B-tree node") /* Move the location of the node on the disk */ - if(H5AC_move_entry(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, new_node_addr, dxpl_id) < 0) + if(H5AC_move_entry(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, new_node_addr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTMOVE, FAIL, "unable to move B-tree node") curr_node_ptr->addr = new_node_addr; @@ -793,7 +788,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, +H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_nodepos_t curr_pos, H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, void *op_data) @@ -819,7 +814,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent_cache_info, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent_cache_info, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") internal_addr = curr_node_ptr->addr; @@ -832,8 +827,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, ((internal->node_ptrs[0].node_nrec + internal->node_ptrs[1].node_nrec) <= ((merge_nrec * 2) + 1))) { /* Merge children of root node */ - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, 0) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, 0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") /* Let the cache know that the object is deleted */ @@ -847,7 +841,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Update flush dependency for child, if using SWMR */ if(hdr->swmr_write) - if(H5B2__update_flush_depend(hdr, dxpl_id, depth, curr_node_ptr, internal, hdr) < 0) + if(H5B2__update_flush_depend(hdr, depth, curr_node_ptr, internal, hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child node to new parent") /* Indicate that the level of the B-tree decreased */ @@ -872,7 +866,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write) { - if(H5B2__shadow_internal(internal, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_internal(internal, curr_node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node") internal_addr = curr_node_ptr->addr; } /* end if */ @@ -906,35 +900,32 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, */ if(idx == 0) { /* Left-most child */ if(retries > 0 && (internal->node_ptrs[idx + 1].node_nrec > merge_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) + if(H5B2__redistribute2(hdr, depth, internal, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ else if(idx == internal->nrec) { /* Right-most child */ if(retries > 0 && (internal->node_ptrs[idx - 1].node_nrec > merge_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) + if(H5B2__redistribute2(hdr, depth, internal, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ else { /* Middle child */ if(retries > 0 && ((internal->node_ptrs[idx + 1].node_nrec > merge_nrec) || (internal->node_ptrs[idx - 1].node_nrec > merge_nrec))) { - if(H5B2__redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) + if(H5B2__redistribute3(hdr, depth, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge3(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__merge3(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end else */ @@ -962,7 +953,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Swap record to delete with record from leaf, if we are the last internal node */ if(swap_loc && depth == 1) - if(H5B2__swap_leaf(hdr, dxpl_id, depth, internal, &internal_flags, idx, swap_loc) < 0) + if(H5B2__swap_leaf(hdr, depth, internal, &internal_flags, idx, swap_loc) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSWAP, FAIL, "Can't swap records in B-tree") /* Set pointers for advancing to child node */ @@ -985,12 +976,12 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Attempt to remove record from child node */ if(depth > 1) { - if(H5B2__remove_internal(hdr, dxpl_id, depth_decreased, swap_loc, swap_parent, (uint16_t)(depth - 1), + if(H5B2__remove_internal(hdr, depth_decreased, swap_loc, swap_parent, (uint16_t)(depth - 1), new_cache_info, new_cache_info_flags_ptr, next_pos, new_node_ptr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") } /* end if */ else { - if(H5B2__remove_leaf(hdr, dxpl_id, new_node_ptr, next_pos, new_cache_info, udata, op, op_data) < 0) + if(H5B2__remove_leaf(hdr, new_node_ptr, next_pos, new_cache_info, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -1008,7 +999,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, done: /* Release the B-tree internal node */ - if(internal && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, internal_addr, internal, internal_flags) < 0) + if(internal && H5AC_unprotect(hdr->f, H5AC_BT2_INT, internal_addr, internal, internal_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1030,11 +1021,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, - hbool_t *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, - H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, - H5B2_remove_t op, void *op_data) +H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, + void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, + unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, hsize_t n, H5B2_remove_t op, void *op_data) { H5AC_info_t *new_cache_info; /* Pointer to new cache info */ unsigned *new_cache_info_flags_ptr = NULL; @@ -1057,7 +1047,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent_cache_info, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent_cache_info, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") internal_addr = curr_node_ptr->addr; HDassert(internal->nrec == curr_node_ptr->node_nrec); @@ -1073,8 +1063,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, HDassert(depth == hdr->depth); /* Merge children of root node */ - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, 0) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, 0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") /* Let the cache know that the object is deleted */ @@ -1088,7 +1077,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Update flush dependency for child, if using SWMR */ if(hdr->swmr_write) - if(H5B2__update_flush_depend(hdr, dxpl_id, depth, curr_node_ptr, internal, hdr) < 0) + if(H5B2__update_flush_depend(hdr, depth, curr_node_ptr, internal, hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child node to new parent") /* Indicate that the level of the B-tree decreased */ @@ -1114,7 +1103,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write) { - if(H5B2__shadow_internal(internal, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_internal(internal, curr_node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node") internal_addr = curr_node_ptr->addr; } /* end if */ @@ -1169,35 +1158,32 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, */ if(idx == 0) { /* Left-most child */ if(retries > 0 && (internal->node_ptrs[idx + 1].node_nrec > merge_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) + if(H5B2__redistribute2(hdr, depth, internal, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ else if(idx == internal->nrec) { /* Right-most child */ if(retries > 0 && (internal->node_ptrs[idx - 1].node_nrec > merge_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) + if(H5B2__redistribute2(hdr, depth, internal, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ else { /* Middle child */ if(retries > 0 && ((internal->node_ptrs[idx + 1].node_nrec > merge_nrec) || (internal->node_ptrs[idx - 1].node_nrec > merge_nrec))) { - if(H5B2__redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) + if(H5B2__redistribute3(hdr, depth, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge3(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__merge3(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end else */ @@ -1253,7 +1239,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Swap record to delete with record from leaf, if we are the last internal node */ if(swap_loc && depth == 1) - if(H5B2__swap_leaf(hdr, dxpl_id, depth, internal, &internal_flags, idx, swap_loc) < 0) + if(H5B2__swap_leaf(hdr, depth, internal, &internal_flags, idx, swap_loc) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSWAP, FAIL, "can't swap records in B-tree") /* Set pointers for advancing to child node */ @@ -1276,12 +1262,12 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Attempt to remove record from child node */ if(depth > 1) { - if(H5B2__remove_internal_by_idx(hdr, dxpl_id, depth_decreased, swap_loc, swap_parent, (uint16_t)(depth - 1), + if(H5B2__remove_internal_by_idx(hdr, depth_decreased, swap_loc, swap_parent, (uint16_t)(depth - 1), new_cache_info, new_cache_info_flags_ptr, new_node_ptr, next_pos, n, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") } /* end if */ else { - if(H5B2__remove_leaf_by_idx(hdr, dxpl_id, new_node_ptr, next_pos, new_cache_info, (unsigned)n, op, op_data) < 0) + if(H5B2__remove_leaf_by_idx(hdr, new_node_ptr, next_pos, new_cache_info, (unsigned)n, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -1299,7 +1285,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, done: /* Release the B-tree internal node */ - if(internal && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, internal_addr, internal, internal_flags) < 0) + if(internal && H5AC_unprotect(hdr->f, H5AC_BT2_INT, internal_addr, internal, internal_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index d900761..54d40ea 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -57,8 +57,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5B2__shadow_leaf(H5B2_leaf_t *leaf, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr); +static herr_t H5B2__shadow_leaf(H5B2_leaf_t *leaf, H5B2_node_ptr_t *curr_node_ptr); /*********************/ @@ -95,7 +94,7 @@ H5FL_DEFINE(H5B2_leaf_t); *------------------------------------------------------------------------- */ herr_t -H5B2__create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, H5B2_node_ptr_t *node_ptr) +H5B2__create_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr) { H5B2_leaf_t *leaf = NULL; /* Pointer to new leaf node created */ hbool_t inserted = FALSE; /* Whether the leaf node was inserted into cache */ @@ -130,17 +129,17 @@ H5B2__create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, H5B2_node_ptr_t leaf->shadow_epoch = hdr->shadow_epoch; /* Allocate space on disk for the leaf */ - if(HADDR_UNDEF == (node_ptr->addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->node_size))) + if(HADDR_UNDEF == (node_ptr->addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, (hsize_t)hdr->node_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for B-tree leaf node") /* Cache the new B-tree node */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree leaf to cache") inserted = TRUE; /* Add leaf node as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, leaf) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, leaf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, FAIL, "unable to add v2 B-tree node as child of proxy") leaf->top_proxy = hdr->top_proxy; } /* end if */ @@ -154,7 +153,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTREMOVE, FAIL, "unable to remove v2 B-tree leaf node from cache") /* Release leaf node's disk space */ - if(H5F_addr_defined(node_ptr->addr) && H5MF_xfree(hdr->f, H5FD_MEM_BTREE, dxpl_id, node_ptr->addr, (hsize_t)hdr->node_size) < 0) + if(H5F_addr_defined(node_ptr->addr) && H5MF_xfree(hdr->f, H5FD_MEM_BTREE, node_ptr->addr, (hsize_t)hdr->node_size) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release file space for v2 B-tree leaf node") /* Destroy leaf node */ @@ -181,8 +180,8 @@ done: *------------------------------------------------------------------------- */ H5B2_leaf_t * -H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, - H5B2_node_ptr_t *node_ptr, hbool_t shadow, unsigned flags) +H5B2__protect_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, + hbool_t shadow, unsigned flags) { H5B2_leaf_cache_ud_t udata; /* User-data for callback */ H5B2_leaf_t *leaf; /* v2 B-tree leaf node */ @@ -205,20 +204,20 @@ H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, udata.nrec = node_ptr->node_nrec; /* Protect the leaf node */ - if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_BT2_LEAF, node_ptr->addr, &udata, flags))) + if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(hdr->f, H5AC_BT2_LEAF, node_ptr->addr, &udata, flags))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to protect B-tree leaf node") /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == leaf->top_proxy) { /* Add leaf node as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, leaf) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, leaf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, NULL, "unable to add v2 B-tree leaf node as child of proxy") leaf->top_proxy = hdr->top_proxy; } /* end if */ /* Shadow the node, if requested */ if(shadow) - if(H5B2__shadow_leaf(leaf, dxpl_id, node_ptr) < 0) + if(H5B2__shadow_leaf(leaf, node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, NULL, "unable to shadow leaf node") /* Set return value */ @@ -237,7 +236,7 @@ done: } /* end if */ /* Unprotect leaf node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, NULL, "unable to unprotect v2 B-tree leaf node, address = %llu", (unsigned long long)node_ptr->addr) } /* end if */ } /* end if */ @@ -273,7 +272,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, +H5B2__neighbor_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, H5B2_compare_t comp, void *parent, void *udata, H5B2_found_t op, void *op_data) { @@ -291,7 +290,7 @@ H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_p HDassert(op); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Locate node pointer for child */ @@ -326,7 +325,7 @@ H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_p done: /* Release the B-tree leaf node */ - if(leaf && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(leaf && H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) @@ -347,7 +346,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, +H5B2__insert_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, void *udata) { H5B2_leaf_t *leaf; /* Pointer to leaf node */ @@ -364,7 +363,7 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Must have a leaf node with enough space to insert a record now */ @@ -431,11 +430,11 @@ done: if(leaf) { /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write && (leaf_flags & H5AC__DIRTIED_FLAG)) - if(H5B2__shadow_leaf(leaf, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf B-tree node") /* Unprotect leaf node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, leaf_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, leaf_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") } /* end if */ @@ -460,7 +459,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__update_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, +H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_status_t *status, H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_modify_t op, void *op_data) { @@ -478,7 +477,7 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Sanity check number of records */ @@ -581,7 +580,7 @@ done: /* Check if we should shadow this node */ if(hdr->swmr_write && (leaf_flags & H5AC__DIRTIED_FLAG)) { /* Attempt to shadow the node if doing SWMR writes */ - if(H5B2__shadow_leaf(leaf, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf B-tree node") /* Change the state to "shadowed" if only modified currently */ @@ -591,7 +590,7 @@ done: } /* end if */ /* Unprotect leaf node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, leaf_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, leaf_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") } /* end if */ @@ -615,9 +614,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, - unsigned idx, void *swap_loc) +H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx, void *swap_loc) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t child_addr; /* Address of child node */ @@ -641,7 +639,7 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, child_class = H5AC_BT2_INT; /* Lock B-tree child nodes */ - if(NULL == (child_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (child_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") child_addr = internal->node_ptrs[idx].addr; @@ -656,7 +654,7 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, child_class = H5AC_BT2_LEAF; /* Lock B-tree child node */ - if(NULL == (child_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (child_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") child_addr = internal->node_ptrs[idx].addr; @@ -683,7 +681,7 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Unlock child node */ - if(child && H5AC_unprotect(hdr->f, dxpl_id, child_class, child_addr, child, H5AC__DIRTIED_FLAG) < 0) + if(child && H5AC_unprotect(hdr->f, child_class, child_addr, child, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) @@ -707,7 +705,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__shadow_leaf(H5B2_leaf_t *leaf, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr) +H5B2__shadow_leaf(H5B2_leaf_t *leaf, H5B2_node_ptr_t *curr_node_ptr) { H5B2_hdr_t *hdr; /* B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -738,11 +736,11 @@ H5B2__shadow_leaf(H5B2_leaf_t *leaf, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_p * shadowed node. Remove it from cache but do not mark it free on disk. */ /* Allocate space for the cloned node */ - if(HADDR_UNDEF == (new_node_addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->node_size))) + if(HADDR_UNDEF == (new_node_addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, (hsize_t)hdr->node_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move B-tree node") /* Move the location of the old child on the disk */ - if(H5AC_move_entry(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, new_node_addr, dxpl_id) < 0) + if(H5AC_move_entry(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, new_node_addr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTMOVE, FAIL, "unable to move B-tree node") curr_node_ptr->addr = new_node_addr; @@ -773,7 +771,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, +H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, void *op_data) { H5B2_leaf_t *leaf; /* Pointer to leaf node */ @@ -791,7 +789,7 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") leaf_addr = curr_node_ptr->addr; @@ -833,7 +831,7 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr if(leaf->nrec > 0) { /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write) { - if(H5B2__shadow_leaf(leaf, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node") leaf_addr = curr_node_ptr->addr; } /* end if */ @@ -860,7 +858,7 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr done: /* Release the B-tree leaf node */ - if(leaf && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0) + if(leaf && H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -882,9 +880,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, - unsigned idx, H5B2_remove_t op, void *op_data) +H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, void *parent, unsigned idx, H5B2_remove_t op, + void *op_data) { H5B2_leaf_t *leaf; /* Pointer to leaf node */ haddr_t leaf_addr = HADDR_UNDEF; /* Leaf address on disk */ @@ -899,7 +897,7 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") leaf_addr = curr_node_ptr->addr; @@ -936,7 +934,7 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, if(leaf->nrec > 0) { /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write) { - if(H5B2__shadow_leaf(leaf, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node") leaf_addr = curr_node_ptr->addr; } /* end if */ @@ -963,7 +961,7 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, done: /* Release the B-tree leaf node */ - if(leaf && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0) + if(leaf && H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index e24d2eb..552cebb 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -334,31 +334,29 @@ extern const H5B2_class_t *const H5B2_client_class_g[H5B2_NUM_BTREE_ID]; /* Generic routines */ H5_DLL herr_t H5B2__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry); -H5_DLL herr_t H5B2__update_flush_depend(H5B2_hdr_t *hdr, hid_t dxpl_id, - unsigned depth, const H5B2_node_ptr_t *node_ptr, void *old_parent, - void *new_parent); +H5_DLL herr_t H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, + const H5B2_node_ptr_t *node_ptr, void *old_parent, void *new_parent); H5_DLL herr_t H5B2__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry); /* Internal node management routines */ -H5_DLL herr_t H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -H5_DLL herr_t H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, +H5_DLL herr_t H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx); +H5_DLL herr_t H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsigned idx); -H5_DLL herr_t H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -H5_DLL herr_t H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -H5_DLL herr_t H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, +H5_DLL herr_t H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); +H5_DLL herr_t H5B2__merge2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx); +H5_DLL herr_t H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx); /* Routines for managing B-tree header info */ H5_DLL H5B2_hdr_t *H5B2__hdr_alloc(H5F_t *f); -H5_DLL haddr_t H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, - const H5B2_create_t *cparam, void *ctx_udata); +H5_DLL haddr_t H5B2__hdr_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata); H5_DLL herr_t H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, uint16_t depth); H5_DLL herr_t H5B2__hdr_incr(H5B2_hdr_t *hdr); @@ -366,29 +364,26 @@ H5_DLL herr_t H5B2__hdr_decr(H5B2_hdr_t *hdr); H5_DLL herr_t H5B2__hdr_fuse_incr(H5B2_hdr_t *hdr); H5_DLL size_t H5B2__hdr_fuse_decr(H5B2_hdr_t *hdr); H5_DLL herr_t H5B2__hdr_dirty(H5B2_hdr_t *hdr); -H5_DLL H5B2_hdr_t *H5B2__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t hdr_addr, +H5_DLL H5B2_hdr_t *H5B2__hdr_protect(H5F_t *f, haddr_t hdr_addr, void *ctx_udata, unsigned flags); -H5_DLL herr_t H5B2__hdr_unprotect(H5B2_hdr_t *hdr, hid_t dxpl_id, - unsigned cache_flags); -H5_DLL herr_t H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id); +H5_DLL herr_t H5B2__hdr_unprotect(H5B2_hdr_t *hdr, unsigned cache_flags); +H5_DLL herr_t H5B2__hdr_delete(H5B2_hdr_t *hdr); /* Routines for operating on leaf nodes */ -H5_DLL H5B2_leaf_t * H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, - void *parent, H5B2_node_ptr_t *node_ptr, hbool_t shadow, unsigned flags); -H5_DLL herr_t H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, - void *swap_loc); +H5_DLL H5B2_leaf_t * H5B2__protect_leaf(H5B2_hdr_t *hdr, void *parent, + H5B2_node_ptr_t *node_ptr, hbool_t shadow, unsigned flags); +H5_DLL herr_t H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx, void *swap_loc); /* Routines for operating on internal nodes */ -H5_DLL H5B2_internal_t *H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - void *parent, H5B2_node_ptr_t *node_ptr, uint16_t depth, hbool_t shadow, - unsigned flags); +H5_DLL H5B2_internal_t *H5B2__protect_internal(H5B2_hdr_t *hdr, void *parent, + H5B2_node_ptr_t *node_ptr, uint16_t depth, hbool_t shadow, unsigned flags); /* Routines for allocating nodes */ -H5_DLL herr_t H5B2__split_root(H5B2_hdr_t *hdr, hid_t dxpl_id); -H5_DLL herr_t H5B2__create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, +H5_DLL herr_t H5B2__split_root(H5B2_hdr_t *hdr); +H5_DLL herr_t H5B2__create_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr); -H5_DLL herr_t H5B2__create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, +H5_DLL herr_t H5B2__create_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, uint16_t depth); /* Routines for releasing structures */ @@ -397,74 +392,69 @@ H5_DLL herr_t H5B2__leaf_free(H5B2_leaf_t *l); H5_DLL herr_t H5B2__internal_free(H5B2_internal_t *i); /* Routines for inserting records */ -H5_DLL herr_t H5B2__insert(H5B2_hdr_t *hdr, hid_t dxpl_id, void *udata); -H5_DLL herr_t H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - uint16_t depth, unsigned *parent_cache_info_flags_ptr, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, void *udata); -H5_DLL herr_t H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, void *udata); +H5_DLL herr_t H5B2__insert(H5B2_hdr_t *hdr, void *udata); +H5_DLL herr_t H5B2__insert_internal(H5B2_hdr_t *hdr, uint16_t depth, + unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, void *parent, void *udata); +H5_DLL herr_t H5B2__insert_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, void *parent, void *udata); /* Routines for update records */ -H5_DLL herr_t H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - uint16_t depth, unsigned *parent_cache_info_flags_ptr, - H5B2_node_ptr_t *curr_node_ptr, H5B2_update_status_t *status, - H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_modify_t op, - void *op_data); -H5_DLL herr_t H5B2__update_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, H5B2_update_status_t *status, - H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_modify_t op, - void *op_data); +H5_DLL herr_t H5B2__update_internal(H5B2_hdr_t *hdr, uint16_t depth, + unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_update_status_t *status, H5B2_nodepos_t curr_pos, void *parent, + void *udata, H5B2_modify_t op, void *op_data); +H5_DLL herr_t H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_update_status_t *status, H5B2_nodepos_t curr_pos, void *parent, + void *udata, H5B2_modify_t op, void *op_data); /* Routines for iterating over nodes/records */ -H5_DLL herr_t H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, +H5_DLL herr_t H5B2__iterate_node(H5B2_hdr_t *hdr, uint16_t depth, const H5B2_node_ptr_t *curr_node, void *parent, H5B2_operator_t op, void *op_data); -H5_DLL herr_t H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, - uint16_t depth, const H5B2_node_ptr_t *curr_node, void *parent, - hsize_t *op_data); +H5_DLL herr_t H5B2__node_size(H5B2_hdr_t *hdr, uint16_t depth, + const H5B2_node_ptr_t *curr_node, void *parent, hsize_t *op_data); /* Routines for locating records */ H5_DLL herr_t H5B2__locate_record(const H5B2_class_t *type, unsigned nrec, size_t *rec_off, const uint8_t *native, const void *udata, unsigned *idx, int *result); -H5_DLL herr_t H5B2__neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, - H5B2_compare_t comp, void *parent, void *udata, H5B2_found_t op, - void *op_data); -H5_DLL herr_t H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5B2__neighbor_internal(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, H5B2_compare_t comp, void *parent, void *udata, H5B2_found_t op, void *op_data); +H5_DLL herr_t H5B2__neighbor_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + void *neighbor_loc, H5B2_compare_t comp, void *parent, void *udata, + H5B2_found_t op, void *op_data); /* Routines for removing records */ -H5_DLL herr_t H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - hbool_t *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, - H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, - H5B2_nodepos_t curr_pos, H5B2_node_ptr_t *curr_node_ptr, void *udata, - H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, - void *udata, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, + void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, + unsigned *parent_cache_info_flags_ptr, H5B2_nodepos_t curr_pos, + H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, + void *op_data); +H5_DLL herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, + void *op_data); +H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, - unsigned idx, H5B2_remove_t op, void *op_data); +H5_DLL herr_t H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, void *parent, unsigned idx, H5B2_remove_t op, + void *op_data); /* Routines for deleting nodes */ -H5_DLL herr_t H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, +H5_DLL herr_t H5B2__delete_node(H5B2_hdr_t *hdr, uint16_t depth, const H5B2_node_ptr_t *curr_node, void *parent, H5B2_remove_t op, void *op_data); /* Debugging routines for dumping file structures */ -H5_DLL herr_t H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t obj_addr); -H5_DLL herr_t H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, const H5B2_class_t *type, - haddr_t hdr_addr, unsigned nrec, unsigned depth, haddr_t obj_addr); -H5_DLL herr_t H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, const H5B2_class_t *type, - haddr_t hdr_addr, unsigned nrec, haddr_t obj_addr); +H5_DLL herr_t H5B2__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, const H5B2_class_t *type, haddr_t obj_addr); +H5_DLL herr_t H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, unsigned depth, + haddr_t obj_addr); +H5_DLL herr_t H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, haddr_t obj_addr); /* Sanity checking routines */ #ifdef H5B2_DEBUG @@ -478,9 +468,9 @@ H5_DLL herr_t H5B2__assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf, /* Testing routines */ #ifdef H5B2_TESTING H5_DLL herr_t H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr); -H5_DLL int H5B2_get_node_depth_test(H5B2_t *bt2, hid_t dxpl_id, void *udata); -H5_DLL herr_t H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, - void *udata, H5B2_node_info_test_t *ninfo); +H5_DLL int H5B2__get_node_depth_test(H5B2_t *bt2, void *udata); +H5_DLL herr_t H5B2__get_node_info_test(H5B2_t *bt2, void *udata, + H5B2_node_info_test_t *ninfo); #endif /* H5B2_TESTING */ #endif /* _H5B2pkg_H */ diff --git a/src/H5B2private.h b/src/H5B2private.h index e4bbffa..83a5272 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -125,34 +125,31 @@ typedef struct H5B2_t H5B2_t; /***************************************/ /* Library-private Function Prototypes */ /***************************************/ -H5_DLL H5B2_t *H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, +H5_DLL H5B2_t *H5B2_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata); -H5_DLL H5B2_t *H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata); +H5_DLL H5B2_t *H5B2_open(H5F_t *f, haddr_t addr, void *ctx_udata); H5_DLL herr_t H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr/*out*/); -H5_DLL herr_t H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata); -H5_DLL herr_t H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, - void *op_data); -H5_DLL htri_t H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, +H5_DLL herr_t H5B2_insert(H5B2_t *bt2, void *udata); +H5_DLL herr_t H5B2_iterate(H5B2_t *bt2, H5B2_operator_t op, void *op_data); +H5_DLL htri_t H5B2_find(H5B2_t *bt2, void *udata, H5B2_found_t op, void *op_data); +H5_DLL herr_t H5B2_index(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, void *op_data); -H5_DLL herr_t H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, - hsize_t idx, H5B2_found_t op, void *op_data); -H5_DLL herr_t H5B2_neighbor(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, - void *udata, H5B2_found_t op, void *op_data); -H5_DLL herr_t H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, - H5B2_modify_t op, void *op_data); -H5_DLL herr_t H5B2_update(H5B2_t *bt2, hid_t dxpl_id, void *udata, - H5B2_modify_t op, void *op_data); -H5_DLL herr_t H5B2_remove(H5B2_t *b2, hid_t dxpl_id, void *udata, - H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, - H5_iter_order_t order, hsize_t idx, H5B2_remove_t op, void *op_data); +H5_DLL herr_t H5B2_neighbor(H5B2_t *bt2, H5B2_compare_t range, void *udata, + H5B2_found_t op, void *op_data); +H5_DLL herr_t H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, + void *op_data); +H5_DLL herr_t H5B2_update(H5B2_t *bt2, void *udata, H5B2_modify_t op, + void *op_data); +H5_DLL herr_t H5B2_remove(H5B2_t *b2, void *udata, H5B2_remove_t op, + void *op_data); +H5_DLL herr_t H5B2_remove_by_idx(H5B2_t *bt2, H5_iter_order_t order, + hsize_t idx, H5B2_remove_t op, void *op_data); H5_DLL herr_t H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec); -H5_DLL herr_t H5B2_size(H5B2_t *bt2, hid_t dxpl_id, - hsize_t *btree_size); -H5_DLL herr_t H5B2_close(H5B2_t *bt2, hid_t dxpl_id); -H5_DLL herr_t H5B2_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr, - void *ctx_udata, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2_depend(H5B2_t *bt2, hid_t dxpl_id, H5AC_proxy_entry_t *parent); +H5_DLL herr_t H5B2_size(H5B2_t *bt2, hsize_t *btree_size); +H5_DLL herr_t H5B2_close(H5B2_t *bt2); +H5_DLL herr_t H5B2_delete(H5F_t *f, haddr_t addr, void *ctx_udata, + H5B2_remove_t op, void *op_data); +H5_DLL herr_t H5B2_depend(H5B2_t *bt2, H5AC_proxy_entry_t *parent); H5_DLL herr_t H5B2_patch_file(H5B2_t *fa, H5F_t *f); /* Statistics routines */ diff --git a/src/H5B2stat.c b/src/H5B2stat.c index df99ad5..5dd9cc2 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -110,7 +110,7 @@ H5B2_stat_info(H5B2_t *bt2, H5B2_stat_t *info) *------------------------------------------------------------------------- */ herr_t -H5B2_size(H5B2_t *bt2, hid_t dxpl_id, hsize_t *btree_size) +H5B2_size(H5B2_t *bt2, hsize_t *btree_size) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -137,7 +137,7 @@ H5B2_size(H5B2_t *bt2, hid_t dxpl_id, hsize_t *btree_size) *btree_size += hdr->node_size; else /* Iterate through nodes */ - if(H5B2__node_size(hdr, dxpl_id, hdr->depth, &hdr->root, hdr, btree_size) < 0) + if(H5B2__node_size(hdr, hdr->depth, &hdr->root, hdr, btree_size) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed") } /* end if */ diff --git a/src/H5B2test.c b/src/H5B2test.c index c10e5a8..49fe3af 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -498,7 +498,7 @@ H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr) /*------------------------------------------------------------------------- - * Function: H5B2_get_node_info_test + * Function: H5B2__get_node_info_test * * Purpose: Determine information about a node holding a record in the B-tree * @@ -511,8 +511,7 @@ H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr) *------------------------------------------------------------------------- */ herr_t -H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, - H5B2_node_info_test_t *ninfo) +H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ @@ -522,7 +521,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(bt2); @@ -554,7 +553,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Unpin parent if necessary */ @@ -577,7 +576,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, next_node_ptr = internal->node_ptrs[idx]; /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Keep track of parent if necessary */ @@ -589,7 +588,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, } /* end if */ else { /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Fill in information about the node */ @@ -608,7 +607,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Unpin parent if necessary */ @@ -624,7 +623,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Indicate the depth that the record was found */ @@ -644,11 +643,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_get_node_info_test() */ +} /* H5B2__get_node_info_test() */ /*------------------------------------------------------------------------- - * Function: H5B2_get_node_depth_test + * Function: H5B2__get_node_depth_test * * Purpose: Determine the depth of a node holding a record in the B-tree * @@ -664,18 +663,18 @@ done: *------------------------------------------------------------------------- */ int -H5B2_get_node_depth_test(H5B2_t *bt2, hid_t dxpl_id, void *udata) +H5B2__get_node_depth_test(H5B2_t *bt2, void *udata) { H5B2_node_info_test_t ninfo; /* Node information */ int ret_value = -1; /* Return information */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(bt2); /* Get information abou the node */ - if(H5B2_get_node_info_test(bt2, dxpl_id, udata, &ninfo) < 0) + if(H5B2__get_node_info_test(bt2, udata, &ninfo) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "error looking up node info") /* Set return value */ @@ -683,5 +682,5 @@ H5B2_get_node_depth_test(H5B2_t *bt2, hid_t dxpl_id, void *udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_get_node_depth_test() */ +} /* H5B2__get_node_depth_test() */ diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index 3881b44..5cad81b 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -53,7 +53,7 @@ *------------------------------------------------------------------------- */ herr_t -H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, +H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B_class_t *type, void *udata) { H5B_t *bt = NULL; @@ -90,7 +90,7 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") /* @@ -149,7 +149,7 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f } /* end for */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -172,7 +172,7 @@ done: */ #ifdef H5B_DEBUG herr_t -H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void *udata) +H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) { H5B_t *bt = NULL; H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -207,7 +207,7 @@ H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG); + bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG); HDassert(bt); shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); HDassert(shared); @@ -217,7 +217,7 @@ H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void cur->level = bt->level; head = tail = cur; - status = H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET); + status = H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET); HDassert(status >= 0); bt = NULL; /* Make certain future references will be caught */ @@ -228,7 +228,7 @@ H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void * test. */ for(ncell = 0; cur; ncell++) { - bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG); + bt = (H5B_t *)H5AC_protect(f, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG); HDassert(bt); /* Check node header */ @@ -268,7 +268,7 @@ H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void } /* end if */ /* Release node */ - status = H5AC_unprotect(f, dxpl_id, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET); + status = H5AC_unprotect(f, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET); HDassert(status >= 0); bt = NULL; /* Make certain future references will be caught */ diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index 14dce4f..a451cab 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -86,8 +86,7 @@ H5FL_EXTERN(H5B_t); /******************************/ H5_DLL herr_t H5B__node_dest(H5B_t *bt); #ifdef H5B_DEBUG -herr_t H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, - void *udata); +herr_t H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata); #endif #endif /*_H5Bpkg_H*/ diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index cb038ec..270b4e6 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -82,8 +82,8 @@ typedef enum H5B_dir_t { } H5B_dir_t; /* Define the operator callback function pointer for H5B_iterate() */ -typedef int (*H5B_operator_t)(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, - const void *_rt_key, void *_udata); +typedef int (*H5B_operator_t)(H5F_t *f, const void *_lt_key, haddr_t addr, + const void *_rt_key, void *_udata); /* Each B-tree has certain information that can be shared across all * the instances of nodes in that B-tree. @@ -113,13 +113,13 @@ typedef struct H5B_class_t { H5B_subid_t id; /*id as found in file*/ size_t sizeof_nkey; /*size of native (memory) key*/ H5UC_t * (*get_shared)(const H5F_t*, const void*); /*shared info for node */ - herr_t (*new_node)(H5F_t*, hid_t, H5B_ins_t, void*, void*, void*, haddr_t*); + herr_t (*new_node)(H5F_t*, H5B_ins_t, void*, void*, void*, haddr_t*); int (*cmp2)(void*, void*, void*); /*compare 2 keys */ int (*cmp3)(void*, void*, void*); /*compare 3 keys */ - htri_t (*found)(H5F_t*, hid_t, haddr_t, const void*, void*); + htri_t (*found)(H5F_t*, haddr_t, const void*, void*); /* insert new data */ - H5B_ins_t (*insert)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*, + H5B_ins_t (*insert)(H5F_t*, haddr_t, void*, hbool_t*, void*, void*, void*, hbool_t*, haddr_t*); /* min insert uses min leaf, not new(), similarily for max insert */ @@ -130,8 +130,7 @@ typedef struct H5B_class_t { H5B_dir_t critical_key; /* remove existing data */ - H5B_ins_t (*remove)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*, - hbool_t*); + H5B_ins_t (*remove)(H5F_t*, haddr_t, void*, hbool_t*, void*, void*, hbool_t*); /* encode, decode, debug key values */ herr_t (*decode)(const H5B_shared_t*, const uint8_t*, void*); @@ -155,26 +154,25 @@ typedef struct H5B_info_t { /***************************************/ /* Library-private Function Prototypes */ /***************************************/ -H5_DLL herr_t H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - void *udata, haddr_t *addr_p/*out*/); -H5_DLL herr_t H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, void *udata); -H5_DLL herr_t H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, void *udata); -H5_DLL herr_t H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, H5B_operator_t op, void *udata); -H5_DLL herr_t H5B_get_info(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, H5B_info_t *bt_info, H5B_operator_t op, void *udata); -H5_DLL herr_t H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, void *udata); -H5_DLL herr_t H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, void *udata); +H5_DLL herr_t H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, + haddr_t *addr_p/*out*/); +H5_DLL herr_t H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, + void *udata); +H5_DLL herr_t H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, + void *udata); +H5_DLL herr_t H5B_iterate(H5F_t *f, const H5B_class_t *type, haddr_t addr, + H5B_operator_t op, void *udata); +H5_DLL herr_t H5B_get_info(H5F_t *f, const H5B_class_t *type, haddr_t addr, + H5B_info_t *bt_info, H5B_operator_t op, void *udata); +H5_DLL herr_t H5B_remove(H5F_t *f, const H5B_class_t *type, haddr_t addr, + void *udata); +H5_DLL herr_t H5B_delete(H5F_t *f, const H5B_class_t *type, haddr_t addr, + void *udata); H5_DLL H5B_shared_t *H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey); H5_DLL herr_t H5B_shared_free(void *_shared); -H5_DLL herr_t H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, +H5_DLL herr_t H5B_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth, const H5B_class_t *type, void *udata); -H5_DLL htri_t H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr); +H5_DLL htri_t H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr); #endif /* _H5Bprivate_H */ diff --git a/src/H5C.c b/src/H5C.c index 0d8cc75..729b267 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -81,6 +81,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Cpkg.h" /* Cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5FLprivate.h" /* Free Lists */ @@ -110,12 +111,18 @@ /* Local Prototypes */ /********************/ -static herr_t H5C__auto_adjust_cache_size(H5F_t * f, - hid_t dxpl_id, - hbool_t write_permitted); +static herr_t H5C__pin_entry_from_client(H5C_t *cache_ptr, + H5C_cache_entry_t *entry_ptr); + +static herr_t H5C__unpin_entry_real(H5C_t *cache_ptr, + H5C_cache_entry_t *entry_ptr, hbool_t update_rp); + +static herr_t H5C__unpin_entry_from_client(H5C_t *cache_ptr, + H5C_cache_entry_t *entry_ptr, hbool_t update_rp); + +static herr_t H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted); static herr_t H5C__autoadjust__ageout(H5F_t * f, - hid_t dxpl_id, double hit_rate, enum H5C_resize_status * status_ptr, size_t * new_max_cache_size_ptr, @@ -124,7 +131,6 @@ static herr_t H5C__autoadjust__ageout(H5F_t * f, static herr_t H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr); static herr_t H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, - hid_t dxpl_id, hbool_t write_permitted); static herr_t H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr); @@ -136,16 +142,13 @@ static herr_t H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr); static herr_t H5C__flash_increase_cache_size(H5C_t * cache_ptr, size_t old_entry_size, size_t new_entry_size); -static herr_t H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags); +static herr_t H5C__flush_invalidate_cache(H5F_t *f, unsigned flags); -static herr_t H5C_flush_invalidate_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, - unsigned flags); +static herr_t H5C_flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); -static herr_t H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, - unsigned flags); +static herr_t H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); static void * H5C_load_entry(H5F_t * f, - hid_t dxpl_id, #ifdef H5_HAVE_PARALLEL hbool_t coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -157,9 +160,9 @@ 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__serialize_ring(H5F_t *f, H5C_ring_t ring); +static herr_t H5C__serialize_single_entry(H5F_t *f, 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); @@ -729,7 +732,7 @@ H5C_free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *------------------------------------------------------------------------- */ herr_t -H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id) +H5C_prep_for_file_close(H5F_t *f) { H5C_t * cache_ptr; hbool_t image_generated = FALSE; /* Whether a cache image was generated */ @@ -757,7 +760,7 @@ H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id) HDassert(cache_ptr->pl_len == 0); /* Prepare cache image */ - if(H5C__prep_image_for_file_close(f, dxpl_id, &image_generated) < 0) + if(H5C__prep_image_for_file_close(f, &image_generated) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cache image") #ifdef H5_HAVE_PARALLEL @@ -798,7 +801,7 @@ H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id) * during a flush, and thus avoid any resulting entrie dirties, * deletions, insertion, or moves during the flush. */ - if(H5C__serialize_cache(f, dxpl_id) < 0) + if(H5C__serialize_cache(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "serialization of the cache failed") } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -816,13 +819,6 @@ done: * This function fails if any object are protected since the * resulting file might not be consistent. * - * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used on the first write occasioned - * by the destroy (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the - * same dxpl_id for both parameters. - * * Note that *cache_ptr has been freed upon successful return. * * Return: Non-negative on success/Negative on failure @@ -833,7 +829,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_dest(H5F_t * f, hid_t dxpl_id) +H5C_dest(H5F_t * f) { H5C_t * cache_ptr = f->shared->cache; herr_t ret_value = SUCCEED; /* Return value */ @@ -851,12 +847,12 @@ H5C_dest(H5F_t * f, hid_t dxpl_id) #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 ) + if(H5C__flush_invalidate_cache(f, 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) + if(H5C__generate_cache_image(f, cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "Can't generate metadata cache image") if(cache_ptr->slist_ptr != NULL) { @@ -899,7 +895,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_evict(H5F_t * f, hid_t dxpl_id) +H5C_evict(H5F_t * f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -909,7 +905,7 @@ H5C_evict(H5F_t * f, hid_t dxpl_id) 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 ) + if(H5C__flush_invalidate_cache(f, H5C__EVICT_ALLOW_LAST_PINS_FLAG) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict entries in the cache") done: @@ -932,8 +928,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, - haddr_t addr, unsigned flags) +H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flags) { H5C_t * cache_ptr; H5C_cache_entry_t * entry_ptr = NULL; @@ -981,7 +976,7 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, /* Delete the entry from the skip list on destroy */ flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flush_flags) < 0) + if(H5C__flush_single_entry(f, entry_ptr, flush_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "can't flush entry") done: @@ -1042,7 +1037,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) +H5C_flush_cache(H5F_t *f, unsigned flags) { #if H5C_DO_SANITY_CHECKS int i; @@ -1109,7 +1104,7 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) cache_ptr->flush_in_progress = TRUE; if(destroy) { - if(H5C_flush_invalidate_cache(f, dxpl_id, flags) < 0) + if(H5C__flush_invalidate_cache(f, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate failed") } /* end if */ else { @@ -1130,14 +1125,14 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) 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(H5MF_settle_raw_data_fsm(f, &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) + if(H5MF_settle_meta_data_fsm(f, &cache_ptr->mdfsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "MD FSM settle failed") break; @@ -1151,7 +1146,7 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) } /* end switch */ } /* end if */ - if(H5C_flush_ring(f, dxpl_id, ring, flags) < 0) + if(H5C__flush_ring(f, ring, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush ring failed") ring++; } /* end while */ @@ -1189,19 +1184,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_flush_to_min_clean(H5F_t * f, - hid_t dxpl_id) +H5C_flush_to_min_clean(H5F_t * f) { H5C_t * cache_ptr; hbool_t write_permitted; -#if 0 /* modified code -- commented out for now */ /* JRM */ - int i; - int flushed_entries_count = 0; - size_t flushed_entries_size = 0; - size_t space_needed = 0; - haddr_t * flushed_entries_list = NULL; - H5C_cache_entry_t * entry_ptr = NULL; -#endif /* JRM */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -1224,101 +1210,8 @@ H5C_flush_to_min_clean(H5F_t * f, if(!write_permitted) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cache write is not permitted!?!") -#if 1 /* original code */ - if(H5C__make_space_in_cache(f, dxpl_id, (size_t)0, write_permitted) < 0) + if(H5C__make_space_in_cache(f, (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 ) { - - if ( ((cache_ptr->max_cache_size - cache_ptr->index_size) + - cache_ptr->cLRU_list_size) >= cache_ptr->min_clean_size ) { - - space_needed = 0; - - } else { - - space_needed = cache_ptr->min_clean_size - - ((cache_ptr->max_cache_size - cache_ptr->index_size) + - cache_ptr->cLRU_list_size); - } - } else { - - if ( cache_ptr->min_clean_size <= cache_ptr->cLRU_list_size ) { - - space_needed = 0; - - } else { - - space_needed = cache_ptr->min_clean_size - - cache_ptr->cLRU_list_size; - } - } - - if ( space_needed > 0 ) { /* we have work to do */ - - HDassert( cache_ptr->slist_len > 0 ); - - /* allocate an array to keep a list of the entries that we - * mark for flush. We need this list to touch up the LRU - * list after the flush. - */ - 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") - - /* Scan the dirty LRU list from tail forward and mark sufficient - * entries to free up the necessary space. Keep a list of the - * entries marked in the order in which they are encountered. - */ - entry_ptr = cache_ptr->dLRU_tail_ptr; - - while ( ( flushed_entries_size < space_needed ) && - ( flushed_entries_count < cache_ptr->slist_len ) && - ( entry_ptr != NULL ) ) - { - HDassert( ! (entry_ptr->is_protected) ); - HDassert( ! (entry_ptr->is_read_only) ); - HDassert( entry_ptr->ro_ref_count == 0 ); - HDassert( entry_ptr->is_dirty ); - HDassert( entry_ptr->in_slist ); - - entry_ptr->flush_marker = TRUE; - flushed_entries_size += entry_ptr->size; - flushed_entries_list[flushed_entries_count] = entry_ptr->addr; - flushed_entries_count++; - entry_ptr = entry_ptr->aux_prev; - } - - HDassert( flushed_entries_count <= cache_ptr->slist_len ); - HDassert( flushed_entries_size >= space_needed ); - - - /* 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") - - /* 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 - * order we encountered them in. - */ - - i = 0; - while ( i < flushed_entries_count ) - { - H5C__SEARCH_INDEX_NO_STATS(cache_ptr, flushed_entries_list[i], \ - entry_ptr, FAIL) - - /* At present, the above search must always succeed. However, - * that may change. Write the code so we need only remove the - * following assert in that event. - */ - HDassert( entry_ptr != NULL ); - H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, FAIL) - i++; - } - } /* if ( space_needed > 0 ) */ -#endif /* end modified code -- commented out for now */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1332,17 +1225,6 @@ done: * exist on disk yet, but it must have an address and disk * space reserved. * - * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used on the first write occasioned - * by the insertion (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the - * metadata cache, but may not be needed elsewhere. If so, - * just use the same dxpl_id for both parameters. - * - * The primary_dxpl_id is the dxpl_id passed to the - * check_write_permitted function if such a function has been - * provided. - * * Observe that this function cannot occasion a read. * * Return: Non-negative on success/Negative on failure @@ -1354,14 +1236,12 @@ done: */ 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) { H5C_t *cache_ptr; - H5P_genplist_t *dxpl; H5AC_ring_t ring = H5C_RING_UNDEFINED; hbool_t insert_pinned; hbool_t flush_last; @@ -1404,13 +1284,8 @@ H5C_insert_entry(H5F_t * f, insert_pinned = ( (flags & H5C__PIN_ENTRY_FLAG) != 0 ); flush_last = ( (flags & H5C__FLUSH_LAST_FLAG) != 0 ); - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a property list") - /* Get the ring type from the DXPL */ - if((H5P_get(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "unable to query ring value") + ring = H5CX_get_ring(); entry_ptr = (H5C_cache_entry_t *)thing; @@ -1515,7 +1390,7 @@ H5C_insert_entry(H5F_t * f, entry_ptr->tag_info = NULL; /* Apply tag to newly inserted entry */ - if(H5C__tag_entry(cache_ptr, entry_ptr, dxpl_id) < 0) + if(H5C__tag_entry(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Cannot tag metadata entry") entry_tagged = TRUE; @@ -1577,7 +1452,7 @@ 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) + if(H5C__make_space_in_cache(f, space_needed, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C__make_space_in_cache failed") } /* end if */ @@ -1606,21 +1481,12 @@ H5C_insert_entry(H5F_t * f, H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) #ifdef H5_HAVE_PARALLEL - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { coll_access = (H5P_USER_TRUE == f->coll_md_read ? TRUE : FALSE); - if(!coll_access && H5P_FORCE_FALSE != f->coll_md_read) { - H5P_coll_md_read_flag_t prop_value; - - /* Get the property value */ - if(H5P_get(dxpl, H5_COLL_MD_READ_FLAG_NAME, &prop_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't get collective metadata access flag") - coll_access = (H5P_USER_TRUE == prop_value ? TRUE : FALSE); - } /* end if */ + /* If not explicitly disabled, get the cmdr setting from the API context */ + if(!coll_access && H5P_FORCE_FALSE != f->coll_md_read) + coll_access = H5CX_get_coll_metadata_read(); } /* end if */ entry_ptr->coll_access = coll_access; @@ -2236,62 +2102,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_pin_entry_from_client() - * - * Purpose: Internal routine to pin a cache entry from a client action. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * 3/26/09 - * - * Changes: Added sanity checks to clarify the circumstances under - * which an entry can be pinned. JRM -- 4/27/14 - * - *------------------------------------------------------------------------- - */ -#ifndef NDEBUG -static herr_t -H5C_pin_entry_from_client(H5C_t * cache_ptr, - H5C_cache_entry_t * entry_ptr) -#else -static herr_t -H5C_pin_entry_from_client(H5C_t H5_ATTR_UNUSED * cache_ptr, - H5C_cache_entry_t * entry_ptr) -#endif -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Sanity checks */ - HDassert( cache_ptr ); - HDassert( entry_ptr ); - HDassert( entry_ptr->is_protected ); - - /* Check if the entry is already pinned */ - if(entry_ptr->is_pinned) { - /* Check if the entry was pinned through an explicit pin from a client */ - if(entry_ptr->pinned_from_client) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Entry is already pinned") - } /* end if */ - else { - entry_ptr->is_pinned = TRUE; - - H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) - } /* end else */ - - /* Mark that the entry was pinned through an explicit pin from a client */ - entry_ptr->pinned_from_client = TRUE; - -done: - - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_pin_entry_from_client() */ - - -/*------------------------------------------------------------------------- * Function: H5C_pin_protected_entry() * * Purpose: Pin a protected cache entry. The entry must be protected @@ -2336,7 +2146,7 @@ H5C_pin_protected_entry(void *thing) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Entry isn't protected") /* Pin the entry from a client */ - if(H5C_pin_entry_from_client(cache_ptr, entry_ptr) < 0) + if(H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") done: @@ -2375,7 +2185,6 @@ done: */ void * H5C_protect(H5F_t * f, - hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * udata, @@ -2395,7 +2204,6 @@ H5C_protect(H5F_t * f, size_t empty_space; void * thing; H5C_cache_entry_t * entry_ptr; - H5P_genplist_t * dxpl; /* dataset transfer property list */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -2422,33 +2230,23 @@ H5C_protect(H5F_t * f, /* 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) + if(H5C__load_cache_image(f) < 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 ); - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, NULL, "not a property list") - - /* Get the ring type from the DXPL */ - if((H5P_get(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "unable to query ring value") + /* Get the ring type from the API context */ + ring = H5CX_get_ring(); #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { coll_access = (H5P_USER_TRUE == f->coll_md_read ? TRUE : FALSE); - if(!coll_access && H5P_FORCE_FALSE != f->coll_md_read) { - H5P_coll_md_read_flag_t prop_value; - - /* get the property value */ - if(H5P_get(dxpl, H5_COLL_MD_READ_FLAG_NAME, &prop_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "Can't get collective metadata access flag") - coll_access = (H5P_USER_TRUE == prop_value ? TRUE : FALSE); - } /* end if */ + /* If not explicitly disabled, get the cmdr setting from the API context */ + if(!coll_access && H5P_FORCE_FALSE != f->coll_md_read) + coll_access = H5CX_get_coll_metadata_read(); } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -2466,7 +2264,7 @@ H5C_protect(H5F_t * f, * 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) + if(H5C__deserialize_prefetched_entry(f, 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); @@ -2507,7 +2305,7 @@ H5C_protect(H5F_t * f, HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ if(0 == mpi_rank) - if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0) + if(H5C__generate_image(f, cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "can't generate entry's image") } /* end if */ HDassert(entry_ptr->image_ptr); @@ -2533,14 +2331,13 @@ H5C_protect(H5F_t * f, haddr_t tag; /* Tag value */ /* The entry is already in the cache, but make sure that the tag value - being passed in via dxpl is still legal. This will ensure that had + is still legal. This will ensure that had the entry NOT been in the cache, tagging was still set up correctly and it would have received a legal tag value after getting loaded from disk. */ - /* Get the tag from the DXPL */ - if((H5P_get(dxpl, H5AC_TAG_NAME, &tag)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to query property value") + /* Get the tag */ + tag = H5CX_get_tag(); if(H5C_verify_tag(entry_ptr->type->id, tag) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "tag verification failed") @@ -2557,7 +2354,7 @@ H5C_protect(H5F_t * f, hit = FALSE; - if(NULL == (thing = H5C_load_entry(f, dxpl_id, + if(NULL == (thing = H5C_load_entry(f, #ifdef H5_HAVE_PARALLEL coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -2574,7 +2371,7 @@ H5C_protect(H5F_t * f, #endif /* H5_HAVE_PARALLEL */ /* Apply tag to newly protected entry */ - if(H5C__tag_entry(cache_ptr, entry_ptr, dxpl_id) < 0) + if(H5C__tag_entry(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, NULL, "Cannot tag metadata entry") /* If the entry is very large, and we are configured to allow it, @@ -2655,7 +2452,7 @@ 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 ) + if(H5C__make_space_in_cache(f, space_needed, write_permitted) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__make_space_in_cache failed") } /* end if */ @@ -2752,7 +2549,7 @@ H5C_protect(H5F_t * f, 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) + if(H5C__auto_adjust_cache_size(f, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Cache auto-resize failed") } /* end if */ @@ -2781,7 +2578,7 @@ 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 ) + if(H5C__make_space_in_cache(f, (size_t)0, write_permitted) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__make_space_in_cache failed") } } /* end if */ @@ -3108,60 +2905,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_unpin_entry_from_client() - * - * Purpose: Internal routine to unpin a cache entry from a client action. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * 3/24/09 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5C_unpin_entry_from_client(H5C_t * cache_ptr, - H5C_cache_entry_t * entry_ptr, - hbool_t update_rp) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Sanity checking */ - HDassert( cache_ptr ); - HDassert( entry_ptr ); - - /* Error checking (should be sanity checks?) */ - if(!entry_ptr->is_pinned) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Entry isn't pinned") - if(!entry_ptr->pinned_from_client) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Entry wasn't pinned by cache client") - - /* Check if the entry is not pinned from a flush dependency */ - if(!entry_ptr->pinned_from_cache) { - /* If requested, update the replacement policy if the entry is not protected */ - if(update_rp && !entry_ptr->is_protected) - H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, FAIL) - - /* Unpin the entry now */ - entry_ptr->is_pinned = FALSE; - - /* Update the stats for an unpin operation */ - H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) - } /* end if */ - - /* Mark the entry as explicitly unpinned by the client */ - entry_ptr->pinned_from_client = FALSE; - -done: - - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_unpin_entry_from_client() */ - - -/*------------------------------------------------------------------------- * Function: H5C_unpin_entry() * * Purpose: Unpin a cache entry. The entry can be either protected or @@ -3201,7 +2944,7 @@ H5C_unpin_entry(void *_entry_ptr) /* Unpin the entry */ - if(H5C_unpin_entry_from_client(cache_ptr, entry_ptr, TRUE) < 0) + if(H5C__unpin_entry_from_client(cache_ptr, entry_ptr, TRUE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry from client") done: @@ -3242,11 +2985,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_unprotect(H5F_t * f, - hid_t dxpl_id, - haddr_t addr, - void * thing, - unsigned int flags) +H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) { H5C_t * cache_ptr; hbool_t deleted; @@ -3323,11 +3062,11 @@ H5C_unprotect(H5F_t * f, /* Pin or unpin the entry as requested. */ if(pin_entry) { /* Pin the entry from a client */ - if(H5C_pin_entry_from_client(cache_ptr, entry_ptr) < 0) + if(H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") } else if(unpin_entry) { /* Unpin the entry from a client */ - if(H5C_unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) + if(H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client") } /* end if */ } else { @@ -3419,11 +3158,11 @@ H5C_unprotect(H5F_t * f, /* Pin or unpin the entry as requested. */ if(pin_entry) { /* Pin the entry from a client */ - if(H5C_pin_entry_from_client(cache_ptr, entry_ptr) < 0) + if(H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") } else if(unpin_entry) { /* Unpin the entry from a client */ - if(H5C_unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) + if(H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client") } /* end if */ @@ -3475,7 +3214,7 @@ H5C_unprotect(H5F_t * f, flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; HDassert(((!was_clean) || dirtied) == entry_ptr->in_slist); - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flush_flags) < 0) + if(H5C__flush_single_entry(f, entry_ptr, flush_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush entry") } /* end if */ #ifdef H5_HAVE_PARALLEL @@ -3488,7 +3227,7 @@ H5C_unprotect(H5F_t * f, else if(test_entry_ptr != entry_ptr) 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) + if(H5C__flush_single_entry(f, 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") } /* end else if */ #endif /* H5_HAVE_PARALLEL */ @@ -4019,17 +3758,9 @@ H5C_destroy_flush_dependency(void *parent_thing, void * child_thing) HDassert(parent_entry->pinned_from_cache); /* Check if we should unpin parent entry now */ - if(!parent_entry->pinned_from_client) { - /* Update the replacement policy if the entry is not protected */ - if(!parent_entry->is_protected) - H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, parent_entry, FAIL) - - /* Unpin the entry now */ - parent_entry->is_pinned = FALSE; - - /* Update the stats for an unpin operation */ - H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, parent_entry) - } /* end if */ + if(!parent_entry->pinned_from_client) + if(H5C__unpin_entry_real(cache_ptr, parent_entry, TRUE) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry") /* Mark the entry as unpinned from the cache's action */ parent_entry->pinned_from_cache = FALSE; @@ -4081,6 +3812,138 @@ done: /**************************** Private Functions: *************************/ /*************************************************************************/ + +/*------------------------------------------------------------------------- + * Function: H5C__pin_entry_from_client() + * + * Purpose: Internal routine to pin a cache entry from a client action. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 3/26/09 + * + *------------------------------------------------------------------------- + */ +#if H5C_COLLECT_CACHE_STATS +static herr_t +H5C__pin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) +#else +static herr_t +H5C__pin_entry_from_client(H5C_t H5_ATTR_UNUSED *cache_ptr, H5C_cache_entry_t *entry_ptr) +#endif +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity checks */ + HDassert(cache_ptr); + HDassert(entry_ptr); + HDassert(entry_ptr->is_protected); + + /* Check if the entry is already pinned */ + if(entry_ptr->is_pinned) { + /* Check if the entry was pinned through an explicit pin from a client */ + if(entry_ptr->pinned_from_client) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "entry is already pinned") + } /* end if */ + else { + entry_ptr->is_pinned = TRUE; + + H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) + } /* end else */ + + /* Mark that the entry was pinned through an explicit pin from a client */ + entry_ptr->pinned_from_client = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C__pin_entry_from_client() */ + + +/*------------------------------------------------------------------------- + * Function: H5C__unpin_entry_real() + * + * Purpose: Internal routine to unpin a cache entry. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 1/6/18 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, + hbool_t update_rp) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity checking */ + HDassert(cache_ptr); + HDassert(entry_ptr); + HDassert(entry_ptr->is_pinned); + + /* If requested, update the replacement policy if the entry is not protected */ + if(update_rp && !entry_ptr->is_protected) + H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, FAIL) + + /* Unpin the entry now */ + entry_ptr->is_pinned = FALSE; + + /* Update the stats for an unpin operation */ + H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C__unpin_entry_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5C__unpin_entry_from_client() + * + * Purpose: Internal routine to unpin a cache entry from a client action. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 3/24/09 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5C__unpin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, + hbool_t update_rp) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity checking */ + HDassert(cache_ptr); + HDassert(entry_ptr); + + /* Error checking (should be sanity checks?) */ + if(!entry_ptr->is_pinned) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "entry isn't pinned") + if(!entry_ptr->pinned_from_client) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "entry wasn't pinned by cache client") + + /* Check if the entry is not pinned from a flush dependency */ + if(!entry_ptr->pinned_from_cache) + if(H5C__unpin_entry_real(cache_ptr, entry_ptr, update_rp) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "can't unpin entry") + + /* Mark the entry as explicitly unpinned by the client */ + entry_ptr->pinned_from_client = FALSE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C__unpin_entry_from_client() */ + /*------------------------------------------------------------------------- * * Function: H5C__auto_adjust_cache_size @@ -4102,9 +3965,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__auto_adjust_cache_size(H5F_t * f, - hid_t dxpl_id, - hbool_t write_permitted) +H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; hbool_t reentrant_call = FALSE; @@ -4297,7 +4158,7 @@ H5C__auto_adjust_cache_size(H5F_t * f, 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) + if(H5C__autoadjust__ageout(f, hit_rate, &status, &new_max_cache_size, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ageout code failed") } /* end else */ } /* end if */ @@ -4427,7 +4288,6 @@ done: */ static herr_t H5C__autoadjust__ageout(H5F_t * f, - hid_t dxpl_id, double hit_rate, enum H5C_resize_status * status_ptr, size_t * new_max_cache_size_ptr, @@ -4463,7 +4323,7 @@ H5C__autoadjust__ageout(H5F_t * f, if ( cache_ptr->max_cache_size > (cache_ptr->resize_ctl).min_size ){ /* evict aged out cache entries if appropriate... */ - if(H5C__autoadjust__ageout__evict_aged_out_entries(f, dxpl_id, write_permitted) < 0) + if(H5C__autoadjust__ageout__evict_aged_out_entries(f, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error flushing aged out entries") /* ... and then reduce cache size if appropriate */ @@ -4634,16 +4494,6 @@ done: * will be re-calculated, and will be enforced the next time * we have to make space in the cache. * - * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used depending on the value of - * *first_flush_ptr. The idea is to use the primary_dxpl_id - * on the first write in a sequence of writes, and to use - * the secondary_dxpl_id on all subsequent writes. - * - * This is useful in the metadata cache, but may not be - * needed elsewhere. If so, just use the same dxpl_id for - * both parameters. - * * Observe that this function cannot occasion a read. * * Return: Non-negative on success/Negative on failure. @@ -4653,9 +4503,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, - hid_t dxpl_id, - hbool_t write_permitted) +H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; size_t eviction_size_limit; @@ -4728,7 +4576,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, cache_ptr->entries_removed_counter = 0; cache_ptr->last_entry_removed_ptr = NULL; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__NO_FLAGS_SET) < 0) + if(H5C__flush_single_entry(f, entry_ptr, H5C__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") if(cache_ptr->entries_removed_counter > 1 || cache_ptr->last_entry_removed_ptr == prev_ptr) @@ -4739,7 +4587,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, bytes_evicted += entry_ptr->size; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) + if(H5C__flush_single_entry(f, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") } /* end else-if */ else { @@ -4811,7 +4659,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, prev_ptr = entry_ptr->prev; if(!(entry_ptr->is_dirty) && !(entry_ptr->prefetched_dirty)) - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) + if(H5C__flush_single_entry(f, 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") /* just skip the entry if it is dirty, as we can't do @@ -5210,7 +5058,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_flush_invalidate_cache + * Function: H5C__flush_invalidate_cache * * Purpose: Flush and destroy the entries contained in the target * cache. @@ -5233,11 +5081,6 @@ done: * until either the cache is empty, or the number of pinned * entries stops decreasing on each pass. * - * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used on the first write occasioned - * by the flush (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). - * * Return: Non-negative on success/Negative on failure or if there was * a request to flush all items and something was protected. * @@ -5247,13 +5090,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) +H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) { H5C_t * cache_ptr; H5C_ring_t ring; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(f); HDassert(f->shared); @@ -5308,7 +5151,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) + if(H5C_flush_invalidate_ring(f, ring, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed") ring++; } /* end while */ @@ -5352,7 +5195,7 @@ H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_flush_invalidate_cache() */ +} /* H5C__flush_invalidate_cache() */ /*------------------------------------------------------------------------- @@ -5392,8 +5235,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, - unsigned flags) +H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) { H5C_t *cache_ptr; hbool_t restart_slist_scan; @@ -5594,7 +5436,7 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, protected_entries++; } /* end if */ else if(entry_ptr->is_pinned) { - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__DURING_FLUSH_FLAG) < 0) + if(H5C__flush_single_entry(f, entry_ptr, H5C__DURING_FLUSH_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed") if(cache_ptr->slist_changed) { @@ -5611,7 +5453,7 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, } /* 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) + if(H5C__flush_single_entry(f, 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") if(cache_ptr->slist_changed) { @@ -5715,7 +5557,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) + if(H5C__flush_single_entry(f, 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") /* Restart the index list scan if necessary. Must @@ -5807,7 +5649,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_flush_ring + * Function: H5C__flush_ring * * Purpose: Flush the entries contained in the specified cache and * ring. All entries in rings outside the specified ring @@ -5830,8 +5672,8 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) +static herr_t +H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) { H5C_t * cache_ptr = f->shared->cache; hbool_t flushed_entries_last_pass; @@ -5850,7 +5692,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) int i; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); @@ -6026,7 +5868,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) protected_entries++; } /* end if */ else { - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (flags | H5C__DURING_FLUSH_FLAG)) < 0) + if(H5C__flush_single_entry(f, entry_ptr, (flags | H5C__DURING_FLUSH_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry") if(cache_ptr->slist_changed) { @@ -6068,7 +5910,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_flush_ring() */ +} /* H5C__flush_ring() */ /*------------------------------------------------------------------------- @@ -6105,8 +5947,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, - unsigned flags) +H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) { H5C_t * cache_ptr; /* Cache for file */ hbool_t destroy; /* external flag */ @@ -6240,7 +6081,7 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, HDassert(!entry_ptr->prefetched); /* Generate the entry's image */ - if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0) + if(H5C__generate_image(f, cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't generate entry's image") } /* end if ( ! (entry_ptr->image_up_to_date) ) */ } /* end if */ @@ -6288,12 +6129,8 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, 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, 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 */ @@ -6478,7 +6315,7 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, * the entry occupies */ if(free_file_space) { - size_t fsf_size; + hsize_t fsf_size; /* Sanity checks */ HDassert(H5F_addr_defined(entry_ptr->addr)); @@ -6505,7 +6342,7 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, fsf_size = entry_ptr->size; /* Release the space on disk */ - if(H5MF_xfree(f, entry_ptr->type->mem_type, dxpl_id, entry_ptr->addr, (hsize_t)fsf_size) < 0) + if(H5MF_xfree(f, entry_ptr->type->mem_type, entry_ptr->addr, fsf_size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "unable to free file space for cache entry") } /* end if ( free_file_space ) */ @@ -6681,7 +6518,6 @@ done: */ static void * H5C_load_entry(H5F_t * f, - hid_t dxpl_id, #ifdef H5_HAVE_PARALLEL hbool_t coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -6781,7 +6617,7 @@ H5C_load_entry(H5F_t * f, #ifdef H5_HAVE_PARALLEL if(!coll_access || 0 == mpi_rank) { #endif /* H5_HAVE_PARALLEL */ - if(H5F_block_read(f, type->mem_type, addr, len, dxpl_id, image) < 0) + if(H5F_block_read(f, type->mem_type, addr, len, image) < 0) HGOTO_ERROR(H5E_CACHE, H5E_READERROR, NULL, "Can't read image*") #ifdef H5_HAVE_PARALLEL } /* end if */ @@ -6828,7 +6664,7 @@ H5C_load_entry(H5F_t * f, /* If the thing's image needs to be bigger for a speculatively * loaded thing, go get the on-disk image again (the extra portion). */ - if(H5F_block_read(f, type->mem_type, addr + len, actual_len - len, dxpl_id, image + len) < 0) + if(H5F_block_read(f, type->mem_type, addr + len, actual_len - len, image + len) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "can't read image") #ifdef H5_HAVE_PARALLEL } @@ -7031,8 +6867,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, - hbool_t write_permitted) +H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; #if H5C_COLLECT_CACHE_STATS @@ -7146,7 +6981,7 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, cache_ptr->entries_removed_counter = 0; cache_ptr->last_entry_removed_ptr = NULL; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__NO_FLAGS_SET) < 0) + if(H5C__flush_single_entry(f, entry_ptr, H5C__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") if ( ( cache_ptr->entries_removed_counter > 1 ) || @@ -7163,7 +6998,7 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, cache_ptr->entries_scanned_to_make_space++; #endif /* H5C_COLLECT_CACHE_STATS */ - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) + if(H5C__flush_single_entry(f, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") } else { /* We have enough space so don't flush clean entry. */ @@ -7317,13 +7152,9 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, && ( ! (entry_ptr->coll_access) ) #endif /* H5_HAVE_PARALLEL */ ) { - - 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 entry") + if(H5C__flush_single_entry(f, entry_ptr, + H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") } /* end if */ @@ -7808,7 +7639,7 @@ H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) *------------------------------------------------------------------------- */ herr_t -H5C__flush_marked_entries(H5F_t * f, hid_t dxpl_id) +H5C__flush_marked_entries(H5F_t * f) { herr_t ret_value = SUCCEED; @@ -7818,7 +7649,7 @@ H5C__flush_marked_entries(H5F_t * f, hid_t dxpl_id) HDassert(f != NULL); /* Flush all marked entries */ - if(H5C_flush_cache(f, dxpl_id, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) + if(H5C_flush_cache(f, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache") done: @@ -8199,7 +8030,7 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry, *------------------------------------------------------------------------- */ herr_t -H5C__serialize_cache(H5F_t *f, hid_t dxpl_id) +H5C__serialize_cache(H5F_t *f) { #if H5C_DO_SANITY_CHECKS int i; @@ -8299,14 +8130,14 @@ H5C__serialize_cache(H5F_t *f, hid_t dxpl_id) 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(H5MF_settle_raw_data_fsm(f, &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) + if(H5MF_settle_meta_data_fsm(f, &cache_ptr->mdfsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "MD FSM settle failed") break; @@ -8319,7 +8150,7 @@ H5C__serialize_cache(H5F_t *f, hid_t dxpl_id) break; } /* end switch */ - if(H5C__serialize_ring(f, dxpl_id, ring) < 0) + if(H5C__serialize_ring(f, ring) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "serialize ring failed") ring++; @@ -8379,7 +8210,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring) +H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) { hbool_t done = FALSE; H5C_t * cache_ptr; @@ -8510,7 +8341,7 @@ H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring) HDassert(entry_ptr->serialization_count == 0); /* Serialize the entry */ - if(H5C__serialize_single_entry(f, dxpl_id, cache_ptr, entry_ptr) < 0) + if(H5C__serialize_single_entry(f, cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") HDassert(entry_ptr->flush_dep_nunser_children == 0); @@ -8575,7 +8406,7 @@ H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring) HDassert(entry_ptr->flush_dep_nunser_children == 0); /* Serialize the entry */ - if(H5C__serialize_single_entry(f, dxpl_id, cache_ptr, entry_ptr) < 0) + if(H5C__serialize_single_entry(f, cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") /* Check for the cache changing */ @@ -8621,8 +8452,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__serialize_single_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, - H5C_cache_entry_t *entry_ptr) +H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -8658,7 +8488,7 @@ H5C__serialize_single_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, } /* end if */ /* Generate image for entry */ - if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0) + if(H5C__generate_image(f, cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "Can't generate image for cache entry") /* Reset the flush_in progress flag */ @@ -8693,8 +8523,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, - hid_t dxpl_id) +H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) { haddr_t new_addr = HADDR_UNDEF; haddr_t old_addr = HADDR_UNDEF; @@ -8720,7 +8549,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, /* Call client's pre-serialize callback, if there's one */ if(entry_ptr->type->pre_serialize && - (entry_ptr->type->pre_serialize)(f, dxpl_id, (void *)entry_ptr, + (entry_ptr->type->pre_serialize)(f, (void *)entry_ptr, entry_ptr->addr, entry_ptr->size, &new_addr, &new_len, &serialize_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to pre-serialize entry") diff --git a/src/H5CX.c b/src/H5CX.c new file mode 100644 index 0000000..3bf732b --- /dev/null +++ b/src/H5CX.c @@ -0,0 +1,3308 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Monday, February 19, 2018 + * + * Purpose: + * Keep a set of "psuedo-global" information for an API call. This + * general corresponds to the DXPL for the call, along with cached + * information from them. + */ + +/****************/ +/* Module Setup */ +/****************/ + +#include "H5CXmodule.h" /* This source code file is part of the H5CX module */ + + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ + + +/****************/ +/* Local Macros */ +/****************/ + +#ifdef H5_HAVE_THREADSAFE +/* + * The per-thread API context. pthread_once() initializes a special + * key that will be used by all threads to create a stack specific to + * each thread individually. The association of contexts to threads will + * be handled by the pthread library. + * + * In order for this macro to work, H5E_get_my_stack() must be preceeded + * by "H5CX_node_t *ctx =". + */ +#define H5CX_get_my_context() H5CX__get_context() +#else /* H5_HAVE_THREADSAFE */ +/* + * The current API context. + */ +#define H5CX_get_my_context() (H5CX_head_g) +#endif /* H5_HAVE_THREADSAFE */ + + +/******************/ +/* Local Typedefs */ +/******************/ + +/* Context stored for each I/O-related API call */ +typedef struct H5CX_t { + /* DXPL */ + hid_t dxpl_id; /* DXPL ID for API operation */ + H5P_genplist_t *dxpl; /* Dataset Transfer Property List */ + + /* LAPL */ + hid_t lapl_id; /* LAPL ID for API operation */ + H5P_genplist_t *lapl; /* Link Access Property List */ + + /* Object tagging info */ + haddr_t tag; /* Current object's tag (ohdr chunk #0 address) */ + + /* Metadata cache info */ + H5AC_ring_t ring; /* Current metadata cache ring for entries*/ + +#ifdef H5_HAVE_PARALLEL + /* Parallel I/O settings */ + hbool_t coll_metadata_read; /* Whether to use collective I/O for metadata read */ + MPI_Datatype btype; /* MPI datatype for buffer, when using collective I/O */ + MPI_Datatype ftype; /* MPI datatype for file, when using collective I/O */ +#endif /* H5_HAVE_PARALLEL */ + + /* Cached DXPL properties */ + size_t max_temp_buf; /* Maximum temporary buffer size */ + hbool_t max_temp_buf_valid; /* Whether maximum temporary buffer size is valid */ + void *tconv_buf; /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */ + hbool_t tconv_buf_valid; /* Whether temporary conversion buffer is valid */ + void *bkgr_buf; /* Background conversion buffer (H5D_XFER_BKGR_BUF_NAME) */ + hbool_t bkgr_buf_valid; /* Whether background conversion buffer is valid */ + H5T_bkg_t bkgr_buf_type; /* Background buffer type (H5D_XFER_BKGR_BUF_NAME) */ + hbool_t bkgr_buf_type_valid;/* Whether background buffer type is valid */ + double btree_split_ratio[3]; /* B-tree split ratios */ + hbool_t btree_split_ratio_valid; /* Whether B-tree split ratios are valid */ + size_t vec_size; /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */ + hbool_t vec_size_valid; /* Whether hyperslab vector is valid */ +#ifdef H5_HAVE_PARALLEL + H5FD_mpio_xfer_t io_xfer_mode; /* Parallel transfer mode for this request (H5D_XFER_IO_XFER_MODE_NAME) */ + hbool_t io_xfer_mode_valid; /* Whether parallel transfer mode is valid */ + H5FD_mpio_collective_opt_t mpio_coll_opt; /* Parallel transfer with independent IO or collective IO with this mode (H5D_XFER_MPIO_COLLECTIVE_OPT_NAME) */ + hbool_t mpio_coll_opt_valid; /* Whether parallel transfer option is valid */ + H5FD_mpio_chunk_opt_t mpio_chunk_opt_mode; /* Collective chunk option (H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME) */ + hbool_t mpio_chunk_opt_mode_valid; /* Whether collective chunk option is valid */ + unsigned mpio_chunk_opt_num; /* Collective chunk thrreshold (H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME) */ + hbool_t mpio_chunk_opt_num_valid; /* Whether collective chunk threshold is valid */ + unsigned mpio_chunk_opt_ratio; /* Collective chunk ratio (H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME) */ + hbool_t mpio_chunk_opt_ratio_valid; /* Whether collective chunk ratio is valid */ +#endif /* H5_HAVE_PARALLEL */ + H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */ + hbool_t err_detect_valid; /* Whether error detection info is valid */ + H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */ + hbool_t filter_cb_valid; /* Whether filter callback function is valid */ + H5Z_data_xform_t *data_transform; /* Data transform info (H5D_XFER_XFORM_NAME) */ + hbool_t data_transform_valid; /* Whether data transform info is valid */ + H5T_vlen_alloc_info_t vl_alloc_info; /* VL datatype alloc info (H5D_XFER_VLEN_*_NAME) */ + hbool_t vl_alloc_info_valid; /* Whether VL datatype alloc info is valid */ + hbool_t dcr_flag; /* Direct chunk read flag (H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME) */ + hbool_t dcr_flag_valid; /* Whether direct chunk read flag is valid */ + hsize_t *dcr_offset; /* Direct chunk read offset (H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME) */ + hbool_t dcr_offset_valid; /* Whether direct chunk read offset is valid */ + hbool_t dcw_flag; /* Direct chunk write flag (H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME) */ + hbool_t dcw_flag_valid; /* Whether direct chunk write flag is valid */ + uint32_t dcw_filters; /* Direct chunk write filter flags (H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME) */ + hbool_t dcw_filters_valid; /* Whether direct chunk write filter flags is valid */ + hsize_t *dcw_offset; /* Direct chunk write offset (H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME) */ + hbool_t dcw_offset_valid; /* Whether direct chunk write offset is valid */ + uint32_t dcw_datasize; /* Direct chunk write data size (H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME) */ + hbool_t dcw_datasize_valid; /* Whether direct chunk write data size is valid */ + H5T_conv_cb_t dt_conv_cb; /* Datatype conversion struct (H5D_XFER_CONV_CB_NAME) */ + hbool_t dt_conv_cb_valid; /* Whether datatype conversion struct is valid */ + + /* Set DXPL properties to return to application */ + uint32_t dcr_filters; /* Direct chunk read filter flags (H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME) */ + hbool_t dcr_filters_set; /* Whether direct chunk read filter flags are set */ +#ifdef H5_HAVE_PARALLEL + H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chunk_opt; /* Chunk optimization mode used for parallel I/O (H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME) */ + hbool_t mpio_actual_chunk_opt_set; /* Whether chunk optimization mode used for parallel I/O is set */ + H5D_mpio_actual_io_mode_t mpio_actual_io_mode; /* Actual I/O mode used for parallel I/O (H5D_MPIO_ACTUAL_IO_MODE_NAME) */ + hbool_t mpio_actual_io_mode_set; /* Whether actual I/O mode used for parallel I/O is set */ + uint32_t mpio_local_no_coll_cause; /* Local reason for breaking collective I/O (H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME) */ + hbool_t mpio_local_no_coll_cause_set; /* Whether local reason for breaking collective I/O is set */ + hbool_t mpio_local_no_coll_cause_valid; /* Whether local reason for breaking collective I/O is valid */ + uint32_t mpio_global_no_coll_cause; /* Global reason for breaking collective I/O (H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME) */ + hbool_t mpio_global_no_coll_cause_set; /* Whether global reason for breaking collective I/O is set */ + hbool_t mpio_global_no_coll_cause_valid; /* Whether global reason for breaking collective I/O is valid */ + int mpio_coll_chunk_link_hard; /* Instrumented "collective chunk link hard" value (H5D_XFER_COLL_CHUNK_LINK_HARD_NAME) */ + hbool_t mpio_coll_chunk_link_hard_set; /* Whether instrumented "collective chunk link hard" value is set */ + int mpio_coll_chunk_multi_hard; /* Instrumented "collective chunk multi hard" value (H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME) */ + hbool_t mpio_coll_chunk_multi_hard_set; /* Whether instrumented "collective chunk multi hard" value is set */ + int mpio_coll_chunk_link_num_true; /* Instrumented "collective chunk link num true" value (H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME) */ + hbool_t mpio_coll_chunk_link_num_true_set; /* Whether instrumented "collective chunk link num true" value is set */ + int mpio_coll_chunk_link_num_false; /* Instrumented "collective chunk link num false" value (H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME) */ + hbool_t mpio_coll_chunk_link_num_false_set; /* Whether instrumented "collective chunk link num false" value is set */ + int mpio_coll_chunk_multi_ratio_coll; /* Instrumented "collective chunk multi ratio coll" value (H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME) */ + hbool_t mpio_coll_chunk_multi_ratio_coll_set; /* Whether instrumented "collective chunk multi ratio coll" value is set */ + int mpio_coll_chunk_multi_ratio_ind; /* Instrumented "collective chunk multi ratio ind" value (H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME) */ + hbool_t mpio_coll_chunk_multi_ratio_ind_set; /* Whether instrumented "collective chunk multi ratio ind" value is set */ +#endif /* H5_HAVE_PARALLEL */ + + /* Cached LAPL properties */ + size_t nlinks; /* Number of soft / UD links to traverse (H5L_ACS_NLINKS_NAME) */ + hbool_t nlinks_valid; /* Whether number of soft / UD links to traverse is valid */ +} H5CX_t; + +/* Typedef for nodes on the API context stack */ +typedef struct H5CX_node_t { + H5CX_t ctx; /* Context for current API call */ + struct H5CX_node_t *next; /* Pointer to previous context, on stack */ +} H5CX_node_t; + +/* Typedef for cached default dataset transfer property list information */ +typedef struct H5CX_dxpl_cache_t { + size_t max_temp_buf; /* Maximum temporary buffer size (H5D_XFER_MAX_TEMP_BUF_NAME) */ + void *tconv_buf; /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */ + void *bkgr_buf; /* Background conversion buffer (H5D_XFER_BKGR_BUF_NAME) */ + H5T_bkg_t bkgr_buf_type; /* Background buffer type (H5D_XFER_BKGR_BUF_NAME) */ + double btree_split_ratio[3]; /* B-tree split ratios (H5D_XFER_BTREE_SPLIT_RATIO_NAME) */ + size_t vec_size; /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */ +#ifdef H5_HAVE_PARALLEL + H5FD_mpio_xfer_t io_xfer_mode; /* Parallel transfer mode for this request (H5D_XFER_IO_XFER_MODE_NAME) */ + H5FD_mpio_collective_opt_t mpio_coll_opt; /* Parallel transfer with independent IO or collective IO with this mode (H5D_XFER_MPIO_COLLECTIVE_OPT_NAME) */ + uint32_t mpio_local_no_coll_cause; /* Local reason for breaking collective I/O (H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME) */ + uint32_t mpio_global_no_coll_cause; /* Global reason for breaking collective I/O (H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME) */ + H5FD_mpio_chunk_opt_t mpio_chunk_opt_mode; /* Collective chunk option (H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME) */ + unsigned mpio_chunk_opt_num; /* Collective chunk thrreshold (H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME) */ + unsigned mpio_chunk_opt_ratio; /* Collective chunk ratio (H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME) */ +#endif /* H5_HAVE_PARALLEL */ + H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */ + H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */ + H5Z_data_xform_t *data_transform; /* Data transform info (H5D_XFER_XFORM_NAME) */ + H5T_vlen_alloc_info_t vl_alloc_info; /* VL datatype alloc info (H5D_XFER_VLEN_*_NAME) */ + hbool_t dcr_flag; /* Direct chunk read flag (H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME) */ + hsize_t *dcr_offset; /* Direct chunk read offset (H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME) */ + hbool_t dcw_flag; /* Direct chunk write flag (H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME) */ + uint32_t dcw_datasize; /* Direct chunk write data size (H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME) */ + hsize_t *dcw_offset; /* Direct chunk write offset (H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME) */ + uint32_t dcw_filters; /* Direct chunk write filter flags (H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME) */ + H5T_conv_cb_t dt_conv_cb; /* Datatype conversion struct (H5D_XFER_CONV_CB_NAME) */ +} H5CX_dxpl_cache_t; + +/* Typedef for cached default link access property list information */ +typedef struct H5CX_lapl_cache_t { + size_t nlinks; /* Number of soft / UD links to traverse (H5L_ACS_NLINKS_NAME) */ +} H5CX_lapl_cache_t; + + +/********************/ +/* Local Prototypes */ +/********************/ +static H5CX_node_t **H5CX__get_context(void); +static void H5CX__push_common(H5CX_node_t *cnode); +static H5CX_node_t *H5CX__pop_common(void); + + +/*********************/ +/* Package Variables */ +/*********************/ + +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + + +/*******************/ +/* Local Variables */ +/*******************/ + +#ifndef H5_HAVE_THREADSAFE +static H5CX_node_t **H5CX_head_g = NULL; /* Pointer to head of context stack */ +#endif /* H5_HAVE_THREADSAFE */ + +/* Define a "default" dataset transfer property list cache structure to use for default DXPLs */ +static H5CX_dxpl_cache_t H5CX_def_dxpl_cache; + +/* Define a "default" link access property list cache structure to use for default LAPLs */ +static H5CX_lapl_cache_t H5CX_def_lapl_cache; + +/* Declare a static free list to manage H5CX_node_t structs */ +H5FL_DEFINE_STATIC(H5CX_node_t); + + + +/*-------------------------------------------------------------------------- +NAME + H5CX__init_package -- Initialize interface-specific information +USAGE + herr_t H5CX__init_package() +RETURNS + Non-negative on success/Negative on failure +DESCRIPTION + Initializes any interface-specific data or routines. +--------------------------------------------------------------------------*/ +herr_t +H5CX__init_package(void) +{ + H5P_genplist_t *dx_plist; /* Data transfer property list */ + H5P_genplist_t *la_plist; /* Link access property list */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + +#ifndef H5_HAVE_THREADSAFE + /* Allocate the context stack head pointer */ + if(NULL = (H5CX_head_g = (H5CX_node_t **)HDmalloc(sizeof(H5CX_node_t *)))) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTALLOC, FAIL, "can't allocate pointer to head of context stack") + *H5CX_head_g = NULL; +#endif /* H5_HAVE_THREADSAFE */ + + /* Reset the "default DXPL cache" information */ + HDmemset(&H5CX_def_dxpl_cache, 0, sizeof(H5CX_dxpl_cache_t)); + + /* Get the default DXPL cache information */ + + /* Get the default dataset transfer property list */ + if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(H5P_DATASET_XFER_DEFAULT))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + + /* Get B-tree split ratios */ + if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &H5CX_def_dxpl_cache.btree_split_ratio) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve B-tree split ratios") + + /* Get maximum temporary buffer size value */ + if(H5P_get(dx_plist, H5D_XFER_MAX_TEMP_BUF_NAME, &H5CX_def_dxpl_cache.max_temp_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve maximum temporary buffer size") + + /* Get temporary buffer pointer */ + if(H5P_get(dx_plist, H5D_XFER_TCONV_BUF_NAME, &H5CX_def_dxpl_cache.tconv_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve temporary buffer pointer") + + /* Get background buffer pointer */ + if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_NAME, &H5CX_def_dxpl_cache.bkgr_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve background buffer pointer") + + /* Get background buffer type */ + if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &H5CX_def_dxpl_cache.bkgr_buf_type) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve background buffer type") + + /* Get I/O vector size */ + if(H5P_get(dx_plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &H5CX_def_dxpl_cache.vec_size) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve I/O vector size") + +#ifdef H5_HAVE_PARALLEL + /* Collect Parallel I/O information for possible later use */ + if(H5P_get(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &H5CX_def_dxpl_cache.io_xfer_mode) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve parallel transfer method") + if(H5P_get(dx_plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &H5CX_def_dxpl_cache.mpio_coll_opt) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve collective transfer option") + if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, &H5CX_def_dxpl_cache.mpio_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization option") + if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, &H5CX_def_dxpl_cache.mpio_chunk_opt_num) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization threshold") + if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, &H5CX_def_dxpl_cache.mpio_chunk_opt_ratio) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization ratio") + + /* Get the local & global reasons for breaking collective I/O values */ + if(H5P_get(dx_plist, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &H5CX_def_dxpl_cache.mpio_local_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve local cause for breaking collective I/O") + if(H5P_get(dx_plist, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &H5CX_def_dxpl_cache.mpio_global_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve global cause for breaking collective I/O") +#endif /* H5_HAVE_PARALLEL */ + + /* Get error detection properties */ + if(H5P_get(dx_plist, H5D_XFER_EDC_NAME, &H5CX_def_dxpl_cache.err_detect) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve error detection info") + + /* Get filter callback function */ + if(H5P_get(dx_plist, H5D_XFER_FILTER_CB_NAME, &H5CX_def_dxpl_cache.filter_cb) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve filter callback function") + + /* Look at the data transform property */ + /* (Note: 'peek', not 'get' - if this turns out to be a problem, we may need + * to copy it and free this in the H5CX terminate routine. -QAK) + */ + if(H5P_peek(dx_plist, H5D_XFER_XFORM_NAME, &H5CX_def_dxpl_cache.data_transform) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve data transform info") + + /* Get VL datatype alloc info */ + if(H5P_get(dx_plist, H5D_XFER_VLEN_ALLOC_NAME, &H5CX_def_dxpl_cache.vl_alloc_info.alloc_func) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get(dx_plist, H5D_XFER_VLEN_ALLOC_INFO_NAME, &H5CX_def_dxpl_cache.vl_alloc_info.alloc_info) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get(dx_plist, H5D_XFER_VLEN_FREE_NAME, &H5CX_def_dxpl_cache.vl_alloc_info.free_func) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get(dx_plist, H5D_XFER_VLEN_FREE_INFO_NAME, &H5CX_def_dxpl_cache.vl_alloc_info.free_info) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + + /* Get direct chunk read info */ + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &H5CX_def_dxpl_cache.dcr_flag) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk read flag") + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, &H5CX_def_dxpl_cache.dcr_offset) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk read offset") + + /* Get direct chunk write info */ + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &H5CX_def_dxpl_cache.dcw_flag) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write flag") + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &H5CX_def_dxpl_cache.dcw_filters) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write filter mask") + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &H5CX_def_dxpl_cache.dcw_offset) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write offset") + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &H5CX_def_dxpl_cache.dcw_datasize) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write data size") + + /* Get datatype conversion struct */ + if(H5P_get(dx_plist, H5D_XFER_CONV_CB_NAME, &H5CX_def_dxpl_cache.dt_conv_cb) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve datatype conversion exception callback") + + + /* Reset the "default LAPL cache" information */ + HDmemset(&H5CX_def_lapl_cache, 0, sizeof(H5CX_lapl_cache_t)); + + /* Get the default LAPL cache information */ + + /* Get the default link access property list */ + if(NULL == (la_plist = (H5P_genplist_t *)H5I_object(H5P_LINK_ACCESS_DEFAULT))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not a link access property list") + + /* Get number of soft / UD links to traverse */ + if(H5P_get(la_plist, H5L_ACS_NLINKS_NAME, &H5CX_def_lapl_cache.nlinks) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve number of soft / UD links to traverse") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX__init_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_term_package + * + * Purpose: Terminate this interface. + * + * Return: Success: Positive if anything was done that might + * affect other interfaces; zero otherwise. + * Failure: Negative. + * + * Programmer: Quincey Koziol + * Februrary 22, 2018 + * + *------------------------------------------------------------------------- + */ +int +H5CX_term_package(void) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { +#ifndef H5_HAVE_THREADSAFE + /* Release pointer to head of API context stack */ + HDfree(H5CX_head_g); + H5CX_head_g = NULL; +#endif /* H5_HAVE_THREADSAFE */ + + H5_PKG_INIT_VAR = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(0) +} /* end H5CX_term_package() */ + + +#ifdef H5_HAVE_THREADSAFE +/*------------------------------------------------------------------------- + * Function: H5CX__get_context + * + * Purpose: Support function for H5CX_get_my_context() to initialize and + * acquire per-thread API context stack. + * + * Return: Success: Non-NULL pointer to head pointer of API context stack for thread + * Failure: NULL + * + * Programmer: Quincey Koziol + * March 12, 2018 + * + *------------------------------------------------------------------------- + */ +static H5CX_node_t ** +H5CX__get_context(void) +{ + H5CX_node_t **ctx = NULL; + + FUNC_ENTER_STATIC_NOERR + + ctx = (H5CX_node_t **)H5TS_get_thread_local_value(H5TS_apictx_key_g); + + if(!ctx) { + /* No associated value with current thread - create one */ +#ifdef H5_HAVE_WIN_THREADS + /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */ + ctx = (H5CX_node_t **)LocalAlloc(LPTR, sizeof(H5CX_node_t *)); +#else + /* Use HDmalloc here since this has to match the HDfree in the + * destructor and we want to avoid the codestack there. + */ + ctx = (H5CX_node_t **)HDmalloc(sizeof(H5CX_node_t *)); +#endif /* H5_HAVE_WIN_THREADS */ + HDassert(ctx); + + /* Reset the thread-specific info */ + *ctx = NULL; + + /* (It's not necessary to release this in this API, it is + * released by the "key destructor" set up in the H5TS + * routines. See calls to pthread_key_create() in H5TS.c -QAK) + */ + H5TS_set_thread_local_value(H5TS_apictx_key_g, (void *)ctx); + } /* end if */ + + /* Set return value */ + FUNC_LEAVE_NOAPI(ctx) +} /* end H5CX__get_context() */ +#endif /* H5_HAVE_THREADSAFE */ + + +/*------------------------------------------------------------------------- + * Function: H5CX__push_common + * + * Purpose: Internal routine to push a context for an API call. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 22, 2018 + * + *------------------------------------------------------------------------- + */ +static void +H5CX__push_common(H5CX_node_t *cnode) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(cnode); + + /* Set non-zero context info */ + cnode->ctx.dxpl_id = H5P_DATASET_XFER_DEFAULT; + cnode->ctx.lapl_id = H5P_LINK_ACCESS_DEFAULT; + cnode->ctx.tag = H5AC__INVALID_TAG; + cnode->ctx.ring = H5AC_RING_USER; + + /* Push context node onto stack */ + cnode->next = *head; + *head = cnode; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX__push_common() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_push + * + * Purpose: Pushes a context for an API call. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 19, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_push(void) +{ + H5CX_node_t *cnode = NULL; /* Context node */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Allocate & clear API context node */ + if(NULL == (cnode = H5FL_CALLOC(H5CX_node_t))) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTALLOC, FAIL, "unable to allocate new struct") + + /* Set context info */ + H5CX__push_common(cnode); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_push() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_push_special + * + * Purpose: Pushes a context for an API call, without using library routines. + * + * Note: This should only be called in special circumstances, like H5close. + * + * Return: + * + * Programmer: Quincey Koziol + * Februrary 22, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_push_special(void) +{ + H5CX_node_t *cnode; /* Context node */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Allocate & clear API context node, without using library API routines */ + cnode = (H5CX_node_t *)HDcalloc(1, sizeof(H5CX_node_t)); + HDassert(cnode); + + /* Set context info */ + H5CX__push_common(cnode); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_push_special() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_is_def_dxpl + * + * Purpose: Checks if the API context is using the library's default DXPL + * + * Return: TRUE / FALSE (can't fail) + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +hbool_t +H5CX_is_def_dxpl(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT); +} /* end H5CX_is_def_dxpl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_dxpl + * + * Purpose: Sets the DXPL for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 8, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_dxpl(hid_t dxpl_id) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(*head); + + /* Set the API context's DXPL to a new value */ + (*head)->ctx.dxpl_id = dxpl_id; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_dxpl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_lapl + * + * Purpose: Sets the LAPL for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 10, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_lapl(hid_t lapl_id) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context's LAPL to a new value */ + (*head)->ctx.lapl_id = lapl_id; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_lapl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_apl + * + * Purpose: Validaties an access property list, and sanity checking & + * setting up collective operations. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 19, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, + hid_t +#ifndef H5_HAVE_PARALLEL + H5_ATTR_UNUSED +#endif /* H5_HAVE_PARALLEL */ + loc_id, hbool_t +#ifndef H5_HAVE_PARALLEL + H5_ATTR_UNUSED +#endif /* H5_HAVE_PARALLEL */ + is_collective) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(acspl_id); + HDassert(libclass); + HDassert(head && *head); + + /* Set access plist to the default property list of the appropriate class if it's the generic default */ + if(H5P_DEFAULT == *acspl_id) + *acspl_id = *libclass->def_plist_id; + else { + htri_t is_lapl; /* Whether the access property list is (or is derived from) a link access property list */ + +#ifdef H5_DEBUG_BUILD + /* Sanity check the access property list class */ + if(TRUE != H5P_isa_class(*acspl_id, *libclass->class_id)) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not the required access property list") +#endif /* H5_DEBUG_BUILD */ + + /* Check for link access property and set API context if so */ + if((is_lapl = H5P_class_isa(*libclass->pclass, *H5P_CLS_LACC->pclass)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't check for link access class") + else if(is_lapl) + (*head)->ctx.lapl_id = *acspl_id; + +#ifdef H5_HAVE_PARALLEL + /* If this routine is not guaranteed to be collective (i.e. it doesn't + * modify the structural metadata in a file), check if we should use + * a collective metadata read. + */ + if(!is_collective) { + H5P_genplist_t *plist; /* Property list pointer */ + H5P_coll_md_read_flag_t md_coll_read; /* Collective metadata read flag */ + + /* Get the plist structure for the access property list */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(*acspl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get the collective metadata read flag */ + if(H5P_peek(plist, H5_COLL_MD_READ_FLAG_NAME, &md_coll_read) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't get core collective metadata read flag") + + /* If collective metadata read requested, set collective metadata read flag */ + if(H5P_USER_TRUE == md_coll_read) + is_collective = TRUE; + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + } /* end else */ + +#ifdef H5_HAVE_PARALLEL + /* Check for collective operation */ + if(is_collective) { + /* Set collective metadata read flag */ + (*head)->ctx.coll_metadata_read = TRUE; + + /* If parallel is enabled and the file driver used is the MPI-IO + * VFD, issue an MPI barrier for easier debugging if the API function + * calling this is supposed to be called collectively. Note that this + * happens only when the environment variable H5_COLL_BARRIER is set + * to non 0. + */ + if(H5_coll_api_sanity_check_g) { + MPI_Comm mpi_comm; /* File communicator */ + + /* Retrieve the MPI communicator from the loc_id or the fapl_id */ + if(H5F_mpi_retrieve_comm(loc_id, *acspl_id, &mpi_comm) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") + + /* issue the barrier */ + if(mpi_comm != MPI_COMM_NULL) + MPI_Barrier(mpi_comm); + } /* end if */ + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_apl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_loc + * + * Purpose: Sanity checks and sets up collective operations. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 8, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_loc(hid_t +#ifndef H5_HAVE_PARALLEL + H5_ATTR_UNUSED +#endif /* H5_HAVE_PARALLEL */ + loc_id, hbool_t +#ifndef H5_HAVE_PARALLEL + H5_ATTR_UNUSED +#endif /* H5_HAVE_PARALLEL */ + is_collective) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + +#ifdef H5_HAVE_PARALLEL + /* Check for collective operation */ + if(is_collective) { + /* Set collective metadata read flag */ + (*head)->ctx.coll_metadata_read = TRUE; + + /* If parallel is enabled and the file driver used is the MPI-IO + * VFD, issue an MPI barrier for easier debugging if the API function + * calling this is supposed to be called collectively. Note that this + * happens only when the environment variable H5_COLL_BARRIER is set + * to non 0. + */ + if(H5_coll_api_sanity_check_g) { + MPI_Comm mpi_comm; /* File communicator */ + + /* Retrieve the MPI communicator from the loc_id or the fapl_id */ + if(H5F_mpi_retrieve_comm(loc_id, H5P_DEFAULT, &mpi_comm) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") + + /* issue the barrier */ + if(mpi_comm != MPI_COMM_NULL) + MPI_Barrier(mpi_comm); + } /* end if */ + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_loc() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dxpl + * + * Purpose: Retrieves the DXPL ID for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 20, 2018 + * + *------------------------------------------------------------------------- + */ +hid_t +H5CX_get_dxpl(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.dxpl_id) +} /* end H5CX_get_dxpl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_lapl + * + * Purpose: Retrieves the LAPL ID for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 10, 2018 + * + *------------------------------------------------------------------------- + */ +hid_t +H5CX_get_lapl(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.lapl_id) +} /* end H5CX_get_lapl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_tag + * + * Purpose: Retrieves the object tag for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 20, 2018 + * + *------------------------------------------------------------------------- + */ +haddr_t +H5CX_get_tag(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.tag) +} /* end H5CX_get_tag() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_ring + * + * Purpose: Retrieves the metadata cache ring for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 22, 2018 + * + *------------------------------------------------------------------------- + */ +H5AC_ring_t +H5CX_get_ring(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.ring) +} /* end H5CX_get_ring() */ + +#ifdef H5_HAVE_PARALLEL + +/*------------------------------------------------------------------------- + * Function: H5CX_get_coll_metadata_read + * + * Purpose: Retrieves the "do collective metadata reads" flag for the current API call context. + * + * Return: TRUE / FALSE on success / + * + * Programmer: Quincey Koziol + * Februrary 23, 2018 + * + *------------------------------------------------------------------------- + */ +hbool_t +H5CX_get_coll_metadata_read(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.coll_metadata_read) +} /* end H5CX_get_coll_metadata_read() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpi_coll_datatypes + * + * Purpose: Retrieves the MPI datatypes for collective I/O for the current API call context. + * + * Note: This is only a shallow copy, the datatypes are not duplicated. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpi_coll_datatypes(MPI_Datatype *btype, MPI_Datatype *ftype) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(btype); + HDassert(ftype); + HDassert(head && *head); + + /* Set the API context values */ + *btype = (*head)->ctx.btype; + *ftype = (*head)->ctx.ftype; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpi_coll_datatypes() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_btree_split_ratios + * + * Purpose: Retrieves the B-tree split ratios for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 23, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_btree_split_ratios(double split_ratio[3]) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(split_ratio); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.btree_split_ratio_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + HDmemcpy((*head)->ctx.btree_split_ratio, &H5CX_def_dxpl_cache.btree_split_ratio, sizeof(H5CX_def_dxpl_cache.btree_split_ratio)); + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get B-tree split ratios */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_BTREE_SPLIT_RATIO_NAME, (*head)->ctx.btree_split_ratio) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't retrieve B-tree split ratios") + } /* end else */ + + /* Mark the B-tree split ratio values as valid */ + (*head)->ctx.btree_split_ratio_valid = TRUE; + } /* end if */ + + /* Get the B-tree split ratio values */ + HDmemcpy(split_ratio, &(*head)->ctx.btree_split_ratio, sizeof((*head)->ctx.btree_split_ratio)); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_btree_split_ratios() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_max_temp_buf + * + * Purpose: Retrieves the maximum temporary buffer size for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_max_temp_buf(size_t *max_temp_buf) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(max_temp_buf); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.max_temp_buf_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.max_temp_buf = H5CX_def_dxpl_cache.max_temp_buf; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get maximum temporary buffer size value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MAX_TEMP_BUF_NAME, &(*head)->ctx.max_temp_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve maximum temporary buffer size") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.max_temp_buf_valid = TRUE; + } /* end if */ + + /* Get the value */ + *max_temp_buf = (*head)->ctx.max_temp_buf; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_max_temp_buf() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_tconv_buf + * + * Purpose: Retrieves the temporary buffer pointer for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_tconv_buf(void **tconv_buf) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(tconv_buf); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.tconv_buf_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.tconv_buf = H5CX_def_dxpl_cache.tconv_buf; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get temporary conversion buffer pointer value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_TCONV_BUF_NAME, &(*head)->ctx.tconv_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve temporary buffer pointer") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.tconv_buf_valid = TRUE; + } /* end if */ + + /* Get the value */ + *tconv_buf = (*head)->ctx.tconv_buf; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_tconv_buf() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_bkgr_buf + * + * Purpose: Retrieves the background buffer pointer for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_bkgr_buf(void **bkgr_buf) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(bkgr_buf); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.bkgr_buf_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.bkgr_buf = H5CX_def_dxpl_cache.bkgr_buf; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get background conversion buffer pointer value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_BKGR_BUF_NAME, &(*head)->ctx.bkgr_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve background buffer pointer") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.bkgr_buf_valid = TRUE; + } /* end if */ + + /* Get the value */ + *bkgr_buf = (*head)->ctx.bkgr_buf; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_bkgr_buf() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_bkgr_buf_type + * + * Purpose: Retrieves the background buffer type for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_bkgr_buf_type(H5T_bkg_t *bkgr_buf_type) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(bkgr_buf_type); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.bkgr_buf_type_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.bkgr_buf_type = H5CX_def_dxpl_cache.bkgr_buf_type; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get background buffer type value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_BKGR_BUF_TYPE_NAME, &(*head)->ctx.bkgr_buf_type) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve background buffer type") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.bkgr_buf_type_valid = TRUE; + } /* end if */ + + /* Get the value */ + *bkgr_buf_type = (*head)->ctx.bkgr_buf_type; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_bkgr_buf_type() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_vec_size + * + * Purpose: Retrieves the hyperslab vector size for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_vec_size(size_t *vec_size) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(vec_size); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.vec_size_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.vec_size = H5CX_def_dxpl_cache.vec_size; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get hyperslab vector size value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &(*head)->ctx.vec_size) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve I/O vector size") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.vec_size_valid = TRUE; + } /* end if */ + + /* Get the value */ + *vec_size = (*head)->ctx.vec_size; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_vec_size() */ + +#ifdef H5_HAVE_PARALLEL + +/*------------------------------------------------------------------------- + * Function: H5CX_get_io_xfer_mode + * + * Purpose: Retrieves the parallel transfer mode for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_io_xfer_mode(H5FD_mpio_xfer_t *io_xfer_mode) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(io_xfer_mode); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.io_xfer_mode_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.io_xfer_mode = H5CX_def_dxpl_cache.io_xfer_mode; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get parallel transfer mode value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_IO_XFER_MODE_NAME, &(*head)->ctx.io_xfer_mode) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve parallel transfer method") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.io_xfer_mode_valid = TRUE; + } /* end if */ + + /* Get the value */ + *io_xfer_mode = (*head)->ctx.io_xfer_mode; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_io_xfer_mode() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_coll_opt + * + * Purpose: Retrieves the collective / independent parallel I/O option for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_coll_opt(H5FD_mpio_collective_opt_t *mpio_coll_opt) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_coll_opt); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.mpio_coll_opt_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_coll_opt = H5CX_def_dxpl_cache.mpio_coll_opt; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get collective I/O option value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &(*head)->ctx.mpio_coll_opt) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve collective transfer option") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_coll_opt_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_coll_opt = (*head)->ctx.mpio_coll_opt; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_coll_opt() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_local_no_coll_cause + * + * Purpose: Retrieves the local cause for breaking collective I/O for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_local_no_coll_cause(uint32_t *mpio_local_no_coll_cause) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_local_no_coll_cause); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved or set already */ + if(!((*head)->ctx.mpio_local_no_coll_cause_valid || (*head)->ctx.mpio_local_no_coll_cause_set)) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_local_no_coll_cause = H5CX_def_dxpl_cache.mpio_local_no_coll_cause; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get the value */ + if(H5P_get((*head)->ctx.dxpl, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_local_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve local cause for breaking collective I/O") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_local_no_coll_cause_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_local_no_coll_cause = (*head)->ctx.mpio_local_no_coll_cause; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_local_no_coll_cause() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_global_no_coll_cause + * + * Purpose: Retrieves the global cause for breaking collective I/O for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_global_no_coll_cause(uint32_t *mpio_global_no_coll_cause) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_global_no_coll_cause); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved or set already */ + if(!((*head)->ctx.mpio_global_no_coll_cause_valid || (*head)->ctx.mpio_global_no_coll_cause_set)) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_global_no_coll_cause = H5CX_def_dxpl_cache.mpio_global_no_coll_cause; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get the value */ + if(H5P_get((*head)->ctx.dxpl, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_global_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve global cause for breaking collective I/O") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_global_no_coll_cause_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_global_no_coll_cause = (*head)->ctx.mpio_global_no_coll_cause; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_global_no_coll_cause() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_chunk_opt_mode + * + * Purpose: Retrieves the collective chunk optimization mode for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_chunk_opt_mode(H5FD_mpio_chunk_opt_t *mpio_chunk_opt_mode) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_chunk_opt_mode); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved or set already */ + if(!(*head)->ctx.mpio_chunk_opt_mode_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_chunk_opt_mode = H5CX_def_dxpl_cache.mpio_chunk_opt_mode; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get the value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, &(*head)->ctx.mpio_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization option") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_chunk_opt_mode_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_chunk_opt_mode = (*head)->ctx.mpio_chunk_opt_mode; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_chunk_opt_mode() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_chunk_opt_num + * + * Purpose: Retrieves the collective chunk optimization threshold for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_chunk_opt_num(unsigned *mpio_chunk_opt_num) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_chunk_opt_num); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved or set already */ + if(!(*head)->ctx.mpio_chunk_opt_num_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_chunk_opt_num = H5CX_def_dxpl_cache.mpio_chunk_opt_num; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get the value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, &(*head)->ctx.mpio_chunk_opt_num) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization threshold") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_chunk_opt_num_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_chunk_opt_num = (*head)->ctx.mpio_chunk_opt_num; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_chunk_opt_num() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_chunk_opt_ratio + * + * Purpose: Retrieves the collective chunk optimization ratio for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_chunk_opt_ratio(unsigned *mpio_chunk_opt_ratio) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_chunk_opt_ratio); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved or set already */ + if(!(*head)->ctx.mpio_chunk_opt_ratio_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_chunk_opt_ratio = H5CX_def_dxpl_cache.mpio_chunk_opt_ratio; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get the value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, &(*head)->ctx.mpio_chunk_opt_ratio) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization ratio") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_chunk_opt_ratio_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_chunk_opt_ratio = (*head)->ctx.mpio_chunk_opt_ratio; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_chunk_opt_ratio() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_err_detect + * + * Purpose: Retrieves the error detection info for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_err_detect(H5Z_EDC_t *err_detect) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(err_detect); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.err_detect_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.err_detect = H5CX_def_dxpl_cache.err_detect; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get error detection info value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_EDC_NAME, &(*head)->ctx.err_detect) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve error detection info") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.err_detect_valid = TRUE; + } /* end if */ + + /* Get the value */ + *err_detect = (*head)->ctx.err_detect; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_err_detect() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_filter_cb + * + * Purpose: Retrieves the I/O filter callback function for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_filter_cb(H5Z_cb_t *filter_cb) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(filter_cb); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.filter_cb_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.filter_cb = H5CX_def_dxpl_cache.filter_cb; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get I/O filter callback function value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_FILTER_CB_NAME, &(*head)->ctx.filter_cb) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve filter callback function") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.filter_cb_valid = TRUE; + } /* end if */ + + /* Get the value */ + *filter_cb = (*head)->ctx.filter_cb; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_filter_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_data_transform + * + * Purpose: Retrieves the I/O filter callback function for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_data_transform(H5Z_data_xform_t **data_transform) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(data_transform); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.data_transform_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.data_transform = H5CX_def_dxpl_cache.data_transform; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get data transform info value */ + /* (Note: 'peek', not 'get' - if this turns out to be a problem, we may need + * to copy it and free this in the H5CX pop routine. -QAK) + */ + if(H5P_peek((*head)->ctx.dxpl, H5D_XFER_XFORM_NAME, &(*head)->ctx.data_transform) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve data transform info") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.data_transform_valid = TRUE; + } /* end if */ + + /* Get the value */ + *data_transform = (*head)->ctx.data_transform; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_data_transform() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_vlen_alloc_info + * + * Purpose: Retrieves the VL datatype alloc info for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 5, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_vlen_alloc_info(H5T_vlen_alloc_info_t *vl_alloc_info) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(vl_alloc_info); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.vl_alloc_info_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.vl_alloc_info = H5CX_def_dxpl_cache.vl_alloc_info; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get VL datatype alloc info values */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_VLEN_ALLOC_NAME, &(*head)->ctx.vl_alloc_info.alloc_func) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_VLEN_ALLOC_INFO_NAME, &(*head)->ctx.vl_alloc_info.alloc_info) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_VLEN_FREE_NAME, &(*head)->ctx.vl_alloc_info.free_func) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_VLEN_FREE_INFO_NAME, &(*head)->ctx.vl_alloc_info.free_info) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.vl_alloc_info_valid = TRUE; + } /* end if */ + + /* Get the value */ + *vl_alloc_info = (*head)->ctx.vl_alloc_info; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_vlen_alloc_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcr_flag + * + * Purpose: Retrieves the direct chunk read flag for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcr_flag(hbool_t *dcr_flag) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcr_flag); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcr_flag_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcr_flag = H5CX_def_dxpl_cache.dcr_flag; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk read flag */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &(*head)->ctx.dcr_flag) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk read flag") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcr_flag_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcr_flag = (*head)->ctx.dcr_flag; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcr_flag() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcr_offset + * + * Purpose: Retrieves the direct chunk read offset for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcr_offset(hsize_t **dcr_offset) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcr_offset); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcr_offset_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcr_offset = H5CX_def_dxpl_cache.dcr_offset; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk read offset */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, &(*head)->ctx.dcr_offset) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk read offset") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcr_offset_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcr_offset = (*head)->ctx.dcr_offset; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcr_offset() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcw_flag + * + * Purpose: Retrieves the direct chunk write flag for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcw_flag(hbool_t *dcw_flag) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcw_flag); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcw_flag_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcw_flag = H5CX_def_dxpl_cache.dcw_flag; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk write flag */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &(*head)->ctx.dcw_flag) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write flag") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcw_flag_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcw_flag = (*head)->ctx.dcw_flag; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcw_flag() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcw_filters + * + * Purpose: Retrieves the direct chunk write filter mask for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcw_filters(uint32_t *dcw_filters) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcw_filters); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcw_filters_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcw_filters = H5CX_def_dxpl_cache.dcw_filters; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk write filter mask */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &(*head)->ctx.dcw_filters) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write filters") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcw_filters_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcw_filters = (*head)->ctx.dcw_filters; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcw_filters() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcw_offset + * + * Purpose: Retrieves the direct chunk write offset for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcw_offset(hsize_t **dcw_offset) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcw_offset); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcw_offset_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcw_offset = H5CX_def_dxpl_cache.dcw_offset; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk write offset */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &(*head)->ctx.dcw_offset) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write offset") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcw_offset_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcw_offset = (*head)->ctx.dcw_offset; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcw_offset() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcw_datasize + * + * Purpose: Retrieves the direct chunk write data size for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcw_datasize(uint32_t *dcw_datasize) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcw_datasize); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcw_datasize_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcw_datasize = H5CX_def_dxpl_cache.dcw_datasize; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk write data size */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &(*head)->ctx.dcw_datasize) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write datasize") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcw_datasize_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcw_datasize = (*head)->ctx.dcw_datasize; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcw_datasize() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dt_conv_cb + * + * Purpose: Retrieves the datatype conversion exception callback for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 8, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dt_conv_cb(H5T_conv_cb_t *dt_conv_cb) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dt_conv_cb); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dt_conv_cb_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dt_conv_cb = H5CX_def_dxpl_cache.dt_conv_cb; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_CONV_CB_NAME, &(*head)->ctx.dt_conv_cb) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve datatype conversion exception callback") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dt_conv_cb_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dt_conv_cb = (*head)->ctx.dt_conv_cb; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dt_conv_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_nlinks + * + * Purpose: Retrieves the # of soft / UD links to traverse for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 10, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_nlinks(size_t *nlinks) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(nlinks); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.nlinks_valid) { + /* Check for default LAPL */ + if((*head)->ctx.lapl_id == H5P_LINK_ACCESS_DEFAULT) + (*head)->ctx.nlinks = H5CX_def_lapl_cache.nlinks; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.lapl) + /* Get the link access property list pointer */ + if(NULL == ((*head)->ctx.lapl = (H5P_genplist_t *)H5I_object((*head)->ctx.lapl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default link access property list") + + /* Get value */ + if(H5P_get((*head)->ctx.lapl, H5L_ACS_NLINKS_NAME, &(*head)->ctx.nlinks) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve number of soft / UD links to traverse") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.nlinks_valid = TRUE; + } /* end if */ + + /* Get the value */ + *nlinks = (*head)->ctx.nlinks; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_nlinks() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_tag + * + * Purpose: Sets the object tag for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * Februrary 20, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_tag(haddr_t tag) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + (*head)->ctx.tag = tag; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_tag() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_ring + * + * Purpose: Sets the metadata cache ring for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * Februrary 20, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_ring(H5AC_ring_t ring) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + (*head)->ctx.ring = ring; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_ring() */ + +#ifdef H5_HAVE_PARALLEL + +/*------------------------------------------------------------------------- + * Function: H5CX_set_coll_metadata_read + * + * Purpose: Sets the "do collective metadata reads" flag for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * Februrary 23, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_coll_metadata_read(hbool_t cmdr) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + (*head)->ctx.coll_metadata_read = cmdr; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_coll_metadata_read() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpi_coll_datatypes + * + * Purpose: Sets the MPI datatypes for collective I/O for the current API call context. + * + * Note: This is only a shallow copy, the datatypes are not duplicated. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_mpi_coll_datatypes(MPI_Datatype btype, MPI_Datatype ftype) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context values */ + (*head)->ctx.btype = btype; + (*head)->ctx.ftype = ftype; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_mpi_coll_datatypes() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_io_xfer_mode + * + * Purpose: Sets the parallel transfer mode for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_io_xfer_mode(H5FD_mpio_xfer_t io_xfer_mode) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context value */ + (*head)->ctx.io_xfer_mode = io_xfer_mode; + + /* Mark the value as valid */ + (*head)->ctx.io_xfer_mode_valid = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_io_xfer_mode() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpio_coll_opt + * + * Purpose: Sets the parallel transfer mode for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_mpio_coll_opt(H5FD_mpio_collective_opt_t mpio_coll_opt) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context value */ + (*head)->ctx.mpio_coll_opt = mpio_coll_opt; + + /* Mark the value as valid */ + (*head)->ctx.mpio_coll_opt_valid = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_mpio_coll_opt() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_vlen_alloc_info + * + * Purpose: Sets the VL datatype alloc info for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_vlen_alloc_info(H5MM_allocate_t alloc_func, + void *alloc_info, H5MM_free_t free_func, void *free_info) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context value */ + (*head)->ctx.vl_alloc_info.alloc_func = alloc_func; + (*head)->ctx.vl_alloc_info.alloc_info = alloc_info; + (*head)->ctx.vl_alloc_info.free_func = free_func; + (*head)->ctx.vl_alloc_info.free_info = free_info; + + /* Mark the value as valid */ + (*head)->ctx.vl_alloc_info_valid = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_vlen_alloc_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_nlinks + * + * Purpose: Sets the # of soft / UD links to traverse for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 10, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_nlinks(size_t nlinks) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context value */ + (*head)->ctx.nlinks = nlinks; + + /* Mark the value as valid */ + (*head)->ctx.nlinks_valid = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_nlinks() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_dcr_filters + * + * Purpose: Sets the direct chunk read filter flags for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_dcr_filters(uint32_t direct_filters) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Cache the filter mask for later, marking it to set in DXPL when context popped */ + (*head)->ctx.dcr_filters = direct_filters; + (*head)->ctx.dcr_filters_set = TRUE; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_dcr_filters() */ + +#ifdef H5_HAVE_PARALLEL + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpio_actual_chunk_opt + * + * Purpose: Sets the actual chunk optimization used for parallel I/O for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chunk_opt) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_actual_chunk_opt = mpio_actual_chunk_opt; + (*head)->ctx.mpio_actual_chunk_opt_set = TRUE; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_mpio_actual_chunk_opt() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpio_actual_io_mode + * + * Purpose: Sets the actual I/O mode used for parallel I/O for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_mpio_actual_io_mode(H5D_mpio_actual_io_mode_t mpio_actual_io_mode) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_actual_io_mode = mpio_actual_io_mode; + (*head)->ctx.mpio_actual_io_mode_set = TRUE; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_mpio_actual_chunk_opt() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpio_local_no_coll_cause + * + * Purpose: Sets the local reason for breaking collective I/O for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_mpio_local_no_coll_cause(uint32_t mpio_local_no_coll_cause) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_local_no_coll_cause = mpio_local_no_coll_cause; + (*head)->ctx.mpio_local_no_coll_cause_set = TRUE; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_mpio_local_no_coll_cause() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpio_global_no_coll_cause + * + * Purpose: Sets the global reason for breaking collective I/O for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_mpio_global_no_coll_cause(uint32_t mpio_global_no_coll_cause) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_global_no_coll_cause = mpio_global_no_coll_cause; + (*head)->ctx.mpio_global_no_coll_cause_set = TRUE; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_mpio_global_no_coll_cause() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_link_hard + * + * Purpose: Sets the instrumented "collective chunk link hard" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_link_hard(int mpio_coll_chunk_link_hard) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_link_hard_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_link_hard_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_link_hard = mpio_coll_chunk_link_hard; + (*head)->ctx.mpio_coll_chunk_link_hard_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_link_hard() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_multi_hard + * + * Purpose: Sets the instrumented "collective chunk multi hard" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_multi_hard(int mpio_coll_chunk_multi_hard) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_multi_hard_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_multi_hard_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_multi_hard = mpio_coll_chunk_multi_hard; + (*head)->ctx.mpio_coll_chunk_multi_hard_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_multi_hard() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_link_num_true + * + * Purpose: Sets the instrumented "collective chunk link num tru" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_link_num_true) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_link_num_true_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_link_num_true_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_link_num_true = mpio_coll_chunk_link_num_true; + (*head)->ctx.mpio_coll_chunk_link_num_true_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_link_num_true() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_link_num_false + * + * Purpose: Sets the instrumented "collective chunk link num false" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_link_num_false_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_link_num_false_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_link_num_false = mpio_coll_chunk_link_num_false; + (*head)->ctx.mpio_coll_chunk_link_num_false_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_link_num_false() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_multi_ratio_coll + * + * Purpose: Sets the instrumented "collective chunk multi ratio coll" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_coll) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_multi_ratio_coll = mpio_coll_chunk_multi_ratio_coll; + (*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_multi_ratio_coll() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_multi_ratio_ind + * + * Purpose: Sets the instrumented "collective chunk multi ratio ind" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_ind) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_multi_ratio_ind_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_multi_ratio_ind_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_multi_ratio_ind = mpio_coll_chunk_multi_ratio_ind; + (*head)->ctx.mpio_coll_chunk_multi_ratio_ind_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_multi_ratio_ind() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * Function: H5CX__pop_common + * + * Purpose: Common code for popping the context for an API call. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +static H5CX_node_t * +H5CX__pop_common(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + H5CX_node_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(head && *head); + + /* Check for cached DXPL properties to return to application */ + if((*head)->ctx.dcr_filters_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the chunk filter mask property */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, &(*head)->ctx.dcr_filters) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting filter mask xfer property") + } /* end if */ +#ifdef H5_HAVE_PARALLEL + if((*head)->ctx.mpio_actual_chunk_opt_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the actual chunk optimization mode for parallel I/O */ + if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &(*head)->ctx.mpio_actual_chunk_opt) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting actual chunk optimization mode for parallel I/O") + } /* end if */ + if((*head)->ctx.mpio_actual_io_mode_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the actual chunk optimization mode for parallel I/O */ + if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_ACTUAL_IO_MODE_NAME, &(*head)->ctx.mpio_actual_io_mode) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting actual I/O mode for parallel I/O") + } /* end if */ + if((*head)->ctx.mpio_local_no_coll_cause_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the local reason for breaking collective I/O */ + if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_local_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting local reason for breaking collective I/O") + } /* end if */ + if((*head)->ctx.mpio_global_no_coll_cause_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the global reason for breaking collective I/O */ + if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_global_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting global reason for breaking collective I/O") + } /* end if */ + if((*head)->ctx.mpio_coll_chunk_link_hard_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the instrumented "collective chunk link hard" value */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &(*head)->ctx.mpio_coll_chunk_link_hard) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk link hard value") + } /* end if */ + if((*head)->ctx.mpio_coll_chunk_multi_hard_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the instrumented "collective chunk multi hard" value */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &(*head)->ctx.mpio_coll_chunk_multi_hard) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk multi hard value") + } /* end if */ + if((*head)->ctx.mpio_coll_chunk_link_num_true_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the instrumented "collective chunk multi hard" value */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &(*head)->ctx.mpio_coll_chunk_link_num_true) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk link num true value") + } /* end if */ + if((*head)->ctx.mpio_coll_chunk_link_num_false_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the instrumented "collective chunk multi hard" value */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &(*head)->ctx.mpio_coll_chunk_link_num_false) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk link num false value") + } /* end if */ + if((*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the instrumented "collective chunk multi ratio coll" value */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, &(*head)->ctx.mpio_coll_chunk_multi_ratio_coll) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk multi ratio coll value") + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + + /* Pop the top context node from the stack */ + ret_value = (*head); + (*head) = (*head)->next; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX__pop_common() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_pop + * + * Purpose: Pops the context for an API call. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 19, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_pop(void) +{ + H5CX_node_t *cnode; /* Context node */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Perform common operations and get top context from stack */ + if(NULL == (cnode = H5CX__pop_common())) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error getting API context node") + + /* Free the context node */ + cnode = H5FL_FREE(H5CX_node_t, cnode); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_pop() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_pop_special + * + * Purpose: Pops the context for an API call, without using library routines. + * + * Note: This should only be called in special circumstances, like H5close. + * + * Return: + * + * Programmer: Quincey Koziol + * Februrary 22, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_pop_special(void) +{ + H5CX_node_t *cnode; /* Context node */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Perform common operations and get top context from stack */ + cnode = H5CX__pop_common(); + HDassert(cnode); + + /* Free the context node */ + HDfree(cnode); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_pop_special() */ + diff --git a/src/H5CXmodule.h b/src/H5CXmodule.h new file mode 100644 index 0000000..f6a8f29 --- /dev/null +++ b/src/H5CXmodule.h @@ -0,0 +1,33 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Sunday, February 25, 2018 + * + * Purpose: This file contains declarations which define macros for the + * H5CX package. Including this header means that the source file + * is part of the H5CX package. + */ +#ifndef _H5CXmodule_H +#define _H5CXmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5CX_MODULE +#define H5_MY_PKG H5CX +#define H5_MY_PKG_ERR H5E_CONTEXT +#define H5_MY_PKG_INIT YES + +#endif /* _H5CXmodule_H */ + diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h new file mode 100644 index 0000000..b9f238b --- /dev/null +++ b/src/H5CXprivate.h @@ -0,0 +1,142 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Header file for API contexts, etc. + */ +#ifndef _H5CXprivate_H +#define _H5CXprivate_H + +/* Include package's public header */ +#ifdef NOT_YET +#include "H5CXpublic.h" +#endif /* NOT_YET */ + +/* Private headers needed by this file */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#ifdef H5_HAVE_PARALLEL +#include "H5FDprivate.h" /* File drivers */ +#endif /* H5_HAVE_PARALLEL */ +#include "H5Zprivate.h" /* Data filters */ + + +/**************************/ +/* Library Private Macros */ +/**************************/ + + +/****************************/ +/* Library Private Typedefs */ +/****************************/ + + +/*****************************/ +/* Library-private Variables */ +/*****************************/ + + +/***************************************/ +/* Library-private Function Prototypes */ +/***************************************/ + +/* Library private routines */ +H5_DLL herr_t H5CX_push(void); +H5_DLL void H5CX_push_special(void); +H5_DLL hbool_t H5CX_is_def_dxpl(void); +H5_DLL herr_t H5CX_pop(void); +H5_DLL void H5CX_pop_special(void); + +/* "Setter" routines for API context info */ +H5_DLL void H5CX_set_dxpl(hid_t dxpl_id); +H5_DLL void H5CX_set_lapl(hid_t lapl_id); +H5_DLL herr_t H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, + hid_t loc_id, hbool_t is_collective); +H5_DLL herr_t H5CX_set_loc(hid_t loc_id, hbool_t is_collective); + +/* "Getter" routines for API context info */ +H5_DLL hid_t H5CX_get_dxpl(void); +H5_DLL hid_t H5CX_get_lapl(void); +H5_DLL haddr_t H5CX_get_tag(void); +H5_DLL H5AC_ring_t H5CX_get_ring(void); +#ifdef H5_HAVE_PARALLEL +H5_DLL hbool_t H5CX_get_coll_metadata_read(void); +H5_DLL herr_t H5CX_get_mpi_coll_datatypes(MPI_Datatype *btype, MPI_Datatype *ftype); +#endif /* H5_HAVE_PARALLEL */ + +/* "Getter" routines for DXPL properties cached in API context */ +H5_DLL herr_t H5CX_get_btree_split_ratios(double split_ratio[3]); +H5_DLL herr_t H5CX_get_max_temp_buf(size_t *max_temp_buf); +H5_DLL herr_t H5CX_get_tconv_buf(void **tconv_buf); +H5_DLL herr_t H5CX_get_bkgr_buf(void **bkgr_buf); +H5_DLL herr_t H5CX_get_bkgr_buf_type(H5T_bkg_t *bkgr_buf_type); +H5_DLL herr_t H5CX_get_vec_size(size_t *vec_size); +#ifdef H5_HAVE_PARALLEL +H5_DLL herr_t H5CX_get_io_xfer_mode(H5FD_mpio_xfer_t *io_xfer_mode); +H5_DLL herr_t H5CX_get_mpio_coll_opt(H5FD_mpio_collective_opt_t *mpio_coll_opt); +H5_DLL herr_t H5CX_get_mpio_local_no_coll_cause(uint32_t *mpio_local_no_coll_cause); +H5_DLL herr_t H5CX_get_mpio_global_no_coll_cause(uint32_t *mpio_global_no_coll_cause); +H5_DLL herr_t H5CX_get_mpio_chunk_opt_mode(H5FD_mpio_chunk_opt_t *mpio_chunk_opt_mode); +H5_DLL herr_t H5CX_get_mpio_chunk_opt_num(unsigned *mpio_chunk_opt_num); +H5_DLL herr_t H5CX_get_mpio_chunk_opt_ratio(unsigned *mpio_chunk_opt_ratio); +#endif /* H5_HAVE_PARALLEL */ +H5_DLL herr_t H5CX_get_err_detect(H5Z_EDC_t *err_detect); +H5_DLL herr_t H5CX_get_filter_cb(H5Z_cb_t *filter_cb); +H5_DLL herr_t H5CX_get_data_transform(H5Z_data_xform_t **data_transform); +H5_DLL herr_t H5CX_get_vlen_alloc_info(H5T_vlen_alloc_info_t *vl_alloc_info); +H5_DLL herr_t H5CX_get_dcr_flag(hbool_t *direct_read); +H5_DLL herr_t H5CX_get_dcr_offset(hsize_t **direct_offset); +H5_DLL herr_t H5CX_get_dcw_flag(hbool_t *direct_write); +H5_DLL herr_t H5CX_get_dcw_filters(uint32_t *direct_filters); +H5_DLL herr_t H5CX_get_dcw_offset(hsize_t **direct_offset); +H5_DLL herr_t H5CX_get_dcw_datasize(uint32_t *direct_datasize); +H5_DLL herr_t H5CX_get_dt_conv_cb(H5T_conv_cb_t *cb_struct); + +/* "Getter" routines for LAPL properties cached in API context */ +H5_DLL herr_t H5CX_get_nlinks(size_t *nlinks); + +/* "Setter" routines for API context info */ +H5_DLL void H5CX_set_tag(haddr_t tag); +H5_DLL void H5CX_set_ring(H5AC_ring_t ring); +#ifdef H5_HAVE_PARALLEL +H5_DLL void H5CX_set_coll_metadata_read(hbool_t cmdr); +H5_DLL herr_t H5CX_set_mpi_coll_datatypes(MPI_Datatype btype, MPI_Datatype ftype); +H5_DLL herr_t H5CX_set_mpio_coll_opt(H5FD_mpio_collective_opt_t mpio_coll_opt); +#endif /* H5_HAVE_PARALLEL */ + +/* "Setter" routines for DXPL properties cached in API context */ +#ifdef H5_HAVE_PARALLEL +H5_DLL herr_t H5CX_set_io_xfer_mode(H5FD_mpio_xfer_t io_xfer_mode); +#endif /* H5_HAVE_PARALLEL */ +H5_DLL herr_t H5CX_set_vlen_alloc_info(H5MM_allocate_t alloc_func, + void *alloc_info, H5MM_free_t free_func, void *free_info); + +/* "Setter" routines for LAPL properties cached in API context */ +H5_DLL herr_t H5CX_set_nlinks(size_t nlinks); + +/* "Setter" routines for cached DXPL properties that must be returned to application */ +H5_DLL void H5CX_set_dcr_filters(uint32_t direct_filters); +#ifdef H5_HAVE_PARALLEL +H5_DLL void H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t chunk_opt); +H5_DLL void H5CX_set_mpio_actual_io_mode(H5D_mpio_actual_io_mode_t actual_io_mode); +H5_DLL void H5CX_set_mpio_local_no_coll_cause(uint32_t mpio_local_no_coll_cause); +H5_DLL void H5CX_set_mpio_global_no_coll_cause(uint32_t mpio_global_no_coll_cause); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_link_hard(int mpio_coll_chunk_link_hard); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_multi_hard(int mpio_coll_chunk_multi_hard); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_link_num_true); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_coll); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_ind); +#endif /* H5_HAVE_PARALLEL */ + +#endif /* _H5CXprivate_H */ + diff --git a/src/H5Cepoch.c b/src/H5Cepoch.c index f8507a9..8bcab9f 100644 --- a/src/H5Cepoch.c +++ b/src/H5Cepoch.c @@ -64,15 +64,15 @@ static void * H5C__epoch_marker_deserialize(const void * image_ptr, size_t len, void * udata, hbool_t * dirty_ptr); static herr_t H5C__epoch_marker_image_len(const void * thing, size_t *image_len_ptr); -static herr_t H5C__epoch_marker_pre_serialize(H5F_t *f, - hid_t dxpl_id, void * thing, haddr_t addr, size_t len, - haddr_t * new_addr_ptr, size_t * new_len_ptr, unsigned * flags_ptr); +static herr_t H5C__epoch_marker_pre_serialize(H5F_t *f, void *thing, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, + unsigned *flags_ptr); static herr_t H5C__epoch_marker_serialize(const H5F_t *f, void * image_ptr, size_t len, void * thing); static herr_t H5C__epoch_marker_notify(H5C_notify_action_t action, void *thing); static herr_t H5C__epoch_marker_free_icr(void * thing); static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, - size_t H5_ATTR_UNUSED * fsf_size_ptr); + hsize_t H5_ATTR_UNUSED * fsf_size_ptr); /*********************/ @@ -180,7 +180,7 @@ H5C__epoch_marker_image_len(const void H5_ATTR_UNUSED *thing, static herr_t -H5C__epoch_marker_pre_serialize(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, +H5C__epoch_marker_pre_serialize(H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED *thing, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED len, haddr_t H5_ATTR_UNUSED *new_addr_ptr, size_t H5_ATTR_UNUSED *new_len_ptr, unsigned H5_ATTR_UNUSED *flags_ptr) @@ -229,7 +229,7 @@ H5C__epoch_marker_free_icr(void H5_ATTR_UNUSED * thing) static herr_t -H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, size_t H5_ATTR_UNUSED *fsf_size_ptr) +H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, hsize_t H5_ATTR_UNUSED *fsf_size_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ diff --git a/src/H5Cimage.c b/src/H5Cimage.c index 53d1712..3156079 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -114,14 +114,12 @@ static void H5C__prep_for_file_close__compute_fd_heights_real( static herr_t H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_ptr); static herr_t H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr); -static herr_t H5C__reconstruct_cache_contents(H5F_t *f, hid_t dxpl_id, - H5C_t *cache_ptr); +static herr_t H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr); static H5C_cache_entry_t *H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, const uint8_t **buf); -static herr_t H5C__write_cache_image_superblock_msg(H5F_t *f, hid_t dxpl_id, - hbool_t create); -static herr_t H5C__read_cache_image(H5F_t * f, hid_t dxpl_id, H5C_t *cache_ptr); -static herr_t H5C__write_cache_image(H5F_t *f, hid_t dxpl_id, const H5C_t *cache_ptr); +static herr_t H5C__write_cache_image_superblock_msg(H5F_t *f, hbool_t create); +static herr_t H5C__read_cache_image(H5F_t * f, H5C_t *cache_ptr); +static herr_t H5C__write_cache_image(H5F_t *f, const H5C_t *cache_ptr); static herr_t H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr); static herr_t H5C__free_image_entries_array(H5C_t *cache_ptr); @@ -391,7 +389,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__generate_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) +H5C__generate_cache_image(H5F_t *f, H5C_t *cache_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -414,7 +412,7 @@ H5C__generate_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) /* Write cache image block if so configured */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDC_IMAGE_BLK) { - if(H5C__write_cache_image(f, dxpl_id, cache_ptr) < 0) + if(H5C__write_cache_image(f, cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write metadata cache image block to file") H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr); @@ -466,7 +464,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, +H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t **entry_ptr_ptr, const H5C_class_t *type, haddr_t addr, void *udata) { @@ -678,7 +676,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, H5C__RESET_CACHE_ENTRY_STATS(ds_entry_ptr); /* Apply to to the newly deserialized entry */ - if(H5C__tag_entry(cache_ptr, ds_entry_ptr, dxpl_id) < 0) + if(H5C__tag_entry(cache_ptr, ds_entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Cannot tag metadata entry") /* We have successfully deserialized the prefetched entry. @@ -707,7 +705,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; } /* end if */ - if(H5C__flush_single_entry(f, dxpl_id, pf_entry_ptr, flush_flags) < 0) + if(H5C__flush_single_entry(f, pf_entry_ptr, flush_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "can't expunge prefetched entry") #ifndef NDEGUG /* verify deletion */ @@ -886,7 +884,7 @@ H5C__free_image_entries_array(H5C_t * cache_ptr) *------------------------------------------------------------------------- */ herr_t -H5C_force_cache_image_load(H5F_t *f, hid_t dxpl_id) +H5C_force_cache_image_load(H5F_t *f) { H5C_t *cache_ptr; herr_t ret_value = SUCCEED; /* Return value */ @@ -904,7 +902,7 @@ H5C_force_cache_image_load(H5F_t *f, hid_t dxpl_id) /* 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) + if(H5C__load_cache_image(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "can't load cache image") } /* end if */ @@ -1034,8 +1032,8 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5C__read_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) +static herr_t +H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1060,12 +1058,9 @@ H5C__read_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) #endif /* H5_HAVE_PARALLEL */ /* Read the buffer (if serial access, or rank 0 of parallel access) */ - if ( H5F_block_read(f, H5FD_MEM_SUPER, cache_ptr->image_addr, - cache_ptr->image_len, dxpl_id, - cache_ptr->image_buffer) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_READERROR, FAIL, \ - "Can't read metadata cache image block") + if(H5F_block_read(f, H5FD_MEM_SUPER, cache_ptr->image_addr, + cache_ptr->image_len, cache_ptr->image_buffer) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_READERROR, FAIL, "Can't read metadata cache image block") H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) @@ -1097,9 +1092,7 @@ H5C__read_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) #endif /* H5_HAVE_PARALLEL */ done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__read_cache_image() */ @@ -1121,7 +1114,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__load_cache_image(H5F_t *f, hid_t dxpl_id) +H5C__load_cache_image(H5F_t *f) { H5C_t * cache_ptr; herr_t ret_value = SUCCEED; /* Return value */ @@ -1154,11 +1147,11 @@ H5C__load_cache_image(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for cache image buffer") /* Load the image from file */ - if(H5C__read_cache_image(f, dxpl_id, cache_ptr) < 0) + if(H5C__read_cache_image(f, cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_READERROR, FAIL, "Can't read metadata cache image block") /* Reconstruct cache contents, from image */ - if(H5C__reconstruct_cache_contents(f, dxpl_id, cache_ptr) < 0) + if(H5C__reconstruct_cache_contents(f, cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTDECODE, FAIL, "Can't reconstruct cache contents from image block") /* Free the image buffer */ @@ -1174,7 +1167,7 @@ H5C__load_cache_image(H5F_t *f, hid_t dxpl_id) /* If directed, free the on disk metadata cache image */ if(cache_ptr->delete_image) { - if(H5F_super_ext_remove_msg(f, dxpl_id, H5O_MDCI_MSG_ID) < 0) + if(H5F__super_ext_remove_msg(f, H5O_MDCI_MSG_ID) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove metadata cache image message from superblock extension") /* Reset image block values */ @@ -1343,7 +1336,7 @@ H5C__image_entry_cmp(const void *_entry1, const void *_entry2) *------------------------------------------------------------------------- */ herr_t -H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated) +H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) { H5C_t * cache_ptr = NULL; haddr_t eoa_frag_addr = HADDR_UNDEF; @@ -1367,7 +1360,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated */ if(cache_ptr->load_image) { cache_ptr->load_image = FALSE; - if(H5C__load_cache_image(f, dxpl_id) < 0) + if(H5C__load_cache_image(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "can't load cache image") } /* end if */ @@ -1408,11 +1401,11 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDCI_SBE_MESG) - if(H5C__write_cache_image_superblock_msg(f, dxpl_id, TRUE) < 0) + if(H5C__write_cache_image_superblock_msg(f, TRUE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "creation of cache image SB mesg failed.") /* Serialize the cache */ - if(H5C__serialize_cache(f, dxpl_id) < 0) + if(H5C__serialize_cache(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "serialization of the cache failed") /* Scan the cache and record data needed to construct the @@ -1470,7 +1463,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * Note that we allocate the cache image directly from the file * driver so as to avoid unsettling the free space managers. */ - if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, dxpl_id, H5FD_MEM_SUPER, f, + if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, H5FD_MEM_SUPER, f, (hsize_t)p0_image_len, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_CACHE, H5E_NOSPACE, FAIL, "can't allocate file space for metadata cache image") } /* end if */ @@ -1480,7 +1473,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * this space directly from the file driver so as to avoid * unsettling the free space managers. */ - if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, dxpl_id, H5FD_MEM_SUPER, f, + if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, H5FD_MEM_SUPER, f, (hsize_t)(cache_ptr->image_data_len), &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_CACHE, H5E_NOSPACE, FAIL, "can't allocate file space for metadata cache image") @@ -1523,7 +1516,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDC_IMAGE_BLK) - if(H5C__write_cache_image_superblock_msg(f, dxpl_id, FALSE) < 0) + if(H5C__write_cache_image_superblock_msg(f, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "update of cache image SB mesg failed") /* At this point: @@ -1577,7 +1570,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDC_IMAGE_BLK) - if(H5F_super_ext_remove_msg(f, dxpl_id, H5O_MDCI_MSG_ID) < 0) + if(H5F__super_ext_remove_msg(f, H5O_MDCI_MSG_ID) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove MDC image msg from superblock ext") cache_ptr->image_ctl.generate_image = FALSE; @@ -3093,7 +3086,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__reconstruct_cache_contents(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) +H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) { H5C_cache_entry_t * pf_entry_ptr; /* Pointer to prefetched entry */ H5C_cache_entry_t * parent_ptr; /* Pointer to parent of prefetched entry */ @@ -3275,7 +3268,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) else write_permitted = cache_ptr->write_permitted; - if(H5C__make_space_in_cache(f, dxpl_id, 0, write_permitted) < 0) + if(H5C__make_space_in_cache(f, 0, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, FAIL, "H5C__make_space_in_cache failed") } /* end if */ @@ -3476,7 +3469,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__write_cache_image_superblock_msg(H5F_t *f, hid_t dxpl_id, hbool_t create) +H5C__write_cache_image_superblock_msg(H5F_t *f, hbool_t create) { H5C_t * cache_ptr; H5O_mdci_t mdci_msg; /* metadata cache image message */ @@ -3514,7 +3507,7 @@ H5C__write_cache_image_superblock_msg(H5F_t *f, hid_t dxpl_id, hbool_t create) mdci_msg.size = cache_ptr->image_len; /* Write metadata cache image message to superblock extension */ - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_MDCI_MSG_ID, &mdci_msg, create, mesg_flags) < 0) + if(H5F__super_ext_write_msg(f, H5O_MDCI_MSG_ID, &mdci_msg, create, mesg_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "can't write metadata cache image message to superblock extension") done: @@ -3536,7 +3529,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__write_cache_image(H5F_t *f, hid_t dxpl_id, const H5C_t *cache_ptr) +H5C__write_cache_image(H5F_t *f, const H5C_t *cache_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -3558,7 +3551,7 @@ H5C__write_cache_image(H5F_t *f, hid_t dxpl_id, const H5C_t *cache_ptr) #endif /* H5_HAVE_PARALLEL */ /* Write the buffer (if serial access, or rank 0 for parallel access) */ - if(H5F_block_write(f, H5FD_MEM_SUPER, cache_ptr->image_addr, cache_ptr->image_len, dxpl_id, cache_ptr->image_buffer) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, cache_ptr->image_addr, cache_ptr->image_len, cache_ptr->image_buffer) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't write metadata cache image block to file") #ifdef H5_HAVE_PARALLEL } /* end if */ diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index a75cd88..e342d69 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -37,14 +37,11 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Cpkg.h" /* Cache */ -#include "H5Dprivate.h" /* Datasets */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5FDprivate.h" /* File drivers */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ #ifdef H5_HAVE_PARALLEL @@ -62,12 +59,11 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5C__collective_write(H5F_t *f, hid_t dxpl_id); -static herr_t H5C__flush_candidate_entries(H5F_t *f, hid_t dxpl_id, - unsigned entries_to_flush[H5C_RING_NTYPES], +static herr_t H5C__collective_write(H5F_t *f); +static herr_t H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES], unsigned entries_to_clear[H5C_RING_NTYPES]); -static herr_t H5C__flush_candidates_in_ring(H5F_t *f, hid_t dxpl_id, - H5C_ring_t ring, unsigned entries_to_flush, unsigned entries_to_clear); +static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, + unsigned entries_to_flush, unsigned entries_to_clear); /*********************/ @@ -171,7 +167,6 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, hid_t dxpl_id, */ 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, @@ -387,7 +382,7 @@ H5C_apply_candidate_list(H5F_t * f, * If we don't do this, my experiments indicate that we will have a * noticably poorer hit ratio as a result. */ - if(H5C__flush_candidate_entries(f, dxpl_id, entries_to_flush, entries_to_clear) < 0) + if(H5C__flush_candidate_entries(f, entries_to_flush, entries_to_clear) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush candidates failed") /* If we've deferred writing to do it collectively, take care of that now */ @@ -396,7 +391,7 @@ H5C_apply_candidate_list(H5F_t * f, HDassert(cache_ptr->coll_write_list); /* Write collective list */ - if(H5C__collective_write(f, dxpl_id) < 0) + if(H5C__collective_write(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "can't write metadata collectively") } /* end if */ @@ -644,7 +639,6 @@ done: */ herr_t H5C_mark_entries_as_clean(H5F_t * f, - hid_t dxpl_id, unsigned ce_array_len, haddr_t * ce_array_ptr) { @@ -788,7 +782,7 @@ H5C_mark_entries_as_clean(H5F_t * f, entry_ptr = entry_ptr->prev; entries_cleared++; - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, + if(H5C__flush_single_entry(f, clear_ptr, (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__UPDATE_PAGE_BUFFER_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry") } /* end if */ @@ -818,7 +812,7 @@ H5C_mark_entries_as_clean(H5F_t * f, pinned_entries_cleared++; progress = TRUE; - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, + if(H5C__flush_single_entry(f, clear_ptr, (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__UPDATE_PAGE_BUFFER_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry") } /* end if */ @@ -922,10 +916,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__collective_write(H5F_t *f, hid_t dxpl_id) +H5C__collective_write(H5F_t *f) { H5AC_t *cache_ptr; - H5P_genplist_t *plist = NULL; H5FD_mpio_xfer_t orig_xfer_mode = H5FD_MPIO_COLLECTIVE; int count; int *length_array = NULL; @@ -947,12 +940,8 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) HDassert(cache_ptr->coll_write_list != NULL); /* Get original transfer mode */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \ - "not a data transfer property list") - - if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, &orig_xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") + if(H5CX_get_io_xfer_mode(&orig_xfer_mode) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") /* Get number of entries in collective write list */ count = (int)H5SL_count(cache_ptr->coll_write_list); @@ -964,35 +953,23 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) void *base_buf; int i; - if(H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ - "can't set MPI-I/O property") + /* Set new transfer mode */ + if(H5CX_set_io_xfer_mode(xfer_mode) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") /* Allocate arrays */ - if ( NULL == (length_array = - (int *)H5MM_malloc((size_t)count * sizeof(int))) ) - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \ - "memory allocation failed for collective write table length array") - - if ( NULL == (buf_array = - (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) ) - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \ - "memory allocation failed for collective buf table length array") - - if(NULL == (offset_array = - (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) ) - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \ - "memory allocation failed for collective offset table length array") + if(NULL == (length_array = (int *)H5MM_malloc((size_t)count * sizeof(int))) ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective write table length array") + if(NULL == (buf_array = (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective buf table length array") + if(NULL == (offset_array = (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective offset table length array") /* Fill arrays */ node = H5SL_first(cache_ptr->coll_write_list); HDassert(node); if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) - HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, \ - "can't retrieve skip list item") + HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") /* Set up initial array position & buffer base address */ length_array[0] = (int)entry_ptr->size; @@ -1005,8 +982,7 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) while(node) { if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) - HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, \ - "can't retrieve skip list item") + HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") /* Set up array position */ length_array[i] = (int)entry_ptr->size; @@ -1019,10 +995,7 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) } /* end while */ /* Create memory MPI type */ - if(MPI_SUCCESS != (mpi_code = - MPI_Type_create_hindexed(count, length_array, - buf_array, MPI_BYTE, - &btype))) + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, buf_array, MPI_BYTE, &btype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) btype_created = TRUE; @@ -1031,10 +1004,7 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) /* Create file MPI type */ - if(MPI_SUCCESS != (mpi_code = - MPI_Type_create_hindexed(count, length_array, - offset_array, MPI_BYTE, - &ftype))) + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, offset_array, MPI_BYTE, &ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) ftype_created = TRUE; @@ -1043,15 +1013,12 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) /* Pass buf type, file type to the file driver */ - if(H5FD_mpi_setup_collective(dxpl_id, &btype, &ftype) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ - "can't set MPI-I/O properties") + if(H5CX_set_mpi_coll_datatypes(btype, ftype) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") /* Write data */ - if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, - (size_t)1, dxpl_id, base_buf) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "unable to write entries collectively") + if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, (size_t)1, base_buf) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to write entries collectively") } /* end if */ else { @@ -1061,43 +1028,35 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) MPI_Info *info_p; MPI_Info info; +/* This should be rewritten to call H5F_block_write, with the correct + * buffer and file datatypes (null ones). -QAK, 2018/02/21 + */ if(H5F_get_mpi_handle(f, (MPI_File **)&mpi_fh_p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, \ - "can't get mpi file handle") + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't get mpi file handle") mpi_fh = *(MPI_File*)mpi_fh_p; - if (H5F_get_mpi_info(f, &info_p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, \ - "can't get mpi file info") + if(H5F_get_mpi_info(f, &info_p) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file info") info = *info_p; /* just to match up with the 1st MPI_File_set_view from * H5FD_mpio_write() */ - if(MPI_SUCCESS != (mpi_code = - MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, - MPI_BYTE, "native", - info))) + if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) /* just to match up with MPI_File_write_at_all from H5FD_mpio_write() */ HDmemset(&mpi_stat, 0, sizeof(MPI_Status)); - if(MPI_SUCCESS != (mpi_code = - MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, - NULL, 0, MPI_BYTE, &mpi_stat))) + if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, NULL, 0, MPI_BYTE, &mpi_stat))) HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code) /* just to match up with the 2nd MPI_File_set_view (reset) in * H5FD_mpio_write() */ - if(MPI_SUCCESS != (mpi_code = - MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, - MPI_BYTE, "native", - info))) + if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) - } /* end else */ done: @@ -1112,13 +1071,10 @@ done: if(ftype_created && MPI_SUCCESS != (mpi_code = MPI_Type_free(&ftype))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - /* Reset dxpl */ - if(orig_xfer_mode != H5FD_MPIO_COLLECTIVE) { - HDassert(plist); - if(H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &orig_xfer_mode) < 0) - HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ - "can't set MPI-I/O property") - } /* end if */ + /* Reset transfer mode in API context, if changed */ + if(orig_xfer_mode != H5FD_MPIO_COLLECTIVE) + if(H5CX_set_io_xfer_mode(orig_xfer_mode) < 0) + HDONE_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") FUNC_LEAVE_NOAPI(ret_value); } /* end H5C__collective_write() */ @@ -1163,8 +1119,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__flush_candidate_entries(H5F_t *f, hid_t dxpl_id, - unsigned entries_to_flush[H5C_RING_NTYPES], +H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES], unsigned entries_to_clear[H5C_RING_NTYPES]) { #if H5C_DO_SANITY_CHECKS @@ -1234,7 +1189,7 @@ H5C__flush_candidate_entries(H5F_t *f, hid_t dxpl_id, */ ring = H5C_RING_USER; while(ring < H5C_RING_NTYPES) { - if(H5C__flush_candidates_in_ring(f, dxpl_id, ring, entries_to_flush[ring], entries_to_clear[ring]) < 0) + if(H5C__flush_candidates_in_ring(f, ring, entries_to_flush[ring], entries_to_clear[ring]) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush candidates in ring failed") ring++; @@ -1284,7 +1239,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__flush_candidates_in_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, +H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flush, unsigned entries_to_clear) { H5C_t * cache_ptr; @@ -1413,7 +1368,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, cache_ptr->entries_removed_counter = 0; cache_ptr->last_entry_removed_ptr = NULL; - if(H5C__flush_single_entry(f, dxpl_id, op_ptr, op_flags) < 0) + if(H5C__flush_single_entry(f, op_ptr, op_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't flush entry") if(cache_ptr->entries_removed_counter != 0 @@ -1551,7 +1506,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, * * JRM -- 2/9/17 */ - if(H5C__flush_single_entry(f, dxpl_id, op_ptr, op_flags) < 0) + if(H5C__flush_single_entry(f, op_ptr, op_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't flush entry") if(cache_ptr->entries_removed_counter != 0 diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index d431887..c5dc8f3 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -4922,31 +4922,29 @@ typedef int (*H5C_tag_iter_cb_t)(H5C_cache_entry_t *entry, void *ctx); /******************************/ /* Package Private Prototypes */ /******************************/ -H5_DLL herr_t H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, - hbool_t *image_generated); -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); +H5_DLL herr_t H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated); +H5_DLL herr_t H5C__deserialize_prefetched_entry(H5F_t *f, 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__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, + unsigned flags); +H5_DLL herr_t H5C__generate_cache_image(H5F_t *f, H5C_t *cache_ptr); +H5_DLL herr_t H5C__load_cache_image(H5F_t *f); 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__make_space_in_cache(H5F_t * f, size_t space_needed, + hbool_t write_permitted); +H5_DLL herr_t H5C__flush_marked_entries(H5F_t * f); 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); + H5C_cache_entry_t *entry_ptr); +H5_DLL herr_t H5C__serialize_cache(H5F_t *f); 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); /* Routines for operating on entry tags */ -H5_DLL herr_t H5C__tag_entry(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr, - hid_t dxpl_id); +H5_DLL herr_t H5C__tag_entry(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr); H5_DLL herr_t H5C__untag_entry(H5C_t *cache, H5C_cache_entry_t *entry); /* Testing functions */ diff --git a/src/H5Cprefetched.c b/src/H5Cprefetched.c index 6237d57..0befdf9 100644 --- a/src/H5Cprefetched.c +++ b/src/H5Cprefetched.c @@ -61,16 +61,16 @@ static void * H5C__prefetched_entry_deserialize(const void *image_ptr, size_t len, void *udata, hbool_t *dirty_ptr); static herr_t H5C__prefetched_entry_image_len(const void *thing, size_t *image_len_ptr); -static herr_t H5C__prefetched_entry_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, - haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); +static herr_t H5C__prefetched_entry_pre_serialize(H5F_t *f, void *thing, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, + unsigned *flags_ptr); static herr_t H5C__prefetched_entry_serialize(const H5F_t *f, void *image_ptr, size_t len, void *thing); static herr_t H5C__prefetched_entry_notify(H5C_notify_action_t action, void *thing); static herr_t H5C__prefetched_entry_free_icr(void *thing); static herr_t H5C__prefetched_entry_fsf_size(const void *thing, - size_t *fsf_size_ptr); + hsize_t *fsf_size_ptr); /*********************/ @@ -182,11 +182,9 @@ H5C__prefetched_entry_image_len(const void H5_ATTR_UNUSED *thing, static herr_t -H5C__prefetched_entry_pre_serialize(H5F_t H5_ATTR_UNUSED *f, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED *thing, +H5C__prefetched_entry_pre_serialize(H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED *thing, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED len, - haddr_t H5_ATTR_UNUSED *new_addr_ptr, - size_t H5_ATTR_UNUSED *new_len_ptr, + haddr_t H5_ATTR_UNUSED *new_addr_ptr, size_t H5_ATTR_UNUSED *new_len_ptr, unsigned H5_ATTR_UNUSED *flags_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ @@ -339,7 +337,7 @@ done: static herr_t H5C__prefetched_entry_fsf_size(const void H5_ATTR_UNUSED *thing, - size_t H5_ATTR_UNUSED *fsf_size_ptr) + hsize_t H5_ATTR_UNUSED *fsf_size_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 50732ca..522b3cf 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -561,7 +561,6 @@ typedef struct H5C_t H5C_t; * The typedef for the pre-serialize callback is as follows: * * typedef herr_t (*H5C_pre_serialize_func_t)(H5F_t *f, - * hid_t dxpl_id, * void * thing, * haddr_t addr, * size_t len, @@ -575,11 +574,6 @@ typedef struct H5C_t H5C_t; * must be modified in the process of serializing the * target entry. * - * dxpl_id: dxpl_id passed with the file pointer to the cache, and - * passed on to the callback. Necessary as some callbacks - * revise the size and location of the target entry, or - * possibly other entries on pre-serialize. - * * thing: Pointer to void containing the address of the in core * representation of the target metadata cache entry. * This is the same pointer returned by a protect of the @@ -826,7 +820,7 @@ typedef struct H5C_t H5C_t; * The typedef for the get_fsf_size callback is as follows: * * typedef herr_t (*H5C_get_fsf_size_t)(const void * thing, - * size_t *fsf_size_ptr); + * hsize_t *fsf_size_ptr); * * The parameters of the get_fsf_size callback are as follows: * @@ -835,7 +829,7 @@ typedef struct H5C_t H5C_t; * is the same pointer that would be returned by a protect() * call of the associated addr and len. * - * fs_size_ptr: Pointer to size_t in which the callback will return + * fs_size_ptr: Pointer to hsize_t in which the callback will return * the size of the piece of file space to be freed. Note * that the space to be freed is presumed to have the same * base address as the cache entry. @@ -881,14 +875,13 @@ typedef htri_t (*H5C_verify_chksum_func_t)(const void *image_ptr, size_t len, vo typedef void *(*H5C_deserialize_func_t)(const void *image_ptr, size_t len, void *udata_ptr, hbool_t *dirty_ptr); typedef herr_t (*H5C_image_len_func_t)(const void *thing, size_t *image_len_ptr); -typedef herr_t (*H5C_pre_serialize_func_t)(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, - size_t *new_len_ptr, unsigned *flags_ptr); +typedef herr_t (*H5C_pre_serialize_func_t)(H5F_t *f, void *thing, haddr_t addr, + size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); typedef herr_t (*H5C_serialize_func_t)(const H5F_t *f, void *image_ptr, size_t len, void *thing); typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action, void *thing); typedef herr_t (*H5C_free_icr_func_t)(void *thing); -typedef herr_t (*H5C_get_fsf_size_t)(const void * thing, size_t *fsf_size_ptr); +typedef herr_t (*H5C_get_fsf_size_t)(const void * thing, hsize_t *fsf_size_ptr); /* Metadata cache client class definition */ typedef struct H5C_class_t { @@ -2245,20 +2238,20 @@ H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, int32_t version, double hit_rate, enum H5C_resize_status status, size_t old_max_cache_size, size_t new_max_cache_size, size_t old_min_clean_size, size_t new_min_clean_size); -H5_DLL herr_t H5C_dest(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5C_evict(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, - const H5C_class_t *type, haddr_t addr, unsigned flags); -H5_DLL herr_t H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags); -H5_DLL herr_t H5C_flush_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag); -H5_DLL herr_t H5C_force_cache_image_load(H5F_t * f, hid_t dxpl_id); -H5_DLL herr_t H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag, hbool_t match_global); -H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id, unsigned flags); +H5_DLL herr_t H5C_dest(H5F_t *f); +H5_DLL herr_t H5C_evict(H5F_t *f); +H5_DLL herr_t H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, + unsigned flags); +H5_DLL herr_t H5C_flush_cache(H5F_t *f, unsigned flags); +H5_DLL herr_t H5C_flush_tagged_entries(H5F_t *f, haddr_t tag); +H5_DLL herr_t H5C_force_cache_image_load(H5F_t * f); +H5_DLL herr_t H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global); +H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags); H5_DLL herr_t H5C_get_tag(const void *thing, /*OUT*/ haddr_t *tag); #if H5C_DO_TAGGING_SANITY_CHECKS herr_t H5C_verify_tag(int id, haddr_t tag); #endif -H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f); 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, @@ -2277,8 +2270,8 @@ 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_insert_entry(H5F_t *f, 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); @@ -2288,10 +2281,10 @@ H5_DLL herr_t H5C_mark_entry_serialized(void *thing); H5_DLL herr_t H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, haddr_t old_addr, haddr_t new_addr); H5_DLL herr_t H5C_pin_protected_entry(void *thing); -H5_DLL herr_t H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5C_prep_for_file_close(H5F_t *f); H5_DLL herr_t H5C_create_flush_dependency(void *parent_thing, void *child_thing); -H5_DLL void * H5C_protect(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, - haddr_t addr, void *udata, unsigned flags); +H5_DLL void * H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, + void *udata, unsigned flags); 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); @@ -2305,7 +2298,7 @@ H5_DLL herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name, H5_DLL void H5C_stats__reset(H5C_t *cache_ptr); 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, +H5_DLL herr_t H5C_unprotect(H5F_t *f, 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, @@ -2324,13 +2317,13 @@ H5_DLL hbool_t H5C_cache_image_pending(const H5C_t *cache_ptr); H5_DLL herr_t H5C_get_mdc_image_info(H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len); #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, - int mpi_rank, int mpi_size); +H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, 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, unsigned ce_array_len, +H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr); #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Ctag.c b/src/H5Ctag.c index a9b2ec0..66aedd9 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -37,6 +37,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Cpkg.h" /* Cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5Iprivate.h" /* IDs */ @@ -54,8 +55,7 @@ /* Typedef for tagged entry iterator callback context - evict tagged entries */ typedef struct { - H5F_t * f; /* File pointer for evicting entry */ - hid_t dxpl_id; /* DXPL for evicting entry */ + H5F_t *f; /* File pointer for evicting entry */ hbool_t evicted_entries_last_pass; /* Flag to indicate that an entry * was evicted when iterating over * cache @@ -72,8 +72,7 @@ typedef struct { /* Typedef for tagged entry iterator callback context - expunge tag type metadata */ typedef struct { - H5F_t * f; /* File pointer for evicting entry */ - hid_t dxpl_id; /* DXPL for evicting entry */ + H5F_t *f; /* File pointer for evicting entry */ int type_id; /* Cache entry type to expunge */ unsigned flags; /* Flags for expunging entry */ } H5C_tag_iter_ettm_ctx_t; @@ -178,7 +177,7 @@ H5C_get_ignore_tags(const H5C_t *cache_ptr) * * Function: H5C__tag_entry * - * Purpose: Tags an entry with the provided tag (contained in the dxpl_id). + * Purpose: Tags an entry with the provided tag (contained in the API context). * If sanity checking is enabled, this function will perform * validation that a proper tag is contained within the provided * data access property list id before application. @@ -191,9 +190,8 @@ H5C_get_ignore_tags(const H5C_t *cache_ptr) *------------------------------------------------------------------------- */ herr_t -H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry, hid_t dxpl_id) +H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry) { - H5P_genplist_t *dxpl; /* dataset transfer property list */ H5C_tag_info_t *tag_info; /* Points to a tag info struct */ haddr_t tag; /* Tag value */ herr_t ret_value = SUCCEED; /* Return value */ @@ -205,18 +203,13 @@ H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry, hid_t dxpl_id) HDassert(entry != NULL); HDassert(cache->magic == H5C__H5C_T_MAGIC); - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - - /* Get the tag from the DXPL */ - if((H5P_get(dxpl, H5AC_TAG_NAME, &tag)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query property value") + /* Get the tag */ + tag = H5CX_get_tag(); if(cache->ignore_tags) { /* if we're ignoring tags, it's because we're running tests on internal functions and may not have inserted a tag - value into a given dxpl_id before creating some metadata. Thus, + value into a given API context before creating some metadata. Thus, in this case only, if a tag value has not been set, we can arbitrarily set it to something for the sake of passing the tests. If the tag value is set, then we'll just let it get assigned without @@ -475,12 +468,12 @@ H5C__evict_tagged_entries_cb(H5C_cache_entry_t *entry, void *_ctx) ctx->pinned_entries_need_evicted = TRUE; else if(!entry->prefetched_dirty) { /* Evict the Entry */ - if(H5C__flush_single_entry(ctx->f, ctx->dxpl_id, entry, H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) + if(H5C__flush_single_entry(ctx->f, entry, H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, H5_ITER_ERROR, "Entry eviction failed.") ctx->evicted_entries_last_pass = TRUE; - } else { + } /* end else-if */ + else ctx->skipped_pf_dirty_entries = TRUE; - } done: FUNC_LEAVE_NOAPI(ret_value) @@ -501,7 +494,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag, hbool_t match_global) +H5C_evict_tagged_entries(H5F_t * f, haddr_t tag, hbool_t match_global) { H5C_t *cache; /* Pointer to cache structure */ H5C_tag_iter_evict_ctx_t ctx; /* Context for iterator callback */ @@ -519,7 +512,6 @@ H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag, hbool_t match_gl /* Construct context for iterator callbacks */ ctx.f = f; - ctx.dxpl_id = dxpl_id; /* Start evicting entries */ do { @@ -721,7 +713,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_flush_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag) +H5C_flush_tagged_entries(H5F_t *f, haddr_t tag) { /* Variable Declarations */ H5C_t *cache_ptr = NULL; @@ -741,7 +733,7 @@ H5C_flush_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't mark tagged entries") /* Flush all marked entries */ - if(H5C__flush_marked_entries(f, dxpl_id) < 0) + if(H5C__flush_marked_entries(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush marked entries") done: @@ -820,7 +812,7 @@ H5C__expunge_tag_type_metadata_cb(H5C_cache_entry_t *entry, void *_ctx) /* Found one with the same tag and type id */ if(entry->type->id == ctx->type_id) - if(H5C_expunge_entry(ctx->f, ctx->dxpl_id, entry->type, entry->addr, ctx->flags) < 0) + if(H5C_expunge_entry(ctx->f, entry->type, entry->addr, ctx->flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, H5_ITER_ERROR, "can't expunge entry") done: @@ -843,8 +835,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id, - unsigned flags) +H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags) { H5C_t *cache; /* Pointer to cache structure */ H5C_tag_iter_ettm_ctx_t ctx; /* Context for iterator callback */ @@ -862,7 +853,6 @@ H5C_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id, /* Construct context for iterator callbacks */ ctx.f = f; - ctx.dxpl_id = dxpl_id; ctx.type_id = type_id; ctx.flags = flags; diff --git a/src/H5D.c b/src/H5D.c index fc2024a..0c88f45 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -22,6 +22,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ @@ -107,7 +108,7 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, H5G_loc_t loc; /* Object location to insert dataset into */ H5D_t *dset = NULL; /* New dataset's info */ const H5S_t *space; /* Dataspace for dataset */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -136,12 +137,16 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Create the new dataset & get its ID */ - if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, lcpl_id, dcpl_id, dapl_id, dxpl_id))) + if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, lcpl_id, dcpl_id, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataset") @@ -151,6 +156,8 @@ done: if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dcreate2() */ @@ -197,7 +204,7 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, H5G_loc_t loc; /* Object location to insert dataset into */ H5D_t *dset = NULL; /* New dataset's info */ const H5S_t *space; /* Dataspace for dataset */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -216,12 +223,16 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* build and open the new dataset */ - if(NULL == (dset = H5D__create(loc.oloc->file, type_id, space, dcpl_id, dapl_id, dxpl_id))) + if(NULL == (dset = H5D__create_anon(loc.oloc->file, type_id, space, dcpl_id, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") /* Register the new dataset to get an ID for it */ @@ -238,7 +249,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get object location of dataset") /* Decrement refcount on dataset's object header in memory */ - if(H5O_dec_rc_by_loc(oloc, dxpl_id) < 0) + if(H5O_dec_rc_by_loc(oloc) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") } /* end if */ @@ -247,6 +258,8 @@ done: if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dcreate_anon() */ @@ -273,7 +286,7 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) { H5D_t *dset = NULL; H5G_loc_t loc; /* Object location of group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl to use to open datset */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -285,12 +298,16 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the dataset */ - if(NULL == (dset = H5D__open_name(&loc, name, dapl_id, dxpl_id))) + if(NULL == (dset = H5D__open_name(&loc, name, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") /* Register an atom for the dataset */ @@ -301,6 +318,9 @@ done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") + +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dopen2() */ @@ -322,6 +342,7 @@ done: herr_t H5Dclose(hid_t dset_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -330,6 +351,9 @@ H5Dclose(hid_t dset_id) /* Check args */ if(NULL == H5I_object_verify(dset_id, H5I_DATASET)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* * Decrement the counter on the dataset. It will be freed if the count @@ -339,6 +363,8 @@ H5Dclose(hid_t dset_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't decrement count on dataset ID") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dclose() */ @@ -363,19 +389,27 @@ hid_t H5Dget_space(hid_t dset_id) { H5D_t *dset = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", dset_id); /* Check args */ 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, H5I_INVALID_HID, "not a dataset") - if((ret_value = H5D_get_space(dset)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get dataspace") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + if((ret_value = H5D__get_space(dset)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to get dataspace") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dget_space() */ @@ -398,6 +432,7 @@ herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) { H5D_t *dset = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -407,11 +442,18 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Read dataspace address and return */ - if(H5D__get_space_status(dset, allocation, H5AC_ind_read_dxpl_id) < 0) + if(H5D__get_space_status(dset, allocation) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get space status") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dget_space_status() */ @@ -435,8 +477,8 @@ done: hid_t H5Dget_type(hid_t dset_id) { - H5D_t *dset; /* Dataset */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -446,10 +488,17 @@ H5Dget_type(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") - if((ret_value = H5D_get_type(dset)) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + if((ret_value = H5D__get_type(dset)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get dataspace") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dget_type() */ @@ -473,20 +522,28 @@ done: hid_t H5Dget_create_plist(hid_t dset_id) { - H5D_t *dataset; /* Dataset structure */ - hid_t ret_value = SUCCEED; /* Return value */ + H5D_t *dataset; /* Dataset structure */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", dset_id); /* Check args */ if(NULL == (dataset = (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, H5I_INVALID_HID, "not a dataset") - if((ret_value = H5D_get_create_plist(dataset)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get creation plist") +/* Set API context, verify access property list, and set up collective metadata if appropriate */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + if((ret_value = H5D__get_create_plist(dataset)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, H5I_INVALID_HID, "Can't get creation plist") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dget_create_plist() */ @@ -567,6 +624,7 @@ hsize_t H5Dget_storage_size(hid_t dset_id) { H5D_t *dset; /* Dataset to query */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hsize_t ret_value; /* Return value */ FUNC_ENTER_API(0) @@ -576,11 +634,18 @@ H5Dget_storage_size(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, 0, "can't set API context") +api_ctx_pushed = TRUE; + /* Set return value */ - if(H5D__get_storage_size(dset, H5AC_ind_read_dxpl_id, &ret_value) < 0) + if(H5D__get_storage_size(dset, &ret_value) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of dataset's storage") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, 0, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dget_storage_size() */ @@ -732,13 +797,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf) +H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) { H5S_t *space; /* Dataspace for iteration */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "iii*x", type_id, space_id, plist_id, buf); + H5TRACE4("e", "iii*x", type_id, space_id, dxpl_id, buf); /* Check args */ if(H5I_DATATYPE != H5I_get_type(type_id) || buf == NULL) @@ -749,16 +815,24 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set") /* Get the default dataset transfer property list if the user didn't provide one */ - if(H5P_DEFAULT == plist_id) - plist_id = H5P_DATASET_XFER_DEFAULT; + if(H5P_DEFAULT == dxpl_id) + dxpl_id = H5P_DATASET_XFER_DEFAULT; else - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) + if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Call internal routine */ - ret_value = H5D_vlen_reclaim(type_id, space, plist_id, buf); + ret_value = H5D_vlen_reclaim(type_id, space, buf); done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dvlen_reclaim() */ @@ -791,15 +865,15 @@ herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size) { - H5D_vlen_bufsize_t vlen_bufsize = {0, 0, 0, 0, 0, 0, 0}; + H5D_vlen_bufsize_t vlen_bufsize = {0, 0, 0, 0, 0, 0}; H5D_t *dset; /* Dataset for operation */ H5S_t *fspace = NULL; /* Dataset's dataspace */ H5S_t *mspace = NULL; /* Memory dataspace */ char bogus; /* bogus value to pass to H5Diterate() */ H5S_t *space; /* Dataspace for iteration */ - H5P_genplist_t *plist; /* Property list */ H5T_t *type; /* Datatype */ H5S_sel_iter_op_t dset_op; /* Operator for iteration */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -837,17 +911,14 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, if(NULL == (vlen_bufsize.vl_tbuf = H5FL_BLK_MALLOC(vlen_vl_buf, (size_t)1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "no temporary buffers available") - /* Change to the custom memory allocation routines for reading VL data */ - if((vlen_bufsize.xfer_pid = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "no dataset xfer plists available") - - /* Get the property list struct */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(vlen_bufsize.xfer_pid))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Set the memory manager to the special allocation routine */ - if(H5P_set_vlen_mem_manager(plist, H5D__vlen_get_buf_size_alloc, &vlen_bufsize, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set VL data allocation routine") + if(H5CX_set_vlen_alloc_info(H5D__vlen_get_buf_size_alloc, &vlen_bufsize, NULL, NULL) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set VL data allocation routine") /* Set the initial number of bytes required */ vlen_bufsize.size = 0; @@ -872,8 +943,8 @@ done: vlen_bufsize.fl_tbuf = H5FL_BLK_FREE(vlen_fl_buf, vlen_bufsize.fl_tbuf); if(vlen_bufsize.vl_tbuf != NULL) vlen_bufsize.vl_tbuf = H5FL_BLK_FREE(vlen_vl_buf, vlen_bufsize.vl_tbuf); - if(vlen_bufsize.xfer_pid > 0 && H5I_dec_ref(vlen_bufsize.xfer_pid) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to decrement ref count on property list") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dvlen_get_buf_size() */ @@ -896,6 +967,7 @@ herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[]) { H5D_t *dset; /* Dataset for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -907,12 +979,22 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[]) if(!size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Private function */ - if(H5D__set_extent(dset, size, H5AC_ind_read_dxpl_id) < 0) + if(H5D__set_extent(dset, size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extend dataset") done: - FUNC_LEAVE_API(ret_value) +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* end H5Dset_extent() */ @@ -931,7 +1013,8 @@ done: herr_t H5Dflush(hid_t dset_id) { - H5D_t *dset; /* Dataset for this operation */ + H5D_t *dset; /* Dataset for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -941,15 +1024,21 @@ H5Dflush(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") - /* Flush any dataset information still cached in memory */ - if(H5D__flush_real(dset, H5AC_ind_read_dxpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Flush object's metadata to file */ - if(H5O_flush_common(&dset->oloc, dset_id, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush dataset and object flush callback") + /* Flush dataset information cached in memory */ + if(H5D__flush(dset, dset_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush cached dataset info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dflush */ @@ -969,8 +1058,9 @@ done: herr_t H5Drefresh(hid_t dset_id) { - H5D_t *dset; /* Dataset to refresh */ - herr_t ret_value = SUCCEED; /* return value */ + H5D_t *dset; /* Dataset to refresh */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", dset_id); @@ -979,11 +1069,21 @@ H5Drefresh(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Call private function to refresh the dataset object */ - if((H5D__refresh(dset_id, dset, H5AC_ind_read_dxpl_id)) < 0) + if((H5D__refresh(dset_id, dset)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTLOAD, FAIL, "unable to refresh dataset") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Drefresh() */ @@ -1008,6 +1108,7 @@ herr_t H5Dformat_convert(hid_t dset_id) { H5D_t *dset; /* Dataset to refresh */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -1017,11 +1118,19 @@ H5Dformat_convert(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + switch(dset->shared->layout.type) { case H5D_CHUNKED: /* Convert the chunk indexing type to version 1 B-tree if not */ if(dset->shared->layout.u.chunk.idx_type != H5D_CHUNK_IDX_BTREE) - if((H5D__format_convert(dset, H5AC_ind_read_dxpl_id)) < 0) + if((H5D__format_convert(dset)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTLOAD, FAIL, "unable to downgrade chunk indexing type for dataset") break; @@ -1029,7 +1138,7 @@ H5Dformat_convert(hid_t dset_id) case H5D_COMPACT: /* Downgrade the layout version to 3 if greater than 3 */ if(dset->shared->layout.version > H5O_LAYOUT_VERSION_DEFAULT) - if((H5D__format_convert(dset, H5AC_ind_read_dxpl_id)) < 0) + if((H5D__format_convert(dset)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTLOAD, FAIL, "unable to downgrade layout version for dataset") break; @@ -1046,6 +1155,8 @@ H5Dformat_convert(hid_t dset_id) } /* end switch */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dformat_convert */ @@ -1104,6 +1215,7 @@ herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_nbytes) { H5D_t *dset = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -1119,11 +1231,18 @@ H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_n if(H5D_CHUNKED != dset->shared->layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Call private function */ - if(H5D__get_chunk_storage_size(dset, H5P_DATASET_XFER_DEFAULT, offset, chunk_nbytes) < 0) + if(H5D__get_chunk_storage_size(dset, offset, chunk_nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get storage size of chunk") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value); } /* H5Dget_chunk_storage_size() */ + diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 8177e13..c23f089 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -95,23 +95,22 @@ static herr_t H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *stor const H5O_layout_chunk_t *layout); /* B-tree iterator callbacks */ -static int H5D__btree_idx_iterate_cb(H5F_t *f, hid_t dxpl_id, const void *left_key, +static int H5D__btree_idx_iterate_cb(H5F_t *f, const void *left_key, haddr_t addr, const void *right_key, void *_udata); /* B-tree callbacks */ static H5UC_t *H5D__btree_get_shared(const H5F_t *f, const void *_udata); -static herr_t H5D__btree_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t, void *_lt_key, +static herr_t H5D__btree_new_node(H5F_t *f, H5B_ins_t, void *_lt_key, void *_udata, void *_rt_key, haddr_t *addr_p /*out*/); static int H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key); static int H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key); -static htri_t H5D__btree_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, +static htri_t H5D__btree_found(H5F_t *f, haddr_t addr, const void *_lt_key, void *_udata); -static H5B_ins_t H5D__btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, +static H5B_ins_t H5D__btree_insert(H5F_t *f, 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/*out*/); -static H5B_ins_t H5D__btree_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); +static H5B_ins_t H5D__btree_remove( H5F_t *f, haddr_t addr, void *_lt_key, + hbool_t *lt_key_changed, void *_udata, void *_rt_key, hbool_t *rt_key_changed); static herr_t H5D__btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); static herr_t H5D__btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, @@ -136,7 +135,7 @@ static herr_t H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info); static herr_t H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst); static herr_t H5D__btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id); + H5O_storage_chunk_t *storage_dst); static herr_t H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); static herr_t H5D__btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); @@ -253,9 +252,8 @@ H5D__btree_get_shared(const H5F_t H5_ATTR_UNUSED *f, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5D__btree_new_node(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5B_ins_t op, - void *_lt_key, void *_udata, void *_rt_key, - haddr_t *addr_p/*out*/) +H5D__btree_new_node(H5F_t *f, H5B_ins_t op, void *_lt_key, void *_udata, + void *_rt_key, haddr_t *addr_p/*out*/) { H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key; H5D_btree_key_t *rt_key = (H5D_btree_key_t *) _rt_key; @@ -438,8 +436,8 @@ H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) *------------------------------------------------------------------------- */ static htri_t -H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, const void *_lt_key, - void *_udata) +H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, haddr_t addr, const void *_lt_key, + void *_udata) { H5D_chunk_ud_t *udata = (H5D_chunk_ud_t *) _udata; const H5D_btree_key_t *lt_key = (const H5D_btree_key_t *) _lt_key; @@ -537,11 +535,9 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5D__btree_insert(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, void *_lt_key, - hbool_t *lt_key_changed, - void *_md_key, void *_udata, void *_rt_key, - hbool_t H5_ATTR_UNUSED *rt_key_changed, - haddr_t *new_node_p/*out*/) +H5D__btree_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, + void *_md_key, void *_udata, void *_rt_key, hbool_t H5_ATTR_UNUSED *rt_key_changed, + haddr_t *new_node_p/*out*/) { H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key; H5D_btree_key_t *md_key = (H5D_btree_key_t *) _md_key; @@ -630,7 +626,7 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5D__btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out */ , +H5D__btree_remove(H5F_t *f, haddr_t addr, void *_lt_key /*in,out */ , hbool_t *lt_key_changed /*out */ , void H5_ATTR_UNUSED * _udata /*in,out */ , void H5_ATTR_UNUSED * _rt_key /*in,out */ , @@ -643,7 +639,7 @@ H5D__btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out /* Remove raw data chunk from file */ H5_CHECK_OVERFLOW(lt_key->nbytes, uint32_t, hsize_t); - if(H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, addr, (hsize_t)lt_key->nbytes) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, addr, (hsize_t)lt_key->nbytes) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTFREE, H5B_INS_ERROR, "unable to free chunk") /* Mark keys as unchanged */ @@ -940,7 +936,7 @@ H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info) udata.storage = idx_info->storage; /* Create the v1 B-tree for the chunk index */ - if(H5B_create(idx_info->f, idx_info->dxpl_id, H5B_BTREE, &udata, &(idx_info->storage->idx_addr)/*out*/) < 0) + if(H5B_create(idx_info->f, H5B_BTREE, &udata, &(idx_info->storage->idx_addr)/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create B-tree") done: @@ -1004,7 +1000,7 @@ H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, * Create the chunk it if it doesn't exist, or reallocate the chunk if * its size changed. */ - if(H5B_insert(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) + if(H5B_insert(idx_info->f, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to allocate chunk") done: @@ -1043,7 +1039,7 @@ H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat HDassert(udata); /* Go get the chunk information from the B-tree */ - if(H5B_find(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) + if(H5B_find(idx_info->f, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") done: @@ -1067,9 +1063,8 @@ done: *------------------------------------------------------------------------- */ static int -H5D__btree_idx_iterate_cb(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - const void *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, - void *_udata) +H5D__btree_idx_iterate_cb(H5F_t H5_ATTR_UNUSED *f, const void *_lt_key, + haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5D_btree_it_ud_t *udata = (H5D_btree_it_ud_t *)_udata; /* User data */ const H5D_btree_key_t *lt_key = (const H5D_btree_key_t *)_lt_key; /* B-tree key for chunk */ @@ -1137,7 +1132,7 @@ H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, udata.udata = chunk_udata; /* Iterate over existing chunks */ - if((ret_value = H5B_iterate(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, H5D__btree_idx_iterate_cb, &udata)) < 0) + if((ret_value = H5B_iterate(idx_info->f, H5B_BTREE, idx_info->storage->idx_addr, H5D__btree_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over chunk B-tree"); FUNC_LEAVE_NOAPI(ret_value) @@ -1174,7 +1169,7 @@ H5D__btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t /* Remove the chunk from the v1 B-tree index and release the space for the * chunk (in the B-tree callback). */ - if(H5B_remove(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) + if(H5B_remove(idx_info->f, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to remove chunk entry") done: @@ -1228,7 +1223,7 @@ H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info) udata.storage = &tmp_storage; /* Delete entire B-tree */ - if(H5B_delete(idx_info->f, idx_info->dxpl_id, H5B_BTREE, tmp_storage.idx_addr, &udata) < 0) + if(H5B_delete(idx_info->f, H5B_BTREE, tmp_storage.idx_addr, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk B-tree") /* Release the shared B-tree page */ @@ -1261,7 +1256,7 @@ H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__COPIED_TAG) HDassert(idx_info_src); HDassert(idx_info_src->f); @@ -1287,7 +1282,7 @@ H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(H5F_addr_defined(idx_info_dst->storage->idx_addr)); done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__btree_idx_copy_setup() */ @@ -1305,8 +1300,7 @@ done: */ static herr_t H5D__btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, - hid_t H5_ATTR_UNUSED dxpl_id) + H5O_storage_chunk_t *storage_dst) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1362,7 +1356,7 @@ H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) udata.storage = idx_info->storage; /* Get metadata information for B-tree */ - if(H5B_get_info(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, &bt_info, NULL, &udata) < 0) + if(H5B_get_info(idx_info->f, H5B_BTREE, idx_info->storage->idx_addr, &bt_info, NULL, &udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to iterate over chunk B-tree") /* Set the size of the B-tree */ @@ -1476,7 +1470,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, +H5D_btree_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth, unsigned ndims, const uint32_t *dim) { H5D_btree_dbg_t udata; /* User data for B-tree callback */ @@ -1510,7 +1504,7 @@ H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent udata.ndims = ndims; /* Dump the records for the B-tree */ - (void)H5B_debug(f, dxpl_id, addr, stream, indent, fwidth, H5B_BTREE, &udata); + (void)H5B_debug(f, addr, stream, indent, fwidth, H5B_BTREE, &udata); done: if(shared_init) { diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index 2e19392..f9074be 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -60,12 +60,6 @@ typedef struct H5D_bt2_ctx_t { uint32_t *dim; /* Size of chunk in elements */ } H5D_bt2_ctx_t; -/* User data for the chunk's removal callback routine */ -typedef struct H5D_bt2_remove_ud_t { - H5F_t *f; /* File pointer for operation */ - hid_t dxpl_id; /* DXPL ID for operation */ -} H5D_bt2_remove_ud_t; - /* Callback info for iteration over chunks in v2 B-tree */ typedef struct H5D_bt2_it_ud_t { H5D_chunk_cb_func_t cb; /* Callback routine for the chunk */ @@ -137,7 +131,7 @@ static herr_t H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info); static herr_t H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst); static herr_t H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id); + H5O_storage_chunk_t *storage_dst); static herr_t H5D__bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); static herr_t H5D__bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); static herr_t H5D__bt2_idx_dump(const H5O_storage_chunk_t *storage, @@ -664,7 +658,7 @@ H5D__btree2_idx_depend(const H5D_chk_idx_info_t *idx_info) oloc.addr = idx_info->storage->u.btree.dset_ohdr_addr; /* Get header */ - if(NULL == (oh = H5O_protect(&oloc, idx_info->dxpl_id, H5AC__READ_ONLY_FLAG, TRUE))) + if(NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Retrieve the dataset's object header proxy */ @@ -672,12 +666,12 @@ H5D__btree2_idx_depend(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get dataset object header proxy") /* Make the v2 B-tree a child flush dependency of the dataset's object header proxy */ - if(H5B2_depend(idx_info->storage->u.btree2.bt2, idx_info->dxpl_id, oh_proxy) < 0) + if(H5B2_depend(idx_info->storage->u.btree2.bt2, oh_proxy) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEPEND, FAIL, "unable to create flush dependency on object header proxy") done: /* Release the object header from the cache */ - if(oh && H5O_unprotect(&oloc, idx_info->dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(&oloc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -726,7 +720,7 @@ H5D__bt2_idx_open(const H5D_chk_idx_info_t *idx_info) u_ctx.dim = idx_info->layout->dim; /* Open v2 B-tree for the chunk index */ - if(NULL == (idx_info->storage->u.btree2.bt2 = H5B2_open(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &u_ctx))) + if(NULL == (idx_info->storage->u.btree2.bt2 = H5B2_open(idx_info->f, idx_info->storage->idx_addr, &u_ctx))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open v2 B-tree for tracking chunked dataset") /* Check for SWMR writes to the file */ @@ -798,7 +792,7 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info) u_ctx.dim = idx_info->layout->dim; /* Create the v2 B-tree for the chunked dataset */ - if(NULL == (idx_info->storage->u.btree2.bt2 = H5B2_create(idx_info->f, idx_info->dxpl_id, &bt2_cparam, &u_ctx))) + if(NULL == (idx_info->storage->u.btree2.bt2 = H5B2_create(idx_info->f, &bt2_cparam, &u_ctx))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create v2 B-tree for tracking chunked dataset") /* Retrieve the v2 B-tree's address in the file */ @@ -947,7 +941,7 @@ H5D__bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, bt2_udata.rec.scaled[u] = udata->common.scaled[u]; /* Update record for v2 B-tree (could be insert or modify) */ - if(H5B2_update(bt2, idx_info->dxpl_id, &bt2_udata, H5D__bt2_mod_cb, &bt2_udata) < 0) + if(H5B2_update(bt2, &bt2_udata, H5D__bt2_mod_cb, &bt2_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTUPDATE, FAIL, "unable to update record in v2 B-tree") done: @@ -1041,7 +1035,7 @@ H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) bt2_udata.rec.scaled[u] = udata->common.scaled[u]; /* Go get chunk information from v2 B-tree */ - if(H5B2_find(bt2, idx_info->dxpl_id, &bt2_udata, H5D__bt2_found_cb, &found_rec) < 0) + if(H5B2_find(bt2, &bt2_udata, H5D__bt2_found_cb, &found_rec) < 0) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in v2 B-tree") /* Set common info for the chunk */ @@ -1155,7 +1149,7 @@ H5D__bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info, udata.udata = chunk_udata; /* Iterate over the records in the v2 B-tree */ - if((ret_value = H5B2_iterate(bt2, idx_info->dxpl_id, H5D__bt2_idx_iterate_cb, &udata)) < 0) + if((ret_value = H5B2_iterate(bt2, H5D__bt2_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over chunk v2 B-tree"); done: @@ -1182,18 +1176,17 @@ static herr_t H5D__bt2_remove_cb(const void *_record, void *_udata) { const H5D_chunk_rec_t *record = (const H5D_chunk_rec_t *)_record; /* The native record */ - H5D_bt2_remove_ud_t *udata = (H5D_bt2_remove_ud_t *)_udata; /* User data for removal callback */ + H5F_t *f = (H5F_t *)_udata; /* User data for removal callback */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC /* Sanity checks */ - HDassert(udata); - HDassert(udata->f); + HDassert(f); /* Free the space in the file for the object being removed */ H5_CHECK_OVERFLOW(record->nbytes, uint32_t, hsize_t); - if(H5MF_xfree(udata->f, H5FD_MEM_DRAW, udata->dxpl_id, record->chunk_addr, (hsize_t)record->nbytes) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, record->chunk_addr, (hsize_t)record->nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") done: @@ -1216,7 +1209,6 @@ static herr_t H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata) { H5B2_t *bt2; /* v2 B-tree handle for indexing chunks */ - H5D_bt2_remove_ud_t remove_udata; /* User data for removal callback */ H5D_bt2_ud_t bt2_udata; /* User data for v2 B-tree find call */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1245,10 +1237,6 @@ H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *u /* Set convenience pointer to v2 B-tree structure */ bt2 = idx_info->storage->u.btree2.bt2; - /* Initialize user data for removal callback */ - remove_udata.f = idx_info->f; - remove_udata.dxpl_id = idx_info->dxpl_id; - /* Prepare user data for compare callback */ bt2_udata.ndims = idx_info->layout->ndims - 1; @@ -1258,7 +1246,7 @@ H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *u /* Remove the record for the "dataset chunk" object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove(bt2, idx_info->dxpl_id, &bt2_udata, (H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) ? NULL : H5D__bt2_remove_cb, &remove_udata) < 0) + if(H5B2_remove(bt2, &bt2_udata, (H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) ? NULL : H5D__bt2_remove_cb, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") done: @@ -1289,7 +1277,6 @@ done: static herr_t H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info) { - H5D_bt2_remove_ud_t remove_udata; /* User data for removal callback */ H5B2_remove_t remove_op; /* The removal callback */ H5D_bt2_ctx_ud_t u_ctx; /* data for context call */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1311,10 +1298,6 @@ H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info) u_ctx.chunk_size = idx_info->layout->size; u_ctx.dim = idx_info->layout->dim; - /* Initialize user data for removal callback */ - remove_udata.f = idx_info->f; - remove_udata.dxpl_id = idx_info->dxpl_id; - /* Set remove operation. Do not remove chunks in SWMR_WRITE mode */ if(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) remove_op = NULL; @@ -1323,7 +1306,7 @@ H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info) /* Delete the v2 B-tree */ /*(space in the file for each object is freed in the 'remove' callback) */ - if(H5B2_delete(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &u_ctx, remove_op, &remove_udata) < 0) + if(H5B2_delete(idx_info->f, idx_info->storage->idx_addr, &u_ctx, remove_op, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "can't delete v2 B-tree") idx_info->storage->idx_addr = HADDR_UNDEF; @@ -1374,7 +1357,7 @@ H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree") /* Set copied metadata tag */ - H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Create v2 B-tree that describes the chunked dataset in the destination file */ if(H5D__bt2_idx_create(idx_info_dst) < 0) @@ -1382,7 +1365,7 @@ H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(H5F_addr_defined(idx_info_dst->storage->idx_addr)); /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) @@ -1402,7 +1385,7 @@ done: */ static herr_t H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t H5_ATTR_UNUSED dxpl_id) + H5O_storage_chunk_t *storage_dst) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1415,12 +1398,12 @@ H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, HDassert(storage_dst->u.btree2.bt2); /* Close v2 B-tree for source file */ - if(H5B2_close(storage_src->u.btree2.bt2, dxpl_id) < 0) + if(H5B2_close(storage_src->u.btree2.bt2) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close v2 B-tree") storage_src->u.btree2.bt2 = NULL; /* Close v2 B-tree for destination file */ - if(H5B2_close(storage_dst->u.btree2.bt2, dxpl_id) < 0) + if(H5B2_close(storage_dst->u.btree2.bt2) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close v2 B-tree") storage_dst->u.btree2.bt2 = NULL; @@ -1466,12 +1449,12 @@ H5D__bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) bt2_cdset = idx_info->storage->u.btree2.bt2; /* Get v2 B-tree size for indexing chunked dataset */ - if(H5B2_size(bt2_cdset, idx_info->dxpl_id, index_size) < 0) + if(H5B2_size(bt2_cdset, index_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve v2 B-tree storage info for chunked dataset") done: /* Close v2 B-tree index */ - if(bt2_cdset && H5B2_close(bt2_cdset, idx_info->dxpl_id) < 0) + if(bt2_cdset && H5B2_close(bt2_cdset) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for tracking chunked dataset") idx_info->storage->u.btree2.bt2 = NULL; @@ -1564,7 +1547,7 @@ H5D__bt2_idx_dest(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch v2 B-tree file pointer") /* Close v2 B-tree */ - if(H5B2_close(idx_info->storage->u.btree2.bt2, idx_info->dxpl_id) < 0) + if(H5B2_close(idx_info->storage->u.btree2.bt2) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree") idx_info->storage->u.btree2.bt2 = NULL; } /* end if */ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index be3b678..5e6047a 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -52,6 +52,7 @@ #ifdef H5_HAVE_PARALLEL #include "H5ACprivate.h" /* Metadata cache */ #endif /* H5_HAVE_PARALLEL */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File functions */ @@ -213,7 +214,6 @@ typedef struct H5D_chunk_it_ud5_t { typedef struct H5D_chunk_readvv_ud_t { unsigned char *rbuf; /* Read buffer to initialize */ const H5D_t *dset; /* Dataset to operate on */ - hid_t dxpl_id; /* DXPL for operation */ } H5D_chunk_readvv_ud_t; /* Callback info for file selection iteration */ @@ -238,8 +238,7 @@ typedef struct H5D_chunk_coll_info_t { /* Chunked layout operation callbacks */ static herr_t H5D__chunk_construct(H5F_t *f, H5D_t *dset); -static herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, - hid_t dapl_id); +static herr_t H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id); static herr_t H5D__chunk_io_init(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, H5D_chunk_map_t *fm); @@ -249,9 +248,9 @@ static herr_t H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *typ static herr_t H5D__chunk_write(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, H5D_chunk_map_t *fm); -static herr_t H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__chunk_flush(H5D_t *dset); static herr_t H5D__chunk_io_term(const H5D_chunk_map_t *fm); -static herr_t H5D__chunk_dest(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__chunk_dest(H5D_t *dset); /* "Nonexistent" layout operation callback */ static ssize_t @@ -285,22 +284,20 @@ static herr_t H5D__chunk_file_cb(void *elem, const H5T_t *type, unsigned ndims, static herr_t H5D__chunk_mem_cb(void *elem, const H5T_t *type, unsigned ndims, const hsize_t *coords, void *fm); static unsigned H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled); -static herr_t H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, - const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t reset); -static herr_t H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, - const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t flush); +static herr_t H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, + hbool_t reset); +static herr_t H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, + hbool_t flush); static hbool_t H5D__chunk_is_partial_edge_chunk(unsigned dset_ndims, const uint32_t *chunk_dims, const hsize_t *chunk_scaled, const hsize_t *dset_dims); static void *H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, hbool_t relax, hbool_t prev_unfilt_chunk); static herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, - const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, - uint32_t naccessed); -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); + const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed); +static herr_t H5D__chunk_cache_prune(const H5D_t *dset, size_t size); static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk); #ifdef H5_HAVE_PARALLEL -static herr_t H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, +static herr_t H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, size_t chunk_size, const void *fill_buf); #endif /* H5_HAVE_PARALLEL */ @@ -383,8 +380,8 @@ H5FL_EXTERN(H5S_sel_iter_t); *------------------------------------------------------------------------- */ 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) +H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset, + uint32_t data_size, const void *buf) { const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ @@ -392,35 +389,25 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, H5D_chk_idx_info_t idx_info; /* Chunked index info */ hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ - H5D_io_info_t io_info; /* to hold the dset and two dxpls (meta and raw data) */ - hbool_t md_dxpl_generated = FALSE; /* bool to indicate whether we should free the md_dxpl_id at exit */ + H5D_io_info_t io_info; /* to hold the dset info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) 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)) { + if(!(*layout->ops->is_space_alloc)(&layout->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") - } + /* Calculate the index of this chunk */ H5VM_chunk_scaled(dset->shared->ndims, offset, layout->u.chunk.dim, scaled); scaled[dset->shared->ndims] = 0; /* Find out the file address of the chunk (if any) */ - if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -438,7 +425,6 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = io_info.md_dxpl_id; idx_info.pline = &(dset->shared->dcpl_cache.pline); idx_info.layout = &(dset->shared->layout.u.chunk); idx_info.storage = &(dset->shared->layout.storage.u.chunk); @@ -446,17 +432,15 @@ 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; - if (0 == idx_info.pline->nused && H5F_addr_defined(old_chunk.offset)) { + 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 { + 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) + 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)) @@ -465,20 +449,14 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, /* Evict the (old) entry from the cache if present, but do not flush * it to disk */ if(UINT_MAX != udata.idx_hint) { - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ - /* 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") - - if(H5D__chunk_cache_evict(dset, io_info.md_dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], FALSE) < 0) + if(H5D__chunk_cache_evict(dset, rdcc->slot[udata.idx_hint], FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") } /* end if */ /* Write the data to the file */ - if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, data_size, io_info.raw_dxpl_id, buf) < 0) + if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, data_size, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file") /* Insert the chunk record into the index */ @@ -491,11 +469,7 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, } /* end if */ 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_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_direct_write() */ @@ -512,20 +486,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, - uint32_t* filters, void *buf) +H5D__chunk_direct_read(const H5D_t *dset, 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) + FUNC_ENTER_PACKAGE_VOL_TAG(dset->oloc.addr) /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); @@ -535,17 +505,6 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, *filters = 0; - 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") @@ -561,7 +520,7 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, 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) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -579,12 +538,8 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, 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) - 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], flush) < 0) + if(H5D__chunk_cache_evict(dset, 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 */ @@ -594,27 +549,23 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, 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) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - } + } /* end if */ /* 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) + if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, udata.chunk_block.length, 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) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* end H5D__chunk_direct_read() */ @@ -631,19 +582,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, hsize_t *storage_size) +H5D__get_chunk_storage_size(H5D_t *dset, 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) + FUNC_ENTER_PACKAGE_VOL_TAG(dset->oloc.addr) /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); @@ -652,17 +599,6 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h *storage_size = 0; - 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_DONE(SUCCEED) @@ -677,7 +613,7 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h 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) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -700,12 +636,8 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h /* 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) + if(H5D__chunk_cache_evict(dset, 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 */ @@ -714,10 +646,10 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h 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) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - } - } + } /* end if */ + } /* end if */ /* Make sure the address of the chunk is returned. */ if(!H5F_addr_defined(udata.chunk_block.offset)) @@ -731,11 +663,7 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h *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) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* H5D__get_chunk_storage_size */ @@ -965,7 +893,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) +H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Convenience pointer to dataset's chunk cache */ @@ -1034,7 +962,6 @@ H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) /* Compose chunked index info struct */ idx_info.f = f; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -1369,7 +1296,7 @@ done: if(iter_init && H5S_SELECT_ITER_RELEASE(&(fm->mem_iter)) < 0) HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator") - if(file_type && (H5T_close(file_type) < 0)) + if(file_type && (H5T_close_real(file_type) < 0)) HDONE_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "Can't free temporary datatype") if(file_space_normalized) { /* (Casting away const OK -QAK) */ @@ -2272,7 +2199,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); /* Get the info for the chunk in the file */ - if(H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -2405,7 +2332,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); /* Look up the chunk */ - if(H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -2448,7 +2375,6 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, if(!H5F_addr_defined(udata.chunk_block.offset)) { /* Compose chunked index info struct */ idx_info.f = io_info->dset->oloc.file; - idx_info.dxpl_id = io_info->md_dxpl_id; idx_info.pline = &(io_info->dset->shared->dcpl_cache.pline); idx_info.layout = &(io_info->dset->shared->layout.u.chunk); idx_info.storage = &(io_info->dset->shared->layout.storage.u.chunk); @@ -2517,10 +2443,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id) +H5D__chunk_flush(H5D_t *dset) { - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); H5D_rdcc_ent_t *ent, *next; unsigned nerrors = 0; /* Count of any errors encountered when flushing chunks */ @@ -2531,14 +2455,10 @@ H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id) /* Sanity check */ HDassert(dset); - /* 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") - /* Loop over all entries in the chunk cache */ for(ent = rdcc->head; ent; ent = next) { next = ent->next; - if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, FALSE) < 0) + if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0) nerrors++; } /* end for */ if(nerrors) @@ -2614,31 +2534,25 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_dest(H5D_t *dset, hid_t dxpl_id) +H5D__chunk_dest(H5D_t *dset) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Dataset's chunk cache */ H5D_rdcc_ent_t *ent = NULL, *next = NULL; /* Pointer to current & next cache entries */ int nerrors = 0; /* Accumulated count of errors */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_STATIC_TAG(dset->oloc.addr) /* Sanity checks */ HDassert(dset); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - nerrors++; - /* 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) + if(H5D__chunk_cache_evict(dset, ent, TRUE) < 0) nerrors++; } /* end for */ @@ -2653,7 +2567,6 @@ H5D__chunk_dest(H5D_t *dset, hid_t dxpl_id) /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -2664,7 +2577,7 @@ H5D__chunk_dest(H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_dest() */ @@ -2830,7 +2743,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id) +H5D__chunk_create(const H5D_t *dset /*in,out*/) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); @@ -2855,7 +2768,6 @@ H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id) /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -2930,7 +2842,7 @@ H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled) *------------------------------------------------------------------------- */ herr_t -H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, +H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udata) { H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ @@ -3001,7 +2913,6 @@ H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -3052,20 +2963,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, - H5D_rdcc_ent_t *ent, hbool_t reset) +H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) { void *buf = NULL; /* Temporary buffer */ hbool_t point_of_no_return = FALSE; H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_STATIC_TAG(dset->oloc.addr) HDassert(dset); HDassert(dset->shared); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(dxpl_cache); HDassert(ent); HDassert(!ent->locked); @@ -3088,8 +2997,16 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t /* Should the chunk be filtered before writing it to disk? */ if(dset->shared->dcpl_cache.pline.nused && !(ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS)) { + H5Z_EDC_t err_detect; /* Error detection info */ + H5Z_cb_t filter_cb; /* I/O filter callback function */ size_t alloc = udata.chunk_block.length; /* Bytes allocated for BUF */ - size_t nbytes; /* Chunk size (in bytes) */ + size_t nbytes; /* Chunk size (in bytes) */ + + /* Retrieve filter settings from API context */ + if(H5CX_get_err_detect(&err_detect) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get error detection info") + if(H5CX_get_filter_cb(&filter_cb) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O filter callback function") if(!reset) { /* @@ -3113,9 +3030,9 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t ent->chunk = NULL; } /* end else */ H5_CHECKED_ASSIGN(nbytes, size_t, udata.chunk_block.length, hsize_t); - if(H5Z_pipeline(&(dset->shared->dcpl_cache.pline), 0, &(udata.filter_mask), dxpl_cache->err_detect, - dxpl_cache->filter_cb, &nbytes, &alloc, &buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "output pipeline failed") + if(H5Z_pipeline(&(dset->shared->dcpl_cache.pline), 0, &(udata.filter_mask), + err_detect, filter_cb, &nbytes, &alloc, &buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFILTER, FAIL, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ if(nbytes > ((size_t)0xffffffff)) @@ -3153,7 +3070,6 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t if(must_alloc) { /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -3172,7 +3088,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t /* Write the data to the file */ HDassert(H5F_addr_defined(udata.chunk_block.offset)); H5_CHECK_OVERFLOW(udata.chunk_block.length, hsize_t, size_t); - if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, (size_t)udata.chunk_block.length, H5AC_rawdata_dxpl_id, buf) < 0) + if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, (size_t)udata.chunk_block.length, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file") /* Insert the chunk record into the index */ @@ -3218,7 +3134,7 @@ done: ((ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS) ? NULL : &(dset->shared->dcpl_cache.pline))); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_flush_entry() */ @@ -3236,23 +3152,23 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, - H5D_rdcc_ent_t *ent, hbool_t flush) +H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, + hbool_t flush) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC + /* Sanity checks */ HDassert(dset); - HDassert(dxpl_cache); HDassert(ent); HDassert(!ent->locked); HDassert(ent->idx < rdcc->nslots); if(flush) { /* Flush */ - if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) + if(H5D__chunk_flush_entry(dset, ent, TRUE) < 0) HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") } /* end if */ else { @@ -3317,8 +3233,7 @@ H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *------------------------------------------------------------------------- */ 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) +H5D__chunk_cache_prune(const H5D_t *dset, size_t size) { const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); size_t total = rdcc->nbytes_max; @@ -3390,7 +3305,7 @@ H5D__chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, if(n[j] == cur) n[j] = cur->next; } /* end for */ - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, cur, TRUE) < 0) + if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0) nerrors++; } /* end if */ } /* end for */ @@ -3457,13 +3372,11 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, FUNC_ENTER_STATIC + /* Sanity checks */ HDassert(io_info); - HDassert(io_info->dxpl_cache); HDassert(io_info->store); HDassert(udata); HDassert(dset); - HDassert(TRUE == H5P_isa_class(io_info->md_dxpl_id, H5P_DATASET_XFER)); - HDassert(TRUE == H5P_isa_class(io_info->raw_dxpl_id, H5P_DATASET_XFER)); HDassert(!(udata->new_unfilt_chunk && prev_unfilt_chunk)); HDassert(!rdcc->tmp_head); @@ -3647,16 +3560,22 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, * size in memory, so allocate memory big enough. */ if(NULL == (chunk = H5D__chunk_mem_alloc(my_chunk_alloc, (udata->new_unfilt_chunk ? old_pline : pline)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk") - if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, chunk_addr, my_chunk_alloc, io_info->raw_dxpl_id, chunk) < 0) + if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, chunk_addr, my_chunk_alloc, chunk) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "unable to read raw data chunk") if(old_pline && old_pline->nused) { - if(H5Z_pipeline(old_pline, H5Z_FLAG_REVERSE, - &(udata->filter_mask), - io_info->dxpl_cache->err_detect, - io_info->dxpl_cache->filter_cb, - &my_chunk_alloc, &buf_alloc, &chunk) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, NULL, "data pipeline read failed") + H5Z_EDC_t err_detect; /* Error detection info */ + H5Z_cb_t filter_cb; /* I/O filter callback function */ + + /* Retrieve filter settings from API context */ + if(H5CX_get_err_detect(&err_detect) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get error detection info") + if(H5CX_get_filter_cb(&filter_cb) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get I/O filter callback function") + + if(H5Z_pipeline(old_pline, H5Z_FLAG_REVERSE, &(udata->filter_mask), + err_detect, filter_cb, &my_chunk_alloc, &buf_alloc, &chunk) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFILTER, NULL, "data pipeline read failed") /* Reallocate chunk if necessary */ if(udata->new_unfilt_chunk) { @@ -3701,14 +3620,14 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* (use the compact dataset storage buffer as the fill value buffer) */ if(H5D__fill_init(&fb_info, chunk, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, - dset->shared->type_id, (size_t)0, chunk_size, io_info->md_dxpl_id) < 0) + dset->shared->type_id, (size_t)0, chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't initialize fill buffer info") fb_info_init = TRUE; /* Check for VL datatype & non-default fill value */ if(fb_info.has_vlen_fill_type) /* Fill the buffer with VL datatype fill values */ - if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, io_info->md_dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, NULL, "can't refill fill value buffer") } /* end if */ else @@ -3729,10 +3648,10 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, if(!ent || !ent->locked) { /* Preempt enough things from the cache to make room */ if(ent) { - if(H5D__chunk_cache_evict(io_info->dset, io_info->md_dxpl_id, io_info->dxpl_cache, ent, TRUE) < 0) + if(H5D__chunk_cache_evict(io_info->dset, ent, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk from cache") } /* end if */ - if(H5D__chunk_cache_prune(io_info->dset, io_info->md_dxpl_id, io_info->dxpl_cache, chunk_size) < 0) + if(H5D__chunk_cache_prune(io_info->dset, chunk_size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk(s) from cache") /* Create a new entry */ @@ -3882,7 +3801,7 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, fake_ent.chunk_block.length = udata->chunk_block.length; fake_ent.chunk = (uint8_t *)chunk; - if(H5D__chunk_flush_entry(io_info->dset, io_info->md_dxpl_id, io_info->dxpl_cache, &fake_ent, TRUE) < 0) + if(H5D__chunk_flush_entry(io_info->dset, &fake_ent, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") } /* end if */ else { @@ -3959,13 +3878,11 @@ H5D__chunk_allocated_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) *------------------------------------------------------------------------- */ herr_t -H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes) +H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Raw data chunk cache */ H5D_rdcc_ent_t *ent; /* Cache entry */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ hsize_t chunk_bytes = 0; /* Number of bytes allocated for chunks */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ @@ -3976,20 +3893,14 @@ H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes) HDassert(dset->shared); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - /* 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") - /* Search for cached chunks that haven't been written out */ - for(ent = rdcc->head; ent; ent = ent->next) { + for(ent = rdcc->head; ent; ent = ent->next) /* Flush the chunk out to disk, to make certain the size is correct later */ - if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, FALSE) < 0) + if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") - } /* end for */ /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -4040,15 +3951,11 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ hbool_t should_fill = FALSE; /* Whether fill values should be written */ void *unfilt_fill_buf = NULL; /* Unfiltered fill value buffer */ void **fill_buf = NULL; /* Pointer to the fill buffer to use for a chunk */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ #ifdef H5_HAVE_PARALLEL hbool_t blocks_written = FALSE; /* Flag to indicate that chunk was actually written */ hbool_t using_mpi = FALSE; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ H5D_chunk_coll_info_t chunk_info; /* chunk address information for doing I/O */ #endif /* H5_HAVE_PARALLEL */ - hid_t md_dxpl_id = io_info->md_dxpl_id; - hid_t raw_dxpl_id = io_info->raw_dxpl_id; hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ unsigned space_ndims; /* Dataset's space rank */ const hsize_t *space_dim; /* Dataset's dataspace dimensions */ @@ -4063,14 +3970,12 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(md_dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(TRUE == H5P_isa_class(md_dxpl_id, H5P_DATASET_XFER)); - HDassert(TRUE == H5P_isa_class(raw_dxpl_id, H5P_DATASET_XFER)); /* Retrieve the dataset dimensions */ space_dim = dset->shared->curr_dims; @@ -4100,10 +4005,6 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ } /* end if */ #endif /* H5_HAVE_PARALLEL */ - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(raw_dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Calculate the minimum and maximum chunk offsets in each dimension, and * determine if there are any unfiltered partial edge chunks. Note that we * assume here that all elements of space_dim are > 0. This is checked at @@ -4154,7 +4055,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ if(H5D__fill_init(&fb_info, NULL, (H5MM_allocate_t)H5D__chunk_mem_alloc, (void *)pline, (H5MM_free_t)H5D__chunk_mem_xfree, (void *)pline, &dset->shared->dcpl_cache.fill, dset->shared->type, - dset->shared->type_id, (size_t)0, orig_chunk_size, md_dxpl_id) < 0) + dset->shared->type_id, (size_t)0, orig_chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") fb_info_init = TRUE; @@ -4168,6 +4069,8 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ * it doesn't contain any non-default VL datatype fill values) */ if(!fb_info.has_vlen_fill_type && pline->nused > 0) { + H5Z_EDC_t err_detect; /* Error detection info */ + H5Z_cb_t filter_cb; /* I/O filter callback function */ size_t buf_size = orig_chunk_size; /* If the dataset has disabled partial chunk filters, create a copy @@ -4178,8 +4081,14 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ HDmemcpy(unfilt_fill_buf, fb_info.fill_buf, orig_chunk_size); } /* end if */ + /* Retrieve filter settings from API context */ + if(H5CX_get_err_detect(&err_detect) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get error detection info") + if(H5CX_get_filter_cb(&filter_cb) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O filter callback function") + /* Push the chunk through the filters */ - if(H5Z_pipeline(pline, 0, &filter_mask, dxpl_cache->err_detect, dxpl_cache->filter_cb, &orig_chunk_size, &buf_size, &fb_info.fill_buf) < 0) + if(H5Z_pipeline(pline, 0, &filter_mask, err_detect, filter_cb, &orig_chunk_size, &buf_size, &fb_info.fill_buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ @@ -4191,7 +4100,6 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = md_dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -4261,7 +4169,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ /* Look up this chunk */ - if(H5D__chunk_lookup(dset, md_dxpl_id, scaled, &udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") #ifndef NDEBUG /* None of the chunks should be allocated */ @@ -4302,15 +4210,23 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ } /* end if */ /* Fill the buffer with VL datatype fill values */ - if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, md_dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") /* Check if there are filters which need to be applied to the chunk */ if((pline->nused > 0) && !nunfilt_edge_chunk_dims) { + H5Z_EDC_t err_detect; /* Error detection info */ + H5Z_cb_t filter_cb; /* I/O filter callback function */ size_t nbytes = orig_chunk_size; + /* Retrieve filter settings from API context */ + if(H5CX_get_err_detect(&err_detect) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get error detection info") + if(H5CX_get_filter_cb(&filter_cb) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O filter callback function") + /* Push the chunk through the filters */ - if(H5Z_pipeline(pline, 0, &filter_mask, dxpl_cache->err_detect, dxpl_cache->filter_cb, &nbytes, &fb_info.fill_buf_size, &fb_info.fill_buf) < 0) + if(H5Z_pipeline(pline, 0, &filter_mask, err_detect, filter_cb, &nbytes, &fb_info.fill_buf_size, &fb_info.fill_buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 @@ -4369,7 +4285,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ - if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, chunk_size, raw_dxpl_id, *fill_buf) < 0) + if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, chunk_size, *fill_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file") #ifdef H5_HAVE_PARALLEL } /* end else */ @@ -4433,7 +4349,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ #ifdef H5_HAVE_PARALLEL /* do final collective I/O */ if(using_mpi && blocks_written) - if(H5D__chunk_collective_fill(dset, raw_dxpl_id, &chunk_info, chunk_size, fb_info.fill_buf) < 0) + if(H5D__chunk_collective_fill(dset, &chunk_info, chunk_size, fb_info.fill_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file") #endif /* H5_HAVE_PARALLEL */ @@ -4453,7 +4369,7 @@ done: H5MM_free(chunk_info.addr); #endif - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_allocate() */ @@ -4474,7 +4390,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]) +H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) { hsize_t old_edge_chunk_sc[H5O_LAYOUT_NDIMS]; /* Offset of first previously incomplete chunk in each dimension */ hsize_t max_edge_chunk_sc[H5O_LAYOUT_NDIMS]; /* largest offset of chunks that might need to be modified in each dimension */ @@ -4489,8 +4405,6 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]) H5D_io_info_t chk_io_info; /* Chunked I/O info object */ H5D_chunk_ud_t chk_udata; /* User data for locking chunk */ H5D_storage_t chk_store; /* Chunk storage information */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ void *chunk; /* The file chunk */ hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); @@ -4502,7 +4416,6 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]) HDassert(dset && H5D_CHUNKED == layout->type); HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); HDassert(pline->nused > 0); HDassert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); @@ -4526,15 +4439,12 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]) /* * Initialize structures needed to lock chunks into cache */ - /* 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") /* Set up chunked I/O info object, for operations on chunks (in callback). * Note that we only need to set chunk_offset once, as the array's address * will never change. */ chk_store.chunk.scaled = chunk_sc; - H5D_BUILD_IO_INFO_RD(&chk_io_info, dset, dxpl_cache, dxpl_id, H5AC_rawdata_dxpl_id, &chk_store, NULL); + H5D_BUILD_IO_INFO_RD(&chk_io_info, dset, &chk_store, NULL); /* * Determine the edges of the dataset which need to be modified @@ -4587,7 +4497,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]) && !H5D__chunk_is_partial_edge_chunk(space_ndims, chunk_dim, chunk_sc, space_dim)); /* Lookup the chunk */ - if(H5D__chunk_lookup(dset, dxpl_id, chunk_sc, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, chunk_sc, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* If this chunk does not exist in cache or on disk, no need to do @@ -4652,8 +4562,8 @@ done: *------------------------------------------------------------------------- */ 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) +H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, + size_t chunk_size, const void *fill_buf) { MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */ int mpi_rank = (-1); /* This process's rank */ @@ -4665,7 +4575,8 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, MPI_Aint *chunk_disp_array = NULL; int *block_lens = NULL; MPI_Datatype mem_type, file_type; - hid_t data_dxpl_id = -1; /* DXPL ID to use for raw data I/O operations */ + H5FD_mpio_xfer_t prev_xfer_mode; /* Previous data xfer mode */ + hbool_t have_xfer_mode = FALSE; /* Whether the previous xffer mode has been retrieved */ int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -4683,10 +4594,6 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, if((mpi_size = H5F_mpi_get_size(dset->oloc.file)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI size") - /* Get a copy of the DXPL, to modify */ - if((data_dxpl_id = H5P_copy_plist((H5P_genplist_t *)H5I_object(dxpl_id), TRUE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property list") - /* Distribute evenly the number of blocks between processes. */ num_blocks = chunk_info->num_io / mpi_size; /* value should be the same on all procs */ @@ -4745,29 +4652,23 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - /* set MPI-IO VFD properties */ - { - H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_COLLECTIVE; - H5P_genplist_t *plist; /* Property list pointer */ + /* Set MPI-IO VFD properties */ - if(NULL == (plist = H5P_object_verify(data_dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list") + /* Set MPI datatypes for operation */ + if(H5CX_set_mpi_coll_datatypes(mem_type, file_type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") - /* Set buffer MPI type */ - if(H5P_set(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, &mem_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") + /* Get current transfer mode */ + if(H5CX_get_io_xfer_mode(&prev_xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode") + have_xfer_mode = TRUE; - /* Set File MPI type */ - if(H5P_set(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, &file_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") + /* Set transfer mode */ + if(H5CX_set_io_xfer_mode(H5FD_MPIO_COLLECTIVE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode") - /* set transfer mode */ - if(H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - } - - /* low level write (collective) */ - if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, (haddr_t)0, (blocks) ? (size_t)1 : (size_t)0, data_dxpl_id, fill_buf) < 0) + /* Low-level write (collective) */ + if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, (haddr_t)0, (blocks) ? (size_t)1 : (size_t)0, fill_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file") /* Barrier so processes don't race ahead */ @@ -4775,8 +4676,10 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code) done: - if(data_dxpl_id > 0 && H5I_dec_ref(data_dxpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't free property list") + if(have_xfer_mode) + /* Set transfer mode */ + if(H5CX_set_io_xfer_mode(prev_xfer_mode) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode") /* free things */ if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) @@ -4830,7 +4733,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) H5_CHECKED_ASSIGN(chunk_size, size_t, layout->u.chunk.size, uint32_t); /* Get the info for the chunk in the file */ - if(H5D__chunk_lookup(dset, io_info->md_dxpl_id, scaled, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") chk_udata.new_unfilt_chunk = new_unfilt_chunk; @@ -4844,7 +4747,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) if(H5D__fill_init(&udata->fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)udata->elmts_per_chunk, - chunk_size, io_info->md_dxpl_id) < 0) + chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") udata->fb_info_init = TRUE; } /* end if */ @@ -4881,7 +4784,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) /* Check for VL datatype & non-default fill value */ if(udata->fb_info.has_vlen_fill_type) /* Re-fill the buffer to use for this I/O operation */ - if(H5D__fill_refill_vl(&udata->fb_info, (size_t)sel_nelmts, io_info->md_dxpl_id) < 0) + if(H5D__fill_refill_vl(&udata->fb_info, (size_t)sel_nelmts) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") /* Allocate the chunk selection iterator */ @@ -4894,7 +4797,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) chunk_iter_init = TRUE; /* Scatter the data into memory */ - if(H5D__scatter_mem(udata->fb_info.fill_buf, udata->chunk_space, chunk_iter, (size_t)sel_nelmts, io_info->dxpl_cache, chunk/*out*/) < 0) + if(H5D__scatter_mem(udata->fb_info.fill_buf, udata->chunk_space, chunk_iter, (size_t)sel_nelmts, chunk/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "scatter failed") @@ -5018,7 +4921,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) +H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) { hsize_t min_mod_chunk_sc[H5O_LAYOUT_NDIMS]; /* Scaled offset of first chunk to modify in each dimension */ hsize_t max_mod_chunk_sc[H5O_LAYOUT_NDIMS]; /* Scaled offset of last chunk to modify in each dimension */ @@ -5029,8 +4932,6 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_io_info_t chk_io_info; /* Chunked I/O info object */ H5D_storage_t chk_store; /* Chunk storage information */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ unsigned space_ndims; /* Dataset's space rank */ @@ -5057,11 +4958,6 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) HDassert(dset && H5D_CHUNKED == layout->type); HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(dxpl_cache); - - /* 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") /* Go get the rank & dimensions (including the element size) */ space_dim = dset->shared->curr_dims; @@ -5102,11 +4998,10 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) * Note that we only need to set scaled once, as the array's address * will never change. */ chk_store.chunk.scaled = scaled; - H5D_BUILD_IO_INFO_RD(&chk_io_info, dset, dxpl_cache, dxpl_id, H5AC_rawdata_dxpl_id, &chk_store, NULL); + H5D_BUILD_IO_INFO_RD(&chk_io_info, dset, &chk_store, NULL); /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -5265,13 +5160,13 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) #endif /* NDEBUG */ /* Check if the chunk exists in cache or on disk */ - if(H5D__chunk_lookup(dset, dxpl_id, scaled, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk") /* Evict the entry from the cache if present, but do not flush * it to disk */ if(UINT_MAX != chk_udata.idx_hint) - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[chk_udata.idx_hint], FALSE) < 0) + if(H5D__chunk_cache_evict(dset, rdcc->slot[chk_udata.idx_hint], FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") /* Remove the chunk from disk, if present */ @@ -5417,7 +5312,6 @@ H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]) /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = io_info->md_dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -5446,7 +5340,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) +H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5O_layout_t layout; /* Dataset layout message */ @@ -5469,7 +5363,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_PLINE_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_PLINE_ID, &pline)) + if(NULL == H5O_msg_read_oh(f, oh, H5O_PLINE_ID, &pline)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O pipeline message") pline_read = TRUE; } /* end else if */ @@ -5480,7 +5374,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 == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LAYOUT_ID, &layout)) + if(NULL == H5O_msg_read_oh(f, oh, H5O_LAYOUT_ID, &layout)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout message") layout_read = TRUE; } /* end else if */ @@ -5489,7 +5383,6 @@ H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) /* Compose chunked index info struct */ idx_info.f = f; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &pline; idx_info.layout = &layout.u.chunk; idx_info.storage = &storage->u.chunk; @@ -5526,14 +5419,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) +H5D__chunk_update_cache(H5D_t *dset) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ H5D_rdcc_ent_t *ent, *next; /*cache entry */ H5D_rdcc_ent_t tmp_head; /* Sentinel entry for temporary entry list */ H5D_rdcc_ent_t *tmp_tail; /* Tail pointer for temporary entry list */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -5545,10 +5436,6 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) /* Check the rank */ HDassert((dset->shared->layout.u.chunk.ndims - 1) > 1); - /* 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") - /* Add temporary entry list to rdcc */ (void)HDmemset(&tmp_head, 0, sizeof(tmp_head)); rdcc->tmp_head = &tmp_head; @@ -5618,7 +5505,7 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) ent = tmp_head.tmp_next; /* Remove the old entry from the cache */ - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) + if(H5D__chunk_cache_evict(dset, ent, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") } /* end while */ @@ -5664,7 +5551,6 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5Z_cb_t filter_cb; /* 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 */ @@ -5756,7 +5642,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) } 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) + if(H5F_block_read(udata->file_src, H5FD_MEM_DRAW, chunk_rec->chunk_addr, nbytes, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") } } @@ -5782,7 +5668,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Convert from source file to memory */ H5_CHECK_OVERFLOW(udata->nelmts, uint32_t, size_t); - if(H5T_convert(tpath_src_mem, tid_src, tid_mem, (size_t)udata->nelmts, (size_t)0, (size_t)0, buf, bkg, udata->idx_info_dst->dxpl_id) < 0) + if(H5T_convert(tpath_src_mem, tid_src, tid_mem, (size_t)udata->nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "datatype conversion failed") /* Copy into another buffer, to reclaim memory later */ @@ -5792,11 +5678,11 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDmemset(bkg, 0, buf_size); /* Convert from memory to destination file */ - if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, udata->nelmts, (size_t)0, (size_t)0, buf, bkg, udata->idx_info_dst->dxpl_id) < 0) + if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, udata->nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "datatype conversion failed") /* Reclaim space from variable length data */ - if(H5D_vlen_reclaim(tid_mem, buf_space, udata->idx_info_dst->dxpl_id, reclaim_buf) < 0) + if(H5D_vlen_reclaim(tid_mem, buf_space, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, H5_ITER_ERROR, "unable to reclaim variable-length data") } /* end if */ else if(fix_ref) { @@ -5809,7 +5695,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) ref_count = nbytes / H5T_get_size(udata->dt_src); /* Copy the reference elements */ - if(H5O_copy_expand_ref(udata->file_src, buf, udata->idx_info_dst->dxpl_id, udata->idx_info_dst->f, bkg, ref_count, H5T_get_ref_type(udata->dt_src), udata->cpy_info) < 0) + if(H5O_copy_expand_ref(udata->file_src, buf, udata->idx_info_dst->f, bkg, ref_count, H5T_get_ref_type(udata->dt_src), udata->cpy_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy reference attribute") } /* end if */ @@ -5850,19 +5736,19 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Write chunk data to destination file */ HDassert(H5F_addr_defined(udata_dst.chunk_block.offset)); - if(H5F_block_write(udata->idx_info_dst->f, H5FD_MEM_DRAW, udata_dst.chunk_block.offset, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + if(H5F_block_write(udata->idx_info_dst->f, H5FD_MEM_DRAW, udata_dst.chunk_block.offset, nbytes, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(udata->idx_info_dst->dxpl_id, H5AC__COPIED_TAG, H5_ITER_ERROR); + /* Set metadata tag in API context */ + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Insert chunk record into index */ if(need_insert && udata->idx_info_dst->storage->ops->insert) if((udata->idx_info_dst->storage->ops->insert)(udata->idx_info_dst, &udata_dst, NULL) < 0) HGOTO_ERROR_TAG(H5E_DATASET, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert chunk addr into index") - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(H5_ITER_ERROR); + /* Reset metadata tag in API context */ + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) @@ -5886,7 +5772,7 @@ herr_t H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk_t *layout_src, H5F_t *f_dst, H5O_storage_chunk_t *storage_dst, const H5S_extent_t *ds_extent_src, const H5T_t *dt_src, - const H5O_pline_t *pline_src, H5O_copy_t *cpy_info, hid_t dxpl_id) + const H5O_pline_t *pline_src, H5O_copy_t *cpy_info) { H5D_chunk_it_ud3_t udata; /* User data for iteration callback */ H5D_chk_idx_info_t idx_info_dst; /* Dest. chunked index info */ @@ -5953,13 +5839,11 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, /* Compose source & dest chunked index info structs */ idx_info_src.f = f_src; - idx_info_src.dxpl_id = dxpl_id; idx_info_src.pline = pline; idx_info_src.layout = layout_src; idx_info_src.storage = storage_src; idx_info_dst.f = f_dst; - idx_info_dst.dxpl_id = dxpl_id; idx_info_dst.pline = pline; /* Use same I/O filter pipeline for dest. */ idx_info_dst.layout = layout_src /* Use same layout for dest. */; idx_info_dst.storage = storage_dst; @@ -5987,7 +5871,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, if(NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) { - (void)H5T_close(dt_mem); + (void)H5T_close_real(dt_mem); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") } /* end if */ @@ -5995,18 +5879,18 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, if(NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if(H5T_set_loc(dt_dst, f_dst, H5T_LOC_DISK) < 0) { - (void)H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk") } /* end if */ if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) { - (void)H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype") } /* end if */ /* Set up the conversion functions */ - if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and mem datatypes") - if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between mem and dst datatypes") /* Determine largest datatype size */ @@ -6148,7 +6032,7 @@ done: /* Clean up any index information */ if(copy_setup_done) - if(storage_src->ops->copy_shutdown && (storage_src->ops->copy_shutdown)(storage_src, storage_dst, dxpl_id) < 0) + if(storage_src->ops->copy_shutdown && (storage_src->ops->copy_shutdown)(storage_src, storage_dst) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to shut down index copying info") FUNC_LEAVE_NOAPI(ret_value) @@ -6169,7 +6053,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5O_layout_t *layout, +H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, hsize_t *index_size) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ @@ -6195,7 +6079,7 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5O_layout_t if((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read object header") else if(exists) { - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_PLINE_ID, &pline)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_PLINE_ID, &pline)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't find I/O pipeline message") pline_read = TRUE; } /* end else if */ @@ -6204,13 +6088,12 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5O_layout_t /* Compose chunked index info struct */ idx_info.f = loc->file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &pline; idx_info.layout = &layout->u.chunk; idx_info.storage = &layout->storage.u.chunk; /* Get the dataspace for the dataset */ - if(NULL == (space = H5S_read(loc, dxpl_id))) + if(NULL == (space = H5S_read(loc))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load dataspace info from dataset header") /* Allocate any indexing structures */ @@ -6296,7 +6179,7 @@ H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) *------------------------------------------------------------------------- */ herr_t -H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream) +H5D__chunk_dump_index(H5D_t *dset, FILE *stream) { H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ @@ -6318,7 +6201,6 @@ H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream) /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -6435,12 +6317,12 @@ H5D__nonexistent_readvv_cb(hsize_t H5_ATTR_UNUSED dst_off, hsize_t src_off, size /* Initialize the fill value buffer */ if(H5D__fill_init(&fb_info, (udata->rbuf + src_off), NULL, NULL, NULL, NULL, &udata->dset->shared->dcpl_cache.fill, udata->dset->shared->type, - udata->dset->shared->type_id, (size_t)0, len, udata->dxpl_id) < 0) + udata->dset->shared->type_id, (size_t)0, len) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") fb_info_init = TRUE; /* Check for VL datatype & fill the buffer with VL datatype fill values */ - if(fb_info.has_vlen_fill_type && H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, udata->dxpl_id) < 0) + if(fb_info.has_vlen_fill_type && H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") done: @@ -6494,7 +6376,6 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info, /* Set up user data for H5VM_opvv() */ udata.rbuf = (unsigned char *)io_info->u.rbuf; udata.dset = io_info->dset; - udata.dxpl_id = io_info->md_dxpl_id; /* Call generic sequence operation routine */ if((ret_value = H5VM_opvv(chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_off_arr, @@ -6617,7 +6498,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old * outdated version of the B-tree node */ if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, old_chunk->offset, old_chunk->length) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, old_chunk->offset, old_chunk->length) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") alloc_chunk = TRUE; } /* end if */ @@ -6660,7 +6541,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old case H5D_CHUNK_IDX_SINGLE: HDassert(new_chunk->length > 0); H5_CHECK_OVERFLOW(new_chunk->length, /*From: */uint32_t, /*To: */hsize_t); - new_chunk->offset = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, (hsize_t)new_chunk->length); + new_chunk->offset = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, (hsize_t)new_chunk->length); if(!H5F_addr_defined(new_chunk->offset)) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "file allocation failed") *need_insert = TRUE; @@ -6734,7 +6615,7 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for raw data chunk") /* Read the non-filtered edge chunk */ - if (H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, H5AC_rawdata_dxpl_id, buf) < 0) + if(H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") /* Pass the chunk through the pipeline */ @@ -6748,12 +6629,12 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) #endif /* H5_SIZEOF_SIZE_T > 4 */ /* Allocate space for the filtered chunk */ - if ((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, new_idx_info->dxpl_id, (hsize_t)nbytes)) == HADDR_UNDEF) + if ((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, (hsize_t)nbytes)) == HADDR_UNDEF) HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, H5_ITER_ERROR, "file allocation failed for filtered chunk") HDassert(H5F_addr_defined(chunk_addr)); /* Write the filtered chunk to disk */ - if (H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + if (H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") } /* end if */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 43e7754..c0c2a80 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -67,8 +67,8 @@ static ssize_t H5D__compact_readvv(const H5D_io_info_t *io_info, static ssize_t H5D__compact_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]); -static herr_t H5D__compact_flush(H5D_t *dset, hid_t dxpl_id); -static herr_t H5D__compact_dest(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__compact_flush(H5D_t *dset); +static herr_t H5D__compact_dest(H5D_t *dset); /*********************/ @@ -117,7 +117,7 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ herr_t -H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id) +H5D__compact_fill(const H5D_t *dset) { H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ @@ -126,7 +126,6 @@ H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); HDassert(dset && H5D_COMPACT == dset->shared->layout.type); HDassert(dset->shared->layout.storage.u.compact.buf); HDassert(dset->shared->type); @@ -137,14 +136,14 @@ H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id) if(H5D__fill_init(&fb_info, dset->shared->layout.storage.u.compact.buf, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, - dset->shared->type_id, (size_t)0, dset->shared->layout.storage.u.compact.size, dxpl_id) < 0) + dset->shared->type_id, (size_t)0, dset->shared->layout.storage.u.compact.size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") fb_info_init = TRUE; /* Check for VL datatype & non-default fill value */ if(fb_info.has_vlen_fill_type) /* Fill the buffer with VL datatype fill values */ - if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") done: @@ -357,7 +356,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__compact_flush(H5D_t *dset, hid_t dxpl_id) +H5D__compact_flush(H5D_t *dset) { herr_t ret_value = SUCCEED; /* Return value */ @@ -369,7 +368,7 @@ 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)) < 0) { dset->shared->layout.storage.u.compact.dirty = TRUE; HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") } @@ -393,7 +392,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__compact_dest(H5D_t *dset, hid_t H5_ATTR_UNUSED dxpl_id) +H5D__compact_dest(H5D_t *dset) { FUNC_ENTER_STATIC_NOERR @@ -421,8 +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, - H5O_storage_compact_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info, - hid_t dxpl_id) + H5O_storage_compact_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info) { hid_t tid_src = -1; /* Datatype ID for source datatype */ hid_t tid_dst = -1; /* Datatype ID for destination datatype */ @@ -470,7 +468,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds if(NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) { - H5T_close(dt_mem); + (void)H5T_close_real(dt_mem); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") } /* end if */ @@ -478,18 +476,18 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds if(NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if(H5T_set_loc(dt_dst, f_dst, H5T_LOC_DISK) < 0) { - H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk") } /* end if */ if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) { - H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype") } /* end if */ /* Set up the conversion functions */ - if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert between src and mem datatypes") - if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert between mem and dst datatypes") /* Determine largest datatype size */ @@ -537,7 +535,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* 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) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Copy into another buffer, to reclaim memory later */ @@ -547,12 +545,12 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds 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) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") HDmemcpy(storage_dst->buf, buf, storage_dst->size); - if(H5D_vlen_reclaim(tid_mem, buf_space, dxpl_id, reclaim_buf) < 0) + if(H5D_vlen_reclaim(tid_mem, buf_space, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data") } /* end if */ else if(H5T_get_class(dt_src, FALSE) == H5T_REFERENCE) { @@ -565,7 +563,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds ref_count = storage_src->size / H5T_get_size(dt_src); /* Copy objects referenced in source buffer to destination file and set destination elements */ - if(H5O_copy_expand_ref(f_src, storage_src->buf, dxpl_id, f_dst, + if(H5O_copy_expand_ref(f_src, storage_src->buf, f_dst, storage_dst->buf, ref_count, H5T_get_ref_type(dt_src), cpy_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy reference attribute") } /* end if */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index aab4901..768e9c0 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -32,6 +32,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ @@ -60,7 +61,6 @@ typedef struct H5D_contig_readvv_sieve_ud_t { H5D_rdcdc_t *dset_contig; /* Cached information about contiguous data */ const H5D_contig_storage_t *store_contig; /* Contiguous storage info for this I/O operation */ unsigned char *rbuf; /* Pointer to buffer to fill */ - hid_t dxpl_id; /* DXPL for operation */ } H5D_contig_readvv_sieve_ud_t; /* Callback info for [plain] readvv operation */ @@ -68,7 +68,6 @@ typedef struct H5D_contig_readvv_ud_t { H5F_t *file; /* File for dataset */ haddr_t dset_addr; /* Address of dataset */ unsigned char *rbuf; /* Pointer to buffer to fill */ - hid_t dxpl_id; /* DXPL for operation */ } H5D_contig_readvv_ud_t; /* Callback info for sieve buffer writevv operation */ @@ -77,7 +76,6 @@ typedef struct H5D_contig_writevv_sieve_ud_t { H5D_rdcdc_t *dset_contig; /* Cached information about contiguous data */ const H5D_contig_storage_t *store_contig; /* Contiguous storage info for this I/O operation */ const unsigned char *wbuf; /* Pointer to buffer to write */ - hid_t dxpl_id; /* DXPL for operation */ } H5D_contig_writevv_sieve_ud_t; /* Callback info for [plain] writevv operation */ @@ -85,7 +83,6 @@ typedef struct H5D_contig_writevv_ud_t { H5F_t *file; /* File for dataset */ haddr_t dset_addr; /* Address of dataset */ const unsigned char *wbuf; /* Pointer to buffer to write */ - hid_t dxpl_id; /* DXPL for operation */ } H5D_contig_writevv_ud_t; @@ -95,8 +92,7 @@ typedef struct H5D_contig_writevv_ud_t { /* Layout operation callbacks */ static herr_t H5D__contig_construct(H5F_t *f, H5D_t *dset); -static herr_t H5D__contig_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, - hid_t dapl_id); +static herr_t H5D__contig_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id); static herr_t H5D__contig_io_init(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, H5D_chunk_map_t *cm); @@ -106,7 +102,7 @@ static ssize_t H5D__contig_readvv(const H5D_io_info_t *io_info, static ssize_t H5D__contig_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -static herr_t H5D__contig_flush(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__contig_flush(H5D_t *dset); /* Helper routines */ static herr_t H5D__contig_write_one(H5D_io_info_t *io_info, hsize_t offset, @@ -162,7 +158,7 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ herr_t -H5D__contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage /*out */ ) +H5D__contig_alloc(H5F_t *f, H5O_storage_contig_t *storage /*out */ ) { herr_t ret_value = SUCCEED; /* Return value */ @@ -173,7 +169,7 @@ H5D__contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage /*out * HDassert(storage); /* Allocate space for the contiguous data */ - if(HADDR_UNDEF == (storage->addr = H5MF_alloc(f, H5FD_MEM_DRAW, dxpl_id, storage->size))) + if(HADDR_UNDEF == (storage->addr = H5MF_alloc(f, H5FD_MEM_DRAW, storage->size))) HGOTO_ERROR(H5E_IO, H5E_NOSPACE, FAIL, "unable to reserve file space") done: @@ -199,11 +195,10 @@ H5D__contig_fill(const H5D_io_info_t *io_info) const H5D_t *dset = io_info->dset; /* the dataset pointer */ H5D_io_info_t ioinfo; /* Dataset I/O info */ H5D_storage_t store; /* Union of storage info for dataset */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ hssize_t snpoints; /* Number of points in space (for error checking) */ size_t npoints; /* Number of points in space */ hsize_t offset; /* Offset of dataset */ + size_t max_temp_buf; /* Maximum size of temporary buffer */ #ifdef H5_HAVE_PARALLEL MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */ int mpi_rank = (-1); /* This process's rank */ @@ -211,8 +206,6 @@ H5D__contig_fill(const H5D_io_info_t *io_info) hbool_t blocks_written = FALSE; /* Flag to indicate that chunk was actually written */ hbool_t using_mpi = FALSE; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ #endif /* H5_HAVE_PARALLEL */ - hid_t md_dxpl_id = io_info->md_dxpl_id; - hid_t raw_dxpl_id = io_info->raw_dxpl_id; H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ herr_t ret_value = SUCCEED; /* Return value */ @@ -220,8 +213,6 @@ H5D__contig_fill(const H5D_io_info_t *io_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(TRUE == H5P_isa_class(md_dxpl_id, H5P_DATASET_XFER)); - HDassert(TRUE == H5P_isa_class(raw_dxpl_id, H5P_DATASET_XFER)); HDassert(dset && H5D_CONTIGUOUS == dset->shared->layout.type); HDassert(H5F_addr_defined(dset->shared->layout.storage.u.contig.addr)); HDassert(dset->shared->layout.storage.u.contig.size > 0); @@ -244,10 +235,6 @@ H5D__contig_fill(const H5D_io_info_t *io_info) } /* end if */ #endif /* H5_HAVE_PARALLEL */ - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(raw_dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Initialize storage info for this dataset */ store.contig.dset_addr = dset->shared->layout.storage.u.contig.addr; store.contig.dset_size = dset->shared->layout.storage.u.contig.size; @@ -257,11 +244,14 @@ H5D__contig_fill(const H5D_io_info_t *io_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "dataset has negative number of elements") H5_CHECKED_ASSIGN(npoints, size_t, snpoints, hssize_t); + /* Get the maximum size of temporary buffers */ + if(H5CX_get_max_temp_buf(&max_temp_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve max. temp. buf size") + /* Initialize the fill value buffer */ if(H5D__fill_init(&fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, - dset->shared->type, dset->shared->type_id, npoints, - dxpl_cache->max_temp_buf, md_dxpl_id) < 0) + dset->shared->type, dset->shared->type_id, npoints, max_temp_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") fb_info_init = TRUE; @@ -269,7 +259,7 @@ H5D__contig_fill(const H5D_io_info_t *io_info) offset = 0; /* Simple setup for dataset I/O info struct */ - H5D_BUILD_IO_INFO_WRT(&ioinfo, dset, dxpl_cache, H5AC_ind_read_dxpl_id, raw_dxpl_id, &store, fb_info.fill_buf); + H5D_BUILD_IO_INFO_WRT(&ioinfo, dset, &store, fb_info.fill_buf); /* * Fill the entire current extent with the fill value. We can do @@ -289,7 +279,7 @@ H5D__contig_fill(const H5D_io_info_t *io_info) /* Check for VL datatype & non-default fill value */ if(fb_info.has_vlen_fill_type) /* Re-fill the buffer to use for this I/O operation */ - if(H5D__fill_refill_vl(&fb_info, curr_points, md_dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, curr_points) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") #ifdef H5_HAVE_PARALLEL @@ -352,7 +342,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__contig_delete(H5F_t *f, hid_t dxpl_id, const H5O_storage_t *storage) +H5D__contig_delete(H5F_t *f, const H5O_storage_t *storage) { herr_t ret_value = SUCCEED; /* Return value */ @@ -363,7 +353,7 @@ H5D__contig_delete(H5F_t *f, hid_t dxpl_id, const H5O_storage_t *storage) HDassert(storage); /* Free the file space for the chunk */ - if(H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, storage->u.contig.addr, storage->u.contig.size) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, storage->u.contig.addr, storage->u.contig.size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free contiguous storage space") done: @@ -459,8 +449,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__contig_init(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - const H5D_t *dset, hid_t H5_ATTR_UNUSED dapl_id) +H5D__contig_init(H5F_t H5_ATTR_UNUSED *f, const H5D_t *dset, + hid_t H5_ATTR_UNUSED dapl_id) { hsize_t tmp_size; /* Temporary holder for raw data size */ size_t tmp_sieve_buf_size; /* Temporary holder for sieve buffer size */ @@ -734,7 +724,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, if(NULL == dset_contig->sieve_buf) { /* Check if we can actually hold the I/O request in the sieve buffer */ if(len > dset_contig->sieve_buf_size) { - if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") } /* end if */ else { @@ -757,7 +747,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Read the new sieve buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") /* Grab the data out of the buffer (must be first piece of data in buffer ) */ @@ -793,7 +783,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Flush the sieve buffer, if it's dirty */ if(dset_contig->sieve_dirty) { /* Write to file */ - if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") /* Reset sieve buffer dirty flag */ @@ -802,7 +792,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, } /* end if */ /* Read directly into the user's buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") } /* end if */ /* Element size fits within the buffer size */ @@ -810,7 +800,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Flush the sieve buffer if it's dirty */ if(dset_contig->sieve_dirty) { /* Write to file */ - if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") /* Reset sieve buffer dirty flag */ @@ -841,7 +831,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, sieve_end = sieve_start + sieve_size; /* Read the new sieve buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") /* Grab the data out of the buffer (must be first piece of data in buffer ) */ @@ -880,7 +870,7 @@ H5D__contig_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata /* Write data */ if(H5F_block_read(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), - len, udata->dxpl_id, (udata->rbuf + src_off)) < 0) + len, (udata->rbuf + src_off)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") done: @@ -933,7 +923,6 @@ H5D__contig_readvv(const H5D_io_info_t *io_info, udata.dset_contig = &(io_info->dset->shared->cache.contig); udata.store_contig = &(io_info->store->contig); udata.rbuf = (unsigned char *)io_info->u.rbuf; - udata.dxpl_id = io_info->raw_dxpl_id; /* Call generic sequence operation routine */ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, @@ -948,7 +937,6 @@ H5D__contig_readvv(const H5D_io_info_t *io_info, udata.file = io_info->dset->oloc.file; udata.dset_addr = io_info->store->contig.dset_addr; udata.rbuf = (unsigned char *)io_info->u.rbuf; - udata.dxpl_id = io_info->raw_dxpl_id; /* Call generic sequence operation routine */ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, @@ -1011,7 +999,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, if(NULL == dset_contig->sieve_buf) { /* Check if we can actually hold the I/O request in the sieve buffer */ if(len > dset_contig->sieve_buf_size) { - if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") } /* end if */ else { @@ -1040,7 +1028,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Check if there is any point in reading the data from the file */ if(dset_contig->sieve_size > len) { /* Read the new sieve buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") } /* end if */ @@ -1080,7 +1068,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Flush the sieve buffer, if it's dirty */ if(dset_contig->sieve_dirty) { /* Write to file */ - if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") /* Reset sieve buffer dirty flag */ @@ -1093,7 +1081,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, } /* end if */ /* Write directly from the user's buffer */ - if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") } /* end if */ /* Element size fits within the buffer size */ @@ -1133,7 +1121,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Flush the sieve buffer if it's dirty */ if(dset_contig->sieve_dirty) { /* Write to file */ - if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") /* Reset sieve buffer dirty flag */ @@ -1166,7 +1154,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Check if there is any point in reading the data from the file */ if(dset_contig->sieve_size > len) { /* Read the new sieve buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") } /* end if */ @@ -1206,7 +1194,7 @@ H5D__contig_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udat FUNC_ENTER_STATIC /* Write data */ - if(H5F_block_write(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), len, udata->dxpl_id, (udata->wbuf + src_off)) < 0) + if(H5F_block_write(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), len, (udata->wbuf + src_off)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") done: @@ -1259,7 +1247,6 @@ H5D__contig_writevv(const H5D_io_info_t *io_info, udata.dset_contig = &(io_info->dset->shared->cache.contig); udata.store_contig = &(io_info->store->contig); udata.wbuf = (const unsigned char *)io_info->u.wbuf; - udata.dxpl_id = io_info->raw_dxpl_id; /* Call generic sequence operation routine */ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, @@ -1274,7 +1261,6 @@ H5D__contig_writevv(const H5D_io_info_t *io_info, udata.file = io_info->dset->oloc.file; udata.dset_addr = io_info->store->contig.dset_addr; udata.wbuf = (const unsigned char *)io_info->u.wbuf; - udata.dxpl_id = io_info->raw_dxpl_id; /* Call generic sequence operation routine */ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, @@ -1301,7 +1287,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__contig_flush(H5D_t *dset, hid_t H5_ATTR_UNUSED dxpl_id) +H5D__contig_flush(H5D_t *dset) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1310,9 +1296,8 @@ H5D__contig_flush(H5D_t *dset, hid_t H5_ATTR_UNUSED dxpl_id) /* Sanity check */ HDassert(dset); - /* Flush any data in sieve buffer - use the raw data dxpl since - the one passed in is a metadata dxpl. */ - if(H5D__flush_sieve_buf(dset, H5AC_rawdata_dxpl_id) < 0) + /* Flush any data in sieve buffer */ + if(H5D__flush_sieve_buf(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush sieve buffer") done: @@ -1335,7 +1320,7 @@ done: herr_t H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f_dst, H5O_storage_contig_t *storage_dst, H5T_t *dt_src, - H5O_copy_t *cpy_info, hid_t dxpl_id) + H5O_copy_t *cpy_info) { haddr_t addr_src; /* File offset in source dataset */ haddr_t addr_dst; /* File offset in destination dataset */ @@ -1379,7 +1364,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, HDassert(dt_src); /* Allocate space for destination raw data */ - if(H5D__contig_alloc(f_dst, dxpl_id, storage_dst) < 0) + if(H5D__contig_alloc(f_dst, storage_dst) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to allocate contiguous storage") /* Set up number of bytes to copy, and initial buffer size */ @@ -1400,7 +1385,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, if(NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) { - H5T_close(dt_mem); + (void)H5T_close_real(dt_mem); HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") } /* end if */ @@ -1408,18 +1393,18 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, if(NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy") if(H5T_set_loc(dt_dst, f_dst, H5T_LOC_DISK) < 0) { - H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "cannot mark datatype on disk") } /* end if */ if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) { - H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype") } /* end if */ /* Set up the conversion functions */ - if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert between src and mem datatypes") - if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert between mem and dst datatypes") /* Determine largest datatype size */ @@ -1531,14 +1516,14 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, 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) + /* Read raw data from source file */ + if(H5F_block_read(f_src, H5FD_MEM_DRAW, addr_src, src_nbytes, 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) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Copy into another buffer, to reclaim memory later */ @@ -1548,11 +1533,11 @@ 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) < 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) + if(H5D_vlen_reclaim(tid_mem, buf_space, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data") } /* end if */ else if(fix_ref) { @@ -1564,7 +1549,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, ref_count = src_nbytes / H5T_get_size(dt_src); /* Copy the reference elements */ - if(H5O_copy_expand_ref(f_src, buf, dxpl_id, f_dst, bkg, ref_count, H5T_get_ref_type(dt_src), cpy_info) < 0) + if(H5O_copy_expand_ref(f_src, buf, f_dst, bkg, ref_count, H5T_get_ref_type(dt_src), cpy_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy reference attribute") /* After fix ref, copy the new reference elements to the buffer to write out */ @@ -1575,8 +1560,8 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, HDmemset(buf, 0, src_nbytes); } /* end if */ - /* Write raw data to destination file - use raw dxpl because passed in one is metadata */ - if(H5F_block_write(f_dst, H5FD_MEM_DRAW, addr_dst, dst_nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + /* Write raw data to destination file */ + if(H5F_block_write(f_dst, H5FD_MEM_DRAW, addr_dst, dst_nbytes, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data") /* Adjust loop variables */ diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index b1efb20..656fa91 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -22,6 +22,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ @@ -77,6 +78,7 @@ herr_t H5Ddebug(hid_t dset_id) { H5D_t *dset; /* Dataset to debug */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -85,14 +87,20 @@ H5Ddebug(hid_t dset_id) /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Print B-tree information */ if(H5D_CHUNKED == dset->shared->layout.type) - (void)H5D__chunk_dump_index(dset, H5AC_ind_read_dxpl_id, stdout); + (void)H5D__chunk_dump_index(dset, stdout); else if(H5D_CONTIGUOUS == dset->shared->layout.type) HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.storage.u.contig.addr); done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ddebug() */ diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 0807048..51ebeba 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -36,6 +36,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ @@ -60,10 +61,6 @@ /* Local Prototypes */ /********************/ -#ifndef H5_NO_DEPRECATED_SYMBOLS -static herr_t H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - /*********************/ /* Package Variables */ @@ -118,6 +115,8 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, H5G_loc_t loc; /* Object location to insert dataset into */ H5D_t *dset = NULL; /* New dataset's info */ const H5S_t *space; /* Dataspace for dataset */ + hid_t dapl_id = H5P_DEFAULT; /* DAPL used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -138,8 +137,16 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Build and open the new dataset */ - if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, H5P_LINK_CREATE_DEFAULT, dcpl_id, H5P_DATASET_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id))) + if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, H5P_LINK_CREATE_DEFAULT, dcpl_id, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") /* Register the new dataset to get an ID for it */ @@ -150,6 +157,8 @@ done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dcreate1() */ @@ -177,7 +186,8 @@ H5Dopen1(hid_t loc_id, const char *name) { H5D_t *dset = NULL; H5G_loc_t loc; /* Object location of group */ - hid_t ret_value; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); @@ -188,8 +198,13 @@ H5Dopen1(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + /* Open the dataset */ - if(NULL == (dset = H5D__open_name(&loc, name, H5P_DATASET_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id))) + if(NULL == (dset = H5D__open_name(&loc, name, H5P_DATASET_ACCESS_DEFAULT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") /* Register an atom for the dataset */ @@ -200,6 +215,8 @@ done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dopen1() */ @@ -224,8 +241,11 @@ done: herr_t H5Dextend(hid_t dset_id, const hsize_t size[]) { - H5D_t *dset; - herr_t ret_value = SUCCEED; /* Return value */ + H5D_t *dset; /* Pointer to dataset to modify */ + hsize_t dset_dims[H5S_MAX_RANK]; /* Current dataset dimensions */ + unsigned u; /* Local index variable */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", dset_id, size); @@ -236,146 +256,30 @@ H5Dextend(hid_t dset_id, const hsize_t size[]) if(!size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") + /* Make certain that the dataset dimensions don't decrease */ + /* (Shrinking dimensions is possible with H5Dset_extent, but not H5Dextend) */ + if(H5S_get_simple_extent_dims(dset->shared->space, dset_dims, NULL) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") + for(u = 0; u < dset->shared->ndims; u++) + if(size[u] > dset_dims[u]) + dset_dims[u] = size[u]; + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Increase size */ - if(H5D__extend(dset, size, H5AC_ind_read_dxpl_id) < 0) + if(H5D__set_extent(dset, dset_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dextend() */ - - -/*------------------------------------------------------------------------- - * Function: H5D__extend - * - * Purpose: Increases the size of a dataset. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Friday, January 30, 1998 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) -{ - htri_t changed; /* Flag to indicate that the dataspace was successfully extended */ - hsize_t old_dims[H5S_MAX_RANK]; /* Current (i.e. old, if changed) dimension sizes */ - H5O_fill_t *fill; /* Dataset's fill value */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Check args */ - HDassert(dataset); - HDassert(size); - - /* Check if the filters in the DCPL will need to encode, and if so, can they? */ - if(H5D__check_filters(dataset) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't apply filters") - - /* - * NOTE: Restrictions on extensions were checked when the dataset was - * created. All extensions are allowed here since none should be - * able to muck things up. - */ - - /* Retrieve the current dimensions */ - HDcompile_assert(sizeof(old_dims) == sizeof(dataset->shared->curr_dims)); - HDmemcpy(old_dims, dataset->shared->curr_dims, H5S_MAX_RANK * sizeof(old_dims[0])); - - /* Increase the size of the data space */ - if((changed = H5S_extend(dataset->shared->space, size)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to increase size of dataspace") - - /* Updated the dataset's info if the dataspace was successfully extended */ - if(changed) { - /* Get the extended dimension sizes */ - /* (Need to retrieve this here, since the 'size' dimensions could - * extend one dimension but be smaller in a different dimension, - * and the dataspace's extent is the larger of the current and - * 'size' dimension values. - QAK) - */ - if(H5S_get_simple_extent_dims(dataset->shared->space, dataset->shared->curr_dims, NULL) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") - - /* Update the index values for the cached chunks for this dataset */ - if(H5D_CHUNKED == dataset->shared->layout.type) { - hbool_t update_chunks = FALSE; /* Flag to indicate chunk cache update is needed */ - - /* Check if we need to track & update scaled dimension information */ - if(dataset->shared->ndims > 1) { - unsigned u; /* Local indicate variable */ - - /* Update scaled chunk information */ - for(u = 0; u < dataset->shared->ndims; u++) { - hsize_t scaled; /* Scaled value */ - - /* Compute the scaled dimension size value */ - scaled = size[u] / dataset->shared->layout.u.chunk.dim[u]; - - /* Check if scaled dimension size changed */ - if(scaled != dataset->shared->cache.chunk.scaled_dims[u]) { - hsize_t scaled_power2up; /* New size value, rounded to next power of 2 */ - - /* Update the scaled dimension size value for the current dimension */ - dataset->shared->cache.chunk.scaled_dims[u] = scaled; - - /* Check if algorithm for computing hash values will change */ - if((scaled > dataset->shared->cache.chunk.nslots && - dataset->shared->cache.chunk.scaled_dims[u] <= dataset->shared->cache.chunk.nslots) - || (scaled <= dataset->shared->cache.chunk.nslots && - 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) { - /* 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); - - /* Indicate that the chunk cache indices should be updated */ - update_chunks = TRUE; - } /* end if */ - } /* end if */ - } /* end for */ - } /* end if */ - - /* Update general information for chunks */ - if(H5D__chunk_set_info(dataset) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to update # of chunks") - - /* Check for updating chunk cache indices */ - if(update_chunks) { - /* Update the chunk cache indices */ - if(H5D__chunk_update_cache(dataset, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices") - } /* end if */ - } /* end if */ - - /* Allocate space for the new parts of the dataset, if appropriate */ - fill = &dataset->shared->dcpl_cache.fill; - if(fill->alloc_time == H5D_ALLOC_TIME_EARLY) { - H5D_io_info_t io_info; - - io_info.dset = dataset; - io_info.raw_dxpl_id = H5AC_rawdata_dxpl_id; - io_info.md_dxpl_id = dxpl_id; - - if(H5D__alloc_storage(&io_info, H5D_ALLOC_EXTEND, FALSE, old_dims) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value") - } - /* Mark the dataspace as dirty, for later writing to the file */ - if(H5D__mark(dataset, dxpl_id, H5D_MARK_SPACE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__extend() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 1df0a58..a20145a 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -65,12 +65,6 @@ typedef struct H5D_earray_ctx_t { size_t chunk_size_len; /* Size of chunk sizes in the file (bytes) */ } H5D_earray_ctx_t; -/* User data for chunk callbacks */ -typedef struct H5D_earray_ud_t { - H5F_t *f; /* File pointer for operation */ - hid_t dxpl_id; /* DXPL ID for operation */ -} H5D_earray_ud_t; - /* Extensible Array callback info for iteration over chunks */ typedef struct H5D_earray_it_ud_t { H5D_chunk_common_ud_t common; /* Common info for Fixed Array user data (must be first) */ @@ -105,7 +99,7 @@ static herr_t H5D__earray_decode(const void *raw, void *elmt, size_t nelmts, void *ctx); static herr_t H5D__earray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); -static void *H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr); +static void *H5D__earray_crt_dbg_context(H5F_t *f, haddr_t obj_addr); static herr_t H5D__earray_dst_dbg_context(void *dbg_ctx); /* Extensible array class callbacks for chunks w/filters */ @@ -136,7 +130,7 @@ static herr_t H5D__earray_idx_delete(const H5D_chk_idx_info_t *idx_info); static herr_t H5D__earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst); static herr_t H5D__earray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id); + H5O_storage_chunk_t *storage_dst); static herr_t H5D__earray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); static herr_t H5D__earray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); @@ -624,7 +618,7 @@ H5D__earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, *------------------------------------------------------------------------- */ static void * -H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) +H5D__earray_crt_dbg_context(H5F_t *f, 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 */ @@ -653,7 +647,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 == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout, dxpl_id)) + if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") /* close the object header */ @@ -675,10 +669,9 @@ done: dbg_ctx = H5FL_FREE(H5D_earray_ctx_ud_t, dbg_ctx); /* Close object header */ - if(obj_opened) { + if(obj_opened) if(H5O_close(&obj_loc, NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header") - } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -757,7 +750,7 @@ H5D__earray_idx_depend(const H5D_chk_idx_info_t *idx_info) oloc.addr = idx_info->storage->u.earray.dset_ohdr_addr; /* Get header */ - if(NULL == (oh = H5O_protect(&oloc, idx_info->dxpl_id, H5AC__READ_ONLY_FLAG, TRUE))) + if(NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Retrieve the dataset's object header proxy */ @@ -765,12 +758,12 @@ H5D__earray_idx_depend(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get dataset object header proxy") /* Make the extensible array a child flush dependency of the dataset's object header */ - if(H5EA_depend(idx_info->storage->u.earray.ea, idx_info->dxpl_id, oh_proxy) < 0) + if(H5EA_depend(idx_info->storage->u.earray.ea, oh_proxy) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEPEND, FAIL, "unable to create flush dependency on object header proxy") done: /* Release the object header from the cache */ - if(oh && H5O_unprotect(&oloc, idx_info->dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(&oloc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -819,7 +812,7 @@ H5D__earray_idx_open(const H5D_chk_idx_info_t *idx_info) udata.chunk_size = idx_info->layout->size; /* Open the extensible array for the chunk index */ - if(NULL == (idx_info->storage->u.earray.ea = H5EA_open(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &udata))) + if(NULL == (idx_info->storage->u.earray.ea = H5EA_open(idx_info->f, idx_info->storage->idx_addr, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open extensible array") /* Check for SWMR writes to the file */ @@ -970,7 +963,7 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) udata.chunk_size = idx_info->layout->size; /* Create the extensible array for the chunk index */ - if(NULL == (idx_info->storage->u.earray.ea = H5EA_create(idx_info->f, idx_info->dxpl_id, &cparam, &udata))) + if(NULL == (idx_info->storage->u.earray.ea = H5EA_create(idx_info->f, &cparam, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create extensible array") /* Get the address of the extensible array in file */ @@ -1065,12 +1058,12 @@ H5D__earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata elmt.filter_mask = udata->filter_mask; /* Set the info for the chunk */ - if(H5EA_set(ea, idx_info->dxpl_id, udata->chunk_idx, &elmt) < 0) + if(H5EA_set(ea, udata->chunk_idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info") } /* end if */ else { /* Set the address for the chunk */ - if(H5EA_set(ea, idx_info->dxpl_id, udata->chunk_idx, &udata->chunk_block.offset) < 0) + if(H5EA_set(ea, udata->chunk_idx, &udata->chunk_block.offset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk address") } /* end else */ @@ -1149,7 +1142,7 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda H5D_earray_filt_elmt_t elmt; /* Extensible array element */ /* Get the information for the chunk */ - if(H5EA_get(ea, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5EA_get(ea, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") /* Set the info for the chunk */ @@ -1159,7 +1152,7 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda } /* end if */ else { /* Get the address for the chunk */ - if(H5EA_get(ea, idx_info->dxpl_id, idx, &udata->chunk_block.offset) < 0) + if(H5EA_get(ea, idx, &udata->chunk_block.offset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Update the other (constant) information for the chunk */ @@ -1357,7 +1350,7 @@ H5D__earray_idx_iterate(const H5D_chk_idx_info_t *idx_info, udata.udata = chunk_udata; /* Iterate over the extensible array elements */ - if((ret_value = H5EA_iterate(ea, idx_info->dxpl_id, H5D__earray_idx_iterate_cb, &udata)) < 0) + if((ret_value = H5EA_iterate(ea, H5D__earray_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); } /* end if */ @@ -1433,14 +1426,14 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t H5D_earray_filt_elmt_t elmt; /* Extensible array element */ /* Get the info about the chunk for the index */ - if(H5EA_get(ea, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5EA_get(ea, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") /* Remove raw data chunk from file if not doing SWMR writes */ HDassert(H5F_addr_defined(elmt.addr)); if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(elmt.nbytes, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, elmt.addr, (hsize_t)elmt.nbytes) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, elmt.addr, (hsize_t)elmt.nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") } /* end if */ @@ -1448,27 +1441,27 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t elmt.addr = HADDR_UNDEF; elmt.nbytes = 0; elmt.filter_mask = 0; - if(H5EA_set(ea, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5EA_set(ea, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to reset chunk info") } /* end if */ else { haddr_t addr = HADDR_UNDEF; /* Chunk address */ /* Get the address of the chunk for the index */ - if(H5EA_get(ea, idx_info->dxpl_id, idx, &addr) < 0) + if(H5EA_get(ea, idx, &addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Remove raw data chunk from file if not doing SWMR writes */ HDassert(H5F_addr_defined(addr)); if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(idx_info->layout->size, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, addr, (hsize_t)idx_info->layout->size) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, addr, (hsize_t)idx_info->layout->size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") } /* end if */ /* Reset the address of the chunk for the index */ addr = HADDR_UNDEF; - if(H5EA_set(ea, idx_info->dxpl_id, idx, &addr) < 0) + if(H5EA_set(ea, idx, &addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to reset chunk address") } /* end else */ @@ -1493,7 +1486,7 @@ done: static int H5D__earray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { - H5D_earray_ud_t *udata = (H5D_earray_ud_t *)_udata; /* User data for callback */ + H5F_t *f = (H5F_t *)_udata; /* User data for callback */ int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC @@ -1502,12 +1495,11 @@ H5D__earray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDassert(chunk_rec); HDassert(H5F_addr_defined(chunk_rec->chunk_addr)); HDassert(chunk_rec->nbytes > 0); - HDassert(udata); - HDassert(udata->f); + HDassert(f); /* Remove raw data chunk from file */ H5_CHECK_OVERFLOW(chunk_rec->nbytes, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(udata->f, H5FD_MEM_DRAW, udata->dxpl_id, chunk_rec->chunk_addr, (hsize_t)chunk_rec->nbytes) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, chunk_rec->chunk_addr, (hsize_t)chunk_rec->nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, H5_ITER_ERROR, "unable to free chunk") done: @@ -1549,19 +1541,14 @@ H5D__earray_idx_delete(const H5D_chk_idx_info_t *idx_info) /* Check if the index data structure has been allocated */ if(H5F_addr_defined(idx_info->storage->idx_addr)) { - H5D_earray_ud_t udata; /* User data for callback */ H5D_earray_ctx_ud_t ctx_udata; /* User data for extensible array open call */ - /* Initialize user data for callback */ - udata.f = idx_info->f; - udata.dxpl_id = idx_info->dxpl_id; - /* Iterate over the chunk addresses in the extensible array, deleting each chunk */ - if(H5D__earray_idx_iterate(idx_info, H5D__earray_idx_delete_cb, &udata) < 0) + if(H5D__earray_idx_iterate(idx_info, H5D__earray_idx_delete_cb, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk addresses") /* Close extensible array */ - if(H5EA_close(idx_info->storage->u.earray.ea, idx_info->dxpl_id) < 0) + if(H5EA_close(idx_info->storage->u.earray.ea) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close extensible array") idx_info->storage->u.earray.ea = NULL; @@ -1570,7 +1557,7 @@ H5D__earray_idx_delete(const H5D_chk_idx_info_t *idx_info) ctx_udata.chunk_size = idx_info->layout->size; /* Delete extensible array */ - if(H5EA_delete(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &ctx_udata) < 0) + if(H5EA_delete(idx_info->f, idx_info->storage->idx_addr, &ctx_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk extensible array") idx_info->storage->idx_addr = HADDR_UNDEF; } /* end if */ @@ -1622,7 +1609,7 @@ H5D__earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open extensible array") /* Set copied metadata tag */ - H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Create the extensible array that describes chunked storage in the dest. file */ if(H5D__earray_idx_create(idx_info_dst) < 0) @@ -1630,7 +1617,7 @@ H5D__earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(H5F_addr_defined(idx_info_dst->storage->idx_addr)); /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) @@ -1651,7 +1638,7 @@ done: */ static herr_t H5D__earray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id) + H5O_storage_chunk_t *storage_dst) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1664,10 +1651,10 @@ H5D__earray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, HDassert(storage_dst->u.earray.ea); /* Close extensible arrays */ - if(H5EA_close(storage_src->u.earray.ea, dxpl_id) < 0) + if(H5EA_close(storage_src->u.earray.ea) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close extensible array") storage_src->u.earray.ea = NULL; - if(H5EA_close(storage_dst->u.earray.ea, dxpl_id) < 0) + if(H5EA_close(storage_dst->u.earray.ea) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close extensible array") storage_dst->u.earray.ea = NULL; @@ -1724,7 +1711,7 @@ H5D__earray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) done: if(idx_info->storage->u.earray.ea) { - if(H5EA_close(idx_info->storage->u.earray.ea, idx_info->dxpl_id) < 0) + if(H5EA_close(idx_info->storage->u.earray.ea) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close extensible array") idx_info->storage->u.earray.ea = NULL; } /* end if */ @@ -1823,7 +1810,7 @@ H5D__earray_idx_dest(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch earray file pointer") /* Close extensible array */ - if(H5EA_close(idx_info->storage->u.earray.ea, idx_info->dxpl_id) < 0) + if(H5EA_close(idx_info->storage->u.earray.ea) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close extensible array") idx_info->storage->u.earray.ea = NULL; } /* end if */ diff --git a/src/H5Defl.c b/src/H5Defl.c index ebe7689..bfd734c 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -597,7 +597,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, hsize_t *heap_size) +H5D__efl_bh_info(H5F_t *f, H5O_efl_t *efl, hsize_t *heap_size) { herr_t ret_value = SUCCEED; /* Return value */ @@ -610,7 +610,7 @@ H5D__efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, hsize_t *heap_size) HDassert(heap_size); /* Get the size of the local heap for EFL's file list */ - if(H5HL_heapsize(f, dxpl_id, efl->heap_addr, heap_size) < 0) + if(H5HL_heapsize(f, efl->heap_addr, heap_size) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTINIT, FAIL, "unable to retrieve local heap info") done: diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index d183a8c..372ae26 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -64,12 +64,6 @@ typedef struct H5D_farray_ctx_t { size_t chunk_size_len; /* Size of chunk sizes in the file (bytes) */ } H5D_farray_ctx_t; -/* User data for chunk callbacks */ -typedef struct H5D_farray_ud_t { - H5F_t *f; /* File pointer for operation */ - hid_t dxpl_id; /* DXPL ID for operation */ -} H5D_farray_ud_t; - /* Fixed Array callback info for iteration over chunks */ typedef struct H5D_farray_it_ud_t { H5D_chunk_common_ud_t common; /* Common info for Fixed Array user data (must be first) */ @@ -105,8 +99,7 @@ static herr_t H5D__farray_decode(const void *raw, void *elmt, size_t nelmts, void *ctx); static herr_t H5D__farray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); -static void *H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, - haddr_t obj_addr); +static void *H5D__farray_crt_dbg_context(H5F_t *f, haddr_t obj_addr); static herr_t H5D__farray_dst_dbg_context(void *dbg_ctx); /* Fixed array class callbacks for chunks w/filters */ @@ -136,7 +129,7 @@ static herr_t H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info); static herr_t H5D__farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst); static herr_t H5D__farray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id); + H5O_storage_chunk_t *storage_dst); static herr_t H5D__farray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); static herr_t H5D__farray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); @@ -464,7 +457,7 @@ H5D__farray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, *------------------------------------------------------------------------- */ static void * -H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) +H5D__farray_crt_dbg_context(H5F_t *f, 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 */ @@ -493,7 +486,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 == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout, dxpl_id)) + if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") /* close the object header */ @@ -515,10 +508,9 @@ done: dbg_ctx = H5FL_FREE(H5D_farray_ctx_ud_t, dbg_ctx); /* Close object header */ - if(obj_opened) { + if(obj_opened) if(H5O_close(&obj_loc, NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header") - } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -757,7 +749,7 @@ H5D__farray_idx_depend(const H5D_chk_idx_info_t *idx_info) oloc.addr = idx_info->storage->u.farray.dset_ohdr_addr; /* Get header */ - if(NULL == (oh = H5O_protect(&oloc, idx_info->dxpl_id, H5AC__READ_ONLY_FLAG, TRUE))) + if(NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Retrieve the dataset's object header proxy */ @@ -765,12 +757,12 @@ H5D__farray_idx_depend(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get dataset object header proxy") /* Make the fixed array a child flush dependency of the dataset's object header proxy */ - if(H5FA_depend(idx_info->storage->u.farray.fa, idx_info->dxpl_id, oh_proxy) < 0) + if(H5FA_depend(idx_info->storage->u.farray.fa, oh_proxy) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEPEND, FAIL, "unable to create flush dependency on object header proxy") done: /* Release the object header from the cache */ - if(oh && H5O_unprotect(&oloc, idx_info->dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(&oloc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -843,7 +835,7 @@ H5D__farray_idx_open(const H5D_chk_idx_info_t *idx_info) udata.chunk_size = idx_info->layout->size; /* Open the fixed array for the chunk index */ - if(NULL == (idx_info->storage->u.farray.fa = H5FA_open(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &udata))) + if(NULL == (idx_info->storage->u.farray.fa = H5FA_open(idx_info->f, idx_info->storage->idx_addr, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open fixed array") /* Check for SWMR writes to the file */ @@ -920,7 +912,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) udata.chunk_size = idx_info->layout->size; /* Create the fixed array for the chunk index */ - if(NULL == (idx_info->storage->u.farray.fa = H5FA_create(idx_info->f, idx_info->dxpl_id, &cparam, &udata))) + if(NULL == (idx_info->storage->u.farray.fa = H5FA_create(idx_info->f, &cparam, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create fixed array") /* Get the address of the fixed array in file */ @@ -1015,12 +1007,12 @@ H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata elmt.filter_mask = udata->filter_mask; /* Set the info for the chunk */ - if(H5FA_set(fa, idx_info->dxpl_id, udata->chunk_idx, &elmt) < 0) + if(H5FA_set(fa, udata->chunk_idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info") } /* end if */ else { /* Set the address for the chunk */ - if(H5FA_set(fa, idx_info->dxpl_id, udata->chunk_idx, &udata->chunk_block.offset) < 0) + if(H5FA_set(fa, udata->chunk_idx, &udata->chunk_block.offset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk address") } /* end else */ @@ -1082,7 +1074,7 @@ H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda H5D_farray_filt_elmt_t elmt; /* Fixed array element */ /* Get the information for the chunk */ - if(H5FA_get(fa, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5FA_get(fa, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") /* Set the info for the chunk */ @@ -1092,7 +1084,7 @@ H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda } /* end if */ else { /* Get the address for the chunk */ - if(H5FA_get(fa, idx_info->dxpl_id, idx, &udata->chunk_block.offset) < 0) + if(H5FA_get(fa, idx, &udata->chunk_block.offset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Update the other (constant) information for the chunk */ @@ -1234,7 +1226,7 @@ H5D__farray_idx_iterate(const H5D_chk_idx_info_t *idx_info, udata.udata = chunk_udata; /* Iterate over the fixed array elements */ - if((ret_value = H5FA_iterate(fa, idx_info->dxpl_id, H5D__farray_idx_iterate_cb, &udata)) < 0) + if((ret_value = H5FA_iterate(fa, H5D__farray_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); } /* end if */ @@ -1293,14 +1285,14 @@ H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t H5D_farray_filt_elmt_t elmt; /* Fixed array element */ /* Get the info about the chunk for the index */ - if(H5FA_get(fa, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5FA_get(fa, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") /* Remove raw data chunk from file if not doing SWMR writes */ HDassert(H5F_addr_defined(elmt.addr)); if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(elmt.nbytes, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, elmt.addr, (hsize_t)elmt.nbytes) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, elmt.addr, (hsize_t)elmt.nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") } /* end if */ @@ -1308,27 +1300,27 @@ H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t elmt.addr = HADDR_UNDEF; elmt.nbytes = 0; elmt.filter_mask = 0; - if(H5FA_set(fa, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5FA_set(fa, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to reset chunk info") } /* end if */ else { haddr_t addr = HADDR_UNDEF; /* Chunk address */ /* Get the address of the chunk for the index */ - if(H5FA_get(fa, idx_info->dxpl_id, idx, &addr) < 0) + if(H5FA_get(fa, idx, &addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Remove raw data chunk from file if not doing SWMR writes */ HDassert(H5F_addr_defined(addr)); if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(idx_info->layout->size, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, addr, (hsize_t)idx_info->layout->size) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, addr, (hsize_t)idx_info->layout->size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") } /* end if */ /* Reset the address of the chunk for the index */ addr = HADDR_UNDEF; - if(H5FA_set(fa, idx_info->dxpl_id, idx, &addr) < 0) + if(H5FA_set(fa, idx, &addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to reset chunk address") } /* end else */ @@ -1353,7 +1345,7 @@ done: static int H5D__farray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { - H5D_farray_ud_t *udata = (H5D_farray_ud_t *)_udata; /* User data for callback */ + H5F_t *f = (H5F_t *)_udata; /* User data for callback */ int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC @@ -1362,12 +1354,11 @@ H5D__farray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDassert(chunk_rec); HDassert(H5F_addr_defined(chunk_rec->chunk_addr)); HDassert(chunk_rec->nbytes > 0); - HDassert(udata); - HDassert(udata->f); + HDassert(f); /* Remove raw data chunk from file */ H5_CHECK_OVERFLOW(chunk_rec->nbytes, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(udata->f, H5FD_MEM_DRAW, udata->dxpl_id, chunk_rec->chunk_addr, (hsize_t)chunk_rec->nbytes) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, chunk_rec->chunk_addr, (hsize_t)chunk_rec->nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, H5_ITER_ERROR, "unable to free chunk") done: @@ -1405,19 +1396,14 @@ H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info) /* Check if the index data structure has been allocated */ if(H5F_addr_defined(idx_info->storage->idx_addr)) { - H5D_farray_ud_t udata; /* User data for callback */ H5D_farray_ctx_ud_t ctx_udata; /* User data for fixed array open call */ - /* Initialize user data for callback */ - udata.f = idx_info->f; - udata.dxpl_id = idx_info->dxpl_id; - /* Iterate over the chunk addresses in the fixed array, deleting each chunk */ - if(H5D__farray_idx_iterate(idx_info, H5D__farray_idx_delete_cb, &udata) < 0) + if(H5D__farray_idx_iterate(idx_info, H5D__farray_idx_delete_cb, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk addresses") /* Close fixed array */ - if(H5FA_close(idx_info->storage->u.farray.fa, idx_info->dxpl_id) < 0) + if(H5FA_close(idx_info->storage->u.farray.fa) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close fixed array") idx_info->storage->u.farray.fa = NULL; @@ -1426,7 +1412,7 @@ H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info) ctx_udata.chunk_size = idx_info->layout->size; /* Delete fixed array */ - if(H5FA_delete(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &ctx_udata) < 0) + if(H5FA_delete(idx_info->f, idx_info->storage->idx_addr, &ctx_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk fixed array") idx_info->storage->idx_addr = HADDR_UNDEF; } /* end if */ @@ -1478,7 +1464,7 @@ H5D__farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open fixed array") /* Set copied metadata tag */ - H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Create the fixed array that describes chunked storage in the dest. file */ if(H5D__farray_idx_create(idx_info_dst) < 0) @@ -1486,7 +1472,7 @@ H5D__farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(H5F_addr_defined(idx_info_dst->storage->idx_addr)); /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) @@ -1507,7 +1493,7 @@ done: */ static herr_t H5D__farray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id) + H5O_storage_chunk_t *storage_dst) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1520,10 +1506,10 @@ H5D__farray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, HDassert(storage_dst->u.farray.fa); /* Close fixed arrays */ - if(H5FA_close(storage_src->u.farray.fa, dxpl_id) < 0) + if(H5FA_close(storage_src->u.farray.fa) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close fixed array") storage_src->u.farray.fa = NULL; - if(H5FA_close(storage_dst->u.farray.fa, dxpl_id) < 0) + if(H5FA_close(storage_dst->u.farray.fa) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close fixed array") storage_dst->u.farray.fa = NULL; @@ -1579,7 +1565,7 @@ H5D__farray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) done: if(idx_info->storage->u.farray.fa) { - if(H5FA_close(idx_info->storage->u.farray.fa, idx_info->dxpl_id) < 0) + if(H5FA_close(idx_info->storage->u.farray.fa) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close fixed array") idx_info->storage->u.farray.fa = NULL; } /* end if */ @@ -1676,7 +1662,7 @@ H5D__farray_idx_dest(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch fixed array file pointer") /* Close fixed array */ - if(H5FA_close(idx_info->storage->u.farray.fa, idx_info->dxpl_id) < 0) + if(H5FA_close(idx_info->storage->u.farray.fa) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close fixed array") idx_info->storage->u.farray.fa = NULL; } /* end if */ diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 922ac98..668ecc3 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -33,11 +33,12 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ -#include "H5VMprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -119,6 +120,7 @@ H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_ H5S_t *space; /* Dataspace */ H5T_t *fill_type; /* Fill-value datatype */ H5T_t *buf_type; /* Buffer datatype */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -133,12 +135,17 @@ H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") if(NULL == (buf_type = (H5T_t *)H5I_object_verify(buf_type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Fill the selection in the memory buffer */ - if(H5D__fill(fill, fill_type, buf, buf_type, space, H5AC_noio_dxpl_id) < 0) + if(H5D__fill(fill, fill_type, buf, buf_type, space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dfill() */ @@ -173,7 +180,7 @@ done: --------------------------------------------------------------------------*/ herr_t H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, - const H5T_t *buf_type, const H5S_t *space, hid_t dxpl_id) + const H5T_t *buf_type, const H5S_t *space) { H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info */ hbool_t mem_iter_init = FALSE; /* Whether the memory selection iterator has been initialized */ @@ -230,7 +237,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, buf_size = MAX(src_type_size, dst_type_size); /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(fill_type, buf_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(fill_type, buf_type))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") /* Construct source & destination datatype IDs, if we will need them */ @@ -247,8 +254,6 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, * of the VL data. */ if(TRUE == H5T_detect_class(fill_type, H5T_VLEN, FALSE)) { - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ hssize_t nelmts; /* Number of data elements */ /* Get the number of elements in the selection */ @@ -268,13 +273,9 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, H5VM_array_fill(tmp_buf, fill, src_type_size, (size_t)nelmts); /* Convert from file's fill value into memory form */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)nelmts, (size_t)0, (size_t)0, tmp_buf, bkg_buf, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, (size_t)nelmts, (size_t)0, (size_t)0, tmp_buf, bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") - /* 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") - /* Allocate the chunk selection iterator */ if(NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate memory selection iterator") @@ -285,7 +286,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, mem_iter_init = TRUE; /* Scatter the data into memory */ - if(H5D__scatter_mem(tmp_buf, space, mem_iter, (size_t)nelmts, dxpl_cache, buf/*out*/) < 0) + if(H5D__scatter_mem(tmp_buf, space, mem_iter, (size_t)nelmts, buf/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") } /* end if */ else { @@ -320,7 +321,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, } /* end if */ /* Perform datatype conversion */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, elem_ptr, bkg_ptr, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, elem_ptr, bkg_ptr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") /* Point at element buffer */ @@ -374,7 +375,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info, const H5O_fill_t *fill, const H5T_t *dset_type, hid_t dset_type_id, - size_t total_nelmts, size_t max_buf_size, hid_t dxpl_id) + size_t total_nelmts, size_t max_buf_size) { herr_t ret_value = SUCCEED; /* Return value */ @@ -410,7 +411,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, /* If necessary, convert fill value datatypes (which copies VL components, etc.) */ if(fb_info->has_vlen_fill_type) { /* Create temporary datatype for conversion operation */ - if(NULL == (fb_info->mem_type = H5T_copy(dset_type, H5T_COPY_REOPEN))) + if(NULL == (fb_info->mem_type = H5T_copy(dset_type, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy file datatype") if((fb_info->mem_tid = H5I_register(H5I_DATATYPE, fb_info->mem_type, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") @@ -449,11 +450,11 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, } /* end else */ /* Get the datatype conversion path for this operation */ - if(NULL == (fb_info->fill_to_mem_tpath = H5T_path_find(dset_type, fb_info->mem_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (fb_info->fill_to_mem_tpath = H5T_path_find(dset_type, fb_info->mem_type))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes") /* Get the inverse datatype conversion path for this operation */ - if(NULL == (fb_info->mem_to_dset_tpath = H5T_path_find(fb_info->mem_type, dset_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (fb_info->mem_to_dset_tpath = H5T_path_find(fb_info->mem_type, dset_type))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes") /* Check if we need to allocate a background buffer */ @@ -569,7 +570,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) +H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts) { herr_t ret_value = SUCCEED; /* Return value */ void * buf = NULL; /* Temporary fill buffer */ @@ -589,7 +590,7 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) HDmemset(fb_info->bkg_buf, 0, fb_info->max_elmt_size); /* Type convert the dataset buffer, to copy any VL components */ - if(H5T_convert(fb_info->fill_to_mem_tpath, fb_info->file_tid, fb_info->mem_tid, (size_t)1, (size_t)0, (size_t)0, fb_info->fill_buf, fb_info->bkg_buf, dxpl_id) < 0) + if(H5T_convert(fb_info->fill_to_mem_tpath, fb_info->file_tid, fb_info->mem_tid, (size_t)1, (size_t)0, (size_t)0, fb_info->fill_buf, fb_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") /* Replicate the fill value into the cached buffer */ @@ -611,18 +612,18 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) HDmemcpy(buf, fb_info->fill_buf, fb_info->fill_buf_size); /* Type convert the dataset buffer, to copy any VL components */ - if(H5T_convert(fb_info->mem_to_dset_tpath, fb_info->mem_tid, fb_info->file_tid, nelmts, (size_t)0, (size_t)0, fb_info->fill_buf, fb_info->bkg_buf, dxpl_id) < 0) + if(H5T_convert(fb_info->mem_to_dset_tpath, fb_info->mem_tid, fb_info->file_tid, nelmts, (size_t)0, (size_t)0, fb_info->fill_buf, fb_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") done: if(buf) { /* Free dynamically allocated VL elements in fill buffer */ if(fb_info->fill->type) { - if(H5T_vlen_reclaim_elmt(buf, fb_info->fill->type, dxpl_id) < 0) + if(H5T_vlen_reclaim_elmt(buf, fb_info->fill->type) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't reclaim vlen element") } /* end if */ else { - if(H5T_vlen_reclaim_elmt(buf, fb_info->mem_type, dxpl_id) < 0) + if(H5T_vlen_reclaim_elmt(buf, fb_info->mem_type) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't reclaim vlen element") } /* end else */ @@ -703,7 +704,7 @@ H5D__fill_term(H5D_fill_buf_info_t *fb_info) if(fb_info->mem_tid > 0) H5I_dec_ref(fb_info->mem_tid); else if(fb_info->mem_type) - H5T_close(fb_info->mem_type); + (void)H5T_close_real(fb_info->mem_type); if(fb_info->bkg_buf) fb_info->bkg_buf = H5FL_BLK_FREE(type_conv, fb_info->bkg_buf); } /* end if */ diff --git a/src/H5Dint.c b/src/H5Dint.c index b6c0341..c6c4ecd 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -23,6 +23,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Dpkg.h" /* Datasets */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5FOprivate.h" /* File objects */ @@ -40,41 +41,31 @@ /* Local Typedefs */ /******************/ -/* Struct for holding callback info during H5D_flush operation */ -typedef struct { - const H5F_t *f; /* Pointer to file being flushed */ - hid_t dxpl_id; /* DXPL for I/O operations */ -} H5D_flush_ud_t; - /********************/ /* Local Prototypes */ /********************/ /* General stuff */ -static herr_t H5D__get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache); -static H5D_shared_t *H5D__new(hid_t dcpl_id, hbool_t creating, - hbool_t vl_type); +static H5D_shared_t *H5D__new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type); static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, - const H5T_t *type); + const H5T_t *type); static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); -static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, - hid_t dapl_id); -static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, +static herr_t H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id); +static herr_t H5D__build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix); -static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); +static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); +static herr_t H5D__get_storage_size_real(const H5D_t *dset, hsize_t *storage_size); static herr_t H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id); +static herr_t H5D__close_cb(H5D_t *dataset); /*********************/ /* Package Variables */ /*********************/ -/* Define a "default" dataset transfer property list cache structure to use for default DXPLs */ -H5D_dxpl_cache_t H5D_def_dxpl_cache; - /* Declare a free list to manage blocks of VL data */ H5FL_BLK_DEFINE(vlen_vl_buf); @@ -109,10 +100,10 @@ static H5D_shared_t H5D_def_dset; /* Dataset ID class */ static const H5I_class_t H5I_DATASET_CLS[1] = {{ - H5I_DATASET, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ - (H5I_free_t)H5D_close /* Callback routine for closing objects of this class */ + H5I_DATASET, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5D__close_cb /* Callback routine for closing objects of this class */ }}; /* Flag indicating "top" of interface has been initialized */ @@ -191,13 +182,6 @@ H5D__init_package(void) if(H5P_get(def_dcpl, H5O_CRT_PIPELINE_NAME, &H5D_def_dset.dcpl_cache.pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") - /* Reset the "default DXPL cache" information */ - HDmemset(&H5D_def_dxpl_cache, 0, sizeof(H5D_dxpl_cache_t)); - - /* Get the default DXPL cache information */ - if(H5D__get_dxpl_cache_real(H5P_DATASET_XFER_DEFAULT, &H5D_def_dxpl_cache) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve default DXPL info") - /* Mark "top" of interface as initialized, too */ H5D_top_package_initialize_s = TRUE; @@ -297,136 +281,6 @@ H5D_term_package(void) } /* end H5D_term_package() */ -/*-------------------------------------------------------------------------- - NAME - H5D__get_dxpl_cache_real - PURPOSE - Get all the values for the DXPL cache. - USAGE - herr_t H5D__get_dxpl_cache_real(dxpl_id, cache) - hid_t dxpl_id; IN: DXPL to query - H5D_dxpl_cache_t *cache;IN/OUT: DXPL cache to fill with values - RETURNS - Non-negative on success/Negative on failure. - DESCRIPTION - Query all the values from a DXPL that are needed by internal routines - within the library. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static herr_t -H5D__get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache) -{ - H5P_genplist_t *dx_plist; /* Data transfer property list */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Check args */ - HDassert(cache); - - /* Get the dataset transfer property list */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Get maximum temporary buffer size */ - if(H5P_get(dx_plist, H5D_XFER_MAX_TEMP_BUF_NAME, &cache->max_temp_buf) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve maximum temporary buffer size") - - /* Get temporary buffer pointer */ - if(H5P_get(dx_plist, H5D_XFER_TCONV_BUF_NAME, &cache->tconv_buf) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve temporary buffer pointer") - - /* Get background buffer pointer */ - if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_NAME, &cache->bkgr_buf) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer pointer") - - /* Get background buffer type */ - if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &cache->bkgr_buf_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer type") - - /* Get B-tree split ratios */ - if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &cache->btree_split_ratio) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve B-tree split ratios") - - /* Get I/O vector size */ - if(H5P_get(dx_plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &cache->vec_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve I/O vector size") - -#ifdef H5_HAVE_PARALLEL - /* Collect Parallel I/O information for possible later use */ - if(H5P_get(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &cache->xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve parallel transfer method") - if(H5P_get(dx_plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &cache->coll_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve collective transfer option") -#endif /* H5_HAVE_PARALLEL */ - - /* Get error detection properties */ - if(H5P_get(dx_plist, H5D_XFER_EDC_NAME, &cache->err_detect) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve error detection info") - - /* Get filter callback function */ - if(H5P_get(dx_plist, H5D_XFER_FILTER_CB_NAME, &cache->filter_cb) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve filter callback function") - - /* Look at the data transform property */ - /* (Note: 'peek', not 'get' - if this turns out to be a problem, we should - * add a H5D__free_dxpl_cache() routine. -QAK) - */ - if(H5P_peek(dx_plist, H5D_XFER_XFORM_NAME, &cache->data_xform_prop) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve data transform info") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__get_dxpl_cache_real() */ - - -/*-------------------------------------------------------------------------- - NAME - H5D__get_dxpl_cache - PURPOSE - Get all the values for the DXPL cache. - USAGE - herr_t H5D__get_dxpl_cache(dxpl_id, cache) - hid_t dxpl_id; IN: DXPL to query - H5D_dxpl_cache_t *cache;IN/OUT: DXPL cache to fill with values - RETURNS - Non-negative on success/Negative on failure. - DESCRIPTION - Query all the values from a DXPL that are needed by internal routines - within the library. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - The CACHE pointer should point at already allocated memory to place - non-default property list info. If a default property list is used, the - CACHE pointer will be changed to point at the default information. - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -herr_t -H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache) -{ - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_PACKAGE - - /* Check args */ - HDassert(cache); - - /* Check for the default DXPL */ - if(dxpl_id==H5P_DATASET_XFER_DEFAULT) - *cache=&H5D_def_dxpl_cache; - else - if(H5D__get_dxpl_cache_real(dxpl_id,*cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't retrieve DXPL values") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__get_dxpl_cache() */ - - /*------------------------------------------------------------------------- * Function: H5D__create_named * @@ -439,14 +293,13 @@ done: */ H5D_t * H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, - const H5S_t *space, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id, - hid_t dxpl_id) + const H5S_t *space, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id) { H5O_obj_create_t ocrt_info; /* Information for object creation */ H5D_obj_create_t dcrt_info; /* Information for dataset creation */ H5D_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL /* Check arguments */ HDassert(loc); @@ -456,7 +309,6 @@ H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, HDassert(lcpl_id != H5P_DEFAULT); HDassert(dcpl_id != H5P_DEFAULT); HDassert(dapl_id != H5P_DEFAULT); - HDassert(dxpl_id != H5P_DEFAULT); /* Set up dataset creation info */ dcrt_info.type_id = type_id; @@ -470,7 +322,7 @@ H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, ocrt_info.new_obj = NULL; /* Create the new dataset and link it to its parent group */ - if(H5L_link_object(loc, name, &ocrt_info, lcpl_id, dapl_id, dxpl_id) < 0) + if(H5L_link_object(loc, name, &ocrt_info, lcpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create and link to dataset") HDassert(ocrt_info.new_obj); @@ -478,11 +330,52 @@ H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, ret_value = (H5D_t *)ocrt_info.new_obj; done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__create_named() */ /*------------------------------------------------------------------------- + * Function: H5D__create_anon + * + * Purpose: Internal routine to create a new anonymous dataset. + * + * Note: This routine is needed so that there's a non-API routine for + * creating datasets that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-NULL, pointer to new dataset object. + * Failure: NULL + * + * Programmer: Quincey Koziol + * December 9, 2017 + * + *------------------------------------------------------------------------- + */ +H5D_t * +H5D__create_anon(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, + hid_t dapl_id) +{ + H5D_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(file); + HDassert(type_id != H5P_DEFAULT); + HDassert(space); + HDassert(dcpl_id != H5P_DEFAULT); + HDassert(dapl_id != H5P_DEFAULT); + + /* Build and open the dataset */ + if(NULL == (ret_value = H5D__create(file, type_id, space, dcpl_id, dapl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create dataset") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5D__create_anon() */ + + +/*------------------------------------------------------------------------- * Function: H5D__get_space_status * * Purpose: Returns the status of data space allocation. @@ -493,21 +386,22 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id) +H5D__get_space_status(const H5D_t *dset, H5D_space_status_t *allocation) { - hsize_t space_allocated; /* The number of bytes allocated for chunks */ - hssize_t snelmts; /* Temporary holder for number of elements in dataspace */ - hsize_t nelmts; /* Number of elements in dataspace */ - size_t dt_size; /* Size of datatype */ - hsize_t full_size; /* The number of bytes in the dataset when fully populated */ herr_t ret_value = SUCCEED; - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL HDassert(dset); /* Check for chunked layout */ if(dset->shared->layout.type == H5D_CHUNKED) { + hsize_t space_allocated; /* The number of bytes allocated for chunks */ + hssize_t snelmts; /* Temporary holder for number of elements in dataspace */ + hsize_t nelmts; /* Number of elements in dataspace */ + size_t dt_size; /* Size of datatype */ + hsize_t full_size; /* The number of bytes in the dataset when fully populated */ + /* For chunked layout set the space status by the storage size */ /* Get the dataset's dataspace */ HDassert(dset->shared->space); @@ -529,7 +423,7 @@ H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id HGOTO_ERROR(H5E_DATASET, H5E_OVERFLOW, FAIL, "size of dataset's storage overflowed") /* Difficult to error check, since the error value is 0 and 0 is a valid value... :-/ */ - if(H5D__get_storage_size(dset, dxpl_id, &space_allocated) < 0) + if(H5D__get_storage_size_real(dset, &space_allocated) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get size of dataset's storage") /* Decide on how much of the space is allocated */ @@ -550,7 +444,7 @@ H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__get_space_status() */ @@ -652,8 +546,8 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) if((dset->shared->type = H5T_copy(type, H5T_COPY_ALL)) == NULL) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy datatype") - /* Convert a datatype (if committed) to a transient type if the committed datatype's file - location is different from the file location where the dataset will be created */ + /* Convert a datatype (if committed) to a transient type if the committed datatype's file + location is different from the file location where the dataset will be created */ if(H5T_convert_committed_datatype(dset->shared->type, file) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get shared datatype info") @@ -667,8 +561,8 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") /* Get a datatype ID for the dataset's datatype */ - if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") + if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") } /* end if */ /* Not a custom datatype, just use it directly */ else { @@ -718,7 +612,7 @@ H5D__cache_dataspace_info(const H5D_t *dset) 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; - } + } /* end for */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -783,7 +677,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) +H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) { H5O_t *oh = NULL; /* Pointer to dataset's object header */ size_t ohdr_size = H5D_MINHDR_SIZE; /* Size of dataset's object header */ @@ -831,14 +725,13 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) /* Determine whether fill value is defined or not */ if(fill_status == H5D_FILL_VALUE_DEFAULT || fill_status == H5D_FILL_VALUE_USER_DEFINED) { /* Convert fill value buffer to dataset's datatype */ - if(fill_prop->buf && fill_prop->size > 0 && H5O_fill_convert(fill_prop, type, &fill_changed, dxpl_id) < 0) + if(fill_prop->buf && fill_prop->size > 0 && H5O_fill_convert(fill_prop, type, &fill_changed) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert fill value to dataset type") - fill_prop->fill_defined = TRUE; - } - else if(fill_status == H5D_FILL_VALUE_UNDEFINED) { + fill_prop->fill_defined = TRUE; + } /* end if */ + else if(fill_status == H5D_FILL_VALUE_UNDEFINED) fill_prop->fill_defined = FALSE; - } else HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine if fill value is defined") @@ -865,24 +758,24 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) ohdr_size += layout->storage.u.compact.size; /* Create an object header for the dataset */ - if(H5O_create(file, dxpl_id, ohdr_size, (size_t)1, dset->shared->dcpl_id, oloc/*out*/) < 0) + if(H5O_create(file, ohdr_size, (size_t)1, dset->shared->dcpl_id, oloc/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset object header") HDassert(file == dset->oloc.file); /* Pin the object header */ - if(NULL == (oh = H5O_pin(oloc, dxpl_id))) + if(NULL == (oh = H5O_pin(oloc))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPIN, FAIL, "unable to pin dataset object header") /* Write the dataspace header message */ - if(H5S_append(file, dxpl_id, oh, dset->shared->space) < 0) + if(H5S_append(file, oh, dset->shared->space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update dataspace header message") /* Write the datatype header message */ - if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT, 0, type) < 0) + if(H5O_msg_append_oh(file, oh, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT, 0, type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update datatype header message") /* Write new fill value message */ - if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_FILL_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, fill_prop) < 0) + if(H5O_msg_append_oh(file, oh, H5O_FILL_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, fill_prop) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update new fill value header message") /* If there is valid information for the old fill value struct, add it */ @@ -898,12 +791,12 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) H5O_msg_reset_share(H5O_FILL_ID, &old_fill_prop); /* Write old fill value */ - if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_FILL_ID, H5O_MSG_FLAG_CONSTANT, 0, &old_fill_prop) < 0) + if(H5O_msg_append_oh(file, oh, H5O_FILL_ID, H5O_MSG_FLAG_CONSTANT, 0, &old_fill_prop) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update old fill value header message") } /* end if */ /* Update/create the layout (and I/O pipeline & EFL) messages */ - if(H5D__layout_oh_create(file, dxpl_id, oh, dset, dapl_id) < 0) + if(H5D__layout_oh_create(file, oh, dset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout/pline/efl header message") /* Indicate that the layout information was initialized */ @@ -922,17 +815,17 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) (H5P_exist_plist(dc_plist, H5O_BOGUS_MSG_ID_NAME) > 0) ) { uint8_t bogus_flags = 0; /* Flags for creating "bogus" message */ - unsigned bogus_id; /* "bogus" ID */ + unsigned bogus_id; /* "bogus" ID */ - /* Retrieve "bogus" message ID */ + /* Retrieve "bogus" message ID */ if(H5P_get(dc_plist, H5O_BOGUS_MSG_ID_NAME, &bogus_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus ID options") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus ID options") /* Retrieve "bogus" message flags */ if(H5P_get(dc_plist, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus message options") /* Add a "bogus" message (for error testing). */ - if(H5O_bogus_oh(file, dxpl_id, oh, bogus_id, (unsigned)bogus_flags) < 0) + if(H5O_bogus_oh(file, oh, bogus_id, (unsigned)bogus_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create 'bogus' message") } /* end if */ } @@ -943,7 +836,7 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) * header and doesn't use a separate message -QAK) */ if(!(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_NO_MOD_TIME_MSG))) - if(H5O_touch_oh(file, dxpl_id, oh, TRUE) < 0) + if(H5O_touch_oh(file, oh, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") done: @@ -956,7 +849,7 @@ done: if(ret_value < 0) if(layout_init) /* Destroy the layout information for the dataset */ - if(dset->shared->layout.ops->dest && (dset->shared->layout.ops->dest)(dset, dxpl_id) < 0) + if(dset->shared->layout.ops->dest && (dset->shared->layout.ops->dest)(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy layout info") FUNC_LEAVE_NOAPI(ret_value) @@ -964,7 +857,7 @@ done: /*-------------------------------------------------------------------------- - * Function: H5D_build_extfile_prefix + * Function: H5D__build_extfile_prefix * * Purpose: Determine the external file prefix to be used and store * it in extfile_prefix. Stores an empty string if no prefix @@ -974,7 +867,7 @@ done: *-------------------------------------------------------------------------- */ static herr_t -H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/) +H5D__build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/) { char *prefix = NULL; /* prefix used to look for the file */ char *extpath = NULL; /* absolute path of directory the HDF5 file is in */ @@ -984,12 +877,11 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_STATIC - FUNC_ENTER_NOAPI_NOINIT - + /* Sanity checks */ HDassert(dset); HDassert(dset->oloc.file); - extpath = H5F_EXTPATH(dset->oloc.file); HDassert(extpath); @@ -1035,7 +927,7 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_build_extfile_prefix() */ +} /* H5D__build_extfile_prefix() */ /*------------------------------------------------------------------------- @@ -1055,7 +947,7 @@ done: */ H5D_t * H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, - hid_t dapl_id, hid_t dxpl_id) + hid_t dapl_id) { const H5T_t *type; /* Datatype for dataset */ H5D_t *new_dset = NULL; @@ -1076,7 +968,6 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HDassert(H5I_DATATYPE == H5I_get_type(type_id)); HDassert(space); HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); - HDassert(H5I_GENPROP_LST == H5I_get_type(dxpl_id)); /* Get the dataset's datatype */ if(NULL == (type = (const H5T_t *)H5I_object(type_id))) @@ -1171,24 +1062,24 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, /* Set the latest version of the layout, pline & fill messages, if requested */ if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DSET_MSG_FLAGS)) { /* Set the latest version for the I/O pipeline message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_PLINE_MSG)) - if(H5O_pline_set_latest_version(&new_dset->shared->dcpl_cache.pline) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of I/O filter pipeline") + if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_PLINE_MSG)) + if(H5O_pline_set_latest_version(&new_dset->shared->dcpl_cache.pline) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of I/O filter pipeline") /* Set the latest version for the fill message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG)) - /* Set the latest version for the fill value message */ - if(H5O_fill_set_latest_version(&new_dset->shared->dcpl_cache.fill) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") + if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG)) + /* Set the latest version for the fill value message */ + if(H5O_fill_set_latest_version(&new_dset->shared->dcpl_cache.fill) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") /* Set the latest version for the layout message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_LAYOUT_MSG)) - /* Set the latest version for the layout message */ - if(H5D__layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") + if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_LAYOUT_MSG)) + /* Set the latest version for the layout message */ + if(H5D__layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") } /* end if */ else if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) { - /* Use latest indexing type for layout message version >= 4 */ + /* Use latest indexing type for layout message version >= 4 */ if(H5D__layout_set_latest_indexing(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest indexing") } /* end if */ @@ -1206,7 +1097,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to construct layout information") /* Update the dataset's object header info. */ - if(H5D__update_oh_info(file, dxpl_id, new_dset, dapl_id) < 0) + if(H5D__update_oh_info(file, new_dset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't update the metadata cache") /* Indicate that the layout information was initialized */ @@ -1214,10 +1105,10 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, /* Set up append flush parameters for the dataset */ if(H5D__append_flush_setup(new_dset, dapl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") /* Set the external file prefix */ - if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) + if(H5D__build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") /* Add the dataset to the list of opened objects in the file */ @@ -1234,7 +1125,7 @@ done: if(!ret_value && new_dset && new_dset->shared) { if(new_dset->shared) { if(layout_init) - if(new_dset->shared->layout.ops->dest && (new_dset->shared->layout.ops->dest)(new_dset, dxpl_id) < 0) + if(new_dset->shared->layout.ops->dest && (new_dset->shared->layout.ops->dest)(new_dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, NULL, "unable to destroy layout info") if(pline_copied) if(H5O_msg_reset(H5O_PLINE_ID, &new_dset->shared->dcpl_cache.pline) < 0) @@ -1253,12 +1144,12 @@ done: if(new_dset->shared->type && H5I_dec_ref(new_dset->shared->type_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") if(H5F_addr_defined(new_dset->oloc.addr)) { - if(H5O_dec_rc_by_loc(&(new_dset->oloc), dxpl_id) < 0) + if(H5O_dec_rc_by_loc(&(new_dset->oloc)) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") if(H5O_close(&(new_dset->oloc), NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release object header") if(file) { - if(H5O_delete(file, dxpl_id, new_dset->oloc.addr) < 0) + if(H5O_delete(file, new_dset->oloc.addr) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDELETE, NULL, "unable to delete object header") } /* end if */ } /* end if */ @@ -1285,8 +1176,7 @@ done: *------------------------------------------------------------------------- */ H5D_t * -H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id, - hid_t dxpl_id) +H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id) { H5D_t *dset = NULL; H5G_loc_t dset_loc; /* Object location of dataset */ @@ -1296,7 +1186,7 @@ H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id, hbool_t loc_found = FALSE; /* Location at 'name' found */ H5D_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL /* Check args */ HDassert(loc); @@ -1308,18 +1198,18 @@ H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id, H5G_loc_reset(&dset_loc); /* Find the dataset object */ - if(H5G_loc_find(loc, name, &dset_loc, dapl_id, dxpl_id) < 0) + if(H5G_loc_find(loc, name, &dset_loc) < 0) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, NULL, "not found") loc_found = TRUE; /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&oloc, &obj_type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get object type") if(obj_type != H5O_TYPE_DATASET) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, NULL, "not a dataset") /* Open the dataset */ - if(NULL == (dset = H5D_open(&dset_loc, dapl_id, dxpl_id))) + if(NULL == (dset = H5D_open(&dset_loc, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't open dataset") /* Set return value */ @@ -1330,7 +1220,7 @@ done: if(loc_found && H5G_loc_free(&dset_loc) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, NULL, "can't free location") - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__open_name() */ @@ -1346,7 +1236,7 @@ done: *------------------------------------------------------------------------- */ H5D_t * -H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) +H5D_open(const H5G_loc_t *loc, hid_t dapl_id) { H5D_shared_t *shared_fo = NULL; H5D_t *dataset = NULL; @@ -1371,7 +1261,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path") /* Get the external file prefix */ - if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) + if(H5D__build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") /* Check if dataset was already open */ @@ -1380,7 +1270,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) H5E_clear_stack(NULL); /* Open the dataset object */ - if(H5D__open_oid(dataset, dapl_id, dxpl_id) < 0) + if(H5D__open_oid(dataset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, NULL, "not found") /* Add the dataset to the list of opened objects in the file */ @@ -1437,7 +1327,7 @@ done: if(shared_fo == NULL && dataset->shared) { /* Need to free shared fo */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); - } + } /* end if */ H5O_loc_free(&(dataset->oloc)); H5G_name_free(&(dataset->path)); @@ -1536,7 +1426,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) +H5D__open_oid(H5D_t *dataset, hid_t dapl_id) { H5P_genplist_t *plist; /* Property list */ H5O_fill_t *fill_prop; /* Pointer to dataset's fill value info */ @@ -1545,7 +1435,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_STATIC_TAG(dataset->oloc.addr) /* check args */ HDassert(dataset); @@ -1559,13 +1449,13 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open") /* Get the type and space */ - if(NULL == (dataset->shared->type = (H5T_t *)H5O_msg_read(&(dataset->oloc), H5O_DTYPE_ID, NULL, dxpl_id))) + if(NULL == (dataset->shared->type = (H5T_t *)H5O_msg_read(&(dataset->oloc), H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load type info from dataset header") if(H5T_set_loc(dataset->shared->type, dataset->oloc.file, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location") - if(NULL == (dataset->shared->space = H5S_read(&(dataset->oloc), dxpl_id))) + if(NULL == (dataset->shared->space = H5S_read(&(dataset->oloc)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load dataspace info from dataset header") /* Cache the dataset's dataspace info */ @@ -1581,7 +1471,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Get the layout/pline/efl message information */ - if(H5D__layout_oh_read(dataset, dxpl_id, dapl_id, plist) < 0) + if(H5D__layout_oh_read(dataset, dapl_id, plist) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout/pline/efl info") /* Indicate that the layout information was initialized */ @@ -1595,18 +1485,18 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) fill_prop = &dataset->shared->dcpl_cache.fill; /* Try to get the new fill value message from the object header */ - if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_NEW_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_NEW_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") if(msg_exists) { - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_NEW_ID, fill_prop, dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_NEW_ID, fill_prop)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") } /* end if */ else { /* For backward compatibility, try to retrieve the old fill value message */ - if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") if(msg_exists) { - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_ID, fill_prop, dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_ID, fill_prop)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") } /* end if */ else { @@ -1665,8 +1555,6 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) H5D_io_info_t io_info; io_info.dset = dataset; - io_info.raw_dxpl_id = H5AC_rawdata_dxpl_id; - io_info.md_dxpl_id = dxpl_id; if(H5D__alloc_storage(&io_info, H5D_ALLOC_OPEN, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file storage") @@ -1678,7 +1566,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header") if(dataset->shared) { if(layout_init) - if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset, dxpl_id) < 0) + if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy layout info") if(dataset->shared->space && H5S_close(dataset->shared->space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") @@ -1688,18 +1576,48 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") } /* end if */ else { - if(H5T_close(dataset->shared->type) < 0) + if(H5T_close_real(dataset->shared->type) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") } /* end else */ } /* end if */ } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__open_oid() */ /*------------------------------------------------------------------------- + * Function: H5D__close_cb + * + * Purpose: Callback routine for closing a dataset ID. Closes the dataset + * object that was attached to the ID. + * + * Return: Non-negative on success/Negative on failure + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D__close_cb(H5D_t *dataset) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* check args */ + HDassert(dataset && dataset->oloc.file && dataset->shared); + HDassert(dataset->shared->fo_count > 0); + + /* Call actual dataset close routine */ + if(H5D_close(dataset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close dataset"); + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5D__close_cb() */ + + +/*------------------------------------------------------------------------- * Function: H5D_close * * Purpose: Insures that all data has been saved to the file, closes the @@ -1732,7 +1650,7 @@ H5D_close(H5D_t *dataset) if(dataset->shared->fo_count == 0) { /* Flush the dataset's information. Continue to close even if it fails. */ - if(H5D__flush_real(dataset, H5AC_ind_read_dxpl_id) < 0) + if(H5D__flush_real(dataset) < 0) HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") /* Set a flag to indicate the dataset is closing, before we start freeing things */ @@ -1812,7 +1730,7 @@ H5D_close(H5D_t *dataset) } /* end switch */ /*lint !e788 All appropriate cases are covered */ /* Destroy any cached layout information for the dataset */ - if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset, H5AC_ind_read_dxpl_id) < 0) + if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy layout info") /* Free the external file prefix */ @@ -1842,21 +1760,21 @@ H5D_close(H5D_t *dataset) /* Remove the dataset from the list of opened objects in the file */ if(H5FO_top_decr(dataset->oloc.file, dataset->oloc.addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't decrement count for object") - if(H5FO_delete(dataset->oloc.file, H5AC_ind_read_dxpl_id, dataset->oloc.addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't remove dataset from list of open objects") + HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't decrement count for object") + if(H5FO_delete(dataset->oloc.file, dataset->oloc.addr) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't remove dataset from list of open objects") /* Close the dataset object */ /* (This closes the file, if this is the last object open) */ if(H5O_close(&(dataset->oloc), &file_closed) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header") + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header") /* Evict dataset metadata if evicting on close */ if(!file_closed && H5F_SHARED(dataset->oloc.file) && H5F_EVICT_ON_CLOSE(dataset->oloc.file)) { - if(H5AC_flush_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") - if(H5AC_evict_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, FALSE, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata") + if(H5AC_flush_tagged_metadata(dataset->oloc.file, dataset->oloc.addr) < 0) + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") + if(H5AC_evict_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, FALSE) < 0) + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata") } /* end if */ /* @@ -1867,7 +1785,6 @@ H5D_close(H5D_t *dataset) */ dataset->oloc.file = NULL; dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); - } /* end if */ else { /* Decrement the ref. count for this object in the top file */ @@ -1911,7 +1828,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_mult_refresh_close(hid_t dset_id, hid_t dxpl_id) +H5D_mult_refresh_close(hid_t dset_id) { H5D_t *dataset; /* Dataset to refresh */ herr_t ret_value = SUCCEED; /* return value */ @@ -1970,7 +1887,7 @@ H5D_mult_refresh_close(hid_t dset_id, hid_t dxpl_id) } /* end switch */ /*lint !e788 All appropriate cases are covered */ /* Destroy any cached layout information for the dataset */ - if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset, dxpl_id) < 0) + if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy layout info") } /* end if */ @@ -1983,13 +1900,13 @@ done: * Function: H5D_mult_refresh_reopen * * Purpose: Re-initialize the needed info when the dataset has multiple - * opens. (From H5O_refresh_metadata_reopen()) + * opens. * * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t -H5D_mult_refresh_reopen(H5D_t *dataset, hid_t dxpl_id) +H5D_mult_refresh_reopen(H5D_t *dataset) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2005,7 +1922,7 @@ H5D_mult_refresh_reopen(H5D_t *dataset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to release dataspace") /* Re-load dataspace info */ - if(NULL == (dataset->shared->space = H5S_read(&(dataset->oloc), dxpl_id))) + if(NULL == (dataset->shared->space = H5S_read(&(dataset->oloc)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load dataspace info from dataset header") /* Cache the dataset's dataspace info */ @@ -2017,7 +1934,7 @@ H5D_mult_refresh_reopen(H5D_t *dataset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout info") /* Re-load layout message info */ - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout), dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read data layout message") } /* end if */ @@ -2127,7 +2044,7 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, /* Check if we have a zero-sized dataset */ if(layout->storage.u.contig.size > 0) { /* Reserve space in the file for the entire array */ - if(H5D__contig_alloc(f, io_info->md_dxpl_id, &layout->storage.u.contig/*out*/) < 0) + if(H5D__contig_alloc(f, &layout->storage.u.contig/*out*/) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize contiguous storage") /* Indicate that we should initialize storage space */ @@ -2144,7 +2061,7 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, case H5D_CHUNKED: if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { /* Create the root of the index that manages chunked storage */ - if(H5D__chunk_create(dset /*in,out*/, io_info->md_dxpl_id) < 0) + if(H5D__chunk_create(dset /*in,out*/) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") /* Indicate that we set the storage addr */ @@ -2245,7 +2162,7 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, */ if(time_alloc != H5D_ALLOC_CREATE && addr_set) /* Mark the layout as dirty, for later writing to the file */ - if(H5D__mark(dset, io_info->md_dxpl_id, H5D_MARK_LAYOUT) < 0) + if(H5D__mark(dset, H5D_MARK_LAYOUT) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ @@ -2279,7 +2196,7 @@ H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t /* If we will be immediately overwriting the values, don't bother to clear them */ if(!full_overwrite) { /* Fill the compact dataset storage */ - if(H5D__compact_fill(dset, io_info->md_dxpl_id) < 0) + if(H5D__compact_fill(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize compact dataset storage") } /* end if */ break; @@ -2327,7 +2244,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__get_storage_size + * Function: H5D__get_storage_size_real * * Purpose: Determines how much space has been reserved to store the raw * data of a dataset. @@ -2335,17 +2252,17 @@ done: * Return: Non-negative on success, negative on failure *------------------------------------------------------------------------- */ -herr_t -H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size) +static herr_t +H5D__get_storage_size_real(const H5D_t *dset, hsize_t *storage_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) switch(dset->shared->layout.type) { case H5D_CHUNKED: if((*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { - if(H5D__chunk_allocated(dset, dxpl_id, storage_size) < 0) + if(H5D__chunk_allocated(dset, storage_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve chunked dataset allocated size") } /* end if */ else @@ -2377,7 +2294,36 @@ H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size) } /*lint !e788 All appropriate cases are covered */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, 0) + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5D__get_storage_size_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5D__get_storage_size + * + * Purpose: Determines how much space has been reserved to store the raw + * data of a dataset. + * + * Note: This routine is needed so that there's a non-API routine for + * creating attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Non-negative on success, negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5D__get_storage_size(const H5D_t *dset, hsize_t *storage_size) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Difficult to error check, since the error value is 0 and 0 is a valid value... :-/ */ + if(H5D__get_storage_size_real(dset, storage_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get size of dataset's storage") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__get_storage_size() */ @@ -2430,19 +2376,17 @@ done: * * Purpose: Frees the buffers allocated for storing variable-length data * in memory. Only frees the VL data in the selection defined in the - * dataspace. The dataset transfer property list is required to find the - * correct allocation/free methods for the VL data in the buffer. + * dataspace. * * Return: Non-negative on success, negative on failure *------------------------------------------------------------------------- */ herr_t -H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf) +H5D_vlen_reclaim(hid_t type_id, H5S_t *space, void *buf) { H5T_t *type; /* Datatype */ H5S_sel_iter_op_t dset_op; /* Operator for iteration */ - H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ - H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ + H5T_vlen_alloc_info_t vl_alloc_info; /* VL allocation info */ herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2450,14 +2394,13 @@ H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf) /* Check args */ HDassert(H5I_DATATYPE == H5I_get_type(type_id)); HDassert(space); - HDassert(H5P_isa_class(plist_id, H5P_DATASET_XFER)); HDassert(buf); if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype") /* Get the allocation info */ - if(H5T_vlen_get_alloc_info(plist_id,&vl_alloc_info) < 0) + if(H5CX_get_vlen_alloc_info(&vl_alloc_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") /* Call H5S_select_iterate with args, etc. */ @@ -2465,7 +2408,7 @@ H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf) dset_op.u.app_op.op = H5T_vlen_reclaim; dset_op.u.app_op.type_id = type_id; - ret_value = H5S_select_iterate(buf, type, space, &dset_op, vl_alloc_info); + ret_value = H5S_select_iterate(buf, type, space, &dset_op, &vl_alloc_info); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2524,7 +2467,8 @@ H5D__vlen_get_buf_size_alloc(size_t size, void *info) *------------------------------------------------------------------------- */ herr_t -H5D__vlen_get_buf_size(void H5_ATTR_UNUSED *elem, hid_t type_id, unsigned H5_ATTR_UNUSED ndim, const hsize_t *point, void *op_data) +H5D__vlen_get_buf_size(void H5_ATTR_UNUSED *elem, hid_t type_id, + unsigned H5_ATTR_UNUSED ndim, const hsize_t *point, void *op_data) { H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)op_data; H5T_t *dt; /* Datatype for operation */ @@ -2548,7 +2492,7 @@ H5D__vlen_get_buf_size(void H5_ATTR_UNUSED *elem, hid_t type_id, unsigned H5_ATT HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't select point") /* Read in the point (with the custom VL memory allocator) */ - if(H5D__read(vlen_bufsize->dset, type_id, vlen_bufsize->mspace, vlen_bufsize->fspace, vlen_bufsize->xfer_pid, vlen_bufsize->fl_tbuf) < 0) + if(H5D__read(vlen_bufsize->dset, type_id, vlen_bufsize->mspace, vlen_bufsize->fspace, vlen_bufsize->fl_tbuf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read point") done: @@ -2616,14 +2560,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) +H5D__set_extent(H5D_t *dset, const hsize_t *size) { hsize_t curr_dims[H5S_MAX_RANK]; /* Current dimension sizes */ htri_t changed; /* Whether the dataspace changed size */ size_t u, v; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_VOL_TAG(dset->oloc.addr) /* Check args */ HDassert(dset); @@ -2718,7 +2662,7 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) /* Check if updating the chunk cache indices is necessary */ if(update_chunks) /* Update the chunk cache indices */ - if(H5D__chunk_update_cache(dset, dxpl_id) < 0) + if(H5D__chunk_update_cache(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices") } /* end if */ @@ -2751,12 +2695,10 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) H5D_io_info_t io_info; io_info.dset = dset; - io_info.raw_dxpl_id = H5AC_rawdata_dxpl_id; - io_info.md_dxpl_id = dxpl_id; if(H5D__alloc_storage(&io_info, H5D_ALLOC_EXTEND, FALSE, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset storage") - } + } /* end if */ /*------------------------------------------------------------------------- * Remove chunk information in the case of chunked datasets * This removal takes place only in case we are shrinking the dateset @@ -2766,24 +2708,24 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) if(H5D_CHUNKED == dset->shared->layout.type) { if(shrink && (*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) /* Remove excess chunks */ - if(H5D__chunk_prune_by_extent(dset, dxpl_id, curr_dims) < 0) + if(H5D__chunk_prune_by_extent(dset, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to remove chunks") /* Update chunks that are no longer edge chunks as a result of * expansion */ if(expand && (dset->shared->layout.u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && (dset->shared->dcpl_cache.pline.nused > 0)) - if(H5D__chunk_update_old_edge_chunks(dset, dxpl_id, curr_dims) < 0) + if(H5D__chunk_update_old_edge_chunks(dset, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to do update old edge chunks") } /* end if */ /* Mark the dataspace as dirty, for later writing to the file */ - if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) + if(H5D__mark(dset, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* end H5D__set_extent() */ @@ -2797,7 +2739,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id) +H5D__flush_sieve_buf(H5D_t *dataset) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2812,7 +2754,7 @@ H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id) /* Write dirty data sieve buffer to file */ if(H5F_block_write(dataset->oloc.file, H5FD_MEM_DRAW, dataset->shared->cache.contig.sieve_loc, - dataset->shared->cache.contig.sieve_size, dxpl_id, dataset->shared->cache.contig.sieve_buf) < 0) + dataset->shared->cache.contig.sieve_size, dataset->shared->cache.contig.sieve_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") /* Reset sieve buffer dirty flag */ @@ -2834,30 +2776,61 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__flush_real(H5D_t *dataset, hid_t dxpl_id) +H5D__flush_real(H5D_t *dataset) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dataset->oloc.addr) /* Check args */ HDassert(dataset); HDassert(dataset->shared); /* Avoid flushing the dataset (again) if it's closing */ - if(!dataset->shared->closing) { + if(!dataset->shared->closing) /* Flush cached raw data for each kind of dataset layout */ - if(dataset->shared->layout.ops->flush && - (dataset->shared->layout.ops->flush)(dataset, dxpl_id) < 0) + if(dataset->shared->layout.ops->flush && (dataset->shared->layout.ops->flush)(dataset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush raw data") - } /* end if */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__flush_real() */ /*------------------------------------------------------------------------- + * Function: H5D__flush + * + * Purpose: Flush dataset information cached in memory + * + * Return: Success: Non-negative + * Failure: Negative + *------------------------------------------------------------------------- + */ +herr_t +H5D__flush(H5D_t *dset, hid_t dset_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check args */ + HDassert(dset); + HDassert(dset->shared); + + /* Flush any dataset information still cached in memory */ + if(H5D__flush_real(dset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush cached dataset info") + + /* Flush object's metadata to file */ + if(H5O_flush_common(&dset->oloc, dset_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush dataset and object flush callback") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5D__flush() */ + + +/*------------------------------------------------------------------------- * Function: H5D__format_convert * * Purpose: For chunked: downgrade the chunk indexing type to version 1 B-tree @@ -2868,7 +2841,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) +H5D__format_convert(H5D_t *dataset) { 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 */ @@ -2878,7 +2851,7 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) 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) + FUNC_ENTER_PACKAGE_VOL_TAG(dataset->oloc.addr) /* Check args */ HDassert(dataset); @@ -2892,7 +2865,6 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) /* 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; @@ -2909,7 +2881,6 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) /* 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; @@ -2934,13 +2905,13 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) } /* end if */ /* Delete the old "current" layout message */ - if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE, dxpl_id) < 0) + if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message") 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) + if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, newlayout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout header message") add_new_layout = TRUE; @@ -2958,7 +2929,7 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) 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) + if(H5O_msg_write(&(dataset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dataset->shared->layout)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") break; @@ -2977,12 +2948,12 @@ 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) + if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE) < 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) + if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &dataset->shared->layout) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to add layout header message") /* Clean up v1 b-tree chunk index */ @@ -2993,7 +2964,7 @@ done: 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)) + if(H5AC_expunge_tag_type_metadata(dataset->oloc.file, dataset->oloc.addr, H5AC_BT_ID, H5AC__NO_FLAGS_SET)) HDONE_ERROR(H5E_DATASET, H5E_CANTEXPUNGE, FAIL, "unable to expunge index metadata") } /* end if */ @@ -3006,7 +2977,7 @@ done: if(newlayout != NULL) newlayout = (H5O_layout_t *)H5MM_xfree(newlayout); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* end H5D__format_convert() */ @@ -3020,7 +2991,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__mark(const H5D_t *dataset, hid_t H5_ATTR_UNUSED dxpl_id, unsigned flags) +H5D__mark(const H5D_t *dataset, unsigned flags) { H5O_t *oh = NULL; /* Pointer to dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3036,12 +3007,12 @@ H5D__mark(const H5D_t *dataset, hid_t H5_ATTR_UNUSED dxpl_id, unsigned flags) unsigned update_flags = H5O_UPDATE_TIME; /* Modification time flag */ /* Pin the object header */ - if(NULL == (oh = H5O_pin(&dataset->oloc, dxpl_id))) + if(NULL == (oh = H5O_pin(&dataset->oloc))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPIN, FAIL, "unable to pin dataset object header") /* Update the layout on disk, if it's been changed */ if(flags & H5D_MARK_LAYOUT) { - if(H5D__layout_oh_write(dataset, dxpl_id, oh, update_flags) < 0) + if(H5D__layout_oh_write(dataset, oh, update_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update layout info") /* Reset the "update the modification time" flag, so we only do it once */ @@ -3050,7 +3021,7 @@ H5D__mark(const H5D_t *dataset, hid_t H5_ATTR_UNUSED dxpl_id, unsigned flags) /* Update the dataspace on disk, if it's been changed */ if(flags & H5D_MARK_SPACE) { - if(H5S_write(dataset->oloc.file, dxpl_id, oh, update_flags, dataset->shared->space) < 0) + if(H5S_write(dataset->oloc.file, oh, update_flags, dataset->shared->space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update file with new dataspace") /* Reset the "update the modification time" flag, so we only do it once */ @@ -3072,7 +3043,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__flush_cb + * Function: H5D__flush_all_cb * * Purpose: Flush any dataset information cached in memory * @@ -3081,31 +3052,31 @@ done: *------------------------------------------------------------------------- */ static int -H5D__flush_cb(void *_dataset, hid_t H5_ATTR_UNUSED id, void *_udata) +H5D__flush_all_cb(void *_dataset, hid_t H5_ATTR_UNUSED id, void *_udata) { - H5D_t *dataset = (H5D_t *)_dataset; /* Dataset pointer */ - H5D_flush_ud_t *udata = (H5D_flush_ud_t *)_udata; /* User data for callback */ - int ret_value = H5_ITER_CONT; /* Return value */ + H5D_t *dataset = (H5D_t *)_dataset; /* Dataset pointer */ + H5F_t *f = (H5F_t *)_udata; /* User data for callback */ + int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC /* Check args */ HDassert(dataset); + HDassert(f); /* Check for dataset in same file */ - if(udata->f == dataset->oloc.file) { + if(f == dataset->oloc.file) /* Flush the dataset's information */ - if(H5D__flush_real(dataset, udata->dxpl_id) < 0) + if(H5D__flush_real(dataset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to flush cached dataset info") - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__flush_cb() */ +} /* end H5D__flush_all_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_flush + * Function: H5D_flush_all * * Purpose: Flush any dataset information cached in memory * @@ -3114,9 +3085,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_flush(const H5F_t *f, hid_t dxpl_id) +H5D_flush_all(const H5F_t *f) { - H5D_flush_ud_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3124,17 +3094,51 @@ H5D_flush(const H5F_t *f, hid_t dxpl_id) /* Check args */ HDassert(f); - /* Set user data for callback */ - udata.f = f; - udata.dxpl_id = dxpl_id; - /* Iterate over all the open datasets */ - if(H5I_iterate(H5I_DATASET, H5D__flush_cb, &udata, FALSE) < 0) + if(H5I_iterate(H5I_DATASET, H5D__flush_all_cb, (void *)f, FALSE) < 0) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to flush cached dataset info") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_flush() */ +} /* end H5D_flush_all() */ + + +/*------------------------------------------------------------------------- + * Function: H5D__get_create_plist + * + * Purpose: Internal routine to retrieve a dataset's creation property list. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: ID for a copy of the dataset creation property + * list. The property list ID should be released + * by calling H5Pclose(). + * + * Failure: FAIL + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +hid_t +H5D__get_create_plist(const H5D_t *dset) +{ + hid_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(dset); + + /* Retrieve the DCPL */ + if((ret_value = H5D_get_create_plist(dset)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset's creation property list") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5D__get_create_plist() */ /*------------------------------------------------------------------------- @@ -3172,7 +3176,7 @@ H5D_get_create_plist(H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "can't get property list") /* Retrieve any object creation properties */ - if(H5O_get_create_plist(&dset->oloc, H5AC_ind_read_dxpl_id, new_plist) < 0) + if(H5O_get_create_plist(&dset->oloc, new_plist) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object creation info") /* Get the layout property */ @@ -3234,7 +3238,7 @@ H5D_get_create_plist(H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy dataset datatype for fill value") /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(dset->shared->type, copied_fill.type, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(dset->shared->type, copied_fill.type))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types") /* Convert disk form of fill value into memory form */ @@ -3262,7 +3266,7 @@ H5D_get_create_plist(H5D_t *dset) } /* end if */ /* Convert fill value */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, copied_fill.buf, bkg_buf, H5AC_noio_dxpl_id) < 0) { + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, copied_fill.buf, bkg_buf) < 0) { H5I_dec_ref(src_id); H5I_dec_ref(dst_id); if(bkg_buf) @@ -3368,18 +3372,17 @@ H5D_get_access_plist(H5D_t *dset) ret_value = new_dapl_id; done: - if(ret_value < 0) { + if(ret_value < 0) if(new_dapl_id > 0) if(H5I_dec_app_ref(new_dapl_id) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't free") - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_get_access_plist() */ /*------------------------------------------------------------------------- - * Function: H5D_get_space + * Function: H5D__get_space * * Purpose: Returns and ID for the dataspace of the dataset. * @@ -3388,16 +3391,16 @@ done: *------------------------------------------------------------------------- */ hid_t -H5D_get_space(H5D_t *dset) +H5D__get_space(const H5D_t *dset) { H5S_t *space = NULL; hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* If the layout is virtual, update the extent */ if(dset->shared->layout.type == H5D_VIRTUAL) - if(H5D__virtual_set_extent_unlim(dset, H5AC_ind_read_dxpl_id) < 0) + if(H5D__virtual_set_extent_unlim(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update virtual dataset extent") /* Read the data space message and return a data space object */ @@ -3414,26 +3417,27 @@ done: if(H5S_close(space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_get_space() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5D__get_space() */ /*------------------------------------------------------------------------- - * Function: H5D_get_type + * Function: H5D__get_type * * Purpose: Returns and ID for the datatype of the dataset. * * Return: Success: ID for datatype * Failure: FAIL + * *------------------------------------------------------------------------- */ hid_t -H5D_get_type(H5D_t *dset) +H5D__get_type(const H5D_t *dset) { H5T_t *dt = NULL; hid_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Patch the datatype's "top level" file pointer */ if(H5T_patch_file(dset->shared->type, dset->oloc.file) < 0) @@ -3455,13 +3459,12 @@ H5D_get_type(H5D_t *dset) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") done: - if(ret_value < 0) { + if(ret_value < 0) if(dt && H5T_close(dt) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_get_type() */ +} /* end H5D__get_type() */ /*------------------------------------------------------------------------- @@ -3473,13 +3476,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__refresh(hid_t dset_id, H5D_t *dset, hid_t dxpl_id) +H5D__refresh(hid_t dset_id, H5D_t *dset) { H5D_virtual_held_file_t *head = NULL; /* Pointer to list of files held open */ hbool_t virt_dsets_held = FALSE; /* Whether virtual datasets' files are held open */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Sanity check */ HDassert(dset); @@ -3493,22 +3496,20 @@ H5D__refresh(hid_t dset_id, H5D_t *dset, hid_t dxpl_id) virt_dsets_held = TRUE; /* Refresh source datasets for virtual dataset */ - if(H5D__virtual_refresh_source_dsets(dset, dxpl_id) < 0) + if(H5D__virtual_refresh_source_dsets(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh VDS source datasets") } /* end if */ /* Refresh dataset object */ - if((H5O_refresh_metadata(dset_id, dset->oloc, dxpl_id)) < 0) + if((H5O_refresh_metadata(dset_id, dset->oloc)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh dataset") done: - /* Release hold on virtual datasets' files */ - if(virt_dsets_held) { - /* Release the hold on source datasets' files */ + /* Release hold on (source) virtual datasets' files */ + if(virt_dsets_held) if(H5D__virtual_release_source_dset_files(head) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't release VDS source files held open") - } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__refresh() */ diff --git a/src/H5Dio.c b/src/H5Dio.c index aee3c35..5b5bb5e 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -22,6 +22,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -50,21 +51,14 @@ /********************/ /* Setup/teardown routines */ -static herr_t H5D__ioinfo_init(H5D_t *dset, -#ifndef H5_HAVE_PARALLEL -const -#endif /* H5_HAVE_PARALLEL */ - H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, const H5D_type_info_t *type_info, H5D_storage_t *store, - H5D_io_info_t *io_info); -static herr_t H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, hid_t mem_type_id, hbool_t do_write, - H5D_type_info_t *type_info); +static herr_t H5D__ioinfo_init(H5D_t *dset, const H5D_type_info_t *type_info, + H5D_storage_t *store, H5D_io_info_t *io_info); +static herr_t H5D__typeinfo_init(const H5D_t *dset, hid_t mem_type_id, + hbool_t do_write, H5D_type_info_t *type_info); #ifdef H5_HAVE_PARALLEL static herr_t H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, - hid_t dxpl_id, const H5S_t *file_space, const H5S_t *mem_space, - const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm); -static herr_t H5D__ioinfo_term(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); #endif /* H5_HAVE_PARALLEL */ static herr_t H5D__typeinfo_term(const H5D_type_info_t *type_info); @@ -118,20 +112,18 @@ H5FL_DEFINE(H5D_chunk_map_t); */ 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*/) + hid_t file_space_id, hid_t dxpl_id, void *buf/*out*/) { - H5D_t *dset = NULL; + H5D_t *dset = NULL; 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; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ 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, - plist_id, buf); + dxpl_id, buf); /* check arguments */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) @@ -161,30 +153,38 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, } /* end if */ /* Get the default dataset transfer property list if the user didn't provide one */ - if (H5P_DEFAULT == plist_id) - plist_id= H5P_DATASET_XFER_DEFAULT; + if(H5P_DEFAULT == dxpl_id) + dxpl_id = H5P_DATASET_XFER_DEFAULT; else - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) + if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - /* 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") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* 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(H5CX_get_dcr_flag(&direct_read) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting flag for direct chunk read") + /* Set up for direct read of chunk, bypassing filters, etc. */ if(direct_read) { - unsigned u; - hsize_t internal_offset[H5O_LAYOUT_NDIMS]; + hsize_t *direct_offset; /* Chunk offset from calling routine */ + hsize_t internal_offset[H5O_LAYOUT_NDIMS]; /* Internal copy of chunk offset */ + uint32_t direct_filters = 0; /* Filters for chunk */ + unsigned u; /* Local index variable */ + /* Sanity check */ 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") + /* Get the direct chunk offset */ + if(H5CX_get_dcr_offset(&direct_offset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting offset for direct chunk read") + HDassert(direct_offset); /* The library's chunking code requires the offset terminates with a zero. So transfer the * offset array to an internal offset array */ @@ -204,19 +204,21 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, internal_offset[dset->shared->ndims] = 0; /* Read the raw chunk */ - if(H5D__chunk_direct_read(dset, plist_id, internal_offset, &direct_filters, buf) < 0) + if(H5D__chunk_direct_read(dset, 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) + + /* Set the chunk filter mask for application */ + H5CX_set_dcr_filters(direct_filters); + } /* end if */ + else + /* Read raw data */ + if(H5D__read(dset, mem_type_id, mem_space, file_space, buf/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") - } done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* end H5Dread() */ @@ -254,13 +256,13 @@ done: */ herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t dxpl_id, const void *buf) + hid_t file_space_id, hid_t dxpl_id, const void *buf) { H5D_t *dset = NULL; - H5P_genplist_t *plist; /* Property list pointer */ const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; hbool_t direct_write = FALSE; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -275,18 +277,21 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, /* Get the default dataset transfer property list if the user didn't provide one */ if(H5P_DEFAULT == dxpl_id) - dxpl_id= H5P_DATASET_XFER_DEFAULT; + dxpl_id = H5P_DATASET_XFER_DEFAULT; else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - /* 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") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Retrieve the 'direct write' flag */ - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &direct_write) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting flag for direct chunk write") + if(H5CX_get_dcw_flag(&direct_write) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting flag for direct chunk read") /* Check dataspace selections if this is not a direct write */ if(!direct_write) { @@ -309,12 +314,15 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(H5S_SELECT_VALID(file_space) != TRUE) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "file selection+offset not within extent") } /* end if */ - } + } /* end if */ - if(H5D__pre_write(dset, direct_write, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0) + if(H5D__pre_write(dset, direct_write, mem_type_id, mem_space, file_space, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't prepare for writing data") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* end H5Dwrite() */ @@ -330,36 +338,30 @@ done: */ herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, - hid_t dxpl_id, const void *buf) + const H5S_t *mem_space, const H5S_t *file_space, const void *buf) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_PACKAGE_VOL /* Direct chunk write */ if(direct_write) { - H5P_genplist_t *plist; /* Property list pointer */ uint32_t direct_filters; hsize_t *direct_offset; uint32_t direct_datasize; 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") /* Retrieve parameters for direct chunk write */ - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &direct_filters) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting filter info for direct chunk write") - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &direct_offset) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting offset info for direct chunk write") - 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") + if(H5CX_get_dcw_filters(&direct_filters) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting filter info for direct chunk write") + if(H5CX_get_dcw_offset(&direct_offset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting offset info for direct chunk write") + if(H5CX_get_dcw_datasize(&direct_datasize) < 0) + HGOTO_ERROR(H5E_DATASET, 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 * offset array to an internal offset array */ @@ -379,17 +381,16 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, internal_offset[dset->shared->ndims] = 0; /* write raw data */ - if(H5D__chunk_direct_write(dset, dxpl_id, direct_filters, internal_offset, direct_datasize, buf) < 0) + if(H5D__chunk_direct_write(dset, direct_filters, internal_offset, direct_datasize, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write chunk directly") } /* end if */ - else { /* Normal write */ - /* write raw data */ - if(H5D__write(dset, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0) + else + /* Normal write of raw data */ + if(H5D__write(dset, mem_type_id, mem_space, file_space, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") - } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__pre_write() */ @@ -408,7 +409,7 @@ done: */ herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, - const H5S_t *file_space, hid_t dxpl_id, void *buf/*out*/) + const H5S_t *file_space, void *buf/*out*/) { H5D_chunk_map_t *fm = NULL; /* Chunk file<->memory mapping */ H5D_io_info_t io_info; /* Dataset I/O info */ @@ -430,14 +431,11 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_storage_t store; /*union of EFL and chunk pointer in file space */ hssize_t snelmts; /*total number of elmts (signed) */ hsize_t nelmts; /*total number of elmts */ - hbool_t io_info_init = FALSE; /* Whether the I/O info has been initialized */ hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ char fake_char; /* Temporary variable for NULL buffer pointers */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_VOL_TAG(dataset->oloc.addr) /* check args */ HDassert(dataset && dataset->oloc.file); @@ -450,20 +448,24 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dst dataspace has invalid selection") H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); - /* 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") - /* Set up datatype info for operation */ - if(H5D__typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, FALSE, &type_info) < 0) + if(H5D__typeinfo_init(dataset, mem_type_id, FALSE, &type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info") type_info_init = TRUE; #ifdef H5_HAVE_PARALLEL - /* Collective access is not permissible without a MPI based VFD */ - if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE && - !(H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_HAS_MPI))) - HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPI-based drivers only") + /* Check for non-MPI-based VFD */ + if(!(H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_HAS_MPI))) { + H5FD_mpio_xfer_t io_xfer_mode; /* MPI I/O transfer mode */ + + /* Get I/O transfer mode */ + if(H5CX_get_io_xfer_mode(&io_xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + + /* Collective access is not permissible without a MPI based VFD */ + if(io_xfer_mode == H5FD_MPIO_COLLECTIVE) + HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPI-based drivers only") + } /* end if */ #endif /*H5_HAVE_PARALLEL*/ /* Make certain that the number of elements in each selection is the same */ @@ -547,8 +549,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, HGOTO_DONE(SUCCEED) /* Go fill the user's selection with the dataset's fill value */ - if(H5D__fill(dataset->shared->dcpl_cache.fill.buf, dataset->shared->type, buf, - type_info.mem_type, mem_space, dxpl_id) < 0) + if(H5D__fill(dataset->shared->dcpl_cache.fill.buf, dataset->shared->type, buf, type_info.mem_type, mem_space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "filling buf failed") else HGOTO_DONE(SUCCEED) @@ -557,9 +558,8 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Set up I/O operation */ io_info.op_type = H5D_IO_OP_READ; io_info.u.rbuf = buf; - if(H5D__ioinfo_init(dataset, dxpl_cache, dxpl_id, &type_info, &store, &io_info) < 0) + if(H5D__ioinfo_init(dataset, &type_info, &store, &io_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to set up I/O operation") - io_info_init = TRUE; /* Sanity check that space is allocated, if there are elements */ if(nelmts > 0) @@ -578,7 +578,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Adjust I/O info for any parallel I/O */ - if(H5D__ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, fm) < 0) + if(H5D__ioinfo_adjust(&io_info, dataset, file_space, mem_space, &type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") #endif /*H5_HAVE_PARALLEL*/ @@ -593,19 +593,6 @@ done: if(fm) fm = H5FL_FREE(H5D_chunk_map_t, fm); - if(io_info_init) { -#ifdef H5_DEBUG_BUILD - /* release the metadata dxpl that was copied in the init function */ - if(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 */ -#ifdef H5_HAVE_PARALLEL - /* Shut down io_info struct */ - if(H5D__ioinfo_term(&io_info) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't shut down io_info") -#endif /*H5_HAVE_PARALLEL*/ - } - /* Shut down datatype info for operation */ if(type_info_init && H5D__typeinfo_term(&type_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down type info") @@ -615,7 +602,7 @@ done: if(H5S_close(projected_mem_space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down projected memory dataspace") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* end H5D__read() */ @@ -634,7 +621,7 @@ done: */ herr_t H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, - const H5S_t *file_space, hid_t dxpl_id, const void *buf) + const H5S_t *file_space, const void *buf) { H5D_chunk_map_t *fm = NULL; /* Chunk file<->memory mapping */ H5D_io_info_t io_info; /* Dataset I/O info */ @@ -656,14 +643,11 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_storage_t store; /*union of EFL and chunk pointer in file space */ hssize_t snelmts; /*total number of elmts (signed) */ hsize_t nelmts; /*total number of elmts */ - hbool_t io_info_init = FALSE; /* Whether the I/O info has been initialized */ hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ char fake_char; /* Temporary variable for NULL buffer pointers */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dataset->oloc.addr) /* check args */ HDassert(dataset && dataset->oloc.file); @@ -680,12 +664,8 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(0 == (H5F_INTENT(dataset->oloc.file) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file") - /* 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") - /* Set up datatype info for operation */ - if(H5D__typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, TRUE, &type_info) < 0) + if(H5D__typeinfo_init(dataset, mem_type_id, TRUE, &type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info") type_info_init = TRUE; @@ -709,8 +689,14 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "Parallel IO does not support writing region reference datatypes yet") } /* end if */ else { + H5FD_mpio_xfer_t io_xfer_mode; /* MPI I/O transfer mode */ + + /* Get I/O transfer mode */ + if(H5CX_get_io_xfer_mode(&io_xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + /* Collective access is not permissible without a MPI based VFD */ - if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) + if(io_xfer_mode == H5FD_MPIO_COLLECTIVE) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPI-based driver only") } /* end else */ #endif /*H5_HAVE_PARALLEL*/ @@ -784,9 +770,8 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Set up I/O operation */ io_info.op_type = H5D_IO_OP_WRITE; io_info.u.wbuf = buf; - if(H5D__ioinfo_init(dataset, dxpl_cache, dxpl_id, &type_info, &store, &io_info) < 0) + if(H5D__ioinfo_init(dataset, &type_info, &store, &io_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up I/O operation") - io_info_init = TRUE; /* Allocate data space and initialize it if it hasn't been. */ if(nelmts > 0 && dataset->shared->dcpl_cache.efl.nused == 0 && @@ -820,7 +805,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Adjust I/O info for any parallel I/O */ - if(H5D__ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, fm) < 0) + if(H5D__ioinfo_adjust(&io_info, dataset, file_space, mem_space, &type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") #endif /*H5_HAVE_PARALLEL*/ @@ -842,7 +827,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, * Update modification time. We have to do this explicitly because * writing to a dataset doesn't necessarily change the object header. */ - if(H5O_touch(&(dataset->oloc), FALSE, dxpl_id) < 0) + if(H5O_touch(&(dataset->oloc), FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time") #endif /* OLD_WAY */ @@ -853,19 +838,6 @@ done: if(fm) fm = H5FL_FREE(H5D_chunk_map_t, fm); - if(io_info_init) { -#ifdef H5_DEBUG_BUILD - /* release the metadata dxpl that was copied in the init function */ - if(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 */ -#ifdef H5_HAVE_PARALLEL - /* Shut down io_info struct */ - if(H5D__ioinfo_term(&io_info) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't shut down io_info") -#endif /*H5_HAVE_PARALLEL*/ - } - /* Shut down datatype info for operation */ if(type_info_init && H5D__typeinfo_term(&type_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down type info") @@ -875,7 +847,7 @@ done: if(H5S_close(projected_mem_space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down projected memory dataspace") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__write() */ @@ -893,16 +865,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__ioinfo_init(H5D_t *dset, -#ifndef H5_HAVE_PARALLEL -const -#endif /* H5_HAVE_PARALLEL */ - H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, - const H5D_type_info_t *type_info, H5D_storage_t *store, H5D_io_info_t *io_info) +H5D__ioinfo_init(H5D_t *dset, const H5D_type_info_t *type_info, + H5D_storage_t *store, H5D_io_info_t *io_info) { - herr_t ret_value = SUCCEED; - - FUNC_ENTER_STATIC + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(dset); @@ -911,19 +877,8 @@ const HDassert(type_info->tpath); HDassert(io_info); - /* init both dxpls to the original one */ - io_info->md_dxpl_id = dxpl_id; - io_info->raw_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") -#endif /* H5_DEBUG_BUILD */ - /* Set up "normal" I/O fields */ io_info->dset = dset; - io_info->dxpl_cache = dxpl_cache; io_info->store = store; /* Set I/O operations to initial values */ @@ -955,10 +910,7 @@ const io_info->using_mpi_vfd = H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI); #endif /* H5_HAVE_PARALLEL */ -#ifdef H5_DEBUG_BUILD - done: -#endif /* H5_DEBUG_BUILD */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__ioinfo_init() */ @@ -976,12 +928,12 @@ const *------------------------------------------------------------------------- */ static herr_t -H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, hid_t mem_type_id, hbool_t do_write, +H5D__typeinfo_init(const H5D_t *dset, hid_t mem_type_id, hbool_t do_write, H5D_type_info_t *type_info) { const H5T_t *src_type; /* Source datatype */ const H5T_t *dst_type; /* Destination datatype */ + H5Z_data_xform_t *data_transform; /* Data transform info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1023,22 +975,40 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, * enough value in xfer_parms since turning off datatype conversion also * turns off background preservation. */ - if(NULL == (type_info->tpath = H5T_path_find(src_type, dst_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (type_info->tpath = H5T_path_find(src_type, dst_type))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") + /* Retrieve info from API context */ + if(H5CX_get_data_transform(&data_transform) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data transform info") + /* Precompute some useful information */ type_info->src_type_size = H5T_get_size(src_type); type_info->dst_type_size = H5T_get_size(dst_type); type_info->max_type_size = MAX(type_info->src_type_size, type_info->dst_type_size); type_info->is_conv_noop = H5T_path_noop(type_info->tpath); - type_info->is_xform_noop = H5Z_xform_noop(dxpl_cache->data_xform_prop); + type_info->is_xform_noop = H5Z_xform_noop(data_transform); if(type_info->is_xform_noop && type_info->is_conv_noop) { type_info->cmpd_subset = NULL; type_info->need_bkg = H5T_BKG_NO; } /* end if */ else { + void *tconv_buf; /* Temporary conversion buffer pointer */ + void *bkgr_buf; /* Background conversion buffer pointer */ + size_t max_temp_buf; /* Maximum temporary buffer size */ + H5T_bkg_t bkgr_buf_type; /* Background buffer type */ size_t target_size; /* Desired buffer size */ + /* Get info from API context */ + if(H5CX_get_max_temp_buf(&max_temp_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve max. temp. buf size") + if(H5CX_get_tconv_buf(&tconv_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve temp. conversion buffer pointer") + if(H5CX_get_bkgr_buf(&bkgr_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve background conversion buffer pointer") + if(H5CX_get_bkgr_buf_type(&bkgr_buf_type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve background buffer type") + /* Check if the datatypes are compound subsets of one another */ type_info->cmpd_subset = H5T_path_compound_subset(type_info->tpath); @@ -1050,7 +1020,7 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, if((path_bkg = H5T_path_bkg(type_info->tpath))) { /* Retrieve the bkgr buffer property */ - type_info->need_bkg = dxpl_cache->bkgr_buf_type; + type_info->need_bkg = bkgr_buf_type; type_info->need_bkg = MAX(path_bkg, type_info->need_bkg); } /* end if */ else @@ -1060,16 +1030,15 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, /* Set up datatype conversion/background buffers */ - /* Get buffer size from DXPL */ - target_size = dxpl_cache->max_temp_buf; + target_size = max_temp_buf; /* If the buffer is too small to hold even one element, try to make it bigger */ if(target_size < type_info->max_type_size) { hbool_t default_buffer_info; /* Whether the buffer information are the defaults */ /* Detect if we have all default settings for buffers */ - default_buffer_info = (hbool_t)((H5D_TEMP_BUF_SIZE == dxpl_cache->max_temp_buf) - && (NULL == dxpl_cache->tconv_buf) && (NULL == dxpl_cache->bkgr_buf)); + default_buffer_info = (hbool_t)((H5D_TEMP_BUF_SIZE == max_temp_buf) + && (NULL == tconv_buf) && (NULL == bkgr_buf)); /* Check if we are using the default buffer info */ if(default_buffer_info) @@ -1094,20 +1063,20 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, * malloc() is usually less resource-intensive if we allocate/free the * same size over and over. */ - if(NULL == (type_info->tconv_buf = (uint8_t *)dxpl_cache->tconv_buf)) { + if(NULL == (type_info->tconv_buf = (uint8_t *)tconv_buf)) { /* Allocate temporary buffer */ if(NULL == (type_info->tconv_buf = H5FL_BLK_MALLOC(type_conv, target_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") type_info->tconv_buf_allocated = TRUE; } /* end if */ - if(type_info->need_bkg && NULL == (type_info->bkg_buf = (uint8_t *)dxpl_cache->bkgr_buf)) { + if(type_info->need_bkg && NULL == (type_info->bkg_buf = (uint8_t *)bkgr_buf)) { size_t bkg_size; /* Desired background buffer size */ /* Compute the background buffer size */ /* (don't try to use buffers smaller than the default size) */ bkg_size = type_info->request_nelmts * type_info->dst_type_size; - if(bkg_size < dxpl_cache->max_temp_buf) - bkg_size = dxpl_cache->max_temp_buf; + if(bkg_size < max_temp_buf) + bkg_size = max_temp_buf; /* Allocate background buffer */ /* (Need calloc()-like call since memory needs to be initialized) */ @@ -1136,13 +1105,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, +H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, 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; /* Data transer property list */ - H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode; /* performed chunk optimization */ - H5D_mpio_actual_io_mode_t actual_io_mode; /* performed io mode */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1156,36 +1122,30 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, HDassert(type_info->tpath); HDassert(io_info); - /* Get the dataset transfer property list */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - /* Reset the actual io mode properties to the default values in case - * the dxpl was previously used in a collective I/O operation. + * the DXPL (if it's non-default) was previously used in a collective + * I/O operation. */ - actual_chunk_opt_mode = H5D_MPIO_NO_CHUNK_OPTIMIZATION; - actual_io_mode = H5D_MPIO_NO_COLLECTIVE; - 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") - 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") + if(!H5CX_is_def_dxpl()) { + H5CX_set_mpio_actual_chunk_opt(H5D_MPIO_NO_CHUNK_OPTIMIZATION); + H5CX_set_mpio_actual_io_mode(H5D_MPIO_NO_COLLECTIVE); + } /* end if */ /* Make any parallel I/O adjustments */ if(io_info->using_mpi_vfd) { + H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request */ htri_t opt; /* Flag whether a selection is optimizable */ - /* Record the original state of parallel I/O transfer options */ - io_info->orig.xfer_mode = io_info->dxpl_cache->xfer_mode; - io_info->orig.coll_opt_mode = io_info->dxpl_cache->coll_opt_mode; - io_info->orig.io_ops.single_read = io_info->io_ops.single_read; - io_info->orig.io_ops.single_write = io_info->io_ops.single_write; + /* Get the original state of parallel I/O transfer mode */ + if(H5CX_get_io_xfer_mode(&xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") /* Get MPI communicator */ if(MPI_COMM_NULL == (io_info->comm = H5F_mpi_get_comm(dset->oloc.file))) 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, dx_plist)) < 0) + if((opt = H5D__mpio_opt_possible(io_info, file_space, mem_space, type_info)) < 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 */ @@ -1217,34 +1177,36 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, "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") + if(H5CX_get_mpio_local_no_coll_cause(&local_no_collective_cause) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get local no collective cause value") + if(H5CX_get_mpio_global_no_coll_cause(&global_no_collective_cause) < 0) + HGOTO_ERROR(H5E_DATASET, 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]); + size_t cause_strlen = HDstrlen(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); + if(local_error_message_previously_written) + HDstrncat(local_no_collective_cause_string, "; ", 2); - strncat(local_no_collective_cause_string, cause_strings[index], cause_strlen); + HDstrncat(local_no_collective_cause_string, cause_strings[index], cause_strlen); local_error_message_previously_written = TRUE; } /* end if */ - if (cause & global_no_collective_cause) { + 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); + if(global_error_message_previously_written) + HDstrncat(global_no_collective_cause_string, "; ", 2); - strncat(global_no_collective_cause_string, cause_strings[index], cause_strlen); + HDstrncat(global_no_collective_cause_string, cause_strings[index], cause_strlen); global_error_message_previously_written = TRUE; } /* end if */ @@ -1259,14 +1221,12 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, } /* 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 - * mark it so that we remember to revert the change. + * collective I/O, change the request to use independent I/O */ - if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) { + if(xfer_mode == H5FD_MPIO_COLLECTIVE) { /* Change the xfer_mode to independent for handling the I/O */ - io_info->dxpl_cache->xfer_mode = H5FD_MPIO_INDEPENDENT; - if(H5P_set(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->dxpl_cache->xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") + if(H5CX_set_io_xfer_mode(H5FD_MPIO_INDEPENDENT) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") } /* end if */ } /* end else */ } /* end if */ @@ -1274,62 +1234,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__ioinfo_adjust() */ - - -/*------------------------------------------------------------------------- - * Function: H5D__ioinfo_term - * - * Purpose: Common logic for terminating an I/O info object - * (Only used for restoring MPI transfer mode currently) - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Friday, February 6, 2004 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D__ioinfo_term(H5D_io_info_t *io_info) -{ - herr_t ret_value = SUCCEED; /*return value */ - - FUNC_ENTER_STATIC - - /* Check if we used the MPI VFD for the I/O */ - if(io_info->using_mpi_vfd) { - /* Check if we need to revert the change to the xfer mode */ - if(io_info->orig.xfer_mode != io_info->dxpl_cache->xfer_mode) { - H5P_genplist_t *dx_plist; /* Data transer property list */ - - /* Get the dataset transfer property list */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Restore the original parallel I/O mode */ - if(H5P_set(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->orig.xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - } /* end if */ - - /* Check if we need to revert the change to the collective opt mode */ - if(io_info->orig.coll_opt_mode != io_info->dxpl_cache->coll_opt_mode) { - H5P_genplist_t *dx_plist; /* Data transer property list */ - - /* Get the dataset transfer property list */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Restore the original parallel I/O mode */ - if(H5P_set(dx_plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &io_info->orig.coll_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set collective option mode") - } /* end if */ - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__ioinfo_term() */ - -#endif /* H5_HAVE_PARALLEL */ +#endif /*H5_HAVE_PARALLEL*/ /*------------------------------------------------------------------------- @@ -1362,53 +1267,3 @@ H5D__typeinfo_term(const H5D_type_info_t *type_info) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__typeinfo_term() */ -#ifdef H5_DEBUG_BUILD - -/*------------------------------------------------------------------------- - * Function: H5D_set_io_info_dxpls - * - * Purpose: Set the metadata and raw data dxpls in an io_info struct - * for sanity checking at the H5FD layer. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Mohamad Chaarawi - * January 2016 - * - *------------------------------------------------------------------------- - */ -herr_t -H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id) -{ - H5P_genplist_t *xfer_plist = NULL; /* Dataset transfer property list object */ - H5FD_dxpl_type_t dxpl_type; /* Property indicating the type of the internal dxpl */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_BADATOM, FAIL, "can't get new property list object") - - /* create the metadata dxpl */ - if((io_info->md_dxpl_id = H5P_copy_plist(xfer_plist, FALSE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dxpl") - - /* Set the dxpl type property */ - dxpl_type = H5FD_RAWDATA_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set dxpl type property") - - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(io_info->md_dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_BADATOM, FAIL, "can't get new property list object") - - /* Set the dxpl type property */ - dxpl_type = H5FD_METADATA_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set dxpl type property") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_set_io_info_dxpls */ -#endif /* H5_DEBUG_BUILD */ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index ec18e86..a591957 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -25,6 +25,7 @@ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5HLprivate.h" /* Local heaps */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -454,8 +455,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, - hid_t dapl_id) +H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, hid_t dapl_id) { H5O_layout_t *layout; /* Dataset's layout information */ const H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */ @@ -463,7 +463,7 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Sanity checking */ HDassert(file); @@ -479,12 +479,12 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, H5O_pline_t *pline; /* Dataset's I/O pipeline information */ pline = &dset->shared->dcpl_cache.pline; - if(pline->nused > 0 && H5O_msg_append_oh(file, dxpl_id, oh, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, pline) < 0) + if(pline->nused > 0 && H5O_msg_append_oh(file, oh, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, pline) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update filter header message") } /* end if */ /* Initialize the layout information for the new dataset */ - if(dset->shared->layout.ops->init && (dset->shared->layout.ops->init)(file, dxpl_id, dset, dapl_id) < 0) + if(dset->shared->layout.ops->init && (dset->shared->layout.ops->init)(file, dset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize layout information") /* Indicate that the layout information was initialized */ @@ -498,12 +498,11 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, H5D_io_info_t io_info; io_info.dset = dset; - io_info.raw_dxpl_id = H5AC_rawdata_dxpl_id; - io_info.md_dxpl_id = dxpl_id; if(H5D__alloc_storage(&io_info, H5D_ALLOC_CREATE, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") - } + } /* end if */ + /* Update external storage message, if it's used */ if(dset->shared->dcpl_cache.efl.nused > 0) { H5O_efl_t *efl = &dset->shared->dcpl_cache.efl; /* Dataset's external file list */ @@ -516,15 +515,15 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, heap_size += H5HL_ALIGN(HDstrlen(efl->slot[u].name) + 1); /* Create the heap for the EFL file names */ - if(H5HL_create(file, dxpl_id, heap_size, &efl->heap_addr/*out*/) < 0) + if(H5HL_create(file, heap_size, &efl->heap_addr/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create EFL file name heap") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(file, dxpl_id, efl->heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(file, efl->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect EFL file name heap") /* Insert "empty" name first */ - if(UFAIL == H5HL_insert(file, dxpl_id, heap, (size_t)1, "")) { + if(UFAIL == H5HL_insert(file, heap, (size_t)1, "")) { H5HL_unprotect(heap); HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert file name into heap") } /* end if */ @@ -533,7 +532,7 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, size_t offset; /* Offset of file name in heap */ /* Insert file name into heap */ - if(UFAIL == (offset = H5HL_insert(file, dxpl_id, heap, + if(UFAIL == (offset = H5HL_insert(file, heap, HDstrlen(efl->slot[u].name) + 1, efl->slot[u].name))) { H5HL_unprotect(heap); HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert file name into heap") @@ -549,11 +548,10 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, heap = NULL; /* Insert EFL message into dataset object header */ - if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_EFL_ID, H5O_MSG_FLAG_CONSTANT, 0, efl) < 0) + if(H5O_msg_append_oh(file, oh, H5O_EFL_ID, H5O_MSG_FLAG_CONSTANT, 0, efl) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update external file list message") } /* end if */ - /* Create layout message */ /* (Don't make layout message constant unless allocation time is early and non-filtered, since space may not be allocated) */ /* (Note: this is relying on H5D__alloc_storage not calling H5O_msg_write during dataset creation) */ if(fill_prop->alloc_time == H5D_ALLOC_TIME_EARLY && H5D_COMPACT != layout->type @@ -561,7 +559,14 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, layout_mesg_flags = H5O_MSG_FLAG_CONSTANT; else layout_mesg_flags = 0; - if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_LAYOUT_ID, layout_mesg_flags, 0, layout) < 0) + + /* Store VDS info in global heap */ + if(H5D_VIRTUAL == layout->type) + if(H5D__virtual_store_layout(file, layout) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to store VDS info") + + /* Create layout message */ + if(H5O_msg_append_oh(file, oh, H5O_LAYOUT_ID, layout_mesg_flags, 0, layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout") done: @@ -569,10 +574,10 @@ done: if(ret_value < 0) if(layout_init) /* Destroy any cached layout information for the dataset */ - if(dset->shared->layout.ops->dest && (dset->shared->layout.ops->dest)(dset, dxpl_id) < 0) + if(dset->shared->layout.ops->dest && (dset->shared->layout.ops->dest)(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy layout info") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__layout_oh_create() */ @@ -590,7 +595,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t *plist) +H5D__layout_oh_read(H5D_t *dataset, 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 */ @@ -603,11 +608,11 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t HDassert(plist); /* Get the optional filters message */ - if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_PLINE_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_PLINE_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") if(msg_exists) { /* Retrieve the I/O pipeline message */ - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline, dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") /* Set the I/O pipeline info in the property list */ @@ -621,16 +626,16 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t * values are copied to the dataset create plist so the user can query * them. */ - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout), dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout))) 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) + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_EFL_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") if(msg_exists) { /* Retrieve the EFL message */ - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_EFL_ID, &dataset->shared->dcpl_cache.efl, dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_EFL_ID, &dataset->shared->dcpl_cache.efl)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") /* Set the EFL info in the property list */ @@ -645,7 +650,7 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t HDassert(dataset->shared->layout.ops); /* Initialize the layout information for the dataset */ - if(dataset->shared->layout.ops->init && (dataset->shared->layout.ops->init)(dataset->oloc.file, dxpl_id, dataset, dapl_id) < 0) + if(dataset->shared->layout.ops->init && (dataset->shared->layout.ops->init)(dataset->oloc.file, dataset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize layout information") /* Adjust chunk dimensions to omit datatype size (in last dimension) for creation property */ @@ -657,16 +662,15 @@ 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_CHUNKED == dataset->shared->layout.type) { + 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(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() */ @@ -685,7 +689,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, unsigned update_flags) +H5D__layout_oh_write(H5D_t *dataset, H5O_t *oh, unsigned update_flags) { htri_t msg_exists; /* Whether the layout message exists */ herr_t ret_value = SUCCEED; /* Return value */ @@ -701,7 +705,7 @@ H5D__layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, unsigned update_f HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to check if layout message exists") if(msg_exists) { /* Write the layout message to the dataset's header */ - if(H5O_msg_write_oh(dataset->oloc.file, dxpl_id, oh, H5O_LAYOUT_ID, 0, update_flags, &dataset->shared->layout) < 0) + if(H5O_msg_write_oh(dataset->oloc.file, oh, H5O_LAYOUT_ID, 0, update_flags, &dataset->shared->layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update layout message") } /* end if */ diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 79572c0..669da68 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -32,6 +32,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ @@ -207,31 +208,23 @@ typedef struct H5D_filtered_collective_io_info_t { static herr_t H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); 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); + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); 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); + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); 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); + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, int sum_chunk); 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); + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); 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); static herr_t H5D__final_collective_io(H5D_io_info_t *io_info, - const H5D_type_info_t *type_info, hsize_t nelmts, MPI_Datatype *mpi_file_type, - MPI_Datatype *mpi_buf_type); + const H5D_type_info_t *type_info, hsize_t nelmts, MPI_Datatype mpi_file_type, + MPI_Datatype mpi_buf_type); static herr_t H5D__sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, H5D_chunk_addr_info_t chunk_addr_info_array[], int many_chunk_opt); 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[]); -static herr_t H5D__ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, - H5FD_mpio_xfer_t xfer_mode); -static herr_t H5D__ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, - H5FD_mpio_collective_opt_t coll_opt_mode); + uint8_t assign_io_mode[], haddr_t chunk_addr[]); 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, @@ -284,11 +277,12 @@ 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, H5P_genplist_t *dx_plist) + const H5S_t *mem_space, const H5D_type_info_t *type_info) { - 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 = SUCCEED; /* Return value */ + H5FD_mpio_xfer_t io_xfer_mode; /* MPI I/O transfer mode */ + 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 = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -300,7 +294,9 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, /* For independent I/O, get out quickly and don't try to form consensus */ - if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_INDEPENDENT) + if(H5CX_get_io_xfer_mode(&io_xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + if(io_xfer_mode == H5FD_MPIO_INDEPENDENT) local_cause |= H5D_MPIO_SET_INDEPENDENT; /* Optimized MPI types flag must be set */ @@ -350,13 +346,9 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) } /* end else */ - /* Write the local value of no-collective-cause to the DXPL. */ - if(H5P_set(dx_plist, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &local_cause) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set local no collective cause property") - - /* Write the global value of no-collective-cause to the DXPL. */ - if(H5P_set(dx_plist, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &global_cause) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set global no collective cause property") + /* Set the local & global values of no-collective-cause in the API context */ + H5CX_set_mpio_local_no_coll_cause(local_cause); + H5CX_set_mpio_global_no_coll_cause(global_cause); /* Set the return value, based on the global cause */ ret_value = global_cause > 0 ? FALSE : TRUE; @@ -387,7 +379,7 @@ H5D__mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATT FUNC_ENTER_PACKAGE H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); - if(H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->raw_dxpl_id, io_info->u.rbuf) < 0) + if(H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->u.rbuf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "can't finish collective parallel read") done: @@ -417,7 +409,7 @@ H5D__mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t H5_AT /*OKAY: CAST DISCARDS CONST QUALIFIER*/ H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); - if(H5F_block_write(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->raw_dxpl_id, io_info->u.wbuf) < 0) + if(H5F_block_write(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->u.wbuf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "can't finish collective parallel write") done: @@ -533,81 +525,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__ioinfo_xfer_mode - * - * Purpose: Switch to between collective & independent MPI I/O - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Friday, August 12, 2005 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D__ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, - H5FD_mpio_xfer_t xfer_mode) -{ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_STATIC - - /* Change the xfer_mode */ - io_info->dxpl_cache->xfer_mode = xfer_mode; - if(H5P_set(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->dxpl_cache->xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - - /* Change the "single I/O" function pointers */ - if(xfer_mode == H5FD_MPIO_INDEPENDENT) { - /* Set the pointers to the original, non-MPI-specific routines */ - io_info->io_ops.single_read = io_info->orig.io_ops.single_read; - io_info->io_ops.single_write = io_info->orig.io_ops.single_write; - } /* end if */ - else { - HDassert(xfer_mode == H5FD_MPIO_COLLECTIVE); - - /* Set the pointers to the MPI-specific routines */ - io_info->io_ops.single_read = H5D__mpio_select_read; - io_info->io_ops.single_write = H5D__mpio_select_write; - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__ioinfo_xfer_mode() */ - - -/*------------------------------------------------------------------------- - * Function: H5D__ioinfo_coll_opt_mode - * - * Purpose: Switch between using collective & independent MPI I/O w/file - * set view - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: MuQun Yang - * Oct. 5th, 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D__ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, - H5FD_mpio_collective_opt_t coll_opt_mode) -{ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_STATIC - - /* Change the optimal xfer_mode */ - io_info->dxpl_cache->coll_opt_mode = coll_opt_mode; - if(H5P_set(dx_plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &io_info->dxpl_cache->coll_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__ioinfo_coll_opt_mode() */ - - -/*------------------------------------------------------------------------- * Function: H5D__mpio_get_min_chunk * * Purpose: Routine for obtaining minimum number of chunks to cover @@ -699,28 +616,21 @@ H5D__contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_ H5D_chunk_map_t H5_ATTR_UNUSED *fm) { H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CONTIGUOUS_COLLECTIVE; - H5P_genplist_t *dx_plist; /* Pointer to DXPL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(H5FD_MPIO == H5F_DRIVER_ID(io_info->dset->oloc.file)); - HDassert(TRUE == H5P_isa_class(io_info->raw_dxpl_id, H5P_DATASET_XFER)); /* Call generic internal collective I/O routine */ if(H5D__inter_collective_io(io_info, type_info, file_space, mem_space) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "couldn't finish shared collective MPI-IO") - /* Obtain the data transfer properties */ - 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 * independent I/O, so we set it here. */ - 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") + H5CX_set_mpio_actual_io_mode(actual_io_mode); done: FUNC_LEAVE_NOAPI(ret_value) @@ -746,28 +656,21 @@ H5D__contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type H5D_chunk_map_t H5_ATTR_UNUSED *fm) { H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CONTIGUOUS_COLLECTIVE; - H5P_genplist_t *dx_plist; /* Pointer to DXPL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(H5FD_MPIO == H5F_DRIVER_ID(io_info->dset->oloc.file)); - HDassert(TRUE == H5P_isa_class(io_info->raw_dxpl_id, H5P_DATASET_XFER)); /* Call generic internal collective I/O routine */ if(H5D__inter_collective_io(io_info, type_info, file_space, mem_space) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't finish shared collective MPI-IO") - /* Obtain the data transfer properties */ - 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 * independent I/O, so we set it here. */ - 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") + H5CX_set_mpio_actual_io_mode(actual_io_mode); done: FUNC_LEAVE_NOAPI(ret_value) @@ -814,7 +717,6 @@ static herr_t H5D__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; /* Pointer to DXPL */ H5FD_mpio_chunk_opt_t chunk_opt_mode; int io_option = H5D_MULTI_CHUNK_IO_MORE_OPT; int sum_chunk = -1; @@ -831,13 +733,9 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf HDassert(type_info); HDassert(fm); - /* Obtain the data transfer properties */ - 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 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(H5CX_get_mpio_chunk_opt_mode(&chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_DATASET, 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*/ @@ -855,8 +753,8 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") /* 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 threshold value") + if(H5CX_get_mpio_chunk_opt_num(&one_link_chunk_io_threshold) < 0) + HGOTO_ERROR(H5E_DATASET, 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. */ @@ -865,54 +763,30 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf #ifdef H5_HAVE_INSTRUMENTED_LIBRARY else temp_not_link_io = TRUE; -#endif +#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ } /* end else */ #ifdef H5_HAVE_INSTRUMENTED_LIBRARY { - H5P_genplist_t *plist; /* Property list pointer */ - htri_t check_prop; - int new_value; - - /* Get the dataset transfer property list */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_IO, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /*** Test collective chunk user-input optimization APIs. ***/ - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME); - if(check_prop > 0) { - if(H5D_ONE_LINK_CHUNK_IO == io_option) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") - } /* end if */ + /*** Set collective chunk user-input optimization APIs. ***/ + if(H5D_ONE_LINK_CHUNK_IO == io_option) { + if(H5CX_test_set_mpio_coll_chunk_link_hard(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME); - if(check_prop > 0) { - if(H5D_MULTI_CHUNK_IO == io_option) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") - } /* end if */ + else if(H5D_MULTI_CHUNK_IO == io_option) { + if(H5CX_test_set_mpio_coll_chunk_multi_hard(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") + } /* end else-if */ + else if(H5D_ONE_LINK_CHUNK_IO_MORE_OPT == io_option) { + if(H5CX_test_set_mpio_coll_chunk_link_num_true(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME); - if(check_prop > 0) { - if(H5D_ONE_LINK_CHUNK_IO_MORE_OPT == io_option) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") - } /* end if */ - } /* end if */ - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME); - if(check_prop > 0) { - if(temp_not_link_io) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") - } /* end if */ + else if(temp_not_link_io) { + if(H5CX_test_set_mpio_coll_chunk_link_num_false(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ } -#endif +#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ /* step 2: Go ahead to do IO.*/ switch (io_option) { @@ -925,34 +799,31 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf * 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) { - if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) + if(io_info->op_type == H5D_IO_OP_READ) { + if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm) < 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) + else + if(H5D__link_chunk_filtered_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish filtered linked chunk MPI-IO") - } /* end else */ } /* end if */ - else { + else /* Perform unfiltered link chunk collective IO */ - if(H5D__link_chunk_collective_io(io_info, type_info, fm, sum_chunk, dx_plist) < 0) + if(H5D__link_chunk_collective_io(io_info, type_info, fm, sum_chunk) < 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 */ 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) + if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple filtered chunk MPI-IO") } /* end if */ - else { + else /* Perform unfiltered multi chunk collective IO */ - if(H5D__multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0) + if(H5D__multi_chunk_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO") - } /* end else */ break; } /* end switch */ @@ -1038,16 +909,11 @@ done: * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * - * Modification: - * - Set H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME and H5D_MPIO_ACTUAL_IO_MODE_NAME - * dxpl in this. - * Programmer: Jonathan Kim - * Date: 2012-10-10 *------------------------------------------------------------------------- */ 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) + H5D_chunk_map_t *fm, int sum_chunk) { H5D_chunk_addr_info_t *chunk_addr_info_array = NULL; MPI_Datatype chunk_final_mtype; /* Final memory MPI datatype for all chunks with seletion */ @@ -1066,20 +932,16 @@ H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ int *chunk_mpi_file_counts = NULL; /* Count of MPI file datatype for each chunk */ int *chunk_mpi_mem_counts = NULL; /* Count of MPI memory datatype for each chunk */ int mpi_code; /* MPI return code */ - 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; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC /* 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") + H5CX_set_mpio_actual_chunk_opt(H5D_MPIO_LINK_CHUNK); /* 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") + H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE); /* Get the sum # of chunks, if not already available */ if(sum_chunk < 0) { @@ -1122,7 +984,7 @@ H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ mspace = chunk_info->mspace; /* Look up address of chunk */ - if(H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk address") ctg_store.contig.dset_addr = udata.chunk_block.offset; } /* end else */ @@ -1312,7 +1174,7 @@ if(H5DEBUG(D)) io_info->store = &ctg_store; /* Perform final collective I/O operation */ - if(H5D__final_collective_io(io_info, type_info, mpi_buf_count, &chunk_final_ftype, &chunk_final_mtype) < 0) + if(H5D__final_collective_io(io_info, type_info, mpi_buf_count, chunk_final_ftype, chunk_final_mtype) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") } /* end else */ @@ -1402,12 +1264,10 @@ if(H5DEBUG(D)) */ 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_chunk_map_t *fm) { 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; /* 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; @@ -1425,7 +1285,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in 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) @@ -1434,14 +1293,12 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in 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") + H5CX_set_mpio_actual_chunk_opt(H5D_MPIO_LINK_CHUNK); /* Set the actual-io-mode property. * 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") + H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE); /* 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) < 0) @@ -1454,7 +1311,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* 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); @@ -1538,7 +1394,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in 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) + 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 @@ -1594,17 +1450,11 @@ done: * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * - * Modification: - * - Set H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME dxpl in this to go along with - * setting H5D_MPIO_ACTUAL_IO_MODE_NAME dxpl at the bottom. - * Programmer: Jonathan Kim - * Date: 2012-10-10 - * *------------------------------------------------------------------------- */ 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) + H5D_chunk_map_t *fm) { H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ @@ -1614,22 +1464,19 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *ty uint8_t *chunk_io_option = NULL; haddr_t *chunk_addr = NULL; H5D_storage_t store; /* union of EFL and chunk pointer in file space */ - H5FD_mpio_xfer_t last_xfer_mode = H5FD_MPIO_COLLECTIVE; /* Last parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */ 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 */ size_t total_chunk; /* Total # of chunks in dataset */ #ifdef H5Dmpio_DEBUG int mpi_rank; #endif size_t u; /* Local index variable */ - 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. */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC /* 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") + H5CX_set_mpio_actual_chunk_opt(H5D_MPIO_MULTI_CHUNK); #ifdef H5Dmpio_DEBUG mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file); @@ -1648,7 +1495,7 @@ if(H5DEBUG(D)) #endif /* Obtain IO option for each chunk */ - if(H5D__obtain_mpio_mode(io_info, fm, dx_plist, chunk_io_option, chunk_addr) < 0) + if(H5D__obtain_mpio_mode(io_info, fm, 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 */ @@ -1706,7 +1553,7 @@ if(H5DEBUG(D)) fspace = chunk_info->fspace; mspace = chunk_info->mspace; - /* Update the local variable tracking the dxpl's actual io mode property. + /* Update the local variable tracking the 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 @@ -1720,14 +1567,9 @@ if(H5DEBUG(D)) } /* 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") + if(H5CX_set_mpio_coll_opt(H5FD_MPIO_COLLECTIVE_IO) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't switch to collective I/O") last_coll_opt_mode = H5FD_MPIO_COLLECTIVE_IO; } /* end if */ @@ -1751,7 +1593,7 @@ if(H5DEBUG(D)) fspace = chunk_info->fspace; mspace = chunk_info->mspace; - /* Update the local variable tracking the dxpl's actual io mode. */ + /* Update the local variable tracking the actual io mode. */ actual_io_mode = (H5D_mpio_actual_io_mode_t) (actual_io_mode | H5D_MPIO_CHUNK_INDEPENDENT); } /* end if */ else { @@ -1760,8 +1602,8 @@ if(H5DEBUG(D)) /* 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") + if(H5CX_set_mpio_coll_opt(H5FD_MPIO_INDIVIDUAL_IO) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't switch to individual I/O") last_coll_opt_mode = H5FD_MPIO_INDIVIDUAL_IO; } /* end if */ @@ -1778,9 +1620,8 @@ if(H5DEBUG(D)) } /* end else */ } /* end for */ - /* 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") + /* Write the local value of actual io mode to the API context. */ + H5CX_set_mpio_actual_io_mode(actual_io_mode); done: if(chunk_io_option) @@ -1850,12 +1691,10 @@ done: */ 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_chunk_map_t *fm) { 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; /* 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 */ @@ -1875,7 +1714,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i 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) @@ -1884,14 +1722,12 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i 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") + H5CX_set_mpio_actual_chunk_opt(H5D_MPIO_MULTI_CHUNK); /* 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") + H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE); /* 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) < 0) @@ -1922,7 +1758,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* 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); @@ -2039,7 +1874,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i } /* 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) + 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 @@ -2189,7 +2024,7 @@ if(H5DEBUG(D)) #endif /* Perform final collective I/O operation */ - if(H5D__final_collective_io(io_info, type_info, (hsize_t)mpi_buf_count, &mpi_file_type, &mpi_buf_type) < 0) + if(H5D__final_collective_io(io_info, type_info, (hsize_t)mpi_buf_count, mpi_file_type, mpi_buf_type) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish collective MPI-IO") done: @@ -2222,15 +2057,15 @@ if(H5DEBUG(D)) */ static herr_t H5D__final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - hsize_t mpi_buf_count, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type) + hsize_t mpi_buf_count, MPI_Datatype mpi_file_type, MPI_Datatype mpi_buf_type) { herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC /* Pass buf type, file type to the file driver. */ - if(H5FD_mpi_setup_collective(io_info->raw_dxpl_id, mpi_buf_type, mpi_file_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") + if(H5CX_set_mpi_coll_datatypes(mpi_buf_type, mpi_file_type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set MPI-I/O collective I/O datatypes") if(io_info->op_type == H5D_IO_OP_WRITE) { if((io_info->io_ops.single_write)(io_info, type_info, mpi_buf_count, NULL, NULL) < 0) @@ -2444,7 +2279,7 @@ if(H5DEBUG(D)) H5D_chunk_ud_t udata; /* User data for querying chunk info */ /* Get address of chunk */ - if(H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") chunk_addr = udata.chunk_block.offset; } /* end if */ @@ -2520,7 +2355,7 @@ done: */ 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[]) + uint8_t assign_io_mode[], haddr_t chunk_addr[]) { size_t total_chunks; unsigned percent_nproc_per_chunk, threshold_nproc_per_chunk; @@ -2535,10 +2370,6 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, int root; size_t ic; int mpi_code; -#ifdef H5_HAVE_INSTRUMENTED_LIBRARY - int new_value; - htri_t check_prop; -#endif herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -2555,8 +2386,8 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, /* Setup parameters */ 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(H5CX_get_mpio_chunk_opt_ratio(&percent_nproc_per_chunk) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "couldn't get percent nproc per chunk") /* if ratio is 0, perform collective io */ if(0 == percent_nproc_per_chunk) { if(H5D__chunk_addrmap(io_info, chunk_addr) < 0) @@ -2646,40 +2477,19 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, #ifdef H5_HAVE_INSTRUMENTED_LIBRARY { - H5P_genplist_t *plist; /* Property list pointer */ - - /* Get the dataset transfer property list */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_IO, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME); - if(check_prop > 0) { - for(ic = 0; ic < total_chunks; ic++) { - if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") - break; - } /* end if */ - } /* end for */ - } /* end if */ - - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME); - if(check_prop > 0) { - int temp_count = 0; + hbool_t coll_op = FALSE; - for(ic = 0; ic < total_chunks; ic++) { - if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { - temp_count++; - break; - } /* end if */ - } /* end for */ - if(temp_count == 0) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") + for(ic = 0; ic < total_chunks; ic++) + if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { + if(H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") + coll_op = TRUE; + break; } /* end if */ - } /* end if */ + + if(!coll_op) + if(H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") } #endif @@ -2732,7 +2542,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(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") @@ -2745,15 +2554,15 @@ 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(H5D_filtered_collective_io_info_t)))) + 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); - for (i = 0; chunk_node; i++) { + for(i = 0; chunk_node; i++) { chunk_info = (H5D_chunk_info_t *) H5SL_item(chunk_node); /* Obtain this chunk's address */ - if (H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") local_info_array[i].index = chunk_info->index; @@ -3000,8 +2809,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty 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)) + if(!H5D__gather_mem(io_info->u.wbuf, chunk_info->mspace, mem_iter, (size_t)iter_nelmts, mod_data_p)) HGOTO_ERROR(H5E_IO, H5E_CANTGATHER, FAIL, "couldn't gather from write buffer") /* Send modification data to new owner */ @@ -3212,6 +3020,8 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk 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 */ + H5Z_EDC_t err_detect; /* Error detection info */ + H5Z_cb_t filter_cb; /* I/O filter callback function */ unsigned filter_mask = 0; hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ hssize_t extent_npoints; @@ -3232,6 +3042,12 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HDassert(type_info); HDassert(fm); + /* Retrieve filter settings from API context */ + if(H5CX_get_err_detect(&err_detect) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get error detection info") + if(H5CX_get_filter_cb(&filter_cb) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O filter callback function") + /* 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") @@ -3253,19 +3069,19 @@ 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 (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { + 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; /* 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) + 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, 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->chunk_states.new_chunk.length, &buf_size, &chunk_entry->buf) < 0) + if(H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, + &filter_mask, err_detect, filter_cb, (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 { @@ -3291,8 +3107,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_info->mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, io_info->u.rbuf) < 0) + if (H5D__scatter_mem(chunk_entry->buf, chunk_info->mspace, mem_iter, (size_t)iter_nelmts, io_info->u.rbuf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't scatter to read buffer") break; @@ -3301,8 +3116,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_info->mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, tmp_gath_buf)) + if(!H5D__gather_mem(io_info->u.wbuf, chunk_info->mspace, mem_iter, (size_t)iter_nelmts, tmp_gath_buf)) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) @@ -3320,8 +3134,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk /* Scatter the owner's modification data into the chunk data buffer according to * the file space. */ - if (H5D__scatter_mem(tmp_gath_buf, chunk_info->fspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf) < 0) + if(H5D__scatter_mem(tmp_gath_buf, chunk_info->fspace, mem_iter, (size_t)iter_nelmts, 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) @@ -3351,8 +3164,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") /* 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) + if(H5D__scatter_mem(mod_data_p, dataspace, mem_iter, (size_t) iter_nelmts, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't scatter to write buffer") if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) @@ -3367,18 +3179,18 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk } /* end for */ /* 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->chunk_states.new_chunk.length, &buf_size, &chunk_entry->buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") + if(H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, + err_detect, filter_cb, (size_t *)&chunk_entry->chunk_states.new_chunk.length, + &buf_size, &chunk_entry->buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "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->chunk_states.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, "invalid I/O operation") } /* end switch */ diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 97ec5d6..be421b6 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -145,7 +145,7 @@ H5D__none_idx_create(const H5D_chk_idx_info_t *idx_info) nbytes = idx_info->layout->max_nchunks * idx_info->layout->size; /* Allocate space for max dataset chunks */ - addr = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, nbytes); + addr = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, nbytes); if(!H5F_addr_defined(addr)) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "file allocation failed") @@ -355,7 +355,7 @@ H5D__none_idx_delete(const H5D_chk_idx_info_t *idx_info) /* chunk size * max # of chunks */ nbytes = idx_info->layout->max_nchunks * idx_info->layout->size; - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, idx_info->storage->idx_addr, nbytes) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->storage->idx_addr, nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, H5_ITER_ERROR, "unable to free dataset chunks") idx_info->storage->idx_addr = HADDR_UNDEF; @@ -401,14 +401,14 @@ H5D__none_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(idx_info_dst->storage); /* Set copied metadata tag */ - H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Allocate dataset chunks in the dest. file */ if(H5D__none_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Doh.c b/src/H5Doh.c index 9abbdff..f8ce69f 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -23,6 +23,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ @@ -45,15 +46,13 @@ /********************/ static void *H5O__dset_get_copy_file_udata(void); static void H5O__dset_free_copy_file_udata(void *); -static htri_t H5O__dset_isa(H5O_t *loc); -static hid_t H5O__dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, - hid_t dxpl_id, hbool_t app_ref); -static void *H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, - hid_t dxpl_id); +static htri_t H5O__dset_isa(const H5O_t *loc); +static hid_t H5O__dset_open(const H5G_loc_t *obj_loc, hbool_t app_ref); +static void *H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc); static H5O_loc_t *H5O__dset_get_oloc(hid_t obj_id); -static herr_t H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, +static herr_t H5O__dset_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info); -static herr_t H5O__dset_flush(void *_obj_ptr, hid_t dxpl_id); +static herr_t H5O__dset_flush(void *_obj_ptr); /*********************/ @@ -148,7 +147,7 @@ H5O__dset_free_copy_file_udata(void *_udata) /* Release copy of dataset's datatype, if it was set */ if(udata->src_dtype) - H5T_close(udata->src_dtype); + H5T_close_real(udata->src_dtype); /* Release copy of dataset's filter pipeline, if it was set */ if(udata->common.src_pline) @@ -179,7 +178,7 @@ H5O__dset_free_copy_file_udata(void *_udata) *------------------------------------------------------------------------- */ static htri_t -H5O__dset_isa(H5O_t *oh) +H5O__dset_isa(const H5O_t *oh) { htri_t exists; /* Flag if header message of interest exists */ htri_t ret_value = TRUE; /* Return value */ @@ -219,10 +218,9 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O__dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O__dset_open(const H5G_loc_t *obj_loc, hbool_t app_ref) { H5D_t *dset = NULL; /* Dataset opened */ - htri_t isdapl; /* lapl_id is a dapl */ hid_t dapl_id; /* dapl to use to open this dataset */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -230,30 +228,41 @@ H5O__dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t a HDassert(obj_loc); - /* If the lapl passed in is a dapl, use it. Otherwise, use the default dapl */ - if(lapl_id == H5P_DEFAULT) - isdapl = FALSE; - else - if((isdapl = H5P_isa_class(lapl_id, H5P_DATASET_ACCESS)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOMPARE, FAIL, "unable to compare property list classes") - - if(isdapl) - dapl_id = lapl_id; - else + /* Get the LAPL (which is a superclass of DAPLs) from the API context, but + * if it's the default link access property list or a custom link access + * property list but not a dataset access property list, use the default + * dataset access property list instead. (Since LAPLs don't have the + * additional properties that DAPLs have) + */ + dapl_id = H5CX_get_lapl(); + if(dapl_id == H5P_LINK_ACCESS_DEFAULT) dapl_id = H5P_DATASET_ACCESS_DEFAULT; + else { + htri_t is_lapl, is_dapl; /* Class of LAPL from API context */ + + /* Check class of LAPL from API context */ + if((is_lapl = H5P_isa_class(dapl_id, H5P_LINK_ACCESS)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, H5I_INVALID_HID, "unable to get LAPL status") + if((is_dapl = H5P_isa_class(dapl_id, H5P_DATASET_ACCESS)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, H5I_INVALID_HID, "unable to get DAPL status") + + /* Switch to default DAPL if not an actual DAPL in the API context */ + if(!is_dapl && is_lapl) + dapl_id = H5P_DATASET_ACCESS_DEFAULT; + } /* end else */ /* Open the dataset */ - if(NULL == (dset = H5D_open(obj_loc, dapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") + if(NULL == (dset = H5D_open(obj_loc, dapl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open dataset") /* Register an ID for the dataset */ if((ret_value = H5I_register(H5I_DATASET, dset, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataset") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataset") done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release dataset") FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__dset_open() */ @@ -273,7 +282,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) { H5D_obj_create_t *crt_info = (H5D_obj_create_t *)_crt_info; /* Dataset creation parameters */ H5D_t *dset = NULL; /* New dataset created */ @@ -287,7 +296,7 @@ H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) HDassert(obj_loc); /* Create the the dataset */ - if(NULL == (dset = H5D__create(f, crt_info->type_id, crt_info->space, crt_info->dcpl_id, crt_info->dapl_id, dxpl_id))) + if(NULL == (dset = H5D__create(f, crt_info->type_id, crt_info->space, crt_info->dcpl_id, crt_info->dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create dataset") /* Set up the new dataset's location */ @@ -357,7 +366,7 @@ 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__dset_bh_info(const H5O_loc_t *loc, 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 */ @@ -376,14 +385,14 @@ 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)) + if(NULL == H5O_msg_read_oh(loc->file, 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)) { /* 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, 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 @@ -391,7 +400,7 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * 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, &(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 */ @@ -407,12 +416,12 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * 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)) + if(NULL == H5O_msg_read_oh(loc->file, 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) + if(H5D__efl_bh_info(loc->file, &efl, &(bh_info->heap_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine EFL heap info") } /* end if */ @@ -441,7 +450,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__dset_flush(void *_obj_ptr, hid_t dxpl_id) +H5O__dset_flush(void *_obj_ptr) { H5D_t *dset = (H5D_t *)_obj_ptr; /* Pointer to dataset object */ H5O_type_t obj_type; /* Type of object at location */ @@ -453,12 +462,12 @@ H5O__dset_flush(void *_obj_ptr, hid_t dxpl_id) HDassert(&dset->oloc); /* Check that the object found is the correct type */ - if(H5O_obj_type(&dset->oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&dset->oloc, &obj_type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") if(obj_type != H5O_TYPE_DATASET) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") - if(H5D__flush_real(dset, dxpl_id) < 0) + if(H5D__flush_real(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") done: diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 542abd0..ce0cdcc 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -30,12 +30,12 @@ #include "H5Dprivate.h" /* Other private headers needed by this file */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5B2private.h" /* v2 B-trees */ -#include "H5Fprivate.h" /* File access */ -#include "H5Gprivate.h" /* Groups */ -#include "H5SLprivate.h" /* Skip lists */ -#include "H5Tprivate.h" /* Datatypes */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5B2private.h" /* v2 B-trees */ +#include "H5Fprivate.h" /* File access */ +#include "H5Gprivate.h" /* Groups */ +#include "H5SLprivate.h" /* Skip lists */ +#include "H5Tprivate.h" /* Datatypes */ /**************************/ /* Package Private Macros */ @@ -45,19 +45,13 @@ #define H5D_MINHDR_SIZE 256 /* [Simple] Macro to construct a H5D_io_info_t from it's components */ -#define H5D_BUILD_IO_INFO_WRT(io_info, ds, dxpl_c, dxpl_m, dxpl_r, str, buf) \ +#define H5D_BUILD_IO_INFO_WRT(io_info, ds, str, buf) \ (io_info)->dset = ds; \ - (io_info)->dxpl_cache = dxpl_c; \ - (io_info)->raw_dxpl_id = dxpl_r; \ - (io_info)->md_dxpl_id = dxpl_m; \ (io_info)->store = str; \ (io_info)->op_type = H5D_IO_OP_WRITE; \ (io_info)->u.wbuf = buf -#define H5D_BUILD_IO_INFO_RD(io_info, ds, dxpl_c, dxpl_m, dxpl_r, str, buf) \ +#define H5D_BUILD_IO_INFO_RD(io_info, ds, str, buf) \ (io_info)->dset = ds; \ - (io_info)->dxpl_cache = dxpl_c; \ - (io_info)->raw_dxpl_id = dxpl_r; \ - (io_info)->md_dxpl_id = dxpl_m; \ (io_info)->store = str; \ (io_info)->op_type = H5D_IO_OP_READ; \ (io_info)->u.rbuf = buf @@ -122,7 +116,7 @@ struct H5D_chunk_map_t; /* Function pointers for I/O on particular types of dataset layouts */ typedef herr_t (*H5D_layout_construct_func_t)(H5F_t *f, H5D_t *dset); -typedef herr_t (*H5D_layout_init_func_t)(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, +typedef herr_t (*H5D_layout_init_func_t)(H5F_t *f, const H5D_t *dset, hid_t dapl_id); typedef hbool_t (*H5D_layout_is_space_alloc_func_t)(const H5O_storage_t *storage); typedef herr_t (*H5D_layout_io_init_func_t)(const struct H5D_io_info_t *io_info, @@ -141,9 +135,9 @@ typedef ssize_t (*H5D_layout_readvv_func_t)(const struct H5D_io_info_t *io_info, typedef ssize_t (*H5D_layout_writevv_func_t)(const struct H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -typedef herr_t (*H5D_layout_flush_func_t)(H5D_t *dataset, hid_t dxpl_id); +typedef herr_t (*H5D_layout_flush_func_t)(H5D_t *dataset); typedef herr_t (*H5D_layout_io_term_func_t)(const struct H5D_chunk_map_t *cm); -typedef herr_t (*H5D_layout_dest_func_t)(H5D_t *dataset, hid_t dxpl_id); +typedef herr_t (*H5D_layout_dest_func_t)(H5D_t *dataset); /* Typedef for grouping layout I/O routines */ typedef struct H5D_layout_ops_t { @@ -210,20 +204,9 @@ typedef enum H5D_io_op_type_t { typedef struct H5D_io_info_t { const H5D_t *dset; /* Pointer to dataset being operated on */ -#ifndef H5_HAVE_PARALLEL - const -#endif /* H5_HAVE_PARALLEL */ - H5D_dxpl_cache_t *dxpl_cache; /* Pointer to cached DXPL info */ - hid_t raw_dxpl_id; /* Original DXPL ID */ - hid_t md_dxpl_id; /* metadata dxpl needed for parallel HDF5 */ #ifdef H5_HAVE_PARALLEL MPI_Comm comm; /* MPI communicator for file */ hbool_t using_mpi_vfd; /* Whether the file is using an MPI-based VFD */ - struct { - H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */ - H5FD_mpio_collective_opt_t coll_opt_mode; /* Parallel transfer with independent IO or collective IO with this mode */ - H5D_io_ops_t io_ops; /* I/O operation function pointers */ - } orig; #endif /* H5_HAVE_PARALLEL */ H5D_storage_t *store; /* Dataset storage info */ H5D_layout_ops_t layout_ops; /* Dataset layout I/O operation function pointers */ @@ -243,7 +226,6 @@ typedef struct H5D_io_info_t { /* Typedef for chunked dataset index operation info */ typedef struct H5D_chk_idx_info_t { H5F_t *f; /* File pointer for operation */ - hid_t dxpl_id; /* DXPL ID for operation */ const H5O_pline_t *pline; /* I/O pipeline info */ H5O_layout_chunk_t *layout; /* Chunk layout description */ H5O_storage_chunk_t *storage; /* Chunk storage description */ @@ -313,7 +295,7 @@ typedef herr_t (*H5D_chunk_delete_func_t)(const H5D_chk_idx_info_t *idx_info); typedef herr_t (*H5D_chunk_copy_setup_func_t)(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst); typedef herr_t (*H5D_chunk_copy_shutdown_func_t)(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id); + H5O_storage_chunk_t *storage_dst); typedef herr_t (*H5D_chunk_size_func_t)(const H5D_chk_idx_info_t *idx_info, hsize_t *idx_size); typedef herr_t (*H5D_chunk_reset_func_t)(H5O_storage_chunk_t *storage, hbool_t reset_addr); @@ -532,7 +514,6 @@ typedef struct { H5S_t *mspace; /* Memory dataspace for operation */ void *fl_tbuf; /* Ptr to the temporary buffer we are using for fixed-length data */ void *vl_tbuf; /* Ptr to the temporary buffer we are using for VL data */ - hid_t xfer_pid; /* ID of the dataset xfer property list */ hsize_t size; /* Accumulated number of bytes for the selection */ } H5D_vlen_bufsize_t; @@ -540,7 +521,6 @@ typedef struct { /*****************************/ /* Package Private Variables */ /*****************************/ -extern H5D_dxpl_cache_t H5D_def_dxpl_cache; /* Storage layout class I/O operations */ H5_DLLVAR const H5D_layout_ops_t H5D_LOPS_CONTIG[1]; @@ -567,45 +547,44 @@ H5_DLLVAR const H5B2_class_t H5D_BT2_FILT[1]; /******************************/ H5_DLL H5D_t *H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, - hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id); + hid_t dcpl_id, hid_t dapl_id); H5_DLL H5D_t *H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, const H5S_t *space, hid_t lcpl_id, hid_t dcpl_id, - hid_t dapl_id, hid_t dxpl_id); -H5_DLL H5D_t *H5D__open_name(const H5G_loc_t *loc, const char *name, - hid_t dapl_id, hid_t dxpl_id); -H5_DLL herr_t H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, - hid_t dxpl_id); + hid_t dapl_id); +H5_DLL H5D_t *H5D__create_anon(H5F_t *file, hid_t type_id, const H5S_t *space, + hid_t dcpl_id, hid_t dapl_id); +H5_DLL H5D_t *H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id); +H5_DLL hid_t H5D__get_space(const H5D_t *dset); +H5_DLL hid_t H5D__get_type(const H5D_t *dset); +H5_DLL herr_t H5D__get_space_status(const 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 herr_t H5D__get_storage_size(const H5D_t *dset, hsize_t *storage_size); +H5_DLL herr_t H5D__get_chunk_storage_size(H5D_t *dset, 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, const hsize_t *point, void *op_data); H5_DLL herr_t H5D__check_filters(H5D_t *dataset); -H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); -H5_DLL herr_t H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache); -H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id); -H5_DLL herr_t H5D__flush_real(H5D_t *dataset, hid_t dxpl_id); -H5_DLL herr_t H5D__mark(const H5D_t *dataset, hid_t dxpl_id, unsigned flags); -H5_DLL herr_t H5D__refresh(hid_t dset_id, H5D_t *dataset, hid_t dxpl_id); -#ifdef H5_DEBUG_BUILD -H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id); -#endif /* H5_DEBUG_BUILD */ +H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size); +H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset); +H5_DLL herr_t H5D__flush_real(H5D_t *dataset); +H5_DLL herr_t H5D__flush(H5D_t *dset, hid_t dset_id); +H5_DLL hid_t H5D__get_create_plist(const H5D_t *dset); +H5_DLL herr_t H5D__mark(const H5D_t *dataset, unsigned flags); +H5_DLL herr_t H5D__refresh(hid_t dset_id, H5D_t *dataset); /* To convert a dataset's chunk indexing type to v1 B-tree */ -H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id); +H5_DLL herr_t H5D__format_convert(H5D_t *dataset); /* Internal I/O routines */ H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); + const H5S_t *mem_space, const H5S_t *file_space, const void *buf); H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, - void *buf/*out*/); + const H5S_t *mem_space, const H5S_t *file_space, void *buf/*out*/); H5_DLL herr_t H5D__write(H5D_t *dataset, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, - const void *buf); + const H5S_t *mem_space, const H5S_t *file_space, const void *buf); /* Functions that perform direct serial I/O operations */ H5_DLL herr_t H5D__select_read(const H5D_io_info_t *io_info, @@ -616,12 +595,10 @@ H5_DLL herr_t H5D__select_write(const H5D_io_info_t *io_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); /* Functions that perform scatter-gather serial I/O operations */ -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__scatter_mem(const void *_tscat_buf, const H5S_t *space, + H5S_sel_iter_t *iter, size_t nelmts, void *_buf); +H5_DLL size_t H5D__gather_mem(const void *_buf, const H5S_t *space, + H5S_sel_iter_t *iter, size_t nelmts, 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); @@ -637,16 +614,14 @@ H5_DLL herr_t H5D__layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space, const H5D_dcpl_cache_t *dcpl_cache); H5_DLL herr_t H5D__layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space, const H5D_dcpl_cache_t *dcpl_cache); -H5_DLL herr_t H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, - H5D_t *dset, hid_t dapl_id); -H5_DLL herr_t H5D__layout_oh_read(H5D_t *dset, hid_t dxpl_id, hid_t dapl_id, +H5_DLL herr_t H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, + hid_t dapl_id); +H5_DLL herr_t H5D__layout_oh_read(H5D_t *dset, hid_t dapl_id, H5P_genplist_t *plist); -H5_DLL herr_t H5D__layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, - unsigned update_flags); +H5_DLL herr_t H5D__layout_oh_write(H5D_t *dataset, H5O_t *oh, unsigned update_flags); /* Functions that operate on contiguous storage */ -H5_DLL herr_t H5D__contig_alloc(H5F_t *f, hid_t dxpl_id, - H5O_storage_contig_t *storage); +H5_DLL herr_t H5D__contig_alloc(H5F_t *f, H5O_storage_contig_t *storage); H5_DLL hbool_t H5D__contig_is_space_alloc(const H5O_storage_t *storage); H5_DLL herr_t H5D__contig_fill(const H5D_io_info_t *io_info); H5_DLL herr_t H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, @@ -657,43 +632,39 @@ H5_DLL herr_t H5D__contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *t H5D_chunk_map_t *fm); H5_DLL herr_t H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f_dst, H5O_storage_contig_t *storage_dst, H5T_t *src_dtype, - H5O_copy_t *cpy_info, hid_t dxpl_id); -H5_DLL herr_t H5D__contig_delete(H5F_t *f, hid_t dxpl_id, - const H5O_storage_t *store); + H5O_copy_t *cpy_info); +H5_DLL herr_t H5D__contig_delete(H5F_t *f, const H5O_storage_t *store); /* Functions that operate on chunked dataset storage */ H5_DLL htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op); -H5_DLL herr_t H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id); +H5_DLL herr_t H5D__chunk_create(const H5D_t *dset /*in,out*/); H5_DLL herr_t H5D__chunk_set_info(const H5D_t *dset); H5_DLL hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage); -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_lookup(const H5D_t *dset, const hsize_t *scaled, + H5D_chunk_ud_t *udata); +H5_DLL herr_t H5D__chunk_allocated(const H5D_t *dset, 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, - const hsize_t *old_dim); +H5_DLL herr_t H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]); +H5_DLL herr_t H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim); H5_DLL herr_t H5D__chunk_set_sizes(H5D_t *dset); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]); #endif /* H5_HAVE_PARALLEL */ -H5_DLL herr_t H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__chunk_update_cache(H5D_t *dset); H5_DLL herr_t H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk_t *layout_src, H5F_t *f_dst, H5O_storage_chunk_t *storage_dst, const H5S_extent_t *ds_extent_src, const H5T_t *dt_src, - const H5O_pline_t *pline_src, H5O_copy_t *cpy_info, hid_t dxpl_id); -H5_DLL herr_t H5D__chunk_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, + const H5O_pline_t *pline_src, H5O_copy_t *cpy_info); +H5_DLL herr_t H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, hsize_t *btree_size); -H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream); -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, +H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, FILE *stream); +H5_DLL herr_t H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *store); +H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, 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, +H5_DLL herr_t H5D__chunk_direct_read(const H5D_t *dset, 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); @@ -703,39 +674,38 @@ H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers); H5_DLL herr_t H5D__chunk_format_convert(H5D_t *dset, H5D_chk_idx_info_t *idx_info, H5D_chk_idx_info_t *new_idx_info); /* Functions that operate on compact dataset storage */ -H5_DLL herr_t H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__compact_fill(const H5D_t *dset); H5_DLL herr_t 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 *src_dtype, - H5O_copy_t *cpy_info, hid_t dxpl_id); + H5O_copy_t *cpy_info); /* Functions that operate on virtual dataset storage */ +H5_DLL herr_t H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout); H5_DLL herr_t H5D__virtual_copy_layout(H5O_layout_t *layout); -H5_DLL herr_t H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__virtual_set_extent_unlim(const H5D_t *dset); H5_DLL herr_t H5D__virtual_reset_layout(H5O_layout_t *layout); -H5_DLL herr_t H5D__virtual_delete(H5F_t *f, hid_t dxpl_id, H5O_storage_t *storage); -H5_DLL herr_t H5D__virtual_copy(H5F_t *f_src, H5O_layout_t *layout_dst, - hid_t dxpl_id); -H5_DLL herr_t H5D__virtual_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, - hid_t dapl_id); +H5_DLL herr_t H5D__virtual_delete(H5F_t *f, H5O_storage_t *storage); +H5_DLL herr_t H5D__virtual_copy(H5F_t *f_src, H5O_layout_t *layout_dst); +H5_DLL herr_t H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id); H5_DLL hbool_t H5D__virtual_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D__virtual_hold_source_dset_files(const H5D_t *dset, H5D_virtual_held_file_t **head); -H5_DLL herr_t H5D__virtual_refresh_source_dsets(H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__virtual_hold_source_dset_files(const H5D_t *dset, + H5D_virtual_held_file_t **head); +H5_DLL herr_t H5D__virtual_refresh_source_dsets(H5D_t *dset); H5_DLL herr_t H5D__virtual_release_source_dset_files(H5D_virtual_held_file_t *head); /* Functions that operate on EFL (External File List)*/ H5_DLL hbool_t H5D__efl_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D__efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, - hsize_t *heap_size); +H5_DLL herr_t H5D__efl_bh_info(H5F_t *f, H5O_efl_t *efl, hsize_t *heap_size); /* Functions that perform fill value operations on datasets */ H5_DLL herr_t H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, - const H5T_t *buf_type, const H5S_t *space, hid_t dxpl_id); + const H5T_t *buf_type, const H5S_t *space); H5_DLL herr_t H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info, const H5O_fill_t *fill, const H5T_t *dset_type, hid_t dset_type_id, - size_t nelmts, size_t min_buf_size, hid_t dxpl_id); -H5_DLL herr_t H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id); + size_t nelmts, size_t min_buf_size); +H5_DLL herr_t H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts); H5_DLL herr_t H5D__fill_term(H5D_fill_buf_info_t *fb_info); #ifdef H5_HAVE_PARALLEL @@ -775,7 +745,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, H5P_genplist_t *dx_plist); + const H5D_type_info_t *type_info); #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index fb994d8..0b37690 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -119,23 +119,6 @@ /* Typedef for dataset in memory (defined in H5Dpkg.h) */ typedef struct H5D_t H5D_t; -/* Typedef for cached dataset transfer property list information */ -typedef struct H5D_dxpl_cache_t { - size_t max_temp_buf; /* Maximum temporary buffer size (H5D_XFER_MAX_TEMP_BUF_NAME) */ - void *tconv_buf; /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */ - void *bkgr_buf; /* Background conversion buffer (H5D_XFER_BKGR_BUF_NAME) */ - H5T_bkg_t bkgr_buf_type; /* Background buffer type (H5D_XFER_BKGR_BUF_NAME) */ - H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */ - double btree_split_ratio[3];/* B-tree split ratios (H5D_XFER_BTREE_SPLIT_RATIO_NAME) */ - size_t vec_size; /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */ -#ifdef H5_HAVE_PARALLEL - H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */ - H5FD_mpio_collective_opt_t coll_opt_mode; /* Parallel transfer with independent IO or collective IO with this mode */ -#endif /*H5_HAVE_PARALLEL*/ - H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */ - H5Z_data_xform_t *data_xform_prop; /* Data transform prop (H5D_XFER_XFORM_NAME) */ -} H5D_dxpl_cache_t; - /* Typedef for cached dataset creation property list information */ typedef struct H5D_dcpl_cache_t { H5O_fill_t fill; /* Fill value info (H5D_CRT_FILL_VALUE_NAME) */ @@ -169,22 +152,19 @@ typedef struct H5D_append_flush_t { /******************************/ H5_DLL herr_t H5D_init(void); -H5_DLL H5D_t *H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id); +H5_DLL H5D_t *H5D_open(const H5G_loc_t *loc, hid_t dapl_id); H5_DLL herr_t H5D_close(H5D_t *dataset); -H5_DLL herr_t H5D_mult_refresh_close(hid_t dset_id, hid_t dxpl_id); -H5_DLL herr_t H5D_mult_refresh_reopen(H5D_t *dataset, hid_t dxpl_id); +H5_DLL herr_t H5D_mult_refresh_close(hid_t dset_id); +H5_DLL herr_t H5D_mult_refresh_reopen(H5D_t *dataset); H5_DLL H5O_loc_t *H5D_oloc(H5D_t *dataset); H5_DLL H5G_name_t *H5D_nameof(H5D_t *dataset); H5_DLL H5T_t *H5D_typeof(const H5D_t *dset); -H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5D_flush_all(const H5F_t *f); H5_DLL hid_t H5D_get_create_plist(H5D_t *dset); H5_DLL hid_t H5D_get_access_plist(H5D_t *dset); -H5_DLL hid_t H5D_get_space(H5D_t *dset); -H5_DLL hid_t H5D_get_type(H5D_t *dset); /* Functions that operate on vlen data */ -H5_DLL herr_t H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, - void *buf); +H5_DLL herr_t H5D_vlen_reclaim(hid_t type_id, H5S_t *space, void *buf); /* Functions that operate on chunked storage */ H5_DLL herr_t H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); @@ -202,7 +182,7 @@ H5_DLL herr_t H5D_virtual_parse_source_name(const char *source_name, H5_DLL herr_t H5D_virtual_free_parsed_name(H5O_storage_virtual_name_seg_t *name_seg); /* Functions that operate on indexed storage */ -H5_DLL herr_t H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, +H5_DLL herr_t H5D_btree_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth, unsigned ndims, const uint32_t *dim); #endif /* _H5Dprivate_H */ diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index baa844a..790674a 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -35,13 +35,13 @@ /* Bit flags for the H5Pset_chunk_opts() and H5Pget_chunk_opts() */ #define H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS (0x0002u) -/* Property names for H5LTDdirect_chunk_write */ +/* Property names for H5DOwrite_chunk */ #define H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME "direct_chunk_flag" #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 */ +/* Property names for H5DOread_chunk */ #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" diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 0ae69ee..f636eb7 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -22,6 +22,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -48,8 +49,7 @@ 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 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*/); + H5S_sel_iter_t *iter, const H5D_type_info_t *type_info, void *user_buf/*out*/); static herr_t H5D__compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info); @@ -103,6 +103,7 @@ H5D__scatter_file(const H5D_io_info_t *_io_info, size_t orig_mem_len, mem_len; /* Length of sequence in memory */ size_t nseq; /* Number of sequences generated */ size_t nelem; /* Number of elements used in sequences */ + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ herr_t ret_value = SUCCEED; /* Return value */ @@ -120,9 +121,13 @@ H5D__scatter_file(const H5D_io_info_t *_io_info, tmp_io_info.op_type = H5D_IO_OP_WRITE; tmp_io_info.u.wbuf = _buf; + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(tmp_io_info.dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = tmp_io_info.dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (len = H5FL_SEQ_MALLOC(size_t, vec_size))) @@ -199,6 +204,7 @@ H5D__gather_file(const H5D_io_info_t *_io_info, size_t orig_mem_len, mem_len; /* Length of sequence in memory */ size_t nseq; /* Number of sequences generated */ size_t nelem; /* Number of elements used in sequences */ + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ size_t ret_value = nelmts; /* Return value */ @@ -218,9 +224,13 @@ H5D__gather_file(const H5D_io_info_t *_io_info, tmp_io_info.op_type = H5D_IO_OP_READ; tmp_io_info.u.rbuf = _buf; + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(tmp_io_info.dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = tmp_io_info.dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (len = H5FL_SEQ_MALLOC(size_t, vec_size))) @@ -279,8 +289,7 @@ done: */ 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/*out*/) + H5S_sel_iter_t *iter, size_t nelmts, void *_buf/*out*/) { uint8_t *buf = (uint8_t *)_buf; /* Get local copies for address arithmetic */ const uint8_t *tscat_buf = (const uint8_t *)_tscat_buf; @@ -290,6 +299,7 @@ H5D__scatter_mem (const void *_tscat_buf, const H5S_t *space, size_t nseq; /* Number of sequences generated */ size_t curr_seq; /* Current sequence being processed */ size_t nelem; /* Number of elements used in sequences */ + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ herr_t ret_value = SUCCEED; /* Number of elements scattered */ @@ -300,12 +310,15 @@ H5D__scatter_mem (const void *_tscat_buf, const H5S_t *space, HDassert(space); HDassert(iter); HDassert(nelmts > 0); - HDassert(dxpl_cache); HDassert(buf); + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (len = H5FL_SEQ_MALLOC(size_t, vec_size))) @@ -364,8 +377,7 @@ done: */ 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*/) + H5S_sel_iter_t *iter, size_t nelmts, void *_tgath_buf/*out*/) { const uint8_t *buf = (const uint8_t *)_buf; /* Get local copies for address arithmetic */ uint8_t *tgath_buf = (uint8_t *)_tgath_buf; @@ -375,6 +387,7 @@ H5D__gather_mem(const void *_buf, const H5S_t *space, size_t nseq; /* Number of sequences generated */ size_t curr_seq; /* Current sequence being processed */ size_t nelem; /* Number of elements used in sequences */ + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ size_t ret_value = nelmts; /* Number of elements gathered */ @@ -385,12 +398,15 @@ H5D__gather_mem(const void *_buf, const H5S_t *space, HDassert(space); HDassert(iter); HDassert(nelmts > 0); - HDassert(dxpl_cache); HDassert(tgath_buf); + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (len = H5FL_SEQ_MALLOC(size_t, vec_size))) @@ -446,7 +462,6 @@ 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) { - const H5D_dxpl_cache_t *dxpl_cache = io_info->dxpl_cache; /* Local pointer to dataset transfer info */ void *buf = io_info->u.rbuf; /* Local pointer to application buffer */ H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info*/ hbool_t mem_iter_init = FALSE; /* Memory selection iteration info has been initialized */ @@ -516,12 +531,12 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf * bypass the rest of steps. */ if(type_info->cmpd_subset && H5T_SUBSET_FALSE != type_info->cmpd_subset->subset) { - if(H5D__compound_opt_read(smine_nelmts, mem_space, mem_iter, dxpl_cache, type_info, buf /*out*/) < 0) + if(H5D__compound_opt_read(smine_nelmts, mem_space, mem_iter, type_info, buf /*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") } /* end if */ else { if(H5T_BKG_YES == type_info->need_bkg) { - n = H5D__gather_mem(buf, mem_space, bkg_iter, smine_nelmts, dxpl_cache, type_info->bkg_buf/*out*/); + n = H5D__gather_mem(buf, mem_space, bkg_iter, smine_nelmts, type_info->bkg_buf/*out*/); if(n != smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "mem gather failed") } /* end if */ @@ -531,18 +546,25 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf */ if(H5T_convert(type_info->tpath, type_info->src_type_id, type_info->dst_type_id, smine_nelmts, (size_t)0, (size_t)0, type_info->tconv_buf, - type_info->bkg_buf, io_info->md_dxpl_id) < 0) + type_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") /* Do the data transform after the conversion (since we're using type mem_type) */ - if(!type_info->is_xform_noop) - if(H5Z_xform_eval(dxpl_cache->data_xform_prop, type_info->tconv_buf, smine_nelmts, type_info->mem_type) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") + if(!type_info->is_xform_noop) { + H5Z_data_xform_t *data_transform; /* Data transform info */ + + /* Retrieve info from API context */ + if(H5CX_get_data_transform(&data_transform) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data transform info") + + if(H5Z_xform_eval(data_transform, type_info->tconv_buf, smine_nelmts, type_info->mem_type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "Error performing data transform") + } /* end if */ /* * Scatter the data into memory. */ - if(H5D__scatter_mem(type_info->tconv_buf, mem_space, mem_iter, smine_nelmts, dxpl_cache, buf/*out*/) < 0) + if(H5D__scatter_mem(type_info->tconv_buf, mem_space, mem_iter, smine_nelmts, buf/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") } /* end else */ } /* end for */ @@ -582,7 +604,6 @@ herr_t H5D__scatgath_write(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) { - const H5D_dxpl_cache_t *dxpl_cache = io_info->dxpl_cache; /* Local pointer to dataset transfer info */ const void *buf = io_info->u.wbuf; /* Local pointer to application buffer */ H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info*/ hbool_t mem_iter_init = FALSE; /* Memory selection iteration info has been initialized */ @@ -639,7 +660,7 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_in * buffer. Also gather data from the file into the background buffer * if necessary. */ - n = H5D__gather_mem(buf, mem_space, mem_iter, smine_nelmts, dxpl_cache, type_info->tconv_buf/*out*/); + n = H5D__gather_mem(buf, mem_space, mem_iter, smine_nelmts, type_info->tconv_buf/*out*/); if(n != smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "mem gather failed") @@ -663,16 +684,23 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_in /* Do the data transform before the type conversion (since * transforms must be done in the memory type). */ - if(!type_info->is_xform_noop) - if(H5Z_xform_eval(dxpl_cache->data_xform_prop, type_info->tconv_buf, smine_nelmts, type_info->mem_type) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") + if(!type_info->is_xform_noop) { + H5Z_data_xform_t *data_transform; /* Data transform info */ + + /* Retrieve info from API context */ + if(H5CX_get_data_transform(&data_transform) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data transform info") + + if(H5Z_xform_eval(data_transform, type_info->tconv_buf, smine_nelmts, type_info->mem_type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "Error performing data transform") + } /* end if */ /* * Perform datatype conversion. */ if(H5T_convert(type_info->tpath, type_info->src_type_id, type_info->dst_type_id, smine_nelmts, (size_t)0, (size_t)0, type_info->tconv_buf, - type_info->bkg_buf, io_info->md_dxpl_id) < 0) + type_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") } /* end else */ @@ -735,8 +763,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__compound_opt_read(size_t nelmts, const H5S_t *space, - H5S_sel_iter_t *iter, const H5D_dxpl_cache_t *dxpl_cache, +H5D__compound_opt_read(size_t nelmts, const H5S_t *space, H5S_sel_iter_t *iter, const H5D_type_info_t *type_info, void *user_buf/*out*/) { uint8_t *ubuf = (uint8_t *)user_buf; /* Cast for pointer arithmetic */ @@ -744,6 +771,7 @@ H5D__compound_opt_read(size_t nelmts, const H5S_t *space, hsize_t *off = NULL; /* Pointer to sequence offsets */ size_t *len = NULL; /* Pointer to sequence lengths */ size_t src_stride, dst_stride, copy_size; + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ herr_t ret_value = SUCCEED; /* Return value */ @@ -753,16 +781,19 @@ H5D__compound_opt_read(size_t nelmts, const H5S_t *space, HDassert(nelmts > 0); HDassert(space); HDassert(iter); - HDassert(dxpl_cache); HDassert(type_info); HDassert(type_info->cmpd_subset); HDassert(H5T_SUBSET_SRC == type_info->cmpd_subset->subset || H5T_SUBSET_DST == type_info->cmpd_subset->subset); HDassert(user_buf); + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (len = H5FL_SEQ_MALLOC(size_t, vec_size))) @@ -924,8 +955,7 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, size_t type_size; /* Datatype element size */ hssize_t nelmts; /* Number of remaining elements in selection */ size_t nelmts_scatter = 0; /* Number of elements to scatter to dst_buf */ - 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 api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -940,10 +970,10 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") if(dst_buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided") - - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(H5AC_noio_dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Get datatype element size */ if(0 == (type_size = H5T_GET_SIZE(type))) @@ -982,7 +1012,7 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback returned more elements than in selection") /* Scatter data */ - if(H5D__scatter_mem(src_buf, dst_space, iter, nelmts_scatter, dxpl_cache, dst_buf) < 0) + if(H5D__scatter_mem(src_buf, dst_space, iter, nelmts_scatter, dst_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "scatter failed") nelmts -= (hssize_t)nelmts_scatter; @@ -994,6 +1024,8 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") if(iter) iter = H5FL_FREE(H5S_sel_iter_t, iter); +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dscatter() */ @@ -1027,8 +1059,7 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, hssize_t nelmts; /* Number of remaining elements in selection */ size_t dst_buf_nelmts; /* Number of elements that can fit in dst_buf */ size_t nelmts_gathered; /* Number of elements gathered from src_buf */ - 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 api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1046,10 +1077,10 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer size is 0") if(dst_buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided") - - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(H5AC_noio_dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Get datatype element size */ if(0 == (type_size = H5T_GET_SIZE(type))) @@ -1081,7 +1112,7 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, /* Loop until all data has been scattered */ while(nelmts > 0) { /* Gather data */ - if(0 == (nelmts_gathered = H5D__gather_mem(src_buf, src_space, iter, MIN(dst_buf_nelmts, (size_t)nelmts), dxpl_cache, dst_buf))) + if(0 == (nelmts_gathered = H5D__gather_mem(src_buf, src_space, iter, MIN(dst_buf_nelmts, (size_t)nelmts), dst_buf))) HGOTO_ERROR(H5E_IO, H5E_CANTCOPY, FAIL, "gather failed") HDassert(nelmts_gathered == MIN(dst_buf_nelmts, (size_t)nelmts)); @@ -1099,6 +1130,8 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") if(iter) iter = H5FL_FREE(H5S_sel_iter_t, iter); +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dgather() */ diff --git a/src/H5Dselect.c b/src/H5Dselect.c index b4d0515..0ec3423 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -28,6 +28,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -99,6 +100,7 @@ H5D__select_io(const H5D_io_info_t *io_info, size_t elmt_size, size_t curr_file_seq; /* Current file sequence to operate on */ size_t mem_nseq; /* Number of sequences generated in the file */ size_t file_nseq; /* Number of sequences generated in memory */ + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ ssize_t tmp_file_len; /* Temporary number of bytes in file sequence */ herr_t ret_value = SUCCEED; /* Return value */ @@ -109,12 +111,15 @@ H5D__select_io(const H5D_io_info_t *io_info, size_t elmt_size, HDassert(io_info); HDassert(io_info->dset); HDassert(io_info->store); - HDassert(TRUE == H5P_isa_class(io_info->raw_dxpl_id, H5P_DATASET_XFER)); HDassert(io_info->u.rbuf); + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(io_info->dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = io_info->dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (mem_len = H5FL_SEQ_MALLOC(size_t, vec_size))) diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index e999449..321d258 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -243,13 +243,11 @@ H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata idx_info->storage->u.single.filter_mask = udata->filter_mask; } /* end if */ - if(dset) { - if(dset->shared->dcpl_cache.fill.alloc_time != H5D_ALLOC_TIME_EARLY || idx_info->pline->nused > 0) { + if(dset) + if(dset->shared->dcpl_cache.fill.alloc_time != H5D_ALLOC_TIME_EARLY || idx_info->pline->nused > 0) /* Mark the layout dirty so that the address of the single chunk will be flushed later */ - if(H5D__mark(dset, idx_info->dxpl_id, H5D_MARK_LAYOUT) < 0) + if(H5D__mark(dset, H5D_MARK_LAYOUT) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark layout as dirty") - } /* end if */ - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -382,7 +380,7 @@ H5D__single_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t else nbytes = idx_info->layout->size; - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, idx_info->storage->idx_addr, nbytes) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->storage->idx_addr, nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, H5_ITER_ERROR, "unable to free dataset chunks") idx_info->storage->idx_addr = HADDR_UNDEF; @@ -461,14 +459,14 @@ H5D__single_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(idx_info_dst->storage); /* Set copied metadata tag */ - H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Set up information at the destination file */ if(H5D__single_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 3be2353..d62bac7 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -82,14 +82,13 @@ static herr_t H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t static herr_t H5D__virtual_write(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, H5D_chunk_map_t *fm); -static herr_t H5D__virtual_flush(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__virtual_flush(H5D_t *dset); /* Other functions */ static herr_t H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *virtual_ent, - H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id); -static herr_t H5D__virtual_reset_source_dset( - H5O_storage_virtual_ent_t *virtual_ent, + H5O_storage_virtual_srcdset_t *source_dset); +static herr_t H5D__virtual_reset_source_dset(H5O_storage_virtual_ent_t *virtual_ent, H5O_storage_virtual_srcdset_t *source_dset); static herr_t H5D__virtual_str_append(const char *src, size_t src_len, char **p, char **buf, size_t *buf_size); @@ -98,7 +97,7 @@ static herr_t H5D__virtual_copy_parsed_name( static herr_t H5D__virtual_build_source_name(char *source_name, const H5O_storage_virtual_name_seg_t *parsed_name, size_t static_strlen, size_t nsubs, hsize_t blockno, char **built_name); -static herr_t H5D__virtual_init_all(const H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__virtual_init_all(const H5D_t *dset); static herr_t H5D__virtual_pre_io(H5D_io_info_t *io_info, H5O_storage_virtual_t *storage, const H5S_t *file_space, const H5S_t *mem_space, hsize_t *tot_nelmts); @@ -390,6 +389,140 @@ done: /*------------------------------------------------------------------------- + * Function: H5D__virtual_store_layout + * + * Purpose: Store virtual dataset layout information, for new dataset + * + * Note: We assume here that the contents of the heap block cannot + * change! If this ever stops being the case we must change + * this code to allow overwrites of the heap block. -NAF + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * Sunday, Feberuary 11, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) +{ + uint8_t *heap_block = NULL; /* Block to add to heap */ + size_t *str_size = NULL; /* Array for VDS entry string lengths */ + uint8_t *heap_block_p; /* Pointer into the heap block, while encoding */ + size_t block_size; /* Total size of block needed */ + hsize_t tmp_nentries; /* Temp. variable for # of VDS entries */ + uint32_t chksum; /* Checksum for heap data */ + size_t i; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Sanity checking */ + HDassert(f); + HDassert(layout); + HDassert(layout->storage.u.virt.serial_list_hobjid.addr == HADDR_UNDEF); + + /* Create block if # of used entries > 0 */ + if(layout->storage.u.virt.list_nused > 0) { + /* Allocate array for caching results of strlen */ + if(NULL == (str_size = (size_t *)H5MM_malloc(2 * layout->storage.u.virt.list_nused * sizeof(size_t)))) + HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, FAIL, "unable to allocate string length array") + + /* + * Calculate heap block size + */ + + /* Version and number of entries */ + block_size = (size_t)1 + H5F_SIZEOF_SIZE(f); + + /* Calculate size of each entry */ + for(i = 0; i < layout->storage.u.virt.list_nused; i++) { + hssize_t select_serial_size; /* Size of serialized selection */ + + HDassert(layout->storage.u.virt.list[i].source_file_name); + HDassert(layout->storage.u.virt.list[i].source_dset_name); + HDassert(layout->storage.u.virt.list[i].source_select); + HDassert(layout->storage.u.virt.list[i].source_dset.virtual_select); + + /* Source file name */ + str_size[2 * i] = HDstrlen(layout->storage.u.virt.list[i].source_file_name) + (size_t)1; + block_size += str_size[2 * i]; + + /* Source dset name */ + str_size[(2 * i) + 1] = HDstrlen(layout->storage.u.virt.list[i].source_dset_name) + (size_t)1; + block_size += str_size[(2 * i) + 1]; + + /* Source selection */ + if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_select)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") + block_size += (size_t)select_serial_size; + + /* Virtual dataset selection */ + if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_dset.virtual_select)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") + block_size += (size_t)select_serial_size; + } /* end for */ + + /* Checksum */ + block_size += 4; + + + /* Allocate heap block */ + if(NULL == (heap_block = (uint8_t *)H5MM_malloc(block_size))) + HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, FAIL, "unable to allocate heap block") + + + /* + * Encode heap block + */ + heap_block_p = heap_block; + + /* Encode heap block encoding version */ + *heap_block_p++ = (uint8_t)H5O_LAYOUT_VDS_GH_ENC_VERS; + + /* Number of entries */ + tmp_nentries = (hsize_t)layout->storage.u.virt.list_nused; + H5F_ENCODE_LENGTH(f, heap_block_p, tmp_nentries) + + /* Encode each entry */ + for(i = 0; i < layout->storage.u.virt.list_nused; i++) { + /* Source file name */ + HDmemcpy((char *)heap_block_p, layout->storage.u.virt.list[i].source_file_name, str_size[2 * i]); + heap_block_p += str_size[2 * i]; + + /* Source dataset name */ + HDmemcpy((char *)heap_block_p, layout->storage.u.virt.list[i].source_dset_name, str_size[(2 * i) + 1]); + heap_block_p += str_size[(2 * i) + 1]; + + /* Source selection */ + if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_select, &heap_block_p) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize source selection") + + /* Virtual selection */ + if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_dset.virtual_select, &heap_block_p) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize virtual selection") + } /* end for */ + + /* Checksum */ + chksum = H5_checksum_metadata(heap_block, block_size - (size_t)4, 0); + UINT32ENCODE(heap_block_p, chksum) + + /* Insert block into global heap */ + if(H5HG_insert(f, block_size, heap_block, &(layout->storage.u.virt.serial_list_hobjid)) < 0) /* Casting away const OK --NAF */ + HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to insert virtual dataset heap block") + } /* end if */ + +done: + heap_block = (uint8_t *)H5MM_xfree(heap_block); + str_size = (size_t *)H5MM_xfree(str_size); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__virtual_store_layout() */ + + +/*------------------------------------------------------------------------- * Function: H5D__virtual_copy_layout * * Purpose: Deep copies virtual storage layout message in memory. @@ -650,35 +783,32 @@ H5D__virtual_reset_layout(H5O_layout_t *layout) *------------------------------------------------------------------------- */ herr_t -H5D__virtual_copy(H5F_t H5_ATTR_UNUSED *f_dst, H5O_layout_t *layout_dst, - hid_t H5_ATTR_UNUSED dxpl_id) +H5D__virtual_copy(H5F_t *f_dst, H5O_layout_t *layout_dst) { herr_t ret_value = SUCCEED; -#ifdef NOT_YET FUNC_ENTER_PACKAGE -#endif /* NOT_YET */ - FUNC_ENTER_PACKAGE_NOERR #ifdef NOT_YET /* Check for copy to the same file */ if(f_dst == f_src) { /* Increase reference count on global heap object */ - if((heap_rc = H5HG_link(f_dst, dxpl_id, (H5HG_t *)&(layout_dst->u.virt.serial_list_hobjid), 1)) < 0) + if((heap_rc = H5HG_link(f_dst, (H5HG_t *)&(layout_dst->u.virt.serial_list_hobjid), 1)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTMODIFY, FAIL, "unable to adjust global heap refence count") } /* end if */ else #endif /* NOT_YET */ { - /* Reset global heap id so a new heap object is created when the message - * is flushed */ + /* Reset global heap id */ layout_dst->storage.u.virt.serial_list_hobjid.addr = HADDR_UNDEF; layout_dst->storage.u.virt.serial_list_hobjid.idx = (size_t)0; + + /* Write the VDS data to destination file's heap */ + if(H5D__virtual_store_layout(f_dst, layout_dst) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to store VDS info") } /* end block/else */ -#ifdef NOT_YET done: -#endif /* NOT_YET */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_copy() */ @@ -696,7 +826,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__virtual_delete(H5F_t *f, hid_t dxpl_id, H5O_storage_t *storage) +H5D__virtual_delete(H5F_t *f, H5O_storage_t *storage) { #ifdef NOT_YET int heap_rc; /* Reference count of global heap object */ @@ -714,12 +844,12 @@ H5D__virtual_delete(H5F_t *f, hid_t dxpl_id, H5O_storage_t *storage) if(storage->u.virt.serial_list_hobjid.addr != HADDR_UNDEF) { #ifdef NOT_YET /* Unlink the global heap block */ - if((heap_rc = H5HG_link(f, dxpl_id, (H5HG_t *)&(storage->u.virt.serial_list_hobjid), -1)) < 0) + if((heap_rc = H5HG_link(f, (H5HG_t *)&(storage->u.virt.serial_list_hobjid), -1)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTMODIFY, FAIL, "unable to adjust global heap refence count") if(heap_rc == 0) #endif /* NOT_YET */ /* Delete the global heap block */ - if(H5HG_remove(f, dxpl_id, (H5HG_t *)&(storage->u.virt.serial_list_hobjid)) < 0) + if(H5HG_remove(f, (H5HG_t *)&(storage->u.virt.serial_list_hobjid)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to remove heap object") } /* end if */ @@ -747,7 +877,7 @@ done: static herr_t H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *virtual_ent, - H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id) + H5O_storage_virtual_srcdset_t *source_dset) { H5F_t *src_file = NULL; /* Source file */ hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */ @@ -766,7 +896,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { /* Open the source file */ - if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl))) H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ else src_file_open = TRUE; @@ -783,7 +913,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to get path for root group") /* Open the source dataset */ - if(NULL == (source_dset->dset = H5D__open_name(&src_root_loc, source_dset->dset_name, vdset->shared->layout.storage.u.virt.source_dapl, dxpl_id))) { + if(NULL == (source_dset->dset = H5D__open_name(&src_root_loc, source_dset->dset_name, vdset->shared->layout.storage.u.virt.source_dapl))) { H5E_clear_stack(NULL); /* Quick hack until proper support for H5Dopen with missing file is implemented */ /* Dataset does not exist */ @@ -1299,7 +1429,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) +H5D__virtual_set_extent_unlim(const H5D_t *dset) { H5O_storage_virtual_t *storage; hsize_t new_dims[H5S_MAX_RANK]; @@ -1335,7 +1465,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) /* Non-printf mapping */ /* Open source dataset */ if(!storage->list[i].source_dset.dset) - if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].source_dset, dxpl_id) < 0) + if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].source_dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") /* Check if source dataset is open */ @@ -1473,7 +1603,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) storage->list[i].sub_dset[j].clipped_virtual_select = storage->list[i].sub_dset[j].virtual_select; /* Open source dataset */ - if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].sub_dset[j], dxpl_id) < 0) + if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].sub_dset[j]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") if(storage->list[i].sub_dset[j].dset) { @@ -1560,7 +1690,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) /* Mark the space as dirty, for later writing to the file */ if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) - if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) + if(H5D__mark(dset, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ @@ -1727,7 +1857,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__virtual_init_all(const H5D_t *dset, hid_t dxpl_id) +H5D__virtual_init_all(const H5D_t *dset) { H5O_storage_virtual_t *storage; hsize_t virtual_dims[H5S_MAX_RANK]; @@ -1757,7 +1887,7 @@ H5D__virtual_init_all(const H5D_t *dset, hid_t dxpl_id) /* Non-printf mapping */ /* Open source dataset */ if(!storage->list[i].source_dset.dset) - if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].source_dset, dxpl_id) < 0) + if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].source_dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") /* Check if source dataset is open */ @@ -1949,8 +2079,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__virtual_init(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const H5D_t *dset, - hid_t dapl_id) +H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) { H5O_storage_virtual_t *storage; /* Convenience pointer */ H5P_genplist_t *dapl; /* Data access property list object pointer */ @@ -2100,7 +2229,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Initialize layout if necessary */ if(!storage->init) - if(H5D__virtual_init_all(io_info->dset, io_info->md_dxpl_id) < 0) + if(H5D__virtual_init_all(io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize virtual layout") /* Initialize tot_nelmts */ @@ -2158,7 +2287,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, * open the source dataset to patch it */ if(storage->list[i].source_space_status != H5O_VIRTUAL_STATUS_CORRECT) { HDassert(!storage->list[i].sub_dset[j].dset); - if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].sub_dset[j], io_info->md_dxpl_id) < 0) + if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].sub_dset[j]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") } /* end if */ @@ -2230,7 +2359,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Open source dataset */ if(!storage->list[i].sub_dset[j].dset) /* Try to open dataset */ - if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].sub_dset[j], io_info->md_dxpl_id) < 0) + if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].sub_dset[j]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") /* If the source dataset is not open, mark the selected @@ -2267,7 +2396,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Open source dataset */ if(!storage->list[i].source_dset.dset) /* Try to open dataset */ - if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset, io_info->md_dxpl_id) < 0) + if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") /* If the source dataset is not open, mark the selected elements @@ -2389,7 +2518,7 @@ H5D__virtual_read_one(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project virtual intersection onto source space") /* Perform read on source dataset */ - if(H5D__read(source_dset->dset, type_info->dst_type_id, source_dset->projected_mem_space, projected_src_space, io_info->raw_dxpl_id, io_info->u.rbuf) < 0) + if(H5D__read(source_dset->dset, type_info->dst_type_id, source_dset->projected_mem_space, projected_src_space, io_info->u.rbuf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read source dataset") /* Close projected_src_space */ @@ -2506,8 +2635,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "unable to clip fill selection") /* Write fill values to memory buffer */ - if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, - type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0) + if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, type_info->mem_type, fill_space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed") #ifndef NDEBUG @@ -2581,7 +2709,7 @@ H5D__virtual_write_one(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project virtual intersection onto source space") /* Perform write on source dataset */ - if(H5D__write(source_dset->dset, type_info->dst_type_id, source_dset->projected_mem_space, projected_src_space, io_info->raw_dxpl_id, io_info->u.wbuf) < 0) + if(H5D__write(source_dset->dset, type_info->dst_type_id, source_dset->projected_mem_space, projected_src_space, io_info->u.wbuf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write to source dataset") /* Close projected_src_space */ @@ -2692,7 +2820,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__virtual_flush(H5D_t *dset, hid_t dxpl_id) +H5D__virtual_flush(H5D_t *dset) { H5O_storage_virtual_t *storage; /* Convenient pointer into layout struct */ size_t i, j; /* Local index variables */ @@ -2713,13 +2841,13 @@ H5D__virtual_flush(H5D_t *dset, hid_t dxpl_id) for(j = 0; j < storage->list[i].sub_dset_nused; j++) if(storage->list[i].sub_dset[j].dset) /* Flush source dataset */ - if(H5D__flush_real(storage->list[i].sub_dset[j].dset, dxpl_id) < 0) + if(H5D__flush_real(storage->list[i].sub_dset[j].dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush source dataset") } /* end if */ else if(storage->list[i].source_dset.dset) /* Flush source dataset */ - if(H5D__flush_real(storage->list[i].source_dset.dset, dxpl_id) < 0) + if(H5D__flush_real(storage->list[i].source_dset.dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to flush source dataset") done: @@ -2794,12 +2922,10 @@ H5D__virtual_hold_source_dset_files(const H5D_t *dset, H5D_virtual_held_file_t * } /* end if */ done: - if(ret_value < 0) { + if(ret_value < 0) /* Release hold on files and delete list on error */ - if(*head) - if(H5D__virtual_release_source_dset_files(*head) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't release source datasets' files held open") - } /* end if */ + if(*head && H5D__virtual_release_source_dset_files(*head) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't release source datasets' files held open") FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_hold_source_dset_files() */ @@ -2818,7 +2944,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__virtual_refresh_source_dset(H5D_t **dset, hid_t dxpl_id) +H5D__virtual_refresh_source_dset(H5D_t **dset) { hid_t dset_id; /* Temporary dataset identifier */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2833,7 +2959,7 @@ H5D__virtual_refresh_source_dset(H5D_t **dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register source dataset ID") /* Refresh source dataset */ - if(H5D__refresh(dset_id, *dset, dxpl_id) < 0) + if(H5D__refresh(dset_id, *dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh source dataset") /* Discard the identifier & replace the dataset */ @@ -2858,7 +2984,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__virtual_refresh_source_dsets(H5D_t *dset, hid_t dxpl_id) +H5D__virtual_refresh_source_dsets(H5D_t *dset) { H5O_storage_virtual_t *storage; /* Convenient pointer into layout struct */ size_t i; /* Local index variable */ @@ -2883,14 +3009,14 @@ H5D__virtual_refresh_source_dsets(H5D_t *dset, hid_t dxpl_id) /* Check if sub-source dataset is open */ if(storage->list[i].sub_dset[j].dset) /* Refresh sub-source dataset */ - if(H5D__virtual_refresh_source_dset(&storage->list[i].sub_dset[j].dset, dxpl_id) < 0) + if(H5D__virtual_refresh_source_dset(&storage->list[i].sub_dset[j].dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh source dataset") } /* end if */ else /* Check if source dataset is open */ if(storage->list[i].source_dset.dset) /* Refresh source dataset */ - if(H5D__virtual_refresh_source_dset(&storage->list[i].source_dset.dset, dxpl_id) < 0) + if(H5D__virtual_refresh_source_dset(&storage->list[i].source_dset.dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh source dataset") done: diff --git a/src/H5EA.c b/src/H5EA.c index c524d49..9ceb144 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -59,8 +59,7 @@ /******************/ /* Typedef for generically unprotecting an object */ -typedef herr_t (*H5EA__unprotect_func_t)(void *thing, hid_t dxpl_id, - unsigned cache_flags); +typedef herr_t (*H5EA__unprotect_func_t)(void *thing, unsigned cache_flags); /********************/ @@ -73,11 +72,11 @@ typedef herr_t (*H5EA__unprotect_func_t)(void *thing, hid_t dxpl_id, /********************/ static herr_t -H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_extend, +H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned thing_acc, void **thing, uint8_t **thing_elmt_buf, hsize_t *thing_elmt_idx, H5EA__unprotect_func_t *thing_unprot_func); -static H5EA_t *H5EA__new(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, - hbool_t from_open, void *ctx_udata); +static H5EA_t *H5EA__new(H5F_t *f, haddr_t ea_addr, hbool_t from_open, + void *ctx_udata); /*********************/ @@ -131,7 +130,7 @@ H5FL_BLK_DEFINE(ea_native_elmt); */ BEGIN_FUNC(STATIC, ERR, H5EA_t *, NULL, NULL, -H5EA__new(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, hbool_t from_open, void *ctx_udata)) +H5EA__new(H5F_t *f, haddr_t ea_addr, hbool_t from_open, void *ctx_udata)) /* Local variables */ H5EA_t *ea = NULL; /* Pointer to new extensible array */ @@ -148,7 +147,7 @@ H5EA__new(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, hbool_t from_open, void *ctx H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array info") /* Lock the array header into memory */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5EA__hdr_protect(f, ea_addr, ctx_udata, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Check for pending array deletion */ @@ -172,10 +171,10 @@ H5EA__new(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, hbool_t from_open, void *ctx CATCH - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") if(!ret_value) - if(ea && H5EA_close(ea, dxpl_id) < 0) + if(ea && H5EA_close(ea) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close extensible array") END_FUNC(STATIC) /* end H5EA__new() */ @@ -197,7 +196,7 @@ END_FUNC(STATIC) /* end H5EA__new() */ */ BEGIN_FUNC(PRIV, ERR, H5EA_t *, NULL, NULL, -H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, void *ctx_udata)) +H5EA_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata)) /* Local variables */ H5EA_t *ea = NULL; /* Pointer to new extensible array */ @@ -213,11 +212,11 @@ H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, void *ctx_udat HDcompile_assert(H5EA_NUM_CLS_ID == NELMTS(H5EA_client_class_g)); /* Create extensible array header */ - if(HADDR_UNDEF == (ea_addr = H5EA__hdr_create(f, dxpl_id, cparam, ctx_udata))) + if(HADDR_UNDEF == (ea_addr = H5EA__hdr_create(f, cparam, ctx_udata))) H5E_THROW(H5E_CANTINIT, "can't create extensible array header") /* Allocate and initialize new extensible array wrapper */ - if(NULL == (ea = H5EA__new(f, dxpl_id, ea_addr, FALSE, ctx_udata))) + if(NULL == (ea = H5EA__new(f, ea_addr, FALSE, ctx_udata))) H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for extensible array wrapper") /* Set the return value */ @@ -226,7 +225,7 @@ H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, void *ctx_udat CATCH if(!ret_value) - if(ea && H5EA_close(ea, dxpl_id) < 0) + if(ea && H5EA_close(ea) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close extensible array") END_FUNC(PRIV) /* end H5EA_create() */ @@ -248,7 +247,7 @@ END_FUNC(PRIV) /* end H5EA_create() */ */ BEGIN_FUNC(PRIV, ERR, H5EA_t *, NULL, NULL, -H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) +H5EA_open(H5F_t *f, haddr_t ea_addr, void *ctx_udata)) /* Local variables */ H5EA_t *ea = NULL; /* Pointer to new extensible array wrapper */ @@ -260,7 +259,7 @@ H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) HDassert(H5F_addr_defined(ea_addr)); /* Allocate and initialize new extensible array wrapper */ - if(NULL == (ea = H5EA__new(f, dxpl_id, ea_addr, TRUE, ctx_udata))) + if(NULL == (ea = H5EA__new(f, ea_addr, TRUE, ctx_udata))) H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for extensible array wrapper") /* Set the return value */ @@ -269,7 +268,7 @@ H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) CATCH if(!ret_value) - if(ea && H5EA_close(ea, dxpl_id) < 0) + if(ea && H5EA_close(ea) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close extensible array") END_FUNC(PRIV) /* end H5EA_open() */ @@ -354,7 +353,7 @@ END_FUNC(PRIV) /* end H5EA_get_addr() */ */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_extend, +H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned thing_acc, void **thing, uint8_t **thing_elmt_buf, hsize_t *thing_elmt_idx, H5EA__unprotect_func_t *thing_unprot_func)) @@ -395,7 +394,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext /* Check if we are allowed to create the thing */ if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ /* Create the index block */ - hdr->idx_blk_addr = H5EA__iblock_create(hdr, dxpl_id, &stats_changed); + hdr->idx_blk_addr = H5EA__iblock_create(hdr, &stats_changed); if(!H5F_addr_defined(hdr->idx_blk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create index block") hdr_dirty = TRUE; @@ -405,7 +404,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext } /* end if */ /* Protect index block */ - if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, thing_acc))) + if(NULL == (iblock = H5EA__iblock_protect(hdr, thing_acc))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Check if element is in index block */ @@ -442,7 +441,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext /* Create data block */ dblk_off = hdr->sblk_info[sblk_idx].start_idx + (dblk_idx * hdr->sblk_info[sblk_idx].dblk_nelmts); - dblk_addr = H5EA__dblock_create(hdr, dxpl_id, iblock, &stats_changed, dblk_off, hdr->sblk_info[sblk_idx].dblk_nelmts); + dblk_addr = H5EA__dblock_create(hdr, iblock, &stats_changed, dblk_off, hdr->sblk_info[sblk_idx].dblk_nelmts); if(!H5F_addr_defined(dblk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create extensible array data block") @@ -455,7 +454,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext } /* end if */ /* Protect data block */ - if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, iblock, iblock->dblk_addrs[dblk_idx], hdr->sblk_info[sblk_idx].dblk_nelmts, thing_acc))) + if(NULL == (dblock = H5EA__dblock_protect(hdr, iblock, iblock->dblk_addrs[dblk_idx], hdr->sblk_info[sblk_idx].dblk_nelmts, thing_acc))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)iblock->dblk_addrs[dblk_idx]) /* Adjust index to offset in data block */ @@ -487,7 +486,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext haddr_t sblk_addr; /* Address of data block created */ /* Create super block */ - sblk_addr = H5EA__sblock_create(hdr, dxpl_id, iblock, &stats_changed, sblk_idx); + sblk_addr = H5EA__sblock_create(hdr, iblock, &stats_changed, sblk_idx); if(!H5F_addr_defined(sblk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create extensible array super block") @@ -500,7 +499,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext } /* end if */ /* Protect super block */ - if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, iblock, iblock->sblk_addrs[sblk_off], sblk_idx, thing_acc))) + if(NULL == (sblock = H5EA__sblock_protect(hdr, iblock, iblock->sblk_addrs[sblk_off], sblk_idx, thing_acc))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)iblock->sblk_addrs[sblk_off]) /* Compute the data block index in super block */ @@ -516,7 +515,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext /* Create data block */ dblk_off = hdr->sblk_info[sblk_idx].start_idx + (dblk_idx * hdr->sblk_info[sblk_idx].dblk_nelmts); - dblk_addr = H5EA__dblock_create(hdr, dxpl_id, sblock, &stats_changed, dblk_off, sblock->dblk_nelmts); + dblk_addr = H5EA__dblock_create(hdr, sblock, &stats_changed, dblk_off, sblock->dblk_nelmts); if(!H5F_addr_defined(dblk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create extensible array data block") @@ -563,7 +562,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext /* Check if we are allowed to create the thing */ if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ /* Create the data block page */ - if(H5EA__dblk_page_create(hdr, dxpl_id, sblock, dblk_page_addr) < 0) + if(H5EA__dblk_page_create(hdr, sblock, dblk_page_addr) < 0) H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in super block */ @@ -575,7 +574,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext } /* end if */ /* Protect data block page */ - if(NULL == (dblk_page = H5EA__dblk_page_protect(hdr, dxpl_id, sblock, dblk_page_addr, thing_acc))) + if(NULL == (dblk_page = H5EA__dblk_page_protect(hdr, sblock, dblk_page_addr, thing_acc))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Check if there is already a dependency on the header */ @@ -593,7 +592,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext } /* end if */ else { /* Protect data block */ - if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, sblock, sblock->dblk_addrs[dblk_idx], sblock->dblk_nelmts, thing_acc))) + if(NULL == (dblock = H5EA__dblock_protect(hdr, sblock, sblock->dblk_addrs[dblk_idx], sblock->dblk_nelmts, thing_acc))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)sblock->dblk_addrs[dblk_idx]) /* Check if there is already a dependency on the header */ @@ -635,14 +634,14 @@ CATCH H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark extensible array header as modified") /* Release resources */ - if(iblock && *thing != iblock && H5EA__iblock_unprotect(iblock, dxpl_id, iblock_cache_flags) < 0) + if(iblock && *thing != iblock && H5EA__iblock_unprotect(iblock, iblock_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block") /* (Note: super blocks don't contain elements, so don't have a '*thing != sblock' check) */ - if(sblock && H5EA__sblock_unprotect(sblock, dxpl_id, sblock_cache_flags) < 0) + if(sblock && H5EA__sblock_unprotect(sblock, sblock_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block") - if(dblock && *thing != dblock && H5EA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(dblock && *thing != dblock && H5EA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block") - if(dblk_page && *thing != dblk_page && H5EA__dblk_page_unprotect(dblk_page, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(dblk_page && *thing != dblk_page && H5EA__dblk_page_unprotect(dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block page") END_FUNC(STATIC) /* end H5EA__lookup_elmt() */ @@ -663,7 +662,7 @@ END_FUNC(STATIC) /* end H5EA__lookup_elmt() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_set(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, const void *elmt)) +H5EA_set(const H5EA_t *ea, hsize_t idx, const void *elmt)) /* Local variables */ H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ @@ -685,7 +684,7 @@ H5EA_set(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, const void *elmt)) /* Look up the array metadata containing the element we want to set */ will_extend = (idx >= hdr->stats.stored.max_idx_set); - if(H5EA__lookup_elmt(ea, dxpl_id, idx, will_extend, H5AC__NO_FLAGS_SET, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) + if(H5EA__lookup_elmt(ea, idx, will_extend, H5AC__NO_FLAGS_SET, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) H5E_THROW(H5E_CANTPROTECT, "unable to protect array metadata") /* Sanity check */ @@ -707,7 +706,7 @@ H5EA_set(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, const void *elmt)) CATCH /* Release resources */ - if(thing && (thing_unprot_func)(thing, dxpl_id, thing_cache_flags) < 0) + if(thing && (thing_unprot_func)(thing, thing_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array metadata") END_FUNC(PRIV) /* end H5EA_set() */ @@ -728,7 +727,7 @@ END_FUNC(PRIV) /* end H5EA_set() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_get(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, void *elmt)) +H5EA_get(const H5EA_t *ea, hsize_t idx, void *elmt)) /* Local variables */ H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ @@ -755,7 +754,7 @@ H5EA_get(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, void *elmt)) hdr->f = ea->f; /* Look up the array metadata containing the element we want to set */ - if(H5EA__lookup_elmt(ea, dxpl_id, idx, FALSE, H5AC__READ_ONLY_FLAG, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) + if(H5EA__lookup_elmt(ea, idx, FALSE, H5AC__READ_ONLY_FLAG, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) H5E_THROW(H5E_CANTPROTECT, "unable to protect array metadata") /* Check if the thing holding the element has been created yet */ @@ -771,7 +770,7 @@ H5EA_get(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, void *elmt)) CATCH /* Release thing */ - if(thing && (thing_unprot_func)(thing, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(thing && (thing_unprot_func)(thing, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array metadata") END_FUNC(PRIV) /* end H5EA_get() */ @@ -793,7 +792,7 @@ END_FUNC(PRIV) /* end H5EA_get() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_depend(H5EA_t *ea, hid_t dxpl_id, H5AC_proxy_entry_t *parent)) +H5EA_depend(H5EA_t *ea, H5AC_proxy_entry_t *parent)) /* Local variables */ H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ @@ -818,7 +817,7 @@ H5EA_depend(H5EA_t *ea, hid_t dxpl_id, H5AC_proxy_entry_t *parent)) hdr->f = ea->f; /* Add the extensible array as a child of the parent (proxy) */ - if(H5AC_proxy_entry_add_child(parent, hdr->f, dxpl_id, hdr->top_proxy) < 0) + if(H5AC_proxy_entry_add_child(parent, hdr->f, hdr->top_proxy) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array as child of proxy") hdr->parent = parent; } /* end if */ @@ -843,7 +842,7 @@ END_FUNC(PRIV) /* end H5EA_depend() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_close(H5EA_t *ea, hid_t dxpl_id)) +H5EA_close(H5EA_t *ea)) /* Local variables */ hbool_t pending_delete = FALSE; /* Whether the array is pending deletion */ @@ -894,7 +893,7 @@ H5EA_close(H5EA_t *ea, hid_t dxpl_id)) /* Lock the array header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ - if(NULL == (hdr = H5EA__hdr_protect(ea->f, dxpl_id, ea_addr, NULL, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5EA__hdr_protect(ea->f, ea_addr, NULL, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTLOAD, "unable to load extensible array header") /* Set the shared array header's file context for this operation */ @@ -908,7 +907,7 @@ H5EA_close(H5EA_t *ea, hid_t dxpl_id)) H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header") /* Delete array, starting with header (unprotects header) */ - if(H5EA__hdr_delete(hdr, dxpl_id) < 0) + if(H5EA__hdr_delete(hdr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array") } /* end if */ else { @@ -944,7 +943,7 @@ END_FUNC(PRIV) /* end H5EA_close() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) +H5EA_delete(H5F_t *f, haddr_t ea_addr, void *ctx_udata)) /* Local variables */ H5EA_hdr_t *hdr = NULL; /* The fractal heap header information */ @@ -956,7 +955,7 @@ H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) HDassert(H5F_addr_defined(ea_addr)); /* Lock the array header into memory */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5EA__hdr_protect(f, ea_addr, ctx_udata, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr) /* Check for files using shared array header */ @@ -967,7 +966,7 @@ H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) hdr->f = f; /* Delete array now, starting with header (unprotects header) */ - if(H5EA__hdr_delete(hdr, dxpl_id) < 0) + if(H5EA__hdr_delete(hdr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array") hdr = NULL; } /* end if */ @@ -975,7 +974,7 @@ H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) CATCH /* Unprotect the header, if an error occurred */ - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PRIV) /* end H5EA_delete() */ @@ -995,7 +994,7 @@ END_FUNC(PRIV) /* end H5EA_delete() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_iterate(H5EA_t *ea, hid_t dxpl_id, H5EA_operator_t op, void *udata)) +H5EA_iterate(H5EA_t *ea, H5EA_operator_t op, void *udata)) /* Local variables */ uint8_t *elmt = NULL; @@ -1017,7 +1016,7 @@ H5EA_iterate(H5EA_t *ea, hid_t dxpl_id, H5EA_operator_t op, void *udata)) int cb_ret; /* Return value from callback */ /* Get array element */ - if(H5EA_get(ea, dxpl_id, u, elmt) < 0) + if(H5EA_get(ea, u, elmt) < 0) H5E_THROW(H5E_CANTGET, "unable to delete fixed array") /* Make callback */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index def38af..8138991 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -110,7 +110,7 @@ static herr_t H5EA__cache_dblock_serialize(const H5F_t *f, void *image, size_t l void *thing); static herr_t H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *thing); static herr_t H5EA__cache_dblock_free_icr(void *thing); -static herr_t H5EA__cache_dblock_fsf_size(const void *thing, size_t *fsf_size); +static herr_t H5EA__cache_dblock_fsf_size(const void *thing, hsize_t *fsf_size); static herr_t H5EA__cache_dblk_page_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5EA__cache_dblk_page_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); @@ -1875,7 +1875,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_free_icr() */ */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5EA__cache_dblock_fsf_size(const void *_thing, size_t *fsf_size)) +H5EA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size)) /* Local variables */ const H5EA_dblock_t *dblock = (const H5EA_dblock_t *)_thing; /* Pointer to the object */ diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index e67a5a8..1a2b973 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -93,7 +93,7 @@ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t obj_addr)) /* Local variables */ @@ -110,14 +110,13 @@ H5EA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(cls); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context") - } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5EA__hdr_protect(f, addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Print opening message */ @@ -169,7 +168,7 @@ H5EA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__hdr_debug() */ @@ -190,7 +189,7 @@ END_FUNC(PKG) /* end H5EA__hdr_debug() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, +H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr)) /* Local variables */ @@ -209,21 +208,20 @@ H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *s HDassert(H5F_addr_defined(obj_addr)); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create extensible array debugging context") - } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Sanity check */ HDassert(H5F_addr_eq(hdr->idx_blk_addr, addr)); /* Protect index block */ - if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC__READ_ONLY_FLAG))) + if(NULL == (iblock = H5EA__iblock_protect(hdr, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Print opening message */ @@ -292,9 +290,9 @@ H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *s CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") - if(iblock && H5EA__iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(iblock && H5EA__iblock_unprotect(iblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block") - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__iblock_debug() */ @@ -315,7 +313,7 @@ END_FUNC(PKG) /* end H5EA__iblock_debug() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, unsigned sblk_idx, haddr_t obj_addr)) /* Local variables */ @@ -334,19 +332,18 @@ H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde HDassert(H5F_addr_defined(obj_addr)); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create extensible array debugging context") - } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Protect super block */ /* (Note: setting parent of super block to 'hdr' for this operation should be OK -QAK) */ - if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, (H5EA_iblock_t *)hdr, addr, sblk_idx, H5AC__READ_ONLY_FLAG))) + if(NULL == (sblock = H5EA__sblock_protect(hdr, (H5EA_iblock_t *)hdr, addr, sblk_idx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)addr) /* Print opening message */ @@ -384,9 +381,9 @@ H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") - if(sblock && H5EA__sblock_unprotect(sblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(sblock && H5EA__sblock_unprotect(sblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block") - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__sblock_debug() */ @@ -407,7 +404,7 @@ END_FUNC(PKG) /* end H5EA__sblock_debug() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, size_t dblk_nelmts, haddr_t obj_addr)) /* Local variables */ @@ -428,19 +425,18 @@ H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde HDassert(dblk_nelmts > 0); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create extensible array debugging context") - } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Protect data block */ /* (Note: setting parent of data block to 'hdr' for this operation should be OK -QAK) */ - if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, hdr, addr, dblk_nelmts, H5AC__READ_ONLY_FLAG))) + if(NULL == (dblock = H5EA__dblock_protect(hdr, hdr, addr, dblk_nelmts, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)addr) /* Print opening message */ @@ -467,9 +463,9 @@ H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") - if(dblock && H5EA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5EA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block") - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__dblock_debug() */ diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index 2b07356..6dd2e98 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -148,8 +148,7 @@ END_FUNC(PKG) /* end H5EA__dblk_page_alloc() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__dblk_page_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent, - haddr_t addr)) +H5EA__dblk_page_create(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t addr)) /* Local variables */ H5EA_dblk_page_t *dblk_page = NULL; /* Extensible array data block page */ @@ -171,13 +170,13 @@ H5EA__dblk_page_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent, H5E_THROW(H5E_CANTSET, "can't set extensible array data block page elements to class's fill value") /* Cache the new extensible array data block page */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add extensible array data block page to cache") inserted = TRUE; /* Add data block page as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblk_page) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") dblk_page->top_proxy = hdr->top_proxy; } /* end if */ @@ -214,7 +213,7 @@ END_FUNC(PKG) /* end H5EA__dblk_page_create() */ */ BEGIN_FUNC(PKG, ERR, H5EA_dblk_page_t *, NULL, NULL, -H5EA__dblk_page_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent, +H5EA__dblk_page_protect(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t dblk_page_addr, unsigned flags)) /* Local variables */ @@ -234,13 +233,13 @@ H5EA__dblk_page_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent, udata.dblk_page_addr = dblk_page_addr; /* Protect the data block page */ - if(NULL == (dblk_page = (H5EA_dblk_page_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, &udata, flags))) + if(NULL == (dblk_page = (H5EA_dblk_page_t *)H5AC_protect(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == dblk_page->top_proxy) { /* Add data block page as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblk_page) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") dblk_page->top_proxy = hdr->top_proxy; } /* end if */ @@ -252,7 +251,7 @@ CATCH /* Clean up on error */ if(!ret_value) { /* Release the data block page, if it was protected */ - if(dblk_page && H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) + if(dblk_page && H5AC_unprotect(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block page, address = %llu", (unsigned long long)dblk_page->addr) } /* end if */ @@ -275,8 +274,7 @@ END_FUNC(PKG) /* end H5EA__dblk_page_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, hid_t dxpl_id, - unsigned cache_flags)) +H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, unsigned cache_flags)) /* Local variables */ @@ -284,7 +282,7 @@ H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, hid_t dxpl_id, HDassert(dblk_page); /* Unprotect the data block page */ - if(H5AC_unprotect(dblk_page->hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0) + if(H5AC_unprotect(dblk_page->hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block page, address = %llu", (unsigned long long)dblk_page->addr) CATCH diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index 7df0ee9..d926fd5 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -160,8 +160,8 @@ END_FUNC(PKG) /* end H5EA__dblock_alloc() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5EA__dblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, - hbool_t *stats_changed, hsize_t dblk_off, size_t nelmts)) +H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, hbool_t *stats_changed, + hsize_t dblk_off, size_t nelmts)) /* Local variables */ H5EA_dblock_t *dblock = NULL; /* Extensible array data block */ @@ -184,7 +184,7 @@ H5EA__dblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, dblock->block_off = dblk_off; /* Allocate space for the data block on disk */ - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_DBLOCK, dxpl_id, (hsize_t)dblock->size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_DBLOCK, (hsize_t)dblock->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array data block") dblock->addr = dblock_addr; @@ -195,13 +195,13 @@ H5EA__dblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, H5E_THROW(H5E_CANTSET, "can't set extensible array data block elements to class's fill value") /* Cache the new extensible array data block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_EARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add extensible array data block to cache") inserted = TRUE; /* Add data block as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") dblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -228,7 +228,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array data block from cache") /* Release data block's disk space */ - if(H5F_addr_defined(dblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_DBLOCK, dxpl_id, dblock->addr, (hsize_t)dblock->size) < 0) + if(H5F_addr_defined(dblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_DBLOCK, dblock->addr, (hsize_t)dblock->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to release extensible array data block") /* Destroy data block */ @@ -292,8 +292,8 @@ END_FUNC(PKG) /* end H5EA__dblock_sblk_idx() */ */ BEGIN_FUNC(PKG, ERR, H5EA_dblock_t *, NULL, NULL, -H5EA__dblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, - haddr_t dblk_addr, size_t dblk_nelmts, unsigned flags)) +H5EA__dblock_protect(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, + size_t dblk_nelmts, unsigned flags)) /* Local variables */ H5EA_dblock_t *dblock; /* Extensible array data block */ @@ -314,13 +314,13 @@ H5EA__dblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, udata.dblk_addr = dblk_addr; /* Protect the data block */ - if(NULL == (dblock = (H5EA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblk_addr, &udata, flags))) + if(NULL == (dblock = (H5EA_dblock_t *)H5AC_protect(hdr->f, H5AC_EARRAY_DBLOCK, dblk_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)dblk_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == dblock->top_proxy) { /* Add data block as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") dblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -333,7 +333,7 @@ CATCH /* Clean up on error */ if(!ret_value) { /* Release the data block, if it was protected */ - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5AC_unprotect(hdr->f, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block, address = %llu", (unsigned long long)dblock->addr) } /* end if */ @@ -355,7 +355,7 @@ END_FUNC(PKG) /* end H5EA__dblock_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__dblock_unprotect(H5EA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flags)) +H5EA__dblock_unprotect(H5EA_dblock_t *dblock, unsigned cache_flags)) /* Local variables */ @@ -363,7 +363,7 @@ H5EA__dblock_unprotect(H5EA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flag HDassert(dblock); /* Unprotect the data block */ - if(H5AC_unprotect(dblock->hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0) + if(H5AC_unprotect(dblock->hdr->f, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block, address = %llu", (unsigned long long)dblock->addr) CATCH @@ -386,8 +386,8 @@ END_FUNC(PKG) /* end H5EA__dblock_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__dblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, - haddr_t dblk_addr, size_t dblk_nelmts)) +H5EA__dblock_delete(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, + size_t dblk_nelmts)) /* Local variables */ H5EA_dblock_t *dblock = NULL; /* Pointer to data block */ @@ -399,7 +399,7 @@ H5EA__dblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, HDassert(dblk_nelmts > 0); /* Protect data block */ - if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, parent, dblk_addr, dblk_nelmts, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5EA__dblock_protect(hdr, parent, dblk_addr, dblk_nelmts, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)dblk_addr) /* Check if this is a paged data block */ @@ -418,7 +418,7 @@ H5EA__dblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, for(u = 0; u < npages; u++) { /* Evict the data block page from the metadata cache */ /* (OK to call if it doesn't exist in the cache) */ - if(H5AC_expunge_entry(hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTEXPUNGE, "unable to remove array data block page from metadata cache") /* Advance to next page address */ @@ -428,7 +428,7 @@ H5EA__dblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, CATCH /* Finished deleting data block in metadata cache */ - if(dblock && H5EA__dblock_unprotect(dblock, dxpl_id, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(dblock && H5EA__dblock_unprotect(dblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block") END_FUNC(PKG) /* end H5EA__dblock_delete() */ diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 92d7c4d..62a23b8 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -355,8 +355,7 @@ END_FUNC(PKG) /* end H5EA__hdr_free_elmts() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, - void *ctx_udata)) +H5EA__hdr_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata)) /* Local variables */ H5EA_hdr_t *hdr = NULL; /* Extensible array header */ @@ -415,7 +414,7 @@ H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, H5E_THROW(H5E_CANTINIT, "initialization failed for extensible array header") /* Allocate space for the header on disk */ - if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_EARRAY_HDR, dxpl_id, (hsize_t)hdr->size))) + if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_EARRAY_HDR, (hsize_t)hdr->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array header") /* Create 'top' proxy for extensible array entries */ @@ -424,13 +423,13 @@ H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, H5E_THROW(H5E_CANTCREATE, "can't create extensible array entry proxy") /* Cache the new extensible array header */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_EARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_EARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add extensible array header to cache") inserted = TRUE; /* Add header as child of 'top' proxy */ if(hdr->top_proxy) - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") /* Set address of array header to return */ @@ -445,7 +444,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array header from cache") /* Release header's disk space */ - if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_EARRAY_HDR, dxpl_id, hdr->addr, (hsize_t)hdr->size) < 0) + if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_EARRAY_HDR, hdr->addr, (hsize_t)hdr->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to free extensible array header") /* Destroy header */ @@ -626,7 +625,7 @@ END_FUNC(PKG) /* end H5EA__hdr_modified() */ */ BEGIN_FUNC(PKG, ERR, H5EA_hdr_t *, NULL, NULL, -H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata, +H5EA__hdr_protect(H5F_t *f, haddr_t ea_addr, void *ctx_udata, unsigned flags)) /* Local variables */ @@ -646,7 +645,7 @@ H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata, udata.ctx_udata = ctx_udata; /* Protect the header */ - if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, &udata, flags))) + if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, H5AC_EARRAY_HDR, ea_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr) hdr->f = f; /* (Must be set again here, in case the header was already in the cache -QAK) */ @@ -657,7 +656,7 @@ H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata, H5E_THROW(H5E_CANTCREATE, "can't create extensible array entry proxy") /* Add header as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") } /* end if */ @@ -684,7 +683,7 @@ END_FUNC(PKG) /* end H5EA__hdr_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__hdr_unprotect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags)) +H5EA__hdr_unprotect(H5EA_hdr_t *hdr, unsigned cache_flags)) /* Local variables */ @@ -692,7 +691,7 @@ H5EA__hdr_unprotect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags)) HDassert(hdr); /* Unprotect the header */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_EARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array hdr, address = %llu", (unsigned long long)hdr->addr) CATCH @@ -715,7 +714,7 @@ END_FUNC(PKG) /* end H5EA__hdr_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id)) +H5EA__hdr_delete(H5EA_hdr_t *hdr)) /* Local variables */ unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting header */ @@ -741,7 +740,7 @@ H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id)) /* Check for index block */ if(H5F_addr_defined(hdr->idx_blk_addr)) { /* Delete index block */ - if(H5EA__iblock_delete(hdr, dxpl_id) < 0) + if(H5EA__iblock_delete(hdr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array index block") } /* end if */ @@ -751,7 +750,7 @@ H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id)) CATCH /* Unprotect the header, deleting it if an error hasn't occurred */ - if(H5EA__hdr_unprotect(hdr, dxpl_id, cache_flags) < 0) + if(H5EA__hdr_unprotect(hdr, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__hdr_delete() */ diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c index e25e3ef..1b5957a 100644 --- a/src/H5EAiblock.c +++ b/src/H5EAiblock.c @@ -176,7 +176,7 @@ END_FUNC(PKG) /* end H5EA__iblock_alloc() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5EA__iblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, hbool_t *stats_changed)) +H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed)) /* Local variables */ H5EA_iblock_t *iblock = NULL; /* Extensible array index block */ @@ -202,7 +202,7 @@ HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size); #endif /* QAK */ /* Allocate space for the index block on disk */ - if(HADDR_UNDEF == (iblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + if(HADDR_UNDEF == (iblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_IBLOCK, (hsize_t)iblock->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array index block") iblock->addr = iblock_addr; @@ -230,13 +230,13 @@ HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size); } /* end if */ /* Cache the new extensible array index block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, iblock_addr, iblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_EARRAY_IBLOCK, iblock_addr, iblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add extensible array index block to cache") inserted = TRUE; /* Add index block as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, iblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, iblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") iblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -265,7 +265,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array index block from cache") /* Release index block's disk space */ - if(H5F_addr_defined(iblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_IBLOCK, dxpl_id, iblock->addr, (hsize_t)iblock->size) < 0) + if(H5F_addr_defined(iblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_IBLOCK, iblock->addr, (hsize_t)iblock->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to release file space for extensible array index block") /* Destroy index block */ @@ -291,7 +291,7 @@ END_FUNC(PKG) /* end H5EA__iblock_create() */ */ BEGIN_FUNC(PKG, ERR, H5EA_iblock_t *, NULL, NULL, -H5EA__iblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned flags)) +H5EA__iblock_protect(H5EA_hdr_t *hdr, unsigned flags)) /* Local variables */ H5EA_iblock_t *iblock = NULL; /* Pointer to index block */ @@ -307,13 +307,13 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Protect the index block */ - if(NULL == (iblock = (H5EA_iblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, hdr->idx_blk_addr, hdr, flags))) + if(NULL == (iblock = (H5EA_iblock_t *)H5AC_protect(hdr->f, H5AC_EARRAY_IBLOCK, hdr->idx_blk_addr, hdr, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == iblock->top_proxy) { /* Add index block as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, iblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, iblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") iblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -325,7 +325,7 @@ CATCH /* Clean up on error */ if(!ret_value) { /* Release the index block, if it was protected */ - if(iblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, H5AC__NO_FLAGS_SET) < 0) + if(iblock && H5AC_unprotect(hdr->f, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array index block, address = %llu", (unsigned long long)iblock->addr) } /* end if */ @@ -347,7 +347,7 @@ END_FUNC(PKG) /* end H5EA__iblock_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__iblock_unprotect(H5EA_iblock_t *iblock, hid_t dxpl_id, unsigned cache_flags)) +H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags)) /* Local variables */ @@ -359,7 +359,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(iblock); /* Unprotect the index block */ - if(H5AC_unprotect(iblock->hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, cache_flags) < 0) + if(H5AC_unprotect(iblock->hdr->f, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array index block, address = %llu", (unsigned long long)iblock->addr) CATCH @@ -382,7 +382,7 @@ END_FUNC(PKG) /* end H5EA__iblock_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__iblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id)) +H5EA__iblock_delete(H5EA_hdr_t *hdr)) /* Local variables */ H5EA_iblock_t *iblock = NULL; /* Pointer to index block */ @@ -396,7 +396,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(H5F_addr_defined(hdr->idx_blk_addr)); /* Protect index block */ - if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC__NO_FLAGS_SET))) + if(NULL == (iblock = H5EA__iblock_protect(hdr, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Check for index block having data block pointers */ @@ -411,7 +411,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Check for data block existing */ if(H5F_addr_defined(iblock->dblk_addrs[u])) { /* Delete data block */ - if(H5EA__dblock_delete(hdr, dxpl_id, iblock, iblock->dblk_addrs[u], hdr->sblk_info[sblk_idx].dblk_nelmts) < 0) + if(H5EA__dblock_delete(hdr, iblock, iblock->dblk_addrs[u], hdr->sblk_info[sblk_idx].dblk_nelmts) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array data block") iblock->dblk_addrs[u] = HADDR_UNDEF; } /* end if */ @@ -436,7 +436,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Check for data block existing */ if(H5F_addr_defined(iblock->sblk_addrs[u])) { /* Delete super block */ - if(H5EA__sblock_delete(hdr, dxpl_id, iblock, iblock->sblk_addrs[u], (unsigned)(u + iblock->nsblks)) < 0) + if(H5EA__sblock_delete(hdr, iblock, iblock->sblk_addrs[u], (unsigned)(u + iblock->nsblks)) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array super block") iblock->sblk_addrs[u] = HADDR_UNDEF; } /* end if */ @@ -445,7 +445,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); CATCH /* Finished deleting index block in metadata cache */ - if(iblock && H5EA__iblock_unprotect(iblock, dxpl_id, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(iblock && H5EA__iblock_unprotect(iblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block") END_FUNC(PKG) /* end H5EA__iblock_delete() */ diff --git a/src/H5EApkg.h b/src/H5EApkg.h index e162fab..fb9afc0 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -396,7 +396,7 @@ H5_DLL herr_t H5EA__destroy_flush_depend(H5AC_info_t *parent_entry, /* Header routines */ H5_DLL H5EA_hdr_t *H5EA__hdr_alloc(H5F_t *f); H5_DLL herr_t H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata); -H5_DLL haddr_t H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, +H5_DLL haddr_t H5EA__hdr_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata); H5_DLL void *H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts); H5_DLL herr_t H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts); @@ -405,71 +405,65 @@ H5_DLL herr_t H5EA__hdr_decr(H5EA_hdr_t *hdr); H5_DLL herr_t H5EA__hdr_fuse_incr(H5EA_hdr_t *hdr); H5_DLL size_t H5EA__hdr_fuse_decr(H5EA_hdr_t *hdr); H5_DLL herr_t H5EA__hdr_modified(H5EA_hdr_t *hdr); -H5_DLL H5EA_hdr_t *H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, +H5_DLL H5EA_hdr_t *H5EA__hdr_protect(H5F_t *f, haddr_t ea_addr, void *ctx_udata, unsigned flags); -H5_DLL herr_t H5EA__hdr_unprotect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags); -H5_DLL herr_t H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id); +H5_DLL herr_t H5EA__hdr_unprotect(H5EA_hdr_t *hdr, unsigned cache_flags); +H5_DLL herr_t H5EA__hdr_delete(H5EA_hdr_t *hdr); H5_DLL herr_t H5EA__hdr_dest(H5EA_hdr_t *hdr); /* Index block routines */ H5_DLL H5EA_iblock_t *H5EA__iblock_alloc(H5EA_hdr_t *hdr); -H5_DLL haddr_t H5EA__iblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, - hbool_t *stats_changed); -H5_DLL H5EA_iblock_t *H5EA__iblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, - unsigned flags); -H5_DLL herr_t H5EA__iblock_unprotect(H5EA_iblock_t *iblock, hid_t dxpl_id, - unsigned cache_flags); -H5_DLL herr_t H5EA__iblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id); +H5_DLL haddr_t H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed); +H5_DLL H5EA_iblock_t *H5EA__iblock_protect(H5EA_hdr_t *hdr, unsigned flags); +H5_DLL herr_t H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags); +H5_DLL herr_t H5EA__iblock_delete(H5EA_hdr_t *hdr); H5_DLL herr_t H5EA__iblock_dest(H5EA_iblock_t *iblock); /* Super block routines */ H5_DLL H5EA_sblock_t *H5EA__sblock_alloc(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, unsigned sblk_idx); -H5_DLL haddr_t H5EA__sblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, - H5EA_iblock_t *parent, hbool_t *stats_changed, unsigned sblk_idx); -H5_DLL H5EA_sblock_t *H5EA__sblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, - H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx, - unsigned flags); -H5_DLL herr_t H5EA__sblock_unprotect(H5EA_sblock_t *sblock, hid_t dxpl_id, - unsigned cache_flags); -H5_DLL herr_t H5EA__sblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, - H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx); +H5_DLL haddr_t H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, + hbool_t *stats_changed, unsigned sblk_idx); +H5_DLL H5EA_sblock_t *H5EA__sblock_protect(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, + haddr_t sblk_addr, unsigned sblk_idx, unsigned flags); +H5_DLL herr_t H5EA__sblock_unprotect(H5EA_sblock_t *sblock, unsigned cache_flags); +H5_DLL herr_t H5EA__sblock_delete(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, + haddr_t sblk_addr, unsigned sblk_idx); H5_DLL herr_t H5EA__sblock_dest(H5EA_sblock_t *sblock); /* Data block routines */ H5_DLL H5EA_dblock_t *H5EA__dblock_alloc(H5EA_hdr_t *hdr, void *parent, size_t nelmts); -H5_DLL haddr_t H5EA__dblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, +H5_DLL haddr_t H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, hbool_t *stats_changed, hsize_t dblk_off, size_t nelmts); H5_DLL unsigned H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx); -H5_DLL H5EA_dblock_t *H5EA__dblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, - void *parent, haddr_t dblk_addr, size_t dblk_nelmts, unsigned flags); -H5_DLL herr_t H5EA__dblock_unprotect(H5EA_dblock_t *dblock, hid_t dxpl_id, - unsigned cache_flags); -H5_DLL herr_t H5EA__dblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, +H5_DLL H5EA_dblock_t *H5EA__dblock_protect(H5EA_hdr_t *hdr, void *parent, + haddr_t dblk_addr, size_t dblk_nelmts, unsigned flags); +H5_DLL herr_t H5EA__dblock_unprotect(H5EA_dblock_t *dblock, unsigned cache_flags); +H5_DLL herr_t H5EA__dblock_delete(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, size_t dblk_nelmts); H5_DLL herr_t H5EA__dblock_dest(H5EA_dblock_t *dblock); /* Data block page routines */ H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_alloc(H5EA_hdr_t *hdr, H5EA_sblock_t *parent); -H5_DLL herr_t H5EA__dblk_page_create(H5EA_hdr_t *hdr, hid_t dxpl_id, - H5EA_sblock_t *parent, haddr_t addr); -H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5EA__dblk_page_create(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, + haddr_t addr); +H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_protect(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t dblk_page_addr, unsigned flags); H5_DLL herr_t H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, - hid_t dxpl_id, unsigned cache_flags); + unsigned cache_flags); H5_DLL herr_t H5EA__dblk_page_dest(H5EA_dblk_page_t *dblk_page); /* Debugging routines for dumping file structures */ -H5_DLL herr_t H5EA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t obj_addr); -H5_DLL herr_t H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5EA__iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr); -H5_DLL herr_t H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, unsigned sblk_idx, haddr_t obj_addr); -H5_DLL herr_t H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, size_t dblk_nelmts, haddr_t obj_addr); diff --git a/src/H5EAprivate.h b/src/H5EAprivate.h index cda1d46..1195256 100644 --- a/src/H5EAprivate.h +++ b/src/H5EAprivate.h @@ -72,7 +72,7 @@ typedef struct H5EA_class_t { herr_t (*encode)(void *raw, const void *elmt, size_t nelmts, void *ctx); /* Encode elements from native form to disk storage form */ herr_t (*decode)(const void *raw, void *elmt, size_t nelmts, void *ctx); /* Decode elements from disk storage form to native form */ herr_t (*debug)(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); /* Print an element for debugging */ - void *(*crt_dbg_ctx)(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr); /* Create debugging context */ + void *(*crt_dbg_ctx)(H5F_t *f, haddr_t obj_addr); /* Create debugging context */ herr_t (*dst_dbg_ctx)(void *dbg_ctx); /* Destroy debugging context */ } H5EA_class_t; @@ -133,17 +133,17 @@ H5_DLLVAR const H5EA_class_t H5EA_CLS_FILT_CHUNK[1]; /***************************************/ /* General routines */ -H5_DLL H5EA_t *H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, +H5_DLL H5EA_t *H5EA_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata); -H5_DLL H5EA_t *H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata); +H5_DLL H5EA_t *H5EA_open(H5F_t *f, haddr_t ea_addr, void *ctx_udata); H5_DLL herr_t H5EA_get_nelmts(const H5EA_t *ea, hsize_t *nelmts); H5_DLL herr_t H5EA_get_addr(const H5EA_t *ea, haddr_t *addr); -H5_DLL herr_t H5EA_set(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, const void *elmt); -H5_DLL herr_t H5EA_get(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, void *elmt); -H5_DLL herr_t H5EA_depend(H5EA_t *ea, hid_t dxpl_id, H5AC_proxy_entry_t *parent); -H5_DLL herr_t H5EA_iterate(H5EA_t *fa, hid_t dxpl_id, H5EA_operator_t op, void *udata); -H5_DLL herr_t H5EA_close(H5EA_t *ea, hid_t dxpl_id); -H5_DLL herr_t H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata); +H5_DLL herr_t H5EA_set(const H5EA_t *ea, hsize_t idx, const void *elmt); +H5_DLL herr_t H5EA_get(const H5EA_t *ea, hsize_t idx, void *elmt); +H5_DLL herr_t H5EA_depend(H5EA_t *ea, H5AC_proxy_entry_t *parent); +H5_DLL herr_t H5EA_iterate(H5EA_t *fa, H5EA_operator_t op, void *udata); +H5_DLL herr_t H5EA_close(H5EA_t *ea); +H5_DLL herr_t H5EA_delete(H5F_t *f, haddr_t ea_addr, void *ctx_udata); H5_DLL herr_t H5EA_patch_file(H5EA_t *fa, H5F_t *f); /* Statistics routines */ diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index 4e291c0..b4671f8 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -186,8 +186,8 @@ END_FUNC(PKG) /* end H5EA__sblock_alloc() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5EA__sblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, - hbool_t *stats_changed, unsigned sblk_idx)) +H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, hbool_t *stats_changed, + unsigned sblk_idx)) /* Local variables */ H5EA_sblock_t *sblock = NULL; /* Extensible array super block */ @@ -210,7 +210,7 @@ H5EA__sblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, sblock->block_off = hdr->sblk_info[sblk_idx].start_idx; /* Allocate space for the super block on disk */ - if(HADDR_UNDEF == (sblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_SBLOCK, dxpl_id, (hsize_t)sblock->size))) + if(HADDR_UNDEF == (sblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_SBLOCK, (hsize_t)sblock->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array super block") sblock->addr = sblock_addr; @@ -218,13 +218,13 @@ H5EA__sblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, H5VM_array_fill(sblock->dblk_addrs, &tmp_addr, sizeof(haddr_t), sblock->ndblks); /* Cache the new extensible array super block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblock_addr, sblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_EARRAY_SBLOCK, sblock_addr, sblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add extensible array super block to cache") inserted = TRUE; /* Add super block as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, sblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, sblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") sblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -248,7 +248,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array super block from cache") /* Release super block's disk space */ - if(H5F_addr_defined(sblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_SBLOCK, dxpl_id, sblock->addr, (hsize_t)sblock->size) < 0) + if(H5F_addr_defined(sblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_SBLOCK, sblock->addr, (hsize_t)sblock->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to release extensible array super block") /* Destroy super block */ @@ -274,7 +274,7 @@ END_FUNC(PKG) /* end H5EA__sblock_create() */ */ BEGIN_FUNC(PKG, ERR, H5EA_sblock_t *, NULL, NULL, -H5EA__sblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, +H5EA__sblock_protect(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx, unsigned flags)) /* Local variables */ @@ -295,13 +295,13 @@ H5EA__sblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, udata.sblk_addr = sblk_addr; /* Protect the super block */ - if(NULL == (sblock = (H5EA_sblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblk_addr, &udata, flags))) + if(NULL == (sblock = (H5EA_sblock_t *)H5AC_protect(hdr->f, H5AC_EARRAY_SBLOCK, sblk_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)sblk_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == sblock->top_proxy) { /* Add super block as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, sblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, sblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") sblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -313,7 +313,7 @@ CATCH /* Clean up on error */ if(!ret_value) { /* Release the super block, if it was protected */ - if(sblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, H5AC__NO_FLAGS_SET) < 0) + if(sblock && H5AC_unprotect(hdr->f, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array super block, address = %llu", (unsigned long long)sblock->addr) } /* end if */ @@ -335,7 +335,7 @@ END_FUNC(PKG) /* end H5EA__sblock_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__sblock_unprotect(H5EA_sblock_t *sblock, hid_t dxpl_id, unsigned cache_flags)) +H5EA__sblock_unprotect(H5EA_sblock_t *sblock, unsigned cache_flags)) /* Local variables */ @@ -343,7 +343,7 @@ H5EA__sblock_unprotect(H5EA_sblock_t *sblock, hid_t dxpl_id, unsigned cache_flag HDassert(sblock); /* Unprotect the super block */ - if(H5AC_unprotect(sblock->hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, cache_flags) < 0) + if(H5AC_unprotect(sblock->hdr->f, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array super block, address = %llu", (unsigned long long)sblock->addr) CATCH @@ -366,7 +366,7 @@ END_FUNC(PKG) /* end H5EA__sblock_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__sblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, +H5EA__sblock_delete(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx)) /* Local variables */ @@ -378,7 +378,7 @@ H5EA__sblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, HDassert(H5F_addr_defined(sblk_addr)); /* Protect super block */ - if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, parent, sblk_addr, sblk_idx, H5AC__NO_FLAGS_SET))) + if(NULL == (sblock = H5EA__sblock_protect(hdr, parent, sblk_addr, sblk_idx, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)sblk_addr) /* Iterate over data blocks */ @@ -386,7 +386,7 @@ H5EA__sblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, /* Check for data block existing */ if(H5F_addr_defined(sblock->dblk_addrs[u])) { /* Delete data block */ - if(H5EA__dblock_delete(hdr, dxpl_id, sblock, sblock->dblk_addrs[u], sblock->dblk_nelmts) < 0) + if(H5EA__dblock_delete(hdr, sblock, sblock->dblk_addrs[u], sblock->dblk_nelmts) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array data block") sblock->dblk_addrs[u] = HADDR_UNDEF; } /* end if */ @@ -394,7 +394,7 @@ H5EA__sblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, CATCH /* Finished deleting super block in metadata cache */ - if(sblock && H5EA__sblock_unprotect(sblock, dxpl_id, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(sblock && H5EA__sblock_unprotect(sblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block") END_FUNC(PKG) /* end H5EA__sblock_delete() */ diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 422ea68..3da7996 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -76,7 +76,7 @@ static herr_t H5EA__test_fill(void *nat_blk, size_t nelmts); static herr_t H5EA__test_encode(void *raw, const void *elmt, size_t nelmts, void *ctx); static herr_t H5EA__test_decode(const void *raw, void *elmt, size_t nelmts, void *ctx); static herr_t H5EA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); -static void *H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED obj_addr); +static void *H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr); static herr_t H5EA__test_dst_dbg_context(void *_ctx); /*********************/ @@ -356,7 +356,7 @@ END_FUNC(STATIC) /* end H5EA__test_debug() */ */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, -H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED obj_addr)) +H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr)) /* Local variables */ H5EA__ctx_cb_t *ctx; /* Context for callbacks */ diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 57e7485..44a542e 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -72,8 +72,7 @@ typedef struct H5E_t H5E_t; * H5_END_TAG statements. Resets the metadata tag before leaving the function. */ #define HGOTO_ERROR_TAG(maj, min, ret_val, ...) { \ - if(H5AC_tag(my_dxpl_id, prv_tag, NULL) < 0) \ - HERROR(H5E_CACHE, H5E_CANTTAG, "unable to apply metadata tag"); \ + H5AC_tag(prv_tag, NULL); \ HCOMMON_ERROR(maj, min, __VA_ARGS__); \ HGOTO_DONE(ret_val) \ } @@ -90,9 +89,8 @@ typedef struct H5E_t H5E_t; * HGOTO_DONE_TAG macro, used like HGOTO_DONE between H5_BEGIN_TAG and * H5_END_TAG statements. Resets the metadata tag before leaving the function. */ -#define HGOTO_DONE_TAG(ret_val, err) { \ - if(H5AC_tag(my_dxpl_id, prv_tag, NULL) < 0) \ - HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ +#define HGOTO_DONE_TAG(ret_val) { \ + H5AC_tag(prv_tag, NULL); \ HGOTO_DONE(ret_val) \ } diff --git a/src/H5F.c b/src/H5F.c index f435502..414bb19 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -24,6 +24,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Aprivate.h" /* Attributes */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ @@ -33,7 +34,6 @@ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ -#include "H5SMprivate.h" /* Shared Object Header Messages */ #include "H5Tprivate.h" /* Datatypes */ @@ -79,7 +79,7 @@ static const H5I_class_t H5I_FILE_CLS[1] = {{ H5I_FILE, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5F_close /* Callback routine for closing objects of this class */ + (H5I_free_t)H5F__close_cb /* Callback routine for closing objects of this class */ }}; @@ -355,6 +355,7 @@ done: htri_t H5Fis_hdf5(const char *name) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -363,13 +364,19 @@ H5Fis_hdf5(const char *name) /* Check args and all the boring stuff. */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* call the private is_HDF5 function */ - if((ret_value = H5F__is_hdf5(name, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id)) < 0) + /* (Should not trigger raw data I/O - QAK, 2018/01/03) */ + if((ret_value = H5F__is_hdf5(name)) < 0) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable open file") done: - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fis_hdf5() */ @@ -401,36 +408,40 @@ hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { H5F_t *new_file = NULL; /* file struct for new file */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id;/* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE4("i", "*sIuii", filename, flags, fcpl_id, fapl_id); /* Check/fix arguments */ if (!filename || !*filename) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid file name") /* In this routine, we only accept the following flags: * H5F_ACC_EXCL, H5F_ACC_TRUNC and H5F_ACC_SWMR_WRITE */ if (flags & ~(H5F_ACC_EXCL | H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid flags") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid flags") /* The H5F_ACC_EXCL and H5F_ACC_TRUNC flags are mutually exclusive */ if ((flags & H5F_ACC_EXCL) && (flags & H5F_ACC_TRUNC)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mutually exclusive flags for file creation") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "mutually exclusive flags for file creation") /* Check file creation property list */ if (H5P_DEFAULT == fcpl_id) fcpl_id = H5P_FILE_CREATE_DEFAULT; else if (TRUE != H5P_isa_class(fcpl_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file create property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not file create property list") - /* Verify access property list and get correct dxpl */ - if (H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id, H5I_INVALID_HID, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Adjust bit flags by turning on the creation bit and making sure that * the EXCL or TRUNC bit is set. All newly-created files are opened for @@ -441,19 +452,21 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; /* Create a new file or truncate an existing file. */ - 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") + if (NULL == (new_file = H5F__create(filename, flags, fcpl_id, fapl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to create file") /* 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") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file") /* Keep this ID in file object structure */ 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 && H5F_try_close(new_file, NULL) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, H5I_INVALID_HID, "problems closing file") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fcreate() */ @@ -482,45 +495,51 @@ hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { H5F_t *new_file = NULL; /* file struct for new file */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "*sIui", filename, flags, fapl_id); /* Check/fix arguments. */ if(!filename || !*filename) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid file name") /* Reject undefined flags (~H5F_ACC_PUBLIC_FLAGS) and the H5F_ACC_TRUNC & H5F_ACC_EXCL flags */ if((flags & ~H5F_ACC_PUBLIC_FLAGS) || (flags & H5F_ACC_TRUNC) || (flags & H5F_ACC_EXCL)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file open flags") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid file open flags") /* Asking for SWMR write access on a read-only file is invalid */ if((flags & H5F_ACC_SWMR_WRITE) && 0 == (flags & H5F_ACC_RDWR)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "SWMR write access on a file open for read-only access is not allowed") + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "SWMR write access on a file open for read-only access is not allowed") /* Asking for SWMR read access on a non-read-only file is invalid */ if((flags & H5F_ACC_SWMR_READ) && (flags & H5F_ACC_RDWR)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "SWMR read access on a file open for read-write access is not allowed") + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "SWMR read access on a file open for read-write access is not allowed") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id, H5I_INVALID_HID, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the file */ - 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") + if(NULL == (new_file = H5F__open(filename, flags, H5P_FILE_CREATE_DEFAULT, fapl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file") /* 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") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle") /* Keep this ID in file object structure */ 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") + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, H5I_INVALID_HID, "problems closing file") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fopen() */ @@ -540,6 +559,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) { H5F_t *f = NULL; /* File to flush */ H5O_loc_t *oloc = NULL; /* Object location for ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -623,20 +643,24 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) * to be flushed. */ if(H5F_ACC_RDWR & H5F_INTENT(f)) { - /* Flush other files, depending on scope */ - if(H5F_SCOPE_GLOBAL == scope) { - /* Call the flush routine for mounted file hierarchies */ - if(H5F_flush_mounts(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") - } /* end if */ - else { - /* Call the flush routine, for this file */ - if(H5F__flush(f, 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") - } /* end else */ + hid_t fapl_id = H5P_DEFAULT; /* FAPL to use */ + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, object_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Flush the file */ + if(H5F__flush(f, scope) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fflush() */ @@ -658,39 +682,28 @@ done: herr_t H5Fclose(hid_t file_id) { - H5F_t *f = NULL; - int nref; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); - /* Check/fix arguments. */ - if (H5I_FILE != H5I_get_type(file_id)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file ID") + /* Check arguments */ + if(H5I_FILE != H5I_get_type(file_id)) + HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a file ID") - /* Flush file if this is the last reference to this id and we have write - * intent, unless it will be flushed by the "shared" file being closed. - * This is only necessary to replicate previous behaviour, and could be - * disabled by an option/property to improve performance. - */ - if (NULL == (f = (H5F_t *)H5I_object(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if ((f->shared->nrefs > 1) && (H5F_INTENT(f) & H5F_ACC_RDWR)) { - if ((nref = H5I_get_ref(file_id, FALSE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count") - if (nref == 1) - if (H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") - } - - /* Decrement reference count on atom. When it reaches zero the file will - * be closed. - */ - if (H5I_dec_app_ref(file_id) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEFILE, FAIL, "decrementing file ID failed") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Close the file */ + if(H5F__close(file_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "closing file ID failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fclose() */ @@ -739,7 +752,7 @@ H5Freopen(hid_t file_id) done: if(ret_value < 0 && new_file) - if(H5F__dest(new_file, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) + if(H5F__dest(new_file, FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") FUNC_LEAVE_API(ret_value) @@ -810,6 +823,7 @@ H5Fget_freespace(hid_t file_id) { H5F_t *file; /* File object for file ID */ hsize_t tot_space; /* Amount of free space in the file */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -819,13 +833,20 @@ H5Fget_freespace(hid_t file_id) if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - /* Go get the actual amount of free space in the file */ - if(H5MF_get_freespace(file, H5AC_ind_read_dxpl_id, &tot_space, NULL) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Get the free space in the file */ + if(H5F__get_freespace(file, &tot_space) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") ret_value = (hssize_t)tot_space; done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_freespace() */ @@ -915,6 +936,7 @@ ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) { H5F_t *file; /* File object for file ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -924,11 +946,19 @@ H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* call private get_file_image function */ - if((ret_value = H5F_get_file_image(file, buf_ptr, buf_len, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id)) < 0) + /* (Should not trigger raw data I/O - QAK, 2018/01/03) */ + if((ret_value = H5F__get_file_image(file, buf_ptr, buf_len)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file image") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Fget_file_image() */ @@ -1199,6 +1229,7 @@ herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) { H5F_t *f; /* Top file in mount hierarchy */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1226,28 +1257,18 @@ H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) } /* end else */ HDassert(f->shared); - /* Reset file info struct */ - HDmemset(finfo, 0, sizeof(*finfo)); - - /* Get the size of the superblock and any superblock extensions */ - if(H5F__super_size(f, H5AC_ind_read_dxpl_id, &finfo->super.super_size, &finfo->super.super_ext_size) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve superblock sizes") - - /* Get the size of any persistent free space */ - if(H5MF_get_freespace(f, H5AC_ind_read_dxpl_id, &finfo->free.tot_space, &finfo->free.meta_size) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve free space information") - - /* Check for SOHM info */ - if(H5F_addr_defined(f->shared->sohm_addr)) - if(H5SM_ih_size(f, H5AC_ind_read_dxpl_id, &finfo->sohm.hdr_size, &finfo->sohm.msgs_info) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve SOHM index & heap storage info") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; - /* Set version # fields */ - finfo->super.version = f->shared->sblock->super_vers; - finfo->sohm.version = f->shared->sohm_vers; - finfo->free.version = HDF5_FREESPACE_VERSION; + /* Get the file info */ + if(H5F__get_info(f, finfo) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_info2() */ @@ -1363,6 +1384,7 @@ H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/) { H5F_t *file; /* Top file in mount hierarchy */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1374,11 +1396,18 @@ H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, if(sect_info && nsects == 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "nsects must be > 0") - /* Go get the free-space section information in the file */ - if((ret_value = H5MF_get_free_sections(file, H5AC_ind_read_dxpl_id, type, nsects, sect_info)) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Get the free-space section information in the file */ + if((ret_value = H5F__get_free_sections(file, type, nsects, sect_info)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_free_sections() */ @@ -1397,8 +1426,9 @@ done: herr_t H5Fclear_elink_file_cache(hid_t file_id) { - H5F_t *file; /* File */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file; /* File */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); @@ -1407,12 +1437,21 @@ H5Fclear_elink_file_cache(hid_t file_id) if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - /* Release the EFC */ - if(file->shared->efc) - if(H5F_efc_release(file->shared->efc) < 0) + /* See if there's an EFC */ + if(file->shared->efc) { +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Release the EFC */ + if(H5F__efc_release(file->shared->efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") + } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fclear_elink_file_cache() */ @@ -1450,18 +1489,10 @@ done: herr_t H5Fstart_swmr_write(hid_t file_id) { + H5F_t *file; /* File info */ 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 */ - hid_t *obj_ids=NULL; /* List of ids */ - H5G_loc_t *obj_glocs=NULL; /* Group location of the object */ - H5O_loc_t *obj_olocs=NULL; /* Object location */ - H5G_name_t *obj_paths=NULL; /* Group hierarchy path */ - size_t u; /* Local index variable */ - hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ - H5F_io_info2_t fio_info; /* I/O info for operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1491,154 +1522,21 @@ 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, FAIL, "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") - - /* Get the # of opened named datatypes and attributes */ - if(H5F_get_obj_count(file, H5F_OBJ_DATATYPE|H5F_OBJ_ATTR, FALSE, &nt_attr_count) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") - if(nt_attr_count) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "named datatypes and/or attributes opened in the file") - - /* Get the # of opened datasets and groups */ - if(H5F_get_obj_count(file, H5F_OBJ_GROUP|H5F_OBJ_DATASET, FALSE, &grp_dset_count) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") - - if(grp_dset_count) { - /* Allocate space for group and object locations */ - if((obj_ids = (hid_t *) H5MM_malloc(grp_dset_count * sizeof(hid_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for hid_t") - if((obj_glocs = (H5G_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_loc_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_loc_t") - if((obj_olocs = (H5O_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5O_loc_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5O_loc_t") - if((obj_paths = (H5G_name_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_name_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_name_t") - - /* Get the list of opened object ids (groups & datasets) */ - if(H5F_get_obj_ids(file, H5F_OBJ_GROUP|H5F_OBJ_DATASET, grp_dset_count, obj_ids, FALSE, &grp_dset_count) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "H5F_get_obj_ids failed") - - /* Refresh opened objects (groups, datasets) in the file */ - for(u = 0; u < grp_dset_count; u++) { - H5O_loc_t *oloc; /* object location */ - H5G_loc_t tmp_loc; - - /* Set up the id's group location */ - obj_glocs[u].oloc = &obj_olocs[u]; - obj_glocs[u].path = &obj_paths[u]; - H5G_loc_reset(&obj_glocs[u]); - - /* get the id's object location */ - if((oloc = H5O_get_loc(obj_ids[u])) == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") - - /* Make deep local copy of object's location information */ - H5G_loc(obj_ids[u], &tmp_loc); - H5G_loc_copy(&obj_glocs[u], &tmp_loc, H5_COPY_DEEP); - - /* Close the object */ - if(H5I_dec_ref(obj_ids[u]) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEOBJ, FAIL, "decrementing object ID failed") - } /* end for */ - } /* end if */ - - /* Set up I/O info for operation */ - fio_info.f = file; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(file_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Flush and reset the accumulator */ - if(H5F__accum_reset(&fio_info, TRUE) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") - - /* Turn on SWMR write in shared file open flags */ - file->shared->flags |= H5F_ACC_SWMR_WRITE; - - /* Mark the file in SWMR writing mode */ - file->shared->sblock->status_flags |= H5F_SUPER_SWMR_WRITE_ACCESS; - - /* Set up metadata read attempts */ - file->shared->read_attempts = H5F_SWMR_METADATA_READ_ATTEMPTS; - - /* Initialize "retries" and "retries_nbins" */ - if(H5F_set_retries(file) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") - - /* Turn off usage of accumulator */ - file->shared->feature_flags &= ~(unsigned)H5FD_FEAT_ACCUMULATE_METADATA; - if(H5FD_set_feature_flags(file->shared->lf, file->shared->feature_flags) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") - - setup = TRUE; - - /* Mark superblock as dirty */ - if(H5F_super_dirty(file) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") - - /* Flush the superblock */ - if(H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") - - /* Evict all flushed entries in the cache except the pinned superblock */ - if(H5F__evict_cache_entries(file, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to evict file's cached information") - - /* Refresh (reopen) the objects (groups & datasets) in the file */ - for(u = 0; u < grp_dset_count; u++) - if(H5O_refresh_metadata_reopen(obj_ids[u], &obj_glocs[u], H5AC_ind_read_dxpl_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't refresh-close object") - - /* Unlock the file */ - if(H5FD_unlock(file->shared->lf) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to unlock the file") + /* Call the internal routine */ + if(H5F__start_swmr_write(file) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "unable to convert file format") done: - if(ret_value < 0 && setup) { - HDassert(file); - - /* Re-enable accumulator */ - file->shared->feature_flags |= (unsigned)H5FD_FEAT_ACCUMULATE_METADATA; - if(H5FD_set_feature_flags(file->shared->lf, file->shared->feature_flags) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") - - /* Reset the # of read attempts */ - file->shared->read_attempts = H5F_METADATA_READ_ATTEMPTS; - if(H5F_set_retries(file) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") - - /* Un-set H5F_ACC_SWMR_WRITE in shared open flags */ - file->shared->flags &= ~H5F_ACC_SWMR_WRITE; - - /* Unmark the file: not in SWMR writing mode */ - file->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_SWMR_WRITE_ACCESS); - - /* Mark superblock as dirty */ - if(H5F_super_dirty(file) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") - - /* Flush the superblock */ - if(H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG, H5AC_ind_read_dxpl_id) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") - } /* end if */ - - /* Free memory */ - if(obj_ids) - H5MM_xfree(obj_ids); - if(obj_glocs) - H5MM_xfree(obj_glocs); - if(obj_olocs) - H5MM_xfree(obj_olocs); - if(obj_paths) - H5MM_xfree(obj_paths); - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fstart_swmr_write() */ @@ -1752,6 +1650,7 @@ H5Fset_latest_format(hid_t file_id, hbool_t latest_format) { H5F_t *f; /* File */ unsigned latest_flags; /* Latest format flags for file */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1764,8 +1663,18 @@ H5Fset_latest_format(hid_t file_id, hbool_t latest_format) /* 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)) { + hid_t fapl_id = H5P_DEFAULT; /* FAPL to use */ + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, file_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Call the flush routine, for this file */ - if(H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) + if(H5F__flush_real(f, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") /* Toggle the 'latest format' flag */ @@ -1773,12 +1682,14 @@ H5Fset_latest_format(hid_t file_id, hbool_t latest_format) } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fset_latest_format() */ /*------------------------------------------------------------------------- - * Function: H5Fformat_convert_super (Internal) + * Function: H5Fformat_convert * * Purpose: Downgrade the superblock version to v2 and * downgrade persistent file space to non-persistent @@ -1790,59 +1701,35 @@ done: herr_t H5Fformat_convert(hid_t fid) { - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *f; /* File to flush */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", fid); - if(H5I_FILE == H5I_get_type(fid)) { - H5F_t *f; /* File to flush */ - hbool_t mark_dirty = FALSE; - - /* Get file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") + if(H5I_FILE != H5I_get_type(fid)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - /* Check if the superblock should be downgraded */ - if(f->shared->sblock->super_vers > HDF5_SUPERBLOCK_VERSION_V18_LATEST) { - f->shared->sblock->super_vers = HDF5_SUPERBLOCK_VERSION_V18_LATEST; - mark_dirty = TRUE; - } /* end if */ + /* Get file object */ + if(NULL == (f = (H5F_t *)H5I_object(fid))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* Check for persistent freespace manager, which needs to be downgraded */ - if(!(f->shared->fs_strategy == H5F_FILE_SPACE_STRATEGY_DEF && - f->shared->fs_persist == H5F_FREE_SPACE_PERSIST_DEF && - f->shared->fs_threshold == H5F_FREE_SPACE_THRESHOLD_DEF && - f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) { - /* Check to remove free-space manager info message from superblock extension */ - if(H5F_addr_defined(f->shared->sblock->ext_addr)) - if(H5F_super_ext_remove_msg(f, H5AC_ind_read_dxpl_id, H5O_FSINFO_ID) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") - - /* Close freespace manager */ - if(H5MF_try_close(f, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to free free-space address") - - /* Set non-persistent freespace manager */ - f->shared->fs_strategy = H5F_FILE_SPACE_STRATEGY_DEF; - f->shared->fs_persist = H5F_FREE_SPACE_PERSIST_DEF; - f->shared->fs_threshold = H5F_FREE_SPACE_THRESHOLD_DEF; - f->shared->fs_page_size = H5F_FILE_SPACE_PAGE_SIZE_DEF; - - /* Indicate that the superblock should be marked dirty */ - mark_dirty = TRUE; - } /* end if */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(fid, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Check if we should mark the superblock dirty */ - if(mark_dirty) - /* Mark superblock as dirty */ - if(H5F_super_dirty(f) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") - } /* end if */ - else - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + /* Call the internal routine */ + if(H5F__format_convert(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "unable to convert file format") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fformat_convert() */ diff --git a/src/H5FA.c b/src/H5FA.c index d421eec..61aaa53 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -62,8 +62,8 @@ /********************/ /* Local Prototypes */ /********************/ -static H5FA_t *H5FA__new(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, - hbool_t from_open, void *ctx_udata); +static H5FA_t *H5FA__new(H5F_t *f, haddr_t fa_addr, hbool_t from_open, + void *ctx_udata); /*********************/ @@ -118,7 +118,7 @@ H5FL_BLK_DEFINE(fa_native_elmt); */ BEGIN_FUNC(STATIC, ERR, H5FA_t *, NULL, NULL, -H5FA__new(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, hbool_t from_open, void *ctx_udata)) +H5FA__new(H5F_t *f, haddr_t fa_addr, hbool_t from_open, void *ctx_udata)) /* Local variables */ H5FA_t *fa = NULL; /* Pointer to new fixed array */ @@ -135,7 +135,7 @@ H5FA__new(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, hbool_t from_open, void *ctx H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array info") /* Lock the array header into memory */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5FA__hdr_protect(f, fa_addr, ctx_udata, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Check for pending array deletion */ @@ -159,10 +159,10 @@ H5FA__new(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, hbool_t from_open, void *ctx CATCH - if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") if(!ret_value) - if(fa && H5FA_close(fa, dxpl_id) < 0) + if(fa && H5FA_close(fa) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close fixed array") END_FUNC(STATIC) /* end H5FA__new() */ @@ -183,7 +183,7 @@ END_FUNC(STATIC) /* end H5FA__new() */ */ BEGIN_FUNC(PRIV, ERR, H5FA_t *, NULL, NULL, -H5FA_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, void *ctx_udata)) +H5FA_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata)) /* Local variables */ H5FA_t *fa = NULL; /* Pointer to new fixed array */ @@ -199,11 +199,11 @@ H5FA_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, void *ctx_udat HDcompile_assert(H5FA_NUM_CLS_ID == NELMTS(H5FA_client_class_g)); /* Create fixed array header */ - if(HADDR_UNDEF == (fa_addr = H5FA__hdr_create(f, dxpl_id, cparam, ctx_udata))) + if(HADDR_UNDEF == (fa_addr = H5FA__hdr_create(f, cparam, ctx_udata))) H5E_THROW(H5E_CANTINIT, "can't create fixed array header") /* Allocate and initialize new fixed array wrapper */ - if(NULL == (fa = H5FA__new(f, dxpl_id, fa_addr, FALSE, ctx_udata))) + if(NULL == (fa = H5FA__new(f, fa_addr, FALSE, ctx_udata))) H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for fixed array wrapper") /* Set the return value */ @@ -212,7 +212,7 @@ H5FA_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, void *ctx_udat CATCH if(!ret_value) - if(fa && H5FA_close(fa, dxpl_id) < 0) + if(fa && H5FA_close(fa) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close fixed array") END_FUNC(PRIV) /* end H5FA_create() */ @@ -233,7 +233,7 @@ END_FUNC(PRIV) /* end H5FA_create() */ */ BEGIN_FUNC(PRIV, ERR, H5FA_t *, NULL, NULL, -H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) +H5FA_open(H5F_t *f, haddr_t fa_addr, void *ctx_udata)) /* Local variables */ H5FA_t *fa = NULL; /* Pointer to new fixed array wrapper */ @@ -245,7 +245,7 @@ H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) HDassert(H5F_addr_defined(fa_addr)); /* Allocate and initialize new fixed array wrapper */ - if(NULL == (fa = H5FA__new(f, dxpl_id, fa_addr, TRUE, ctx_udata))) + if(NULL == (fa = H5FA__new(f, fa_addr, TRUE, ctx_udata))) H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for fixed array wrapper") /* Set the return value */ @@ -254,7 +254,7 @@ H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) CATCH if(!ret_value) - if(fa && H5FA_close(fa, dxpl_id) < 0) + if(fa && H5FA_close(fa) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close fixed array") END_FUNC(PRIV) /* end H5FA_open() */ @@ -335,7 +335,7 @@ END_FUNC(PRIV) /* end H5FA_get_addr() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt)) +H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt)) /* Local variables */ H5FA_hdr_t *hdr = fa->hdr; /* Header for fixed array */ @@ -357,7 +357,7 @@ H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt)) /* Check if we need to create the fixed array data block */ if(!H5F_addr_defined(hdr->dblk_addr)) { /* Create the data block */ - hdr->dblk_addr = H5FA__dblock_create(hdr, dxpl_id, &hdr_dirty); + hdr->dblk_addr = H5FA__dblock_create(hdr, &hdr_dirty); if(!H5F_addr_defined(hdr->dblk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create fixed array data block") } /* end if */ @@ -365,7 +365,7 @@ H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt)) HDassert(idx < hdr->cparam.nelmts); /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, hdr->dblk_addr, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr) /* Check for paging data block */ @@ -397,7 +397,7 @@ H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt)) /* Check if the page has been created yet */ if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { /* Create the data block page */ - if(H5FA__dblk_page_create(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts) < 0) + if(H5FA__dblk_page_create(hdr, dblk_page_addr, dblk_page_nelmts) < 0) H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in data block */ @@ -406,7 +406,7 @@ H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt)) } /* end if */ /* Protect the data block page */ - if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC__NO_FLAGS_SET))) + if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dblk_page_addr, dblk_page_nelmts, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Set the element in the data block page */ @@ -421,9 +421,9 @@ CATCH H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark fixed array header as modified") /* Release resources */ - if(dblock && H5FA__dblock_unprotect(dblock, dxpl_id, dblock_cache_flags) < 0) + if(dblock && H5FA__dblock_unprotect(dblock, dblock_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block") - if(dblk_page && H5FA__dblk_page_unprotect(dblk_page, dxpl_id, dblk_page_cache_flags) < 0) + if(dblk_page && H5FA__dblk_page_unprotect(dblk_page, dblk_page_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block page") END_FUNC(PRIV) /* end H5FA_set() */ @@ -443,7 +443,7 @@ END_FUNC(PRIV) /* end H5FA_set() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_get(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, void *elmt)) +H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt)) /* Local variables */ H5FA_hdr_t *hdr = fa->hdr; /* Header for FA */ @@ -468,7 +468,7 @@ H5FA_get(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, void *elmt)) else { /* Get the data block */ HDassert(H5F_addr_defined(hdr->dblk_addr)); - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, hdr->dblk_addr, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr) /* Check for paged data block */ @@ -508,7 +508,7 @@ H5FA_get(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, void *elmt)) dblk_page_nelmts = dblock->dblk_page_nelmts; /* Protect the data block page */ - if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC__READ_ONLY_FLAG))) + if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dblk_page_addr, dblk_page_nelmts, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Retrieve element from data block */ @@ -518,9 +518,9 @@ H5FA_get(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, void *elmt)) } /* end else */ CATCH - if(dblock && H5FA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5FA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block") - if(dblk_page && H5FA__dblk_page_unprotect(dblk_page, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(dblk_page && H5FA__dblk_page_unprotect(dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block page") END_FUNC(PRIV) /* end H5FA_get() */ @@ -540,7 +540,7 @@ END_FUNC(PRIV) /* end H5FA_get() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_close(H5FA_t *fa, hid_t dxpl_id)) +H5FA_close(H5FA_t *fa)) /* Local variables */ hbool_t pending_delete = FALSE; /* Whether the array is pending deletion */ @@ -591,7 +591,7 @@ H5FA_close(H5FA_t *fa, hid_t dxpl_id)) /* Lock the array header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ - if(NULL == (hdr = H5FA__hdr_protect(fa->f, dxpl_id, fa_addr, NULL, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5FA__hdr_protect(fa->f, fa_addr, NULL, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTLOAD, "unable to load fixed array header") /* Set the shared array header's file context for this operation */ @@ -605,7 +605,7 @@ H5FA_close(H5FA_t *fa, hid_t dxpl_id)) H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header") /* Delete array, starting with header (unprotects header) */ - if(H5FA__hdr_delete(hdr, dxpl_id) < 0) + if(H5FA__hdr_delete(hdr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array") } /* end if */ else { @@ -640,7 +640,7 @@ END_FUNC(PRIV) /* end H5FA_close() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) +H5FA_delete(H5F_t *f, haddr_t fa_addr, void *ctx_udata)) /* Local variables */ H5FA_hdr_t *hdr = NULL; /* The fixed array header information */ @@ -652,7 +652,7 @@ H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) HDassert(H5F_addr_defined(fa_addr)); /* Lock the array header into memory */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5FA__hdr_protect(f, fa_addr, ctx_udata, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr) /* Check for files using shared array header */ @@ -663,7 +663,7 @@ H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) hdr->f = f; /* Delete array now, starting with header (unprotects header) */ - if(H5FA__hdr_delete(hdr, dxpl_id) < 0) + if(H5FA__hdr_delete(hdr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array") hdr = NULL; } /* end if */ @@ -671,7 +671,7 @@ H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) CATCH /* Unprotect the header, if an error occurred */ - if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PRIV) /* end H5FA_delete() */ @@ -694,7 +694,7 @@ END_FUNC(PRIV) /* end H5FA_delete() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_iterate(H5FA_t *fa, hid_t dxpl_id, H5FA_operator_t op, void *udata)) +H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata)) /* Local variables */ uint8_t *elmt = NULL; @@ -716,7 +716,7 @@ H5FA_iterate(H5FA_t *fa, hid_t dxpl_id, H5FA_operator_t op, void *udata)) int cb_ret; /* Return value from callback */ /* Get array element */ - if(H5FA_get(fa, dxpl_id, u, elmt) < 0) + if(H5FA_get(fa, u, elmt) < 0) H5E_THROW(H5E_CANTGET, "unable to delete fixed array") /* Make callback */ @@ -749,7 +749,7 @@ END_FUNC(PRIV) /* end H5FA_iterate() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_depend(H5FA_t *fa, hid_t dxpl_id, H5AC_proxy_entry_t *parent)) +H5FA_depend(H5FA_t *fa, H5AC_proxy_entry_t *parent)) /* Local variables */ H5FA_hdr_t *hdr = fa->hdr; /* Header for FA */ @@ -774,7 +774,7 @@ H5FA_depend(H5FA_t *fa, hid_t dxpl_id, H5AC_proxy_entry_t *parent)) hdr->f = fa->f; /* Add the fixed array as a child of the parent (proxy) */ - if(H5AC_proxy_entry_add_child(parent, hdr->f, dxpl_id, hdr->top_proxy) < 0) + if(H5AC_proxy_entry_add_child(parent, hdr->f, hdr->top_proxy) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array as child of proxy") hdr->parent = parent; } /* end if */ diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 19fdb74..1f199e9 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -88,7 +88,7 @@ static herr_t H5FA__cache_dblock_serialize(const H5F_t *f, void *image, size_t l void *thing); static herr_t H5FA__cache_dblock_notify(H5AC_notify_action_t action, void *thing); static herr_t H5FA__cache_dblock_free_icr(void *thing); -static herr_t H5FA__cache_dblock_fsf_size(const void *thing, size_t *fsf_size); +static herr_t H5FA__cache_dblock_fsf_size(const void *thing, hsize_t *fsf_size); static herr_t H5FA__cache_dblk_page_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5FA__cache_dblk_page_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); @@ -975,7 +975,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_free_icr() */ */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5FA__cache_dblock_fsf_size(const void *_thing, size_t *fsf_size)) +H5FA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size)) const H5FA_dblock_t *dblock = (const H5FA_dblock_t *)_thing; /* Pointer to the object */ diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index 7444eae..b578cf2 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -91,7 +91,7 @@ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5FA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5FA_class_t *cls, haddr_t obj_addr)) /* Local variables */ @@ -108,14 +108,13 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(cls); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context") - } /* end if */ /* Load the fixed array header */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5FA__hdr_protect(f, addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Print opening message */ @@ -148,7 +147,7 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context") - if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PKG) /* end H5FA__hdr_debug() */ @@ -169,7 +168,7 @@ END_FUNC(PKG) /* end H5FA__hdr_debug() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5FA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr)) /* Local variables */ @@ -189,18 +188,17 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde HDassert(H5F_addr_defined(obj_addr)); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context") - } /* end if */ /* Load the fixed array header */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5FA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, addr, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)addr) /* Print opening message */ @@ -244,7 +242,7 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde if(((page_idx + 1) == dblock->npages) && (nelmts_left = hdr->cparam.nelmts % dblock->dblk_page_nelmts)) dblk_page_nelmts = (size_t)nelmts_left; - if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC__READ_ONLY_FLAG))) + if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dblk_page_addr, dblk_page_nelmts, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) HDfprintf(stream, "%*sElements in page %Zu:\n", indent, "", page_idx); @@ -253,7 +251,7 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde if((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u, ((uint8_t *)dblk_page->elmts) + (hdr->cparam.cls->nat_elmt_size * u)) < 0) H5E_THROW(H5E_CANTGET, "can't get element for debugging") } /* end for */ - if(H5FA__dblk_page_unprotect(dblk_page, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(H5FA__dblk_page_unprotect(dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block page") /* Advance to next page address */ @@ -274,9 +272,9 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context") - if(dblock && H5FA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5FA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block") - if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PKG) /* end H5FA__dblock_debug() */ diff --git a/src/H5FAdblkpage.c b/src/H5FAdblkpage.c index baf4286..effdeb2 100644 --- a/src/H5FAdblkpage.c +++ b/src/H5FAdblkpage.c @@ -147,7 +147,7 @@ END_FUNC(PKG) /* end H5FA__dblk_page_alloc() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__dblk_page_create(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, size_t nelmts)) +H5FA__dblk_page_create(H5FA_hdr_t *hdr, haddr_t addr, size_t nelmts)) /* Local variables */ H5FA_dblk_page_t *dblk_page = NULL; /* Fixed array data block page */ @@ -176,13 +176,13 @@ HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", FUNC, dblk_page->size); H5E_THROW(H5E_CANTSET, "can't set fixed array data block page elements to class's fill value") /* Cache the new fixed array data block page */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add fixed array data block page to cache") inserted = TRUE; /* Add data block page as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblk_page) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") dblk_page->top_proxy = hdr->top_proxy; } /* end if */ @@ -218,7 +218,7 @@ END_FUNC(PKG) /* end H5FA__dblk_page_create() */ */ BEGIN_FUNC(PKG, ERR, H5FA_dblk_page_t *, NULL, NULL, -H5FA__dblk_page_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_page_addr, +H5FA__dblk_page_protect(H5FA_hdr_t *hdr, haddr_t dblk_page_addr, size_t dblk_page_nelmts, unsigned flags)) /* Local variables */ @@ -242,13 +242,13 @@ HDfprintf(stderr, "%s: Called\n", FUNC); udata.dblk_page_addr = dblk_page_addr; /* Protect the data block page */ - if(NULL == (dblk_page = (H5FA_dblk_page_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, &udata, flags))) + if(NULL == (dblk_page = (H5FA_dblk_page_t *)H5AC_protect(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == dblk_page->top_proxy) { /* Add data block page as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblk_page) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") dblk_page->top_proxy = hdr->top_proxy; } /* end if */ @@ -261,7 +261,7 @@ CATCH /* Clean up on error */ if(!ret_value) { /* Release the data block page, if it was protected */ - if(dblk_page && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) + if(dblk_page && H5AC_unprotect(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block page, address = %llu", (unsigned long long)dblk_page->addr) } /* end if */ @@ -283,8 +283,7 @@ END_FUNC(PKG) /* end H5FA__dblk_page_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, hid_t dxpl_id, - unsigned cache_flags)) +H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, unsigned cache_flags)) /* Local variables */ @@ -296,7 +295,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(dblk_page); /* Unprotect the data block page */ - if(H5AC_unprotect(dblk_page->hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0) + if(H5AC_unprotect(dblk_page->hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block page, address = %llu", (unsigned long long)dblk_page->addr) CATCH diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c index 432bf58..a6a8ced 100644 --- a/src/H5FAdblock.c +++ b/src/H5FAdblock.c @@ -184,7 +184,7 @@ END_FUNC(PKG) /* end H5FA__dblock_alloc() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty)) +H5FA__dblock_create(H5FA_hdr_t *hdr, hbool_t *hdr_dirty)) /* Local variables */ H5FA_dblock_t *dblock = NULL; /* Fixed array data block */ @@ -203,7 +203,7 @@ H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty)) hdr->stats.dblk_size = dblock->size = H5FA_DBLOCK_SIZE(dblock); /* Allocate space for the data block on disk */ - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_FARRAY_DBLOCK, dxpl_id, (hsize_t)dblock->size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_FARRAY_DBLOCK, (hsize_t)dblock->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for fixed array data block") dblock->addr = dblock_addr; @@ -214,13 +214,13 @@ H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty)) H5E_THROW(H5E_CANTSET, "can't set fixed array data block elements to class's fill value") /* Cache the new fixed array data block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_FARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add fixed array data block to cache") inserted = TRUE; /* Add data block as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") dblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -241,7 +241,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove fixed array data block from cache") /* Release data block's disk space */ - if(H5F_addr_defined(dblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_FARRAY_DBLOCK, dxpl_id, dblock->addr, (hsize_t)dblock->size) < 0) + if(H5F_addr_defined(dblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_FARRAY_DBLOCK, dblock->addr, (hsize_t)dblock->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to release fixed array data block") /* Destroy data block */ @@ -266,8 +266,7 @@ END_FUNC(PKG) /* end H5FA__dblock_create() */ */ BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL, -H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr, - unsigned flags)) +H5FA__dblock_protect(H5FA_hdr_t *hdr, haddr_t dblk_addr, unsigned flags)) /* Local variables */ H5FA_dblock_t *dblock; /* Fixed array data block */ @@ -285,13 +284,13 @@ H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr, udata.dblk_addr = dblk_addr; /* Protect the data block */ - if(NULL == (dblock = (H5FA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblk_addr, &udata, flags))) + if(NULL == (dblock = (H5FA_dblock_t *)H5AC_protect(hdr->f, H5AC_FARRAY_DBLOCK, dblk_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)dblk_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == dblock->top_proxy) { /* Add data block as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") dblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -304,7 +303,7 @@ CATCH /* Clean up on error */ if(!ret_value) /* Release the data block, if it was protected */ - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblock->addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5AC_unprotect(hdr->f, H5AC_FARRAY_DBLOCK, dblock->addr, dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block, address = %llu", (unsigned long long)dblock->addr) END_FUNC(PKG) /* end H5FA__dblock_protect() */ @@ -324,7 +323,7 @@ END_FUNC(PKG) /* end H5FA__dblock_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__dblock_unprotect(H5FA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flags)) +H5FA__dblock_unprotect(H5FA_dblock_t *dblock, unsigned cache_flags)) /* Local variables */ @@ -332,7 +331,7 @@ H5FA__dblock_unprotect(H5FA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flag HDassert(dblock); /* Unprotect the data block */ - if(H5AC_unprotect(dblock->hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0) + if(H5AC_unprotect(dblock->hdr->f, H5AC_FARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block, address = %llu", (unsigned long long)dblock->addr) CATCH @@ -354,7 +353,7 @@ END_FUNC(PKG) /* end H5FA__dblock_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr)) +H5FA__dblock_delete(H5FA_hdr_t *hdr, haddr_t dblk_addr)) /* Local variables */ H5FA_dblock_t *dblock = NULL; /* Pointer to data block */ @@ -364,7 +363,7 @@ H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr)) HDassert(H5F_addr_defined(dblk_addr)); /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, dblk_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dblk_addr, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)dblk_addr) /* Check if data block is paged */ @@ -379,7 +378,7 @@ H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr)) for(u = 0; u < dblock->npages; u++) { /* Evict the data block page from the metadata cache */ /* (OK to call if it doesn't exist in the cache) */ - if(H5AC_expunge_entry(hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTEXPUNGE, "unable to remove array data block page from metadata cache") /* Advance to next page address */ @@ -390,7 +389,7 @@ H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr)) CATCH /* Finished deleting data block in metadata cache */ - if(dblock && H5FA__dblock_unprotect(dblock, dxpl_id, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(dblock && H5FA__dblock_unprotect(dblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block") END_FUNC(PKG) /* end H5FA__dblock_delete() */ diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 6809f02..2e3db0b 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -178,8 +178,7 @@ END_FUNC(PKG) /* end H5FA__hdr_init() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5FA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, - void *ctx_udata)) +H5FA__hdr_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata)) /* Local variables */ H5FA_hdr_t *hdr = NULL; /* Fixed array header */ @@ -215,7 +214,7 @@ H5FA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, H5E_THROW(H5E_CANTINIT, "initialization failed for fixed array header") /* Allocate space for the header on disk */ - if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_FARRAY_HDR, dxpl_id, (hsize_t)hdr->size))) + if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_FARRAY_HDR, (hsize_t)hdr->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for Fixed Array header") /* Create 'top' proxy for extensible array entries */ @@ -224,13 +223,13 @@ H5FA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, H5E_THROW(H5E_CANTCREATE, "can't create fixed array entry proxy") /* Cache the new Fixed Array header */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_FARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add fixed array header to cache") inserted = TRUE; /* Add header as child of 'top' proxy */ if(hdr->top_proxy) - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") /* Set address of array header to return */ @@ -246,7 +245,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove fixed array header from cache") /* Release header's disk space */ - if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_FARRAY_HDR, dxpl_id, hdr->addr, (hsize_t)hdr->size) < 0) + if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_FARRAY_HDR, hdr->addr, (hsize_t)hdr->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to free Fixed Array header") /* Destroy header */ @@ -421,8 +420,7 @@ END_FUNC(PKG) /* end H5FA__hdr_modified() */ */ BEGIN_FUNC(PKG, ERR, H5FA_hdr_t *, NULL, NULL, -H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata, - unsigned flags)) +H5FA__hdr_protect(H5F_t *f, haddr_t fa_addr, void *ctx_udata, unsigned flags)) /* Local variables */ H5FA_hdr_t *hdr; /* Fixed array header */ @@ -441,7 +439,7 @@ H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata, udata.ctx_udata = ctx_udata; /* Protect the header */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, &udata, flags))) + if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, H5AC_FARRAY_HDR, fa_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr) hdr->f = f; /* (Must be set again here, in case the header was already in the cache -QAK) */ @@ -452,7 +450,7 @@ H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata, H5E_THROW(H5E_CANTCREATE, "can't create fixed array entry proxy") /* Add header as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") } /* end if */ @@ -479,7 +477,7 @@ END_FUNC(PKG) /* end H5FA__hdr_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags)) +H5FA__hdr_unprotect(H5FA_hdr_t *hdr, unsigned cache_flags)) /* Local variables */ @@ -487,7 +485,7 @@ H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags)) HDassert(hdr); /* Unprotect the header */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array hdr, address = %llu", (unsigned long long)hdr->addr) CATCH @@ -509,7 +507,7 @@ END_FUNC(PKG) /* end H5EA__hdr_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id)) +H5FA__hdr_delete(H5FA_hdr_t *hdr)) /* Local variables */ unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting header */ @@ -535,7 +533,7 @@ H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id)) /* Check for Fixed Array Data block */ if(H5F_addr_defined(hdr->dblk_addr)) { /* Delete Fixed Array Data block */ - if(H5FA__dblock_delete(hdr, dxpl_id, hdr->dblk_addr) < 0) + if(H5FA__dblock_delete(hdr, hdr->dblk_addr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array data block") } /* end if */ @@ -545,7 +543,7 @@ H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id)) CATCH /* Unprotect the header, deleting it if an error hasn't occurred */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PKG) /* end H5FA__hdr_delete() */ diff --git a/src/H5FApkg.h b/src/H5FApkg.h index 6f0a43a..720c046 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -267,7 +267,7 @@ H5_DLL herr_t H5FA__destroy_flush_depend(H5AC_info_t *parent_entry, /* Header routines */ H5_DLL H5FA_hdr_t *H5FA__hdr_alloc(H5F_t *f); H5_DLL herr_t H5FA__hdr_init(H5FA_hdr_t *hdr, void *ctx_udata); -H5_DLL haddr_t H5FA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, void *ctx_udata); +H5_DLL haddr_t H5FA__hdr_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata); H5_DLL void *H5FA__hdr_alloc_elmts(H5FA_hdr_t *hdr, size_t nelmts); H5_DLL herr_t H5FA__hdr_free_elmts(H5FA_hdr_t *hdr, size_t nelmts, void *elmts); H5_DLL herr_t H5FA__hdr_incr(H5FA_hdr_t *hdr); @@ -275,40 +275,35 @@ H5_DLL herr_t H5FA__hdr_decr(H5FA_hdr_t *hdr); H5_DLL herr_t H5FA__hdr_fuse_incr(H5FA_hdr_t *hdr); H5_DLL size_t H5FA__hdr_fuse_decr(H5FA_hdr_t *hdr); H5_DLL herr_t H5FA__hdr_modified(H5FA_hdr_t *hdr); -H5_DLL H5FA_hdr_t *H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, - void *ctx_udata, unsigned flags); -H5_DLL herr_t H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags); -H5_DLL herr_t H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id); +H5_DLL H5FA_hdr_t *H5FA__hdr_protect(H5F_t *f, haddr_t fa_addr, void *ctx_udata, + unsigned flags); +H5_DLL herr_t H5FA__hdr_unprotect(H5FA_hdr_t *hdr, unsigned cache_flags); +H5_DLL herr_t H5FA__hdr_delete(H5FA_hdr_t *hdr); H5_DLL herr_t H5FA__hdr_dest(H5FA_hdr_t *hdr); /* Data block routines */ H5_DLL H5FA_dblock_t *H5FA__dblock_alloc(H5FA_hdr_t *hdr); -H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty); +H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, hbool_t *hdr_dirty); H5_DLL unsigned H5FA__dblock_sblk_idx(const H5FA_hdr_t *hdr, hsize_t idx); -H5_DLL H5FA_dblock_t *H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblk_addr, unsigned flags); -H5_DLL herr_t H5FA__dblock_unprotect(H5FA_dblock_t *dblock, hid_t dxpl_id, - unsigned cache_flags); -H5_DLL herr_t H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblk_addr); +H5_DLL H5FA_dblock_t *H5FA__dblock_protect(H5FA_hdr_t *hdr, haddr_t dblk_addr, + unsigned flags); +H5_DLL herr_t H5FA__dblock_unprotect(H5FA_dblock_t *dblock, unsigned cache_flags); +H5_DLL herr_t H5FA__dblock_delete(H5FA_hdr_t *hdr, haddr_t dblk_addr); H5_DLL herr_t H5FA__dblock_dest(H5FA_dblock_t *dblock); /* Data block page routines */ -H5_DLL herr_t H5FA__dblk_page_create(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t addr, size_t nelmts); +H5_DLL herr_t H5FA__dblk_page_create(H5FA_hdr_t *hdr, haddr_t addr, size_t nelmts); H5_DLL H5FA_dblk_page_t *H5FA__dblk_page_alloc(H5FA_hdr_t *hdr, size_t nelmts); -H5_DLL H5FA_dblk_page_t *H5FA__dblk_page_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblk_page_addr, size_t dblk_page_nelmts, unsigned flags); -H5_DLL herr_t H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, - hid_t dxpl_id, unsigned cache_flags); +H5_DLL H5FA_dblk_page_t *H5FA__dblk_page_protect(H5FA_hdr_t *hdr, haddr_t dblk_page_addr, + size_t dblk_page_nelmts, unsigned flags); +H5_DLL herr_t H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, unsigned cache_flags); H5_DLL herr_t H5FA__dblk_page_dest(H5FA_dblk_page_t *dblk_page); /* Debugging routines for dumping file structures */ -H5_DLL herr_t H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, const H5FA_class_t *cls, haddr_t obj_addr); -H5_DLL herr_t H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, const H5FA_class_t *cls, - haddr_t hdr_addr, haddr_t obj_addr); +H5_DLL herr_t H5FA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, const H5FA_class_t *cls, haddr_t obj_addr); +H5_DLL herr_t H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, + int indent, int fwidth, const H5FA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr); /* Testing routines */ #ifdef H5FA_TESTING diff --git a/src/H5FAprivate.h b/src/H5FAprivate.h index 1e44126..98a9af4 100644 --- a/src/H5FAprivate.h +++ b/src/H5FAprivate.h @@ -70,7 +70,7 @@ typedef struct H5FA_class_t { herr_t (*encode)(void *raw, const void *elmt, size_t nelmts, void *ctx); /* Encode elements from native form to disk storage form */ herr_t (*decode)(const void *raw, void *elmt, size_t nelmts, void *ctx); /* Decode elements from disk storage form to native form */ herr_t (*debug)(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); /* Print an element for debugging */ - void *(*crt_dbg_ctx)(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr); /* Create debugging context */ + void *(*crt_dbg_ctx)(H5F_t *f, haddr_t obj_addr); /* Create debugging context */ herr_t (*dst_dbg_ctx)(void *dbg_ctx); /* Destroy debugging context */ } H5FA_class_t; @@ -118,17 +118,17 @@ H5_DLLVAR const H5FA_class_t H5FA_CLS_FILT_CHUNK[1]; /***************************************/ /* General routines */ -H5_DLL H5FA_t *H5FA_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, +H5_DLL H5FA_t *H5FA_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata); -H5_DLL H5FA_t *H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata); +H5_DLL H5FA_t *H5FA_open(H5F_t *f, haddr_t fa_addr, void *ctx_udata); H5_DLL herr_t H5FA_get_nelmts(const H5FA_t *fa, hsize_t *nelmts); H5_DLL herr_t H5FA_get_addr(const H5FA_t *fa, haddr_t *addr); -H5_DLL herr_t H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt); -H5_DLL herr_t H5FA_get(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, void *elmt); -H5_DLL herr_t H5FA_depend(H5FA_t *fa, hid_t dxpl_id, H5AC_proxy_entry_t *parent); -H5_DLL herr_t H5FA_iterate(H5FA_t *fa, hid_t dxpl_id, H5FA_operator_t op, void *udata); -H5_DLL herr_t H5FA_close(H5FA_t *fa, hid_t dxpl_id); -H5_DLL herr_t H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata); +H5_DLL herr_t H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt); +H5_DLL herr_t H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt); +H5_DLL herr_t H5FA_depend(H5FA_t *fa, H5AC_proxy_entry_t *parent); +H5_DLL herr_t H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata); +H5_DLL herr_t H5FA_close(H5FA_t *fa); +H5_DLL herr_t H5FA_delete(H5F_t *f, haddr_t fa_addr, void *ctx_udata); H5_DLL herr_t H5FA_patch_file(H5FA_t *fa, H5F_t *f); /* Statistics routines */ diff --git a/src/H5FAtest.c b/src/H5FAtest.c index 3c6d8e4..4b03036 100644 --- a/src/H5FAtest.c +++ b/src/H5FAtest.c @@ -76,8 +76,7 @@ static herr_t H5FA__test_decode(const void *raw, void *elmt, size_t nelmts, void *ctx); static herr_t H5FA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); -static void *H5FA__test_crt_dbg_context(H5F_t *f, hid_t dxpl_id, - haddr_t obj_addr); +static void *H5FA__test_crt_dbg_context(H5F_t *f, haddr_t obj_addr); /*********************/ @@ -341,7 +340,7 @@ END_FUNC(STATIC) /* end H5FA__test_debug() */ */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, -H5FA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED obj_addr)) +H5FA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr)) /* Local variables */ H5FA__test_ctx_t *ctx; /* Context for callbacks */ diff --git a/src/H5FD.c b/src/H5FD.c index 405e2d8..41111f5 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -31,6 +31,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ @@ -1023,6 +1024,7 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_API(HADDR_UNDEF) @@ -1040,15 +1042,23 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a data transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, HADDR_UNDEF, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Do the real work */ - if(HADDR_UNDEF == (ret_value = H5FD_alloc_real(file, dxpl_id, type, size, NULL, NULL))) + if(HADDR_UNDEF == (ret_value = H5FD__alloc_real(file, type, size, NULL, NULL))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file memory") /* (Note compensating for base address subtraction in internal routine) */ ret_value += file->base_addr; done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, HADDR_UNDEF, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDalloc() */ @@ -1072,6 +1082,7 @@ done: herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1087,13 +1098,21 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Do the real work */ /* (Note compensating for base address addition in internal routine) */ - if(H5FD_free_real(file, dxpl_id, type, addr - file->base_addr, size) < 0) + if(H5FD_free_real(file, type, addr - file->base_addr, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "file deallocation request failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDfree() */ @@ -1359,7 +1378,7 @@ herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { - H5FD_io_info_t fdio_info; /* File driver I/O object */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1378,27 +1397,21 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size if(!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null result buffer") - /* Set up the file driver I/O info object */ - fdio_info.file = file; - if(H5FD_MEM_DRAW == type) { - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end if */ - else { - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end else */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Do the real work */ /* (Note compensating for base address addition in internal routine) */ - if(H5FD_read(&fdio_info, type, addr - file->base_addr, size, buf) < 0) + if(H5FD_read(file, type, addr - file->base_addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "file read request failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDread() */ @@ -1421,7 +1434,7 @@ herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf) { - H5FD_io_info_t fdio_info; /* File driver I/O object */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1439,27 +1452,21 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz if(!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null buffer") - /* Set up the file driver I/O info object */ - fdio_info.file = file; - if(H5FD_MEM_DRAW == type) { - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end if */ - else { - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end else */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* The real work */ /* (Note compensating for base address addition in internal routine) */ - if(H5FD_write(&fdio_info, type, addr - file->base_addr, size, buf) < 0) + if(H5FD_write(file, type, addr - file->base_addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "file write request failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDwrite() */ @@ -1482,6 +1489,7 @@ done: herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1495,14 +1503,22 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Do the real work */ - if(H5FD_flush(file, dxpl_id, closing) < 0) + if(H5FD_flush(file, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "file flush request failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) -} +} /* end H5FDflush() */ /*------------------------------------------------------------------------- @@ -1516,15 +1532,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_flush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) +H5FD_flush(H5FD_t *file, hbool_t closing) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(file && file->cls); - if(file->cls->flush && (file->cls->flush)(file, dxpl_id, closing) < 0) + if(file->cls->flush && (file->cls->flush)(file, H5CX_get_dxpl(), closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver flush request failed") done: @@ -1545,6 +1562,7 @@ done: herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1558,14 +1576,22 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Do the real work */ - if(H5FD_truncate(file, dxpl_id, closing) < 0) + if(H5FD_truncate(file, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "file flush request failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) -} +} /* end H5FDtruncate() */ /*------------------------------------------------------------------------- @@ -1579,15 +1605,17 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_truncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) +H5FD_truncate(H5FD_t *file, hbool_t closing) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(file && file->cls); - if(file->cls->truncate && (file->cls->truncate)(file, dxpl_id, closing) < 0) + /* Dispatch to driver */ + if(file->cls->truncate && (file->cls->truncate)(file, H5CX_get_dxpl(), closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "driver truncate request failed") done: diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 98ece84..aacc5c0 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -1265,7 +1265,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) +H5FD_family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_family_t *file = (H5FD_family_t*)_file; unsigned u, nerrors = 0; @@ -1274,7 +1274,7 @@ H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) FUNC_ENTER_NOAPI_NOINIT for(u = 0; u < file->nmembs; u++) - if(file->memb[u] && H5FD_flush(file->memb[u], dxpl_id, closing) < 0) + if(file->memb[u] && H5FD_flush(file->memb[u], closing) < 0) nerrors++; if(nerrors) @@ -1300,7 +1300,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) +H5FD_family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_family_t *file = (H5FD_family_t*)_file; unsigned u, nerrors = 0; @@ -1309,7 +1309,7 @@ H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) FUNC_ENTER_NOAPI_NOINIT for(u = 0; u < file->nmembs; u++) - if(file->memb[u] && H5FD_truncate(file->memb[u], dxpl_id, closing) < 0) + if(file->memb[u] && H5FD_truncate(file->memb[u], closing) < 0) nerrors++; if(nerrors) diff --git a/src/H5FDint.c b/src/H5FDint.c index 52fbc23..023ff57 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -33,6 +33,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5FDpkg.h" /* File Drivers */ @@ -91,9 +92,8 @@ *------------------------------------------------------------------------- */ herr_t -H5FD_locate_signature(H5FD_io_info_t *fdio_info, haddr_t *sig_addr) +H5FD_locate_signature(H5FD_t *file, haddr_t *sig_addr) { - H5FD_t *file; haddr_t addr, eoa, eof; uint8_t buf[H5F_SIGNATURE_LEN]; unsigned n, maxpow; @@ -101,8 +101,7 @@ H5FD_locate_signature(H5FD_io_info_t *fdio_info, haddr_t *sig_addr) FUNC_ENTER_NOAPI_NOINIT - HDassert(fdio_info); - file = fdio_info->file; + /* Sanity checks */ HDassert(file); /* Find the least N such that 2^N is larger than the file size */ @@ -123,7 +122,7 @@ H5FD_locate_signature(H5FD_io_info_t *fdio_info, haddr_t *sig_addr) addr = (8 == n) ? 0 : (haddr_t)1 << n; if(H5FD_set_eoa(file, H5FD_MEM_SUPER, addr + H5F_SIGNATURE_LEN) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to set EOA value for file signature") - if(H5FD_read(fdio_info, H5FD_MEM_SUPER, addr, (size_t)H5F_SIGNATURE_LEN, buf) < 0) + if(H5FD_read(file, H5FD_MEM_SUPER, addr, (size_t)H5F_SIGNATURE_LEN, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to read file signature") if(!HDmemcmp(buf, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) break; @@ -161,47 +160,20 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_read(H5FD_io_info_t *fdio_info, H5FD_mem_t type, haddr_t addr, - size_t size, void *buf/*out*/) +H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, + void *buf/*out*/) { - H5FD_t *file; - H5P_genplist_t *io_dxpl; - haddr_t eoa = HADDR_UNDEF; - herr_t ret_value = SUCCEED; /* Return value */ + hid_t dxpl_id; /* DXPL for operation */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(fdio_info); - file = fdio_info->file; + /* Sanity checks */ HDassert(file && file->cls); - HDassert(TRUE == H5P_class_isa(H5P_CLASS(fdio_info->meta_dxpl), H5P_CLS_DATASET_XFER_g)); - HDassert(TRUE == H5P_class_isa(H5P_CLASS(fdio_info->raw_dxpl), H5P_CLS_DATASET_XFER_g)); HDassert(buf); - /* Set up proper DXPL for I/O */ - if(H5FD_MEM_DRAW == type) - io_dxpl = fdio_info->raw_dxpl; - else - io_dxpl = fdio_info->meta_dxpl; - - /* Sanity check the dxpl type against the mem type */ -#ifdef H5_DEBUG_BUILD - { - H5FD_dxpl_type_t dxpl_type; /* Property indicating the type of the internal dxpl */ - - /* get the dxpl type */ - if(H5P_get(io_dxpl, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't retrieve dxpl type") - - /* we shouldn't be here if the dxpl is labeled with NO I/O */ - HDassert(H5FD_NOIO_DXPL != dxpl_type); - - if(H5FD_MEM_DRAW == type) - HDassert(H5FD_RAWDATA_DXPL == dxpl_type); - else - HDassert(H5FD_METADATA_DXPL == dxpl_type); - } -#endif /* H5_DEBUG_BUILD */ + /* Get proper DXPL for I/O */ + dxpl_id = H5CX_get_dxpl(); #ifndef H5_HAVE_PARALLEL /* Do not return early for Parallel mode since the I/O could be a */ @@ -211,9 +183,6 @@ H5FD_read(H5FD_io_info_t *fdio_info, H5FD_mem_t type, haddr_t addr, HGOTO_DONE(SUCCEED) #endif /* H5_HAVE_PARALLEL */ - if(HADDR_UNDEF == (eoa = (file->cls->get_eoa)(file, type))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed") - /* * If the file is open for SWMR read access, allow access to data past * the end of the allocated space (the 'eoa'). This is done because the @@ -221,11 +190,18 @@ H5FD_read(H5FD_io_info_t *fdio_info, H5FD_mem_t type, haddr_t addr, * objects being written within the file by the application performing * SWMR write operations. */ - if(!(file->access_flags & H5F_ACC_SWMR_READ) && ((addr + file->base_addr + size) > eoa)) - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size = %llu, eoa = %llu", (unsigned long long)(addr + file->base_addr), (unsigned long long)size, (unsigned long long)eoa) + if(!(file->access_flags & H5F_ACC_SWMR_READ)) { + haddr_t eoa; + + if(HADDR_UNDEF == (eoa = (file->cls->get_eoa)(file, type))) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed") + + if((addr + file->base_addr + size) > eoa) + HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size = %llu, eoa = %llu", (unsigned long long)(addr + file->base_addr), (unsigned long long)size, (unsigned long long)eoa) + } /* end if */ /* Dispatch to driver */ - if((file->cls->read)(file, type, H5P_PLIST_ID(io_dxpl), addr + file->base_addr, size, buf) < 0) + if((file->cls->read)(file, type, dxpl_id, addr + file->base_addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed") done: @@ -247,47 +223,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_write(const H5FD_io_info_t *fdio_info, H5FD_mem_t type, haddr_t addr, - size_t size, const void *buf) +H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, + const void *buf) { - H5FD_t *file; - H5P_genplist_t *io_dxpl; - haddr_t eoa = HADDR_UNDEF; - herr_t ret_value = SUCCEED; /* Return value */ + hid_t dxpl_id; /* DXPL for operation */ + haddr_t eoa = HADDR_UNDEF; /* EOA for file */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(fdio_info); - file = fdio_info->file; + /* Sanity checks */ HDassert(file && file->cls); - HDassert(TRUE == H5P_class_isa(H5P_CLASS(fdio_info->meta_dxpl), H5P_CLS_DATASET_XFER_g)); - HDassert(TRUE == H5P_class_isa(H5P_CLASS(fdio_info->raw_dxpl), H5P_CLS_DATASET_XFER_g)); HDassert(buf); - /* Set up proper DXPL for I/O */ - if(H5FD_MEM_DRAW == type) - io_dxpl = fdio_info->raw_dxpl; - else - io_dxpl = fdio_info->meta_dxpl; - - /* Sanity check the dxpl type against the mem type */ -#ifdef H5_DEBUG_BUILD - { - H5FD_dxpl_type_t dxpl_type; /* Property indicating the type of the internal dxpl */ - - /* get the dxpl type */ - if(H5P_get(io_dxpl, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't retrieve dxpl type") - - /* we shouldn't be here if the dxpl is labeled with NO I/O */ - HDassert(H5FD_NOIO_DXPL != dxpl_type); - - if(H5FD_MEM_DRAW == type) - HDassert(H5FD_RAWDATA_DXPL == dxpl_type); - else - HDassert(H5FD_METADATA_DXPL == dxpl_type); - } -#endif /* H5_DEBUG_BUILD */ + /* Get proper DXPL for I/O */ + dxpl_id = H5CX_get_dxpl(); #ifndef H5_HAVE_PARALLEL /* Do not return early for Parallel mode since the I/O could be a */ @@ -304,7 +254,7 @@ H5FD_write(const H5FD_io_info_t *fdio_info, H5FD_mem_t type, haddr_t addr, (unsigned long long)(addr+ file->base_addr), (unsigned long long)size, (unsigned long long)eoa) /* Dispatch to driver */ - if((file->cls->write)(file, type, H5P_PLIST_ID(io_dxpl), addr + file->base_addr, size, buf) < 0) + if((file->cls->write)(file, type, dxpl_id, addr + file->base_addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed") done: diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 98e1b1a..4b42a73 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -21,6 +21,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ @@ -175,9 +176,8 @@ H5FD_get_mpi_info(H5FD_t *file, void** mpi_info) HDassert(cls->get_mpi_info); /* All MPI drivers must implement this */ /* Dispatch to driver */ - if ((ret_value=(cls->get_mpi_info)(file, mpi_info)) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, \ - "driver get_mpi_info request failed") + if((ret_value = (cls->get_mpi_info)(file, mpi_info)) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_mpi_info request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -480,44 +480,5 @@ done: FUNC_LEAVE_NOAPI(ret_value) } #endif /* NOT_YET */ - - -/*------------------------------------------------------------------------- - * Function: H5FD_mpi_setup_collective - * - * Purpose: Set the buffer type BTYPE, file type FTYPE for a data - * transfer. Also request a MPI type transfer. - * - * Return: Success: 0 - * Failure: -1 - * - * Programmer: Robb Matzke - * Monday, August 9, 1999 - * - *------------------------------------------------------------------------- - */ -herr_t -H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype *btype, MPI_Datatype *ftype) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check arguments */ - if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list") - - /* Set buffer MPI type */ - if(H5P_set(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, btype) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") - - /* Set File MPI type */ - if(H5P_set(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, ftype) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mpi_setup_collective() */ - #endif /* H5_HAVE_PARALLEL */ + diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index f594d8e..0801b17 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -23,6 +23,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ @@ -1410,8 +1411,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, haddr_t addr, size_t size, - void *buf/*out*/) +H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; MPI_Offset mpi_off; @@ -1430,7 +1431,6 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, had int io_size; /* Actual number of bytes requested */ int n; #endif - H5P_genplist_t *plist = NULL; /* Property list pointer */ hbool_t use_view_this_time = FALSE; herr_t ret_value = SUCCEED; @@ -1442,9 +1442,6 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, had #endif HDassert(file); HDassert(H5FD_MPIO==file->pub.driver_id); - /* Make certain we have the correct type of property list */ - HDassert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); - HDassert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); HDassert(buf); /* Portably initialize MPI status variable */ @@ -1467,13 +1464,9 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, had if(type == H5FD_MEM_DRAW) { H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */ - /* Obtain the data transfer properties */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - - /* get the transfer mode from the dxpl */ - if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + /* Get the transfer mode from the API context */ + if(H5CX_get_io_xfer_mode(&xfer_mode) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") /* * Set up for a fancy xfer using complex types, or single byte block. We @@ -1487,11 +1480,9 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, had /* Remember that views are used */ use_view_this_time = TRUE; - /* prepare for a full-blown xfer using btype, ftype, and disp */ - if(H5P_get(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, &buf_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") - if(H5P_get(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, &file_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") + /* Prepare for a full-blown xfer using btype, ftype, and disp */ + if(H5CX_get_mpi_coll_datatypes(&buf_type, &file_type) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O datatypes") /* * Set the file view when we are using MPI derived types @@ -1508,18 +1499,15 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, had /* Read the data. */ if(use_view_this_time) { - H5FD_mpio_collective_opt_t coll_opt_mode; + H5FD_mpio_collective_opt_t coll_opt_mode; #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "H5FD_mpio_read: using MPIO collective mode\n"); #endif /* Get the collective_opt property to check whether the application wants to do IO individually. */ - HDassert(plist); - - /* get the transfer mode from the dxpl */ - if(H5P_get(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &coll_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O collective_op property") + if(H5CX_get_mpio_coll_opt(&coll_opt_mode) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O collective_op property") if(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) { #ifdef H5FDmpio_DEBUG @@ -1710,8 +1698,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, - size_t size, const void *buf) +H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, + haddr_t addr, size_t size, const void *buf) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; MPI_Offset mpi_off; @@ -1729,7 +1717,6 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, #endif int size_i; hbool_t use_view_this_time = FALSE; - H5P_genplist_t *plist = NULL; /* Property list pointer */ H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */ herr_t ret_value = SUCCEED; @@ -1741,9 +1728,6 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, #endif HDassert(file); HDassert(H5FD_MPIO==file->pub.driver_id); - /* Make certain we have the correct type of property list */ - HDassert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); - HDassert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); HDassert(buf); /* Portably initialize MPI status variable */ @@ -1761,13 +1745,9 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, fprintf(stdout, "in H5FD_mpio_write mpi_off=%ld size_i=%d\n", (long)mpi_off, size_i); #endif - /* Obtain the data transfer properties */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - - /* get the transfer mode from the dxpl */ - if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + /* Get the transfer mode from the API context */ + if(H5CX_get_io_xfer_mode(&xfer_mode) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") /* * Set up for a fancy xfer using complex types, or single byte block. We @@ -1781,11 +1761,9 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Remember that views are used */ use_view_this_time = TRUE; - /* prepare for a full-blown xfer using btype, ftype, and disp */ - if(H5P_get(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, &buf_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") - if(H5P_get(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, &file_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") + /* Prepare for a full-blown xfer using btype, ftype, and disp */ + if(H5CX_get_mpi_coll_datatypes(&buf_type, &file_type) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O datatypes") /* * Set the file view when we are using MPI derived types @@ -1809,10 +1787,8 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, #endif /* Get the collective_opt property to check whether the application wants to do IO individually. */ - HDassert(plist); - /* get the transfer mode from the dxpl */ - if(H5P_get(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &coll_opt_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O collective_op property") + if(H5CX_get_mpio_coll_opt(&coll_opt_mode) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O collective_op property") if(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) { #ifdef H5FDmpio_DEBUG diff --git a/src/H5FDpkg.h b/src/H5FDpkg.h index 31dcf8d..6f47efb 100644 --- a/src/H5FDpkg.h +++ b/src/H5FDpkg.h @@ -50,10 +50,10 @@ /******************************/ /* Package Private Prototypes */ /******************************/ -H5_DLL haddr_t H5FD_alloc_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, - hsize_t size, haddr_t *align_addr, hsize_t *align_size); -H5_DLL herr_t H5FD_free_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, - haddr_t addr, hsize_t size); +H5_DLL haddr_t H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, + haddr_t *align_addr, hsize_t *align_size); +H5_DLL herr_t H5FD_free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, + hsize_t size); /* Testing functions */ #ifdef H5FD_TESTING diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index e758951..0430064 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -103,30 +103,6 @@ typedef struct H5FD_mpio_fapl_t { } H5FD_mpio_fapl_t; #endif /* H5_HAVE_PARALLEL */ -#ifdef H5_DEBUG_BUILD -/* Definitions for the internal DXPL types created in H5AC__init_package() */ -typedef enum { - H5FD_METADATA_DXPL = 0, - H5FD_NOIO_DXPL, - H5FD_RAWDATA_DXPL -} H5FD_dxpl_type_t; - -#define H5FD_DXPL_TYPE_NAME "H5P_dxpl_type" -#endif /* H5_DEBUG_BUILD */ - -/* I/O Info for an operation */ -typedef struct H5FD_io_info_t { - H5FD_t *file; /* File driver object */ -#ifndef H5_DEBUG_BUILD - const -#endif /* H5_DEBUG_BUILD */ - H5P_genplist_t *meta_dxpl; /* Metadata DXPL object */ -#ifndef H5_DEBUG_BUILD - const -#endif /* H5_DEBUG_BUILD */ - H5P_genplist_t *raw_dxpl; /* Raw data DXPL object */ -} H5FD_io_info_t; - /*****************************/ /* Library Private Variables */ @@ -141,7 +117,7 @@ typedef struct H5FD_io_info_t { struct H5F_t; H5_DLL int H5FD_term_interface(void); -H5_DLL herr_t H5FD_locate_signature(H5FD_io_info_t *fdio_info, haddr_t *sig_addr); +H5_DLL herr_t H5FD_locate_signature(H5FD_t *file, haddr_t *sig_addr); H5_DLL H5FD_class_t *H5FD_get_class(hid_t id); H5_DLL hsize_t H5FD_sb_size(H5FD_t *file); H5_DLL herr_t H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf); @@ -154,12 +130,12 @@ H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id, H5_DLL herr_t H5FD_close(H5FD_t *file); H5_DLL int H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2); 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, +H5_DLL haddr_t H5FD_alloc(H5FD_t *file, 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, +H5_DLL herr_t H5FD_free(H5FD_t *file, H5FD_mem_t type, struct H5F_t *f, haddr_t addr, hsize_t size); H5_DLL htri_t H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, struct H5F_t *f, - hid_t dxpl_id, haddr_t blk_end, hsize_t extra_requested); + haddr_t blk_end, hsize_t extra_requested); H5_DLL haddr_t H5FD_get_eoa(const H5FD_t *file, H5FD_mem_t type); H5_DLL herr_t H5FD_set_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr); H5_DLL haddr_t H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type); @@ -167,12 +143,12 @@ H5_DLL haddr_t H5FD_get_maxaddr(const H5FD_t *file); H5_DLL herr_t H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags); H5_DLL herr_t H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags); H5_DLL herr_t H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map); -H5_DLL herr_t H5FD_read(H5FD_io_info_t *fdio_info, H5FD_mem_t type, - haddr_t addr, size_t size, void *buf/*out*/); -H5_DLL herr_t H5FD_write(const H5FD_io_info_t *fdio_info, H5FD_mem_t type, - haddr_t addr, size_t size, const void *buf); -H5_DLL herr_t H5FD_flush(H5FD_t *file, hid_t dxpl_id, hbool_t closing); -H5_DLL herr_t H5FD_truncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing); +H5_DLL herr_t H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, + size_t size, void *buf/*out*/); +H5_DLL herr_t H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, + size_t size, const void *buf); +H5_DLL herr_t H5FD_flush(H5FD_t *file, hbool_t closing); +H5_DLL herr_t H5FD_truncate(H5FD_t *file, hbool_t closing); H5_DLL herr_t H5FD_lock(H5FD_t *file, hbool_t rw); H5_DLL herr_t H5FD_unlock(H5FD_t *file); H5_DLL herr_t H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum); @@ -193,8 +169,6 @@ H5_DLL herr_t H5FD_mpi_comm_info_free(MPI_Comm *comm, MPI_Info *info); H5_DLL herr_t H5FD_mpio_wait_for_left_neighbor(H5FD_t *file); H5_DLL herr_t H5FD_mpio_signal_right_neighbor(H5FD_t *file); #endif /* NOT_YET */ -H5_DLL herr_t H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype *btype, - MPI_Datatype *ftype); H5_DLL herr_t H5FD_set_mpio_atomicity(H5FD_t *file, hbool_t flag); H5_DLL herr_t H5FD_get_mpio_atomicity(H5FD_t *file, hbool_t *flag); diff --git a/src/H5FDspace.c b/src/H5FDspace.c index 0af755f..e158a44 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -33,6 +33,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5FDpkg.h" /* File Drivers */ @@ -131,7 +132,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_alloc_real + * Function: H5FD__alloc_real * * Purpose: Allocate space in the file with the VFD * Note: the handling of alignment is moved up from each driver to @@ -146,8 +147,8 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5FD_alloc_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, hsize_t size, - haddr_t *frag_addr, hsize_t *frag_size) +H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr, + hsize_t *frag_size) { hsize_t orig_size = size; /* Original allocation size */ haddr_t eoa; /* Address of end-of-allocated space */ @@ -156,7 +157,7 @@ H5FD_alloc_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, hsize_t size, hbool_t use_alloc_size; /* Just pass alloc size to the driver */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI(HADDR_UNDEF) + FUNC_ENTER_PACKAGE #ifdef H5FD_ALLOC_DEBUG HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size); #endif /* H5FD_ALLOC_DEBUG */ @@ -196,7 +197,7 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size); /* For the multi/split driver: the size passed down to the alloc callback is the original size from H5FD_alloc() */ /* For all other drivers: the size passed down to the alloc callback is the size + [possibly] alignment size */ if(file->cls->alloc) { - ret_value = (file->cls->alloc)(file, type, dxpl_id, use_alloc_size ? size : size + extra); + ret_value = (file->cls->alloc)(file, type, H5CX_get_dxpl(), use_alloc_size ? size : size + extra); if(!H5F_addr_defined(ret_value)) HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver allocation request failed") } /* end if */ @@ -222,7 +223,7 @@ done: HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value); #endif /* H5FD_ALLOC_DEBUG */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_alloc_real() */ +} /* end H5FD__alloc_real() */ /*------------------------------------------------------------------------- @@ -244,7 +245,7 @@ HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value); *------------------------------------------------------------------------- */ haddr_t -H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, H5F_t *f, hsize_t size, +H5FD_alloc(H5FD_t *file, H5FD_mem_t type, H5F_t *f, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size) { haddr_t ret_value = HADDR_UNDEF; /* Return value */ @@ -258,12 +259,12 @@ H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, H5F_t *f, hsize_t size, HDassert(size > 0); /* Call the real 'alloc' routine */ - ret_value = H5FD_alloc_real(file, dxpl_id, type, size, frag_addr, frag_size); + ret_value = H5FD__alloc_real(file, type, size, frag_addr, frag_size); if(!H5F_addr_defined(ret_value)) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "real 'alloc' request failed") /* Mark EOA info dirty in cache, so change will get encoded */ - if(H5F_eoa_dirty(f, dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTMARKDIRTY, HADDR_UNDEF, "unable to mark EOA info as dirty") done: @@ -285,7 +286,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_free_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, hsize_t size) +H5FD_free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size) { herr_t ret_value = SUCCEED; /* Return value */ @@ -317,7 +318,7 @@ HDfprintf(stderr, "%s: type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)type #ifdef H5FD_ALLOC_DEBUG HDfprintf(stderr, "%s: Letting VFD free space\n", FUNC); #endif /* H5FD_ALLOC_DEBUG */ - if((file->cls->free)(file, type, dxpl_id, addr, size) < 0) + if((file->cls->free)(file, type, H5CX_get_dxpl(), addr, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "driver free request failed") } /* end if */ /* Check if this free block is at the end of file allocated space. @@ -369,8 +370,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_free(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, H5F_t *f, - haddr_t addr, hsize_t size) +H5FD_free(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t addr, hsize_t size) { herr_t ret_value = SUCCEED; /* Return value */ @@ -383,11 +383,11 @@ H5FD_free(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, H5F_t *f, HDassert(size > 0); /* Call the real 'free' routine */ - if(H5FD_free_real(file, dxpl_id, type, addr, size) < 0) + if(H5FD_free_real(file, type, addr, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "real 'free' request failed") /* Mark EOA info dirty in cache, so change will get encoded */ - if(H5F_eoa_dirty(f, dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTMARKDIRTY, FAIL, "unable to mark EOA info as dirty") done: @@ -414,8 +414,8 @@ done: *------------------------------------------------------------------------- */ htri_t -H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, hid_t dxpl_id, - haddr_t blk_end, hsize_t extra_requested) +H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, + hsize_t extra_requested) { haddr_t eoa; /* End of allocated space in file */ htri_t ret_value = FALSE; /* Return value */ @@ -443,7 +443,7 @@ H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, hid_t dxpl_id, HGOTO_ERROR(H5E_VFL, H5E_CANTEXTEND, FAIL, "driver extend request failed") /* Mark EOA info dirty in cache, so change will get encoded */ - if(H5F_eoa_dirty(f, dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTMARKDIRTY, FAIL, "unable to mark EOA info as dirty") /* Indicate success */ diff --git a/src/H5FO.c b/src/H5FO.c index 627ee64..7bbf7fa 100644 --- a/src/H5FO.c +++ b/src/H5FO.c @@ -208,7 +208,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5FO_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) +H5FO_delete(H5F_t *f, haddr_t addr) { H5FO_open_obj_t *open_obj; /* Information about open object */ herr_t ret_value=SUCCEED; /* Return value */ @@ -227,7 +227,7 @@ H5FO_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) /* Check if the object was deleted from the file */ if(open_obj->deleted) { - if(H5O_delete(f, dxpl_id, addr) < 0) + if(H5O_delete(f, addr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file") } /* end if */ diff --git a/src/H5FOprivate.h b/src/H5FOprivate.h index aa85c29..49e8126 100644 --- a/src/H5FOprivate.h +++ b/src/H5FOprivate.h @@ -37,7 +37,7 @@ typedef H5SL_t H5FO_t; /* Currently, all open objects are stored in skip l H5_DLL herr_t H5FO_create(const H5F_t *f); H5_DLL void *H5FO_opened(const H5F_t *f, haddr_t addr); H5_DLL herr_t H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag); -H5_DLL herr_t H5FO_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr); +H5_DLL herr_t H5FO_delete(H5F_t *f, haddr_t addr); H5_DLL herr_t H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted); H5_DLL hbool_t H5FO_marked(const H5F_t *f, haddr_t addr); H5_DLL herr_t H5FO_dest(const H5F_t *f); diff --git a/src/H5FS.c b/src/H5FS.c index b789dfd..ec2dc11 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -101,7 +101,7 @@ H5FL_DEFINE(H5FS_t); *------------------------------------------------------------------------- */ H5FS_t * -H5FS_create(H5F_t *f, hid_t dxpl_id, haddr_t *fs_addr, const H5FS_create_t *fs_create, +H5FS_create(H5F_t *f, haddr_t *fs_addr, const H5FS_create_t *fs_create, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold) { H5FS_t *fspace = NULL; /* New free space structure */ @@ -138,11 +138,11 @@ HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", FUNC, ncl /* Check if the free space tracker is supposed to be persistant */ if(fs_addr) { /* Allocate space for the free space header */ - if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, dxpl_id, (hsize_t)fspace->hdr_size))) + if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, (hsize_t)fspace->hdr_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "file allocation failed for free space header") /* Cache the new free space header (pinned) */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, NULL, "can't add free space header to cache") /* Return free space header address to caller, if desired */ @@ -184,7 +184,7 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); *------------------------------------------------------------------------- */ H5FS_t * -H5FS_open(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, uint16_t nclasses, +H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold) { H5FS_t *fspace = NULL; /* New free space structure */ @@ -209,7 +209,7 @@ HDfprintf(stderr, "%s: Opening free space manager, fs_addr = %a, nclasses = %Zu\ cache_udata.addr = fs_addr; /* Protect the free space header */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, NULL, "unable to load free space header") #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: fspace->sect_addr = %a\n", FUNC, fspace->sect_addr); @@ -228,7 +228,7 @@ HDfprintf(stderr, "%s: fspace->rc = %u\n", FUNC, fspace->rc); fspace->align_thres = threshold; /* Unlock free space header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, NULL, "unable to release free space header") /* Set return value */ @@ -252,7 +252,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_delete(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr) +H5FS_delete(H5F_t *f, haddr_t fs_addr) { H5FS_t *fspace = NULL; /* Free space header loaded from file */ H5FS_hdr_cache_ud_t cache_udata; /* User-data for metadata cache callback */ @@ -320,7 +320,7 @@ HDfprintf(stderr, "%s: Deleting free space manager, fs_addr = %a\n", FUNC, fs_ad #endif /* H5FS_DEBUG */ /* Protect the free space header */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to protect free space header") /* Sanity check */ @@ -361,7 +361,7 @@ HDfprintf(stderr, "%s: Expunging free space section info from cache\n", FUNC); if (!H5F_IS_TMP_ADDR(f, fspace->sect_addr)) cache_flags |= H5AC__FREE_FILE_SPACE_FLAG; - if(H5AC_expunge_entry(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, cache_flags) < 0) + if(H5AC_expunge_entry(f, H5AC_FSPACE_SINFO, fspace->sect_addr, cache_flags) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "unable to remove free space section info from cache") } /* end block */ @@ -374,15 +374,14 @@ HDfprintf(stderr, "%s: Done expunging free space section info from cache\n", FUN HDfprintf(stderr, "%s: Deleting free space section info from file\n", FUNC); #endif /* H5FS_DEBUG */ /* Release the space in the file */ - if(!H5F_IS_TMP_ADDR(f, fspace->sect_addr)) { - if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_addr, fspace->alloc_sect_size) < 0) + if(!H5F_IS_TMP_ADDR(f, fspace->sect_addr)) + if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, fspace->sect_addr, fspace->alloc_sect_size) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to release free space sections") - } /* end if */ } /* end else */ } /* end if */ done: - if(fspace && H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(fspace && H5AC_unprotect(f, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space header") FUNC_LEAVE_NOAPI(ret_value) @@ -403,7 +402,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_close(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace) +H5FS_close(H5F_t *f, H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ @@ -441,7 +440,7 @@ HDfprintf(stderr, "%s: Real sections to store in file\n", FUNC); HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") } /* end if */ else { - if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") } /* end if */ fspace->alloc_sect_size = (size_t)fspace->sect_size; @@ -456,7 +455,7 @@ HDfprintf(stderr, "%s: Real sections to store in file\n", FUNC); HDassert(H5F_addr_defined(fspace->sect_addr)); /* Cache the free space section info */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space sections to cache") } /* end if */ else { @@ -498,7 +497,7 @@ HDfprintf(stderr, "%s: Section info in temp. address space went 'go away'\n", FU HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") } /* end if */ else { - if((status = H5MF_try_shrink(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_addr, fspace->alloc_sect_size)) < 0) + if((status = H5MF_try_shrink(f, H5FD_MEM_FSPACE_SINFO, fspace->sect_addr, fspace->alloc_sect_size)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't check for absorbing section info") else if(status == FALSE) { /* Section info can't "go away", but it's free. Allow @@ -539,7 +538,7 @@ HDfprintf(stderr, "%s: Section info is NOT for file free space\n", FUNC); /* Free previous serialized sections disk space */ if(!H5F_IS_TMP_ADDR(f, old_sect_addr)) { - if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, old_sect_addr, old_alloc_sect_size) < 0) + if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, old_sect_addr, old_alloc_sect_size) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to free free space sections") } /* end if */ } /* end else */ @@ -819,7 +818,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr, hid_t dxpl_id) +H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -831,11 +830,11 @@ H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr, hid_t dxpl_id) if(!H5F_addr_defined(fspace->addr)) { /* Allocate space for the free space header */ - if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, dxpl_id, (hsize_t)H5FS_HEADER_SIZE(f)))) + if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, (hsize_t)H5FS_HEADER_SIZE(f)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for free space header") /* Cache the new free space header (pinned) */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space header to cache") } /* end if */ @@ -860,7 +859,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id) +H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ @@ -871,7 +870,7 @@ H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id) HDassert(fspace); if(!H5F_addr_defined(fspace->sect_addr) && fspace->sinfo && fspace->serial_sect_count > 0) { - if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for section info") fspace->alloc_sect_size = fspace->sect_size; @@ -880,7 +879,7 @@ H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") /* Cache the free-space section info */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space sections to cache") /* Since space has been allocated for the section info and the sinfo @@ -908,7 +907,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) +H5FS_free(H5F_t *f, H5FS_t *fspace, hbool_t free_file_space) { haddr_t saved_addr; /* Previous address of item */ unsigned cache_flags; /* Flags for unprotecting cache entries */ @@ -937,13 +936,12 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) /* Protect the free space sections */ cache_udata.f = f; - cache_udata.dxpl_id = dxpl_id; cache_udata.fspace = fspace; - if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to protect free space section info") /* Unload and release ownership of the free-space manager section info */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, cache_flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info") } /* end if */ @@ -956,7 +954,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) /* Free space for the free-space manager section info */ if(!H5F_IS_TMP_ADDR(f, saved_addr)) { if(free_file_space && - H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, saved_addr, saved_size) < 0) + H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, saved_addr, saved_size) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to release free space sections") } /* end if */ @@ -982,7 +980,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) cache_udata.nclasses = 0; cache_udata.classes = NULL; cache_udata.cls_init_udata = NULL; - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, H5AC_FSPACE_HDR, fspace->addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to protect free space section info") /* Unpin the free-space manager header */ @@ -990,7 +988,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap header") /* Unload and release ownership of the free-space header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, fspace, cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_HDR, fspace->addr, fspace, cache_flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info") } /* end if */ @@ -999,7 +997,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) /* Free space for the free-space manager header */ if(free_file_space && - H5MF_xfree(f, H5FD_MEM_FSPACE_HDR, dxpl_id, saved_addr, (hsize_t)H5FS_HEADER_SIZE(f)) < 0) + H5MF_xfree(f, H5FD_MEM_FSPACE_HDR, saved_addr, (hsize_t)H5FS_HEADER_SIZE(f)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to free free space header") } /* end if */ @@ -1193,7 +1191,7 @@ H5FS_get_sect_count(const H5FS_t *frsp, hsize_t *tot_sect_count) #ifdef H5FS_DEBUG_ASSERT /*------------------------------------------------------------------------- - * Function: H5FS_assert + * Function: H5FS__assert * * Purpose: Verify that the free space manager is mostly sane * @@ -1205,17 +1203,17 @@ H5FS_get_sect_count(const H5FS_t *frsp, hsize_t *tot_sect_count) *------------------------------------------------------------------------- */ herr_t -H5FS_assert(const H5FS_t *fspace, hid_t dxpl_id) +H5FS__assert(const H5FS_t *fspace) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR #ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_assert", fspace->tot_sect_count); +HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__assert", fspace->tot_sect_count); #endif /* QAK */ /* Checks for section info, if it's available */ if(fspace->sinfo) { /* Sanity check sections */ - H5FS_sect_assert(fspace, dxpl_id); + H5FS__sect_assert(fspace); /* General assumptions about the section size counts */ HDassert(fspace->sinfo->tot_size_count >= fspace->sinfo->serial_size_count); @@ -1231,6 +1229,6 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_assert", fspace->t #endif /* QAK */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FS_assert() */ +} /* end H5FS__assert() */ #endif /* H5FS_DEBUG_ASSERT */ diff --git a/src/H5FScache.c b/src/H5FScache.c index 628fba0..875a383 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -82,9 +82,8 @@ static htri_t H5FS__cache_hdr_verify_chksum(const void *image_ptr, size_t len, v static void *H5FS__cache_hdr_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5FS__cache_hdr_image_len(const void *thing, size_t *image_len); -static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, - unsigned *flags); +static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, void *thing, haddr_t addr, + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5FS__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5FS__cache_hdr_notify(H5AC_notify_action_t action, void *thing); @@ -95,9 +94,8 @@ static htri_t H5FS__cache_sinfo_verify_chksum(const void *image_ptr, size_t len, static void *H5FS__cache_sinfo_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5FS__cache_sinfo_image_len(const void *thing, size_t *image_len); -static herr_t H5FS__cache_sinfo_pre_serialize(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, - unsigned *flags); +static herr_t H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *thing, + haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5FS__cache_sinfo_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5FS__cache_sinfo_notify(H5AC_notify_action_t action, void *thing); @@ -404,12 +402,11 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, +H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t *new_addr, size_t *new_len, unsigned *flags) { H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ @@ -432,9 +429,8 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, if(H5AC_get_entry_ring(f, addr, &ring) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "unable to get property value"); - /* Set the ring type for the section info in the DXPL */ - if(H5AC_set_ring(dxpl_id, ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type for the section info in the API context */ + H5AC_set_ring(ring, &orig_ring); /* This implies that the header "owns" the section info. * @@ -524,7 +520,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, /* allocate file space for the section info, and insert it * into the metadata cache. */ - if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") fspace->alloc_sect_size = (size_t)fspace->sect_size; @@ -532,10 +528,10 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, /* Get the tag for this free space manager and use it to insert the entry */ if(H5AC_get_tag((const void *)fspace, &tag) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTTAG, FAIL, "can't get tag for metadata cache object") - H5_BEGIN_TAG(dxpl_id, tag, FAIL) - if(H5AC_insert_entry((H5F_t *)f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + H5_BEGIN_TAG(tag) + if(H5AC_insert_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR_TAG(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space sections to cache") - H5_END_TAG(FAIL) + H5_END_TAG HDassert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); @@ -559,14 +555,14 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, HDassert(fspace->alloc_sect_size == (size_t)fspace->sect_size); /* Allocate space for the section info in file */ - if(HADDR_UNDEF == (new_sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (new_sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") fspace->alloc_sect_size = (size_t)fspace->sect_size; HDassert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); /* Let the metadata cache know the section info moved */ - if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr, dxpl_id) < 0) + if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move section info") fspace->sect_addr = new_sect_addr; @@ -621,7 +617,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, HDassert((sect_status & H5AC_ES__IS_PINNED) == 0); /* Allocate space for the section info in file */ - if(HADDR_UNDEF == (new_sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (new_sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") fspace->alloc_sect_size = (size_t)fspace->sect_size; @@ -630,7 +626,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, HDassert(!H5F_addr_eq(fspace->sect_addr, new_sect_addr)); /* Let the metadata cache know the section info moved */ - if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr, dxpl_id) < 0) + if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMOVE, FAIL, "unable to move section info") /* Update the internal address for the section info */ @@ -651,9 +647,9 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, *flags = 0; done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); FUNC_LEAVE_NOAPI(ret_value) } /* end H5FS__cache_hdr_pre_serialize() */ @@ -989,7 +985,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* initialize old_sect_size */ - H5_CHECKED_ASSIGN(old_sect_size, size_t, udata->fspace->sect_size, hsize_t); + H5_CHECKED_ASSIGN(old_sect_size, size_t, fspace->sect_size, hsize_t); /* Magic number */ if(HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) @@ -1002,7 +998,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, /* Address of free space header for these sections */ H5F_addr_decode(udata->f, &image, &fs_addr); - if(H5F_addr_ne(fs_addr, udata->fspace->addr)) + if(H5F_addr_ne(fs_addr, fspace->addr)) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "incorrect header address for free space sections") /* Check for any serialized sections */ @@ -1014,7 +1010,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, unsigned sect_cnt_size; /* The size of the section size counts */ /* Compute the size of the section counts */ - sect_cnt_size = H5VM_limit_enc_size((uint64_t)udata->fspace->serial_sect_count); + sect_cnt_size = H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); /* Reset the section count, the "add" routine will update it */ old_tot_sect_count = fspace->tot_sect_count; @@ -1055,16 +1051,16 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, /* Call 'deserialize' callback for this section */ des_flags = 0; - HDassert(udata->fspace->sect_cls[sect_type].deserialize); - if(NULL == (new_sect = (*fspace->sect_cls[sect_type].deserialize) (&fspace->sect_cls[sect_type], udata->dxpl_id, image, sect_addr, sect_size, &des_flags))) + HDassert(fspace->sect_cls[sect_type].deserialize); + if(NULL == (new_sect = (*fspace->sect_cls[sect_type].deserialize) (&fspace->sect_cls[sect_type], image, sect_addr, sect_size, &des_flags))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTDECODE, NULL, "can't deserialize section") /* Update offset in serialization image */ - image += udata->fspace->sect_cls[sect_type].serial_size; + image += fspace->sect_cls[sect_type].serial_size; /* Insert section in free space manager, unless requested not to */ if(!(des_flags & H5FS_DESERIALIZE_NO_ADD)) - if(H5FS_sect_add(udata->f, udata->dxpl_id, udata->fspace, new_sect, H5FS_ADD_DESERIALIZING, udata) < 0) + if(H5FS_sect_add(udata->f, fspace, new_sect, H5FS_ADD_DESERIALIZING, udata) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, NULL, "can't add section to free space manager") } /* end for */ } while(image < (((const uint8_t *)_image + old_sect_size) - H5FS_SIZEOF_CHKSUM)); @@ -1154,8 +1150,8 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5FS__cache_sinfo_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, - haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags) +H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags) { H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ H5FS_t *fspace; /* Free space header */ @@ -1193,7 +1189,7 @@ H5FS__cache_sinfo_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, HDassert(H5F_addr_eq(fspace->sect_addr, addr)); /* Allocate space for the section info in file */ - if(HADDR_UNDEF == (sinfo_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (sinfo_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") fspace->alloc_sect_size = (size_t)fspace->sect_size; @@ -1202,7 +1198,7 @@ H5FS__cache_sinfo_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, HDassert(!H5F_addr_eq(sinfo->fspace->sect_addr, sinfo_addr)); /* Let the metadata cache know the section info moved */ - if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, sinfo->fspace->sect_addr, sinfo_addr, dxpl_id) < 0) + if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, sinfo->fspace->sect_addr, sinfo_addr) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMOVE, FAIL, "unable to move section info") /* Update the internal address for the section info */ diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index 450216b..c615b68 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -89,7 +89,7 @@ *------------------------------------------------------------------------- */ herr_t -H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth) +H5FS_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) { H5FS_t *fspace = NULL; /* Free space header info */ H5FS_hdr_cache_ud_t cache_udata; /* User-data for cache callback */ @@ -116,7 +116,7 @@ H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int /* * Load the free space header. */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, H5AC_FSPACE_HDR, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, FAIL, "unable to load free space header") /* Print opening message */ @@ -167,7 +167,7 @@ H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fspace->alloc_sect_size); done: - if(fspace && H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, addr, fspace, H5AC__NO_FLAGS_SET) < 0) + if(fspace && H5AC_unprotect(f, H5AC_FSPACE_HDR, addr, fspace, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FSPACE, H5E_PROTECT, FAIL, "unable to release free space header") FUNC_LEAVE_NOAPI(ret_value) @@ -225,7 +225,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, int fwidth, +H5FS_sects_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, int fwidth, haddr_t fs_addr, haddr_t client_addr) { H5FS_t *fspace = NULL; /* Free space header info */ @@ -256,7 +256,7 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *str /* * Load the free space header. */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, FAIL, "unable to load free space header") /* Retrieve the client id */ @@ -266,7 +266,7 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *str /* (set the "deleted" flag for the unprotect, so the cache entry is removed * and reloaded later, with the correct client information -QAK) */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__DELETED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__DELETED_FLAG) < 0) HDONE_ERROR(H5E_FSPACE, H5E_PROTECT, FAIL, "unable to release free space header") fspace = NULL; @@ -278,12 +278,12 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *str */ switch(client) { case H5FS_CLIENT_FHEAP_ID: - if(H5HF_sects_debug(f, dxpl_id, client_addr, stream, indent + 3, MAX(0, fwidth - 3)) < 0) + if(H5HF_sects_debug(f, client_addr, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_SYSTEM, FAIL, "unable to dump fractal heap free space sections") break; case H5FS_CLIENT_FILE_ID: - if(H5MF_sects_debug(f, dxpl_id, fs_addr, stream, indent + 3, MAX(0, fwidth - 3)) < 0) + if(H5MF_sects_debug(f, fs_addr, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_SYSTEM, FAIL, "unable to dump file free space sections") break; @@ -294,7 +294,7 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *str } /* end switch */ done: - if(fspace && H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0) + if(fspace && H5AC_unprotect(f, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FSPACE, H5E_PROTECT, FAIL, "unable to release free space header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index df1d92f..23e1212 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -104,7 +104,6 @@ typedef struct H5FS_hdr_cache_ud_t { typedef struct H5FS_sinfo_cache_ud_t { H5F_t *f; /* File that free space section info is within */ H5FS_t *fspace; /* free space manager */ - hid_t dxpl_id; } H5FS_sinfo_cache_ud_t; /* Free space section bin info */ @@ -237,8 +236,8 @@ H5_DLL herr_t H5FS_sinfo_dest(H5FS_sinfo_t *sinfo); /* Sanity check routines */ #ifdef H5FS_DEBUG -H5_DLL herr_t H5FS_assert(const H5FS_t *fspace, hid_t dxpl_id); -H5_DLL herr_t H5FS_sect_assert(const H5FS_t *fspace, hid_t dxpl_id); +H5_DLL herr_t H5FS__assert(const H5FS_t *fspace); +H5_DLL herr_t H5FS__sect_assert(const H5FS_t *fspace); #endif /* H5FS_DEBUG */ /* Testing routines */ diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index 247d75c..de1b4c1 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -104,13 +104,13 @@ typedef struct H5FS_section_class_t { /* Object methods */ herr_t (*add)(H5FS_section_info_t **, unsigned *, void *); /* Routine called when section is about to be added to manager */ herr_t (*serialize)(const struct H5FS_section_class_t *, const H5FS_section_info_t *, uint8_t *); /* Routine to serialize a "live" section into a buffer */ - H5FS_section_info_t *(*deserialize)(const struct H5FS_section_class_t *, hid_t dxpl_id, const uint8_t *, haddr_t, hsize_t, unsigned *); /* Routine to deserialize a buffer into a "live" section */ + H5FS_section_info_t *(*deserialize)(const struct H5FS_section_class_t *, const uint8_t *, haddr_t, hsize_t, unsigned *); /* Routine to deserialize a buffer into a "live" section */ htri_t (*can_merge)(const H5FS_section_info_t *, const H5FS_section_info_t *, void *); /* Routine to determine if two nodes are mergable */ herr_t (*merge)(H5FS_section_info_t **, H5FS_section_info_t *, void *); /* Routine to merge two nodes */ htri_t (*can_shrink)(const H5FS_section_info_t *, void *); /* Routine to determine if node can shrink container */ herr_t (*shrink)(H5FS_section_info_t **, void *); /* Routine to shrink container */ herr_t (*free)(H5FS_section_info_t *); /* Routine to free node */ - herr_t (*valid)(const struct H5FS_section_class_t *, const H5FS_section_info_t *, hid_t dxpl_id); /* Routine to check if a section is valid */ + herr_t (*valid)(const struct H5FS_section_class_t *, const H5FS_section_info_t *); /* Routine to check if a section is valid */ H5FS_section_info_t *(*split)(H5FS_section_info_t *, hsize_t); /* Routine to create the split section */ herr_t (*debug)(const H5FS_section_info_t *, FILE *, int , int ); /* Routine to dump debugging information about a section */ } H5FS_section_class_t; @@ -179,36 +179,35 @@ H5FL_SEQ_EXTERN(H5FS_section_class_t); 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, - const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold); -H5_DLL H5FS_t *H5FS_open(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, - uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold); +H5_DLL H5FS_t *H5FS_create(H5F_t *f, haddr_t *fs_addr, const H5FS_create_t *fs_create, + uint16_t nclasses, const H5FS_section_class_t *classes[], + void *cls_init_udata, hsize_t alignment, hsize_t threshold); +H5_DLL H5FS_t *H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses, + const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, + hsize_t threshold); H5_DLL herr_t H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size); -H5_DLL herr_t H5FS_delete(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr); -H5_DLL herr_t H5FS_close(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace); -H5_DLL herr_t H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr, hid_t dxpl_id); -H5_DLL herr_t H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id); -H5_DLL herr_t H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, - hbool_t free_file_space); +H5_DLL herr_t H5FS_delete(H5F_t *f, haddr_t fs_addr); +H5_DLL herr_t H5FS_close(H5F_t *f, H5FS_t *fspace); +H5_DLL herr_t H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr); +H5_DLL herr_t H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace); +H5_DLL herr_t H5FS_free(H5F_t *f, H5FS_t *fspace, hbool_t free_file_space); /* Free space section routines */ -H5_DLL herr_t H5FS_sect_add(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - H5FS_section_info_t *node, unsigned flags, void *op_data); -H5_DLL htri_t H5FS_sect_try_merge(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, +H5_DLL herr_t H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *node, + unsigned flags, void *op_data); +H5_DLL htri_t H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags, void *op_data); -H5_DLL htri_t H5FS_sect_try_extend(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - haddr_t addr, hsize_t size, hsize_t extra_requested, unsigned flags, void *op_data); -H5_DLL herr_t H5FS_sect_remove(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - H5FS_section_info_t *node); -H5_DLL htri_t H5FS_sect_find(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - hsize_t request, H5FS_section_info_t **node); -H5_DLL herr_t H5FS_sect_iterate(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_operator_t op, void *op_data); +H5_DLL htri_t H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, + hsize_t size, hsize_t extra_requested, unsigned flags, void *op_data); +H5_DLL herr_t H5FS_sect_remove(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *node); +H5_DLL htri_t H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, + H5FS_section_info_t **node); +H5_DLL herr_t H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data); H5_DLL herr_t H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space, hsize_t *nsects); -H5_DLL herr_t H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, +H5_DLL herr_t H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint16_t new_class); -H5_DLL htri_t H5FS_sect_try_shrink_eoa(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, +H5_DLL htri_t H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data); /* Statistics routine */ @@ -216,16 +215,14 @@ H5_DLL herr_t H5FS_stat_info(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *st H5_DLL herr_t H5FS_get_sect_count(const H5FS_t *frsp, hsize_t *tot_sect_count); /* free space manager settling routines */ -H5_DLL herr_t H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, - hid_t dxpl_id, - H5FS_t *fspace, - haddr_t *fs_addr_ptr); +H5_DLL herr_t H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, + haddr_t *fs_addr_ptr); /* Debugging routines for dumping file structures */ -H5_DLL herr_t H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, haddr_t fs_addr, haddr_t client_addr); +H5_DLL herr_t H5FS_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth); +H5_DLL herr_t H5FS_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, haddr_t fs_addr, haddr_t client_addr); H5_DLL herr_t H5FS_sect_debug(const H5FS_t *fspace, const H5FS_section_info_t *sect, FILE *stream, int indent, int fwidth); diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 8f911a4..f0d9f47 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -204,7 +204,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_lock(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, unsigned accmode) +H5FS_sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode) { H5FS_sinfo_cache_ud_t cache_udata; /* User-data for cache callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -236,14 +236,13 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" /* Check if we need to switch from read-only access to read-write */ if(0 == (accmode & (unsigned)(~H5AC__READ_ONLY_FLAG))) { /* Unprotect the read-only section info */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info") /* Re-protect the section info with read-write access */ cache_udata.f = f; - cache_udata.dxpl_id = dxpl_id; cache_udata.fspace = fspace; - if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to load free space sections") /* Switch the access mode we have */ @@ -263,9 +262,8 @@ HDfprintf(stderr, "%s: Reading in existing sections, fspace->sect_addr = %a\n", #endif /* H5FS_SINFO_DEBUG */ /* Protect the free space sections */ cache_udata.f = f; - cache_udata.dxpl_id = dxpl_id; cache_udata.fspace = fspace; - if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, accmode))) + if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, accmode))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to load free space sections") /* Remember that we protected the section info & the access mode */ @@ -317,7 +315,7 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_unlock(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hbool_t modified) +H5FS_sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) { herr_t ret_value = SUCCEED; /* Return value */ @@ -386,7 +384,7 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: Unprotecting section info, cache_flags = %u\n", FUNC, cache_flags); #endif /* H5FS_SINFO_DEBUG */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, cache_flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info") /* Reset the protected flag on the section info */ @@ -451,10 +449,9 @@ HDfprintf(stderr, "%s: Relinquishing section info ownership\n", FUNC); HDfprintf(stderr, "%s: Freeing section info on disk, old_sect_addr = %a, old_alloc_sect_size = %Hu\n", FUNC, old_sect_addr, old_alloc_sect_size); #endif /* H5FS_SINFO_DEBUG */ /* Release space for section info in file */ - if(!H5F_IS_TMP_ADDR(f, old_sect_addr)) { - if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, old_sect_addr, old_alloc_sect_size) < 0) + if(!H5F_IS_TMP_ADDR(f, old_sect_addr)) + if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, old_sect_addr, old_alloc_sect_size) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to free free space sections") - } /* end if */ } /* end if */ } /* end if */ @@ -897,8 +894,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_sect_remove(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - H5FS_section_info_t *sect) +H5FS_sect_remove(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect) { hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ herr_t ret_value = SUCCEED; /* Return value */ @@ -911,7 +907,7 @@ H5FS_sect_remove(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, HDassert(sect); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -921,7 +917,7 @@ H5FS_sect_remove(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, TRUE) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, TRUE) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -1362,8 +1358,8 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); *------------------------------------------------------------------------- */ herr_t -H5FS_sect_add(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t *sect, - unsigned flags, void *op_data) +H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags, + void *op_data) { H5FS_section_class_t *cls; /* Section's class */ hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ @@ -1383,16 +1379,15 @@ HDfprintf(stderr, "%s: *sect = {%a, %Hu, %u, %s}\n", FUNC, sect->addr, sect->siz HDassert(sect->size); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; /* Call "add" section class callback, if there is one */ cls = &fspace->sect_cls[sect->type]; - if(cls->add) { + if(cls->add) if((*cls->add)(§, &flags, op_data) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "'add' section class callback failed") - } /* end if */ /* Check for merging returned space with existing section node */ if(flags & H5FS_ADD_RETURNED_SPACE) { @@ -1423,12 +1418,12 @@ HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") #ifdef H5FS_DEBUG_ASSERT if(!(flags & (H5FS_ADD_DESERIALIZING | H5FS_ADD_SKIP_VALID))) - H5FS_assert(fspace, dxpl_id); + H5FS__assert(fspace); #endif /* H5FS_DEBUG_ASSERT */ #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); @@ -1450,7 +1445,7 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); *------------------------------------------------------------------------- */ htri_t -H5FS_sect_try_extend(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, haddr_t addr, +H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize_t extra_requested, unsigned flags, void *op_data) { hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ @@ -1480,7 +1475,7 @@ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_se H5FS_section_info_t *sect; /* Temporary free space section */ /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1566,7 +1561,7 @@ if(_section_) done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -1588,7 +1583,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5FS_sect_try_merge(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t *sect, +H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags, void *op_data) { hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ @@ -1606,7 +1601,7 @@ H5FS_sect_try_merge(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t HDassert(sect->size); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; saved_fs_size = sect->size; @@ -1632,7 +1627,7 @@ H5FS_sect_try_merge(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -1802,8 +1797,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5FS_sect_find(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hsize_t request, - H5FS_section_info_t **node) +H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node) { hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ hbool_t sinfo_modified = FALSE; /* Whether the section info was modified */ @@ -1829,7 +1823,7 @@ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_se #endif /* QAK */ if(fspace->tot_sect_count > 0) { /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1849,11 +1843,11 @@ HDfprintf(stderr, "%s: (*node)->size = %Hu, (*node)->addr = %a, (*node)->type = done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") #ifdef H5FS_DEBUG_ASSERT - H5FS_assert(fspace, dxpl_id); + H5FS__assert(fspace); #endif /* H5FS_DEBUG_ASSERT */ FUNC_LEAVE_NOAPI(ret_value) } /* H5FS_sect_find() */ @@ -1945,7 +1939,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_sect_iterate(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_operator_t op, void *op_data) +H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data) { H5FS_iter_ud_t udata; /* User data for callbacks */ hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ @@ -1971,7 +1965,7 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_c unsigned bin; /* Current bin we are on */ /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__READ_ONLY_FLAG) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1991,7 +1985,7 @@ HDfprintf(stderr, "%s: Iterate over section bins\n", FUNC); done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, FALSE) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, FALSE) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -2042,8 +2036,8 @@ H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space, hsize_t *nsects) *------------------------------------------------------------------------- */ herr_t -H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - H5FS_section_info_t *sect, uint16_t new_class) +H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, + uint16_t new_class) { const H5FS_section_class_t *old_cls; /* Old class of section */ const H5FS_section_class_t *new_cls; /* New class of section */ @@ -2060,7 +2054,7 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, HDassert(new_class < fspace->nclasses); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -2190,7 +2184,7 @@ HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, TRUE) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, TRUE) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -2199,7 +2193,7 @@ done: #ifdef H5FS_DEBUG_ASSERT /*------------------------------------------------------------------------- - * Function: H5FS_sect_assert + * Function: H5FS__sect_assert * * Purpose: Verify that the sections managed are mostly sane * @@ -2211,13 +2205,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_sect_assert(const H5FS_t *fspace, hid_t dxpl_id) +H5FS__sect_assert(const H5FS_t *fspace) { hsize_t separate_obj; /* The number of separate objects managed */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR #ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_sect_assert", fspace->tot_sect_count); +HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__sect_assert", fspace->tot_sect_count); #endif /* QAK */ /* Initialize state */ @@ -2276,14 +2270,14 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_sect_assert", fspa sect = H5SL_item(curr_sect_node); cls = &fspace->sect_cls[sect->type]; #ifdef QAK -HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H5FS_assert", sect->size, sect->addr, sect->type); +HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H5FS__sect_assert", sect->size, sect->addr, sect->type); #endif /* QAK */ /* Sanity check section */ HDassert(H5F_addr_defined(sect->addr)); HDassert(fspace_node->sect_size == sect->size); if(cls->valid) - (*cls->valid)(cls, sect, dxpl_id); + (*cls->valid)(cls, sect); /* Add to correct count */ if(cls->flags & H5FS_CLS_GHOST_OBJ) @@ -2344,7 +2338,7 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H HDassert(fspace->tot_sect_count == (separate_obj + H5SL_count(fspace->sinfo->merge_list))); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FS_sect_assert() */ +} /* end H5FS__sect_assert() */ #endif /* H5FS_DEBUG_ASSERT */ @@ -2362,7 +2356,7 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H *------------------------------------------------------------------------- */ htri_t -H5FS_sect_try_shrink_eoa(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, void *op_data) +H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data) { hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ hbool_t section_removed = FALSE; /* Whether a section was removed */ @@ -2373,7 +2367,7 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, void *op_data) /* Check arguments. */ HDassert(fspace); - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -2411,7 +2405,7 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, void *op_data) done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, section_removed) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, section_removed) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -2509,8 +2503,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, hid_t dxpl_id, - H5FS_t *fspace, haddr_t *fs_addr_ptr) +H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, + haddr_t *fs_addr_ptr) { hsize_t hdr_alloc_size; hsize_t sinfo_alloc_size; @@ -2578,11 +2572,8 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, hid_t dxpl_id, } /* end if */ /* allocate space for the hdr */ - if(HADDR_UNDEF == (fspace->addr = H5FD_alloc(f->shared->lf, dxpl_id, - H5FD_MEM_FSPACE_HDR, f, - hdr_alloc_size, - &eoa_frag_addr, - &eoa_frag_size))) + if(HADDR_UNDEF == (fspace->addr = H5FD_alloc(f->shared->lf, H5FD_MEM_FSPACE_HDR, + f, hdr_alloc_size, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't allocate file space for hdr") /* if the file alignement is 1, there should be no @@ -2591,7 +2582,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, hid_t dxpl_id, HDassert((eoa_frag_size == 0) || (f->shared->alignment != 1)); /* Cache the new free space header (pinned) */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space header to cache") *fs_addr_ptr = fspace->addr; @@ -2621,11 +2612,8 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, hid_t dxpl_id, } /* end if */ /* allocate space for the section info */ - if(HADDR_UNDEF == (sect_addr = H5FD_alloc(f->shared->lf, dxpl_id, - H5FD_MEM_FSPACE_SINFO, f, - sinfo_alloc_size, - &eoa_frag_addr, - &eoa_frag_size))) + if(HADDR_UNDEF == (sect_addr = H5FD_alloc(f->shared->lf, H5FD_MEM_FSPACE_SINFO, + f, sinfo_alloc_size, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't allocate file space") /* if the file alignement is 1, there should be no @@ -2662,7 +2650,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, hid_t dxpl_id, * * JRM -- 11/4/16 */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_SINFO, sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_SINFO, sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space sinfo to cache") /* We have changed the sinfo address -- Mark free space header dirty */ diff --git a/src/H5Faccum.c b/src/H5Faccum.c index e84cfda..0b33f8e 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -110,31 +110,27 @@ H5FL_BLK_DEFINE_STATIC(meta_accum); *------------------------------------------------------------------------- */ herr_t -H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t addr, +H5F__accum_read(H5F_t *f, H5FD_mem_t map_type, haddr_t addr, size_t size, void *buf/*out*/) { - H5FD_io_info_t fdio_info; /* File driver I/O info */ - herr_t ret_value = SUCCEED; /* Return value */ + H5FD_t *file; /* File driver pointer */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE - HDassert(fio_info); - HDassert(fio_info->f); - HDassert(fio_info->meta_dxpl); - HDassert(fio_info->raw_dxpl); + /* Sanity checks */ + HDassert(f); HDassert(buf); /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + file = f->shared->lf; /* Check if this information is in the metadata accumulator */ - if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) { + if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) { H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */ /* Set up alias for file's metadata accumulator info */ - accum = &fio_info->f->shared->accum; + accum = &f->shared->accum; if(size < H5F_ACCUM_MAX_SIZE) { /* Sanity check */ @@ -183,7 +179,7 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add accum->dirty_off += amount_before; /* Dispatch to driver */ - if(H5FD_read(&fdio_info, map_type, addr, amount_before, accum->buf) < 0) + if(H5FD_read(file, map_type, addr, amount_before, accum->buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end if */ else @@ -197,7 +193,7 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add H5_CHECKED_ASSIGN(amount_after, size_t, ((addr + size) - (accum->loc + accum->size)), hsize_t); /* Dispatch to driver */ - if(H5FD_read(&fdio_info, map_type, (accum->loc + accum->size), amount_after, (accum->buf + accum->size + amount_before)) < 0) + if(H5FD_read(file, map_type, (accum->loc + accum->size), amount_after, (accum->buf + accum->size + amount_before)) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end if */ @@ -211,13 +207,13 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add /* Current read doesn't overlap with metadata accumulator, read it from file */ else { /* Dispatch to driver */ - if(H5FD_read(&fdio_info, map_type, addr, size, buf) < 0) + if(H5FD_read(file, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end else */ } /* end if */ else { /* Read the data */ - if(H5FD_read(&fdio_info, map_type, addr, size, buf) < 0) + if(H5FD_read(file, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") /* Check for overlap w/dirty accumulator */ @@ -260,7 +256,7 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add } /* end if */ else { /* Read the data */ - if(H5FD_read(&fdio_info, map_type, addr, size, buf) < 0) + if(H5FD_read(file, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end else */ @@ -283,7 +279,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info, +H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, H5F_accum_adjust_t adjust, size_t size) { herr_t ret_value = SUCCEED; /* Return value */ @@ -291,7 +287,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info, FUNC_ENTER_STATIC HDassert(accum); - HDassert(fdio_info); + HDassert(file); HDassert(H5F_ACCUM_APPEND == adjust || H5F_ACCUM_PREPEND == adjust); HDassert(size > 0); HDassert(size <= H5F_ACCUM_MAX_SIZE); @@ -349,7 +345,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info, /* Check if the dirty region overlaps the region to eliminate from the accumulator */ if((accum->size - shrink_size) < (accum->dirty_off + accum->dirty_len)) { /* Write out the dirty region from the metadata accumulator, with dispatch to driver */ - if(H5FD_write(fdio_info, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "file write failed") /* Reset accumulator dirty flag */ @@ -360,7 +356,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info, /* Check if the dirty region overlaps the region to eliminate from the accumulator */ if(shrink_size > accum->dirty_off) { /* Write out the dirty region from the metadata accumulator, with dispatch to driver */ - if(H5FD_write(fdio_info, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "file write failed") /* Reset accumulator dirty flag */ @@ -422,32 +418,28 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t addr, +H5F__accum_write(H5F_t *f, H5FD_mem_t map_type, haddr_t addr, size_t size, const void *buf) { - H5FD_io_info_t fdio_info; /* File driver I/O info */ - herr_t ret_value = SUCCEED; /* Return value */ + H5FD_t *file; /* File driver pointer */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(fio_info); - HDassert(fio_info->f); - HDassert(H5F_INTENT(fio_info->f) & H5F_ACC_RDWR); - HDassert(fio_info->meta_dxpl); - HDassert(fio_info->raw_dxpl); + /* Sanity checks */ + HDassert(f); + HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); HDassert(buf); - /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + /* Translate to file driver pointer */ + file = f->shared->lf; /* Check for accumulating metadata */ - if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) { + if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) { H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */ /* Set up alias for file's metadata accumulator info */ - accum = &fio_info->f->shared->accum; + accum = &f->shared->accum; if(size < H5F_ACCUM_MAX_SIZE) { /* Sanity check */ @@ -458,7 +450,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad /* Check if the new metadata adjoins the beginning of the current accumulator */ if((addr + size) == accum->loc) { /* Check if we need to adjust accumulator size */ - if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_PREPEND, size) < 0) + if(H5F__accum_adjust(accum, file, H5F_ACCUM_PREPEND, size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator") /* Move the existing metadata to the proper location */ @@ -483,7 +475,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad /* Check if the new metadata adjoins the end of the current accumulator */ else if(addr == (accum->loc + accum->size)) { /* Check if we need to adjust accumulator size */ - if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_APPEND, size) < 0) + if(H5F__accum_adjust(accum, file, H5F_ACCUM_APPEND, size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator") /* Copy the new metadata to the end */ @@ -543,7 +535,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad H5_CHECKED_ASSIGN(add_size, size_t, (accum->loc - addr), hsize_t); /* Check if we need to adjust accumulator size */ - if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_PREPEND, add_size) < 0) + if(H5F__accum_adjust(accum, file, H5F_ACCUM_PREPEND, add_size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator") /* Calculate the proper offset of the existing metadata */ @@ -583,7 +575,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad H5_CHECKED_ASSIGN(add_size, size_t, (addr + size) - (accum->loc + accum->size), hsize_t); /* Check if we need to adjust accumulator size */ - if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_APPEND, add_size) < 0) + if(H5F__accum_adjust(accum, file, H5F_ACCUM_APPEND, add_size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator") /* Compute offset of dirty region (after adjusting accumulator) */ @@ -649,7 +641,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad else { /* Write out the existing metadata accumulator, with dispatch to driver */ if(accum->dirty) { - if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, accum->loc + accum->dirty_off, accum->dirty_len, accum->buf + accum->dirty_off) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, accum->loc + accum->dirty_off, accum->dirty_len, accum->buf + accum->dirty_off) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") /* Reset accumulator dirty flag */ @@ -739,13 +731,13 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad } /* end if */ else { /* Make certain that data in accumulator is visible before new write */ - if((H5F_INTENT(fio_info->f) & H5F_ACC_SWMR_WRITE) > 0) + if((H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) > 0) /* Flush if dirty and reset accumulator */ - if(H5F__accum_reset(fio_info, TRUE) < 0) + if(H5F__accum_reset(f, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") /* Write the data */ - if(H5FD_write(&fdio_info, map_type, addr, size, buf) < 0) + if(H5FD_write(file, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") /* Check for overlap w/accumulator */ @@ -790,7 +782,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad } /* end if */ else { /* Access covers whole accumulator */ /* Reset accumulator, but don't flush */ - if(H5F__accum_reset(fio_info, FALSE) < 0) + if(H5F__accum_reset(f, FALSE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") } /* end else */ } /* end if */ @@ -830,7 +822,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad } /* end if */ else { /* Write the data */ - if(H5FD_write(&fdio_info, map_type, addr, size, buf) < 0) + if(H5FD_write(file, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") } /* end else */ @@ -854,31 +846,26 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr, +H5F__accum_free(H5F_t *f, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr, hsize_t size) { H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */ - H5FD_io_info_t fdio_info; /* File driver I/O info */ + H5FD_t *file; /* File driver pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(fio_info); - HDassert(fio_info->f); - HDassert(fio_info->meta_dxpl); - HDassert(fio_info->raw_dxpl); + HDassert(f); /* Set up alias for file's metadata accumulator info */ - accum = &fio_info->f->shared->accum; + accum = &f->shared->accum; - /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + /* Translate to file driver pointer */ + file = f->shared->lf; /* Adjust the metadata accumulator to remove the freed block, if it overlaps */ - if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) + if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && H5F_addr_overlap(addr, size, accum->loc, accum->size)) { size_t overlap_size; /* Size of overlap with accumulator */ @@ -949,7 +936,7 @@ H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type, /* Check if block to free is entirely before dirty region */ if(H5F_addr_le(tail_addr, dirty_start)) { /* Write out the entire dirty region of the accumulator */ - if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, dirty_start, accum->dirty_len, accum->buf + accum->dirty_off) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, dirty_start, accum->dirty_len, accum->buf + accum->dirty_off) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") } /* end if */ /* Block to free overlaps with some/all of dirty region */ @@ -964,7 +951,7 @@ H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type, HDassert(write_size > 0); /* Write out the unfreed dirty region of the accumulator */ - if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") } /* end if */ @@ -984,7 +971,7 @@ H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type, HDassert(write_size > 0); /* Write out the unfreed end of the dirty region of the accumulator */ - if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") } /* end if */ @@ -1025,32 +1012,28 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__accum_flush(const H5F_io_info2_t *fio_info) +H5F__accum_flush(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(fio_info); - HDassert(fio_info->f); - HDassert(fio_info->meta_dxpl); - HDassert(fio_info->raw_dxpl); + /* Sanity checks */ + HDassert(f); /* Check if we need to flush out the metadata accumulator */ - if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && fio_info->f->shared->accum.dirty) { - H5FD_io_info_t fdio_info; /* File driver I/O info */ + if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && f->shared->accum.dirty) { + H5FD_t *file; /* File driver pointer */ - /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + /* Translate to file driver pointer */ + file = f->shared->lf; /* Flush the metadata contents */ - if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, fio_info->f->shared->accum.loc + fio_info->f->shared->accum.dirty_off, fio_info->f->shared->accum.dirty_len, fio_info->f->shared->accum.buf + fio_info->f->shared->accum.dirty_off) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, f->shared->accum.loc + f->shared->accum.dirty_off, f->shared->accum.dirty_len, f->shared->accum.buf + f->shared->accum.dirty_off) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") /* Reset the dirty flag */ - fio_info->f->shared->accum.dirty = FALSE; + f->shared->accum.dirty = FALSE; } /* end if */ done: @@ -1072,34 +1055,34 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__accum_reset(const H5F_io_info2_t *fio_info, hbool_t flush) +H5F__accum_reset(H5F_t *f, hbool_t flush) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE - HDassert(fio_info); - HDassert(fio_info->f); + /* Sanity checks */ + HDassert(f); /* Flush any dirty data in accumulator, if requested */ if(flush) - if(H5F__accum_flush(fio_info) < 0) + if(H5F__accum_flush(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "can't flush metadata accumulator") /* Check if we need to reset the metadata accumulator information */ - if(fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) { + if(f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) { /* Sanity check */ - HDassert(!fio_info->f->closing || FALSE == fio_info->f->shared->accum.dirty); + HDassert(!f->closing || FALSE == f->shared->accum.dirty); /* Free the buffer */ - if(fio_info->f->shared->accum.buf) - fio_info->f->shared->accum.buf = H5FL_BLK_FREE(meta_accum, fio_info->f->shared->accum.buf); + if(f->shared->accum.buf) + f->shared->accum.buf = H5FL_BLK_FREE(meta_accum, f->shared->accum.buf); /* Reset the buffer sizes & location */ - fio_info->f->shared->accum.alloc_size = fio_info->f->shared->accum.size = 0; - fio_info->f->shared->accum.loc = HADDR_UNDEF; - fio_info->f->shared->accum.dirty = FALSE; - fio_info->f->shared->accum.dirty_len = 0; + f->shared->accum.alloc_size = f->shared->accum.size = 0; + f->shared->accum.loc = HADDR_UNDEF; + f->shared->accum.dirty = FALSE; + f->shared->accum.dirty_len = 0; } /* end if */ done: diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c index 04b86d2..aa5f8ab 100644 --- a/src/H5Fcwfs.c +++ b/src/H5Fcwfs.c @@ -159,7 +159,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_cwfs_find_free_heap(H5F_t *f, hid_t dxpl_id, size_t need, haddr_t *addr) +H5F_cwfs_find_free_heap(H5F_t *f, size_t need, haddr_t *addr) { unsigned cwfsno; /* Local index for iterating over collections */ hbool_t found = FALSE; /* Flag to indicate a heap with enough space was found */ @@ -210,11 +210,11 @@ H5F_cwfs_find_free_heap(H5F_t *f, hid_t dxpl_id, size_t need, haddr_t *addr) if((H5HG_SIZE(f->shared->cwfs[cwfsno]) + new_need) <= H5HG_MAXSIZE) { htri_t was_extended; /* Whether the heap was extended */ - was_extended = H5MF_try_extend(f, dxpl_id, H5FD_MEM_GHEAP, H5HG_ADDR(f->shared->cwfs[cwfsno]), (hsize_t)H5HG_SIZE(f->shared->cwfs[cwfsno]), (hsize_t)new_need); + was_extended = H5MF_try_extend(f, H5FD_MEM_GHEAP, H5HG_ADDR(f->shared->cwfs[cwfsno]), (hsize_t)H5HG_SIZE(f->shared->cwfs[cwfsno]), (hsize_t)new_need); if(was_extended < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "error trying to extend heap") else if(was_extended == TRUE) { - if(H5HG_extend(f, dxpl_id, H5HG_ADDR(f->shared->cwfs[cwfsno]), new_need) < 0) + if(H5HG_extend(f, H5HG_ADDR(f->shared->cwfs[cwfsno]), new_need) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to extend global heap collection") *addr = H5HG_ADDR(f->shared->cwfs[cwfsno]); found = TRUE; diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 03f5df8..cbbd16f 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -36,6 +36,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5Iprivate.h" /* IDs */ @@ -100,6 +101,8 @@ herr_t H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) { H5F_t *f; /* Top file in mount hierarchy */ + H5F_info2_t finfo2; /* Current file info struct */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -127,19 +130,23 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) } /* end else */ HDassert(f->shared); - /* Reset file info struct */ - HDmemset(finfo, 0, sizeof(*finfo)); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; - /* Get the size of the superblock extension */ - if(H5F__super_size(f, H5AC_ind_read_dxpl_id, NULL, &finfo->super_ext_size) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve superblock extension size") + /* Get the current file info */ + if(H5F__get_info(f, &finfo2) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info") - /* Check for SOHM info */ - if(H5F_addr_defined(f->shared->sohm_addr)) - if(H5SM_ih_size(f, H5AC_ind_read_dxpl_id, &finfo->sohm.hdr_size, &finfo->sohm.msgs_info) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve SOHM index & heap storage info") + /* Copy the compatible fields into the older struct */ + finfo->super_ext_size = finfo2.super.super_ext_size; + finfo->sohm.hdr_size = finfo2.sohm.hdr_size; + finfo->sohm.msgs_info = finfo2.sohm.msgs_info; done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_info1() */ diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 5652d15..45b1379 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -57,14 +57,15 @@ struct H5F_efc_t { unsigned nfiles; /* Size of the external file cache */ unsigned max_nfiles; /* Maximum size of the external file cache */ unsigned nrefs; /* Number of times this file appears in another file's EFC */ - int tag; /* Temporary variable used by H5F_efc_try_close() */ - H5F_file_t *tmp_next; /* Next file in temporary list used by H5F_efc_try_close() */ + int tag; /* Temporary variable used by H5F__efc_try_close() */ + H5F_file_t *tmp_next; /* Next file in temporary list used by H5F__efc_try_close() */ }; /* Private prototypes */ -static herr_t H5F_efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent); -static void H5F_efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail); -static void H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail); +static herr_t H5F__efc_release_real(H5F_efc_t *efc); +static herr_t H5F__efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent); +static void H5F__efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail); +static void H5F__efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail); /* Free lists */ H5FL_DEFINE_STATIC(H5F_efc_ent_t); @@ -76,7 +77,7 @@ H5FL_DEFINE_STATIC(H5F_efc_t); * * Purpose: Allocate and initialize a new external file cache object, * which can the be used to cache open external files. - * the object must be freed with H5F_efc_destroy. + * the object must be freed with H5F__efc_destroy. * * Return: Pointer to new external file cache object on success * NULL on failure @@ -139,7 +140,7 @@ done: */ H5F_t * H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, - hid_t fapl_id, hid_t dxpl_id) + hid_t fapl_id) { H5F_efc_t *efc = NULL; /* External file cache for parent file */ H5F_efc_ent_t *ent = NULL; /* Entry for target file in efc */ @@ -160,7 +161,7 @@ H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, * support this so clients do not have to make 2 different calls depending * on the state of the efc. */ if(!efc) { - if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id, dxpl_id))) + if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file") /* Increment the number of open objects to prevent the file from being @@ -225,14 +226,14 @@ H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, /* Evict the file if found, otherwise just open the target file and * do not add it to cache */ if(ent) { - if(H5F_efc_remove_ent(efc, ent) < 0) + if(H5F__efc_remove_ent(efc, ent) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTREMOVE, NULL, "can't remove entry from external file cache") /* Do not free ent, we will recycle it below */ } /* end if */ else { /* Cannot cache file, just open file and return */ - if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id, dxpl_id))) + if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file") /* Increment the number of open objects to prevent the file from @@ -253,7 +254,7 @@ H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Open the file */ - if(NULL == (ent->file = H5F_open(name, flags, fcpl_id, fapl_id, dxpl_id))) + if(NULL == (ent->file = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file") open_file = TRUE; @@ -400,7 +401,7 @@ H5F_efc_max_nfiles(H5F_efc_t *efc) /*------------------------------------------------------------------------- - * Function: H5F_efc_release + * Function: H5F__efc_release_real * * Purpose: Releases the external file cache, potentially closing any * cached files unless they are held open from somewhere @@ -414,14 +415,14 @@ H5F_efc_max_nfiles(H5F_efc_t *efc) * *------------------------------------------------------------------------- */ -herr_t -H5F_efc_release(H5F_efc_t *efc) +static herr_t +H5F__efc_release_real(H5F_efc_t *efc) { H5F_efc_ent_t *ent = NULL; /* EFC entry */ H5F_efc_ent_t *prev_ent = NULL; /* Previous EFC entry */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(efc); @@ -429,7 +430,7 @@ H5F_efc_release(H5F_efc_t *efc) /* Lock the EFC to prevent manipulation of the EFC wile we are releasing it. * The EFC should never be locked when we enter this function because that * would require a cycle, a cycle would necessarily invoke - * H5F_efc_try_close(), and that function checks the status of the lock + * H5F__efc_try_close(), and that function checks the status of the lock * before calling this one. */ HDassert((efc->tag == H5F_EFC_TAG_DEFAULT) || (efc->tag == H5F_EFC_TAG_CLOSE)); @@ -440,7 +441,7 @@ H5F_efc_release(H5F_efc_t *efc) ent = efc->LRU_head; while(ent) if(!ent->nopen) { - if(H5F_efc_remove_ent(efc, ent) < 0) + if(H5F__efc_remove_ent(efc, ent) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTREMOVE, FAIL, "can't remove entry from external file cache") /* Free the entry and move to next entry in LRU list */ @@ -458,11 +459,45 @@ H5F_efc_release(H5F_efc_t *efc) done: FUNC_LEAVE_NOAPI(ret_value); +} /* end H5F__efc_release_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__efc_release + * + * Purpose: Releases the external file cache, potentially closing any + * cached files unless they are held open from somewhere + * else (or are currently opened by a client). + * + * Return: Non-negative on success + * Negative on failure + * + * Programmer: Quincey Koziol + * Sunday, February 18, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__efc_release(H5F_efc_t *efc) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity checks */ + HDassert(efc); + + /* Call 'real' routine */ + if(H5F__efc_release_real(efc) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't remove entry from external file cache") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5F_efc_release() */ /*------------------------------------------------------------------------- - * Function: H5F_efc_destroy + * Function: H5F__efc_destroy * * Purpose: Frees an external file cache object, releasing it first * if necessary. If it cannot be fully released, for example @@ -477,18 +512,18 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_efc_destroy(H5F_efc_t *efc) +H5F__efc_destroy(H5F_efc_t *efc) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity checks */ HDassert(efc); if(efc->nfiles > 0) { /* Release (clear) the efc */ - if(H5F_efc_release(efc) < 0) + if(H5F__efc_release_real(efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") /* If there are still cached files, return an error */ @@ -510,11 +545,11 @@ H5F_efc_destroy(H5F_efc_t *efc) done: FUNC_LEAVE_NOAPI(ret_value); -} /* end H5F_efc_destroy() */ +} /* end H5F__efc_destroy() */ /*------------------------------------------------------------------------- - * Function: H5F_efc_remove_ent + * Function: H5F__efc_remove_ent * * Purpose: Removes the specified entry from the specified EFC, * closing the file if requested. Does not free the entry. @@ -528,11 +563,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent) +H5F__efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(efc); @@ -576,11 +611,11 @@ H5F_efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_efc_remove_ent() */ +} /* end H5F__efc_remove_ent() */ /*------------------------------------------------------------------------- - * Function: H5F_efc_try_close_tag1 + * Function: H5F__efc_try_close_tag1 * * Purpose: Recursively traverse the EFC tree, keeping a temporary * reference count on each file that assumes all reachable @@ -594,12 +629,12 @@ done: *------------------------------------------------------------------------- */ static void -H5F_efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail) +H5F__efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail) { H5F_efc_ent_t *ent = NULL; /* EFC entry */ H5F_file_t *esf; /* Convenience pointer to ent->file->shared */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(sf); @@ -644,17 +679,17 @@ H5F_efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail) } /* end if */ /* Recurse into the entry */ - H5F_efc_try_close_tag1(ent->file->shared, tail); + H5F__efc_try_close_tag1(ent->file->shared, tail); } /* end if */ } /* end if */ } /* end for */ FUNC_LEAVE_NOAPI_VOID -} /* end H5F_efc_try_close_tag1() */ +} /* end H5F__efc_try_close_tag1() */ /*------------------------------------------------------------------------- - * Function: H5F_efc_try_close_tag2 + * Function: H5F__efc_try_close_tag2 * * Purpose: Recuresively mark all files reachable through this one as * uncloseable, and add newly uncloseable files to the tail @@ -668,12 +703,12 @@ H5F_efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail) *------------------------------------------------------------------------- */ static void -H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) +H5F__efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) { H5F_efc_ent_t *ent = NULL; /* EFC entry */ H5F_file_t *esf; /* Convenience pointer to ent->file->shared */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(sf); @@ -715,17 +750,17 @@ H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) } /* end if */ /* Recurse into the entry */ - H5F_efc_try_close_tag2(esf, tail); + H5F__efc_try_close_tag2(esf, tail); } /* end if */ } /* end if */ } /* end for */ FUNC_LEAVE_NOAPI_VOID -} /* end H5F_efc_try_close_tag2() */ +} /* end H5F__efc_try_close_tag2() */ /*------------------------------------------------------------------------- - * Function: H5F_efc_try_close + * Function: H5F__efc_try_close * * Purpose: Attempts to close the provided (shared) file by checking * to see if the releasing the EFC would cause its reference @@ -741,7 +776,7 @@ H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) * "callback" for the final pass (the one where the files are * actually closed). The code for the callback case is at * the top of this function; luckily it only consists of a - * (possible) call to H5F_efc_release(). + * (possible) call to H5F__efc_release_real(). * * The algorithm basically consists of 3 passes over the EFC * tree. The first pass assumes that every reachable file is @@ -757,8 +792,8 @@ H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) * closeable only because the first pass assumed that an * uncloseable file would be closed. * - * The final pass exploits the H5F_efc_release()-> - * H5F_efc_remove_ent()->H5F_try_close()->H5F_efc_try_close() + * The final pass exploits the H5F__efc_release_real()-> + * H5F_efc_remove_ent()->H5F_try_close()->H5F__efc_try_close() * calling chain to recursively close the tree, but only the * files that are still marked as closeable. All files * marked as closeable have their EFCs released, and will @@ -775,7 +810,7 @@ H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) *------------------------------------------------------------------------- */ herr_t -H5F_efc_try_close(H5F_t *f) +H5F__efc_try_close(H5F_t *f) { H5F_file_t *tail; /* Tail of linked list of found files. Head will be f->shared. */ H5F_file_t *uncloseable_head = NULL; /* Head of linked list of files found to be uncloseable by the first pass */ @@ -798,8 +833,8 @@ H5F_efc_try_close(H5F_t *f) /* We must have reentered this function, and we should close this file. * In actuality, we just release the EFC, the recursion should * eventually reduce this file's reference count to 1 (though possibly - * not from this call to H5F_efc_release()). */ - if(H5F_efc_release(f->shared->efc) < 0) + * not from this call to H5F__efc_release_real()). */ + if(H5F__efc_release_real(f->shared->efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") /* If we marked the file as closeable, there must be no open files in @@ -816,7 +851,7 @@ H5F_efc_try_close(H5F_t *f) /* Conditions where we should not do anything and just return immediately */ /* If there are references that are not from an EFC or f, it will never * be possible to close the file. Just return. Note that this holds true - * for the case that this file is being closed through H5F_efc_release() + * for the case that this file is being closed through H5F__efc_release_real() * because that function (through H5F_efc_remove_ent()) decrements the EFC * reference count before it calls H5F_try_close(). This may occur if this * function is reentered. */ @@ -851,7 +886,7 @@ H5F_efc_try_close(H5F_t *f) * field to keep track of final reference count for each file (including * this one). Keep list of files with starting reference count > 1 (head is * f->shared). */ - H5F_efc_try_close_tag1(f->shared, &tail); + H5F__efc_try_close_tag1(f->shared, &tail); /* Check if f->shared->efc->tag dropped to 0. If it did not, * we cannot close anything. Just reset temporary values and return. */ @@ -909,7 +944,7 @@ H5F_efc_try_close(H5F_t *f) tail = uncloseable_tail; HDassert(tail); while(sf != tail->efc->tmp_next) { - H5F_efc_try_close_tag2(sf, &uncloseable_tail); + H5F__efc_try_close_tag2(sf, &uncloseable_tail); sf = sf->efc->tmp_next; } /* end while */ } /* end if */ @@ -918,7 +953,7 @@ H5F_efc_try_close(H5F_t *f) * should start the recursive release that should close all closeable files. * Also, see the top of this function. */ if(f->shared->efc->tag == H5F_EFC_TAG_CLOSE) { - if(H5F_efc_release(f->shared->efc) < 0) + if(H5F__efc_release_real(f->shared->efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") /* Make sure the file's reference count is now 1 and will be closed by @@ -941,5 +976,5 @@ H5F_efc_try_close(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_efc_try_close() */ +} /* end H5F__efc_try_close() */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 0eb1ea9..203d720 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -74,8 +74,8 @@ typedef struct H5F_olist_t { static int H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key); static herr_t H5F_build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *name, char ** /*out*/ actual_name);/* Declare a free list to manage the H5F_t struct */ -static herr_t H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id); -static herr_t H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing); +static herr_t H5F__flush_phase1(H5F_t *f); +static herr_t H5F__flush_phase2(H5F_t *f, hbool_t closing); /*********************/ @@ -494,28 +494,20 @@ done: *------------------------------------------------------------------------- */ htri_t -H5F__is_hdf5(const char *name, hid_t meta_dxpl_id, hid_t raw_dxpl_id) +H5F__is_hdf5(const char *name) { H5FD_t *file = NULL; /* Low-level file struct */ - H5FD_io_info_t fdio_info; /* File driver I/O info */ haddr_t sig_addr; /* Addess of hdf5 file signature */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Open the file at the virtual file layer */ if(NULL == (file = H5FD_open(name, H5F_ACC_RDONLY, H5P_FILE_ACCESS_DEFAULT, HADDR_UNDEF))) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file") - - /* Set up the file driver info */ - fdio_info.file = file; - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(raw_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") + HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file") /* The file is an hdf5 file if the hdf5 file signature can be found */ - if(H5FD_locate_signature(&fdio_info, &sig_addr) < 0) + if(H5FD_locate_signature(file, &sig_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") ret_value = (HADDR_UNDEF != sig_addr); @@ -525,7 +517,7 @@ done: if(H5FD_close(file) < 0 && ret_value >= 0) HDONE_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file") - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5F__is_hdf5() */ @@ -778,7 +770,7 @@ done: if(!shared) { /* Attempt to clean up some of the shared file structures */ if(f->shared->efc) - if(H5F_efc_destroy(f->shared->efc) < 0) + if(H5F__efc_destroy(f->shared->efc) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, NULL, "can't destroy external file cache") if(f->shared->fcpl_id > 0) if(H5I_dec_ref(f->shared->fcpl_id) < 0) @@ -805,7 +797,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) +H5F__dest(H5F_t *f, hbool_t flush) { herr_t ret_value = SUCCEED; /* Return value */ @@ -817,14 +809,13 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) if(1 == f->shared->nrefs) { int actype; /* metadata cache type (enum value) */ - H5F_io_info2_t fio_info; /* I/O info for operation */ /* Flush at this point since the file will be closed (phase 1). * Only try to flush the file if it was opened with write access, and if * the caller requested a flush. */ if((H5F_ACC_RDWR & H5F_INTENT(f)) && flush) - if(H5F__flush_phase1(f, meta_dxpl_id) < 0) + if(H5F__flush_phase1(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cached data (phase 1)") @@ -832,7 +823,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * This allows the cache to set up for creating a metadata cache * image if this has been requested. */ - if(H5AC_prep_for_file_close(f, meta_dxpl_id) < 0) + if(H5AC_prep_for_file_close(f) < 0) /* Push error, but keep going */ HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "metadata cache prep for close failed") @@ -841,7 +832,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * the caller requested a flush. */ if((H5F_ACC_RDWR & H5F_INTENT(f)) && flush) - if(H5F__flush_phase2(f, meta_dxpl_id, raw_dxpl_id, TRUE) < 0) + if(H5F__flush_phase2(f, TRUE) < 0) /* Push error, but keep going */ HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cached data (phase 2)") @@ -855,7 +846,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) /* Release the external file cache */ if(f->shared->efc) { - if(H5F_efc_destroy(f->shared->efc) < 0) + if(H5F__efc_destroy(f->shared->efc) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't destroy external file cache") f->shared->efc = NULL; @@ -888,7 +879,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * -- JRM */ if(H5F_ACC_RDWR & H5F_INTENT(f)) { - if(H5MF_close(f, meta_dxpl_id) < 0) + if(H5MF_close(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file free space info") @@ -906,7 +897,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) f->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_SWMR_WRITE_ACCESS); /* Mark EOA info dirty in cache, so change will get encoded */ - if(H5F_eoa_dirty(f, meta_dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") @@ -917,12 +908,12 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * At most, this should change the superblock or the * superblock extension messages. */ - if(H5MF_free_aggrs(f, meta_dxpl_id) < 0) + if(H5MF_free_aggrs(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file space") /* Truncate the file to the current allocated size */ - if(H5FD_truncate(f->shared->lf, meta_dxpl_id, TRUE) < 0) + if(H5FD_truncate(f->shared->lf, TRUE) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") @@ -961,19 +952,12 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file") /* Shutdown the metadata cache */ - if(H5AC_dest(f, meta_dxpl_id)) + if(H5AC_dest(f)) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file") - /* Set up I/O info for operation */ - fio_info.f = f; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - /* Shutdown the page buffer cache */ - if(H5PB_dest(&fio_info) < 0) + if(H5PB_dest(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing page buffer cache") @@ -994,7 +978,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) } /* end if */ /* Destroy other components of the file */ - if(H5F__accum_reset(&fio_info, TRUE) < 0) + if(H5F__accum_reset(f, TRUE) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file") if(H5FO_dest(f) < 0) @@ -1049,7 +1033,79 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) f = H5FL_FREE(H5F_t, f); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_dest() */ +} /* end H5F__dest() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__create + * + * Purpose: Internal routine to create a file. + * + * Note: This routine is needed so that there's a non-API routine for + * creating files that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-NULL, pointer to new file object. + * Failure: NULL + * + * Programmer: Quincey Koziol + * December 13, 2017 + * + *------------------------------------------------------------------------- + */ +H5F_t * +H5F__create(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) +{ + H5F_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(filename); + + /* Create a new file or truncate an existing file. */ + if(NULL == (ret_value = H5F_open(filename, flags, fcpl_id, fapl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__create() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__open + * + * Purpose: Internal routine to open a file. + * + * Note: This routine is needed so that there's a non-API routine for + * opening files that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-NULL, pointer to new file object. + * Failure: NULL + * + * Programmer: Quincey Koziol + * December 13, 2017 + * + *------------------------------------------------------------------------- + */ +H5F_t * +H5F__open(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) +{ + H5F_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(filename); + + /* Open the file */ + if(NULL == (ret_value = H5F_open(filename, flags, fcpl_id, fapl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__open() */ /*------------------------------------------------------------------------- @@ -1126,8 +1182,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) *------------------------------------------------------------------------- */ H5F_t * -H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, - hid_t meta_dxpl_id) +H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { H5F_t *file = NULL; /*the success return value */ H5F_file_t *shared = NULL; /*shared part of `file' */ @@ -1136,7 +1191,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_class_t *drvr; /*file driver class info */ H5P_genplist_t *a_plist; /*file access property list */ H5F_close_degree_t fc_degree; /*file close degree */ - hid_t raw_dxpl_id = H5AC_rawdata_dxpl_id; /* Raw data dxpl used by library */ size_t page_buf_size; unsigned page_buf_min_meta_perc; unsigned page_buf_min_raw_perc; @@ -1334,19 +1388,19 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, /* Initialize information about the superblock and allocate space for it */ /* (Writes superblock extension messages, if there are any) */ - if(H5F__super_init(file, meta_dxpl_id) < 0) + if(H5F__super_init(file) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to allocate file superblock") /* Create and open the root group */ /* (This must be after the space for the superblock is allocated in * the file, since the superblock must be at offset 0) */ - if(H5G_mkroot(file, meta_dxpl_id, TRUE) < 0) + if(H5G_mkroot(file, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create/open root group") } /* end if */ else if (1 == shared->nrefs) { /* Read the superblock if it hasn't been read before. */ - if(H5F__super_read(file, meta_dxpl_id, raw_dxpl_id, TRUE) < 0) + if(H5F__super_read(file, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") /* Create the page buffer before initializing the superblock */ @@ -1355,7 +1409,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create page buffer") /* Open the root group */ - if(H5G_mkroot(file, meta_dxpl_id, FALSE) < 0) + if(H5G_mkroot(file, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root group") } /* end if */ @@ -1429,9 +1483,9 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, /* 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) + if(H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG) < 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) + if(H5F_flush_tagged_metadata(file, file->shared->sblock->ext_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, NULL, "unable to flush superblock extension") /* Remove the file lock for SWMR_WRITE */ @@ -1463,7 +1517,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, done: if((NULL == ret_value) && file) - if(H5F__dest(file, meta_dxpl_id, raw_dxpl_id, FALSE) < 0) + if(H5F__dest(file, FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") FUNC_LEAVE_NOAPI(ret_value) @@ -1479,7 +1533,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id) +H5F__flush_phase1(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1489,7 +1543,7 @@ H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id) HDassert(f); /* Flush any cached dataset storage raw data */ - if(H5D_flush(f, meta_dxpl_id) < 0) + if(H5D_flush_all(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush dataset cache") @@ -1499,7 +1553,7 @@ H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id) /* (needs to happen before cache flush, with superblock write, since the * 'eoa' value is written in superblock -QAK) */ - if(H5MF_free_aggrs(f, meta_dxpl_id) < 0) + if(H5MF_free_aggrs(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file space") @@ -1516,9 +1570,8 @@ H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id) *------------------------------------------------------------------------- */ static herr_t -H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing) +H5F__flush_phase2(H5F_t *f, hbool_t closing) { - H5F_io_info2_t fio_info; /* I/O info for operation */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1527,41 +1580,32 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi HDassert(f); /* Flush the entire metadata cache */ - if(H5AC_flush(f, meta_dxpl_id) < 0) + if(H5AC_flush(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") /* Truncate the file to the current allocated size */ - if(H5FD_truncate(f->shared->lf, meta_dxpl_id, closing) < 0) + if(H5FD_truncate(f->shared->lf, closing) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") /* Flush the entire metadata cache again since the EOA could have changed in the truncate call. */ - if(H5AC_flush(f, meta_dxpl_id) < 0) + if(H5AC_flush(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") - /* Set up I/O info for operation */ - fio_info.f = f; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - /* Push error, but keep going*/ - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(raw_dxpl_id))) - /* Push error, but keep going*/ - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - /* Flush out the metadata accumulator */ - if(H5F__accum_flush(&fio_info) < 0) + if(H5F__accum_flush(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush metadata accumulator") /* Flush the page buffer */ - if(H5PB_flush(&fio_info) < 0) + if(H5PB_flush(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "page buffer flush failed") /* Flush file buffers to disk. */ - if(H5FD_flush(f->shared->lf, meta_dxpl_id, closing) < 0) + if(H5FD_flush(f->shared->lf, closing) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "low level flush failed") @@ -1570,7 +1614,7 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi /*------------------------------------------------------------------------- - * Function: H5F__flush + * Function: H5F__flush_real * * Purpose: Flushes cached data. * @@ -1578,7 +1622,7 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi *------------------------------------------------------------------------- */ herr_t -H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing) +H5F__flush_real(H5F_t *f, hbool_t closing) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1588,45 +1632,137 @@ H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing) HDassert(f); /* First phase of flushing data */ - if(H5F__flush_phase1(f, meta_dxpl_id) < 0) + if(H5F__flush_phase1(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush file data") /* Second phase of flushing data */ - if(H5F__flush_phase2(f, meta_dxpl_id, raw_dxpl_id, closing) < 0) + if(H5F__flush_phase2(f, closing) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush file data") FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__flush_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__flush + * + * Purpose: Internal routine to flush a file. + * + * Note: This routine is needed so that there's a non-API routine for + * flushing files that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * December 13, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__flush(H5F_t *f, H5F_scope_t scope) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + /* Flush other files, depending on scope */ + if(H5F_SCOPE_GLOBAL == scope) { + /* Call the flush routine for mounted file hierarchies */ + if(H5F_flush_mounts(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") + } /* end if */ + else { + /* Call the flush routine, for this file */ + if(H5F__flush_real(f, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") + } /* end else */ + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5F__flush() */ /*------------------------------------------------------------------------- - * Function: H5F_close + * Function: H5F__close + * + * Purpose: Internal routine to close a file. + * + * Note: This routine is needed so that there's a non-API routine for + * closing files that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * December 16, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__close(hid_t file_id) +{ + H5F_t *f; /* File pointer */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Flush file if this is the last reference to this id and we have write + * intent, unless it will be flushed by the "shared" file being closed. + * This is only necessary to replicate previous behaviour, and could be + * disabled by an option/property to improve performance. + */ + if(NULL == (f = (H5F_t *)H5I_object(file_id))) + HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "invalid file identifier") + if((f->shared->nrefs > 1) && (H5F_INTENT(f) & H5F_ACC_RDWR)) { + int nref; /* Number of references to file ID */ + + if((nref = H5I_get_ref(file_id, FALSE)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get ID ref count") + if(nref == 1) + if(H5F__flush_real(f, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cache") + } /* end if */ + + /* Decrement reference count on file ID */ + /* (When it reaches zero the file will be closed) */ + if(H5I_dec_app_ref(file_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "decrementing file ID failed") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__close() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__close_cb * * Purpose: Closes a file or causes the close operation to be pended. - * This function is called two ways: from the API it gets called - * by H5Fclose->H5I_dec_ref->H5F_close when H5I_dec_ref() + * This function is called from the API and gets called + * by H5Fclose->H5I_dec_ref->H5F__close_cb when H5I_dec_ref() * decrements the file ID reference count to zero. The file ID * is removed from the H5I_FILE group by H5I_dec_ref() just - * before H5F_close() is called. If there are open object + * before H5F__close_cb() is called. If there are open object * headers then the close is pended by moving the file to the * H5I_FILE_CLOSING ID group (the f->closing contains the ID * assigned to file). * - * This function is also called directly from H5O_close() when - * the last object header is closed for the file and the file - * has a pending close. - * * Return: Non-negative on success/Negative on failure + * *------------------------------------------------------------------------- */ herr_t -H5F_close(H5F_t *f) +H5F__close_cb(H5F_t *f) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Sanity check */ HDassert(f); @@ -1658,8 +1794,8 @@ H5F_close(H5F_t *f) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_close() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__close_cb() */ /*------------------------------------------------------------------------- @@ -1671,6 +1807,7 @@ done: * - The file was unmounted * * Return: Non-negative on success/Negative on failure + * *------------------------------------------------------------------------- */ herr_t @@ -1805,14 +1942,14 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close parent file") /* Unmount and close each child before closing the current file. */ - if(H5F_close_mounts(f) < 0) + if(H5F__close_mounts(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't unmount child files") /* If there is more than one reference to the shared file struct and the * file has an external file cache, we should see if it can be closed. This * can happen if a cycle is formed with external file caches */ if(f->shared->efc && (f->shared->nrefs > 1)) - if(H5F_efc_try_close(f) < 0) + if(H5F__efc_try_close(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't attempt to close EFC") /* Delay flush until the shared file struct is closed, in H5F__dest. If the @@ -1824,7 +1961,7 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) * shared H5F_file_t struct. If the reference count for the H5F_file_t * struct reaches zero then destroy it also. */ - if(H5F__dest(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, TRUE) < 0) + if(H5F__dest(f, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file") /* Since we closed the file, this should be set to TRUE */ @@ -2314,23 +2451,57 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) /*------------------------------------------------------------------------- - * Function: H5F_get_file_image + * Function: H5F__get_freespace + * + * Purpose: Private version of H5Fget_freespace + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: SUCCEED + * Failure: FAIL + *------------------------------------------------------------------------- + */ +herr_t +H5F__get_freespace(H5F_t *f, hsize_t *tot_space) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + /* Go get the actual amount of free space in the file */ + if(H5MF_get_freespace(f, tot_space, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__get_freespace() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__get_file_image * * Purpose: Private version of H5Fget_file_image * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * * Return: Success: Bytes copied / number of bytes needed. * Failure: negative value *------------------------------------------------------------------------- */ ssize_t -H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_id, - hid_t raw_dxpl_id) +H5F__get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len) { H5FD_t *fd_ptr; /* file driver */ haddr_t eoa; /* End of file address */ ssize_t ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Check args */ if(!file || !file->shared || !file->shared->lf) @@ -2391,7 +2562,6 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_i /* test to see if a buffer was provided -- if not, we are done */ if(buf_ptr != NULL) { - H5FD_io_info_t fdio_info; /* File driver I/O info */ size_t space_needed; /* size of file image */ hsize_t tmp; size_t tmp_size; @@ -2402,16 +2572,9 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_i space_needed = (size_t)eoa; - /* Set up file driver I/O info object */ - fdio_info.file = fd_ptr; - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get property list object") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(raw_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get property list object") - /* read in the file image */ /* (Note compensation for base address addition in internal routine) */ - if(H5FD_read(&fdio_info, H5FD_MEM_DEFAULT, 0, space_needed, buf_ptr) < 0) + if(H5FD_read(fd_ptr, H5FD_MEM_DEFAULT, 0, space_needed, buf_ptr) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, FAIL, "file image read request failed") /* Offset to "status_flags" in the superblock */ @@ -2425,8 +2588,58 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_i } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_get_file_image() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__get_file_image() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__get_info + * + * Purpose: Private version of H5Fget_info + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: SUCCEED + * Failure: FAIL + *------------------------------------------------------------------------- + */ +herr_t +H5F__get_info(H5F_t *f, H5F_info2_t *finfo) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + HDassert(finfo); + + /* Reset file info struct */ + HDmemset(finfo, 0, sizeof(*finfo)); + + /* Get the size of the superblock and any superblock extensions */ + if(H5F__super_size(f, &finfo->super.super_size, &finfo->super.super_ext_size) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve superblock sizes") + + /* Get the size of any persistent free space */ + if(H5MF_get_freespace(f, &finfo->free.tot_space, &finfo->free.meta_size) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve free space information") + + /* Check for SOHM info */ + if(H5F_addr_defined(f->shared->sohm_addr)) + if(H5SM_ih_size(f, &finfo->sohm.hdr_size, &finfo->sohm.msgs_info) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve SOHM index & heap storage info") + + /* Set version # fields */ + finfo->super.version = f->shared->sblock->super_vers; + finfo->sohm.version = f->shared->sohm_vers; + finfo->free.version = HDF5_FREESPACE_VERSION; + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__get_info() */ /*------------------------------------------------------------------------- @@ -2514,6 +2727,39 @@ H5F_set_retries(H5F_t *f) /*------------------------------------------------------------------------- + * Function: H5F__get_free_sections + * + * Purpose: Private version of H5Fget_free_sections + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: non-negative, the total # of free space sections + * Failure: negative + *------------------------------------------------------------------------- + */ +ssize_t +H5F__get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, + H5F_sect_info_t *sect_info) +{ + ssize_t ret_value = -1; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + /* Go get the actual amount of free space in the file */ + if((ret_value = H5MF_get_free_sections(f, type, nsects, sect_info)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get free space sections for file") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__get_free_sections() */ + + +/*------------------------------------------------------------------------- * Function: H5F_object_flush_cb * * Purpose: To invoke the callback function for object flush that is set @@ -2676,3 +2922,244 @@ H5F_set_latest_flags(H5F_t *f, unsigned flags) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_latest_flags() */ + +/*------------------------------------------------------------------------- + * Function: H5F__start_swmr_write + * + * Purpose: Private version of H5Fstart_swmr_write + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: SUCCEED + * Failure: FAIL + *------------------------------------------------------------------------- + */ +herr_t +H5F__start_swmr_write(H5F_t *f) +{ + size_t grp_dset_count = 0; /* # of open objects: groups & datasets */ + size_t nt_attr_count = 0; /* # of opened named datatypes + opened attributes */ + hid_t *obj_ids = NULL; /* List of ids */ + H5G_loc_t *obj_glocs = NULL;/* Group location of the object */ + H5O_loc_t *obj_olocs = NULL;/* Object location */ + H5G_name_t *obj_paths = NULL; /* Group hierarchy path */ + size_t u; /* Local index variable */ + hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + /* Flush the superblock extension */ + if(H5F_flush_tagged_metadata(f, f->shared->sblock->ext_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock extension") + + /* Flush data buffers */ + if(H5F__flush_real(f, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush f's cached information") + + /* Get the # of opened named datatypes and attributes */ + if(H5F_get_obj_count(f, H5F_OBJ_DATATYPE|H5F_OBJ_ATTR, FALSE, &nt_attr_count) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") + if(nt_attr_count) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "named datatypes and/or attributes opened in the file") + + /* Get the # of opened datasets and groups */ + if(H5F_get_obj_count(f, H5F_OBJ_GROUP|H5F_OBJ_DATASET, FALSE, &grp_dset_count) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") + + if(grp_dset_count) { + /* Allocate space for group and object locations */ + if((obj_ids = (hid_t *) H5MM_malloc(grp_dset_count * sizeof(hid_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for hid_t") + if((obj_glocs = (H5G_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_loc_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_loc_t") + if((obj_olocs = (H5O_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5O_loc_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5O_loc_t") + if((obj_paths = (H5G_name_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_name_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_name_t") + + /* Get the list of opened object ids (groups & datasets) */ + if(H5F_get_obj_ids(f, H5F_OBJ_GROUP|H5F_OBJ_DATASET, grp_dset_count, obj_ids, FALSE, &grp_dset_count) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "H5F_get_obj_ids failed") + + /* Refresh opened objects (groups, datasets) in the file */ + for(u = 0; u < grp_dset_count; u++) { + H5O_loc_t *oloc; /* object location */ + H5G_loc_t tmp_loc; + + /* Set up the id's group location */ + obj_glocs[u].oloc = &obj_olocs[u]; + obj_glocs[u].path = &obj_paths[u]; + H5G_loc_reset(&obj_glocs[u]); + + /* get the id's object location */ + if((oloc = H5O_get_loc(obj_ids[u])) == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") + + /* Make deep local copy of object's location information */ + H5G_loc(obj_ids[u], &tmp_loc); + H5G_loc_copy(&obj_glocs[u], &tmp_loc, H5_COPY_DEEP); + + /* Close the object */ + if(H5I_dec_ref(obj_ids[u]) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEOBJ, FAIL, "decrementing object ID failed") + } /* end for */ + } /* end if */ + + /* Flush and reset the accumulator */ + if(H5F__accum_reset(f, TRUE) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") + + /* Turn on SWMR write in shared file open flags */ + f->shared->flags |= H5F_ACC_SWMR_WRITE; + + /* Mark the file in SWMR writing mode */ + f->shared->sblock->status_flags |= H5F_SUPER_SWMR_WRITE_ACCESS; + + /* Set up metadata read attempts */ + f->shared->read_attempts = H5F_SWMR_METADATA_READ_ATTEMPTS; + + /* Initialize "retries" and "retries_nbins" */ + if(H5F_set_retries(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") + + /* Turn off usage of accumulator */ + f->shared->feature_flags &= ~(unsigned)H5FD_FEAT_ACCUMULATE_METADATA; + if(H5FD_set_feature_flags(f->shared->lf, f->shared->feature_flags) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") + + setup = TRUE; + + /* Mark superblock as dirty */ + if(H5F_super_dirty(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") + + /* Flush the superblock */ + if(H5F_flush_tagged_metadata(f, H5AC__SUPERBLOCK_TAG) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") + + /* Evict all flushed entries in the cache except the pinned superblock */ + if(H5F__evict_cache_entries(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to evict file's cached information") + + /* Refresh (reopen) the objects (groups & datasets) in the file */ + for(u = 0; u < grp_dset_count; u++) + if(H5O_refresh_metadata_reopen(obj_ids[u], &obj_glocs[u], TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't refresh-close object") + + /* Unlock the file */ + if(H5FD_unlock(f->shared->lf) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to unlock the file") + +done: + if(ret_value < 0 && setup) { + HDassert(f); + + /* Re-enable accumulator */ + f->shared->feature_flags |= (unsigned)H5FD_FEAT_ACCUMULATE_METADATA; + if(H5FD_set_feature_flags(f->shared->lf, f->shared->feature_flags) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") + + /* Reset the # of read attempts */ + f->shared->read_attempts = H5F_METADATA_READ_ATTEMPTS; + if(H5F_set_retries(f) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") + + /* Un-set H5F_ACC_SWMR_WRITE in shared open flags */ + f->shared->flags &= ~H5F_ACC_SWMR_WRITE; + + /* Unmark the f: not in SWMR writing mode */ + f->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_SWMR_WRITE_ACCESS); + + /* Mark superblock as dirty */ + if(H5F_super_dirty(f) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") + + /* Flush the superblock */ + if(H5F_flush_tagged_metadata(f, H5AC__SUPERBLOCK_TAG) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") + } /* end if */ + + /* Free memory */ + if(obj_ids) + H5MM_xfree(obj_ids); + if(obj_glocs) + H5MM_xfree(obj_glocs); + if(obj_olocs) + H5MM_xfree(obj_olocs); + if(obj_paths) + H5MM_xfree(obj_paths); + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__start_swmr_write() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__format_convert + * + * Purpose: Private version of H5Fformat_convert + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: SUCCEED + * Failure: FAIL + *------------------------------------------------------------------------- + */ +herr_t +H5F__format_convert(H5F_t *f) +{ + hbool_t mark_dirty = FALSE; /* Whether to mark the file's superblock dirty */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + /* Check if the superblock should be downgraded */ + if(f->shared->sblock->super_vers > HDF5_SUPERBLOCK_VERSION_V18_LATEST) { + f->shared->sblock->super_vers = HDF5_SUPERBLOCK_VERSION_V18_LATEST; + mark_dirty = TRUE; + } /* end if */ + + /* Check for persistent freespace manager, which needs to be downgraded */ + if(!(f->shared->fs_strategy == H5F_FILE_SPACE_STRATEGY_DEF && + f->shared->fs_persist == H5F_FREE_SPACE_PERSIST_DEF && + f->shared->fs_threshold == H5F_FREE_SPACE_THRESHOLD_DEF && + f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) { + /* Check to remove free-space manager info message from superblock extension */ + if(H5F_addr_defined(f->shared->sblock->ext_addr)) + if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") + + /* Close freespace manager */ + if(H5MF_try_close(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to free free-space address") + + /* Set non-persistent freespace manager */ + f->shared->fs_strategy = H5F_FILE_SPACE_STRATEGY_DEF; + f->shared->fs_persist = H5F_FREE_SPACE_PERSIST_DEF; + f->shared->fs_threshold = H5F_FREE_SPACE_THRESHOLD_DEF; + f->shared->fs_page_size = H5F_FILE_SPACE_PAGE_SIZE_DEF; + + /* Indicate that the superblock should be marked dirty */ + mark_dirty = TRUE; + } /* end if */ + + /* Check if we should mark the superblock dirty */ + if(mark_dirty) + /* Mark superblock as dirty */ + if(H5F_super_dirty(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__format_convert() */ + diff --git a/src/H5Fio.c b/src/H5Fio.c index 81fa514..830b7ee 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -92,15 +92,15 @@ *------------------------------------------------------------------------- */ herr_t -H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, - hid_t dxpl_id, void *buf/*out*/) +H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, + void *buf/*out*/) { - H5F_io_info2_t fio_info; /* I/O info for operation */ H5FD_mem_t map_type; /* Mapped memory type */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(buf); @@ -113,23 +113,8 @@ H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, /* Treat global heap as raw data */ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; - /* Set up the I/O info object */ - fio_info.f = f; - if(H5FD_MEM_DRAW == type) { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end if */ - else { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end else */ - /* Pass through page buffer layer */ - if(H5PB_read(&fio_info, map_type, addr, size, buf) < 0) + if(H5PB_read(f, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "read through page buffer failed") done: @@ -153,15 +138,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, - hid_t dxpl_id, const void *buf) +H5F_block_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, + const void *buf) { - H5F_io_info2_t fio_info; /* I/O info for operation */ H5FD_mem_t map_type; /* Mapped memory type */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); @@ -175,23 +160,8 @@ H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, /* Treat global heap as raw data */ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; - /* Set up the I/O info object */ - fio_info.f = f; - if(H5FD_MEM_DRAW == type) { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end if */ - else { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end else */ - /* Pass through page buffer layer */ - if(H5PB_write(&fio_info, map_type, addr, size, buf) < 0) + if(H5PB_write(f, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write through page buffer failed") done: @@ -213,30 +183,22 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_flush_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id) +H5F_flush_tagged_metadata(H5F_t *f, haddr_t tag) { - H5F_io_info2_t fio_info; /* I/O info for operation */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) /* Use tag to search for and flush associated metadata */ - if(H5AC_flush_tagged_metadata(f, tag, dxpl_id)<0) + if(H5AC_flush_tagged_metadata(f, tag) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") - /* Set up I/O info for operation */ - fio_info.f = f; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - /* Flush and reset the accumulator */ - if(H5F__accum_reset(&fio_info, TRUE) < 0) + if(H5F__accum_reset(f, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") /* Flush file buffers to disk. */ - if(H5FD_flush(f->shared->lf, dxpl_id, FALSE) < 0) + if(H5FD_flush(f->shared->lf, FALSE) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed") done: @@ -257,14 +219,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_evict_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id) +H5F_evict_tagged_metadata(H5F_t *f, haddr_t tag) { herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) /* Evict the object's metadata */ - if(H5AC_evict_tagged_metadata(f, tag, TRUE, dxpl_id) < 0) + if(H5AC_evict_tagged_metadata(f, tag, TRUE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "unable to evict tagged metadata") done: @@ -285,7 +247,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id) +H5F__evict_cache_entries(H5F_t *f) { herr_t ret_value = SUCCEED; @@ -295,7 +257,7 @@ H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id) HDassert(f->shared); /* Evict all except pinned entries in the cache */ - if(H5AC_evict(f, dxpl_id) < 0) + if(H5AC_evict(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "unable to evict all except pinned entries") #ifndef NDEBUG diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 3cd5c21..a7d42e4 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -17,6 +17,7 @@ /* Packages needed by this file... */ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5Gprivate.h" /* Groups */ @@ -25,14 +26,14 @@ #include "H5MMprivate.h" /* Memory management */ /* PRIVATE PROTOTYPES */ -static herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, - hid_t plist_id, hid_t dxpl_id); -static herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id); +static herr_t H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, + hid_t plist_id); +static herr_t H5F__unmount(H5G_loc_t *loc, const char *name); static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); /*------------------------------------------------------------------------- - * Function: H5F_close_mounts + * Function: H5F__close_mounts * * Purpose: Close all mounts for a given file * @@ -44,7 +45,7 @@ static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigne *------------------------------------------------------------------------- */ herr_t -H5F_close_mounts(H5F_t *f) +H5F__close_mounts(H5F_t *f) { unsigned u; /* Local index */ herr_t ret_value=SUCCEED; /* Return value */ @@ -64,7 +65,7 @@ H5F_close_mounts(H5F_t *f) /* Close the internal group maintaining the mount point */ if(H5G_close(f->shared->mtab.child[u].group) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close child group") + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close child group") /* Close the child file */ if(H5F_try_close(f->shared->mtab.child[u].file, NULL) < 0) @@ -82,11 +83,11 @@ H5F_close_mounts(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_close_mounts() */ +} /* end H5F__close_mounts() */ /*------------------------------------------------------------------------- - * Function: H5F_mount + * Function: H5F__mount * * Purpose: Mount file CHILD onto the group specified by LOC and NAME, * using mount properties in PLIST. CHILD must not already be @@ -100,8 +101,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, - hid_t H5_ATTR_UNUSED plist_id, hid_t dxpl_id) +H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED plist_id) { H5G_t *mount_point = NULL; /*mount point group */ H5F_t *ancestor = NULL; /*ancestor files */ @@ -114,7 +114,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, H5G_loc_t root_loc; /* Group location of root of file to mount */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_VOL HDassert(loc); HDassert(name && *name); @@ -134,7 +134,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, */ if(child->parent) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "file is already mounted") - if(H5G_loc_find(loc, name, &mp_loc/*out*/, H5P_DEFAULT, dxpl_id) < 0) + if(H5G_loc_find(loc, name, &mp_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") /* If the mount location is holding its file open, that file will close * and remove the mount as soon as we exit this function. Prevent the @@ -144,7 +144,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount path cannot contain links to external files") /* Open the mount point group */ - if(NULL == (mount_point = H5G_open(&mp_loc, dxpl_id))) + if(NULL == (mount_point = H5G_open(&mp_loc))) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point not found") /* Check if the proposed mount point group is already a mount point */ @@ -227,8 +227,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, /* Search the open IDs and replace names for mount operation */ /* We pass H5G_UNKNOWN as object type; search all IDs */ if(H5G_name_replace(NULL, H5G_NAME_MOUNT, mp_loc.oloc->file, - mp_loc.path->full_path_r, root_loc.oloc->file, root_loc.path->full_path_r, - dxpl_id) < 0) + mp_loc.path->full_path_r, root_loc.oloc->file, root_loc.path->full_path_r) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to replace name") done: @@ -243,12 +242,12 @@ done: } /* end else */ } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_mount() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__mount() */ /*------------------------------------------------------------------------- - * Function: H5F_unmount + * Function: H5F__unmount * * Purpose: Unmount the child which is mounted at the group specified by * LOC and NAME or fail if nothing is mounted there. Neither @@ -266,7 +265,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) +H5F__unmount(H5G_loc_t *loc, const char *name) { H5G_t *child_group = NULL; /* Child's group in parent mtab */ H5F_t *child = NULL; /*mounted file */ @@ -280,7 +279,7 @@ H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) int child_idx; /* Index of child in parent's mtab */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_VOL HDassert(loc); HDassert(name && *name); @@ -295,7 +294,7 @@ H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) * If we get the root group and the file has a parent in the mount tree, * then we must have found the mount point. */ - if(H5G_loc_find(loc, name, &mp_loc/*out*/, H5P_DEFAULT, dxpl_id) < 0) + if(H5G_loc_find(loc, name, &mp_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") mp_loc_setup = TRUE; child = mp_loc.oloc->file; @@ -366,8 +365,7 @@ H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) /* Search the open IDs replace names to reflect unmount operation */ if(H5G_name_replace(NULL, H5G_NAME_UNMOUNT, mp_loc.oloc->file, - mp_loc.path->full_path_r, root_loc.oloc->file, root_loc.path->full_path_r, - dxpl_id) < 0) + mp_loc.path->full_path_r, root_loc.oloc->file, root_loc.path->full_path_r) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to replace name") /* Eliminate the mount point from the table */ @@ -392,8 +390,8 @@ done: if(mp_loc_setup) H5G_loc_free(&mp_loc); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_unmount() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__unmount() */ /*------------------------------------------------------------------------- @@ -445,6 +443,7 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) { H5G_loc_t loc; H5F_t *child = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -463,11 +462,22 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) if(TRUE != H5P_isa_class(plist_id, H5P_FILE_MOUNT)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Do the mount */ - if(H5F_mount(&loc, name, child, plist_id, H5AC_ind_read_dxpl_id) < 0) + if(H5F__mount(&loc, name, child, plist_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* end H5Fmount() */ @@ -495,6 +505,7 @@ herr_t H5Funmount(hid_t loc_id, const char *name) { H5G_loc_t loc; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -506,11 +517,22 @@ H5Funmount(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Unmount */ - if (H5F_unmount(&loc, name, H5AC_ind_read_dxpl_id) < 0) + if(H5F__unmount(&loc, name) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* end H5Funmount() */ @@ -612,7 +634,7 @@ H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) *------------------------------------------------------------------------- */ static herr_t -H5F_flush_mounts_recurse(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id) +H5F_flush_mounts_recurse(H5F_t *f) { unsigned nerrors = 0; /* Errors from recursive flushes */ unsigned u; /* Index variable */ @@ -625,11 +647,11 @@ H5F_flush_mounts_recurse(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id) /* Flush all child files, not stopping for errors */ for(u = 0; u < f->shared->mtab.nmounts; u++) - if(H5F_flush_mounts_recurse(f->shared->mtab.child[u].file, meta_dxpl_id, raw_dxpl_id) < 0) + if(H5F_flush_mounts_recurse(f->shared->mtab.child[u].file) < 0) nerrors++; /* Call the "real" flush routine, for this file */ - if(H5F__flush(f, meta_dxpl_id, raw_dxpl_id, FALSE) < 0) + if(H5F__flush_real(f, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") /* Check flush errors for children - errors are already on the stack */ @@ -654,7 +676,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_flush_mounts(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id) +H5F_flush_mounts(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -668,7 +690,7 @@ H5F_flush_mounts(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id) f = f->parent; /* Flush the mounted file hierarchy */ - if(H5F_flush_mounts_recurse(f, meta_dxpl_id, raw_dxpl_id) < 0) + if(H5F_flush_mounts_recurse(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") done: diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 2ce454a..f854d3b 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -310,50 +310,53 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) FUNC_ENTER_NOAPI(FAIL) + /* Sanity check */ HDassert(mpi_comm); + + /* Set value to return to invalid MPI comm */ *mpi_comm = MPI_COMM_NULL; /* if the loc_id is valid, then get the comm from the file attached to the loc_id */ if(H5I_INVALID_HID != loc_id) { H5G_loc_t loc; - H5F_t *f = NULL; + H5F_t *f; - /* retrieve the file structure */ + /* Retrieve the file structure */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a location") f = loc.oloc->file; HDassert(f); - /* check if MPIO driver is used */ + /* Check if MPIO driver is used */ if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { /* retrieve the file communicator */ if(MPI_COMM_NULL == (*mpi_comm = H5F_mpi_get_comm(f))) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator") - } - } - /* otherwise, this if from H5Fopen or H5Fcreate and has to be collective */ + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") + } /* end if */ + } /* end if */ + /* otherwise, this is from H5Fopen or H5Fcreate and has to be collective */ else { H5P_genplist_t *plist; /* Property list pointer */ - HDassert(H5P_isa_class(acspl_id, H5P_FILE_ACCESS)); - if(NULL == (plist = H5P_object_verify(acspl_id, H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list") + HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a file access list") if(H5FD_MPIO == H5P_peek_driver(plist)) { const H5FD_mpio_fapl_t *fa; /* MPIO fapl info */ if(NULL == (fa = (const H5FD_mpio_fapl_t *)H5P_peek_driver_info(plist))) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad VFL driver info") *mpi_comm = fa->comm; - } - } + } /* end if */ + } /* end else */ + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_mpi_retrieve_comm */ + /*------------------------------------------------------------------------- * Function: H5F_get_mpi_info * diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index d702506..2c52d00 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -395,43 +395,52 @@ H5FL_EXTERN(H5F_file_t); /* General routines */ H5F_t *H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf); -H5_DLL herr_t H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush); -H5_DLL herr_t H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing); -H5_DLL htri_t H5F__is_hdf5(const char *name, hid_t meta_dxpl_id, hid_t raw_dxpl_id); +H5_DLL herr_t H5F__dest(H5F_t *f, hbool_t flush); +H5_DLL H5F_t *H5F__create(const char *filename, unsigned flags, hid_t fcpl_id, + hid_t fapl_id); +H5_DLL H5F_t * H5F__open(const char *filename, unsigned flags, hid_t fcpl_id, + hid_t fapl_id); +H5_DLL herr_t H5F__flush(H5F_t *f, H5F_scope_t scope); +H5_DLL herr_t H5F__flush_real(H5F_t *f, hbool_t closing); +H5_DLL htri_t H5F__is_hdf5(const char *name); H5_DLL herr_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); -H5_DLL ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, - hid_t meta_dxpl_id, hid_t raw_dxpl_id); -H5_DLL herr_t H5F_close(H5F_t *f); +H5_DLL herr_t H5F__get_freespace(H5F_t *f, hsize_t *tot_space); +H5_DLL ssize_t H5F__get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len); +H5_DLL herr_t H5F__get_info(H5F_t *f, H5F_info2_t *finfo); +H5_DLL ssize_t H5F__get_free_sections(H5F_t *f, H5FD_mem_t type, + size_t nsects, H5F_sect_info_t *sect_info); +H5_DLL herr_t H5F__format_convert(H5F_t *f); +H5_DLL herr_t H5F__start_swmr_write(H5F_t *f); +H5_DLL herr_t H5F__close(hid_t file_id); +H5_DLL herr_t H5F__close_cb(H5F_t *f); /* File mount related routines */ -H5_DLL herr_t H5F_close_mounts(H5F_t *f); +H5_DLL herr_t H5F__close_mounts(H5F_t *f); H5_DLL int H5F_term_unmount_cb(void *obj_ptr, hid_t obj_id, void *key); H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); /* Superblock related routines */ -H5_DLL herr_t H5F__super_init(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, - hbool_t initial_read); -H5_DLL herr_t H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_size); +H5_DLL herr_t H5F__super_init(H5F_t *f); +H5_DLL herr_t H5F__super_read(H5F_t *f, hbool_t initial_read); +H5_DLL herr_t H5F__super_size(H5F_t *f, hsize_t *super_size, hsize_t *super_ext_size); 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_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); +H5_DLL herr_t H5F__super_ext_write_msg(H5F_t *f, unsigned id, void *mesg, + hbool_t may_create, unsigned mesg_flags); +H5_DLL herr_t H5F__super_ext_remove_msg(H5F_t *f, unsigned id); +H5_DLL herr_t H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hbool_t was_created); /* Metadata accumulator routines */ -H5_DLL herr_t H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, - haddr_t addr, size_t size, void *buf); -H5_DLL herr_t H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, - haddr_t addr, size_t size, const void *buf); -H5_DLL herr_t H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t type, - haddr_t addr, hsize_t size); -H5_DLL herr_t H5F__accum_flush(const H5F_io_info2_t *fio_info); -H5_DLL herr_t H5F__accum_reset(const H5F_io_info2_t *fio_info, hbool_t flush); +H5_DLL herr_t H5F__accum_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, + size_t size, void *buf); +H5_DLL herr_t H5F__accum_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, + size_t size, const void *buf); +H5_DLL herr_t H5F__accum_free(H5F_t *f, H5FD_mem_t type, haddr_t addr, + hsize_t size); +H5_DLL herr_t H5F__accum_flush(H5F_t *f); +H5_DLL herr_t H5F__accum_reset(H5F_t *f, hbool_t flush); /* Shared file list related routines */ H5_DLL herr_t H5F_sfile_add(H5F_file_t *shared); @@ -441,15 +450,15 @@ H5_DLL herr_t H5F_sfile_remove(H5F_file_t *shared); /* External file cache routines */ H5_DLL H5F_efc_t *H5F_efc_create(unsigned max_nfiles); H5_DLL unsigned H5F_efc_max_nfiles(H5F_efc_t *efc); -H5_DLL herr_t H5F_efc_release(H5F_efc_t *efc); -H5_DLL herr_t H5F_efc_destroy(H5F_efc_t *efc); -H5_DLL herr_t H5F_efc_try_close(H5F_t *f); +H5_DLL herr_t H5F__efc_release(H5F_efc_t *efc); +H5_DLL herr_t H5F__efc_destroy(H5F_efc_t *efc); +H5_DLL herr_t H5F__efc_try_close(H5F_t *f); /* Space allocation routines */ -H5_DLL haddr_t H5F_alloc(H5F_t *f, hid_t dxpl_id, H5F_mem_t type, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); -H5_DLL herr_t H5F_free(H5F_t *f, hid_t dxpl_id, H5F_mem_t type, haddr_t addr, hsize_t size); -H5_DLL htri_t H5F_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, - haddr_t blk_end, hsize_t extra_requested); +H5_DLL haddr_t H5F__alloc(H5F_t *f, H5F_mem_t type, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); +H5_DLL herr_t H5F__free(H5F_t *f, H5F_mem_t type, haddr_t addr, hsize_t size); +H5_DLL htri_t H5F__try_extend(H5F_t *f, H5FD_mem_t type, haddr_t blk_end, + hsize_t extra_requested); /* Functions that get/retrieve values from VFD layer */ H5_DLL herr_t H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr); @@ -457,7 +466,7 @@ H5_DLL herr_t H5F__set_base_addr(const H5F_t *f, haddr_t addr); H5_DLL herr_t H5F__set_paged_aggr(const H5F_t *f, hbool_t paged); /* Functions that flush or evict */ -H5_DLL herr_t H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5F__evict_cache_entries(H5F_t *f); /* Testing functions */ #ifdef H5F_TESTING diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 18d0460..d067664 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -672,20 +672,6 @@ typedef struct H5F_object_flush_t { void *udata; /* User data */ } H5F_object_flush_t; -/* I/O Info for an operation (old) */ -typedef struct H5F_io_info_t { - const H5F_t *f; /* File object */ - const struct H5P_genplist_t *dxpl; /* DXPL object */ -} H5F_io_info_t; - -/* I/O Info for an operation */ -/* (Migrate toward this one, so that both raw data & metadata DXPLs are available) */ -typedef struct H5F_io_info2_t { - const H5F_t *f; /* File object */ - const struct H5P_genplist_t *meta_dxpl; /* Metadata DXPL object */ - const struct H5P_genplist_t *raw_dxpl; /* Raw data DXPL object */ -} H5F_io_info2_t; - /* Concise info about a block of bytes in a file */ typedef struct H5F_block_t { haddr_t offset; /* Offset of the block in the file */ @@ -733,7 +719,7 @@ typedef enum H5F_mem_page_t { /* Private functions */ H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, - hid_t fapl_id, hid_t dxpl_id); + hid_t fapl_id); H5_DLL herr_t H5F_try_close(H5F_t *f, hbool_t *was_closed/*out*/); /* Functions than retrieve values from the file struct */ @@ -757,7 +743,7 @@ H5_DLL herr_t H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, h H5_DLL hsize_t H5F_get_pgend_meta_thres(const H5F_t *f); H5_DLL hbool_t H5F_get_point_of_no_return(const H5F_t *f); H5_DLL hbool_t H5F_get_first_alloc_dealloc(const H5F_t *f); -H5_DLL hbool_t H5F_get_eoa_pre_fsm_fsalloc(const H5F_t *f); +H5_DLL haddr_t H5F_get_eoa_pre_fsm_fsalloc(const H5F_t *f); /* Functions than retrieve values set/cached from the superblock/FCPL */ H5_DLL haddr_t H5F_get_base_addr(const H5F_t *f); @@ -809,17 +795,17 @@ H5_DLL herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void **file_hand H5_DLL hbool_t H5F_is_mount(const H5F_t *file); H5_DLL hbool_t H5F_has_mount(const H5F_t *file); H5_DLL herr_t H5F_traverse_mount(struct H5O_loc_t *oloc/*in,out*/); -H5_DLL herr_t H5F_flush_mounts(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id); +H5_DLL herr_t H5F_flush_mounts(H5F_t *f); /* Functions that operate on blocks of bytes wrt super block */ -H5_DLL herr_t H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, - size_t size, hid_t dxpl_id, void *buf/*out*/); -H5_DLL herr_t H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, - size_t size, hid_t dxpl_id, const void *buf); +H5_DLL herr_t H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, + size_t size, void *buf/*out*/); +H5_DLL herr_t H5F_block_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, + size_t size, const void *buf); /* Functions that flush or evict */ -H5_DLL herr_t H5F_flush_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id); -H5_DLL herr_t H5F_evict_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id); +H5_DLL herr_t H5F_flush_tagged_metadata(H5F_t *f, haddr_t tag); +H5_DLL herr_t H5F_evict_tagged_metadata(H5F_t * f, haddr_t tag); /* Functions that verify a piece of metadata with checksum */ H5_DLL herr_t H5F_get_checksums(const uint8_t *buf, size_t chk_size, uint32_t *s_chksum, uint32_t *c_chksum); @@ -846,7 +832,7 @@ H5_DLL herr_t H5F_fake_free(H5F_t *f); /* Superblock related routines */ H5_DLL herr_t H5F_super_dirty(H5F_t *f); -H5_DLL herr_t H5F_eoa_dirty(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5F_eoa_dirty(H5F_t *f); /* Parallel I/O (i.e. MPI) related routines */ #ifdef H5_HAVE_PARALLEL @@ -860,12 +846,12 @@ H5_DLL herr_t H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info); /* External file cache routines */ H5_DLL H5F_t *H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, - hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); + hid_t fcpl_id, hid_t fapl_id); H5_DLL herr_t H5F_efc_close(H5F_t *parent, H5F_t *file); /* Global heap CWFS routines */ H5_DLL herr_t H5F_cwfs_add(H5F_t *f, struct H5HG_heap_t *heap); -H5_DLL herr_t H5F_cwfs_find_free_heap(H5F_t *f, hid_t dxpl_id, size_t need, haddr_t *addr); +H5_DLL herr_t H5F_cwfs_find_free_heap(H5F_t *f, size_t need, haddr_t *addr); H5_DLL herr_t H5F_cwfs_advance_heap(H5F_t *f, struct H5HG_heap_t *heap, hbool_t add_heap); H5_DLL herr_t H5F_cwfs_remove_heap(H5F_file_t *shared, struct H5HG_heap_t *heap); diff --git a/src/H5Fquery.c b/src/H5Fquery.c index cc2399b..2495828 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -1171,7 +1171,7 @@ H5F_get_first_alloc_dealloc(const H5F_t *f) * Failure: (can't happen) *------------------------------------------------------------------------- */ -hbool_t +haddr_t H5F_get_eoa_pre_fsm_fsalloc(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ diff --git a/src/H5Fspace.c b/src/H5Fspace.c index 0962f69..6baf163 100644 --- a/src/H5Fspace.c +++ b/src/H5Fspace.c @@ -75,7 +75,7 @@ /*------------------------------------------------------------------------- - * Function: H5F_alloc + * Function: H5F__alloc * * Purpose: Wrapper for H5FD_alloc, to make certain EOA changes are * reflected in superblock. @@ -93,11 +93,11 @@ *------------------------------------------------------------------------- */ haddr_t -H5F_alloc(H5F_t *f, hid_t dxpl_id, H5F_mem_t type, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size) +H5F__alloc(H5F_t *f, H5F_mem_t type, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size) { haddr_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(HADDR_UNDEF) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -120,21 +120,21 @@ H5F_alloc(H5F_t *f, hid_t dxpl_id, H5F_mem_t type, hsize_t size, haddr_t *frag_a } /* end if */ /* Call the file driver 'alloc' routine */ - ret_value = H5FD_alloc(f->shared->lf, dxpl_id, type, f, size, frag_addr, frag_size); + ret_value = H5FD_alloc(f->shared->lf, type, f, size, frag_addr, frag_size); if(!H5F_addr_defined(ret_value)) HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, HADDR_UNDEF, "file driver 'alloc' request failed") /* Mark EOA dirty */ - if(H5F_eoa_dirty(f, dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, HADDR_UNDEF, "unable to mark EOA as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_alloc() */ +} /* end H5F__alloc() */ /*------------------------------------------------------------------------- - * Function: H5F_free + * Function: H5F__free * * Purpose: Wrapper for H5FD_free, to make certain EOA changes are * reflected in superblock. @@ -152,11 +152,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, hsize_t size) +H5F__free(H5F_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f); @@ -166,20 +166,20 @@ H5F_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, hsize_t size) HDassert(size > 0); /* Call the file driver 'free' routine */ - if(H5FD_free(f->shared->lf, dxpl_id, type, f, addr, size) < 0) + if(H5FD_free(f->shared->lf, type, f, addr, size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "file driver 'free' request failed") /* Mark EOA dirty */ - if(H5F_eoa_dirty(f, dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark EOA as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_free() */ +} /* end H5F__free() */ /*------------------------------------------------------------------------- - * Function: H5F_try_extend + * Function: H5F__try_extend * * Purpose: Extend a block at the end of the file, if possible. * @@ -197,11 +197,11 @@ done: *------------------------------------------------------------------------- */ htri_t -H5F_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_requested) +H5F__try_extend(H5F_t *f, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_requested) { htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -211,7 +211,7 @@ H5F_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t blk_end, hsize_ HDassert(extra_requested > 0); /* Extend the object by extending the underlying file */ - if((ret_value = H5FD_try_extend(f->shared->lf, type, f, dxpl_id, blk_end, extra_requested)) < 0) + if((ret_value = H5FD_try_extend(f->shared->lf, type, f, blk_end, extra_requested)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTEXTEND, FAIL, "driver try extend request failed") /* H5FD_try_extend() updates driver message and marks the superblock @@ -220,5 +220,5 @@ H5F_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t blk_end, hsize_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_try_extend() */ +} /* end H5F__try_extend() */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 0c6f9cd..5896e32 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -51,8 +51,8 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5F_super_ext_create(H5F_t *f, hid_t dxpl_id, H5O_loc_t *ext_ptr); -static herr_t H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id); +static herr_t H5F__super_ext_create(H5F_t *f, H5O_loc_t *ext_ptr); +static herr_t H5F__update_super_ext_driver_msg(H5F_t *f); /*********************/ @@ -75,7 +75,7 @@ H5FL_DEFINE(H5F_super_t); /*------------------------------------------------------------------------- - * Function: H5F_super_ext_create + * Function: H5F__super_ext_create * * Purpose: Create the superblock extension * @@ -87,11 +87,11 @@ H5FL_DEFINE(H5F_super_t); *------------------------------------------------------------------------- */ static herr_t -H5F_super_ext_create(H5F_t *f, hid_t dxpl_id, H5O_loc_t *ext_ptr) +H5F__super_ext_create(H5F_t *f, H5O_loc_t *ext_ptr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -115,7 +115,7 @@ H5F_super_ext_create(H5F_t *f, hid_t dxpl_id, H5O_loc_t *ext_ptr) * extension. */ H5O_loc_reset(ext_ptr); - if(H5O_create(f, dxpl_id, (size_t)0, (size_t)1, H5P_GROUP_CREATE_DEFAULT, ext_ptr) < 0) + if(H5O_create(f, (size_t)0, (size_t)1, H5P_GROUP_CREATE_DEFAULT, ext_ptr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "unable to create superblock extension") /* Record the address of the superblock extension */ @@ -124,7 +124,7 @@ H5F_super_ext_create(H5F_t *f, hid_t dxpl_id, H5O_loc_t *ext_ptr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_super_ext_create() */ +} /* H5F__super_ext_create() */ /*------------------------------------------------------------------------- @@ -166,7 +166,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_super_ext_close + * Function: H5F__super_ext_close * * Purpose: Close superblock extension * @@ -178,14 +178,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, - hbool_t was_created) +H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hbool_t was_created) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(f); @@ -193,16 +191,15 @@ H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, /* Check if extension was created */ if(was_created) { - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, &orig_ring); /* Increment link count on superblock extension's object header */ - if(H5O_link(ext_ptr, 1, dxpl_id) < 0) + if(H5O_link(ext_ptr, 1) < 0) HGOTO_ERROR(H5E_FILE, H5E_LINKCOUNT, FAIL, "unable to increment hard link count") /* Decrement refcount on superblock extension's object header in memory */ - if(H5O_dec_rc_by_loc(ext_ptr, dxpl_id) < 0) + if(H5O_dec_rc_by_loc(ext_ptr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to decrement refcount on superblock extension"); } /* end if */ @@ -213,12 +210,12 @@ H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, f->nopen_objs--; done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_super_ext_close() */ +} /* H5F__super_ext_close() */ /*------------------------------------------------------------------------- @@ -240,7 +237,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id) +H5F__update_super_ext_driver_msg(H5F_t *f) { H5F_super_t *sblock; /* Pointer to the super block */ herr_t ret_value = SUCCEED; /* Return value */ @@ -289,7 +286,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, 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) */ @@ -319,14 +316,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial_read) +H5F__super_read(H5F_t *f, hbool_t initial_read) { - H5P_genplist_t *dxpl = NULL; /* DXPL object */ - H5AC_ring_t ring, orig_ring = H5AC_RING_INV; + H5AC_ring_t orig_ring = H5AC_RING_INV; H5F_super_t * sblock = NULL; /* Superblock structure */ H5F_superblock_cache_ud_t udata; /* User data for cache callbacks */ H5P_genplist_t *c_plist; /* File creation property list */ - H5FD_io_info_t fdio_info; /* File driver I/O info */ + H5FD_t *file; /* File driver pointer */ 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 */ @@ -338,24 +334,15 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial int mpi_result; #endif /* H5_HAVE_PARALLEL */ - FUNC_ENTER_PACKAGE_TAG(meta_dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__SUPERBLOCK_TAG) /* initialize the drvinfo to NULL -- we will overwrite this if there * is a driver information block */ f->shared->drvinfo = NULL; - /* Get the DXPL plist object for DXPL ID */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if((H5P_get(dxpl, H5AC_RING_NAME, &orig_ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get property value"); - /* Set up file driver I/O info */ - fdio_info.file = f->shared->lf; - fdio_info.meta_dxpl = dxpl; - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(raw_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + file = f->shared->lf; /* Find the superblock */ #ifdef H5_HAVE_PARALLEL @@ -377,31 +364,29 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial * fact that we have skipped actually calling MPI functions to determine * our MPI rank and size. */ - if ( mpi_size > 1 ) { + if(mpi_size > 1) { MPI_Comm this_comm = MPI_COMM_NULL; - if ( mpi_rank == 0 ) { - if (H5FD_locate_signature(&fdio_info, &super_addr) < 0) + if(0 == mpi_rank) + if(H5FD_locate_signature(file, &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)) ) + if(MPI_COMM_NULL == (this_comm = H5F_mpi_get_comm(f))) 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))) + 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) - } + } /* end if */ else { /* Locate the signature as per per the serial library */ #endif /* H5_HAVE_PARALLEL */ - if (H5FD_locate_signature(&fdio_info, &super_addr) < 0) + if(H5FD_locate_signature(file, &super_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") #ifdef H5_HAVE_PARALLEL - } + } /* end else */ #endif /* H5_HAVE_PARALLEL */ if(HADDR_UNDEF == super_addr) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "file signature not found") @@ -443,13 +428,11 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial udata.stored_eof = HADDR_UNDEF; udata.drvrinfo_removed = FALSE; - /* Set the ring type in the DXPL */ - ring = H5AC_RING_SB; - if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value"); + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SB, &orig_ring); /* Look up the superblock */ - if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, meta_dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags))) + if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags))) HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock") if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) @@ -582,10 +565,8 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial * allocated so that it knows how to allocate additional memory. */ - /* Set the ring type in the DXPL */ - ring = H5AC_RING_SBE; - if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value"); + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, NULL); /* Decode the optional driver information block */ if(H5F_addr_defined(sblock->driver_addr)) { @@ -609,7 +590,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_CANTINIT, FAIL, "set end of space allocation request failed") /* Look up the driver info block */ - if(NULL == (drvinfo = (H5O_drvinfo_t *)H5AC_protect(f, meta_dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, &drvrinfo_udata, rw_flags))) + if(NULL == (drvinfo = (H5O_drvinfo_t *)H5AC_protect(f, H5AC_DRVRINFO, sblock->driver_addr, &drvrinfo_udata, rw_flags))) HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load driver info block") /* Loading the driver info block is enough to set up the right info */ @@ -624,7 +605,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial drvinfo_flags |= H5AC__PIN_ENTRY_FLAG; /* Release the driver info block */ - if(H5AC_unprotect(f, meta_dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, drvinfo, drvinfo_flags) < 0) + if(H5AC_unprotect(f, H5AC_DRVRINFO, sblock->driver_addr, drvinfo, drvinfo_flags) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTUNPROTECT, FAIL, "unable to release driver info block") /* save a pointer to the driver information cache entry */ @@ -665,14 +646,14 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open file's superblock extension") /* Check for the extension having a 'driver info' message */ - if((status = H5O_msg_exists(&ext_loc, H5O_DRVINFO_ID, meta_dxpl_id)) < 0) + if((status = H5O_msg_exists(&ext_loc, H5O_DRVINFO_ID)) < 0) HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") if(status) { /* Check for ignoring the driver info for this file */ if(!udata.ignore_drvrinfo) { /* Retrieve the 'driver info' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_DRVINFO_ID, &drvinfo, meta_dxpl_id)) + if(NULL == H5O_msg_read(&ext_loc, H5O_DRVINFO_ID, &drvinfo)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "driver info message not present") /* Validate and decode driver information */ @@ -690,15 +671,15 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial } /* end if */ /* Read in the shared OH message information if there is any */ - if(H5SM_get_info(&ext_loc, c_plist, meta_dxpl_id) < 0) + if(H5SM_get_info(&ext_loc, c_plist) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to read SOHM table information") /* Check for the extension having a 'v1 B-tree "K"' message */ - if((status = H5O_msg_exists(&ext_loc, H5O_BTREEK_ID, meta_dxpl_id)) < 0) + if((status = H5O_msg_exists(&ext_loc, H5O_BTREEK_ID)) < 0) HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") if(status) { /* Retrieve the 'v1 B-tree "K"' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_BTREEK_ID, &btreek, meta_dxpl_id)) + if(NULL == H5O_msg_read(&ext_loc, H5O_BTREEK_ID, &btreek)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "v1 B-tree 'K' info message not present") /* Set non-default v1 B-tree 'K' value info from file */ @@ -714,21 +695,21 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial } /* end if */ /* Check for the extension having a 'free-space manager info' message */ - if((status = H5O_msg_exists(&ext_loc, H5O_FSINFO_ID, meta_dxpl_id)) < 0) + if((status = H5O_msg_exists(&ext_loc, H5O_FSINFO_ID)) < 0) HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") if(status) { H5O_fsinfo_t fsinfo; /* File space info message from superblock extension */ uint8_t flags; /* Message flags */ /* Get message flags */ - if(H5O_msg_get_flags(&ext_loc, H5O_FSINFO_ID, meta_dxpl_id, &flags) < 0) + if(H5O_msg_get_flags(&ext_loc, H5O_FSINFO_ID, &flags) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to message flags for free-space manager info message") /* If message is NOT marked "unknown"--set up file space info */ if(!(flags & H5O_MSG_FLAG_WAS_UNKNOWN)) { /* Retrieve the 'file space info' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_FSINFO_ID, &fsinfo, meta_dxpl_id)) + if(NULL == H5O_msg_read(&ext_loc, H5O_FSINFO_ID, &fsinfo)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get free-space manager info message") /* Update changed values */ @@ -790,7 +771,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ /* KLUGE ALERT!! * - * H5F_super_ext_write_msg() expects f->shared->sblock to + * H5F__super_ext_write_msg() expects f->shared->sblock to * be set -- verify that it is NULL, and then set it. * Set it back to NULL when we are done. */ @@ -798,10 +779,10 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial f->shared->sblock = sblock; #endif /* JRM */ - if(H5F_super_ext_remove_msg(f, meta_dxpl_id, H5O_FSINFO_ID) < 0) + if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDELETE, FAIL, "error in removing message from superblock extension") - if(H5F_super_ext_write_msg(f, meta_dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ f->shared->sblock = NULL; @@ -812,7 +793,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial } /* end if */ /* 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) + if((status = H5O_msg_exists(&ext_loc, H5O_MDCI_MSG_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); @@ -831,7 +812,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial */ /* 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)) 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 */ @@ -840,7 +821,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial } /* end if */ /* Close superblock extension */ - if(H5F_super_ext_close(f, &ext_loc, meta_dxpl_id, FALSE) < 0) + if(H5F__super_ext_close(f, &ext_loc, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close file's superblock extension") } /* end if */ @@ -877,14 +858,14 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ /* KLUGE ALERT!! * - * H5F_super_ext_write_msg() expects f->shared->sblock to + * H5F__super_ext_write_msg() expects f->shared->sblock to * be set -- verify that it is NULL, and then set it. * Set it back to NULL when we are done. */ HDassert(f->shared->sblock == NULL); f->shared->sblock = sblock; #endif /* JRM */ - if(H5F_super_ext_write_msg(f, meta_dxpl_id, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) + if(H5F__super_ext_write_msg(f, 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 */ @@ -896,7 +877,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial /* Check for eliminating the driver info block */ else if(H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO)) { /* Remove the driver info message from the superblock extension */ - if(H5F_super_ext_remove_msg(f, meta_dxpl_id, H5O_DRVINFO_ID) < 0) + if(H5F__super_ext_remove_msg(f, H5O_DRVINFO_ID) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") /* Check if the superblock extension was removed */ @@ -913,12 +894,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_CANTSET, FAIL, "failed to set paged_aggr status for file driver") done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Release the superblock */ - if(sblock && H5AC_unprotect(f, meta_dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, sblock, sblock_flags) < 0) + if(sblock && H5AC_unprotect(f, H5AC_SUPERBLOCK, (haddr_t)0, sblock, sblock_flags) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTUNPROTECT, FAIL, "unable to close superblock") /* If we have failed, make sure no entries are left in the @@ -931,7 +912,7 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin driver info") /* Evict the driver info block from the cache */ - if(H5AC_expunge_entry(f, meta_dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge driver info block") } /* end if */ @@ -942,12 +923,12 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin superblock") /* Evict the superblock from the cache */ - if(H5AC_expunge_entry(f, meta_dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_SUPERBLOCK, (haddr_t)0, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge superblock") } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5F__super_read() */ @@ -968,15 +949,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__super_init(H5F_t *f, hid_t dxpl_id) +H5F__super_init(H5F_t *f) { H5F_super_t *sblock = NULL; /* Superblock cache structure */ hbool_t sblock_in_cache = FALSE; /* Whether the superblock has been inserted into the metadata cache */ H5O_drvinfo_t *drvinfo = NULL; /* Driver info */ hbool_t drvinfo_in_cache = FALSE; /* Whether the driver info block has been inserted into the metadata cache */ H5P_genplist_t *plist; /* File creation property list */ - H5P_genplist_t *dxpl = NULL; - H5AC_ring_t ring, orig_ring = H5AC_RING_INV; + H5AC_ring_t orig_ring = H5AC_RING_INV; hsize_t userblock_size; /* Size of userblock, in bytes */ hsize_t superblock_size; /* Size of superblock, in bytes */ size_t driver_size; /* Size of driver info block (bytes) */ @@ -987,7 +967,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) 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) + FUNC_ENTER_PACKAGE_TAG(H5AC__SUPERBLOCK_TAG) /* Allocate space for the superblock */ if(NULL == (sblock = H5FL_CALLOC(H5F_super_t))) @@ -1128,12 +1108,11 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) if(super_vers < HDF5_SUPERBLOCK_VERSION_2) superblock_size += driver_size; - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_SB, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SB, &orig_ring); /* Insert superblock into cache, pinned */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, sblock, H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_SUPERBLOCK, (haddr_t)0, sblock, H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "can't add superblock to cache") sblock_in_cache = TRUE; @@ -1141,7 +1120,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) f->shared->sblock = sblock; /* Allocate space for the superblock */ - if(HADDR_UNDEF == H5MF_alloc(f, H5FD_MEM_SUPER, dxpl_id, superblock_size)) + if(HADDR_UNDEF == H5MF_alloc(f, H5FD_MEM_SUPER, superblock_size)) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for superblock") /* set the drvinfo filed to NULL -- will overwrite this later if needed */ @@ -1180,10 +1159,8 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) else need_ext = FALSE; - /* Set the ring type in the DXPL */ - ring = H5AC_RING_SBE; - if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, NULL); /* Create the superblock extension for "extra" superblock data, if necessary. */ if(need_ext) { @@ -1195,18 +1172,17 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) * be tuned if more information is added to the superblock * extension. */ - if(H5F_super_ext_create(f, dxpl_id, &ext_loc) < 0) + if(H5F__super_ext_create(f, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create superblock extension") ext_created = TRUE; /* Create the Shared Object Header Message table and register it with * the metadata cache, if this file supports shared messages. */ - if(f->shared->sohm_nindexes > 0) { + if(f->shared->sohm_nindexes > 0) /* Initialize the shared message code & write the SOHM message to the extension */ - if(H5SM_init(f, plist, &ext_loc, dxpl_id) < 0) + if(H5SM_init(f, plist, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to create SOHM table") - } /* end if */ /* Check for non-default v1 B-tree 'K' values to store */ if(sblock->btree_k[H5B_SNODE_ID] != HDF5_BTREE_SNODE_IK_DEF || @@ -1218,7 +1194,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) btreek.btree_k[H5B_CHUNK_ID] = sblock->btree_k[H5B_CHUNK_ID]; btreek.btree_k[H5B_SNODE_ID] = sblock->btree_k[H5B_SNODE_ID]; btreek.sym_leaf_k = sblock->sym_leaf_k; - if(H5O_msg_create(&ext_loc, H5O_BTREEK_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &btreek, dxpl_id) < 0) + if(H5O_msg_create(&ext_loc, H5O_BTREEK_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &btreek) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update v1 B-tree 'K' value header message") } /* end if */ @@ -1238,7 +1214,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) /* Write driver info information to the superblock extension */ info.len = driver_size; info.buf = dbuf; - if(H5O_msg_create(&ext_loc, H5O_DRVINFO_ID, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &info, dxpl_id) < 0) + if(H5O_msg_create(&ext_loc, H5O_DRVINFO_ID, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &info) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update driver info header message") HDassert(FALSE == f->shared->drvinfo_sb_msg_exists); @@ -1262,7 +1238,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype)) fsinfo.fs_addr[ptype - 1] = HADDR_UNDEF; - if(H5O_msg_create(&ext_loc, H5O_FSINFO_ID, H5O_MSG_FLAG_DONTSHARE | H5O_MSG_FLAG_MARK_IF_UNKNOWN, H5O_UPDATE_TIME, &fsinfo, dxpl_id) < 0) + if(H5O_msg_create(&ext_loc, H5O_FSINFO_ID, H5O_MSG_FLAG_DONTSHARE | H5O_MSG_FLAG_MARK_IF_UNKNOWN, H5O_UPDATE_TIME, &fsinfo) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update free-space info header message") } /* end if */ } /* end if */ @@ -1285,7 +1261,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) H5_CHECKED_ASSIGN(drvinfo->len, size_t, H5FD_sb_size(f->shared->lf), hsize_t); /* Insert driver info block into cache */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, drvinfo, H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_DRVRINFO, sblock->driver_addr, drvinfo, H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINS, FAIL, "can't add driver info block to cache") drvinfo_in_cache = TRUE; f->shared->drvinfo = drvinfo; @@ -1295,12 +1271,12 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) } /* end if */ done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Close superblock extension, if it was created */ - if(ext_created && H5F_super_ext_close(f, &ext_loc, dxpl_id, ext_created) < 0) + if(ext_created && H5F__super_ext_close(f, &ext_loc, ext_created) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close file's superblock extension") /* Cleanup on failure */ @@ -1314,7 +1290,7 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin driver info") /* Evict the driver info block from the cache */ - if(H5AC_expunge_entry(f, dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge driver info block") } /* end if */ else @@ -1331,7 +1307,7 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin superblock") /* Evict the superblock from the cache */ - if(H5AC_expunge_entry(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_SUPERBLOCK, (haddr_t)0, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge superblock") } /* end if */ else @@ -1344,7 +1320,7 @@ done: } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5F__super_init() */ @@ -1362,7 +1338,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_eoa_dirty(H5F_t *f, hid_t dxpl_id) +H5F_eoa_dirty(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1387,7 +1363,7 @@ H5F_eoa_dirty(H5F_t *f, hid_t dxpl_id) } /* end if */ /* If the driver info is stored as a message, update that instead */ else if(f->shared->drvinfo_sb_msg_exists) { - if(H5F__update_super_ext_driver_msg(f, dxpl_id) < 0) + if(H5F__update_super_ext_driver_msg(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark drvinfo message as dirty") } /* end if */ @@ -1475,9 +1451,8 @@ H5F__super_free(H5F_super_t *sblock) *------------------------------------------------------------------------- */ herr_t -H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_size) +H5F__super_size(H5F_t *f, hsize_t *super_size, hsize_t *super_ext_size) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1503,12 +1478,11 @@ H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext ext_loc.file = f; ext_loc.addr = f->shared->sblock->ext_addr; - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, &orig_ring); /* Get object header info for superblock extension */ - if(H5O_get_hdr_info(&ext_loc, dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&ext_loc, &hdr_info) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve superblock extension info") /* Set the superblock extension size */ @@ -1520,16 +1494,16 @@ H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext } /* end if */ done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); FUNC_LEAVE_NOAPI(ret_value) } /* H5F__super_size() */ /*------------------------------------------------------------------------- - * Function: H5F_super_ext_write_msg() + * Function: H5F__super_ext_write_msg() * * Purpose: Write the message with ID to the superblock extension * @@ -1540,10 +1514,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, +H5F__super_ext_write_msg(H5F_t *f, 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 */ hbool_t ext_created = FALSE; /* Whether superblock extension was created */ hbool_t ext_opened = FALSE; /* Whether superblock extension was opened */ @@ -1551,16 +1524,15 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, htri_t status; /* Indicate whether the message exists or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(f->shared->sblock); - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, &orig_ring); /* Open/create the superblock extension object header */ if(H5F_addr_defined(f->shared->sblock->ext_addr)) { @@ -1569,7 +1541,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, } /* end if */ else { HDassert(may_create); - if(H5F_super_ext_create(f, dxpl_id, &ext_loc) < 0) + if(H5F__super_ext_create(f, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create file's superblock extension") ext_created = TRUE; } /* end else */ @@ -1577,7 +1549,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, ext_opened = TRUE; /* Check if message with ID does not exist in the object header */ - if((status = H5O_msg_exists(&ext_loc, id, dxpl_id)) < 0) + if((status = H5O_msg_exists(&ext_loc, id)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check object header for message or message exists") /* Check for creating vs. writing */ @@ -1586,7 +1558,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, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to create the message in object header") } /* end if */ else { @@ -1594,17 +1566,17 @@ 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, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to write the message in object header") } /* end else */ done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Close the superblock extension, if it was opened */ - if(ext_opened && H5F_super_ext_close(f, &ext_loc, dxpl_id, ext_created) < 0) + if(ext_opened && H5F__super_ext_close(f, &ext_loc, ext_created) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close file's superblock extension") /* Mark superblock dirty in cache, if superblock extension was created */ @@ -1612,11 +1584,11 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_super_ext_write_msg() */ +} /* H5F__super_ext_write_msg() */ /*------------------------------------------------------------------------- - * Function: H5F_super_ext_remove_msg + * Function: H5F__super_ext_remove_msg * * Purpose: Remove the message with ID from the superblock extension * @@ -1627,9 +1599,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) +H5F__super_ext_remove_msg(H5F_t *f, unsigned id) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5O_loc_t ext_loc; /* "Object location" for superblock extension */ hbool_t ext_opened = FALSE; /* Whether the superblock extension was opened */ @@ -1637,14 +1608,13 @@ H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) htri_t status; /* Indicate whether the message exists or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Make sure that the superblock extension object header exists */ HDassert(H5F_addr_defined(f->shared->sblock->ext_addr)); - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, &orig_ring); /* Open superblock extension object header */ if(H5F_super_ext_open(f, f->shared->sblock->ext_addr, &ext_loc) < 0) @@ -1652,26 +1622,26 @@ H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) ext_opened = TRUE; /* Check if message with ID exists in the object header */ - if((status = H5O_msg_exists(&ext_loc, id, dxpl_id)) < 0) + if((status = H5O_msg_exists(&ext_loc, id)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check object header for message") else if(status) { /* message exists */ H5O_hdr_info_t hdr_info; /* Object header info for superblock extension */ /* Remove the message */ - if(H5O_msg_remove(&ext_loc, id, H5O_ALL, TRUE, dxpl_id) < 0) + if(H5O_msg_remove(&ext_loc, id, H5O_ALL, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete free-space manager info message") /* Get info for the superblock extension's object header */ - if(H5O_get_hdr_info(&ext_loc, dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&ext_loc, &hdr_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to retrieve superblock extension info") /* If the object header is an empty base chunk, remove superblock extension */ if(hdr_info.nchunks == 1) { - if((null_count = H5O_msg_count(&ext_loc, H5O_NULL_ID, dxpl_id)) < 0) + if((null_count = H5O_msg_count(&ext_loc, H5O_NULL_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to count messages") else if((unsigned)null_count == hdr_info.nmesgs) { HDassert(H5F_addr_defined(ext_loc.addr)); - if(H5O_delete(f, dxpl_id, ext_loc.addr) < 0) + if(H5O_delete(f, ext_loc.addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to count messages") f->shared->sblock->ext_addr = HADDR_UNDEF; } /* end if */ @@ -1679,14 +1649,14 @@ H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) } /* end if */ done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Close superblock extension object header, if opened */ - if(ext_opened && H5F_super_ext_close(f, &ext_loc, dxpl_id, FALSE) < 0) + if(ext_opened && H5F__super_ext_close(f, &ext_loc, FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close file's superblock extension") FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_super_ext_remove_msg() */ +} /* H5F__super_ext_remove_msg() */ diff --git a/src/H5Ftest.c b/src/H5Ftest.c index dd69b1e..df062ff 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -38,6 +38,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5Gpkg.h" /* Groups */ @@ -98,6 +99,7 @@ H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, size_t *mesg_count) { H5F_t *file; /* File info */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -105,12 +107,17 @@ H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, /* Check arguments */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Retrieve count for message type */ - if(H5SM_get_mesg_count_test(file, H5AC_ind_read_dxpl_id, type_id, mesg_count) < 0) + if(H5SM__get_mesg_count_test(file, type_id, mesg_count) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve shared message count") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_sohm_mesg_count_test() */ @@ -135,6 +142,7 @@ herr_t H5F_check_cached_stab_test(hid_t file_id) { H5F_t *file; /* File info */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -142,12 +150,17 @@ H5F_check_cached_stab_test(hid_t file_id) /* Check arguments */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Verify the cached stab info */ if(H5G__verify_cached_stab_test(H5G_oloc(file->shared->root_grp), file->shared->sblock->root_ent) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to verify cached symbol table info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_check_cached_stab_test() */ diff --git a/src/H5G.c b/src/H5G.c index 10eb5ed..4ba43c0 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -85,6 +85,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ @@ -133,7 +134,7 @@ static const H5I_class_t H5I_GROUP_CLS[1] = {{ H5I_GROUP, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5G_close /* Callback routine for closing objects of this class */ + (H5I_free_t)H5G__close_cb /* Callback routine for closing objects of this class */ }}; /* Flag indicating "top" of interface has been initialized */ @@ -275,7 +276,7 @@ H5G_term_package(void) * writing. Call H5Gclose() when finished with * the group. * - * Failure: FAIL + * Failure: H5I_INVALID_HID * * Programmer: Quincey Koziol * April 5, 2007 @@ -288,47 +289,53 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, { H5G_loc_t loc; /* Location to create group */ H5G_t *grp = NULL; /* New group created */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE5("i", "i*siii", loc_id, name, lcpl_id, gcpl_id, gapl_id); /* Check arguments */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") /* Get correct property list */ if(H5P_DEFAULT == lcpl_id) lcpl_id = H5P_LINK_CREATE_DEFAULT; else if(TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link creation property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not link creation property list") /* Check group creation property list */ if(H5P_DEFAULT == gcpl_id) gcpl_id = H5P_GROUP_CREATE_DEFAULT; else if(TRUE != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not group create property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not group create property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Create the new group & get its ID */ - if(NULL == (grp = H5G__create_named(&loc, name, lcpl_id, gcpl_id, gapl_id, dxpl_id))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") + if(NULL == (grp = H5G__create_named(&loc, name, lcpl_id, gcpl_id))) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group") if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group") done: if(ret_value < 0) if(grp && H5G_close(grp) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") + HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate2() */ @@ -361,7 +368,7 @@ done: * writing. Call H5Gclose() when finished with * the group. * - * Failure: FAIL + * Failure: H5I_INVALID_HID * * Programmer: Peter Cao * May 08, 2005 @@ -374,26 +381,30 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) H5G_loc_t loc; H5G_t *grp = NULL; H5G_obj_create_t gcrt_info; /* Information for group creation */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "iii", loc_id, gcpl_id, gapl_id); /* Check arguments */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") /* Check group creation property list */ if(H5P_DEFAULT == gcpl_id) gcpl_id = H5P_GROUP_CREATE_DEFAULT; else if(TRUE != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not group create property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not group create property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Set up group creation info */ gcrt_info.gcpl_id = gcpl_id; @@ -401,10 +412,10 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); /* Create the new group & get its ID */ - if(NULL == (grp = H5G__create(loc.oloc->file, &gcrt_info, dxpl_id))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") + if(NULL == (grp = H5G__create_anon(loc.oloc->file, &gcrt_info))) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group") if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group") done: /* Release the group's object header, if it was created */ @@ -413,18 +424,20 @@ done: /* Get the new group's object location */ if(NULL == (oloc = H5G_oloc(grp))) - HDONE_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get object location of group") + HDONE_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "unable to get object location of group") /* Decrement refcount on group's object header in memory */ - if(H5O_dec_rc_by_loc(oloc, dxpl_id) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") + if(H5O_dec_rc_by_loc(oloc) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTDEC, H5I_INVALID_HID, "unable to decrement refcount on newly created object") } /* end if */ /* Cleanup on failure */ if(ret_value < 0) if(grp && H5G_close(grp) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") + HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate_anon() */ @@ -439,7 +452,7 @@ done: * Property List, which H5Gopen1() does not. * * Return: Success: Object ID of the group. - * Failure: FAIL + * Failure: H5I_INVALID_HID * * Programmer: James Laird * Thursday, July 27, 2006 @@ -451,36 +464,41 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id) { H5G_t *grp = NULL; /* Group opened */ H5G_loc_t loc; /* Location of parent for group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "i*si", loc_id, name, gapl_id); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the group */ - if((grp = H5G__open_name(&loc, name, gapl_id, dxpl_id)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") + if(NULL == (grp = H5G__open_name(&loc, name))) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open group") /* Register an ID for the group */ if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group") done: - if(ret_value < 0) { + if(ret_value < 0) if(grp && H5G_close(grp) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") - } /* end if */ + HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gopen2() */ @@ -494,7 +512,7 @@ done: * property list. The property list ID should be * released by calling H5Pclose(). * - * Failure: FAIL + * Failure: H5I_INVALID_HID * * Programmer: Quincey Koziol * Tuesday, October 25, 2005 @@ -504,20 +522,28 @@ done: hid_t H5Gget_create_plist(hid_t group_id) { - H5G_t *group = NULL; - hid_t ret_value = FAIL; + H5G_t *group = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", group_id); /* Check args */ if(NULL == (group = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a group") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; - if((ret_value = H5G_get_create_plist(group)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") + if((ret_value = H5G__get_create_plist(group)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "can't get group's creation property list") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_create_plist() */ @@ -540,6 +566,7 @@ H5Gget_info(hid_t grp_id, H5G_info_t *grp_info) { H5I_type_t id_type; /* Type of ID */ H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -556,11 +583,18 @@ H5Gget_info(hid_t grp_id, H5G_info_t *grp_info) if(H5G_loc(grp_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Retrieve the group's information */ - if(H5G__obj_info(loc.oloc, grp_info/*out*/, H5AC_ind_read_dxpl_id) < 0) + if(H5G__get_info(&loc, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info() */ @@ -583,11 +617,7 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - H5G_loc_t grp_loc; /* Location used to open group */ - H5G_name_t grp_path; /* Opened object group hier. path */ - H5O_loc_t grp_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -601,28 +631,21 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, if(!grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - grp_loc.oloc = &grp_oloc; - grp_loc.path = &grp_path; - H5G_loc_reset(&grp_loc); - - /* Find the group object */ - if(H5G_loc_find(&loc, name, &grp_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the group's information */ - if(H5G__obj_info(grp_loc.oloc, grp_info/*out*/, dxpl_id) < 0) + if(H5G__get_info_by_name(&loc, name, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: - if(loc_found && H5G_loc_free(&grp_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info_by_name() */ @@ -646,11 +669,7 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *grp_info, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - H5G_loc_t grp_loc; /* Location used to open group */ - H5G_name_t grp_path; /* Opened object group hier. path */ - H5O_loc_t grp_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -669,30 +688,21 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(!grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - grp_loc.oloc = &grp_oloc; - grp_loc.path = &grp_path; - H5G_loc_reset(&grp_loc); - - /* Find the object's location, according to the order in the index */ - if(H5G_loc_find_by_idx(&loc, group_name, idx_type, order, n, &grp_loc/*out*/, - lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the group's information */ - if(H5G__obj_info(grp_loc.oloc, grp_info/*out*/, dxpl_id) < 0) + if(H5G__get_info_by_idx(&loc, group_name, idx_type, order, n, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: - /* Release the object location */ - if(loc_found && H5G_loc_free(&grp_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info_by_idx() */ @@ -713,6 +723,7 @@ done: herr_t H5Gclose(hid_t group_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -721,6 +732,10 @@ H5Gclose(hid_t group_id) /* Check args */ if(NULL == H5I_object_verify(group_id,H5I_GROUP)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* * Decrement the counter on the group atom. It will be freed if the count @@ -730,6 +745,8 @@ H5Gclose(hid_t group_id) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gclose() */ @@ -749,8 +766,9 @@ done: herr_t H5Gflush(hid_t group_id) { - H5G_t *grp; /* Dataset for this operation */ - herr_t ret_value = SUCCEED; /* return value */ + H5G_t *grp; /* Group for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", group_id); @@ -759,11 +777,21 @@ H5Gflush(hid_t group_id) if(NULL == (grp = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") - /* Flush object's metadata to file */ - if(H5O_flush_common(&grp->oloc, group_id, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFLUSH, FAIL, "unable to flush group and object flush callback") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(group_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Flush group's metadata to file */ + if(H5G__flush(grp, group_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTFLUSH, FAIL, "unable to flush group") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Gflush */ @@ -771,7 +799,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Grefresh * - * Purpose: Refreshes all buffers associated with a dataset. + * Purpose: Refreshes all buffers associated with a group. * * Return: Non-negative on success, negative on failure * @@ -783,8 +811,9 @@ done: herr_t H5Grefresh(hid_t group_id) { - H5G_t * grp = NULL; - herr_t ret_value = SUCCEED; /* return value */ + H5G_t *grp; /* Group for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", group_id); @@ -793,11 +822,21 @@ H5Grefresh(hid_t group_id) if(NULL == (grp = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(group_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Call private function to refresh group object */ - if ((H5O_refresh_metadata(group_id, grp->oloc, H5AC_ind_read_dxpl_id)) < 0) + if((H5G__refresh(grp, group_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to refresh group") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Grefresh */ diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 71d15e5..9ac31a2 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -53,7 +53,6 @@ typedef struct H5G_fh_ud_cmp_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ const char *name; /* Name of link to compare */ H5B2_found_t found_op; /* Callback when correct link is found */ void *found_op_data; /* Callback data when correct link is found */ @@ -164,7 +163,7 @@ H5G_dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_uda FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Compare the string values */ @@ -264,7 +263,6 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.name = bt2_udata->name; fh_udata.found_op = bt2_udata->found_op; fh_udata.found_op_data = bt2_udata->found_op_data; @@ -273,8 +271,7 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) fh_udata.cmp = 0; /* Check if the user's link and the B-tree's link have the same name */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, bt2_rec->id, - H5G_dense_fh_name_cmp, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G_dense_fh_name_cmp, &fh_udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") /* Callback will set comparison value */ diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index d5698a8..aae5496 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -42,7 +42,6 @@ typedef struct { typedef struct { /* downward */ H5F_t *file; /* File that object header is located within */ - hid_t dxpl_id; /* DXPL during insertion */ H5RS_str_t *grp_full_path_r;/* Full path for group of link */ const char *name; /* Link name to search for */ } H5G_iter_rm_t; @@ -61,7 +60,7 @@ typedef struct { /* PRIVATE PROTOTYPES */ static herr_t H5G_compact_build_table_cb(const void *_mesg, unsigned idx, void *_udata); -static herr_t H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, +static herr_t H5G__compact_build_table(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable); @@ -107,7 +106,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_compact_build_table + * Function: H5G__compact_build_table * * Purpose: Builds a table containing a sorted (alphabetically) list of * links for a group @@ -121,12 +120,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__compact_build_table(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(oloc); @@ -153,7 +152,7 @@ H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t /* Iterate through the link messages, adding them to the table */ op.op_type = H5O_MESG_OP_APP; op.u.app_op = H5G_compact_build_table_cb; - if(H5O_msg_iterate(oloc, H5O_LINK_ID, &op, &udata, dxpl_id) < 0) + if(H5O_msg_iterate(oloc, H5O_LINK_ID, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over link messages") /* Sort link table in correct iteration order */ @@ -165,7 +164,7 @@ H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_build_table() */ +} /* end H5G__compact_build_table() */ /*------------------------------------------------------------------------- @@ -184,8 +183,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, - hid_t dxpl_id) +H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk) { herr_t ret_value = SUCCEED; /* Return value */ @@ -196,7 +194,7 @@ H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, HDassert(obj_lnk); /* Insert link message into group */ - if(H5O_msg_create(grp_oloc, H5O_LINK_ID, 0, H5O_UPDATE_TIME, obj_lnk, dxpl_id) < 0) + if(H5O_msg_create(grp_oloc, H5O_LINK_ID, 0, H5O_UPDATE_TIME, obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") done: @@ -218,9 +216,9 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, - const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, - hsize_t idx, char* name, size_t size) +H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, + H5_index_t idx_type, H5_iter_order_t order, hsize_t idx, char* name, + size_t size) { H5G_link_table_t ltable = {0, NULL}; /* Link table */ ssize_t ret_value = -1; /* Return value */ @@ -231,7 +229,7 @@ H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, HDassert(oloc); /* Build table of all link messages */ - if(H5G_compact_build_table(oloc, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create link message table") /* Check for going out of bounds */ @@ -287,7 +285,7 @@ H5G_compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, voi /* If we've found the right link, get the object type */ if(HDstrcmp(lnk->name, udata->name) == 0) { /* Replace path names for link being removed */ - if(H5G__link_name_replace(udata->file, udata->dxpl_id, udata->grp_full_path_r, lnk) < 0) + if(H5G__link_name_replace(udata->file, udata->grp_full_path_r, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get object type") /* Stop the iteration, we found the correct link */ @@ -312,7 +310,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, +H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name) { H5G_iter_rm_t udata; /* Data to pass through OH iteration */ @@ -325,12 +323,11 @@ H5G__compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id, H5RS_str_t *grp_full_p /* Initialize data to pass through object header iteration */ udata.file = oloc->file; - udata.dxpl_id = dxpl_id; udata.grp_full_path_r = grp_full_path_r; udata.name = name; /* Iterate over the link messages to delete the right one */ - if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE, dxpl_id) < 0) + if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message") done: @@ -351,9 +348,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, - const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n) +H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, + H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, + hsize_t n) { H5G_link_table_t ltable = {0, NULL};/* Link table */ H5G_iter_rm_t udata; /* Data to pass through OH iteration */ @@ -365,7 +362,7 @@ H5G__compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, HDassert(linfo); /* Build table of all link messages, sorted according to desired order */ - if(H5G_compact_build_table(oloc, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create link message table") /* Check for going out of bounds */ @@ -374,12 +371,11 @@ H5G__compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, /* Initialize data to pass through object header iteration */ udata.file = oloc->file; - udata.dxpl_id = dxpl_id; udata.grp_full_path_r = grp_full_path_r; udata.name = ltable.lnks[n].name; /* Iterate over the link messages to delete the right one */ - if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE, dxpl_id) < 0) + if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message") done: @@ -404,7 +400,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__compact_iterate(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data) { @@ -419,7 +415,7 @@ H5G__compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *li HDassert(op); /* Build table of all link messages */ - if(H5G_compact_build_table(oloc, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create link message table") /* Iterate over links in table */ @@ -496,8 +492,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__compact_lookup(const H5O_loc_t *oloc, const char *name, H5O_link_t *lnk, - hid_t dxpl_id) +H5G__compact_lookup(const H5O_loc_t *oloc, const char *name, H5O_link_t *lnk) { H5G_iter_lkp_t udata; /* User data for iteration callback */ H5O_mesg_operator_t op; /* Message operator */ @@ -517,7 +512,7 @@ H5G__compact_lookup(const H5O_loc_t *oloc, const char *name, H5O_link_t *lnk, /* Iterate through the link messages, adding them to the table */ op.op_type = H5O_MESG_OP_APP; op.u.app_op = H5G_compact_lookup_cb; - if(H5O_msg_iterate(oloc, H5O_LINK_ID, &op, &udata, dxpl_id) < 0) + if(H5O_msg_iterate(oloc, H5O_LINK_ID, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over link messages") /* Determine if we found the link we were looking for */ @@ -543,7 +538,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk) { H5G_link_table_t ltable = {0, NULL};/* Link table */ @@ -557,7 +552,7 @@ H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo HDassert(lnk); /* Build table of all link messages, sorted according to desired order */ - if(H5G_compact_build_table(oloc, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create link message table") /* Check for going out of bounds */ @@ -592,7 +587,7 @@ done: *------------------------------------------------------------------------- */ H5G_obj_t -H5G__compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__compact_get_type_by_idx(H5O_loc_t *oloc, const H5O_linfo_t *linfo, hsize_t idx) { H5G_link_table_t ltable = {0, NULL}; /* Link table */ @@ -604,7 +599,7 @@ H5G__compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t * HDassert(oloc); /* Build table of all link messages */ - if(H5G_compact_build_table(oloc, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) + if(H5G__compact_build_table(oloc, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5G_UNKNOWN, "can't create link message table") /* Check for going out of bounds */ @@ -625,7 +620,7 @@ H5G__compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t * tmp_oloc.addr = ltable.lnks[idx].u.hard.addr; /* Get the type of the object */ - if(H5O_obj_type(&tmp_oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&tmp_oloc, &obj_type) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type") /* Map to group object type */ diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 4ae6800..181a399 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -83,7 +83,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ hsize_t count; /* # of links examined */ @@ -103,7 +102,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ /* upward */ H5O_link_t *lnk; /* Copy of link */ @@ -129,7 +127,6 @@ typedef struct { typedef struct { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ haddr_t corder_bt2_addr; /* Address of v2 B-tree indexing creation order */ H5RS_str_t *grp_full_path_r; /* Full path of group where link is removed */ hbool_t replace_names; /* Whether to replace the names of open objects */ @@ -142,7 +139,6 @@ typedef struct { typedef struct { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ H5_index_t idx_type; /* Primary index for removing link */ haddr_t other_bt2_addr; /* Address of "other" v2 B-tree indexing link */ @@ -156,7 +152,6 @@ typedef struct { typedef struct { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ /* upward */ H5O_link_t *lnk; /* Pointer to link to remove */ @@ -169,7 +164,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ /* downward (from application) */ @@ -187,7 +181,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ /* downward (from application) */ char *name; /* Name buffer to fill */ @@ -204,7 +197,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ /* upward */ @@ -218,7 +210,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ /* upward */ H5O_link_t *lnk; /* Pointer to link */ @@ -265,8 +256,7 @@ typedef struct { *------------------------------------------------------------------------- */ herr_t -H5G__dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, - const H5O_pline_t *pline) +H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline) { H5HF_create_t fheap_cparam; /* Fractal heap creation parameters */ H5B2_create_t bt2_cparam; /* v2 B-tree creation parameters */ @@ -298,7 +288,7 @@ H5G__dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, fheap_cparam.pline = *pline; /* Create fractal heap for storing links */ - if(NULL == (fheap = H5HF_create(f, dxpl_id, &fheap_cparam))) + if(NULL == (fheap = H5HF_create(f, &fheap_cparam))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create fractal heap") /* Retrieve the heap's address in the file */ @@ -325,7 +315,7 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); (uint32_t)fheap_id_len; /* Fractal heap ID */ bt2_cparam.split_percent = H5G_NAME_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5G_NAME_BT2_MERGE_PERC; - if(NULL == (bt2_name = H5B2_create(f, dxpl_id, &bt2_cparam, NULL))) + if(NULL == (bt2_name = H5B2_create(f, &bt2_cparam, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for name index") /* Retrieve the v2 B-tree's address in the file */ @@ -346,7 +336,7 @@ HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr) (uint32_t)fheap_id_len; /* Fractal heap ID */ bt2_cparam.split_percent = H5G_CORDER_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5G_CORDER_BT2_MERGE_PERC; - if(NULL == (bt2_corder = H5B2_create(f, dxpl_id, &bt2_cparam, NULL))) + if(NULL == (bt2_corder = H5B2_create(f, &bt2_cparam, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for creation order index") /* Retrieve the v2 B-tree's address in the file */ @@ -359,11 +349,11 @@ HDfprintf(stderr, "%s: linfo->corder_bt2_addr = %a\n", FUNC, linfo->corder_bt2_a done: /* Close the open objects */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") FUNC_LEAVE_NOAPI(ret_value) @@ -384,8 +374,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - const H5O_link_t *lnk) +H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk) { H5G_bt2_ud_ins_t udata; /* User data for v2 B-tree insertion */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -430,20 +419,19 @@ HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDst HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't encode link") /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Insert the serialized link into the fractal heap */ - if(H5HF_insert(fheap, dxpl_id, link_size, link_ptr, udata.id) < 0) + if(H5HF_insert(fheap, link_size, link_ptr, udata.id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into fractal heap") /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, linfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, linfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Create the callback information for v2 B-tree record insertion */ udata.common.f = f; - udata.common.dxpl_id = dxpl_id; udata.common.fheap = fheap; udata.common.name = lnk->name; udata.common.name_hash = H5_checksum_lookup3(lnk->name, HDstrlen(lnk->name), 0); @@ -453,28 +441,28 @@ HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDst /* udata.id already set in H5HF_insert() call */ /* Insert link into 'name' tracking v2 B-tree */ - if(H5B2_insert(bt2_name, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_name, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") /* Check if we should create a creation order index v2 B-tree record */ if(linfo->index_corder) { /* Open the creation order index v2 B-tree */ HDassert(H5F_addr_defined(linfo->corder_bt2_addr)); - if(NULL == (bt2_corder = H5B2_open(f, dxpl_id, linfo->corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(f, linfo->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Insert the record into the creation order index v2 B-tree */ - if(H5B2_insert(bt2_corder, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_corder, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") } /* end if */ done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") if(wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") @@ -534,8 +522,8 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - const char *name, H5O_link_t *lnk) +H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, + H5O_link_t *lnk) { H5G_bt2_ud_common_t udata; /* User data for v2 B-tree link lookup */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -553,16 +541,15 @@ H5G__dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, HDassert(lnk); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, linfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, linfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Construct the user data for v2 B-tree callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.name = name; udata.name_hash = H5_checksum_lookup3(name, HDstrlen(name), 0); @@ -570,14 +557,14 @@ H5G__dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, udata.found_op_data = lnk; /* Find & copy the named link in the 'name' index */ - if((ret_value = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((ret_value = H5B2_find(bt2_name, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to locate link in name index") done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) @@ -608,7 +595,7 @@ H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, vo FUNC_ENTER_NOAPI_NOINIT /* Decode link information & keep a copy */ - if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Copy link information */ @@ -650,12 +637,10 @@ H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.lnk = bt2_udata->lnk; /* Call fractal heap 'op' routine, to copy the link information */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, record->id, - H5G_dense_lookup_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_lookup_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "link found callback failed") done: @@ -678,7 +663,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk) { H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -729,26 +714,25 @@ H5G__dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5G_bt2_ud_lbi_t udata; /* User data for v2 B-tree link lookup */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Construct the user data for v2 B-tree callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.lnk = lnk; /* Find & copy the link in the appropriate index */ - if(H5B2_index(bt2, dxpl_id, order, n, H5G_dense_lookup_by_idx_bt2_cb, &udata) < 0) + if(H5B2_index(bt2, order, n, H5G_dense_lookup_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to locate link in index") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ /* Build the table of links for this group */ - if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Check for going out of bounds */ @@ -762,9 +746,9 @@ H5G__dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") @@ -830,8 +814,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable) +H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, + H5_iter_order_t order, H5G_link_table_t *ltable) { herr_t ret_value = SUCCEED; /* Return value */ @@ -859,7 +843,7 @@ H5G__dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, udata.curr_lnk = 0; /* Iterate over the links in the group, building a table of the link messages */ - if(H5G__dense_iterate(f, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_dense_build_table_cb, &udata) < 0) + if(H5G__dense_iterate(f, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_dense_build_table_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") /* Sort link table in correct iteration order */ @@ -903,7 +887,7 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_u * HDF5 routine, it could attempt to re-protect that direct block for the * heap, causing the HDF5 routine called to fail - QAK) */ - if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") done: @@ -942,11 +926,9 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; /* Call fractal heap 'op' routine, to copy the link information */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, record->id, - H5G_dense_iterate_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_iterate_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "heap op callback failed") /* Make the callback */ @@ -983,9 +965,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - H5G_lib_iterate_t op, void *op_data) +H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, + H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, + void *op_data) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5G_link_table_t ltable = {0, NULL}; /* Table of links */ @@ -1038,16 +1020,15 @@ H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, HDassert(H5F_addr_defined(bt2_addr)); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Construct the user data for v2 B-tree iterator callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.skip = skip; udata.count = 0; @@ -1056,7 +1037,7 @@ H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, /* Iterate over the records in the v2 B-tree's "native" order */ /* (by hash of name) */ - if((ret_value = H5B2_iterate(bt2, dxpl_id, H5G_dense_iterate_bt2_cb, &udata)) < 0) + if((ret_value = H5B2_iterate(bt2, H5G_dense_iterate_bt2_cb, &udata)) < 0) HERROR(H5E_SYM, H5E_BADITER, "link iteration failed"); /* Update the last link examined, if requested */ @@ -1065,7 +1046,7 @@ H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, } /* end if */ else { /* Build the table of links for this group */ - if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Iterate over links in table */ @@ -1075,9 +1056,9 @@ H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") @@ -1110,7 +1091,7 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Get the length of the name */ @@ -1157,13 +1138,11 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.name = bt2_udata->name; fh_udata.name_size = bt2_udata->name_size; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, record->id, - H5G_dense_get_name_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_get_name_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link found callback failed") /* Set the name's full length to return */ @@ -1189,9 +1168,8 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name, - size_t size) +H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, char *name, size_t size) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5G_link_table_t ltable = {0, NULL}; /* Table of links */ @@ -1240,22 +1218,21 @@ H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, H5G_bt2_ud_gnbi_t udata; /* User data for v2 B-tree callback */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.name = name; udata.name_size = size; /* Retrieve the name according to the v2 B-tree's index order */ - if(H5B2_index(bt2, dxpl_id, order, n, H5G_dense_get_name_by_idx_bt2_cb, &udata) < 0) + if(H5B2_index(bt2, order, n, H5G_dense_get_name_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLIST, FAIL, "can't locate object in v2 B-tree") /* Set return value */ @@ -1263,7 +1240,7 @@ H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ /* Build the table of links for this group */ - if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Check for going out of bounds */ @@ -1283,9 +1260,9 @@ H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") @@ -1318,7 +1295,7 @@ H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Check for removing the link from the creation order index */ @@ -1326,7 +1303,7 @@ H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud H5G_bt2_ud_common_t bt2_udata; /* Info for B-tree callbacks */ /* Open the creation order index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(udata->f, udata->dxpl_id, udata->corder_bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(udata->f, udata->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Set up the user data for the v2 B-tree 'record remove' callback */ @@ -1334,23 +1311,23 @@ H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud bt2_udata.corder = lnk->corder; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove(bt2, udata->dxpl_id, &bt2_udata, NULL, NULL) < 0) + if(H5B2_remove(bt2, &bt2_udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from creation order index v2 B-tree") } /* end if */ /* Replace open objects' names, if requested */ if(udata->replace_names) - if(H5G__link_name_replace(udata->f, udata->dxpl_id, udata->grp_full_path_r, lnk) < 0) + if(H5G__link_name_replace(udata->f, udata->grp_full_path_r, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRENAME, FAIL, "unable to rename open objects") /* Perform the deletion action on the link, if requested */ /* (call message "delete" callback directly: *ick* - QAK) */ - if(H5O_link_delete(udata->f, udata->dxpl_id, NULL, lnk) < 0) + if(H5O_link_delete(udata->f, NULL, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link") done: /* Release resources */ - if(bt2 && H5B2_close(bt2, udata->dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") if(lnk) H5O_msg_free(H5O_LINK_ID, lnk); @@ -1384,19 +1361,17 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) /* Set up the user data for fractal heap 'op' callback */ fh_udata.f = bt2_udata->common.f; - fh_udata.dxpl_id = bt2_udata->common.dxpl_id; fh_udata.corder_bt2_addr = bt2_udata->corder_bt2_addr; fh_udata.grp_full_path_r = bt2_udata->grp_full_path_r; fh_udata.replace_names = bt2_udata->replace_names; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->common.fheap, bt2_udata->common.dxpl_id, record->id, - H5G_dense_remove_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->common.fheap, record->id, H5G_dense_remove_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed") /* Remove record from fractal heap, if requested */ if(bt2_udata->rem_from_fheap) - if(H5HF_remove(bt2_udata->common.fheap, bt2_udata->common.dxpl_id, record->id) < 0) + if(H5HF_remove(bt2_udata->common.fheap, record->id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from fractal heap") done: @@ -1418,8 +1393,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - H5RS_str_t *grp_full_path_r, const char *name) +H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, + const char *name) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5G_bt2_ud_rm_t udata; /* User data for v2 B-tree record removal */ @@ -1436,16 +1411,15 @@ H5G__dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, HDassert(name && *name); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the name index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, linfo->name_bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, linfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata.common.f = f; - udata.common.dxpl_id = dxpl_id; udata.common.fheap = fheap; udata.common.name = name; udata.common.name_hash = H5_checksum_lookup3(name, HDstrlen(name), 0); @@ -1457,14 +1431,14 @@ H5G__dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, udata.replace_names = TRUE; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove(bt2, dxpl_id, &udata, H5G_dense_remove_bt2_cb, &udata) < 0) + if(H5B2_remove(bt2, &udata, H5G_dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from name index v2 B-tree") done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) @@ -1493,7 +1467,7 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, vo FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, H5_ITER_ERROR, "can't decode link") /* Can't operate on link here because the fractal heap block is locked */ @@ -1545,12 +1519,10 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Set up the user data for fractal heap 'op' callback */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.lnk = NULL; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, heap_id, - H5G_dense_remove_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, heap_id, H5G_dense_remove_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed") HDassert(fh_udata.lnk); @@ -1568,7 +1540,6 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Set up the user data for the v2 B-tree 'record remove' callback */ other_bt2_udata.f = bt2_udata->f; - other_bt2_udata.dxpl_id = bt2_udata->dxpl_id; other_bt2_udata.fheap = bt2_udata->fheap; other_bt2_udata.name = fh_udata.lnk->name; other_bt2_udata.name_hash = H5_checksum_lookup3(fh_udata.lnk->name, HDstrlen(fh_udata.lnk->name), 0); @@ -1577,35 +1548,35 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) } /* end else */ /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(bt2_udata->f, bt2_udata->dxpl_id, bt2_udata->other_bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(bt2_udata->f, bt2_udata->other_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for 'other' index") /* Set the common information for the v2 B-tree remove operation */ /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove(bt2, bt2_udata->dxpl_id, &other_bt2_udata, NULL, NULL) < 0) + if(H5B2_remove(bt2, &other_bt2_udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, H5_ITER_ERROR, "unable to remove link from 'other' index v2 B-tree") } /* end if */ /* Replace open objects' names */ - if(H5G__link_name_replace(bt2_udata->f, bt2_udata->dxpl_id, bt2_udata->grp_full_path_r, fh_udata.lnk) < 0) + if(H5G__link_name_replace(bt2_udata->f, bt2_udata->grp_full_path_r, fh_udata.lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRENAME, FAIL, "unable to rename open objects") /* Perform the deletion action on the link */ /* (call link message "delete" callback directly: *ick* - QAK) */ - if(H5O_link_delete(bt2_udata->f, bt2_udata->dxpl_id, NULL, fh_udata.lnk) < 0) + if(H5O_link_delete(bt2_udata->f, NULL, fh_udata.lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link") /* Release the space allocated for the link */ H5O_msg_free(H5O_LINK_ID, fh_udata.lnk); /* Remove record from fractal heap */ - if(H5HF_remove(bt2_udata->fheap, bt2_udata->dxpl_id, heap_id) < 0) + if(H5HF_remove(bt2_udata->fheap, heap_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from fractal heap") done: /* Release resources */ - if(bt2 && H5B2_close(bt2, bt2_udata->dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for 'other' index") FUNC_LEAVE_NOAPI(ret_value) @@ -1627,9 +1598,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, - hsize_t n) +H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5G_link_table_t ltable = {0, NULL}; /* Table of links */ @@ -1678,28 +1648,27 @@ H5G__dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5G_bt2_ud_rmbi_t udata; /* User data for v2 B-tree record removal */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Set up the user data for the v2 B-tree 'remove by index' callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.idx_type = idx_type; udata.other_bt2_addr = idx_type == H5_INDEX_NAME ? linfo->corder_bt2_addr : linfo->name_bt2_addr; udata.grp_full_path_r = grp_full_path_r; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_by_idx(bt2, dxpl_id, order, n, H5G_dense_remove_by_idx_bt2_cb, &udata) < 0) + if(H5B2_remove_by_idx(bt2, order, n, H5G_dense_remove_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from indexed v2 B-tree") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ /* Build the table of links for this group */ - if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Check for going out of bounds */ @@ -1707,15 +1676,15 @@ H5G__dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "index out of bound") /* Remove the appropriate link from the dense storage */ - if(H5G__dense_remove(f, dxpl_id, linfo, grp_full_path_r, ltable.lnks[n].name) < 0) + if(H5G__dense_remove(f, linfo, grp_full_path_r, ltable.lnks[n].name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from dense storage") } /* end else */ done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") @@ -1738,7 +1707,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) +H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1759,12 +1728,11 @@ H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) H5G_bt2_ud_rm_t udata; /* User data for v2 B-tree record removal */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata.common.f = f; - udata.common.dxpl_id = dxpl_id; udata.common.fheap = fheap; udata.common.name = NULL; udata.common.name_hash = 0; @@ -1776,16 +1744,16 @@ H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) udata.replace_names = FALSE; /* Delete the name index, adjusting the ref. count on links removed */ - if(H5B2_delete(f, dxpl_id, linfo->name_bt2_addr, NULL, H5G_dense_remove_bt2_cb, &udata) < 0) + if(H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G_dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for name index") /* Close the fractal heap */ - if(H5HF_close(fheap, dxpl_id) < 0) + if(H5HF_close(fheap) < 0) HGOTO_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") } /* end if */ else { /* Delete the name index, without adjusting the ref. count on the links */ - if(H5B2_delete(f, dxpl_id, linfo->name_bt2_addr, NULL, NULL, NULL) < 0) + if(H5B2_delete(f, linfo->name_bt2_addr, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for name index") } /* end else */ linfo->name_bt2_addr = HADDR_UNDEF; @@ -1794,7 +1762,7 @@ H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) if(linfo->index_corder) { /* Delete the creation order index, without adjusting the ref. count on the links */ HDassert(H5F_addr_defined(linfo->corder_bt2_addr)); - if(H5B2_delete(f, dxpl_id, linfo->corder_bt2_addr, NULL, NULL, NULL) < 0) + if(H5B2_delete(f, linfo->corder_bt2_addr, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for creation order index") linfo->corder_bt2_addr = HADDR_UNDEF; } /* end if */ @@ -1802,7 +1770,7 @@ H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) HDassert(!H5F_addr_defined(linfo->corder_bt2_addr)); /* Delete the fractal heap */ - if(H5HF_delete(f, dxpl_id, linfo->fheap_addr) < 0) + if(H5HF_delete(f, linfo->fheap_addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete fractal heap") linfo->fheap_addr = HADDR_UNDEF; @@ -1833,8 +1801,7 @@ done: *------------------------------------------------------------------------- */ H5G_obj_t -H5G__dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, - hsize_t idx) +H5G__dense_get_type_by_idx(H5F_t *f, H5O_linfo_t *linfo, hsize_t idx) { H5G_link_table_t ltable = {0, NULL}; /* Table of links */ H5G_obj_t ret_value = H5G_UNKNOWN; /* Return value */ @@ -1848,7 +1815,7 @@ H5G__dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, HDassert(linfo); /* Build the table of links for this group */ - if(H5G__dense_build_table(f, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) + if(H5G__dense_build_table(f, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "error building table of links") /* Check for going out of bounds */ @@ -1869,7 +1836,7 @@ H5G__dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, tmp_oloc.addr = ltable.lnks[idx].u.hard.addr; /* Get the type of the object */ - if(H5O_obj_type(&tmp_oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&tmp_oloc, &obj_type) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type") /* Map to group object type */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 1cc7e15..5835e06 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -37,6 +37,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ @@ -59,7 +60,6 @@ typedef struct { H5G_stat_t *statbuf; /* Stat buffer about object */ hbool_t follow_link; /* Whether we are following a link or not */ H5F_t *loc_file; /* Pointer to the file the location is in */ - hid_t dxpl_id; /* Dataset transfer property list */ } H5G_trav_goi_t; @@ -72,17 +72,29 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5G_link_hard(hid_t cur_loc_id, const char *cur_name, - hid_t new_loc_id, const char *new_name); -static herr_t H5G_move(hid_t src_loc_id, const char *src_name, - hid_t dst_loc_id, const char *dst_name); -static herr_t H5G_get_objinfo_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5G__link(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, + hid_t new_loc_id, const char *new_name, hid_t lcpl_id); +static herr_t H5G__move(hid_t src_loc_id, const char *src_name, + hid_t dst_loc_id, const char *dst_name, hid_t lcpl_id); +static herr_t H5G__unlink(H5G_loc_t *loc, const char *name); +static herr_t H5G__get_linkval(const H5G_loc_t *loc, const char *name, size_t size, + char *buf/*out*/); +static herr_t H5G__set_comment(const H5G_loc_t *loc, const char *name, + const char *comment); +static int H5G__get_comment(const H5G_loc_t *loc, const char *name, char *buf, + size_t bufsize); +static herr_t H5G__iterate(hid_t loc_id, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t idx, hsize_t *last_lnk, + const H5G_link_iterate_t *lnk_op, void *op_data); +static herr_t H5G__get_num_objs(const H5O_loc_t *oloc, H5G_info_t *grp_info); +static herr_t H5G__get_objinfo_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5G_get_objinfo(const H5G_loc_t *loc, const char *name, - hbool_t follow_link, H5G_stat_t *statbuf/*out*/, hid_t dxpl_id); -static H5G_obj_t H5G_obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, - hid_t dxpl_id); +static herr_t H5G__get_objinfo(const H5G_loc_t *loc, const char *name, + hbool_t follow_link, H5G_stat_t *statbuf/*out*/); +static ssize_t H5G__get_objname_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t idx, char *name, size_t size); +static H5G_obj_t H5G__obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx); #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -178,6 +190,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) H5G_loc_t loc; /* Location to create group */ H5G_t *grp = NULL; /* New group created */ hid_t tmp_gcpl = (-1); /* Temporary group creation property list */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -218,12 +231,19 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) else tmp_gcpl = H5P_GROUP_CREATE_DEFAULT; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Create the new group & get its ID */ - if(NULL == (grp = H5G__create_named(&loc, name, H5P_LINK_CREATE_DEFAULT, - tmp_gcpl, H5P_GROUP_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id))) + if(NULL == (grp = H5G__create_named(&loc, name, H5P_LINK_CREATE_DEFAULT, tmp_gcpl))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") + HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, FAIL, "unable to register group") done: if(tmp_gcpl > 0 && tmp_gcpl != H5P_GROUP_CREATE_DEFAULT) @@ -233,6 +253,8 @@ done: if(ret_value < 0) if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate1() */ @@ -260,6 +282,7 @@ H5Gopen1(hid_t loc_id, const char *name) { H5G_t *grp = NULL; /* Group opened */ H5G_loc_t loc; /* Location of parent for group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -271,8 +294,13 @@ H5Gopen1(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + /* Open the group */ - if((grp = H5G__open_name(&loc, name, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) == NULL) + if(NULL == (grp = H5G__open_name(&loc, name))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an atom for the group */ @@ -280,10 +308,11 @@ H5Gopen1(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") done: - if(ret_value < 0) { + if(ret_value < 0) if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") - } /* end if */ +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gopen1() */ @@ -300,6 +329,7 @@ done: herr_t H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new_name) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -311,25 +341,21 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new if(!new_name || !*new_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified") - if(type == H5L_TYPE_HARD) { - if((ret_value = H5G_link_hard(cur_loc_id, cur_name, H5L_SAME_LOC, new_name)) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "couldn't create link") - } /* end if */ - else if(type == H5L_TYPE_SOFT) { - H5G_loc_t cur_loc; /* Group location for new link */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Finish checking arguments */ - if(H5G_loc(cur_loc_id, &cur_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - - /* Create the link */ - if(H5L_create_soft(cur_name, &cur_loc, new_name, H5P_DEFAULT, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") - } /* end else if */ - else - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not a valid link type") + /* Call internal routine to create link */ + if(H5G__link(cur_loc_id, cur_name, type, H5L_SAME_LOC, new_name, H5P_LINK_CREATE_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "couldn't create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Glink() */ @@ -346,6 +372,7 @@ herr_t H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_id, const char *new_name) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -357,86 +384,94 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, if(!new_name || !*new_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified") - if(type == H5L_TYPE_HARD) { - if((ret_value = H5G_link_hard(cur_loc_id, cur_name, new_loc_id, new_name)) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "couldn't create link") - } /* end if */ - else if(type == H5L_TYPE_SOFT) { - H5G_loc_t new_loc; /* Group location for new link */ - - /* Soft links only need one location, the new_loc_id, but it's possible that - * new_loc_id is H5L_SAME_LOC */ - if(new_loc_id == H5L_SAME_LOC) - new_loc_id = cur_loc_id; - - /* Finish checking arguments */ - if(H5G_loc(new_loc_id, &new_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Create the link */ - if(H5L_create_soft(cur_name, &new_loc, new_name, H5P_DEFAULT, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") - } /* end else if */ - else - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid link type") + /* Call internal routine to create link */ + if(H5G__link(cur_loc_id, cur_name, type, new_loc_id, new_name, H5P_LINK_CREATE_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "couldn't create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Glink2() */ /*------------------------------------------------------------------------- - * Function: H5G_link_hard + * Function: H5G__link * - * Purpose: Creates a hard link from NEW_NAME to CUR_NAME. - * - * CUR_NAME must name an existing object. CUR_NAME and - * NEW_NAME are interpreted relative to CUR_LOC_ID and - * NEW_LOC_ID, which are either file IDs or group IDs. + * Purpose: Internal routine to create a new link. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * Monday, November 6, 2006 + * Monday, December 18, 2017 * *------------------------------------------------------------------------- */ static herr_t -H5G_link_hard(hid_t cur_loc_id, const char *cur_name, hid_t new_loc_id, - const char *new_name) +H5G__link(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, + hid_t new_loc_id, const char *new_name, hid_t lcpl_id) { - H5G_loc_t cur_loc, *cur_loc_p; /* Information about current link's group */ - H5G_loc_t new_loc, *new_loc_p; /* Information about new link's group */ - herr_t ret_value = SUCCEED; /* Return value */ + H5G_loc_t new_loc; /* Information about new link's group */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_VOL - /* Finish checking arguments */ - if(cur_loc_id == H5L_SAME_LOC && new_loc_id == H5L_SAME_LOC) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should not be both H5L_SAME_LOC") - if(cur_loc_id != H5L_SAME_LOC && H5G_loc(cur_loc_id, &cur_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(new_loc_id != H5L_SAME_LOC && H5G_loc(new_loc_id, &new_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + /* Create the appropriate kind of link */ + if(type == H5L_TYPE_HARD) { + H5G_loc_t cur_loc, *cur_loc_p; /* Information about current link's group */ + H5G_loc_t *new_loc_p; /* Information about new link's group */ + + /* Finish checking arguments */ + if(cur_loc_id == H5L_SAME_LOC && new_loc_id == H5L_SAME_LOC) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "source and destination should not be both H5L_SAME_LOC") + if(cur_loc_id != H5L_SAME_LOC && H5G_loc(cur_loc_id, &cur_loc) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") + if(new_loc_id != H5L_SAME_LOC && H5G_loc(new_loc_id, &new_loc) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") + + /* Set up current & new location pointers */ + cur_loc_p = &cur_loc; + new_loc_p = &new_loc; + if(cur_loc_id == H5L_SAME_LOC) + cur_loc_p = new_loc_p; + else if(new_loc_id == H5L_SAME_LOC) + new_loc_p = cur_loc_p; + else if(cur_loc_p->oloc->file != new_loc_p->oloc->file) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "source and destination should be in the same file.") + + /* Create the link */ + if(H5L_create_hard(cur_loc_p, cur_name, new_loc_p, new_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") + } /* end if */ + else if(type == H5L_TYPE_SOFT) { + /* Soft links only need one location, the new_loc_id, but it's possible + * that new_loc_id is H5L_SAME_LOC + */ + if(new_loc_id == H5L_SAME_LOC) + new_loc_id = cur_loc_id; + + /* Finish checking arguments */ + if(H5G_loc(new_loc_id, &new_loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - /* Set up current & new location pointers */ - cur_loc_p = &cur_loc; - new_loc_p = &new_loc; - if(cur_loc_id == H5L_SAME_LOC) - cur_loc_p = new_loc_p; - else if(new_loc_id == H5L_SAME_LOC) - new_loc_p = cur_loc_p; - else if(cur_loc_p->oloc->file != new_loc_p->oloc->file) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file.") - - /* Create the link */ - if(H5L_create_hard(cur_loc_p, cur_name, new_loc_p, new_name, - H5P_DEFAULT, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") + /* Create the link */ + if(H5L_create_soft(cur_name, &new_loc, new_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") + } /* end else if */ + else + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "Not a valid link type") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_hard() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__link() */ /*------------------------------------------------------------------------- @@ -449,16 +484,27 @@ done: herr_t H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name) { - herr_t ret_value = SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*s", src_loc_id, src_name, dst_name); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(src_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Call common routine to move the link */ - if(H5G_move(src_loc_id, src_name, H5L_SAME_LOC, dst_name) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "couldn't move link") + if(H5G__move(src_loc_id, src_name, H5L_SAME_LOC, dst_name, H5P_LINK_CREATE_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTMOVE, FAIL, "couldn't move link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gmove() */ @@ -474,22 +520,37 @@ herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name) { - herr_t ret_value = SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*si*s", src_loc_id, src_name, dst_loc_id, dst_name); + /* Check arguments */ + if(src_loc_id == H5L_SAME_LOC && dst_loc_id == H5L_SAME_LOC) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "source and destination should not both be H5L_SAME_LOC") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dst_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Call common routine to move the link */ - if(H5G_move(src_loc_id, src_name, dst_loc_id, dst_name) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "couldn't move link") + if(H5G__move(src_loc_id, src_name, dst_loc_id, dst_name, H5P_LINK_CREATE_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTMOVE, FAIL, "couldn't move link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gmove2() */ /*------------------------------------------------------------------------- - * Function: H5G_move + * Function: H5G__move * * Purpose: Renames an object within an HDF5 file and moves it to a new * group. The original name SRC is unlinked from the group graph @@ -506,26 +567,24 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_move(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, - const char *dst_name) +H5G__move(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, + const char *dst_name, hid_t lcpl_id) { H5G_loc_t src_loc, *src_loc_p; /* Group info for source location */ H5G_loc_t dst_loc, *dst_loc_p; /* Group info for destination location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_VOL /* Check arguments */ - if(src_loc_id == H5L_SAME_LOC && dst_loc_id == H5L_SAME_LOC) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should not both be H5L_SAME_LOC") if(src_loc_id != H5L_SAME_LOC && H5G_loc(src_loc_id, &src_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") if(dst_loc_id != H5L_SAME_LOC && H5G_loc(dst_loc_id, &dst_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") if(!src_name || !*src_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no current name specified") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no current name specified") if(!dst_name || !*dst_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no destination name specified") /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -536,13 +595,12 @@ H5G_move(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, dst_loc_p = src_loc_p; /* Move the link */ - if(H5L_move(src_loc_p, src_name, dst_loc_p, dst_name, FALSE, H5P_DEFAULT, - H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") + if(H5L_move(src_loc_p, src_name, dst_loc_p, dst_name, FALSE, lcpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTMOVE, FAIL, "unable to move link") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_move() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__move() */ /*------------------------------------------------------------------------- @@ -556,6 +614,7 @@ herr_t H5Gunlink(hid_t loc_id, const char *name) { H5G_loc_t loc; /* Group's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -563,20 +622,61 @@ H5Gunlink(hid_t loc_id, const char *name) /* Check arguments */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no name") - /* Call H5L routine... */ - if(H5L_delete(&loc, name, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "couldn't delete link") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Call internal routine */ + if(H5G__unlink(&loc, name) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "couldn't delete link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gunlink() */ /*------------------------------------------------------------------------- + * Function: H5G__unlink + * + * Purpose: Internal version of H5Gunlink. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G__unlink(H5G_loc_t *loc, const char *name) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Call H5L routine... */ + if(H5L_delete(loc, name) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "couldn't delete link") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__unlink() */ + + +/*------------------------------------------------------------------------- * Function: H5Gget_linkval * * Purpose: Retrieve's a soft link's data. The new API is @@ -588,6 +688,7 @@ herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) { H5G_loc_t loc; /* Group's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -599,16 +700,58 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - /* Call the new link routine which provides this capability */ - if(H5L_get_val(&loc, name, buf, size, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "couldn't get link info") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Call internal routine */ + if(H5G__get_linkval(&loc, name, size, buf) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "couldn't delete link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_linkval() */ /*------------------------------------------------------------------------- + * Function: H5G__get_linkval + * + * Purpose: Internal version of H5Gget_linkval. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G__get_linkval(const H5G_loc_t *loc, const char *name, size_t size, + char *buf/*out*/) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Call the link routine which provides this capability */ + if(H5L_get_val(loc, name, buf, size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "couldn't get link info") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_linkval() */ + + +/*------------------------------------------------------------------------- * Function: H5Gset_comment * * Purpose: Gives the specified object a comment. The COMMENT string @@ -628,7 +771,8 @@ done: herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment) { - H5G_loc_t loc; + H5G_loc_t loc; /* Group's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -639,15 +783,57 @@ H5Gset_comment(hid_t loc_id, const char *name, const char *comment) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - if(H5G_loc_set_comment(&loc, name, comment, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to set comment value") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Call internal routine */ + if(H5G__set_comment(&loc, name, comment) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "unable to set comment value") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gset_comment() */ /*------------------------------------------------------------------------- + * Function: H5G__set_comment + * + * Purpose: Internal version of H5Gset_comment. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G__set_comment(const H5G_loc_t *loc, const char *name, const char *comment) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Call the common routine which provides this capability */ + if(H5G_loc_set_comment(loc, name, comment) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "unable to set comment value") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__set_comment() */ + + +/*------------------------------------------------------------------------- * Function: H5Gget_comment * * Purpose: Return at most BUFSIZE characters of the comment for the @@ -673,8 +859,9 @@ done: int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) { - H5G_loc_t loc; - int ret_value; + H5G_loc_t loc; /* Group's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + int ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("Is", "i*sz*s", loc_id, name, bufsize, buf); @@ -686,15 +873,58 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) if(bufsize > 0 && !buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no buffer specified") - if((ret_value = (int)H5G_loc_get_comment(&loc, name, buf, bufsize, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to get comment value") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Call internal routine */ + if((ret_value = H5G__get_comment(&loc, name, buf, bufsize)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get comment value") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_comment() */ /*------------------------------------------------------------------------- + * Function: H5G__get_comment + * + * Purpose: Internal version of H5Gget_comment. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static int +H5G__get_comment(const H5G_loc_t *loc, const char *name, char *buf, + size_t bufsize) +{ + int ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Call the common routine which provides this capability */ + if((ret_value = (int)H5G_loc_get_comment(loc, name, buf, bufsize)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get comment value") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_comment() */ + + +/*------------------------------------------------------------------------- * Function: H5Giterate * * Purpose: Iterates over the entries of a group. The LOC_ID and NAME @@ -724,19 +954,20 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, { H5G_link_iterate_t lnk_op; /* Link operator */ hsize_t last_obj; /* Index of last object looked at */ - hsize_t idx; /* Internal location to hold index */ + hsize_t idx; /* Internal location to hold index */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*s*Isx*x", loc_id, name, idx_p, op, op_data); /* Check args */ - if (!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - if (idx_p && *idx_p < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") - if (!op) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") + if(!name || !*name) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no name specified") + if(idx_p && *idx_p < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "invalid index specified") + if(!op) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no operator specified") /* Set number of objects looked at to zero */ last_obj = 0; @@ -746,20 +977,60 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, lnk_op.op_type = H5G_LINK_OP_OLD; lnk_op.op_func.op_old = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Call private function. */ - if ((ret_value = H5G_iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5G__iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed") /* Set the index we stopped at */ - if (idx_p) + if(idx_p) *idx_p = (int)last_obj; done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Giterate() */ /*------------------------------------------------------------------------- + * Function: H5G__iterate + * + * Purpose: Internal version of H5Giterate. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G__iterate(hid_t loc_id, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t idx, hsize_t *last_lnk, + const H5G_link_iterate_t *lnk_op, void *op_data) +{ + herr_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Call the common routine which provides this capability */ + if((ret_value = H5G_iterate(loc_id, name, idx_type, order, idx, last_lnk, lnk_op, op_data)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__iterate() */ + + +/*------------------------------------------------------------------------- * Function: H5Gget_num_objs * * Purpose: Returns the number of objects in the group. It iterates @@ -778,37 +1049,78 @@ done: herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) { - H5G_loc_t loc; /* Location of object */ - H5G_info_t grp_info; /* Group information */ - H5O_type_t obj_type; /* Type of object at location */ - herr_t ret_value = SUCCEED; + H5G_loc_t loc; /* Location of object */ + H5G_info_t grp_info; /* Group information */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", loc_id, num_objs); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location ID") - if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_GROUP) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location ID") if(!num_objs) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad pointer to # of objects") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "bad pointer to # of objects") - /* Retrieve information about the group */ - if(H5G__obj_info(loc.oloc, &grp_info, H5AC_ind_read_dxpl_id) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Call the internal routine */ + if(H5G__get_num_objs(loc.oloc, &grp_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't determine") /* Set the number of objects [sic: links] in the group */ *num_objs = grp_info.nlinks; done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_num_objs() */ /*------------------------------------------------------------------------- + * Function: H5G__get_num_objs + * + * Purpose: Internal version of H5Gget_num_objs. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G__get_num_objs(const H5O_loc_t *oloc, H5G_info_t *grp_info) +{ + H5O_type_t obj_type; /* Type of object at location */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check args */ + if(H5O_obj_type(oloc, &obj_type) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") + if(obj_type != H5O_TYPE_GROUP) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a group") + + /* Retrieve information about the group */ + if(H5G__obj_info(oloc, grp_info) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't determine # of objects") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_num_objs() */ + + +/*------------------------------------------------------------------------- * Function: H5Gget_objinfo * * Purpose: Returns information about an object. If FOLLOW_LINK is @@ -829,7 +1141,8 @@ herr_t H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t *statbuf/*out*/) { - H5G_loc_t loc; + H5G_loc_t loc; /* Group's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -837,21 +1150,28 @@ H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, /* Check arguments */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no name specified") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Get info */ - if(H5G_get_objinfo(&loc, name, follow_link, statbuf, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "cannot stat object") + if(H5G__get_objinfo(&loc, name, follow_link, statbuf) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "cannot stat object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objinfo() */ /*------------------------------------------------------------------------- - * Function: H5G_get_objinfo_cb + * Function: H5G__get_objinfo_cb * * Purpose: Callback for retrieving info about an object. This routine * gets the info @@ -864,13 +1184,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, +H5G__get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_trav_goi_t *udata = (H5G_trav_goi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(lnk == NULL && obj_loc == NULL) @@ -893,7 +1213,7 @@ H5G_get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, co /* Go retrieve the object information */ /* (don't need index & heap info) */ HDassert(obj_loc); - if(H5O_get_info(obj_loc->oloc, udata->dxpl_id, FALSE, &oinfo) < 0) + if(H5O_get_info(obj_loc->oloc, FALSE, &oinfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info") /* Get mapped object type */ @@ -926,11 +1246,11 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_get_objinfo_cb() */ +} /* end H5G__get_objinfo_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_get_objinfo + * Function: H5G__get_objinfo * * Purpose: Returns information about an object. * @@ -946,14 +1266,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, - H5G_stat_t *statbuf/*out*/, hid_t dxpl_id) +H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, + H5G_stat_t *statbuf/*out*/) { H5G_trav_goi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_VOL + /* Sanity checks */ HDassert(loc); HDassert(name && *name); @@ -965,11 +1286,10 @@ H5G_get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, udata.statbuf = statbuf; udata.follow_link = follow_link; udata.loc_file = loc->oloc->file; - udata.dxpl_id = dxpl_id; /* Traverse the group hierarchy to locate the object to get info about */ if(H5G_traverse(loc, name, (unsigned)(follow_link ? H5G_TARGET_NORMAL : H5G_TARGET_SLINK|H5G_TARGET_UDLINK), - H5G_get_objinfo_cb, &udata, H5P_DEFAULT, dxpl_id) < 0) + H5G__get_objinfo_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist") /* If we're pointing at a soft or UD link, get the real link length and type */ @@ -980,7 +1300,7 @@ H5G_get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, /* Get information about link to the object. If this fails, e.g. * because the object is ".", just treat the object as a hard link. */ H5E_BEGIN_TRY { - ret = H5L_get_info(loc, name, &linfo, H5P_DEFAULT, dxpl_id); + ret = H5L_get_info(loc, name, &linfo); } H5E_END_TRY if(ret >= 0 && linfo.type != H5L_TYPE_HARD) { @@ -995,8 +1315,8 @@ H5G_get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_get_objinfo() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_objinfo() */ /*------------------------------------------------------------------------- @@ -1025,31 +1345,73 @@ done: ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size) { - H5G_loc_t loc; /* Object location */ - H5O_type_t obj_type; /* Type of object at location */ - ssize_t ret_value; + H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + ssize_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE4("Zs", "ih*sz", loc_id, idx, name, size); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location ID") - if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_GROUP) - HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a group") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location ID") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Call internal function */ - if((ret_value = H5G_obj_get_name_by_idx(loc.oloc, H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5G__get_objname_by_idx(loc.oloc, H5_INDEX_NAME, H5_ITER_INC, idx, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "can't get object name") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objname_by_idx() */ /*------------------------------------------------------------------------- + * Function: H5G__get_objname_by_idx + * + * Purpose: Internal version of H5Gget_objname_by_idx. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static ssize_t +H5G__get_objname_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t idx, char *name, size_t size) +{ + H5O_type_t obj_type; /* Type of object at location */ + ssize_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check args */ + if(H5O_obj_type(oloc, &obj_type) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") + if(obj_type != H5O_TYPE_GROUP) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a group") + + /* Call common routine */ + if((ret_value = H5G_obj_get_name_by_idx(oloc, idx_type, order, idx, name, size)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object name") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_objname_by_idx() */ + + +/*------------------------------------------------------------------------- * Function: H5Gget_objtype_by_idx * * Purpose: Returns the type of objects in the group by giving index. @@ -1067,9 +1429,9 @@ done: H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) { - H5G_loc_t loc; /* Object location */ - H5O_type_t obj_type; /* Type of object at location */ - H5G_obj_t ret_value; + H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + H5G_obj_t ret_value; FUNC_ENTER_API(H5G_UNKNOWN) H5TRACE2("Go", "ih", loc_id, idx); @@ -1077,22 +1439,25 @@ H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) /* Check args */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "not a location ID") - if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type") - if(obj_type != H5O_TYPE_GROUP) - HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "not a group") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5G_UNKNOWN, "can't set API context") +api_ctx_pushed = TRUE; /* Call internal function*/ - if((ret_value = H5G_obj_get_type_by_idx(loc.oloc, idx, H5AC_ind_read_dxpl_id)) == H5G_UNKNOWN) + if(H5G_UNKNOWN == (ret_value = H5G__obj_get_type_by_idx(loc.oloc, idx))) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "can't get object type") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5G_UNKNOWN, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objtype_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_obj_get_type_by_idx + * Function: H5G__obj_get_type_by_idx * * Purpose: Private function for H5Gget_objtype_by_idx. * Returns the type of objects in the group by giving index. @@ -1107,40 +1472,47 @@ done: *------------------------------------------------------------------------- */ static H5G_obj_t -H5G_obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) +H5G__obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ + H5O_type_t obj_type; /* Type of object at location */ H5G_obj_t ret_value = H5G_UNKNOWN; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, H5G_UNKNOWN) + FUNC_ENTER_STATIC_VOL_TAG(oloc->addr) /* Sanity check */ HDassert(oloc); + /* Check args */ + if(H5O_obj_type(oloc, &obj_type) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type") + if(obj_type != H5O_TYPE_GROUP) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "not a group") + /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't check for link info message") if(linfo_exists) { if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the object's name from the dense link storage */ - if((ret_value = H5G__dense_get_type_by_idx(oloc->file, dxpl_id, &linfo, idx)) < 0) + if((ret_value = H5G__dense_get_type_by_idx(oloc->file, &linfo, idx)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type") } /* end if */ else { /* Get the object's type from the link messages */ - if((ret_value = H5G__compact_get_type_by_idx(oloc, dxpl_id, &linfo, idx)) < 0) + if((ret_value = H5G__compact_get_type_by_idx(oloc, &linfo, idx)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type") } /* end else */ } /* end if */ else { /* Get the object's type from the symbol table */ - if((ret_value = H5G__stab_get_type_by_idx(oloc, idx, dxpl_id)) < 0) + if((ret_value = H5G__stab_get_type_by_idx(oloc, idx)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, H5G_UNKNOWN) -} /* end H5G_obj_get_type_by_idx() */ + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) +} /* end H5G__obj_get_type_by_idx() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Gent.c b/src/H5Gent.c index 7987850..4b8b38c 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -387,9 +387,8 @@ H5G__ent_reset(H5G_entry_t *ent) *------------------------------------------------------------------------- */ herr_t -H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, - const H5O_link_t *lnk, H5O_type_t obj_type, const void *crt_info, - H5G_entry_t *ent) +H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, const H5O_link_t *lnk, + H5O_type_t obj_type, const void *crt_info, H5G_entry_t *ent) { size_t name_offset; /* Offset of name in heap */ herr_t ret_value = SUCCEED; /* Return value */ @@ -408,7 +407,7 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, /* * Add the new name to the heap. */ - name_offset = H5HL_insert(f, dxpl_id, heap, HDstrlen(name) + 1, name); + name_offset = H5HL_insert(f, heap, HDstrlen(name) + 1, name); if(0 == name_offset || UFAIL == name_offset) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert symbol name into heap") ent->name_off = name_offset; @@ -436,8 +435,7 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, targ_oloc.addr = lnk->u.hard.addr; /* Check if a symbol table message exists */ - if((stab_exists = H5O_msg_exists(&targ_oloc, H5O_STAB_ID, - dxpl_id)) < 0) + if((stab_exists = H5O_msg_exists(&targ_oloc, H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to check for STAB message") HDassert(!stab_exists); @@ -458,23 +456,20 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, targ_oloc.addr = lnk->u.hard.addr; /* Get the object header */ - if(NULL == (oh = H5O_protect(&targ_oloc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(&targ_oloc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_SYM, H5E_CANTPROTECT, FAIL, "unable to protect target object header") /* Check if a symbol table message exists */ if((stab_exists = H5O_msg_exists_oh(oh, H5O_STAB_ID)) < 0) { - if(H5O_unprotect(&targ_oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) - < 0) + if(H5O_unprotect(&targ_oloc, oh, H5AC__NO_FLAGS_SET) < 0) HERROR(H5E_SYM, H5E_CANTUNPROTECT, "unable to release object header"); HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to check for STAB message") } /* end if */ if(stab_exists) { /* Read symbol table message */ - if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_STAB_ID, - &stab)) { - if(H5O_unprotect(&targ_oloc, dxpl_id, oh, - H5AC__NO_FLAGS_SET) < 0) + if(NULL == H5O_msg_read_oh(f, oh, H5O_STAB_ID, &stab)) { + if(H5O_unprotect(&targ_oloc, oh, H5AC__NO_FLAGS_SET) < 0) HERROR(H5E_SYM, H5E_CANTUNPROTECT, "unable to release object header"); HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read STAB message") } /* end if */ @@ -488,8 +483,7 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, /* No symbol table message, don't cache anything */ ent->type = H5G_NOTHING_CACHED; - if(H5O_unprotect(&targ_oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) - < 0) + if(H5O_unprotect(&targ_oloc, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTUNPROTECT, FAIL, "unable to release object header") } /* end else */ else @@ -503,7 +497,7 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, size_t lnk_offset; /* Offset to sym-link value */ /* Insert link value into local heap */ - if(UFAIL == (lnk_offset = H5HL_insert(f, dxpl_id, heap, + if(UFAIL == (lnk_offset = H5HL_insert(f, heap, HDstrlen(lnk->u.soft.name) + 1, lnk->u.soft.name))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write link value to local heap") diff --git a/src/H5Gint.c b/src/H5Gint.c index 6d33716..3b5de44 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -66,8 +66,6 @@ typedef struct { typedef struct { hid_t gid; /* The group ID for the starting group */ H5G_loc_t *curr_loc; /* Location of starting group */ - hid_t lapl_id; /* LAPL for walking across links */ - hid_t dxpl_id; /* DXPL for operations */ H5_index_t idx_type; /* Index to use */ H5_iter_order_t order; /* Iteration order within index */ H5SL_t *visited; /* Skip list for tracking visited nodes */ @@ -88,7 +86,7 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5G_open_oid(H5G_t *grp, hid_t dxpl_id); +static herr_t H5G__open_oid(H5G_t *grp); /*********************/ @@ -130,21 +128,19 @@ H5FL_DEFINE(H5_obj_t); */ H5G_t * H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, - hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id) + hid_t gcpl_id) { H5O_obj_create_t ocrt_info; /* Information for object creation */ H5G_obj_create_t gcrt_info; /* Information for group creation */ H5G_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL /* Check arguments */ HDassert(loc); HDassert(name && *name); HDassert(lcpl_id != H5P_DEFAULT); HDassert(gcpl_id != H5P_DEFAULT); - HDassert(gapl_id != H5P_DEFAULT); - HDassert(dxpl_id != H5P_DEFAULT); /* Set up group creation info */ gcrt_info.gcpl_id = gcpl_id; @@ -157,7 +153,7 @@ H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, ocrt_info.new_obj = NULL; /* Create the new group and link it to its parent group */ - if(H5L_link_object(loc, name, &ocrt_info, lcpl_id, gapl_id, dxpl_id) < 0) + if(H5L_link_object(loc, name, &ocrt_info, lcpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create and link to group") HDassert(ocrt_info.new_obj); @@ -165,11 +161,48 @@ H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, ret_value = (H5G_t *)ocrt_info.new_obj; done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5G__create_named() */ /*------------------------------------------------------------------------- + * Function: H5G__create_anon + * + * Purpose: Internal routine to create a new anonymous group. + * + * Note: This routine is needed so that there's a non-API routine for + * creating groups that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-NULL, pointer to new group object. + * Failure: NULL + * + * Programmer: Quincey Koziol + * December 17, 2017 + * + *------------------------------------------------------------------------- + */ +H5G_t * +H5G__create_anon(H5F_t *file, H5G_obj_create_t *gcrt_info) +{ + H5G_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(file); + HDassert(gcrt_info); + + /* Create the new group & get its ID */ + if(NULL == (ret_value = H5G__create(file, gcrt_info))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, NULL, "unable to create group") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__create_anon() */ + + +/*------------------------------------------------------------------------- * Function: H5G__create * * Purpose: Creates a new empty group with the specified name. The name @@ -188,7 +221,7 @@ done: *------------------------------------------------------------------------- */ H5G_t * -H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id) +H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info) { H5G_t *grp = NULL; /*new group */ unsigned oloc_init = 0; /* Flag to indicate that the group object location was created successfully */ @@ -199,7 +232,6 @@ H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id) /* check args */ HDassert(file); HDassert(gcrt_info->gcpl_id != H5P_DEFAULT); - HDassert(dxpl_id != H5P_DEFAULT); /* create an open group */ if(NULL == (grp = H5FL_CALLOC(H5G_t))) @@ -208,7 +240,7 @@ H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Create the group object header */ - if(H5G__obj_create(file, dxpl_id, gcrt_info, &(grp->oloc)/*out*/) < 0) + if(H5G__obj_create(file, gcrt_info, &(grp->oloc)/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group object header") oloc_init = 1; /* Indicate that the object location information is valid */ @@ -228,11 +260,11 @@ done: if(ret_value == NULL) { /* Check if we need to release the file-oriented symbol table info */ if(oloc_init) { - if(H5O_dec_rc_by_loc(&(grp->oloc), dxpl_id) < 0) + if(H5O_dec_rc_by_loc(&(grp->oloc)) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") if(H5O_close(&(grp->oloc), NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, NULL, "unable to release object header") - if(H5O_delete(file, dxpl_id, grp->oloc.addr) < 0) + if(H5O_delete(file, grp->oloc.addr) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDELETE, NULL, "unable to delete object header") } /* end if */ if(grp != NULL) { @@ -260,8 +292,7 @@ done: *------------------------------------------------------------------------- */ H5G_t * -H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, - hid_t dxpl_id) +H5G__open_name(const H5G_loc_t *loc, const char *name) { H5G_t *grp = NULL; /* Group to open */ H5G_loc_t grp_loc; /* Location used to open group */ @@ -271,7 +302,7 @@ H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, H5O_type_t obj_type; /* Type of object at location */ H5G_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL /* Check args */ HDassert(loc); @@ -282,31 +313,30 @@ H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, grp_loc.path = &grp_path; H5G_loc_reset(&grp_loc); - /* Find the group object using the gapl passed in */ - if(H5G_loc_find(loc, name, &grp_loc/*out*/, gapl_id, dxpl_id) < 0) + /* Find the group object */ + if(H5G_loc_find(loc, name, &grp_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "group not found") loc_found = TRUE; /* Check that the object found is the correct type */ - if(H5O_obj_type(&grp_oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&grp_oloc, &obj_type) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "can't get object type") if(obj_type != H5O_TYPE_GROUP) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, NULL, "not a group") /* Open the group */ - if((grp = H5G_open(&grp_loc, dxpl_id)) == NULL) + if(NULL == (grp = H5G_open(&grp_loc))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to open group") /* Set return value */ ret_value = grp; done: - if(!ret_value) { + if(!ret_value) if(loc_found && H5G_loc_free(&grp_loc) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, NULL, "can't free location") - } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5G__open_name() */ @@ -326,7 +356,7 @@ done: *------------------------------------------------------------------------- */ H5G_t * -H5G_open(const H5G_loc_t *loc, hid_t dxpl_id) +H5G_open(const H5G_loc_t *loc) { H5G_t *grp = NULL; /* Group opened */ H5G_shared_t *shared_fo; /* Shared group object */ @@ -354,7 +384,7 @@ H5G_open(const H5G_loc_t *loc, hid_t dxpl_id) H5E_clear_stack(NULL); /* Open the group object */ - if(H5G_open_oid(grp, dxpl_id) < 0) + if(H5G__open_oid(grp) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "not found") /* Add group to list of open objects in file */ @@ -404,7 +434,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_open_oid + * Function: H5G__open_oid * * Purpose: Opens an existing group. The group should eventually be * closed by calling H5G_close(). @@ -419,12 +449,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_open_oid(H5G_t *grp, hid_t dxpl_id) +H5G__open_oid(H5G_t *grp) { hbool_t obj_opened = FALSE; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(grp); @@ -439,8 +469,8 @@ H5G_open_oid(H5G_t *grp, hid_t dxpl_id) obj_opened = TRUE; /* Check if this object has the right message(s) to be treated as a group */ - if((H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id) <= 0) - && (H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID, dxpl_id) <= 0)) + if((H5O_msg_exists(&(grp->oloc), H5O_STAB_ID) <= 0) + && (H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID) <= 0)) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "not a group") done: @@ -452,7 +482,39 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_open_oid() */ +} /* end H5G__open_oid() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__close_cb + * + * Purpose: Closes the specified group. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Sunday, February 18, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__close_cb(H5G_t *grp) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check args */ + HDassert(grp && grp->shared); + HDassert(grp->shared->fo_count > 0); + + /* Call actual group close routine */ + if(H5G_close(grp) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "problem closing group") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__close_cb() */ /*------------------------------------------------------------------------- @@ -495,16 +557,16 @@ H5G_close(H5G_t *grp) /* Remove the group from the list of opened objects in the file */ if(H5FO_top_decr(grp->oloc.file, grp->oloc.addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't decrement count for object") - if(H5FO_delete(grp->oloc.file, H5AC_ind_read_dxpl_id, grp->oloc.addr) < 0) + if(H5FO_delete(grp->oloc.file, grp->oloc.addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't remove group from list of open objects") if(H5O_close(&(grp->oloc), &file_closed) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close") /* Evict group metadata if evicting on close */ if(!file_closed && H5F_SHARED(grp->oloc.file) && H5F_EVICT_ON_CLOSE(grp->oloc.file)) { - if(H5AC_flush_tagged_metadata(grp->oloc.file, grp->oloc.addr, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush_tagged_metadata(grp->oloc.file, grp->oloc.addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") - if(H5AC_evict_tagged_metadata(grp->oloc.file, grp->oloc.addr, FALSE, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_evict_tagged_metadata(grp->oloc.file, grp->oloc.addr, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata") } /* end if */ @@ -526,7 +588,8 @@ H5G_close(H5G_t *grp) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "problem attempting to free location") /* If this group is a mount point and the mount point is the last open - * reference to the group, then attempt to close down the file hierarchy + * reference to the group (i.e. fo_count == 1 now), then attempt to + * close down the file hierarchy */ if(grp->shared->mounted && grp->shared->fo_count == 1) { /* Attempt to close down the file hierarchy */ @@ -794,7 +857,7 @@ done: herr_t H5G_iterate(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - const H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id) + const H5G_link_iterate_t *lnk_op, void *op_data) { H5G_loc_t loc; /* Location of parent for group */ hid_t gid = -1; /* ID of group to iterate over */ @@ -815,7 +878,7 @@ H5G_iterate(hid_t loc_id, const char *group_name, */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(NULL == (grp = H5G__open_name(&loc, group_name, lapl_id, dxpl_id))) + if(NULL == (grp = H5G__open_name(&loc, group_name))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") if((gid = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") @@ -826,7 +889,7 @@ H5G_iterate(hid_t loc_id, const char *group_name, udata.op_data = op_data; /* Call the real group iteration routine */ - if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G_iterate_cb, &udata, dxpl_id)) < 0) + if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G_iterate_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "error iterating over links") done: @@ -935,7 +998,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) /* Find the object using the LAPL passed in */ /* (Correctly handles mounted files) */ - if(H5G_loc_find(udata->curr_loc, lnk->name, &obj_loc/*out*/, udata->lapl_id, udata->dxpl_id) < 0) + if(H5G_loc_find(udata->curr_loc, lnk->name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") obj_found = TRUE; @@ -949,7 +1012,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) unsigned rc; /* Reference count of object */ /* Get the object's reference count and type */ - if(H5O_get_rc_and_type(&obj_oloc, udata->dxpl_id, &rc, &otype) < 0) + if(H5O_get_rc_and_type(&obj_oloc, &rc, &otype) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get object info") /* If its ref count is > 1, we add it to the list of visited objects */ @@ -982,7 +1045,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) udata->curr_path_len++; /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(&obj_oloc, &linfo, udata->dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(&obj_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1006,7 +1069,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) udata->curr_loc = &obj_loc; /* Iterate over links in group */ - ret_value = H5G__obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G_visit_cb, udata, udata->dxpl_id); + ret_value = H5G__obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G_visit_cb, udata); /* Restore location */ udata->curr_loc = old_loc; @@ -1059,8 +1122,7 @@ done: */ herr_t H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, - H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id) + H5_iter_order_t order, H5L_iterate_t op, void *op_data) { H5G_iter_visit_ud_t udata; /* User data for callback */ H5O_linfo_t linfo; /* Link info message */ @@ -1082,7 +1144,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Open the group to begin visiting within */ - if((grp = H5G__open_name(&loc, group_name, lapl_id, dxpl_id)) == NULL) + if(NULL == (grp = H5G__open_name(&loc, group_name))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an ID for the starting group */ @@ -1096,8 +1158,6 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, /* Set up user data */ udata.gid = gid; udata.curr_loc = &start_loc; - udata.lapl_id = lapl_id; - udata.dxpl_id = dxpl_id; udata.idx_type = idx_type; udata.order = order; udata.op = op; @@ -1114,7 +1174,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create skip list for visited objects") /* Get the group's reference count */ - if(H5O_get_rc_and_type(&grp->oloc, dxpl_id, &rc, NULL) < 0) + if(H5O_get_rc_and_type(&grp->oloc, &rc, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get object info") /* If its ref count is > 1, we add it to the list of visited objects */ @@ -1136,7 +1196,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, } /* end if */ /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1157,7 +1217,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, } /* end if */ /* Call the link iteration routine */ - if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G_visit_cb, &udata, dxpl_id)) < 0) + if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G_visit_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't visit links") done: @@ -1179,6 +1239,44 @@ done: /*------------------------------------------------------------------------- + * Function: H5G__get_create_plist + * + * Purpose: Internal routine to retrieve a group's creation property list. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: ID for a copy of the group creation property + * list. The property list ID should be released + * by calling H5Pclose(). + * + * Failure: H5I_INVALID_HID + * + * Programmer: Quincey Koziol + * December 17, 2017 + * + *------------------------------------------------------------------------- + */ +hid_t +H5G__get_create_plist(const H5G_t *grp) +{ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(grp); + + /* Retrieve the GCPL */ + if((ret_value = H5G_get_create_plist(grp)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "can't get group's creation property list") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_create_plist() */ + + +/*------------------------------------------------------------------------- * Function: H5G_get_create_plist * * Purpose: Private function for H5Gget_create_plist @@ -1187,7 +1285,7 @@ done: * property list. The property list ID should be * released by calling H5Pclose(). * - * Failure: FAIL + * Failure: H5I_INVALID_HID * * Programmer: Quincey Koziol * Tuesday, October 25, 2005 @@ -1195,7 +1293,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5G_get_create_plist(H5G_t *grp) +H5G_get_create_plist(const H5G_t *grp) { H5O_linfo_t linfo; /* Link info message */ htri_t ginfo_exists; @@ -1203,60 +1301,60 @@ H5G_get_create_plist(H5G_t *grp) htri_t pline_exists; H5P_genplist_t *gcpl_plist; H5P_genplist_t *new_plist; - hid_t new_gcpl_id = FAIL; - hid_t ret_value = FAIL; + hid_t new_gcpl_id = H5I_INVALID_HID; + hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(H5I_INVALID_HID) /* Copy the default group creation property list */ if(NULL == (gcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_GROUP_CREATE_ID_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default group creation property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't get default group creation property list") if((new_gcpl_id = H5P_copy_plist(gcpl_plist, TRUE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to copy the creation property list") + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "unable to copy the creation property list") if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_gcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't get property list") /* Retrieve any object creation properties */ - if(H5O_get_create_plist(&grp->oloc, H5AC_ind_read_dxpl_id, new_plist) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object creation info") + if(H5O_get_create_plist(&grp->oloc, new_plist) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "can't get object creation info") /* Check for the group having a group info message */ - if((ginfo_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") + if((ginfo_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to read object header") if(ginfo_exists) { H5O_ginfo_t ginfo; /* Group info message */ /* Read the group info */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_GINFO_ID, &ginfo, H5AC_ind_read_dxpl_id)) - HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info") + if(NULL == H5O_msg_read(&(grp->oloc), H5O_GINFO_ID, &ginfo)) + HGOTO_ERROR(H5E_SYM, H5E_BADMESG, H5I_INVALID_HID, "can't get group info") /* Set the group info for the property list */ if(H5P_set(new_plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set group info") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, H5I_INVALID_HID, "can't set group info") } /* end if */ /* Check for the group having a link info message */ - if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") + if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to read object header") if(linfo_exists) { /* Set the link info for the property list */ if(H5P_set(new_plist, H5G_CRT_LINK_INFO_NAME, &linfo) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set link info") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, H5I_INVALID_HID, "can't set link info") } /* end if */ /* Check for the group having a pipeline message */ - if((pline_exists = H5O_msg_exists(&(grp->oloc), H5O_PLINE_ID, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") + if((pline_exists = H5O_msg_exists(&(grp->oloc), H5O_PLINE_ID)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "unable to read object header") if(pline_exists) { H5O_pline_t pline; /* Pipeline message */ /* Read the pipeline */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_PLINE_ID, &pline, H5AC_ind_read_dxpl_id)) - HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link pipeline") + if(NULL == H5O_msg_read(&(grp->oloc), H5O_PLINE_ID, &pline)) + HGOTO_ERROR(H5E_SYM, H5E_BADMESG, H5I_INVALID_HID, "can't get link pipeline") /* Set the pipeline for the property list */ if(H5P_poke(new_plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set link pipeline") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, H5I_INVALID_HID, "can't set link pipeline") } /* end if */ /* Set the return value */ @@ -1266,8 +1364,224 @@ done: if(ret_value < 0) { if(new_gcpl_id > 0) if(H5I_dec_app_ref(new_gcpl_id) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't free") + HDONE_ERROR(H5E_SYM, H5E_CANTDEC, H5I_INVALID_HID, "can't free") } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_get_create_plist() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__get_info + * + * Purpose: Internal routine to retrieve the info for a group. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__get_info(const H5G_loc_t *loc, H5G_info_t *grp_info) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(grp_info); + + /* Retrieve the group's information */ + if(H5G__obj_info(loc->oloc, grp_info) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__get_info_by_name + * + * Purpose: Internal routine to retrieve the info for a group, by name. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__get_info_by_name(const H5G_loc_t *loc, const char *name, H5G_info_t *grp_info) +{ + H5G_loc_t grp_loc; /* Location used to open group */ + H5G_name_t grp_path; /* Opened object group hier. path */ + H5O_loc_t grp_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Location at 'name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(grp_info); + + /* Set up opened group location to fill in */ + grp_loc.oloc = &grp_oloc; + grp_loc.path = &grp_path; + H5G_loc_reset(&grp_loc); + + /* Find the group object */ + if(H5G_loc_find(loc, name, &grp_loc/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") + loc_found = TRUE; + + /* Retrieve the group's information */ + if(H5G__obj_info(grp_loc.oloc, grp_info/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") + +done: + /* Clean up */ + if(loc_found && H5G_loc_free(&grp_loc) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_info_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__get_info_by_idx + * + * Purpose: Internal routine to retrieve the info for a group, by index. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *grp_info) +{ + H5G_loc_t grp_loc; /* Location used to open group */ + H5G_name_t grp_path; /* Opened object group hier. path */ + H5O_loc_t grp_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Location at 'name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(grp_info); + + /* Set up opened group location to fill in */ + grp_loc.oloc = &grp_oloc; + grp_loc.path = &grp_path; + H5G_loc_reset(&grp_loc); + + /* Find the object's location, according to the order in the index */ + if(H5G_loc_find_by_idx(loc, group_name, idx_type, order, n, &grp_loc/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") + loc_found = TRUE; + + /* Retrieve the group's information */ + if(H5G__obj_info(grp_loc.oloc, grp_info/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") + +done: + /* Clean up */ + if(loc_found && H5G_loc_free(&grp_loc) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_info_by_idx() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__flush + * + * Purpose: Internal routine to flushes a group to disk. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__flush(H5G_t *grp, hid_t group_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(grp); + + /* Flush metadata to file */ + if(H5O_flush_common(&grp->oloc, group_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTFLUSH, FAIL, "unable to flush group and object flush callback") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5G__flush */ + + +/*------------------------------------------------------------------------- + * Function: H5G__refresh + * + * Purpose: Internal routine to refresh a group. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__refresh(H5G_t *grp, hid_t group_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(grp); + + /* Call private function to refresh group object */ + if((H5O_refresh_metadata(group_id, grp->oloc)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to refresh group") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5G__refresh */ + diff --git a/src/H5Glink.c b/src/H5Glink.c index e199f89..509e511 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -553,8 +553,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__link_name_replace(H5F_t *file, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, - const H5O_link_t *lnk) +H5G__link_name_replace(H5F_t *file, H5RS_str_t *grp_full_path_r, const H5O_link_t *lnk) { H5RS_str_t *obj_path_r = NULL; /* Full path for link being removed */ herr_t ret_value = SUCCEED; /* Return value */ @@ -567,7 +566,7 @@ H5G__link_name_replace(H5F_t *file, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, /* Search the open IDs and replace names for unlinked object */ if(grp_full_path_r) { obj_path_r = H5G_build_fullpath_refstr_str(grp_full_path_r, lnk->name); - if(H5G_name_replace(lnk, H5G_NAME_DELETE, file, obj_path_r, NULL, NULL, dxpl_id) < 0) + if(H5G_name_replace(lnk, H5G_NAME_DELETE, file, obj_path_r, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to replace name") } /* end if */ diff --git a/src/H5Gloc.c b/src/H5Gloc.c index c011cdf..7273a89 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -65,8 +65,6 @@ typedef struct { /* User data for looking up an object in a group by index */ typedef struct { /* downward */ - hid_t lapl_id; /* LAPL to use for operation */ - hid_t dxpl_id; /* DXPL to use for operation */ H5_index_t idx_type; /* Index to use */ H5_iter_order_t order; /* Iteration order within index */ hsize_t n; /* Offset within index */ @@ -78,7 +76,6 @@ typedef struct { /* User data for getting an object's info in a group */ typedef struct { /* downward */ - hid_t dxpl_id; /* DXPL to use for operation */ hbool_t want_ih_info; /* Whether to retrieve the index & heap info */ /* upward */ @@ -88,7 +85,6 @@ typedef struct { /* User data for setting an object's comment in a group */ typedef struct { /* downward */ - hid_t dxpl_id; /* DXPL to use for operation */ const char *comment; /* Object comment buffer */ /* upward */ @@ -97,7 +93,6 @@ typedef struct { /* User data for getting an object's comment in a group */ typedef struct { /* downward */ - hid_t dxpl_id; /* DXPL to use for operation */ char *comment; /* Object comment buffer */ size_t bufsize; /* Size of object comment buffer */ @@ -111,16 +106,16 @@ typedef struct { /********************/ /* Group traversal callbacks */ -static herr_t H5G_loc_find_cb(H5G_loc_t *grp_loc, const char *name, +static herr_t H5G__loc_find_cb(H5G_loc_t *grp_loc, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata, H5G_own_loc_t *own_loc); -static herr_t H5G_loc_find_by_idx_cb(H5G_loc_t *grp_loc, const char *name, +static herr_t H5G__loc_find_by_idx_cb(H5G_loc_t *grp_loc, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata, H5G_own_loc_t *own_loc); -static herr_t H5G_loc_set_comment_cb(H5G_loc_t *grp_loc, const char *name, +static herr_t H5G__loc_set_comment_cb(H5G_loc_t *grp_loc, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata, H5G_own_loc_t *own_loc); -static herr_t H5G_loc_get_comment_cb(H5G_loc_t *grp_loc, const char *name, +static herr_t H5G__loc_get_comment_cb(H5G_loc_t *grp_loc, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata, H5G_own_loc_t *own_loc); @@ -357,7 +352,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_find_cb + * Function: H5G__loc_find_cb * * Purpose: Callback for retrieving object location for an object in a group * @@ -369,14 +364,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_find_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, +H5G__loc_find_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_fnd_t *udata = (H5G_loc_fnd_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid object */ if(obj_loc == NULL) @@ -391,7 +386,7 @@ H5G_loc_find_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_loc_find_cb() */ +} /* end H5G__loc_find_cb() */ /*------------------------------------------------------------------------- @@ -407,8 +402,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc/*out*/, - hid_t lapl_id, hid_t dxpl_id) +H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc/*out*/) { H5G_loc_fnd_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -424,7 +418,7 @@ H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc/*out*/, udata.loc = obj_loc; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G_loc_find_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G__loc_find_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object") done: @@ -433,7 +427,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_find_by_idx_cb + * Function: H5G__loc_find_by_idx_cb * * Purpose: Callback for retrieving object location for an object in a group * according to the order within an index @@ -446,27 +440,25 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_find_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5G__loc_find_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_fbi_t *udata = (H5G_loc_fbi_t *)_udata; /* User data passed in */ H5O_link_t fnd_lnk; /* Link within group */ hbool_t lnk_copied = FALSE; /* Whether the link was copied */ - size_t links_left = H5L_NUM_LINKS; /* # of links left to traverse */ hbool_t obj_loc_valid = FALSE; /* Flag to indicate that the object location is valid */ hbool_t obj_exists = FALSE; /* Whether the object exists (unused) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Query link */ - if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, - udata->n, &fnd_lnk, udata->dxpl_id) < 0) + if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "link not found") lnk_copied = TRUE; @@ -478,7 +470,7 @@ H5G_loc_find_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_AT /* Perform any special traversals that the link needs */ /* (soft links, user-defined links, file mounting, etc.) */ /* (may modify the object location) */ - if(H5G__traverse_special(obj_loc, &fnd_lnk, H5G_TARGET_NORMAL, &links_left, TRUE, udata->loc, &obj_exists, udata->lapl_id, udata->dxpl_id) < 0) + if(H5G__traverse_special(obj_loc, &fnd_lnk, H5G_TARGET_NORMAL, TRUE, udata->loc, &obj_exists) < 0) HGOTO_ERROR(H5E_LINK, H5E_TRAVERSE, FAIL, "special link traversal failed") done: @@ -496,7 +488,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_loc_find_by_idx_cb() */ +} /* end H5G__loc_find_by_idx_cb() */ /*------------------------------------------------------------------------- @@ -512,9 +504,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_loc_find_by_idx(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, H5G_loc_t *obj_loc/*out*/, hid_t lapl_id, - hid_t dxpl_id) +H5G_loc_find_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, H5G_loc_t *obj_loc/*out*/) { H5G_loc_fbi_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -527,15 +518,13 @@ H5G_loc_find_by_idx(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, HDassert(obj_loc); /* Set up user data for locating object */ - udata.dxpl_id = dxpl_id; - udata.lapl_id = lapl_id; udata.idx_type = idx_type; udata.order = order; udata.n = n; udata.loc = obj_loc; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, group_name, H5G_TARGET_NORMAL, H5G_loc_find_by_idx_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, group_name, H5G_TARGET_NORMAL, H5G__loc_find_by_idx_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object") done: @@ -557,7 +546,7 @@ done: */ herr_t H5G__loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc, - H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id) + H5O_type_t obj_type, const void *crt_info) { H5O_link_t lnk; /* Link for object to insert */ herr_t ret_value = SUCCEED; /* Return value */ @@ -579,8 +568,7 @@ H5G__loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc, lnk.u.hard.addr = obj_loc->oloc->addr; /* Insert new group into current group's symbol table */ - if(H5G_obj_insert(grp_loc->oloc, name, &lnk, TRUE, obj_type, crt_info, - dxpl_id) < 0) + if(H5G_obj_insert(grp_loc->oloc, name, &lnk, TRUE, obj_type, crt_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert object") /* Set the name of the object location */ @@ -644,7 +632,7 @@ H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UN *------------------------------------------------------------------------- */ htri_t -H5G_loc_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) +H5G_loc_exists(const H5G_loc_t *loc, const char *name) { H5G_loc_exists_t udata; /* User data for traversal callback */ htri_t ret_value = FAIL; /* Return value */ @@ -659,7 +647,7 @@ H5G_loc_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl udata.exists = FALSE; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G_loc_exists_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G_loc_exists_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't check if object exists") /* Set return value */ @@ -696,7 +684,7 @@ H5G_loc_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUS HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") /* Query object information */ - if(H5O_get_info(obj_loc->oloc, udata->dxpl_id, udata->want_ih_info, udata->oinfo) < 0) + if(H5O_get_info(obj_loc->oloc, udata->want_ih_info, udata->oinfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object info") done: @@ -722,8 +710,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_loc_info(H5G_loc_t *loc, const char *name, hbool_t want_ih_info, H5O_info_t *oinfo/*out*/, - hid_t lapl_id, hid_t dxpl_id) +H5G_loc_info(const H5G_loc_t *loc, const char *name, hbool_t want_ih_info, H5O_info_t *oinfo/*out*/) { H5G_loc_info_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -736,12 +723,11 @@ H5G_loc_info(H5G_loc_t *loc, const char *name, hbool_t want_ih_info, H5O_info_t HDassert(oinfo); /* Set up user data for locating object */ - udata.dxpl_id = dxpl_id; udata.want_ih_info = want_ih_info; udata.oinfo = oinfo; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G_loc_info_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G_loc_info_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object") done: @@ -750,7 +736,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_set_comment_cb + * Function: H5G__loc_set_comment_cb * * Purpose: Callback for (re)setting object comment for an object in a group * @@ -762,7 +748,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_set_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, +H5G__loc_set_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_sc_t *udata = (H5G_loc_sc_t *)_udata; /* User data passed in */ @@ -770,26 +756,26 @@ H5G_loc_set_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_AT htri_t exists; /* Whether a "comment" message already exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") /* Check for existing comment message */ - if((exists = H5O_msg_exists(obj_loc->oloc, H5O_NAME_ID, udata->dxpl_id)) < 0) + if((exists = H5O_msg_exists(obj_loc->oloc, H5O_NAME_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read object header") /* Remove the previous comment message if any */ if(exists) - if(H5O_msg_remove(obj_loc->oloc, H5O_NAME_ID, 0, TRUE, udata->dxpl_id) < 0) + if(H5O_msg_remove(obj_loc->oloc, H5O_NAME_ID, 0, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete existing comment object header message") /* Add the new message */ if(udata->comment && *udata->comment) { /* Casting away const OK -QAK */ comment.s = (char *)udata->comment; - if(H5O_msg_create(obj_loc->oloc, H5O_NAME_ID, 0, H5O_UPDATE_TIME, &comment, udata->dxpl_id) < 0) + if(H5O_msg_create(obj_loc->oloc, H5O_NAME_ID, 0, H5O_UPDATE_TIME, &comment) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to set comment object header message") } /* end if */ @@ -799,7 +785,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_loc_set_comment_cb() */ +} /* end H5G__loc_set_comment_cb() */ /*------------------------------------------------------------------------- @@ -816,8 +802,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_loc_set_comment(H5G_loc_t *loc, const char *name, const char *comment, - hid_t lapl_id, hid_t dxpl_id) +H5G_loc_set_comment(const H5G_loc_t *loc, const char *name, const char *comment) { H5G_loc_sc_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -829,11 +814,10 @@ H5G_loc_set_comment(H5G_loc_t *loc, const char *name, const char *comment, HDassert(name && *name); /* Set up user data for locating object */ - udata.dxpl_id = dxpl_id; udata.comment = comment; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G_loc_set_comment_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G__loc_set_comment_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object") done: @@ -842,7 +826,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_get_comment_cb + * Function: H5G__loc_get_comment_cb * * Purpose: Callback for retrieving object comment for an object in a group * @@ -854,14 +838,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_get_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, +H5G__loc_get_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_gc_t *udata = (H5G_loc_gc_t *)_udata; /* User data passed in */ H5O_name_t comment; /* Object header "comment" message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) @@ -869,11 +853,12 @@ H5G_loc_get_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_AT /* Query object comment */ comment.s = NULL; - if(NULL == H5O_msg_read(obj_loc->oloc, H5O_NAME_ID, &comment, udata->dxpl_id)) { + if(NULL == H5O_msg_read(obj_loc->oloc, H5O_NAME_ID, &comment)) { if(udata->comment && udata->bufsize > 0) udata->comment[0] = '\0'; udata->comment_size = 0; - } else { + } /* end if */ + else { if(udata->comment && udata->bufsize) HDstrncpy(udata->comment, comment.s, udata->bufsize); udata->comment_size = (ssize_t)HDstrlen(comment.s); @@ -886,7 +871,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_loc_get_comment_cb() */ +} /* end H5G__loc_get_comment_cb() */ /*------------------------------------------------------------------------- @@ -907,8 +892,8 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5G_loc_get_comment(H5G_loc_t *loc, const char *name, char *comment/*out*/, - size_t bufsize, hid_t lapl_id, hid_t dxpl_id) +H5G_loc_get_comment(const H5G_loc_t *loc, const char *name, char *comment/*out*/, + size_t bufsize) { H5G_loc_gc_t udata; /* User data for traversal callback */ ssize_t ret_value = -1; /* Return value */ @@ -920,13 +905,12 @@ H5G_loc_get_comment(H5G_loc_t *loc, const char *name, char *comment/*out*/, HDassert(name && *name); /* Set up user data for locating object */ - udata.dxpl_id = dxpl_id; udata.comment = comment; udata.bufsize = bufsize; udata.comment_size = (-1); /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G_loc_get_comment_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G__loc_get_comment_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object") /* Set the return value */ diff --git a/src/H5Gname.c b/src/H5Gname.c index 7b53668..1ca06b9 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -65,8 +65,6 @@ typedef struct H5G_names_t { typedef struct H5G_gnba_iter_t { /* In */ const H5O_loc_t *loc; /* The location of the object we're looking for */ - hid_t lapl_id; /* LAPL for operations */ - hid_t dxpl_id; /* DXPL for operations */ /* Out */ char *path; /* Name of the object */ @@ -560,7 +558,7 @@ H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth) */ ssize_t H5G_get_name(const H5G_loc_t *loc, char *name/*out*/, size_t size, - hbool_t *cached, hid_t lapl_id, hid_t dxpl_id) + hbool_t *cached) { ssize_t len = 0; /* Length of object's name */ ssize_t ret_value = -1; /* Return value */ @@ -593,7 +591,7 @@ H5G_get_name(const H5G_loc_t *loc, char *name/*out*/, size_t size, HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get file ID") /* Search for name of object */ - if((len = H5G_get_name_by_addr(file, lapl_id, dxpl_id, loc->oloc, name, size)) < 0) { + if((len = H5G_get_name_by_addr(file, loc->oloc, name, size)) < 0) { H5I_dec_ref(file); HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't determine name") } /* end if */ @@ -1076,8 +1074,7 @@ done: */ herr_t H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, - H5RS_str_t *src_full_path_r, H5F_t *dst_file, H5RS_str_t *dst_full_path_r, - hid_t dxpl_id) + H5RS_str_t *src_full_path_r, H5F_t *dst_file, H5RS_str_t *dst_full_path_r) { herr_t ret_value = SUCCEED; @@ -1106,7 +1103,7 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, tmp_oloc.addr = lnk->u.hard.addr; /* Get the type of the object */ - if(H5O_obj_type(&tmp_oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&tmp_oloc, &obj_type) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") /* Determine which type of objects to operate on */ @@ -1244,7 +1241,7 @@ H5G_get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info_t *linfo, H5G_loc_reset(&obj_loc); /* Find the object */ - if(H5G_loc_find(&grp_loc, path, &obj_loc/*out*/, udata->lapl_id, udata->dxpl_id) < 0) + if(H5G_loc_find(&grp_loc, path, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") obj_found = TRUE; @@ -1283,7 +1280,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5G_get_name_by_addr(hid_t file, hid_t lapl_id, hid_t dxpl_id, const H5O_loc_t *loc, +H5G_get_name_by_addr(hid_t file, const H5O_loc_t *loc, char *name, size_t size) { H5G_gnba_iter_t udata; /* User data for iteration */ @@ -1310,12 +1307,10 @@ H5G_get_name_by_addr(hid_t file, hid_t lapl_id, hid_t dxpl_id, const H5O_loc_t * else { /* Set up user data for iterator */ udata.loc = loc; - udata.lapl_id = lapl_id; - udata.dxpl_id = dxpl_id; udata.path = NULL; /* Visit all the links in the file */ - if((status = H5G_visit(file, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G_get_name_by_addr_cb, &udata, lapl_id, dxpl_id)) < 0) + if((status = H5G_visit(file, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G_get_name_by_addr_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group traversal failed while looking for object name") else if(status > 0) found_obj = TRUE; diff --git a/src/H5Gnode.c b/src/H5Gnode.c index b335624..2ae3d538 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -76,16 +76,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, +static herr_t H5G__node_create(H5F_t *f, H5B_ins_t op, void *_lt_key, 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, +static htri_t H5G_node_found(H5F_t *f, haddr_t addr, const void *_lt_key, void *_udata); -static H5B_ins_t H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, +static H5B_ins_t H5G__node_insert(H5F_t *f, 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*/); -static H5B_ins_t H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *lt_key, +static H5B_ins_t H5G_node_remove(H5F_t *f, haddr_t addr, void *lt_key, 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); @@ -102,11 +102,11 @@ 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_create, /*new */ H5G_node_cmp2, /*cmp2 */ H5G_node_cmp3, /*cmp3 */ H5G_node_found, /*found */ - H5G_node_insert, /*insert */ + H5G__node_insert, /*insert */ TRUE, /*follow min branch? */ TRUE, /*follow max branch? */ H5B_RIGHT, /*critical key */ @@ -297,7 +297,7 @@ H5G__node_free(H5G_node_t *sym) /*------------------------------------------------------------------------- - * Function: H5G_node_create + * 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 @@ -316,7 +316,7 @@ H5G__node_free(H5G_node_t *sym) *------------------------------------------------------------------------- */ static herr_t -H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_key, +H5G__node_create(H5F_t *f, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_key, 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; @@ -324,7 +324,7 @@ H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_ H5G_node_t *sym = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -335,12 +335,12 @@ H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_ if(NULL == (sym = H5FL_CALLOC(H5G_node_t))) 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))) + if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)sym->node_size))) 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") - if(H5AC_insert_entry(f, dxpl_id, H5AC_SNODE, *addr_p, sym, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_SNODE, *addr_p, sym, H5AC__NO_FLAGS_SET) < 0) 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 @@ -363,7 +363,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_create() */ +} /* end H5G__node_create() */ /*------------------------------------------------------------------------- @@ -507,7 +507,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, +H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void *_udata) { H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata; @@ -529,7 +529,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))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node") /* @@ -557,7 +557,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "iterator callback failed") done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) @@ -565,7 +565,7 @@ done: /*------------------------------------------------------------------------- - * 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 @@ -597,11 +597,9 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, - void H5_ATTR_UNUSED *_lt_key, hbool_t H5_ATTR_UNUSED *lt_key_changed, - void *_md_key, void *_udata, - void *_rt_key, hbool_t *rt_key_changed, - haddr_t *new_node_p) +H5G__node_insert(H5F_t *f, haddr_t addr, void H5_ATTR_UNUSED *_lt_key, + hbool_t H5_ATTR_UNUSED *lt_key_changed, void *_md_key, void *_udata, + 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; @@ -615,7 +613,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5G_entry_t ent; /* Entry to insert in node */ H5B_ins_t ret_value = H5B_INS_ERROR; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -630,7 +628,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))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") /* @@ -654,7 +652,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, 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, + if(H5G__ent_convert(f, 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") @@ -668,10 +666,10 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, 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) + if(H5G__node_create(f, 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))) + if(NULL == (snrt = (H5G_node_t *)H5AC_protect(f, 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), @@ -726,13 +724,13 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, insert_into->nsyms += 1; done: - if(snrt && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, *new_node_p, snrt, snrt_flags) < 0) + if(snrt && H5AC_unprotect(f, H5AC_SNODE, *new_node_p, snrt, snrt_flags) < 0) 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) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, sn_flags) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_insert() */ +} /* end H5G__node_insert() */ /*------------------------------------------------------------------------- @@ -764,7 +762,7 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, +H5G_node_remove(H5F_t *f, 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*/) @@ -788,7 +786,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, HDassert(udata && udata->common.heap); /* Load the symbol table */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) 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 */ @@ -835,7 +833,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, } /* end else */ /* Replace any object names */ - if(H5G__link_name_replace(f, dxpl_id, udata->grp_full_path_r, &lnk) < 0) + if(H5G__link_name_replace(f, udata->grp_full_path_r, &lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get object type") /* Decrement the ref. count for hard links */ @@ -846,7 +844,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, tmp_oloc.file = f; tmp_oloc.addr = lnk.u.hard.addr; - if(H5O_link(&tmp_oloc, -1, dxpl_id) < 0) + if(H5O_link(&tmp_oloc, -1) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to decrement object link count") } /* end if */ else { @@ -855,13 +853,13 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, size_t soft_link_len; /* Length of string in local heap */ soft_link_len = HDstrlen(lnk.u.soft.name) + 1; - if(H5HL_remove(f, dxpl_id, udata->common.heap, sn->entry[idx].cache.slink.lval_offset, soft_link_len) < 0) + if(H5HL_remove(f, udata->common.heap, sn->entry[idx].cache.slink.lval_offset, soft_link_len) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, H5B_INS_ERROR, "unable to remove soft link from local heap") } /* end if */ } /* end else */ /* Remove the link's name from the local heap */ - if(H5HL_remove(f, dxpl_id, udata->common.heap, sn->entry[idx].name_off, link_name_len) < 0) + if(H5HL_remove(f, udata->common.heap, sn->entry[idx].name_off, link_name_len) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, H5B_INS_ERROR, "unable to remove link name from local heap") /* Remove the entry from the symbol table node */ @@ -923,7 +921,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, HDassert(H5F_addr_defined(sn->entry[idx].header)); tmp_oloc.addr = sn->entry[idx].header; - if(H5O_link(&tmp_oloc, -1, dxpl_id) < 0) + if(H5O_link(&tmp_oloc, -1) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, H5B_INS_ERROR, "unable to decrement object link count") } /* end if */ } /* end for */ @@ -939,7 +937,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, } /* end else */ done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, sn_flags) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, sn_flags) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) @@ -960,7 +958,7 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, +H5G__node_iterate(H5F_t *f, 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; @@ -979,7 +977,7 @@ H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, h HDassert(udata && udata->heap); /* 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))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* @@ -1018,11 +1016,12 @@ H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, h done: /* Release resources */ - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__node_iterate() */ + /*------------------------------------------------------------------------- * Function: H5G__node_sumup @@ -1038,7 +1037,7 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, +H5G__node_sumup(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { hsize_t *num_objs = (hsize_t *)_udata; @@ -1055,13 +1054,13 @@ H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, had HDassert(num_objs); /* 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))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") *num_objs += sn->nsyms; done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1083,7 +1082,7 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, +H5G__node_by_idx(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_idx_common_t *udata = (H5G_bt_it_idx_common_t *)_udata; @@ -1100,7 +1099,7 @@ H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, ha HDassert(udata); /* 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))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) 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 */ @@ -1122,7 +1121,7 @@ H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, ha udata->num_objs += sn->nsyms; done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1219,7 +1218,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, +H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_cpy_t *udata = (H5G_bt_it_cpy_t *)_udata; @@ -1238,11 +1237,11 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd HDassert(udata); /* 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))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) 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))) + if(NULL == (heap = H5HL_protect(f, udata->src_heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5_ITER_ERROR, "unable to protect symbol name") /* copy object in this node one by one */ @@ -1275,7 +1274,7 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd 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) { + if(H5G_loc_info(&grp_loc, link_name, FALSE, &oinfo) >= 0) { tmp_src_ent.header = oinfo.addr; src_ent = &tmp_src_ent; } /* end if */ @@ -1298,8 +1297,7 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd tmp_src_oloc.addr = src_ent->header; /* Copy the shared object from source to destination */ - if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, - cpy_info, TRUE, &obj_type, (void **)&cpy_udata) < 0) + if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, cpy_info, TRUE, &obj_type, (void **)&cpy_udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy object") /* Set up object creation info for symbol table insertion. Only @@ -1339,17 +1337,16 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get source object name") /* Set copied metadata tag */ - H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, H5_ITER_ERROR); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Insert the new object in the destination file's group */ /* (Don't increment the link count - that's already done above for hard links) */ if(H5G__stab_insert_real(udata->dst_file, udata->dst_stab, name, &lnk, - obj_type, (obj_type == H5O_TYPE_GROUP ? &gcrt_info : NULL), - dxpl_id) < 0) + obj_type, (obj_type == H5O_TYPE_GROUP ? &gcrt_info : NULL)) < 0) HGOTO_ERROR_TAG(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "unable to insert the name") /* Reset metadata tag */ - H5_END_TAG(H5_ITER_ERROR); + H5_END_TAG } /* end of for (i=0; insyms; i++) */ @@ -1357,7 +1354,7 @@ done: if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to unprotect symbol name") - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1378,7 +1375,7 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, +H5G__node_build_table(H5F_t *f, 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; @@ -1399,7 +1396,7 @@ H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_ke * Save information about the symbol table node since we can't lock it * 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))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* Check if the link table needs to be extended */ @@ -1432,7 +1429,7 @@ H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_ke done: /* Release the locked items */ - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1453,7 +1450,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATTR_UNUSED *_lt_key, +H5G__node_iterate_size(H5F_t *f, 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 */ @@ -1485,8 +1482,8 @@ H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATT *------------------------------------------------------------------------- */ 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_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth, + haddr_t heap_addr) { H5G_node_t *sn = NULL; H5HL_t *heap = NULL; @@ -1506,19 +1503,19 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, /* Pin the heap down in memory */ if(heap_addr > 0 && H5F_addr_defined(heap_addr)) - if(NULL == (heap = H5HL_protect(f, dxpl_id, heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(f, heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table heap") /* * If we couldn't load the symbol table node, then try loading the * B-tree node. */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) { + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) { H5G_bt_common_t udata; /*data to pass through B-tree */ H5E_clear_stack(NULL); /* discard that error */ udata.heap = heap; - if(H5B_debug(f, dxpl_id, addr, stream, indent, fwidth, H5B_SNODE, &udata) < 0) + if(H5B_debug(f, addr, stream, indent, fwidth, H5B_SNODE, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to debug B-tree node"); } /* end if */ else { @@ -1551,7 +1548,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, } /* end if */ done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) 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/H5Gobj.c b/src/H5Gobj.c index d2dc83b..e38d97c 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -58,7 +58,6 @@ typedef struct { H5F_t *f; /* Pointer to file for insertion */ haddr_t oh_addr; /* Address of the object header */ - hid_t dxpl_id; /* DXPL during insertion */ H5O_linfo_t *linfo; /* Pointer to link info */ } H5G_obj_oh_it_ud1_t; @@ -76,7 +75,6 @@ typedef struct { */ typedef struct { const H5O_loc_t *grp_oloc; /* Pointer to group for insertion */ - hid_t dxpl_id; /* DXPL during insertion */ } H5G_obj_stab_it_ud1_t; @@ -90,8 +88,7 @@ typedef struct { /********************/ static herr_t H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned idx, void *_udata); -static herr_t H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, - hid_t dxpl_id); +static herr_t H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo); /*********************/ @@ -124,8 +121,7 @@ static herr_t H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *li *------------------------------------------------------------------------- */ herr_t -H5G__obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, - H5O_loc_t *oloc/*out*/) +H5G__obj_create(H5F_t *f, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { H5P_genplist_t *gc_plist; /* Group creation property list */ H5O_ginfo_t ginfo; /* Group info */ @@ -158,7 +154,7 @@ H5G__obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get group info") /* Call the "real" group creation routine now */ - if(H5G__obj_create_real(f, dxpl_id, &ginfo, &linfo, &pline, gcrt_info, oloc) < 0) + if(H5G__obj_create_real(f, &ginfo, &linfo, &pline, gcrt_info, oloc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "unable to create group") done: @@ -180,7 +176,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, +H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linfo, const H5O_pline_t *pline, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { @@ -261,32 +257,32 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, * since nothing refers to it yet. The link count will be * incremented if the object is added to the group directed graph. */ - if(H5O_create(f, dxpl_id, hdr_size, (size_t)1, gcpl_id, oloc/*out*/) < 0) + if(H5O_create(f, hdr_size, (size_t)1, gcpl_id, oloc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") /* Check for format of group to create */ if(use_latest_format) { /* Insert link info message */ /* (Casting away const OK - QAK) */ - if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo, dxpl_id) < 0) + if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Insert group info message */ /* (Casting away const OK - QAK) */ - if(H5O_msg_create(oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)ginfo, dxpl_id) < 0) + if(H5O_msg_create(oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)ginfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Insert pipeline message */ if(pline && pline->nused) /* (Casting away const OK - QAK) */ - if(H5O_msg_create(oloc, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)pline, dxpl_id) < 0) + if(H5O_msg_create(oloc, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)pline) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") } /* end if */ else { H5O_stab_t stab; /* Symbol table message */ /* The group doesn't currently have a 'stab' message, go create one */ - if(H5G__stab_create(oloc, dxpl_id, ginfo, &stab) < 0) + if(H5G__stab_create(oloc, ginfo, &stab) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create symbol table") /* Cache the symbol table information */ @@ -316,23 +312,23 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) +H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo) { H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* check arguments */ HDassert(grp_oloc); HDassert(linfo); /* Check for the group having a link info message */ - if((ret_value = H5O_msg_exists(grp_oloc, H5O_LINFO_ID, dxpl_id)) < 0) + if((ret_value = H5O_msg_exists(grp_oloc, H5O_LINFO_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(ret_value) { /* Retrieve the "link info" structure */ - if(NULL == H5O_msg_read(grp_oloc, H5O_LINFO_ID, linfo, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_LINFO_ID, linfo)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "link info message not present") /* Check if we don't know how many links there are */ @@ -340,7 +336,7 @@ H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) /* Check if we are using "dense" link storage */ if(H5F_addr_defined(linfo->fheap_addr)) { /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(grp_oloc->file, dxpl_id, linfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(grp_oloc->file, linfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in "name" B-tree */ @@ -350,7 +346,7 @@ H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) } /* end if */ else { /* Retrieve # of links from object header */ - if(H5O_get_nlinks(grp_oloc, dxpl_id, &linfo->nlinks) < 0) + if(H5O_get_nlinks(grp_oloc, &linfo->nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve # of links for object") } /* end if */ } /* end if */ @@ -358,10 +354,10 @@ H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__obj_get_linfo() */ @@ -386,18 +382,18 @@ H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void H5G_obj_oh_it_ud1_t *udata = (H5G_obj_oh_it_ud1_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(udata->dxpl_id, udata->oh_addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(udata->oh_addr) /* check arguments */ HDassert(lnk); HDassert(udata); /* Insert link into dense link storage */ - if(H5G__dense_insert(udata->f, udata->dxpl_id, udata->linfo, lnk) < 0) + if(H5G__dense_insert(udata->f, udata->linfo, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into dense storage") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_compact_to_dense_cb() */ @@ -429,8 +425,7 @@ H5G_obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) /* Insert link into group */ /* (Casting away const OK - QAK) */ - if(H5G_obj_insert(udata->grp_oloc, lnk->name, (H5O_link_t *)lnk, FALSE, - H5O_TYPE_UNKNOWN, NULL, udata->dxpl_id) < 0) + if(H5G_obj_insert(udata->grp_oloc, lnk->name, (H5O_link_t *)lnk, FALSE, H5O_TYPE_UNKNOWN, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5_ITER_ERROR, "can't insert link into group") done: @@ -457,7 +452,7 @@ done: */ herr_t H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, - hbool_t adj_link, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id) + hbool_t adj_link, H5O_type_t obj_type, const void *crt_info) { H5O_pline_t tmp_pline; /* Pipeline message */ H5O_pline_t *pline = NULL; /* Pointer to pipeline message */ @@ -467,7 +462,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, hbool_t use_new_dense = FALSE; /* Whether to use "dense" form of 'new format' group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -476,7 +471,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Check if we have information about the number of objects in this group */ /* (by attempting to get the link info message for this group) */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { H5O_ginfo_t ginfo; /* Group info message */ @@ -500,7 +495,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get link size") /* Get the group info */ - if(NULL == H5O_msg_read(grp_oloc, H5O_GINFO_ID, &ginfo, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_GINFO_ID, &ginfo)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info") /* If there's still a small enough number of links, use the 'link' message */ @@ -517,32 +512,31 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, H5O_mesg_operator_t op; /* Message operator */ /* Get the pipeline message, if it exists */ - if((pline_exists = H5O_msg_exists(grp_oloc, H5O_PLINE_ID, dxpl_id)) < 0) + if((pline_exists = H5O_msg_exists(grp_oloc, H5O_PLINE_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(pline_exists) { - if(NULL == H5O_msg_read(grp_oloc, H5O_PLINE_ID, &tmp_pline, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_PLINE_ID, &tmp_pline)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link pipeline") pline = &tmp_pline; } /* end if */ /* The group doesn't currently have "dense" storage for links */ - if(H5G__dense_create(grp_oloc->file, dxpl_id, &linfo, pline) < 0) + if(H5G__dense_create(grp_oloc->file, &linfo, pline) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create 'dense' form of new format group") /* Set up user data for object header message iteration */ udata.f = grp_oloc->file; udata.oh_addr = grp_oloc->addr; - udata.dxpl_id = dxpl_id; udata.linfo = &linfo; /* Iterate over the 'link' messages, inserting them into the dense link storage */ op.op_type = H5O_MESG_OP_APP; op.u.app_op = H5G_obj_compact_to_dense_cb; - if(H5O_msg_iterate(grp_oloc, H5O_LINK_ID, &op, &udata, dxpl_id) < 0) + if(H5O_msg_iterate(grp_oloc, H5O_LINK_ID, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over links") /* Remove all the 'link' messages */ - if(H5O_msg_remove(grp_oloc, H5O_LINK_ID, H5O_ALL, FALSE, dxpl_id) < 0) + if(H5O_msg_remove(grp_oloc, H5O_LINK_ID, H5O_ALL, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link messages") use_new_dense = TRUE; @@ -558,31 +552,29 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Convert group to "new format" group, in order to hold the information */ /* Insert link info message */ - if(H5O_msg_create(grp_oloc, H5O_LINFO_ID, 0, 0, &new_linfo, dxpl_id) < 0) + if(H5O_msg_create(grp_oloc, H5O_LINFO_ID, 0, 0, &new_linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Insert group info message */ - if(H5O_msg_create(grp_oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, H5O_UPDATE_TIME, &new_ginfo, dxpl_id) < 0) + if(H5O_msg_create(grp_oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, H5O_UPDATE_TIME, &new_ginfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Set up user data for iteration */ udata.grp_oloc = grp_oloc; - udata.dxpl_id = dxpl_id; /* Iterate through all links in "old format" group and insert them into new format */ - if(H5G__stab_iterate(grp_oloc, dxpl_id, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_obj_stab_to_new_cb, &udata) < 0) + if(H5G__stab_iterate(grp_oloc, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_obj_stab_to_new_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over old format links") /* Remove the symbol table message from the group */ - if(H5O_msg_remove(grp_oloc, H5O_STAB_ID, 0, FALSE, dxpl_id) < 0) + if(H5O_msg_remove(grp_oloc, H5O_STAB_ID, 0, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete old format link storage") /* Recursively call this routine to insert the new link, since the * group is in the "new format" now and the link info should be * set up, etc. */ - if(H5G_obj_insert(grp_oloc, name, obj_lnk, adj_link, obj_type, - crt_info, dxpl_id) < 0) + if(H5G_obj_insert(grp_oloc, name, obj_lnk, adj_link, obj_type, crt_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into group") /* Done with insertion now */ @@ -595,19 +587,18 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Insert into symbol table or "dense" storage */ if(use_old_format) { /* Insert into symbol table */ - if(H5G__stab_insert(grp_oloc, name, obj_lnk, obj_type, crt_info, dxpl_id) - < 0) + if(H5G__stab_insert(grp_oloc, name, obj_lnk, obj_type, crt_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert entry into symbol table") } /* end if */ else { if(use_new_dense) { /* Insert into dense link storage */ - if(H5G__dense_insert(grp_oloc->file, dxpl_id, &linfo, obj_lnk) < 0) + if(H5G__dense_insert(grp_oloc->file, &linfo, obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into dense storage") } /* end if */ else { /* Insert with link message */ - if(H5G__compact_insert(grp_oloc, obj_lnk, dxpl_id) < 0) + if(H5G__compact_insert(grp_oloc, obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link as link message") } /* end else */ } /* end else */ @@ -615,7 +606,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Increment the number of objects in this group */ if(!use_old_format) { linfo.nlinks++; - if(H5O_msg_write(grp_oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, &linfo, dxpl_id) < 0) + if(H5O_msg_write(grp_oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, &linfo) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update link info message") } /* end if */ @@ -629,7 +620,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, obj_oloc.addr = obj_lnk->u.hard.addr; /* Increment reference count for object */ - if(H5O_link(&obj_oloc, 1, dxpl_id) < 0) + if(H5O_link(&obj_oloc, 1) < 0) HGOTO_ERROR(H5E_SYM, H5E_LINKCOUNT, FAIL, "unable to increment hard link count") } /* end if */ @@ -638,7 +629,7 @@ done: if(pline && H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "can't release pipeline") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_insert() */ @@ -658,22 +649,22 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__obj_iterate(const H5O_loc_t *grp_oloc, - H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - H5G_lib_iterate_t op, void *op_data, hid_t dxpl_id) +H5G__obj_iterate(const H5O_loc_t *grp_oloc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, + void *op_data) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* Sanity check */ HDassert(grp_oloc); HDassert(op); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for going out of bounds */ @@ -689,12 +680,12 @@ H5G__obj_iterate(const H5O_loc_t *grp_oloc, if(H5F_addr_defined(linfo.fheap_addr)) { /* Iterate over the links in the group, building a table of the link messages */ - if((ret_value = H5G__dense_iterate(grp_oloc->file, dxpl_id, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__dense_iterate(grp_oloc->file, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over dense links") } /* end if */ else { /* Get the object's name from the link messages */ - if((ret_value = H5G__compact_iterate(grp_oloc, dxpl_id, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__compact_iterate(grp_oloc, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over compact links") } /* end else */ } /* end if */ @@ -704,12 +695,12 @@ H5G__obj_iterate(const H5O_loc_t *grp_oloc, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Iterate over symbol table */ - if((ret_value = H5G__stab_iterate(grp_oloc, dxpl_id, order, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__stab_iterate(grp_oloc, order, skip, last_lnk, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over symbol table") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__obj_iterate() */ @@ -727,7 +718,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) +H5G__obj_info(const H5O_loc_t *oloc, H5G_info_t *grp_info) { H5G_t *grp = NULL; /* Group to query */ H5G_loc_t grp_loc; /* Entry of group to be queried */ @@ -749,18 +740,18 @@ H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) H5G_loc_reset(&grp_loc); /* Deep copy (duplicate) of the group location object */ - if(H5O_loc_copy(&grp_oloc, oloc, H5_COPY_DEEP) < 0) + if(H5O_loc_copy(&grp_oloc, (H5O_loc_t *)oloc, H5_COPY_DEEP) < 0) /* (Casting away const OK - QAK) */ HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "can't copy object location") /* Open the group */ - if(NULL == (grp = H5G_open(&grp_loc, dxpl_id))) + if(NULL == (grp = H5G_open(&grp_loc))) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point not found") /* Get information from the group */ grp_info->mounted = H5G_MOUNTED(grp); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Retrieve the information about the links */ @@ -775,7 +766,7 @@ H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) } /* end if */ else { /* Get the number of objects in this group by iterating over symbol table */ - if(H5G__stab_count(oloc, &grp_info->nlinks, dxpl_id) < 0) + if(H5G__stab_count(oloc, &grp_info->nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't count objects") /* Set the other information about the group */ @@ -807,19 +798,19 @@ done: */ ssize_t H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id) + H5_iter_order_t order, hsize_t n, char* name, size_t size) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ ssize_t ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(oloc->addr, FAIL) /* Sanity check */ HDassert(oloc && oloc->file); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -832,12 +823,12 @@ H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the object's name from the dense link storage */ - if((ret_value = H5G__dense_get_name_by_idx(oloc->file, dxpl_id, &linfo, idx_type, order, n, name, size)) < 0) + if((ret_value = H5G__dense_get_name_by_idx(oloc->file, &linfo, idx_type, order, n, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end if */ else { /* Get the object's name from the link messages */ - if((ret_value = H5G__compact_get_name_by_idx(oloc, dxpl_id, &linfo, idx_type, order, n, name, size)) < 0) + if((ret_value = H5G__compact_get_name_by_idx(oloc, &linfo, idx_type, order, n, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end else */ } /* end if */ @@ -847,17 +838,17 @@ H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Get the object's name from the symbol table */ - if((ret_value = H5G__stab_get_name_by_idx(oloc, order, n, name, size, dxpl_id)) < 0) + if((ret_value = H5G__stab_get_name_by_idx(oloc, order, n, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_get_name_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_obj_remove_update_linfo + * Function: H5G__obj_remove_update_linfo * * Purpose: Update the link info after removing a link from a group * @@ -870,11 +861,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) +H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(oloc); @@ -892,7 +883,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp /* Check if there's no more links */ if(linfo->nlinks == 0) { /* Delete the dense storage */ - if(H5G__dense_delete(oloc->file, dxpl_id, linfo, FALSE) < 0) + if(H5G__dense_delete(oloc->file, linfo, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete dense link storage") } /* end if */ /* Check for switching back to compact storage */ @@ -900,7 +891,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp H5O_ginfo_t ginfo; /* Group info message */ /* Get the group info */ - if(NULL == H5O_msg_read(oloc, H5O_GINFO_ID, &ginfo, dxpl_id)) + if(NULL == H5O_msg_read(oloc, H5O_GINFO_ID, &ginfo)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info") /* Check if we should switch from dense storage back to link messages */ @@ -911,11 +902,11 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp size_t u; /* Local index */ /* Build the table of links for this group */ - if(H5G__dense_build_table(oloc->file, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, <able) < 0) + if(H5G__dense_build_table(oloc->file, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") /* Pin the object header */ - if(NULL == (oh = H5O_pin(oloc, dxpl_id))) + if(NULL == (oh = H5O_pin(oloc))) HGOTO_ERROR(H5E_SYM, H5E_CANTPIN, FAIL, "unable to pin group object header") /* Inspect links in table for ones that can't be converted back @@ -932,7 +923,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp if(can_convert) { /* Insert link messages into group */ for(u = 0; u < linfo->nlinks; u++) - if(H5O_msg_append_oh(oloc->file, dxpl_id, oh, H5O_LINK_ID, 0, H5O_UPDATE_TIME, &(ltable.lnks[u])) < 0) { + if(H5O_msg_append_oh(oloc->file, oh, H5O_LINK_ID, 0, H5O_UPDATE_TIME, &(ltable.lnks[u])) < 0) { /* Release object header */ if(H5O_unpin(oh) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTUNPIN, FAIL, "unable to unpin group object header") @@ -941,7 +932,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp } /* end if */ /* Remove the dense storage */ - if(H5G__dense_delete(oloc->file, dxpl_id, linfo, FALSE) < 0) + if(H5G__dense_delete(oloc->file, linfo, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete dense link storage") } /* end if */ @@ -957,12 +948,12 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp } /* end if */ /* Update link info in the object header */ - if(H5O_msg_write(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, linfo, dxpl_id) < 0) + if(H5O_msg_write(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, linfo) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update link info message") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_obj_remove_update_linfo() */ +} /* end H5G__obj_remove_update_linfo() */ /*------------------------------------------------------------------------- @@ -979,21 +970,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name, hid_t dxpl_id) +H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(oloc->addr, FAIL) /* Sanity check */ HDassert(oloc); HDassert(name && *name); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Using the new format for groups */ @@ -1002,31 +993,30 @@ H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *n /* Check for dense or compact storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Remove object from the dense link storage */ - if(H5G__dense_remove(oloc->file, dxpl_id, &linfo, grp_full_path_r, name) < 0) + if(H5G__dense_remove(oloc->file, &linfo, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end if */ - else { + else /* Remove object from the link messages */ - if(H5G__compact_remove(oloc, dxpl_id, grp_full_path_r, name) < 0) + if(H5G__compact_remove(oloc, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") - } /* end else */ } /* end if */ else { /* Using the old format for groups */ use_old_format = TRUE; /* Remove object from the symbol table */ - if(H5G__stab_remove(oloc, dxpl_id, grp_full_path_r, name) < 0) + if(H5G__stab_remove(oloc, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ /* Update link info for a new-style group */ if(!use_old_format) - if(H5G_obj_remove_update_linfo(oloc, &linfo, dxpl_id) < 0) + if(H5G__obj_remove_update_linfo(oloc, &linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTUPDATE, FAIL, "unable to update link info") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_remove() */ @@ -1045,20 +1035,20 @@ done: */ herr_t H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id) + H5_index_t idx_type, H5_iter_order_t order, hsize_t n) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) /* Sanity check */ HDassert(grp_oloc && grp_oloc->file); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1074,12 +1064,12 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, /* Check for dense or compact storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Remove object from the dense link storage */ - if(H5G__dense_remove_by_idx(grp_oloc->file, dxpl_id, &linfo, grp_full_path_r, idx_type, order, n) < 0) + if(H5G__dense_remove_by_idx(grp_oloc->file, &linfo, grp_full_path_r, idx_type, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end if */ else { /* Remove object from compact link storage */ - if(H5G__compact_remove_by_idx(grp_oloc, dxpl_id, &linfo, grp_full_path_r, idx_type, order, n) < 0) + if(H5G__compact_remove_by_idx(grp_oloc, &linfo, grp_full_path_r, idx_type, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ } /* end if */ @@ -1092,18 +1082,17 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, use_old_format = TRUE; /* Remove object from the symbol table */ - if(H5G__stab_remove_by_idx(grp_oloc, dxpl_id, grp_full_path_r, order, n) < 0) + if(H5G__stab_remove_by_idx(grp_oloc, grp_full_path_r, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ /* Update link info for a new-style group */ - if(!use_old_format) { - if(H5G_obj_remove_update_linfo(grp_oloc, &linfo, dxpl_id) < 0) + if(!use_old_format) + if(H5G__obj_remove_update_linfo(grp_oloc, &linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTUPDATE, FAIL, "unable to update link info") - } /* end if */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_remove() */ @@ -1121,43 +1110,41 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, - hid_t dxpl_id) +H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); HDassert(name && *name); /* Attempt to get the link info message for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the object's info from the dense link storage */ - if((ret_value = H5G__dense_lookup(grp_oloc->file, dxpl_id, &linfo, name, lnk)) < 0) + if((ret_value = H5G__dense_lookup(grp_oloc->file, &linfo, name, lnk)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end if */ else { /* Get the object's info from the link messages */ - if((ret_value = H5G__compact_lookup(grp_oloc, name, lnk, dxpl_id)) < 0) + if((ret_value = H5G__compact_lookup(grp_oloc, name, lnk)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ } /* end if */ - else { + else /* Get the object's info from the symbol table */ - if((ret_value = H5G__stab_lookup(grp_oloc, name, lnk, dxpl_id)) < 0) + if((ret_value = H5G__stab_lookup(grp_oloc, name, lnk)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") - } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__obj_lookup() */ @@ -1177,19 +1164,19 @@ done: */ herr_t H5G_obj_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, H5O_link_t *lnk, hid_t dxpl_id) + H5_iter_order_t order, hsize_t n, H5O_link_t *lnk) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); /* Attempt to get the link info message for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1202,12 +1189,12 @@ H5G_obj_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_index_t idx_type, /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the link from the dense storage */ - if(H5G__dense_lookup_by_idx(grp_oloc->file, dxpl_id, &linfo, idx_type, order, n, lnk) < 0) + if(H5G__dense_lookup_by_idx(grp_oloc->file, &linfo, idx_type, order, n, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end if */ else { /* Get the link from the link messages */ - if(H5G__compact_lookup_by_idx(grp_oloc, dxpl_id, &linfo, idx_type, order, n, lnk) < 0) + if(H5G__compact_lookup_by_idx(grp_oloc, &linfo, idx_type, order, n, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ } /* end if */ @@ -1217,11 +1204,11 @@ H5G_obj_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Get the object's info from the symbol table */ - if(H5G__stab_lookup_by_idx(grp_oloc, order, n, lnk, dxpl_id) < 0) + if(H5G__stab_lookup_by_idx(grp_oloc, order, n, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_lookup_by_idx() */ diff --git a/src/H5Goh.c b/src/H5Goh.c index 977fc2d..38570f9 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -43,15 +43,13 @@ /* Local Prototypes */ /********************/ -static void *H5O_group_get_copy_file_udata(void); -static void H5O_group_free_copy_file_udata(void *udata); -static htri_t H5O_group_isa(H5O_t *loc); -static hid_t H5O_group_open(const H5G_loc_t *obj_loc, hid_t lapl_id, - hid_t dxpl_id, hbool_t app_ref); -static void *H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, - hid_t dxpl_id); -static H5O_loc_t *H5O_group_get_oloc(hid_t obj_id); -static herr_t H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, +static void *H5O__group_get_copy_file_udata(void); +static void H5O__group_free_copy_file_udata(void *udata); +static htri_t H5O__group_isa(const H5O_t *loc); +static hid_t H5O__group_open(const H5G_loc_t *obj_loc, hbool_t app_ref); +static void *H5O__group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc); +static H5O_loc_t *H5O__group_get_oloc(hid_t obj_id); +static herr_t H5O__group_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info); @@ -73,13 +71,13 @@ static herr_t H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, const H5O_obj_class_t H5O_OBJ_GROUP[1] = {{ H5O_TYPE_GROUP, /* object type */ "group", /* object name, for debugging */ - H5O_group_get_copy_file_udata, /* get 'copy file' user data */ - H5O_group_free_copy_file_udata, /* free 'copy file' user data */ - H5O_group_isa, /* "isa" message */ - H5O_group_open, /* open an object of this class */ - H5O_group_create, /* create an object of this class */ - H5O_group_get_oloc, /* get an object header location for an object */ - H5O_group_bh_info, /* get the index & heap info for an object */ + H5O__group_get_copy_file_udata, /* get 'copy file' user data */ + H5O__group_free_copy_file_udata, /* free 'copy file' user data */ + H5O__group_isa, /* "isa" message */ + H5O__group_open, /* open an object of this class */ + H5O__group_create, /* create an object of this class */ + H5O__group_get_oloc, /* get an object header location for an object */ + H5O__group_bh_info, /* get the index & heap info for an object */ NULL /* flush an opened object of this class */ }}; @@ -88,7 +86,7 @@ H5FL_DEFINE(H5G_copy_file_ud_t); /*------------------------------------------------------------------------- - * Function: H5O_group_get_copy_file_udata + * Function: H5O__group_get_copy_file_udata * * Purpose: Allocates the user data needed for copying a group's * object header from file to file. @@ -103,11 +101,11 @@ H5FL_DEFINE(H5G_copy_file_ud_t); *------------------------------------------------------------------------- */ static void * -H5O_group_get_copy_file_udata(void) +H5O__group_get_copy_file_udata(void) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate space for the 'copy file' user data for copying groups. * Currently this is only a ginfo, so there is no specific struct type for @@ -117,11 +115,11 @@ H5O_group_get_copy_file_udata(void) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_group_get_copy_file_udata() */ +} /* end H5O__group_get_copy_file_udata() */ /*------------------------------------------------------------------------- - * Function: H5O_group_free_copy_file_udata + * Function: H5O__group_free_copy_file_udata * * Purpose: Release the user data needed for copying a group's * object header from file to file. @@ -134,11 +132,11 @@ done: *------------------------------------------------------------------------- */ static void -H5O_group_free_copy_file_udata(void *_udata) +H5O__group_free_copy_file_udata(void *_udata) { H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(udata); @@ -150,11 +148,11 @@ H5O_group_free_copy_file_udata(void *_udata) udata = H5FL_FREE(H5G_copy_file_ud_t, udata); FUNC_LEAVE_NOAPI_VOID -} /* end H5O_group_free_copy_file_udata() */ +} /* end H5O__group_free_copy_file_udata() */ /*------------------------------------------------------------------------- - * Function: H5O_group_isa + * Function: H5O__group_isa * * Purpose: Determines if an object has the requisite messages for being * a group. @@ -171,13 +169,13 @@ H5O_group_free_copy_file_udata(void *_udata) *------------------------------------------------------------------------- */ static htri_t -H5O_group_isa(struct H5O_t *oh) +H5O__group_isa(const H5O_t *oh) { htri_t stab_exists; /* Whether the 'stab' message is in the object header */ htri_t linfo_exists; /* Whether the 'linfo' message is in the object header */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(oh); @@ -191,11 +189,11 @@ H5O_group_isa(struct H5O_t *oh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_group_isa() */ +} /* end H5O__group_isa() */ /*------------------------------------------------------------------------- - * Function: H5O_group_open + * Function: H5O__group_open * * Purpose: Open a group at a particular location * @@ -208,17 +206,17 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O_group_open(const H5G_loc_t *obj_loc, hid_t H5_ATTR_UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O__group_open(const H5G_loc_t *obj_loc, hbool_t app_ref) { H5G_t *grp = NULL; /* Group opened */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(obj_loc); /* Open the group */ - if(NULL == (grp = H5G_open(obj_loc, dxpl_id))) + if(NULL == (grp = H5G_open(obj_loc))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an ID for the group */ @@ -231,11 +229,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_group_open() */ +} /* end H5O__group_open() */ /*------------------------------------------------------------------------- - * Function: H5O_group_create + * Function: H5O__group_create * * Purpose: Create a group in a file * @@ -248,13 +246,13 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O__group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) { H5G_obj_create_t *crt_info = (H5G_obj_create_t *)_crt_info; /* Group creation parameters */ H5G_t *grp = NULL; /* New group created */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); @@ -262,7 +260,7 @@ H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) HDassert(obj_loc); /* Create the the group */ - if(NULL == (grp = H5G__create(f, crt_info, dxpl_id))) + if(NULL == (grp = H5G__create(f, crt_info))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") /* Set up the new group's location */ @@ -280,11 +278,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, NULL, "unable to release group") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_group_create() */ +} /* end H5O__group_create() */ /*------------------------------------------------------------------------- - * Function: H5O_group_get_oloc + * Function: H5O__group_get_oloc * * Purpose: Retrieve the object header location for an open object * @@ -297,12 +295,12 @@ done: *------------------------------------------------------------------------- */ static H5O_loc_t * -H5O_group_get_oloc(hid_t obj_id) +H5O__group_get_oloc(hid_t obj_id) { H5G_t *grp; /* Group opened */ H5O_loc_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the group */ if(NULL == (grp = (H5G_t *)H5I_object(obj_id))) @@ -314,11 +312,11 @@ H5O_group_get_oloc(hid_t obj_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_group_get_oloc() */ +} /* end H5O__group_get_oloc() */ /*------------------------------------------------------------------------- - * Function: H5O_group_bh_info + * Function: H5O__group_bh_info * * Purpose: Retrieve storage for 1.8 btree and heap * Retrieve storage for 1.6 btree and heap via H5G_stab_bh_info() @@ -331,7 +329,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) +H5O__group_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info) { htri_t exists; /* Flag if header message of interest exists */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -339,7 +337,7 @@ H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_STATIC_TAG(oh->cache_info.addr) /* Sanity check */ HDassert(loc); @@ -355,39 +353,39 @@ H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * H5O_linfo_t linfo; /* Link info message */ /* Get "new style" group info */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LINFO_ID, &linfo)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_LINFO_ID, &linfo)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't read LINFO message") /* Check if name index available */ if(H5F_addr_defined(linfo.name_bt2_addr)) { /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(loc->file, dxpl_id, linfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(loc->file, linfo.name_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Get name index B-tree size */ - if(H5B2_size(bt2_name, dxpl_id, &bh_info->index_size) < 0) + if(H5B2_size(bt2_name, &bh_info->index_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info for name index") } /* end if */ /* Check if creation order index available */ if(H5F_addr_defined(linfo.corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(loc->file, dxpl_id, linfo.corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(loc->file, linfo.corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Get creation order index B-tree size */ - if(H5B2_size(bt2_corder, dxpl_id, &bh_info->index_size) < 0) + if(H5B2_size(bt2_corder, &bh_info->index_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info for creation order index") } /* end if */ /* Get fractal heap size, if available */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Open the fractal heap for links */ - if(NULL == (fheap = H5HF_open(loc->file, dxpl_id, linfo.fheap_addr))) + if(NULL == (fheap = H5HF_open(loc->file, linfo.fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Get heap storage size */ - if(H5HF_size(fheap, dxpl_id, &bh_info->heap_size) < 0) + if(H5HF_size(fheap, &bh_info->heap_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve fractal heap storage info") } /* end if */ } /* end if */ @@ -395,23 +393,23 @@ H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * H5O_stab_t stab; /* Info about symbol table */ /* Must be "old style" group, get symbol table message */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_STAB_ID, &stab)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't find LINFO nor STAB messages") /* Get symbol table size info */ - if(H5G__stab_bh_size(loc->file, dxpl_id, &stab, bh_info) < 0) + if(H5G__stab_bh_size(loc->file, &stab, bh_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve symbol table size info") } /* end else */ done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_group_bh_info() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__group_bh_info() */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 76bf08b..6b28054 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -267,7 +267,6 @@ typedef struct H5G_dense_bt2_corder_rec_t { typedef struct H5G_bt2_ud_common_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ const char *name; /* Name of link to compare */ uint32_t name_hash; /* Hash of name of link to compare */ @@ -329,19 +328,27 @@ H5FL_EXTERN(H5G_shared_t); /* * General group routines */ -H5_DLL H5G_t *H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, - hid_t dxpl_id); +H5_DLL H5G_t *H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info); H5_DLL H5G_t *H5G__create_named(const H5G_loc_t *loc, const char *name, - hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id); -H5_DLL H5G_t *H5G__open_name(const H5G_loc_t *loc, const char *name, - hid_t gapl_id, hid_t dxpl_id); + hid_t lcpl_id, hid_t gcpl_id); +H5_DLL H5G_t *H5G__create_anon(H5F_t *file, H5G_obj_create_t *gcrt_info); +H5_DLL H5G_t *H5G__open_name(const H5G_loc_t *loc, const char *name); +H5_DLL hid_t H5G__get_create_plist(const H5G_t *grp); +H5_DLL herr_t H5G__get_info(const H5G_loc_t *loc, H5G_info_t *grp_info); +H5_DLL herr_t H5G__get_info_by_name(const H5G_loc_t *loc, const char *name, + H5G_info_t *grp_info); +H5_DLL herr_t H5G__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *grp_info); +H5_DLL herr_t H5G__flush(H5G_t *grp, hid_t group_id); +H5_DLL herr_t H5G__refresh(H5G_t *grp, hid_t group_id); +H5_DLL herr_t H5G__close_cb(H5G_t *grp); /* * Group hierarchy traversal routines */ H5_DLL herr_t H5G__traverse_special(const H5G_loc_t *grp_loc, - const H5O_link_t *lnk, unsigned target, size_t *nlinks, hbool_t last_comp, - H5G_loc_t *obj_loc, hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id); + const H5O_link_t *lnk, unsigned target, hbool_t last_comp, + H5G_loc_t *obj_loc, hbool_t *obj_exists); /* * Utility functions @@ -353,38 +360,35 @@ H5_DLL const char *H5G__component(const char *name, size_t *size_p); * functions that understand names are exported to the rest of * the library and appear in H5Gprivate.h. */ -H5_DLL herr_t H5G__stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, - const H5O_ginfo_t *ginfo, H5O_stab_t *stab); -H5_DLL herr_t H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t dxpl_id); +H5_DLL herr_t H5G__stab_create(H5O_loc_t *grp_oloc, const H5O_ginfo_t *ginfo, + H5O_stab_t *stab); +H5_DLL herr_t H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint); H5_DLL herr_t H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, - hid_t dxpl_id); + H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info); H5_DLL herr_t H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, const char *name, H5O_link_t *obj_lnk, H5O_type_t obj_type, - const void *crt_info, hid_t dxpl_id); -H5_DLL herr_t H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab); -H5_DLL herr_t H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, + const void *crt_info); +H5_DLL herr_t H5G__stab_delete(H5F_t *f, const H5O_stab_t *stab); +H5_DLL herr_t H5G__stab_iterate(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); -H5_DLL herr_t H5G__stab_count(struct H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id); -H5_DLL herr_t H5G__stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, +H5_DLL herr_t H5G__stab_count(const struct H5O_loc_t *oloc, hsize_t *num_objs); +H5_DLL herr_t H5G__stab_bh_size(H5F_t *f, const H5O_stab_t *stab, H5_ih_info_t *bh_info); H5_DLL ssize_t H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, - hsize_t n, char* name, size_t size, hid_t dxpl_id); -H5_DLL herr_t H5G__stab_remove(const H5O_loc_t *oloc, hid_t dxpl_id, - H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, + hsize_t n, char* name, size_t size); +H5_DLL herr_t H5G__stab_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, + const char *name); +H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, H5_iter_order_t order, hsize_t n); H5_DLL herr_t H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *lnk, hid_t dxpl_id); + H5O_link_t *lnk); H5_DLL herr_t H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, - hsize_t n, H5O_link_t *lnk, hid_t dxpl_id); + hsize_t n, H5O_link_t *lnk); #ifndef H5_STRICT_FORMAT_CHECKS -H5_DLL herr_t H5G__stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, - H5O_stab_t *alt_stab); +H5_DLL herr_t H5G__stab_valid(H5O_loc_t *grp_oloc, H5O_stab_t *alt_stab); #endif /* H5_STRICT_FORMAT_CHECKS */ #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL H5G_obj_t H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, - hid_t dxpl_id); +H5_DLL H5G_obj_t H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx); #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -398,25 +402,25 @@ H5_DLL herr_t H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsigned n); H5_DLL herr_t H5G__ent_encode_vec(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent, unsigned n); -H5_DLL herr_t H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, - const char *name, const H5O_link_t *lnk, H5O_type_t obj_type, - const void *crt_info, H5G_entry_t *ent); +H5_DLL herr_t H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, + const H5O_link_t *lnk, H5O_type_t obj_type, const void *crt_info, + H5G_entry_t *ent); H5_DLL herr_t H5G__ent_debug(const H5G_entry_t *ent, FILE * stream, int indent, int fwidth, const H5HL_t *heap); /* Functions that understand symbol table nodes */ H5_DLL herr_t H5G__node_init(H5F_t *f); -H5_DLL int H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_iterate(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_sumup(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_by_idx(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_copy(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_build_table(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL herr_t H5G__node_iterate_size(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL herr_t H5G__node_iterate_size(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); H5_DLL herr_t H5G__node_free(H5G_node_t *sym); @@ -430,78 +434,73 @@ H5_DLL herr_t H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type H5_DLL herr_t H5G__link_iterate_table(const H5G_link_table_t *ltable, hsize_t skip, hsize_t *last_lnk, const H5G_lib_iterate_t op, void *op_data); H5_DLL herr_t H5G__link_release_table(H5G_link_table_t *ltable); -H5_DLL herr_t H5G__link_name_replace(H5F_t *file, hid_t dxpl_id, - H5RS_str_t *grp_full_path_r, const H5O_link_t *lnk); +H5_DLL herr_t H5G__link_name_replace(H5F_t *file, H5RS_str_t *grp_full_path_r, + const H5O_link_t *lnk); /* Functions that understand "compact" link storage */ -H5_DLL herr_t H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, - hid_t dxpl_id); -H5_DLL ssize_t H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk); +H5_DLL ssize_t H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t idx, char *name, size_t size); -H5_DLL herr_t H5G__compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id, - H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, + const char *name); +H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5G__compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__compact_iterate(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); H5_DLL htri_t H5G__compact_lookup(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *lnk, hid_t dxpl_id); -H5_DLL herr_t H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, + H5O_link_t *lnk); +H5_DLL herr_t H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk); #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL H5G_obj_t H5G__compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL H5G_obj_t H5G__compact_get_type_by_idx(H5O_loc_t *oloc, const H5O_linfo_t *linfo, hsize_t idx); #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Functions that understand "dense" link storage */ -H5_DLL herr_t H5G__dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5_DLL herr_t H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable); -H5_DLL herr_t H5G__dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, +H5_DLL herr_t H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline); -H5_DLL herr_t H5G__dense_insert(H5F_t *f, hid_t dxpl_id, - const H5O_linfo_t *linfo, const H5O_link_t *lnk); -H5_DLL htri_t H5G__dense_lookup(H5F_t *f, hid_t dxpl_id, - const H5O_linfo_t *linfo, const char *name, H5O_link_t *lnk); -H5_DLL herr_t H5G__dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, - const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, - hsize_t n, H5O_link_t *lnk); -H5_DLL herr_t H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5_DLL herr_t H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, + const H5O_link_t *lnk); +H5_DLL htri_t H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, + const char *name, H5O_link_t *lnk); +H5_DLL herr_t H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk); +H5_DLL herr_t H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); -H5_DLL ssize_t H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, - H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - char *name, size_t size); -H5_DLL herr_t H5G__dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5_DLL ssize_t H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name, + size_t size); +H5_DLL herr_t H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G__dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, - const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, - hbool_t adj_link); +H5_DLL herr_t H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, + H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, + hsize_t n); +H5_DLL herr_t H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link); #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL H5G_obj_t H5G__dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, - H5O_linfo_t *linfo, hsize_t idx); +H5_DLL H5G_obj_t H5G__dense_get_type_by_idx(H5F_t *f, H5O_linfo_t *linfo, + hsize_t idx); #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Functions that understand group objects */ -H5_DLL herr_t H5G__obj_create(H5F_t *f, hid_t dxpl_id, - H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/); -H5_DLL herr_t H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, - const H5O_ginfo_t *ginfo, const H5O_linfo_t *linfo, - const H5O_pline_t *pline, H5G_obj_create_t *gcrt_info, +H5_DLL herr_t H5G__obj_create(H5F_t *f, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/); -H5_DLL htri_t H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, - hid_t dxpl_id); +H5_DLL herr_t H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, + const H5O_linfo_t *linfo, const H5O_pline_t *pline, H5G_obj_create_t *gcrt_info, + H5O_loc_t *oloc/*out*/); +H5_DLL htri_t H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo); H5_DLL herr_t H5G__obj_iterate(const H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - H5G_lib_iterate_t op, void *op_data, hid_t dxpl_id); -H5_DLL herr_t H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id); + H5G_lib_iterate_t op, void *op_data); +H5_DLL herr_t H5G__obj_info(const H5O_loc_t *oloc, H5G_info_t *grp_info); H5_DLL htri_t H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *lnk, hid_t dxpl_id); + H5O_link_t *lnk); /* * These functions operate on group hierarchy names. @@ -512,7 +511,7 @@ H5_DLL herr_t H5G__name_init(H5G_name_t *name, const char *path); * These functions operate on group "locations" */ H5_DLL herr_t H5G__loc_insert(H5G_loc_t *grp_loc, const char *name, - H5G_loc_t *obj_loc, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id); + H5G_loc_t *obj_loc, H5O_type_t obj_type, const void *crt_info); /* Testing functions */ #ifdef H5G_TESTING diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index c48e687..427f14b 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -189,7 +189,7 @@ typedef struct H5G_entry_t H5G_entry_t; H5_DLL struct H5O_loc_t *H5G_oloc(H5G_t *grp); H5_DLL H5G_name_t * H5G_nameof(H5G_t *grp); H5_DLL H5F_t *H5G_fileof(H5G_t *grp); -H5_DLL H5G_t *H5G_open(const H5G_loc_t *loc, hid_t dxpl_id); +H5_DLL H5G_t *H5G_open(const H5G_loc_t *loc); H5_DLL herr_t H5G_close(H5G_t *grp); H5_DLL herr_t H5G_get_shared_count(H5G_t *grp); H5_DLL herr_t H5G_mount(H5G_t *grp); @@ -208,14 +208,12 @@ H5_DLL char *H5G_normalize(const char *name); * Group hierarchy traversal routines */ H5_DLL herr_t H5G_traverse(const H5G_loc_t *loc, const char *name, - unsigned target, H5G_traverse_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id); + unsigned target, H5G_traverse_t op, void *op_data); H5_DLL herr_t H5G_iterate(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - const H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id); + const H5G_link_iterate_t *lnk_op, void *op_data); H5_DLL herr_t H5G_visit(hid_t loc_id, const char *group_name, - H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data, - hid_t lapl_id, hid_t dxpl_id); + H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data); /* * Functions that understand links in groups @@ -227,23 +225,23 @@ H5_DLL herr_t H5G_link_to_info(const struct H5O_link_t *lnk, H5L_info_t *linfo); */ H5_DLL herr_t H5G_obj_insert(const struct H5O_loc_t *grp_oloc, const char *name, struct H5O_link_t *obj_lnk, hbool_t adj_link, H5O_type_t obj_type, - const void *crt_info, hid_t dxpl_id); + const void *crt_info); H5_DLL ssize_t H5G_obj_get_name_by_idx(const struct H5O_loc_t *oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id); + H5_iter_order_t order, hsize_t n, char* name, size_t size); H5_DLL herr_t H5G_obj_remove(const struct H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, - const char *name, hid_t dxpl_id); + const char *name); H5_DLL herr_t H5G_obj_remove_by_idx(const struct H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id); + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); H5_DLL herr_t H5G_obj_lookup_by_idx(const struct H5O_loc_t *grp_oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, struct H5O_link_t *lnk, hid_t dxpl_id); -H5_DLL hid_t H5G_get_create_plist(H5G_t *grp); + H5_iter_order_t order, hsize_t n, struct H5O_link_t *lnk); +H5_DLL hid_t H5G_get_create_plist(const H5G_t *grp); /* * These functions operate on symbol table nodes. */ H5_DLL herr_t H5G_node_close(const H5F_t *f); -H5_DLL herr_t H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, - int indent, int fwidth, haddr_t heap); +H5_DLL herr_t H5G_node_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, haddr_t heap); /* * These functions operate on group object locations. @@ -257,14 +255,14 @@ H5_DLL herr_t H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *en H5_DLL herr_t H5G_name_set(const H5G_name_t *loc, H5G_name_t *obj, const char *name); H5_DLL herr_t H5G_name_replace(const struct H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS_str_t *src_full_path_r, H5F_t *dst_file, - H5RS_str_t *dst_full_path_r, hid_t dxpl_id); + H5RS_str_t *dst_full_path_r); H5_DLL herr_t H5G_name_reset(H5G_name_t *name); H5_DLL herr_t H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth); H5_DLL herr_t H5G_name_free(H5G_name_t *name); H5_DLL ssize_t H5G_get_name(const H5G_loc_t *loc, char *name/*out*/, size_t size, - hbool_t *cached, hid_t lapl_id, hid_t dxpl_id); -H5_DLL ssize_t H5G_get_name_by_addr(hid_t fid, hid_t lapl_id, hid_t dxpl_id, - const struct H5O_loc_t *loc, char* name, size_t size); + hbool_t *cached); +H5_DLL ssize_t H5G_get_name_by_addr(hid_t fid, const struct H5O_loc_t *loc, + char* name, size_t size); H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char *name); /* @@ -273,26 +271,24 @@ H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char H5_DLL herr_t H5G_loc(hid_t loc_id, H5G_loc_t *loc); H5_DLL herr_t H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth); H5_DLL herr_t H5G_loc_find(const H5G_loc_t *loc, const char *name, - H5G_loc_t *obj_loc/*out*/, hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5G_loc_find_by_idx(H5G_loc_t *loc, const char *group_name, + H5G_loc_t *obj_loc/*out*/); +H5_DLL herr_t H5G_loc_find_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - H5G_loc_t *obj_loc/*out*/, hid_t lapl_id, hid_t dxpl_id); -H5_DLL htri_t H5G_loc_exists(const H5G_loc_t *loc, const char *name, - hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5G_loc_info(H5G_loc_t *loc, const char *name, - hbool_t want_ih_info, H5O_info_t *oinfo/*out*/, hid_t lapl_id, - hid_t dxpl_id); -H5_DLL herr_t H5G_loc_set_comment(H5G_loc_t *loc, const char *name, - const char *comment, hid_t lapl_id, hid_t dxpl_id); -H5_DLL ssize_t H5G_loc_get_comment(H5G_loc_t *loc, const char *name, - char *comment/*out*/, size_t bufsize, hid_t lapl_id, hid_t dxpl_id); + H5G_loc_t *obj_loc/*out*/); +H5_DLL htri_t H5G_loc_exists(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5G_loc_info(const H5G_loc_t *loc, const char *name, + hbool_t want_ih_info, H5O_info_t *oinfo/*out*/); +H5_DLL herr_t H5G_loc_set_comment(const H5G_loc_t *loc, const char *name, + const char *comment); +H5_DLL ssize_t H5G_loc_get_comment(const H5G_loc_t *loc, const char *name, + char *comment/*out*/, size_t bufsize); H5_DLL herr_t H5G_loc_reset(H5G_loc_t *loc); H5_DLL herr_t H5G_loc_free(H5G_loc_t *loc); /* * These functions operate on the root group */ -H5_DLL herr_t H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root); +H5_DLL herr_t H5G_mkroot(H5F_t *f, hbool_t create_root); H5_DLL herr_t H5G_root_loc(H5F_t *f, H5G_loc_t *loc); H5_DLL herr_t H5G_root_free(H5G_t *grp); H5_DLL H5G_t *H5G_rootof(H5F_t *f); diff --git a/src/H5Groot.c b/src/H5Groot.c index fbc4f1a..36aa8f6 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -143,7 +143,7 @@ H5G_rootof(H5F_t *f) *------------------------------------------------------------------------- */ herr_t -H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) +H5G_mkroot(H5F_t *f, hbool_t create_root) { H5G_loc_t root_loc; /* Root location information */ H5G_obj_create_t gcrt_info; /* Root group object creation info */ @@ -192,13 +192,13 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) /* (Pass the FCPL which is a sub-class of the group creation property class) */ gcrt_info.gcpl_id = f->shared->fcpl_id; gcrt_info.cache_type = H5G_NOTHING_CACHED; - if(H5G__obj_create(f, dxpl_id, &gcrt_info, root_loc.oloc/*out*/) < 0) + if(H5G__obj_create(f, &gcrt_info, root_loc.oloc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group entry") - if(1 != H5O_link(root_loc.oloc, 1, dxpl_id)) + if(1 != H5O_link(root_loc.oloc, 1)) HGOTO_ERROR(H5E_SYM, H5E_LINKCOUNT, FAIL, "internal error (wrong link count)") /* Decrement refcount on root group's object header in memory */ - if(H5O_dec_rc_by_loc(root_loc.oloc, dxpl_id) < 0) + if(H5O_dec_rc_by_loc(root_loc.oloc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "unable to decrement refcount on root group's object header") /* Mark superblock dirty, so root group info is flushed */ @@ -235,7 +235,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) /* Check for the situation where the symbol table is cached but does * not exist. This can happen if, for example, an external link is * added to the root group. */ - if((stab_exists = H5O_msg_exists(root_loc.oloc, H5O_STAB_ID, dxpl_id)) < 0) + if((stab_exists = H5O_msg_exists(root_loc.oloc, H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check if symbol table message exists") /* Remove the cache if the stab does not exist */ @@ -253,7 +253,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) /* Check if the symbol table message is valid, and replace with the * cached symbol table if necessary */ - if(H5G__stab_valid(root_loc.oloc, dxpl_id, &cached_stab) < 0) + if(H5G__stab_valid(root_loc.oloc, &cached_stab) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to verify symbol table") } /* end if */ #endif /* H5_STRICT_FORMAT_CHECKS */ @@ -272,12 +272,12 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) /* Check if the stab message exists. It's possible for the root group * to use the latest version while the superblock is an old version. * If stab_exists is not -1 then we have already checked. */ - if(stab_exists == -1 && (stab_exists = H5O_msg_exists(root_loc.oloc, H5O_STAB_ID, dxpl_id)) < 0) + if(stab_exists == -1 && (stab_exists = H5O_msg_exists(root_loc.oloc, H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check if symbol table message exists") if(stab_exists) { /* Read the root group's symbol table message */ - if(NULL == H5O_msg_read(root_loc.oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(root_loc.oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "unable to read symbol table message") /* Update the root group symbol table entry */ diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 4dc06ca..64c4054 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -69,7 +69,6 @@ typedef struct H5G_bt_it_gtbi_t { /* downward */ H5G_bt_it_idx_common_t common; /* Common information for "by index" lookup */ H5F_t *f; /* Pointer to file that symbol table is in */ - hid_t dxpl_id; /* DXPL for operation */ /* upward */ H5G_obj_t type; /*member type to be returned */ @@ -134,7 +133,7 @@ typedef struct H5G_bt_it_lbi_t { *------------------------------------------------------------------------- */ herr_t -H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t dxpl_id) +H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint) { H5HL_t *heap = NULL; /* Pointer to local heap */ size_t name_offset; /* Offset of "" name */ @@ -150,19 +149,19 @@ H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t HDassert(size_hint > 0); /* Create the B-tree */ - if(H5B_create(f, dxpl_id, H5B_SNODE, NULL, &(stab->btree_addr)/*out*/) < 0) + if(H5B_create(f, H5B_SNODE, NULL, &(stab->btree_addr)/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create B-tree") /* Create symbol table private heap */ - if(H5HL_create(f, dxpl_id, size_hint, &(stab->heap_addr)/*out*/) < 0) + if(H5HL_create(f, size_hint, &(stab->heap_addr)/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create heap") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(f, stab->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Insert name into the heap */ - if(UFAIL == (name_offset = H5HL_insert(f, dxpl_id, heap, (size_t)1, ""))) + if(UFAIL == (name_offset = H5HL_insert(f, heap, (size_t)1, ""))) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert name into heap") /* @@ -201,14 +200,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, const H5O_ginfo_t *ginfo, - H5O_stab_t *stab) +H5G__stab_create(H5O_loc_t *grp_oloc, const H5O_ginfo_t *ginfo, H5O_stab_t *stab) { size_t heap_hint; /* Local heap size hint */ size_t size_hint; /* Local heap size hint */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* * Check arguments. @@ -226,18 +224,18 @@ H5G__stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, const H5O_ginfo_t *ginfo, size_hint = MAX(heap_hint, H5HL_SIZEOF_FREE(grp_oloc->file) + 2); /* Go create the B-tree & local heap */ - if(H5G__stab_create_components(grp_oloc->file, stab, size_hint, dxpl_id) < 0) + if(H5G__stab_create_components(grp_oloc->file, stab, size_hint) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create symbol table components") /* * Insert the symbol table message into the object header and the symbol * table entry. */ - if(H5O_msg_create(grp_oloc, H5O_STAB_ID, 0, H5O_UPDATE_TIME, stab, dxpl_id) < 0) + if(H5O_msg_create(grp_oloc, H5O_STAB_ID, 0, H5O_UPDATE_TIME, stab) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_create() */ @@ -258,8 +256,7 @@ done: */ herr_t H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, const char *name, - H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, - hid_t dxpl_id) + H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_ins_t udata; /* Data to pass through B-tree */ @@ -274,7 +271,7 @@ H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, const char *name, HDassert(obj_lnk); /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(f, stab->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Initialize data to pass through B-tree */ @@ -285,7 +282,7 @@ H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, const char *name, udata.crt_info = crt_info; /* Insert into symbol table */ - if(H5B_insert(f, dxpl_id, H5B_SNODE, stab->btree_addr, &udata) < 0) + if(H5B_insert(f, H5B_SNODE, stab->btree_addr, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert entry") done: @@ -314,13 +311,12 @@ done: */ herr_t H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, - hid_t dxpl_id) + H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info) { H5O_stab_t stab; /* Symbol table message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -328,15 +324,14 @@ H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, HDassert(obj_lnk); /* Retrieve symbol table message */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table") - if(H5G__stab_insert_real(grp_oloc->file, &stab, name, obj_lnk, obj_type, - crt_info, dxpl_id) < 0) + if(H5G__stab_insert_real(grp_oloc->file, &stab, name, obj_lnk, obj_type, crt_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "unable to insert the name") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, H5_ITER_ERROR) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_insert() */ @@ -353,7 +348,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_remove(const H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, +H5G__stab_remove(const H5O_loc_t *loc, H5RS_str_t *grp_full_path_r, const char *name) { H5HL_t *heap = NULL; /* Pointer to local heap */ @@ -367,11 +362,11 @@ H5G__stab_remove(const H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_ HDassert(name && *name); /* Read in symbol table message */ - if(NULL == H5O_msg_read(loc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(loc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(loc->file, dxpl_id, stab.heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(loc->file, stab.heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Initialize data to pass through B-tree */ @@ -380,7 +375,7 @@ H5G__stab_remove(const H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_ udata.grp_full_path_r = grp_full_path_r; /* Remove from symbol table */ - if(H5B_remove(loc->file, dxpl_id, H5B_SNODE, stab.btree_addr, &udata) < 0) + if(H5B_remove(loc->file, H5B_SNODE, stab.btree_addr, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to remove entry") done: @@ -405,7 +400,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, +H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, H5_iter_order_t order, hsize_t n) { H5HL_t *heap = NULL; /* Pointer to local heap */ @@ -420,16 +415,16 @@ H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *gr HDassert(grp_oloc && grp_oloc->file); /* Look up name of link to remove, by index */ - if(H5G__stab_lookup_by_idx(grp_oloc, order, n, &obj_lnk, dxpl_id) < 0) + if(H5G__stab_lookup_by_idx(grp_oloc, order, n, &obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get link information") lnk_copied = TRUE; /* Read in symbol table message */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Initialize data to pass through B-tree */ @@ -438,7 +433,7 @@ H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *gr udata.grp_full_path_r = grp_full_path_r; /* Remove link from symbol table */ - if(H5B_remove(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, &udata) < 0) + if(H5B_remove(grp_oloc->file, H5B_SNODE, stab.btree_addr, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to remove entry") done: @@ -464,12 +459,10 @@ done: * Programmer: Quincey Koziol * Thursday, March 20, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t -H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) +H5G__stab_delete(H5F_t *f, const H5O_stab_t *stab) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_rm_t udata; /*data to pass through B-tree */ @@ -483,7 +476,7 @@ H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) HDassert(H5F_addr_defined(stab->heap_addr)); /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(f, stab->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Set up user data for B-tree deletion */ @@ -491,7 +484,7 @@ H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) udata.common.heap = heap; /* Delete entire B-tree */ - if(H5B_delete(f, dxpl_id, H5B_SNODE, stab->btree_addr, &udata) < 0) + if(H5B_delete(f, H5B_SNODE, stab->btree_addr, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete symbol table B-tree") /* Release resources */ @@ -500,7 +493,7 @@ H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) heap = NULL; /* Delete local heap for names */ - if(H5HL_delete(f, dxpl_id, stab->heap_addr) < 0) + if(H5HL_delete(f, stab->heap_addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete symbol table heap") done: @@ -525,7 +518,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, +H5G__stab_iterate(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data) { H5HL_t *heap = NULL; /* Local heap for group */ @@ -533,18 +526,18 @@ H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, H5G_link_table_t ltable = {0, NULL}; /* Link table */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(oloc->addr) /* Sanity check */ HDassert(oloc); HDassert(op); /* Get the B-tree info */ - if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Check on iteration order */ @@ -560,7 +553,7 @@ H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, udata.op_data = op_data; /* Iterate over the group members */ - if((ret_value = H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_iterate, &udata)) < 0) + if((ret_value = H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_iterate, &udata)) < 0) HERROR(H5E_SYM, H5E_CANTNEXT, "iteration operator failed"); /* Check for too high of a starting index (ex post facto :-) */ @@ -577,7 +570,7 @@ H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, udata.ltable = <able; /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_build_table, &udata) < 0) + if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_build_table, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to build link table") /* Check for skipping out of bounds */ @@ -600,7 +593,7 @@ done: if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_iterate() */ @@ -617,12 +610,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_count(H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id) +H5G__stab_count(const H5O_loc_t *oloc, hsize_t *num_objs) { H5O_stab_t stab; /* Info about symbol table */ herr_t ret_value = SUCCEED; - FUNC_ENTER_PACKAGE_TAG(dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(oloc->addr) /* Sanity check */ HDassert(oloc); @@ -632,15 +625,15 @@ H5G__stab_count(H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id) *num_objs = 0; /* Get the B-tree info */ - if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_sumup, num_objs) < 0) + if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_sumup, num_objs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_count() */ @@ -657,8 +650,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, - H5_ih_info_t *bh_info) +H5G__stab_bh_size(H5F_t *f, const H5O_stab_t *stab, H5_ih_info_t *bh_info) { hsize_t snode_size; /* Symbol table node size */ H5B_info_t bt_info; /* B-tree node info */ @@ -675,14 +667,14 @@ H5G__stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, snode_size = 0; /* Get the B-tree & symbol table node size info */ - if(H5B_get_info(f, dxpl_id, H5B_SNODE, stab->btree_addr, &bt_info, H5G__node_iterate_size, &snode_size) < 0) + if(H5B_get_info(f, H5B_SNODE, stab->btree_addr, &bt_info, H5G__node_iterate_size, &snode_size) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "iteration operator failed") /* Add symbol table & B-tree node sizes to index info */ bh_info->index_size += snode_size + bt_info.size; /* Get the size of the local heap for the group */ - if(H5HL_heapsize(f, dxpl_id, stab->heap_addr, &(bh_info->heap_size)) < 0) + if(H5HL_heapsize(f, stab->heap_addr, &(bh_info->heap_size)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "iteration operator failed") done: @@ -747,7 +739,7 @@ done: */ ssize_t H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, - char* name, size_t size, hid_t dxpl_id) + char* name, size_t size) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5O_stab_t stab; /* Info about local heap & B-tree */ @@ -764,11 +756,11 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t HDassert(oloc); /* Get the B-tree & local heap info */ - if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Remap index for decreasing iteration order */ @@ -776,7 +768,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t hsize_t nlinks = 0; /* Number of links in group */ /* Iterate over the symbol table nodes, to count the links */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_sumup, &nlinks) < 0) + if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_sumup, &nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") /* Map decreasing iteration order index to increasing iteration order index */ @@ -792,7 +784,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t udata_valid = TRUE; /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) + if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed") /* If we don't know the name now, we almost certainly went out of bounds */ @@ -869,8 +861,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, - hid_t dxpl_id) +H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_lkp_t bt_udata; /* Data to pass through B-tree */ @@ -886,11 +877,11 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, HDassert(lnk); /* Retrieve the symbol table message for the group */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't read message") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Set up user data to pass to 'find' operation callback */ @@ -905,7 +896,7 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, bt_udata.op_data = &udata; /* Search the B-tree */ - if((ret_value = H5B_find(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, &bt_udata)) < 0) + if((ret_value = H5B_find(grp_oloc->file, H5B_SNODE, stab.btree_addr, &bt_udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "not found") done: @@ -973,7 +964,7 @@ done: */ herr_t H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, - H5O_link_t *lnk, hid_t dxpl_id) + H5O_link_t *lnk) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_it_lbi_t udata; /* Iteration information */ @@ -987,11 +978,11 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ HDassert(lnk); /* Get the B-tree & local heap info */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Remap index for decreasing iteration order */ @@ -999,7 +990,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ hsize_t nlinks = 0; /* Number of links in group */ /* Iterate over the symbol table nodes, to count the links */ - if(H5B_iterate(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_sumup, &nlinks) < 0) + if(H5B_iterate(grp_oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_sumup, &nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") /* Map decreasing iteration order index to increasing iteration order index */ @@ -1015,7 +1006,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ udata.found = FALSE; /* Iterate over the group members */ - if(H5B_iterate(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) + if(H5B_iterate(grp_oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed") /* If we didn't find the link, we almost certainly went out of bounds */ @@ -1055,24 +1046,24 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab) +H5G__stab_valid(H5O_loc_t *grp_oloc, H5O_stab_t *alt_stab) { H5O_stab_t stab; /* Current symbol table */ H5HL_t *heap = NULL; /* Pointer to local heap */ hbool_t changed = FALSE; /* Whether stab has been modified */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* Read the symbol table message */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "unable to read symbol table message"); /* Check if the symbol table message's b-tree address is valid */ - if(H5B_valid(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr) < 0) { + if(H5B_valid(grp_oloc->file, H5B_SNODE, stab.btree_addr) < 0) { /* Address is invalid, try the b-tree address in the alternate symbol * table message */ - if(!alt_stab || H5B_valid(grp_oloc->file, dxpl_id, H5B_SNODE, alt_stab->btree_addr) < 0) + if(!alt_stab || H5B_valid(grp_oloc->file, H5B_SNODE, alt_stab->btree_addr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to locate b-tree") else { /* The alternate symbol table's b-tree address is valid. Adjust the @@ -1083,10 +1074,10 @@ H5G__stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab) } /* end if */ /* Check if the symbol table message's heap address is valid */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) { + if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) { /* Address is invalid, try the heap address in the alternate symbol * table message */ - if(!alt_stab || NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, alt_stab->heap_addr, H5AC__READ_ONLY_FLAG))) + if(!alt_stab || NULL == (heap = H5HL_protect(grp_oloc->file, alt_stab->heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "unable to locate heap") else { /* The alternate symbol table's heap address is valid. Adjust the @@ -1099,7 +1090,7 @@ H5G__stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab) /* Update the symbol table message and clear errors if necessary */ if(changed) { H5E_clear_stack(NULL); - if(H5O_msg_write(grp_oloc, H5O_STAB_ID, 0, H5O_UPDATE_TIME | H5O_UPDATE_FORCE, &stab, dxpl_id) < 0) + if(H5O_msg_write(grp_oloc, H5O_STAB_ID, 0, H5O_UPDATE_TIME | H5O_UPDATE_FORCE, &stab) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to correct symbol table message") } /* end if */ @@ -1108,7 +1099,7 @@ done: if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_valid */ #endif /* H5_STRICT_FORMAT_CHECKS */ @@ -1161,7 +1152,7 @@ H5G_stab_get_type_by_idx_cb(const H5G_entry_t *ent, void *_udata) tmp_oloc.addr = ent->header; /* Get the type of the object */ - if(H5O_obj_type(&tmp_oloc, &obj_type, udata->dxpl_id) < 0) + if(H5O_obj_type(&tmp_oloc, &obj_type) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") udata->type = H5G_map_obj_type(obj_type); } @@ -1189,19 +1180,19 @@ done: *------------------------------------------------------------------------- */ H5G_obj_t -H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) +H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx) { H5O_stab_t stab; /* Info about local heap & B-tree */ H5G_bt_it_gtbi_t udata; /* User data for B-tree callback */ H5G_obj_t ret_value = H5G_UNKNOWN; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, oloc->addr, H5G_UNKNOWN) + FUNC_ENTER_PACKAGE_TAG(oloc->addr) /* Sanity check */ HDassert(oloc); /* Get the B-tree & local heap info */ - if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "unable to determine local heap address") /* Set iteration information */ @@ -1209,11 +1200,10 @@ H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) udata.common.num_objs = 0; udata.common.op = H5G_stab_get_type_by_idx_cb; udata.f = oloc->file; - udata.dxpl_id = dxpl_id; udata.type = H5G_UNKNOWN; /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) + if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "iteration operator failed") /* If we don't know the type now, we almost certainly went out of bounds */ @@ -1224,7 +1214,7 @@ H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) ret_value = udata.type; done: - FUNC_LEAVE_NOAPI_TAG(ret_value, H5G_UNKNOWN) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_get_type_by_idx() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 7271cdc..eaee737 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -29,6 +29,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gpkg.h" /* Groups */ @@ -95,7 +96,7 @@ H5G__is_empty_test(hid_t gid) H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = FALSE; /* Indicate that a header message is present */ htri_t linfo_exists = FALSE;/* Indicate that the 'link info' message is present */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -104,14 +105,19 @@ H5G__is_empty_test(hid_t gid) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* "New format" checks */ /* Check if the group has any link messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) { /* Sanity check that new group format shouldn't have old messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found") @@ -120,19 +126,19 @@ H5G__is_empty_test(hid_t gid) } /* end if */ /* Check for a link info message */ - if((linfo_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID, dxpl_id)) < 0) + if((linfo_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(linfo_exists > 0) { H5O_linfo_t linfo; /* Link info message */ /* Sanity check that new group format shouldn't have old messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link info messages found") /* Get the link info */ - if(H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id) < 0) + if(H5G__obj_get_linfo(&(grp->oloc), &linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info") /* Check for 'dense' link storage file addresses being defined */ @@ -151,7 +157,7 @@ H5G__is_empty_test(hid_t gid) /* "Old format" checks */ /* Check if the group has a symbol table message */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) { H5O_stab_t stab; /* Info about local heap & B-tree */ @@ -160,17 +166,17 @@ H5G__is_empty_test(hid_t gid) /* Sanity check that old group format shouldn't have new messages */ if(linfo_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link info messages found") - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and group info messages found") /* Get the B-tree & local heap info */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read symbol table message") /* Get the count of links in the group */ - if(H5G__stab_count(&(grp->oloc), &nlinks, dxpl_id) < 0) + if(H5G__stab_count(&(grp->oloc), &nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to count links") /* Check for link count */ @@ -179,6 +185,9 @@ H5G__is_empty_test(hid_t gid) } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__is_empty_test() */ @@ -207,7 +216,7 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -216,14 +225,19 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Check if the group has any link messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists == 0) HGOTO_DONE(FALSE) /* Check if the group has a symbol table message */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found") @@ -233,12 +247,15 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) int msg_count; /* Number of messages of a type */ /* Check how many link messages there are */ - if((msg_count = H5O_msg_count(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0) + if((msg_count = H5O_msg_count(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to count link messages") *nmsgs = (unsigned)msg_count; } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__has_links_test() */ @@ -266,7 +283,7 @@ H5G__has_stab_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -275,19 +292,27 @@ H5G__has_stab_test(hid_t gid) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Check if the group has a symbol table message */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists == 0) HGOTO_DONE(FALSE) /* Check if the group has any link messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__has_stab_test() */ @@ -317,7 +342,7 @@ H5G__is_new_dense_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -326,26 +351,31 @@ H5G__is_new_dense_test(hid_t gid) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Check if the group has a symbol table message */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_DONE(FALSE) /* Check if the group has any link messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_DONE(FALSE) /* Check if the group has link info message */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) { H5O_linfo_t linfo; /* Link info message */ /* Get the link info */ - if(H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id) < 0) + if(H5G__obj_get_linfo(&(grp->oloc), &linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info") /* Check for 'dense' link storage file addresses being defined */ @@ -356,6 +386,9 @@ H5G__is_new_dense_test(hid_t gid) } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__is_new_dense_test() */ @@ -388,7 +421,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ H5O_linfo_t linfo; /* Link info message */ H5G_t *grp = NULL; /* Pointer to group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -397,21 +430,26 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(dxpl_id, grp->oloc.addr, FAIL); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Set metadata tag in API context */ + H5_BEGIN_TAG(grp->oloc.addr); /* Get the link info */ - if(H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id) < 0) + if(H5G__obj_get_linfo(&(grp->oloc), &linfo) < 0) HGOTO_ERROR_TAG(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info") /* Check for 'dense' link storage file addresses being defined */ if(!H5F_addr_defined(linfo.fheap_addr)) - HGOTO_DONE_TAG(FAIL, FAIL) + HGOTO_DONE_TAG(FAIL) if(!H5F_addr_defined(linfo.name_bt2_addr)) - HGOTO_DONE_TAG(FAIL, FAIL) + HGOTO_DONE_TAG(FAIL) /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(grp->oloc.file, dxpl_id, linfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(grp->oloc.file, linfo.name_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in name index */ @@ -421,7 +459,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) /* Check if there is a creation order index */ if(H5F_addr_defined(linfo.corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(grp->oloc.file, dxpl_id, linfo.corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(grp->oloc.file, linfo.corder_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Retrieve # of records in creation order index */ @@ -431,15 +469,17 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) else *corder_count = 0; - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__new_dense_info_test() */ @@ -469,7 +509,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) { H5G_t *grp = NULL; /* Pointer to group */ H5O_stab_t stab; /* Symbol table message */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -478,15 +518,23 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Make certain the group has a symbol table message */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read symbol table message") /* Check the size of the local heap for the group */ - if(H5HL_get_size(grp->oloc.file, dxpl_id, stab.heap_addr, lheap_size) < 0) + if(H5HL_get_size(grp->oloc.file, stab.heap_addr, lheap_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't query local heap size") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__lheap_size_test() */ @@ -518,6 +566,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign { void *obj_ptr; /* Pointer to object for ID */ H5G_name_t *obj_path; /* Pointer to group hier. path for obj */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -530,6 +579,11 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign if(NULL == (obj_ptr = H5I_object(obj_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get object for ID") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the symbol table entry */ switch(H5I_get_type(obj_id)) { case H5I_GROUP: @@ -586,6 +640,9 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign } /* end else */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__user_path_test() */ @@ -611,17 +668,16 @@ H5G__verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent) { H5O_stab_t stab; /* Symbol table */ H5HL_t *heap = NULL; /* Pointer to local heap */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* Verify that stab info is cached in ent */ if(ent->type != H5G_CACHED_STAB) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "symbol table information is not cached") /* Read the symbol table message from the group */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "unable to read symbol table message") /* Verify that the cached symbol table info matches the symbol table message @@ -631,11 +687,11 @@ H5G__verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "cached stab info does not match object header") /* Verify that the btree address is valid */ - if(H5B_valid(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr) < 0) + if(H5B_valid(grp_oloc->file, H5B_SNODE, stab.btree_addr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "b-tree address is invalid") /* Verify that the heap address is valid */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "heap address is invalid") done: @@ -643,12 +699,12 @@ done: if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__verify_cached_stab_test() */ /*------------------------------------------------------------------------- - * Function: H5G_verify_cached_stabs_test_cb + * Function: H5G__verify_cached_stabs_test_cb * * Purpose: Verify that all entries in this node contain cached symbol * table information if and only if the entry refers to a @@ -663,9 +719,8 @@ done: *------------------------------------------------------------------------- */ static int -H5G_verify_cached_stabs_test_cb(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 H5_ATTR_UNUSED *udata) +H5G__verify_cached_stabs_test_cb(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, + haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void H5_ATTR_UNUSED *udata) { H5G_node_t *sn = NULL; H5O_loc_t targ_oloc; @@ -675,7 +730,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, unsigned i; int ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -684,7 +739,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, HDassert(H5F_addr_defined(addr)); /* Load the node */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* Check each target object to see if its stab message (if present) matches @@ -699,7 +754,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, targ_oloc.addr = sn->entry[i].header; /* Load target object header */ - if(NULL == (targ_oh = H5O_protect(&targ_oloc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (targ_oh = H5O_protect(&targ_oloc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_SYM, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to protect target object header") /* Check if a symbol table message exists */ @@ -708,7 +763,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, if(stab_exists) { /* Read symbol table message */ - if(NULL == H5O_msg_read_oh(f, dxpl_id, targ_oh, H5O_STAB_ID, &stab)) + if(NULL == H5O_msg_read_oh(f, targ_oh, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to read STAB message") /* Check if the stab matches the cached stab info */ @@ -723,23 +778,23 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, H5_ITER_ERROR, "nonexistent STAB message is cached") /* Unprotect target object */ - if(H5O_unprotect(&targ_oloc, dxpl_id, targ_oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(&targ_oloc, targ_oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release object header"); targ_oh = NULL; } /* end for */ done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") if(targ_oh) { HDassert(ret_value == H5_ITER_ERROR); - if(H5O_unprotect(&targ_oloc, dxpl_id, targ_oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(&targ_oloc, targ_oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release object header"); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_verify_cached_stabs_test_cb() */ +} /* end H5G__verify_cached_stabs_test_cb() */ /*------------------------------------------------------------------------- @@ -768,7 +823,6 @@ H5G__verify_cached_stabs_test(hid_t gid) H5O_stab_t stab; /* Symbol table message */ H5G_bt_common_t udata = {NULL, NULL}; /* Dummy udata so H5B_iterate doesn't freak out */ haddr_t prev_tag = HADDR_UNDEF; /* Previous metadata tag */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -781,13 +835,11 @@ H5G__verify_cached_stabs_test(hid_t gid) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") /* Set up metadata tagging */ - if(H5AC_tag(dxpl_id, grp->oloc.addr, &prev_tag) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to apply metadata tag") + H5AC_tag(grp->oloc.addr, &prev_tag); /* Check for group having a symbol table message */ /* Check for the group having a group info message */ - if((stab_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, - dxpl_id)) < 0) + if((stab_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") /* No need to check anything if the symbol table doesn't exist */ @@ -795,17 +847,16 @@ H5G__verify_cached_stabs_test(hid_t gid) HGOTO_DONE(SUCCEED); /* Read the stab */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get symbol table info") /* Iterate over the b-tree, checking validity of cached information */ - if((ret_value = H5B_iterate(grp->oloc.file, dxpl_id, H5B_SNODE, - stab.btree_addr, H5G_verify_cached_stabs_test_cb, &udata)) < 0) + if((ret_value = H5B_iterate(grp->oloc.file, H5B_SNODE, stab.btree_addr, + H5G__verify_cached_stabs_test_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "iteration operator failed"); /* Reset metadata tagging */ - if(H5AC_tag(dxpl_id, prev_tag, NULL) < 0) - HDONE_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to apply metadata tag") + H5AC_tag(prev_tag, NULL); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index ff1206e..37b6292 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -33,6 +33,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ @@ -73,18 +74,15 @@ typedef struct { /********************/ /* Local Prototypes */ /********************/ -static herr_t H5G_traverse_slink_cb(H5G_loc_t *grp_loc, const char *name, +static herr_t H5G__traverse_slink_cb(H5G_loc_t *grp_loc, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5G_traverse_ud(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, - H5G_loc_t *obj_loc/*in,out*/, unsigned target, size_t *nlinks/*in,out*/, - hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id); -static herr_t H5G_traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, - H5G_loc_t *obj_loc/*in,out*/, unsigned target, size_t *nlinks/*in,out*/, - hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id); -static herr_t H5G_traverse_real(const H5G_loc_t *loc, const char *name, - unsigned target, size_t *nlinks, H5G_traverse_t op, void *op_data, - hid_t lapl_id, hid_t dxpl_id); +static herr_t H5G__traverse_ud(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, + H5G_loc_t *obj_loc/*in,out*/, unsigned target, hbool_t *obj_exists); +static herr_t H5G__traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, + H5G_loc_t *obj_loc/*in,out*/, unsigned target, hbool_t *obj_exists); +static herr_t H5G__traverse_real(const H5G_loc_t *loc, const char *name, + unsigned target, H5G_traverse_t op, void *op_data); /*********************/ @@ -104,7 +102,7 @@ static herr_t H5G_traverse_real(const H5G_loc_t *loc, const char *name, /*------------------------------------------------------------------------- - * Function: H5G_traverse_slink_cb + * Function: H5G__traverse_slink_cb * * Purpose: Callback for soft link traversal. This routine sets the * correct information for the object location. @@ -117,14 +115,14 @@ static herr_t H5G_traverse_real(const H5G_loc_t *loc, const char *name, *------------------------------------------------------------------------- */ static herr_t -H5G_traverse_slink_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc, const char H5_ATTR_UNUSED *name, +H5G__traverse_slink_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_trav_slink_t *udata = (H5G_trav_slink_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check for dangling soft link */ if(obj_loc == NULL) { @@ -147,11 +145,11 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_traverse_slink_cb() */ +} /* end H5G__traverse_slink_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_traverse_link_ud + * Function: H5G__traverse_ud * * Purpose: Callback for user-defined link traversal. Sets up a * location ID and passes it to the user traversal callback. @@ -164,9 +162,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, - H5G_loc_t *obj_loc/*in,out*/, unsigned target, size_t *nlinks/*in,out*/, - hbool_t *obj_exists, hid_t _lapl_id, hid_t dxpl_id) +H5G__traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, + H5G_loc_t *obj_loc/*in,out*/, unsigned target, hbool_t *obj_exists) { const H5L_class_t *link_class; /* User-defined link class */ hid_t cb_return = -1; /* The ID the user-defined callback returned */ @@ -175,20 +172,16 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, H5O_loc_t grp_oloc_copy; H5G_loc_t new_loc; /* Group location for newly opened external object */ H5G_t *grp; - hid_t lapl_id = (-1); /* LAPL local to this routine */ - H5P_genplist_t *lapl; /* LAPL with nlinks set */ hid_t cur_grp = (-1); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(grp_loc); HDassert(lnk); HDassert(lnk->type >= H5L_TYPE_UD_MIN); HDassert(obj_loc); - HDassert(nlinks); - HDassert(_lapl_id >= 0); /* Get the link class for this type of link. */ if(NULL == (link_class = H5L_find_class(lnk->type))) @@ -203,37 +196,17 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy object location") /* Create a group ID to pass to the user-defined callback */ - if(NULL == (grp = H5G_open(&grp_loc_copy, dxpl_id))) + if(NULL == (grp = H5G_open(&grp_loc_copy))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") if((cur_grp = H5I_register(H5I_GROUP, grp, FALSE)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, FAIL, "unable to register group") - /* Check for generic default property list and use link access default if so */ - if(_lapl_id == H5P_DEFAULT) { - HDassert(H5P_LINK_ACCESS_DEFAULT != -1); - if(NULL == (lapl = (H5P_genplist_t *)H5I_object(H5P_LINK_ACCESS_DEFAULT))) - HGOTO_ERROR(H5E_SYM, H5E_BADATOM, FAIL, "unable to get default property list") - } /* end if */ - else { - /* Get the underlying property list passed in */ - if(NULL == (lapl = (H5P_genplist_t *)H5I_object(_lapl_id))) - HGOTO_ERROR(H5E_SYM, H5E_BADATOM, FAIL, "unable to get property list from ID") - } /* end else */ - - /* Copy the property list passed in */ - if((lapl_id = H5P_copy_plist(lapl, FALSE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy property list") - - /* Get the underlying property list copy */ - if(NULL == (lapl = (H5P_genplist_t *)H5I_object(lapl_id))) - HGOTO_ERROR(H5E_SYM, H5E_BADATOM, FAIL, "unable to get property list from ID") - - /* Record number of soft links left to traverse in the property list. */ - if(H5P_set(lapl, H5L_ACS_NLINKS_NAME, nlinks) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set nlink info") - /* User-defined callback function */ - cb_return = (link_class->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, lapl_id); + /* (Backwardly compatible with v0 H5L_class_t traverssal callback) */ + if(link_class->version == H5L_LINK_CLASS_T_VERS_0) + cb_return = (((const H5L_class_0_t *)link_class)->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, H5CX_get_lapl()); + else + cb_return = (link_class->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, H5CX_get_lapl(), H5CX_get_dxpl()); /* Check for failing to locate the object */ if(cb_return < 0) { @@ -284,16 +257,12 @@ done: if(ret_value < 0 && cb_return > 0 && H5I_dec_ref(cb_return) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") - /* Close the LAPL, if we copied one */ - if(lapl_id > 0 && H5I_dec_ref(lapl_id) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close copied link access property list") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_traverse_ud() */ +} /* end H5G__traverse_ud() */ /*------------------------------------------------------------------------- - * Function: H5G_traverse_slink + * Function: H5G__traverse_slink * * Purpose: Traverses symbolic link. The link head appears in the group * whose entry is GRP_LOC and the link tail entry is OBJ_LOC. @@ -309,9 +278,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, - H5G_loc_t *obj_loc/*in,out*/, unsigned target, size_t *nlinks/*in,out*/, - hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id) +H5G__traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, + H5G_loc_t *obj_loc/*in,out*/, unsigned target, hbool_t *obj_exists) { H5G_trav_slink_t udata; /* User data to pass to link traversal callback */ H5G_name_t tmp_obj_path; /* Temporary copy of object's path */ @@ -322,13 +290,12 @@ H5G_traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, hbool_t tmp_grp_loc_set = FALSE; /* Flag to indicate that tmp group location is initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(grp_loc); HDassert(lnk); HDassert(lnk->type == H5L_TYPE_SOFT); - HDassert(nlinks); /* Set up temporary location */ tmp_grp_loc.oloc = &tmp_grp_oloc; @@ -356,7 +323,7 @@ H5G_traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, udata.obj_loc = obj_loc; /* Traverse the link */ - if(H5G_traverse_real(&tmp_grp_loc, lnk->u.soft.name, target, nlinks, H5G_traverse_slink_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G__traverse_real(&tmp_grp_loc, lnk->u.soft.name, target, H5G__traverse_slink_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to follow symbolic link") /* Pass back information about whether the object exists */ @@ -374,7 +341,7 @@ done: H5G_loc_free(&tmp_grp_loc); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_traverse_slink() */ +} /* end H5G__traverse_slink() */ /*------------------------------------------------------------------------- @@ -392,9 +359,10 @@ done: */ herr_t H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, - unsigned target, size_t *nlinks, hbool_t last_comp, - H5G_loc_t *obj_loc, hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id) + unsigned target, hbool_t last_comp, H5G_loc_t *obj_loc, + hbool_t *obj_exists) { + size_t nlinks; /* # of soft / UD links left to traverse */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -403,7 +371,6 @@ H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, HDassert(grp_loc); HDassert(lnk); HDassert(obj_loc); - HDassert(nlinks); /* * If we found a symbolic link then we should follow it. But if this @@ -412,9 +379,20 @@ H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, */ if(H5L_TYPE_SOFT == lnk->type && (0 == (target & H5G_TARGET_SLINK) || !last_comp)) { - if((*nlinks)-- <= 0) + /* Get the # of soft / UD links left to traverse */ + if(H5CX_get_nlinks(&nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve # of soft / UD links to traverse") + + /* Decrement # of links and range check */ + if((nlinks)-- <= 0) HGOTO_ERROR(H5E_LINK, H5E_NLINKS, FAIL, "too many links") - if(H5G_traverse_slink(grp_loc, lnk, obj_loc, (target & H5G_TARGET_EXISTS), nlinks, obj_exists, lapl_id, dxpl_id) < 0) + + /* Update the # of links in the API context */ + if(H5CX_set_nlinks(nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't update # of soft / UD links to traverse") + + /* Traverse soft link */ + if(H5G__traverse_slink(grp_loc, lnk, obj_loc, (target & H5G_TARGET_EXISTS), obj_exists) < 0) HGOTO_ERROR(H5E_LINK, H5E_TRAVERSE, FAIL, "symbolic link traversal failed") } /* end if */ @@ -425,9 +403,20 @@ H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, */ if(lnk->type >= H5L_TYPE_UD_MIN && (0 == (target & H5G_TARGET_UDLINK) || !last_comp) ) { - if((*nlinks)-- <= 0) + /* Get the # of soft / UD links left to traverse */ + if(H5CX_get_nlinks(&nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve # of soft / UD links to traverse") + + /* Decrement # of links and range check */ + if((nlinks)-- <= 0) HGOTO_ERROR(H5E_LINK, H5E_NLINKS, FAIL, "too many links") - if(H5G_traverse_ud(grp_loc, lnk, obj_loc, (target & H5G_TARGET_EXISTS), nlinks, obj_exists, lapl_id, dxpl_id) < 0) + + /* Update the # of links in the API context */ + if(H5CX_set_nlinks(nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't update # of soft / UD links to traverse") + + /* Traverse user-defined link */ + if(H5G__traverse_ud(grp_loc, lnk, obj_loc, (target & H5G_TARGET_EXISTS), obj_exists) < 0) HGOTO_ERROR(H5E_LINK, H5E_TRAVERSE, FAIL, "user-defined link traversal failed") } /* end if */ @@ -462,7 +451,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_traverse_real + * Function: H5G__traverse_real * * Purpose: Internal version of path traversal routine * @@ -478,8 +467,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, - size_t *nlinks, H5G_traverse_t op, void *op_data, hid_t lapl_id, hid_t dxpl_id) +H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, + H5G_traverse_t op, void *op_data) { H5G_loc_t loc; /* Location of start object */ H5O_loc_t grp_oloc; /* Object loc. for current group */ @@ -500,12 +489,11 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, hbool_t last_comp = FALSE; /* Flag to indicate that a component is the last component in the name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check parameters */ HDassert(_loc); HDassert(name); - HDassert(nlinks); HDassert(op); /* @@ -590,7 +578,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, } /* end if */ /* Get information for object in current group */ - if((lookup_status = H5G__obj_lookup(grp_loc.oloc, comp, &lnk/*out*/, dxpl_id)) < 0) + if((lookup_status = H5G__obj_lookup(grp_loc.oloc, comp, &lnk/*out*/)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't look up component") obj_exists = FALSE; @@ -611,7 +599,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Perform any special traversals that the link needs */ /* (soft links, user-defined links, file mounting, etc.) */ - if(H5G__traverse_special(&grp_loc, &lnk, target, nlinks, last_comp, &obj_loc, &obj_exists, lapl_id, dxpl_id) < 0) + if(H5G__traverse_special(&grp_loc, &lnk, target, last_comp, &obj_loc, &obj_exists) < 0) HGOTO_ERROR(H5E_LINK, H5E_TRAVERSE, FAIL, "special link traversal failed") } /* end if */ @@ -660,11 +648,11 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Check for the parent group having a group info message */ /* (OK if not found) */ - if((exists = H5O_msg_exists(grp_loc.oloc, H5O_GINFO_ID, dxpl_id)) < 0) + if((exists = H5O_msg_exists(grp_loc.oloc, H5O_GINFO_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(exists) { /* Get the group info for parent group */ - if(NULL == H5O_msg_read(grp_loc.oloc, H5O_GINFO_ID, &par_ginfo, dxpl_id)) + if(NULL == H5O_msg_read(grp_loc.oloc, H5O_GINFO_ID, &par_ginfo)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "group info message not present") /* Use parent group info settings */ @@ -677,7 +665,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Check for the parent group having a link info message */ /* (OK if not found) */ /* Get the link info for parent group */ - if((exists = H5G__obj_get_linfo(grp_loc.oloc, &par_linfo, dxpl_id)) < 0) + if((exists = H5G__obj_get_linfo(grp_loc.oloc, &par_linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(exists) { /* Only keep the creation order information from the parent @@ -694,11 +682,11 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Check for the parent group having a filter pipeline message */ /* (OK if not found) */ - if((exists = H5O_msg_exists(grp_loc.oloc, H5O_PLINE_ID, dxpl_id)) < 0) + if((exists = H5O_msg_exists(grp_loc.oloc, H5O_PLINE_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(exists) { /* Get the filter pipeline for parent group */ - if(NULL == H5O_msg_read(grp_loc.oloc, H5O_PLINE_ID, &par_pline, dxpl_id)) + if(NULL == H5O_msg_read(grp_loc.oloc, H5O_PLINE_ID, &par_pline)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "filter pipeline message not present") /* Use parent filter pipeline settings */ @@ -713,15 +701,15 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, gcrt_info.gcpl_id = H5P_GROUP_CREATE_DEFAULT; gcrt_info.cache_type = H5G_NOTHING_CACHED; HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); - if(H5G__obj_create_real(grp_oloc.file, dxpl_id, ginfo, linfo, pline, &gcrt_info, obj_loc.oloc/*out*/) < 0) + if(H5G__obj_create_real(grp_oloc.file, ginfo, linfo, pline, &gcrt_info, obj_loc.oloc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group entry") /* Insert new group into current group's symbol table */ - if(H5G__loc_insert(&grp_loc, comp, &obj_loc, H5O_TYPE_GROUP, &gcrt_info, dxpl_id) < 0) + if(H5G__loc_insert(&grp_loc, comp, &obj_loc, H5O_TYPE_GROUP, &gcrt_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert intermediate group") /* Decrement refcount on intermediate group's object header in memory */ - if(H5O_dec_rc_by_loc(obj_loc.oloc, dxpl_id) < 0) + if(H5O_dec_rc_by_loc(obj_loc.oloc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") /* Close new group */ @@ -806,7 +794,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't release wrapped buffer") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_traverse_real() */ +} /* end H5G__traverse_real() */ /*------------------------------------------------------------------------- @@ -827,11 +815,10 @@ done: */ herr_t H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traverse_t op, - void *op_data, hid_t lapl_id, hid_t dxpl_id) + void *op_data) { - size_t nlinks; /* Link countdown value */ - H5P_genplist_t *lapl; /* Property list with value for nlinks */ - herr_t ret_value = SUCCEED; /* Return value */ + size_t orig_nlinks; /* Original value for # of soft / UD links able to traverse */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -842,17 +829,14 @@ H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traver HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "no starting location") if(!op) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "no operation provided") - HDassert(lapl_id >= 0); - /* Set nlinks value from property list, if it exists */ - if(lapl_id == H5P_DEFAULT) - nlinks = H5L_NUM_LINKS; - else { - if(NULL == (lapl = (H5P_genplist_t *)H5I_object(lapl_id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_get(lapl, H5L_ACS_NLINKS_NAME, &nlinks) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get number of links") - } /* end else */ + /* Retrieve the original # of soft / UD links that are able to be traversed */ + /* (So that multiple calls to H5G_traverse don't incorrectly look + * like they've traversed too many. Nested calls, like in H5L__move(), + * may need their own mechanism to set & reset the # of links to traverse) + */ + if(H5CX_get_nlinks(&orig_nlinks) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to retrieve # of soft / UD links to traverse") /* Set up invalid tag. This is a precautionary step only. Setting an invalid tag here will ensure that no metadata accessed while doing the traversal @@ -860,14 +844,18 @@ H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traver first. This will ensure we're not accidentally tagging something we shouldn't be during the traversal. Note that for best tagging assertion coverage, setting H5C_DO_TAGGING_SANITY_CHECKS is advised. */ - H5_BEGIN_TAG(dxpl_id, H5AC__INVALID_TAG, FAIL); + H5_BEGIN_TAG(H5AC__INVALID_TAG); /* Go perform "real" traversal */ - if(H5G_traverse_real(loc, name, target, &nlinks, op, op_data, lapl_id, dxpl_id) < 0) + if(H5G__traverse_real(loc, name, target, op, op_data) < 0) HGOTO_ERROR_TAG(H5E_SYM, H5E_NOTFOUND, FAIL, "internal path traversal failed") /* Reset tag after traversal */ - H5_END_TAG(FAIL); + H5_END_TAG + + /* Reset the # of soft / UD links that can be traversed */ + if(H5CX_set_nlinks(orig_nlinks) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't reset # of soft / UD links to traverse") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HF.c b/src/H5HF.c index 6c09969..b7a6244 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -150,7 +150,7 @@ H5HF_op_write(const void *obj, size_t obj_len, void *op_data) *------------------------------------------------------------------------- */ H5HF_t * -H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) +H5HF_create(H5F_t *f, const H5HF_create_t *cparam) { H5HF_t *fh = NULL; /* Pointer to new fractal heap */ H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ @@ -166,7 +166,7 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) HDassert(cparam); /* Create shared fractal heap header */ - if(HADDR_UNDEF == (fh_addr = H5HF_hdr_create(f, dxpl_id, cparam))) + if(HADDR_UNDEF == (fh_addr = H5HF_hdr_create(f, cparam))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create fractal heap header") /* Allocate fractal heap wrapper */ @@ -174,7 +174,7 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed for fractal heap info") /* Lock the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header") /* Point fractal heap wrapper at header and bump it's ref count */ @@ -193,10 +193,10 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) ret_value = fh; done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release fractal heap header") if(!ret_value && fh) - if(H5HF_close(fh, dxpl_id) < 0) + if(H5HF_close(fh) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTCLOSEOBJ, NULL, "unable to close fractal heap") FUNC_LEAVE_NOAPI(ret_value) @@ -218,7 +218,7 @@ done: *------------------------------------------------------------------------- */ H5HF_t * -H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) +H5HF_open(H5F_t *f, haddr_t fh_addr) { H5HF_t *fh = NULL; /* Pointer to new fractal heap */ H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ @@ -233,7 +233,7 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) HDassert(H5F_addr_defined(fh_addr)); /* Load the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header") /* Check for pending heap deletion */ @@ -260,10 +260,10 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) ret_value = fh; done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release fractal heap header") if(!ret_value && fh) - if(H5HF_close(fh, dxpl_id) < 0) + if(H5HF_close(fh) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTCLOSEOBJ, NULL, "unable to close fractal heap") FUNC_LEAVE_NOAPI(ret_value) @@ -347,8 +347,7 @@ H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr_p) *------------------------------------------------------------------------- */ herr_t -H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, const void *obj, - void *id/*out*/) +H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id/*out*/) { H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ herr_t ret_value = SUCCEED; @@ -374,7 +373,7 @@ H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, const void *obj, if(size > hdr->max_man_size) { /* Store 'huge' object in heap */ /* (Casting away const OK - QAK) */ - if(H5HF_huge_insert(hdr, dxpl_id, size, (void *)obj, id) < 0) + if(H5HF__huge_insert(hdr, size, (void *)obj, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't store 'huge' object in fractal heap") } /* end if */ /* Check for 'tiny' object */ @@ -390,7 +389,7 @@ HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "'write once' managed blocks not su } /* end if */ else { /* Allocate space for object in 'managed' heap */ - if(H5HF_man_insert(hdr, dxpl_id, size, obj, id) < 0) + if(H5HF__man_insert(hdr, size, obj, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't store 'managed' object in fractal heap") } /* end else */ } /* end else */ @@ -414,7 +413,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_get_obj_len(H5HF_t *fh, hid_t dxpl_id, const void *_id, size_t *obj_len_p) +H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -445,7 +444,7 @@ H5HF_get_obj_len(H5HF_t *fh, hid_t dxpl_id, const void *_id, size_t *obj_len_p) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'managed' object's length") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { - if(H5HF_huge_get_obj_len(fh->hdr, dxpl_id, id, obj_len_p) < 0) + if(H5HF__huge_get_obj_len(fh->hdr, id, obj_len_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'huge' object's length") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -476,7 +475,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_get_obj_off(H5HF_t *fh, hid_t dxpl_id, const void *_id, hsize_t *obj_off_p) +H5HF_get_obj_off(H5HF_t *fh, const void *_id, hsize_t *obj_off_p) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -507,7 +506,7 @@ H5HF_get_obj_off(H5HF_t *fh, hid_t dxpl_id, const void *_id, hsize_t *obj_off_p) } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { /* Huge objects are located directly in the file */ - if(H5HF__huge_get_obj_off(fh->hdr, dxpl_id, id, obj_off_p) < 0) + if(H5HF__huge_get_obj_off(fh->hdr, id, obj_off_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'huge' object's offset") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -538,7 +537,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_read(H5HF_t *fh, hid_t dxpl_id, const void *_id, void *obj/*out*/) +H5HF_read(H5HF_t *fh, const void *_id, void *obj/*out*/) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -566,12 +565,12 @@ H5HF_read(H5HF_t *fh, hid_t dxpl_id, const void *_id, void *obj/*out*/) /* Check type of object in heap */ if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { /* Read object from managed heap blocks */ - if(H5HF_man_read(fh->hdr, dxpl_id, id, obj) < 0) + if(H5HF__man_read(fh->hdr, id, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't read object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { /* Read 'huge' object from file */ - if(H5HF_huge_read(fh->hdr, dxpl_id, id, obj) < 0) + if(H5HF__huge_read(fh->hdr, id, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't read 'huge' object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -615,8 +614,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *_id, hbool_t H5_ATTR_UNUSED *id_changed, - const void *obj) +H5HF_write(H5HF_t *fh, void *_id, hbool_t H5_ATTR_UNUSED *id_changed, const void *obj) { uint8_t *id = (uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -645,12 +643,12 @@ H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *_id, hbool_t H5_ATTR_UNUSED *id_chan if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { /* Operate on object from managed heap blocks */ /* (ID can't change and modifying object is "easy" to manage) */ - if(H5HF_man_write(fh->hdr, dxpl_id, id, obj) < 0) + if(H5HF__man_write(fh->hdr, id, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "can't write to 'managed' heap object") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { /* Operate on "huge" object */ - if(H5HF_huge_write(fh->hdr, dxpl_id, id, obj) < 0) + if(H5HF__huge_write(fh->hdr, id, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "can't write to 'huge' heap object") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -687,8 +685,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_op(H5HF_t *fh, hid_t dxpl_id, const void *_id, H5HF_operator_t op, - void *op_data) +H5HF_op(H5HF_t *fh, const void *_id, H5HF_operator_t op, void *op_data) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -716,12 +713,12 @@ H5HF_op(H5HF_t *fh, hid_t dxpl_id, const void *_id, H5HF_operator_t op, /* Check type of object in heap */ if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { /* Operate on object from managed heap blocks */ - if(H5HF_man_op(fh->hdr, dxpl_id, id, op, op_data) < 0) + if(H5HF__man_op(fh->hdr, id, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "can't operate on object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { /* Operate on 'huge' object from file */ - if(H5HF_huge_op(fh->hdr, dxpl_id, id, op, op_data) < 0) + if(H5HF__huge_op(fh->hdr, id, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "can't operate on 'huge' object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -753,7 +750,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_remove(H5HF_t *fh, hid_t dxpl_id, const void *_id) +H5HF_remove(H5HF_t *fh, const void *_id) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -781,12 +778,12 @@ H5HF_remove(H5HF_t *fh, hid_t dxpl_id, const void *_id) /* Check type of object in heap */ if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { /* Remove object from managed heap blocks */ - if(H5HF_man_remove(fh->hdr, dxpl_id, id) < 0) + if(H5HF__man_remove(fh->hdr, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { /* Remove 'huge' object from file & v2 B-tree tracker */ - if(H5HF_huge_remove(fh->hdr, dxpl_id, id) < 0) + if(H5HF__huge_remove(fh->hdr, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove 'huge' object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -818,7 +815,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_close(H5HF_t *fh, hid_t dxpl_id) +H5HF_close(H5HF_t *fh) { hbool_t pending_delete = FALSE; /* Whether the heap is pending deletion */ haddr_t heap_addr = HADDR_UNDEF; /* Address of heap (for deletion) */ @@ -842,7 +839,7 @@ H5HF_close(H5HF_t *fh, hid_t dxpl_id) * a reference loop and the objects couldn't be removed from * the metadata cache - QAK) */ - if(H5HF_space_close(fh->hdr, dxpl_id) < 0) + if(H5HF__space_close(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") /* Reset the block iterator, if necessary */ @@ -860,7 +857,7 @@ H5HF_close(H5HF_t *fh, hid_t dxpl_id) * has the address of an object in the file, which might be * modified by the shutdown routine - QAK) */ - if(H5HF_huge_term(fh->hdr, dxpl_id) < 0) + if(H5HF__huge_term(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release 'huge' object info") /* Check for pending heap deletion */ @@ -885,11 +882,11 @@ H5HF_close(H5HF_t *fh, hid_t dxpl_id) H5HF_hdr_t *hdr; /* Another pointer to fractal heap header */ /* Lock the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(fh->f, dxpl_id, heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5HF__hdr_protect(fh->f, heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Delete heap, starting with header (unprotects header) */ - if(H5HF_hdr_delete(hdr, dxpl_id) < 0) + if(H5HF__hdr_delete(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to delete fractal heap") } /* end if */ @@ -915,7 +912,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) +H5HF_delete(H5F_t *f, haddr_t fh_addr) { H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ herr_t ret_value = SUCCEED; /* Return value */ @@ -929,7 +926,7 @@ H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) HDassert(H5F_addr_defined(fh_addr)); /* Lock the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Check for files using shared heap header */ @@ -937,14 +934,14 @@ H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) hdr->pending_delete = TRUE; else { /* Delete heap now, starting with header (unprotects header) */ - if(H5HF_hdr_delete(hdr, dxpl_id) < 0) + if(H5HF__hdr_delete(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to delete fractal heap") hdr = NULL; } /* end if */ done: /* Unprotect the header, if an error occurred */ - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index 2d35368..5807c56 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -306,7 +306,7 @@ H5HF__huge_bt2_indir_remove(const void *nrecord, void *_udata) FUNC_ENTER_PACKAGE /* Free the space in the file for the object being removed */ - if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->len) < 0) + if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free space for huge object on disk") /* Set the length of the object removed */ @@ -509,7 +509,7 @@ H5HF__huge_bt2_filt_indir_remove(const void *nrecord, void *_udata) FUNC_ENTER_PACKAGE /* Free the space in the file for the object being removed */ - if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_filt_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_filt_indir_rec_t *)nrecord)->len) < 0) + if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, ((const H5HF_huge_bt2_filt_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_filt_indir_rec_t *)nrecord)->len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free space for huge object on disk") /* Set the length of the object removed */ @@ -691,7 +691,7 @@ H5HF__huge_bt2_dir_remove(const void *nrecord, void *_udata) FUNC_ENTER_PACKAGE /* Free the space in the file for the object being removed */ - if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->len) < 0) + if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free space for huge object on disk") /* Set the length of the object removed */ @@ -903,7 +903,7 @@ H5HF__huge_bt2_filt_dir_remove(const void *nrecord, void *_udata) FUNC_ENTER_PACKAGE /* Free the space in the file for the object being removed */ - if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->len) < 0) + if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free space for huge object on disk") /* Set the length of the object removed */ diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 069bf17..6572720 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -79,9 +79,8 @@ static htri_t H5HF__cache_hdr_verify_chksum(const void *image_ptr, size_t len, v static void *H5HF__cache_hdr_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5HF__cache_hdr_image_len(const void *thing, size_t *image_len); -static herr_t H5HF__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, - unsigned *flags); +static herr_t H5HF__cache_hdr_pre_serialize(H5F_t *f, void *thing, haddr_t addr, + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5HF__cache_hdr_free_icr(void *thing); @@ -91,9 +90,8 @@ static htri_t H5HF__cache_iblock_verify_chksum(const void *image_ptr, size_t len static void *H5HF__cache_iblock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5HF__cache_iblock_image_len(const void *thing, size_t *image_len); -static herr_t H5HF__cache_iblock_pre_serialize(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, - unsigned *flags); +static herr_t H5HF__cache_iblock_pre_serialize(H5F_t *f, void *thing, + haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_iblock_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *thing); @@ -104,26 +102,26 @@ static htri_t H5HF__cache_dblock_verify_chksum(const void *image_ptr, size_t len static void *H5HF__cache_dblock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5HF__cache_dblock_image_len(const void *thing, size_t *image_len); -static herr_t H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, - unsigned *flags); +static herr_t H5HF__cache_dblock_pre_serialize(H5F_t *f, void *thing, haddr_t addr, + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_dblock_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5HF__cache_dblock_notify(H5AC_notify_action_t action, void *thing); static herr_t H5HF__cache_dblock_free_icr(void *thing); +static herr_t H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size); /* 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_hdr_descendants_clean(H5F_t *f, 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); + 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, + haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, hbool_t *has_iblocks); #endif /* NDEBUG */ @@ -183,7 +181,7 @@ const H5AC_class_t H5AC_FHEAP_DBLOCK[1] = {{ H5HF__cache_dblock_serialize, /* 'serialize' callback */ H5HF__cache_dblock_notify, /* 'notify' callback */ H5HF__cache_dblock_free_icr, /* 'free_icr' callback */ - NULL, /* 'fsf_size' callback */ + H5HF__cache_dblock_fsf_size, /* 'fsf_size' callback */ }}; @@ -572,7 +570,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, UINT32DECODE(image, hdr->pline_root_direct_filter_mask); /* Decode I/O filter information */ - if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, udata->dxpl_id, NULL, H5O_PLINE_ID, image))) + if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, NULL, H5O_PLINE_ID, image))) HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, NULL, "can't decode I/O pipeline filters") /* Advance past filter info to checksum */ @@ -665,9 +663,9 @@ H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HF__cache_hdr_pre_serialize(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, - void *_thing, haddr_t addr, size_t len, haddr_t H5_ATTR_UNUSED *new_addr, - size_t H5_ATTR_UNUSED *new_len, unsigned *flags) +H5HF__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, + haddr_t H5_ATTR_UNUSED *new_addr, size_t H5_ATTR_UNUSED *new_len, + unsigned *flags) { H5HF_hdr_t *hdr = (H5HF_hdr_t *)_thing; /* Fractal heap info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -716,7 +714,7 @@ H5HF__cache_hdr_pre_serialize(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, * 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, &fd_children_clean, &descendants_clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify hdr descendants clean.") HDassert(fd_children_clean); } @@ -1044,7 +1042,10 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, /* this copy of the parent pointer is needed by the notify callback so */ /* that it can take down flush dependencies on eviction even if */ /* the parent pointer has been nulled out. JRM -- 5/18/14 */ - iblock->fd_parent = udata->par_info->iblock; + if(udata->par_info->iblock) + iblock->fd_parent = udata->par_info->iblock; + else + iblock->fd_parent = udata->par_info->hdr; iblock->par_entry = udata->par_info->entry; if(iblock->parent) { /* Share parent block */ @@ -1203,9 +1204,9 @@ H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HF__cache_iblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, - haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t *new_addr, - size_t H5_ATTR_UNUSED *new_len, unsigned *flags) +H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, + size_t H5_ATTR_UNUSED len, haddr_t *new_addr, size_t H5_ATTR_UNUSED *new_len, + unsigned *flags) { H5HF_hdr_t *hdr; /* Shared fractal heap information */ H5HF_indirect_t *iblock = (H5HF_indirect_t *)_thing; /* Indirect block info */ @@ -1247,7 +1248,7 @@ 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->addr, iblock, &iblock_status, &fd_children_clean, &descendants_clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify descendants clean.") HDassert(fd_children_clean); } @@ -1260,14 +1261,14 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, haddr_t iblock_addr; /* Allocate 'normal' space for the new indirect block on disk */ - if(HADDR_UNDEF == (iblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + if(HADDR_UNDEF == (iblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_IBLOCK, (hsize_t)iblock->size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") /* Sanity check */ HDassert(!H5F_addr_eq(iblock->addr, iblock_addr)); /* Let the metadata cache know the block moved */ - if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_IBLOCK, iblock->addr, iblock_addr, dxpl_id) < 0) + if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_IBLOCK, iblock->addr, iblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move indirect block") /* Update the internal address for the block */ @@ -1459,9 +1460,6 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); HDassert(iblock->hdr); - if(action == H5AC_NOTIFY_ACTION_BEFORE_EVICT) - HDassert((iblock->parent == iblock->fd_parent) || ((NULL == iblock->parent) && (iblock->fd_parent))); - /* further sanity checks */ if(iblock->parent == NULL) { /* pointer from hdr to root iblock will not be set up unless */ @@ -1492,16 +1490,10 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: case H5AC_NOTIFY_ACTION_AFTER_LOAD: - if(iblock->parent) { /* this is a child iblock */ - /* create flush dependency with parent iblock */ - if(H5AC_create_flush_dependency(iblock->parent, iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") - } /* end if */ - else { /* this is the root iblock */ - /* create flush dependency with header */ - if(H5AC_create_flush_dependency(iblock->hdr, iblock) < 0) + /* Create flush dependency with parent, if there is one */ + if(iblock->fd_parent) + if(H5AC_create_flush_dependency(iblock->fd_parent, iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") - } /* end else */ break; case H5AC_NOTIFY_ACTION_AFTER_FLUSH: @@ -1515,16 +1507,12 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) break; case H5AC_NOTIFY_ACTION_BEFORE_EVICT: - if(iblock->fd_parent) { /* this is a child iblock */ - /* destroy flush dependency with parent iblock */ + if(iblock->fd_parent) { + /* Destroy flush dependency with parent */ if(H5AC_destroy_flush_dependency(iblock->fd_parent, iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + iblock->fd_parent = NULL; } /* end if */ - else { /* this is the root iblock */ - /* destroy flush dependency with header */ - if(H5AC_destroy_flush_dependency(iblock->hdr, iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - } /* end else */ break; default: @@ -1890,7 +1878,10 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, /* Address of parent block */ dblock->parent = par_info->iblock; - dblock->fd_parent = par_info->iblock; + if(par_info->iblock) + dblock->fd_parent = par_info->iblock; + else + dblock->fd_parent = par_info->hdr; dblock->par_entry = par_info->entry; if(dblock->parent) { /* Share parent block */ @@ -2080,7 +2071,7 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, +H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags) { hbool_t at_tmp_addr; /* Flag to indicate direct block is */ @@ -2257,11 +2248,11 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, */ if(!at_tmp_addr) /* Release direct block's current disk space */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)hdr->pline_root_direct_size) < 0) + if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, addr, (hsize_t)hdr->pline_root_direct_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") /* Allocate space for the compressed direct block */ - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") /* Update information about compressed direct block's @@ -2309,11 +2300,11 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, */ if(!at_tmp_addr) /* Release direct block's current disk space */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)par_iblock->filt_ents[par_entry].size) < 0) + if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, addr, (hsize_t)par_iblock->filt_ents[par_entry].size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") /* Allocate space for the compressed direct block */ - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") /* Update information about compressed direct block's @@ -2353,7 +2344,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, */ if(at_tmp_addr) { /* Allocate 'normal' space for the direct block */ - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") /* Check for root direct block */ @@ -2512,23 +2503,14 @@ H5HF__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); HDassert(dblock->hdr); - HDassert((dblock->fd_parent) || - ((dblock->hdr->man_dtable.curr_root_rows == 0) && (dblock->block_off == (hsize_t)0))); switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: case H5AC_NOTIFY_ACTION_AFTER_LOAD: - HDassert(dblock->parent == dblock->fd_parent); - if(dblock->parent) { /* this is a leaf dblock */ - /* create flush dependency with parent iblock */ - if(H5AC_create_flush_dependency(dblock->parent, dblock) < 0) + /* Create flush dependency with parent, if there is one */ + if(dblock->fd_parent) + if(H5AC_create_flush_dependency(dblock->fd_parent, dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") - } /* end if */ - else { /* this is a root dblock */ - /* create flush dependency with header */ - if(H5AC_create_flush_dependency(dblock->hdr, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") - } /* end else */ break; case H5AC_NOTIFY_ACTION_AFTER_FLUSH: @@ -2542,18 +2524,12 @@ H5HF__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) break; case H5AC_NOTIFY_ACTION_BEFORE_EVICT: - HDassert((dblock->parent == dblock->fd_parent) || - ((NULL == dblock->parent) && (dblock->fd_parent))); - if(dblock->fd_parent) { /* this is a leaf dblock */ - /* destroy flush dependency with parent iblock */ + if(dblock->fd_parent) { + /* Destroy flush dependency with parent */ if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + dblock->fd_parent = NULL; } /* end if */ - else { /* this is a root dblock */ - /* destroy flush dependency with header */ - if(H5AC_destroy_flush_dependency(dblock->hdr, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - } /* end else */ break; default: @@ -2606,6 +2582,42 @@ done: } /* end H5HF__cache_dblock_free_icr() */ +/*------------------------------------------------------------------------- + * Function: H5HF__cache_dblock_fsf_size + * + * Purpose: Tell the metadata cache the actual amount of file space + * to free when a dblock entry is destroyed with the free + * file space flag set. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * 1/5/18 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) +{ + const H5HF_direct_t *dblock = (const H5HF_direct_t *)_thing; /* Fractal heap direct block */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(dblock); + HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); + HDassert(dblock->file_size > 0); + HDassert(fsf_size); + + /* Set free space in file size */ + *fsf_size = dblock->file_size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HF__cache_dblock_fsf_size() */ + + /*------------------------------------------------------------------------ * Function: H5HF__cache_verify_hdr_descendants_clean * @@ -2671,8 +2683,8 @@ 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 *fd_clean, hbool_t *clean) { hbool_t fd_exists = FALSE; /* whether flush dependency exists. */ haddr_t hdr_addr; /* Address of header */ @@ -2793,19 +2805,19 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, * 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. + * The tag specified in the API context we received + * as a parameter (via API context) may not be correct. * Grab the (hopefully) correct tag from the header, - * and load it into the dxpl via the H5_BEGIN_TAG and + * and load it into the API context 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) + H5_BEGIN_TAG(hdr->heap_addr) - if(NULL == (root_iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) + if(NULL == (root_iblock = (H5HF_indirect_t *)H5AC_protect(f, 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) + H5_END_TAG unprotect_root_iblock = TRUE; } /* end if */ @@ -2867,19 +2879,19 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, * 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. + * The tag associated specified in the API context we received + * as a parameter (via API context) may not be correct. * Grab the (hopefully) correct tag from the header, - * and load it into the dxpl via the H5_BEGIN_TAG and + * and load it into the API context 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) + H5_BEGIN_TAG(hdr->heap_addr) - if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) + if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(f, 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) + H5_END_TAG unprotect_root_iblock = TRUE; HDassert(iblock == root_iblock); @@ -2893,13 +2905,13 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, 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) + if(H5HF__cache_verify_iblock_descendants_clean(f, 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) + if(H5AC_unprotect(f, 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 */ @@ -3036,9 +3048,9 @@ 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, 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; @@ -3060,7 +3072,7 @@ H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, hid_t dxpl_id, 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((*fd_clean) && H5HF__cache_verify_descendant_iblocks_clean(f, dxpl_id, fd_parent_addr, iblock, fd_clean, clean, &has_iblocks) < 0) + if((*fd_clean) && H5HF__cache_verify_descendant_iblocks_clean(f, 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 */ @@ -3318,9 +3330,9 @@ 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, - hbool_t *clean, hbool_t *has_iblocks) +H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, 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; @@ -3442,23 +3454,23 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, /* 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) */ + /* The tag associated specified in the API context */ + /* we received as a parameter (via API context) */ /* may not be correct. */ /* */ /* Grab the (hopefully) correct tag from the */ - /* parent iblock, and load it into the dxpl */ + /* parent iblock, and load it into the API context */ /* 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) + H5_BEGIN_TAG(iblock->hdr->heap_addr) - if(NULL == (child_iblock = (H5HF_indirect_t *) H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, child_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) + if(NULL == (child_iblock = (H5HF_indirect_t *) H5AC_protect(f, 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) + H5_END_TAG unprotect_child_iblock = TRUE; } /* end if */ @@ -3489,7 +3501,7 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, 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) + if(H5HF__cache_verify_iblock_descendants_clean(f, 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 @@ -3506,7 +3518,7 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, /* 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) + if(H5AC_unprotect(f, 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 */ diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 279de1e..70dfeed 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -111,7 +111,7 @@ static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, *------------------------------------------------------------------------- */ herr_t -H5HF_id_print(H5HF_t *fh, hid_t dxpl_id, const void *_id, FILE *stream, int indent, int fwidth) +H5HF_id_print(H5HF_t *fh, const void *_id, FILE *stream, int indent, int fwidth) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -154,11 +154,11 @@ HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") } /* end else */ /* Get the length of the heap object */ - if(H5HF_get_obj_len(fh, dxpl_id, id, &obj_len) < 0) + if(H5HF_get_obj_len(fh, id, &obj_len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length") /* Get the offset of the heap object */ - if(H5HF_get_obj_off(fh, dxpl_id, id, &obj_off) < 0) + if(H5HF_get_obj_off(fh, id, &obj_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length") /* Display the heap ID */ @@ -257,7 +257,7 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi *------------------------------------------------------------------------- */ void -H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE *stream, int indent, int fwidth) +H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int indent, int fwidth) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -341,8 +341,7 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE "Filter mask for root direct block:", hdr->pline_root_direct_filter_mask); } /* end if */ - H5O_debug_id(H5O_PLINE_ID, hdr->f, dxpl_id, &(hdr->pline), stream, - indent + 3, MAX(0, fwidth - 3)); + H5O_debug_id(H5O_PLINE_ID, hdr->f, &(hdr->pline), stream, indent + 3, MAX(0, fwidth - 3)); } /* end if */ /* Print internal (runtime) information, if requested */ @@ -378,7 +377,7 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth) +H5HF_hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -395,14 +394,14 @@ H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(fwidth >= 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5HF__hdr_protect(f, addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Print the information about the heap's header */ - H5HF_hdr_print(hdr, dxpl_id, FALSE, stream, indent, fwidth); + H5HF_hdr_print(hdr, FALSE, stream, indent, fwidth); done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) @@ -507,8 +506,8 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) *------------------------------------------------------------------------- */ herr_t -H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, - int indent, int fwidth, haddr_t hdr_addr, size_t block_size) +H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, + haddr_t hdr_addr, size_t block_size) { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ H5HF_direct_t *dblock = NULL; /* Fractal heap direct block info */ @@ -531,13 +530,13 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDassert(block_size > 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5HF__hdr_protect(f, hdr_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* * Load the heap direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, addr, block_size, NULL, 0, H5AC__READ_ONLY_FLAG))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, addr, block_size, NULL, 0, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap direct block") /* Print opening message */ @@ -562,7 +561,7 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Initialize the free space information for the heap */ - if(H5HF_space_start(hdr, dxpl_id, FALSE) < 0) + if(H5HF__space_start(hdr, FALSE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space") /* If there is a free space manager for the heap, check for sections that overlap this block */ @@ -583,11 +582,11 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDfprintf(stream, "%*sFree Blocks (offset, size):\n", indent, ""); /* Iterate over the free space sections, to detect overlaps with this block */ - if(H5FS_sect_iterate(f, dxpl_id, hdr->fspace, H5HF_dblock_debug_cb, &udata) < 0) + if(H5FS_sect_iterate(f, hdr->fspace, H5HF_dblock_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(H5HF_space_close(hdr, dxpl_id) < 0) + if(H5HF__space_close(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") /* Keep the amount of space free */ @@ -610,9 +609,9 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, H5_buffer_dump(stream, indent, dblock->blk, marker, (size_t)0, dblock->size); done: - if(dblock && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_DBLOCK, addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5AC_unprotect(f, H5AC_FHEAP_DBLOCK, addr, dblock, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap direct block") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") H5MM_xfree(marker); @@ -766,8 +765,8 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, *------------------------------------------------------------------------- */ herr_t -H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, - int indent, int fwidth, haddr_t hdr_addr, unsigned nrows) +H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, + haddr_t hdr_addr, unsigned nrows) { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ H5HF_indirect_t *iblock = NULL; /* Fractal heap direct block info */ @@ -788,22 +787,22 @@ H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDassert(nrows > 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5HF__hdr_protect(f, hdr_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* * Load the heap indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, addr, nrows, NULL, 0, FALSE, H5AC__READ_ONLY_FLAG, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, addr, nrows, NULL, 0, FALSE, H5AC__READ_ONLY_FLAG, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block") /* Print the information about the heap's indirect block */ H5HF_iblock_print(iblock, FALSE, stream, indent, fwidth); done: - if(iblock && H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(iblock && H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap direct block") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) @@ -879,8 +878,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, - FILE *stream, int indent, int fwidth) +H5HF_sects_debug(H5F_t *f, haddr_t fh_addr, FILE *stream, int indent, + int fwidth) { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -897,11 +896,11 @@ H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, HDassert(fwidth >= 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Initialize the free space information for the heap */ - if(H5HF_space_start(hdr, dxpl_id, FALSE) < 0) + if(H5HF__space_start(hdr, FALSE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space") /* If there is a free space manager for the heap, iterate over them */ @@ -915,16 +914,16 @@ H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, udata.fwidth = fwidth; /* Iterate over all the free space sections */ - if(H5FS_sect_iterate(f, dxpl_id, hdr->fspace, H5HF_sects_debug_cb, &udata) < 0) + if(H5FS_sect_iterate(f, hdr->fspace, H5HF_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(H5HF_space_close(hdr, dxpl_id) < 0) + if(H5HF__space_close(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") } /* end if */ done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 4496962..a6560e2 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -79,7 +79,7 @@ H5FL_DEFINE(H5HF_direct_t); /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_create + * Function: H5HF__man_dblock_create * * Purpose: Allocate & initialize a managed direct block * @@ -92,7 +92,7 @@ H5FL_DEFINE(H5HF_direct_t); *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, +H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned par_entry, haddr_t *addr_p, H5HF_free_section_t **ret_sec_node) { H5HF_free_section_t *sec_node; /* Pointer to free space section for block */ @@ -101,7 +101,7 @@ H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblo size_t free_space; /* Free space in new block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -155,16 +155,19 @@ H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblo HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") } /* end if */ else { - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)dblock->size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)dblock->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") } /* end else */ /* Attach to parent indirect block, if there is one */ dblock->parent = par_iblock; - dblock->fd_parent = par_iblock; - if(dblock->parent) + if(dblock->parent) { if(H5HF_man_iblock_attach(dblock->parent, par_entry, dblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach direct block to parent indirect block") + dblock->fd_parent = par_iblock; + } /* end if */ + else + dblock->fd_parent = hdr; dblock->par_entry = par_entry; /* Create a new 'single' section for the free space in the block */ @@ -178,12 +181,12 @@ H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblo *ret_sec_node = sec_node; else { /* Add new free space to the heap's list of space */ - if(H5HF_space_add(hdr, dxpl_id, sec_node, 0) < 0) + if(H5HF__space_add(hdr, sec_node, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add direct block free space to global list") } /* end else */ /* Cache the new fractal heap direct block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add fractal heap direct block to cache") /* Increase the allocated heap size */ @@ -201,11 +204,11 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_create() */ +} /* end H5HF__man_dblock_create() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_destroy + * Function: H5HF__man_dblock_destroy * * Purpose: Destroy a managed direct block * @@ -222,14 +225,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, - haddr_t dblock_addr) +H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, + haddr_t dblock_addr, hbool_t *parent_removed) { hsize_t dblock_size; /* Size of direct block on disk */ unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting indirect block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -258,6 +261,10 @@ H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, else dblock_size = (hsize_t)dblock->size; + /* Reset the parent_removed flag */ + if(parent_removed) + *parent_removed = FALSE; + /* Check for root direct block */ if(hdr->man_dtable.curr_root_rows == 0) { /* Sanity check */ @@ -267,11 +274,8 @@ H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, /* Sanity check block iterator */ HDassert(!H5HF_man_iter_ready(&hdr->next_block)); - /* Reset root pointer information */ - hdr->man_dtable.table_addr = HADDR_UNDEF; - /* Reset header information back to "empty heap" state */ - if(H5HF_hdr_empty(hdr) < 0) + if(H5HF__hdr_empty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't make heap empty") } /* end if */ else { @@ -279,36 +283,32 @@ H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, hdr->man_alloc_size -= dblock->size; /* Check for this direct block being the highest in the heap */ - if((dblock->block_off + dblock->size) == hdr->man_iter_off) { + if((dblock->block_off + dblock->size) == hdr->man_iter_off) /* Move 'next block' iterator backwards (may shrink heap) */ - if(H5HF_hdr_reverse_iter(hdr, dxpl_id, dblock_addr) < 0) + if(H5HF__hdr_reverse_iter(hdr, dblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reverse 'next block' iterator") - } /* end if */ -#if 0 - else { - unsigned par_row, par_col; /* Row & column in parent indirect block */ - - /* Compute row & column in parent indirect block */ - par_row = dblock->par_entry / hdr->man_dtable.cparam.width; - par_col = dblock->par_entry % hdr->man_dtable.cparam.width; - - /* Add a 'range' section for the space in the destroyed block */ - if(H5HF_sect_range_add(hdr, dxpl_id, dblock->block_off, hdr->man_dtable.row_tot_dblock_free[par_row], - dblock->parent, par_row, par_col, 1) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't create range section for direct block being destroyed") - } /* end else */ -#endif /* 0 */ /* Detach from parent indirect block */ if(dblock->parent) { - if(H5HF_man_iblock_detach(dblock->parent, dxpl_id, dblock->par_entry) < 0) + /* Destroy flush dependency between direct block and parent */ + if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + dblock->fd_parent = NULL; + + /* If this is the last direct block for the indirect block, the + * indirect block will be removed when this direct block is detached + */ + if(parent_removed && 1 == dblock->parent->nchildren) + *parent_removed = TRUE; + + if(H5HF__man_iblock_detach(dblock->parent, dblock->par_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't detach from parent indirect block"); dblock->parent = NULL; dblock->par_entry = 0; } /* end if */ } /* end else */ - /* Indicate that the indirect block should be deleted */ + /* Indicate that the direct block should be deleted */ dblock->file_size = dblock_size; cache_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG; @@ -318,15 +318,15 @@ H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, done: /* Unprotect the indirect block, with appropriate flags */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, cache_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_destroy() */ +} /* end H5HF__man_dblock_destroy() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_new + * Function: H5HF__man_dblock_new * * Purpose: Create a direct block large enough to hold an object of * the requested size @@ -340,14 +340,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_new(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t request, +H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_sec_node) { haddr_t dblock_addr; /* Address of new direct block */ size_t min_dblock_size; /* Min. size of direct block to allocate */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -371,7 +371,7 @@ H5HF_man_dblock_new(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t request, if(!H5F_addr_defined(hdr->man_dtable.table_addr) && min_dblock_size == hdr->man_dtable.cparam.start_block_size) { /* Create new direct block at starting offset */ - if(H5HF_man_dblock_create(dxpl_id, hdr, NULL, 0, &dblock_addr, ret_sec_node) < 0) + if(H5HF__man_dblock_create(hdr, NULL, 0, &dblock_addr, ret_sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap direct block") /* Point root at new direct block */ @@ -394,7 +394,7 @@ H5HF_man_dblock_new(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t request, size_t next_size; /* Size of next direct block to create */ /* Update iterator to reflect any previous increments as well as allow for requested direct block size */ - if(H5HF_hdr_update_iter(hdr, dxpl_id, min_dblock_size) < 0) + if(H5HF__hdr_update_iter(hdr, min_dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUPDATE, FAIL, "unable to update block iterator") /* Retrieve information about current iterator position */ @@ -414,17 +414,17 @@ HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "skipping direct block sizes not su HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment 'next block' iterator") /* Create new direct block at current location*/ - if(H5HF_man_dblock_create(dxpl_id, hdr, iblock, next_entry, &dblock_addr, ret_sec_node) < 0) + if(H5HF__man_dblock_create(hdr, iblock, next_entry, &dblock_addr, ret_sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap direct block") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_new() */ +} /* end H5HF__man_dblock_new() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_protect + * Function: H5HF__man_dblock_protect * * Purpose: Convenience wrapper around H5AC_protect on a direct block * (Use H5AC_unprotect to unprotect it for now) @@ -438,7 +438,7 @@ done: *------------------------------------------------------------------------- */ H5HF_direct_t * -H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, +H5HF__man_dblock_protect(H5HF_hdr_t *hdr, haddr_t dblock_addr, size_t dblock_size, H5HF_indirect_t *par_iblock, unsigned par_entry, unsigned flags) { @@ -446,7 +446,7 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, H5HF_dblock_cache_ud_t udata; /* parent and other infor for deserializing direct block */ H5HF_direct_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -496,7 +496,7 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, udata.dblk = NULL; /* Protect the direct block */ - if(NULL == (dblock = (H5HF_direct_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, &udata, flags))) + if(NULL == (dblock = (H5HF_direct_t *)H5AC_protect(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, &udata, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap direct block") /* Set the return value */ @@ -504,11 +504,11 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_protect() */ +} /* end H5HF__man_dblock_protect() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_locate + * Function: H5HF__man_dblock_locate * * Purpose: Locate a direct block in a managed heap * @@ -521,7 +521,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, +H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_iblock, unsigned *ret_entry, hbool_t *ret_did_protect, unsigned flags) { @@ -532,7 +532,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, unsigned entry; /* Entry of block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -553,7 +553,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, iblock_addr = hdr->man_dtable.table_addr; /* Lock root indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, hdr->man_dtable.curr_root_rows, NULL, 0, FALSE, flags, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, hdr->man_dtable.curr_root_rows, NULL, 0, FALSE, flags, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Check for indirect block row */ @@ -575,7 +575,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, /* Check if we need to (re-)create the child indirect block */ if(!H5F_addr_defined(iblock_addr)) { - if(H5HF_man_iblock_create(hdr, dxpl_id, iblock, entry, nrows, nrows, &iblock_addr) < 0) + if(H5HF__man_iblock_create(hdr, iblock, entry, nrows, nrows, &iblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap indirect block") /* Indicate that the parent indirect block was modified */ @@ -583,11 +583,11 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, } /* end if */ /* Lock child indirect block */ - if(NULL == (new_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, iblock, entry, FALSE, flags, &new_did_protect))) + if(NULL == (new_iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, iblock, entry, FALSE, flags, &new_did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Release the current indirect block */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, cache_flags, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, cache_flags, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") /* Switch variables to use new indirect block */ @@ -608,17 +608,17 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_locate() */ +} /* end H5HF__man_dblock_locate() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_delete + * Function: H5HF__man_dblock_delete * * Purpose: Delete a managed direct block * * Note: This routine does _not_ modify any indirect block that points * to this direct block, it is assumed that the whole heap is - * being deleted. (H5HF_man_dblock_destroy modifies the indirect + * being deleted. (H5HF__man_dblock_destroy modifies the indirect * block) * * Return: SUCCEED/FAIL @@ -630,19 +630,19 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_delete(H5F_t *f, hid_t dxpl_id, haddr_t dblock_addr, - hsize_t dblock_size) +H5HF__man_dblock_delete(H5F_t *f, haddr_t dblock_addr, hsize_t dblock_size) { unsigned dblock_status = 0; /* Direct block's status in the metadata cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. */ HDassert(f); HDassert(H5F_addr_defined(dblock_addr)); + HDassert(dblock_size > 0); /* Check the direct block's status in the metadata cache */ if(H5AC_get_entry_status(f, dblock_addr, &dblock_status) < 0) @@ -655,13 +655,13 @@ H5HF_man_dblock_delete(H5F_t *f, hid_t dxpl_id, haddr_t dblock_addr, HDassert(!(dblock_status & H5AC_ES__IS_PROTECTED)); /* Evict the direct block from the metadata cache */ - if(H5AC_expunge_entry(f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_FHEAP_DBLOCK, dblock_addr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "unable to remove direct block from cache") } /* end if */ /* Check if the direct block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ - if(!H5F_IS_TMP_ADDR(f, dblock_addr)) { + if(!H5F_IS_TMP_ADDR(f, dblock_addr)) /* Release direct block's disk space */ /* (XXX: Under the best of circumstances, this block's space in the file * would be freed in the H5AC_expunge_entry() call above (and the @@ -671,18 +671,14 @@ H5HF_man_dblock_delete(H5F_t *f, hid_t dxpl_id, haddr_t dblock_addr, * "file_size" field for the direct block structure. In order to * do that, we'd have to protect/unprotect the direct block and * that would add a bunch of unnecessary overhead to the process, - * so we just release the file space here, directly. When the - * revised metadata cache is operating, it will "know" the file - * size of each entry in the cache and we can the the - * H5AC_expunge_entry() method. -QAK) + * so we just release the file space here, directly. -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, dblock_addr, dblock_size) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") - } /* end if */ + if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dblock_addr, dblock_size) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block file space") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_delete() */ +} /* end H5HF__man_dblock_delete() */ /*------------------------------------------------------------------------- @@ -715,7 +711,7 @@ H5HF_man_dblock_dest(H5HF_direct_t *dblock) if(H5HF_hdr_decr(dblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if(dblock->parent) - if(H5HF_iblock_decr(dblock->parent) < 0) + if(H5HF__iblock_decr(dblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") /* Free block's buffer */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 2f01ce6..9394fc0 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -337,7 +337,7 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) +H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) { H5HF_hdr_t *hdr = NULL; /* The new fractal heap header information */ size_t dblock_overhead; /* Direct block's overhead */ @@ -495,11 +495,11 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not large enough to hold all managed blocks") /* Allocate space for the header on disk */ - if(HADDR_UNDEF == (hdr->heap_addr = H5MF_alloc(f, H5FD_MEM_FHEAP_HDR, dxpl_id, (hsize_t)hdr->heap_size))) + if(HADDR_UNDEF == (hdr->heap_addr = H5MF_alloc(f, H5FD_MEM_FHEAP_HDR, (hsize_t)hdr->heap_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for fractal heap header") /* Cache the new fractal heap header */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, HADDR_UNDEF, "can't add fractal heap header to cache") /* Set address of heap header to return */ @@ -515,7 +515,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_protect + * Function: H5HF__hdr_protect * * Purpose: Convenience wrapper around H5AC_protect on an indirect block * @@ -528,13 +528,13 @@ done: *------------------------------------------------------------------------- */ H5HF_hdr_t * -H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) +H5HF__hdr_protect(H5F_t *f, haddr_t addr, unsigned flags) { H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ H5HF_hdr_t *hdr; /* Fractal heap header */ H5HF_hdr_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(f); @@ -545,10 +545,9 @@ H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) /* Set up userdata for protect call */ cache_udata.f = f; - cache_udata.dxpl_id = dxpl_id; /* Lock the heap header into memory */ - if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, addr, &cache_udata, flags))) + if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, H5AC_FHEAP_HDR, addr, &cache_udata, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header") /* Set the header's address */ @@ -562,7 +561,7 @@ H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_protect() */ +} /* end H5HF__hdr_protect() */ /*------------------------------------------------------------------------- @@ -921,7 +920,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_skip_blocks + * Function: H5HF__hdr_skip_blocks * * Purpose: Add skipped direct blocks to free space for heap * @@ -934,14 +933,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_skip_blocks(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *iblock, +H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries) { unsigned row, col; /* Row & column of entry */ hsize_t sect_size; /* Size of section in heap space */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -961,16 +960,16 @@ H5HF_hdr_skip_blocks(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *iblock, HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't increase allocated heap size") /* Add 'indirect' section for blocks skipped in this row */ - if(H5HF_sect_indirect_add(hdr, dxpl_id, iblock, start_entry, nentries) < 0) + if(H5HF__sect_indirect_add(hdr, iblock, start_entry, nentries) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section for indirect block's free space") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_skip_blocks() */ +} /* end H5HF__hdr_skip_blocks() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_update_iter + * Function: H5HF__hdr_update_iter * * Purpose: Update state of heap to account for current iterator * position. @@ -986,11 +985,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) +H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1000,7 +999,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) /* Check for creating first indirect block */ if(hdr->man_dtable.curr_root_rows == 0) { - if(H5HF_man_iblock_root_create(hdr, dxpl_id, min_dblock_size) < 0) + if(H5HF__man_iblock_root_create(hdr, min_dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "unable to create root indirect block") } /* end if */ else { @@ -1016,7 +1015,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) /* Initialize block iterator, if necessary */ if(!H5HF_man_iter_ready(&hdr->next_block)) { /* Start iterator with previous offset of iterator */ - if(H5HF_man_iter_start_offset(hdr, dxpl_id, &hdr->next_block, hdr->man_iter_off) < 0) + if(H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location") } /* end if */ @@ -1037,7 +1036,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) skip_entries = min_entry - next_entry; /* Add skipped direct blocks to heap's free space */ - if(H5HF_hdr_skip_blocks(hdr, dxpl_id, iblock, next_entry, skip_entries) < 0) + if(H5HF__hdr_skip_blocks(hdr, iblock, next_entry, skip_entries) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") /* Get information about new iterator location */ @@ -1054,7 +1053,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) while(next_row >= iblock->nrows) { /* Check for needing to expand root indirect block */ if(iblock->parent == NULL) { - if(H5HF_man_iblock_root_double(hdr, dxpl_id, min_dblock_size) < 0) + if(H5HF__man_iblock_root_double(hdr, min_dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "unable to double root indirect block") } /* end if */ else { @@ -1099,7 +1098,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) child_entry = iblock->nrows * hdr->man_dtable.cparam.width; /* Add skipped indirect blocks to heap's free space */ - if(H5HF_hdr_skip_blocks(hdr, dxpl_id, iblock, next_entry, (child_entry - next_entry)) < 0) + if(H5HF__hdr_skip_blocks(hdr, iblock, next_entry, (child_entry - next_entry)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") } /* end if */ else { @@ -1108,11 +1107,11 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) haddr_t new_iblock_addr; /* New indirect block's address */ /* Allocate new indirect block */ - if(H5HF_man_iblock_create(hdr, dxpl_id, iblock, next_entry, child_nrows, child_nrows, &new_iblock_addr) < 0) + if(H5HF__man_iblock_create(hdr, iblock, next_entry, child_nrows, child_nrows, &new_iblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap indirect block") /* Lock new indirect block */ - if(NULL == (new_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, new_iblock_addr, child_nrows, iblock, next_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (new_iblock = H5HF__man_iblock_protect(hdr, new_iblock_addr, child_nrows, iblock, next_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Move iterator down one level (pins indirect block) */ @@ -1127,12 +1126,12 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) new_entry = hdr->man_dtable.cparam.width * min_dblock_row; /* Add skipped blocks to heap's free space */ - if(H5HF_hdr_skip_blocks(hdr, dxpl_id, new_iblock, 0, new_entry) < 0) + if(H5HF__hdr_skip_blocks(hdr, new_iblock, 0, new_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") } /* end if */ /* Unprotect child indirect block */ - if(H5HF_man_iblock_unprotect(new_iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(new_iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") } /* end else */ @@ -1148,7 +1147,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_update_iter() */ +} /* end H5HF__hdr_update_iter() */ /*------------------------------------------------------------------------- @@ -1191,7 +1190,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_reverse_iter + * Function: H5HF__hdr_reverse_iter * * Purpose: Walk "next block" iterator backwards until the correct * location to allocate next block from is found @@ -1205,7 +1204,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) +H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) { H5HF_indirect_t *iblock; /* Indirect block where iterator is located */ unsigned curr_entry; /* Current entry for iterator */ @@ -1213,7 +1212,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) hbool_t walked_up; /* Loop flag */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1223,7 +1222,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) /* Initialize block iterator, if necessary */ if(!H5HF_man_iter_ready(&hdr->next_block)) /* Start iterator with previous offset of iterator */ - if(H5HF_man_iter_start_offset(hdr, dxpl_id, &hdr->next_block, hdr->man_iter_off) < 0) + if(H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location") /* Walk backwards through heap, looking for direct block to place iterator after */ @@ -1306,7 +1305,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[row]); /* Lock child indirect block */ - if(NULL == (child_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock->ents[curr_entry].addr, child_nrows, iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (child_iblock = H5HF__man_iblock_protect(hdr, iblock->ents[curr_entry].addr, child_nrows, iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Set the current location of the iterator */ @@ -1322,7 +1321,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) curr_entry = (child_iblock->nrows * hdr->man_dtable.cparam.width) - 1; /* Unprotect child indirect block */ - if(H5HF_man_iblock_unprotect(child_iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(child_iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") /* Note that we walked down */ @@ -1333,11 +1332,11 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_reverse_iter() */ +} /* end H5HF__hdr_reverse_iter() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_empty + * Function: H5HF__hdr_empty * * Purpose: Reset heap header to 'empty heap' state * @@ -1350,11 +1349,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_empty(H5HF_hdr_t *hdr) +H5HF__hdr_empty(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -1369,6 +1368,10 @@ H5HF_hdr_empty(H5HF_hdr_t *hdr) hdr->man_size = 0; hdr->man_alloc_size = 0; + /* Reset root pointer information */ + hdr->man_dtable.curr_root_rows = 0; + hdr->man_dtable.table_addr = HADDR_UNDEF; + /* Reset the 'next block' iterator location */ hdr->man_iter_off = 0; @@ -1381,7 +1384,7 @@ H5HF_hdr_empty(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_empty() */ +} /* end H5HF__hdr_empty() */ /*------------------------------------------------------------------------- @@ -1427,7 +1430,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_delete + * Function: H5HF__hdr_delete * * Purpose: Delete a fractal heap, starting with the header * @@ -1440,12 +1443,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__hdr_delete(H5HF_hdr_t *hdr) { unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting heap header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1471,35 +1474,35 @@ H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) /* (must occur before attempting to delete the heap, so indirect blocks * will get unpinned) */ - if(H5F_addr_defined(hdr->fs_addr)) { + if(H5F_addr_defined(hdr->fs_addr)) /* Delete free space manager for heap */ - if(H5HF_space_delete(hdr, dxpl_id) < 0) + if(H5HF__space_delete(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap free space manager") - } /* end if */ /* Check for root direct/indirect block */ if(H5F_addr_defined(hdr->man_dtable.table_addr)) { if(hdr->man_dtable.curr_root_rows == 0) { - hsize_t dblock_size; /* Size of direct block */ + hsize_t dblock_size; /* Size of direct block on disk */ /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { - dblock_size = (hsize_t)hdr->pline_root_direct_size; + /* Set the dblock's size */ + dblock_size = hdr->pline_root_direct_size; /* Reset the header's pipeline information */ hdr->pline_root_direct_size = 0; hdr->pline_root_direct_filter_mask = 0; - } /* end else */ + } /* end if */ else - dblock_size = (hsize_t)hdr->man_dtable.cparam.start_block_size; + dblock_size = hdr->man_dtable.cparam.start_block_size; /* Delete root direct block */ - if(H5HF_man_dblock_delete(hdr->f, dxpl_id, hdr->man_dtable.table_addr, dblock_size) < 0) + if(H5HF__man_dblock_delete(hdr->f, hdr->man_dtable.table_addr, dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap root direct block") } /* end if */ else { /* Delete root indirect block */ - if(H5HF_man_iblock_delete(hdr, dxpl_id, hdr->man_dtable.table_addr, hdr->man_dtable.curr_root_rows, NULL, 0) < 0) + if(H5HF__man_iblock_delete(hdr, hdr->man_dtable.table_addr, hdr->man_dtable.curr_root_rows, NULL, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap root indirect block") } /* end else */ } /* end if */ @@ -1507,7 +1510,7 @@ H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) /* Check for 'huge' objects in heap */ if(H5F_addr_defined(hdr->huge_bt2_addr)) { /* Delete huge objects in heap and their tracker */ - if(H5HF_huge_delete(hdr, dxpl_id) < 0) + if(H5HF__huge_delete(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap 'huge' objects and tracker") } /* end if */ @@ -1516,9 +1519,9 @@ H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) done: /* Unprotect the header with appropriate flags */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, cache_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_delete() */ +} /* end H5HF__hdr_delete() */ diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index 350100e..6e475ad 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -64,12 +64,12 @@ /********************/ /* Local v2 B-tree operations */ -static herr_t H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id); +static herr_t H5HF__huge_bt2_create(H5HF_hdr_t *hdr); /* Local 'huge' object support routines */ static hsize_t H5HF_huge_new_id(H5HF_hdr_t *hdr); -static herr_t H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, - const uint8_t *id, hbool_t is_read, H5HF_operator_t op, void *op_data); +static herr_t H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, + hbool_t is_read, H5HF_operator_t op, void *op_data); /*********************/ @@ -88,7 +88,7 @@ static herr_t H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, /*------------------------------------------------------------------------- - * Function: H5HF_huge_bt2_create + * Function: H5HF__huge_bt2_create * * Purpose: Create the v2 B-tree for tracking the huge objects in the heap * @@ -101,12 +101,12 @@ static herr_t H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__huge_bt2_create(H5HF_hdr_t *hdr) { H5B2_create_t bt2_cparam; /* v2 B-tree creation parameters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -155,7 +155,7 @@ H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id) bt2_cparam.merge_percent = H5HF_HUGE_BT2_MERGE_PERC; /* Create v2 B-tree for tracking 'huge' objects */ - if(NULL == (hdr->huge_bt2 = H5B2_create(hdr->f, dxpl_id, &bt2_cparam, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_create(hdr->f, &bt2_cparam, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "can't create v2 B-tree for tracking 'huge' heap objects") /* Retrieve the v2 B-tree's address in the file */ @@ -164,7 +164,7 @@ H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_bt2_create() */ +} /* end H5HF__huge_bt2_create() */ /*------------------------------------------------------------------------- @@ -291,7 +291,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_huge_insert + * Function: H5HF__huge_insert * * Purpose: Insert a 'huge' object into the file and track it * @@ -304,8 +304,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, - void *_id) +H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id) { uint8_t *id = (uint8_t *)_id; /* Pointer to ID buffer */ haddr_t obj_addr; /* Address of object in the file */ @@ -314,7 +313,7 @@ H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, unsigned filter_mask = 0; /* Filter mask for object (only used for filtered objects) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE #ifdef QAK HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); #endif /* QAK */ @@ -330,14 +329,14 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); /* Check if the v2 B-tree for tracking 'huge' heap objects has been created yet */ if(!H5F_addr_defined(hdr->huge_bt2_addr)) { /* Go create (& open) v2 B-tree */ - if(H5HF_huge_bt2_create(hdr, dxpl_id) < 0) + if(H5HF__huge_bt2_create(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "can't create v2 B-tree for tracking 'huge' heap objects") } /* end if */ else { /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ } /* end else */ @@ -377,11 +376,11 @@ HDfprintf(stderr, "%s: obj_size = %Zu, obj = %p\n", FUNC, obj_size, obj); } /* end else */ /* Allocate space in the file for storing the 'huge' object */ - if(HADDR_UNDEF == (obj_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, dxpl_id, (hsize_t)write_size))) + if(HADDR_UNDEF == (obj_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap huge object") /* Write the object's data to disk */ - if(H5F_block_write(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, write_size, H5AC_rawdata_dxpl_id, write_buf) < 0) + if(H5F_block_write(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, write_size, write_buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "writing 'huge' object to file failed") /* Release buffer for writing, if we had one */ @@ -405,7 +404,7 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu, %x, %Hu}\n", FUNC, obj_rec.addr, obj_ #endif /* QAK */ /* Insert record for object in v2 B-tree */ - if(H5B2_insert(hdr->huge_bt2, dxpl_id, &obj_rec) < 0) + if(H5B2_insert(hdr->huge_bt2, &obj_rec) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "couldn't insert object tracking record in v2 B-tree") /* Encode ID for user */ @@ -426,7 +425,7 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len); #endif /* QAK */ /* Insert record for object in v2 B-tree */ - if(H5B2_insert(hdr->huge_bt2, dxpl_id, &obj_rec) < 0) + if(H5B2_insert(hdr->huge_bt2, &obj_rec) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "couldn't insert object tracking record in v2 B-tree") /* Encode ID for user */ @@ -473,7 +472,7 @@ HDfprintf(stderr, "%s: indir_rec = {%a, %Hu, %Hu}\n", FUNC, indir_rec.addr, indi } /* end else */ /* Insert record for tracking object in v2 B-tree */ - if(H5B2_insert(hdr->huge_bt2, dxpl_id, ins_rec) < 0) + if(H5B2_insert(hdr->huge_bt2, ins_rec) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "couldn't insert object tracking record in v2 B-tree") /* Encode ID for user */ @@ -491,11 +490,11 @@ HDfprintf(stderr, "%s: indir_rec = {%a, %Hu, %Hu}\n", FUNC, indir_rec.addr, indi done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_insert() */ +} /* end H5HF__huge_insert() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_get_obj_len + * Function: H5HF__huge_get_obj_len * * Purpose: Get the size of a 'huge' object in a fractal heap * @@ -508,12 +507,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - size_t *obj_len_p) +H5HF__huge_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -547,7 +545,7 @@ H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ @@ -559,7 +557,7 @@ H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's length */ @@ -573,7 +571,7 @@ H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's length */ @@ -583,7 +581,7 @@ H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_get_obj_len() */ +} /* end H5HF__huge_get_obj_len() */ /*------------------------------------------------------------------------- @@ -600,13 +598,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - hsize_t *obj_off_p) +H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p) { haddr_t obj_addr; /* Object's address in the file */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -631,7 +628,7 @@ H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ @@ -643,7 +640,7 @@ H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -657,7 +654,7 @@ H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -674,7 +671,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_huge_op_real + * Function: H5HF__huge_op_real * * Purpose: Internal routine to perform an operation on a 'huge' object * @@ -687,8 +684,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - hbool_t is_read, H5HF_operator_t op, void *op_data) +H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is_read, + H5HF_operator_t op, void *op_data) { void *read_buf = NULL; /* Pointer to buffer for reading */ haddr_t obj_addr; /* Object's address in the file */ @@ -696,7 +693,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, unsigned filter_mask = 0; /* Filter mask for object (only used for filtered objects) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -725,7 +722,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ @@ -737,7 +734,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -753,7 +750,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -772,7 +769,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Read the object's (possibly filtered) data from the file */ /* (reads directly into application's buffer if no filters are present) */ - if(H5F_block_read(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, (size_t)obj_size, H5AC_rawdata_dxpl_id, read_buf) < 0) + if(H5F_block_read(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, (size_t)obj_size, read_buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_READERROR, FAIL, "can't read 'huge' object's data from the file") /* Check for I/O pipeline filter on heap */ @@ -816,11 +813,11 @@ done: read_buf = H5MM_xfree(read_buf); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_op_real() */ +} /* end H5HF__huge_op_real() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_write + * Function: H5HF__huge_write * * Purpose: Write a 'huge' object to the heap * @@ -838,14 +835,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - const void *obj) +H5HF__huge_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj) { haddr_t obj_addr; /* Object's address in the file */ size_t obj_size; /* Object's size in the file */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -877,7 +873,7 @@ H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ @@ -885,7 +881,7 @@ H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -895,16 +891,16 @@ H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Write the object's data to the file */ /* (writes directly from application's buffer) */ - if(H5F_block_write(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, obj_size, H5AC_rawdata_dxpl_id, obj) < 0) + if(H5F_block_write(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, obj_size, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "writing 'huge' object to file failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_write() */ +} /* end H5HF__huge_write() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_read + * Function: H5HF__huge_read * * Purpose: Read a 'huge' object from the heap * @@ -917,11 +913,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_read(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, void *obj) +H5HF__huge_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -931,16 +927,16 @@ H5HF_huge_read(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, void *obj) HDassert(obj); /* Call the internal 'op' routine */ - if(H5HF_huge_op_real(hdr, dxpl_id, id, TRUE, NULL, obj) < 0) + if(H5HF__huge_op_real(hdr, id, TRUE, NULL, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_read() */ +} /* end H5HF__huge_read() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_op + * Function: H5HF__huge_op * * Purpose: Operate directly on a 'huge' object * @@ -953,12 +949,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - H5HF_operator_t op, void *op_data) +H5HF__huge_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, + void *op_data) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -968,16 +964,16 @@ H5HF_huge_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, HDassert(op); /* Call the internal 'op' routine routine */ - if(H5HF_huge_op_real(hdr, dxpl_id, id, FALSE, op, op_data) < 0) + if(H5HF__huge_op_real(hdr, id, FALSE, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_op() */ +} /* end H5HF__huge_op() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_remove + * Function: H5HF__huge_remove * * Purpose: Remove a 'huge' object from the file and the v2 B-tree tracker * @@ -990,12 +986,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) +H5HF__huge_remove(H5HF_hdr_t *hdr, const uint8_t *id) { H5HF_huge_remove_ud_t udata; /* User callback data for v2 B-tree remove call */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1007,7 +1003,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ @@ -1016,7 +1012,6 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Set up the common callback info */ udata.hdr = hdr; - udata.dxpl_id = dxpl_id; /* Check for 'huge' object ID that encodes address & length directly */ if(hdr->huge_ids_direct) { @@ -1030,7 +1025,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_filt_dir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_filt_dir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end if */ else { @@ -1043,7 +1038,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_dir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_dir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end else */ } /* end if */ @@ -1056,7 +1051,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_filt_indir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_filt_indir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end if */ else { @@ -1067,7 +1062,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_indir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_indir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end else */ } /* end else */ @@ -1082,11 +1077,11 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_remove() */ +} /* end H5HF__huge_remove() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_term + * Function: H5HF__huge_term * * Purpose: Shut down the information for tracking 'huge' objects * @@ -1099,11 +1094,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__huge_term(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1116,7 +1111,7 @@ H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id) HDassert(H5F_addr_defined(hdr->huge_bt2_addr)); /* Close v2 B-tree index */ - if(H5B2_close(hdr->huge_bt2, dxpl_id) < 0) + if(H5B2_close(hdr->huge_bt2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree") hdr->huge_bt2 = NULL; } /* end if */ @@ -1130,7 +1125,7 @@ H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id) /* Delete the v2 B-tree */ /* (any v2 B-tree class will work here) */ - if(H5B2_delete(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f, NULL, NULL) < 0) + if(H5B2_delete(hdr->f, hdr->huge_bt2_addr, hdr->f, NULL, NULL) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "can't delete v2 B-tree") /* Reset the information about 'huge' objects in the file */ @@ -1145,11 +1140,11 @@ H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_term() */ +} /* end H5HF__huge_term() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_delete + * Function: H5HF__huge_delete * * Purpose: Delete all the 'huge' objects in the heap, and the v2 B-tree * tracker for them @@ -1163,13 +1158,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__huge_delete(H5HF_hdr_t *hdr) { H5HF_huge_remove_ud_t udata; /* User callback data for v2 B-tree remove call */ H5B2_remove_t op; /* Callback for v2 B-tree removal */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1181,7 +1176,6 @@ H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) /* Set up the callback info */ udata.hdr = hdr; - udata.dxpl_id = dxpl_id; /* Set the v2 B-tree callback operator */ if(hdr->huge_ids_direct) { @@ -1198,10 +1192,10 @@ H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) } /* end else */ /* Delete the v2 B-tree */ - if(H5B2_delete(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f, op, &udata) < 0) + if(H5B2_delete(hdr->f, hdr->huge_bt2_addr, hdr->f, op, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "can't delete v2 B-tree") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_delete() */ +} /* end H5HF__huge_delete() */ diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 11abce0..e5c2559 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -57,10 +57,10 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5HF_iblock_pin(H5HF_indirect_t *iblock); -static herr_t H5HF_iblock_unpin(H5HF_indirect_t *iblock); -static herr_t H5HF_man_iblock_root_halve(H5HF_indirect_t *root_iblock, hid_t dxpl_id); -static herr_t H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id); +static herr_t H5HF__iblock_pin(H5HF_indirect_t *iblock); +static herr_t H5HF__iblock_unpin(H5HF_indirect_t *iblock); +static herr_t H5HF__man_iblock_root_halve(H5HF_indirect_t *root_iblock); +static herr_t H5HF__man_iblock_root_revert(H5HF_indirect_t *root_iblock); /*********************/ @@ -92,7 +92,7 @@ H5FL_SEQ_DEFINE(H5HF_indirect_ptr_t); /*------------------------------------------------------------------------- - * Function: H5HF_iblock_pin + * Function: H5HF__iblock_pin * * Purpose: Pin an indirect block in memory * @@ -105,11 +105,11 @@ H5FL_SEQ_DEFINE(H5HF_indirect_ptr_t); *------------------------------------------------------------------------- */ static herr_t -H5HF_iblock_pin(H5HF_indirect_t *iblock) +H5HF__iblock_pin(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(iblock); @@ -155,11 +155,11 @@ H5HF_iblock_pin(H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_pin() */ +} /* end H5HF__iblock_pin() */ /*------------------------------------------------------------------------- - * Function: H5HF_iblock_unpin + * Function: H5HF__iblock_unpin * * Purpose: Unpin an indirect block in the metadata cache * @@ -172,57 +172,22 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_iblock_unpin(H5HF_indirect_t *iblock) +H5HF__iblock_unpin(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(iblock); - /* If this indirect block has a parent, reset it's child iblock pointer */ - if(iblock->parent) { - H5HF_indirect_t *par_iblock = iblock->parent; /* Parent indirect block */ - unsigned indir_idx; /* Index in parent's child iblock pointer array */ - - /* Sanity check */ - HDassert(par_iblock->child_iblocks); - HDassert(iblock->par_entry >= (iblock->hdr->man_dtable.max_direct_rows - * iblock->hdr->man_dtable.cparam.width)); - - /* Compute index in parent's child iblock pointer array */ - indir_idx = iblock->par_entry - (iblock->hdr->man_dtable.max_direct_rows - * iblock->hdr->man_dtable.cparam.width); - - /* Reset pointer to pinned child indirect block in parent */ - HDassert(par_iblock->child_iblocks[indir_idx]); - par_iblock->child_iblocks[indir_idx] = NULL; - } /* end if */ - else { - /* Check for root indirect block */ - if(iblock->block_off == 0) { - /* Sanity check - shouldn't be recursively unpinning root indirect block */ - HDassert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED); - - /* Check if we should reset the root iblock pointer */ - if(H5HF_ROOT_IBLOCK_PINNED == iblock->hdr->root_iblock_flags) { - HDassert(NULL != iblock->hdr->root_iblock); - iblock->hdr->root_iblock = NULL; - } /* end if */ - - /* Indicate that the root indirect block is unpinned */ - iblock->hdr->root_iblock_flags &= (unsigned)(~(H5HF_ROOT_IBLOCK_PINNED)); - } /* end if */ - } /* end else */ - /* Mark block as evictable again */ if(H5AC_unpin_entry(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_unpin() */ +} /* end H5HF__iblock_unpin() */ /*------------------------------------------------------------------------- @@ -251,7 +216,7 @@ H5HF_iblock_incr(H5HF_indirect_t *iblock) /* Mark block as un-evictable when a child block is depending on it */ if(iblock->rc == 0) - if(H5HF_iblock_pin(iblock) < 0) + if(H5HF__iblock_pin(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTPIN, FAIL, "unable to pin fractal heap indirect block") /* Increment reference count on shared indirect block */ @@ -263,7 +228,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_iblock_decr + * Function: H5HF__iblock_decr * * Purpose: Decrement reference count on shared indirect block * @@ -276,11 +241,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_iblock_decr(H5HF_indirect_t *iblock) +H5HF__iblock_decr(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(iblock); @@ -288,63 +253,60 @@ H5HF_iblock_decr(H5HF_indirect_t *iblock) /* Decrement reference count on shared indirect block */ iblock->rc--; - /* Mark block as evictable again when no child blocks depend on it */ + /* Check for last reference to block */ if(iblock->rc == 0) { - H5HF_hdr_t *hdr; /* Fractal heap header */ - haddr_t iblock_addr; /* Address of fractal heap */ - hbool_t expunge_iblock = FALSE; /* Whether to expunge indirect block from heap */ - - /* Set up convenience variables */ - hdr = iblock->hdr; - iblock_addr = iblock->addr; - - if(iblock->nchildren == 0) { - /* Check for deleting root indirect block (and no root direct block) */ - if(iblock->block_off == 0 && hdr->man_dtable.curr_root_rows > 0) { - /* Reset root pointer information */ - hdr->man_dtable.curr_root_rows = 0; - hdr->man_dtable.table_addr = HADDR_UNDEF; - - /* Reset header information back to "empty heap" state */ - if(H5HF_hdr_empty(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't make heap empty") - } /* end if */ - /* Detach from parent indirect block */ - if(iblock->parent) { - /* Detach from parent indirect block */ - if(H5HF_man_iblock_detach(iblock->parent, H5AC_ind_read_dxpl_id, iblock->par_entry) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't detach from parent indirect block") - iblock->parent = NULL; - iblock->par_entry = 0; - } /* end if */ - - /* Mark indirect block for removal from the metadata cache */ - expunge_iblock = TRUE; - } /* end if */ - - /* Unpin the indirect block */ - if(H5HF_iblock_unpin(iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block") - - /* Check for expunging the indirect block from the metadata cache */ - if(expunge_iblock) { - unsigned cache_flags = H5AC__NO_FLAGS_SET; - - /* if the indirect block is in real file space, tell - * the cache to free its file space. - */ - if (!H5F_IS_TMP_ADDR(hdr->f, iblock_addr)) - cache_flags |= H5AC__FREE_FILE_SPACE_FLAG; - - if(H5AC_expunge_entry(hdr->f, H5AC_ind_read_dxpl_id, H5AC_FHEAP_IBLOCK, iblock_addr, cache_flags) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "unable to remove indirect block from cache") - } /* end if */ + /* If this indirect block has a parent, reset it's child iblock pointer */ + if(iblock->parent) { + H5HF_indirect_t *par_iblock = iblock->parent; /* Parent indirect block */ + unsigned indir_idx; /* Index in parent's child iblock pointer array */ + + /* Sanity check */ + HDassert(par_iblock->child_iblocks); + HDassert(iblock->par_entry >= (iblock->hdr->man_dtable.max_direct_rows + * iblock->hdr->man_dtable.cparam.width)); + + /* Compute index in parent's child iblock pointer array */ + indir_idx = iblock->par_entry - (iblock->hdr->man_dtable.max_direct_rows + * iblock->hdr->man_dtable.cparam.width); + + /* Reset pointer to pinned child indirect block in parent */ + HDassert(par_iblock->child_iblocks[indir_idx]); + par_iblock->child_iblocks[indir_idx] = NULL; + } /* end if */ + else { + /* Check for root indirect block */ + if(iblock->block_off == 0) { + /* Sanity check - shouldn't be recursively unpinning root indirect block */ + HDassert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED); + + /* Check if we should reset the root iblock pointer */ + if(H5HF_ROOT_IBLOCK_PINNED == iblock->hdr->root_iblock_flags) { + HDassert(NULL != iblock->hdr->root_iblock); + iblock->hdr->root_iblock = NULL; + } /* end if */ + + /* Indicate that the root indirect block is unpinned */ + iblock->hdr->root_iblock_flags &= (unsigned)(~(H5HF_ROOT_IBLOCK_PINNED)); + } /* end if */ + } /* end else */ + + /* Check if the block is still in the cache */ + if(!iblock->removed_from_cache) { + /* Unpin the indirect block, making it evictable again */ + if(H5HF__iblock_unpin(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block") + } /* end if */ + else { + /* Destroy the indirect block */ + if(H5HF_man_iblock_dest(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") + } /* end else */ } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_decr() */ +} /* end H5HF__iblock_decr() */ /*------------------------------------------------------------------------- @@ -380,7 +342,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_root_create + * Function: H5HF__man_iblock_root_create * * Purpose: Create root indirect block * @@ -393,7 +355,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) +H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) { H5HF_indirect_t *iblock; /* Pointer to indirect block */ haddr_t iblock_addr; /* Indirect block's address */ @@ -404,7 +366,7 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check for allocating entire root indirect block initially */ if(hdr->man_dtable.cparam.start_root_rows == 0) @@ -424,13 +386,13 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si } /* end else */ /* Allocate root indirect block */ - if(H5HF_man_iblock_create(hdr, dxpl_id, NULL, 0, nrows, hdr->man_dtable.max_root_rows, &iblock_addr) < 0) + if(H5HF__man_iblock_create(hdr, NULL, 0, nrows, hdr->man_dtable.max_root_rows, &iblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap indirect block") /* Move current direct block (used as root) into new indirect block */ /* Lock new indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, NULL, 0, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, NULL, 0, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Check if there's already a direct block as root) */ @@ -439,21 +401,22 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si H5HF_direct_t *dblock; /* Pointer to direct block to query */ /* Lock first (root) direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, hdr->man_dtable.table_addr, hdr->man_dtable.cparam.start_block_size, NULL, 0, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, hdr->man_dtable.table_addr, hdr->man_dtable.cparam.start_block_size, NULL, 0, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") /* Attach direct block to new root indirect block */ dblock->parent = iblock; - dblock->fd_parent = iblock; dblock->par_entry = 0; - /* destroy flush dependency between direct block and header */ - if(H5AC_destroy_flush_dependency(dblock->hdr, dblock) < 0) + /* Destroy flush dependency between direct block and header */ + if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + dblock->fd_parent = NULL; - /* create flush dependency between direct block and new root indirect block */ - if(H5AC_create_flush_dependency(dblock->parent, dblock) < 0) + /* Create flush dependency between direct block and new root indirect block */ + if(H5AC_create_flush_dependency(iblock, dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + dblock->fd_parent = iblock; if(H5HF_man_iblock_attach(iblock, 0, hdr->man_dtable.table_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach root direct block to parent indirect block") @@ -470,11 +433,11 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si } /* end if */ /* Scan free space sections to set any 'parent' pointers to new indirect block */ - if(H5HF_space_create_root(hdr, dxpl_id, iblock) < 0) + if(H5HF__space_create_root(hdr, iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "can't set free space section info to new root indirect block") /* Unlock first (previously the root) direct block */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") dblock = NULL; } /* end if */ @@ -484,19 +447,18 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize block iterator") /* Check for skipping over direct blocks, in order to get to large enough block */ - if(min_dblock_size > hdr->man_dtable.cparam.start_block_size) { + if(min_dblock_size > hdr->man_dtable.cparam.start_block_size) /* Add skipped blocks to heap's free space */ - if(H5HF_hdr_skip_blocks(hdr, dxpl_id, iblock, have_direct_block, + if(H5HF__hdr_skip_blocks(hdr, iblock, have_direct_block, ((nrows - 1) * hdr->man_dtable.cparam.width) - have_direct_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") - } /* end if */ /* Mark indirect block as modified */ if(H5HF_iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Unprotect root indirect block (it's pinned by the iterator though) */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__DIRTIED_FLAG, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__DIRTIED_FLAG, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") iblock = NULL; @@ -519,11 +481,11 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_root_create() */ +} /* end H5HF__man_iblock_root_create() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_root_double + * Function: H5HF__man_iblock_root_double * * Purpose: Double size of root indirect block * @@ -536,7 +498,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) +H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) { H5HF_indirect_t *iblock; /* Pointer to root indirect block */ haddr_t new_addr; /* New address of indirect block */ @@ -553,7 +515,7 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Get "new block" iterator information */ if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) @@ -587,20 +549,10 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ - if(!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) { -/* Currently, the old block data is "thrown away" after the space is reallocated, -* to avoid data copy in H5MF_realloc() call by just free'ing the space and -* allocating new space. -* -* This also keeps the file smaller, by freeing the space and then -* allocating new space, instead of vice versa (in H5MF_realloc). -* -* QAK - 3/14/2006 -*/ + if(!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) /* Free previous indirect block disk space */ - if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, iblock->addr, (hsize_t)iblock->size) < 0) + if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, iblock->addr, (hsize_t)iblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space") - } /* end if */ /* Compute size of buffer needed for new indirect block */ iblock->nrows = new_nrows; @@ -613,7 +565,7 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end if */ else { - if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, (hsize_t)iblock->size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end else */ @@ -625,7 +577,7 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si /* Move object in cache, if it actually was relocated */ if(H5F_addr_ne(iblock->addr, new_addr)) { - if(H5AC_move_entry(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr, dxpl_id) < 0) + if(H5AC_move_entry(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move fractal heap root indirect block") iblock->addr = new_addr; } /* end if */ @@ -635,11 +587,10 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for direct entries") /* Check for skipping over rows and add free section for skipped rows */ - if(skip_direct_rows) { + if(skip_direct_rows) /* Add skipped blocks to heap's free space */ - if(H5HF_hdr_skip_blocks(hdr, dxpl_id, iblock, next_entry, (new_next_entry - next_entry)) < 0) + if(H5HF__hdr_skip_blocks(hdr, iblock, next_entry, (new_next_entry - next_entry)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") - } /* end if */ /* Initialize new direct block entries in rows added */ acc_dblock_free = 0; @@ -706,11 +657,11 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_root_double() */ +} /* end H5HF__man_iblock_root_double() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_root_halve + * Function: H5HF__man_iblock_root_halve * * Purpose: Halve size of root indirect block * @@ -723,7 +674,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) +H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) { H5HF_hdr_t *hdr = iblock->hdr; /* Pointer to heap header */ haddr_t new_addr; /* New address of indirect block */ @@ -735,7 +686,7 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(iblock); @@ -750,20 +701,10 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ - if(!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) { -/* Currently, the old block data is "thrown away" after the space is reallocated, -* to avoid data copy in H5MF_realloc() call by just free'ing the space and -* allocating new space. -* -* This also keeps the file smaller, by freeing the space and then -* allocating new space, instead of vice versa (in H5MF_realloc). -* -* QAK - 6/12/2006 -*/ + if(!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) /* Free previous indirect block disk space */ - if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, iblock->addr, (hsize_t)iblock->size) < 0) + if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, iblock->addr, (hsize_t)iblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space") - } /* end if */ /* Compute free space in rows to delete */ acc_dblock_free = 0; @@ -782,7 +723,7 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end if */ else { - if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, (hsize_t)iblock->size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end else */ @@ -794,7 +735,7 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) /* Move object in cache, if it actually was relocated */ if(H5F_addr_ne(iblock->addr, new_addr)) { - if(H5AC_move_entry(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr, dxpl_id) < 0) + if(H5AC_move_entry(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSPLIT, FAIL, "unable to move fractal heap root indirect block") iblock->addr = new_addr; } /* end if */ @@ -841,11 +782,11 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_root_halve() */ +} /* end H5HF__man_iblock_root_halve() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_root_revert + * Function: H5HF__man_iblock_root_revert * * Purpose: Revert root indirect block back to root direct block * @@ -861,7 +802,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) +H5HF__man_iblock_root_revert(H5HF_indirect_t *root_iblock) { H5HF_hdr_t *hdr; /* Pointer to heap's header */ H5HF_direct_t *dblock = NULL; /* Pointer to new root indirect block */ @@ -869,7 +810,7 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) size_t dblock_size; /* Direct block's size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -882,7 +823,7 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) dblock_size = hdr->man_dtable.cparam.start_block_size; /* Get pointer to last direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, root_iblock, 0, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, root_iblock, 0, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") HDassert(dblock->parent == root_iblock); HDassert(dblock->par_entry == 0); @@ -894,24 +835,21 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) hdr->pline_root_direct_filter_mask = root_iblock->filt_ents[0].filter_mask; } /* end if */ + /* Destroy flush dependency between old root iblock and new root direct block */ + if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + dblock->fd_parent = NULL; + /* Detach direct block from parent */ - if(H5HF_man_iblock_detach(dblock->parent, dxpl_id, 0) < 0) + if(H5HF__man_iblock_detach(dblock->parent, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't detach direct block from parent indirect block") dblock->parent = NULL; dblock->par_entry = 0; - /* destroy flush dependency between old root iblock and new root direct block*/ - if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, \ - "unable to destroy flush dependency") - - - /* create flush dependency between header and new root direct block */ - if(H5AC_create_flush_dependency(dblock->hdr, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, \ - "unable to create flush dependency") - - dblock->fd_parent = NULL; + /* Create flush dependency between header and new root direct block */ + if(H5AC_create_flush_dependency(hdr, dblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + dblock->fd_parent = hdr; /* Point root at direct block */ hdr->man_dtable.curr_root_rows = 0; @@ -926,20 +864,19 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") /* Scan free space sections to reset any 'parent' pointers */ - if(H5HF_space_revert_root(hdr, dxpl_id) < 0) + if(H5HF__space_revert_root(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESET, FAIL, "can't reset free space section info") - done: - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5AC_unprotect(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_root_revert() */ +} /* end H5HF__man_iblock_root_revert() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_alloc_row + * Function: H5HF__man_iblock_alloc_row * * Purpose: Allocate a "single" section for an object, out of a * "row" section. @@ -955,7 +892,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t **sec_node) +H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node) { H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ H5HF_free_section_t *old_sec_node = *sec_node; /* Pointer to old indirect section node */ @@ -963,7 +900,7 @@ H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t ** hbool_t iblock_held = FALSE; /* Flag to indicate that indirect block is held */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -972,12 +909,14 @@ H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t ** HDassert(sec_node && old_sec_node); HDassert(old_sec_node->u.row.row < hdr->man_dtable.max_direct_rows); - /* Check for serialized section */ - if(old_sec_node->sect_info.state == H5FS_SECT_SERIALIZED) { - /* Revive indirect section */ - if(H5HF_sect_row_revive(hdr, dxpl_id, old_sec_node) < 0) + /* Check for serialized row section, or serialized / deleted indirect + * section under it. */ + if(old_sec_node->sect_info.state == H5FS_SECT_SERIALIZED + || (H5FS_SECT_SERIALIZED == old_sec_node->u.row.under->sect_info.state) + || (TRUE == old_sec_node->u.row.under->u.indirect.u.iblock->removed_from_cache)) + /* Revive row and / or indirect section */ + if(H5HF__sect_row_revive(hdr, old_sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") - } /* end if */ /* Get a pointer to the indirect block covering the section */ if(NULL == (iblock = H5HF_sect_row_get_iblock(old_sec_node))) @@ -989,25 +928,25 @@ H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t ** iblock_held = TRUE; /* Reduce (& possibly re-add) 'row' section */ - if(H5HF_sect_row_reduce(hdr, dxpl_id, old_sec_node, &dblock_entry) < 0) + if(H5HF__sect_row_reduce(hdr, old_sec_node, &dblock_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce row section node") /* Create direct block & single section */ - if(H5HF_man_dblock_create(dxpl_id, hdr, iblock, dblock_entry, NULL, sec_node) < 0) + if(H5HF__man_dblock_create(hdr, iblock, dblock_entry, NULL, sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap direct block") done: /* Release hold on indirect block */ if(iblock_held) - if(H5HF_iblock_decr(iblock) < 0) + if(H5HF__iblock_decr(iblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_alloc_row() */ +} /* end H5HF__man_iblock_alloc_row() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_create + * Function: H5HF__man_iblock_create * * Purpose: Allocate & initialize a managed indirect block * @@ -1020,14 +959,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblock, +H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned par_entry, unsigned nrows, unsigned max_rows, haddr_t *addr_p) { H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1050,10 +989,11 @@ H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblo if(H5HF_hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header") - /* Set info for direct block */ + /* Set info for indirect block */ iblock->rc = 0; iblock->nrows = nrows; iblock->max_rows = max_rows; + iblock->removed_from_cache = FALSE; /* Compute size of buffer needed for indirect block */ iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock->nrows); @@ -1100,19 +1040,13 @@ H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblo HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end if */ else { - if(HADDR_UNDEF == (*addr_p = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + if(HADDR_UNDEF == (*addr_p = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, (hsize_t)iblock->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end else */ iblock->addr = *addr_p; /* Attach to parent indirect block, if there is one */ iblock->parent = par_iblock; - iblock->fd_parent = par_iblock; /* this copy of the parent pointer is */ - /* needed by the notify callback so */ - /* that it can take down flush */ - /* dependencies on eviction even if */ - /* the parent pointer has been nulled */ - /* out. JRM -- 5/18/14 */ iblock->par_entry = par_entry; if(iblock->parent) { /* Attach new block to parent */ @@ -1124,16 +1058,23 @@ H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblo iblock->block_off = par_iblock->block_off; iblock->block_off += hdr->man_dtable.row_block_off[par_entry / hdr->man_dtable.cparam.width]; iblock->block_off += hdr->man_dtable.row_block_size[par_entry / hdr->man_dtable.cparam.width] * (par_entry % hdr->man_dtable.cparam.width); + + /* Set indirect block parent as flush dependency parent */ + iblock->fd_parent = par_iblock; } /* end if */ - else + else { iblock->block_off = 0; /* Must be the root indirect block... */ + /* Set heap header as flush dependency parent */ + iblock->fd_parent = hdr; + } /* end else */ + /* Update indirect block's statistics */ iblock->nchildren = 0; iblock->max_child = 0; /* Cache the new indirect block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, *addr_p, iblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_FHEAP_IBLOCK, *addr_p, iblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add fractal heap indirect block to cache") done: @@ -1143,11 +1084,11 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_create() */ +} /* end H5HF__man_iblock_create() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_protect + * Function: H5HF__man_iblock_protect * * Purpose: Convenience wrapper around H5AC_protect on an indirect block * @@ -1160,7 +1101,7 @@ done: *------------------------------------------------------------------------- */ H5HF_indirect_t * -H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, +H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hbool_t must_protect, unsigned flags, hbool_t *did_protect) { @@ -1169,7 +1110,7 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, hbool_t should_protect = FALSE; /* Whether we should protect the indirect block or not */ H5HF_indirect_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1241,7 +1182,7 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, cache_udata.nrows = &iblock_nrows; /* Protect the indirect block */ - if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, iblock_addr, &cache_udata, flags))) + if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(hdr->f, H5AC_FHEAP_IBLOCK, iblock_addr, &cache_udata, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap indirect block") /* Set the indirect block's address */ @@ -1274,11 +1215,11 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_protect() */ +} /* end H5HF__man_iblock_protect() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_unprotect + * Function: H5HF__man_iblock_unprotect * * Purpose: Convenience wrapper around H5AC_unprotect on an indirect block * @@ -1291,12 +1232,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id, - unsigned cache_flags, hbool_t did_protect) +H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, + hbool_t did_protect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1322,13 +1263,13 @@ H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id, } /* end if */ /* Unprotect the indirect block */ - if(H5AC_unprotect(iblock->hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, iblock->addr, iblock, cache_flags) < 0) + if(H5AC_unprotect(iblock->hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, iblock, cache_flags) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_unprotect() */ +} /* end H5HF__man_iblock_unprotect() */ /*------------------------------------------------------------------------- @@ -1397,7 +1338,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_detach + * Function: H5HF__man_iblock_detach * * Purpose: Detach a child block (direct or indirect) from an indirect block * @@ -1410,12 +1351,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry) +H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) { + H5HF_hdr_t *hdr; /* Fractal heap header */ + H5HF_indirect_t *del_iblock = NULL; /* Pointer to protected indirect block, when deleting */ unsigned row; /* Row for entry */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1423,34 +1366,36 @@ H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry) HDassert(iblock); HDassert(iblock->nchildren); + /* Set up convenience variables */ + hdr = iblock->hdr; + /* Reset address of entry */ iblock->ents[entry].addr = HADDR_UNDEF; /* Compute row for entry */ - row = entry / iblock->hdr->man_dtable.cparam.width; + row = entry / hdr->man_dtable.cparam.width; /* Check for I/O filters on this heap */ - if(iblock->hdr->filter_len > 0) { + if(hdr->filter_len > 0) { /* Sanity check */ HDassert(iblock->filt_ents); /* If this is a direct block, reset its initial size */ - if(row < iblock->hdr->man_dtable.max_direct_rows) { + if(row < hdr->man_dtable.max_direct_rows) { iblock->filt_ents[entry].size = 0; iblock->filt_ents[entry].filter_mask = 0; } /* end if */ } /* end if */ /* Check for indirect block being detached */ - if(row >= iblock->hdr->man_dtable.max_direct_rows) { + if(row >= hdr->man_dtable.max_direct_rows) { unsigned indir_idx; /* Index in parent's child iblock pointer array */ /* Sanity check */ HDassert(iblock->child_iblocks); /* Compute index in child iblock pointer array */ - indir_idx = entry - (iblock->hdr->man_dtable.max_direct_rows - * iblock->hdr->man_dtable.cparam.width); + indir_idx = entry - (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width); /* Sanity check */ HDassert(iblock->child_iblocks[indir_idx]); @@ -1482,38 +1427,127 @@ H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry) * direct block */ if(iblock->nchildren == 1 && H5F_addr_defined(iblock->ents[0].addr)) - if(H5HF_man_iblock_root_revert(iblock, dxpl_id) < 0) + if(H5HF__man_iblock_root_revert(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't convert root indirect block back to root direct block") - /* Check for reducing size of root indirect block */ - if(iblock->nchildren > 0 && iblock->hdr->man_dtable.cparam.start_root_rows != 0 - && entry > iblock->max_child) { - unsigned max_child_row; /* Row for max. child entry */ - - /* Compute information needed for determining whether to reduce size of root indirect block */ - max_child_row = iblock->max_child / iblock->hdr->man_dtable.cparam.width; - - /* Check if the root indirect block should be reduced */ - if(iblock->nrows > 1 && max_child_row <= (iblock->nrows / 2)) - if(H5HF_man_iblock_root_halve(iblock, dxpl_id) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce size of root indirect block") - } /* end if */ + /* If the indirect block wasn't removed already (by reverting it) */ + if(!iblock->removed_from_cache) { + /* Check for reducing size of root indirect block */ + if(iblock->nchildren > 0 && hdr->man_dtable.cparam.start_root_rows != 0 + && entry > iblock->max_child) { + unsigned max_child_row; /* Row for max. child entry */ + + /* Compute information needed for determining whether to reduce size of root indirect block */ + max_child_row = iblock->max_child / hdr->man_dtable.cparam.width; + + /* Check if the root indirect block should be reduced */ + if(iblock->nrows > 1 && max_child_row <= (iblock->nrows / 2)) + if(H5HF__man_iblock_root_halve(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce size of root indirect block") + } /* end if */ + } /* end if */ } /* end if */ - /* Mark indirect block as modified */ - if(H5HF_iblock_dirty(iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") + /* If the indirect block wasn't removed already (by reverting it) */ + if(!iblock->removed_from_cache) { + /* Mark indirect block as modified */ + if(H5HF_iblock_dirty(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") + + /* Check for last child being removed from indirect block */ + if(iblock->nchildren == 0) { + hbool_t did_protect = FALSE; /* Whether the indirect block was protected */ + + /* If this indirect block's refcount is >1, then it's being deleted + * from the fractal heap (since its nchildren == 0), but is still + * referred to from free space sections in the heap (refcount >1). + * Its space in the file needs to be freed now, and it also needs + * to be removed from the metadata cache now, in case the space in + * the file is reused by another piece of metadata that is inserted + * into the cache before the indirect block's entry is evicted + * (having two entries at the same address would be an error, from + * the cache's perspective). + */ + /* Lock indirect block for deletion */ + if(NULL == (del_iblock = H5HF__man_iblock_protect(hdr, iblock->addr, iblock->nrows, iblock->parent, iblock->par_entry, TRUE, H5AC__NO_FLAGS_SET, &did_protect))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") + HDassert(did_protect == TRUE); + + /* Check for deleting root indirect block (and no root direct block) */ + if(iblock->block_off == 0 && hdr->man_dtable.curr_root_rows > 0) + /* Reset header information back to "empty heap" state */ + if(H5HF__hdr_empty(hdr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't make heap empty") + + /* Detach from parent indirect block */ + if(iblock->parent) { + /* Destroy flush dependency between indirect block and parent */ + if(H5AC_destroy_flush_dependency(iblock->fd_parent, iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + iblock->fd_parent = NULL; + + /* Detach from parent indirect block */ + if(H5HF__man_iblock_detach(iblock->parent, iblock->par_entry) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't detach from parent indirect block") + iblock->parent = NULL; + iblock->par_entry = 0; + } /* end if */ + } /* end if */ + } /* end if */ - /* Decrement the reference count on this indirect block */ - /* (should be last, so that potential 'unpin' on this indirect block - * doesn't invalidate the 'iblock' variable) + /* Decrement the reference count on this indirect block if we're not deleting it */ + /* (should be after iblock needs to be modified, so that potential 'unpin' + * on this indirect block doesn't invalidate the 'iblock' variable, if it's + * not being deleted) */ - if(H5HF_iblock_decr(iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") + if(H5HF__iblock_decr(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") + iblock = NULL; + + /* Delete indirect block from cache, if appropriate */ + if(del_iblock) { + unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotect */ + hbool_t took_ownership = FALSE; /* Flag to indicate that block ownership has transitioned */ + + /* If the refcount is still >0, unpin the block and take ownership + * from the cache, otherwise let the cache destroy it. + */ + if(del_iblock->rc > 0) { + cache_flags |= (H5AC__DELETED_FLAG | H5AC__TAKE_OWNERSHIP_FLAG); + cache_flags |= H5AC__UNPIN_ENTRY_FLAG; + took_ownership = TRUE; + } /* end if */ + else { + /* Entry should be removed from the cache */ + cache_flags |= H5AC__DELETED_FLAG; + + /* If the indirect block is in real file space, tell + * the cache to free its file space as well. + */ + if(!H5F_IS_TMP_ADDR(hdr->f, del_iblock->addr)) + cache_flags |= H5AC__FREE_FILE_SPACE_FLAG; + } /* end else */ + + /* Unprotect the indirect block, with appropriate flags */ + if(H5HF__man_iblock_unprotect(del_iblock, cache_flags, TRUE) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") + + /* if took ownership, free file space & mark block as removed from cache */ + if(took_ownership) { + /* Free indirect block disk space, if it's in real space */ + if(!H5F_IS_TMP_ADDR(hdr->f, del_iblock->addr)) + if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, del_iblock->addr, (hsize_t)del_iblock->size) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space") + del_iblock->addr = HADDR_UNDEF; + + /* Mark block as removed from the cache */ + del_iblock->removed_from_cache = TRUE; + } /* end if */ + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_detach() */ +} /* end H5HF__man_iblock_detach() */ /*------------------------------------------------------------------------- @@ -1548,7 +1582,7 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_delete + * Function: H5HF__man_iblock_delete * * Purpose: Delete a managed indirect block * @@ -1565,7 +1599,7 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, +H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry) { H5HF_indirect_t *iblock; /* Pointer to indirect block */ @@ -1575,7 +1609,7 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, hbool_t did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1585,7 +1619,7 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, HDassert(iblock_nrows > 0); /* Lock indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, iblock_nrows, par_iblock, par_entry, TRUE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, iblock_nrows, par_iblock, par_entry, TRUE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") HDassert(iblock->nchildren > 0); HDassert(did_protect == TRUE); @@ -1597,33 +1631,32 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, for(col = 0; col < hdr->man_dtable.cparam.width; col++, entry++) { /* Check for child entry at this position */ if(H5F_addr_defined(iblock->ents[entry].addr)) { - hsize_t row_block_size; /* The size of blocks in this row */ - - /* Get the row's block size */ - row_block_size = (hsize_t)hdr->man_dtable.row_block_size[row]; - /* Are we in a direct or indirect block row */ if(row < hdr->man_dtable.max_direct_rows) { - hsize_t dblock_size; /* Size of direct block on disk */ + hsize_t dblock_size; /* Size of direct block on disk */ - /* Check for I/O filters on this heap */ - if(hdr->filter_len > 0) - dblock_size = iblock->filt_ents[entry].size; - else - dblock_size = row_block_size; + /* Check for I/O filters on this heap */ + if(hdr->filter_len > 0) + dblock_size = iblock->filt_ents[entry].size; + else + dblock_size = hdr->man_dtable.row_block_size[row]; /* Delete child direct block */ - if(H5HF_man_dblock_delete(hdr->f, dxpl_id, iblock->ents[entry].addr, dblock_size) < 0) + if(H5HF__man_dblock_delete(hdr->f, iblock->ents[entry].addr, dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap child direct block") } /* end if */ else { + hsize_t row_block_size; /* The size of blocks in this row */ unsigned child_nrows; /* Number of rows in new indirect block */ + /* Get the row's block size */ + row_block_size = (hsize_t)hdr->man_dtable.row_block_size[row]; + /* Compute # of rows in next child indirect block to use */ child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, row_block_size); /* Delete child indirect block */ - if(H5HF_man_iblock_delete(hdr, dxpl_id, iblock->ents[entry].addr, child_nrows, iblock, entry) < 0) + if(H5HF__man_iblock_delete(hdr, iblock->ents[entry].addr, child_nrows, iblock, entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap child indirect block") } /* end else */ } /* end if */ @@ -1654,16 +1687,16 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, done: /* Unprotect the indirect block, with appropriate flags */ - if(iblock && H5HF_man_iblock_unprotect(iblock, dxpl_id, cache_flags, did_protect) < 0) + if(iblock && H5HF__man_iblock_unprotect(iblock, cache_flags, did_protect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_delete() */ +} /* end H5HF__man_iblock_delete() */ /*------------------------------------------------------------------------- * - * Function: H5HF_man_iblock_size + * Function: H5HF__man_iblock_size * * Purpose: Gather storage used for the indirect block in fractal heap * @@ -1674,14 +1707,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_addr, +H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hsize_t *heap_size) { H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ hbool_t did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1692,7 +1725,7 @@ H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_ad HDassert(heap_size); /* Protect the indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, par_iblock, par_entry, FALSE, H5AC__READ_ONLY_FLAG, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, par_iblock, par_entry, FALSE, H5AC__READ_ONLY_FLAG, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block") /* Accumulate size of this indirect block */ @@ -1715,19 +1748,96 @@ H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_ad for(v = 0; v < hdr->man_dtable.cparam.width; v++, entry++) if(H5F_addr_defined(iblock->ents[entry].addr)) - if(H5HF_man_iblock_size(f, dxpl_id, hdr, iblock->ents[entry].addr, num_indirect_rows, iblock, entry, heap_size) < 0) + if(H5HF__man_iblock_size(f, hdr, iblock->ents[entry].addr, num_indirect_rows, iblock, entry, heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to get fractal heap storage info for indirect block") } /* end for */ } /* end if */ done: /* Release the indirect block */ - if(iblock && H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(iblock && H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") iblock = NULL; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_size() */ +} /* end H5HF__man_iblock_size() */ + + +/*------------------------------------------------------------------------- + * + * Function: H5HF_man_iblock_parent_info + * + * Purpose: Determine the parent block's offset and entry location + * (within it's parent) of an indirect block, given its offset + * within the heap. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * koziol@lbl.gov + * Jan 14 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, + hsize_t *ret_par_block_off, unsigned *ret_entry) +{ + hsize_t par_block_off; /* Offset of parent within heap */ + hsize_t prev_par_block_off; /* Offset of previous parent block within heap */ + unsigned row, col; /* Row & column for block */ + unsigned prev_row = 0, prev_col = 0;/* Previous row & column for block */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* + * Check arguments. + */ + HDassert(hdr); + HDassert(block_off > 0); + HDassert(ret_entry); + + /* Look up row & column for object */ + if(H5HF_dtable_lookup(&hdr->man_dtable, block_off, &row, &col) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block") + + /* Sanity check - first lookup must be an indirect block */ + HDassert(row >= hdr->man_dtable.max_direct_rows); + + /* Traverse down, until a direct block at the offset is found, then + * use previous (i.e. parent's) offset, row, and column. + */ + prev_par_block_off = par_block_off = 0; + while(row >= hdr->man_dtable.max_direct_rows) { + /* Retain previous parent block offset */ + prev_par_block_off = par_block_off; + + /* Compute the new parent indirect block's offset in the heap's address space */ + /* (based on previous block offset) */ + par_block_off += hdr->man_dtable.row_block_off[row]; + par_block_off += hdr->man_dtable.row_block_size[row] * col; + + /* Preserve current row & column */ + prev_row = row; + prev_col = col; + + /* Look up row & column in new indirect block for object */ + if(H5HF_dtable_lookup(&hdr->man_dtable, (block_off - par_block_off), &row, &col) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block") + } /* end while */ + + /* Sanity check */ + HDassert(row == 0); + HDassert(col == 0); + + /* Set return parameters */ + *ret_par_block_off = prev_par_block_off; + *ret_entry = (prev_row * hdr->man_dtable.cparam.width) + prev_col; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF__man_iblock_par_info() */ /*------------------------------------------------------------------------- @@ -1761,7 +1871,7 @@ H5HF_man_iblock_dest(H5HF_indirect_t *iblock) if(H5HF_hdr_decr(iblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if(iblock->parent) - if(H5HF_iblock_decr(iblock->parent) < 0) + if(H5HF__iblock_decr(iblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") /* Release entry tables */ diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 54246d2..ceebc3b 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -109,7 +109,7 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter) /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_start_offset + * Function: H5HF__man_iter_start_offset * * Purpose: Initialize a block iterator to a particular location, given * an offset in the heap @@ -123,8 +123,8 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter) *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_block_iter_t *biter, hsize_t offset) +H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, + hsize_t offset) { H5HF_indirect_t *iblock; /* Indirect block for location context */ haddr_t iblock_addr; /* Address of indirect block */ @@ -137,7 +137,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t root_block = TRUE; /* Flag to indicate the current block is the root indirect block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -216,7 +216,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, } /* end else */ /* Load indirect block for this context location */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, iblock_nrows, iblock_parent, iblock_par_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, iblock_nrows, iblock_parent, iblock_par_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Make indirect block the context for the current location */ @@ -227,7 +227,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Release the current indirect block */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") iblock = NULL; @@ -261,7 +261,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_start_offset() */ +} /* end H5HF__man_iter_start_offset() */ /*------------------------------------------------------------------------- @@ -395,7 +395,7 @@ H5HF_man_iter_reset(H5HF_block_iter_t *biter) /* If this node is holding an indirect block, release the block */ if(curr_loc->context) - if(H5HF_iblock_decr(curr_loc->context) < 0) + if(H5HF__iblock_decr(curr_loc->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") /* Free the current location context */ @@ -484,7 +484,7 @@ H5HF_man_iter_up(H5HF_block_iter_t *biter) HDassert(biter->curr->context); /* Release hold on current location's indirect block */ - if(H5HF_iblock_decr(biter->curr->context) < 0) + if(H5HF__iblock_decr(biter->curr->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") /* Get pointer to location context above this one */ diff --git a/src/H5HFman.c b/src/H5HFman.c index 2b88b50..394bcff 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -70,8 +70,8 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, - const uint8_t *id, H5HF_operator_t op, void *op_data, unsigned op_flags); +static herr_t H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, + H5HF_operator_t op, void *op_data, unsigned op_flags); /*********************/ /* Package Variables */ @@ -90,7 +90,7 @@ static herr_t H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, /*------------------------------------------------------------------------- - * Function: H5HF_man_insert + * Function: H5HF__man_insert * * Purpose: Insert an object in a managed direct block * @@ -103,8 +103,7 @@ static herr_t H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, *------------------------------------------------------------------------- */ herr_t -H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj, - void *_id) +H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) { H5HF_free_section_t *sec_node = NULL; /* Pointer to free space section */ H5HF_direct_t *dblock = NULL; /* Pointer to direct block to modify */ @@ -115,7 +114,7 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj htri_t node_found; /* Whether an existing free list node was found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -129,30 +128,28 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj H5HF_MAN_WRITE_CHECK_PLINE(hdr) /* Look for free space */ - if((node_found = H5HF_space_find(hdr, dxpl_id, (hsize_t)obj_size, &sec_node)) < 0) + if((node_found = H5HF__space_find(hdr, (hsize_t)obj_size, &sec_node)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't locate free space in fractal heap") /* If we didn't find a node, go create a direct block big enough to hold the requested block */ if(!node_found) /* Allocate direct block big enough to hold requested size */ - if(H5HF_man_dblock_new(hdr, dxpl_id, obj_size, &sec_node) < 0) + if(H5HF__man_dblock_new(hdr, obj_size, &sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "can't create fractal heap direct block") /* Check for row section */ if(sec_node->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW || sec_node->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW) { - /* Allocate 'single' selection out of 'row' selection */ - if(H5HF_man_iblock_alloc_row(hdr, dxpl_id, &sec_node) < 0) + if(H5HF__man_iblock_alloc_row(hdr, &sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't break up row section") } /* end if */ HDassert(sec_node->sect_info.type == H5HF_FSPACE_SECT_SINGLE); /* Check for 'single' section being serialized */ - if(sec_node->sect_info.state == H5FS_SECT_SERIALIZED) { - if(H5HF_sect_single_revive(hdr, dxpl_id, sec_node) < 0) + if(sec_node->sect_info.state == H5FS_SECT_SERIALIZED) + if(H5HF__sect_single_revive(hdr, sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") - } /* end if */ HDassert(sec_node->sect_info.state == H5FS_SECT_LIVE); /* Retrieve direct block address from section */ @@ -160,7 +157,7 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Lock direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, sec_node->u.single.parent, sec_node->u.single.par_entry, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, sec_node->u.single.parent, sec_node->u.single.par_entry, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") /* Insert object into block */ @@ -173,7 +170,7 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj HDassert(sec_node->sect_info.size >= obj_size); /* Reduce (& possibly re-add) single section */ - if(H5HF_sect_single_reduce(hdr, dxpl_id, sec_node, obj_size) < 0) + if(H5HF__sect_single_reduce(hdr, sec_node, obj_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce single section node") sec_node = NULL; @@ -205,15 +202,15 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj done: /* Release section node on error */ if(ret_value < 0) - if(sec_node && H5HF_sect_single_free((H5FS_section_info_t *)sec_node) < 0) + if(sec_node && H5HF__sect_single_free((H5FS_section_info_t *)sec_node) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release section node") /* Release the direct block (marked as dirty) */ - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__DIRTIED_FLAG) < 0) + if(dblock && H5AC_unprotect(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_insert() */ +} /* end H5HF__man_insert() */ /*------------------------------------------------------------------------- @@ -290,7 +287,7 @@ H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off /*------------------------------------------------------------------------- - * Function: H5HF_man_op_real + * Function: H5HF__man_op_real * * Purpose: Internal routine to perform an operation on a managed heap * object @@ -304,7 +301,7 @@ H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off *------------------------------------------------------------------------- */ static herr_t -H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, +H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data, unsigned op_flags) { H5HF_direct_t *dblock = NULL; /* Pointer to direct block to query */ @@ -322,7 +319,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, uint8_t *p; /* Temporary pointer to obj info in block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -370,7 +367,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, dblock_size = hdr->man_dtable.cparam.start_block_size; /* Lock direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, NULL, 0, dblock_access_flags))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, NULL, 0, dblock_access_flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") } /* end if */ else { @@ -379,7 +376,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, unsigned entry; /* Entry of block */ /* Look up indirect block containing direct block */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, obj_off, &iblock, &entry, &did_protect, H5AC__READ_ONLY_FLAG) < 0) + if(H5HF__man_dblock_locate(hdr, obj_off, &iblock, &entry, &did_protect, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Set direct block info */ @@ -390,23 +387,23 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check for offset of invalid direct block */ if(!H5F_addr_defined(dblock_addr)) { /* Unlock indirect block */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap ID not in allocated direct block") } /* end if */ /* Lock direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, iblock, entry, dblock_access_flags))) { + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, iblock, entry, dblock_access_flags))) { /* Unlock indirect block */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") } /* end if */ /* Unlock indirect block */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") iblock = NULL; } /* end else */ @@ -432,15 +429,15 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, done: /* Unlock direct block */ - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, dblock_cache_flags) < 0) + if(dblock && H5AC_unprotect(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, dblock_cache_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_op_real() */ +} /* end H5HF__man_op_real() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_read + * Function: H5HF__man_read * * Purpose: Read an object from a managed heap * @@ -453,11 +450,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_read(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, void *obj) +H5HF__man_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -467,16 +464,16 @@ H5HF_man_read(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, void *obj) HDassert(obj); /* Call the internal 'op' routine routine */ - if(H5HF_man_op_real(hdr, dxpl_id, id, H5HF_op_read, obj, 0) < 0) + if(H5HF__man_op_real(hdr, id, H5HF_op_read, obj, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_read() */ +} /* end H5HF__man_read() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_write + * Function: H5HF__man_write * * Purpose: Write an object to a managed heap * @@ -489,12 +486,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - const void *obj) +H5HF__man_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -505,16 +501,16 @@ H5HF_man_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Call the internal 'op' routine routine */ /* (Casting away const OK - QAK) */ - if(H5HF_man_op_real(hdr, dxpl_id, id, H5HF_op_write, (void *)obj, H5HF_OP_MODIFY) < 0) + if(H5HF__man_op_real(hdr, id, H5HF_op_write, (void *)obj, H5HF_OP_MODIFY) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_write() */ +} /* end H5HF__man_write() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_op + * Function: H5HF__man_op * * Purpose: Operate directly on an object from a managed heap * @@ -527,12 +523,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - H5HF_operator_t op, void *op_data) +H5HF__man_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -542,16 +537,16 @@ H5HF_man_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, HDassert(op); /* Call the internal 'op' routine routine */ - if(H5HF_man_op_real(hdr, dxpl_id, id, op, op_data, 0) < 0) + if(H5HF__man_op_real(hdr, id, op, op_data, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_op() */ +} /* end H5HF__man_op() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_remove + * Function: H5HF__man_remove * * Purpose: Remove an object from a managed heap * @@ -564,7 +559,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) +H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) { H5HF_free_section_t *sec_node = NULL; /* Pointer to free space section for block */ H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ @@ -577,7 +572,7 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) size_t blk_off; /* Offset of object in block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -616,7 +611,7 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) } /* end if */ else { /* Look up indirect block containing direct block */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, obj_off, &iblock, &dblock_entry, &did_protect, H5AC__NO_FLAGS_SET) < 0) + if(H5HF__man_dblock_locate(hdr, obj_off, &iblock, &dblock_entry, &did_protect, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Check for offset of invalid direct block */ @@ -652,7 +647,7 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Unlock indirect block */ if(iblock) { - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") iblock = NULL; } /* end if */ @@ -665,21 +660,21 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) hdr->man_nobjs--; /* Return free space to the heap's list of space */ - if(H5HF_space_add(hdr, dxpl_id, sec_node, H5FS_ADD_RETURNED_SPACE) < 0) + if(H5HF__space_add(hdr, sec_node, H5FS_ADD_RETURNED_SPACE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add direct block free space to global list") sec_node = NULL; done: if(ret_value < 0) { /* Release section node */ - if(sec_node && H5HF_sect_single_free((H5FS_section_info_t *)sec_node) < 0) + if(sec_node && H5HF__sect_single_free((H5FS_section_info_t *)sec_node) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release section node") } /* end if */ /* Unlock indirect block */ - if(iblock && H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(iblock && H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_remove() */ +} /* end H5HF__man_remove() */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index d03c1222..b38a897 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -382,8 +382,7 @@ struct H5HF_indirect_t { size_t rc; /* Reference count of objects using this block */ H5HF_hdr_t *hdr; /* Shared heap header info */ struct H5HF_indirect_t *parent; /* Shared parent indirect block info */ - struct H5HF_indirect_t - *fd_parent; /* Saved copy of the parent pointer -- this */ + void *fd_parent; /* Saved copy of the parent pointer -- this */ /* necessary as the parent field is sometimes */ /* nulled out before the eviction notify call */ /* is made from the metadata cache. Since */ @@ -397,6 +396,10 @@ struct H5HF_indirect_t { unsigned nchildren; /* Number of child blocks */ unsigned max_child; /* Max. offset used in child entries */ struct H5HF_indirect_t **child_iblocks; /* Array of pointers to pinned child indirect blocks */ + hbool_t removed_from_cache; /* Flag that indicates the block has */ + /* been removed from the metadata cache, but */ + /* is still 'live' due to a refcount (rc) > 0 */ + /* (usually from free space sections) */ /* Stored values */ hsize_t block_off; /* Offset of the block within the heap's address space */ @@ -412,7 +415,7 @@ typedef struct H5HF_direct_t { /* Internal heap information */ H5HF_hdr_t *hdr; /* Shared heap header info */ H5HF_indirect_t *parent; /* Shared parent indirect block info */ - H5HF_indirect_t *fd_parent; /* Saved copy of the parent pointer -- this */ + void *fd_parent; /* Saved copy of the parent pointer -- this */ /* necessary as the parent field is sometimes */ /* nulled out before the eviction notify call */ /* is made from the metadata cache. Since */ @@ -498,20 +501,17 @@ typedef struct H5HF_huge_bt2_filt_dir_rec_t { /* User data for free space section 'add' callback */ typedef struct { H5HF_hdr_t *hdr; /* Fractal heap header */ - hid_t dxpl_id; /* DXPL ID for operation */ } H5HF_sect_add_ud_t; /* User data for v2 B-tree 'remove' callback on 'huge' objects */ typedef struct { H5HF_hdr_t *hdr; /* Fractal heap header (in) */ - hid_t dxpl_id; /* DXPL ID for operation (in) */ hsize_t obj_len; /* Length of object removed (out) */ } H5HF_huge_remove_ud_t; /* User data for fractal heap header cache client callback */ typedef struct H5HF_hdr_cache_ud_t { H5F_t *f; /* File pointer */ - hid_t dxpl_id; /* DXPL ID for operation (in) */ } H5HF_hdr_cache_ud_t; /* User data for fractal heap indirect block cache client callbacks */ @@ -617,9 +617,8 @@ H5_DLL hsize_t H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start /* Heap header routines */ H5_DLL H5HF_hdr_t * H5HF_hdr_alloc(H5F_t *f); -H5_DLL haddr_t H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam); -H5_DLL H5HF_hdr_t *H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, - unsigned flags); +H5_DLL haddr_t H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam); +H5_DLL H5HF_hdr_t *H5HF__hdr_protect(H5F_t *f, haddr_t addr, unsigned flags); H5_DLL herr_t H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_hdr_finish_init(H5HF_hdr_t *hdr); @@ -632,100 +631,95 @@ H5_DLL herr_t H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt); H5_DLL herr_t H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free); H5_DLL herr_t H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size); H5_DLL herr_t H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry); -H5_DLL herr_t H5HF_hdr_skip_blocks(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries); -H5_DLL herr_t H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size); +H5_DLL herr_t H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, + unsigned start_entry, unsigned nentries); +H5_DLL herr_t H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size); H5_DLL herr_t H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries); -H5_DLL herr_t H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblock_addr); +H5_DLL herr_t H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr); H5_DLL herr_t H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off); -H5_DLL herr_t H5HF_hdr_empty(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_empty(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_hdr_free(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id); +H5_DLL herr_t H5HF__hdr_delete(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_hdr_dest(H5HF_hdr_t *hdr); /* Indirect block routines */ H5_DLL herr_t H5HF_iblock_incr(H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF_iblock_decr(H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__iblock_decr(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF_iblock_dirty(H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size); -H5_DLL herr_t H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size); -H5_DLL herr_t H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node); -H5_DLL herr_t H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_indirect_t *par_iblock, unsigned par_entry, unsigned nrows, - unsigned max_rows, haddr_t *addr_p); -H5_DLL H5HF_indirect_t *H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, - haddr_t iblock_addr, unsigned iblock_nrows, - H5HF_indirect_t *par_iblock, unsigned par_entry, hbool_t must_protect, - unsigned flags, hbool_t *did_protect); -H5_DLL herr_t H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id, - unsigned cache_flags, hbool_t did_protect); +H5_DLL herr_t H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, + unsigned par_entry, unsigned nrows, unsigned max_rows, haddr_t *addr_p); +H5_DLL H5HF_indirect_t *H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, + unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, + hbool_t must_protect, unsigned flags, hbool_t *did_protect); +H5_DLL herr_t H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, + hbool_t did_protect); H5_DLL herr_t H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t dblock_addr); -H5_DLL herr_t H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry); +H5_DLL herr_t H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry); H5_DLL herr_t H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr); -H5_DLL herr_t H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, - haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, - unsigned par_entry); -H5_DLL herr_t H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, + unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry); +H5_DLL herr_t H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hsize_t *heap_size/*out*/); +H5_DLL herr_t H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, + hsize_t block_off, hsize_t *ret_par_block_off, unsigned *ret_entry); H5_DLL herr_t H5HF_man_iblock_dest(H5HF_indirect_t *iblock); /* Direct block routines */ -H5_DLL herr_t H5HF_man_dblock_new(H5HF_hdr_t *fh, hid_t dxpl_id, size_t request, +H5_DLL herr_t H5HF__man_dblock_new(H5HF_hdr_t *fh, size_t request, H5HF_free_section_t **ret_sec_node); -H5_DLL herr_t H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned par_entry, haddr_t *addr_p, H5HF_free_section_t **ret_sec_node); -H5_DLL herr_t H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_direct_t *dblock, haddr_t dblock_addr); -H5_DLL H5HF_direct_t *H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblock_addr, size_t dblock_size, - H5HF_indirect_t *par_iblock, unsigned par_entry, +H5_DLL herr_t H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, + haddr_t dblock_addr, hbool_t *parent_removed); +H5_DLL H5HF_direct_t *H5HF__man_dblock_protect(H5HF_hdr_t *hdr, haddr_t dblock_addr, + size_t dblock_size, H5HF_indirect_t *par_iblock, unsigned par_entry, + unsigned flags); +H5_DLL herr_t H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, + H5HF_indirect_t **par_iblock, unsigned *par_entry, hbool_t *par_did_protect, unsigned flags); -H5_DLL herr_t H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, - hsize_t obj_off, H5HF_indirect_t **par_iblock, - unsigned *par_entry, hbool_t *par_did_protect, unsigned flags); -H5_DLL herr_t H5HF_man_dblock_delete(H5F_t *f, hid_t dxpl_id, haddr_t dblock_addr, +H5_DLL herr_t H5HF__man_dblock_delete(H5F_t *f, haddr_t dblock_addr, hsize_t dblock_size); H5_DLL herr_t H5HF_man_dblock_dest(H5HF_direct_t *dblock); /* Managed object routines */ -H5_DLL herr_t H5HF_man_insert(H5HF_hdr_t *fh, hid_t dxpl_id, size_t obj_size, +H5_DLL herr_t H5HF__man_insert(H5HF_hdr_t *fh, size_t obj_size, const void *obj, void *id); H5_DLL herr_t H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); H5_DLL void H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p); -H5_DLL herr_t H5HF_man_read(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id, - void *obj); -H5_DLL herr_t H5HF_man_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - const void *obj); -H5_DLL herr_t H5HF_man_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - H5HF_operator_t op, void *op_data); -H5_DLL herr_t H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id); +H5_DLL herr_t H5HF__man_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj); +H5_DLL herr_t H5HF__man_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj); +H5_DLL herr_t H5HF__man_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, + void *op_data); +H5_DLL herr_t H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id); /* 'Huge' object routines */ H5_DLL herr_t H5HF_huge_init(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, +H5_DLL herr_t H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *id); -H5_DLL herr_t H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, - const uint8_t *id, size_t *obj_len_p); -H5_DLL herr_t H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, - const uint8_t *id, hsize_t *obj_off_p); -H5_DLL herr_t H5HF_huge_read(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id, +H5_DLL herr_t H5HF__huge_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, + size_t *obj_len_p); +H5_DLL herr_t H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, const uint8_t *id, + hsize_t *obj_off_p); +H5_DLL herr_t H5HF__huge_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj); -H5_DLL herr_t H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, +H5_DLL herr_t H5HF__huge_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj); -H5_DLL herr_t H5HF_huge_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, +H5_DLL herr_t H5HF__huge_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data); -H5_DLL herr_t H5HF_huge_remove(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id); -H5_DLL herr_t H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id); -H5_DLL herr_t H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id); +H5_DLL herr_t H5HF__huge_remove(H5HF_hdr_t *fh, const uint8_t *id); +H5_DLL herr_t H5HF__huge_term(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__huge_delete(H5HF_hdr_t *hdr); /* 'Huge' object v2 B-tree function callbacks */ H5_DLL herr_t H5HF__huge_bt2_indir_found(const void *nrecord, void *op_data); @@ -748,21 +742,21 @@ H5_DLL herr_t H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5_DLL herr_t H5HF_tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); /* Debugging routines for dumping file structures */ -H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, - hbool_t dump_internal, FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, haddr_t addr, + FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, haddr_t hdr_addr, size_t nrec); H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, haddr_t hdr_addr, unsigned nrows); /* Block iteration routines */ H5_DLL herr_t H5HF_man_iter_init(H5HF_block_iter_t *biter); -H5_DLL herr_t H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_block_iter_t *biter, hsize_t offset); +H5_DLL herr_t H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, + hsize_t offset); H5_DLL herr_t H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, unsigned start_entry); H5_DLL herr_t H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, @@ -779,39 +773,36 @@ H5_DLL herr_t H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5_DLL hbool_t H5HF_man_iter_ready(H5HF_block_iter_t *biter); /* Free space manipulation routines */ -H5_DLL herr_t H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create); -H5_DLL herr_t H5HF_space_add(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *node, unsigned flags); -H5_DLL htri_t H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request, +H5_DLL herr_t H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create); +H5_DLL herr_t H5HF__space_add(H5HF_hdr_t *hdr, H5HF_free_section_t *node, + unsigned flags); +H5_DLL htri_t H5HF__space_find(H5HF_hdr_t *hdr, hsize_t request, H5HF_free_section_t **node); -H5_DLL herr_t H5HF_space_revert_root(const H5HF_hdr_t *hdr, hid_t dxpl_id); -H5_DLL herr_t H5HF_space_create_root(const H5HF_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5HF__space_revert_root(const H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock); -H5_DLL herr_t H5HF_space_size(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t *fs_size); -H5_DLL herr_t H5HF_space_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *node); -H5_DLL herr_t H5HF_space_close(H5HF_hdr_t *hdr, hid_t dxpl_id); -H5_DLL herr_t H5HF_space_delete(H5HF_hdr_t *hdr, hid_t dxpl_id); -H5_DLL herr_t H5HF_space_sect_change_class(H5HF_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5HF__space_size(H5HF_hdr_t *hdr, hsize_t *fs_size); +H5_DLL herr_t H5HF__space_remove(H5HF_hdr_t *hdr, H5HF_free_section_t *node); +H5_DLL herr_t H5HF__space_close(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__space_delete(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16_t new_class); /* Free space section routines */ H5_DLL H5HF_free_section_t *H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry); -H5_DLL herr_t H5HF_sect_single_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect); +H5_DLL herr_t H5HF__sect_single_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); H5_DLL herr_t H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, - H5HF_free_section_t *sect, haddr_t *dblock_addr, size_t *dblock_size); -H5_DLL herr_t H5HF_sect_single_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, size_t amt); -H5_DLL herr_t H5HF_sect_row_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect); -H5_DLL herr_t H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, unsigned *entry_p); + const H5HF_free_section_t *sect, haddr_t *dblock_addr, size_t *dblock_size); +H5_DLL herr_t H5HF__sect_single_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + size_t amt); +H5_DLL herr_t H5HF__sect_row_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); +H5_DLL herr_t H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + unsigned *entry_p); H5_DLL H5HF_indirect_t *H5HF_sect_row_get_iblock(H5HF_free_section_t *sect); -H5_DLL herr_t H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries); -H5_DLL herr_t H5HF_sect_single_free(H5FS_section_info_t *sect); +H5_DLL herr_t H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, + unsigned start_entry, unsigned nentries); +H5_DLL herr_t H5HF__sect_single_free(H5FS_section_info_t *sect); /* Internal operator callbacks */ H5_DLL herr_t H5HF_op_read(const void *obj, size_t obj_len, void *op_data); diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h index 8cf4b3c..5086afb 100644 --- a/src/H5HFprivate.h +++ b/src/H5HFprivate.h @@ -106,36 +106,33 @@ typedef herr_t (*H5HF_operator_t)(const void *obj/*in*/, size_t obj_len, /***************************************/ /* General routines for fractal heap operations */ -H5_DLL H5HF_t *H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam); -H5_DLL H5HF_t *H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr); +H5_DLL H5HF_t *H5HF_create(H5F_t *f, const H5HF_create_t *cparam); +H5_DLL H5HF_t *H5HF_open(H5F_t *f, haddr_t fh_addr); H5_DLL herr_t H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p/*out*/); H5_DLL herr_t H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr/*out*/); -H5_DLL herr_t H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, - const void *obj, void *id/*out*/); -H5_DLL herr_t H5HF_get_obj_len(H5HF_t *fh, hid_t dxpl_id, const void *id, - size_t *obj_len_p/*out*/); -H5_DLL herr_t H5HF_get_obj_off(H5HF_t *fh, hid_t dxpl_id, const void *_id, - hsize_t *obj_off_p/*out*/); -H5_DLL herr_t H5HF_read(H5HF_t *fh, hid_t dxpl_id, const void *id, - void *obj/*out*/); -H5_DLL herr_t H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *id, hbool_t *id_changed, +H5_DLL herr_t H5HF_insert(H5HF_t *fh, size_t size, const void *obj, + void *id/*out*/); +H5_DLL herr_t H5HF_get_obj_len(H5HF_t *fh, const void *id, size_t *obj_len_p/*out*/); +H5_DLL herr_t H5HF_get_obj_off(H5HF_t *fh, const void *_id, hsize_t *obj_off_p/*out*/); +H5_DLL herr_t H5HF_read(H5HF_t *fh, const void *id, void *obj/*out*/); +H5_DLL herr_t H5HF_write(H5HF_t *fh, void *id, hbool_t *id_changed, const void *obj); -H5_DLL herr_t H5HF_op(H5HF_t *fh, hid_t dxpl_id, const void *id, - H5HF_operator_t op, void *op_data); -H5_DLL herr_t H5HF_remove(H5HF_t *fh, hid_t dxpl_id, const void *id); -H5_DLL herr_t H5HF_close(H5HF_t *fh, hid_t dxpl_id); -H5_DLL herr_t H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr); +H5_DLL herr_t H5HF_op(H5HF_t *fh, const void *id, H5HF_operator_t op, + void *op_data); +H5_DLL herr_t H5HF_remove(H5HF_t *fh, const void *id); +H5_DLL herr_t H5HF_close(H5HF_t *fh); +H5_DLL herr_t H5HF_delete(H5F_t *f, haddr_t fh_addr); /* Statistics routines */ H5_DLL herr_t H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats); -H5_DLL herr_t H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size/*out*/); +H5_DLL herr_t H5HF_size(const H5HF_t *fh, hsize_t *heap_size/*out*/); /* Debugging routines */ -H5_DLL herr_t H5HF_id_print(H5HF_t *fh, hid_t dxpl_id, - const void *id, FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_id_print(H5HF_t *fh, const void *id, FILE *stream, + int indent, int fwidth); #ifdef H5HF_DEBUGGING -H5_DLL herr_t H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth); #endif /* H5HF_DEBUGGING */ #endif /* _H5HFprivate_H */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index 42c12ec..66c8414 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -77,58 +77,57 @@ static herr_t H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *parent); /* 'single' section routines */ -static herr_t H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, - hbool_t refresh, H5HF_free_section_t *sect); -static herr_t H5HF_sect_single_full_dblock(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, H5HF_free_section_t *sect); +static herr_t H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); /* 'single' section callbacks */ -static herr_t H5HF_sect_single_add(H5FS_section_info_t **sect, unsigned *flags, +static herr_t H5HF__sect_single_add(H5FS_section_info_t **sect, unsigned *flags, void *udata); -static H5FS_section_info_t *H5HF_sect_single_deserialize(const H5FS_section_class_t *cls, - hid_t dxpl_id, const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, +static H5FS_section_info_t *H5HF__sect_single_deserialize(const H5FS_section_class_t *cls, + const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags); -static htri_t H5HF_sect_single_can_merge(const H5FS_section_info_t *sect1, +static htri_t H5HF__sect_single_can_merge(const H5FS_section_info_t *sect1, const H5FS_section_info_t *sect2, void *udata); -static herr_t H5HF_sect_single_merge(H5FS_section_info_t **sect1, +static herr_t H5HF__sect_single_merge(H5FS_section_info_t **sect1, H5FS_section_info_t *sect2, void *udata); -static htri_t H5HF_sect_single_can_shrink(const H5FS_section_info_t *sect, +static htri_t H5HF__sect_single_can_shrink(const H5FS_section_info_t *sect, void *udata); -static herr_t H5HF_sect_single_shrink(H5FS_section_info_t **_sect, +static herr_t H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *udata); -static herr_t H5HF_sect_single_valid(const H5FS_section_class_t *cls, - const H5FS_section_info_t *sect, hid_t dxpl_id); +static herr_t H5HF__sect_single_valid(const H5FS_section_class_t *cls, + const H5FS_section_info_t *sect); /* 'row' section routines */ static H5HF_free_section_t *H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col, unsigned nentries, H5HF_free_section_t *under_sect); -static herr_t H5HF_sect_row_first(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect); +static herr_t H5HF__sect_row_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); +static herr_t H5HF__sect_row_parent_removed(H5HF_free_section_t *sect); static herr_t H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock); -static herr_t H5HF_sect_row_free_real(H5HF_free_section_t *sect); +static herr_t H5HF__sect_row_free_real(H5HF_free_section_t *sect); /* 'row' section callbacks */ -static herr_t H5HF_sect_row_init_cls(H5FS_section_class_t *cls, void *udata); -static herr_t H5HF_sect_row_term_cls(H5FS_section_class_t *cls); -static herr_t H5HF_sect_row_serialize(const H5FS_section_class_t *cls, +static herr_t H5HF__sect_row_init_cls(H5FS_section_class_t *cls, void *udata); +static herr_t H5HF__sect_row_term_cls(H5FS_section_class_t *cls); +static herr_t H5HF__sect_row_serialize(const H5FS_section_class_t *cls, const H5FS_section_info_t *sect, uint8_t *buf); -static H5FS_section_info_t *H5HF_sect_row_deserialize(const H5FS_section_class_t *cls, - hid_t dxpl_id, const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, +static H5FS_section_info_t *H5HF__sect_row_deserialize(const H5FS_section_class_t *cls, + const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags); -static htri_t H5HF_sect_row_can_merge(const H5FS_section_info_t *sect1, +static htri_t H5HF__sect_row_can_merge(const H5FS_section_info_t *sect1, const H5FS_section_info_t *sect2, void *udata); -static herr_t H5HF_sect_row_merge(H5FS_section_info_t **sect1, +static herr_t H5HF__sect_row_merge(H5FS_section_info_t **sect1, H5FS_section_info_t *sect2, void *udata); -static htri_t H5HF_sect_row_can_shrink(const H5FS_section_info_t *sect, +static htri_t H5HF__sect_row_can_shrink(const H5FS_section_info_t *sect, void *udata); -static herr_t H5HF_sect_row_shrink(H5FS_section_info_t **sect, +static herr_t H5HF__sect_row_shrink(H5FS_section_info_t **sect, void *udata); -static herr_t H5HF_sect_row_free(H5FS_section_info_t *sect); -static herr_t H5HF_sect_row_valid(const H5FS_section_class_t *cls, - const H5FS_section_info_t *sect, hid_t dxpl_id); -static herr_t H5HF_sect_row_debug(const H5FS_section_info_t *sect, +static herr_t H5HF__sect_row_free(H5FS_section_info_t *sect); +static herr_t H5HF__sect_row_valid(const H5FS_section_class_t *cls, + const H5FS_section_info_t *sect); +static herr_t H5HF__sect_row_debug(const H5FS_section_info_t *sect, FILE *stream, int indent, int fwidth); /* 'indirect' section routines */ @@ -136,37 +135,36 @@ static H5HF_free_section_t *H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_indirect_t *iblock, hsize_t iblock_off, unsigned row, unsigned col, unsigned nentries); -static herr_t H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, hbool_t first_child, H5HF_free_section_t **first_row_sect, +static herr_t H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + hbool_t first_child, H5HF_free_section_t **first_row_sect, unsigned space_flags, unsigned start_row, unsigned start_col, unsigned end_row, unsigned end_col); static H5HF_free_section_t *H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect); static herr_t H5HF_sect_indirect_decr(H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_revive_row(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_revive_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_indirect_t *sect_iblock); -static herr_t H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, hbool_t *alloc_from_start); -static herr_t H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned child_entry); -static herr_t H5HF_sect_indirect_first(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static hbool_t H5HF_sect_indirect_is_first(H5HF_free_section_t *sect); static H5HF_indirect_t * H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect); static hsize_t H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect); static H5HF_free_section_t * H5HF_sect_indirect_top(H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect1, H5HF_free_section_t *sect2); -static herr_t H5HF_sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_shrink(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); +static herr_t H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf); -static H5FS_section_info_t *H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, - hid_t dxpl_id, const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, - unsigned *des_flags); +static H5FS_section_info_t *H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, + const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags); static herr_t H5HF_sect_indirect_free(H5HF_free_section_t *sect); static herr_t H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect); @@ -195,15 +193,15 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_SINGLE[1] = {{ NULL, /* Terminate section class */ /* Object methods */ - H5HF_sect_single_add, /* Add section */ + H5HF__sect_single_add, /* Add section */ NULL, /* Serialize section */ - H5HF_sect_single_deserialize, /* Deserialize section */ - H5HF_sect_single_can_merge, /* Can sections merge? */ - H5HF_sect_single_merge, /* Merge sections */ - H5HF_sect_single_can_shrink, /* Can section shrink container?*/ - H5HF_sect_single_shrink, /* Shrink container w/section */ - H5HF_sect_single_free, /* Free section */ - H5HF_sect_single_valid, /* Check validity of section */ + H5HF__sect_single_deserialize, /* Deserialize section */ + H5HF__sect_single_can_merge, /* Can sections merge? */ + H5HF__sect_single_merge, /* Merge sections */ + H5HF__sect_single_can_shrink, /* Can section shrink container?*/ + H5HF__sect_single_shrink, /* Shrink container w/section */ + H5HF__sect_single_free, /* Free section */ + H5HF__sect_single_valid, /* Check validity of section */ NULL, /* Split section node for alignment */ NULL, /* Dump debugging for section */ }}; @@ -220,21 +218,21 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_FIRST_ROW[1] = {{ NULL, /* Class private info */ /* Class methods */ - H5HF_sect_row_init_cls, /* Initialize section class */ - H5HF_sect_row_term_cls, /* Terminate section class */ + H5HF__sect_row_init_cls, /* Initialize section class */ + H5HF__sect_row_term_cls, /* Terminate section class */ /* Object methods */ NULL, /* Add section */ - H5HF_sect_row_serialize, /* Serialize section */ - H5HF_sect_row_deserialize, /* Deserialize section */ - H5HF_sect_row_can_merge, /* Can sections merge? */ - H5HF_sect_row_merge, /* Merge sections */ - H5HF_sect_row_can_shrink, /* Can section shrink container?*/ - H5HF_sect_row_shrink, /* Shrink container w/section */ - H5HF_sect_row_free, /* Free section */ - H5HF_sect_row_valid, /* Check validity of section */ + H5HF__sect_row_serialize, /* Serialize section */ + H5HF__sect_row_deserialize, /* Deserialize section */ + H5HF__sect_row_can_merge, /* Can sections merge? */ + H5HF__sect_row_merge, /* Merge sections */ + H5HF__sect_row_can_shrink, /* Can section shrink container?*/ + H5HF__sect_row_shrink, /* Shrink container w/section */ + H5HF__sect_row_free, /* Free section */ + H5HF__sect_row_valid, /* Check validity of section */ NULL, /* Split section node for alignment */ - H5HF_sect_row_debug, /* Dump debugging for section */ + H5HF__sect_row_debug, /* Dump debugging for section */ }}; /* Class info for "normal row" free space sections */ @@ -246,8 +244,8 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_NORMAL_ROW[1] = {{ NULL, /* Class private info */ /* Class methods */ - H5HF_sect_row_init_cls, /* Initialize section class */ - H5HF_sect_row_term_cls, /* Terminate section class */ + H5HF__sect_row_init_cls, /* Initialize section class */ + H5HF__sect_row_term_cls, /* Terminate section class */ /* Object methods */ NULL, /* Add section */ @@ -257,10 +255,10 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_NORMAL_ROW[1] = {{ NULL, /* Merge sections */ NULL, /* Can section shrink container?*/ NULL, /* Shrink container w/section */ - H5HF_sect_row_free, /* Free section */ - H5HF_sect_row_valid, /* Check validity of section */ + H5HF__sect_row_free, /* Free section */ + H5HF__sect_row_valid, /* Check validity of section */ NULL, /* Split section node for alignment */ - H5HF_sect_row_debug, /* Dump debugging for section */ + H5HF__sect_row_debug, /* Dump debugging for section */ }}; /* Class info for "indirect" free space sections */ @@ -459,7 +457,7 @@ H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) /* Release indirect block, if there was one */ if(iblock) - if(H5HF_iblock_decr(iblock) < 0) + if(H5HF__iblock_decr(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on section's indirect block") /* Release the section */ @@ -523,7 +521,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_locate_parent + * Function: H5HF__sect_single_locate_parent * * Purpose: Locate the parent indirect block for a single section * @@ -536,7 +534,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, +H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, H5HF_free_section_t *sect) { H5HF_indirect_t *sec_iblock; /* Pointer to section indirect block */ @@ -544,7 +542,7 @@ H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, hbool_t did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -554,7 +552,7 @@ H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, HDassert(sect); /* Look up indirect block containing direct blocks for range */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, sect->sect_info.addr, &sec_iblock, &sec_entry, &did_protect, H5AC__READ_ONLY_FLAG) < 0) + if(H5HF__man_dblock_locate(hdr, sect->sect_info.addr, &sec_iblock, &sec_entry, &did_protect, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Increment reference count on indirect block that free section is in */ @@ -565,7 +563,7 @@ H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, if(refresh) { if(sect->u.single.parent) { /* Release hold on previous parent indirect block */ - if(H5HF_iblock_decr(sect->u.single.parent) < 0) + if(H5HF__iblock_decr(sect->u.single.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on section's indirect block") } /* end if */ } /* end if */ @@ -575,17 +573,17 @@ H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, sect->u.single.par_entry = sec_entry; /* Unlock indirect block */ - if(H5HF_man_iblock_unprotect(sec_iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(sec_iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") sec_iblock = NULL; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_single_locate_parent() */ +} /* end H5HF__sect_single_locate_parent() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_revive + * Function: H5HF__sect_single_revive * * Purpose: Update the memory information for a 'single' free section * @@ -598,12 +596,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_single_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect) +H5HF__sect_single_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -621,7 +618,7 @@ H5HF_sect_single_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, } /* end if */ else { /* Look up indirect block information for section */ - if(H5HF_sect_single_locate_parent(hdr, dxpl_id, FALSE, sect) < 0) + if(H5HF__sect_single_locate_parent(hdr, FALSE, sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get section's parent info") } /* end else */ @@ -630,7 +627,7 @@ H5HF_sect_single_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_single_revive() */ +} /* end H5HF__sect_single_revive() */ /*------------------------------------------------------------------------- @@ -647,8 +644,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, - H5HF_free_section_t *sect, haddr_t *dblock_addr, size_t *dblock_size) +H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, + haddr_t *dblock_addr, size_t *dblock_size) { FUNC_ENTER_NOAPI_NOERR @@ -680,7 +677,7 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_reduce + * Function: H5HF__sect_single_reduce * * Purpose: Reduce the size of a single section (possibly freeing it) * and re-add it back to the free space manager for the heap @@ -695,12 +692,12 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, *------------------------------------------------------------------------- */ herr_t -H5HF_sect_single_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, size_t amt) +H5HF__sect_single_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + size_t amt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -713,7 +710,7 @@ H5HF_sect_single_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, /* Check for eliminating the section */ if(sect->sect_info.size == amt) { /* Free single section */ - if(H5HF_sect_single_free((H5FS_section_info_t *)sect) < 0) + if(H5HF__sect_single_free((H5FS_section_info_t *)sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free single section node") } /* end if */ else { @@ -722,17 +719,17 @@ H5HF_sect_single_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, sect->sect_info.size -= amt; /* Re-insert section node into heap's free space */ - if(H5HF_space_add(hdr, dxpl_id, sect, 0) < 0) + if(H5HF__space_add(hdr, sect, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't re-add single section to free space manager") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_single_reduce() */ +} /* end H5HF__sect_single_reduce() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_full_dblock + * Function: H5HF__sect_single_full_dblock * * Purpose: Checks if a single section covers the entire direct block * that it resides in, and converts it to a row section if so @@ -749,15 +746,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_full_dblock(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect) +H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { haddr_t dblock_addr; /* Section's direct block's address */ size_t dblock_size; /* Section's direct block's size */ size_t dblock_overhead; /* Direct block's overhead */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(sect); @@ -774,8 +770,9 @@ H5HF_sect_single_full_dblock(H5HF_hdr_t *hdr, hid_t dxpl_id, if((dblock_size - dblock_overhead) == sect->sect_info.size && hdr->man_dtable.curr_root_rows > 0) { H5HF_direct_t *dblock; /* Pointer to direct block for section */ + hbool_t parent_removed; /* Whether the direct block parent was removed from the file */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, sect->u.single.parent, sect->u.single.par_entry, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, sect->u.single.parent, sect->u.single.par_entry, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") HDassert(H5F_addr_eq(dblock->block_off + dblock_overhead, sect->sect_info.addr)); @@ -784,18 +781,25 @@ H5HF_sect_single_full_dblock(H5HF_hdr_t *hdr, hid_t dxpl_id, HGOTO_ERROR(H5E_HEAP, H5E_CANTCONVERT, FAIL, "can't convert single section into row section") /* Destroy direct block */ - if(H5HF_man_dblock_destroy(hdr, dxpl_id, dblock, dblock_addr) < 0) + if(H5HF__man_dblock_destroy(hdr, dblock, dblock_addr, &parent_removed) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release direct block") dblock = NULL; + + /* If the parent for this direct block was removed and the indirect + * section is still "live", switch it to the "serialized" state. + */ + if(parent_removed && H5FS_SECT_LIVE == sect->u.row.under->sect_info.state) + if(H5HF__sect_row_parent_removed(sect) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUPDATE, FAIL, "can't update section info") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_full_dblock() */ +} /* H5HF__sect_single_full_dblock() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_add + * Function: H5HF__sect_single_add * * Purpose: Perform any actions on section as it is added to free space * manager @@ -809,11 +813,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) +H5HF__sect_single_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Don't need to check section if we are deserializing, because it should * have already been checked when it was first added @@ -822,7 +826,6 @@ H5HF_sect_single_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) H5HF_free_section_t **sect = (H5HF_free_section_t **)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ /* Sanity check */ HDassert(sect); @@ -830,7 +833,7 @@ H5HF_sect_single_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) /* Check if single section covers entire direct block it's in */ /* (converts to row section possibly) */ - if(H5HF_sect_single_full_dblock(hdr, dxpl_id, (*sect)) < 0) + if(H5HF__sect_single_full_dblock(hdr, (*sect)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCONVERT, FAIL, "can't check/convert single section") /* Set the "returned space" flag if the single section was changed @@ -843,11 +846,11 @@ H5HF_sect_single_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_add() */ +} /* H5HF__sect_single_add() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_deserialize + * Function: H5HF__sect_single_deserialize * * Purpose: Deserialize a buffer into a "live" single section * @@ -860,14 +863,14 @@ done: *------------------------------------------------------------------------- */ static H5FS_section_info_t * -H5HF_sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, - hid_t H5_ATTR_UNUSED dxpl_id, const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr, +H5HF__sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, + const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr, hsize_t sect_size, unsigned H5_ATTR_UNUSED *des_flags) { H5HF_free_section_t *new_sect; /* New section */ H5FS_section_info_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(H5F_addr_defined(sect_addr)); @@ -882,11 +885,11 @@ H5HF_sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_deserialize() */ +} /* H5HF__sect_single_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_can_merge + * Function: H5HF__sect_single_can_merge * * Purpose: Can two sections of this type merge? * @@ -902,14 +905,14 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5HF_sect_single_can_merge(const H5FS_section_info_t *_sect1, +H5HF__sect_single_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_info_t *_sect2, void H5_ATTR_UNUSED *_udata) { const H5HF_free_section_t *sect1 = (const H5HF_free_section_t *)_sect1; /* Fractal heap free section */ const H5HF_free_section_t *sect2 = (const H5HF_free_section_t *)_sect2; /* Fractal heap free section */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect1); @@ -927,11 +930,11 @@ H5HF_sect_single_can_merge(const H5FS_section_info_t *_sect1, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_can_merge() */ +} /* H5HF__sect_single_can_merge() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_merge + * Function: H5HF__sect_single_merge * * Purpose: Merge two sections of this type * @@ -947,17 +950,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, +H5HF__sect_single_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, void *_udata) { H5HF_free_section_t **sect1 = (H5HF_free_section_t **)_sect1; /* Fractal heap free section */ H5HF_free_section_t *sect2 = (H5HF_free_section_t *)_sect2; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect1); @@ -970,26 +972,26 @@ H5HF_sect_single_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2 (*sect1)->sect_info.size += sect2->sect_info.size; /* Get rid of second section */ - if(H5HF_sect_single_free((H5FS_section_info_t *)sect2) < 0) + if(H5HF__sect_single_free((H5FS_section_info_t *)sect2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") /* Check to see if we should revive first section */ if((*sect1)->sect_info.state != H5FS_SECT_LIVE) - if(H5HF_sect_single_revive(hdr, dxpl_id, (*sect1)) < 0) + if(H5HF__sect_single_revive(hdr, (*sect1)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") /* Check if single section covers entire direct block it's in */ /* (converts to row section possibly) */ - if(H5HF_sect_single_full_dblock(hdr, dxpl_id, (*sect1)) < 0) + if(H5HF__sect_single_full_dblock(hdr, (*sect1)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCONVERT, FAIL, "can't check/convert single section") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_merge() */ +} /* H5HF__sect_single_merge() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_can_shrink + * Function: H5HF__sect_single_can_shrink * * Purpose: Can this section shrink the container? * @@ -1007,14 +1009,14 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5HF_sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) +H5HF__sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect); @@ -1044,11 +1046,11 @@ H5HF_sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_can_shrink() */ +} /* H5HF__sect_single_can_shrink() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_shrink + * Function: H5HF__sect_single_shrink * * Purpose: Shrink container with section * @@ -1062,18 +1064,17 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void H5_ATTR_UNUSED *_udata) +H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *_udata) { H5HF_free_section_t **sect = (H5HF_free_section_t **)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ H5HF_direct_t *dblock; /* Pointer to direct block for section */ haddr_t dblock_addr; /* Section's direct block's address */ size_t dblock_size; /* Section's direct block's size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect); @@ -1082,7 +1083,7 @@ H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void H5_ATTR_UNUSED *_udata /* Check to see if we should revive section */ if((*sect)->sect_info.state != H5FS_SECT_LIVE) - if(H5HF_sect_single_revive(hdr, dxpl_id, (*sect)) < 0) + if(H5HF__sect_single_revive(hdr, (*sect)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") /* Retrieve direct block address from section */ @@ -1092,30 +1093,29 @@ H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void H5_ATTR_UNUSED *_udata /* Protect the direct block for the section */ /* (should be a root direct block) */ HDassert(dblock_addr == hdr->man_dtable.table_addr); - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, - dblock_size, (*sect)->u.single.parent, (*sect)->u.single.par_entry, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, (*sect)->u.single.parent, (*sect)->u.single.par_entry, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") HDassert(H5F_addr_eq(dblock->block_off + dblock_size, (*sect)->sect_info.addr + (*sect)->sect_info.size)); + /* Get rid of section */ + if(H5HF__sect_single_free((H5FS_section_info_t *)*sect) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") + /* Destroy direct block */ - if(H5HF_man_dblock_destroy(hdr, dxpl_id, dblock, dblock_addr) < 0) + if(H5HF__man_dblock_destroy(hdr, dblock, dblock_addr, NULL) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release direct block") dblock = NULL; - /* Get rid of section */ - if(H5HF_sect_single_free((H5FS_section_info_t *)*sect) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") - /* Indicate that the section has been released */ *sect = NULL; done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_shrink() */ +} /* H5HF__sect_single_shrink() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_free + * Function: H5HF__sect_single_free * * Purpose: Free a 'single' section node * @@ -1129,13 +1129,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_single_free(H5FS_section_info_t *_sect) +H5HF__sect_single_free(H5FS_section_info_t *_sect) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Pointer to section to free */ H5HF_indirect_t *parent = NULL; /* Parent indirect block for section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(sect); @@ -1153,11 +1153,11 @@ H5HF_sect_single_free(H5FS_section_info_t *_sect) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_free() */ +} /* H5HF__sect_single_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_valid + * Function: H5HF__sect_single_valid * * Purpose: Check the validity of a section * @@ -1170,11 +1170,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5FS_section_info_t *_sect, hid_t dxpl_id) +H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5FS_section_info_t *_sect) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Pointer to section to check */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect); @@ -1195,8 +1195,7 @@ H5HF_sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5F HDassert(H5F_addr_defined(iblock->ents[sect->u.single.par_entry].addr)); /* Retrieve direct block address from section */ - /* (Casting away const OK - QAK) */ - status = H5HF_sect_single_dblock_info(iblock->hdr, (H5HF_free_section_t *)sect, &dblock_addr, &dblock_size); + status = H5HF_sect_single_dblock_info(iblock->hdr, (const H5HF_free_section_t *)sect, &dblock_addr, &dblock_size); HDassert(status >= 0); HDassert(H5F_addr_eq(iblock->ents[sect->u.single.par_entry].addr, dblock_addr)); HDassert(dblock_size > 0); @@ -1220,25 +1219,24 @@ H5HF_sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5F H5HF_direct_t *dblock; /* Direct block for section */ /* Protect the direct block for the section */ - dblock = H5HF_man_dblock_protect(iblock->hdr, dxpl_id, dblock_addr, dblock_size, iblock, sect->u.single.par_entry, H5AC__READ_ONLY_FLAG); + dblock = H5HF__man_dblock_protect(iblock->hdr, dblock_addr, dblock_size, iblock, sect->u.single.par_entry, H5AC__READ_ONLY_FLAG); HDassert(dblock); /* Sanity check settings for section */ HDassert(dblock_size == dblock->size); HDassert(dblock->size > sect->sect_info.size); HDassert(H5F_addr_lt(dblock->block_off, sect->sect_info.addr)); - HDassert(H5F_addr_ge((dblock->block_off + dblock->size), - (sect->sect_info.addr + sect->sect_info.size))); + HDassert(H5F_addr_ge((dblock->block_off + dblock->size), (sect->sect_info.addr + sect->sect_info.size))); /* Release direct block */ - status = H5AC_unprotect(iblock->hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET); + status = H5AC_unprotect(iblock->hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET); HDassert(status >= 0); } /* end if */ } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_single_valid() */ +} /* H5HF__sect_single_valid() */ /*------------------------------------------------------------------------- @@ -1330,7 +1328,7 @@ H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "serializing row section not supported yet") /* Release single section's hold on underlying indirect block */ - if(H5HF_iblock_decr(dblock->parent) < 0) + if(H5HF__iblock_decr(dblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") done: @@ -1339,7 +1337,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_revive + * Function: H5HF__sect_row_revive * * Purpose: Update the memory information for a 'row' free section * @@ -1352,11 +1350,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_row_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) +H5HF__sect_row_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1364,20 +1362,28 @@ H5HF_sect_row_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) HDassert(hdr); HDassert(sect); HDassert(sect->u.row.under); - HDassert(sect->sect_info.state == H5FS_SECT_SERIALIZED); + + /* If the indirect section's iblock has been removed from the cache, but the + * section is still marked as "live", switch it to the "serialized" state. + */ + if((H5FS_SECT_LIVE == sect->u.row.under->sect_info.state) + && (TRUE == sect->u.row.under->u.indirect.u.iblock->removed_from_cache)) + if(H5HF__sect_row_parent_removed(sect) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUPDATE, FAIL, "can't update section info") /* Pass along "revive" request to underlying indirect section */ /* (which will mark this section as "live") */ - if(H5HF_sect_indirect_revive_row(hdr, dxpl_id, sect->u.row.under) < 0) + if(H5HF__sect_indirect_revive_row(hdr, sect->u.row.under) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") + HDassert(sect->sect_info.state == H5FS_SECT_LIVE); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_revive() */ +} /* end H5HF__sect_row_revive() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_reduce + * Function: H5HF__sect_row_reduce * * Purpose: Reduce the size of a row section (possibly freeing it) * and re-add it back to the free space manager for the heap @@ -1392,13 +1398,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, +H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned *entry_p) { hbool_t alloc_from_start; /* Whether to allocate from the end of the row */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1416,7 +1422,7 @@ H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, /* Forward row section to indirect routines, to handle reducing underlying indirect section */ alloc_from_start = FALSE; - if(H5HF_sect_indirect_reduce_row(hdr, dxpl_id, sect, &alloc_from_start) < 0) + if(H5HF__sect_indirect_reduce_row(hdr, sect, &alloc_from_start) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce underlying section") /* Determine entry allocated */ @@ -1427,7 +1433,7 @@ H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, /* Check for eliminating the section */ if(sect->u.row.num_entries == 1) { /* Free row section */ - if(H5HF_sect_row_free((H5FS_section_info_t *)sect) < 0) + if(H5HF__sect_row_free((H5FS_section_info_t *)sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free row section node") } /* end if */ else { @@ -1445,17 +1451,17 @@ H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, sect->u.row.checked_out = FALSE; /* Add 'row' section back to free space list */ - if(H5HF_space_add(hdr, dxpl_id, sect, 0) < 0) + if(H5HF__space_add(hdr, sect, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't re-add indirect section to free space manager") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_reduce() */ +} /* end H5HF__sect_row_reduce() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_first + * Function: H5HF__sect_row_first * * Purpose: Make row a "first row" * @@ -1468,11 +1474,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) +H5HF__sect_row_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(hdr); @@ -1485,15 +1491,14 @@ H5HF_sect_row_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) */ if(sect->u.row.checked_out) sect->sect_info.type = H5HF_FSPACE_SECT_FIRST_ROW; - else { + else /* Change row section to be the "first row" */ - if(H5HF_space_sect_change_class(hdr, dxpl_id, sect, H5HF_FSPACE_SECT_FIRST_ROW) < 0) + if(H5HF__space_sect_change_class(hdr, sect, H5HF_FSPACE_SECT_FIRST_ROW) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "can't set row section to be first row") - } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_first() */ +} /* end H5HF__sect_row_first() */ /*------------------------------------------------------------------------- @@ -1531,7 +1536,60 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_init_cls + * Function: H5HF__sect_row_parent_removed + * + * Purpose: Update the information for a row and its parent indirect + * when an indirect block is removed from the metadata cache. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * koziol@lbl.gov + * February 4 2018 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF__sect_row_parent_removed(H5HF_free_section_t *sect) +{ + hsize_t tmp_iblock_off; /* Indirect block offset for row */ + unsigned u; /* Local index value */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Check arguments */ + HDassert(sect); + + /* Get a copy of the indirect block's offset before decrementing refcount on it */ + tmp_iblock_off = sect->u.row.under->u.indirect.u.iblock->block_off; + + /* Decrement the refcount on the indirect block, since serialized sections don't hold a reference */ + if(H5HF__iblock_decr(sect->u.row.under->u.indirect.u.iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") + + /* Switch indirect block info to serialized form */ + /* (Overwrites iblock pointer in the indirect section) */ + sect->u.row.under->u.indirect.u.iblock_off = tmp_iblock_off; + sect->u.row.under->u.indirect.iblock_entries = 0; + + /* Loop over derived row sections and mark them all as 'live' now */ + for(u = 0; u < sect->u.row.under->u.indirect.dir_nrows; u++) + sect->u.row.under->u.indirect.dir_rows[u]->sect_info.state = H5FS_SECT_SERIALIZED; + + /* Mark the indirect section as serialized now */ + sect->u.row.under->sect_info.state = H5FS_SECT_SERIALIZED; + + /* Mark the row section as serialized now */ + sect->sect_info.state = H5FS_SECT_SERIALIZED; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF__sect_row_parent_removed() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF__sect_row_init_cls * * Purpose: Initialize the "row" section class structure * @@ -1548,12 +1606,12 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_init_cls(H5FS_section_class_t *cls, void *_udata) +H5HF__sect_row_init_cls(H5FS_section_class_t *cls, void *_udata) { H5HF_hdr_t *hdr = (H5HF_hdr_t *)_udata; /* Fractal heap header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -1571,11 +1629,11 @@ H5HF_sect_row_init_cls(H5FS_section_class_t *cls, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_init_cls() */ +} /* H5HF__sect_row_init_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_term_cls + * Function: H5HF__sect_row_term_cls * * Purpose: Terminate the "row" section class structure * @@ -1592,11 +1650,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_term_cls(H5FS_section_class_t *cls) +H5HF__sect_row_term_cls(H5FS_section_class_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -1607,11 +1665,11 @@ H5HF_sect_row_term_cls(H5FS_section_class_t *cls) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_term_cls() */ +} /* H5HF__sect_row_term_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_serialize + * Function: H5HF__sect_row_serialize * * Purpose: Serialize a "live" row section into a buffer * @@ -1625,14 +1683,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_serialize(const H5FS_section_class_t *cls, +H5HF__sect_row_serialize(const H5FS_section_class_t *cls, const H5FS_section_info_t *_sect, uint8_t *buf) { H5HF_hdr_t *hdr; /* Fractal heap header */ const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -1648,11 +1706,11 @@ H5HF_sect_row_serialize(const H5FS_section_class_t *cls, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_serialize() */ +} /* H5HF__sect_row_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_deserialize + * Function: H5HF__sect_row_deserialize * * Purpose: Deserialize a buffer into a "live" row section * @@ -1669,14 +1727,13 @@ done: *------------------------------------------------------------------------- */ static H5FS_section_info_t * -H5HF_sect_row_deserialize(const H5FS_section_class_t *cls, hid_t dxpl_id, - const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, - unsigned *des_flags) +H5HF__sect_row_deserialize(const H5FS_section_class_t *cls, const uint8_t *buf, + haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags) { H5HF_hdr_t *hdr; /* Fractal heap header */ H5FS_section_info_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -1686,17 +1743,16 @@ H5HF_sect_row_deserialize(const H5FS_section_class_t *cls, hid_t dxpl_id, /* Forward to indirect routine to deserialize underlying section */ hdr = ((H5HF_sect_private_t *)(cls->cls_private))->hdr; - if(NULL == (ret_value = H5HF_sect_indirect_deserialize(hdr, dxpl_id, buf, - sect_addr, sect_size, des_flags))) + if(NULL == (ret_value = H5HF__sect_indirect_deserialize(hdr, buf, sect_addr, sect_size, des_flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, NULL, "can't deserialize row section's underlying indirect section") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_deserialize() */ +} /* H5HF__sect_row_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_can_merge + * Function: H5HF__sect_row_can_merge * * Purpose: Can two sections of this type merge? * @@ -1712,7 +1768,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5HF_sect_row_can_merge(const H5FS_section_info_t *_sect1, +H5HF__sect_row_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_info_t *_sect2, void H5_ATTR_UNUSED *_udata) { const H5HF_free_section_t *sect1 = (const H5HF_free_section_t *)_sect1; /* Fractal heap free section */ @@ -1720,7 +1776,7 @@ H5HF_sect_row_can_merge(const H5FS_section_info_t *_sect1, H5HF_free_section_t *top_indir_sect1, *top_indir_sect2; /* Top indirect section for each row */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect1); @@ -1740,7 +1796,7 @@ H5HF_sect_row_can_merge(const H5FS_section_info_t *_sect1, * section. */ if(top_indir_sect1 != top_indir_sect2) { - if(H5HF_sect_indirect_iblock_off(top_indir_sect1) == H5HF_sect_indirect_iblock_off(top_indir_sect2)) { + if(H5HF_sect_indirect_iblock_off(sect1->u.row.under) == H5HF_sect_indirect_iblock_off(sect2->u.row.under)) { /* Check if second section adjoins first section */ if(H5F_addr_eq((top_indir_sect1->sect_info.addr + top_indir_sect1->u.indirect.span_size), top_indir_sect2->sect_info.addr)) HGOTO_DONE(TRUE) @@ -1749,11 +1805,11 @@ H5HF_sect_row_can_merge(const H5FS_section_info_t *_sect1, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_can_merge() */ +} /* H5HF__sect_row_can_merge() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_merge + * Function: H5HF__sect_row_merge * * Purpose: Merge two sections of this type * @@ -1769,17 +1825,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, +H5HF__sect_row_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, void *_udata) { H5HF_free_section_t **sect1 = (H5HF_free_section_t **)_sect1; /* Fractal heap free section */ H5HF_free_section_t *sect2 = (H5HF_free_section_t *)_sect2; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect1); @@ -1795,32 +1850,21 @@ H5HF_sect_row_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, top_indir_sect = H5HF_sect_indirect_top(sect2->u.row.under); /* Shrink away underlying indirect section */ - if(H5HF_sect_indirect_shrink(hdr, dxpl_id, top_indir_sect) < 0) + if(H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't shrink underlying indirect section") } /* end if */ - else { - /* Check to see if we should revive first section */ - if((*sect1)->sect_info.state != H5FS_SECT_LIVE) - if(H5HF_sect_row_revive(hdr, dxpl_id, (*sect1)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") - - /* Check to see if we should revive second section */ - if(sect2->sect_info.state != H5FS_SECT_LIVE) - if(H5HF_sect_row_revive(hdr, dxpl_id, sect2) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") - + else /* Merge rows' underlying indirect sections together */ - if(H5HF_sect_indirect_merge_row(hdr, dxpl_id, (*sect1), sect2) < 0) + if(H5HF__sect_indirect_merge_row(hdr, (*sect1), sect2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMERGE, FAIL, "can't merge underlying indirect sections") - } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_merge() */ +} /* H5HF__sect_row_merge() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_can_shrink + * Function: H5HF__sect_row_can_shrink * * Purpose: Can this section shrink the container? * @@ -1838,14 +1882,14 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5HF_sect_row_can_shrink(const H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) +H5HF__sect_row_can_shrink(const H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect); @@ -1857,11 +1901,11 @@ H5HF_sect_row_can_shrink(const H5FS_section_info_t *_sect, void H5_ATTR_UNUSED * done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_can_shrink() */ +} /* H5HF__sect_row_can_shrink() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_shrink + * Function: H5HF__sect_row_shrink * * Purpose: Shrink container with section * @@ -1875,16 +1919,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) +H5HF__sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) { H5HF_free_section_t **sect = (H5HF_free_section_t **)_sect; /* Fractal heap free section */ H5HF_free_section_t *top_indir_sect; /* Top indirect section for row */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect); @@ -1895,7 +1938,7 @@ H5HF_sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) top_indir_sect = H5HF_sect_indirect_top((*sect)->u.row.under); /* Shrink away underlying indirect section */ - if(H5HF_sect_indirect_shrink(hdr, dxpl_id, top_indir_sect) < 0) + if(H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't shrink underlying indirect section") /* Indicate that the section has been released */ @@ -1903,11 +1946,11 @@ H5HF_sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_shrink() */ +} /* H5HF__sect_row_shrink() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_free_real + * Function: H5HF__sect_row_free_real * * Purpose: Free a 'row' section node * @@ -1921,11 +1964,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_free_real(H5HF_free_section_t *sect) +H5HF__sect_row_free_real(H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(sect); @@ -1935,11 +1978,11 @@ H5HF_sect_row_free_real(H5HF_free_section_t *sect) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_free_real() */ +} /* H5HF__sect_row_free_real() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_free + * Function: H5HF__sect_row_free * * Purpose: Free a 'row' section node * @@ -1953,12 +1996,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_free(H5FS_section_info_t *_sect) +H5HF__sect_row_free(H5FS_section_info_t *_sect) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Pointer to section to free */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(sect); HDassert(sect->u.row.under); @@ -1968,16 +2011,16 @@ H5HF_sect_row_free(H5FS_section_info_t *_sect) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't detach section node") /* Release the section */ - if(H5HF_sect_row_free_real(sect) < 0) + if(H5HF__sect_row_free_real(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_free() */ +} /* H5HF__sect_row_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_valid + * Function: H5HF__sect_row_valid * * Purpose: Check the validity of a section * @@ -1990,8 +2033,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t *_sect, - hid_t H5_ATTR_UNUSED dxpl_id) +H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t *_sect) { H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */ const H5HF_hdr_t *hdr; /* Fractal heap header */ @@ -1999,7 +2041,7 @@ H5HF_sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t * const H5HF_free_section_t *indir_sect; /* Pointer to underlying indirect section */ unsigned indir_idx; /* Index of row in underlying indirect section's row array */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Basic sanity check */ HDassert(cls); @@ -2035,11 +2077,11 @@ H5HF_sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t * } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_row_valid() */ +} /* H5HF__sect_row_valid() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_debug + * Function: H5HF__sect_row_debug * * Purpose: Dump debugging information about an row free space section * @@ -2052,12 +2094,12 @@ H5HF_sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t * *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_debug(const H5FS_section_info_t *_sect, +H5HF__sect_row_debug(const H5FS_section_info_t *_sect, FILE *stream, int indent, int fwidth) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Section to dump info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect); @@ -2083,7 +2125,7 @@ H5HF_sect_row_debug(const H5FS_section_info_t *_sect, } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_row_debug() */ +} /* H5HF__sect_row_debug() */ /*------------------------------------------------------------------------- @@ -2359,7 +2401,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_init_rows + * Function: H5HF__sect_indirect_init_rows * * Purpose: Initialize the derived row sections for a newly created * indirect section @@ -2373,8 +2415,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, hbool_t first_child, H5HF_free_section_t **first_row_sect, +H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + hbool_t first_child, H5HF_free_section_t **first_row_sect, unsigned space_flags, unsigned start_row, unsigned start_col, unsigned end_row, unsigned end_col) { @@ -2389,7 +2431,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2492,11 +2534,10 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, /* Check to see if we should grab the first row section instead of adding it immediately */ if(first_row_sect) *first_row_sect = row_sect; - else { + else /* Add new row section to free space manager for the heap */ - if(H5HF_space_add(hdr, dxpl_id, row_sect, space_flags) < 0) + if(H5HF__space_add(hdr, row_sect, space_flags) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add row section to free space") - } /* end else */ /* Increment reference count for underlying indirect section */ sect->u.indirect.rc++; @@ -2536,7 +2577,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, /* If the child indirect block's address is defined, protect it */ if(H5F_addr_defined(child_iblock_addr)) { - if(NULL == (child_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, child_iblock_addr, child_nrows, sect->u.indirect.u.iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (child_iblock = H5HF__man_iblock_protect(hdr, child_iblock_addr, child_nrows, sect->u.indirect.u.iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") } /* end if */ else @@ -2551,7 +2592,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") /* Initialize rows for new indirect section */ - if(H5HF_sect_indirect_init_rows(hdr, dxpl_id, child_sect, + if(H5HF__sect_indirect_init_rows(hdr, child_sect, first_child, first_row_sect, space_flags, 0, 0, (child_nrows - 1), (hdr->man_dtable.cparam.width - 1)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize indirect section") @@ -2559,7 +2600,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, /* If we have a valid child indirect block, release it now */ /* (will be pinned, if rows reference it) */ if(child_iblock) - if(H5HF_man_iblock_unprotect(child_iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(child_iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") /* Attach child section to this section */ @@ -2607,11 +2648,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_init_rows() */ +} /* end H5HF__sect_indirect_init_rows() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_add + * Function: H5HF__sect_indirect_add * * Purpose: Add a new 'indirect' section to the free space manager for this * heap @@ -2625,8 +2666,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries) +H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, + unsigned start_entry, unsigned nentries) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ H5HF_free_section_t *first_row_sect = NULL; /* First row section in new indirect section */ @@ -2639,7 +2680,7 @@ H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -2669,7 +2710,7 @@ H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id, HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") /* Initialize rows for new indirect section */ - if(H5HF_sect_indirect_init_rows(hdr, dxpl_id, sect, TRUE, &first_row_sect, + if(H5HF__sect_indirect_init_rows(hdr, sect, TRUE, &first_row_sect, H5FS_ADD_SKIP_VALID, start_row, start_col, end_row, end_col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize indirect section") HDassert(first_row_sect); @@ -2677,7 +2718,7 @@ H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id, /* Now that underlying indirect section is consistent, add first row * section to free space manager for the heap */ - if(H5HF_space_add(hdr, dxpl_id, first_row_sect, H5FS_ADD_RETURNED_SPACE) < 0) + if(H5HF__space_add(hdr, first_row_sect, H5FS_ADD_RETURNED_SPACE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add row section to free space") done: @@ -2686,7 +2727,7 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_add() */ +} /* end H5HF__sect_indirect_add() */ /*------------------------------------------------------------------------- @@ -2741,7 +2782,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_revive_row + * Function: H5HF__sect_indirect_revive_row * * Purpose: Update the memory information for a 'indirect' free section * @@ -2754,14 +2795,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_revive_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) +H5HF__sect_indirect_revive_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { H5HF_indirect_t *sec_iblock; /* Pointer to section indirect block */ hbool_t did_protect; /* Whether we protected the indirect block or not */ - unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2771,44 +2811,24 @@ H5HF_sect_indirect_revive_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ HDassert(sect->sect_info.state == H5FS_SECT_SERIALIZED); /* Look up indirect block containing indirect blocks for section */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, sect->sect_info.addr, &sec_iblock, NULL, &did_protect, H5AC__READ_ONLY_FLAG) < 0) + if(H5HF__man_dblock_locate(hdr, sect->sect_info.addr, &sec_iblock, NULL, &did_protect, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") - /* Increment reference count on indirect block that free section is in */ - if(H5HF_iblock_incr(sec_iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") - - /* Set the pointer to the section's indirect block */ - sect->u.indirect.u.iblock = sec_iblock; - - /* Set the number of entries in the indirect block */ - sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width * - sect->u.indirect.u.iblock->max_rows; + /* Review the section */ + if(H5HF__sect_indirect_revive(hdr, sect, sec_iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") +done: /* Unlock indirect block */ - if(H5HF_man_iblock_unprotect(sec_iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") - sec_iblock = NULL; - - /* Section is "live" now */ - sect->sect_info.state = H5FS_SECT_LIVE; - - /* Loop over derived row sections and mark them all as 'live' now */ - for(u = 0; u < sect->u.indirect.dir_nrows; u++) - sect->u.indirect.dir_rows[u]->sect_info.state = H5FS_SECT_LIVE; - - /* Revive parent indirect section, if there is one */ - if(sect->u.indirect.parent && sect->u.indirect.parent->sect_info.state == H5FS_SECT_SERIALIZED) - if(H5HF_sect_indirect_revive(hdr, dxpl_id, sect->u.indirect.parent, sect->u.indirect.u.iblock->parent) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") + if(sec_iblock && H5HF__man_iblock_unprotect(sec_iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) + HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") -done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_revive_row() */ +} /* end H5HF__sect_indirect_revive_row() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_revive + * Function: H5HF__sect_indirect_revive * * Purpose: Update the memory information for a 'indirect' free section * @@ -2821,13 +2841,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, H5HF_indirect_t *sect_iblock) +H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + H5HF_indirect_t *sect_iblock) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2857,16 +2877,16 @@ H5HF_sect_indirect_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, /* Revive parent indirect section, if there is one */ if(sect->u.indirect.parent && sect->u.indirect.parent->sect_info.state == H5FS_SECT_SERIALIZED) - if(H5HF_sect_indirect_revive(hdr, dxpl_id, sect->u.indirect.parent, sect->u.indirect.u.iblock->parent) < 0) + if(H5HF__sect_indirect_revive(hdr, sect->u.indirect.parent, sect->u.indirect.u.iblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_revive() */ +} /* end H5HF__sect_indirect_revive() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_reduce_row + * Function: H5HF__sect_indirect_reduce_row * * Purpose: Remove a block from an indirect section (possibly freeing it) * and re-add it back to the free space manager for the heap @@ -2881,7 +2901,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *row_sect, +H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, hbool_t *alloc_from_start) { H5HF_free_section_t *sect; /* Indirect section underlying row section */ @@ -2896,7 +2916,7 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ H5HF_free_section_t *peer_sect = NULL; /* Peer indirect section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2941,14 +2961,14 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ is_first = H5HF_sect_indirect_is_first(sect); /* Remove this indirect section from parent indirect section */ - if(H5HF_sect_indirect_reduce(hdr, dxpl_id, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) + if(H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce parent indirect section") sect->u.indirect.parent = NULL; sect->u.indirect.par_entry = 0; /* If we weren't the first section, set "first row" for this indirect section */ if(!is_first) - if(H5HF_sect_indirect_first(hdr, dxpl_id, sect) < 0) + if(H5HF__sect_indirect_first(hdr, sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for indirect section") } /* end if */ @@ -2983,7 +3003,7 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ /* Make new "first row" in indirect section */ if(row_sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW) - if(H5HF_sect_row_first(hdr, dxpl_id, sect->u.indirect.dir_rows[0]) < 0) + if(H5HF__sect_row_first(hdr, sect->u.indirect.dir_rows[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for indirect section") } /* end if */ else { @@ -2996,7 +3016,7 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ /* Make new "first row" in indirect section */ if(row_sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW) - if(H5HF_sect_indirect_first(hdr, dxpl_id, sect->u.indirect.indir_ents[0]) < 0) + if(H5HF__sect_indirect_first(hdr, sect->u.indirect.indir_ents[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for child indirect section") } /* end else */ } /* end if */ @@ -3133,11 +3153,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_reduce_row() */ +} /* end H5HF__sect_indirect_reduce_row() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_reduce + * Function: H5HF__sect_indirect_reduce * * Purpose: Reduce the size of a indirect section (possibly freeing it) * and re-add it back to the free space manager for the heap @@ -3152,7 +3172,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, +H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned child_entry) { unsigned start_entry; /* Entry for first block covered */ @@ -3163,7 +3183,7 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s H5HF_free_section_t *peer_sect = NULL; /* Peer indirect section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -3190,14 +3210,14 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s is_first = H5HF_sect_indirect_is_first(sect); /* Reduce parent indirect section */ - if(H5HF_sect_indirect_reduce(hdr, dxpl_id, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) + if(H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce parent indirect section") sect->u.indirect.parent = NULL; sect->u.indirect.par_entry = 0; /* If we weren't the first section, set "first row" for this indirect section */ if(!is_first) - if(H5HF_sect_indirect_first(hdr, dxpl_id, sect) < 0) + if(H5HF__sect_indirect_first(hdr, sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for indirect section") } /* end if */ @@ -3229,7 +3249,7 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s HDassert(sect->u.indirect.indir_ents[0]); /* Make new "first row" in new first indirect child section */ - if(H5HF_sect_indirect_first(hdr, dxpl_id, sect->u.indirect.indir_ents[0]) < 0) + if(H5HF__sect_indirect_first(hdr, sect->u.indirect.indir_ents[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for child indirect section") } /* end if */ else if(child_entry == end_entry) { @@ -3335,7 +3355,7 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s (peer_sect->u.indirect.indir_nents + peer_sect->u.indirect.dir_nrows)); /* Make new "first row" in peer section */ - if(H5HF_sect_indirect_first(hdr, dxpl_id, peer_sect->u.indirect.indir_ents[0]) < 0) + if(H5HF__sect_indirect_first(hdr, peer_sect->u.indirect.indir_ents[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for peer indirect section") /* Reset the peer_sect variable, to indicate that it has been hooked into the data structures correctly and shouldn't be freed */ @@ -3369,7 +3389,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_reduce() */ +} /* end H5HF__sect_indirect_reduce() */ /*------------------------------------------------------------------------- @@ -3408,7 +3428,7 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_first + * Function: H5HF__sect_indirect_first * * Purpose: Make new 'first row' for indirect section * @@ -3421,11 +3441,11 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) +H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(hdr); @@ -3440,7 +3460,7 @@ H5HF_sect_indirect_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *se HDassert(sect->u.indirect.dir_rows[0]); /* Change first row section in indirect section to be the "first row" */ - if(H5HF_sect_row_first(hdr, dxpl_id, sect->u.indirect.dir_rows[0]) < 0) + if(H5HF__sect_row_first(hdr, sect->u.indirect.dir_rows[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "can't set row section to be first row") } /* end if */ else { @@ -3450,13 +3470,13 @@ H5HF_sect_indirect_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *se HDassert(sect->u.indirect.indir_ents[0]); /* Forward to first child indirect section */ - if(H5HF_sect_indirect_first(hdr, dxpl_id, sect->u.indirect.indir_ents[0]) < 0) + if(H5HF__sect_indirect_first(hdr, sect->u.indirect.indir_ents[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "can't set child indirect section to be first row") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_first() */ +} /* end H5HF__sect_indirect_first() */ /*------------------------------------------------------------------------- @@ -3489,7 +3509,7 @@ H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect) /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_merge_row + * Function: H5HF__sect_indirect_merge_row * * Purpose: Merge two sections of this type * @@ -3505,8 +3525,8 @@ H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *row_sect1, H5HF_free_section_t *row_sect2) +H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, + H5HF_free_section_t *row_sect2) { H5HF_free_section_t *sect1, *sect2; /* Indirect sections underlying row sections */ unsigned start_entry1; /* Start entry for section #1 */ @@ -3518,16 +3538,14 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check parameters */ HDassert(hdr); HDassert(row_sect1); HDassert(row_sect1->u.row.under); - HDassert(row_sect1->sect_info.state == H5FS_SECT_LIVE); HDassert(row_sect2); HDassert(row_sect2->u.row.under); - HDassert(row_sect2->sect_info.state == H5FS_SECT_LIVE); HDassert(row_sect2->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Set up indirect section information */ @@ -3537,13 +3555,8 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, HDassert(sect2); /* Sanity check some assumptions about the indirect sections */ - HDassert(sect1->sect_info.state == H5FS_SECT_LIVE); HDassert(sect1->u.indirect.span_size > 0); - HDassert(sect1->u.indirect.iblock_entries > 0); - HDassert(sect2->sect_info.state == H5FS_SECT_LIVE); HDassert(sect2->u.indirect.span_size > 0); - HDassert(sect2->u.indirect.iblock_entries > 0); - HDassert(sect1->u.indirect.iblock_entries == sect2->u.indirect.iblock_entries); /* Set up span information */ start_row1 = sect1->u.indirect.row; @@ -3558,6 +3571,7 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, * row, and thus have no row sections of it's own) */ if(sect2->u.indirect.dir_nrows > 0) { + hsize_t sect1_iblock_off, sect2_iblock_off; /* Offset of indirect block underlying row section */ unsigned new_dir_nrows1; /* New value for number of direct rows in first section */ unsigned src_row2; /* Source row for copying from second section */ unsigned nrows_moved2; /* Number of rows to move from second section to first */ @@ -3571,9 +3585,18 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, HDassert(sect1->u.indirect.dir_nrows > 0); HDassert(sect1->u.indirect.dir_rows); + /* Get the offsets for the indirect blocks under the rows */ + if(H5FS_SECT_LIVE == row_sect1->u.row.under->sect_info.state) + sect1_iblock_off = row_sect1->u.row.under->u.indirect.u.iblock->block_off; + else + sect1_iblock_off = row_sect1->u.row.under->u.indirect.u.iblock_off; + if(H5FS_SECT_LIVE == row_sect2->u.row.under->sect_info.state) + sect2_iblock_off = row_sect2->u.row.under->u.indirect.u.iblock->block_off; + else + sect2_iblock_off = row_sect2->u.row.under->u.indirect.u.iblock_off; + /* Check for sections sharing a row in the same underlying indirect block */ - if(row_sect1->u.row.under->u.indirect.u.iblock->block_off == row_sect2->u.row.under->u.indirect.u.iblock->block_off - && end_row1 == start_row2) { + if(sect1_iblock_off == sect2_iblock_off && end_row1 == start_row2) { H5HF_free_section_t *last_row_sect1; /* Last row in first indirect section */ /* Locate the last row section in first indirect section, if we don't already have it */ @@ -3689,14 +3712,14 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, (sect1->u.indirect.indir_nents + sect1->u.indirect.dir_nrows)); /* Wrap up, freeing or re-inserting second row section */ - /* (want this to be after the first indirection section is consistent again) */ + /* (want this to be after the first indirect section is consistent again) */ if(merged_rows) { /* Release second row section */ /* (indirectly releases second indirect section, since all of it's * other dependents are gone) */ HDassert(sect2->u.indirect.rc == 1); - if(H5HF_sect_row_free((H5FS_section_info_t *)row_sect2) < 0) + if(H5HF__sect_row_free((H5FS_section_info_t *)row_sect2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free row section") } /* end if */ else { @@ -3715,7 +3738,7 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, * from the free space manager and needs to be re-added) */ row_sect2->sect_info.type = H5HF_FSPACE_SECT_NORMAL_ROW; - if(H5HF_space_add(hdr, dxpl_id, row_sect2, H5FS_ADD_SKIP_VALID) < 0) + if(H5HF__space_add(hdr, row_sect2, H5FS_ADD_SKIP_VALID) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't re-add second row section to free space") } /* end else */ @@ -3724,17 +3747,17 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, if(sect1->u.indirect.iblock_entries == sect1->u.indirect.num_entries) { /* Build parent section for fully populated indirect section */ HDassert(sect1->u.indirect.parent == NULL); - if(H5HF_sect_indirect_build_parent(hdr, sect1) < 0) + if(H5HF__sect_indirect_build_parent(hdr, sect1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "can't create parent for full indirect section") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_merge_row() */ +} /* end H5HF__sect_indirect_merge_row() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_build_parent + * Function: H5HF__sect_indirect_build_parent * * Purpose: Build a parent indirect section for a full indirect section * @@ -3747,19 +3770,21 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) +H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { H5HF_indirect_t *par_iblock; /* Indirect block for parent section */ H5HF_free_section_t *par_sect = NULL; /* Parent indirect section */ + hsize_t par_block_off; /* Offset of parent's block */ unsigned par_row, par_col; /* Row & column in parent indirect section */ unsigned par_entry; /* Entry within parent indirect section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check parameters */ HDassert(hdr); HDassert(sect); + HDassert(H5FS_SECT_LIVE == sect->sect_info.state); HDassert(sect->u.indirect.span_size > 0); HDassert(sect->u.indirect.iblock_entries > 0); HDassert(sect->u.indirect.iblock_entries == sect->u.indirect.num_entries); @@ -3767,16 +3792,26 @@ H5HF_sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HDassert(sect->u.indirect.parent == NULL); /* Get information for creating parent indirect section */ - par_entry = sect->u.indirect.u.iblock->par_entry; + if(sect->u.indirect.u.iblock->parent) { + par_entry = sect->u.indirect.u.iblock->par_entry; + par_iblock = sect->u.indirect.u.iblock->parent; + par_block_off = par_iblock->block_off; + } /* end if */ + else { + /* Retrieve the information for the parent block */ + if(H5HF__man_iblock_parent_info(hdr, sect->sect_info.addr, &par_block_off, &par_entry) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get block entry") + par_iblock = NULL; + } /* end else */ + + /* Compute row & column for block in parent */ par_row = par_entry / hdr->man_dtable.cparam.width; par_col = par_entry % hdr->man_dtable.cparam.width; HDassert(par_row >= hdr->man_dtable.max_direct_rows); - par_iblock = sect->u.indirect.u.iblock->parent; - HDassert(par_iblock); /* Create parent indirect section */ if(NULL == (par_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr, - sect->sect_info.size, par_iblock, par_iblock->block_off, + sect->sect_info.size, par_iblock, par_block_off, par_row, par_col, 1))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -3801,11 +3836,11 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_build_parent() */ +} /* end H5HF__sect_indirect_build_parent() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_shrink + * Function: H5HF__sect_indirect_shrink * * Purpose: "Shrink" container w/section * @@ -3818,12 +3853,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_shrink(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) +H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check parameters */ HDassert(hdr); @@ -3837,18 +3872,18 @@ H5HF_sect_indirect_shrink(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s /* Remove the normal rows from free space manager */ if(sect->u.indirect.dir_rows[u]->sect_info.type != H5HF_FSPACE_SECT_FIRST_ROW) { HDassert(sect->u.indirect.dir_rows[u]->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); - if(H5HF_space_remove(hdr, dxpl_id, sect->u.indirect.dir_rows[u]) < 0) + if(H5HF__space_remove(hdr, sect->u.indirect.dir_rows[u]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove section from heap free space") } /* end if */ /* Release the row section */ - if(H5HF_sect_row_free_real(sect->u.indirect.dir_rows[u]) < 0) + if(H5HF__sect_row_free_real(sect->u.indirect.dir_rows[u]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free child section node") } /* end for */ /* Walk through indirect entries, freeing them (recursively) */ for(u = 0; u < sect->u.indirect.indir_nents; u++) - if(H5HF_sect_indirect_shrink(hdr, dxpl_id, sect->u.indirect.indir_ents[u]) < 0) + if(H5HF__sect_indirect_shrink(hdr, sect->u.indirect.indir_ents[u]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free child section node") /* Free the indirect section itself */ @@ -3857,7 +3892,7 @@ H5HF_sect_indirect_shrink(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_shrink() */ +} /* end H5HF__sect_indirect_shrink() */ /*------------------------------------------------------------------------- @@ -3918,12 +3953,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_deserialize + * Function: H5HF__sect_indirect_deserialize * * Purpose: Deserialize a buffer into a "live" indirect section * * Return: Success: non-negative - * * Failure: negative * * Programmer: Quincey Koziol @@ -3932,9 +3966,8 @@ done: *------------------------------------------------------------------------- */ static H5FS_section_info_t * -H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id, - const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, - unsigned *des_flags) +H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf, + haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags) { H5HF_free_section_t *new_sect; /* New indirect section */ hsize_t iblock_off; /* Indirect block's offset */ @@ -3947,7 +3980,7 @@ H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned end_col; /* End column in indirect block */ H5FS_section_info_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -3981,7 +4014,7 @@ H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id, end_col = end_entry % hdr->man_dtable.cparam.width; /* Initialize rows for new indirect section */ - if(H5HF_sect_indirect_init_rows(hdr, dxpl_id, new_sect, TRUE, NULL, + if(H5HF__sect_indirect_init_rows(hdr, new_sect, TRUE, NULL, H5FS_ADD_DESERIALIZING, new_sect->u.indirect.row, new_sect->u.indirect.col, end_row, end_col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize indirect section") @@ -3994,7 +4027,7 @@ H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_deserialize() */ +} /* H5HF__sect_indirect_deserialize() */ /*------------------------------------------------------------------------- diff --git a/src/H5HFspace.c b/src/H5HFspace.c index 41954fc..5d659a6 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -78,7 +78,7 @@ /*------------------------------------------------------------------------- - * Function: H5HF_space_start + * Function: H5HF__space_start * * Purpose: "Start up" free space for heap - open existing free space * structure if one exists, otherwise create a new free space @@ -92,15 +92,10 @@ * koziol@ncsa.uiuc.edu * May 2 2006 * - * Modifications: - * Vailin Choi, July 29th, 2008 - * Pass values of alignment and threshold to FS_create() and FS_open() - * for handling alignment. - * *------------------------------------------------------------------------- */ herr_t -H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create) +H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create) { const H5FS_section_class_t *classes[] = { /* Free space section classes implemented for fractal heap */ H5HF_FSPACE_SECT_CLS_SINGLE, @@ -109,7 +104,7 @@ H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create) H5HF_FSPACE_SECT_CLS_INDIRECT}; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -119,7 +114,7 @@ H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create) /* Check for creating free space info for the heap */ if(H5F_addr_defined(hdr->fs_addr)) { /* Open an existing free space structure for the heap */ - if(NULL == (hdr->fspace = H5FS_open(hdr->f, dxpl_id, hdr->fs_addr, + if(NULL == (hdr->fspace = H5FS_open(hdr->f, hdr->fs_addr, NELMTS(classes), classes, hdr, (hsize_t)H5HF_FSPACE_THRHD_DEF, (hsize_t)H5HF_FSPACE_ALIGN_DEF))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize free space info") } /* end if */ @@ -136,7 +131,7 @@ H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create) fs_create.max_sect_addr = hdr->man_dtable.cparam.max_index; /* Create the free space structure for the heap */ - if(NULL == (hdr->fspace = H5FS_create(hdr->f, dxpl_id, &hdr->fs_addr, + if(NULL == (hdr->fspace = H5FS_create(hdr->f, &hdr->fs_addr, &fs_create, NELMTS(classes), classes, hdr, (hsize_t)H5HF_FSPACE_THRHD_DEF, (hsize_t)H5HF_FSPACE_ALIGN_DEF))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize free space info") HDassert(H5F_addr_defined(hdr->fs_addr)); @@ -145,11 +140,11 @@ H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_start() */ +} /* end H5HF__space_start() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_add + * Function: H5HF__space_add * * Purpose: Add a section to the free space for the heap * @@ -164,13 +159,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_add(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node, - unsigned flags) +H5HF__space_add(H5HF_hdr_t *hdr, H5HF_free_section_t *node, unsigned flags) { H5HF_sect_add_ud_t udata; /* User data for free space manager 'add' */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -180,29 +174,27 @@ H5HF_space_add(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node, /* Check if the free space for the heap has been initialized */ if(!hdr->fspace) - if(H5HF_space_start(hdr, dxpl_id, TRUE) < 0) + if(H5HF__space_start(hdr, TRUE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space") /* Construct user data */ udata.hdr = hdr; - udata.dxpl_id = dxpl_id; /* Add to the free space for the heap */ - if(H5FS_sect_add(hdr->f, dxpl_id, hdr->fspace, (H5FS_section_info_t *)node, flags, &udata) < 0) + if(H5FS_sect_add(hdr->f, hdr->fspace, (H5FS_section_info_t *)node, flags, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't add section to heap free space") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_add() */ +} /* end H5HF__space_add() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_find + * Function: H5HF__space_find * * Purpose: Attempt to find space in a fractal heap * * Return: Success: non-negative - * * Failure: negative * * Programmer: Quincey Koziol @@ -212,12 +204,12 @@ done: *------------------------------------------------------------------------- */ htri_t -H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request, H5HF_free_section_t **node) +H5HF__space_find(H5HF_hdr_t *hdr, hsize_t request, H5HF_free_section_t **node) { htri_t node_found = FALSE; /* Whether an existing free list node was found */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -228,12 +220,12 @@ H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request, H5HF_free_secti /* Check if the free space for the heap has been initialized */ if(!hdr->fspace) - if(H5HF_space_start(hdr, dxpl_id, FALSE) < 0) + if(H5HF__space_start(hdr, FALSE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space") /* Search for free space in the heap */ if(hdr->fspace) - if((node_found = H5FS_sect_find(hdr->f, dxpl_id, hdr->fspace, request, (H5FS_section_info_t **)node)) < 0) + if((node_found = H5FS_sect_find(hdr->f, hdr->fspace, request, (H5FS_section_info_t **)node)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't locate free space in fractal heap") /* Set return value */ @@ -241,7 +233,7 @@ H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request, H5HF_free_secti done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_find() */ +} /* end H5HF__space_find() */ /*------------------------------------------------------------------------- @@ -277,7 +269,7 @@ H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udat if(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE && sect->sect_info.state == H5FS_SECT_LIVE) { /* Release hold on previous indirect block (we must have one) */ HDassert(sect->u.single.parent); - if(H5HF_iblock_decr(sect->u.single.parent) < 0) + if(H5HF__iblock_decr(sect->u.single.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on section's indirect block") /* Reset parent information */ @@ -291,7 +283,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_space_revert_root + * Function: H5HF__space_revert_root * * Purpose: Reset 'parent' pointers in sections, when the heap is * changing from having a root indirect block to a direct block. @@ -306,11 +298,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_revert_root(const H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__space_revert_root(const H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -318,15 +310,14 @@ H5HF_space_revert_root(const H5HF_hdr_t *hdr, hid_t dxpl_id) HDassert(hdr); /* Only need to scan the sections if the free space has been initialized */ - if(hdr->fspace) { + if(hdr->fspace) /* Iterate over all sections, reseting the parent pointers in 'single' sections */ - if(H5FS_sect_iterate(hdr->f, dxpl_id, hdr->fspace, H5HF_space_revert_root_cb, NULL) < 0) + if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_revert_root_cb, NULL) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to reset parent pointers") - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_revert_root() */ +} /* end H5HF__space_revert_root() */ /*------------------------------------------------------------------------- @@ -383,7 +374,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_space_create_root + * Function: H5HF__space_create_root * * Purpose: Set 'parent' pointers in sections to new indirect block, when * the heap is changing from having a root direct block to a @@ -399,11 +390,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_create_root(const H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *root_iblock) +H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -412,19 +403,18 @@ H5HF_space_create_root(const H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *ro HDassert(root_iblock); /* Only need to scan the sections if the free space has been initialized */ - if(hdr->fspace) { + if(hdr->fspace) /* Iterate over all sections, seting the parent pointers in 'single' sections to the new indirect block */ - if(H5FS_sect_iterate(hdr->f, dxpl_id, hdr->fspace, H5HF_space_create_root_cb, root_iblock) < 0) + if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_create_root_cb, root_iblock) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to set parent pointers") - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_create_root() */ +} /* end H5HF__space_create_root() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_size + * Function: H5HF__space_size * * Purpose: Query the size of the heap's free space info on disk * @@ -438,11 +428,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_size(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t *fs_size) +H5HF__space_size(H5HF_hdr_t *hdr, hsize_t *fs_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -452,7 +442,7 @@ H5HF_space_size(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t *fs_size) /* Check if the free space for the heap has been initialized */ if(!hdr->fspace) - if(H5HF_space_start(hdr, dxpl_id, FALSE) < 0) + if(H5HF__space_start(hdr, FALSE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space") /* Get free space metadata size */ @@ -465,11 +455,11 @@ H5HF_space_size(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t *fs_size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_size() */ +} /* end H5HF__space_size() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_remove + * Function: H5HF__space_remove * * Purpose: Remove a section from the free space for the heap * @@ -483,11 +473,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node) +H5HF__space_remove(H5HF_hdr_t *hdr, H5HF_free_section_t *node) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -497,16 +487,16 @@ H5HF_space_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node) HDassert(node); /* Remove from the free space for the heap */ - if(H5FS_sect_remove(hdr->f, dxpl_id, hdr->fspace, (H5FS_section_info_t *)node) < 0) + if(H5FS_sect_remove(hdr->f, hdr->fspace, (H5FS_section_info_t *)node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove section from heap free space") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_remove() */ +} /* end H5HF__space_remove() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_close + * Function: H5HF__space_close * * Purpose: Close the free space for the heap * @@ -521,11 +511,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_close(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__space_close(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -544,13 +534,13 @@ HDfprintf(stderr, "%s: nsects = %Hu\n", FUNC, nsects); #endif /* QAK */ /* Close the free space for the heap */ - if(H5FS_close(hdr->f, dxpl_id, hdr->fspace) < 0) + if(H5FS_close(hdr->f, hdr->fspace) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") hdr->fspace = NULL; /* Check if we can delete the free space manager for this heap */ if(!nsects) { - if(H5FS_delete(hdr->f, dxpl_id, hdr->fs_addr) < 0) + if(H5FS_delete(hdr->f, hdr->fs_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "can't delete free space info") hdr->fs_addr = HADDR_UNDEF; } /* end if */ @@ -558,11 +548,11 @@ HDfprintf(stderr, "%s: nsects = %Hu\n", FUNC, nsects); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_close() */ +} /* end H5HF__space_close() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_delete + * Function: H5HF__space_delete * * Purpose: Delete the free space manager for the heap * @@ -576,11 +566,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__space_delete(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -588,16 +578,16 @@ H5HF_space_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) HDassert(hdr); /* Delete the free space manager */ - if(H5FS_delete(hdr->f, dxpl_id, hdr->fs_addr) < 0) + if(H5FS_delete(hdr->f, hdr->fs_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "can't delete to free space manager") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_delete() */ +} /* end H5HF__space_delete() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_change_sect_class + * Function: H5HF__space_sect_change_class * * Purpose: Change a section's class * @@ -612,11 +602,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_sect_change_class(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, uint16_t new_class) +H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + uint16_t new_class) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE #ifdef QAK HDfprintf(stderr, "%s: Called\n", FUNC); #endif /* QAK */ @@ -629,10 +620,10 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(sect); /* Notify the free space manager that a section has changed class */ - if(H5FS_sect_change_class(hdr->f, dxpl_id, hdr->fspace, (H5FS_section_info_t *)sect, new_class) < 0) + if(H5FS_sect_change_class(hdr->f, hdr->fspace, (H5FS_section_info_t *)sect, new_class) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMODIFY, FAIL, "can't modify class of free space section") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_sect_change_class() */ +} /* end H5HF__space_sect_change_class() */ diff --git a/src/H5HFstat.c b/src/H5HFstat.c index e38a9b1..7d18ba6 100644 --- a/src/H5HFstat.c +++ b/src/H5HFstat.c @@ -123,7 +123,7 @@ H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats) *------------------------------------------------------------------------- */ herr_t -H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size) +H5HF_size(const H5HF_t *fh, hsize_t *heap_size) { H5HF_hdr_t *hdr; /* Fractal heap header */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ @@ -148,30 +148,30 @@ H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size) /* Check for indirect blocks for managed objects */ if(H5F_addr_defined(hdr->man_dtable.table_addr) && hdr->man_dtable.curr_root_rows != 0) - if(H5HF_man_iblock_size(hdr->f, dxpl_id, hdr, hdr->man_dtable.table_addr, hdr->man_dtable.curr_root_rows, NULL, 0, heap_size) < 0) + if(H5HF__man_iblock_size(hdr->f, hdr, hdr->man_dtable.table_addr, hdr->man_dtable.curr_root_rows, NULL, 0, heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to get fractal heap storage info for indirect block") /* Check for B-tree storage of huge objects in fractal heap */ if(H5F_addr_defined(hdr->huge_bt2_addr)) { /* Open the huge object index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' objects") /* Get the B-tree storage */ - if(H5B2_size(bt2, dxpl_id, heap_size) < 0) + if(H5B2_size(bt2, heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") } /* end if */ /* Get storage for free-space tracking info */ if(H5F_addr_defined(hdr->fs_addr)) { - if(H5HF_space_size(hdr, dxpl_id, &meta_size) < 0) + if(H5HF__space_size(hdr, &meta_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve FS meta storage info") *heap_size += meta_size; } /* end if */ done: /* Release resources */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for tracking 'huge' objects") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HG.c b/src/H5HG.c index 893be80..53f1b2a 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -82,7 +82,7 @@ /* Local Prototypes */ /********************/ -static haddr_t H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size); +static haddr_t H5HG__create(H5F_t *f, size_t size); /*********************/ @@ -114,7 +114,7 @@ H5FL_BLK_DEFINE(gheap_chunk); /*------------------------------------------------------------------------- - * Function: H5HG_create + * Function: H5HG__create * * Purpose: Creates a global heap collection of the specified size. If * SIZE is less than some minimum it will be readjusted. The @@ -133,7 +133,7 @@ H5FL_BLK_DEFINE(gheap_chunk); *------------------------------------------------------------------------- */ static haddr_t -H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size) +H5HG__create(H5F_t *f, size_t size) { H5HG_heap_t *heap = NULL; uint8_t *p = NULL; @@ -141,7 +141,7 @@ H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size) size_t n; haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, HADDR_UNDEF) + FUNC_ENTER_STATIC_TAG(H5AC__GLOBALHEAP_TAG) /* Check args */ HDassert(f); @@ -151,7 +151,7 @@ H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size) /* Create it */ H5_CHECK_OVERFLOW(size, size_t, hsize_t); - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_GHEAP, dxpl_id, (hsize_t)size))) + if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_GHEAP, (hsize_t)size))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file space for global heap") if(NULL == (heap = H5FL_CALLOC(H5HG_heap_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") @@ -207,7 +207,7 @@ H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to add global heap collection to file's CWFS") /* Add the heap to the cache */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_GHEAP, addr, heap, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_GHEAP, addr, heap, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to cache global heap collection") ret_value = addr; @@ -217,7 +217,7 @@ done: if(!H5F_addr_defined(ret_value)) { if(H5F_addr_defined(addr)) { /* Release the space on disk */ - if(H5MF_xfree(f, H5FD_MEM_GHEAP, dxpl_id, addr, (hsize_t)size) < 0) + if(H5MF_xfree(f, H5FD_MEM_GHEAP, addr, (hsize_t)size) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, HADDR_UNDEF, "unable to free global heap") /* Check if the heap object was allocated */ @@ -228,12 +228,12 @@ done: } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, HADDR_UNDEF); -} /* H5HG_create() */ + FUNC_LEAVE_NOAPI_TAG(ret_value); +} /* H5HG__create() */ /*------------------------------------------------------------------------- - * Function: H5HG_protect + * Function: H5HG__protect * * Purpose: Convenience wrapper around H5AC_protect on an indirect block * @@ -245,12 +245,12 @@ done: *------------------------------------------------------------------------- */ H5HG_heap_t * -H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) +H5HG__protect(H5F_t *f, haddr_t addr, unsigned flags) { H5HG_heap_t *heap; /* Global heap */ H5HG_heap_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(f); @@ -260,7 +260,7 @@ H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Lock the heap into memory */ - if(NULL == (heap = (H5HG_heap_t *)H5AC_protect(f, dxpl_id, H5AC_GHEAP, addr, f, flags))) + if(NULL == (heap = (H5HG_heap_t *)H5AC_protect(f, H5AC_GHEAP, addr, f, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect global heap") /* Set the heap's address */ @@ -271,7 +271,7 @@ H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HG_protect() */ +} /* H5HG__protect() */ /*------------------------------------------------------------------------- @@ -412,20 +412,10 @@ done: * Programmer: Quincey Koziol * Saturday, June 12, 2004 * - * Modifications: - * - * John Mainzer, 6/8/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * - * In this case, that required adding the new heap_dirtied_ptr - * parameter to the function's argument list. - * *------------------------------------------------------------------------- */ herr_t -H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need) +H5HG_extend(H5F_t *f, haddr_t addr, size_t need) { H5HG_heap_t *heap = NULL; /* Pointer to heap to extend */ unsigned heap_flags = H5AC__NO_FLAGS_SET; /* Flags to unprotecting heap */ @@ -442,7 +432,7 @@ H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need) HDassert(H5F_addr_defined(addr)); /* Protect the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HG__protect(f, addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") /* Re-allocate the heap information in memory */ @@ -485,7 +475,7 @@ H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need) heap_flags |= H5AC__DIRTIED_FLAG; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, heap->addr, heap, heap_flags) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, heap->addr, heap, heap_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to unprotect heap") FUNC_LEAVE_NOAPI(ret_value) @@ -515,7 +505,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/) +H5HG_insert(H5F_t *f, size_t size, void *obj, H5HG_t *hobj/*out*/) { size_t need; /*total space needed for object */ size_t idx; @@ -524,7 +514,7 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ unsigned heap_flags = H5AC__NO_FLAGS_SET; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ HDassert(f); @@ -539,7 +529,7 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ /* Look for a heap in the file's CWFS that has enough space for the object */ addr = HADDR_UNDEF; - if(H5F_cwfs_find_free_heap(f, dxpl_id, need, &addr) < 0) + if(H5F_cwfs_find_free_heap(f, need, &addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "error trying to locate heap") /* @@ -547,14 +537,14 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ * new collection large enough for the message plus the collection header. */ if(!H5F_addr_defined(addr)) { - addr = H5HG_create(f, dxpl_id, need + H5HG_SIZEOF_HDR(f)); + addr = H5HG__create(f, need + H5HG_SIZEOF_HDR(f)); if(!H5F_addr_defined(addr)) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to allocate a global heap collection") } /* end if */ HDassert(H5F_addr_defined(addr)); - if(NULL == (heap = H5HG_protect(f, dxpl_id, addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HG__protect(f, addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") /* Split the free space to make room for the new object */ @@ -577,10 +567,10 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ hobj->idx = idx; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, heap->addr, heap, heap_flags) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, heap->addr, heap, heap_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to unprotect heap.") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5HG_insert() */ @@ -602,8 +592,7 @@ done: *------------------------------------------------------------------------- */ void * -H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, - size_t *buf_size) +H5HG_read(H5F_t *f, H5HG_t *hobj, void *object/*out*/, size_t *buf_size) { H5HG_heap_t *heap = NULL; /* Pointer to global heap object */ size_t size; /* Size of the heap object */ @@ -611,14 +600,14 @@ H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, void *orig_object = object; /* Keep a copy of the original object pointer */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, NULL) + FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, NULL) /* Check args */ HDassert(f); HDassert(hobj); /* Load the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); @@ -648,13 +637,13 @@ H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, ret_value = object; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, H5AC__NO_FLAGS_SET) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, hobj->addr, heap, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release object header") if(NULL == ret_value && NULL == orig_object && object) H5MM_free(object); - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5HG_read() */ @@ -677,13 +666,13 @@ done: *------------------------------------------------------------------------- */ int -H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) +H5HG_link(H5F_t *f, const H5HG_t *hobj, int adjust) { H5HG_heap_t *heap = NULL; unsigned heap_flags = H5AC__NO_FLAGS_SET; int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ HDassert(f); @@ -692,7 +681,7 @@ H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") /* Load the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") if(adjust != 0) { @@ -710,10 +699,10 @@ H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) ret_value = heap->obj[hobj->idx].nrefs; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, heap_flags) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, hobj->addr, heap, heap_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5HG_link() */ @@ -731,12 +720,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HG_get_obj_size(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, size_t *obj_size) +H5HG_get_obj_size(H5F_t *f, H5HG_t *hobj, size_t *obj_size) { H5HG_heap_t *heap = NULL; /* Pointer to global heap object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ HDassert(f); @@ -744,7 +733,7 @@ H5HG_get_obj_size(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, size_t *obj_size) HDassert(obj_size); /* Load the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); @@ -754,10 +743,10 @@ H5HG_get_obj_size(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, size_t *obj_size) *obj_size = heap->obj[hobj->idx].size; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, H5AC__NO_FLAGS_SET) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, hobj->addr, heap, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5HG_get_obj_size() */ @@ -771,17 +760,10 @@ done: * Programmer: Robb Matzke * Monday, March 30, 1998 * - * Modifications: - * - * John Mainzer - 6/8/05 - * Modified function to use the dirtied parameter of - * H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t -H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) +H5HG_remove (H5F_t *f, H5HG_t *hobj) { H5HG_heap_t *heap = NULL; uint8_t *p = NULL, *obj_start = NULL; @@ -790,7 +772,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) unsigned flags = H5AC__NO_FLAGS_SET;/* Whether the heap gets deleted */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL); + FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ HDassert(f); @@ -799,7 +781,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") /* Load the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); @@ -849,10 +831,10 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) } /* end else */ done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, flags) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, hobj->addr, heap, flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL); + FUNC_LEAVE_NOAPI_TAG(ret_value); } /* end H5HG_remove() */ diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index 6dd94f5..a5e5363 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -83,8 +83,7 @@ *------------------------------------------------------------------------- */ herr_t -H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, - int fwidth) +H5HG_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) { unsigned u, nused, maxobj; unsigned j, k; @@ -101,7 +100,7 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(indent >= 0); HDassert(fwidth >= 0); - if(NULL == (h = H5HG_protect(f, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (h = H5HG__protect(f, addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap collection"); HDfprintf(stream, "%*sGlobal Heap Collection...\n", indent, ""); @@ -169,7 +168,7 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } done: - if (h && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, addr, h, H5AC__NO_FLAGS_SET) < 0) + if (h && H5AC_unprotect(f, H5AC_GHEAP, addr, h, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index 47760bf..a735ba0 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -138,7 +138,7 @@ struct H5HG_heap_t { /* Package Private Prototypes */ /******************************/ H5_DLL herr_t H5HG_free(H5HG_heap_t *heap); -H5_DLL H5HG_heap_t *H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags); +H5_DLL H5HG_heap_t *H5HG__protect(H5F_t *f, haddr_t addr, unsigned flags); #endif /* _H5HGpkg_H */ diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h index 19dcaa4..a7d7a80 100644 --- a/src/H5HGprivate.h +++ b/src/H5HGprivate.h @@ -54,15 +54,14 @@ typedef struct H5HG_heap_t H5HG_heap_t; /* Main global heap routines */ -H5_DLL herr_t H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, - H5HG_t *hobj/*out*/); -H5_DLL void *H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object, size_t *buf_size/*out*/); -H5_DLL int H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust); -H5_DLL herr_t H5HG_get_obj_size(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, size_t *obj_size); -H5_DLL herr_t H5HG_remove(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj); +H5_DLL herr_t H5HG_insert(H5F_t *f, size_t size, void *obj, H5HG_t *hobj/*out*/); +H5_DLL void *H5HG_read(H5F_t *f, H5HG_t *hobj, void *object, size_t *buf_size/*out*/); +H5_DLL int H5HG_link(H5F_t *f, const H5HG_t *hobj, int adjust); +H5_DLL herr_t H5HG_get_obj_size(H5F_t *f, H5HG_t *hobj, size_t *obj_size); +H5_DLL herr_t H5HG_remove(H5F_t *f, H5HG_t *hobj); /* Support routines */ -H5_DLL herr_t H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need); +H5_DLL herr_t H5HG_extend(H5F_t *f, haddr_t addr, size_t need); /* Query routines */ H5_DLL haddr_t H5HG_get_addr(const H5HG_heap_t *h); @@ -70,7 +69,7 @@ H5_DLL size_t H5HG_get_size(const H5HG_heap_t *h); H5_DLL size_t H5HG_get_free_size(const H5HG_heap_t *h); /* Debugging functions */ -H5_DLL herr_t H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5_DLL herr_t H5HG_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth); #endif /* _H5HGprivate_H */ diff --git a/src/H5HL.c b/src/H5HL.c index dd756f5..735077c 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -62,7 +62,7 @@ /********************/ static H5HL_free_t *H5HL__remove_free(H5HL_t *heap, H5HL_free_t *fl); -static herr_t H5HL__minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap); +static herr_t H5HL__minimize_heap_space(H5F_t *f, H5HL_t *heap); static herr_t H5HL__dirty(H5HL_t *heap); @@ -110,7 +110,7 @@ H5FL_BLK_DEFINE(lheap_chunk); */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/)) +H5HL_create(H5F_t *f, size_t size_hint, haddr_t *addr_p/*out*/)) H5HL_t *heap = NULL; /* Heap created */ H5HL_prfx_t *prfx = NULL; /* Heap prefix */ @@ -131,7 +131,7 @@ H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/)) /* Allocate file space */ total_size = heap->prfx_size + size_hint; - if(HADDR_UNDEF == (heap->prfx_addr = H5MF_alloc(f, H5FD_MEM_LHEAP, dxpl_id, total_size))) + if(HADDR_UNDEF == (heap->prfx_addr = H5MF_alloc(f, H5FD_MEM_LHEAP, total_size))) H5E_THROW(H5E_CANTALLOC, "unable to allocate file memory"); /* Initialize info */ @@ -161,7 +161,7 @@ H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/)) H5E_THROW(H5E_CANTALLOC, "memory allocation failed"); /* Add to cache */ - if(FAIL == H5AC_insert_entry(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) + if(FAIL == H5AC_insert_entry(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) H5E_THROW(H5E_CANTINIT, "unable to cache local heap prefix"); /* Set address to return */ @@ -177,7 +177,7 @@ CATCH else { if(heap) { if(H5F_addr_defined(heap->prfx_addr)) - if(FAIL == H5MF_xfree(f, H5FD_MEM_LHEAP, dxpl_id, heap->prfx_addr, total_size)) + if(FAIL == H5MF_xfree(f, H5FD_MEM_LHEAP, heap->prfx_addr, total_size)) H5E_THROW(H5E_CANTFREE, "can't release heap data?"); if(FAIL == H5HL__dest(heap)) H5E_THROW(H5E_CANTFREE, "unable to destroy local heap"); @@ -203,7 +203,7 @@ END_FUNC(PRIV) /* end H5HL_create() */ */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5HL__minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap)) +H5HL__minimize_heap_space(H5F_t *f, H5HL_t *heap)) size_t new_heap_size = heap->dblk_size; /* New size of heap */ @@ -297,7 +297,7 @@ H5HL__minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap)) H5E_THROW(H5E_CANTALLOC, "memory allocation failed"); /* Reallocate data block in file */ - if(FAIL == H5HL__dblk_realloc(f, dxpl_id, heap, new_heap_size)) + if(FAIL == H5HL__dblk_realloc(f, heap, new_heap_size)) H5E_THROW(H5E_CANTRESIZE, "reallocating data block failed"); } /* end if */ @@ -322,7 +322,7 @@ END_FUNC(STATIC) /* H5HL__minimize_heap_space() */ */ BEGIN_FUNC(PRIV, ERR, H5HL_t *, NULL, NULL, -H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags)) +H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags)) H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ H5HL_prfx_t *prfx = NULL; /* Local heap prefix */ @@ -345,7 +345,7 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags)) prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, flags))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix"); /* Get the pointer to the heap */ @@ -360,7 +360,7 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags)) prfx_cache_flags |= H5AC__PIN_ENTRY_FLAG; else { /* Protect the local heap data block */ - if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, heap, flags))) + if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, heap, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap data block"); /* Set the flag for pinning the data block when unprotecting it */ @@ -376,11 +376,11 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags)) CATCH /* Release the prefix from the cache, now pinned */ - if(prfx && heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, prfx_cache_flags) < 0) + if(prfx && heap && H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, prfx_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix"); /* Release the data block from the cache, now pinned */ - if(dblk && heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, dblk_cache_flags) < 0) + if(dblk && heap && H5AC_unprotect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, dblk_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap data block"); END_FUNC(PRIV) /* end H5HL_protect() */ @@ -547,7 +547,7 @@ END_FUNC(STATIC) /* end H5HL__dirty() */ */ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL, -H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void *buf)) +H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf)) H5HL_free_t *fl = NULL, *last_fl = NULL; size_t offset = 0; @@ -635,7 +635,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void * H5_CHECK_OVERFLOW(new_dblk_size, size_t, hsize_t); /* Extend current heap if possible */ - was_extended = H5MF_try_extend(f, dxpl_id, H5FD_MEM_LHEAP, heap->dblk_addr, (hsize_t)(heap->dblk_size), (hsize_t)need_more); + was_extended = H5MF_try_extend(f, H5FD_MEM_LHEAP, heap->dblk_addr, (hsize_t)(heap->dblk_size), (hsize_t)need_more); if(FAIL == was_extended) H5E_THROW(H5E_CANTEXTEND, "error trying to extend heap"); @@ -658,7 +658,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void * } /* end if */ else { /* ...if we can't, allocate a new chunk & release the old */ /* Reallocate data block in file */ - if(FAIL == H5HL__dblk_realloc(f, dxpl_id, heap, new_dblk_size)) + if(FAIL == H5HL__dblk_realloc(f, heap, new_dblk_size)) H5E_THROW(H5E_CANTRESIZE, "reallocating data block failed"); } /* end if */ @@ -761,7 +761,7 @@ END_FUNC(PRIV) /* H5HL_insert() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) +H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size)) H5HL_free_t *fl = NULL; @@ -809,7 +809,7 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) fl2 = H5HL__remove_free(heap, fl2); if(((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) { - if(FAIL == H5HL__minimize_heap_space(f, dxpl_id, heap)) + if(FAIL == H5HL__minimize_heap_space(f, heap)) H5E_THROW(H5E_CANTFREE, "heap size minimization failed"); } H5_LEAVE(SUCCEED); @@ -818,7 +818,7 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) } if(((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) { - if(FAIL == H5HL__minimize_heap_space(f, dxpl_id, heap)) + if(FAIL == H5HL__minimize_heap_space(f, heap)) H5E_THROW(H5E_CANTFREE, "heap size minimization failed"); } H5_LEAVE(SUCCEED); @@ -833,7 +833,7 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) fl2 = H5HL__remove_free(heap, fl2); if(((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) { - if(FAIL == H5HL__minimize_heap_space(f, dxpl_id, heap)) + if(FAIL == H5HL__minimize_heap_space(f, heap)) H5E_THROW(H5E_CANTFREE, "heap size minimization failed"); } /* end if */ H5_LEAVE(SUCCEED); @@ -842,7 +842,7 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) } /* end while */ if(((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) { - if(FAIL == H5HL__minimize_heap_space(f, dxpl_id, heap)) + if(FAIL == H5HL__minimize_heap_space(f, heap)) H5E_THROW(H5E_CANTFREE, "heap size minimization failed"); } /* end if */ H5_LEAVE(SUCCEED); @@ -879,11 +879,9 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) heap->freelist->prev = fl; heap->freelist = fl; - if(((fl->offset + fl->size) == heap->dblk_size) && - ((2 * fl->size) > heap->dblk_size)) { - if(FAIL == H5HL__minimize_heap_space(f, dxpl_id, heap)) + if(((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) + if(FAIL == H5HL__minimize_heap_space(f, heap)) H5E_THROW(H5E_CANTFREE, "heap size minimization failed"); - } /* end if */ CATCH /* No special processing on exit */ @@ -905,7 +903,7 @@ END_FUNC(PRIV) /* end H5HL_remove() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr)) +H5HL_delete(H5F_t *f, haddr_t addr)) H5HL_t *heap = NULL; /* Local heap to delete */ H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ @@ -924,7 +922,7 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr)) prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix"); /* Get the pointer to the heap */ @@ -933,7 +931,7 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr)) /* Check if heap has separate data block */ if(!heap->single_cache_obj) /* Protect the local heap data block */ - if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, heap, H5AC__NO_FLAGS_SET))) + if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, heap, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap data block"); /* Set the flags for releasing the prefix and data block */ @@ -941,11 +939,11 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr)) CATCH /* Release the data block from the cache, now deleted */ - if(dblk && heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, cache_flags) < 0) + if(dblk && heap && H5AC_unprotect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap data block"); /* Release the prefix from the cache, now deleted */ - if(prfx && heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, cache_flags) < 0) + if(prfx && heap && H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix"); END_FUNC(PRIV) /* end H5HL_delete() */ @@ -965,7 +963,7 @@ END_FUNC(PRIV) /* end H5HL_delete() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size)) +H5HL_get_size(H5F_t *f, haddr_t addr, size_t *size)) H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ H5HL_prfx_t *prfx = NULL; /* Local heap prefix */ @@ -983,7 +981,7 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size)) prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix"); /* Get the pointer to the heap */ @@ -993,7 +991,7 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size)) *size = heap->dblk_size; CATCH - if(prfx && FAIL == H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) + if(prfx && FAIL == H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix"); END_FUNC(PRIV) /* end H5HL_get_size() */ @@ -1014,7 +1012,7 @@ END_FUNC(PRIV) /* end H5HL_get_size() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size)) +H5HL_heapsize(H5F_t *f, haddr_t addr, hsize_t *heap_size)) H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ H5HL_prfx_t *prfx = NULL; /* Local heap prefix */ @@ -1032,7 +1030,7 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size)) prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix"); /* Get the pointer to the heap */ @@ -1042,7 +1040,7 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size)) *heap_size += (hsize_t)(heap->prfx_size + heap->dblk_size); CATCH - if(prfx && FAIL == H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) + if(prfx && FAIL == H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix"); END_FUNC(PRIV) /* end H5HL_heapsize() */ diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index 3533a39..e4e6fa8 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -47,7 +47,7 @@ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth)) +H5HL_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth)) H5HL_t *h = NULL; int free_block; @@ -62,7 +62,7 @@ H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int HDassert(indent >= 0); HDassert(fwidth >= 0); - if(NULL == (h = (H5HL_t *)H5HL_protect(f, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (h = (H5HL_t *)H5HL_protect(f, addr, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load/protect local heap"); HDfprintf(stream, "%*sLocal Heap...\n", indent, ""); diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c index 684d7f9..762a213 100644 --- a/src/H5HLdblk.c +++ b/src/H5HLdblk.c @@ -178,7 +178,7 @@ END_FUNC(PKG) /* end H5HL__dblk_dest() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5HL__dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size)) +H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size)) H5HL_dblk_t *dblk; /* Local heap data block */ haddr_t old_addr; /* Old location of heap data block */ @@ -193,12 +193,12 @@ H5HL__dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size)) old_addr = heap->dblk_addr; old_heap_size = heap->dblk_size; H5_CHECK_OVERFLOW(old_heap_size, size_t, hsize_t); - if(FAIL == H5MF_xfree(f, H5FD_MEM_LHEAP, dxpl_id, old_addr, (hsize_t)old_heap_size)) + if(FAIL == H5MF_xfree(f, H5FD_MEM_LHEAP, old_addr, (hsize_t)old_heap_size)) H5E_THROW(H5E_CANTFREE, "can't free old local heap data"); /* Allocate new space on disk */ H5_CHECK_OVERFLOW(new_heap_size, size_t, hsize_t); - if(HADDR_UNDEF == (new_addr = H5MF_alloc(f, H5FD_MEM_LHEAP, dxpl_id, (hsize_t)new_heap_size))) + if(HADDR_UNDEF == (new_addr = H5MF_alloc(f, H5FD_MEM_LHEAP, (hsize_t)new_heap_size))) H5E_THROW(H5E_CANTALLOC, "unable to allocate file space for local heap"); /* Update heap info*/ @@ -240,7 +240,7 @@ H5HL__dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size)) H5E_THROW(H5E_CANTRESIZE, "unable to resize heap prefix in cache"); /* Insert data block into cache (pinned) */ - if(FAIL == H5AC_insert_entry(f, dxpl_id, H5AC_LHEAP_DBLK, new_addr, dblk, H5AC__PIN_ENTRY_FLAG)) + if(FAIL == H5AC_insert_entry(f, H5AC_LHEAP_DBLK, new_addr, dblk, H5AC__PIN_ENTRY_FLAG)) H5E_THROW(H5E_CANTINIT, "unable to cache local heap data block"); dblk = NULL; @@ -257,7 +257,7 @@ H5HL__dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size)) H5E_THROW(H5E_CANTRESIZE, "unable to resize heap data block in cache"); /* Relocate the heap data block in the cache */ - if(FAIL == H5AC_move_entry(f, H5AC_LHEAP_DBLK, old_addr, new_addr, dxpl_id)) + if(FAIL == H5AC_move_entry(f, H5AC_LHEAP_DBLK, old_addr, new_addr)) H5E_THROW(H5E_CANTMOVE, "unable to move heap data block in cache"); } /* end else */ diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 770b7c0..44a2cfb 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -147,6 +147,6 @@ H5_DLL herr_t H5HL__prfx_dest(H5HL_prfx_t *prfx); /* Heap data block routines */ H5_DLL H5HL_dblk_t *H5HL__dblk_new(H5HL_t *heap); H5_DLL herr_t H5HL__dblk_dest(H5HL_dblk_t *dblk); -H5_DLL herr_t H5HL__dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size); +H5_DLL herr_t H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size); #endif /* _H5HLpkg_H */ diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 054d396..4001ef1 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -56,20 +56,18 @@ typedef struct H5HL_t H5HL_t; /* * Library prototypes */ -H5_DLL herr_t H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr/*out*/); -H5_DLL herr_t H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr); -H5_DLL herr_t H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size); -H5_DLL herr_t H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size); -H5_DLL size_t H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t size, - const void *buf); +H5_DLL herr_t H5HL_create(H5F_t *f, size_t size_hint, haddr_t *addr/*out*/); +H5_DLL herr_t H5HL_delete(H5F_t *f, haddr_t addr); +H5_DLL herr_t H5HL_get_size(H5F_t *f, haddr_t addr, size_t *size); +H5_DLL herr_t H5HL_heapsize(H5F_t *f, haddr_t addr, hsize_t *heap_size); +H5_DLL size_t H5HL_insert(H5F_t *f, H5HL_t *heap, size_t size, const void *buf); H5_DLL void *H5HL_offset_into(const H5HL_t *heap, size_t offset); -H5_DLL H5HL_t *H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags); -H5_DLL herr_t H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, - size_t size); +H5_DLL H5HL_t *H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags); +H5_DLL herr_t H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size); H5_DLL herr_t H5HL_unprotect(H5HL_t *heap); /* Debugging routines for dumping file structures */ -H5_DLL herr_t H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, +H5_DLL herr_t H5HL_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth); #endif diff --git a/src/H5I.c b/src/H5I.c index 99f944d..915c13c 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -30,8 +30,9 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Ipkg.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ @@ -126,6 +127,7 @@ static void *H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id); static int H5I__inc_type_ref(H5I_type_t type); static int H5I__get_type_ref(H5I_type_t type); static H5I_id_info_t *H5I__find_id(hid_t id); +static ssize_t H5I__get_name(const H5G_loc_t *loc, char *name, size_t size); #ifdef H5I_DEBUG_OUTPUT static herr_t H5I__debug(H5I_type_t type); #endif /* H5I_DEBUG_OUTPUT */ @@ -1199,6 +1201,7 @@ done: int H5Idec_ref(hid_t id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value = 0; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1207,12 +1210,18 @@ H5Idec_ref(hid_t id) /* Check arguments */ if(id < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Do actual decrement operation */ if((ret_value = H5I_dec_app_ref(id)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Idec_ref() */ @@ -2016,25 +2025,68 @@ ssize_t H5Iget_name(hid_t id, char *name/*out*/, size_t size) { H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "ixz", id, name, size); /* Get object location */ - if (H5G_loc(id, &loc) < 0) + if(H5G_loc(id, &loc) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") - /* Call internal group routine to retrieve object's name */ - if ((ret_value = H5G_get_name(&loc, name, size, NULL, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Call internal routine to retrieve object's name */ + if((ret_value = H5I__get_name(&loc, name, size)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Iget_name() */ /*------------------------------------------------------------------------- + * Function: H5I__get_name + * + * Purpose: Internal routine to retrieve the name for an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: The length of the name + * Failure: -1 + * + * Programmer: Quincey Koziol + * January 9, 2018 + * + *------------------------------------------------------------------------- + */ +static ssize_t +H5I__get_name(const H5G_loc_t *loc, char *name, size_t size) +{ + ssize_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + + /* Retrieve object's name */ + if((ret_value = H5G_get_name(loc, name, size, NULL)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5I__get_name() */ + + +/*------------------------------------------------------------------------- * Function: H5Iget_file_id * * Purpose: The public version of H5I_get_file_id(), obtains the file diff --git a/src/H5Itest.c b/src/H5Itest.c index e7bd2a7..87aa7b9 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -30,6 +30,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ #include "H5Ipkg.h" /* IDs */ @@ -78,6 +79,7 @@ ssize_t H5I_get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached) { H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -86,11 +88,19 @@ H5I_get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached) if(H5G_loc(id, &loc) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Call internal group routine to retrieve object's name */ - if((ret_value = H5G_get_name(&loc, name, size, cached, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5G_get_name(&loc, name, size, cached)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_name_test() */ diff --git a/src/H5L.c b/src/H5L.c index 07f3cdb..fe2cad1 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -23,6 +23,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ @@ -47,14 +48,12 @@ /* User data for path traversal routine for getting link info by name */ typedef struct { H5L_info_t *linfo; /* Buffer to return to user */ - hid_t dxpl_id; /* DXPL to use in callback */ } H5L_trav_gi_t; /* User data for path traversal callback to creating a link */ typedef struct { H5F_t *file; /* Pointer to the file */ H5P_genplist_t *lc_plist; /* Link creation property list */ - hid_t dxpl_id; /* Dataset transfer property list */ H5G_name_t *path; /* Path to object being linked */ H5O_obj_create_t *ocrt_info; /* Pointer to object creation info */ H5O_link_t *lnk; /* Pointer to link information to insert */ @@ -64,11 +63,10 @@ typedef struct { typedef struct { const char *dst_name; /* Destination name for moving object */ H5T_cset_t cset; /* Char set for new name */ - H5G_loc_t *dst_loc; /* Destination location for moving object */ + const H5G_loc_t *dst_loc; /* Destination location for moving object */ unsigned dst_target_flags; /* Target flags for destination object */ hbool_t copy; /* TRUE if this is a copy operation */ - hid_t lapl_id; /* LAPL to use in callback */ - hid_t dxpl_id; /* DXPL to use in callback */ + size_t orig_nlinks; /* The original value for the # of soft / UD links that can be traversed */ } H5L_trav_mv_t; /* User data for path traversal routine for moving and renaming an object */ @@ -76,15 +74,12 @@ typedef struct { H5F_t *file; /* Pointer to the file */ H5O_link_t *lnk; /* Pointer to link information to insert */ hbool_t copy; /* TRUE if this is a copy operation */ - hid_t dxpl_id; /* Dataset transfer property list */ } H5L_trav_mv2_t; /* User data for path traversal routine for checking if a link exists */ typedef struct { /* Down */ char *sep; /* Pointer to next separator in the string */ - hid_t lapl_id; /* Link access property list */ - hid_t dxpl_id; /* Dataset transfer property list */ /* Up */ hbool_t exists; /* Whether the link exists or not */ @@ -96,56 +91,81 @@ typedef struct { void *buf; /* User buffer */ } H5L_trav_gv_t; -/* User data for path traversal routine for removing link */ -typedef struct { - hid_t dxpl_id; /* DXPL to use in callback */ -} H5L_trav_rm_t; - /********************/ /* Local Prototypes */ /********************/ static int H5L_find_class_idx(H5L_type_t id); -static herr_t H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, +static herr_t H5L__create_real(const H5G_loc_t *link_loc, const char *link_name, H5G_name_t *obj_path, H5F_t *obj_file, H5O_link_t *lnk, H5O_obj_create_t *ocrt_info, - hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); -static herr_t H5L_get_val_real(const H5O_link_t *lnk, void *buf, size_t size); -static herr_t H5L_get_val_cb(H5G_loc_t *grp_loc/*in*/, const char *name, + hid_t lcpl_id); +static herr_t H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, + const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id); +static herr_t H5L__create_soft(const char *target_path, const H5G_loc_t *link_loc, + const char *link_name, hid_t lcpl_id); +static herr_t H5L__get_val_real(const H5O_link_t *lnk, void *buf, size_t size); +static herr_t H5L__get_val_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_get_val_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__get_val(const H5G_loc_t *loc, const char *name, + void *buf/*out*/, size_t size); +static herr_t H5L__get_val_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + void *buf/*out*/, size_t size); +static herr_t H5L__delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_delete_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__delete(const H5G_loc_t *loc, const char *name); +static herr_t H5L__delete_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); +static herr_t H5L__move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); +static herr_t H5L__move(const H5G_loc_t *src_loc, const char *src_name, + H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, hid_t lcpl_id); static herr_t H5L__exists_final_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); static herr_t H5L__exists_inter_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_get_info_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static htri_t H5L__exists(const H5G_loc_t *loc, const char *name); +static herr_t H5L__get_info_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_get_info_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__get_info(const H5G_loc_t *loc, const char *name, + H5L_info_t *linfo/*out*/); +static herr_t H5L__get_info_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_get_name_by_idx_cb(H5G_loc_t *grp_loc/*in*/, +static herr_t H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + H5L_info_t *linfo /*out*/); +static herr_t H5L__get_name_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); +static ssize_t H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + char *name /*out*/, size_t size); +static herr_t H5L__iterate(hid_t grp_id, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, + H5L_iterate_t op, void *op_data); +static herr_t H5L__visit(hid_t grp_id, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, + void *op_data); + /*********************/ /* Package Variables */ @@ -284,8 +304,8 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, { H5G_loc_t src_loc, *src_loc_p; H5G_loc_t dst_loc, *dst_loc_p; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value=SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, lcpl_id, @@ -305,11 +325,14 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, - ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), - TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -320,11 +343,12 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, dst_loc_p = src_loc_p; /* Move the link */ - if(H5L_move(src_loc_p, src_name, dst_loc_p, dst_name, FALSE, lcpl_id, - lapl_id, dxpl_id) < 0) + if(H5L__move(src_loc_p, src_name, dst_loc_p, dst_name, FALSE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lmove() */ @@ -349,8 +373,8 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, { H5G_loc_t src_loc, *src_loc_p; H5G_loc_t dst_loc, *dst_loc_p; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value=SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, lcpl_id, @@ -370,11 +394,14 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, - ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), - TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -385,11 +412,12 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, dst_loc_p = src_loc_p; /* Copy the link */ - if(H5L_move(src_loc_p, src_name, dst_loc_p, dst_name, TRUE, lcpl_id, - lapl_id, dxpl_id) < 0) + if(H5L__move(src_loc_p, src_name, dst_loc_p, dst_name, TRUE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcopy() */ @@ -413,11 +441,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Lcreate_soft(const char *link_target, - hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id) +H5Lcreate_soft(const char *link_target, hid_t link_loc_id, + const char *link_name, hid_t lcpl_id, hid_t lapl_id) { H5G_loc_t link_loc; /* Group location for new link */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -433,15 +461,21 @@ H5Lcreate_soft(const char *link_target, if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, link_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Create the link */ - if(H5L_create_soft(link_target, &link_loc, link_name, lcpl_id, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") + if(H5L__create_soft(link_target, &link_loc, link_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_soft() */ @@ -468,8 +502,8 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, { H5G_loc_t cur_loc, *cur_loc_p; H5G_loc_t new_loc, *new_loc_p; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value = SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*si*sii", cur_loc_id, cur_name, new_loc_id, new_name, lcpl_id, @@ -489,9 +523,13 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, cur_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up current & new location pointers */ cur_loc_p = &cur_loc; @@ -504,11 +542,12 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file.") /* Create the link */ - if(H5L_create_hard(cur_loc_p, cur_name, new_loc_p, new_name, - lcpl_id, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") + if(H5L__create_hard(cur_loc_p, cur_name, new_loc_p, new_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_hard() */ @@ -542,8 +581,8 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, const void *udata, size_t udata_size, hid_t lcpl_id, hid_t lapl_id) { H5G_loc_t link_loc; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value = SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE7("e", "i*sLl*xzii", link_loc_id, link_name, link_type, udata, @@ -557,15 +596,21 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, if(link_type < H5L_TYPE_UD_MIN || link_type > H5L_TYPE_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link class") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, link_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Create external link */ - if(H5L_create_ud(&link_loc, link_name, udata, udata_size, link_type, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_ud(&link_loc, link_name, udata, udata_size, link_type, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_ud() */ @@ -591,7 +636,7 @@ herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; /* Group's location */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -603,15 +648,21 @@ H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Unlink */ - if(H5L_delete(&loc, name, lapl_id, dxpl_id) < 0) + if(H5L__delete(&loc, name) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ldelete() */ @@ -636,12 +687,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Ldelete_by_idx(hid_t loc_id, const char *group_name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) +H5Ldelete_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, hid_t lapl_id) { H5G_loc_t loc; /* Group's location */ - H5L_trav_rmbi_t udata; /* User data for callback */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -657,22 +707,21 @@ H5Ldelete_by_idx(hid_t loc_id, const char *group_name, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") - /* Set up user data for unlink operation */ - udata.idx_type = idx_type; - udata.order = order; - udata.n = n; - udata.dxpl_id = dxpl_id; - - /* Traverse the group hierarchy to remove the link */ - if(H5G_traverse(&loc, group_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK|H5G_TARGET_MOUNT, - H5L_delete_by_idx_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist") + /* Delete the link */ + if(H5L__delete_by_idx(&loc, group_name, idx_type, order, n) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ldelete_by_idx() */ @@ -701,7 +750,7 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, hid_t lapl_id) { H5G_loc_t loc; /* Group location for location to query */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -713,15 +762,21 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link value */ - if(H5L_get_val(&loc, name, buf, size, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link value for '%s'", name) + if(H5L__get_val(&loc, name, buf, size) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for '%s'", name) done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_val() */ @@ -750,8 +805,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, hid_t lapl_id) { H5G_loc_t loc; /* Group location for location to query */ - H5L_trav_gvbi_t udata; /* User data for callback */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -768,25 +822,21 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up user data for retrieving information */ - udata.idx_type = idx_type; - udata.order = order; - udata.n = n; - udata.dxpl_id = dxpl_id; - udata.buf = buf; - udata.size = size; - - /* Traverse the group hierarchy to locate the object to get info about */ - if(H5G_traverse(&loc, group_name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L_get_val_by_idx_cb, - &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Get the link value */ + if(H5L__get_val_by_idx(&loc, group_name, idx_type, order, n, buf, size) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_val_by_idx() */ @@ -808,8 +858,8 @@ htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - htri_t ret_value; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("t", "i*si", loc_id, name, lapl_id); @@ -820,15 +870,21 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Check for the existence of the link */ - if((ret_value = H5L_exists(&loc, name, lapl_id, dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info") + if((ret_value = H5L__exists(&loc, name)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lexists() */ @@ -852,8 +908,8 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, hid_t lapl_id) { H5G_loc_t loc; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value = SUCCEED; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*sxi", loc_id, name, linfo, lapl_id); @@ -864,15 +920,21 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link information */ - if(H5L_get_info(&loc, name, linfo, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") + if(H5L__get_info(&loc, name, linfo) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_info() */ @@ -897,8 +959,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, H5L_info_t *linfo /*out*/, hid_t lapl_id) { H5G_loc_t loc; /* Group location for group to query */ - H5L_trav_gibi_t udata; /* User data for callback */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -915,23 +976,21 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") - /* Set up user data for callback */ - udata.idx_type = idx_type; - udata.order = order; - udata.n = n; - udata.dxpl_id = dxpl_id; - udata.linfo = linfo; - - /* Traverse the group hierarchy to locate the object to get info about */ - if(H5G_traverse(&loc, group_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK, - H5L_get_info_by_idx_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") + /* Get the link information */ + if(H5L__get_info_by_idx(&loc, group_name, idx_type, order, n, linfo) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_info_by_idx() */ @@ -969,8 +1028,12 @@ H5Lregister(const H5L_class_t *cls) /* Check H5L_class_t version number; this is where a function to convert * from an outdated version should be called. + * + * v0 of the H5L_class_t is only different in the parameters to the + * traversal callback, which is handled in H5G_traverse_ud() + * (in src/H5Gtraverse.c), so it's allowed to to pass through here. - QAK, 2018/02/06 */ - if(cls->version != H5L_LINK_CLASS_T_VERS) + if(cls->version > H5L_LINK_CLASS_T_VERS) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5L_class_t version number") if(cls->id < H5L_TYPE_UD_MIN || cls->id > H5L_TYPE_MAX) @@ -1086,9 +1149,8 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, char *name /*out*/, size_t size, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - H5L_trav_gnbi_t udata; /* User data for callback */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - ssize_t ret_value; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE8("Zs", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, name, size, @@ -1104,28 +1166,21 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up user data for callback */ - udata.idx_type = idx_type; - udata.order = order; - udata.n = n; - udata.dxpl_id = dxpl_id; - udata.name = name; - udata.size = size; - udata.name_len = -1; - - /* Traverse the group hierarchy to locate the link to get name of */ - if(H5G_traverse(&loc, group_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK, - H5L_get_name_by_idx_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "name doesn't exist") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") - /* Set the return value */ - ret_value = udata.name_len; + /* Get the link information */ + if((ret_value = H5L__get_name_by_idx(&loc, group_name, idx_type, order, n, name, size)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link name") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_name_by_idx() */ @@ -1152,11 +1207,9 @@ herr_t H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data) { - H5I_type_t id_type; /* Type of ID */ - H5G_link_iterate_t lnk_op; /* Link operator */ - hsize_t last_lnk; /* Index of last object looked at */ - hsize_t idx; /* Internal location to hold index */ - herr_t ret_value; /* Return value */ + H5I_type_t id_type; /* Type of ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "iIiIo*hx*x", grp_id, idx_type, order, idx_p, op, op_data); @@ -1172,23 +1225,18 @@ H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, if (!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") - /* Set up iteration beginning/end info */ - idx = (idx_p == NULL ? 0 : *idx_p); - last_lnk = 0; - - /* Build link operator info */ - lnk_op.op_type = H5G_LINK_OP_NEW; - lnk_op.op_func.op_new = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Iterate over the links */ - if ((ret_value = H5G_iterate(grp_id, ".", idx_type, order, idx, &last_lnk, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") - - /* Set the index we stopped at */ - if(idx_p) - *idx_p = last_lnk; + if((ret_value = H5L__iterate(grp_id, ".", idx_type, order, idx_p, op, op_data)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Literate() */ @@ -1220,11 +1268,8 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data, hid_t lapl_id) { - H5G_link_iterate_t lnk_op; /* Link operator */ - hsize_t last_lnk; /* Index of last object looked at */ - hsize_t idx; /* Internal location to hold index */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, group_name, idx_type, order, idx_p, op, @@ -1240,28 +1285,21 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up iteration beginning/end info */ - idx = (idx_p == NULL ? 0 : *idx_p); - last_lnk = 0; - - /* Build link operator info */ - lnk_op.op_type = H5G_LINK_OP_NEW; - lnk_op.op_func.op_new = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Iterate over the links */ - if((ret_value = H5G_iterate(loc_id, group_name, idx_type, order, idx, &last_lnk, &lnk_op, - op_data, lapl_id, dxpl_id)) < 0) + if((ret_value = H5L__iterate(loc_id, group_name, idx_type, order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") - /* Set the index we stopped at */ - if(idx_p) - *idx_p = last_lnk; - done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Literate_by_name() */ @@ -1299,6 +1337,7 @@ H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data) { H5I_type_t id_type; /* Type of ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1315,11 +1354,18 @@ H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") - /* Call internal group visitation routine */ - if((ret_value = H5G_visit(grp_id, ".", idx_type, order, op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link visitation failed") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Call internal routine */ + if((ret_value = H5L__visit(grp_id, ".", idx_type, order, op, op_data)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lvisit() */ @@ -1356,7 +1402,7 @@ herr_t H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id) { - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1373,15 +1419,21 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") - /* Call internal group visitation routine */ - if((ret_value = H5G_visit(loc_id, group_name, idx_type, order, op, op_data, lapl_id, dxpl_id)) < 0) + /* Call internal routine */ + if((ret_value = H5L__visit(loc_id, group_name, idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lvisit_by_name() */ @@ -1572,7 +1624,7 @@ done: */ herr_t H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, - hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id) + hid_t lcpl_id) { H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1594,7 +1646,7 @@ H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, lnk.u.hard.addr = obj_loc->oloc->addr; /* Create the link */ - if(H5L_create_real(new_loc, new_name, obj_loc->path, obj_loc->oloc->file, &lnk, NULL, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_real(new_loc, new_name, obj_loc->path, obj_loc->oloc->file, &lnk, NULL, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object") done: @@ -1616,7 +1668,7 @@ done: */ herr_t H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, - H5O_obj_create_t *ocrt_info, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id) + H5O_obj_create_t *ocrt_info, hid_t lcpl_id) { H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1637,7 +1689,7 @@ H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, lnk.type = H5L_TYPE_HARD; /* Create the link */ - if(H5L_create_real(new_loc, new_name, NULL, NULL, &lnk, ocrt_info, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_real(new_loc, new_name, NULL, NULL, &lnk, ocrt_info, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object") done: @@ -1646,7 +1698,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_link_cb + * Function: H5L__link_cb * * Purpose: Callback for creating a link to an object. * @@ -1658,7 +1710,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk, +H5L__link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_cr_t *udata = (H5L_trav_cr_t *)_udata; /* User data passed in */ @@ -1669,12 +1721,12 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR hbool_t obj_created = FALSE; /* Whether an object was created (through a hard link) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid location */ /* (which is not what we want) */ if(obj_loc != NULL) - HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name already exists") + HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "name already exists") /* Check for crossing file boundaries with a new hard link */ if(udata->lnk->type == H5L_TYPE_HARD) { @@ -1684,8 +1736,8 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR H5G_loc_t new_loc; /* Group location for new object */ /* Create new object at this location */ - if(NULL == (udata->ocrt_info->new_obj = H5O_obj_create(grp_loc->oloc->file, udata->ocrt_info->obj_type, udata->ocrt_info->crt_info, &new_loc, udata->dxpl_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create object") + if(NULL == (udata->ocrt_info->new_obj = H5O_obj_create(grp_loc->oloc->file, udata->ocrt_info->obj_type, udata->ocrt_info->crt_info, &new_loc))) + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create object") /* Set address for hard link */ udata->lnk->u.hard.addr = new_loc.oloc->addr; @@ -1699,7 +1751,7 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR else { /* Check that both objects are in same file */ if(!H5F_SAME_SHARED(grp_loc->oloc->file, udata->file)) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "interfile hard links are not allowed") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "interfile hard links are not allowed") } /* end else */ } /* end if */ @@ -1711,7 +1763,7 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR if(udata->lc_plist) { /* Get character encoding property */ if(H5P_get(udata->lc_plist, H5P_STRCRT_CHAR_ENCODING_NAME, &udata->lnk->cset) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for character encoding") + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get property value for character encoding") } /* end if */ else udata->lnk->cset = H5F_DEFAULT_CSET; /* Default character encoding for link */ @@ -1723,14 +1775,13 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR /* Insert link into group */ if(H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, udata->ocrt_info ? udata->ocrt_info->obj_type : H5O_TYPE_UNKNOWN, - udata->ocrt_info ? udata->ocrt_info->crt_info : NULL, - udata->dxpl_id) < 0) + udata->ocrt_info ? udata->ocrt_info->crt_info : NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link for object") /* Set object's path if it has been passed in and is not set */ if(udata->path != NULL && udata->path->user_path_r == NULL) if(H5G_name_set(grp_loc->path, udata->path, name) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "cannot set name") + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "cannot set name") /* If link is a user-defined link, trigger its creation callback if it has one */ if(udata->lnk->type >= H5L_TYPE_UD_MIN) { @@ -1749,17 +1800,17 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR */ H5G_name_reset(&temp_path); if(H5O_loc_copy(&temp_oloc, grp_loc->oloc, H5_COPY_DEEP) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCOPY, FAIL, "unable to copy object location") + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object location") temp_loc.oloc = &temp_oloc; temp_loc.path = &temp_path; temp_loc_init = TRUE; /* Set up location for user-defined callback */ - if((grp = H5G_open(&temp_loc, udata->dxpl_id)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") + if(NULL == (grp = H5G_open(&temp_loc))) + HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group") if((grp_id = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register ID for group") + HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register ID for group") /* Make callback */ if((link_class->create_func)(name, grp_id, udata->lnk->u.ud.udata, udata->lnk->u.ud.size, H5P_DEFAULT) < 0) @@ -1778,18 +1829,18 @@ done: oloc.addr = udata->lnk->u.hard.addr; /* Decrement refcount on new object's object header in memory */ - if(H5O_dec_rc_by_loc(&oloc, udata->dxpl_id) < 0) + if(H5O_dec_rc_by_loc(&oloc) < 0) HDONE_ERROR(H5E_LINK, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") } /* end if */ /* Close the location given to the user callback if it was created */ if(grp_id >= 0) { if(H5I_dec_app_ref(grp_id) < 0) - HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") + HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") } /* end if */ else if(grp != NULL) { if(H5G_close(grp) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback") + HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback") } /* end if */ else if(temp_loc_init) H5G_loc_free(&temp_loc); @@ -1799,11 +1850,11 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_link_cb() */ +} /* end H5L__link_cb() */ /*------------------------------------------------------------------------- - * Function: H5L_create_real + * Function: H5L__create_real * * Purpose: Creates a link at a path location * @@ -1822,9 +1873,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, +H5L__create_real(const H5G_loc_t *link_loc, const char *link_name, H5G_name_t *obj_path, H5F_t *obj_file, H5O_link_t *lnk, - H5O_obj_create_t *ocrt_info, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id) + H5O_obj_create_t *ocrt_info, hid_t lcpl_id) { char *norm_link_name = NULL; /* Pointer to normalized link name */ unsigned target_flags = H5G_TARGET_NORMAL; /* Flags to pass to group traversal function */ @@ -1832,7 +1883,7 @@ H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, H5L_trav_cr_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(link_loc); @@ -1842,7 +1893,7 @@ H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, /* Get normalized link name */ if((norm_link_name = H5G_normalize(link_name)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize name") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name") /* Check for flags present in creation property list */ if(lcpl_id != H5P_DEFAULT) { @@ -1864,7 +1915,6 @@ H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, * FILE is used to make sure that hard links don't cross files, and * should be NULL for other link types. * LC_PLIST is a pointer to the link creation property list. - * DXPL_ID is the dxpl ID that needs to be used during writes and reads. * PATH is a pointer to the path of the object being inserted if this is * a hard link; this is used to set the paths to objects when they are * created. For other link types, this is NULL. @@ -1875,14 +1925,13 @@ H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, */ udata.file = obj_file; udata.lc_plist = lc_plist; - udata.dxpl_id = dxpl_id; udata.path = obj_path; udata.ocrt_info = ocrt_info; udata.lnk = lnk; /* Traverse the destination path & create new link */ - if(H5G_traverse(link_loc, link_name, target_flags, H5L_link_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert link") + if(H5G_traverse(link_loc, link_name, target_flags, H5L__link_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert link") done: /* Free the normalized path name */ @@ -1890,7 +1939,7 @@ done: H5MM_xfree(norm_link_name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_create_real() */ +} /* end H5L__create_real() */ /*------------------------------------------------------------------------- @@ -1907,8 +1956,7 @@ done: */ herr_t H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, - const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id, - hid_t lapl_id, hid_t dxpl_id) + const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id) { char *norm_cur_name = NULL; /* Pointer to normalized current name */ H5F_t *link_file = NULL; /* Pointer to file to link to */ @@ -1929,7 +1977,7 @@ H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, /* Get normalized copy of the current name */ if((norm_cur_name = H5G_normalize(cur_name)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize name") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name") /* Set up link data specific to hard links */ lnk.type = H5L_TYPE_HARD; @@ -1938,8 +1986,8 @@ H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, obj_loc.path = &path; obj_loc.oloc = &oloc; H5G_loc_reset(&obj_loc); - if(H5G_loc_find(cur_loc, norm_cur_name, &obj_loc, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "source object not found") + if(H5G_loc_find(cur_loc, norm_cur_name, &obj_loc) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "source object not found") loc_valid = TRUE; /* Construct link information for eventual insertion */ @@ -1950,14 +1998,14 @@ H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, /* Create actual link to the object. Pass in NULL for the path, since this * function shouldn't change an object's user path. */ - if(H5L_create_real(link_loc, link_name, NULL, link_file, &lnk, NULL, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_real(link_loc, link_name, NULL, link_file, &lnk, NULL, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object") done: /* Free the object header location */ if(loc_valid) if(H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to free location") + HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to free location") /* Free the normalized path name */ if(norm_cur_name) @@ -1968,6 +2016,45 @@ done: /*------------------------------------------------------------------------- + * Function: H5L__create_hard + * + * Purpose: Internal routine to create a hard link + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 25, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, + const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(cur_loc); + HDassert(cur_name); + HDassert(link_loc); + HDassert(link_name); + + /* Create the link */ + if(H5L_create_hard(cur_loc, cur_name, link_loc, link_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__create_hard() */ + + +/*------------------------------------------------------------------------- * Function: H5L_create_soft * * Purpose: Creates a soft link from LINK_NAME to TARGET_PATH. @@ -1981,7 +2068,7 @@ done: */ herr_t H5L_create_soft(const char *target_path, const H5G_loc_t *link_loc, - const char *link_name, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id) + const char *link_name, hid_t lcpl_id) { char *norm_target = NULL; /* Pointer to normalized current name */ H5O_link_t lnk; /* Link to insert */ @@ -1996,14 +2083,14 @@ H5L_create_soft(const char *target_path, const H5G_loc_t *link_loc, /* Get normalized copy of the link target */ if((norm_target = H5G_normalize(target_path)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize name") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name") /* Set up link data specific to soft links */ lnk.type = H5L_TYPE_SOFT; lnk.u.soft.name = norm_target; /* Create actual link to the object */ - if(H5L_create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object") done: @@ -2016,7 +2103,45 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_create_ud + * Function: H5L__create_soft + * + * Purpose: Internal routine to create a soft link + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 25, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__create_soft(const char *target_path, const H5G_loc_t *link_loc, + const char *link_name, hid_t lcpl_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(target_path); + HDassert(link_loc); + HDassert(link_name); + + /* Create the link */ + if(H5L_create_soft(target_path, link_loc, link_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__create_soft() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__create_ud * * Purpose: Creates a user-defined link. See H5Lcreate_ud for * full documentation. @@ -2029,14 +2154,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_create_ud(const H5G_loc_t *link_loc, const char *link_name, - const void *ud_data, size_t ud_data_size, H5L_type_t type, hid_t lcpl_id, - hid_t lapl_id, hid_t dxpl_id) +H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, + const void *ud_data, size_t ud_data_size, H5L_type_t type, hid_t lcpl_id) { H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Check args */ HDassert(type >= H5L_TYPE_UD_MIN && type <= H5L_TYPE_MAX); @@ -2063,19 +2187,19 @@ H5L_create_ud(const H5G_loc_t *link_loc, const char *link_name, lnk.type = type; /* Create actual link to the object */ - if(H5L_create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to register new name for object") done: /* Free the link's udata buffer if it's been allocated */ H5MM_xfree(lnk.u.ud.udata); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_create_ud() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__create_ud() */ /*------------------------------------------------------------------------- - * Function: H5L_get_val_real + * Function: H5L__get_val_real * * Purpose: Retrieve link value from a link object * @@ -2087,11 +2211,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_val_real(const H5O_link_t *lnk, void *buf, size_t size) +H5L__get_val_real(const H5O_link_t *lnk, void *buf, size_t size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(lnk); @@ -2127,11 +2251,11 @@ H5L_get_val_real(const H5O_link_t *lnk, void *buf, size_t size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_val_real() */ +} /* end H5L__get_val_real() */ /*------------------------------------------------------------------------- - * Function: H5L_get_val_cb + * Function: H5L__get_val_cb * * Purpose: Callback for retrieving link value or udata. * @@ -2143,20 +2267,20 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_val_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, +H5L__get_val_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gv_t *udata = (H5L_trav_gv_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "'%s' doesn't exist", name) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "'%s' doesn't exist", name) /* Retrieve the value for the link */ - if(H5L_get_val_real(lnk, udata->buf, udata->size) < 0) + if(H5L__get_val_real(lnk, udata->buf, udata->size) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't retrieve link value") done: @@ -2165,7 +2289,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_val_cb() */ +} /* end H5L__get_val_cb() */ /*------------------------------------------------------------------------- @@ -2188,8 +2312,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_get_val(H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size, - hid_t lapl_id, hid_t dxpl_id) +H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size) { H5L_trav_gv_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2205,8 +2328,8 @@ H5L_get_val(H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size, udata.buf = buf; /* Traverse the group hierarchy to locate the object to get info about */ - if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L_get_val_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_val_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2214,7 +2337,43 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_val_by_idx_cb + * Function: H5L__get_val + * + * Purpose: Internal routine to query a link value + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Get the link value */ + if(H5L_get_val(loc, name, buf, size) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for '%s'", name) + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__get_val() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__get_val_by_idx_cb * * Purpose: Callback for retrieving a link's value according to an * index's order. @@ -2227,7 +2386,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_val_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5L__get_val_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { @@ -2236,20 +2395,19 @@ H5L_get_val_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATT hbool_t lnk_copied = FALSE; /* Whether the link was copied */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Query link */ - if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, - udata->n, &fnd_lnk, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "link not found") + if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found") lnk_copied = TRUE; /* Retrieve the value for the link */ - if(H5L_get_val_real(&fnd_lnk, udata->buf, udata->size) < 0) + if(H5L__get_val_real(&fnd_lnk, udata->buf, udata->size) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't retrieve link value") done: @@ -2262,11 +2420,57 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_val_by_idx_cb() */ +} /* end H5L__get_val_by_idx_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__get_val_by_idx + * + * Purpose: Internal routine to query a link value according to the + * index within a group + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, void *buf/*out*/, size_t size) +{ + H5L_trav_gvbi_t udata; /* User data for callback */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Set up user data for retrieving information */ + udata.idx_type = idx_type; + udata.order = order; + udata.n = n; + udata.buf = buf; + udata.size = size; + + /* Traverse the group hierarchy to locate the object to get info about */ + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_val_by_idx_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get link info for index: %llu", (unsigned long long)n) + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__get_val_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5L_delete_cb + * Function: H5L__delete_cb * * Purpose: Callback for deleting a link. This routine * actually deletes the link @@ -2279,31 +2483,31 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, - H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) +H5L__delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, + H5G_loc_t H5_ATTR_UNUSED *obj_loc, void H5_ATTR_UNUSED *_udata/*in,out*/, + H5G_own_loc_t *own_loc/*out*/) { - H5L_trav_rm_t *udata = (H5L_trav_rm_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the group resolved to a valid link */ if(grp_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Check if the name in this group resolved to a valid link */ if(name == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist") /* Check for non-existent (NULL) link. * Note that this can also occur when attempting to remove '.' */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "callback link pointer is NULL (specified link may be '.' or not exist)") + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "callback link pointer is NULL (specified link may be '.' or not exist)") /* Remove the link from the group */ - if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to remove link from group") + if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to remove link from group") done: /* Indicate that this callback didn't take ownership of the group * @@ -2311,7 +2515,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_delete_cb() */ +} /* end H5L__delete_cb() */ /*------------------------------------------------------------------------- @@ -2327,9 +2531,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) +H5L_delete(const H5G_loc_t *loc, const char *name) { - H5L_trav_rm_t udata; /* User data for callback */ char *norm_name = NULL; /* Pointer to normalized name */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2341,12 +2544,11 @@ H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) /* Get normalized copy of the name */ if((norm_name = H5G_normalize(name)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize name") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name") /* Set up user data for unlink operation */ - udata.dxpl_id = dxpl_id; - if(H5G_traverse(loc, norm_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK|H5G_TARGET_MOUNT, H5L_delete_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "can't unlink object") + if(H5G_traverse(loc, norm_name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK | H5G_TARGET_MOUNT, H5L__delete_cb, NULL) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTREMOVE, FAIL, "can't unlink object") done: /* Free the normalized path name */ @@ -2358,7 +2560,43 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_delete_by_idx_cb + * Function: H5L__delete + * + * Purpose: Internal routine to delete a link + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__delete(const H5G_loc_t *loc, const char *name) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Delete the link */ + if(H5L_delete(loc, name) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link: %s", name) + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__delete() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__delete_by_idx_cb * * Purpose: Callback for removing a link according to an index's order. * @@ -2370,39 +2608,82 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_delete_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5L__delete_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gvbi_t *udata = (H5L_trav_gvbi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(udata->dxpl_id, (obj_loc) ? (obj_loc->oloc->addr) : HADDR_UNDEF, FAIL) + FUNC_ENTER_STATIC_TAG((obj_loc) ? (obj_loc->oloc->addr) : HADDR_UNDEF) /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Delete link */ - if(H5G_obj_remove_by_idx(obj_loc->oloc, obj_loc->path->full_path_r, - udata->idx_type, udata->order, udata->n, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "link not found") + if(H5G_obj_remove_by_idx(obj_loc->oloc, obj_loc->path->full_path_r, udata->idx_type, udata->order, udata->n) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found") done: /* Indicate that this callback didn't take ownership of the group * * location for the object */ *own_loc = H5G_OWN_NONE; - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5L_delete_by_idx_cb() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5L__delete_by_idx_cb() */ /*------------------------------------------------------------------------- - * Function: H5L_move_dest_cb + * Function: H5L__delete_by_idx + * + * Purpose: Internal routine to delete a link according to its index + * within a group. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) +{ + H5L_trav_rmbi_t udata; /* User data for callback */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Set up user data for unlink operation */ + udata.idx_type = idx_type; + udata.order = order; + udata.n = n; + + /* Traverse the group hierarchy to remove the link */ + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK | H5G_TARGET_MOUNT, H5L__delete_by_idx_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "link doesn't exist") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__delete() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__move_dest_cb * * Purpose: Second callback for moving and renaming an object. This routine * inserts a new link into the group returned by the traversal. - * It is called by H5L_move_cb. + * It is called by H5L__move_cb. * * Return: Non-negative on success/Negative on failure * @@ -2412,7 +2693,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +H5L__move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { @@ -2423,18 +2704,17 @@ H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, hbool_t temp_loc_init = FALSE; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Make sure an object with this name doesn't already exist */ if(obj_loc != NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "an object with that name already exists") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "an object with that name already exists") /* Check for crossing file boundaries with a new hard link */ - if(udata->lnk->type == H5L_TYPE_HARD) { + if(udata->lnk->type == H5L_TYPE_HARD) /* Check that both objects are in same file */ if(!H5F_SAME_SHARED(grp_loc->oloc->file, udata->file)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "moving a link across files is not allowed") - } /* end if */ + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "moving a link across files is not allowed") /* Give the object its new name */ /* Casting away const okay -JML */ @@ -2442,8 +2722,7 @@ H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, udata->lnk->name = (char *)name; /* Insert the link into the group */ - if(H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, H5O_TYPE_UNKNOWN, - NULL, udata->dxpl_id) < 0) + if(H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, H5O_TYPE_UNKNOWN, NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object") /* If the link was a user-defined link, call its move callback if it has one */ @@ -2463,17 +2742,17 @@ H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, */ H5G_name_reset(&temp_path); if(H5O_loc_copy(&temp_oloc, grp_loc->oloc, H5_COPY_DEEP) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCOPY, FAIL, "unable to copy object location") + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object location") temp_loc.oloc = &temp_oloc; temp_loc.path = &temp_path; temp_loc_init = TRUE; /* Set up location for user-defined callback */ - if((grp = H5G_open(&temp_loc, udata->dxpl_id)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") + if(NULL == (grp = H5G_open(&temp_loc))) + HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group") if((grp_id = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group ID") + HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register group ID") if(udata->copy) { if((link_class->copy_func)(udata->lnk->name, grp_id, udata->lnk->u.ud.udata, udata->lnk->u.ud.size) < 0) @@ -2490,11 +2769,11 @@ done: /* Close the location given to the user callback if it was created */ if(grp_id >= 0) { if(H5I_dec_app_ref(grp_id) < 0) - HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") + HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") } /* end if */ else if(grp != NULL) { if(H5G_close(grp) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback") + HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback") } /* end if */ else if(temp_loc_init) H5G_loc_free(&temp_loc); @@ -2508,11 +2787,11 @@ done: udata->lnk->name = NULL; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_move_dest_cb() */ +} /* end H5L__move_dest_cb() */ /*------------------------------------------------------------------------- - * Function: H5L_move_cb + * Function: H5L__move_cb * * Purpose: Callback for moving and renaming an object. This routine * replaces the names of open objects with the moved object @@ -2526,24 +2805,24 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, +H5L__move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_mv_t *udata = (H5L_trav_mv_t *)_udata; /* User data passed in */ - H5L_trav_mv2_t udata_out; /* User data for H5L_move_dest_cb traversal */ + H5L_trav_mv2_t udata_out; /* User data for H5L__move_dest_cb traversal */ char * orig_name = NULL; /* The name of the link in this group */ hbool_t link_copied = FALSE; /* Has udata_out.lnk been allocated? */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist") /* Check for operations on '.' */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "the name of a link must be supplied to move or copy") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "the name of a link must be supplied to move or copy") /* Set up user data for move_dest_cb */ if(NULL == (udata_out.lnk = (H5O_link_t *)H5O_msg_copy(H5O_LINK_ID, lnk, NULL))) @@ -2558,15 +2837,19 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, udata_out.lnk->cset = udata->cset; udata_out.file = grp_loc->oloc->file; udata_out.copy = udata->copy; - udata_out.dxpl_id = udata->dxpl_id; /* Keep a copy of link's name (it's "owned" by the H5G_traverse() routine) */ orig_name = H5MM_xstrdup(name); + /* Reset the # of soft / UD links that can be traversed, so that the second + * (destination) traversal has the correct value + */ + if(H5CX_set_nlinks(udata->orig_nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't reset # of soft / UD links to traverse") + /* Insert the link into its new location */ - if(H5G_traverse(udata->dst_loc, udata->dst_name, udata->dst_target_flags, - H5L_move_dest_cb, &udata_out, udata->lapl_id, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to follow symbolic link") + if(H5G_traverse(udata->dst_loc, udata->dst_name, udata->dst_target_flags, H5L__move_dest_cb, &udata_out) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to follow symbolic link") /* If this is a move and not a copy operation, change the object's name and remove the old link */ if(!udata->copy) { @@ -2579,7 +2862,7 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, /* Create reference counted string for full dst path */ if((dst_name_r = H5G_build_fullpath_refstr_str(udata->dst_loc->path->full_path_r, udata->dst_name)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_PATH, FAIL, "can't build destination path name") + HGOTO_ERROR(H5E_LINK, H5E_PATH, FAIL, "can't build destination path name") } /* end if */ else dst_name_r = H5RS_wrap(udata->dst_name); @@ -2587,15 +2870,15 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, /* Fix names up */ if(H5G_name_replace(lnk, H5G_NAME_MOVE, obj_loc->oloc->file, obj_loc->path->full_path_r, - udata->dst_loc->oloc->file, dst_name_r, udata->dxpl_id) < 0) { + udata->dst_loc->oloc->file, dst_name_r) < 0) { H5RS_decr(dst_name_r); - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to replace name") + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to replace name") } /* end if */ /* Remove the old link */ - if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, orig_name, udata->dxpl_id) < 0) { + if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, orig_name) < 0) { H5RS_decr(dst_name_r); - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to remove old name") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to remove old name") } /* end if */ H5RS_decr(dst_name_r); @@ -2607,7 +2890,7 @@ done: H5MM_xfree(orig_name); /* If udata_out.lnk was copied, free any memory allocated - * In this special case, the H5L_move_dest_cb callback resets the name + * In this special case, the H5L__move_dest_cb callback resets the name * so H5O_msg_free shouldn't try to free it */ if(link_copied) @@ -2618,7 +2901,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_move_cb() */ +} /* end H5L__move_cb() */ /*------------------------------------------------------------------------- @@ -2642,19 +2925,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, - const char *dst_name, hbool_t copy_flag, hid_t lcpl_id, hid_t lapl_id, - hid_t dxpl_id) +H5L_move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc, + const char *dst_name, hbool_t copy_flag, hid_t lcpl_id) { unsigned dst_target_flags = H5G_TARGET_NORMAL; H5T_cset_t char_encoding = H5F_DEFAULT_CSET; /* Character encoding for link */ H5P_genplist_t* lc_plist; /* Link creation property list */ - H5P_genplist_t* la_plist; /* Link access property list */ H5L_trav_mv_t udata; /* User data for traversal */ - hid_t lapl_copy; /* Copy of lapl for this function */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(src_loc); @@ -2682,31 +2962,22 @@ H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for character encoding") } /* end if */ - /* Copy the link access property list because traversing UD links will - * decrease the NLINKS property. HDF5 should have NLINKS traversals to - * get to the source and NLINKS more to get to the destination. */ - if(lapl_id == H5P_DEFAULT) - lapl_copy = lapl_id; - else { - if(NULL == (la_plist = (H5P_genplist_t *)H5I_object(lapl_id))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a valid access PL") - if((lapl_copy = H5P_copy_plist(la_plist, FALSE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy access properties") - } /* end else */ - /* Set up user data */ udata.dst_loc = dst_loc; udata.dst_name= dst_name; udata.dst_target_flags = dst_target_flags; udata.cset = char_encoding; udata.copy = copy_flag; - udata.lapl_id = lapl_copy; - udata.dxpl_id = dxpl_id; + + /* Retrieve the original # of soft / UD links that can be traversed, so + * that the countdown can be reset after the first path is traversed. + */ + if(H5CX_get_nlinks(&udata.orig_nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve # of soft / UD links to traverse") /* Do the move */ - if(H5G_traverse(src_loc, src_name, H5G_TARGET_MOUNT | H5G_TARGET_SLINK | H5G_TARGET_UDLINK, - H5L_move_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to find link") + if(H5G_traverse(src_loc, src_name, H5G_TARGET_MOUNT | H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__move_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to find link") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2714,6 +2985,45 @@ done: /*------------------------------------------------------------------------- + * Function: H5L__move + * + * Purpose: Internal routine to move / copy a link + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 25, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__move(const H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, + const char *dst_name, hbool_t copy_flag, hid_t lcpl_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(src_loc); + HDassert(src_name); + HDassert(dst_loc); + HDassert(dst_name); + + /* Move the link */ + if(H5L_move(src_loc, src_name, dst_loc, dst_name, copy_flag, lcpl_id) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__move() */ + + +/*------------------------------------------------------------------------- * Function: H5L__exists_final_cb * * Purpose: Callback for checking whether a link exists, as the final @@ -2788,8 +3098,8 @@ H5L__exists_inter_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR } while('/' == *udata->sep); cb_func = H5L__exists_inter_cb; } /* end else */ - if(H5G_traverse(obj_loc, next, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, udata, udata->lapl_id, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't determine if link exists") + if(H5G_traverse(obj_loc, next, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't determine if link exists") } /* end if */ else udata->exists = TRUE; @@ -2822,7 +3132,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) +H5L_exists_tolerant(const H5G_loc_t *loc, const char *name) { H5L_trav_le_t udata; /* User data for traversal */ H5G_traverse_t cb_func; /* Callback function for tranversal */ @@ -2846,8 +3156,6 @@ H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t HGOTO_DONE(TRUE) /* Set up user data & correct callback */ - udata.lapl_id = lapl_id; - udata.dxpl_id = dxpl_id; udata.exists = FALSE; if(NULL == (udata.sep = HDstrchr(name_trav, '/'))) cb_func = H5L__exists_final_cb; @@ -2861,8 +3169,8 @@ H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t } /* end else */ /* Traverse the group hierarchy to locate the link to check */ - if(H5G_traverse(loc, name_trav, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't determine if link exists") + if(H5G_traverse(loc, name_trav, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't determine if link exists") /* Set return value */ ret_value = (htri_t)udata.exists; @@ -2876,7 +3184,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_exists + * Function: H5L__exists * * Purpose: Returns whether a link exists in a group * @@ -2891,12 +3199,12 @@ done: *------------------------------------------------------------------------- */ htri_t -H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) +H5L__exists(const H5G_loc_t *loc, const char *name) { H5L_trav_le_t udata; /* User data for traversal */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC_VOL /* A path of "/" will always exist in a file */ if(0 == HDstrcmp(name, "/")) @@ -2904,19 +3212,19 @@ H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) /* Traverse the group hierarchy to locate the object to get info about */ udata.exists = FALSE; - if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__exists_final_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "path doesn't exist") + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__exists_final_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "path doesn't exist") /* Set return value */ ret_value = (htri_t)udata.exists; done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_exists() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5L__exists() */ /*------------------------------------------------------------------------- - * Function: H5L_get_info_cb + * Function: H5L__get_info_cb * * Purpose: Callback for retrieving a link's metadata * @@ -2928,18 +3236,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5L__get_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t *lnk, H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gi_t *udata = (H5L_trav_gi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist") /* Get information from the link */ if(H5G_link_to_info(lnk, udata->linfo) < 0) @@ -2951,7 +3259,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_info_cb() */ +} /* end H5L__get_info_cb() */ /*------------------------------------------------------------------------- @@ -2967,8 +3275,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_get_info(const H5G_loc_t *loc, const char *name, - H5L_info_t *linfo/*out*/, hid_t lapl_id, hid_t dxpl_id) +H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info_t *linfo/*out*/) { H5L_trav_gi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2976,11 +3283,10 @@ H5L_get_info(const H5G_loc_t *loc, const char *name, FUNC_ENTER_NOAPI(FAIL) udata.linfo = linfo; - udata.dxpl_id = dxpl_id; /* Traverse the group hierarchy to locate the object to get info about */ - if(H5G_traverse(loc, name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK, H5L_get_info_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist") + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_info_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "name doesn't exist") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2988,7 +3294,43 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_info_by_idx_cb + * Function: H5L__get_info + * + * Purpose: Internal routine to retrieve link info + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__get_info(const H5G_loc_t *loc, const char *name, H5L_info_t *linfo/*out*/) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Get the link information */ + if(H5L_get_info(loc, name, linfo) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info for: '%s'", name) + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__get_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__get_info_by_idx_cb * * Purpose: Callback for retrieving a link's metadata according to an * index's order. @@ -3001,7 +3343,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5L__get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { @@ -3010,16 +3352,15 @@ H5L_get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_AT hbool_t lnk_copied = FALSE; /* Whether the link was copied */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Query link */ - if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, - udata->n, &fnd_lnk, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "link not found") + if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found") lnk_copied = TRUE; /* Get information from the link */ @@ -3036,39 +3377,57 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_info_by_idx_cb() */ +} /* end H5L__get_info_by_idx_cb() */ /*------------------------------------------------------------------------- - * Function: H5L_get_default_lcpl + * Function: H5L__get_info_by_idx * - * Purpose: Accessor for the default Link Creation Property List + * Purpose: Internal routine to retrieve link info according to an + * index's order. * - * Return: Success: ID of the deafult lcpl + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). * - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: James Laird - * Tuesday, July 4, 2006 + * Programmer: Quincey Koziol + * December 27, 2017 * *------------------------------------------------------------------------- */ -hid_t -H5L_get_default_lcpl(void) +static herr_t +H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, H5L_info_t *linfo /*out*/) { - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + H5L_trav_gibi_t udata; /* User data for callback */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + HDassert(linfo); + + /* Set up user data for callback */ + udata.idx_type = idx_type; + udata.order = order; + udata.n = n; + udata.linfo = linfo; - ret_value = H5P_LINK_CREATE_DEFAULT; + /* Traverse the group hierarchy to locate the object to get info about */ + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_info_by_idx_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_get_default_lcpl */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__get_info_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5L_get_name_by_idx_cb + * Function: H5L__get_name_by_idx_cb * * Purpose: Callback for retrieving a link's name according to an * index's order. @@ -3081,23 +3440,22 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_name_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5L__get_name_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gnbi_t *udata = (H5L_trav_gnbi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Query link */ - if((udata->name_len = H5G_obj_get_name_by_idx(obj_loc->oloc, udata->idx_type, udata->order, - udata->n, udata->name, udata->size, udata->dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "link not found") + if((udata->name_len = H5G_obj_get_name_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, udata->name, udata->size)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found") done: /* Indicate that this callback didn't take ownership of the group * @@ -3105,11 +3463,151 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_name_by_idx_cb() */ +} /* end H5L__get_name_by_idx_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__get_name_by_idx + * + * Purpose: Internal routine to retrieve link name according to an + * index's order. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static ssize_t +H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name /*out*/, + size_t size) +{ + H5L_trav_gnbi_t udata; /* User data for callback */ + ssize_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(group_name && *group_name); + + /* Set up user data for callback */ + udata.idx_type = idx_type; + udata.order = order; + udata.n = n; + udata.name = name; + udata.size = size; + udata.name_len = -1; + + /* Traverse the group hierarchy to locate the link to get name of */ + if(H5G_traverse(loc, group_name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_name_by_idx_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get name") + + /* Set the return value */ + ret_value = udata.name_len; + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__get_name_by_idx() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__iterate + * + * Purpose: Internal routine to iterate over links + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__iterate(hid_t grp_id, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data) +{ + H5G_link_iterate_t lnk_op; /* Link operator */ + hsize_t last_lnk; /* Index of last object looked at */ + hsize_t idx; /* Internal location to hold index */ + herr_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(group_name); + HDassert(op); + + /* Set up iteration beginning/end info */ + idx = (idx_p == NULL ? 0 : *idx_p); + last_lnk = 0; + + /* Build link operator info */ + lnk_op.op_type = H5G_LINK_OP_NEW; + lnk_op.op_func.op_new = op; + + /* Iterate over the links */ + if((ret_value = H5G_iterate(grp_id, group_name, idx_type, order, idx, &last_lnk, &lnk_op, op_data)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") + + /* Set the index we stopped at */ + if(idx_p) + *idx_p = last_lnk; + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__iterate() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__visit + * + * Purpose: Internal routine to visit links + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__visit(hid_t grp_id, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, H5L_iterate_t op, void *op_data) +{ + herr_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(group_name); + HDassert(op); + + /* Call internal group visitation routine */ + if((ret_value = H5G_visit(grp_id, group_name, idx_type, order, op, op_data)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__visit() */ /*------------------------------------------------------------------------- - * Function: H5L_link_copy_file + * Function: H5L__link_copy_file * * Purpose: Copy a link and the object it points to from one file to * another. @@ -3123,7 +3621,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, +H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, H5O_copy_t *cpy_info) { H5O_link_t tmp_src_lnk; /* Temporary copy of src link, when needed */ @@ -3135,7 +3633,7 @@ H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, H5O_loc_t tmp_src_oloc; /* Object location for target object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(dst_file); @@ -3157,27 +3655,25 @@ H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, lnk_grp_loc.oloc = (H5O_loc_t *)src_oloc; /* Casting away const OK -QAK */ /* Check if the target object exists */ - if((tar_exists = H5G_loc_exists(&lnk_grp_loc, src_lnk->name, H5P_DEFAULT, - dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to check if target object exists") + if((tar_exists = H5G_loc_exists(&lnk_grp_loc, src_lnk->name)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to check if target object exists") if(tar_exists) { /* Make a temporary copy of the link, so that it will not change the * info in the cache when we change it to a hard link */ if(NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, &tmp_src_lnk)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy message") + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy message") /* Set up group location for target object. Let H5G_traverse expand * the link. */ tmp_src_loc.path = &tmp_src_path; tmp_src_loc.oloc = &tmp_src_oloc; if(H5G_loc_reset(&tmp_src_loc) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to reset location") + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to reset location") /* Find the target object */ - if(H5G_loc_find(&lnk_grp_loc, src_lnk->name, &tmp_src_loc, - H5P_DEFAULT, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to find target object") + if(H5G_loc_find(&lnk_grp_loc, src_lnk->name, &tmp_src_loc) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to find target object") expanded_link_open = TRUE; /* Convert symbolic link to hard link */ @@ -3194,7 +3690,7 @@ H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, /* Copy src link information to dst link information */ if(NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, dst_lnk)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy message") + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy message") dst_lnk_init = TRUE; /* Check if object in source group is a hard link & copy it */ @@ -3216,9 +3712,8 @@ H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, /* Copy the shared object from source to destination */ /* Don't care about obj_type or udata because those are only important * for old style groups */ - if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, cpy_info, - TRUE, NULL, NULL) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") + if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, cpy_info, TRUE, NULL, NULL) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object") /* Copy new destination object's information for eventual insertion */ dst_lnk->u.hard.addr = new_dst_oloc.addr; @@ -3236,8 +3731,8 @@ done: /* Check if we need to free the temp source oloc */ if(expanded_link_open) if(H5G_loc_free(&tmp_src_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free object") + HDONE_ERROR(H5E_LINK, H5E_CANTFREE, FAIL, "unable to free object") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_link_copy_file() */ +} /* end H5L__link_copy_file() */ diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index b4a173f..6c132ab 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -24,6 +24,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ @@ -55,10 +56,12 @@ /********************/ /* Local Prototypes */ /********************/ - -static hid_t H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, - const void *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id); -static ssize_t H5L_extern_query(const char H5_ATTR_UNUSED * link_name, const void *udata, +static char *H5L__getenv_prefix_name(char **env_prefix/*in,out*/); +static herr_t H5L__build_name(const char *prefix, const char *file_name, + char **full_name/*out*/); +static hid_t H5L__extern_traverse(const char *link_name, hid_t cur_group, + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id); +static ssize_t H5L__extern_query(const char *link_name, const void *udata, size_t udata_size, void * buf /*out*/, size_t buf_size); @@ -84,15 +87,15 @@ static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ NULL, /* Creation callback */ NULL, /* Move callback */ NULL, /* Copy callback */ - H5L_extern_traverse, /* The actual traversal function */ + H5L__extern_traverse, /* The actual traversal function */ NULL, /* Deletion callback */ - H5L_extern_query /* Query callback */ + H5L__extern_query /* Query callback */ }}; /*-------------------------------------------------------------------------- - * Function: H5L_getenv_prefix_name -- + * Function: H5L__getenv_prefix_name * * Purpose: Get the first pathname in the list of pathnames stored in ENV_PREFIX, * which is separated by the environment delimiter. @@ -105,29 +108,30 @@ static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ * --------------------------------------------------------------------------*/ static char * -H5L_getenv_prefix_name(char **env_prefix/*in,out*/) +H5L__getenv_prefix_name(char **env_prefix/*in,out*/) { - char *retptr=NULL; - char *strret=NULL; + char *retptr = NULL; + char *strret = NULL; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR strret = HDstrchr(*env_prefix, H5_COLON_SEPC); - if (strret == NULL) { + if(strret == NULL) { retptr = *env_prefix; *env_prefix = strret; - } else { + } /* end if */ + else { retptr = *env_prefix; *env_prefix = strret + 1; *strret = '\0'; - } + } /* end else */ FUNC_LEAVE_NOAPI(retptr) -} /* end H5L_getenv_prefix_name() */ +} /* end H5L__getenv_prefix_name() */ /*-------------------------------------------------------------------------- - * Function: H5L_build_name + * Function: H5L__build_name * * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME * @@ -137,13 +141,13 @@ H5L_getenv_prefix_name(char **env_prefix/*in,out*/) * --------------------------------------------------------------------------*/ static herr_t -H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) +H5L__build_name(const char *prefix, const char *file_name, char **full_name/*out*/) { size_t prefix_len; /* length of prefix */ size_t fname_len; /* Length of external link file name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC prefix_len = HDstrlen(prefix); fname_len = HDstrlen(file_name); @@ -158,11 +162,11 @@ H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_build_name() */ +} /* H5L__build_name() */ /*------------------------------------------------------------------------- - * Function: H5L_extern_traverse + * Function: H5L__extern_traverse * * Purpose: Default traversal function for external links. This can * be overridden using H5Lregister(). @@ -177,27 +181,13 @@ done: * * Programmer: James Laird * Monday, July 10, 2006 - * Modifications: - * Vailin Choi, April 2, 2008 - * Add handling to search for the target file - * See description in RM: H5Lcreate_external - * - * Vailin Choi; Sept. 12th, 2008; bug #1247 - * Retrieve the file access property list identifer that is set - * for link access property via H5Pget_elink_fapl(). - * If the return value is H5P_DEFAULT, the parent's file access - * property is used to H5F_open() the target file; - * Otherwise, the file access property retrieved from H5Pget_elink_fapl() - * is used to H5F_open() the target file. - * - * Vailin Choi; Nov 2010 - * Free memory pointed to by tmp_env_prefix for HDF5_EXT_PREFIX case. * *------------------------------------------------------------------------- */ static hid_t -H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, - const void *_udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id) +H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, + const void *_udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { H5P_genplist_t *plist; /* Property list pointer */ char *my_prefix; /* Library's copy of the prefix */ @@ -220,10 +210,9 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, char *actual_file_name = NULL; /* Parent file's actual name */ H5P_genplist_t *fa_plist; /* File access property list pointer */ H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(p); @@ -244,10 +233,6 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, if(NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, cur_group, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - /* Get the fapl_id set for lapl_id if any */ if(H5P_get(plist, H5L_ACS_ELINK_FAPL_NAME, &fapl_id) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fapl for links") @@ -285,7 +270,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, parent_file_name = H5F_OPEN_NAME(loc.oloc->file); /* Query length of parent group name */ - if((group_name_len = H5G_get_name(&loc, NULL, (size_t) 0, NULL, lapl_id, dxpl_id)) < 0) + if((group_name_len = H5G_get_name(&loc, NULL, (size_t) 0, NULL)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve length of group name") /* Account for null terminator */ @@ -300,7 +285,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, parent_group_name = local_group_name; /* Get parent group name */ - if(H5G_get_name(&loc, parent_group_name, (size_t) group_name_len, NULL, lapl_id, dxpl_id) < 0) + if(H5G_get_name(&loc, parent_group_name, (size_t) group_name_len, NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve group name") /* Make callback */ @@ -331,7 +316,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* target file_name is an absolute pathname: see RM for detailed description */ if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { /* Try opening file */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) { char *ptr; H5E_clear_stack(NULL); @@ -350,7 +335,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, } /* end if */ else if(H5_CHECK_ABS_DRIVE(file_name)) { /* Try opening file */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) { H5E_clear_stack(NULL); @@ -373,14 +358,14 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, while((tmp_env_prefix) && (*tmp_env_prefix)) { char *out_prefix_name; - out_prefix_name = H5L_getenv_prefix_name(&tmp_env_prefix/*in,out*/); + out_prefix_name = H5L__getenv_prefix_name(&tmp_env_prefix/*in,out*/); if(out_prefix_name && (*out_prefix_name)) { - if(H5L_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { + if(H5L__build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { saved_env = (char *)H5MM_xfree(saved_env); HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") } /* end if */ - ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); + ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id); full_name = (char *)H5MM_xfree(full_name); if(ext_file != NULL) break; @@ -396,9 +381,9 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, if(H5P_peek(plist, H5L_ACS_ELINK_PREFIX_NAME, &my_prefix) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external link prefix") if(my_prefix) { - if(H5L_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) + if(H5L__build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) H5E_clear_stack(NULL); full_name = (char *)H5MM_xfree(full_name); } /* end if */ @@ -409,9 +394,9 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, char *extpath; if(NULL != (extpath = H5F_EXTPATH(loc.oloc->file))) { - if(H5L_build_name(extpath, temp_file_name, &full_name/*out*/) < 0) + if(H5L__build_name(extpath, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) H5E_clear_stack(NULL); full_name = (char *)H5MM_xfree(full_name); } /* end if */ @@ -419,7 +404,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* try the relative file_name stored in temp_file_name */ if(ext_file == NULL) { - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) H5E_clear_stack(NULL); } /* end if */ @@ -442,23 +427,22 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, *ptr = '\0'; /* Build new file name for the external file */ - if(H5L_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) + if(H5L__build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") /* Try opening with the resolved name */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) full_name = (char *)H5MM_xfree(full_name); } /* end if */ - /* Retrieve the "group location" for the file's root group */ if(H5G_root_loc(ext_file, &root_loc) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "unable to create location for file") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "unable to create location for file") /* Open the object referenced in the external file */ - if((ext_obj = H5O_open_name(&root_loc, obj_name, lapl_id, dxpl_id, FALSE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") + if((ext_obj = H5O_open_name(&root_loc, obj_name, FALSE)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open object") /* Set return value */ ret_value = ext_obj; @@ -482,11 +466,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_extern_traverse() */ +} /* end H5L__extern_traverse() */ /*------------------------------------------------------------------------- - * Function: H5L_extern_query + * Function: H5L__extern_query * * Purpose: Default query function for external links. This can * be overridden using H5Lregister(). @@ -503,7 +487,7 @@ done: *------------------------------------------------------------------------- */ static ssize_t -H5L_extern_query(const char H5_ATTR_UNUSED * link_name, const void *_udata, size_t udata_size, +H5L__extern_query(const char H5_ATTR_UNUSED * link_name, const void *_udata, size_t udata_size, void *buf /*out*/, size_t buf_size) { const uint8_t *udata = (const uint8_t *)_udata; /* Pointer to external link buffer */ @@ -532,7 +516,7 @@ H5L_extern_query(const char H5_ATTR_UNUSED * link_name, const void *_udata, size done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_extern_query() */ +} /* end H5L__extern_query() */ /*------------------------------------------------------------------------- @@ -566,7 +550,7 @@ H5Lcreate_external(const char *file_name, const char *obj_name, size_t file_name_len; /* Length of file name string */ size_t norm_obj_name_len; /* Length of normalized object name string */ uint8_t *p; /* Pointer into external link buffer */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -585,7 +569,7 @@ H5Lcreate_external(const char *file_name, const char *obj_name, /* Get normalized copy of the link target */ if(NULL == (norm_obj_name = H5G_normalize(obj_name))) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize object name") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize object name") /* Combine the filename and link name into a single buffer to give to the UD link */ file_name_len = HDstrlen(file_name) + 1; @@ -601,18 +585,24 @@ H5Lcreate_external(const char *file_name, const char *obj_name, p += file_name_len; HDstrncpy((char *)p, norm_obj_name, buf_size - (file_name_len + 1)); /* External link's object */ - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, link_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Create an external link */ - if(H5L_create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") done: H5MM_xfree(ext_link_buf); H5MM_xfree(norm_obj_name); +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_external() */ diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h index 39e3197..f0e9cfc 100644 --- a/src/H5Lpkg.h +++ b/src/H5Lpkg.h @@ -51,12 +51,11 @@ /* Package Private Prototypes */ /******************************/ -H5_DLL herr_t H5L_create_ud(const H5G_loc_t *link_loc, const char *link_name, +H5_DLL herr_t H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, const void * ud_data, size_t ud_data_size, H5L_type_t type, - hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, - const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, - H5O_copy_t *cpy_info); + hid_t lcpl_id); +H5_DLL herr_t H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, + const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, H5O_copy_t *cpy_info); #endif /* _H5Lpkg_H */ diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index 8a2bd34..3bbb6b6 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -54,7 +54,6 @@ typedef struct { H5_index_t idx_type; /* Index to use */ H5_iter_order_t order; /* Order to iterate in index */ hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ size_t size; /* Size of user buffer */ /* Out */ @@ -67,7 +66,6 @@ typedef struct { H5_index_t idx_type; /* Index to use */ H5_iter_order_t order; /* Order to iterate in index */ hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ /* Out */ H5L_info_t *linfo; /* Buffer to return to user */ @@ -80,7 +78,6 @@ typedef struct { H5_iter_order_t order; /* Order to iterate in index */ hsize_t n; /* Offset of link within index */ size_t size; /* Size of name buffer */ - hid_t dxpl_id; /* DXPL to use in callback */ /* Out */ char *name; /* Buffer to return name to user */ @@ -93,7 +90,6 @@ typedef struct { H5_index_t idx_type; /* Index to use */ H5_iter_order_t order; /* Order to iterate in index */ hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ } H5L_trav_rmbi_t; /* Structure for external link traversal callback property */ @@ -115,27 +111,22 @@ typedef struct H5L_elink_cb_t { /* General operations on links */ H5_DLL herr_t H5L_init(void); H5_DLL herr_t H5L_link(const H5G_loc_t *new_loc, const char *new_name, - H5G_loc_t *obj_loc, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); + H5G_loc_t *obj_loc, hid_t lcpl_id); H5_DLL herr_t H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, - H5O_obj_create_t *ocrt_info, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); + H5O_obj_create_t *ocrt_info, hid_t lcpl_id); H5_DLL herr_t H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, - const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id, - hid_t lapl_id, hid_t dxpl_id); + const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id); H5_DLL herr_t H5L_create_soft(const char *target_path, const H5G_loc_t *cur_loc, - const char *cur_name, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); -H5_DLL hid_t H5L_get_default_lcpl(void); -H5_DLL herr_t H5L_move(H5G_loc_t *src_loc, const char *src_name, - H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, - hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); -H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hid_t lapl_id, - hid_t dxpl_id); -H5_DLL htri_t H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id); + const char *cur_name, hid_t lcpl_id); +H5_DLL herr_t H5L_move(const H5G_loc_t *src_loc, const char *src_name, + const H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, + hid_t lcpl_id); +H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name); H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name, - H5L_info_t *linkbuf/*out*/, hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, - hid_t dxpl_id); -H5_DLL herr_t H5L_get_val(H5G_loc_t *loc, const char *name, void *buf/*out*/, - size_t size, hid_t lapl_id, hid_t dxpl_id); + H5L_info_t *linkbuf/*out*/); +H5_DLL herr_t H5L_delete(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, + size_t size); H5_DLL herr_t H5L_register_external(void); /* User-defined link functions */ diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index 9d1643e..e6fd37c 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -41,7 +41,10 @@ #define H5L_SAME_LOC (hid_t)0 /* Current version of the H5L_class_t struct */ -#define H5L_LINK_CLASS_T_VERS 0 +#define H5L_LINK_CLASS_T_VERS 1 + +/* Previous versions of the H5L_class_t struct */ +#define H5L_LINK_CLASS_T_VERS_0 0 #ifdef __cplusplus extern "C" { @@ -99,8 +102,10 @@ typedef herr_t (*H5L_copy_func_t)(const char *new_name, hid_t new_loc, const void *lnkdata, size_t lnkdata_size); /* Callback during link traversal */ -typedef hid_t (*H5L_traverse_func_t)(const char *link_name, hid_t cur_group, +typedef hid_t (*H5L_traverse_0_func_t)(const char *link_name, hid_t cur_group, const void *lnkdata, size_t lnkdata_size, hid_t lapl_id); +typedef hid_t (*H5L_traverse_func_t)(const char *link_name, hid_t cur_group, + const void *lnkdata, size_t lnkdata_size, hid_t lapl_id, hid_t dxpl_id); /* Callback for when the link is deleted */ typedef herr_t (*H5L_delete_func_t)(const char *link_name, hid_t file, @@ -119,6 +124,18 @@ typedef struct { H5L_create_func_t create_func; /* Callback during link creation */ H5L_move_func_t move_func; /* Callback after moving link */ H5L_copy_func_t copy_func; /* Callback after copying link */ + H5L_traverse_0_func_t trav_func; /* Callback during link traversal */ + H5L_delete_func_t del_func; /* Callback for link deletion */ + H5L_query_func_t query_func; /* Callback for queries */ +} H5L_class_0_t; + +typedef struct { + int version; /* Version number of this struct */ + H5L_type_t id; /* Link type ID */ + const char *comment; /* Comment for debugging */ + H5L_create_func_t create_func; /* Callback during link creation */ + H5L_move_func_t move_func; /* Callback after moving link */ + H5L_copy_func_t copy_func; /* Callback after copying link */ H5L_traverse_func_t trav_func; /* Callback during link traversal */ H5L_delete_func_t del_func; /* Callback for link deletion */ H5L_query_func_t query_func; /* Callback for queries */ diff --git a/src/H5MF.c b/src/H5MF.c index 7e06654..250a242 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -79,23 +79,23 @@ typedef struct { /********************/ /* Allocator routines */ -static haddr_t H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size); +static haddr_t H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size); /* "File closing" routines */ -static herr_t H5MF__close_aggrfs(H5F_t *f, hid_t dxpl_id); -static herr_t H5MF__close_pagefs(H5F_t *f, hid_t dxpl_id); -static herr_t H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id); +static herr_t H5MF__close_aggrfs(H5F_t *f); +static herr_t H5MF__close_pagefs(H5F_t *f); +static herr_t H5MF__close_shrink_eoa(H5F_t *f); /* General routines */ -static herr_t H5MF__get_free_sects(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums); +static herr_t H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums); static hbool_t H5MF__fsm_type_is_self_referential(H5F_t *f, H5F_mem_page_t fsm_type); static hbool_t H5MF__fsm_is_self_referential(H5F_t *f, H5FS_t *fspace); /* Free-space type manager routines */ -static herr_t H5MF__create_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); -static herr_t H5MF__close_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); -static herr_t H5MF__delete_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); -static herr_t H5MF__close_delete_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); +static herr_t H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type); +static herr_t H5MF__close_fstype(H5F_t *f, H5F_mem_page_t type); +static herr_t H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type); +static herr_t H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type); /*********************/ @@ -275,7 +275,7 @@ H5MF_alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_pag /*------------------------------------------------------------------------- - * Function: H5MF_open_fstype + * Function: H5MF__open_fstype * * Purpose: Open an existing free space manager of TYPE for file by * creating a free-space structure. @@ -291,7 +291,7 @@ H5MF_alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_pag *------------------------------------------------------------------------- */ herr_t -H5MF_open_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__open_fstype(H5F_t *f, H5F_mem_page_t type) { const H5FS_section_class_t *classes[] = { /* Free space section classes implemented for file */ H5MF_FSPACE_SECT_CLS_SIMPLE, @@ -299,13 +299,11 @@ H5MF_open_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) H5MF_FSPACE_SECT_CLS_LARGE }; hsize_t alignment; /* Alignment to use */ hsize_t threshold; /* Threshold to use */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) /* * Check arguments. @@ -331,17 +329,15 @@ H5MF_open_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) threshold = f->shared->threshold; } /* end else */ - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); /* 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], + if(NULL == (f->shared->fs_man[type] = H5FS_open(f, f->shared->fs_addr[type], NELMTS(classes), classes, f, alignment, threshold))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space info") @@ -350,13 +346,12 @@ H5MF_open_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) f->shared->fs_state[type] = H5F_FS_STATE_OPEN; 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5MF_open_fstype() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5MF__open_fstype() */ /*------------------------------------------------------------------------- @@ -376,7 +371,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5MF__create_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) { const H5FS_section_class_t *classes[] = { /* Free space section classes implemented for file */ H5MF_FSPACE_SECT_CLS_SIMPLE, @@ -384,14 +379,12 @@ H5MF__create_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) H5MF_FSPACE_SECT_CLS_LARGE }; H5FS_create_t fs_create; /* Free space creation parameters */ hsize_t alignment; /* Alignment to use */ - hsize_t threshold; /* Threshold to use */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + hsize_t threshold; /* Threshold to use */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ - herr_t ret_value = SUCCEED; /* Return value */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) /* * Check arguments. @@ -424,16 +417,14 @@ H5MF__create_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) threshold = f->shared->threshold; } /* end else */ - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); - if(NULL == (f->shared->fs_man[type] = H5FS_create(f, dxpl_id, NULL, + if(NULL == (f->shared->fs_man[type] = H5FS_create(f, NULL, &fs_create, NELMTS(classes), classes, f, alignment, threshold))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space info") @@ -442,17 +433,16 @@ H5MF__create_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) f->shared->fs_state[type] = H5F_FS_STATE_OPEN; 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__create_fstype() */ /*------------------------------------------------------------------------- - * Function: H5MF_start_fstype + * Function: H5MF__start_fstype * * Purpose: Open or create a free space manager of a given TYPE. * Note that TYPE can be H5F_mem_page_t or H5FD_mem_t enum types. @@ -467,11 +457,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_start_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) /* * Check arguments. @@ -488,18 +478,18 @@ H5MF_start_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) /* Check if the free space manager exists already */ if(H5F_addr_defined(f->shared->fs_addr[type])) { /* Open existing free space manager */ - if(H5MF_open_fstype(f, dxpl_id, type) < 0) + if(H5MF__open_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTOPENOBJ, FAIL, "can't initialize file free space") } /* end if */ else { /* Create new free space manager */ - if(H5MF__create_fstype(f, dxpl_id, type) < 0) + if(H5MF__create_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCREATE, FAIL, "can't initialize file free space") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5MF_start_fstype() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5MF__start_fstype() */ /*------------------------------------------------------------------------- @@ -516,16 +506,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5MF__delete_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ haddr_t tmp_fs_addr; /* Temporary holder for free space manager address */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) /* check args */ HDassert(f); @@ -545,21 +533,19 @@ H5MF__delete_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) */ f->shared->fs_state[type] = H5F_FS_STATE_DELETING; - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Before deleting free space manager\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Delete free space manager for this type */ - if(H5FS_delete(f, dxpl_id, tmp_fs_addr) < 0) + if(H5FS_delete(f, tmp_fs_addr) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't delete free space manager") /* Shift [back] to closed state */ @@ -570,12 +556,11 @@ HDfprintf(stderr, "%s: Before deleting free space manager\n", FUNC); HDassert(!H5F_addr_defined(f->shared->fs_addr[type])); 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__delete_fstype() */ @@ -593,11 +578,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5MF__close_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__close_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) /* * Check arguments. @@ -616,19 +601,19 @@ HDfprintf(stderr, "%s: Before closing free space manager\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Close an existing free space structure for the file */ - if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) + if(H5FS_close(f, f->shared->fs_man[type]) < 0) 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; done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__close_fstype() */ /*------------------------------------------------------------------------- - * Function: H5MF_add_sect + * Function: H5MF__add_sect * * Purpose: To add a section to the specified free-space manager. * @@ -640,17 +625,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_add_sect(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, H5FS_t *fspace, H5MF_free_section_t *node) +H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_section_t *node) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ - H5MF_sect_ud_t udata; /* User data for callback */ - H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */ - - herr_t ret_value = SUCCEED; /* Return value */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ + H5MF_sect_ud_t udata; /* User data for callback */ + H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) HDassert(f); HDassert(fspace); @@ -660,36 +643,35 @@ H5MF_add_sect(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, H5FS_t *fspace, H5 /* Construct user data for callbacks */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.alloc_type = alloc_type; udata.allow_sect_absorb = TRUE; udata.allow_eoa_shrink_only = FALSE; - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_is_self_referential(f, fspace)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + H5AC_set_ring(fsm_ring, &orig_ring); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: adding node, node->sect_info.addr = %a, node->sect_info.size = %Hu\n", FUNC, node->sect_info.addr, node->sect_info.size); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Add the section */ - if(H5FS_sect_add(f, dxpl_id, fspace, (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata) < 0) + if(H5FS_sect_add(f, fspace, (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't re-add section to file free space") done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5MF_add_sect() */ + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); + + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5MF__add_sect() */ /*------------------------------------------------------------------------- - * Function: H5MF_find_sect + * Function: H5MF__find_sect * * Purpose: To find a section from the specified free-space manager to fulfill the request. * If found, re-add the left-over space back to the manager. @@ -702,31 +684,28 @@ done: *------------------------------------------------------------------------- */ htri_t -H5MF_find_sect(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size, H5FS_t *fspace, haddr_t *addr) +H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, + haddr_t *addr) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ H5MF_free_section_t *node; /* Free space section pointer */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ htri_t ret_value = FAIL; /* Whether an existing free list node was found */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) HDassert(f); HDassert(fspace); - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_is_self_referential(f, fspace)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); /* Try to get a section from the free space manager */ - if((ret_value = H5FS_sect_find(f, dxpl_id, fspace, size, (H5FS_section_info_t **)&node)) < 0) + if((ret_value = H5FS_sect_find(f, fspace, size, (H5FS_section_info_t **)&node)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "error locating free space in file") #ifdef H5MF_ALLOC_DEBUG_MORE @@ -762,19 +741,18 @@ HDfprintf(stderr, "%s: re-adding node, node->sect_info.size = %Hu\n", FUNC, node #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Re-add the section to the free-space manager */ - if(H5MF_add_sect(f, alloc_type, dxpl_id, fspace, node) < 0) + if(H5MF__add_sect(f, alloc_type, fspace, node) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't re-add section to file free space") } /* end else */ } /* end if */ 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5MF_find_sect() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5MF__find_sect() */ /*------------------------------------------------------------------------- @@ -795,16 +773,14 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size) +H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t fsm_ring = H5AC_RING_INV; /* free space manager ring */ - H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t orig_ring; /* Original ring value */ H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, HADDR_UNDEF) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, HADDR_UNDEF) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -817,7 +793,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ if(f->shared->first_alloc_dealloc) { HDassert(! H5AC_cache_image_pending(f)); - if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "tidy of self referential fsm hack failed") } /* end if */ @@ -827,14 +803,12 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ HDfprintf(stderr, "%s: Check 1.0\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, fs_type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, HADDR_UNDEF, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); /* Check if we are using the free space manager for this file */ if(H5F_HAVE_FREE_SPACE_MANAGER(f)) { @@ -848,14 +822,14 @@ HDfprintf(stderr, "%s: Check 1.0\n", FUNC); /* Check if the free space manager for the file has been initialized */ if(!f->shared->fs_man[fs_type] && H5F_addr_defined(f->shared->fs_addr[fs_type])) { /* Open the free-space manager */ - if(H5MF_open_fstype(f, dxpl_id, fs_type) < 0) + if(H5MF__open_fstype(f, fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTOPENOBJ, HADDR_UNDEF, "can't initialize file free space") HDassert(f->shared->fs_man[fs_type]); } /* end if */ /* Search for large enough space in the free space manager */ if(f->shared->fs_man[fs_type]) - if(H5MF_find_sect(f, alloc_type, dxpl_id, size, f->shared->fs_man[fs_type], &ret_value) < 0) + if(H5MF__find_sect(f, alloc_type, size, f->shared->fs_man[fs_type], &ret_value) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "error locating a node") } /* end if */ @@ -866,11 +840,11 @@ HDfprintf(stderr, "%s: Check 2.0\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ if(f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE) { HDassert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); - if(HADDR_UNDEF == (ret_value = H5MF__alloc_pagefs(f, alloc_type, dxpl_id, size))) + if(HADDR_UNDEF == (ret_value = H5MF__alloc_pagefs(f, alloc_type, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from paged aggregation") } /* end if */ else { /* For non-paged aggregation, continue further action */ - if(HADDR_UNDEF == (ret_value = H5MF_aggr_vfd_alloc(f, alloc_type, dxpl_id, size))) + if(HADDR_UNDEF == (ret_value = H5MF_aggr_vfd_alloc(f, alloc_type, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd") } /* end else */ } /* end if */ @@ -880,19 +854,18 @@ HDfprintf(stderr, "%s: Check 3.0\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, HADDR_UNDEF, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, size); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP -H5MF_sects_dump(f, dxpl_id, stderr); +H5MF_sects_dump(f, stderr); #endif /* H5MF_ALLOC_DEBUG_DUMP */ - FUNC_LEAVE_NOAPI_TAG(ret_value, HADDR_UNDEF) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_alloc() */ @@ -918,13 +891,13 @@ H5MF_sects_dump(f, dxpl_id, stderr); *------------------------------------------------------------------------- */ static haddr_t -H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size) +H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) { H5F_mem_page_t ptype; /* Free-space mananger type */ H5MF_free_section_t *node = NULL; /* Free space section pointer */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, HADDR_UNDEF) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size); @@ -951,7 +924,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ H5MF_EOA_MISALIGN(f, (eoa+size), f->shared->fs_page_size, frag_size); /* Allocate from VFD */ - if(HADDR_UNDEF == (ret_value = H5F_alloc(f, dxpl_id, alloc_type, size + frag_size, NULL, NULL))) + if(HADDR_UNDEF == (ret_value = H5F__alloc(f, alloc_type, size + frag_size, NULL, NULL))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space") /* If there is a mis-aligned fragment at EOA */ @@ -959,7 +932,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ /* Start up the free-space manager */ if(!(f->shared->fs_man[ptype])) - if(H5MF_start_fstype(f, dxpl_id, ptype) < 0) + if(H5MF__start_fstype(f, ptype) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize file free space") /* Create free space section for the fragment */ @@ -967,7 +940,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize free space section") /* Add the fragment to the large free-space manager */ - if(H5MF_add_sect(f, alloc_type, dxpl_id, f->shared->fs_man[ptype], node) < 0) + if(H5MF__add_sect(f, alloc_type, f->shared->fs_man[ptype], node) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, HADDR_UNDEF, "can't re-add section to file free space") node = NULL; @@ -985,12 +958,12 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ haddr_t new_page; /* The address for the new file size page */ /* Allocate one file space page */ - if(HADDR_UNDEF == (new_page = H5MF_alloc(f, alloc_type, dxpl_id, f->shared->fs_page_size))) + if(HADDR_UNDEF == (new_page = H5MF_alloc(f, alloc_type, f->shared->fs_page_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space") /* Start up the free-space manager */ if(!(f->shared->fs_man[ptype])) - if(H5MF_start_fstype(f, dxpl_id, ptype) < 0) + if(H5MF__start_fstype(f, ptype) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize file free space") HDassert(f->shared->fs_man[ptype]); @@ -998,7 +971,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize free space section") /* Add the remaining space in the page to the manager */ - if(H5MF_add_sect(f, alloc_type, dxpl_id, f->shared->fs_man[ptype], node) < 0) + if(H5MF__add_sect(f, alloc_type, f->shared->fs_man[ptype], node) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, HADDR_UNDEF, "can't re-add section to file free space") node = NULL; @@ -1024,7 +997,7 @@ done: HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, size); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP -H5MF_sects_dump(f, dxpl_id, stderr); +H5MF_sects_dump(f, stderr); #endif /* H5MF_ALLOC_DEBUG_DUMP */ /* Release section node, if allocated and not added to section list or merged */ @@ -1032,7 +1005,7 @@ H5MF_sects_dump(f, dxpl_id, stderr); if(H5MF_sect_free((H5FS_section_info_t *)node) < 0) HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, HADDR_UNDEF, "can't free section node") - FUNC_LEAVE_NOAPI_TAG(ret_value, HADDR_UNDEF) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__alloc_pagefs() */ @@ -1111,20 +1084,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, - hsize_t size) +H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) { - H5F_io_info2_t fio_info; /* I/O info for operation */ H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */ H5MF_free_section_t *node = NULL; /* Free space section pointer */ unsigned ctype; /* section class type */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of fsm */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)alloc_type, addr, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -1137,20 +1106,18 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN if(f->shared->first_alloc_dealloc) { HDassert(!H5AC_cache_image_pending(f)); - if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") } /* end if */ H5MF_alloc_to_fs_type(f, alloc_type, size, &fs_type); - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, fs_type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); /* we are about to change the contents of the free space manager -- * notify metadata cache that the associated fsm ring is @@ -1165,24 +1132,14 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN if(H5F_addr_le(f->shared->tmp_addr, addr)) HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, FAIL, "attempting to free temporary file space") - /* Set up I/O info for operation */ - fio_info.f = f; - if(H5FD_MEM_DRAW == alloc_type) { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + /* If it's metadata, check if the space to free intersects with the file's + * metadata accumulator + */ + if(H5FD_MEM_DRAW != alloc_type) { + /* Check if the space to free intersects with the file's metadata accumulator */ + if(H5F__accum_free(f, alloc_type, addr, size) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't check free space intersection w/metadata accumulator") } /* end if */ - else { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end else */ - - /* Check if the space to free intersects with the file's metadata accumulator */ - if(H5F__accum_free(&fio_info, alloc_type, addr, size) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't check free space intersection w/metadata accumulator") /* Check if the free space manager for the file has been initialized */ if(!f->shared->fs_man[fs_type]) { @@ -1200,7 +1157,7 @@ HDfprintf(stderr, "%s: fs_addr = %a\n", FUNC, f->shared->fs_addr[fs_type]); 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) + if((status = H5MF_try_shrink(f, alloc_type, addr, size)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "can't check for absorbing block") else if(status > 0) /* Indicate success */ @@ -1234,7 +1191,7 @@ HDfprintf(stderr, "%s: dropping addr = %a, size = %Hu, on the floor!\n", FUNC, a * space isn't at the end of the file, so start up (or create) * the file space manager */ - if(H5MF_start_fstype(f, dxpl_id, fs_type) < 0) + if(H5MF__start_fstype(f, fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") } /* end if */ @@ -1252,7 +1209,7 @@ HDfprintf(stderr, "%s: Before H5FS_sect_add()\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Add to the free space for the file */ - if(H5MF_add_sect(f, alloc_type, dxpl_id, f->shared->fs_man[fs_type], node) < 0) + if(H5MF__add_sect(f, alloc_type, f->shared->fs_man[fs_type], node) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't add section to file free space") node = NULL; @@ -1266,13 +1223,12 @@ HDfprintf(stderr, "%s: After H5FS_sect_add()\n", FUNC); /* Construct user data for callbacks */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.alloc_type = alloc_type; udata.allow_sect_absorb = TRUE; udata.allow_eoa_shrink_only = FALSE; /* Try to merge the section that is smaller than threshold */ - if((merged = H5FS_sect_try_merge(f, dxpl_id, f->shared->fs_man[fs_type], (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata)) < 0) + if((merged = H5FS_sect_try_merge(f, f->shared->fs_man[fs_type], (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't merge section to file free space") else if(merged == TRUE) /* successfully merged */ /* Indicate that the node was used */ @@ -1280,10 +1236,9 @@ HDfprintf(stderr, "%s: After H5FS_sect_add()\n", FUNC); } /* end else */ 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Release section node, if allocated and not added to section list or merged */ if(node) @@ -1294,9 +1249,9 @@ done: HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP -H5MF_sects_dump(f, dxpl_id, stderr); +H5MF_sects_dump(f, stderr); #endif /* H5MF_ALLOC_DEBUG_DUMP */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_xfree() */ @@ -1323,21 +1278,19 @@ H5MF_sects_dump(f, dxpl_id, stderr); *------------------------------------------------------------------------- */ htri_t -H5MF_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t alloc_type, haddr_t addr, - hsize_t size, hsize_t extra_requested) +H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, + hsize_t extra_requested) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ haddr_t end; /* End of block to extend */ H5FD_mem_t map_type; /* Mapped type */ H5F_mem_page_t fs_type; /* free space type */ htri_t allow_extend = TRUE; /* Possible to extend the block */ hsize_t frag_size = 0; /* Size of mis-aligned fragment */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_requested = %Hu\n", FUNC, (unsigned)alloc_type, addr, size, extra_requested); #endif /* H5MF_ALLOC_DEBUG */ @@ -1348,7 +1301,7 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r if(f->shared->first_alloc_dealloc) { HDassert(! H5AC_cache_image_pending(f)); - if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") } /* end if */ @@ -1383,18 +1336,16 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r /* Get free space type from allocation type */ H5MF_alloc_to_fs_type(f, alloc_type, size, &fs_type); - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, fs_type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); if(allow_extend) { /* Try extending the block at EOA */ - if((ret_value = H5F_try_extend(f, dxpl_id, map_type, end, extra_requested + frag_size)) < 0) + if((ret_value = H5F__try_extend(f, map_type, end, extra_requested + frag_size)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file") #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: extended = %t\n", FUNC, ret_value); @@ -1410,7 +1361,7 @@ HDfprintf(stderr, "%s: extended = %t\n", FUNC, ret_value); /* Start up the free-space manager */ if(!(f->shared->fs_man[fs_type])) - if(H5MF_start_fstype(f, dxpl_id, fs_type) < 0) + if(H5MF__start_fstype(f, fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") /* Create free space section for the fragment */ @@ -1418,7 +1369,7 @@ HDfprintf(stderr, "%s: extended = %t\n", FUNC, ret_value); HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space section") /* Add the fragment to the large-sized free-space manager */ - if(H5MF_add_sect(f, alloc_type, dxpl_id, f->shared->fs_man[fs_type], node) < 0) + if(H5MF__add_sect(f, alloc_type, f->shared->fs_man[fs_type], node) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't re-add section to file free space") node = NULL; @@ -1431,11 +1382,11 @@ HDfprintf(stderr, "%s: extended = %t\n", FUNC, ret_value); /* Check if the block is able to extend into aggregation block */ aggr = (map_type == H5FD_MEM_DRAW) ? &(f->shared->sdata_aggr) : &(f->shared->meta_aggr); - if((ret_value = H5MF_aggr_try_extend(f, dxpl_id, aggr, map_type, end, extra_requested)) < 0) + if((ret_value = H5MF__aggr_try_extend(f, aggr, map_type, end, extra_requested)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending aggregation block") #ifdef H5MF_ALLOC_DEBUG_MORE -HDfprintf(stderr, "%s: H5MF_aggr_try_extend = %t\n", FUNC, ret_value); +HDfprintf(stderr, "%s: H5MF__aggr_try_extend = %t\n", FUNC, ret_value); #endif /* H5MF_ALLOC_DEBUG_MORE */ } /* end if */ @@ -1446,18 +1397,17 @@ HDfprintf(stderr, "%s: H5MF_aggr_try_extend = %t\n", FUNC, ret_value); /* Construct user data for callbacks */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.alloc_type = alloc_type; /* Check if the free space for the file has been initialized */ if(!f->shared->fs_man[fs_type] && H5F_addr_defined(f->shared->fs_addr[fs_type])) /* Open the free-space manager */ - if(H5MF_open_fstype(f, dxpl_id, fs_type) < 0) + if(H5MF__open_fstype(f, fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") /* Try to extend the block into a free-space section */ if(f->shared->fs_man[fs_type]) { - if((ret_value = H5FS_sect_try_extend(f, dxpl_id, f->shared->fs_man[fs_type], addr, size, extra_requested, H5FS_ADD_RETURNED_SPACE, &udata)) < 0) + if((ret_value = H5FS_sect_try_extend(f, f->shared->fs_man[fs_type], addr, size, extra_requested, H5FS_ADD_RETURNED_SPACE, &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending block in free space manager") #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Try to H5FS_sect_try_extend = %t\n", FUNC, ret_value); @@ -1478,19 +1428,18 @@ HDfprintf(stderr, "%s: Try to extend into the page end threshold = %t\n", FUNC, } /* allow_extend */ 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP -H5MF_sects_dump(f, dxpl_id, stderr); +H5MF_sects_dump(f, stderr); #endif /* H5MF_ALLOC_DEBUG_DUMP */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_try_extend() */ @@ -1509,20 +1458,17 @@ H5MF_sects_dump(f, dxpl_id, stderr); *------------------------------------------------------------------------- */ htri_t -H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, - hsize_t size) +H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) { H5MF_free_section_t *node = NULL; /* Free space section pointer */ H5MF_sect_ud_t udata; /* User data for callback */ H5FS_section_class_t *sect_cls; /* Section class */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - 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 = FALSE; /* Return value */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ + H5F_mem_page_t fs_type; /* Free space type */ + htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)alloc_type, addr, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -1541,14 +1487,12 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN /* Get free space type from allocation type */ H5MF_alloc_to_fs_type(f, alloc_type, size, &fs_type); - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, fs_type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); /* Create free-space section for block */ if(NULL == (node = H5MF_sect_new(sect_cls->type, addr, size))) @@ -1556,7 +1500,6 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN /* Construct user data for callbacks */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.alloc_type = alloc_type; udata.allow_sect_absorb = FALSE; /* Force section to be absorbed into aggregator */ udata.allow_eoa_shrink_only = FALSE; @@ -1574,10 +1517,9 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN } /* end if */ 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Free section node allocated */ if(node && H5MF_sect_free((H5FS_section_info_t *)node) < 0) @@ -1586,7 +1528,7 @@ done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_try_shrink() */ @@ -1603,11 +1545,11 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); *------------------------------------------------------------------------- */ herr_t -H5MF_close(H5F_t *f, hid_t dxpl_id) +H5MF_close(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1617,11 +1559,11 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); HDassert(f->shared); if(H5F_PAGED_AGGR(f)) { - if((ret_value = H5MF__close_pagefs(f, dxpl_id)) < 0) + if((ret_value = H5MF__close_pagefs(f)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't close free-space managers for 'page' file space") } /* end if */ else { - if((ret_value = H5MF__close_aggrfs(f, dxpl_id)) < 0) + if((ret_value = H5MF__close_aggrfs(f)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't close free-space managers for 'aggr' file space") } /* end else */ @@ -1630,7 +1572,7 @@ done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_close() */ @@ -1649,11 +1591,11 @@ HDfprintf(stderr, "%s: Leaving\n", FUNC); *------------------------------------------------------------------------- */ static herr_t -H5MF__close_delete_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1672,7 +1614,7 @@ HDfprintf(stderr, "%s: Check 1.0 - f->shared->fs_man[%u] = %p, f->shared->fs_add /* If the free space manager for this type is open, close it */ if(f->shared->fs_man[type]) - if(H5MF__close_fstype(f, dxpl_id, type) < 0) + if(H5MF__close_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close the free space manager") #ifdef H5MF_ALLOC_DEBUG_MORE @@ -1681,14 +1623,14 @@ HDfprintf(stderr, "%s: Check 2.0 - f->shared->fs_man[%u] = %p, f->shared->fs_add /* If there is free space manager info for this type, delete it */ if(H5F_addr_defined(f->shared->fs_addr[type])) - if(H5MF__delete_fstype(f, dxpl_id, type) < 0) + if(H5MF__delete_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't delete the free space manager") done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF__close_delete() */ @@ -1707,16 +1649,14 @@ HDfprintf(stderr, "%s: Leaving\n", FUNC); *------------------------------------------------------------------------- */ herr_t -H5MF_try_close(H5F_t *f, hid_t dxpl_id) +H5MF_try_close(H5F_t *f) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1740,23 +1680,20 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); */ if(f->shared->first_alloc_dealloc) { if(H5AC_cache_image_pending(f)) { - if(H5AC_force_cache_image_load(f, dxpl_id) < 0) + if(H5AC_force_cache_image_load(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "forced cache image load failed") } /* end if */ else { - if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") } /* end else */ } /* end if */ - /* Set the ring type in the DXPL. In most cases, we will + /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initialy set the ring in - * the DXPL to that value. We will alter this later if - * needed. + * the DXPL to that value. We will alter this later if needed. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; if(H5F_PAGED_AGGR(f)) { @@ -1771,14 +1708,12 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); needed_ring = H5AC_RING_MDFSM; 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 (1)") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ - if(H5MF__close_delete_fstype(f, dxpl_id, ptype) < 0) + if(H5MF__close_delete_fstype(f, ptype) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close the free space manager") } /* end for */ } /* end if */ @@ -1789,33 +1724,30 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); * get each free list's space */ for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) { - /* test to see if we need to switch rings -- do so if required */ + /* Test to see if we need to switch rings -- do so if required */ if(H5MF__fsm_type_is_self_referential(f, (H5F_mem_page_t)type)) needed_ring = H5AC_RING_MDFSM; 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") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ - if(H5MF__close_delete_fstype(f, dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__close_delete_fstype(f, (H5F_mem_page_t)type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close the free space manager") } /* end for */ } /* end else */ 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_try_close() */ @@ -1832,17 +1764,15 @@ HDfprintf(stderr, "%s: Leaving\n", FUNC); *------------------------------------------------------------------------- */ static herr_t -H5MF__close_aggrfs(H5F_t *f, hid_t dxpl_id) +H5MF__close_aggrfs(H5F_t *f) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5FD_mem_t type; /* Memory type for iteration */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ - herr_t ret_value = SUCCEED; /* Return value */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ + H5FD_mem_t type; /* Memory type for iteration */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1853,23 +1783,20 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); HDassert(f->shared->lf); HDassert(f->shared->sblock); - /* Set the ring type in the DXPL. In most cases, we will + /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initialy set the ring in - * the DXPL to that value. We will alter this later if - * needed. + * the DXPL to that value. We will alter this later if needed. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; /* Free the space in aggregators */ /* (for space not at EOA, it may be put into free space managers) */ - if(H5MF_free_aggrs(f, dxpl_id) < 0) + if(H5MF_free_aggrs(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't free aggregators") /* Trying shrinking the EOA for the file */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* Making free-space managers persistent for superblock version >= 2 */ @@ -1906,29 +1833,25 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); fsinfo.eoa_pre_fsm_fsalloc = f->shared->eoa_pre_fsm_fsalloc; /* 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_FLAG_MARK_IF_UNKNOWN) < 0) + if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") /* Close the free space managers */ for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) { if(f->shared->fs_man[type]) { - /* test to see if we need to switch rings -- do - * so if required - */ + /* Test to see if we need to switch rings -- do so if required */ if(H5MF__fsm_type_is_self_referential(f, (H5F_mem_page_t)type)) needed_ring = H5AC_RING_MDFSM; 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 (1)") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ HDassert(f->shared->fs_state[type] == H5F_FS_STATE_OPEN); - if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) + if(H5FS_close(f, f->shared->fs_man[type]) < 0) 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; @@ -1952,7 +1875,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* get the eoa, and verify that it has the expected value */ @@ -1967,30 +1890,29 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); } /* end if */ else { /* super_vers can be 0, 1, 2 */ for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) - if(H5MF__close_delete_fstype(f, dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__close_delete_fstype(f, (H5F_mem_page_t)type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") } /* end else */ /* Free the space in aggregators (again) */ /* (in case any free space information re-started them) */ - if(H5MF_free_aggrs(f, dxpl_id) < 0) + if(H5MF_free_aggrs(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't free aggregators") /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__close_aggrfs() */ @@ -2006,20 +1928,16 @@ HDfprintf(stderr, "%s: Leaving\n", FUNC); *------------------------------------------------------------------------- */ static herr_t -H5MF__close_pagefs(H5F_t *f, hid_t dxpl_id) +H5MF__close_pagefs(H5F_t *f) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* ring value needed for this - * iteration. - */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ H5F_mem_page_t ptype; /* Memory type for iteration */ H5O_fsinfo_t fsinfo; /* File space info message */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -2032,18 +1950,15 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); HDassert(f->shared->fs_page_size); HDassert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); - /* Set the ring type in the DXPL. In most cases, we will + /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initialy set the ring in - * the DXPL to that value. We will alter this later if - * needed. + * the DXPL to that value. We will alter this later if needed. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; /* Trying shrinking the EOA for the file */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* Set up file space info message */ @@ -2080,30 +1995,26 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); fsinfo.eoa_pre_fsm_fsalloc = f->shared->eoa_pre_fsm_fsalloc; /* 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_FLAG_MARK_IF_UNKNOWN) < 0) + if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") /* Close the free space managers */ /* use H5MF__close_fstype() for this? */ for(ptype = H5F_MEM_PAGE_META; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype)) { if(f->shared->fs_man[ptype]) { - /* test to see if we need to switch rings -- do - * so if required - */ + /* Test to see if we need to switch rings -- do so if required */ if(H5MF__fsm_type_is_self_referential(f, ptype)) needed_ring = H5AC_RING_MDFSM; 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 (1)") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ HDassert(f->shared->fs_state[ptype] == H5F_FS_STATE_OPEN); - if(H5FS_close(f, dxpl_id, f->shared->fs_man[ptype]) < 0) + if(H5FS_close(f, f->shared->fs_man[ptype]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close free space manager") f->shared->fs_man[ptype] = NULL; f->shared->fs_state[ptype] = H5F_FS_STATE_CLOSED; @@ -2118,7 +2029,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* get the eoa, and verify that it has the expected value */ @@ -2151,30 +2062,29 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); * and get each free list's space */ for(ptype = H5F_MEM_PAGE_META; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype)) - if(H5MF__close_delete_fstype(f, dxpl_id, ptype) < 0) + if(H5MF__close_delete_fstype(f, ptype) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close the free space manager") /* Write file space info message to superblock extension object header */ /* Create the superblock extension object header in advance if needed */ - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") } /* end else */ /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__close_pagefs() */ @@ -2191,21 +2101,19 @@ HDfprintf(stderr, "%s: Leaving\n", FUNC); *------------------------------------------------------------------------- */ static herr_t -H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) +H5MF__close_shrink_eoa(H5F_t *f) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ H5F_mem_t type; - H5F_mem_page_t ptype; /* Memory type for iteration */ + H5F_mem_page_t ptype; /* Memory type for iteration */ hbool_t eoa_shrank; /* Whether an EOA shrink occurs */ htri_t status; /* Status value */ H5MF_sect_ud_t udata; /* User data for callback */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) /* check args */ HDassert(f); @@ -2213,14 +2121,11 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) /* Construct user data for callbacks */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.allow_sect_absorb = FALSE; udata.allow_eoa_shrink_only = TRUE; - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value(1)") - reset_ring = TRUE; + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; /* Iterate until no more EOA shrinking occurs */ @@ -2236,16 +2141,14 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) needed_ring = H5AC_RING_MDFSM; 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 (1)") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ udata.alloc_type = (H5FD_mem_t)((H5FD_mem_t)ptype < H5FD_MEM_NTYPES ? ptype : ((ptype % H5FD_MEM_NTYPES) + 1)); - if((status = H5FS_sect_try_shrink_eoa(f, dxpl_id, f->shared->fs_man[ptype], &udata)) < 0) + if((status = H5FS_sect_try_shrink_eoa(f, f->shared->fs_man[ptype], &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") else if(status > 0) eoa_shrank = TRUE; @@ -2261,16 +2164,14 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) needed_ring = H5AC_RING_MDFSM; 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 (1)") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ udata.alloc_type = type; - if((status = H5FS_sect_try_shrink_eoa(f, dxpl_id, f->shared->fs_man[type], &udata)) < 0) + if((status = H5FS_sect_try_shrink_eoa(f, f->shared->fs_man[type], &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") else if(status > 0) eoa_shrank = TRUE; @@ -2278,7 +2179,7 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) } /* end for */ /* check the two aggregators */ - if((status = H5MF_aggrs_try_shrink_eoa(f, dxpl_id)) < 0) + if((status = H5MF_aggrs_try_shrink_eoa(f)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") else if(status > 0) eoa_shrank = TRUE; @@ -2286,12 +2187,11 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) } while(eoa_shrank); 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__close_shrink_eoa() */ @@ -2309,7 +2209,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_size) +H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size) { haddr_t ma_addr = HADDR_UNDEF; /* Base "metadata aggregator" address */ hsize_t ma_size = 0; /* Size of "metadata aggregator" */ @@ -2323,28 +2223,23 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si H5F_mem_page_t end_type; /* Memory type for iteration */ htri_t fs_started[H5F_MEM_PAGE_NTYPES]; /* Indicate whether the free-space manager has been started */ haddr_t fs_eoa[H5FD_MEM_NTYPES]; /* EAO for each free-space manager */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ - herr_t ret_value = SUCCEED; /* Return value */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ HDassert(f); HDassert(f->shared); HDassert(f->shared->lf); - /* Set the ring type in the DXPL. In most cases, we will + /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initialy set the ring in - * the DXPL to that value. We will alter this later if - * needed. + * the DXPL to that value. We will alter this later if needed. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; /* Determine start/end points for loop */ @@ -2377,23 +2272,19 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si /* Check if the free space for the file has been initialized */ if(!f->shared->fs_man[type] && H5F_addr_defined(f->shared->fs_addr[type])) { - if(H5MF_open_fstype(f, dxpl_id, type) < 0) + if(H5MF__open_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") HDassert(f->shared->fs_man[type]); fs_started[type] = TRUE; } /* end if */ - /* test to see if we need to switch rings -- do - * so if required - */ + /* Test to see if we need to switch rings -- do so if required */ if(H5MF__fsm_type_is_self_referential(f, (H5F_mem_page_t)type)) needed_ring = H5AC_RING_MDFSM; 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") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ @@ -2421,15 +2312,13 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si needed_ring = H5AC_RING_MDFSM; 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") + H5AC_set_ring(needed_ring, &curr_ring); curr_ring = needed_ring; } /* end if */ if(fs_started[type]) - if(H5MF__close_fstype(f, dxpl_id, type) < 0) + if(H5MF__close_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't close file free space") } /* end for */ @@ -2441,12 +2330,11 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si *meta_size = tot_meta_size; 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_get_freespace() */ @@ -2463,20 +2351,18 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, H5F_sect_info_t *sect_info) +H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t *sect_info) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ size_t total_sects = 0; /* Total number of sections */ H5MF_sect_iter_ud_t sect_udata; /* User data for callback */ H5F_mem_page_t start_type, end_type; /* Memory types to iterate over */ H5F_mem_page_t ty; /* Memory type for iteration */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ ssize_t ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, -1) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ HDassert(f); @@ -2497,11 +2383,11 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, */ if(f->shared->first_alloc_dealloc) { if(H5AC_cache_image_pending(f)) { - if(H5AC_force_cache_image_load(f, dxpl_id) < 0) + if(H5AC_force_cache_image_load(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "forced cache image load failed") } /* end if */ else { - if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") } /* end else */ } /* end if */ @@ -2523,14 +2409,11 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, sect_udata.sect_count = nsects; sect_udata.sect_idx = 0; - /* Set the ring type in the DXPL. In most cases, we will + /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initialy set the ring in - * the DXPL to that value. We will alter this later if - * needed. + * the DXPL to that value. We will alter this later if needed. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value(0)") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; /* Iterate over memory types, retrieving the number of sections of each type */ @@ -2543,15 +2426,13 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, needed_ring = H5AC_RING_MDFSM; 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 (1)") + H5AC_set_ring(needed_ring, &curr_ring); curr_ring = needed_ring; } /* end if */ if(!f->shared->fs_man[ty] && H5F_addr_defined(f->shared->fs_addr[ty])) { - if(H5MF_open_fstype(f, dxpl_id, ty) < 0) + if(H5MF__open_fstype(f, ty) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't open the free space manager") HDassert(f->shared->fs_man[ty]); fs_started = TRUE; @@ -2559,7 +2440,7 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, /* Check if there's free space sections of this type */ if(f->shared->fs_man[ty]) - if(H5MF__get_free_sects(f, dxpl_id, f->shared->fs_man[ty], §_udata, &nums) < 0) + if(H5MF__get_free_sects(f, f->shared->fs_man[ty], §_udata, &nums) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't get section info for the free space manager") /* Increment total # of sections */ @@ -2567,7 +2448,7 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, /* Close the free space manager of this type, if we started it here */ if(fs_started) - if(H5MF__close_fstype(f, dxpl_id, ty) < 0) + if(H5MF__close_fstype(f, ty) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCLOSEOBJ, FAIL, "can't close file free space") if((H5F_PAGED_AGGR(f)) && (type != H5FD_MEM_DEFAULT)) ty = (H5F_mem_page_t)(ty + H5FD_MEM_NTYPES - 2); @@ -2577,12 +2458,11 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, ret_value = (ssize_t)total_sects; 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, -1) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_get_free_sections() */ @@ -2630,7 +2510,7 @@ H5MF_sects_cb(H5FS_section_info_t *_sect, void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5MF__get_free_sects(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums) +H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums) { hsize_t hnums = 0; /* # of sections */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2651,7 +2531,7 @@ H5MF__get_free_sects(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5MF_sect_iter_ud_ /* Check if we should retrieve the section info */ if(sect_udata->sects && *nums > 0) /* Iterate over all the free space sections of this type, adding them to the user's section info */ - if(H5FS_sect_iterate(f, dxpl_id, fspace, H5MF_sects_cb, sect_udata) < 0) + if(H5FS_sect_iterate(f, fspace, H5MF_sects_cb, sect_udata) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_BADITER, FAIL, "can't iterate over sections") done: @@ -2761,7 +2641,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) +H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) { int pass_count; hsize_t alloc_size; @@ -2769,14 +2649,12 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) H5F_mem_page_t fsm_type; /* FSM type for iteration */ H5O_fsinfo_t fsinfo; /* Free space manager info message */ H5FS_stat_t fs_stat; /* Information for free-space manager */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* Check args */ HDassert(f); @@ -2821,7 +2699,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * is enabled -- skip this if so. */ /* Vailin -- is this correct? */ - if(!H5F_PAGED_AGGR(f) && (H5MF_free_aggrs(f, dxpl_id) < 0)) + if(!H5F_PAGED_AGGR(f) && (H5MF_free_aggrs(f) < 0)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free aggregators") /* Set the ring type in the DXPL. In most cases, we will @@ -2829,9 +2707,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * the DXPL to that value. We will alter this later if * 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)") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_MDFSM, &orig_ring); curr_ring = H5AC_RING_MDFSM; /* b) Free the file space (if any) allocated to each free space manager. @@ -2895,7 +2771,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Sanity check */ HDassert(fsm_opened[fsm_type] == FALSE); - if(H5MF_open_fstype(f, dxpl_id, fsm_type) < 0) + if(H5MF__open_fstype(f, fsm_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") fsm_opened[fsm_type] = TRUE; } /* end if */ @@ -2907,10 +2783,8 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) needed_ring = H5AC_RING_MDFSM; 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") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ @@ -2924,7 +2798,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * reallocate later if the free space manager contains * any free space. */ - if(H5FS_free(f, f->shared->fs_man[fsm_type], dxpl_id, TRUE) < 0) + if(H5FS_free(f, f->shared->fs_man[fsm_type], TRUE) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free-space headers") f->shared->fs_addr[fsm_type] = HADDR_UNDEF; } /* end if */ @@ -2950,11 +2824,11 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * Leave it in for now, but consider removing it. */ if(H5F_addr_defined(f->shared->sblock->ext_addr)) - if(H5F_super_ext_remove_msg(f, dxpl_id, H5O_FSINFO_ID) < 0) + if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) 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) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") @@ -2980,7 +2854,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) fsinfo.pgend_meta_thres = f->shared->pgend_meta_thres; fsinfo.eoa_pre_fsm_fsalloc = HADDR_UNDEF; - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") @@ -3029,15 +2903,13 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) else /* paged allocation disabled -- should be unreachable */ HDassert(FALSE); - /* test to see if we need to switch rings -- do so if required */ + /* Test to see if we need to switch rings -- do so if required */ if(H5MF__fsm_type_is_self_referential(f, fsm_type)) needed_ring = H5AC_RING_MDFSM; 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") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ @@ -3072,13 +2944,13 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) HDassert(!H5F_addr_defined(fs_stat.addr)); /* Allocate FSM header */ - if(H5FS_alloc_hdr(f, f->shared->fs_man[fsm_type], &f->shared->fs_addr[fsm_type], dxpl_id) < 0) + if(H5FS_alloc_hdr(f, f->shared->fs_man[fsm_type], &f->shared->fs_addr[fsm_type]) < 0) 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 ) + if(H5FS_alloc_sect(f, f->shared->fs_man[fsm_type]) < 0 ) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate free-space section info") #ifndef NDEBUG @@ -3104,7 +2976,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__close_fstype(f, dxpl_id, fsm_type) < 0) + if(H5MF__close_fstype(f, fsm_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't close file free space manager") fsm_opened[fsm_type] = FALSE; } /* end if */ @@ -3121,12 +2993,11 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) } /* end if */ 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_settle_raw_data_fsm() */ @@ -3233,7 +3104,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) +H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) { H5F_mem_page_t sm_fshdr_fs_type; /* small fs hdr fsm */ H5F_mem_page_t sm_fssinfo_fs_type; /* small fs sinfo fsm */ @@ -3247,12 +3118,10 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* for self referential FSMs */ haddr_t eoa_post_fsm_fsalloc; /* eoa post file space allocation */ /* for self referential FSMs */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - hbool_t reset_ring = FALSE; /* Whether we set the ring */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* Check args */ HDassert(f); @@ -3303,10 +3172,8 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) lg_sinfo_fspace = f->shared->fs_man[lg_fssinfo_fs_type]; } /* end if */ - /* 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") - reset_ring = TRUE; + /* Set the ring in the API context appropriately for subsequent calls */ + H5AC_set_ring(H5AC_RING_MDFSM, &orig_ring); #ifndef NDEBUG { @@ -3371,11 +3238,11 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) */ /* Vailin -- is this correct? */ /* (for space not at EOF, it may be put into free space managers) */ - if((!H5F_PAGED_AGGR(f)) && (H5MF_free_aggrs(f, dxpl_id) < 0)) + if((!H5F_PAGED_AGGR(f)) && (H5MF_free_aggrs(f) < 0)) 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) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* At this point, the EOA should be set to a value that contains @@ -3465,20 +3332,20 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * the fragment on the floor for now. */ if(sm_hdr_fspace) - if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, dxpl_id, sm_hdr_fspace, &(f->shared->fs_addr[sm_fshdr_fs_type])) < 0) + if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, sm_hdr_fspace, &(f->shared->fs_addr[sm_fshdr_fs_type])) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate sm hdr FSM file space") if(sm_sinfo_fspace && (sm_sinfo_fspace != sm_hdr_fspace)) - if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, dxpl_id, sm_sinfo_fspace, &(f->shared->fs_addr[sm_fssinfo_fs_type])) < 0) + if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, sm_sinfo_fspace, &(f->shared->fs_addr[sm_fssinfo_fs_type])) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate sm sinfo FSM file space") if(H5F_PAGED_AGGR(f)) { if(lg_hdr_fspace) - if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, dxpl_id, lg_hdr_fspace, &(f->shared->fs_addr[lg_fshdr_fs_type])) < 0) + if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, lg_hdr_fspace, &(f->shared->fs_addr[lg_fshdr_fs_type])) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate lg hdr FSM file space") if(lg_sinfo_fspace && (lg_sinfo_fspace != lg_hdr_fspace)) - if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, dxpl_id, lg_sinfo_fspace, &(f->shared->fs_addr[lg_fssinfo_fs_type])) < 0) + if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, lg_sinfo_fspace, &(f->shared->fs_addr[lg_fssinfo_fs_type])) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate lg sinfo FSM file space") } /* end if */ @@ -3503,11 +3370,11 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) } /* end if */ done: - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_settle_meta_data_fsm() */ @@ -3686,11 +3553,10 @@ H5MF__fsm_is_self_referential(H5F_t *f, H5FS_t *fspace) *------------------------------------------------------------------------- */ herr_t -H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) +H5MF_tidy_self_referential_fsm_hack(H5F_t *f) { haddr_t eoa; /* EOA of file */ hsize_t tail_size = 0; /* Size of chunk to free */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ haddr_t first_srfsm_hdr = HADDR_UNDEF; /* Addr of first self referential */ /* fsm header in file */ @@ -3699,10 +3565,9 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) H5F_mem_page_t sm_fssinfo_fs_type; /* Small fs sinfo fsm */ H5F_mem_page_t lg_fshdr_fs_type; /* Large fs hdr fsm */ H5F_mem_page_t lg_fssinfo_fs_type; /* Large fs sinfo fsm */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ HDassert(f); @@ -3710,12 +3575,10 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(f->shared->fs_persist); HDassert(f->shared->first_alloc_dealloc); - /* Set the ring type in the DXPL. Since we are only dealing with + /* Set the ring type in the API context. Since we are only dealing with * self referential FSMs, we will only need H5AC_RING_MDFSM. */ - 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") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_MDFSM, &orig_ring); /* 1) Verify that f->shared->first_alloc_dealloc is TRUE, * and then set it to FALSE. @@ -3763,7 +3626,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) first_srfsm_hdr = f->shared->fs_addr[sm_fshdr_fs_type]; /* open the FSM */ - if(H5MF_open_fstype(f, dxpl_id, sm_fshdr_fs_type) < 0) + if(H5MF__open_fstype(f, sm_fshdr_fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") HDassert(f->shared->fs_man[sm_fshdr_fs_type]); @@ -3780,7 +3643,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(NULL == f->shared->fs_man[sm_fssinfo_fs_type]); /* open the FSM */ - if(H5MF_open_fstype(f, dxpl_id, sm_fssinfo_fs_type) < 0) + if(H5MF__open_fstype(f, sm_fssinfo_fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") HDassert(f->shared->fs_man[sm_fssinfo_fs_type]); @@ -3808,7 +3671,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(NULL == f->shared->fs_man[lg_fshdr_fs_type]); /* open the FSM */ - if(H5MF_open_fstype(f, dxpl_id, lg_fshdr_fs_type) < 0) + if(H5MF__open_fstype(f, lg_fshdr_fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") HDassert(f->shared->fs_man[lg_fshdr_fs_type]); } /* end if */ @@ -3822,7 +3685,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(NULL == f->shared->fs_man[lg_fssinfo_fs_type]); /* open the FSM */ - if(H5MF_open_fstype(f, dxpl_id, lg_fssinfo_fs_type) < 0) + if(H5MF__open_fstype(f, lg_fssinfo_fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") HDassert(f->shared->fs_man[lg_fssinfo_fs_type]); } /* end if */ @@ -3837,7 +3700,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(H5F_addr_defined(fs_stat.addr)); HDassert(H5F_addr_defined(fs_stat.sect_addr)); - if(H5FS_free(f, f->shared->fs_man[sm_fshdr_fs_type], dxpl_id, FALSE) < 0) + if(H5FS_free(f, f->shared->fs_man[sm_fshdr_fs_type], FALSE) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free-space headers") f->shared->fs_addr[sm_fshdr_fs_type] = HADDR_UNDEF; } /* end if */ @@ -3849,7 +3712,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(H5F_addr_defined(fs_stat.addr)); HDassert(H5F_addr_defined(fs_stat.sect_addr)); - if(H5FS_free(f, f->shared->fs_man[sm_fssinfo_fs_type], dxpl_id, FALSE) < 0) + if(H5FS_free(f, f->shared->fs_man[sm_fssinfo_fs_type], FALSE) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free-space headers") f->shared->fs_addr[sm_fssinfo_fs_type] = HADDR_UNDEF; } /* end if */ @@ -3862,7 +3725,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(H5F_addr_defined(fs_stat.addr)); HDassert(H5F_addr_defined(fs_stat.sect_addr)); - if(H5FS_free(f, f->shared->fs_man[lg_fshdr_fs_type], dxpl_id, FALSE) < 0) + if(H5FS_free(f, f->shared->fs_man[lg_fshdr_fs_type], FALSE) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't float free-space headers") f->shared->fs_addr[lg_fshdr_fs_type] = HADDR_UNDEF; } /* end if */ @@ -3874,7 +3737,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(H5F_addr_defined(fs_stat.addr)); HDassert(H5F_addr_defined(fs_stat.sect_addr)); - if(H5FS_free(f, f->shared->fs_man[lg_fssinfo_fs_type], dxpl_id, FALSE) < 0) + if(H5FS_free(f, f->shared->fs_man[lg_fssinfo_fs_type], FALSE) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't float free-space headers") f->shared->fs_addr[lg_fssinfo_fs_type] = HADDR_UNDEF; } /* end if */ @@ -3902,7 +3765,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) tail_size = (hsize_t)(eoa - f->shared->eoa_pre_fsm_fsalloc); /* Release file space allocated to self referential FSMs */ - if(H5F_free(f, dxpl_id, H5FD_MEM_DEFAULT, f->shared->eoa_pre_fsm_fsalloc, tail_size) < 0) + if(H5F__free(f, H5FD_MEM_DEFAULT, f->shared->eoa_pre_fsm_fsalloc, tail_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed") if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get EOA") @@ -3913,11 +3776,10 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert((!H5F_PAGED_AGGR(f)) || (0 == (eoa % f->shared->fs_page_size))); 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") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_tidy_self_referential_fsm_hack() */ diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 7c05e0d..cd80a10 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -55,9 +55,9 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5MF__aggr_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, +static herr_t H5MF__aggr_free(H5F_t *f, H5FD_mem_t type, H5F_blk_aggr_t *aggr); -static haddr_t H5MF__aggr_alloc(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, +static haddr_t H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5FD_mem_t type, hsize_t size); @@ -95,7 +95,7 @@ static haddr_t H5MF__aggr_alloc(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, *------------------------------------------------------------------------- */ haddr_t -H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size) +H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) { haddr_t ret_value = HADDR_UNDEF; /* Return value */ @@ -113,12 +113,12 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ /* Couldn't find anything from the free space manager, go allocate some */ if(alloc_type != H5FD_MEM_DRAW && alloc_type != H5FD_MEM_GHEAP) { /* Handle metadata differently from "raw" data */ - if(HADDR_UNDEF == (ret_value = H5MF__aggr_alloc(f, dxpl_id, &(f->shared->meta_aggr), &(f->shared->sdata_aggr), alloc_type, size))) + if(HADDR_UNDEF == (ret_value = H5MF__aggr_alloc(f, &(f->shared->meta_aggr), &(f->shared->sdata_aggr), alloc_type, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate metadata") } /* end if */ else { /* Allocate "raw" data: H5FD_MEM_DRAW and H5FD_MEM_GHEAP */ - if(HADDR_UNDEF == (ret_value = H5MF__aggr_alloc(f, dxpl_id, &(f->shared->sdata_aggr), &(f->shared->meta_aggr), H5FD_MEM_DRAW, size))) + if(HADDR_UNDEF == (ret_value = H5MF__aggr_alloc(f, &(f->shared->sdata_aggr), &(f->shared->meta_aggr), H5FD_MEM_DRAW, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate raw data") } /* end else */ @@ -149,8 +149,8 @@ HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, *------------------------------------------------------------------------- */ static 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) +H5MF__aggr_alloc(H5F_t *f, 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 */ @@ -218,7 +218,7 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz if(H5F_addr_gt((aggr->addr + aggr->size + ext_size), f->shared->tmp_addr)) HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "'normal' file space allocation request will overlap into 'temporary' file space") - if((aggr->addr > 0) && (extended = H5F_try_extend(f, dxpl_id, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0) + if((aggr->addr > 0) && (extended = H5F__try_extend(f, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't extending space") else if (extended) { /* aggr->size is unchanged */ @@ -232,12 +232,12 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz */ if((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) && (other_aggr->tot_size > other_aggr->size) && ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) { - if(H5MF__aggr_free(f, dxpl_id, other_alloc_type, other_aggr) < 0) + if(H5MF__aggr_free(f, other_alloc_type, other_aggr) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation block") } /* end if */ /* Allocate space from the VFD (i.e. at the end of the file) */ - if(HADDR_UNDEF == (ret_value = H5F_alloc(f, dxpl_id, alloc_type, size, &eoa_frag_addr, &eoa_frag_size))) + if(HADDR_UNDEF == (ret_value = H5F__alloc(f, alloc_type, size, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space") } /* end else */ } /* end if */ @@ -256,7 +256,7 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC); if(H5F_addr_gt((aggr->addr + aggr->size + ext_size), f->shared->tmp_addr)) HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "'normal' file space allocation request will overlap into 'temporary' file space") - if((aggr->addr > 0) && (extended = H5F_try_extend(f, dxpl_id, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0) + if((aggr->addr > 0) && (extended = H5F__try_extend(f, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't extending space") else if(extended) { aggr->addr += aggr_frag_size; @@ -272,17 +272,17 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC); */ if((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) && (other_aggr->tot_size > other_aggr->size) && ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) { - if(H5MF__aggr_free(f, dxpl_id, other_alloc_type, other_aggr) < 0) + if(H5MF__aggr_free(f, other_alloc_type, other_aggr) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation block") } /* end if */ /* Allocate space from the VFD (i.e. at the end of the file) */ - if(HADDR_UNDEF == (new_space = H5F_alloc(f, dxpl_id, alloc_type, aggr->alloc_size, &eoa_frag_addr, &eoa_frag_size))) + if(HADDR_UNDEF == (new_space = H5F__alloc(f, alloc_type, aggr->alloc_size, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space") /* Return the unused portion of the block to a free list */ if(aggr->size > 0) - if(H5MF_xfree(f, alloc_type, dxpl_id, aggr->addr, aggr->size) < 0) + if(H5MF_xfree(f, alloc_type, aggr->addr, aggr->size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation block") /* If the block is not to be aligned, fold the eoa fragment @@ -315,12 +315,12 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC); /* Freeing any possible fragment due to file allocation */ if(eoa_frag_size) - if(H5MF_xfree(f, alloc_type, dxpl_id, eoa_frag_addr, eoa_frag_size) < 0) + if(H5MF_xfree(f, alloc_type, eoa_frag_addr, eoa_frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment") /* Freeing any possible fragment due to alignment in the block after extension */ if(extended && aggr_frag_size) - if(H5MF_xfree(f, alloc_type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0) + if(H5MF_xfree(f, alloc_type, aggr_frag_addr, aggr_frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment") } /* end if */ else { @@ -331,19 +331,19 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC); /* free any possible fragment */ if(aggr_frag_size) - if(H5MF_xfree(f, alloc_type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0) + if(H5MF_xfree(f, alloc_type, aggr_frag_addr, aggr_frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment") } /* end else */ } /* end if */ else { /* Allocate data from the file */ - if(HADDR_UNDEF == (ret_value = H5F_alloc(f, dxpl_id, type, size, &eoa_frag_addr, &eoa_frag_size))) + if(HADDR_UNDEF == (ret_value = H5F__alloc(f, type, size, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space") /* Check if fragment was generated */ if(eoa_frag_size) /* Put fragment on the free list */ - if(H5MF_xfree(f, type, dxpl_id, eoa_frag_addr, eoa_frag_size) < 0) + if(H5MF_xfree(f, type, eoa_frag_addr, eoa_frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment") } /* end else */ @@ -363,7 +363,7 @@ HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value); /*------------------------------------------------------------------------- - * Function: H5MF_aggr_try_extend + * Function: H5MF__aggr_try_extend * * Purpose: Check if a block is inside an aggregator block and extend it * if possible. @@ -388,12 +388,12 @@ HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value); *------------------------------------------------------------------------- */ htri_t -H5MF_aggr_try_extend(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, +H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_requested) { htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f); @@ -431,7 +431,7 @@ H5MF_aggr_try_extend(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, else { hsize_t extra = (extra_requested < aggr->alloc_size) ? aggr->alloc_size : extra_requested; - if((ret_value = H5F_try_extend(f, dxpl_id, type, (aggr->addr + aggr->size), extra)) < 0) + if((ret_value = H5F__try_extend(f, type, (aggr->addr + aggr->size), extra)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file") else if(ret_value == TRUE) { /* Shift the aggregator block by the extra requested */ @@ -467,7 +467,7 @@ H5MF_aggr_try_extend(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5MF_aggr_try_extend() */ +} /* end H5MF__aggr_try_extend() */ /*------------------------------------------------------------------------- @@ -648,7 +648,7 @@ H5MF_aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr, haddr_t *addr, /*------------------------------------------------------------------------- - * Function: H5MF_aggr_reset + * Function: H5MF__aggr_reset * * Purpose: Reset a block aggregator, returning any space back to file * @@ -661,12 +661,12 @@ H5MF_aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr, haddr_t *addr, *------------------------------------------------------------------------- */ static herr_t -H5MF_aggr_reset(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr) +H5MF__aggr_reset(H5F_t *f, H5F_blk_aggr_t *aggr) { H5FD_mem_t alloc_type; /* Type of file memory to work with */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(f); @@ -695,13 +695,13 @@ HDfprintf(stderr, "%s: tmp_addr = %a, tmp_size = %Hu\n", FUNC, tmp_addr, tmp_siz /* Return the unused portion of the metadata block to the file */ if(tmp_size > 0 && (H5F_INTENT(f) & H5F_ACC_RDWR)) - if(H5MF_xfree(f, alloc_type, dxpl_id, tmp_addr, tmp_size) < 0) + if(H5MF_xfree(f, alloc_type, tmp_addr, tmp_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't release aggregator's free space") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5MF_aggr_reset() */ +} /* end H5MF__aggr_reset() */ /*------------------------------------------------------------------------- @@ -719,7 +719,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_free_aggrs(H5F_t *f, hid_t dxpl_id) +H5MF_free_aggrs(H5F_t *f) { H5F_blk_aggr_t *first_aggr; /* First aggregator to reset */ H5F_blk_aggr_t *second_aggr; /* Second aggregator to reset */ @@ -764,9 +764,9 @@ H5MF_free_aggrs(H5F_t *f, hid_t dxpl_id) /* Release the unused portion of the metadata and "small data" blocks back * to the free lists in the file. */ - if(H5MF_aggr_reset(f, dxpl_id, first_aggr) < 0) + if(H5MF__aggr_reset(f, first_aggr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't reset metadata block") - if(H5MF_aggr_reset(f, dxpl_id, second_aggr) < 0) + if(H5MF__aggr_reset(f, second_aggr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't reset 'small data' block") done: FUNC_LEAVE_NOAPI(ret_value) @@ -826,7 +826,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5MF__aggr_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, H5F_blk_aggr_t *aggr) +H5MF__aggr_free(H5F_t *f, H5FD_mem_t type, H5F_blk_aggr_t *aggr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -843,7 +843,7 @@ H5MF__aggr_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, H5F_blk_aggr_t *aggr) HDassert(f->shared->feature_flags & aggr->feature_flag); /* Free the remaining space at EOA in the aggregator */ - if(H5F_free(f, dxpl_id, type, aggr->addr, aggr->size) < 0) + if(H5F__free(f, type, aggr->addr, aggr->size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free aggregation block") /* Reset the aggregator */ @@ -870,7 +870,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5MF_aggrs_try_shrink_eoa(H5F_t *f, hid_t dxpl_id) +H5MF_aggrs_try_shrink_eoa(H5F_t *f) { htri_t ma_status; /* Whether the metadata aggregator can shrink the EOA */ htri_t sda_status; /* Whether the small data aggregator can shrink the EOA */ @@ -885,13 +885,13 @@ H5MF_aggrs_try_shrink_eoa(H5F_t *f, hid_t dxpl_id) if((ma_status = H5MF_aggr_can_shrink_eoa(f, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr))) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query metadata aggregator stats") if(ma_status > 0) - if(H5MF__aggr_free(f, dxpl_id, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr)) < 0) + if(H5MF__aggr_free(f, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") if((sda_status = H5MF_aggr_can_shrink_eoa(f, H5FD_MEM_DRAW, &(f->shared->sdata_aggr))) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query small data aggregator stats") if(sda_status > 0) - if(H5MF__aggr_free(f, dxpl_id, H5FD_MEM_DRAW, &(f->shared->sdata_aggr)) < 0) + if(H5MF__aggr_free(f, H5FD_MEM_DRAW, &(f->shared->sdata_aggr)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") ret_value = (ma_status || sda_status); diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 0b300ba..592ca87 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -153,12 +153,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int indent, int fwidth) +H5MF_sects_debug(H5F_t *f, haddr_t fs_addr, FILE *stream, int indent, int fwidth) { 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) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* * Check arguments. @@ -171,7 +171,7 @@ H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int ind 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) + if(H5MF__open_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") if(f->shared->fs_man[type]) { @@ -184,18 +184,18 @@ H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int ind 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) + if(H5FS_sect_iterate(f, 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) + if(H5FS_close(f, 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) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_sects_debug() */ #ifdef H5MF_ALLOC_DEBUG_DUMP @@ -214,14 +214,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_sects_dump(H5F_t *f, hid_t dxpl_id, FILE *stream) +H5MF_sects_dump(H5F_t *f, FILE *stream) { haddr_t eoa; /* End of allocated space in the file */ int indent = 0; /* Amount to indent */ int fwidth = 50; /* Field width */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Dumping file free space sections\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -260,7 +260,7 @@ HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %a\n", FUNC, eoa); udata.fwidth = MAX(0, fwidth - 6); /* Iterate over all the free space sections */ - if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[ptype], H5MF_sects_debug_cb, &udata) < 0) + if(H5FS_sect_iterate(f, f->shared->fs_man[ptype], H5MF_sects_debug_cb, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") } /* end if */ else @@ -313,7 +313,7 @@ HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC, udata.fwidth = MAX(0, fwidth - 6); /* Iterate over all the free space sections */ - if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[atype], H5MF_sects_debug_cb, &udata) < 0) + if(H5FS_sect_iterate(f, f->shared->fs_man[atype], H5MF_sects_debug_cb, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") } /* end if */ else /* No sections of this type */ @@ -326,7 +326,7 @@ HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC, done: HDfprintf(stderr, "%s: Done dumping file free space sections\n", FUNC); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_sects_dump() */ #endif /* H5MF_ALLOC_DEBUG_DUMP */ diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h index b95a6db..fbf9ee8 100644 --- a/src/H5MFpkg.h +++ b/src/H5MFpkg.h @@ -146,7 +146,6 @@ typedef enum { typedef struct H5MF_sect_ud_t { /* Down */ H5F_t *f; /* Pointer to file to operate on */ - hid_t dxpl_id; /* DXPL for VFD operations */ H5FD_mem_t alloc_type; /* Type of memory being allocated */ hbool_t allow_sect_absorb; /* Whether sections are allowed to absorb a block aggregator */ hbool_t allow_eoa_shrink_only; /* Whether shrinking eoa is allowed only for the section */ @@ -181,13 +180,13 @@ H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1]; /******************************/ /* Allocator routines */ -H5_DLL herr_t H5MF_open_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); -H5_DLL herr_t H5MF_start_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); +H5_DLL herr_t H5MF__open_fstype(H5F_t *f, H5F_mem_page_t type); +H5_DLL herr_t H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type); -H5_DLL htri_t H5MF_find_sect(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size, H5FS_t *fspace, haddr_t *addr); -H5_DLL herr_t H5MF_add_sect(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, H5FS_t *fspace, H5MF_free_section_t *node); +H5_DLL htri_t H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, haddr_t *addr); +H5_DLL herr_t H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_section_t *node); -H5_DLL herr_t H5MF_sects_dump(H5F_t *f, hid_t dxpl_id, FILE *stream); +H5_DLL herr_t H5MF_sects_dump(H5F_t *f, FILE *stream); H5_DLL void H5MF_alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_page_t *fs_type); @@ -198,7 +197,7 @@ H5_DLL herr_t H5MF_sect_free(H5FS_section_info_t *sect); /* Block aggregator routines */ -H5_DLL htri_t H5MF_aggr_try_extend(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, +H5_DLL htri_t H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type, haddr_t abs_blk_end, hsize_t extra_requested); H5_DLL htri_t H5MF_aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr, const H5MF_free_section_t *sect, H5MF_shrink_type_t *shrink); diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index bfeaa33..58e5054 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -49,32 +49,32 @@ /* 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_close(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5MF_try_close(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size); +H5_DLL herr_t H5MF_close(H5F_t *f); +H5_DLL herr_t H5MF_try_close(H5F_t *f); /* 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 herr_t H5MF_xfree(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, +H5_DLL haddr_t H5MF_alloc(H5F_t *f, H5FD_mem_t type, hsize_t size); +H5_DLL haddr_t H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t type, hsize_t size); +H5_DLL herr_t H5MF_xfree(H5F_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size); -H5_DLL herr_t H5MF_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, - haddr_t addr, hsize_t size, hsize_t extra_requested); -H5_DLL htri_t H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, - haddr_t addr, hsize_t size); -H5_DLL ssize_t H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, - size_t nsects, H5F_sect_info_t *sect_info); +H5_DLL herr_t H5MF_try_extend(H5F_t *f, H5FD_mem_t type, haddr_t addr, + hsize_t size, hsize_t extra_requested); +H5_DLL htri_t H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, + hsize_t size); +H5_DLL ssize_t H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, + H5F_sect_info_t *sect_info); /* File 'temporary' space allocation routines */ H5_DLL haddr_t H5MF_alloc_tmp(H5F_t *f, hsize_t size); /* 'block aggregator' routines */ -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); +H5_DLL herr_t H5MF_free_aggrs(H5F_t *f); +H5_DLL htri_t H5MF_aggrs_try_shrink_eoa(H5F_t *f); /* 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); +H5_DLL herr_t H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled); +H5_DLL herr_t H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled); /* This function has to be declared in H5MFprivate.h as it is needed * in our test code to allow us to manually start a self referential @@ -82,12 +82,12 @@ H5_DLL herr_t H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_se * deallocation without causing assertion failures on the first * file space allocation / deallocation. */ -H5_DLL herr_t H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5MF_tidy_self_referential_fsm_hack(H5F_t *f); /* Debugging routines */ #ifdef H5MF_DEBUGGING -H5_DLL herr_t H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5MF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth); #endif /* H5MF_DEBUGGING */ #endif /* end _H5MFprivate_H */ diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 02e3218..4c021b2 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -57,10 +57,9 @@ /* 'simple/small/large' section callbacks */ static H5FS_section_info_t *H5MF_sect_deserialize(const H5FS_section_class_t *cls, - hid_t dxpl_id, const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, - unsigned *des_flags); + const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags); static herr_t H5MF_sect_valid(const H5FS_section_class_t *cls, - const H5FS_section_info_t *sect, hid_t dxpl_id); + const H5FS_section_info_t *sect); static H5FS_section_info_t *H5MF_sect_split(H5FS_section_info_t *sect, hsize_t frag_size); @@ -145,8 +144,8 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{ H5MF_sect_deserialize, /* Deserialize 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_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 */ @@ -285,7 +284,7 @@ H5MF_sect_free(H5FS_section_info_t *_sect) */ static H5FS_section_info_t * H5MF_sect_deserialize(const H5FS_section_class_t *cls, - hid_t H5_ATTR_UNUSED dxpl_id, const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr, + const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr, hsize_t sect_size, unsigned H5_ATTR_UNUSED *des_flags) { H5MF_free_section_t *sect; /* New section */ @@ -329,7 +328,7 @@ H5MF_sect_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, #ifdef NDEBUG H5_ATTR_UNUSED #endif /* NDEBUG */ - *_sect, hid_t H5_ATTR_UNUSED dxpl_id) + *_sect) { #ifndef NDEBUG const H5MF_free_section_t *sect = (const H5MF_free_section_t *)_sect; /* File free section */ @@ -594,7 +593,7 @@ H5MF_sect_simple_shrink(H5FS_section_info_t **_sect, void *_udata) HDassert(H5F_INTENT(udata->f) & H5F_ACC_RDWR); /* Release section's space at EOA */ - if(H5F_free(udata->f, udata->dxpl_id, udata->alloc_type, (*sect)->sect_info.addr, (*sect)->sect_info.size) < 0) + if(H5F__free(udata->f, udata->alloc_type, (*sect)->sect_info.addr, (*sect)->sect_info.size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed") } /* end if */ else { @@ -772,7 +771,7 @@ H5MF_sect_small_shrink(H5FS_section_info_t **_sect, void *_udata) HDassert(H5F_INTENT(udata->f) & H5F_ACC_RDWR); /* Release section's space at EOA */ - if(H5F_free(udata->f, udata->dxpl_id, udata->alloc_type, (*sect)->sect_info.addr, (*sect)->sect_info.size) < 0) + if(H5F__free(udata->f, udata->alloc_type, (*sect)->sect_info.addr, (*sect)->sect_info.size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed") /* Free section */ @@ -872,7 +871,7 @@ H5MF_sect_small_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, (*sect1)->sect_info.size += sect2->sect_info.size; if((*sect1)->sect_info.size == udata->f->shared->fs_page_size) { - if(H5MF_xfree(udata->f, udata->alloc_type, udata->dxpl_id, (*sect1)->sect_info.addr, (*sect1)->sect_info.size) < 0) + if(H5MF_xfree(udata->f, udata->alloc_type, (*sect1)->sect_info.addr, (*sect1)->sect_info.size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free merged section") /* Need to free possible metadata page in the PB cache */ @@ -1073,7 +1072,7 @@ H5MF_sect_large_shrink(H5FS_section_info_t **_sect, void *_udata) /* Free full pages from EOA */ /* Retain partial page in the free-space manager so as to keep EOA at page boundary */ - if(H5F_free(udata->f, udata->dxpl_id, udata->alloc_type, (*sect)->sect_info.addr+frag_size, (*sect)->sect_info.size-frag_size) < 0) + if(H5F__free(udata->f, udata->alloc_type, (*sect)->sect_info.addr+frag_size, (*sect)->sect_info.size-frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed") if(frag_size) /* Adjust section size for the partial page */ diff --git a/src/H5O.c b/src/H5O.c index cf84b47..1795b71 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -31,6 +31,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5Iprivate.h" /* IDs */ @@ -99,8 +100,8 @@ hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) { - H5G_loc_t loc; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ + H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -112,15 +113,21 @@ H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the object */ - if((ret_value = H5O_open_name(&loc, name, lapl_id, dxpl_id, TRUE)) < 0) + if((ret_value = H5O__open_name(&loc, name)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen() */ @@ -152,12 +159,8 @@ hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { - H5G_loc_t loc; - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ + H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -173,30 +176,21 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location, according to the order in the index */ - if(H5G_loc_find_by_idx(&loc, group_name, idx_type, order, n, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "group not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the object */ - if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, TRUE)) < 0) + if((ret_value = H5O__open_by_idx(&loc, group_name, idx_type, order, n)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: - /* Release the object location if we failed after copying it */ - if(ret_value < 0 && loc_found) - if(H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_idx() */ @@ -239,36 +233,31 @@ done: hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr) { - H5G_loc_t loc; - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hid_t lapl_id = H5P_LINK_ACCESS_DEFAULT; /* lapl to use to open this object */ - hid_t ret_value = FAIL; + H5G_loc_t loc; /* Location within file */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "ia", loc_id, addr); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if(!H5F_addr_defined(addr)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no address supplied") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no address supplied") - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - obj_loc.oloc->addr = addr; - obj_loc.oloc->file = loc.oloc->file; - H5G_name_reset(obj_loc.path); /* objects opened through this routine don't have a path name */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; /* Open the object */ - if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, H5AC_ind_read_dxpl_id, TRUE)) < 0) + if((ret_value = H5O__open_by_addr(&loc, addr)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_addr() */ @@ -298,9 +287,9 @@ herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id) { - H5G_loc_t new_loc; - H5G_loc_t obj_loc; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ + H5G_loc_t new_loc; /* Location of group to link from */ + H5G_loc_t obj_loc; /* Location of object to link to */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -323,15 +312,21 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, obj_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") - /* Link to the object */ - if(H5L_link(&new_loc, new_name, &obj_loc, lcpl_id, lapl_id, dxpl_id) < 0) + /* Create a link to the object */ + if(H5O__create_link(&new_loc, new_name, &obj_loc, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Olink() */ @@ -359,8 +354,9 @@ done: herr_t H5Oincr_refcount(hid_t object_id) { - H5O_loc_t *oloc; - herr_t ret_value = SUCCEED; + H5O_loc_t *oloc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); @@ -369,10 +365,21 @@ H5Oincr_refcount(hid_t object_id) if((oloc = H5O_get_loc(object_id)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") - if(H5O_link(oloc, 1, H5AC_ind_read_dxpl_id) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(object_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Change the object's refcount */ + if(H5O__link(oloc, 1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5O_incr_refcount() */ @@ -400,8 +407,9 @@ done: herr_t H5Odecr_refcount(hid_t object_id) { - H5O_loc_t *oloc; - herr_t ret_value = SUCCEED; + H5O_loc_t *oloc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); @@ -410,10 +418,21 @@ H5Odecr_refcount(hid_t object_id) if((oloc = H5O_get_loc(object_id)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") - if(H5O_link(oloc, -1, H5AC_ind_read_dxpl_id) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(object_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Change the object's refcount */ + if(H5O__link(oloc, -1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Odecr_refcount() */ @@ -435,7 +454,7 @@ htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; /* Location info */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) @@ -447,15 +466,21 @@ H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Check if the object exists */ - if((ret_value = H5G_loc_exists(&loc, name, lapl_id, dxpl_id)) < 0) + if((ret_value = H5O__exists_by_name(&loc, name)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists", name) done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oexists_by_name() */ @@ -477,6 +502,7 @@ herr_t H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) { H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -488,11 +514,18 @@ H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Retrieve the object's information */ - if(H5G_loc_info(&loc, ".", TRUE, oinfo/*out*/, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if(H5O__get_info_by_name(&loc, ".", oinfo/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info() */ @@ -514,7 +547,7 @@ herr_t H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -528,15 +561,21 @@ H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lap if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's information */ - if(H5G_loc_info(&loc, name, TRUE, oinfo/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if(H5O__get_info_by_name(&loc, name, oinfo/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object: '%s'", name) done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info_by_name() */ @@ -560,11 +599,7 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -583,29 +618,21 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location, according to the order in the index */ - if(H5G_loc_find_by_idx(&loc, group_name, idx_type, order, n, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "group not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's information */ - if(H5O_get_info(obj_loc.oloc, dxpl_id, TRUE, oinfo) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info") + if(H5O__get_info_by_idx(&loc, group_name, idx_type, order, n, oinfo) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object") done: - /* Release the object location */ - if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info_by_idx() */ @@ -631,6 +658,7 @@ herr_t H5Oset_comment(hid_t obj_id, const char *comment) { H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -640,11 +668,21 @@ H5Oset_comment(hid_t obj_id, const char *comment) if(H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* (Re)set the object's comment */ - if(H5G_loc_set_comment(&loc, ".", comment, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if(H5O__set_comment_by_name(&loc, ".", comment) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oset_comment() */ @@ -671,7 +709,7 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -683,15 +721,21 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* (Re)set the object's comment */ - if(H5G_loc_set_comment(&loc, name, comment, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if(H5O__set_comment_by_name(&loc, name, comment) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object: '%s'", name) done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oset_comment_by_name() */ @@ -716,6 +760,7 @@ ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize) { H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -725,11 +770,18 @@ H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize) if(H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Retrieve the object's comment */ - if((ret_value = H5G_loc_get_comment(&loc, ".", comment/*out*/, bufsize, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if((ret_value = H5O__get_comment_by_name(&loc, ".", comment/*out*/, bufsize)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment() */ @@ -755,7 +807,7 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -767,15 +819,21 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's comment */ - if((ret_value = H5G_loc_get_comment(&loc, name, comment/*out*/, bufsize, lapl_id, dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if((ret_value = H5O__get_comment_by_name(&loc, name, comment/*out*/, bufsize)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object: '%s'", name) done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment_by_name() */ @@ -816,6 +874,7 @@ herr_t H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -829,11 +888,18 @@ H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Call internal object visitation routine */ - if((ret_value = H5O_visit(obj_id, ".", idx_type, order, op, op_data, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5O__visit(obj_id, ".", idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ovisit() */ @@ -874,7 +940,7 @@ herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id) { - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -891,15 +957,21 @@ H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal object visitation routine */ - if((ret_value = H5O_visit(loc_id, obj_name, idx_type, order, op, op_data, lapl_id, dxpl_id)) < 0) + if((ret_value = H5O__visit(loc_id, obj_name, idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ovisit_by_name() */ @@ -925,6 +997,7 @@ done: herr_t H5Oclose(hid_t object_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -937,6 +1010,10 @@ H5Oclose(hid_t object_id) case H5I_DATASET: if(H5I_object(object_id) == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid object") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; if(H5I_dec_app_ref(object_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close object") break; @@ -960,6 +1037,8 @@ H5Oclose(hid_t object_id) } /* end switch */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oclose() */ diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index d8298a4..dc5bc47 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -34,24 +34,23 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_ainfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__ainfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_ainfo_copy(const void *_mesg, void *_dest); static size_t H5O_ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_ainfo_free(void *_mesg); -static herr_t H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - void *_mesg); +static herr_t H5O__ainfo_free(void *_mesg); +static herr_t H5O__ainfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); static herr_t H5O_ainfo_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); -static void *H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, +static void *H5O__ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_ainfo_post_copy_file(const H5O_loc_t *src_oloc, + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, - unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); -static herr_t H5O_ainfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); + unsigned *mesg_flags, H5O_copy_t *cpy_info); +static herr_t H5O__ainfo_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_AINFO[1] = {{ @@ -59,22 +58,22 @@ const H5O_msg_class_t H5O_MSG_AINFO[1] = {{ "ainfo", /*message name for debugging */ sizeof(H5O_ainfo_t), /*native message size */ 0, /* messages are sharable? */ - H5O_ainfo_decode, /*decode message */ + H5O__ainfo_decode, /*decode message */ H5O_ainfo_encode, /*encode message */ H5O_ainfo_copy, /*copy the native value */ H5O_ainfo_size, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_ainfo_free, /* free method */ - H5O_ainfo_delete, /* file delete method */ + H5O__ainfo_free, /* free method */ + H5O__ainfo_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ H5O_ainfo_pre_copy_file, /* pre copy native value to file */ - H5O_ainfo_copy_file, /* copy native value to file */ - H5O_ainfo_post_copy_file, /* post copy native value to file */ + H5O__ainfo_copy_file, /* copy native value to file */ + H5O__ainfo_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_ainfo_debug /*debug the message */ + H5O__ainfo_debug /*debug the message */ }}; /* Current version of attribute info information */ @@ -90,7 +89,7 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t); /*------------------------------------------------------------------------- - * Function: H5O_ainfo_decode + * Function: H5O__ainfo_decode * * Purpose: Decode a message and return a pointer to a newly allocated one. * @@ -104,14 +103,14 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t); *------------------------------------------------------------------------- */ static void * -H5O_ainfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__ainfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_ainfo_t *ainfo = NULL; /* Attribute info */ unsigned char flags; /* Flags for encoding attribute info */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -161,7 +160,7 @@ done: ainfo = H5FL_FREE(H5O_ainfo_t, ainfo); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ainfo_decode() */ +} /* end H5O__ainfo_decode() */ /*------------------------------------------------------------------------- @@ -295,9 +294,9 @@ H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void /*------------------------------------------------------------------------- - * Function: H5O_ainfo_free + * Function: H5O__ainfo_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -307,20 +306,20 @@ H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_free(void *mesg) +H5O__ainfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_ainfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ainfo_free() */ +} /* end H5O__ainfo_free() */ /*------------------------------------------------------------------------- - * Function: H5O_ainfo_delete + * Function: H5O__ainfo_delete * * Purpose: Free file space referenced by message. Note that open_oh * *must* be non-NULL - this means that calls to @@ -334,12 +333,12 @@ H5O_ainfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O__ainfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_ainfo_t *ainfo = (H5O_ainfo_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -347,15 +346,14 @@ H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) HDassert(open_oh); /* If the object is using "dense" attribute storage, delete it */ - if(H5F_addr_defined(ainfo->fheap_addr)) { + if(H5F_addr_defined(ainfo->fheap_addr)) /* Delete the attribute */ - if(H5A_dense_delete(f, dxpl_id, ainfo) < 0) + if(H5A__dense_delete(f, ainfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free dense attribute storage") - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ainfo_delete() */ +} /* end H5O__ainfo_delete() */ /*------------------------------------------------------------------------- @@ -393,7 +391,7 @@ H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE /*------------------------------------------------------------------------- - * Function: H5O_ainfo_copy_file + * Function: H5O__ainfo_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -406,15 +404,15 @@ H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE *------------------------------------------------------------------------- */ static void * -H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, +H5O__ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata, hid_t dxpl_id) + H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src; H5O_ainfo_t *ainfo_dst = NULL; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(file_src); @@ -434,13 +432,13 @@ H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, /* Prepare to copy dense attributes - actual copy in post_copy */ /* Set copied metadata tag */ - H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, NULL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); - if(H5A_dense_create(file_dst, dxpl_id, ainfo_dst) < 0) + if(H5A__dense_create(file_dst, ainfo_dst) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINIT, NULL, "unable to create dense storage for attributes") /* Reset metadata tag */ - H5_END_TAG(NULL); + H5_END_TAG } /* end if */ /* Set return value */ @@ -452,11 +450,11 @@ done: ainfo_dst = H5FL_FREE(H5O_ainfo_t, ainfo_dst); FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_ainfo_copy_file() */ +} /* H5O__ainfo_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_ainfo_post_copy_file + * Function: H5O__ainfo_post_copy_file * * Purpose: Finish copying a message from between files. * We have to copy the values of a reference attribute in the @@ -472,30 +470,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, +H5O__ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, - hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_copy_t *cpy_info) { const H5O_ainfo_t *ainfo_src = (const H5O_ainfo_t *)mesg_src; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(ainfo_src); - if(H5F_addr_defined(ainfo_src->fheap_addr)) { - if(H5A_dense_post_copy_file_all(src_oloc, ainfo_src, dst_oloc, - (H5O_ainfo_t *)mesg_dst, dxpl_id, cpy_info) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't copy attribute") - } /* end if */ + if(H5F_addr_defined(ainfo_src->fheap_addr)) + if(H5A__dense_post_copy_file_all(src_oloc, ainfo_src, dst_oloc, (H5O_ainfo_t *)mesg_dst, cpy_info) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't copy attribute") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_ainfo_post_copy_file() */ +} /* H5O__ainfo_post_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_ainfo_debug + * Function: H5O__ainfo_debug * * Purpose: Prints debugging info for a message. * @@ -508,12 +504,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__ainfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -539,5 +535,5 @@ H5O_ainfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ainfo_debug() */ +} /* end H5O__ainfo_debug() */ diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 478d950..8e6a5f3 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -61,21 +61,20 @@ static herr_t H5O_add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied, size_t idx, uint8_t *new_gap_loc, size_t new_gap_size); static herr_t H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *new_gap_loc, size_t new_gap_size); -static herr_t H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx, +static herr_t H5O__alloc_null(H5F_t *f, H5O_t *oh, size_t null_idx, const H5O_msg_class_t *new_type, void *new_native, size_t new_size); -static htri_t H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, +static htri_t H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size_t *msg_idx); static herr_t H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size, H5O_msg_alloc_info_t *found_msg); -static herr_t H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, +static herr_t H5O__alloc_new_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t *new_idx); static herr_t H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx); -static htri_t H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u); -static htri_t H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh); -static htri_t H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh); -static htri_t H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh); -static herr_t H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - unsigned chunkno); +static htri_t H5O_move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u); +static htri_t H5O_move_msgs_forward(H5F_t *f, H5O_t *oh); +static htri_t H5O_merge_null(H5F_t *f, H5O_t *oh); +static htri_t H5O_remove_empty_chunks(H5F_t *f, H5O_t *oh); +static herr_t H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno); /*********************/ @@ -325,7 +324,7 @@ H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, /*------------------------------------------------------------------------- * - * Function: H5O_alloc_null + * Function: H5O__alloc_null * * Purpose: Allocate room for a new message from a null message * @@ -338,7 +337,7 @@ H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, *------------------------------------------------------------------------- */ static herr_t -H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx, +H5O__alloc_null(H5F_t *f, H5O_t *oh, size_t null_idx, const H5O_msg_class_t *new_type, void *new_native, size_t new_size) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ @@ -346,7 +345,7 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx, H5O_mesg_t *alloc_msg; /* Pointer to null message to allocate out of */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(oh); @@ -357,7 +356,7 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx, alloc_msg = &oh->mesg[null_idx]; /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, alloc_msg->chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, alloc_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Check if there's a need to split the null message */ @@ -424,11 +423,11 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx, done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_alloc_null() */ +} /* H5O__alloc_null() */ /*------------------------------------------------------------------------- @@ -480,7 +479,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5O_alloc_extend_chunk + * Function: H5O__alloc_extend_chunk * * Purpose: Attempt to extend a chunk that is allocated on disk. * @@ -507,8 +506,8 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, - size_t size, size_t *msg_idx) +H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, + size_t *msg_idx) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ @@ -525,7 +524,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, size_t u; /* Local index variable */ htri_t ret_value = TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f != NULL); @@ -590,12 +589,11 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, } /* end if */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Determine whether the chunk can be extended */ - was_extended = H5MF_try_extend(f, dxpl_id, H5FD_MEM_OHDR, oh->chunk[chunkno].addr, - (hsize_t)(oh->chunk[chunkno].size), (hsize_t)(delta + extra_prfx_size)); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, oh->chunk[chunkno].addr, (hsize_t)(oh->chunk[chunkno].size), (hsize_t)(delta + extra_prfx_size)); if(was_extended < 0) /* error */ HGOTO_ERROR(H5E_OHDR, H5E_CANTEXTEND, FAIL, "can't tell if we can extend chunk") else if(was_extended == FALSE) /* can't extend -- we are done */ @@ -674,7 +672,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, unsigned cont_chunkno = oh->mesg[u].chunkno; /* Chunk # for continuation message */ /* Protect chunk containing continuation message */ - if(NULL == (chk_proxy2 = H5O_chunk_protect(f, dxpl_id, oh, cont_chunkno))) + if(NULL == (chk_proxy2 = H5O__chunk_protect(f, oh, cont_chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Adjust size in continuation message */ @@ -686,7 +684,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, chk_dirtied2 = TRUE; /* Release chunk containing continuation message */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy2, chk_dirtied2) < 0) + if(H5O__chunk_unprotect(f, chk_proxy2, chk_dirtied2) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ @@ -700,11 +698,11 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_alloc_extend_chunk() */ +} /* H5O__alloc_extend_chunk() */ /*------------------------------------------------------------------------- @@ -885,8 +883,8 @@ H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size, *------------------------------------------------------------------------- */ herr_t -H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, - size_t found_null, const H5O_msg_alloc_info_t *found_msg, size_t *new_idx) +H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, + const H5O_msg_alloc_info_t *found_msg, size_t *new_idx) { H5O_mesg_t *curr_msg; /* Pointer to current message to operate on */ H5O_chunk_proxy_t *chk_proxy; /* Chunk that message is in */ @@ -923,7 +921,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size += H5O_SIZEOF_CHKHDR_OH(oh); /* Allocate space in file to hold the new chunk */ - new_chunk_addr = H5MF_alloc(f, H5FD_MEM_OHDR, dxpl_id, (hsize_t)size); + new_chunk_addr = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)size); if(!H5F_addr_defined(new_chunk_addr)) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "unable to allocate space for new chunk") @@ -974,7 +972,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, H5O_mesg_t *null_msg; /* Pointer to new null message */ /* Protect last chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, chunkno - 1))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, chunkno - 1))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Copy each message to the new location */ @@ -1023,7 +1021,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, oh->chunk[chunkno - 1].gap = 0; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, TRUE) < 0) + if(H5O__chunk_unprotect(f, chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ else { @@ -1033,7 +1031,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, H5O_mesg_t *null_msg; /* Pointer to new null message */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, oh->mesg[found_msg->msgno].chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, oh->mesg[found_msg->msgno].chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Create null message for space that message to copy currently occupies */ @@ -1072,7 +1070,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, null_msg->raw_size += found_msg->null_size; /* Release any information/memory for message */ - H5O_msg_free_mesg(old_null_msg); + H5O__msg_free_mesg(old_null_msg); /* Remove null message from list of messages */ if(found_msg->null_msgno < (oh->nmesgs - 1)) @@ -1090,7 +1088,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, null_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, TRUE) < 0) + if(H5O__chunk_unprotect(f, chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ } /* end if */ @@ -1106,7 +1104,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, oh->mesg[idx].chunkno = chunkno; /* Insert the new chunk into the cache */ - if(H5O_chunk_add(f, dxpl_id, oh, chunkno, oh->mesg[found_null].chunkno) < 0) + if(H5O__chunk_add(f, oh, chunkno, oh->mesg[found_null].chunkno) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't add new chunk to cache") /* Initialize the continuation information */ @@ -1117,7 +1115,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, cont->chunkno = chunkno; /* Split the null message and point at continuation message */ - if(H5O_alloc_null(f, dxpl_id, oh, found_null, H5O_MSG_CONT, cont, cont_size) < 0) + if(H5O__alloc_null(f, oh, found_null, H5O_MSG_CONT, cont, cont_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't split null message") /* Set new message index value */ @@ -1129,7 +1127,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_alloc_new_chunk + * Function: H5O__alloc_new_chunk * * Purpose: Allocates a new chunk for the object header, including * file space. @@ -1164,14 +1162,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size_t *new_idx) +H5O__alloc_new_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t *new_idx) { size_t cont_size; /*continuation message size */ size_t idx; /* Message number */ H5O_msg_alloc_info_t found_msg; /* Best fit non-null message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(oh); @@ -1192,12 +1190,12 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size_t *new } /* end if */ /* Allocate and initialize new chunk in the file */ - if(H5O__alloc_chunk(f, dxpl_id, oh, size, idx, &found_msg, new_idx) < 0) + if(H5O__alloc_chunk(f, oh, size, idx, &found_msg, new_idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "can't allocate new object header chunk") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_alloc_new_chunk() */ +} /* H5O__alloc_new_chunk() */ /*------------------------------------------------------------------------- @@ -1277,7 +1275,7 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx) /*------------------------------------------------------------------------- - * Function: H5O_alloc + * Function: H5O__alloc * * Purpose: Allocate enough space in the object header for this message. * @@ -1290,7 +1288,7 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx) *------------------------------------------------------------------------- */ herr_t -H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, +H5O__alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const void *mesg, size_t *mesg_idx) { size_t raw_size; /* Raw size of message */ @@ -1298,7 +1296,7 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, size_t idx; /* Index of message which fits allocation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(oh); @@ -1332,7 +1330,7 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, for(chunkno = 0; chunkno < oh->nchunks; chunkno++) { htri_t tri_result; /* Status from attempting to extend chunk */ - if((tri_result = H5O_alloc_extend_chunk(f, dxpl_id, oh, chunkno, raw_size, &idx)) < 0) + if((tri_result = H5O__alloc_extend_chunk(f, oh, chunkno, raw_size, &idx)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTEXTEND, FAIL, "can't extend existing chunk") if(tri_result == TRUE) break; @@ -1340,13 +1338,13 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, /* If we were not able to extend a chunk, create a new one */ if(idx >= oh->nmesgs) - if(H5O_alloc_new_chunk(f, dxpl_id, oh, raw_size, &idx) < 0) + if(H5O__alloc_new_chunk(f, oh, raw_size, &idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "unable to create a new object header data chunk") } /* end if */ HDassert(idx < oh->nmesgs); /* Split the null message and point at continuation message */ - if(H5O_alloc_null(f, dxpl_id, oh, idx, type, NULL, aligned_size) < 0) + if(H5O__alloc_null(f, oh, idx, type, NULL, aligned_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't split null message") /* Mark object header as dirty in cache */ @@ -1358,7 +1356,7 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_alloc() */ +} /* H5O__alloc() */ /*------------------------------------------------------------------------- @@ -1376,8 +1374,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, - hbool_t adj_link) +H5O_release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ @@ -1391,18 +1388,17 @@ H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, HDassert(mesg); /* Check if we should operate on the message */ - if(adj_link) { + if(adj_link) /* Free any space referred to in the file from this message */ - if(H5O_delete_mesg(f, dxpl_id, oh, mesg) < 0) + if(H5O__delete_mesg(f, oh, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") - } /* end if */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, mesg->chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, mesg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Free any native information */ - H5O_msg_free_mesg(mesg); + H5O__msg_free_mesg(mesg); /* Change message type to nil and zero it */ mesg->type = H5O_MSG_NULL; @@ -1427,7 +1423,7 @@ H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1448,7 +1444,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) +H5O_move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that continuation message is in */ H5O_mesg_t *cont_msg; /* Pointer to the continuation message */ @@ -1464,7 +1460,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) /* Get initial information */ cont_msg = &oh->mesg[cont_u]; - H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, cont_msg, FAIL) + H5O_LOAD_NATIVE(f, 0, oh, cont_msg, FAIL) deleted_chunkno = ((H5O_cont_t *)(cont_msg->native))->chunkno; /* Check if continuation message is pointing to the last chunk */ @@ -1504,11 +1500,11 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) /* Convert continuation message into a null message. Do not delete * the target chunk yet, so we can still copy messages from it. */ - if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, FALSE) < 0) + if(H5O_release_mesg(f, oh, cont_msg, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to convert into null message") /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, cont_chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, cont_chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Move message(s) forward into continuation message */ @@ -1534,7 +1530,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) } /* end if */ /* Delete the target chunk */ - if(H5O_chunk_delete(f, dxpl_id, oh, deleted_chunkno) < 0) + if(H5O__chunk_delete(f, oh, deleted_chunkno) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove chunk from cache") HDassert(move_start <= (move_end + gap_size)); @@ -1558,7 +1554,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) } /* end if */ /* Release any information/memory for continuation message */ - H5O_msg_free_mesg(cont_msg); + H5O__msg_free_mesg(cont_msg); if(cont_u < (oh->nmesgs - 1)) HDmemmove(&oh->mesg[cont_u], &oh->mesg[cont_u + 1], ((oh->nmesgs - 1) - cont_u) * sizeof(H5O_mesg_t)); oh->nmesgs--; @@ -1572,7 +1568,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) /* Remove all null messages in deleted chunk from list of messages */ if(curr_msg->type->id == H5O_NULL_ID) { /* Release any information/memory for message */ - H5O_msg_free_mesg(curr_msg); + H5O__msg_free_mesg(curr_msg); chk_dirtied = TRUE; /* Remove from message list */ @@ -1594,7 +1590,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1616,7 +1612,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) +H5O_move_msgs_forward(H5F_t *f, H5O_t *oh) { H5O_chunk_proxy_t *null_chk_proxy = NULL; /* Chunk that null message is in */ H5O_chunk_proxy_t *curr_chk_proxy = NULL; /* Chunk that message is in */ @@ -1664,7 +1660,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* (We'll merge them together later, in another routine) */ if(H5O_NULL_ID != nonnull_msg->type->id) { /* Protect chunk */ - if(NULL == (null_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) + if(NULL == (null_chk_proxy = H5O__chunk_protect(f, oh, curr_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Copy raw data for non-null message to new location */ @@ -1683,7 +1679,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) curr_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, TRUE) < 0) + if(H5O__chunk_unprotect(f, null_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") null_chk_proxy = NULL; @@ -1710,7 +1706,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) if(H5O_CONT_ID == curr_msg->type->id) { htri_t status; /* Status from moving messages */ - if((status = H5O_move_cont(f, dxpl_id, oh, u)) < 0) + if((status = H5O_move_cont(f, oh, u)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "Error in moving messages into cont message") else if(status > 0) { /* Message(s) got moved into "continuation" message */ packed_msg = TRUE; @@ -1730,9 +1726,9 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) old_raw = curr_msg->raw; /* Protect chunks */ - if(NULL == (null_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, null_msg->chunkno))) + if(NULL == (null_chk_proxy = H5O__chunk_protect(f, oh, null_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") - if(NULL == (curr_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) + if(NULL == (curr_chk_proxy = H5O__chunk_protect(f, oh, curr_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* If the message being moved is a continuation @@ -1754,20 +1750,20 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) HDassert(((H5O_cont_t *)(curr_msg->native))->chunkno > 0); /* Protect continuation message target chunk */ - if(NULL == (cont_targ_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, ((H5O_cont_t *)(curr_msg->native))->chunkno))) + if(NULL == (cont_targ_chk_proxy = H5O__chunk_protect(f, oh, ((H5O_cont_t *)(curr_msg->native))->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Remove flush dependency on old continuation * message chunk */ HDassert(cont_targ_chk_proxy); - HDassert(cont_targ_chk_proxy->parent); + HDassert(cont_targ_chk_proxy->fd_parent); HDassert(curr_chk_proxy); - HDassert((void *)curr_chk_proxy == cont_targ_chk_proxy->parent); + HDassert((void *)curr_chk_proxy == cont_targ_chk_proxy->fd_parent); if(H5AC_destroy_flush_dependency(curr_chk_proxy, cont_targ_chk_proxy) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - cont_targ_chk_proxy->parent = NULL; + cont_targ_chk_proxy->fd_parent = NULL; /* Create flush dependency on new continuation * message chunk */ @@ -1780,11 +1776,11 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) HDassert((((H5C_cache_entry_t *)null_chk_mdc_obj)->type->id == H5AC_OHDR_ID) || (((H5C_cache_entry_t *)null_chk_mdc_obj)->type->id == H5AC_OHDR_CHK_ID)); - cont_targ_chk_proxy->parent = null_chk_mdc_obj; + cont_targ_chk_proxy->fd_parent = null_chk_mdc_obj; /* Unprotect continuation message target chunk */ - if(H5O_chunk_unprotect(f, dxpl_id, cont_targ_chk_proxy, FALSE) < 0) + if(H5O__chunk_unprotect(f, cont_targ_chk_proxy, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") cont_targ_chk_proxy = NULL; } /* end if */ @@ -1809,7 +1805,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) null_chk_dirtied = TRUE; /* Release current chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_dirtied) < 0) + if(H5O__chunk_unprotect(f, curr_chk_proxy, curr_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") curr_chk_proxy = NULL; curr_chk_dirtied = FALSE; @@ -1824,7 +1820,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) } /* end if */ /* Release null chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_dirtied) < 0) + if(H5O__chunk_unprotect(f, null_chk_proxy, null_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") null_chk_proxy = NULL; null_chk_dirtied = FALSE; @@ -1873,7 +1869,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) } /* end else */ /* Release null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_dirtied) < 0) + if(H5O__chunk_unprotect(f, null_chk_proxy, null_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") null_chk_proxy = NULL; null_chk_dirtied = FALSE; @@ -1899,7 +1895,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) } /* end if */ /* Release new null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_dirtied) < 0) + if(H5O__chunk_unprotect(f, curr_chk_proxy, curr_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") curr_chk_proxy = NULL; curr_chk_dirtied = FALSE; @@ -1933,11 +1929,11 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) done: if(ret_value < 0) { - if(null_chk_proxy && H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_dirtied) < 0) + if(null_chk_proxy && H5O__chunk_unprotect(f, null_chk_proxy, null_chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect null object header chunk") - if(curr_chk_proxy && H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_dirtied) < 0) + if(curr_chk_proxy && H5O__chunk_unprotect(f, curr_chk_proxy, curr_chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect current object header chunk") - if(cont_targ_chk_proxy && H5O_chunk_unprotect(f, dxpl_id, cont_targ_chk_proxy, FALSE) < 0) + if(cont_targ_chk_proxy && H5O__chunk_unprotect(f, cont_targ_chk_proxy, FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect continuation message target object header chunk") } /* end if */ else @@ -1962,7 +1958,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) +H5O_merge_null(H5F_t *f, H5O_t *oh) { hbool_t merged_msg; /* Flag to indicate that messages were merged */ hbool_t did_merging = FALSE; /* Whether any messages were merged */ @@ -2024,10 +2020,10 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) htri_t result; /* Release any information/memory for second message */ - H5O_msg_free_mesg(curr_msg2); + H5O__msg_free_mesg(curr_msg2); /* Protect chunk */ - if(NULL == (curr_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) + if(NULL == (curr_chk_proxy = H5O__chunk_protect(f, oh, curr_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Adjust first message address and extend length to cover second message */ @@ -2038,7 +2034,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) curr_msg->dirty = TRUE; /* Release new null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, TRUE) < 0) + if(H5O__chunk_unprotect(f, curr_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Remove second message from list of messages */ @@ -2050,7 +2046,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) oh->nmesgs--; /* The merge null message might span the entire chunk: scan for empty chunk to remove */ - if((result = H5O_remove_empty_chunks(f, dxpl_id, oh)) < 0) + if((result = H5O_remove_empty_chunks(f, oh)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't remove empty chunk") else if(result > 0) /* Get out of loop */ @@ -2058,7 +2054,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* If the merged message is too large, shrink the chunk */ if(curr_msg->raw_size >= H5O_MESG_MAX_SIZE) - if(H5O_alloc_shrink_chunk(f, dxpl_id, oh, curr_msg->chunkno) < 0) + if(H5O__alloc_shrink_chunk(f, oh, curr_msg->chunkno) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "unable to shrink chunk") /* Get out of loop */ @@ -2105,7 +2101,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) +H5O_remove_empty_chunks(H5F_t *f, H5O_t *oh) { hbool_t deleted_chunk; /* Whether to a chunk was deleted */ hbool_t did_deleting = FALSE; /* Whether any chunks were deleted */ @@ -2141,7 +2137,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) for(v = 0, cont_msg = &oh->mesg[0]; v < oh->nmesgs; v++, cont_msg++) { if(H5O_CONT_ID == cont_msg->type->id) { /* Decode current continuation message if necessary */ - H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, cont_msg, FAIL) + H5O_LOAD_NATIVE(f, 0, oh, cont_msg, FAIL) /* Check if the chunkno needs to be set */ /* (should only occur when the continuation message is first decoded) */ @@ -2172,7 +2168,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) deleted_chunkno = null_msg->chunkno; /* Convert continuation message into a null message */ - if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, TRUE) < 0) + if(H5O_release_mesg(f, oh, cont_msg, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to convert into null message") /* @@ -2196,7 +2192,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* If the entry is in the cache, update its chunk index */ if(chk_proxy_status & H5AC_ES__IN_CACHE) { - if(H5O_chunk_update_idx(f, dxpl_id, oh, u) < 0) + if(H5O__chunk_update_idx(f, oh, u) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "unable to update index for chunk proxy") } /* end if */ } /* end for */ @@ -2211,7 +2207,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) */ /* Release any information/memory for message */ - H5O_msg_free_mesg(null_msg); + H5O__msg_free_mesg(null_msg); /* Remove null message from list of messages */ if(null_msg_no < (oh->nmesgs - 1)) @@ -2233,7 +2229,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* Check for continuation message */ if(H5O_CONT_ID == curr_msg->type->id) { /* Decode current continuation message if necessary */ - H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, curr_msg, FAIL) + H5O_LOAD_NATIVE(f, 0, oh, curr_msg, FAIL) /* Check if the chunkno needs to be set */ /* (should only occur when the continuation message is first decoded) */ @@ -2287,15 +2283,10 @@ done: * koziol@ncsa.uiuc.edu * Oct 4 2005 * - * Modifications: - * Feb. 2009: Vailin Choi - * Add 2 more parameters to H5O_move_msgs_forward() for moving - * messages forward into "continuation" message - * *------------------------------------------------------------------------- */ herr_t -H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id) +H5O_condense_header(H5F_t *f, H5O_t *oh) { hbool_t rescan_header; /* Whether to rescan header */ htri_t result; /* Result from packing/merging/etc */ @@ -2312,21 +2303,21 @@ H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id) rescan_header = FALSE; /* Scan for messages that can be moved earlier in chunks */ - result = H5O_move_msgs_forward(f, dxpl_id, oh); + result = H5O_move_msgs_forward(f, oh); if(result < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't move header messages forward") if(result > 0) rescan_header = TRUE; /* Scan for adjacent null messages & merge them */ - result = H5O_merge_null(f, dxpl_id, oh); + result = H5O_merge_null(f, oh); if(result < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack null header messages") if(result > 0) rescan_header = TRUE; /* Scan for empty chunks to remove */ - result = H5O_remove_empty_chunks(f, dxpl_id, oh); + result = H5O_remove_empty_chunks(f, oh); if(result < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't remove empty chunk") if(result > 0) @@ -2343,7 +2334,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5O_alloc_shrink_chunk + * Function: H5O__alloc_shrink_chunk * * Purpose: Shrinks a chunk, removing all null messages and any gap. * @@ -2356,7 +2347,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) +H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno) { H5O_chunk_t *chunk = &oh->chunk[chunkno]; /* Chunk to shrink */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Metadata cache proxy for chunk to shrink */ @@ -2374,14 +2365,14 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) size_t u; /* Index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); HDassert(oh); /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Loop backwards to increase the chance of seeing more null messages at the @@ -2415,7 +2406,7 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) new_size -= shrink_size; /* Release any information/memory for the message */ - H5O_msg_free_mesg(curr_msg); + H5O__msg_free_mesg(curr_msg); /* Remove the deleted null message from list of messages */ if(u < (oh->nmesgs - 1)) @@ -2508,7 +2499,7 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) H5O_chunk_proxy_t *cont_chk_proxy; /* Chunk that message is in */ /* Protect chunk */ - if(NULL == (cont_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) + if(NULL == (cont_chk_proxy = H5O__chunk_protect(f, oh, curr_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Adjust size of continuation message */ @@ -2519,7 +2510,7 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) curr_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, cont_chk_proxy, TRUE) < 0) + if(H5O__chunk_unprotect(f, cont_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ @@ -2531,14 +2522,14 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) HGOTO_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize object header chunk") /* Free the unused space in the file */ - if(H5MF_xfree(f, H5FD_MEM_OHDR, dxpl_id, chunk->addr + new_size, (hsize_t)(old_size - new_size)) < 0) + if(H5MF_xfree(f, H5FD_MEM_OHDR, chunk->addr + new_size, (hsize_t)(old_size - new_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to shrink object header chunk") done: /* Release chunk, marking it dirty */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, TRUE) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, TRUE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_alloc_shrink_chunk() */ +} /* H5O__alloc_shrink_chunk() */ diff --git a/src/H5Oattr.c b/src/H5Oattr.c index cb802ea..441a938 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -25,23 +25,23 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +static void *H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static void *H5O_attr_copy(const void *_mesg, void *_dest); static size_t H5O_attr_size(const H5F_t *f, const void *_mesg); -static herr_t H5O_attr_free(void *mesg); +static herr_t H5O__attr_free(void *mesg); static herr_t H5O_attr_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); -static void *H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, +static void *H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_attr_post_copy_file(const H5O_loc_t *src_oloc, - const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__attr_post_copy_file(const H5O_loc_t *src_oloc, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); static herr_t H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx); static herr_t H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx); -static herr_t H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__attr_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_ATTR @@ -51,17 +51,17 @@ static herr_t H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, #define H5O_SHARED_ENCODE_REAL H5O_attr_encode #define H5O_SHARED_SIZE H5O_attr_shared_size #define H5O_SHARED_SIZE_REAL H5O_attr_size -#define H5O_SHARED_DELETE H5O_attr_shared_delete -#define H5O_SHARED_DELETE_REAL H5O_attr_delete -#define H5O_SHARED_LINK H5O_attr_shared_link -#define H5O_SHARED_LINK_REAL H5O_attr_link -#define H5O_SHARED_COPY_FILE H5O_attr_shared_copy_file -#define H5O_SHARED_COPY_FILE_REAL H5O_attr_copy_file +#define H5O_SHARED_DELETE H5O__attr_shared_delete +#define H5O_SHARED_DELETE_REAL H5O__attr_delete +#define H5O_SHARED_LINK H5O__attr_shared_link +#define H5O_SHARED_LINK_REAL H5O__attr_link +#define H5O_SHARED_COPY_FILE H5O__attr_shared_copy_file +#define H5O_SHARED_COPY_FILE_REAL H5O__attr_copy_file #define H5O_SHARED_POST_COPY_FILE H5O_attr_shared_post_copy_file -#define H5O_SHARED_POST_COPY_FILE_REAL H5O_attr_post_copy_file +#define H5O_SHARED_POST_COPY_FILE_REAL H5O__attr_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_attr_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O_attr_debug +#define H5O_SHARED_DEBUG_REAL H5O__attr_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* This message derives from H5O message class */ @@ -74,14 +74,14 @@ const H5O_msg_class_t H5O_MSG_ATTR[1] = {{ H5O_attr_shared_encode, /* encode message */ H5O_attr_copy, /* copy the native value */ H5O_attr_shared_size, /* size of raw message */ - H5O_attr_reset, /* reset method */ - H5O_attr_free, /* free method */ - H5O_attr_shared_delete, /* file delete method */ - H5O_attr_shared_link, /* link method */ + H5O__attr_reset, /* reset method */ + H5O__attr_free, /* free method */ + H5O__attr_shared_delete, /* file delete method */ + H5O__attr_shared_link, /* link method */ NULL, /*set share method */ NULL, /*can share method */ H5O_attr_pre_copy_file, /* pre copy native value to file */ - H5O_attr_shared_copy_file, /* copy native value to file */ + H5O__attr_shared_copy_file, /* copy native value to file */ H5O_attr_shared_post_copy_file, /* post copy native value to file */ H5O_attr_get_crt_index, /* get creation index */ H5O_attr_set_crt_index, /* set creation index */ @@ -107,9 +107,8 @@ H5FL_EXTERN(H5S_extent_t); Decode a attribute message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_attr_decode(f, dxpl_id, mesg_flags, p) + void *H5O_attr_decode(f, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct - hid_t dxpl_id; IN: DXPL for any I/O unsigned mesg_flags; IN: Message flags to influence decoding const uint8_t *p; IN: the raw information buffer RETURNS @@ -120,7 +119,7 @@ H5FL_EXTERN(H5S_extent_t); function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, +H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags, const uint8_t *p) { H5A_t *attr = NULL; @@ -184,8 +183,8 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED p += name_len; /* advance the memory pointer */ /* Decode the attribute's datatype */ - if(NULL == (attr->shared->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)(f, dxpl_id, open_oh, - ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p))) + if(NULL == (attr->shared->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)(f, open_oh, + ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p))) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype") if(attr->shared->version < H5O_ATTR_VERSION_2) p += H5O_ALIGN_OLD(attr->shared->dt_size); @@ -199,7 +198,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Decode attribute's dataspace extent */ - if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, dxpl_id, open_oh, + if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, open_oh, ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p)) == NULL) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace") @@ -251,7 +250,7 @@ done: if(attr) { if(attr->shared) { /* Free any dynamicly allocated items */ - if(H5A_free(attr) < 0) + if(H5A__free(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't release attribute info") /* Destroy shared attribute struct */ @@ -400,7 +399,7 @@ H5O_attr_copy(const void *_src, void *_dst) HDassert(_src); /* copy */ - if(NULL == (ret_value = (H5A_t *)H5A_copy((H5A_t *)_dst, (const H5A_t *)_src))) + if(NULL == (ret_value = (H5A_t *)H5A__copy((H5A_t *)_dst, (const H5A_t *)_src))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "can't copy attribute") done: @@ -470,7 +469,7 @@ H5O_attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) /*------------------------------------------------------------------------- - * Function: H5O_attr_reset + * Function: H5O__attr_reset * * Purpose: Frees resources within a attribute message, but doesn't free * the message itself. @@ -480,28 +479,21 @@ H5O_attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) * Programmer: Robb Matzke * Tuesday, December 9, 1997 * - * Modification:Raymond Lu - * 25 June 2008 - * Made this function empty. The freeing action is actually - * done in H5O_attr_free (see H5O_msg_free_real). But this - * empty reset function needs to be here. Otherwise, the - * caller function H5O_msg_reset_real will zero-set the whole - * message. *------------------------------------------------------------------------- */ herr_t -H5O_attr_reset(void H5_ATTR_UNUSED *_mesg) +H5O__attr_reset(void H5_ATTR_UNUSED *_mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_attr_reset() */ +} /* end H5O__attr_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_free + * Function: H5O__attr_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -511,25 +503,25 @@ H5O_attr_reset(void H5_ATTR_UNUSED *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_attr_free(void *mesg) +H5O__attr_free(void *mesg) { H5A_t *attr = (H5A_t *)mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(mesg); - if(H5A_close(attr) < 0) + if(H5A__close(attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "unable to close attribute object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_free() */ +} /* end H5O__attr_free() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_delete + * Function: H5O__attr_delete * * Purpose: Free file space referenced by message * @@ -541,7 +533,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *_mesg) +H5O__attr_delete(H5F_t *f, H5O_t *oh, void *_mesg) { H5A_t *attr = (H5A_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -553,20 +545,20 @@ H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *_mesg) HDassert(attr); /* Decrement reference count on datatype in file */ - if((H5O_MSG_DTYPE->del)(f, dxpl_id, oh, attr->shared->dt) < 0) + if((H5O_MSG_DTYPE->del)(f, oh, attr->shared->dt) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust datatype link count") /* Decrement reference count on dataspace in file */ - if((H5O_MSG_SDSPACE->del)(f, dxpl_id, oh, attr->shared->ds) < 0) + if((H5O_MSG_SDSPACE->del)(f, oh, attr->shared->ds) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust dataspace link count") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_delete() */ +} /* end H5O__attr_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_link + * Function: H5O__attr_link * * Purpose: Increment reference count on any objects referenced by * message @@ -579,12 +571,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *_mesg) +H5O__attr_link(H5F_t *f, H5O_t *oh, void *_mesg) { H5A_t *attr = (H5A_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -596,14 +588,14 @@ H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *_mesg) * message is deleted. */ /* Increment reference count on datatype & dataspace in file */ - if((H5O_MSG_DTYPE->link)(f, dxpl_id, oh, attr->shared->dt) < 0) + if((H5O_MSG_DTYPE->link)(f, oh, attr->shared->dt) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust datatype link count") - if((H5O_MSG_SDSPACE->link)(f, dxpl_id, oh, attr->shared->ds) < 0) + if((H5O_MSG_SDSPACE->link)(f, oh, attr->shared->ds) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust dataspace link count") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_link() */ +} /* end H5O__attr_link() */ /*------------------------------------------------------------------------- @@ -642,7 +634,7 @@ H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED /*------------------------------------------------------------------------- - * Function: H5O_attr_copy_file + * Function: H5O__attr_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -656,13 +648,13 @@ H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *------------------------------------------------------------------------- */ static void * -H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t H5_ATTR_UNUSED *mesg_type, +H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t H5_ATTR_UNUSED *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata, hid_t dxpl_id) + H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(native_src); @@ -676,16 +668,16 @@ H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t H5_ATTR_UNUSED *mesg_t if(H5T_set_loc(((H5A_t *)native_src)->shared->dt, file_src, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "invalid datatype location") - if(NULL == (ret_value = H5A_attr_copy_file((H5A_t *)native_src, file_dst, recompute_size, cpy_info, dxpl_id))) + if(NULL == (ret_value = H5A__attr_copy_file((H5A_t *)native_src, file_dst, recompute_size, cpy_info))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy attribute") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_attr_copy_file() */ +} /* H5O__attr_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_post_copy_file + * Function: H5O__attr_post_copy_file * * Purpose: Finish copying a message from between files. * We have to copy the values of a reference attribute in the @@ -701,21 +693,19 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, - H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) +H5O__attr_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, + H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info) { herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_STATIC - FUNC_ENTER_NOAPI_NOINIT - - if ( H5A_attr_post_copy_file(src_oloc, (const H5A_t *)mesg_src, - dst_oloc, (H5A_t *)mesg_dst, dxpl_id, cpy_info) < 0) + if(H5A__attr_post_copy_file(src_oloc, (const H5A_t *)mesg_src, dst_oloc, (H5A_t *)mesg_dst, cpy_info) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't copy attribute") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_attr_post_copy_file() */ +} /* H5O__attr_post_copy_file() */ /*------------------------------------------------------------------------- @@ -779,11 +769,11 @@ H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) /*-------------------------------------------------------------------------- NAME - H5O_attr_debug + H5O__attr_debug PURPOSE Prints debugging information for an attribute message USAGE - void *H5O_attr_debug(f, mesg, stream, indent, fwidth) + void *H5O__attr_debug(f, mesg, stream, indent, fwidth) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source attribute struct FILE *stream; IN: Pointer to the stream for output data @@ -796,15 +786,14 @@ H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) parameter. --------------------------------------------------------------------------*/ static herr_t -H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int indent, - int fwidth) +H5O__attr_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5A_t *mesg = (const H5A_t *)_mesg; const char *s; /* Temporary string pointer */ char buf[128]; /* Temporary string buffer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -868,17 +857,17 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0,fwidth - 3), "Encoded Size:", (unsigned long)(mesg->shared->dt_size)); - if((H5O_MSG_DTYPE->debug)(f, dxpl_id, mesg->shared->dt, stream, indent + 3, MAX(0, fwidth - 3)) < 0) + if((H5O_MSG_DTYPE->debug)(f, mesg->shared->dt, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display datatype message info") HDfprintf(stream, "%*sDataspace...\n", indent, ""); HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0, fwidth - 3), "Encoded Size:", (unsigned long)(mesg->shared->ds_size)); - if(H5S_debug(f, dxpl_id, mesg->shared->ds, stream, indent + 3, MAX(0, fwidth - 3)) < 0) + if(H5S_debug(f, mesg->shared->ds, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display dataspace message info") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_debug() */ +} /* end H5O__attr_debug() */ diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 2223564..9d125e8 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -55,7 +55,6 @@ /* User data for iteration when converting attributes to dense storage */ typedef struct { H5F_t *f; /* Pointer to file for insertion */ - hid_t dxpl_id; /* DXPL during iteration */ H5O_ainfo_t *ainfo; /* Attribute info struct */ } H5O_iter_cvt_t; @@ -72,7 +71,6 @@ typedef struct { typedef struct { /* down */ H5F_t *f; /* Pointer to file attribute is in */ - hid_t dxpl_id; /* DXPL for operation */ H5A_t *attr; /* Attribute data to update object header with */ /* up */ @@ -83,7 +81,6 @@ typedef struct { typedef struct { /* down */ H5F_t *f; /* Pointer to file attribute is in */ - hid_t dxpl_id; /* DXPL for operation */ const char *old_name; /* Old name of attribute */ const char *new_name; /* New name of attribute */ @@ -95,7 +92,6 @@ typedef struct { typedef struct { /* down */ H5F_t *f; /* Pointer to file attribute is in */ - hid_t dxpl_id; /* DXPL for operation */ hid_t loc_id; /* ID of object being iterated over */ unsigned skip; /* # of attributes to skip over */ H5A_operator_t op; /* Callback routine for each attribute */ @@ -109,7 +105,6 @@ typedef struct { typedef struct { /* down */ H5F_t *f; /* Pointer to file attribute is in */ - hid_t dxpl_id; /* DXPL for operation */ const char *name; /* Name of attribute to open */ /* up */ @@ -186,12 +181,12 @@ H5O_attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, HDassert(attr); /* Insert attribute into dense storage */ - if(H5A_dense_insert(udata->f, udata->dxpl_id, udata->ainfo, attr) < 0) + if(H5A__dense_insert(udata->f, udata->ainfo, attr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to add to dense storage") /* Convert message into a null message in the header */ /* (don't delete attribute's space in the file though) */ - if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, FALSE) < 0) + if(H5O_release_mesg(udata->f, oh, mesg, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") /* Indicate that the object header was modified */ @@ -203,7 +198,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_create + * Function: H5O__attr_create * * Purpose: Create a new attribute in the object header. * @@ -215,7 +210,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) +H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ @@ -229,7 +224,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) HDassert(attr); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check if this object already has attribute information */ @@ -238,7 +233,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) htri_t ainfo_exists; /* Whether the attribute info was retrieved */ /* Check for (& retrieve if available) attribute info */ - if((ainfo_exists = H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") if(!ainfo_exists) { /* Initialize attribute information */ @@ -266,7 +261,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) size_t raw_size = 0; /* Raw size of message */ /* Check for attribute being sharable */ - if((sharable = H5SM_can_share(loc->file, dxpl_id, NULL, NULL, H5O_ATTR_ID, attr)) < 0) + if((sharable = H5SM_can_share(loc->file, NULL, NULL, H5O_ATTR_ID, attr)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't determine attribute sharing status") else if(sharable == FALSE) { /* Compute the size needed to encode the attribute */ @@ -279,18 +274,17 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) H5O_mesg_operator_t op; /* Wrapper for operator */ /* Create dense storage for attributes */ - if(H5A_dense_create(loc->file, dxpl_id, &ainfo) < 0) + if(H5A__dense_create(loc->file, &ainfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create dense storage for attributes") /* Set up user data for callback */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.ainfo = &ainfo; /* Iterate over existing attributes, moving them to dense storage */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_to_dense_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCONVERT, FAIL, "error converting attributes to dense storage") } /* end if */ } /* end if */ @@ -313,14 +307,13 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) /* Add the attribute information message, if one is needed */ if(new_ainfo) { - if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, &ainfo) < 0) + if(H5O__msg_append_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new attribute info message") } /* end if */ /* Otherwise, update existing message */ - else { - if(H5O_msg_write_real(loc->file, dxpl_id, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, &ainfo) < 0) + else + if(H5O__msg_write_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message") - } /* end else */ } /* end if */ else { /* Set "bogus" creation index for attribute */ @@ -333,19 +326,18 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) /* Check for storing attribute with dense storage */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Insert attribute into dense storage */ - if(H5A_dense_insert(loc->file, dxpl_id, &ainfo, attr) < 0) + if(H5A__dense_insert(loc->file, &ainfo, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to add to dense storage") } /* end if */ - else { + else /* Append new message to object header */ - if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_ATTR, 0, 0, attr) < 0) + if(H5O__msg_append_real(loc->file, oh, H5O_MSG_ATTR, 0, 0, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new attribute in header") - } /* end else */ /* Increment reference count for shared attribute object for the - * object handle created by the caller function H5A_create. The count + * object handle created by the caller function H5A__create. The count * for the cached object header has been incremented in the step above - * (in H5O_msg_append_real). The dense storage doesn't need a count. */ + * (in H5O__msg_append_real). The dense storage doesn't need a count. */ attr->shared->nrefs += 1; /* Was new attribute shared? */ @@ -353,7 +345,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) hsize_t attr_rc; /* Attribute's ref count in shared message storage */ /* Retrieve ref count for shared attribute */ - if(H5SM_get_refcount(loc->file, dxpl_id, H5O_ATTR_ID, &attr->sh_loc, &attr_rc) < 0) + if(H5SM_get_refcount(loc->file, H5O_ATTR_ID, &attr->sh_loc, &attr_rc) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") /* If this is not the first copy of the attribute in the shared message @@ -380,7 +372,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) * *ick* -QAK, 2007/01/08 */ if(attr_rc > 1) { - if(H5O_attr_delete(loc->file, dxpl_id, oh, attr) < 0) + if(H5O__attr_delete(loc->file, oh, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") } /* end if */ } /* end if */ @@ -388,7 +380,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(loc->file, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: @@ -396,7 +388,7 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_create() */ +} /* end H5O__attr_create() */ /*------------------------------------------------------------------------- @@ -430,7 +422,7 @@ H5O_attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, /* Check for correct attribute message to modify */ if(HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { /* Make a copy of the attribute to return */ - if(NULL == (udata->attr = H5A_copy(NULL, (H5A_t *)mesg->native))) + if(NULL == (udata->attr = H5A__copy(NULL, (H5A_t *)mesg->native))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy attribute") /* Assign [somewhat arbitrary] creation order value, for older versions @@ -449,7 +441,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_open_by_name + * Function: H5O__attr_open_by_name * * Purpose: Open an existing attribute in an object header. * @@ -458,15 +450,10 @@ done: * Programmer: Quincey Koziol * Monday, December 11, 2006 * - * Modification:Raymond Lu - * 23 June 2008 - * If the attribute is in dense storage and has already been - * opened, make a copy of already opened object to share some - * object information. *------------------------------------------------------------------------- */ H5A_t * -H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) +H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ @@ -475,21 +462,21 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) htri_t found_open_attr = FALSE; /* Whether opened object is found */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, NULL) + FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ HDassert(loc); HDassert(name); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't check for attribute info message") } /* end if */ @@ -499,14 +486,14 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) if((found_open_attr = H5O_attr_find_opened_attr(loc, &exist_attr, name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "failed in finding opened attribute") else if(found_open_attr == TRUE) { - if(NULL == (opened_attr = H5A_copy(NULL, exist_attr))) + if(NULL == (opened_attr = H5A__copy(NULL, exist_attr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy existing attribute") } /* end else if */ else { /* Check for attributes in dense storage */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Open attribute with dense storage */ - if(NULL == (opened_attr = H5A_dense_open(loc->file, dxpl_id, &ainfo, name))) + if(NULL == (opened_attr = H5A__dense_open(loc->file, &ainfo, name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "can't open attribute") } /* end if */ else { @@ -520,7 +507,7 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Iterate over attributes, to locate correct one to open */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_open_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "error updating attribute") /* Check that we found the attribute */ @@ -541,16 +528,16 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) ret_value = opened_attr; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, NULL, "unable to release object header") /* Release any resources, on error */ if(NULL == ret_value && opened_attr) - if(H5A_close(opened_attr) < 0) + if(H5A__close(opened_attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, NULL, "can't close attribute") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* end H5O_attr_open_by_name() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__attr_open_by_name() */ /*------------------------------------------------------------------------- @@ -580,7 +567,7 @@ H5O_attr_open_by_idx_cb(const H5A_t *attr, void *_ret_attr) HDassert(ret_attr); /* Copy attribute information. Shared some attribute information. */ - if(NULL == (*ret_attr = H5A_copy(NULL, attr))) + if(NULL == (*ret_attr = H5A__copy(NULL, attr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") done: @@ -589,7 +576,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_open_by_idx + * Function: H5O__attr_open_by_idx * * Purpose: Open an existing attribute in an object header according to * an index. @@ -599,25 +586,19 @@ done: * Programmer: Quincey Koziol * Monday, December 18, 2006 * - * Modification:Raymond Lu - * 23 June 2008 - * After opening the attribute, check whether it's in dense - * storage and has already been opened. If it has, close the - * opened object and make a copy of already opened object. *------------------------------------------------------------------------- */ H5A_t * -H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, hid_t dxpl_id) +H5O__attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) { - H5O_t *oh = NULL; /* Object header */ H5A_attr_iter_op_t attr_op; /* Attribute operator */ H5A_t *exist_attr = NULL; /* Existing opened attribute object */ H5A_t *opened_attr = NULL; /* Newly opened attribute object */ htri_t found_open_attr = FALSE; /* Whether opened object is found */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -627,13 +608,9 @@ H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, attr_op.u.lib_op = H5O_attr_open_by_idx_cb; /* Iterate over attributes to locate correct one */ - if(H5O_attr_iterate_real((hid_t)-1, loc, dxpl_id, idx_type, order, n, NULL, &attr_op, &opened_attr) < 0) + if(H5O_attr_iterate_real((hid_t)-1, loc, idx_type, order, n, NULL, &attr_op, &opened_attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, NULL, "can't locate attribute") - /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, NULL, "unable to load object header") - /* Find out whether it has already been opened. If it has, close the object * and make a copy of the already opened object to share the object info. */ @@ -645,9 +622,9 @@ H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, * and close the object just opened. */ if(found_open_attr && exist_attr) { - if(H5A_close(opened_attr) < 0) + if(H5A__close(opened_attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, NULL, "can't close attribute") - if(NULL == (opened_attr = H5A_copy(NULL, exist_attr))) + if(NULL == (opened_attr = H5A__copy(NULL, exist_attr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy existing attribute") } else { /* Mark datatype as being on disk now */ @@ -660,16 +637,13 @@ H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, ret_value = opened_attr; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - /* Release any resources, on error */ if(NULL == ret_value && opened_attr) - if(H5A_close(opened_attr) < 0) + if(H5A__close(opened_attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, NULL, "can't close attribute") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_open_by_idx() */ +} /* end H5O__attr_open_by_idx() */ /*------------------------------------------------------------------------- @@ -754,7 +728,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_update_shared + * Function: H5O__attr_update_shared * * Purpose: Update a shared attribute. * @@ -767,15 +741,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5A_t *attr, - H5O_shared_t *update_sh_mesg) +H5O__attr_update_shared(H5F_t *f, H5O_t *oh, H5A_t *attr, H5O_shared_t *update_sh_mesg) { H5O_shared_t sh_mesg; /* Shared object header message */ hsize_t attr_rc; /* Attribute's ref count in shared message storage */ htri_t shared_mesg; /* Whether the message should be shared */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -791,13 +764,13 @@ H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5A_t *attr, /* Store new version of message as a SOHM */ /* (should always work, since we're not changing the size of the attribute) */ - if((shared_mesg = H5SM_try_share(f, dxpl_id, oh, 0, H5O_ATTR_ID, attr, NULL)) == 0) + if((shared_mesg = H5SM_try_share(f, oh, 0, H5O_ATTR_ID, attr, NULL)) == 0) HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "attribute changed sharing status") else if(shared_mesg < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't share attribute") /* Retrieve shared message storage ref count for new shared attribute */ - if(H5SM_get_refcount(f, dxpl_id, H5O_ATTR_ID, &attr->sh_loc, &attr_rc) < 0) + if(H5SM_get_refcount(f, H5O_ATTR_ID, &attr->sh_loc, &attr_rc) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") /* If the newly shared attribute needs to share "ownership" of the shared @@ -809,14 +782,13 @@ H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5A_t *attr, * * *ick* -QAK, 2007/01/08 */ - if(attr_rc == 1) { + if(attr_rc == 1) /* Increment reference count on attribute components */ - if(H5O_attr_link(f, dxpl_id, oh, attr) < 0) + if(H5O__attr_link(f, oh, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count") - } /* end if */ /* Remove the old attribute from the SOHM storage */ - if(H5SM_delete(f, dxpl_id, oh, &sh_mesg) < 0) + if(H5SM_delete(f, oh, &sh_mesg) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to delete shared attribute in shared storage") /* Extract updated shared message info from modified attribute, if requested */ @@ -826,7 +798,7 @@ H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5A_t *attr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_update_shared() */ +} /* end H5O__attr_update_shared() */ /*------------------------------------------------------------------------- @@ -866,7 +838,7 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Check for correct attribute message to modify */ if(0 == HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->attr->shared->name)) { /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(udata->f, udata->dxpl_id, oh, mesg->chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(udata->f, oh, mesg->chunkno))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk") /* Because the attribute structure is shared now. The only situation that requires @@ -888,13 +860,13 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) + if(H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") chk_proxy = NULL; /* Update the shared attribute in the SOHM storage */ if(mesg->flags & H5O_MSG_FLAG_SHARED) - if(H5O_attr_update_shared(udata->f, udata->dxpl_id, oh, udata->attr, (H5O_shared_t *)mesg->native) < 0) + if(H5O__attr_update_shared(udata->f, oh, udata->attr, (H5O_shared_t *)mesg->native) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, H5_ITER_ERROR, "unable to update attribute in shared storage") /* Indicate that the object header was modified */ @@ -909,7 +881,7 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -917,7 +889,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_write + * Function: H5O__attr_write * * Purpose: Write a new value to an attribute. * @@ -929,34 +901,34 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) +H5O__attr_write(const H5O_loc_t *loc, H5A_t *attr) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); HDassert(attr); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Modify the attribute data in dense storage */ - if(H5A_dense_write(loc->file, dxpl_id, &ainfo, attr) < 0) + if(H5A__dense_write(loc->file, &ainfo, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") } /* end if */ else { @@ -965,14 +937,13 @@ H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) /* Set up user data for callback */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.attr = attr; udata.found = FALSE; /* Iterate over attributes, to locate correct one to update */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_write_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") /* Check that we found the attribute */ @@ -981,7 +952,7 @@ H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) } /* end else */ /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(loc->file, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: @@ -989,7 +960,7 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_write */ +} /* end H5O__attr_write */ /*------------------------------------------------------------------------- @@ -1073,7 +1044,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned old_version = ((H5A_t *)mesg->native)->shared->version; /* Old version of the attribute */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(udata->f, udata->dxpl_id, oh, mesg->chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(udata->f, oh, mesg->chunkno))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk") /* Change the name for the attribute */ @@ -1081,7 +1052,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, ((H5A_t *)mesg->native)->shared->name = H5MM_xstrdup(udata->new_name); /* Recompute the version to encode the attribute with */ - if(H5A_set_version(udata->f, ((H5A_t *)mesg->native)) < 0) + if(H5A__set_version(udata->f, ((H5A_t *)mesg->native)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5_ITER_ERROR, "unable to update attribute version") /* Mark the message as modified */ @@ -1089,14 +1060,14 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) + if(H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") chk_proxy = NULL; /* Check for shared message */ if(mesg->flags & H5O_MSG_FLAG_SHARED) { /* Update the shared attribute in the SOHM storage */ - if(H5O_attr_update_shared(udata->f, udata->dxpl_id, oh, (H5A_t *)mesg->native, NULL) < 0) + if(H5O__attr_update_shared(udata->f, oh, (H5A_t *)mesg->native, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, H5_ITER_ERROR, "unable to update attribute in shared storage") } /* end if */ else { @@ -1125,21 +1096,21 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* (doesn't decrement the link count on shared components becuase * the "native" pointer has been reset) */ - if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, FALSE) < 0) + if(H5O_release_mesg(udata->f, oh, mesg, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release previous attribute") *oh_modified = H5O_MODIFY_CONDENSE; /* Append renamed attribute to object header */ /* (Don't let it become shared) */ - if(H5O_msg_append_real(udata->f, udata->dxpl_id, oh, H5O_MSG_ATTR, (mesg->flags | H5O_MSG_FLAG_DONTSHARE), 0, attr) < 0) + if(H5O__msg_append_real(udata->f, oh, H5O_MSG_ATTR, (mesg->flags | H5O_MSG_FLAG_DONTSHARE), 0, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to relocate renamed attribute in header") /* Sanity check */ HDassert(H5O_msg_is_shared(H5O_ATTR_ID, attr) == FALSE); /* Close the local copy of the attribute */ - H5A_close(attr); + H5A__close(attr); } /* end if */ } /* end else */ @@ -1155,7 +1126,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1163,7 +1134,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_rename + * Function: H5O__attr_rename * * Purpose: Rename an attribute. * @@ -1175,14 +1146,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, +H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, const char *new_name) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ HDassert(loc); @@ -1190,21 +1161,21 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, HDassert(new_name); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Rename the attribute data in dense storage */ - if(H5A_dense_rename(loc->file, dxpl_id, &ainfo, old_name, new_name) < 0) + if(H5A__dense_rename(loc->file, &ainfo, old_name, new_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") } /* end if */ else { @@ -1213,7 +1184,6 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, /* Set up user data for callback */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.old_name = old_name; udata.new_name = new_name; udata.found = FALSE; @@ -1221,7 +1191,7 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, /* Iterate over attributes, to check if "new name" exists already */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_rename_chk_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") /* If the new name was found, indicate an error */ @@ -1231,7 +1201,7 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, /* Iterate over attributes again, to actually rename attribute with old name */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_rename_mod_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") /* Check that we found the attribute to rename */ @@ -1240,15 +1210,15 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, } /* end else */ /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(loc->file, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: if(oh && H5O_unpin(oh) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_attr_rename */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__attr_rename */ /*------------------------------------------------------------------------- @@ -1264,16 +1234,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, - H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, - hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data) +H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, + const H5A_attr_iter_op_t *attr_op, void *op_data) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(loc->addr) /* Check arguments */ HDassert(loc); @@ -1282,14 +1252,14 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, HDassert(attr_op); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -1300,21 +1270,21 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") /* Release the object header */ - if(H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") oh = NULL; /* Iterate over attributes in dense storage */ - if((ret_value = H5A_dense_iterate(loc->file, dxpl_id, loc_id, &ainfo, idx_type, order, skip, last_attr, attr_op, op_data)) < 0) + if((ret_value = H5A__dense_iterate(loc->file, loc_id, &ainfo, idx_type, order, skip, last_attr, attr_op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); } /* end if */ else { /* Build table of attributes for compact storage */ - if(H5A_compact_build_table(loc->file, dxpl_id, oh, idx_type, order, &atable) < 0) + if(H5A__compact_build_table(loc->file, oh, idx_type, order, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") /* Release the object header */ - if(H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") oh = NULL; @@ -1323,23 +1293,23 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") /* Iterate over attributes in table */ - if((ret_value = H5A_attr_iterate_table(&atable, skip, last_attr, loc_id, attr_op, op_data)) < 0) + if((ret_value = H5A__attr_iterate_table(&atable, skip, last_attr, loc_id, attr_op, op_data)) < 0) HERROR(H5E_ATTR, H5E_CANTNEXT, "iteration operator failed"); } /* end else */ done: /* Release resources */ - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if(atable.attrs && H5A_attr_release_table(&atable) < 0) + if(atable.attrs && H5A__attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_attr_iterate_real() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_iterate + * Function: H5O__attr_iterate * * Purpose: Iterate over attributes for an object. * @@ -1351,14 +1321,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, - H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, - hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data) +H5O__attr_iterate(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, + hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, + void *op_data) { H5G_loc_t loc; /* Object location */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(attr_op); @@ -1368,12 +1338,12 @@ H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Iterate over attributes to locate correct one */ - if((ret_value = H5O_attr_iterate_real(loc_id, loc.oloc, dxpl_id, idx_type, order, skip, last_attr, attr_op, op_data)) < 0) + if((ret_value = H5O_attr_iterate_real(loc_id, loc.oloc, idx_type, order, skip, last_attr, attr_op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_iterate() */ +} /* end H5O__attr_iterate() */ /*------------------------------------------------------------------------- @@ -1397,8 +1367,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo, - hid_t dxpl_id) +H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) { H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1419,7 +1388,7 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo, size_t u; /* Local index */ /* Build the table of attributes for this object */ - if(H5A_dense_build_table(loc->file, dxpl_id, ainfo, H5_INDEX_NAME, H5_ITER_NATIVE, &atable) < 0) + if(H5A__dense_build_table(loc->file, ainfo, H5_INDEX_NAME, H5_ITER_NATIVE, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") /* Inspect attributes in table for ones that can't be converted back @@ -1447,7 +1416,7 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo, else if(shared_mesg == 0) { /* Increment reference count on attribute components */ /* (so that they aren't deleted when the dense attribute storage is deleted) */ - if(H5O_attr_link(loc->file, dxpl_id, oh, (atable.attrs[u])) < 0) + if(H5O__attr_link(loc->file, oh, (atable.attrs[u])) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count") } /* end if */ else { @@ -1464,17 +1433,17 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo, /* If found the attribute is already opened, use the opened message to insert. If not, still use the message in the attribute table. */ if(found_open_attr && exist_attr) { - if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_ATTR, 0, 0, exist_attr) < 0) + if(H5O__msg_append_real(loc->file, oh, H5O_MSG_ATTR, 0, 0, exist_attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't create message") - } else { - if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_ATTR, 0, 0, (atable.attrs[u])) < 0) + } /* end if */ + else + if(H5O__msg_append_real(loc->file, oh, H5O_MSG_ATTR, 0, 0, (atable.attrs[u])) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't create message") - } } /* end for */ /* Remove the dense storage */ - if(H5A_dense_delete(loc->file, dxpl_id, ainfo) < 0) + if(H5A__dense_delete(loc->file, ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete dense attribute storage") } /* end if */ } /* end if */ @@ -1483,17 +1452,16 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo, * message should be deleted itself. */ if(ainfo->nattrs == 0) { - if(H5O_msg_remove_real(loc->file, oh, H5O_MSG_AINFO, H5O_ALL, NULL, NULL, TRUE, dxpl_id) < 0) + if(H5O__msg_remove_real(loc->file, oh, H5O_MSG_AINFO, H5O_ALL, NULL, NULL, TRUE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute info") } /* end if */ - else { - if(H5O_msg_write_real(loc->file, dxpl_id, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, ainfo) < 0) + else + if(H5O__msg_write_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message") - } /* end else */ done: /* Release resources */ - if(atable.attrs && H5A_attr_release_table(&atable) < 0) + if(atable.attrs && H5A__attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") FUNC_LEAVE_NOAPI(ret_value) @@ -1531,7 +1499,7 @@ H5O_attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Check for correct attribute message to modify */ if(HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { /* Convert message into a null message (i.e. delete it) */ - if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, TRUE) < 0) + if(H5O_release_mesg(udata->f, oh, mesg, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") /* Indicate that the object header was modified */ @@ -1550,7 +1518,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_remove + * Function: H5O__attr_remove * * Purpose: Delete an attribute on an object. * @@ -1562,35 +1530,35 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) +H5O__attr_remove(const H5O_loc_t *loc, const char *name) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ HDassert(loc); HDassert(name); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if((ainfo_exists = H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Delete attribute from dense storage */ - if(H5A_dense_remove(loc->file, dxpl_id, &ainfo, name) < 0) + if(H5A__dense_remove(loc->file, &ainfo, name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage") } /* end if */ else { @@ -1599,14 +1567,13 @@ H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Set up user data for callback */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.name = name; udata.found = FALSE; /* Iterate over attributes, to locate correct one to delete */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_remove_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute") /* Check that we found the attribute */ @@ -1616,23 +1583,23 @@ H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Update the attribute information after removing an attribute */ if(ainfo_exists) - if(H5O_attr_remove_update(loc, oh, &ainfo, dxpl_id) < 0) + if(H5O_attr_remove_update(loc, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(loc->file, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: if(oh && H5O_unpin(oh) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_attr_remove() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__attr_remove() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_remove_by_idx + * Function: H5O__attr_remove_by_idx * * Purpose: Delete an attribute on an object, according to an order within * an index. @@ -1645,8 +1612,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, hid_t dxpl_id) +H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ @@ -1654,27 +1621,27 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ HDassert(loc); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if((ainfo_exists = H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Delete attribute from dense storage */ - if(H5A_dense_remove_by_idx(loc->file, dxpl_id, &ainfo, idx_type, order, n) < 0) + if(H5A__dense_remove_by_idx(loc->file, &ainfo, idx_type, order, n) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage") } /* end if */ else { @@ -1682,7 +1649,7 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5O_mesg_operator_t op; /* Wrapper for operator */ /* Build table of attributes for compact storage */ - if(H5A_compact_build_table(loc->file, dxpl_id, oh, idx_type, order, &atable) < 0) + if(H5A__compact_build_table(loc->file, oh, idx_type, order, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") /* Check for skipping too many attributes */ @@ -1691,14 +1658,13 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, /* Set up user data for callback, to remove the attribute by name */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.name = ((atable.attrs[n])->shared)->name; udata.found = FALSE; /* Iterate over attributes, to locate correct one to delete */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_remove_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute") /* Check that we found the attribute */ @@ -1708,21 +1674,21 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, /* Update the attribute information after removing an attribute */ if(ainfo_exists) - if(H5O_attr_remove_update(loc, oh, &ainfo, dxpl_id) < 0) + if(H5O_attr_remove_update(loc, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(loc->file, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: if(oh && H5O_unpin(oh) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") - if(atable.attrs && H5A_attr_release_table(&atable) < 0) + if(atable.attrs && H5A__attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_attr_remove_by_idx() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__attr_remove_by_idx() */ /*------------------------------------------------------------------------- @@ -1738,11 +1704,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs) +H5O_attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(oh->cache_info.addr) /* Check arguments */ HDassert(f); @@ -1755,7 +1721,7 @@ H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs) H5O_ainfo_t ainfo; /* Attribute information for object */ /* Attempt to get the attribute information from the object header */ - if((ainfo_exists = H5A_get_ainfo(f, dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(f, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") else if(ainfo_exists > 0) *nattrs = ainfo.nattrs; @@ -1775,7 +1741,7 @@ H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs) } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_attr_count_real */ @@ -1820,7 +1786,7 @@ H5O_attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, /*------------------------------------------------------------------------- - * Function: H5O_attr_exists + * Function: H5O__attr_exists * * Purpose: Determine if an attribute with a particular name exists on an object * @@ -1832,34 +1798,34 @@ H5O_attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, *------------------------------------------------------------------------- */ htri_t -H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) +H5O__attr_exists(const H5O_loc_t *loc, const char *name) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ HDassert(loc); HDassert(name); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Check if attribute exists in dense storage */ - if((ret_value = H5A_dense_exists(loc->file, dxpl_id, &ainfo, name)) < 0) + if((ret_value = H5A__dense_exists(loc->file, &ainfo, name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error checking for existence of attribute") } /* end if */ else { @@ -1868,14 +1834,13 @@ H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Set up user data for callback */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.name = name; udata.found = FALSE; /* Iterate over existing attributes, checking for attribute with same name */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_exists_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error checking for existence of attribute") /* Check that we found the attribute */ @@ -1883,15 +1848,15 @@ H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) } /* end else */ done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_attr_exists */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__attr_exists() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_bh_info + * Function: H5O__attr_bh_info * * Purpose: For 1.8 attribute, returns storage amount for btree and fractal heap * @@ -1903,14 +1868,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) +H5O__attr_bh_info(H5F_t *f, H5O_t *oh, H5_ih_info_t *bh_info) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(f); HDassert(oh); @@ -1922,39 +1887,39 @@ H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ /* Check for (& retrieve if available) attribute info */ - if((ainfo_exists = H5A_get_ainfo(f, dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(f, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") else if(ainfo_exists > 0) { /* Check if name index available */ if(H5F_addr_defined(ainfo.name_bt2_addr)) { /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo.name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Get name index B-tree size */ - if(H5B2_size(bt2_name, dxpl_id, &(bh_info->index_size)) < 0) + if(H5B2_size(bt2_name, &(bh_info->index_size)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") } /* end if */ /* Check if creation order index available */ if(H5F_addr_defined(ainfo.corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(f, dxpl_id, ainfo.corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(f, ainfo.corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Get creation order index B-tree size */ - if(H5B2_size(bt2_corder, dxpl_id, &(bh_info->index_size)) < 0) + if(H5B2_size(bt2_corder, &(bh_info->index_size)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") } /* end if */ /* Get storage size of fractal heap, if it's used */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Open the fractal heap for attributes */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo.fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo.fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Get heap storage size */ - if(H5HF_size(fheap, dxpl_id, &(bh_info->heap_size)) < 0) + if(H5HF_size(fheap, &(bh_info->heap_size)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") } /* end if */ } /* end else */ @@ -1962,20 +1927,20 @@ H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_attr_bh_info() */ +} /* H5O__attr_bh_info() */ #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- - * Function: H5O_attr_count + * Function: H5O__attr_count * * Purpose: Determine the # of attributes on an object * @@ -1987,33 +1952,33 @@ done: *------------------------------------------------------------------------- */ int -H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id) +H5O__attr_count(const H5O_loc_t *loc) { H5O_t *oh = NULL; /* Pointer to actual object header */ hsize_t nattrs; /* Number of attributes */ int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve # of attributes on object */ - if(H5O_attr_count_real(loc->file, dxpl_id, oh, &nattrs) < 0) + if(H5O_attr_count_real(loc->file, oh, &nattrs) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve attribute count") /* Set return value */ ret_value = (int)nattrs; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_count */ +} /* end H5O__attr_count */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Obogus.c b/src/H5Obogus.c index a3531ed..4542d30 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -37,12 +37,12 @@ #ifdef H5O_ENABLE_BOGUS /* PRIVATE PROTOTYPES */ -static void *H5O_bogus_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__bogus_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_bogus_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth); +static herr_t H5O__bogus_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1] = {{ @@ -50,7 +50,7 @@ const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1] = {{ "bogus valid", /*message name for debugging */ 0, /*native message size */ 0, /* messages are sharable? */ - H5O_bogus_decode, /*decode message */ + H5O__bogus_decode, /*decode message */ H5O_bogus_encode, /*encode message */ NULL, /*copy the native value */ H5O_bogus_size, /*raw message size */ @@ -65,7 +65,7 @@ const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_bogus_debug /*debug the message */ + H5O__bogus_debug /*debug the message */ }}; /* This message derives from H5O message class */ @@ -74,8 +74,8 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ "bogus invalid", /*message name for debugging */ 0, /*native message size */ 0, /* messages are sharable? */ - H5O_bogus_decode, /*decode message */ - H5O_bogus_encode, /*encode message */ + H5O__bogus_decode, /*decode message */ + H5O__bogus_encode, /*encode message */ NULL, /*copy the native value */ H5O_bogus_size, /*raw message size */ NULL, /*free internal memory */ @@ -89,12 +89,12 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_bogus_debug /*debug the message */ + H5O__bogus_debug /*debug the message */ }}; /*------------------------------------------------------------------------- - * Function: H5O_bogus_decode + * Function: H5O__bogus_decode * * Purpose: Decode a "bogus" message and return a pointer to a new * native message struct. @@ -110,13 +110,13 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_bogus_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__bogus_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_bogus_t *mesg = NULL; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -141,7 +141,7 @@ done: H5MM_xfree(mesg); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_bogus_decode() */ +} /* end H5O__bogus_decode() */ /*------------------------------------------------------------------------- @@ -202,7 +202,7 @@ H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha /*------------------------------------------------------------------------- - * Function: H5O_bogus_debug + * Function: H5O__bogus_debug * * Purpose: Prints debugging info for the message. * @@ -217,12 +217,12 @@ H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha *------------------------------------------------------------------------- */ static herr_t -H5O_bogus_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth) +H5O__bogus_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_bogus_t *mesg = (const H5O_bogus_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -235,6 +235,6 @@ H5O_bogus_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi "Bogus Value:", mesg->u); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_bogus_debug() */ +} /* end H5O__bogus_debug() */ #endif /* H5O_ENABLE_BOGUS */ diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index 4fd0577..4b7875e 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -27,13 +27,13 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_btreek_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_btreek_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_btreek_copy(const void *_mesg, void *_dest); static size_t H5O_btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_btreek_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); +static herr_t H5O__btreek_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ @@ -56,7 +56,7 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_btreek_debug /*debug the message */ + H5O__btreek_debug /*debug the message */ }}; /* Current version of v1 B-tree 'K' value information */ @@ -78,7 +78,7 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_btreek_t *mesg; /* Native message */ @@ -219,7 +219,7 @@ H5O_btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sh /*------------------------------------------------------------------------- - * Function: H5O_btreek_debug + * Function: H5O__btreek_debug * * Purpose: Prints debugging info for the message. * @@ -231,12 +231,12 @@ H5O_btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sh *------------------------------------------------------------------------- */ static herr_t -H5O_btreek_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O__btreek_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -253,5 +253,5 @@ H5O_btreek_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const vo "Symbol table node leaf 'K' value:", mesg->sym_leaf_k); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_btreek_debug() */ +} /* end H5O__btreek_debug() */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 8f4c155..02dd63f 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -799,7 +799,7 @@ H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, } /* end else */ /* Increment reference count of object header */ - if(H5O_inc_rc(udata->oh) < 0) + if(H5O__inc_rc(udata->oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, NULL, "can't increment reference count on object header") chk_proxy->oh = udata->oh; @@ -912,7 +912,6 @@ static herr_t H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) { H5O_chunk_proxy_t *chk_proxy = (H5O_chunk_proxy_t *)_thing; - H5O_chunk_proxy_t *cont_chk_proxy = NULL; /* Proxy for chunk containing continuation message that points to this chunk, if not chunk 0 */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -927,37 +926,26 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_AFTER_INSERT: case H5AC_NOTIFY_ACTION_AFTER_LOAD: if(chk_proxy->oh->swmr_write) { - /* Add flush dependency on chunk parent */ - { - void *parent; /* Chunk containing continuation message that points to this chunk */ - - /* Determine the parent of the chunk */ - if(chk_proxy->cont_chunkno == 0) - parent = chk_proxy->oh; - else { - if(NULL == (cont_chk_proxy = H5O_chunk_protect(chk_proxy->f, H5AC_ind_read_dxpl_id, chk_proxy->oh, chk_proxy->cont_chunkno))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") - parent = cont_chk_proxy; - } /* end else */ - + /* Add flush dependency on chunk with continuation, if one exists */ + if(chk_proxy->fd_parent) { /* Sanity checks */ - HDassert(parent); - HDassert(((H5C_cache_entry_t *)parent)->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(((H5C_cache_entry_t *)parent)->type); - HDassert((((H5C_cache_entry_t *)(parent))->type->id == H5AC_OHDR_ID) - || (((H5C_cache_entry_t *)(parent))->type->id == H5AC_OHDR_CHK_ID)); + HDassert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type); + HDassert((((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_ID) + || (((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_CHK_ID)); /* Add flush dependency from chunk containing the continuation message * that points to this chunk (either oh or another chunk proxy object) */ - if(H5AC_create_flush_dependency(parent, chk_proxy) < 0) + if(H5AC_create_flush_dependency(chk_proxy->fd_parent, chk_proxy) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + } /* end if */ - /* Make note of the address and pointer of the flush dependency - * parent so we can take the dependency down on eviction. - */ - chk_proxy->parent = parent; - } + /* Add flush dependency on object header */ + { + if(H5AC_create_flush_dependency(chk_proxy->oh, chk_proxy) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + } /* end if */ /* Add flush dependency on object header proxy, if proxy exists */ { @@ -996,17 +984,21 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_BEFORE_EVICT: if(chk_proxy->oh->swmr_write) { - /* Remove flush dependency on parent object header chunk */ - { + /* Remove flush dependency on parent object header chunk, if one is set */ + if(chk_proxy->fd_parent) { /* Sanity checks */ - HDassert(chk_proxy->parent != NULL); - HDassert(((H5C_cache_entry_t *)(chk_proxy->parent))->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(((H5C_cache_entry_t *)(chk_proxy->parent))->type); - HDassert((((H5C_cache_entry_t *)(chk_proxy->parent))->type->id == H5AC_OHDR_ID) || (((H5C_cache_entry_t *)(chk_proxy->parent))->type->id == H5AC_OHDR_CHK_ID)); + HDassert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type); + HDassert((((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_ID) || (((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_CHK_ID)); - if(H5AC_destroy_flush_dependency(chk_proxy->parent, chk_proxy) < 0) + if(H5AC_destroy_flush_dependency(chk_proxy->fd_parent, chk_proxy) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - } + chk_proxy->fd_parent = NULL; + } /* end if */ + + /* Unregister the object header as a parent of the virtual entry */ + if(H5AC_destroy_flush_dependency(chk_proxy->oh, chk_proxy) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") /* Unregister the object header chunk as a parent of the virtual entry */ if(H5AC_proxy_entry_remove_parent(chk_proxy->oh->proxy, chk_proxy) < 0) @@ -1023,10 +1015,6 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) } /* end switch */ done: - if(cont_chk_proxy) - if(H5O_chunk_unprotect(chk_proxy->f, H5AC_ind_read_dxpl_id, cont_chk_proxy, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") - FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__cache_chk_notify() */ @@ -1515,7 +1503,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image H5O_cont_t *cont; /* Decode continuation message */ - cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw); + cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, NULL, 0, &ioflags, mesg->raw); H5_CHECKED_ASSIGN(cont->chunkno, unsigned, udata->cont_msg_info->nmsgs + 1, size_t); /* the next continuation message/chunk */ /* Save 'native' form of continuation message */ @@ -1531,7 +1519,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image /* Decode ref. count message */ HDassert(oh->version > H5O_VERSION_1); - refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw); + refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(udata->f, NULL, 0, &ioflags, mesg->raw); /* Save 'native' form of ref. count message */ mesg->native = refcount; diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index a427b49..acf5b5b 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -37,7 +37,7 @@ #include "H5MFprivate.h" /* File space management */ /* Callbacks for message class */ -static void *H5O__mdci_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +static void *H5O__mdci_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O__mdci_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); @@ -45,10 +45,9 @@ static void *H5O__mdci_copy(const void *_mesg, void *_dest); static size_t H5O__mdci_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__mdci_free(void *mesg); -static herr_t H5O__mdci_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - void *_mesg); -static herr_t H5O__mdci_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE *stream, int indent, int fwidth); +static herr_t H5O__mdci_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); +static herr_t H5O__mdci_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_MDCI[1] = {{ @@ -97,9 +96,9 @@ H5FL_DEFINE(H5O_mdci_t); *------------------------------------------------------------------------- */ static void * -H5O__mdci_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__mdci_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + const uint8_t *p) { H5O_mdci_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ @@ -276,7 +275,7 @@ H5O__mdci_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O__mdci_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O__mdci_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_mdci_t *mesg = (H5O_mdci_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -325,11 +324,11 @@ H5O__mdci_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) if(H5F_FIRST_ALLOC_DEALLOC(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) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") } /* end if */ else { - if(H5MF_xfree(f, H5FD_MEM_SUPER, dxpl_id, mesg->addr, mesg->size) < 0) + if(H5MF_xfree(f, H5FD_MEM_SUPER, mesg->addr, mesg->size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free file space for cache image block") } /* end else */ } /* end if */ @@ -352,8 +351,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__mdci_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - const void *_mesg, FILE * stream, int indent, int fwidth) +H5O__mdci_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_mdci_t *mdci = (const H5O_mdci_t *) _mesg; diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index dbc894c..205515a 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -77,7 +77,7 @@ H5FL_DEFINE(H5O_chunk_proxy_t); /*------------------------------------------------------------------------- - * Function: H5O_chunk_add + * Function: H5O__chunk_add * * Purpose: Add new chunk for object header to metadata cache * @@ -91,13 +91,13 @@ H5FL_DEFINE(H5O_chunk_proxy_t); *------------------------------------------------------------------------- */ herr_t -H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, - unsigned cont_chunkno) +H5O__chunk_add(H5F_t *f, H5O_t *oh, unsigned idx, unsigned cont_chunkno) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Proxy for chunk, to mark it dirty in the cache */ + H5O_chunk_proxy_t *cont_chk_proxy = NULL; /* Proxy for chunk containing continuation message that points to this chunk, if not chunk 0 */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) /* check args */ HDassert(f); @@ -110,32 +110,43 @@ H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Increment reference count on object header */ - if(H5O_inc_rc(oh) < 0) + if(H5O__inc_rc(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "can't increment reference count on object header") /* Set the values in the chunk proxy */ chk_proxy->f = f; chk_proxy->oh = oh; chk_proxy->chunkno = idx; - chk_proxy->cont_chunkno = cont_chunkno; + + /* Determine the parent of the chunk */ + if(cont_chunkno != 0) { + if(NULL == (cont_chk_proxy = H5O__chunk_protect(f, oh, cont_chunkno))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") + chk_proxy->fd_parent = cont_chk_proxy; + } /* end else */ /* Insert the chunk proxy into the cache */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header chunk") - chk_proxy = NULL; done: + /* Cleanup on failure */ if(ret_value < 0) if(chk_proxy && H5O__chunk_dest(chk_proxy) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to destroy object header chunk") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_chunk_add() */ + /* Release resources */ + if(cont_chk_proxy) + if(H5O__chunk_unprotect(f, cont_chk_proxy, FALSE) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") + + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__chunk_add() */ /*------------------------------------------------------------------------- - * Function: H5O_chunk_protect + * Function: H5O__chunk_protect * * Purpose: Protect an object header chunk for modifications * @@ -149,12 +160,12 @@ done: *------------------------------------------------------------------------- */ H5O_chunk_proxy_t * -H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) +H5O__chunk_protect(H5F_t *f, H5O_t *oh, unsigned idx) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Proxy for protected chunk */ H5O_chunk_proxy_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, NULL) + FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) /* check args */ HDassert(f); @@ -169,7 +180,7 @@ H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed") /* Increment reference count on object header */ - if(H5O_inc_rc(oh) < 0) + if(H5O__inc_rc(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, NULL, "can't increment reference count on object header") /* Set chunk proxy fields */ @@ -188,7 +199,7 @@ H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) chk_udata.size = oh->chunk[idx].size; /* Get the chunk proxy */ - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") /* Sanity check */ @@ -205,12 +216,12 @@ done: if(0 == idx && chk_proxy && H5O__chunk_dest(chk_proxy) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header chunk") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* end H5O_chunk_protect() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__chunk_protect() */ /*------------------------------------------------------------------------- - * Function: H5O_chunk_unprotect + * Function: H5O__chunk_unprotect * * Purpose: Unprotect an object header chunk after modifications * @@ -224,12 +235,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, - hbool_t dirtied) +H5O__chunk_unprotect(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t dirtied) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -245,7 +255,7 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, } /* end else/if */ /* Decrement reference count of object header */ - if(H5O_dec_rc(chk_proxy->oh) < 0) + if(H5O__dec_rc(chk_proxy->oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "can't decrement reference count on object header") /* Free fake chunk proxy */ @@ -253,13 +263,13 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, } /* end if */ else { /* Release the chunk proxy from the cache, possibly marking it dirty */ - if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, chk_proxy->oh->chunk[chk_proxy->chunkno].addr, chk_proxy, (dirtied ? H5AC__DIRTIED_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(f, H5AC_OHDR_CHK, chk_proxy->oh->chunk[chk_proxy->chunkno].addr, chk_proxy, (dirtied ? H5AC__DIRTIED_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_chunk_unprotect() */ +} /* end H5O__chunk_unprotect() */ /*------------------------------------------------------------------------- @@ -305,7 +315,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_chunk_update_idx + * Function: H5O__chunk_update_idx * * Purpose: Update the chunk index for a chunk proxy * @@ -319,13 +329,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) +H5O__chunk_update_idx(H5F_t *f, H5O_t *oh, unsigned idx) { - H5O_chunk_proxy_t *chk_proxy; /* Proxy for chunk, to mark it dirty in the cache */ + H5O_chunk_proxy_t *chk_proxy = NULL;/* Proxy for chunk, to mark it dirty in the cache */ H5O_chk_cache_ud_t chk_udata; /* User data for loading chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -341,23 +351,23 @@ H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) chk_udata.size = oh->chunk[idx].size; /* Get the chunk proxy */ - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Update index for chunk proxy in cache */ chk_proxy->chunkno = idx; /* Release the chunk proxy from the cache, marking it deleted */ - if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_chunk_update_idx() */ +} /* end H5O__chunk_update_idx() */ /*------------------------------------------------------------------------- - * Function: H5O_chunk_delete + * Function: H5O__chunk_delete * * Purpose: Notify metadata cache that a chunk has been deleted * @@ -371,14 +381,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) +H5O__chunk_delete(H5F_t *f, H5O_t *oh, unsigned idx) { - H5O_chunk_proxy_t *chk_proxy; /* Proxy for chunk, to mark it dirty in the cache */ - H5O_chk_cache_ud_t chk_udata; /* User data for loading chunk */ + H5O_chunk_proxy_t *chk_proxy = NULL;/* Proxy for chunk, to mark it dirty in the cache */ unsigned cache_flags = H5AC__DELETED_FLAG; /* Flags for unprotecting proxy */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) /* check args */ HDassert(f); @@ -386,32 +395,21 @@ H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) HDassert(idx < oh->nchunks); HDassert(idx > 0); - /* Construct the user data for protecting chunk proxy */ - /* (and _not_ decoding it) */ - HDmemset(&chk_udata, 0, sizeof(chk_udata)); - chk_udata.oh = oh; - chk_udata.chunkno = idx; - chk_udata.size = oh->chunk[idx].size; - /* Get the chunk proxy */ - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, idx))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") - /* Sanity check */ - HDassert(chk_proxy->oh == oh); - HDassert(chk_proxy->chunkno == idx); - /* Only free file space if not doing SWMR writes */ if(!oh->swmr_write) cache_flags |= H5AC__DIRTIED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; +done: /* Release the chunk proxy from the cache, marking it deleted */ - if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, cache_flags) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") + if(chk_proxy && H5AC_unprotect(f, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, cache_flags) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") -done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_chunk_delete() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__chunk_delete() */ /*------------------------------------------------------------------------- @@ -439,7 +437,7 @@ H5O__chunk_dest(H5O_chunk_proxy_t *chk_proxy) HDassert(chk_proxy); /* Decrement reference count of object header */ - if(chk_proxy->oh && H5O_dec_rc(chk_proxy->oh) < 0) + if(chk_proxy->oh && H5O__dec_rc(chk_proxy->oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "can't decrement reference count on object header") /* Release the chunk proxy object */ diff --git a/src/H5Ocont.c b/src/H5Ocont.c index b002a32..42dfca9 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -36,14 +36,14 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_cont_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_cont_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_cont_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_cont_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_cont_free(void *mesg); -static herr_t H5O_cont_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); -static herr_t H5O_cont_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth); +static herr_t H5O__cont_free(void *mesg); +static herr_t H5O__cont_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); +static herr_t H5O__cont_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_CONT[1] = {{ @@ -56,8 +56,8 @@ const H5O_msg_class_t H5O_MSG_CONT[1] = {{ NULL, /*no copy method */ H5O_cont_size, /*size of header continuation */ NULL, /*reset method */ - H5O_cont_free, /* free method */ - H5O_cont_delete, /* file delete method */ + H5O__cont_free, /* free method */ + H5O__cont_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ @@ -66,7 +66,7 @@ const H5O_msg_class_t H5O_MSG_CONT[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_cont_debug /*debugging */ + H5O__cont_debug /*debugging */ }}; /* Declare the free list for H5O_cont_t's */ @@ -89,7 +89,7 @@ H5FL_DEFINE(H5O_cont_t); *------------------------------------------------------------------------- */ static void * -H5O_cont_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_cont_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_cont_t *cont = NULL; @@ -186,9 +186,9 @@ H5O_cont_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void /*------------------------------------------------------------------------- - * Function: H5O_cont_free + * Function: H5O__cont_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -198,20 +198,20 @@ H5O_cont_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *------------------------------------------------------------------------- */ static herr_t -H5O_cont_free(void *mesg) +H5O__cont_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_cont_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_cont_free() */ +} /* end H5O__cont_free() */ /*------------------------------------------------------------------------- - * Function: H5O_cont_delete + * Function: H5O__cont_delete * * Purpose: Free file space referenced by message * @@ -223,12 +223,12 @@ H5O_cont_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_cont_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O__cont_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_cont_t *mesg = (H5O_cont_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -236,16 +236,16 @@ H5O_cont_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) /* Notify the cache that the chunk has been deleted */ /* (releases the space for the chunk) */ - if(H5O_chunk_delete(f, dxpl_id, open_oh, mesg->chunkno) < 0) + if(H5O__chunk_delete(f, open_oh, mesg->chunkno) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove chunk from cache") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_cont_delete() */ +} /* end H5O__cont_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_cont_debug + * Function: H5O__cont_debug * * Purpose: Prints debugging info. * @@ -260,12 +260,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_cont_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__cont_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_cont_t *cont = (const H5O_cont_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -285,4 +285,4 @@ H5O_cont_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void (int) (cont->chunkno)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_cont_debug() */ +} /* end H5O__cont_debug() */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index aa2a9e0..9681bc1 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -34,6 +34,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Aprivate.h" /* Attributes */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5Iprivate.h" /* IDs */ @@ -66,7 +67,6 @@ typedef struct H5O_copy_search_comm_dt_ud_t { H5SL_t *dst_dt_list; /* Skip list of committed datatypes */ H5G_loc_t *dst_root_loc; /* Starting location for iteration */ H5O_loc_t obj_oloc; /* Object location (for attribute iteration callback) */ - hid_t dxpl_id; /* Dataset transfer property list id */ } H5O_copy_search_comm_dt_ud_t; @@ -79,23 +79,25 @@ typedef struct H5O_copy_search_comm_dt_ud_t { /* Local Prototypes */ /********************/ -static herr_t H5O_copy_free_addrmap_cb(void *item, void *key, void *op_data); -static herr_t H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, - hid_t dxpl_id, H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata); -static herr_t H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, - hid_t dxpl_id, hid_t ocpypl_id); -static herr_t H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, - const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id); -static herr_t H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, - H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, H5O_copy_t *cpy_info); -static herr_t H5O_copy_free_comm_dt_cb(void *item, void *key, void *op_data); -static int H5O_copy_comm_dt_cmp(const void *dt1, const void *dt2); -static herr_t H5O_copy_search_comm_dt_cb(hid_t group, const char *name, +static herr_t H5O__copy(const H5G_loc_t *loc, const char *src_name, + H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); +static herr_t H5O__copy_free_addrmap_cb(void *item, void *key, void *op_data); +static herr_t H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, + H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata); +static herr_t H5O__copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, + hid_t ocpypl_id, hid_t lcpl_id); +static herr_t H5O__copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, + const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); +static herr_t H5O__copy_obj_by_ref(H5O_loc_t *src_oloc, H5O_loc_t *dst_oloc, + H5G_loc_t *dst_root_loc, H5O_copy_t *cpy_info); +static herr_t H5O__copy_free_comm_dt_cb(void *item, void *key, void *op_data); +static int H5O__copy_comm_dt_cmp(const void *dt1, const void *dt2); +static herr_t H5O__copy_search_comm_dt_cb(hid_t group, const char *name, const H5L_info_t *linfo, void *udata); -static htri_t H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, - H5O_loc_t *oloc_dst/*in, out*/, hid_t dxpl_id, H5O_copy_t *cpy_info); -static herr_t H5O_copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, - H5O_loc_t *oloc_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); +static htri_t H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, + H5O_loc_t *oloc_dst/*in, out*/, H5O_copy_t *cpy_info); +static herr_t H5O__copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, + H5O_loc_t *oloc_dst, H5O_copy_t *cpy_info); /*********************/ @@ -202,19 +204,11 @@ H5FL_DEFINE(haddr_t); */ herr_t H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, - const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id) + const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id) { H5G_loc_t loc; /* Source group group location */ - H5G_loc_t src_loc; /* Source object group location */ H5G_loc_t dst_loc; /* Destination group location */ - - /* for opening the destination object */ - H5G_name_t src_path; /* Opened source object hier. path */ - H5O_loc_t src_oloc; /* Opened source object object location */ - htri_t dst_exists; /* Does destination name exist already? */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ - hbool_t obj_open = FALSE; /* Entry at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -231,8 +225,63 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, if(!dst_name || !*dst_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified") - /* check if destination name already exists */ - if((dst_exists = H5L_exists_tolerant(&dst_loc, dst_name, H5P_DEFAULT, dxpl_id)) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(src_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Call internal routine to copy object */ + if(H5O__copy(&loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") + +done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") + FUNC_LEAVE_API(ret_value) +} /* end H5Ocopy() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__copy + * + * Purpose: Internal routine to copy an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 29, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, + const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id) +{ + H5G_loc_t src_loc; /* Source object group location */ + H5G_name_t src_path; /* Opened source object hier. path */ + H5O_loc_t src_oloc; /* Opened source object object location */ + htri_t dst_exists; /* Does destination name exist already? */ + hbool_t loc_found = FALSE; /* Location at 'name' found */ + hbool_t obj_open = FALSE; /* Entry at 'name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(src_name && *src_name); + HDassert(dst_loc); + HDassert(dst_name && *dst_name); + + /* Check if destination name already exists */ + if((dst_exists = H5L_exists_tolerant(dst_loc, dst_name)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check if destination name exists") if(TRUE == dst_exists) HGOTO_ERROR(H5E_OHDR, H5E_EXISTS, FAIL, "destination object already exists") @@ -243,7 +292,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5G_loc_reset(&src_loc); /* Find the source object to copy */ - if(H5G_loc_find(&loc, src_name, &src_loc/*out*/, H5P_DEFAULT, dxpl_id) < 0) + if(H5G_loc_find(loc, src_name, &src_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "source object not found") loc_found = TRUE; @@ -254,7 +303,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, /* Get correct property lists */ if(H5P_DEFAULT == lcpl_id) { - if((lcpl_id = H5L_get_default_lcpl()) < 0) + if((lcpl_id = H5P_get_default(H5P_CLS_LCRT)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to get default lcpl") } /* end if */ else @@ -262,14 +311,16 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link creation property list") /* Get object copy property list */ - if(H5P_DEFAULT == ocpypl_id) - ocpypl_id = H5P_OBJECT_COPY_DEFAULT; + if(H5P_DEFAULT == ocpypl_id) { + if((ocpypl_id = H5P_get_default(H5P_CLS_OCPY)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to get default ocpypl") + } /* end if */ else if(TRUE != H5P_isa_class(ocpypl_id, H5P_OBJECT_COPY)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not object copy property list") /* Do the actual copying of the object */ - if(H5O_copy_obj(&src_loc, &dst_loc, dst_name, ocpypl_id, lcpl_id, dxpl_id) < 0) + if(H5O__copy_obj(&src_loc, dst_loc, dst_name, ocpypl_id, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") done: @@ -278,12 +329,12 @@ done: if(obj_open && H5O_close(&src_oloc, NULL) < 0) HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, FAIL, "unable to release object header") - FUNC_LEAVE_API(ret_value) -} /* end H5Ocopy() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__copy() */ /*------------------------------------------------------------------------- - * Function: H5O_copy_header_real + * Function: H5O__copy_header_real * * Purpose: Copy header object from one location to another using * pre-copy, copy, and post-copy callbacks for each message @@ -300,19 +351,11 @@ done: * Programmer: Peter Cao * May 30, 2005 * - * Modifications: - * Vailin Choi; Feb 2012 - * Bug fix for HDFFV-7853 - * When the object is opened, call the object's flush class action - * to ensure that cached data is flushed so that H5Ocopy will get - * the correct data. - * *------------------------------------------------------------------------- */ static herr_t -H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, - hid_t dxpl_id, H5O_copy_t *cpy_info, H5O_type_t *obj_type, - void **udata /*out*/) +H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, + H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata /*out*/) { H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */ H5O_t *oh_src = NULL; /* Object header for source object */ @@ -335,7 +378,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, size_t msghdr_size; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, oloc_src->addr, FAIL) + FUNC_ENTER_STATIC_TAG(oloc_src->addr) HDassert(oloc_src); HDassert(oloc_src->file); @@ -344,14 +387,14 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, HDassert(cpy_info); /* Get pointer to object class for this object */ - if(NULL == (obj_class = H5O_obj_class(oloc_src, dxpl_id))) + if(NULL == (obj_class = H5O__obj_class(oloc_src))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") /* 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))) + if(NULL == (oh_src = H5O_protect(oloc_src, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve user data for particular type of object to copy */ @@ -376,7 +419,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, else /* Search for a matching committed datatype, building the list if * necessary */ - if((merge = H5O_copy_search_comm_dt(oloc_src->file, oh_src, oloc_dst, dxpl_id, cpy_info)) < 0) + if((merge = H5O__copy_search_comm_dt(oloc_src->file, oh_src, oloc_dst, cpy_info)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't search for matching committed datatype") if(merge) { @@ -488,7 +531,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, if(copy_type->pre_copy_file) { /* Decode the message if necessary. */ - H5O_LOAD_NATIVE(oloc_src->file, dxpl_id, 0, oh_src, mesg_src, FAIL) + H5O_LOAD_NATIVE(oloc_src->file, 0, oh_src, mesg_src, FAIL) /* Perform "pre copy" operation on message */ if((copy_type->pre_copy_file)(oloc_src->file, mesg_src->native, @@ -560,7 +603,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, unsigned mesg_flags; /* Message flags */ /* Decode the message if necessary. */ - H5O_LOAD_NATIVE(oloc_src->file, dxpl_id, 0, oh_src, mesg_src, FAIL) + H5O_LOAD_NATIVE(oloc_src->file, 0, oh_src, mesg_src, FAIL) /* Get destination message flags, and unset shared and shareable * flags. mesg_dst->flags will contain the original flags for now. @@ -570,9 +613,9 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, /* Copy the source message */ recompute_size = FALSE; - if((mesg_dst->native = H5O_msg_copy_file(copy_type, oloc_src->file, + if(NULL == (mesg_dst->native = H5O__msg_copy_file(copy_type, oloc_src->file, mesg_src->native, oloc_dst->file, &recompute_size, - &mesg_flags, cpy_info, cpy_udata, dxpl_id)) == NULL) + &mesg_flags, cpy_info, cpy_udata))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object header message") /* Check if the sharing state changed, and recompute the size if so @@ -653,7 +696,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, dst_oh_size += (uint64_t)H5O_SIZEOF_HDR(oh_dst); /* Allocate space for chunk in destination file */ - if(HADDR_UNDEF == (oh_dst->chunk[0].addr = H5MF_alloc(oloc_dst->file, H5FD_MEM_OHDR, dxpl_id, (hsize_t)dst_oh_size))) + if(HADDR_UNDEF == (oh_dst->chunk[0].addr = H5MF_alloc(oloc_dst->file, H5FD_MEM_OHDR, (hsize_t)dst_oh_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for object header") addr_new = oh_dst->chunk[0].addr; @@ -756,7 +799,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, * the copied datatype into the list of committed datatypes in the target file. */ if(cpy_info->merge_comm_dt && obj_class->type == H5O_TYPE_NAMED_DATATYPE) - if(H5O_copy_insert_comm_dt(oloc_src->file, oh_src, oloc_dst, dxpl_id, cpy_info) < 0) + if(H5O__copy_insert_comm_dt(oloc_src->file, oh_src, oloc_dst, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't insert committed datatype into destination list") /* Allocate space for the address mapping of the object copied */ @@ -821,7 +864,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, /* Perform "post copy" operation on message */ if((copy_type->post_copy_file)(oloc_src, mesg_src->native, oloc_dst, - mesg_dst->native, &mesg_flags, dxpl_id, cpy_info) < 0) + mesg_dst->native, &mesg_flags, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to perform 'post copy' operation on message") /* Verify that the flags did not change */ @@ -843,16 +886,16 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to re-tag metadata entries") /* Set metadata tag for destination object's object header */ - H5_BEGIN_TAG(dxpl_id, oloc_dst->addr, FAIL); + H5_BEGIN_TAG(oloc_dst->addr); /* Insert destination object header in cache */ - if(H5AC_insert_entry(oloc_dst->file, dxpl_id, H5AC_OHDR, oloc_dst->addr, oh_dst, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(oloc_dst->file, H5AC_OHDR, oloc_dst->addr, oh_dst, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header") oh_dst = NULL; inserted = TRUE; /* Reset metadat tag */ - H5_END_TAG(FAIL); + H5_END_TAG /* Set obj_type and udata, if requested */ if(obj_type) { @@ -867,7 +910,7 @@ done: H5MM_free(deleted); /* Release pointer to source object header and its derived objects */ - if(oh_src && H5O_unprotect(oloc_src, dxpl_id, oh_src, H5AC__NO_FLAGS_SET) < 0) + if(oh_src && H5O_unprotect(oloc_src, oh_src, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") /* Free destination object header on failure */ @@ -878,8 +921,8 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_copy_header_real() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__copy_header_real() */ /*------------------------------------------------------------------------- @@ -897,8 +940,8 @@ done: */ herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, - hid_t dxpl_id, H5O_copy_t *cpy_info, hbool_t inc_depth, - H5O_type_t *obj_type, void **udata /*out*/) + H5O_copy_t *cpy_info, hbool_t inc_depth, H5O_type_t *obj_type, + void **udata /*out*/) { H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */ H5_obj_t src_obj_pos; /* Position of source object */ @@ -932,8 +975,7 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, cpy_info->curr_depth++; /* Copy object referred to */ - if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, cpy_info, obj_type, - udata) < 0) + if(H5O__copy_header_real(oloc_src, oloc_dst, cpy_info, obj_type, udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Check for incrementing the depth of copy */ @@ -972,7 +1014,7 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, /* Increment destination object's link count, if allowed */ if(inc_link) - if(H5O_link(oloc_dst, 1, dxpl_id) < 0) + if(H5O_link(oloc_dst, 1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to increment object link count") done: @@ -982,11 +1024,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5O_copy_free_addrmap_cb + H5O__copy_free_addrmap_cb PURPOSE Internal routine to free address maps from the skip list for copying objects USAGE - herr_t H5O_copy_free_addrmap_cb(item, key, op_data) + herr_t H5O__copy_free_addrmap_cb(item, key, op_data) void *item; IN/OUT: Pointer to addr void *key; IN/OUT: (unused) void *op_data; IN: (unused) @@ -1000,11 +1042,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5O_copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) +H5O__copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) { H5O_addr_map_t *item = (H5O_addr_map_t *)_item; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(item); @@ -1019,11 +1061,11 @@ H5O_copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNU item = H5FL_FREE(H5O_addr_map_t, item); FUNC_LEAVE_NOAPI(0) -} /* H5O_copy_free_addrmap_cb() */ +} /* H5O__copy_free_addrmap_cb() */ /*------------------------------------------------------------------------- - * Function: H5O_copy_header + * Function: H5O__copy_header * * Purpose: copy header object from one location to another. * @@ -1035,8 +1077,8 @@ H5O_copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNU *------------------------------------------------------------------------- */ static herr_t -H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - hid_t dxpl_id, hid_t ocpypl_id) +H5O__copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, + hid_t ocpypl_id, hid_t lcpl_id) { H5O_copy_t cpy_info; /* Information for copying object */ H5P_genplist_t *ocpy_plist; /* Object copy property list created */ @@ -1045,7 +1087,7 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, unsigned cpy_option = 0; /* Copy options */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(oloc_src); @@ -1100,26 +1142,29 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, cpy_info.mcdt_cb = cb_info.func; cpy_info.mcdt_ud = cb_info.user_data; + /* Add property lists needed by callbacks */ + cpy_info.lcpl_id = lcpl_id; + /* Create a skip list to keep track of which objects are copied */ if(NULL == (cpy_info.map_list = H5SL_create(H5SL_TYPE_OBJ, NULL))) HGOTO_ERROR(H5E_SLIST, H5E_CANTCREATE, FAIL, "cannot make skip list") /* copy the object from the source file to the destination file */ - if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, &cpy_info, NULL, NULL) < 0) + if(H5O__copy_header_real(oloc_src, oloc_dst, &cpy_info, NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") done: if(cpy_info.map_list) - H5SL_destroy(cpy_info.map_list, H5O_copy_free_addrmap_cb, NULL); + H5SL_destroy(cpy_info.map_list, H5O__copy_free_addrmap_cb, NULL); if(cpy_info.dst_dt_list) - H5SL_destroy(cpy_info.dst_dt_list, H5O_copy_free_comm_dt_cb, NULL); + H5SL_destroy(cpy_info.dst_dt_list, H5O__copy_free_comm_dt_cb, NULL); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_header() */ +} /* end H5O__copy_header() */ /*------------------------------------------------------------------------- - * Function: H5O_copy_obj + * Function: H5O__copy_obj * * Purpose: Copy an object to destination location * @@ -1131,8 +1176,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, - hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id) +H5O__copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, + hid_t ocpypl_id, hid_t lcpl_id) { H5G_name_t new_path; /* Copied object group hier. path */ H5O_loc_t new_oloc; /* Copied object object location */ @@ -1141,7 +1186,7 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, hbool_t entry_inserted = FALSE; /* Flag to indicate that the new entry was inserted into a group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(src_loc); HDassert(src_loc->oloc->file); @@ -1156,12 +1201,12 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, new_oloc.file = dst_loc->oloc->file; /* Make a copy of the destination file, in case the original is changed by - * H5O_copy_header. If and when oloc's point to the shared file struct, + * H5O__copy_header. If and when oloc's point to the shared file struct, * this will no longer be necessary, so this code can be removed. */ cached_dst_file = dst_loc->oloc->file; /* Copy the object from the source file to the destination file */ - if(H5O_copy_header(src_loc->oloc, &new_oloc, dxpl_id, ocpypl_id) < 0) + if(H5O__copy_header(src_loc->oloc, &new_oloc, ocpypl_id, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Patch dst_loc. Again, this can be removed once oloc's point to shared @@ -1169,7 +1214,7 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, dst_loc->oloc->file = cached_dst_file; /* Insert the new object in the destination file's group */ - if(H5L_link(dst_loc, dst_name, &new_loc, lcpl_id, H5P_DEFAULT, dxpl_id) < 0) + if(H5L_link(dst_loc, dst_name, &new_loc, lcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to insert link") entry_inserted = TRUE; @@ -1179,11 +1224,11 @@ done: H5G_loc_free(&new_loc); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_obj() */ +} /* end H5O__copy_obj() */ /*------------------------------------------------------------------------- - * Function: H5O_copy_obj_by_ref + * Function: H5O__copy_obj_by_ref * * Purpose: Copy the object pointed by _src_ref. * @@ -1195,19 +1240,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, +H5O__copy_obj_by_ref(H5O_loc_t *src_oloc, H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, H5O_copy_t *cpy_info) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(src_oloc); HDassert(dst_oloc); /* Perform the copy, or look up existing copy */ - if((ret_value = H5O_copy_header_map(src_oloc, dst_oloc, dxpl_id, cpy_info, - FALSE, NULL, NULL)) < 0) + if((ret_value = H5O_copy_header_map(src_oloc, dst_oloc, cpy_info, FALSE, NULL, NULL)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Check if a new valid object is copied to the destination */ @@ -1233,7 +1277,7 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, * pass the obj_type and udata fields returned by H5O_copy_header_map. * This could be changed in the future to slightly improve performance * --NAF */ - if(H5L_link(dst_root_loc, tmp_obj_name, &new_loc, H5P_DEFAULT, H5P_DEFAULT, dxpl_id) < 0) + if(H5L_link(dst_root_loc, tmp_obj_name, &new_loc, cpy_info->lcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to insert link") H5G_loc_free(&new_loc); @@ -1241,7 +1285,7 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_obj_by_ref() */ +} /* end H5O__copy_obj_by_ref() */ /*------------------------------------------------------------------------- @@ -1257,9 +1301,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, - H5F_t *file_dst, void *_dst_ref, size_t ref_count, H5R_type_t ref_type, - H5O_copy_t *cpy_info) +H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, H5F_t *file_dst, + void *_dst_ref, size_t ref_count, H5R_type_t ref_type, H5O_copy_t *cpy_info) { H5O_loc_t dst_oloc; /* Copied object object location */ H5O_loc_t src_oloc; /* Temporary object location for source object */ @@ -1305,7 +1348,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, /* Attempt to copy object from source to destination file */ if(src_oloc.addr != (haddr_t)0) { - if(H5O_copy_obj_by_ref(&src_oloc, dxpl_id, &dst_oloc, &dst_root_loc, cpy_info) < 0) + if(H5O__copy_obj_by_ref(&src_oloc, &dst_oloc, &dst_root_loc, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") } /* end if */ else @@ -1334,7 +1377,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, if(hobjid.addr != (haddr_t)0) { /* Get the dataset region from the heap (allocate inside routine) */ - if((buf = (uint8_t *)H5HG_read(src_oloc.file, dxpl_id, &hobjid, NULL, &buf_size)) == NULL) + if((buf = (uint8_t *)H5HG_read(src_oloc.file, &hobjid, NULL, &buf_size)) == NULL) HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") /* Get the object oid for the dataset */ @@ -1343,7 +1386,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, dst_oloc.addr = HADDR_UNDEF; /* copy the object pointed by the ref to the destination */ - if(H5O_copy_obj_by_ref(&src_oloc, dxpl_id, &dst_oloc, &dst_root_loc, cpy_info) < 0) { + if(H5O__copy_obj_by_ref(&src_oloc, &dst_oloc, &dst_root_loc, cpy_info) < 0) { H5MM_xfree(buf); HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") } /* end if */ @@ -1353,7 +1396,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, H5F_addr_encode(dst_oloc.file, &p, dst_oloc.addr); /* Save the serialized buffer to the destination */ - if(H5HG_insert(dst_oloc.file, dxpl_id, buf_size, buf, &hobjid) < 0) { + if(H5HG_insert(dst_oloc.file, buf_size, buf, &hobjid) < 0) { H5MM_xfree(buf); HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "Unable to write dataset region information") } /* end if */ @@ -1380,7 +1423,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_copy_free_comm_dt_cb + * Function: H5O__copy_free_comm_dt_cb * * Purpose: Frees the merge committed dt skip list key and object. * @@ -1392,12 +1435,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *op_data) +H5O__copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *_op_data) { haddr_t *addr = (haddr_t *)item; H5O_copy_search_comm_dt_key_t *key = (H5O_copy_search_comm_dt_key_t *)_key; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(addr); HDassert(key); @@ -1408,11 +1451,11 @@ H5O_copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *op_data) addr = H5FL_FREE(haddr_t, addr); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_copy_free_comm_dt_cb */ +} /* end H5O__copy_free_comm_dt_cb */ /*------------------------------------------------------------------------- - * Function: H5O_copy_comm_dt_cmp + * Function: H5O__copy_comm_dt_cmp * * Purpose: Skiplist callback used to compare 2 keys for the merge * committed dt list. Mostly a wrapper for H5T_cmp. @@ -1427,13 +1470,13 @@ H5O_copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *op_data) *------------------------------------------------------------------------- */ static int -H5O_copy_comm_dt_cmp(const void *_key1, const void *_key2) +H5O__copy_comm_dt_cmp(const void *_key1, const void *_key2) { const H5O_copy_search_comm_dt_key_t *key1 = (const H5O_copy_search_comm_dt_key_t *)_key1; const H5O_copy_search_comm_dt_key_t *key2 = (const H5O_copy_search_comm_dt_key_t *)_key2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check fileno. It is unlikely to be different so check if they are equal * first so only one comparison needs to be made. */ @@ -1448,7 +1491,7 @@ H5O_copy_comm_dt_cmp(const void *_key1, const void *_key2) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_comm_dt_cmp */ +} /* end H5O__copy_comm_dt_cmp */ /*------------------------------------------------------------------------- @@ -1546,10 +1589,6 @@ done: * Programmer: Neil Fortner * Nov 3 2011 * - * Modifications: - * Vailin Choi; August 2012 - * Use H5O_obj_class to get object type instead of - * H5O_get_info(...TRUE....) saving time in traversing metadata. *------------------------------------------------------------------------- */ static herr_t @@ -1572,7 +1611,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, HDassert(udata->dst_root_loc); /* Get pointer to object class for this object */ - if((obj_class = H5O_obj_class(obj_oloc, udata->dxpl_id)) == NULL) + if((obj_class = H5O__obj_class(obj_oloc)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") /* Check if the object is a datatype, a dataset using a committed @@ -1583,7 +1622,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Read the destination datatype */ - if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL, udata->dxpl_id))) + if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") /* Get destination object fileno */ @@ -1608,7 +1647,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Read the destination datatype */ - if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL, udata->dxpl_id))) + if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") /* Check if the datatype is committed and search the skip list if so @@ -1636,8 +1675,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, attr_op.u.lib_op = H5O_copy_search_comm_dt_attr_cb; udata->obj_oloc.file = obj_oloc->file; udata->obj_oloc.addr = obj_oloc->addr; - if(H5O_attr_iterate_real((hid_t)-1, obj_oloc, udata->dxpl_id, H5_INDEX_NAME, - H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, udata) < 0) + if(H5O_attr_iterate_real((hid_t)-1, obj_oloc, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "error iterating over attributes"); done: @@ -1659,7 +1697,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_copy_search_comm_dt_cb + * Function: H5O__copy_search_comm_dt_cb * * Purpose: H5G_visit callback to add committed datatypes to the merge * committed dt skiplist. Mostly a wrapper for @@ -1673,7 +1711,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, +H5O__copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *linfo, void *_udata) { H5O_copy_search_comm_dt_ud_t *udata = (H5O_copy_search_comm_dt_ud_t *)_udata; /* Skip list of dtypes in dest file */ @@ -1683,7 +1721,7 @@ H5O_copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, hbool_t obj_found = FALSE; /* Object at 'name' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(name); @@ -1700,7 +1738,7 @@ H5O_copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, H5G_loc_reset(&obj_loc); /* Find the object */ - if(H5G_loc_find(udata->dst_root_loc, name, &obj_loc/*out*/, H5P_LINK_ACCESS_DEFAULT, udata->dxpl_id) < 0) + if(H5G_loc_find(udata->dst_root_loc, name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") obj_found = TRUE; @@ -1715,11 +1753,11 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_search_comm_dt_cb */ +} /* end H5O__copy_search_comm_dt_cb */ /*------------------------------------------------------------------------- - * Function: H5O_copy_search_comm_dt + * Function: H5O__copy_search_comm_dt * * Purpose: Checks if the committed datatype present in oh_src matches any * in the destination file, building the destination file @@ -1736,8 +1774,8 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, - H5O_loc_t *oloc_dst/*in, out*/, hid_t dxpl_id, H5O_copy_t *cpy_info) +H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, + H5O_loc_t *oloc_dst/*in, out*/, H5O_copy_t *cpy_info) { H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ haddr_t *dst_addr; /* Destination datatype address */ @@ -1745,7 +1783,7 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_copy_search_comm_dt_ud_t udata; /* Group iteration user data */ herr_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(oh_src); @@ -1759,7 +1797,7 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Read the source datatype */ - if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, dxpl_id, oh_src, H5O_DTYPE_ID, NULL))) + if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, oh_src, H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") /* Get destination object fileno */ @@ -1768,7 +1806,7 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, /* Check if the destination dtype list exists, create it if it does not */ if(!cpy_info->dst_dt_list) { /* Create the skip list */ - if(NULL == (cpy_info->dst_dt_list = H5SL_create(H5SL_TYPE_GENERIC, H5O_copy_comm_dt_cmp))) + if(NULL == (cpy_info->dst_dt_list = H5SL_create(H5SL_TYPE_GENERIC, H5O__copy_comm_dt_cmp))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create skip list for committed datatypes") /* Add suggested types to list, if they are present */ @@ -1794,12 +1832,11 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, udata.dst_root_loc = &dst_root_loc; udata.obj_oloc.file = NULL; udata.obj_oloc.addr = HADDR_UNDEF; - udata.dxpl_id = dxpl_id; /* Walk through the list of datatype suggestions */ while(suggestion) { /* Find the object */ - if(H5G_loc_find(&dst_root_loc, suggestion->path, &obj_loc/*out*/, H5P_LINK_ACCESS_DEFAULT, dxpl_id) < 0) + if(H5G_loc_find(&dst_root_loc, suggestion->path, &obj_loc/*out*/) < 0) /* Ignore errors - i.e. suggestions not present in * destination file */ H5E_clear_stack(NULL); @@ -1859,11 +1896,10 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, udata.dst_root_loc = &dst_root_loc; udata.obj_oloc.file = NULL; udata.obj_oloc.addr = HADDR_UNDEF; - udata.dxpl_id = dxpl_id; /* Traverse the destination file, adding committed datatypes to the skip * list */ - if(H5G_visit(H5F_FILE_ID(oloc_dst->file), "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5O_copy_search_comm_dt_cb, &udata, H5P_LINK_ACCESS_DEFAULT, dxpl_id) < 0) + if(H5G_visit(H5F_FILE_ID(oloc_dst->file), "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5O__copy_search_comm_dt_cb, &udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") cpy_info->dst_dt_list_complete = TRUE; } /* end if */ @@ -1890,11 +1926,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_search_comm_dt */ +} /* end H5O__copy_search_comm_dt */ /*------------------------------------------------------------------------- - * Function: H5O_copy_insert_comm_dt + * Function: H5O__copy_insert_comm_dt * * Purpose: Insert the committed datatype at oloc_dst into the merge committed * dt skiplist. The datatype must not be present already. @@ -1907,14 +1943,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst, - hid_t dxpl_id, H5O_copy_t *cpy_info) +H5O__copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst, + H5O_copy_t *cpy_info) { H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ haddr_t *addr = NULL; /* Destination object address */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(oh_src); @@ -1930,7 +1966,7 @@ H5O_copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst, /* Read the datatype. Read from the source file because the destination * object could be changed in the post-copy. */ - if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, dxpl_id, oh_src, H5O_DTYPE_ID, NULL))) + if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, oh_src, H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") /* Get destination object fileno */ @@ -1957,5 +1993,5 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_insert_comm_dt */ +} /* end H5O__copy_insert_comm_dt */ diff --git a/src/H5Odbg.c b/src/H5Odbg.c index 483c5fd..1fc95dd 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -239,12 +239,10 @@ H5O_assert(const H5O_t *oh) * koziol@ncsa.uiuc.edu * Feb 13 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t -H5O_debug_id(unsigned type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, int indent, int fwidth) +H5O_debug_id(unsigned type_id, H5F_t *f, const void *mesg, FILE *stream, int indent, int fwidth) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = FAIL; /* Return value */ @@ -263,7 +261,7 @@ H5O_debug_id(unsigned type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE * HDassert(fwidth >= 0); /* Call the debug method in the class */ - if((ret_value = (type->debug)(f, dxpl_id, mesg, stream, indent, fwidth)) < 0) + if((ret_value = (type->debug)(f, mesg, stream, indent, fwidth)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "unable to debug message") done: @@ -289,7 +287,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int fwidth) +H5O_debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int fwidth) { size_t mesg_total = 0, chunk_total = 0, gap_total = 0; unsigned *sequence = NULL; @@ -519,13 +517,13 @@ H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, i /* decode the message */ debug_type = oh->mesg[i].type; if(NULL == oh->mesg[i].native && debug_type->decode) - H5O_LOAD_NATIVE(f, dxpl_id, H5O_DECODEIO_NOCHANGE, oh, &oh->mesg[i], FAIL) + H5O_LOAD_NATIVE(f, H5O_DECODEIO_NOCHANGE, oh, &oh->mesg[i], FAIL) /* print the message */ HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), "Message Information:"); if(debug_type->debug && oh->mesg[i].native != NULL) - (debug_type->debug)(f, dxpl_id, oh->mesg[i].native, stream, indent + 6, MAX(0, fwidth - 6)); + (debug_type->debug)(f, oh->mesg[i].native, stream, indent + 6, MAX(0, fwidth - 6)); else HDfprintf(stream, "%*s\n", indent + 6, ""); } /* end for */ @@ -556,7 +554,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth) +H5O_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) { H5O_t *oh = NULL; /* Object header to display */ H5O_loc_t loc; /* Object location for object to delete */ @@ -576,14 +574,14 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f loc.addr = addr; loc.holding_file = FALSE; - if(NULL == (oh = H5O_protect(&loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(&loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* debug */ - H5O_debug_real(f, dxpl_id, oh, addr, stream, indent, fwidth); + H5O_debug_real(f, oh, addr, stream, indent, fwidth); done: - if(oh && H5O_unprotect(&loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(&loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index b9dea26..adb4837 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -27,14 +27,14 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_drvinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_drvinfo_copy(const void *_mesg, void *_dest); static size_t H5O_drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_drvinfo_reset(void *_mesg); -static herr_t H5O_drvinfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); +static herr_t H5O__drvinfo_reset(void *_mesg); +static herr_t H5O__drvinfo_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ @@ -46,7 +46,7 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ H5O_drvinfo_encode, /*encode message */ H5O_drvinfo_copy, /*copy the native value */ H5O_drvinfo_size, /*raw message size */ - H5O_drvinfo_reset, /*free internal memory */ + H5O__drvinfo_reset, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ NULL, /* link method */ @@ -57,7 +57,7 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_drvinfo_debug /*debug the message */ + H5O__drvinfo_debug /*debug the message */ }}; /* Current version of driver info information */ @@ -79,7 +79,7 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_drvinfo_t *mesg; /* Native message */ @@ -245,7 +245,7 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_reset + * Function: H5O__drvinfo_reset * * Purpose: Frees internal pointers and resets the message to an * initial state. @@ -259,11 +259,11 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s *------------------------------------------------------------------------- */ static herr_t -H5O_drvinfo_reset(void *_mesg) +H5O__drvinfo_reset(void *_mesg) { H5O_drvinfo_t *mesg = (H5O_drvinfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(mesg); @@ -272,11 +272,11 @@ H5O_drvinfo_reset(void *_mesg) mesg->buf = (uint8_t *)H5MM_xfree(mesg->buf); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_drvinfo_reset() */ +} /* end H5O__drvinfo_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_debug + * Function: H5O__drvinfo_debug * * Purpose: Prints debugging info for the message. * @@ -288,12 +288,12 @@ H5O_drvinfo_reset(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O__drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -308,6 +308,6 @@ H5O_drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const v "Buffer size:", mesg->len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_drvinfo_debug() */ +} /* end H5O__drvinfo_debug() */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index a1c24b6..013a70b 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -29,25 +29,24 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_dtype_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_dtype_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static void *H5O_dtype_copy(const void *_mesg, void *_dest); static size_t H5O_dtype_size(const H5F_t *f, const void *_mesg); -static herr_t H5O_dtype_reset(void *_mesg); +static herr_t H5O__dtype_reset(void *_mesg); static herr_t H5O__dtype_free(void *_mesg); static herr_t H5O_dtype_set_share(void *_mesg, const H5O_shared_t *sh); static htri_t H5O_dtype_can_share(const void *_mesg); static herr_t H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); -static void *H5O_dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, +static void *H5O__dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_dtype_shared_post_copy_upd(const H5O_loc_t *src_oloc, - const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__dtype_shared_post_copy_upd(const H5O_loc_t *src_oloc, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); - -static herr_t H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__dtype_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_DTYPE @@ -57,17 +56,17 @@ static herr_t H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, #define H5O_SHARED_ENCODE_REAL H5O_dtype_encode #define H5O_SHARED_SIZE H5O_dtype_shared_size #define H5O_SHARED_SIZE_REAL H5O_dtype_size -#define H5O_SHARED_DELETE H5O_dtype_shared_delete +#define H5O_SHARED_DELETE H5O__dtype_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O_dtype_shared_link +#define H5O_SHARED_LINK H5O__dtype_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O_dtype_shared_copy_file -#define H5O_SHARED_COPY_FILE_REAL H5O_dtype_copy_file +#define H5O_SHARED_COPY_FILE H5O__dtype_shared_copy_file +#define H5O_SHARED_COPY_FILE_REAL H5O__dtype_copy_file #define H5O_SHARED_POST_COPY_FILE H5O_dtype_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL -#define H5O_SHARED_POST_COPY_FILE_UPD H5O_dtype_shared_post_copy_upd +#define H5O_SHARED_POST_COPY_FILE_UPD H5O__dtype_shared_post_copy_upd #define H5O_SHARED_DEBUG H5O_dtype_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O_dtype_debug +#define H5O_SHARED_DEBUG_REAL H5O__dtype_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* Macros to check for the proper version of a datatype */ @@ -99,14 +98,14 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{ H5O_dtype_shared_encode, /* encode message */ H5O_dtype_copy, /* copy the native value */ H5O_dtype_shared_size, /* size of raw message */ - H5O_dtype_reset, /* reset method */ + H5O__dtype_reset, /* reset method */ H5O__dtype_free, /* free method */ - H5O_dtype_shared_delete, /* file delete method */ - H5O_dtype_shared_link, /* link method */ + H5O__dtype_shared_delete, /* file delete method */ + H5O__dtype_shared_link, /* link method */ H5O_dtype_set_share, /* set share method */ H5O_dtype_can_share, /* can share method */ H5O_dtype_pre_copy_file, /* pre copy native value to file */ - H5O_dtype_shared_copy_file, /* copy native value to file */ + H5O__dtype_shared_copy_file, /* copy native value to file */ H5O_dtype_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ @@ -360,7 +359,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p } /* end if */ /* Close the base type for the array */ - H5T_close(temp_type); + (void)H5T_close_real(temp_type); /* Make the array type the type that is set for the field */ temp_type = array_dt; @@ -1080,9 +1079,8 @@ done: Decode a message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_dtype_decode(f, dxpl_id, mesg_flags, p) + void *H5O_dtype_decode(f, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct - hid_t dxpl_id; IN: DXPL for any I/O unsigned mesg_flags; IN: Message flags to influence decoding const uint8 *p; IN: the raw information buffer RETURNS @@ -1093,8 +1091,8 @@ done: function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_dtype_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 *ioflags/*in,out*/, const uint8_t *p) +H5O_dtype_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, + unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags/*in,out*/, const uint8_t *p) { H5T_t *dt = NULL; void *ret_value = NULL; /* Return value */ @@ -1344,7 +1342,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) /*------------------------------------------------------------------------- - * Function: H5O_dtype_reset + * Function: H5O__dtype_reset * * Purpose: Frees resources within a message, but doesn't free * the message itself. @@ -1354,22 +1352,20 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) * Programmer: Robb Matzke * Tuesday, December 9, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_reset(void *_mesg) +H5O__dtype_reset(void *_mesg) { H5T_t *dt = (H5T_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(dt) H5T__free(dt); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_dtype_reset() */ +} /* end H5O__dtype_reset() */ /*------------------------------------------------------------------------- @@ -1395,7 +1391,7 @@ H5O__dtype_free(void *mesg) HDassert(mesg); /* Release the datatype */ - if(H5T_close((H5T_t *)mesg) < 0) + if(H5T_close_real((H5T_t *)mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free datatype") done: @@ -1552,7 +1548,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_dtype_copy_file + * Function: H5O__dtype_copy_file * * Purpose: Copy a native datatype message from one file to another. * @@ -1565,14 +1561,14 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg_type, +H5O__dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg_type, void *native_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, - H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata, hid_t H5_ATTR_UNUSED dxpl_id) + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { H5T_t *dst_mesg; /* Destination datatype */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Perform a normal copy of the object header message */ if(NULL == (dst_mesg = (H5T_t *)H5O_dtype_copy(native_src, NULL))) @@ -1587,12 +1583,13 @@ H5O_dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg_ done: if(NULL == ret_value) H5O_msg_free(mesg_type->id, dst_mesg); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_copy_file() */ +} /* end H5O__dtype_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_shared_post_copy_upd + * Function: H5O__dtype_shared_post_copy_upd * * Purpose: Update a message after the shared message operations * during the post-copy loop @@ -1605,14 +1602,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc, +H5O__dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc, const void H5_ATTR_UNUSED *mesg_src, H5O_loc_t H5_ATTR_UNUSED *dst_oloc, void *mesg_dst, - hid_t H5_ATTR_UNUSED dxpl_id, H5O_copy_t H5_ATTR_UNUSED *cpy_info) + H5O_copy_t H5_ATTR_UNUSED *cpy_info) { H5T_t *dt_dst = (H5T_t *)mesg_dst; /* Destination datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(dt_dst->sh_loc.type == H5O_SHARE_TYPE_COMMITTED) { HDassert(H5T_committed(dt_dst)); @@ -1626,16 +1623,16 @@ H5O_dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_shared_post_copy_upd */ +} /* end H5O__dtype_shared_post_copy_upd */ /*-------------------------------------------------------------------------- NAME - H5O_dtype_debug + H5O__dtype_debug PURPOSE Prints debugging information for a message USAGE - void *H5O_dtype_debug(f, mesg, stream, indent, fwidth) + void *H5O__dtype_debug(f, mesg, stream, indent, fwidth) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source simple datatype struct @@ -1649,8 +1646,8 @@ done: parameter. --------------------------------------------------------------------------*/ static herr_t -H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, - int indent, int fwidth) +H5O__dtype_debug(H5F_t *f, const void *mesg, FILE *stream, int indent, + int fwidth) { const H5T_t *dt = (const H5T_t*)mesg; const char *s; @@ -1658,7 +1655,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, unsigned i; size_t k; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -1742,13 +1739,13 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0, fwidth-3), "Byte offset:", (unsigned long)(dt->shared->u.compnd.memb[i].offset)); - H5O_dtype_debug(f, dxpl_id, dt->shared->u.compnd.memb[i].type, stream, + H5O__dtype_debug(f, dt->shared->u.compnd.memb[i].type, stream, indent + 3, MAX(0, fwidth - 3)); } /* end for */ } /* end if */ else if(H5T_ENUM == dt->shared->type) { HDfprintf(stream, "%*s%s\n", indent, "", "Base type:"); - H5O_dtype_debug(f, dxpl_id, dt->shared->parent, stream, indent+3, MAX(0, fwidth-3)); + H5O__dtype_debug(f, dt->shared->parent, stream, indent+3, MAX(0, fwidth-3)); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of members:", dt->shared->u.enumer.nmembs); @@ -1978,7 +1975,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, HDfprintf(stream, "%s%u", (i ? ", " : ""), (unsigned)dt->shared->u.array.dim[i]); HDfprintf(stream, "}\n"); HDfprintf(stream, "%*s%s\n", indent, "", "Base type:"); - H5O_dtype_debug(f, dxpl_id, dt->shared->parent, stream, indent + 3, MAX(0, fwidth - 3)); + H5O__dtype_debug(f, dt->shared->parent, stream, indent + 3, MAX(0, fwidth - 3)); } /* end else if */ else { switch (dt->shared->u.atomic.order) { @@ -2162,5 +2159,5 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_dtype_debug() */ +} /* end H5O__dtype_debug() */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index ba7a6ee..5220762 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -27,17 +27,17 @@ #include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_efl_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_efl_copy(const void *_mesg, void *_dest); static size_t H5O_efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_efl_reset(void *_mesg); -static void *H5O_efl_copy_file(H5F_t *file_src, void *mesg_src, +static herr_t H5O__efl_reset(void *_mesg); +static void *H5O__efl_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_efl_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth); + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__efl_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ @@ -49,18 +49,18 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ H5O_efl_encode, /*encode message */ H5O_efl_copy, /*copy native value */ H5O_efl_size, /*size of message on disk */ - H5O_efl_reset, /*reset method */ - NULL, /* free method */ + H5O__efl_reset, /*reset method */ + NULL, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ - H5O_efl_copy_file, /* copy native value to file */ + H5O__efl_copy_file, /* copy native value to file */ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_efl_debug /*debug the message */ + H5O__efl_debug /*debug the message */ }}; #define H5O_EFL_VERSION 1 @@ -87,7 +87,7 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_efl_decode(H5F_t *f, 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; @@ -126,7 +126,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, #ifndef NDEBUG HDassert(H5F_addr_defined(mesg->heap_addr)); - if(NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(f, mesg->heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") s = (const char *)H5HL_offset_into(heap, 0); @@ -143,7 +143,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, if(NULL == mesg->slot) 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))) + if(NULL == (heap = H5HL_protect(f, 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 */ @@ -347,7 +347,7 @@ H5O_efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void * /*------------------------------------------------------------------------- - * Function: H5O_efl_reset + * Function: H5O__efl_reset * * Purpose: Frees internal pointers and resets the message to an * initialial state. @@ -360,12 +360,12 @@ H5O_efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void * *------------------------------------------------------------------------- */ static herr_t -H5O_efl_reset(void *_mesg) +H5O__efl_reset(void *_mesg) { H5O_efl_t *mesg = (H5O_efl_t *) _mesg; size_t u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(mesg); @@ -382,7 +382,7 @@ H5O_efl_reset(void *_mesg) mesg->nused = mesg->nalloc = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_efl_reset() */ +} /* end H5O__efl_reset() */ /*------------------------------------------------------------------------- @@ -425,7 +425,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_efl_copy_file + * Function: H5O__efl_copy_file * * Purpose: Copies an efl message from _MESG to _DEST in file * @@ -439,9 +439,9 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_dst, +H5O__efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *_udata, hid_t dxpl_id) + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *_udata) { H5O_efl_t *efl_src = (H5O_efl_t *) mesg_src; H5O_efl_t *efl_dst = NULL; @@ -449,7 +449,7 @@ H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_ds size_t idx, size, name_offset, heap_size; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__COPIED_TAG, NULL) + FUNC_ENTER_STATIC_TAG(H5AC__COPIED_TAG) /* check args */ HDassert(efl_src); @@ -468,15 +468,15 @@ H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_ds heap_size += H5HL_ALIGN(HDstrlen(efl_src->slot[idx].name) + 1); /* Create name heap */ - if(H5HL_create(file_dst, dxpl_id, heap_size, &efl_dst->heap_addr/*out*/) < 0) + if(H5HL_create(file_dst, heap_size, &efl_dst->heap_addr/*out*/) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTINIT, NULL, "can't create heap") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(file_dst, dxpl_id, efl_dst->heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(file_dst, efl_dst->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_EFL, H5E_PROTECT, NULL, "unable to protect EFL file name heap") /* Insert "empty" name first */ - if(UFAIL == (name_offset = H5HL_insert(file_dst, dxpl_id, heap, (size_t)1, ""))) + if(UFAIL == (name_offset = H5HL_insert(file_dst, heap, (size_t)1, ""))) HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap") HDassert(0 == name_offset); @@ -493,7 +493,7 @@ H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_ds /* copy the name from the source */ for(idx = 0; idx < efl_src->nused; idx++) { efl_dst->slot[idx].name = H5MM_xstrdup(efl_src->slot[idx].name); - if(UFAIL == (efl_dst->slot[idx].name_offset = H5HL_insert(file_dst, dxpl_id, heap, + if(UFAIL == (efl_dst->slot[idx].name_offset = H5HL_insert(file_dst, heap, HDstrlen(efl_dst->slot[idx].name) + 1, efl_dst->slot[idx].name))) HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap") } /* end for */ @@ -509,12 +509,12 @@ done: if(efl_dst) H5MM_xfree(efl_dst); - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* end H5O_efl_copy_file() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__efl_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_efl_debug + * Function: H5O__efl_debug * * Purpose: Prints debugging info for a message. * @@ -526,13 +526,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_efl_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__efl_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; size_t u; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -572,5 +572,5 @@ H5O_efl_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_efl_debug() */ +} /* end H5O__efl_debug() */ diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 5419762..445a655 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -32,19 +32,19 @@ #include "H5Sprivate.h" /* Dataspaces */ -static void *H5O_fill_old_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_fill_old_size(const H5F_t *f, const void *_mesg); -static void *H5O_fill_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_fill_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg); static void *H5O_fill_copy(const void *_mesg, void *_dest); -static herr_t H5O_fill_reset(void *_mesg); -static herr_t H5O_fill_free(void *_mesg); -static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); +static herr_t H5O__fill_reset(void *_mesg); +static herr_t H5O__fill_free(void *_mesg); +static herr_t H5O__fill_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_FILL @@ -54,17 +54,17 @@ static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *s #define H5O_SHARED_ENCODE_REAL H5O_fill_old_encode #define H5O_SHARED_SIZE H5O_fill_shared_size #define H5O_SHARED_SIZE_REAL H5O_fill_old_size -#define H5O_SHARED_DELETE H5O_fill_shared_delete +#define H5O_SHARED_DELETE H5O__fill_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O_fill_shared_link +#define H5O_SHARED_LINK H5O__fill_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O_fill_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__fill_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL #define H5O_SHARED_POST_COPY_FILE H5O_fill_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_fill_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O_fill_debug +#define H5O_SHARED_DEBUG_REAL H5O__fill_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* Set up & include shared message "interface" info */ @@ -84,13 +84,13 @@ static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *s #undef H5O_SHARED_SIZE_REAL #define H5O_SHARED_SIZE_REAL H5O_fill_new_size #undef H5O_SHARED_DELETE -#define H5O_SHARED_DELETE H5O_fill_new_shared_delete +#define H5O_SHARED_DELETE H5O__fill_new_shared_delete #undef H5O_SHARED_DELETE_REAL #undef H5O_SHARED_LINK -#define H5O_SHARED_LINK H5O_fill_new_shared_link +#define H5O_SHARED_LINK H5O__fill_new_shared_link #undef H5O_SHARED_LINK_REAL #undef H5O_SHARED_COPY_FILE -#define H5O_SHARED_COPY_FILE H5O_fill_new_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__fill_new_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE #define H5O_SHARED_POST_COPY_FILE H5O_fill_new_shared_post_copy_file @@ -99,7 +99,7 @@ static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *s #undef H5O_SHARED_DEBUG #define H5O_SHARED_DEBUG H5O_fill_new_shared_debug #undef H5O_SHARED_DEBUG_REAL -#define H5O_SHARED_DEBUG_REAL H5O_fill_debug +#define H5O_SHARED_DEBUG_REAL H5O__fill_debug #undef H5Oshared_H #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -113,14 +113,14 @@ const H5O_msg_class_t H5O_MSG_FILL[1] = {{ H5O_fill_shared_encode, /*encode message */ H5O_fill_copy, /*copy the native value */ H5O_fill_shared_size, /*raw message size */ - H5O_fill_reset, /*free internal memory */ - H5O_fill_free, /* free method */ - H5O_fill_shared_delete, /* file delete method */ - H5O_fill_shared_link, /* link method */ + H5O__fill_reset, /*free internal memory */ + H5O__fill_free, /* free method */ + H5O__fill_shared_delete, /* file delete method */ + H5O__fill_shared_link, /* link method */ NULL, /* set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ - H5O_fill_shared_copy_file, /* copy native value to file */ + H5O__fill_shared_copy_file, /* copy native value to file */ H5O_fill_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ @@ -137,14 +137,14 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ H5O_fill_new_shared_encode, /*encode message */ H5O_fill_copy, /*copy the native value */ H5O_fill_new_shared_size, /*raw message size */ - H5O_fill_reset, /*free internal memory */ - H5O_fill_free, /* free method */ - H5O_fill_new_shared_delete, /* file delete method */ - H5O_fill_new_shared_link, /* link method */ + H5O__fill_reset, /*free internal memory */ + H5O__fill_free, /* free method */ + H5O__fill_new_shared_delete,/* file delete method */ + H5O__fill_new_shared_link, /* link method */ NULL, /* set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ - H5O_fill_new_shared_copy_file, /* copy native value to file */ + H5O__fill_new_shared_copy_file, /* copy native value to file */ H5O_fill_new_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ @@ -183,7 +183,7 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ static void * -H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_fill_t *fill = NULL; @@ -297,7 +297,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_fill_old_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_fill_old_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_fill_t *fill = NULL; /* Decoded fill value message */ @@ -525,7 +525,7 @@ H5O_fill_copy(const void *_src, void *_dst) H5T_path_t *tpath; /* Conversion information */ /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(src->type, dst->type, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(src->type, dst->type))) HGOTO_ERROR(H5E_OHDR, H5E_UNSUPPORTED, NULL, "unable to convert between src and dst data types") /* If necessary, convert fill value datatypes (which copies VL components, etc.) */ @@ -553,7 +553,7 @@ H5O_fill_copy(const void *_src, void *_dst) } /* end if */ /* Convert fill value */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, dst->buf, bkg_buf, H5AC_noio_dxpl_id) < 0) { + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, dst->buf, bkg_buf) < 0) { H5I_dec_ref(src_id); H5I_dec_ref(dst_id); if(bkg_buf) @@ -580,7 +580,7 @@ done: if(dst->buf) H5MM_xfree(dst->buf); if(dst->type) - H5T_close(dst->type); + (void)H5T_close_real(dst->type); if(!_dst) dst = H5FL_FREE(H5O_fill_t, dst); } /* end if */ @@ -698,7 +698,7 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) if(NULL == (fill_type = H5T_copy(fill->type, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to copy fill value datatype") if((fill_type_id = H5I_register(H5I_DATATYPE, fill_type, FALSE)) < 0) { - H5T_close(fill_type); + (void)H5T_close_real(fill_type); HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to register fill value datatype") } /* end if */ @@ -707,7 +707,7 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create scalar dataspace") /* Reclaim any variable length components of the fill value */ - if(H5D_vlen_reclaim(fill_type_id, fill_space, H5AC_noio_dxpl_id, fill->buf) < 0) { + if(H5D_vlen_reclaim(fill_type_id, fill_space, fill->buf) < 0) { H5S_close(fill_space); HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "unable to reclaim variable-length fill value data") } /* end if */ @@ -721,7 +721,7 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) } /* end if */ fill->size = 0; if(fill->type) { - H5T_close(fill->type); + (void)H5T_close_real(fill->type); fill->type = NULL; } /* end if */ @@ -734,7 +734,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_fill_reset + * Function: H5O__fill_reset * * Purpose: Resets a message to an initial state. * @@ -746,11 +746,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_fill_reset(void *_fill) +H5O__fill_reset(void *_fill) { H5O_fill_t *fill = (H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(fill); @@ -763,11 +763,11 @@ H5O_fill_reset(void *_fill) fill->fill_defined = FALSE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_reset() */ +} /* end H5O__fill_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_free + * Function: H5O__fill_free * * Purpose: Frees the message * @@ -779,20 +779,20 @@ H5O_fill_reset(void *_fill) *------------------------------------------------------------------------- */ static herr_t -H5O_fill_free(void *fill) +H5O__fill_free(void *fill) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(fill); fill = H5FL_FREE(H5O_fill_t, fill); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_free() */ +} /* end H5O__fill_free() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_debug + * Function: H5O__fill_debug * * Purpose: Prints debugging info for the message. * @@ -804,13 +804,13 @@ H5O_fill_free(void *fill) *------------------------------------------------------------------------- */ static herr_t -H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_fill, FILE *stream, - int indent, int fwidth) +H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream, + int indent, int fwidth) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; H5D_fill_value_t fill_status; /* Whether the fill value is defined */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); HDassert(fill); @@ -890,7 +890,7 @@ H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void fprintf(stream, "\n"); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_debug() */ +} /* end H5O__fill_debug() */ /*------------------------------------------------------------------------- @@ -909,7 +909,7 @@ H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *------------------------------------------------------------------------- */ herr_t -H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_t dxpl_id) +H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed) { H5T_path_t *tpath; /* Type conversion info */ void *buf = NULL, *bkg = NULL; /* Conversion buffers */ @@ -926,7 +926,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ if(!fill->buf || !fill->type || 0 == H5T_cmp(fill->type, dset_type, FALSE)) { /* Don't need datatype for fill value */ if(fill->type) - H5T_close(fill->type); + (void)H5T_close_real(fill->type); fill->type = NULL; /* Note that the fill value info has changed */ @@ -938,7 +938,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ /* * Can we convert between source and destination data types? */ - if(NULL == (tpath = H5T_path_find(fill->type, dset_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(fill->type, dset_type))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes") /* Don't bother doing anything if there will be no actual conversion */ @@ -965,16 +965,16 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") /* Do the conversion */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Update the fill message */ if(buf != fill->buf) { - H5T_vlen_reclaim_elmt(fill->buf, fill->type, dxpl_id); + H5T_vlen_reclaim_elmt(fill->buf, fill->type); H5MM_xfree(fill->buf); fill->buf = buf; } /* end if */ - H5T_close(fill->type); + (void)H5T_close_real(fill->type); fill->type = NULL; H5_CHECKED_ASSIGN(fill->size, ssize_t, H5T_get_size(dset_type), size_t); diff --git a/src/H5Oflush.c b/src/H5Oflush.c index b1592dd..31ef9b9 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -33,17 +33,24 @@ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Errors */ #include "H5Fprivate.h" /* Files */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ #include "H5Opkg.h" /* Objects */ + /********************/ /* Local Prototypes */ /********************/ -static herr_t H5O_oh_tag(const H5O_loc_t *oloc, hid_t dxpl_id, haddr_t *tag); +static herr_t H5O__flush(hid_t obj_id); +static herr_t H5O__oh_tag(const H5O_loc_t *oloc, haddr_t *tag); +static herr_t H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, + H5G_loc_t *obj_loc); +static herr_t H5O__refresh(hid_t obj_id); + /*************/ /* Functions */ @@ -66,38 +73,31 @@ static herr_t H5O_oh_tag(const H5O_loc_t *oloc, hid_t dxpl_id, haddr_t *tag); herr_t H5Oflush(hid_t obj_id) { - H5O_loc_t *oloc; /* object location */ - void *obj_ptr; /* Pointer to object */ - const H5O_obj_class_t *obj_class = NULL; /* Class of object */ - herr_t ret_value = SUCCEED; /* return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", obj_id); - /* Check args */ - if(NULL == (oloc = H5O_get_loc(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") - - /* Get the object pointer */ - if(NULL == (obj_ptr = H5I_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") - /* Get the object class */ - if(NULL == (obj_class = H5O_obj_class(oloc, H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object class") - - /* Flush the object of this class */ - if(obj_class->flush && obj_class->flush(obj_ptr, H5AC_ind_read_dxpl_id) < 0) + /* Call internal routine */ + if(H5O__flush(obj_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object") - /* Flush the object metadata and invoke flush callback */ - if(H5O_flush_common(oloc, obj_id, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object and object flush callback") - done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oflush() */ + /*------------------------------------------------------------------------- * Function: H5O_flush_common * @@ -111,7 +111,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id, hid_t dxpl_id) +H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id) { haddr_t tag = 0; herr_t ret_value = SUCCEED; /* Return value */ @@ -119,11 +119,11 @@ H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id, hid_t dxpl_id) FUNC_ENTER_NOAPI(FAIL) /* Retrieve tag for object */ - if(H5O_oh_tag(oloc, dxpl_id, &tag) < 0) + if(H5O__oh_tag(oloc, &tag) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object metadata") /* Flush metadata based on tag value of the object */ - if(H5F_flush_tagged_metadata(oloc->file, tag, dxpl_id) < 0) + if(H5F_flush_tagged_metadata(oloc->file, tag) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") /* Check to invoke callback */ @@ -136,7 +136,58 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_oh_tag + * Function: H5O__flush + * + * Purpose: Internal routine to flush an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 29, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O__flush(hid_t obj_id) +{ + H5O_loc_t *oloc; /* Object location */ + void *obj_ptr; /* Pointer to object */ + const H5O_obj_class_t *obj_class; /* Class of object */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check args */ + if(NULL == (oloc = H5O_get_loc(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") + + /* Get the object pointer */ + if(NULL == (obj_ptr = H5I_object(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") + + /* Get the object class */ + if(NULL == (obj_class = H5O__obj_class(oloc))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object class") + + /* Flush the object of this class */ + if(obj_class->flush && obj_class->flush(obj_ptr) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object") + + /* Flush the object metadata and invoke flush callback */ + if(H5O_flush_common(oloc, obj_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object and object flush callback") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__flush() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__oh_tag * * Purpose: Get object header's address--tag value for the object * @@ -149,18 +200,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_oh_tag(const H5O_loc_t *oloc, hid_t dxpl_id, haddr_t *tag) +H5O__oh_tag(const H5O_loc_t *oloc, haddr_t *tag) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Check args */ HDassert(oloc); /* Get object header for object */ - if(NULL == (oh = H5O_protect(oloc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(oloc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object's object header") /* Get object header's address (i.e. the tag value for this object) */ @@ -169,11 +220,11 @@ H5O_oh_tag(const H5O_loc_t *oloc, hid_t dxpl_id, haddr_t *tag) done: /* Unprotect object header on failure */ - if(oh && H5O_unprotect(oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(oloc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_oh_tag() */ +} /* end H5O__oh_tag() */ /*------------------------------------------------------------------------- @@ -191,21 +242,27 @@ done: herr_t H5Orefresh(hid_t oid) { - H5O_loc_t *oloc; /* object location */ - herr_t ret_value = SUCCEED; /* return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", oid); - /* Check args */ - if(NULL == (oloc = H5O_get_loc(oid))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(oid, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") - /* Private function */ - if(H5O_refresh_metadata(oid, *oloc, H5AC_ind_read_dxpl_id) < 0) + /* Call internal routine */ + if(H5O__refresh(oid) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Orefresh() */ @@ -231,7 +288,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc, hid_t dxpl_id) +H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc) { hbool_t objs_incr = FALSE; /* Whether the object count in the file was incremented */ herr_t ret_value = SUCCEED; /* Return value */ @@ -256,11 +313,11 @@ H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc, hid_t dxpl_id) objs_incr = TRUE; /* Close object & evict its metadata */ - if((H5O_refresh_metadata_close(oid, oloc, &obj_loc, dxpl_id)) < 0) + if((H5O__refresh_metadata_close(oid, oloc, &obj_loc)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object") /* Re-open the object, re-fetching its metadata */ - if((H5O_refresh_metadata_reopen(oid, &obj_loc, dxpl_id, FALSE)) < 0) + if((H5O_refresh_metadata_reopen(oid, &obj_loc, FALSE)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object") } /* end if */ @@ -273,7 +330,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_refresh_metadata_close + * Function: H5O__refresh_metadata_close * * Purpose: This is the first part of the original routine H5O_refresh_metadata(). * (1) Save object location information. @@ -291,14 +348,14 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5O_refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc, hid_t dxpl_id) +static herr_t +H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc) { haddr_t tag = 0; /* Tag for object */ hbool_t corked = FALSE; /* Whether object's metadata is corked */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Make deep local copy of object's location information */ if(obj_loc) { @@ -310,11 +367,11 @@ H5O_refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc, hid_t /* Get object's type */ if(H5I_get_type(oid) == H5I_DATASET) - if(H5D_mult_refresh_close(oid, dxpl_id) < 0) + if(H5D_mult_refresh_close(oid) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to prepare refresh for dataset") /* Retrieve tag for object */ - if(H5O_oh_tag(&oloc, dxpl_id, &tag) < 0) + if(H5O__oh_tag(&oloc, &tag) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to get object header address") /* Get cork status of the object with tag */ @@ -326,11 +383,11 @@ H5O_refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc, hid_t HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to close object") /* Flush metadata based on tag value of the object */ - if(H5F_flush_tagged_metadata(oloc.file, tag, dxpl_id) < 0) + if(H5F_flush_tagged_metadata(oloc.file, tag) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") /* Evict the object's tagged metadata */ - if(H5F_evict_tagged_metadata(oloc.file, tag, dxpl_id) < 0) + if(H5F_evict_tagged_metadata(oloc.file, tag) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to evict metadata") /* Re-cork object with tag */ @@ -340,7 +397,7 @@ H5O_refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc, hid_t done: FUNC_LEAVE_NOAPI(ret_value); -} /* end H5O_refresh_metadata_close() */ +} /* end H5O__refresh_metadata_close() */ /*------------------------------------------------------------------------- @@ -358,7 +415,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_t start_swmr) +H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hbool_t start_swmr) { void *object = NULL; /* Dataset for this operation */ H5I_type_t type; /* Type of object for the ID */ @@ -372,22 +429,22 @@ H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_ switch(type) { case H5I_GROUP: /* Re-open the group */ - if(NULL == (object = H5G_open(obj_loc, dxpl_id))) + if(NULL == (object = H5G_open(obj_loc))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") break; case H5I_DATATYPE: /* Re-open the named datatype */ - if(NULL == (object = H5T_open(obj_loc, dxpl_id))) + if(NULL == (object = H5T_open(obj_loc))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype") break; case H5I_DATASET: /* Re-open the dataset */ - if(NULL == (object = H5D_open(obj_loc, H5P_DATASET_ACCESS_DEFAULT, dxpl_id))) + if(NULL == (object = H5D_open(obj_loc, H5P_DATASET_ACCESS_DEFAULT))) 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) + if(H5D_mult_refresh_reopen((H5D_t *)object) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to finish refresh for dataset") break; @@ -417,3 +474,40 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5O_refresh_metadata_reopen() */ + +/*------------------------------------------------------------------------- + * Function: H5O__refresh + * + * Purpose: Internal routine to refresh an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 29, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O__refresh(hid_t obj_id) +{ + H5O_loc_t *oloc; /* Object location */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check args */ + if(NULL == (oloc = H5O_get_loc(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") + + /* Private function */ + if(H5O_refresh_metadata(obj_id, *oloc) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__refresh() */ + diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 4d62f49..2b135ed 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -32,13 +32,14 @@ #include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_fsinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_fsinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_fsinfo_copy(const void *_mesg, void *_dest); static size_t H5O_fsinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_fsinfo_free(void *mesg); -static herr_t H5O_fsinfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__fsinfo_free(void *mesg); +static herr_t H5O__fsinfo_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_FSINFO[1] = {{ @@ -51,7 +52,7 @@ const H5O_msg_class_t H5O_MSG_FSINFO[1] = {{ H5O_fsinfo_copy, /* copy the native value */ H5O_fsinfo_size, /* size of free-space manager info message */ NULL, /* default reset method */ - H5O_fsinfo_free, /* free method */ + H5O__fsinfo_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /* set share method */ @@ -61,7 +62,7 @@ const H5O_msg_class_t H5O_MSG_FSINFO[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_fsinfo_debug /* debug the message */ + H5O__fsinfo_debug /* debug the message */ }}; /* Current version of free-space manager info information */ @@ -85,7 +86,7 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t); *------------------------------------------------------------------------- */ static void * -H5O_fsinfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_fsinfo_decode(H5F_t *f, 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 */ @@ -307,9 +308,9 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_free + * Function: H5O__fsinfo_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -318,20 +319,20 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi *------------------------------------------------------------------------- */ static herr_t -H5O_fsinfo_free(void *mesg) +H5O__fsinfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_fsinfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fsinfo_free() */ +} /* end H5O__fsinfo_free() */ /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_debug + * Function: H5O__fsinfo_debug * * Purpose: Prints debugging info for a message. * @@ -342,13 +343,13 @@ H5O_fsinfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *) _mesg; H5F_mem_page_t ptype; /* Free-space types for iteration */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -402,5 +403,5 @@ H5O_fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const vo } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fsinfo_debug() */ +} /* end H5O__fsinfo_debug() */ diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 468e07a..7c13f8f 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -32,14 +32,14 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_ginfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_ginfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_ginfo_copy(const void *_mesg, void *_dest); static size_t H5O_ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_ginfo_free(void *_mesg); -static herr_t H5O_ginfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__ginfo_free(void *_mesg); +static herr_t H5O__ginfo_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_GINFO[1] = {{ @@ -52,7 +52,7 @@ const H5O_msg_class_t H5O_MSG_GINFO[1] = {{ H5O_ginfo_copy, /*copy the native value */ H5O_ginfo_size, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_ginfo_free, /* free method */ + H5O__ginfo_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ @@ -62,7 +62,7 @@ const H5O_msg_class_t H5O_MSG_GINFO[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_ginfo_debug /*debug the message */ + H5O__ginfo_debug /*debug the message */ }}; /* Current version of group info information */ @@ -94,7 +94,7 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); *------------------------------------------------------------------------- */ static void * -H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_ginfo_t *ginfo = NULL; /* Pointer to group information message */ @@ -285,9 +285,9 @@ H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha /*------------------------------------------------------------------------- - * Function: H5O_ginfo_free + * Function: H5O__ginfo_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -297,7 +297,7 @@ H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha *------------------------------------------------------------------------- */ static herr_t -H5O_ginfo_free(void *mesg) +H5O__ginfo_free(void *mesg) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -306,11 +306,11 @@ H5O_ginfo_free(void *mesg) mesg = H5FL_FREE(H5O_ginfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ginfo_free() */ +} /* end H5O__ginfo_free() */ /*------------------------------------------------------------------------- - * Function: H5O_ginfo_debug + * Function: H5O__ginfo_debug * * Purpose: Prints debugging info for a message. * @@ -323,12 +323,12 @@ H5O_ginfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_ginfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__ginfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -347,5 +347,5 @@ H5O_ginfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi "Estimated length of object in group's name:", ginfo->est_name_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ginfo_debug() */ +} /* end H5O__ginfo_debug() */ diff --git a/src/H5Oint.c b/src/H5Oint.c index 6ab5393..3ed19bf 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -58,8 +58,6 @@ typedef struct { hid_t obj_id; /* The ID for the starting group */ H5G_loc_t *start_loc; /* Location of starting group */ - hid_t lapl_id; /* LAPL for walking across links */ - hid_t dxpl_id; /* DXPL for operations */ H5SL_t *visited; /* Skip list for tracking visited nodes */ H5O_iterate_t op; /* Application callback */ void *op_data; /* Application's op data */ @@ -75,10 +73,14 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh); -static herr_t H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type); -static herr_t H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr); -static const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh); +static herr_t H5O__delete_oh(H5F_t *f, H5O_t *oh); +static herr_t H5O__obj_type_real(const H5O_t *oh, H5O_type_t *obj_type); +static herr_t H5O__get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr); +static herr_t H5O__free_visit_visited(void *item, void *key, + void *operator_data/*in,out*/); +static herr_t H5O__visit_cb(hid_t group, const char *name, const H5L_info_t *linfo, + void *_udata); +static const H5O_obj_class_t *H5O__obj_class_real(const H5O_t *oh); /*********************/ @@ -223,8 +225,8 @@ H5O__init_package(void) *------------------------------------------------------------------------- */ herr_t -H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, - hid_t ocpl_id, H5O_loc_t *loc/*out*/) +H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id, + H5O_loc_t *loc/*out*/) { H5P_genplist_t *oc_plist; /* Object creation property list */ H5O_t *oh = NULL; /* Object header created */ @@ -337,7 +339,7 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, oh_size = (size_t)H5O_SIZEOF_HDR(oh) + size_hint; /* Allocate disk space for header and first chunk */ - if(HADDR_UNDEF == (oh_addr = H5MF_alloc(f, H5FD_MEM_OHDR, dxpl_id, (hsize_t)oh_size))) + if(HADDR_UNDEF == (oh_addr = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)oh_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for object header") /* Create the chunk list */ @@ -381,18 +383,18 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, insert_flags |= H5AC__PIN_ENTRY_FLAG; } - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(dxpl_id, oh_addr, FAIL); + /* Set metadata tag in API context */ + H5_BEGIN_TAG(oh_addr); /* Cache object header */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_OHDR, oh_addr, oh, insert_flags) < 0) + if(H5AC_insert_entry(f, H5AC_OHDR, oh_addr, oh, insert_flags) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header") /* Reset object header pointer, now that it's been inserted into the cache */ oh = NULL; - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG /* Set up object location */ loc->file = f; @@ -470,15 +472,15 @@ done: *------------------------------------------------------------------------- */ hid_t -H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O_open_name(const H5G_loc_t *loc, const char *name, hbool_t app_ref) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'name' found */ - hid_t ret_value = FAIL; + hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(H5I_INVALID_HID) /* Check args */ HDassert(loc); @@ -490,25 +492,162 @@ H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id, hb H5G_loc_reset(&obj_loc); /* Find the object's location */ - if(H5G_loc_find(loc, name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if(H5G_loc_find(loc, name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5I_INVALID_HID, "object not found") loc_found = TRUE; /* Open the object */ - if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, app_ref)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") + if((ret_value = H5O__open_by_loc(&obj_loc, app_ref)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") done: if(ret_value < 0 && loc_found) if(H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5I_INVALID_HID, "can't free location") FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_open_name() */ /*------------------------------------------------------------------------- - * Function: H5O_open_by_loc + * Function: H5O__open_name + * + * Purpose: Internal routine to open an object by name + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +hid_t +H5O__open_name(const H5G_loc_t *loc, const char *name) +{ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name); + + /* Open the object */ + if((ret_value = H5O_open_name(loc, name, TRUE)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__open_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__open_by_idx + * + * Purpose: Internal routine to open an object by index within group + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +hid_t +H5O__open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'name' found */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location, according to the order in the index */ + if(H5G_loc_find_by_idx(loc, name, idx_type, order, n, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5I_INVALID_HID, "group not found") + loc_found = TRUE; + + /* Open the object */ + if((ret_value = H5O__open_by_loc(&obj_loc, TRUE)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") + +done: + /* Release the object location if we failed after copying it */ + if(ret_value < 0 && loc_found) + if(H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5I_INVALID_HID, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__open_by_idx() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__open_by_addr + * + * Purpose: Internal routine to open an object by its address + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +hid_t +H5O__open_by_addr(const H5G_loc_t *loc, haddr_t addr) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + obj_loc.oloc->addr = addr; + obj_loc.oloc->file = loc->oloc->file; + H5G_name_reset(obj_loc.path); /* objects opened through this routine don't have a path name */ + + /* Open the object */ + if((ret_value = H5O__open_by_loc(&obj_loc, TRUE)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__open_by_addr() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__open_by_loc * * Purpose: Opens an object and returns an ID given its group loction. * @@ -521,27 +660,65 @@ done: *------------------------------------------------------------------------- */ hid_t -H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O__open_by_loc(const H5G_loc_t *obj_loc, hbool_t app_ref) { const H5O_obj_class_t *obj_class; /* Class of object for location */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(obj_loc); /* Get the object class for this location */ - if(NULL == (obj_class = H5O_obj_class(obj_loc->oloc, dxpl_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class") + if(NULL == (obj_class = H5O__obj_class(obj_loc->oloc))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5I_INVALID_HID, "unable to determine object class") /* Call the object class's 'open' routine */ HDassert(obj_class->open); - if((ret_value = obj_class->open(obj_loc, lapl_id, dxpl_id, app_ref)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") + if((ret_value = obj_class->open(obj_loc, app_ref)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_open_by_loc() */ +} /* end H5O__open_by_loc() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__create_link + * + * Purpose: Internal routine to create a link from a group to an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__create_link(const H5G_loc_t *new_loc, const char *new_name, + H5G_loc_t *obj_loc, hid_t lcpl_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(new_loc); + HDassert(new_name && *new_name); + HDassert(obj_loc); + + /* Link to the object */ + if(H5L_link(new_loc, new_name, obj_loc, lcpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "unable to create link") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__create_link() */ /*------------------------------------------------------------------------- @@ -609,7 +786,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_link_oh + * Function: H5O__link_oh * * Purpose: Adjust the link count for an open object header by adding * ADJUST to the link count. @@ -625,12 +802,12 @@ done: *------------------------------------------------------------------------- */ int -H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) +H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted) { haddr_t addr = H5O_OH_GET_ADDR(oh); /* Object header address */ int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -690,7 +867,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) if(oh->has_refcount_msg) { /* Check for removing refcount message */ if(oh->nlink <= 1) { - if(H5O_msg_remove_real(f, oh, H5O_MSG_REFCOUNT, H5O_ALL, NULL, NULL, TRUE, dxpl_id) < 0) + if(H5O__msg_remove_real(f, oh, H5O_MSG_REFCOUNT, H5O_ALL, NULL, NULL, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete refcount message") oh->has_refcount_msg = FALSE; } /* end if */ @@ -698,7 +875,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) else { H5O_refcount_t refcount = oh->nlink; - if(H5O_msg_write_real(f, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) + if(H5O__msg_write_real(f, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update refcount message") } /* end else */ } /* end if */ @@ -707,7 +884,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) if(oh->nlink > 1) { H5O_refcount_t refcount = oh->nlink; - if(H5O_msg_append_real(f, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) + if(H5O__msg_append_real(f, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to create new refcount message") oh->has_refcount_msg = TRUE; } /* end if */ @@ -720,7 +897,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_link_oh() */ +} /* end H5O__link_oh() */ /*------------------------------------------------------------------------- @@ -740,13 +917,13 @@ done: *------------------------------------------------------------------------- */ int -H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) +H5O_link(const H5O_loc_t *loc, int adjust) { H5O_t *oh = NULL; hbool_t deleted = FALSE; /* Whether the object was deleted */ int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL) /* check args */ HDassert(loc); @@ -754,24 +931,59 @@ H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) HDassert(H5F_addr_defined(loc->addr)); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Call the "real" link routine */ - if((ret_value = H5O_link_oh(loc->file, adjust, dxpl_id, oh, &deleted)) < 0) + if((ret_value = H5O__link_oh(loc->file, adjust, oh, &deleted)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust object link count") done: if(oh && H5O_unpin(oh) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") - if(ret_value >= 0 && deleted && H5O_delete(loc->file, dxpl_id, loc->addr) < 0) + if(ret_value >= 0 && deleted && H5O_delete(loc->file, loc->addr) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_link() */ /*------------------------------------------------------------------------- + * Function: H5O__link + * + * Purpose: Internal routine to change the refcount for an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__link(const H5O_loc_t *oloc, int adjust) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(oloc); + + /* Change the object's refcount */ + if(H5O_link(oloc, adjust) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__link() */ + + +/*------------------------------------------------------------------------- * Function: H5O_protect * * Purpose: Wrapper around H5AC_protect for use during a H5O_protect-> @@ -789,8 +1001,7 @@ done: *------------------------------------------------------------------------- */ H5O_t * -H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, - hbool_t pin_all_chunks) +H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks) { H5O_t *oh = NULL; /* Object header protected */ H5O_cache_ud_t udata; /* User data for protecting object header */ @@ -798,7 +1009,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, unsigned file_intent; /* R/W intent on file */ H5O_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, NULL) + FUNC_ENTER_NOAPI_TAG(loc->addr, NULL) /* check args */ HDassert(loc); @@ -822,7 +1033,6 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, udata.chunk0_size = 0; udata.oh = NULL; udata.common.f = loc->file; - udata.common.dxpl_id = dxpl_id; udata.common.file_intent = file_intent; udata.common.merged_null_msgs = 0; HDmemset(&cont_msg_info, 0, sizeof(cont_msg_info)); @@ -830,7 +1040,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, udata.common.addr = loc->addr; /* Lock the object header into the cache */ - if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, &udata, prot_flags))) + if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, H5AC_OHDR, loc->addr, &udata, prot_flags))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Check if there are any continuation messages to process */ @@ -849,7 +1059,6 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, chk_udata.oh = oh; chk_udata.chunkno = UINT_MAX; /* Set to invalid value, for better error detection */ chk_udata.common.f = loc->file; - chk_udata.common.dxpl_id = dxpl_id; chk_udata.common.file_intent = file_intent; chk_udata.common.merged_null_msgs = udata.common.merged_null_msgs; chk_udata.common.cont_msg_info = &cont_msg_info; @@ -869,7 +1078,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, /* (which adds to the object header) */ chk_udata.common.addr = cont_msg_info.msgs[curr_msg].addr; chk_udata.size = cont_msg_info.msgs[curr_msg].size; - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, &chk_udata, prot_flags))) + if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(loc->file, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, &chk_udata, prot_flags))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") /* Sanity check */ @@ -878,7 +1087,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, HDassert(oh->nchunks == (chkcnt + 1)); /* Release the chunk from the cache */ - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(loc->file, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header chunk") /* Advance to next continuation message */ @@ -928,7 +1137,7 @@ H5O_assert(oh); H5O_chunk_proxy_t *chk_proxy; /* Chunk proxy */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(loc->file, dxpl_id, oh, u))) + if(NULL == (chk_proxy = H5O__chunk_protect(loc->file, oh, u))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header chunk") /* Pin chunk proxy*/ @@ -936,7 +1145,7 @@ H5O_assert(oh); HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, NULL, "unable to pin object header chunk") /* Unprotect chunk */ - if(H5O_chunk_unprotect(loc->file, dxpl_id, chk_proxy, FALSE) < 0) + if(H5O__chunk_unprotect(loc->file, chk_proxy, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to unprotect object header chunk") /* Preserve chunk proxy pointer for later */ @@ -952,10 +1161,10 @@ H5O_assert(oh); done: if(ret_value == NULL && oh) - if(H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_protect() */ @@ -977,7 +1186,7 @@ done: *------------------------------------------------------------------------- */ H5O_t * -H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id) +H5O_pin(const H5O_loc_t *loc) { H5O_t *oh = NULL; /* Object header */ H5O_t *ret_value = NULL; /* Return value */ @@ -988,12 +1197,12 @@ H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id) HDassert(loc); /* Get header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header") /* Increment the reference count on the object header */ /* (which will pin it, if appropriate) */ - if(H5O_inc_rc(oh) < 0) + if(H5O__inc_rc(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, NULL, "unable to increment reference count on object header") /* Set the return value */ @@ -1001,7 +1210,7 @@ H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id) done: /* Release the object header from the cache */ - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1035,7 +1244,7 @@ H5O_unpin(H5O_t *oh) /* Decrement the reference count on the object header */ /* (which will unpin it, if appropriate) */ - if(H5O_dec_rc(oh) < 0) + if(H5O__dec_rc(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement reference count on object header") done: @@ -1060,7 +1269,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_unprotect(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, unsigned oh_flags) +H5O_unprotect(const H5O_loc_t *loc, H5O_t *oh, unsigned oh_flags) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1092,7 +1301,7 @@ H5O_unprotect(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, unsigned oh_flags) } /* end if */ /* Unprotect the object header */ - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, oh->chunk[0].addr, oh, oh_flags) < 0) + if(H5AC_unprotect(loc->file, H5AC_OHDR, oh->chunk[0].addr, oh, oh_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") done: @@ -1115,7 +1324,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) +H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ @@ -1150,7 +1359,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) HGOTO_DONE(SUCCEED); /*nothing to do*/ /* Allocate space for the modification time message */ - if(H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_MTIME_NEW, &mesg_flags, &now, &idx) < 0) + if(H5O__msg_alloc(f, oh, H5O_MSG_MTIME_NEW, &mesg_flags, &now, &idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for modification time message") /* Set the message's flags if appropriate */ @@ -1158,7 +1367,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) } /* end if */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, oh->mesg[idx].chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, oh->mesg[idx].chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Allocate 'native' space, if necessary */ @@ -1187,7 +1396,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1210,7 +1419,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id) +H5O_touch(const H5O_loc_t *loc, hbool_t force) { H5O_t *oh = NULL; /* Object header to modify */ unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting object header */ @@ -1222,18 +1431,18 @@ H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id) HDassert(loc); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Create/Update the modification time message */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, force) < 0) + if(H5O_touch_oh(loc->file, oh, force) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "unable to update object modificaton time") /* Mark object header as changed */ oh_flags |= H5AC__DIRTIED_FLAG; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, oh_flags) < 0) + if(oh && H5O_unprotect(loc, oh, oh_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1255,7 +1464,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned bogus_id, unsigned mesg_flags) +H5O_bogus_oh(H5F_t *f, H5O_t *oh, unsigned bogus_id, unsigned mesg_flags) { size_t idx; /* Local index variable */ H5O_msg_class_t *type; /* Message class type */ @@ -1290,7 +1499,7 @@ H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned bogus_id, unsigned mes HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID for 'bogus' message") /* Allocate space in the object header for bogus message */ - if(H5O_msg_alloc(f, dxpl_id, oh, type, &mesg_flags, bogus, &idx) < 0) + if(H5O__msg_alloc(f, oh, type, &mesg_flags, bogus, &idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for 'bogus' message") /* Point to "bogus" information (take it over) */ @@ -1327,7 +1536,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) +H5O_delete(H5F_t *f, haddr_t addr) { H5O_t *oh = NULL; /* Object header information */ H5O_loc_t loc; /* Object location for object to delete */ @@ -1335,7 +1544,7 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) hbool_t corked; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, addr, FAIL) + FUNC_ENTER_NOAPI_TAG(addr, FAIL) /* Check args */ HDassert(f); @@ -1347,11 +1556,11 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) loc.holding_file = FALSE; /* Get the object header information */ - if(NULL == (oh = H5O_protect(&loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + if(NULL == (oh = H5O_protect(&loc, H5AC__NO_FLAGS_SET, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Delete object */ - if(H5O_delete_oh(f, dxpl_id, oh) < 0) + if(H5O__delete_oh(f, oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file") /* Uncork cache entries with tag: addr */ @@ -1365,15 +1574,15 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) oh_flags = H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; done: - if(oh && H5O_unprotect(&loc, dxpl_id, oh, oh_flags) < 0) + if(oh && H5O_unprotect(&loc, oh, oh_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_delete_oh + * Function: H5O__delete_oh * * Purpose: Internal function to: * Delete an object header from a file. This frees the file @@ -1390,13 +1599,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) +H5O__delete_oh(H5F_t *f, H5O_t *oh) { H5O_mesg_t *curr_msg; /* Pointer to current message being operated on */ unsigned u; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(f); @@ -1407,13 +1616,13 @@ H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) */ for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { /* Free any space referred to in the file from this message */ - if(H5O_delete_mesg(f, dxpl_id, oh, curr_msg) < 0) + if(H5O__delete_mesg(f, oh, curr_msg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") } /* end for */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_delete_oh() */ +} /* end H5O__delete_oh() */ /*------------------------------------------------------------------------- @@ -1430,31 +1639,31 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type, hid_t dxpl_id) +H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type) { H5O_t *oh = NULL; /* Object header for location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL) /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve the type of the object */ - if(H5O_obj_type_real(oh, obj_type) < 0) + if(H5O__obj_type_real(oh, obj_type) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_obj_type() */ /*------------------------------------------------------------------------- - * Function: H5O_obj_type_real + * Function: H5O__obj_type_real * * Purpose: Returns the type of object pointed to by `oh'. * @@ -1467,35 +1676,35 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type) +H5O__obj_type_real(const H5O_t *oh, H5O_type_t *obj_type) { const H5O_obj_class_t *obj_class; /* Class of object for header */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(oh); HDassert(obj_type); /* Look up class for object header */ - if(NULL == (obj_class = H5O_obj_class_real(oh))) { + if(NULL == (obj_class = H5O__obj_class_real(oh))) { /* Clear error stack from "failed" class lookup */ H5E_clear_stack(NULL); /* Set type to "unknown" */ *obj_type = H5O_TYPE_UNKNOWN; - } + } /* end if */ else { /* Set object type */ *obj_type = obj_class->type; - } + } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_obj_type_real() */ +} /* end H5O__obj_type_real() */ /*------------------------------------------------------------------------- - * Function: H5O_obj_class + * Function: H5O__obj_class * * Purpose: Returns the class of object pointed to by `loc'. * @@ -1508,31 +1717,31 @@ H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type) *------------------------------------------------------------------------- */ const H5O_obj_class_t * -H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id) +H5O__obj_class(const H5O_loc_t *loc) { H5O_t *oh = NULL; /* Object header for location */ const H5O_obj_class_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, NULL) + FUNC_ENTER_STATIC_TAG(loc->addr) /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Test whether entry qualifies as a particular type of object */ - if(NULL == (ret_value = H5O_obj_class_real(oh))) + if(NULL == (ret_value = H5O__obj_class_real(oh))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to determine object type") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* end H5O_obj_class() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__obj_class() */ /*------------------------------------------------------------------------- - * Function: H5O_obj_class_real + * Function: H5O__obj_class_real * * Purpose: Returns the class of object pointed to by `oh'. * @@ -1545,12 +1754,12 @@ done: *------------------------------------------------------------------------- */ static const H5O_obj_class_t * -H5O_obj_class_real(H5O_t *oh) +H5O__obj_class_real(const H5O_t *oh) { size_t i; /* Local index variable */ const H5O_obj_class_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(oh); @@ -1564,14 +1773,14 @@ H5O_obj_class_real(H5O_t *oh) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to determine object type") else if(isa) HGOTO_DONE(H5O_obj_class_g[i - 1]) - } + } /* end for */ if(0 == i) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to determine object type") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_obj_class_real() */ +} /* end H5O__obj_class_real() */ /*------------------------------------------------------------------------- @@ -1786,6 +1995,42 @@ done: /*------------------------------------------------------------------------- + * Function: H5O__exists_by_name + * + * Purpose: Internal routine to check if an object exists + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +htri_t +H5O__exists_by_name(const H5G_loc_t *loc, const char *name) +{ + htri_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Check if the object exists */ + if((ret_value = H5G_loc_exists(loc, name)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists", name) + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__exists_by_name() */ + + +/*------------------------------------------------------------------------- * Function: H5O_get_hdr_info * * Purpose: Retrieve the object header information for an object @@ -1799,7 +2044,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_get_hdr_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_hdr_info_t *hdr) +H5O_get_hdr_info(const H5O_loc_t *loc, H5O_hdr_info_t *hdr) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1814,15 +2059,15 @@ H5O_get_hdr_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_hdr_info_t *hdr) HDmemset(hdr, 0, sizeof(*hdr)); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Get the information for the object header */ - if(H5O_get_hdr_info_real(oh, hdr) < 0) + if(H5O__get_hdr_info_real(oh, hdr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object header info") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1830,7 +2075,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_get_hdr_info_real + * Function: H5O__get_hdr_info_real * * Purpose: Internal routine to retrieve the object header information for an object * @@ -1843,13 +2088,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) +H5O__get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) { const H5O_mesg_t *curr_msg; /* Pointer to current message being operated on */ const H5O_chunk_t *curr_chunk; /* Pointer to current message being operated on */ unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(oh); @@ -1907,7 +2152,7 @@ H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) HDassert(hdr->space.total == (hdr->space.free + hdr->space.meta + hdr->space.mesg)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_get_hdr_info_real() */ +} /* end H5O__get_hdr_info_real() */ /*------------------------------------------------------------------------- @@ -1924,21 +2169,20 @@ H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) *------------------------------------------------------------------------- */ herr_t -H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, - H5O_info_t *oinfo) +H5O_get_info(const H5O_loc_t *loc, hbool_t want_ih_info, H5O_info_t *oinfo) { const H5O_obj_class_t *obj_class; /* Class of object for header */ H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL) /* Check args */ HDassert(loc); HDassert(oinfo); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Reset the object info structure */ @@ -1951,7 +2195,7 @@ H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, oinfo->addr = loc->addr; /* Get class for object */ - if(NULL == (obj_class = H5O_obj_class_real(oh))) + if(NULL == (obj_class = H5O__obj_class_real(oh))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class") /* Retrieve the type of the object */ @@ -1984,7 +2228,7 @@ H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME message") if(exists > 0) { /* Get "old style" modification time info */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_MTIME_ID, &oinfo->ctime)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_MTIME_ID, &oinfo->ctime)) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME message") } /* end if */ else { @@ -1993,7 +2237,7 @@ H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME_NEW message") if(exists > 0) { /* Get "new style" modification time info */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_MTIME_NEW_ID, &oinfo->ctime)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_MTIME_NEW_ID, &oinfo->ctime)) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME_NEW message") } /* end if */ else @@ -2002,38 +2246,204 @@ H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, } /* end else */ /* Get the information for the object header */ - if(H5O_get_hdr_info_real(oh, &oinfo->hdr) < 0) + if(H5O__get_hdr_info_real(oh, &oinfo->hdr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object header info") /* Retrieve # of attributes */ - if(H5O_attr_count_real(loc->file, dxpl_id, oh, &oinfo->num_attrs) < 0) + if(H5O_attr_count_real(loc->file, oh, &oinfo->num_attrs) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve attribute count") /* Get B-tree & heap metadata storage size, if requested */ if(want_ih_info) { /* Check for 'bh_info' callback for this type of object */ - if(obj_class->bh_info) { + if(obj_class->bh_info) /* Call the object's class 'bh_info' routine */ - if((obj_class->bh_info)(loc, dxpl_id, oh, &oinfo->meta_size.obj) < 0) + if((obj_class->bh_info)(loc, oh, &oinfo->meta_size.obj) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object's btree & heap info") - } /* end if */ /* Get B-tree & heap info for any attributes */ - if(oinfo->num_attrs > 0) { - if(H5O_attr_bh_info(loc->file, dxpl_id, oh, &oinfo->meta_size.attr) < 0) + if(oinfo->num_attrs > 0) + if(H5O__attr_bh_info(loc->file, oh, &oinfo->meta_size.attr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve attribute btree & heap info") - } /* end if */ } /* end if */ done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_get_info() */ /*------------------------------------------------------------------------- + * Function: H5O__get_info_by_name + * + * Purpose: Internal routine to retrieve an object's info + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__get_info_by_name(const H5G_loc_t *loc, const char *name, H5O_info_t *oinfo) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + HDassert(oinfo); + + /* Retrieve the object's information */ + if(H5G_loc_info(loc, name, TRUE, oinfo/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__get_info_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__get_info_by_idx + * + * Purpose: Internal routine to retrieve an object's info according to + * an index within a group. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(group_name && *group_name); + HDassert(oinfo); + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location, according to the order in the index */ + if(H5G_loc_find_by_idx(loc, group_name, idx_type, order, n, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Retrieve the object's information */ + if(H5O_get_info(obj_loc.oloc, TRUE, oinfo) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info") + +done: + /* Release the object location */ + if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__get_info_by_idx() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__set_comment_by_name + * + * Purpose: Internal routine to set an object's "comment" + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__set_comment_by_name(const H5G_loc_t *loc, const char *name, + const char *comment) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* (Re)set the object's comment */ + if(H5G_loc_set_comment(loc, name, comment) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__set_comment_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__get_comment_by_name + * + * Purpose: Internal routine to retrieve an object's "comment" + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +ssize_t +H5O__get_comment_by_name(const H5G_loc_t *loc, const char *name, + char *comment, size_t bufsize) +{ + ssize_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Retrieve the object's comment */ + if((ret_value = H5G_loc_get_comment(loc, name, comment/*out*/, bufsize)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__get_comment_by_name() */ + + +/*------------------------------------------------------------------------- * Function: H5O_get_create_plist * * Purpose: Retrieve the object creation properties for an object @@ -2047,7 +2457,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, H5P_genplist_t *oc_plist) +H5O_get_create_plist(const H5O_loc_t *loc, H5P_genplist_t *oc_plist) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2059,7 +2469,7 @@ H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, H5P_genplist_t *oc_pli HDassert(oc_plist); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Set property values, if they were used for the object */ @@ -2081,7 +2491,7 @@ H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, H5P_genplist_t *oc_pli } /* end if */ done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -2102,7 +2512,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks) +H5O_get_nlinks(const H5O_loc_t *loc, hsize_t *nlinks) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2114,14 +2524,14 @@ H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks) HDassert(nlinks); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve the # of link messages seen when the object header was loaded */ *nlinks = oh->link_msgs_seen; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -2142,8 +2552,7 @@ done: *------------------------------------------------------------------------- */ void * -H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc, - hid_t dxpl_id) +H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc) { size_t u; /* Local index variable */ void *ret_value = NULL; /* Return value */ @@ -2162,7 +2571,7 @@ H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc if(H5O_obj_class_g[u]->type == obj_type) { /* Call the object class's 'create' routine */ HDassert(H5O_obj_class_g[u]->create); - if(NULL == (ret_value = H5O_obj_class_g[u]->create(f, crt_info, obj_loc, dxpl_id))) + if(NULL == (ret_value = H5O_obj_class_g[u]->create(f, crt_info, obj_loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object") /* Break out of loop */ @@ -2220,7 +2629,7 @@ H5O_get_oh_addr(const H5O_t *oh) *------------------------------------------------------------------------- */ herr_t -H5O_get_rc_and_type(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc, H5O_type_t *otype) +H5O_get_rc_and_type(const H5O_loc_t *loc, unsigned *rc, H5O_type_t *otype) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2231,7 +2640,7 @@ H5O_get_rc_and_type(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc, H5O_type_ HDassert(loc); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Set the object's reference count */ @@ -2240,11 +2649,11 @@ H5O_get_rc_and_type(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc, H5O_type_ /* Retrieve the type of the object */ if(otype) - if(H5O_obj_type_real(oh, otype) < 0) + if(H5O__obj_type_real(oh, otype) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -2252,7 +2661,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_free_visit_visited + * Function: H5O__free_visit_visited * * Purpose: Free the key for an object visited during a group traversal * @@ -2264,18 +2673,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) +H5O__free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR item = H5FL_FREE(H5_obj_t, item); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_free_visit_visited() */ +} /* end H5O__free_visit_visited() */ /*------------------------------------------------------------------------- - * Function: H5O_visit_cb + * Function: H5O__visit_cb * * Purpose: Callback function for recursively visiting objects from a group * @@ -2288,7 +2697,7 @@ H5O_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *------------------------------------------------------------------------- */ static herr_t -H5O_visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *linfo, +H5O__visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *linfo, void *_udata) { H5O_iter_visit_ud_t *udata = (H5O_iter_visit_ud_t *)_udata; /* User data for callback */ @@ -2298,7 +2707,7 @@ H5O_visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *lin hbool_t obj_found = FALSE; /* Object at 'name' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(name); @@ -2316,7 +2725,7 @@ H5O_visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *lin /* Find the object using the LAPL passed in */ /* (Correctly handles mounted files) */ - if(H5G_loc_find(udata->start_loc, name, &obj_loc/*out*/, udata->lapl_id, udata->dxpl_id) < 0) + if(H5G_loc_find(udata->start_loc, name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") obj_found = TRUE; @@ -2329,7 +2738,7 @@ H5O_visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *lin H5O_info_t oinfo; /* Object info */ /* Get the object's info */ - if(H5O_get_info(&obj_oloc, udata->dxpl_id, TRUE, &oinfo) < 0) + if(H5O_get_info(&obj_oloc, TRUE, &oinfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get object info") /* Make the application callback */ @@ -2363,11 +2772,11 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_visit_cb() */ +} /* end H5O__visit_cb() */ /*------------------------------------------------------------------------- - * Function: H5O_visit + * Function: H5O__visit * * Purpose: Recursively visit an object and all the objects reachable * from it. If the starting object is a group, all the objects @@ -2399,9 +2808,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, - H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id) +H5O__visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, + H5_iter_order_t order, H5O_iterate_t op, void *op_data) { H5O_iter_visit_ud_t udata; /* User data for callback */ H5G_loc_t loc; /* Location of reference object */ @@ -2413,7 +2821,7 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, hid_t obj_id = (-1); /* ID of object */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE_VOL /* Portably initialize user data struct to zeros */ HDmemset(&udata, 0, sizeof(udata)); @@ -2428,17 +2836,17 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5G_loc_reset(&obj_loc); /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) + if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") loc_found = TRUE; /* Get the object's info */ - if(H5O_get_info(&obj_oloc, dxpl_id, TRUE, &oinfo) < 0) + if(H5O_get_info(&obj_oloc, TRUE, &oinfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info") /* Open the object */ /* (Takes ownership of the obj_loc information) */ - if((obj_id = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, TRUE)) < 0) + if((obj_id = H5O__open_by_loc(&obj_loc, TRUE)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") /* Make callback for starting object */ @@ -2460,8 +2868,6 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, /* Set up user data for visiting links */ udata.obj_id = obj_id; udata.start_loc = &start_loc; - udata.lapl_id = lapl_id; - udata.dxpl_id = dxpl_id; udata.op = op; udata.op_data = op_data; @@ -2488,7 +2894,7 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, } /* end if */ /* Call internal group visitation routine */ - if((ret_value = H5G_visit(obj_id, ".", idx_type, order, H5O_visit_cb, &udata, lapl_id, dxpl_id)) < 0) + if((ret_value = H5G_visit(obj_id, ".", idx_type, order, H5O__visit_cb, &udata)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") } /* end if */ @@ -2500,14 +2906,14 @@ done: else if(loc_found && H5G_loc_free(&obj_loc) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") if(udata.visited) - H5SL_destroy(udata.visited, H5O_free_visit_visited, NULL); + H5SL_destroy(udata.visited, H5O__free_visit_visited, NULL); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_visit() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__visit() */ /*------------------------------------------------------------------------- - * Function: H5O_inc_rc + * Function: H5O__inc_rc * * Purpose: Increments the reference count on an object header * @@ -2520,11 +2926,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_inc_rc(H5O_t *oh) +H5O__inc_rc(H5O_t *oh) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(oh); @@ -2539,11 +2945,11 @@ H5O_inc_rc(H5O_t *oh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_inc_rc() */ +} /* end H5O__inc_rc() */ /*------------------------------------------------------------------------- - * Function: H5O_dec_rc + * Function: H5O__dec_rc * * Purpose: Decrements the reference count on an object header * @@ -2556,11 +2962,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_dec_rc(H5O_t *oh) +H5O__dec_rc(H5O_t *oh) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(oh); @@ -2575,7 +2981,7 @@ H5O_dec_rc(H5O_t *oh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dec_rc() */ +} /* end H5O__dec_rc() */ /*------------------------------------------------------------------------- @@ -2593,7 +2999,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id) +H5O_dec_rc_by_loc(const H5O_loc_t *loc) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2604,17 +3010,17 @@ H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id) HDassert(loc); /* Get header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Decrement the reference count on the object header */ /* (which will unpin it, if appropriate) */ - if(H5O_dec_rc(oh) < 0) + if(H5O__dec_rc(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement reference count on object header") done: /* Release the object header from the cache */ - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -2690,7 +3096,7 @@ H5O__free(H5O_t *oh) HDassert(oh->mesg[u].dirty == 0); #endif /* NDEBUG */ - H5O_msg_free_mesg(&oh->mesg[u]); + H5O__msg_free_mesg(&oh->mesg[u]); } /* end for */ /* Make sure we accounted for all the messages dirtied by decoding */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 838a80f..e854884 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -33,25 +33,21 @@ /* Local macros */ -/* Version # of encoded virtual dataset global heap blocks */ -#define H5O_LAYOUT_VDS_GH_ENC_VERS 0 - /* PRIVATE PROTOTYPES */ -static void *H5O__layout_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__layout_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O__layout_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O__layout_copy(const void *_mesg, void *_dest); static size_t H5O__layout_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__layout_reset(void *_mesg); static herr_t H5O__layout_free(void *_mesg); -static herr_t H5O__layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - void *_mesg); +static herr_t H5O__layout_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); static void *H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O__layout_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__layout_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_LAYOUT[1] = {{ @@ -98,7 +94,7 @@ H5FL_DEFINE(H5O_layout_t); *------------------------------------------------------------------------- */ static void * -H5O__layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_layout_t *mesg = NULL; @@ -395,7 +391,7 @@ H5O__layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED size_t i; /* Read heap */ - if(NULL == (heap_block = (uint8_t *)H5HG_read(f, dxpl_id, &(mesg->storage.u.virt.serial_list_hobjid), NULL, &block_size))) + if(NULL == (heap_block = (uint8_t *)H5HG_read(f, &(mesg->storage.u.virt.serial_list_hobjid), NULL, &block_size))) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "Unable to read global heap block") heap_block_p = (const uint8_t *)heap_block; @@ -550,8 +546,6 @@ static herr_t H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; - uint8_t *heap_block = NULL; - size_t *str_size = NULL; unsigned u; herr_t ret_value = SUCCEED; /* Return value */ @@ -676,106 +670,9 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, break; case H5D_VIRTUAL: - /* Create heap block if it has not been created yet */ - /* Note that we assume here that the contents of the heap block - * cannot change! If this ever stops being the case we must change - * this code to allow overwrites of the heap block. -NAF */ - if((mesg->storage.u.virt.serial_list_hobjid.addr == HADDR_UNDEF) - && (mesg->storage.u.virt.list_nused > 0)) { - uint8_t *heap_block_p; - size_t block_size; - hssize_t select_serial_size; - hsize_t tmp_hsize; - uint32_t chksum; - size_t i; - - /* Allocate array for caching results of strlen */ - if(NULL == (str_size = (size_t *)H5MM_malloc(2 * mesg->storage.u.virt.list_nused *sizeof(size_t)))) - HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, FAIL, "unable to allocate string length array") - - /* - * Calculate heap block size - */ - /* Version and number of entries */ - block_size = (size_t)1 + H5F_SIZEOF_SIZE(f); - - /* Calculate size of each entry */ - for(i = 0; i < mesg->storage.u.virt.list_nused; i++) { - HDassert(mesg->storage.u.virt.list[i].source_file_name); - HDassert(mesg->storage.u.virt.list[i].source_dset_name); - HDassert(mesg->storage.u.virt.list[i].source_select); - HDassert(mesg->storage.u.virt.list[i].source_dset.virtual_select); - - /* Source file name */ - str_size[2 * i] = HDstrlen(mesg->storage.u.virt.list[i].source_file_name) + (size_t)1; - block_size += str_size[2 * i]; - - /* Source dset name */ - str_size[(2 * i) + 1] = HDstrlen(mesg->storage.u.virt.list[i].source_dset_name) + (size_t)1; - block_size += str_size[(2 * i) + 1]; - - /* Source selection */ - if((select_serial_size = H5S_SELECT_SERIAL_SIZE(mesg->storage.u.virt.list[i].source_select)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") - block_size += (size_t)select_serial_size; - - /* Virtual dataset selection */ - if((select_serial_size = H5S_SELECT_SERIAL_SIZE(mesg->storage.u.virt.list[i].source_dset.virtual_select)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") - block_size += (size_t)select_serial_size; - } /* end for */ - - /* Checksum */ - block_size += 4; - - /* Allocate heap block */ - if(NULL == (heap_block = (uint8_t *)H5MM_malloc(block_size))) - HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, FAIL, "unable to allocate heap block") - - /* - * Encode heap block - */ - heap_block_p = heap_block; - - /* Encode heap block encoding version */ - *heap_block_p++ = (uint8_t)H5O_LAYOUT_VDS_GH_ENC_VERS; - - /* Number of entries */ - tmp_hsize = (hsize_t)mesg->storage.u.virt.list_nused; - H5F_ENCODE_LENGTH(f, heap_block_p, tmp_hsize) - - /* Encode each entry */ - for(i = 0; i < mesg->storage.u.virt.list_nused; i++) { - /* Source file name */ - (void)HDmemcpy((char *)heap_block_p, mesg->storage.u.virt.list[i].source_file_name, str_size[2 * i]); - heap_block_p += str_size[2 * i]; - - /* Source dataset name */ - (void)HDmemcpy((char *)heap_block_p, mesg->storage.u.virt.list[i].source_dset_name, str_size[(2 * i) + 1]); - heap_block_p += str_size[(2 * i) + 1]; - - /* Source selection */ - if(H5S_SELECT_SERIALIZE(mesg->storage.u.virt.list[i].source_select, &heap_block_p) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize source selection") - - /* Virtual selection */ - if(H5S_SELECT_SERIALIZE(mesg->storage.u.virt.list[i].source_dset.virtual_select, &heap_block_p) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize virtual selection") - } /* end for */ - - /* Checksum */ - chksum = H5_checksum_metadata(heap_block, block_size - (size_t)4, 0); - UINT32ENCODE(heap_block_p, chksum) - - /* Insert block into global heap */ - if(H5HG_insert(f, H5AC_ind_read_dxpl_id, block_size, heap_block, &((H5O_layout_t *)mesg)->storage.u.virt.serial_list_hobjid) < 0) /* Casting away const OK --NAF */ - HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to insert virtual dataset heap block") - } /* end if */ - - /* Heap information */ + /* Encode heap ID for VDS info */ H5F_addr_encode(f, &p, mesg->storage.u.virt.serial_list_hobjid.addr); UINT32ENCODE(p, mesg->storage.u.virt.serial_list_hobjid.idx); - break; case H5D_LAYOUT_ERROR: @@ -785,9 +682,6 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, } /* end switch */ done: - heap_block = (uint8_t *)H5MM_xfree(heap_block); - str_size = (size_t *)H5MM_xfree(str_size); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__layout_encode() */ @@ -997,7 +891,7 @@ H5O__layout_free(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O__layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O__layout_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_layout_t *mesg = (H5O_layout_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -1017,19 +911,19 @@ H5O__layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) case H5D_CONTIGUOUS: /* Contiguous block on disk */ /* Free the file space for the raw data */ - if(H5D__contig_delete(f, dxpl_id, &mesg->storage) < 0) + if(H5D__contig_delete(f, &mesg->storage) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; case H5D_CHUNKED: /* Chunked blocks on disk */ /* Free the file space for the index & chunk raw data */ - if(H5D__chunk_delete(f, dxpl_id, open_oh, &mesg->storage) < 0) + if(H5D__chunk_delete(f, open_oh, &mesg->storage) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; case H5D_VIRTUAL: /* Virtual dataset */ /* Free the file space virtual dataset */ - if(H5D__virtual_delete(f, dxpl_id, &mesg->storage) < 0) + if(H5D__virtual_delete(f, &mesg->storage) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; @@ -1061,7 +955,7 @@ done: static void * H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id) + H5O_copy_t *cpy_info, void *_udata) { H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ H5O_layout_t *layout_src = (H5O_layout_t *) mesg_src; @@ -1085,7 +979,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, case H5D_COMPACT: if(layout_src->storage.u.compact.buf) { /* copy compact raw data */ - if(H5D__compact_copy(file_src, &layout_src->storage.u.compact, file_dst, &layout_dst->storage.u.compact, udata->src_dtype, cpy_info, dxpl_id) < 0) + if(H5D__compact_copy(file_src, &layout_src->storage.u.compact, file_dst, &layout_dst->storage.u.compact, udata->src_dtype, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage") copied = TRUE; } /* end if */ @@ -1102,7 +996,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, if(H5D__contig_is_space_alloc(&layout_src->storage)) { /* copy contiguous raw data */ - if(H5D__contig_copy(file_src, &layout_src->storage.u.contig, file_dst, &layout_dst->storage.u.contig, udata->src_dtype, cpy_info, dxpl_id) < 0) + if(H5D__contig_copy(file_src, &layout_src->storage.u.contig, file_dst, &layout_dst->storage.u.contig, udata->src_dtype, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy contiguous storage") copied = TRUE; } /* end if */ @@ -1111,7 +1005,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, case H5D_CHUNKED: if(H5D__chunk_is_space_alloc(&layout_src->storage)) { /* Create chunked layout */ - if(H5D__chunk_copy(file_src, &layout_src->storage.u.chunk, &layout_src->u.chunk, file_dst, &layout_dst->storage.u.chunk, udata->src_space_extent, udata->src_dtype, udata->common.src_pline, cpy_info, dxpl_id) < 0) + if(H5D__chunk_copy(file_src, &layout_src->storage.u.chunk, &layout_src->u.chunk, file_dst, &layout_dst->storage.u.chunk, udata->src_space_extent, udata->src_dtype, udata->common.src_pline, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage") copied = TRUE; } /* end if */ @@ -1120,7 +1014,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, case H5D_VIRTUAL: /* Copy virtual layout. Always copy so the memory fields get copied * properly. */ - if(H5D__virtual_copy(file_dst, layout_dst, dxpl_id) < 0) + if(H5D__virtual_copy(file_dst, layout_dst) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy virtual storage") break; @@ -1159,8 +1053,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__layout_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth) +H5O__layout_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; size_t u; diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index cac4ed1..342e8ba 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -36,22 +36,21 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_linfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__linfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_linfo_copy(const void *_mesg, void *_dest); static size_t H5O_linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_linfo_free(void *_mesg); -static herr_t H5O_linfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - void *_mesg); -static void *H5O_linfo_copy_file(H5F_t *file_src, void *native_src, - H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_linfo_post_copy_file(const H5O_loc_t *parent_src_oloc, - const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, - unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); -static herr_t H5O_linfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__linfo_free(void *_mesg); +static herr_t H5O__linfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); +static void *H5O__linfo_copy_file(H5F_t *file_src, void *native_src, + H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__linfo_post_copy_file(const H5O_loc_t *parent_src_oloc, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, + unsigned *mesg_flags, H5O_copy_t *cpy_info); +static herr_t H5O__linfo_debug(H5F_t *f, const void *_mesg, + FILE * stream, int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_LINFO[1] = {{ @@ -59,22 +58,22 @@ const H5O_msg_class_t H5O_MSG_LINFO[1] = {{ "linfo", /*message name for debugging */ sizeof(H5O_linfo_t), /*native message size */ 0, /* messages are sharable? */ - H5O_linfo_decode, /*decode message */ + H5O__linfo_decode, /*decode message */ H5O_linfo_encode, /*encode message */ H5O_linfo_copy, /*copy the native value */ H5O_linfo_size, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_linfo_free, /* free method */ - H5O_linfo_delete, /* file delete method */ + H5O__linfo_free, /* free method */ + H5O__linfo_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ - H5O_linfo_copy_file, /* copy native value to file */ - H5O_linfo_post_copy_file, /* post copy native value to file */ + H5O__linfo_copy_file, /* copy native value to file */ + H5O__linfo_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_linfo_debug /*debug the message */ + H5O__linfo_debug /*debug the message */ }}; /* Current version of link info information */ @@ -90,7 +89,6 @@ typedef struct { const H5O_loc_t *src_oloc; /* Source object location */ H5O_loc_t *dst_oloc; /* Destination object location */ H5O_linfo_t *dst_linfo; /* Destination object's link info message */ - hid_t dxpl_id; /* DXPL for operation */ H5O_copy_t *cpy_info; /* Information for copy operation */ } H5O_linfo_postcopy_ud_t; @@ -99,7 +97,7 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); /*------------------------------------------------------------------------- - * Function: H5O_linfo_decode + * Function: H5O__linfo_decode * * Purpose: Decode a message and return a pointer to a newly allocated one. * @@ -113,14 +111,14 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); *------------------------------------------------------------------------- */ static void * -H5O_linfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__linfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_linfo_t *linfo = NULL; /* Link info */ unsigned char index_flags; /* Flags for encoding link index info */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -132,7 +130,7 @@ H5O_linfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *o /* Allocate space for message */ if(NULL == (linfo = H5FL_MALLOC(H5O_linfo_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Get the index flags for the group */ index_flags = *p++; @@ -171,7 +169,7 @@ done: linfo = H5FL_FREE(H5O_linfo_t, linfo); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_linfo_decode() */ +} /* end H5O__linfo_decode() */ /*------------------------------------------------------------------------- @@ -255,7 +253,7 @@ H5O_linfo_copy(const void *_mesg, void *_dest) /* check args */ HDassert(linfo); if(!dest && NULL == (dest = H5FL_MALLOC(H5O_linfo_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* copy */ *dest = *linfo; @@ -305,9 +303,9 @@ H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void /*------------------------------------------------------------------------- - * Function: H5O_linfo_free + * Function: H5O__linfo_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -317,20 +315,20 @@ H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_free(void *mesg) +H5O__linfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_linfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_linfo_free() */ +} /* end H5O__linfo_free() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_delete + * Function: H5O__linfo_delete * * Purpose: Free file space referenced by message * @@ -342,12 +340,12 @@ H5O_linfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) +H5O__linfo_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) { H5O_linfo_t *linfo = (H5O_linfo_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -355,16 +353,16 @@ H5O_linfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_ /* If the group is using "dense" link storage, delete it */ if(H5F_addr_defined(linfo->fheap_addr)) - if(H5G__dense_delete(f, dxpl_id, linfo, TRUE) < 0) + if(H5G__dense_delete(f, linfo, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free dense link storage") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_linfo_delete() */ +} /* end H5O__linfo_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_copy_file + * Function: H5O__linfo_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -378,16 +376,16 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *file_dst, +H5O__linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id) + H5O_copy_t *cpy_info, void *_udata) { H5O_linfo_t *linfo_src = (H5O_linfo_t *) native_src; H5O_linfo_t *linfo_dst = NULL; H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *) _udata; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__COPIED_TAG, NULL) + FUNC_ENTER_STATIC_TAG(H5AC__COPIED_TAG) /* check args */ HDassert(linfo_src); @@ -415,7 +413,7 @@ H5O_linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *fil */ if(H5F_addr_defined(linfo_src->fheap_addr)) { /* Create the dense link storage */ - if(H5G__dense_create(file_dst, dxpl_id, linfo_dst, udata->common.src_pline) < 0) + if(H5G__dense_create(file_dst, linfo_dst, udata->common.src_pline) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create 'dense' form of new format group") } /* end if */ } /* end else */ @@ -428,12 +426,12 @@ done: if(linfo_dst) linfo_dst = H5FL_FREE(H5O_linfo_t, linfo_dst); - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* H5O_linfo_copy_file() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* H5O__linfo_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_post_copy_file_cb + * Function: H5O__linfo_post_copy_file_cb * * Purpose: Callback routine for copying links from src to dst file * during "post copy" routine @@ -448,35 +446,34 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_post_copy_file_cb(const H5O_link_t *src_lnk, void *_udata) +H5O__linfo_post_copy_file_cb(const H5O_link_t *src_lnk, void *_udata) { H5O_linfo_postcopy_ud_t *udata = (H5O_linfo_postcopy_ud_t *)_udata; /* 'User data' passed in */ H5O_link_t dst_lnk; /* Destination link to insert */ hbool_t dst_lnk_init = FALSE; /* Whether the destination link is initialized */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(src_lnk); HDassert(udata); /* Copy the link (and the object it points to) */ - if(H5L_link_copy_file(udata->dst_oloc->file, udata->dxpl_id, src_lnk, - udata->src_oloc, &dst_lnk, udata->cpy_info) < 0) + if(H5L__link_copy_file(udata->dst_oloc->file, src_lnk, udata->src_oloc, &dst_lnk, udata->cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy link") dst_lnk_init = TRUE; - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(udata->dxpl_id, H5AC__COPIED_TAG, FAIL); + /* Set metadata tag in API context */ + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Insert the new object in the destination file's group */ /* (Doesn't increment the link count - that's already been taken care of for hard links) */ - if(H5G__dense_insert(udata->dst_oloc->file, udata->dxpl_id, udata->dst_linfo, &dst_lnk) < 0) + if(H5G__dense_insert(udata->dst_oloc->file, udata->dst_linfo, &dst_lnk) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert destination link") - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG done: /* Check if the destination link has been initialized */ @@ -484,11 +481,11 @@ done: H5O_msg_reset(H5O_LINK_ID, &dst_lnk); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_linfo_post_copy_file_cb() */ +} /* end H5O__linfo_post_copy_file_cb() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_post_copy_file + * Function: H5O__linfo_post_copy_file * * Purpose: Finish copying a message from between files * @@ -500,15 +497,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, +H5O__linfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, - hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_copy_t *cpy_info) { const H5O_linfo_t *linfo_src = (const H5O_linfo_t *)mesg_src; H5O_linfo_t *linfo_dst = (H5O_linfo_t *)mesg_dst; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(src_oloc && src_oloc->file); @@ -530,21 +527,20 @@ H5O_linfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, udata.src_oloc = src_oloc; udata.dst_oloc = dst_oloc; udata.dst_linfo = linfo_dst; - udata.dxpl_id = dxpl_id; udata.cpy_info = cpy_info; /* Iterate over the links in the group, building a table of the link messages */ - if(H5G__dense_iterate(src_oloc->file, dxpl_id, linfo_src, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5O_linfo_post_copy_file_cb, &udata) < 0) + if(H5G__dense_iterate(src_oloc->file, linfo_src, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5O__linfo_post_copy_file_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_linfo_post_copy_file() */ +} /* H5O__linfo_post_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_debug + * Function: H5O__linfo_debug * * Purpose: Prints debugging info for a message. * @@ -557,12 +553,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__linfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_linfo_t *linfo = (const H5O_linfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -588,5 +584,5 @@ H5O_linfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_linfo_debug() */ +} /* end H5O__linfo_debug() */ diff --git a/src/H5Olink.c b/src/H5Olink.c index 77872ad..12dbe30 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -38,23 +38,23 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_link_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__link_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_link_copy(const void *_mesg, void *_dest); static size_t H5O_link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_link_reset(void *_mesg); -static herr_t H5O_link_free(void *_mesg); +static herr_t H5O__link_reset(void *_mesg); +static herr_t H5O__link_free(void *_mesg); static herr_t H5O_link_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); -static void *H5O_link_copy_file(H5F_t *file_src, void *native_src, +static void *H5O__link_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_link_post_copy_file(const H5O_loc_t *src_oloc, + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, - unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); -static herr_t H5O_link_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); + unsigned *mesg_flags, H5O_copy_t *cpy_info); +static herr_t H5O__link_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_LINK[1] = {{ @@ -62,22 +62,22 @@ const H5O_msg_class_t H5O_MSG_LINK[1] = {{ "link", /*message name for debugging */ sizeof(H5O_link_t), /*native message size */ 0, /* messages are sharable? */ - H5O_link_decode, /*decode message */ + H5O__link_decode, /*decode message */ H5O_link_encode, /*encode message */ H5O_link_copy, /*copy the native value */ H5O_link_size, /*size of symbol table entry */ - H5O_link_reset, /* reset method */ - H5O_link_free, /* free method */ + H5O__link_reset, /* reset method */ + H5O__link_free, /* free method */ H5O_link_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ H5O_link_pre_copy_file, /* pre copy native value to file */ - H5O_link_copy_file, /* copy native value to file */ - H5O_link_post_copy_file, /* post copy native value to file */ + H5O__link_copy_file, /* copy native value to file */ + H5O__link_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_link_debug /*debug the message */ + H5O__link_debug /*debug the message */ }}; /* Current version of link information */ @@ -101,7 +101,7 @@ H5FL_DEFINE_STATIC(H5O_link_t); /*------------------------------------------------------------------------- - * Function: H5O_link_decode + * Function: H5O__link_decode * * Purpose: Decode a message and return a pointer to * a newly allocated one. @@ -117,7 +117,7 @@ H5FL_DEFINE_STATIC(H5O_link_t); *------------------------------------------------------------------------- */ static void * -H5O_link_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__link_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_link_t *lnk = NULL; /* Pointer to link message */ @@ -125,7 +125,7 @@ H5O_link_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *op unsigned char link_flags; /* Flags for encoding link info */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -262,7 +262,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_link_decode() */ +} /* end H5O__link_decode() */ /*------------------------------------------------------------------------- @@ -534,7 +534,7 @@ H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void /*------------------------------------------------------------------------- - * Function: H5O_link_reset + * Function: H5O__link_reset * * Purpose: Frees resources within a message, but doesn't free * the message itself. @@ -547,11 +547,11 @@ H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *------------------------------------------------------------------------- */ static herr_t -H5O_link_reset(void *_mesg) +H5O__link_reset(void *_mesg) { H5O_link_t *lnk = (H5O_link_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(lnk) { /* Free information for link (but don't free link pointer) */ @@ -565,13 +565,13 @@ H5O_link_reset(void *_mesg) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_link_reset() */ +} /* end H5O__link_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_link_free + * Function: H5O__link_free * - * Purpose: Free's the message contents and the message itself + * Purpose: Frees the message contents and the message itself * * Return: Non-negative on success/Negative on failure * @@ -581,20 +581,18 @@ H5O_link_reset(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_link_free(void *_mesg) +H5O__link_free(void *_mesg) { H5O_link_t *lnk = (H5O_link_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(lnk); - /* Free information for link */ - H5O_link_reset(lnk); lnk = H5FL_FREE(H5O_link_t, lnk); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_link_free() */ +} /* end H5O__link_free() */ /*------------------------------------------------------------------------- @@ -610,7 +608,7 @@ H5O_link_free(void *_mesg) *------------------------------------------------------------------------- */ herr_t -H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) +H5O_link_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) { H5O_link_t *lnk = (H5O_link_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -633,7 +631,7 @@ H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_m oloc.addr = lnk->u.hard.addr; /* Decrement the ref count for the object */ - if(H5O_link(&oloc, -1, dxpl_id) < 0) + if(H5O_link(&oloc, -1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to decrement object link count") } /* end if */ /* Perform the "delete" callback when a user-defined link is removed */ @@ -707,7 +705,7 @@ H5O_link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED /*------------------------------------------------------------------------- - * Function: H5O_link_copy_file + * Function: H5O__link_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -721,14 +719,14 @@ H5O_link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *------------------------------------------------------------------------- */ static void * -H5O_link_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t H5_ATTR_UNUSED *file_dst, +H5O__link_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t H5_ATTR_UNUSED *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata, hid_t H5_ATTR_UNUSED dxpl_id) + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { H5O_link_t *link_src = (H5O_link_t *)native_src; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(link_src); @@ -746,11 +744,11 @@ H5O_link_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t H5_AT done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_link_copy_file() */ +} /* H5O__link_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_link_post_copy_file + * Function: H5O__link_post_copy_file * * Purpose: Finish copying a message from between files * @@ -762,15 +760,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, +H5O__link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, - hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_copy_t *cpy_info) { const H5O_link_t *link_src = (const H5O_link_t *)mesg_src; H5O_link_t *link_dst = (H5O_link_t *)mesg_dst; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(link_src); @@ -782,17 +780,16 @@ H5O_link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, HDassert(cpy_info->max_depth < 0 || cpy_info->curr_depth < cpy_info->max_depth); /* Copy the link (and the object it points to) */ - if(H5L_link_copy_file(dst_oloc->file, dxpl_id, link_src, src_oloc, link_dst, - cpy_info) < 0) + if(H5L__link_copy_file(dst_oloc->file, link_src, src_oloc, link_dst, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy link") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_link_post_copy_file() */ +} /* H5O__link_post_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_link_debug + * Function: H5O__link_debug * * Purpose: Prints debugging info for a message. * @@ -805,8 +802,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_link_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_link_t *lnk = (const H5O_link_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -873,5 +870,5 @@ H5O_link_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_link_debug() */ +} /* end H5O__link_debug() */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 158701b..0ae2eac 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -54,7 +54,6 @@ /* User data for iteration while removing a message */ typedef struct { H5F_t *f; /* Pointer to file for insertion */ - hid_t dxpl_id; /* DXPL during iteration */ int sequence; /* Sequence # to search for */ unsigned nfailed; /* # of failed message removals */ H5O_operator_t op; /* Callback routine for removal operations */ @@ -75,7 +74,7 @@ typedef struct { static herr_t H5O__msg_reset_real(const H5O_msg_class_t *type, void *native); static herr_t H5O__msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned *oh_modified, void *_udata/*in,out*/); -static herr_t H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, +static herr_t H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, const H5O_msg_class_t *type, const void *mesg, unsigned mesg_flags, unsigned update_flags); @@ -113,7 +112,7 @@ static herr_t H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, */ herr_t H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, - unsigned update_flags, void *mesg, hid_t dxpl_id) + unsigned update_flags, void *mesg) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -127,11 +126,11 @@ H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, HDassert(mesg); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Go append message to object header */ - if(H5O_msg_append_oh(loc->file, dxpl_id, oh, type_id, mesg_flags, update_flags, mesg) < 0) + if(H5O_msg_append_oh(loc->file, oh, type_id, mesg_flags, update_flags, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to append to object header") done: @@ -160,7 +159,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_append_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, +H5O_msg_append_oh(H5F_t *f, H5O_t *oh, unsigned type_id, unsigned mesg_flags, unsigned update_flags, void *mesg) { const H5O_msg_class_t *type; /* Original H5O class type for the ID */ @@ -179,7 +178,7 @@ H5O_msg_append_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, HDassert(mesg); /* Append new message to object header */ - if(H5O_msg_append_real(f, dxpl_id, oh, type, mesg_flags, update_flags, mesg) < 0) + if(H5O__msg_append_real(f, oh, type, mesg_flags, update_flags, mesg) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new message in header") done: @@ -188,7 +187,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_msg_append_real + * Function: H5O__msg_append_real * * Purpose: Append a new message to an object header. * @@ -203,13 +202,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, +H5O__msg_append_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, void *mesg) { size_t idx; /* Index of message to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -219,11 +218,11 @@ H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *t HDassert(mesg); /* Allocate space for a new message */ - if(H5O_msg_alloc(f, dxpl_id, oh, type, &mesg_flags, mesg, &idx) < 0) + if(H5O__msg_alloc(f, oh, type, &mesg_flags, mesg, &idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "unable to create new message") /* Copy the information for the message */ - if(H5O__copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags) < 0) + if(H5O__copy_mesg(f, oh, idx, type, mesg, mesg_flags, update_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to write message") #ifdef H5O_DEBUG H5O_assert(oh); @@ -231,7 +230,7 @@ H5O_assert(oh); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_append_real() */ +} /* end H5O__msg_append_real() */ /*------------------------------------------------------------------------- @@ -256,7 +255,7 @@ done: */ herr_t H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, - unsigned update_flags, void *mesg, hid_t dxpl_id) + unsigned update_flags, void *mesg) { H5O_t *oh = NULL; /* Object header to use */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -276,11 +275,11 @@ H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Call the "real" modify routine */ - if(H5O_msg_write_real(loc->file, dxpl_id, oh, type, mesg_flags, update_flags, mesg) < 0) + if(H5O__msg_write_real(loc->file, oh, type, mesg_flags, update_flags, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header message") done: @@ -311,13 +310,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_write_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, - unsigned mesg_flags, unsigned update_flags, void *mesg) +H5O_msg_write_oh(H5F_t *f, H5O_t *oh, unsigned type_id, unsigned mesg_flags, + unsigned update_flags, void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_TAG(oh->cache_info.addr, FAIL) /* check args */ HDassert(f); @@ -330,16 +329,16 @@ H5O_msg_write_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); /* Call the "real" modify routine */ - if(H5O_msg_write_real(f, dxpl_id, oh, type, mesg_flags, update_flags, mesg) < 0) + if(H5O__msg_write_real(f, oh, type, mesg_flags, update_flags, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header message") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_msg_write_oh() */ /*------------------------------------------------------------------------- - * Function: H5O_msg_write_real + * Function: H5O__msg_write_real * * Purpose: Modifies an existing message or creates a new message. * @@ -359,14 +358,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, +H5O__msg_write_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, void *mesg) { H5O_mesg_t *idx_msg; /* Pointer to message to modify */ size_t idx; /* Index of message to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -408,7 +407,7 @@ H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *ty * the location of the object changes (from in another object's * header to the SOHM heap), so just delete it first -QAK) */ - if(H5SM_delete(f, dxpl_id, oh, (H5O_shared_t *)idx_msg->native) < 0) + if(H5SM_delete(f, oh, (H5O_shared_t *)idx_msg->native) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete message from SOHM index") /* If we're replacing a shared message, the new message must be shared @@ -418,14 +417,14 @@ H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *ty * XXX: This doesn't handle freeing extra space in object header from * a message shrinking. */ - if((status = H5SM_try_share(f, dxpl_id, ((mesg_flags & H5O_MSG_FLAG_SHARED) ? NULL : oh), 0, idx_msg->type->id, mesg, &mesg_flags)) < 0) + if((status = H5SM_try_share(f, ((mesg_flags & H5O_MSG_FLAG_SHARED) ? NULL : oh), 0, idx_msg->type->id, mesg, &mesg_flags)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "error while trying to share message") if(status == FALSE && (mesg_flags & H5O_MSG_FLAG_SHARED)) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "message changed sharing status") } /* end if */ /* Copy the information for the message */ - if(H5O__copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags) < 0) + if(H5O__copy_mesg(f, oh, idx, type, mesg, mesg_flags, update_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to write message") #ifdef H5O_DEBUG H5O_assert(oh); @@ -433,7 +432,7 @@ H5O_assert(oh); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_write_real() */ +} /* end H5O__msg_write_real() */ /*------------------------------------------------------------------------- @@ -460,13 +459,12 @@ done: *------------------------------------------------------------------------- */ void * -H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg, - hid_t dxpl_id) +H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg) { H5O_t *oh = NULL; /* Object header to use */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, NULL) + FUNC_ENTER_NOAPI_TAG(loc->addr, NULL) /* check args */ HDassert(loc); @@ -475,18 +473,18 @@ H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg, HDassert(type_id < NELMTS(H5O_msg_class_g)); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header") /* Call the "real" read routine */ - if(NULL == (ret_value = H5O_msg_read_oh(loc->file, dxpl_id, oh, type_id, mesg))) + if(NULL == (ret_value = H5O_msg_read_oh(loc->file, oh, type_id, mesg))) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header message") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_msg_read() */ @@ -514,8 +512,7 @@ done: *------------------------------------------------------------------------- */ void * -H5O_msg_read_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, - void *mesg) +H5O_msg_read_oh(H5F_t *f, H5O_t *oh, unsigned type_id, void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ unsigned idx; /* Message's index in object header */ @@ -541,7 +538,7 @@ H5O_msg_read_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, * Decode the message if necessary. If the message is shared then retrieve * native message through the shared interface. */ - H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, &(oh->mesg[idx]), NULL) + H5O_LOAD_NATIVE(f, 0, oh, &(oh->mesg[idx]), NULL) /* * The object header caches the native message (along with @@ -661,16 +658,16 @@ H5O_msg_free(unsigned type_id, void *mesg) HDassert(type); /* Call the "real" free routine */ - ret_value = H5O_msg_free_real(type, mesg); + ret_value = H5O__msg_free_real(type, mesg); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_msg_free() */ /*------------------------------------------------------------------------- - * Function: H5O_msg_free_mesg + * Function: H5O__msg_free_mesg * - * Purpose: Call H5O_msg_free_real() on a message. + * Purpose: Call H5O__msg_free_real() on a message. * * Return: Non-negative on success/Negative on failure * @@ -680,28 +677,27 @@ H5O_msg_free(unsigned type_id, void *mesg) *------------------------------------------------------------------------- */ herr_t -H5O_msg_free_mesg(H5O_mesg_t *mesg) +H5O__msg_free_mesg(H5O_mesg_t *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* check args */ HDassert(mesg); /* Free any native information */ - mesg->native = H5O_msg_free_real(mesg->type, mesg->native); + mesg->native = H5O__msg_free_real(mesg->type, mesg->native); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_msg_free_mesg() */ +} /* end H5O__msg_free_mesg() */ /*------------------------------------------------------------------------- - * Function: H5O_msg_free_real + * Function: H5O__msg_free_real * * Purpose: Similar to H5O_msg_reset() except it also frees the message * pointer. * * Return: Success: NULL - * * Failure: NULL * * Programmer: Robb Matzke @@ -710,9 +706,9 @@ H5O_msg_free_mesg(H5O_mesg_t *mesg) *------------------------------------------------------------------------- */ void * -H5O_msg_free_real(const H5O_msg_class_t *type, void *msg_native) +H5O__msg_free_real(const H5O_msg_class_t *type, void *msg_native) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* check args */ HDassert(type); @@ -726,7 +722,7 @@ H5O_msg_free_real(const H5O_msg_class_t *type, void *msg_native) } /* end if */ FUNC_LEAVE_NOAPI(NULL) -} /* end H5O_msg_free_real() */ +} /* end H5O__msg_free_real() */ /*------------------------------------------------------------------------- @@ -783,7 +779,7 @@ done: *------------------------------------------------------------------------- */ int -H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) +H5O_msg_count(const H5O_loc_t *loc, unsigned type_id) { H5O_t *oh = NULL; /* Object header to operate on */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -801,7 +797,7 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) HDassert(type); /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Count the messages of the correct type */ @@ -809,7 +805,7 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) H5_CHECKED_ASSIGN(ret_value, int, msg_count, unsigned); done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -871,19 +867,19 @@ H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type) *------------------------------------------------------------------------- */ htri_t -H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) +H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id) { H5O_t *oh = NULL; /* Object header for location */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL) HDassert(loc); HDassert(loc->file); HDassert(type_id < NELMTS(H5O_msg_class_g)); /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Call the "real" exists routine */ @@ -891,10 +887,10 @@ H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, FAIL, "unable to verify object header message") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_msg_exists() */ @@ -961,8 +957,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj_link, - hid_t dxpl_id) +H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj_link) { H5O_t *oh = NULL; /* Pointer to actual object header */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -980,11 +975,11 @@ H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj HDassert(type); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Call the "real" remove routine */ - if((ret_value = H5O_msg_remove_real(loc->file, oh, type, sequence, NULL, NULL, adj_link, dxpl_id)) < 0) + if((ret_value = H5O__msg_remove_real(loc->file, oh, type, sequence, NULL, NULL, adj_link)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove object header message") done: @@ -1014,7 +1009,7 @@ done: */ herr_t H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence, - H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id) + H5O_operator_t op, void *op_data, hbool_t adj_link) { H5O_t *oh = NULL; /* Pointer to actual object header */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -1032,11 +1027,11 @@ H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence, HDassert(type); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Call the "real" remove routine */ - if((ret_value = H5O_msg_remove_real(loc->file, oh, type, sequence, op, op_data, adj_link, dxpl_id)) < 0) + if((ret_value = H5O__msg_remove_real(loc->file, oh, type, sequence, op, op_data, adj_link)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove object header message") done: @@ -1095,7 +1090,7 @@ H5O__msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, * (OK to remove constant messages - QAK) */ /* Convert message into a null message */ - if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, udata->adj_link) < 0) + if(H5O_release_mesg(udata->f, oh, mesg, udata->adj_link) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release message") /* Indicate that the object header was modified */ @@ -1112,7 +1107,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_msg_remove_real + * Function: H5O__msg_remove_real * * Purpose: Removes the specified message from the object header. * If sequence is H5O_ALL (-1) then all messages of the @@ -1129,15 +1124,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, - int sequence, H5O_operator_t app_op, void *op_data, hbool_t adj_link, - hid_t dxpl_id) +H5O__msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + int sequence, H5O_operator_t app_op, void *op_data, hbool_t adj_link) { H5O_iter_rm_t udata; /* User data for iterator */ H5O_mesg_operator_t op; /* Wrapper for operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -1150,7 +1144,6 @@ H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, /* Set up iterator operator data */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.sequence = sequence; udata.nfailed = 0; udata.op = app_op; @@ -1160,7 +1153,7 @@ H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, /* Iterate over the messages, deleting appropriate one(s) */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O__msg_remove_cb; - if(H5O_msg_iterate_real(f, oh, type, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(f, oh, type, &op, &udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "error iterating over messages") /* Fail if we tried to remove any constant messages */ @@ -1169,7 +1162,7 @@ H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_remove_real() */ +} /* end H5O__msg_remove_real() */ /*------------------------------------------------------------------------- @@ -1205,7 +1198,7 @@ done: */ herr_t H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, - const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id) + const H5O_mesg_operator_t *op, void *op_data) { H5O_t *oh = NULL; /* Pointer to actual object header */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -1223,15 +1216,15 @@ H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, HDassert(op); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Call the "real" iterate routine */ - if((ret_value = H5O_msg_iterate_real(loc->file, oh, type, op, op_data, dxpl_id)) < 0) + if((ret_value = H5O__msg_iterate_real(loc->file, oh, type, op, op_data)) < 0) HERROR(H5E_OHDR, H5E_BADITER, "unable to iterate over object header messages"); done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1239,7 +1232,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_msg_iterate_real + * Function: H5O__msg_iterate_real * * Purpose: Iterate through object headers of a certain type. * @@ -1270,8 +1263,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, - const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id) +H5O__msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + const H5O_mesg_operator_t *op, void *op_data) { H5O_mesg_t *idx_msg; /* Pointer to current message */ unsigned idx; /* Absolute index of current message in all messages */ @@ -1279,7 +1272,7 @@ H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned oh_modified = 0; /* Whether the callback modified the object header */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -1292,7 +1285,7 @@ H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, for(sequence = 0, idx = 0, idx_msg = &oh->mesg[0]; idx < oh->nmesgs && !ret_value; idx++, idx_msg++) { if(type == idx_msg->type) { /* Decode the message if necessary. */ - H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, idx_msg, FAIL) + H5O_LOAD_NATIVE(f, 0, oh, idx_msg, FAIL) /* Check for making an "internal" (i.e. within the H5O package) callback */ if(op->op_type == H5O_MESG_OP_LIB) @@ -1322,11 +1315,11 @@ done: * message removal) */ if(oh_modified & H5O_MODIFY_CONDENSE) - if(H5O_condense_header(f, oh, dxpl_id) < 0) + if(H5O_condense_header(f, oh) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header") /* Mark object header as changed */ - if(H5O_touch_oh(f, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(f, oh, FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update time on object") /* Mark object header as dirty in cache */ @@ -1335,7 +1328,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_iterate_real() */ +} /* end H5O__msg_iterate_real() */ /*------------------------------------------------------------------------- @@ -1810,8 +1803,7 @@ done: *------------------------------------------------------------------------- */ void * -H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, - const unsigned char *buf) +H5O_msg_decode(H5F_t *f, H5O_t *open_oh, unsigned type_id, const unsigned char *buf) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ unsigned ioflags = 0; /* Flags for decode routine */ @@ -1826,7 +1818,7 @@ H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, HDassert(type); /* decode */ - if((ret_value = (type->decode)(f, dxpl_id, open_oh, 0, &ioflags, buf)) == NULL) + if((ret_value = (type->decode)(f, open_oh, 0, &ioflags, buf)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode message") done: @@ -1835,7 +1827,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_msg_copy_file + * Function: H5O__msg_copy_file * * Purpose: Copies a message to file. If MESG is is the null pointer then a null * pointer is returned with no error. @@ -1853,13 +1845,13 @@ done: *------------------------------------------------------------------------- */ void * -H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, +H5O__msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, - unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id) + unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(type); @@ -1873,16 +1865,16 @@ H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, /* The copy_file callback will return an H5O_shared_t only if the message * to be copied is a committed datatype. */ - if(NULL == (ret_value = (type->copy_file)(file_src, native_src, file_dst, recompute_size, mesg_flags, cpy_info, udata, dxpl_id))) + if(NULL == (ret_value = (type->copy_file)(file_src, native_src, file_dst, recompute_size, mesg_flags, cpy_info, udata))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy object header message to file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_copy_file() */ +} /* end H5O__msg_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_msg_alloc + * Function: H5O__msg_alloc * * Purpose: Create a new message in an object header * @@ -1895,14 +1887,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, +H5O__msg_alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned *mesg_flags, void *native, size_t *mesg_idx) { size_t new_idx; /* New index for message */ htri_t shared_mesg; /* Should this message be stored in the Shared Message table? */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -1918,18 +1910,18 @@ H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "error determining if message is shared") else if(shared_mesg > 0) { /* Increment message's reference count */ - if(type->link && (type->link)(f, dxpl_id, oh, native) < 0) + if(type->link && (type->link)(f, oh, native) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared message ref count") *mesg_flags |= H5O_MSG_FLAG_SHARED; } /* end if */ else { /* Attempt to share message */ - if(H5SM_try_share(f, dxpl_id, oh, 0, type->id, native, mesg_flags) < 0) + if(H5SM_try_share(f, oh, 0, type->id, native, mesg_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") } /* end else */ /* Allocate space in the object header for the message */ - if(H5O_alloc(f, dxpl_id, oh, type, native, &new_idx) < 0) + if(H5O__alloc(f, oh, type, native, &new_idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for message") /* Get the message's "creation index", if it has one */ @@ -1944,7 +1936,7 @@ H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_alloc() */ +} /* end H5O__msg_alloc() */ /*------------------------------------------------------------------------- @@ -1961,9 +1953,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, - const H5O_msg_class_t *type, const void *mesg, unsigned mesg_flags, - unsigned update_flags) +H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, const H5O_msg_class_t *type, + const void *mesg, unsigned mesg_flags, unsigned update_flags) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ H5O_mesg_t *idx_msg = &oh->mesg[idx]; /* Pointer to message to modify */ @@ -1980,7 +1971,7 @@ H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, HDassert(mesg); /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, idx_msg->chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, idx_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Reset existing native information for the header's message */ @@ -1998,18 +1989,18 @@ H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") chk_proxy = NULL; /* Update the modification time, if requested */ if(update_flags & H5O_UPDATE_TIME) - if(H5O_touch_oh(f, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(f, oh, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: /* Release chunk, if not already released */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -2021,8 +2012,8 @@ done: * * Purpose: Calls a message's delete callback. * - * This is mostly redundant with H5O_delete_mesg below, - * but H5O_delete_mesg only works on messages in object headers + * This is mostly redundant with H5O__delete_mesg below, + * but H5O__delete_mesg only works on messages in object headers * (while the shared message code needs to delete messages in * the heap). * @@ -2039,8 +2030,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, - void *mesg) +H5O_msg_delete(H5F_t *f, H5O_t *open_oh, unsigned type_id, void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2054,7 +2044,7 @@ H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, HDassert(type); /* delete */ - if((type->del) && (type->del)(f, dxpl_id, open_oh, mesg) < 0) + if((type->del) && (type->del)(f, open_oh, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") done: @@ -2063,7 +2053,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_delete_mesg + * Function: H5O__delete_mesg * * Purpose: Internal function to: * Delete an object header message from a file. This frees the file @@ -2078,12 +2068,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg) +H5O__delete_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) { const H5O_msg_class_t *type = mesg->type; /* Type of object to free */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f); @@ -2093,15 +2083,15 @@ H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg) /* Check if there is a file space deletion callback for this type of message */ if(type->del) { /* Decode the message if necessary. */ - H5O_LOAD_NATIVE(f, dxpl_id, H5O_DECODEIO_NOCHANGE, oh, mesg, FAIL) + H5O_LOAD_NATIVE(f, H5O_DECODEIO_NOCHANGE, oh, mesg, FAIL) - if((type->del)(f, dxpl_id, oh, mesg->native) < 0) + if((type->del)(f, oh, mesg->native) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_delete_mesg() */ +} /* end H5O__delete_mesg() */ /*------------------------------------------------------------------------- @@ -2264,7 +2254,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id, uint8_t *flags) +H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, uint8_t *flags) { H5O_t *oh = NULL; /* Object header to use */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -2283,7 +2273,7 @@ H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id, uint8_t HDassert(type); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Locate message of correct type */ @@ -2298,7 +2288,7 @@ H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id, uint8_t *flags = idx_msg->flags; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 7e7baea..6699706 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -27,20 +27,19 @@ #include "H5Opkg.h" /* Object headers */ -static void *H5O_mtime_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__mtime_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static void *H5O_mtime_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__mtime_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_mtime_copy(const void *_mesg, void *_dest); static size_t H5O_mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_mtime_reset(void *_mesg); -static herr_t H5O_mtime_free(void *_mesg); -static herr_t H5O_mtime_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); +static herr_t H5O__mtime_free(void *_mesg); +static herr_t H5O__mtime_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_MTIME[1] = {{ @@ -48,12 +47,12 @@ const H5O_msg_class_t H5O_MSG_MTIME[1] = {{ "mtime", /*message name for debugging */ sizeof(time_t), /*native message size */ 0, /* messages are sharable? */ - H5O_mtime_decode, /*decode message */ + H5O__mtime_decode, /*decode message */ H5O_mtime_encode, /*encode message */ H5O_mtime_copy, /*copy the native value */ H5O_mtime_size, /*raw message size */ - H5O_mtime_reset, /* reset method */ - H5O_mtime_free, /* free method */ + NULL, /* reset method */ + H5O__mtime_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ @@ -63,7 +62,7 @@ const H5O_msg_class_t H5O_MSG_MTIME[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_mtime_debug /*debug the message */ + H5O__mtime_debug /*debug the message */ }}; /* This message derives from H5O message class */ @@ -73,12 +72,12 @@ const H5O_msg_class_t H5O_MSG_MTIME_NEW[1] = {{ "mtime_new", /*message name for debugging */ sizeof(time_t), /*native message size */ 0, /* messages are sharable? */ - H5O_mtime_new_decode, /*decode message */ + H5O__mtime_new_decode, /*decode message */ H5O_mtime_new_encode, /*encode message */ H5O_mtime_copy, /*copy the native value */ H5O_mtime_new_size, /*raw message size */ - H5O_mtime_reset, /* reset method */ - H5O_mtime_free, /* free method */ + NULL, /* reset method */ + H5O__mtime_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ @@ -88,7 +87,7 @@ const H5O_msg_class_t H5O_MSG_MTIME_NEW[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_mtime_debug /*debug the message */ + H5O__mtime_debug /*debug the message */ }}; /* Current version of new mtime information */ @@ -99,7 +98,7 @@ H5FL_DEFINE(time_t); /*------------------------------------------------------------------------- - * Function: H5O_mtime_new_decode + * Function: H5O__mtime_new_decode * * Purpose: Decode a new modification time message and return a pointer to * a new time_t value. @@ -118,14 +117,14 @@ H5FL_DEFINE(time_t); *------------------------------------------------------------------------- */ static void * -H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { time_t *mesg; uint32_t tmp_time; /* Temporary copy of the time */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -151,11 +150,11 @@ H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_mtime_new_decode() */ +} /* end H5O__mtime_new_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_decode + * Function: H5O__mtime_decode * * Purpose: Decode a modification time message and return a pointer to a * new time_t value. @@ -174,7 +173,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__mtime_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { time_t *mesg, the_time; @@ -182,7 +181,7 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 int i; /* Local index variable */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -215,7 +214,7 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_mtime_decode() */ +} /* end H5O__mtime_decode() */ /*------------------------------------------------------------------------- @@ -406,58 +405,32 @@ H5O_mtime_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_sh /*------------------------------------------------------------------------- - * Function: H5O_mtime_reset + * Function: H5O__mtime_free * - * Purpose: Frees resources within a modification time message, but doesn't free - * the message itself. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Mondey, December 23, 2002 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O_mtime_reset(void H5_ATTR_UNUSED *_mesg) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(SUCCEED) -} - - -/*------------------------------------------------------------------------- - * Function: H5O_mtime_free - * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, March 30, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_free(void *mesg) +H5O__mtime_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(time_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_mtime_free() */ +} /* end H5O__mtime_free() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_debug + * Function: H5O__mtime_debug * * Purpose: Prints debugging info for the message. * @@ -472,7 +445,7 @@ H5O_mtime_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O__mtime_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const time_t *mesg = (const time_t *)_mesg; @@ -496,5 +469,5 @@ H5O_mtime_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi "Time:", buf); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__mtime_debug() */ diff --git a/src/H5Oname.c b/src/H5Oname.c index 6292883..185dc48 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -32,14 +32,14 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_name_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +static void *H5O__name_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_name_copy(const void *_mesg, void *_dest); static size_t H5O_name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_name_reset(void *_mesg); -static herr_t H5O_name_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth); +static herr_t H5O__name_reset(void *_mesg); +static herr_t H5O__name_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ @@ -47,11 +47,11 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ "name", /*message name for debugging */ sizeof(H5O_name_t), /*native message size */ 0, /* messages are sharable? */ - H5O_name_decode, /*decode message */ + H5O__name_decode, /*decode message */ H5O_name_encode, /*encode message */ H5O_name_copy, /*copy the native value */ H5O_name_size, /*raw message size */ - H5O_name_reset, /*free internal memory */ + H5O__name_reset, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ NULL, /* link method */ @@ -62,12 +62,12 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_name_debug /*debug the message */ + H5O__name_debug /*debug the message */ }}; /*------------------------------------------------------------------------- - * Function: H5O_name_decode + * Function: H5O__name_decode * * Purpose: Decode a name message and return a pointer to a new * native message struct. @@ -83,13 +83,13 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_name_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__name_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_name_t *mesg; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -105,13 +105,12 @@ H5O_name_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ ret_value = mesg; done: - if(NULL == ret_value) { + if(NULL == ret_value) if(mesg) mesg = (H5O_name_t *)H5MM_xfree(mesg); - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_name_decode() */ +} /* end H5O__name_decode() */ /*------------------------------------------------------------------------- @@ -237,7 +236,7 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar /*------------------------------------------------------------------------- - * Function: H5O_name_reset + * Function: H5O__name_reset * * Purpose: Frees internal pointers and resets the message to an * initial state. @@ -248,16 +247,14 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar * matzke@llnl.gov * Aug 12 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_name_reset(void *_mesg) +H5O__name_reset(void *_mesg) { H5O_name_t *mesg = (H5O_name_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(mesg); @@ -266,11 +263,11 @@ H5O_name_reset(void *_mesg) mesg->s = (char *)H5MM_xfree(mesg->s); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_name_reset() */ +} /* end H5O__name_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_name_debug + * Function: H5O__name_debug * * Purpose: Prints debugging info for the message. * @@ -285,8 +282,8 @@ H5O_name_reset(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_name_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth) +H5O__name_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_name_t *mesg = (const H5O_name_t *)_mesg; @@ -304,4 +301,5 @@ H5O_name_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void mesg->s); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__name_debug() */ + diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 109d273..c6fb55c 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -179,14 +179,14 @@ /* Load native information for a message, if it's not already present */ /* (Only works for messages with decode callback) */ -#define H5O_LOAD_NATIVE(F, DXPL, IOF, OH, MSG, ERR) \ +#define H5O_LOAD_NATIVE(F, IOF, OH, MSG, ERR) \ if(NULL == (MSG)->native) { \ const H5O_msg_class_t *msg_type = (MSG)->type; \ unsigned ioflags = (IOF); \ \ /* Decode the message */ \ HDassert(msg_type->decode); \ - if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw))) \ + if(NULL == ((MSG)->native = (msg_type->decode)((F), (OH), (MSG)->flags, &ioflags, (MSG)->raw))) \ HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \ \ /* Mark the message dirty if it was changed by decoding */ \ @@ -228,22 +228,22 @@ struct H5O_msg_class_t { const char *name; /*for debugging */ size_t native_size; /*size of native message */ unsigned share_flags; /* Message sharing settings */ - void *(*decode)(H5F_t *, hid_t, H5O_t *, unsigned, unsigned *, const uint8_t *); + void *(*decode)(H5F_t *, H5O_t *, unsigned, unsigned *, const uint8_t *); herr_t (*encode)(H5F_t *, hbool_t, uint8_t *, const void *); void *(*copy)(const void *, void *); /*copy native value */ size_t (*raw_size)(const H5F_t *, hbool_t, const void *);/*sizeof encoded message */ herr_t (*reset)(void *); /*free nested data structs */ herr_t (*free)(void *); /*free main data struct */ - herr_t (*del)(H5F_t *, hid_t, H5O_t *, void *); /* Delete space in file referenced by this message */ - herr_t (*link)(H5F_t *, hid_t, H5O_t *, void *); /* Increment any links in file reference by this message */ + herr_t (*del)(H5F_t *, H5O_t *, void *); /* Delete space in file referenced by this message */ + herr_t (*link)(H5F_t *, H5O_t *, void *); /* Increment any links in file reference by this message */ herr_t (*set_share)(void*, const H5O_shared_t*); /* Set shared information */ htri_t (*can_share)(const void *); /* Is message allowed to be shared? */ herr_t (*pre_copy_file)(H5F_t *, const void *, hbool_t *, const H5O_copy_t *, void *); /*"pre copy" action when copying native value to file */ - void *(*copy_file)(H5F_t *, void *, H5F_t *, hbool_t *, unsigned *, H5O_copy_t *, void *, hid_t); /*copy native value to file */ - herr_t (*post_copy_file)(const H5O_loc_t *, const void *, H5O_loc_t *, void *, unsigned *, hid_t, H5O_copy_t *); /*"post copy" action when copying native value to file */ + void *(*copy_file)(H5F_t *, void *, H5F_t *, hbool_t *, unsigned *, H5O_copy_t *, void *); /*copy native value to file */ + herr_t (*post_copy_file)(const H5O_loc_t *, const void *, H5O_loc_t *, void *, unsigned *, H5O_copy_t *); /*"post copy" action when copying native value to file */ herr_t (*get_crt_index)(const void *, H5O_msg_crt_idx_t *); /* Get message's creation index */ herr_t (*set_crt_index)(void *, H5O_msg_crt_idx_t); /* Set message's creation index */ - herr_t (*debug)(H5F_t*, hid_t, const void*, FILE*, int, int); + herr_t (*debug)(H5F_t*, const void*, FILE*, int, int); }; struct H5O_mesg_t { @@ -338,12 +338,12 @@ typedef struct H5O_obj_class_t { const char *name; /*for debugging */ void *(*get_copy_file_udata)(void); /*retrieve user data for 'copy file' operation */ void (*free_copy_file_udata)(void *); /*free user data for 'copy file' operation */ - htri_t (*isa)(H5O_t *); /*if a header matches an object class */ - hid_t (*open)(const H5G_loc_t *, hid_t, hid_t, hbool_t ); /*open an object of this class */ - void *(*create)(H5F_t *, void *, H5G_loc_t *, hid_t ); /*create an object of this class */ + htri_t (*isa)(const H5O_t *); /*if a header matches an object class */ + hid_t (*open)(const H5G_loc_t *, hbool_t ); /*open an object of this class */ + void *(*create)(H5F_t *, void *, H5G_loc_t *); /*create an object of this class */ H5O_loc_t *(*get_oloc)(hid_t ); /*get the object header location for an object */ - herr_t (*bh_info)(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info); /*get the index & heap info for an object */ - herr_t (*flush)(void *obj_ptr, hid_t dxpl_id); /*flush an opened object of this class */ + herr_t (*bh_info)(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info); /*get the index & heap info for an object */ + herr_t (*flush)(void *obj_ptr); /*flush an opened object of this class */ } H5O_obj_class_t; /* Node in skip list to map addresses from one file to another during object header copy */ @@ -366,7 +366,6 @@ typedef struct H5O_cont_msgs_t { /* Common callback information for loading object header prefix from disk */ typedef struct H5O_common_cache_ud_t { H5F_t *f; /* Pointer to file for object header/chunk */ - hid_t dxpl_id; /* DXPL for operation */ unsigned file_intent; /* Read/write intent for file */ unsigned merged_null_msgs; /* Number of null messages merged together */ H5O_cont_msgs_t *cont_msg_info; /* Pointer to continuation messages to work on */ @@ -390,21 +389,19 @@ typedef struct H5O_chunk_proxy_t { H5F_t *f; /* Pointer to file for object header/chunk */ H5O_t *oh; /* Object header for this chunk */ unsigned chunkno; /* Chunk number for this chunk */ - unsigned cont_chunkno; /* Chunk number for the chunk containing the continuation message that points to this chunk */ /* Flush depencency parent information (not stored) * * The following field is used to store a pointer - * to the in-core representation of the chunk proxy's flush dependency + * to the in-core representation of a new chunk proxy's flush dependency * parent -- if it exists. If it does not exist, this field will * contain NULL. * * If the file is opened in SWMR write mode, the flush dependency * parent of the chunk proxy will be either its object header - * (if cont_chunkno == 0) or the chunk proxy indicated by the - * cont_chunkno field (if cont_chunkno > 0). + * or the chunk with the continuation message that references this chunk. */ - void *parent; /* Pointer to flush dependency parent */ + void *fd_parent; /* Pointer to flush dependency parent */ } H5O_chunk_proxy_t; /* Callback information for loading object header chunk from disk */ @@ -558,89 +555,99 @@ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1]; /* Package-local function prototypes */ -H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg); -H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh); -H5_DLL hid_t H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref); -H5_DLL herr_t H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_mesg_t *mesg); -H5_DLL const H5O_obj_class_t * H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id); -H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted); -H5_DLL herr_t H5O_inc_rc(H5O_t *oh); -H5_DLL herr_t H5O_dec_rc(H5O_t *oh); +H5_DLL hid_t H5O__open_name(const H5G_loc_t *loc, const char *name); +H5_DLL hid_t H5O__open_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); +H5_DLL hid_t H5O__open_by_addr(const H5G_loc_t *loc, haddr_t addr); +H5_DLL hid_t H5O__open_by_loc(const H5G_loc_t *obj_loc, hbool_t app_ref); +H5_DLL herr_t H5O__create_link(const H5G_loc_t *new_loc, const char *new_name, + H5G_loc_t *obj_loc, hid_t lcpl_id); +H5_DLL const H5O_obj_class_t *H5O__obj_class(const H5O_loc_t *loc); +H5_DLL int H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted); +H5_DLL herr_t H5O__link(const H5O_loc_t *loc, int adjust); +H5_DLL htri_t H5O__exists_by_name(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5O__get_info_by_name(const H5G_loc_t *loc, const char *name, + H5O_info_t *oinfo); +H5_DLL herr_t H5O__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo); +H5_DLL herr_t H5O__set_comment_by_name(const H5G_loc_t *loc, const char *name, + const char *comment); +H5_DLL ssize_t H5O__get_comment_by_name(const H5G_loc_t *loc, const char *name, + char *comment, size_t bufsize); +H5_DLL herr_t H5O__visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, + H5_iter_order_t order, H5O_iterate_t op, void *op_data); +H5_DLL herr_t H5O__inc_rc(H5O_t *oh); +H5_DLL herr_t H5O__dec_rc(H5O_t *oh); H5_DLL herr_t H5O__free(H5O_t *oh); /* Object header message routines */ -H5_DLL herr_t H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_msg_class_t *type, unsigned *mesg_flags, void *mesg, - size_t *mesg_idx); -H5_DLL herr_t H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, - void *mesg); -H5_DLL herr_t H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, - void *mesg); -H5_DLL void *H5O_msg_free_real(const H5O_msg_class_t *type, void *mesg); -H5_DLL herr_t H5O_msg_free_mesg(H5O_mesg_t *mesg); +H5_DLL herr_t H5O__msg_alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + unsigned *mesg_flags, void *mesg, size_t *mesg_idx); +H5_DLL herr_t H5O__msg_append_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + unsigned mesg_flags, unsigned update_flags, void *mesg); +H5_DLL herr_t H5O__msg_write_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + unsigned mesg_flags, unsigned update_flags, void *mesg); +H5_DLL void *H5O__msg_free_real(const H5O_msg_class_t *type, void *mesg); +H5_DLL herr_t H5O__msg_free_mesg(H5O_mesg_t *mesg); H5_DLL unsigned H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type); -H5_DLL herr_t H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, - int sequence, H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id); -H5_DLL void *H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, +H5_DLL herr_t H5O__msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + int sequence, H5O_operator_t op, void *op_data, hbool_t adj_link); +H5_DLL void *H5O__msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, - unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -H5_DLL herr_t H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, - const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id); + unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata); +H5_DLL herr_t H5O__msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + const H5O_mesg_operator_t *op, void *op_data); +H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg); +H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh); +H5_DLL herr_t H5O__delete_mesg(H5F_t *f, H5O_t *open_oh, H5O_mesg_t *mesg); /* Object header chunk routines */ -H5_DLL herr_t H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, - unsigned cont_chunkno); -H5_DLL H5O_chunk_proxy_t *H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - unsigned idx); -H5_DLL herr_t H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, - H5O_chunk_proxy_t *chk_proxy, hbool_t chk_dirtied); -H5_DLL herr_t H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); +H5_DLL herr_t H5O__chunk_add(H5F_t *f, H5O_t *oh, unsigned idx, unsigned cont_chunkno); +H5_DLL H5O_chunk_proxy_t *H5O__chunk_protect(H5F_t *f, H5O_t *oh, unsigned idx); +H5_DLL herr_t H5O__chunk_unprotect(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, + hbool_t chk_dirtied); +H5_DLL herr_t H5O__chunk_update_idx(H5F_t *f, H5O_t *oh, unsigned idx); H5_DLL herr_t H5O_chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_proxy); -H5_DLL herr_t H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); +H5_DLL herr_t H5O__chunk_delete(H5F_t *f, H5O_t *oh, unsigned idx); H5_DLL herr_t H5O__chunk_dest(H5O_chunk_proxy_t *chunk_proxy); /* Collect storage info for btree and heap */ -H5_DLL herr_t H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - H5_ih_info_t *bh_info); +H5_DLL herr_t H5O__attr_bh_info(H5F_t *f, H5O_t *oh, H5_ih_info_t *bh_info); /* Object header allocation routines */ H5_DLL herr_t H5O_alloc_msgs(H5O_t *oh, size_t min_alloc); -H5_DLL herr_t H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, +H5_DLL herr_t H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_msg_alloc_info_t *found_msg, size_t *new_idx); -H5_DLL herr_t H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_msg_class_t *type, const void *mesg, size_t *mesg_idx); -H5_DLL herr_t H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id); -H5_DLL herr_t H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - H5O_mesg_t *mesg, hbool_t adj_link); +H5_DLL herr_t H5O__alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + const void *mesg, size_t *mesg_idx); +H5_DLL herr_t H5O_condense_header(H5F_t *f, H5O_t *oh); +H5_DLL herr_t H5O_release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, + hbool_t adj_link); /* Shared object operators */ -H5_DLL void * H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned *ioflags, const uint8_t *buf, const H5O_msg_class_t *type); +H5_DLL void * H5O_shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, + const uint8_t *buf, const H5O_msg_class_t *type); H5_DLL herr_t H5O_shared_encode(const H5F_t *f, uint8_t *buf/*out*/, const H5O_shared_t *sh_mesg); H5_DLL size_t H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg); -H5_DLL herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +H5_DLL herr_t H5O__shared_delete(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg); -H5_DLL herr_t H5O_shared_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +H5_DLL herr_t H5O__shared_link(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg); -H5_DLL herr_t H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, +H5_DLL herr_t H5O__shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, - void *udata, hid_t dxpl_id); -H5_DLL herr_t H5O_shared_post_copy_file (H5F_t *f, + void *udata); +H5_DLL herr_t H5O__shared_post_copy_file (H5F_t *f, const H5O_msg_class_t *mesg_type, const H5O_shared_t *shared_src, - H5O_shared_t *shared_dst, unsigned *mesg_flags, hid_t dxpl_id, - H5O_copy_t *cpy_info); + H5O_shared_t *shared_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info); H5_DLL herr_t H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth); /* Attribute message operators */ -H5_DLL herr_t H5O_attr_reset(void *_mesg); -H5_DLL herr_t H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); -H5_DLL herr_t H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); -H5_DLL herr_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - hsize_t *nattrs); +H5_DLL herr_t H5O__attr_reset(void *_mesg); +H5_DLL herr_t H5O__attr_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); +H5_DLL herr_t H5O__attr_link(H5F_t *f, H5O_t *open_oh, void *_mesg); +H5_DLL herr_t H5O_attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs); /* Testing functions */ #ifdef H5O_TESTING @@ -649,8 +656,8 @@ H5_DLL htri_t H5O_is_attr_dense_test(hid_t oid); H5_DLL herr_t H5O_num_attrs_test(hid_t oid, hsize_t *nattrs); H5_DLL herr_t H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count); H5_DLL herr_t H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val); -H5_DLL herr_t H5O_expunge_chunks_test(const H5O_loc_t *oloc, hid_t dxpl_id); -H5_DLL herr_t H5O_get_rc(const H5O_loc_t *oloc, hid_t dxpl_id, unsigned *rc); +H5_DLL herr_t H5O_expunge_chunks_test(const H5O_loc_t *oloc); +H5_DLL herr_t H5O_get_rc(const H5O_loc_t *oloc, unsigned *rc); H5_DLL herr_t H5O_msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num); H5_DLL herr_t H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type); @@ -660,7 +667,8 @@ H5_DLL herr_t H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type); #ifdef H5O_DEBUG H5_DLL herr_t H5O_assert(const H5O_t *oh); #endif /* H5O_DEBUG */ -H5_DLL herr_t H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5O_debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, + int indent, int fwidth); #endif /* _H5Opkg_H */ diff --git a/src/H5Opline.c b/src/H5Opline.c index 2e52dbb..7ce4ae3 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -33,36 +33,36 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_pline_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_pline_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +static void *H5O__pline_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static void *H5O_pline_copy(const void *_mesg, void *_dest); static size_t H5O_pline_size(const H5F_t *f, const void *_mesg); -static herr_t H5O_pline_reset(void *_mesg); -static herr_t H5O_pline_free(void *_mesg); +static herr_t H5O__pline_reset(void *_mesg); +static herr_t H5O__pline_free(void *_mesg); static herr_t H5O_pline_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); -static herr_t H5O_pline_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__pline_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_PLINE #define H5O_SHARED_DECODE H5O_pline_shared_decode -#define H5O_SHARED_DECODE_REAL H5O_pline_decode +#define H5O_SHARED_DECODE_REAL H5O__pline_decode #define H5O_SHARED_ENCODE H5O_pline_shared_encode #define H5O_SHARED_ENCODE_REAL H5O_pline_encode #define H5O_SHARED_SIZE H5O_pline_shared_size #define H5O_SHARED_SIZE_REAL H5O_pline_size -#define H5O_SHARED_DELETE H5O_pline_shared_delete +#define H5O_SHARED_DELETE H5O__pline_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O_pline_shared_link +#define H5O_SHARED_LINK H5O__pline_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O_pline_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__pline_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL #define H5O_SHARED_POST_COPY_FILE H5O_pline_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_pline_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O_pline_debug +#define H5O_SHARED_DEBUG_REAL H5O__pline_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* This message derives from H5O message class */ @@ -75,14 +75,14 @@ const H5O_msg_class_t H5O_MSG_PLINE[1] = {{ H5O_pline_shared_encode, /* encode message */ H5O_pline_copy, /* copy the native value */ H5O_pline_shared_size, /* size of raw message */ - H5O_pline_reset, /* reset method */ - H5O_pline_free, /* free method */ - H5O_pline_shared_delete, /* file delete method */ - H5O_pline_shared_link, /* link method */ + H5O__pline_reset, /* reset method */ + H5O__pline_free, /* free method */ + H5O__pline_shared_delete, /* file delete method */ + H5O__pline_shared_link, /* link method */ NULL, /* set share method */ NULL, /*can share method */ H5O_pline_pre_copy_file, /* pre copy native value to file */ - H5O_pline_shared_copy_file, /* copy native value to file */ + H5O__pline_shared_copy_file, /* copy native value to file */ H5O_pline_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ @@ -95,7 +95,7 @@ H5FL_DEFINE(H5O_pline_t); /*------------------------------------------------------------------------- - * Function: H5O_pline_decode + * Function: H5O__pline_decode * * Purpose: Decodes a filter pipeline message. * @@ -108,7 +108,7 @@ H5FL_DEFINE(H5O_pline_t); *------------------------------------------------------------------------- */ static void * -H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__pline_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_pline_t *pline = NULL; /* Pipeline message */ @@ -117,7 +117,7 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 size_t i; /* Local index variable */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(p); @@ -215,12 +215,12 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 done: if(NULL == ret_value && pline) { - H5O_pline_reset(pline); - H5O_pline_free(pline); + H5O__pline_reset(pline); + H5O__pline_free(pline); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_pline_decode() */ +} /* end H5O__pline_decode() */ /*------------------------------------------------------------------------- @@ -405,9 +405,9 @@ H5O_pline_copy(const void *_src, void *_dst/*out*/) done: if(!ret_value && dst) { - H5O_pline_reset(dst); + H5O__pline_reset(dst); if(!_dst) - H5O_pline_free(dst); + H5O__pline_free(dst); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -476,7 +476,7 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) /*------------------------------------------------------------------------- - * Function: H5O_pline_reset + * Function: H5O__pline_reset * * Purpose: Resets a filter pipeline message by clearing all filters. * The MESG buffer is not freed. @@ -489,12 +489,12 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_pline_reset(void *mesg) +H5O__pline_reset(void *mesg) { H5O_pline_t *pline = (H5O_pline_t*)mesg; /* Pipeline message */ size_t i; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(pline); @@ -521,13 +521,13 @@ H5O_pline_reset(void *mesg) pline->version = H5O_PLINE_VERSION_1; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_pline_reset() */ +} /* end H5O__pline_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_pline_free + * Function: H5O__pline_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -537,16 +537,16 @@ H5O_pline_reset(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_pline_free(void *mesg) +H5O__pline_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_pline_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_pline_free() */ +} /* end H5O__pline_free() */ /*------------------------------------------------------------------------- @@ -591,7 +591,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_pline_debug + * Function: H5O__pline_debug * * Purpose: Prints debugging information for filter pipeline message MESG * on output stream STREAM. Each line is indented INDENT @@ -605,13 +605,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *mesg, FILE *stream, - int indent, int fwidth) +H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, + int indent, int fwidth) { const H5O_pline_t *pline = (const H5O_pline_t *)mesg; size_t i, j; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -660,7 +660,7 @@ H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_pline_debug() */ +} /* end H5O__pline_debug() */ /*------------------------------------------------------------------------- diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 4b74d8f..455ec41 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -180,6 +180,7 @@ typedef struct H5O_copy_t { 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 */ + hid_t lcpl_id; /* LCPL for callbacks' use */ } H5O_copy_t; /* Header message IDs */ @@ -387,6 +388,9 @@ typedef struct H5O_efl_t { | H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER \ ) +/* Version # of encoded virtual dataset global heap blocks */ +#define H5O_LAYOUT_VDS_GH_ENC_VERS 0 + /* Initial version of the layout information. Used when space is allocated */ #define H5O_LAYOUT_VERSION_1 1 @@ -854,65 +858,58 @@ struct H5P_genplist_t; /* Object header routines */ H5_DLL herr_t H5O_init(void); -H5_DLL herr_t H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, - size_t initial_rc, hid_t ocpl_id, H5O_loc_t *loc/*out*/); +H5_DLL herr_t H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, + hid_t ocpl_id, H5O_loc_t *loc/*out*/); H5_DLL herr_t H5O_open(H5O_loc_t *loc); H5_DLL herr_t H5O_close(H5O_loc_t *loc, hbool_t *file_closed/*out*/); -H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id); -H5_DLL H5O_t *H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, - unsigned prot_flags, hbool_t pin_all_chunks); -H5_DLL H5O_t *H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id); +H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust); +H5_DLL H5O_t *H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, + hbool_t pin_all_chunks); +H5_DLL H5O_t *H5O_pin(const H5O_loc_t *loc); H5_DLL herr_t H5O_unpin(H5O_t *oh); -H5_DLL herr_t H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id); -H5_DLL herr_t H5O_unprotect(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, - unsigned oh_flags); -H5_DLL herr_t H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id); -H5_DLL herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - hbool_t force); +H5_DLL herr_t H5O_dec_rc_by_loc(const H5O_loc_t *loc); +H5_DLL herr_t H5O_unprotect(const H5O_loc_t *loc, H5O_t *oh, unsigned oh_flags); +H5_DLL herr_t H5O_touch(const H5O_loc_t *loc, hbool_t force); +H5_DLL herr_t H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force); #ifdef H5O_ENABLE_BOGUS -H5_DLL herr_t H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_id, unsigned mesg_flags); +H5_DLL herr_t H5O_bogus_oh(H5F_t *f, H5O_t *oh, unsigned mesg_id, unsigned mesg_flags); #endif /* H5O_ENABLE_BOGUS */ -H5_DLL herr_t H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr); -H5_DLL herr_t H5O_get_hdr_info(const H5O_loc_t *oloc, hid_t dxpl_id, H5O_hdr_info_t *hdr); -H5_DLL herr_t H5O_get_info(const H5O_loc_t *oloc, hid_t dxpl_id, hbool_t want_ih_info, +H5_DLL herr_t H5O_delete(H5F_t *f, haddr_t addr); +H5_DLL herr_t H5O_get_hdr_info(const H5O_loc_t *oloc, H5O_hdr_info_t *hdr); +H5_DLL herr_t H5O_get_info(const H5O_loc_t *oloc, hbool_t want_ih_info, H5O_info_t *oinfo); -H5_DLL herr_t H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type, hid_t dxpl_id); -H5_DLL herr_t H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, struct H5P_genplist_t *oc_plist); -H5_DLL hid_t H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref); -H5_DLL herr_t H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks); -H5_DLL void *H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id); +H5_DLL herr_t H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type); +H5_DLL herr_t H5O_get_create_plist(const H5O_loc_t *loc, struct H5P_genplist_t *oc_plist); +H5_DLL hid_t H5O_open_name(const H5G_loc_t *loc, const char *name, hbool_t app_ref); +H5_DLL herr_t H5O_get_nlinks(const H5O_loc_t *loc, hsize_t *nlinks); +H5_DLL void *H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc); H5_DLL haddr_t H5O_get_oh_addr(const H5O_t *oh); -H5_DLL herr_t H5O_get_rc_and_type(const H5O_loc_t *oloc, hid_t dxpl_id, unsigned *rc, H5O_type_t *otype); +H5_DLL herr_t H5O_get_rc_and_type(const H5O_loc_t *oloc, unsigned *rc, H5O_type_t *otype); H5_DLL H5AC_proxy_entry_t *H5O_get_proxy(const H5O_t *oh); -H5_DLL herr_t H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, - H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id); /* Object header message routines */ H5_DLL herr_t H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, - unsigned update_flags, void *mesg, hid_t dxpl_id); -H5_DLL herr_t H5O_msg_append_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, + unsigned update_flags, void *mesg); +H5_DLL herr_t H5O_msg_append_oh(H5F_t *f, H5O_t *oh, unsigned type_id, unsigned mesg_flags, unsigned update_flags, void *mesg); H5_DLL herr_t H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, - unsigned mesg_flags, unsigned update_flags, void *mesg, hid_t dxpl_id); -H5_DLL herr_t H5O_msg_write_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - unsigned type_id, unsigned mesg_flags, unsigned update_flags, void *mesg); -H5_DLL void *H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg, - hid_t dxpl_id); -H5_DLL void *H5O_msg_read_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, - void *mesg); + unsigned mesg_flags, unsigned update_flags, void *mesg); +H5_DLL herr_t H5O_msg_write_oh(H5F_t *f, H5O_t *oh, unsigned type_id, + unsigned mesg_flags, unsigned update_flags, void *mesg); +H5_DLL void *H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg); +H5_DLL void *H5O_msg_read_oh(H5F_t *f, H5O_t *oh, unsigned type_id, void *mesg); H5_DLL herr_t H5O_msg_reset(unsigned type_id, void *native); H5_DLL void *H5O_msg_free(unsigned type_id, void *mesg); H5_DLL void *H5O_msg_copy(unsigned type_id, const void *mesg, void *dst); -H5_DLL int H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id); -H5_DLL htri_t H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id); +H5_DLL int H5O_msg_count(const H5O_loc_t *loc, unsigned type_id); +H5_DLL htri_t H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id); H5_DLL htri_t H5O_msg_exists_oh(const H5O_t *oh, unsigned type_id); H5_DLL herr_t H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, - hbool_t adj_link, hid_t dxpl_id); + hbool_t adj_link); H5_DLL herr_t H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence, - H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id); + H5O_operator_t op, void *op_data, hbool_t adj_link); H5_DLL herr_t H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, - const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id); + const H5O_mesg_operator_t *op, void *op_data); H5_DLL size_t H5O_msg_raw_size(const H5F_t *f, unsigned type_id, hbool_t disable_shared, const void *mesg); H5_DLL size_t H5O_msg_size_f(const H5F_t *f, hid_t ocpl_id, unsigned type_id, @@ -929,29 +926,28 @@ H5_DLL herr_t H5O_msg_get_crt_index(unsigned type_id, const void *mesg, H5O_msg_crt_idx_t *crt_idx); H5_DLL herr_t H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared, unsigned char *buf, const void *obj); -H5_DLL void* H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned type_id, const unsigned char *buf); -H5_DLL herr_t H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned type_id, void *mesg); -H5_DLL herr_t H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id, uint8_t *flags); +H5_DLL void* H5O_msg_decode(H5F_t *f, H5O_t *open_oh, unsigned type_id, + const unsigned char *buf); +H5_DLL herr_t H5O_msg_delete(H5F_t *f, H5O_t *open_oh, unsigned type_id, + void *mesg); +H5_DLL herr_t H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, uint8_t *flags); /* Object metadata flush/refresh routines */ -H5_DLL herr_t H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id, hid_t dxpl_id); -H5_DLL herr_t H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc, hid_t dxpl_id); -H5_DLL herr_t H5O_refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc, hid_t dxpl_id); -H5_DLL herr_t H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_t start_swmr); +H5_DLL herr_t H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id); +H5_DLL herr_t H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc); +H5_DLL herr_t H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hbool_t start_swmr); /* Object copying routines */ H5_DLL herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - hid_t dxpl_id, H5O_copy_t *cpy_info, hbool_t inc_depth, + H5O_copy_t *cpy_info, hbool_t inc_depth, H5O_type_t *obj_type, void **udata); -H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, +H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, H5F_t *file_dst, void *_dst_ref, size_t ref_count, H5R_type_t ref_type, H5O_copy_t *cpy_info); /* Debugging routines */ -H5_DLL herr_t H5O_debug_id(unsigned type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, +H5_DLL herr_t H5O_debug_id(unsigned type_id, H5F_t *f, const void *mesg, FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5O_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth); /* These functions operate on object locations */ @@ -966,12 +962,11 @@ H5_DLL hsize_t H5O_efl_total_size(H5O_efl_t *efl); /* Fill value operators */ H5_DLL herr_t H5O_fill_reset_dyn(H5O_fill_t *fill); -H5_DLL herr_t H5O_fill_convert(H5O_fill_t *fill, H5T_t *type, hbool_t *fill_changed, hid_t dxpl_id); +H5_DLL herr_t H5O_fill_convert(H5O_fill_t *fill, H5T_t *type, hbool_t *fill_changed); H5_DLL herr_t H5O_fill_set_latest_version(H5O_fill_t *fill); /* Link operators */ -H5_DLL herr_t H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - void *_mesg); +H5_DLL herr_t H5O_link_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); /* Filter pipeline operators */ H5_DLL herr_t H5O_pline_set_latest_version(H5O_pline_t *pline); diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index af68417..5b6cbb0 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -32,16 +32,16 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_refcount_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__refcount_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_refcount_copy(const void *_mesg, void *_dest); static size_t H5O_refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_refcount_free(void *_mesg); +static herr_t H5O__refcount_free(void *_mesg); static herr_t H5O_refcount_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); -static herr_t H5O_refcount_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__refcount_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_REFCOUNT[1] = {{ @@ -49,12 +49,12 @@ const H5O_msg_class_t H5O_MSG_REFCOUNT[1] = {{ "refcount", /*message name for debugging */ sizeof(H5O_refcount_t), /*native message size */ 0, /* messages are sharable? */ - H5O_refcount_decode, /*decode message */ + H5O__refcount_decode, /*decode message */ H5O_refcount_encode, /*encode message */ H5O_refcount_copy, /*copy the native value */ H5O_refcount_size, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_refcount_free, /* free method */ + H5O__refcount_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ @@ -64,7 +64,7 @@ const H5O_msg_class_t H5O_MSG_REFCOUNT[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_refcount_debug /*debug the message */ + H5O__refcount_debug /*debug the message */ }}; /* Current version of ref. count information */ @@ -75,7 +75,7 @@ H5FL_DEFINE_STATIC(H5O_refcount_t); /*------------------------------------------------------------------------- - * Function: H5O_refcount_decode + * Function: H5O__refcount_decode * * Purpose: Decode a message and return a pointer to a newly allocated one. * @@ -89,13 +89,13 @@ H5FL_DEFINE_STATIC(H5O_refcount_t); *------------------------------------------------------------------------- */ static void * -H5O_refcount_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__refcount_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_refcount_t *refcount = NULL; /* Reference count */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -120,7 +120,7 @@ done: refcount = H5FL_FREE(H5O_refcount_t, refcount); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_refcount_decode() */ +} /* end H5O__refcount_decode() */ /*------------------------------------------------------------------------- @@ -231,9 +231,9 @@ H5O_refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_ /*------------------------------------------------------------------------- - * Function: H5O_refcount_free + * Function: H5O__refcount_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -243,16 +243,16 @@ H5O_refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_ *------------------------------------------------------------------------- */ static herr_t -H5O_refcount_free(void *mesg) +H5O__refcount_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_refcount_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_refcount_free() */ +} /* end H5O__refcount_free() */ /*------------------------------------------------------------------------- @@ -289,7 +289,7 @@ H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UN /*------------------------------------------------------------------------- - * Function: H5O_refcount_debug + * Function: H5O__refcount_debug * * Purpose: Prints debugging info for a message. * @@ -302,12 +302,12 @@ H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UN *------------------------------------------------------------------------- */ static herr_t -H5O_refcount_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__refcount_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_refcount_t *refcount = (const H5O_refcount_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -320,5 +320,5 @@ H5O_refcount_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const "Number of links:", (unsigned)*refcount); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_refcount_debug() */ +} /* end H5O__refcount_debug() */ diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 3fe5652..22ab4fe 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -25,37 +25,37 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__sdspace_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_sdspace_copy(const void *_mesg, void *_dest); static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg); -static herr_t H5O_sdspace_reset(void *_mesg); -static herr_t H5O_sdspace_free(void *_mesg); +static herr_t H5O__sdspace_reset(void *_mesg); +static herr_t H5O__sdspace_free(void *_mesg); static herr_t H5O_sdspace_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); -static herr_t H5O_sdspace_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__sdspace_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_SDSPACE #define H5O_SHARED_DECODE H5O_sdspace_shared_decode -#define H5O_SHARED_DECODE_REAL H5O_sdspace_decode +#define H5O_SHARED_DECODE_REAL H5O__sdspace_decode #define H5O_SHARED_ENCODE H5O_sdspace_shared_encode #define H5O_SHARED_ENCODE_REAL H5O_sdspace_encode #define H5O_SHARED_SIZE H5O_sdspace_shared_size #define H5O_SHARED_SIZE_REAL H5O_sdspace_size -#define H5O_SHARED_DELETE H5O_sdspace_shared_delete +#define H5O_SHARED_DELETE H5O__sdspace_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O_sdspace_shared_link +#define H5O_SHARED_LINK H5O__sdspace_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O_sdspace_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__sdspace_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL #define H5O_SHARED_POST_COPY_FILE H5O_sdspace_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_sdspace_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O_sdspace_debug +#define H5O_SHARED_DEBUG_REAL H5O__sdspace_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* This message derives from H5O message class */ @@ -68,14 +68,14 @@ const H5O_msg_class_t H5O_MSG_SDSPACE[1] = {{ H5O_sdspace_shared_encode, /* encode message */ H5O_sdspace_copy, /* copy the native value */ H5O_sdspace_shared_size, /* size of symbol table entry */ - H5O_sdspace_reset, /* default reset method */ - H5O_sdspace_free, /* free method */ - H5O_sdspace_shared_delete, /* file delete method */ - H5O_sdspace_shared_link, /* link method */ + H5O__sdspace_reset, /* default reset method */ + H5O__sdspace_free, /* free method */ + H5O__sdspace_shared_delete, /* file delete method */ + H5O__sdspace_shared_link, /* link method */ NULL, /* set share method */ NULL, /*can share method */ H5O_sdspace_pre_copy_file, /* pre copy native value to file */ - H5O_sdspace_shared_copy_file,/* copy native value to file */ + H5O__sdspace_shared_copy_file,/* copy native value to file */ H5O_sdspace_shared_post_copy_file,/* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ @@ -91,14 +91,13 @@ H5FL_ARR_EXTERN(hsize_t); /*-------------------------------------------------------------------------- NAME - H5O_sdspace_decode + H5O__sdspace_decode PURPOSE Decode a simple dimensionality message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_sdspace_decode(f, dxpl_id, mesg_flags, p) + void *H5O__sdspace_decode(f, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct - hid_t dxpl_id; IN: DXPL for any I/O unsigned mesg_flags; IN: Message flags to influence decoding const uint8 *p; IN: the raw information buffer RETURNS @@ -109,7 +108,7 @@ H5FL_ARR_EXTERN(hsize_t); within this function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_sdspace_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5S_extent_t *sdim = NULL;/* New extent dimensionality structure */ @@ -117,7 +116,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED unsigned i; /* Local counting variable */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -194,7 +193,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_sdspace_decode() */ +} /* end H5O__sdspace_decode() */ /*-------------------------------------------------------------------------- @@ -372,7 +371,7 @@ H5O_sdspace_size(const H5F_t *f, const void *_mesg) /*------------------------------------------------------------------------- - * Function: H5O_sdspace_reset + * Function: H5O__sdspace_reset * * Purpose: Frees the inside of a dataspace message and resets it to some * initial value. @@ -382,27 +381,25 @@ H5O_sdspace_size(const H5F_t *f, const void *_mesg) * Programmer: Robb Matzke * Thursday, April 30, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_sdspace_reset(void *_mesg) +H5O__sdspace_reset(void *_mesg) { H5S_extent_t *mesg = (H5S_extent_t*)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR H5S_extent_release(mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__sdspace_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_sdsdpace_free + * Function: H5O__sdsdpace_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -412,16 +409,16 @@ H5O_sdspace_reset(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_sdspace_free(void *mesg) +H5O__sdspace_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5S_extent_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_sdspace_free() */ +} /* end H5O__sdspace_free() */ /*------------------------------------------------------------------------- @@ -476,11 +473,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5O_sdspace_debug + H5O__sdspace_debug PURPOSE Prints debugging information for a simple dimensionality message USAGE - void *H5O_sdspace_debug(f, mesg, stream, indent, fwidth) + void *H5O__sdspace_debug(f, mesg, stream, indent, fwidth) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source extent dimensionality struct FILE *stream; IN: Pointer to the stream for output data @@ -493,12 +490,12 @@ done: parameter. --------------------------------------------------------------------------*/ static herr_t -H5O_sdspace_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *mesg, - FILE * stream, int indent, int fwidth) +H5O__sdspace_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE * stream, + int indent, int fwidth) { const H5S_extent_t *sdim = (const H5S_extent_t *)mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -535,5 +532,5 @@ H5O_sdspace_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const v } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_sdspace_debug() */ +} /* end H5O__sdspace_debug() */ diff --git a/src/H5Oshared.c b/src/H5Oshared.c index db2d0cc..c1957b4 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -104,7 +104,7 @@ *------------------------------------------------------------------------- */ static void * -H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, +H5O_shared_read(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, const H5O_shared_t *shared, const H5O_msg_class_t *type) { H5HF_t *fheap = NULL; @@ -132,15 +132,15 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, size_t mesg_size; /* Size of message */ /* Retrieve the fractal heap address for shared messages */ - if(H5SM_get_fheap_addr(f, dxpl_id, type->id, &fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, type->id, &fheap_addr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "can't get fheap address for shared messages") /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, fheap_addr))) + if(NULL == (fheap = H5HF_open(f, fheap_addr))) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open fractal heap") /* Get the size of the message in the heap */ - if(H5HF_get_obj_len(fheap, dxpl_id, &(shared->u.heap_id), &mesg_size) < 0) + if(H5HF_get_obj_len(fheap, &(shared->u.heap_id), &mesg_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "can't get message size from fractal heap.") /* Wrap the local buffer for serialized message */ @@ -152,11 +152,11 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "can't get actual buffer") /* Retrieve the message from the heap */ - if(H5HF_read(fheap, dxpl_id, &(shared->u.heap_id), mesg_ptr) < 0) + if(H5HF_read(fheap, &(shared->u.heap_id), mesg_ptr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "can't read message from fractal heap.") /* Decode the message */ - if(NULL == (ret_value = (type->decode)(f, dxpl_id, open_oh, 0, ioflags, mesg_ptr))) + if(NULL == (ret_value = (type->decode)(f, open_oh, 0, ioflags, mesg_ptr))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "can't decode shared message.") } /* end if */ else { @@ -174,11 +174,11 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, * is possible, for example, if an attribute's datatype is shared in * the same object header the attribute is in. Read the message * directly. */ - if(NULL == (ret_value = H5O_msg_read_oh(f, dxpl_id, open_oh, type->id, NULL))) + if(NULL == (ret_value = H5O_msg_read_oh(f, open_oh, type->id, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read message") } else /* The shared message is in another object header */ - if(NULL == (ret_value = H5O_msg_read(&oloc, type->id, NULL, dxpl_id))) + if(NULL == (ret_value = H5O_msg_read(&oloc, type->id, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read message") } /* end else */ @@ -188,7 +188,7 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "can't close fractal heap") if(wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") @@ -198,7 +198,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_shared_link_adj + * Function: H5O__shared_link_adj * * Purpose: Changes the link count for the object referenced by a shared * message. @@ -219,12 +219,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - const H5O_msg_class_t *type, H5O_shared_t *shared, int adjust) +H5O__shared_link_adj(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, + H5O_shared_t *shared, int adjust) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -262,15 +262,15 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, * is possible, for example, if an attribute's datatype is shared in * the same object header the attribute is in. Adjust the link * count directly. */ - hbool_t deleted = FALSE; /* This is used only to satisfy H5O_link_oh */ + hbool_t deleted = FALSE; /* This is used only to satisfy H5O__link_oh */ - if(H5O_link_oh(f, adjust, dxpl_id, open_oh, &deleted) < 0) + if(H5O__link_oh(f, adjust, open_oh, &deleted) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") HDassert(!deleted); } else /* The shared message is in another object header */ - if(H5O_link(&oloc, adjust, dxpl_id) < 0) + if(H5O_link(&oloc, adjust) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") } /* end if */ else { @@ -278,19 +278,19 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Check for decrementing reference count on shared message */ if(adjust < 0) { - if(H5SM_delete(f, dxpl_id, open_oh, shared) < 0) + if(H5SM_delete(f, open_oh, shared) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to delete message from SOHM table") } /* end if */ /* Check for incrementing reference count on message */ else if(adjust > 0) { - if(H5SM_try_share(f, dxpl_id, open_oh, 0, type->id, shared, NULL) < 0) + if(H5SM_try_share(f, open_oh, 0, type->id, shared, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "error trying to share message") } /* end if */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shared_link_adj() */ +} /* end H5O__shared_link_adj() */ /*------------------------------------------------------------------------- @@ -306,8 +306,8 @@ done: *------------------------------------------------------------------------- */ void * -H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, - const uint8_t *buf, const H5O_msg_class_t *type) +H5O_shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, const uint8_t *buf, + const H5O_msg_class_t *type) { H5O_shared_t sh_mesg; /* Shared message info */ unsigned version; /* Shared message version */ @@ -373,7 +373,7 @@ H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, sh_mesg.msg_type_id = type->id; /* Retrieve actual message, through decoded shared message info */ - if(NULL == (ret_value = H5O_shared_read(f, dxpl_id, open_oh, ioflags, &sh_mesg, type))) + if(NULL == (ret_value = H5O_shared_read(f, open_oh, ioflags, &sh_mesg, type))) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to retrieve native message") done: @@ -496,7 +496,7 @@ H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg) /*------------------------------------------------------------------------- - * Function: H5O_shared_delete + * Function: H5O__shared_delete * * Purpose: Free file space referenced by message * @@ -508,12 +508,12 @@ H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg) *------------------------------------------------------------------------- */ herr_t -H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - const H5O_msg_class_t *type, H5O_shared_t *sh_mesg) +H5O__shared_delete(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, + H5O_shared_t *sh_mesg) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -521,24 +521,24 @@ H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* * Committed datatypes increment the OH of the original message when they - * are written (in H5O_shared_link) and decrement it here. + * are written (in H5O__shared_link) and decrement it here. * SOHMs in the heap behave differently; their refcount is incremented * during H5SM_share when they are going to be written (in H5O_msg_append * or H5O_msg_write). Their refcount in the SOHM indexes still needs to - * be decremented when they're deleted (in H5O_shared_link_adj). + * be decremented when they're deleted (in H5O__shared_link_adj). */ /* Decrement the reference count on the shared object */ - if(H5O_shared_link_adj(f, dxpl_id, open_oh, type, sh_mesg, -1) < 0) + if(H5O__shared_link_adj(f, open_oh, type, sh_mesg, -1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shared_delete() */ +} /* end H5O__shared_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_shared_link + * Function: H5O__shared_link * * Purpose: Increment reference count on any objects referenced by * message @@ -551,28 +551,28 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_shared_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - const H5O_msg_class_t *type, H5O_shared_t *sh_mesg) +H5O__shared_link(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, + H5O_shared_t *sh_mesg) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); HDassert(sh_mesg); /* Increment the reference count on the shared object */ - if(H5O_shared_link_adj(f, dxpl_id, open_oh, type, sh_mesg, 1) < 0) + if(H5O__shared_link_adj(f, open_oh, type, sh_mesg, 1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shared_link() */ +} /* end H5O__shared_link() */ /*------------------------------------------------------------------------- - * Function: H5O_shared_copy_file + * Function: H5O__shared_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -585,16 +585,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, +H5O__shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, - void H5_ATTR_UNUSED *udata, hid_t dxpl_id) + void H5_ATTR_UNUSED *udata) { const H5O_shared_t *shared_src = (const H5O_shared_t *)_native_src; /* Alias to shared info in native source */ H5O_shared_t *shared_dst = (H5O_shared_t *)_native_dst; /* Alias to shared info in native destination message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(file_src); @@ -617,13 +617,13 @@ H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, if(shared_src->type != H5O_SHARE_TYPE_COMMITTED) { /* Simulate trying to share new message in the destination file. */ /* Set copied metadata tag */ - H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_DEFER, mesg_type->id, _native_dst, mesg_flags) < 0) + if(H5SM_try_share(file_dst, NULL, H5SM_DEFER, mesg_type->id, _native_dst, mesg_flags) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to determine if message should be shared") /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG } /* end if */ else { /* Mark the message as committed - as it will be committed in post copy @@ -634,11 +634,11 @@ H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_shared_copy_file() */ +} /* H5O__shared_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_shared_post_copy_file + * Function: H5O__shared_post_copy_file * * Purpose: Delate a shared message and replace with a new one. * The function is needed at cases such as coping a shared reg_ref attribute. @@ -656,13 +656,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, +H5O__shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, const H5O_shared_t *shared_src, H5O_shared_t *shared_dst, - unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info) + unsigned *mesg_flags, H5O_copy_t *cpy_info) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -679,8 +679,7 @@ H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, dst_oloc.file = f; src_oloc.file = shared_src->file; src_oloc.addr = shared_src->u.loc.oh_addr; - if(H5O_copy_header_map(&src_oloc, &dst_oloc, dxpl_id, cpy_info, FALSE, - NULL, NULL) < 0) + if(H5O_copy_header_map(&src_oloc, &dst_oloc, cpy_info, FALSE, NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Set up destination message's shared info */ @@ -688,13 +687,12 @@ H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, } /* end if */ else /* Share the message */ - if(H5SM_try_share(f, dxpl_id, NULL, H5SM_WAS_DEFERRED, mesg_type->id, - shared_dst, mesg_flags) < 0) + if(H5SM_try_share(f, NULL, H5SM_WAS_DEFERRED, mesg_type->id, shared_dst, mesg_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "can't share message") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shared_post_copy_file() */ +} /* end H5O__shared_post_copy_file() */ /*------------------------------------------------------------------------- diff --git a/src/H5Oshared.h b/src/H5Oshared.h index 2465e65..fdde3dc 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -46,7 +46,7 @@ *------------------------------------------------------------------------- */ static H5_INLINE void * -H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, +H5O_SHARED_DECODE(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p) { void *ret_value = NULL; /* Return value */ @@ -66,7 +66,7 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, /* Check for shared message */ if(mesg_flags & H5O_MSG_FLAG_SHARED) { /* Retrieve native message info indirectly through shared message */ - if(NULL == (ret_value = H5O_shared_decode(f, dxpl_id, open_oh, ioflags, p, H5O_SHARED_TYPE))) + if(NULL == (ret_value = H5O_shared_decode(f, open_oh, ioflags, p, H5O_SHARED_TYPE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message") /* We currently do not support automatically fixing shared messages */ @@ -79,7 +79,7 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, } /* end if */ else { /* Decode native message directly */ - if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, open_oh, mesg_flags, ioflags, p))) + if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, open_oh, mesg_flags, ioflags, p))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode native message") } /* end else */ @@ -214,12 +214,12 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE herr_t -H5O_SHARED_DELETE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O_SHARED_DELETE(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -231,13 +231,13 @@ H5O_SHARED_DELETE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) /* Check for message tracked elsewhere */ if(H5O_IS_TRACKED_SHARED(sh_mesg->type)) { /* Decrement the reference count on the shared message/object */ - if(H5O_shared_delete(f, dxpl_id, open_oh, H5O_SHARED_TYPE, sh_mesg) < 0) + if(H5O__shared_delete(f, open_oh, H5O_SHARED_TYPE, sh_mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement ref count for shared message") } /* end if */ #ifdef H5O_SHARED_DELETE_REAL else { /* Decrement the reference count on the native message directly */ - if(H5O_SHARED_DELETE_REAL(f, dxpl_id, open_oh, _mesg) < 0) + if(H5O_SHARED_DELETE_REAL(f, open_oh, _mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement ref count for native message") } /* end else */ #endif /* H5O_SHARED_DELETE_REAL */ @@ -266,12 +266,12 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE herr_t -H5O_SHARED_LINK(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O_SHARED_LINK(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -283,13 +283,13 @@ H5O_SHARED_LINK(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) /* Check for message tracked elsewhere */ if(H5O_IS_TRACKED_SHARED(sh_mesg->type)) { /* Increment the reference count on the shared message/object */ - if(H5O_shared_link(f, dxpl_id, open_oh, H5O_SHARED_TYPE, sh_mesg) < 0) + if(H5O__shared_link(f, open_oh, H5O_SHARED_TYPE, sh_mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "unable to increment ref count for shared message") } /* end if */ #ifdef H5O_SHARED_LINK_REAL else { /* Increment the reference count on the native message directly */ - if(H5O_SHARED_LINK_REAL(f, dxpl_id, open_oh, _mesg) < 0) + if(H5O_SHARED_LINK_REAL(f, open_oh, _mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "unable to increment ref count for native message") } /* end else */ #endif /* H5O_SHARED_LINK_REAL */ @@ -319,12 +319,12 @@ done: static H5_INLINE void * H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, - void *udata, hid_t dxpl_id) + void *udata) { void *dst_mesg = NULL; /* Destination message */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -335,7 +335,7 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, #ifdef H5O_SHARED_COPY_FILE_REAL /* Call native message's copy file callback to copy the message */ - if(NULL == (dst_mesg = H5O_SHARED_COPY_FILE_REAL(file_src, H5O_SHARED_TYPE, _native_src, file_dst, recompute_size, cpy_info, udata, dxpl_id))) + if(NULL == (dst_mesg = H5O_SHARED_COPY_FILE_REAL(file_src, H5O_SHARED_TYPE, _native_src, file_dst, recompute_size, cpy_info, udata))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy native message to another file") #else /* H5O_SHARED_COPY_FILE_REAL */ /* No copy file callback defined, just copy the message itself */ @@ -347,8 +347,8 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, HDmemset(dst_mesg, 0, sizeof(H5O_shared_t)); /* Handle sharing destination message */ - if(H5O_shared_copy_file(file_src, file_dst, H5O_SHARED_TYPE, _native_src, - dst_mesg, recompute_size, mesg_flags, cpy_info, udata, dxpl_id) < 0) + if(H5O__shared_copy_file(file_src, file_dst, H5O_SHARED_TYPE, _native_src, + dst_mesg, recompute_size, mesg_flags, cpy_info, udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, NULL, "unable to determine if message should be shared") /* Set return value */ @@ -382,7 +382,7 @@ done: */ static H5_INLINE herr_t H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src, - H5O_loc_t *oloc_dst, void *mesg_dst, unsigned *mesg_flags, hid_t dxpl_id, + H5O_loc_t *oloc_dst, void *mesg_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info) { const H5O_shared_t *shared_src = (const H5O_shared_t *)mesg_src; /* Alias to shared info in native source */ @@ -406,21 +406,21 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src, #ifdef H5O_SHARED_POST_COPY_FILE_REAL /* Call native message's post copy file callback to copy the message */ - if(H5O_SHARED_POST_COPY_FILE_REAL(oloc_src, mesg_src, oloc_dst, mesg_dst, dxpl_id, cpy_info) <0 ) + if(H5O_SHARED_POST_COPY_FILE_REAL(oloc_src, mesg_src, oloc_dst, mesg_dst, cpy_info) <0 ) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy native message to another file") #endif /* H5O_SHARED_POST_COPY_FILE_REAL */ /* Update shared message after the post copy - will short circuit in * production if the DEFER pass determined it will not be shared; debug mode * verifies that it is indeed the case */ - if(H5O_shared_post_copy_file(oloc_dst->file, H5O_SHARED_TYPE, - shared_src, shared_dst, mesg_flags, dxpl_id, cpy_info) < 0) + if(H5O__shared_post_copy_file(oloc_dst->file, H5O_SHARED_TYPE, + shared_src, shared_dst, mesg_flags, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to fix shared message in post copy") #ifdef H5O_SHARED_POST_COPY_FILE_UPD /* Call native message's post copy file update callback to update the * message */ - if(H5O_SHARED_POST_COPY_FILE_UPD(oloc_src, mesg_src, oloc_dst, mesg_dst, dxpl_id, cpy_info) < 0) + if(H5O_SHARED_POST_COPY_FILE_UPD(oloc_src, mesg_src, oloc_dst, mesg_dst, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to update native message") #endif /* H5O_SHARED_POST_COPY_FILE_UPD */ @@ -452,8 +452,8 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE herr_t -H5O_SHARED_DEBUG(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth) +H5O_SHARED_DEBUG(H5F_t *f, const void *_mesg, FILE *stream, int indent, + int fwidth) { const H5O_shared_t *sh_mesg = (const H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ herr_t ret_value = SUCCEED; /* Return value */ @@ -478,7 +478,7 @@ H5O_SHARED_DEBUG(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, } /* end if */ /* Call native message's debug callback */ - if(H5O_SHARED_DEBUG_REAL(f, dxpl_id, _mesg, stream, indent, fwidth) < 0) + if(H5O_SHARED_DEBUG_REAL(f, _mesg, stream, indent, fwidth) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display native message info") done: diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 1cbfb05..2a3cdc3 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -27,13 +27,13 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_shmesg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__shmesg_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_shmesg_copy(const void *_mesg, void *_dest); static size_t H5O_shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_shmesg_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); +static herr_t H5O__shmesg_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ @@ -41,7 +41,7 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ "shared message table", /*message name for debugging */ sizeof(H5O_shmesg_table_t), /*native message size */ 0, /* messages are sharable? */ - H5O_shmesg_decode, /*decode message */ + H5O__shmesg_decode, /*decode message */ H5O_shmesg_encode, /*encode message */ H5O_shmesg_copy, /*copy the native value */ H5O_shmesg_size, /*raw message size */ @@ -56,12 +56,12 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_shmesg_debug /*debug the message */ + H5O__shmesg_debug /*debug the message */ }}; /*------------------------------------------------------------------------- - * Function: H5O_shmesg_decode + * Function: H5O__shmesg_decode * * Purpose: Decode a shared message table message and return a pointer * to a newly allocated H5O_shmesg_table_t struct. @@ -75,13 +75,13 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_shmesg_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__shmesg_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_shmesg_table_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -100,7 +100,7 @@ H5O_shmesg_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED * done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shmesg_decode() */ +} /* end H5O__shmesg_decode() */ /*------------------------------------------------------------------------- @@ -209,7 +209,7 @@ H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi /*------------------------------------------------------------------------- - * Function: H5O_shmesg_debug + * Function: H5O__shmesg_debug * * Purpose: Prints debugging info for the message. * @@ -221,12 +221,12 @@ H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi *------------------------------------------------------------------------- */ static herr_t -H5O_shmesg_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O__shmesg_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -243,5 +243,5 @@ H5O_shmesg_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const vo "Number of indexes:", mesg->nindexes); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_shmesg_debug() */ +} /* end H5O__shmesg_debug() */ diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 5c840a6..944a722 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -35,20 +35,20 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_stab_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__stab_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_stab_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_stab_copy(const void *_mesg, void *_dest); static size_t H5O_stab_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_stab_free(void *_mesg); -static herr_t H5O_stab_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); -static void *H5O_stab_copy_file(H5F_t *file_src, void *native_src, +static herr_t H5O__stab_free(void *_mesg); +static herr_t H5O__stab_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); +static void *H5O__stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id); -static herr_t H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, + H5O_copy_t *cpy_info, void *_udata); +static herr_t H5O__stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, - unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); -static herr_t H5O_stab_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, + unsigned *mesg_flags, H5O_copy_t *cpy_info); +static herr_t H5O__stab_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); /* This message derives from H5O message class */ @@ -57,22 +57,22 @@ const H5O_msg_class_t H5O_MSG_STAB[1] = {{ "stab", /*message name for debugging */ sizeof(H5O_stab_t), /*native message size */ 0, /* messages are sharable? */ - H5O_stab_decode, /*decode message */ + H5O__stab_decode, /*decode message */ H5O_stab_encode, /*encode message */ H5O_stab_copy, /*copy the native value */ H5O_stab_size, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_stab_free, /* free method */ - H5O_stab_delete, /* file delete method */ + H5O__stab_free, /* free method */ + H5O__stab_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ - H5O_stab_copy_file, /* copy native value to file */ - H5O_stab_post_copy_file, /* post copy native value to file */ + H5O__stab_copy_file, /* copy native value to file */ + H5O__stab_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_stab_debug /*debug the message */ + H5O__stab_debug /*debug the message */ }}; /* Declare a free list to manage the H5O_stab_t struct */ @@ -80,7 +80,7 @@ H5FL_DEFINE_STATIC(H5O_stab_t); /*------------------------------------------------------------------------- - * Function: H5O_stab_decode + * Function: H5O__stab_decode * * Purpose: Decode a symbol table message and return a pointer to * a newly allocated one. @@ -96,7 +96,7 @@ H5FL_DEFINE_STATIC(H5O_stab_t); *------------------------------------------------------------------------- */ static void * -H5O_stab_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__stab_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_stab_t *stab = NULL; @@ -124,7 +124,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_stab_decode() */ +} /* end H5O__stab_decode() */ /*------------------------------------------------------------------------- @@ -229,38 +229,36 @@ H5O_stab_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void ret_value = (size_t)(2 * H5F_SIZEOF_ADDR(f)); FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5O_stab_size() */ /*------------------------------------------------------------------------- - * Function: H5O_stab_free + * Function: H5O__stab_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, March 30, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_stab_free(void *mesg) +H5O__stab_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_stab_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_stab_free() */ +} /* end H5O__stab_free() */ /*------------------------------------------------------------------------- - * Function: H5O_stab_delete + * Function: H5O__stab_delete * * Purpose: Free file space referenced by message * @@ -272,27 +270,27 @@ H5O_stab_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_stab_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *mesg) +H5O__stab_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *mesg) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); HDassert(mesg); /* Free the file space for the symbol table */ - if(H5G__stab_delete(f, dxpl_id, (const H5O_stab_t *)mesg) < 0) + if(H5G__stab_delete(f, (const H5O_stab_t *)mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free symbol table") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_stab_delete() */ +} /* end H5O__stab_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_stab_copy_file + * Function: H5O__stab_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -306,9 +304,9 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, +H5O__stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata, hid_t dxpl_id) + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata) { H5O_stab_t *stab_src = (H5O_stab_t *) native_src; H5O_stab_t *stab_dst = NULL; @@ -316,7 +314,7 @@ H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, size_t size_hint; /* Local heap initial size */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(stab_src); @@ -327,18 +325,18 @@ H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Get the old local heap's size and use that as the hint for the new heap */ - if(H5HL_get_size(file_src, dxpl_id, stab_src->heap_addr, &size_hint) < 0) + if(H5HL_get_size(file_src, stab_src->heap_addr, &size_hint) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, NULL, "can't query local heap size") /* Set copy metadata tag */ - H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, NULL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Create components of symbol table message */ - if(H5G__stab_create_components(file_dst, stab_dst, size_hint, dxpl_id) < 0) + if(H5G__stab_create_components(file_dst, stab_dst, size_hint) < 0) HGOTO_ERROR_TAG(H5E_SYM, H5E_CANTINIT, NULL, "can't create symbol table components") /* Reset metadata tag */ - H5_END_TAG(NULL); + H5_END_TAG /* Cache stab in udata */ udata->cache_type = H5G_CACHED_STAB; @@ -354,11 +352,11 @@ done: stab_dst = H5FL_FREE(H5O_stab_t, stab_dst); FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_stab_copy_file() */ +} /* H5O__stab_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_stab_post_copy_file + * Function: H5O__stab_post_copy_file * * Purpose: Finish copying a message from between files * @@ -370,16 +368,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, +H5O__stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, - hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_copy_t *cpy_info) { const H5O_stab_t *stab_src = (const H5O_stab_t *)mesg_src; H5O_stab_t *stab_dst = (H5O_stab_t *)mesg_dst; H5G_bt_it_cpy_t udata; /* B-tree user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(stab_src); @@ -400,16 +398,16 @@ H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, udata.cpy_info = cpy_info; /* Iterate over objects in group, copying them */ - if((H5B_iterate(src_oloc->file, dxpl_id, H5B_SNODE, stab_src->btree_addr, H5G__node_copy, &udata)) < 0) + if((H5B_iterate(src_oloc->file, H5B_SNODE, stab_src->btree_addr, H5G__node_copy, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_stab_post_copy_file() */ +} /* H5O__stab_post_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_stab_debug + * Function: H5O__stab_debug * * Purpose: Prints debugging info for a symbol table message. * @@ -424,12 +422,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_stab_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__stab_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_stab_t *stab = (const H5O_stab_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -445,5 +443,5 @@ H5O_stab_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void "Name heap address:", stab->heap_addr); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__stab_debug() */ diff --git a/src/H5Otest.c b/src/H5Otest.c index 68462a1..c978d10 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -32,6 +32,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Opkg.h" /* Object headers */ @@ -97,6 +98,7 @@ H5O_is_attr_dense_test(hid_t oid) H5O_t *oh = NULL; /* Object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -105,15 +107,20 @@ H5O_is_attr_dense_test(hid_t oid) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, H5AC_ind_read_dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -128,8 +135,10 @@ H5O_is_attr_dense_test(hid_t oid) ret_value = FALSE; done: - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_is_attr_dense_test() */ @@ -162,6 +171,7 @@ H5O_is_attr_empty_test(hid_t oid) htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ H5O_loc_t *loc; /* Pointer to object's location */ hsize_t nattrs; /* Number of attributes */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -170,14 +180,19 @@ H5O_is_attr_empty_test(hid_t oid) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if((ainfo_exists = H5A_get_ainfo(loc->file, H5AC_ind_read_dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -192,15 +207,15 @@ H5O_is_attr_empty_test(hid_t oid) /* Check for any messages in object header */ HDassert(nattrs == 0); - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(H5AC_ind_read_dxpl_id, loc->addr, FAIL); + /* Set metadata tag in API context */ + H5_BEGIN_TAG(loc->addr); /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_read_dxpl_id, ainfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(loc->file, ainfo.name_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG /* Retrieve # of records in name index */ if(H5B2_get_nrec(bt2_name, &nattrs) < 0) @@ -219,10 +234,12 @@ H5O_is_attr_empty_test(hid_t oid) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, H5AC_ind_read_dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_is_attr_empty_test() */ @@ -255,6 +272,7 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ hsize_t obj_nattrs; /* Number of attributes */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -263,15 +281,20 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, H5AC_ind_read_dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -285,15 +308,15 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) /* Check for any messages in object header */ HDassert(obj_nattrs == 0); - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(H5AC_ind_read_dxpl_id, loc->addr, FAIL); + /* Set metadata tag in API context */ + H5_BEGIN_TAG(loc->addr); /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_read_dxpl_id, ainfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(loc->file, ainfo.name_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG /* Retrieve # of records in name index */ if(H5B2_get_nrec(bt2_name, &obj_nattrs) < 0) @@ -309,10 +332,12 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, H5AC_ind_read_dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_num_attrs_test() */ @@ -347,6 +372,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -355,29 +381,34 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(H5AC_ind_read_dxpl_id, loc->addr, FAIL); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Set metadata tag in API context */ + H5_BEGIN_TAG(loc->addr); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, H5AC_ind_read_dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR_TAG(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for 'dense' attribute storage file addresses being defined */ if(!H5F_addr_defined(ainfo.fheap_addr)) - HGOTO_DONE_TAG(FAIL, FAIL) + HGOTO_DONE_TAG(FAIL) if(!H5F_addr_defined(ainfo.name_bt2_addr)) - HGOTO_DONE_TAG(FAIL, FAIL) + HGOTO_DONE_TAG(FAIL) /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_read_dxpl_id, ainfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(loc->file, ainfo.name_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in name index */ @@ -387,7 +418,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) /* Check if there is a creation order index */ if(H5F_addr_defined(ainfo.corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(loc->file, H5AC_ind_read_dxpl_id, ainfo.corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(loc->file, ainfo.corder_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Retrieve # of records in creation order index */ @@ -397,17 +428,19 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) else *corder_count = 0; - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, H5AC_ind_read_dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, H5AC_ind_read_dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_attr_dense_info_test() */ @@ -450,7 +483,7 @@ H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Locate "unknown" message */ @@ -469,7 +502,7 @@ H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "'unknown' message type not found") done: - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -482,9 +515,7 @@ done: PURPOSE Expunge all the chunks for an object header from the cache. USAGE - herr_t H5O_expunge_chunks_test(f, dxpl_id, loc) - H5F_t *f; IN: Pointer to file that object is within - hid_t dxpl_id; IN: DXPL to use for operation + herr_t H5O_expunge_chunks_test(loc) H5O_loc_t *loc; IN: Object location for object header to expunge RETURNS Non-negative on success, negative on failure @@ -498,7 +529,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5O_expunge_chunks_test(const H5O_loc_t *loc, hid_t dxpl_id) +H5O_expunge_chunks_test(const H5O_loc_t *loc) { H5O_t *oh = NULL; /* Object header */ haddr_t chk_addr[16]; /* Array of chunk addresses */ @@ -509,7 +540,7 @@ H5O_expunge_chunks_test(const H5O_loc_t *loc, hid_t dxpl_id) FUNC_ENTER_NOAPI(FAIL) /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Safety check */ @@ -521,13 +552,13 @@ H5O_expunge_chunks_test(const H5O_loc_t *loc, hid_t dxpl_id) chk_addr[u] = oh->chunk[u].addr; /* Release the object header */ - if(H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header") /* Iterate over all the saved chunk addresses, evicting them from the cache */ /* (in reverse order, so that chunk #0 is unpinned) */ for(u = nchunks - 1; u < nchunks; u--) - if(H5AC_expunge_entry(loc->file, dxpl_id, (u == 0 ? H5AC_OHDR : H5AC_OHDR_CHK), chk_addr[u], H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(loc->file, (u == 0 ? H5AC_OHDR : H5AC_OHDR_CHK), chk_addr[u], H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTEXPUNGE, FAIL, "unable to expunge object header chunk") done: @@ -541,9 +572,8 @@ done: PURPOSE Retrieve the refcount for the object header USAGE - herr_t H5O_expunge_chunks_test(loc, dxpl_id, rc) + herr_t H5O_expunge_chunks_test(loc, rc) const H5O_loc_t *loc; IN: Object location for object header to query - hid_t dxpl_id; IN: DXPL to use for operation unsigned *rc; OUT: Pointer to refcount for object header RETURNS Non-negative on success, negative on failure @@ -557,7 +587,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5O_get_rc(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc) +H5O_get_rc(const H5O_loc_t *loc, unsigned *rc) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -569,7 +599,7 @@ H5O_get_rc(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc) HDassert(rc); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Save the refcount for the object header */ @@ -577,7 +607,7 @@ H5O_get_rc(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc) done: /* Release the object header */ - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header") FUNC_LEAVE_NOAPI(ret_value) @@ -612,6 +642,7 @@ H5O_msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) H5O_loc_t *loc; /* Pointer to object's location */ H5O_mesg_t *idx_msg; /* Pointer to message */ unsigned idx; /* Index of message */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -620,8 +651,13 @@ H5O_msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Locate first message of given type */ @@ -639,8 +675,10 @@ H5O_msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "message of type not found") done: - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_msg_get_chunkno_test() */ @@ -672,6 +710,7 @@ H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) H5O_loc_t *loc; /* Pointer to object's location */ H5O_mesg_t *curr_msg; /* Pointer to current message */ unsigned idx; /* Index of message */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -680,8 +719,13 @@ H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Locate first message of given type */ @@ -731,7 +775,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, (curr_msg->raw_size + H5O_SIZEOF_MSGHDR_OH(oh)), oh->nmesgs, &found_msg, &new_idx) < 0) + if(H5O__alloc_chunk(loc->file, oh, (curr_msg->raw_size + (size_t)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 */ @@ -739,8 +783,10 @@ H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) } /* end if */ done: - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_msg_get_chunkno_test() */ diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c index 1b3a997..dbab28c 100644 --- a/src/H5Ounknown.c +++ b/src/H5Ounknown.c @@ -32,7 +32,7 @@ /* PRIVATE PROTOTYPES */ -static herr_t H5O_unknown_free(void *_mesg); +static herr_t H5O__unknown_free(void *_mesg); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_UNKNOWN[1] = {{ @@ -45,7 +45,7 @@ const H5O_msg_class_t H5O_MSG_UNKNOWN[1] = {{ NULL, /*copy the native value */ NULL, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_unknown_free, /* free method */ + H5O__unknown_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ @@ -63,9 +63,9 @@ H5FL_DEFINE(H5O_unknown_t); /*------------------------------------------------------------------------- - * Function: H5O_unknown_free + * Function: H5O__unknown_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -75,14 +75,14 @@ H5FL_DEFINE(H5O_unknown_t); *------------------------------------------------------------------------- */ static herr_t -H5O_unknown_free(void *mesg) +H5O__unknown_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_unknown_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_unknown_free() */ +} /* end H5O__unknown_free() */ diff --git a/src/H5P.c b/src/H5P.c index 49bea0a..9243d41 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -27,6 +27,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Ppkg.h" /* Property lists */ @@ -96,6 +97,7 @@ hid_t H5Pcopy(hid_t id) { void *obj; /* Property object to copy */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value=FALSE; /* return value */ FUNC_ENTER_API(FAIL) @@ -109,6 +111,10 @@ H5Pcopy(hid_t id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property object"); if(NULL == (obj = H5I_object(id))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property object doesn't exist"); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Compare property lists */ if(H5I_GENPROP_LST == H5I_get_type(id)) { @@ -131,6 +137,8 @@ H5Pcopy(hid_t id) } /* end else */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Pcopy() */ @@ -1501,6 +1509,7 @@ done: herr_t H5Pclose(hid_t plist_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -1511,6 +1520,10 @@ H5Pclose(hid_t plist_id) /* Check arguments. */ if(H5I_GENPROP_LST != H5I_get_type(plist_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Close the property list */ if(H5I_dec_app_ref(plist_id) < 0) @@ -1518,6 +1531,8 @@ H5Pclose(hid_t plist_id) } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Pclose() */ diff --git a/src/H5PB.c b/src/H5PB.c index 63e5e7a..dab69f4 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -123,8 +123,8 @@ typedef struct { /* Local Prototypes */ /********************/ static herr_t H5PB__insert_entry(H5PB_t *page_buf, H5PB_entry_t *page_entry); -static htri_t H5PB__make_space(const H5F_io_info2_t *fio_info, H5PB_t *page_buf, H5FD_mem_t inserted_type); -static herr_t H5PB__write_entry(const H5F_io_info2_t *fio_info, H5PB_entry_t *page_entry); +static htri_t H5PB__make_space(H5F_t *f, H5PB_t *page_buf, H5FD_mem_t inserted_type); +static herr_t H5PB__write_entry(H5F_t *f, H5PB_entry_t *page_entry); /*********************/ @@ -369,18 +369,18 @@ static herr_t H5PB__flush_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) { H5PB_entry_t *page_entry = (H5PB_entry_t *)item; /* Pointer to page entry node */ - const H5F_io_info2_t *fio_info = (const H5F_io_info2_t *)_op_data; + H5F_t *f = (H5F_t *)_op_data; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC /* Sanity checks */ HDassert(page_entry); - HDassert(fio_info); + HDassert(f); /* Flush the page if it's dirty */ if(page_entry->is_dirty) - if(H5PB__write_entry(fio_info, page_entry) < 0) + if(H5PB__write_entry(f, page_entry) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "file write failed") done: @@ -400,24 +400,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PB_flush(const H5F_io_info2_t *fio_info) +H5PB_flush(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(fio_info); - HDassert(fio_info->f); - HDassert(fio_info->meta_dxpl); - HDassert(fio_info->raw_dxpl); + HDassert(f); /* Flush all the entries in the PB skiplist, if we have write access on the file */ - if(fio_info->f->shared->page_buf && (H5F_ACC_RDWR & H5F_INTENT(fio_info->f))) { - H5PB_t *page_buf = fio_info->f->shared->page_buf; + if(f->shared->page_buf && (H5F_ACC_RDWR & H5F_INTENT(f))) { + H5PB_t *page_buf = f->shared->page_buf; /* Iterate over all entries in page buffer skip list */ - if(H5SL_iterate(page_buf->slist_ptr, H5PB__flush_cb, (void *)fio_info)) + if(H5SL_iterate(page_buf->slist_ptr, H5PB__flush_cb, (void *)f)) HGOTO_ERROR(H5E_PAGEBUF, H5E_BADITER, FAIL, "can't flush page buffer skip list") } /* end if */ @@ -475,16 +472,13 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) *------------------------------------------------------------------------- */ herr_t -H5PB_dest(const H5F_io_info2_t *fio_info) +H5PB_dest(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ - H5F_t *f; /* file pointer */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(fio_info); - f = fio_info->f; HDassert(f); /* flush and destroy the page buffer, if it exists */ @@ -492,7 +486,7 @@ H5PB_dest(const H5F_io_info2_t *fio_info) H5PB_t *page_buf = f->shared->page_buf; H5PB_ud1_t op_data; /* Iteration context */ - if(H5PB_flush(fio_info)<0) + if(H5PB_flush(f) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTFLUSH, FAIL, "can't flush page buffer") /* Set up context info */ @@ -512,10 +506,6 @@ H5PB_dest(const H5F_io_info2_t *fio_info) if(H5FL_fac_term(page_buf->page_fac) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTRELEASE, FAIL, "can't destroy page buffer page factory") -#ifdef QAK -H5PB_print_stats(page_buf); -#endif /* QAK */ - f->shared->page_buf = H5FL_FREE(H5PB_t, page_buf); } /* end if */ @@ -693,12 +683,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, - size_t size, void *buf/*out*/) +H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/) { H5PB_t *page_buf; /* Page buffering info for this file */ H5PB_entry_t *page_entry; /* Pointer to the corresponding page entry */ - H5FD_io_info_t fdio_info; /* File driver I/O info */ + H5FD_t *file; /* File driver pointer */ haddr_t first_page_addr, last_page_addr; /* Addresses of the first and last pages covered by I/O */ haddr_t offset; haddr_t search_addr; /* Address of current page */ @@ -711,20 +700,21 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(fio_info); + HDassert(f); + HDassert(type != H5FD_MEM_GHEAP); /* Get pointer to page buffer info for this file */ - page_buf = fio_info->f->shared->page_buf; + page_buf = f->shared->page_buf; #ifdef H5_HAVE_PARALLEL - if(H5F_HAS_FEATURE(fio_info->f, H5FD_FEAT_HAS_MPI)) { + if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { #if 1 bypass_pb = TRUE; #else /* MSC - why this stopped working ? */ int mpi_size; - if((mpi_size = H5F_mpi_get_size(fio_info->f)) < 0) + if((mpi_size = H5F_mpi_get_size(f)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size") if(1 != mpi_size) bypass_pb = TRUE; @@ -738,12 +728,12 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, */ if(NULL == page_buf || size >= page_buf->page_size || (bypass_pb && H5FD_MEM_DRAW == type)) { - if(H5F__accum_read(fio_info, type, addr, size, buf) < 0) + if(H5F__accum_read(f, type, addr, size, buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_READERROR, FAIL, "read through metadata accumulator failed") /* Update statistics */ if(page_buf) { - if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP) + if(type == H5FD_MEM_DRAW) page_buf->bypasses[1] ++; else page_buf->bypasses[0] ++; @@ -759,7 +749,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, /* Update statistics */ if(page_buf) { - if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP) + if(type == H5FD_MEM_DRAW) page_buf->accesses[1]++; else page_buf->accesses[0]++; @@ -789,9 +779,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, } /* end else */ /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + file = f->shared->lf; /* Copy raw data from dirty pages into the read buffer if the read request spans pages in the page buffer*/ @@ -890,7 +878,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, H5PB__MOVE_TO_TOP_LRU(page_buf, page_entry) /* Update statistics */ - if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP) + if(type == H5FD_MEM_DRAW) page_buf->hits[1]++; else page_buf->hits[0]++; @@ -906,7 +894,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, htri_t can_make_space; /* check if we can make space in page buffer */ - if((can_make_space = H5PB__make_space(fio_info, page_buf, type)) < 0) + if((can_make_space = H5PB__make_space(f, page_buf, type)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_NOSPACE, FAIL, "make space in Page buffer Failed") /* if make_space returns 0, then we can't use the page @@ -916,7 +904,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, HDassert(0 == i); /* read entire block from VFD and return */ - if(H5FD_read(&fdio_info, type, addr, size, buf) < 0) + if(H5FD_read(file, type, addr, size, buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_READERROR, FAIL, "driver read request failed") /* Break out of loop */ @@ -931,7 +919,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, /* Read page through the VFD layer, but make sure we don't read past the EOA. */ /* Retrieve the 'eoa' for the file */ - if(HADDR_UNDEF == (eoa = H5F_get_eoa(fio_info->f, type))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type))) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eoa request failed") /* If the entire page falls outside the EOA, then fail */ @@ -943,7 +931,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, page_size = (size_t)(eoa - search_addr); /* Read page from VFD */ - if(H5FD_read(&fdio_info, type, search_addr, page_size, new_page_buf) < 0) + if(H5FD_read(file, type, search_addr, page_size, new_page_buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_READERROR, FAIL, "driver read request failed") /* Copy the requested data from the page into the input buffer */ @@ -965,7 +953,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTSET, FAIL, "error inserting new page in page buffer") /* Update statistics */ - if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP) + if(type == H5FD_MEM_DRAW) page_buf->misses[1]++; else page_buf->misses[0]++; @@ -992,12 +980,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, +H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf) { H5PB_t *page_buf; /* Page buffering info for this file */ H5PB_entry_t *page_entry; /* Pointer to the corresponding page entry */ - H5FD_io_info_t fdio_info; /* File driver I/O info */ + H5FD_t *file; /* File driver pointer */ haddr_t first_page_addr, last_page_addr; /* Addresses of the first and last pages covered by I/O */ haddr_t offset; haddr_t search_addr; /* Address of current page */ @@ -1010,21 +998,20 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(fio_info); - HDassert(fio_info->f); + HDassert(f); /* Get pointer to page buffer info for this file */ - page_buf = fio_info->f->shared->page_buf; + page_buf = f->shared->page_buf; #ifdef H5_HAVE_PARALLEL - if(H5F_HAS_FEATURE(fio_info->f, H5FD_FEAT_HAS_MPI)) { + if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { #if 1 bypass_pb = TRUE; #else /* MSC - why this stopped working ? */ int mpi_size; - if((mpi_size = H5F_mpi_get_size(fio_info->f)) < 0) + if((mpi_size = H5F_mpi_get_size(f)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size") if(1 != mpi_size) bypass_pb = TRUE; @@ -1037,7 +1024,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, * buffering. */ if(NULL == page_buf || size >= page_buf->page_size || bypass_pb) { - if(H5F__accum_write(fio_info, type, addr, size, buf) < 0) + if(H5F__accum_write(f, type, addr, size, buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "write through metadata accumulator failed") /* Update statistics */ @@ -1096,9 +1083,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, } /* end else */ /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + file = f->shared->lf; /* Check if existing pages for raw data need to be updated since raw data access is not atomic */ if(H5FD_MEM_DRAW == type && size >= page_buf->page_size) { @@ -1210,7 +1195,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, htri_t can_make_space; /* Check if we can make space in page buffer */ - if((can_make_space = H5PB__make_space(fio_info, page_buf, type)) < 0) + if((can_make_space = H5PB__make_space(f, page_buf, type)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_NOSPACE, FAIL, "make space in Page buffer Failed") /* If make_space returns 0, then we can't use the page @@ -1220,7 +1205,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, HDassert(0 == i); /* Write to VFD and return */ - if(H5FD_write(&fdio_info, type, addr, size, buf) < 0) + if(H5FD_write(file, type, addr, size, buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "driver write request failed") /* Break out of loop */ @@ -1229,7 +1214,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, } /* end if */ /* Don't bother searching if there is no write access */ - if(H5F_ACC_RDWR & H5F_INTENT(fio_info->f)) + if(H5F_ACC_RDWR & H5F_INTENT(f)) /* Lookup & remove the page from the new skip list page if * it exists to see if this is a new page from the MF layer */ @@ -1272,7 +1257,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, page_entry->type = (H5F_mem_page_t)type; /* Retrieve the 'eoa' for the file */ - if(HADDR_UNDEF == (eoa = H5F_get_eoa(fio_info->f, type))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type))) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eoa request failed") /* If the entire page falls outside the EOA, then fail */ @@ -1283,8 +1268,8 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, * returned will most likely be HADDR_UNDEF, so skip * that check. */ - if(!H5F_HAS_FEATURE(fio_info->f, H5FD_FEAT_HAS_MPI)) - if(HADDR_UNDEF == (eof = H5FD_get_eof(fio_info->f->shared->lf, H5FD_MEM_DEFAULT))) + if(!H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) + if(HADDR_UNDEF == (eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eof request failed") /* Adjust the read size to not go beyond the EOA */ @@ -1292,7 +1277,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, page_size = (size_t)(eoa - search_addr); if(search_addr < eof) { - if(H5FD_read(&fdio_info, type, search_addr, page_size, new_page_buf) < 0) + if(H5FD_read(file, type, search_addr, page_size, new_page_buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_READERROR, FAIL, "driver read request failed") /* Update statistics */ @@ -1393,8 +1378,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5PB__make_space(const H5F_io_info2_t *fio_info, H5PB_t *page_buf, - H5FD_mem_t inserted_type) +H5PB__make_space(H5F_t *f, H5PB_t *page_buf, H5FD_mem_t inserted_type) { H5PB_entry_t *page_entry; /* Pointer to page eviction candidate */ htri_t ret_value = TRUE; /* Return value */ @@ -1402,7 +1386,7 @@ H5PB__make_space(const H5F_io_info2_t *fio_info, H5PB_t *page_buf, FUNC_ENTER_STATIC /* Sanity check */ - HDassert(fio_info); + HDassert(f); HDassert(page_buf); /* Get oldest entry */ @@ -1459,7 +1443,7 @@ H5PB__make_space(const H5F_io_info2_t *fio_info, H5PB_t *page_buf, /* Flush page if dirty */ if(page_entry->is_dirty) - if(H5PB__write_entry(fio_info, page_entry) < 0) + if(H5PB__write_entry(f, page_entry) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "file write failed") /* Update statistics */ @@ -1493,7 +1477,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5PB__write_entry(const H5F_io_info2_t *fio_info, H5PB_entry_t *page_entry) +H5PB__write_entry(H5F_t *f, H5PB_entry_t *page_entry) { haddr_t eoa; /* Current EOA for the file */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1501,31 +1485,28 @@ H5PB__write_entry(const H5F_io_info2_t *fio_info, H5PB_entry_t *page_entry) FUNC_ENTER_STATIC /* Sanity check */ - HDassert(fio_info); - HDassert(fio_info->f); + HDassert(f); HDassert(page_entry); /* Retrieve the 'eoa' for the file */ - if(HADDR_UNDEF == (eoa = H5F_get_eoa(fio_info->f, (H5FD_mem_t)page_entry->type))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(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 * the EOA, then the entire page is discarded without writing. */ if(page_entry->addr <= eoa) { - H5FD_io_info_t fdio_info; /* File driver I/O info */ - size_t page_size = fio_info->f->shared->page_buf->page_size; + H5FD_t *file; /* File driver I/O info */ + size_t page_size = f->shared->page_buf->page_size; /* Adjust the page length if it exceeds the EOA */ if((page_entry->addr + page_size) > eoa) page_size = (size_t)(eoa - page_entry->addr); /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + file = f->shared->lf; - if(H5FD_write(&fdio_info, (H5FD_mem_t)page_entry->type, page_entry->addr, page_size, page_entry->page_buf_ptr) < 0) + if(H5FD_write(file, (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/src/H5PBprivate.h b/src/H5PBprivate.h index e6f2874..aef87e1 100644 --- a/src/H5PBprivate.h +++ b/src/H5PBprivate.h @@ -86,15 +86,15 @@ typedef struct H5PB_t { /* General routines */ H5_DLL herr_t H5PB_create(H5F_t *file, size_t page_buffer_size, unsigned page_buf_min_meta_perc, unsigned page_buf_min_raw_perc); -H5_DLL herr_t H5PB_flush(const H5F_io_info2_t *fio_info); -H5_DLL herr_t H5PB_dest(const H5F_io_info2_t *fio_info); +H5_DLL herr_t H5PB_flush(H5F_t *f); +H5_DLL herr_t H5PB_dest(H5F_t *f); H5_DLL herr_t H5PB_add_new_page(H5F_t *f, H5FD_mem_t type, haddr_t page_addr); H5_DLL herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf); H5_DLL herr_t H5PB_remove_entry(const H5F_t *f, haddr_t addr); -H5_DLL herr_t H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, - haddr_t addr, size_t size, void *buf/*out*/); -H5_DLL herr_t H5PB_write(const H5F_io_info2_t *f, H5FD_mem_t type, haddr_t addr, - size_t size, const void *buf); +H5_DLL herr_t H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, + void *buf/*out*/); +H5_DLL herr_t H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, + const void *buf); /* Statistics routines */ H5_DLL herr_t H5PB_reset_stats(H5PB_t *page_buf); diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 3b4c159..14701ff 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -34,6 +34,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -3184,6 +3185,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) { H5P_genplist_t *plist; /* Property list pointer */ H5O_fill_t fill; /* Fill value to modify */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -3192,6 +3194,10 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) /* Get the plist 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") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Get the current fill value */ if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) @@ -3217,7 +3223,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HDmemcpy(fill.buf, value, (size_t)fill.size); /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(type, type, NULL, NULL, H5AC_ind_read_dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(type, type))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types") /* If necessary, convert fill value datatypes (which copies VL components, etc.) */ @@ -3229,7 +3235,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Convert the fill value */ - if(H5T_convert(tpath, type_id, type_id, (size_t)1, (size_t)0, (size_t)0, fill.buf, bkg_buf, H5AC_ind_read_dxpl_id) < 0) { + if(H5T_convert(tpath, type_id, type_id, (size_t)1, (size_t)0, (size_t)0, fill.buf, bkg_buf) < 0) { if(bkg_buf) bkg_buf = H5FL_BLK_FREE(type_conv, bkg_buf); HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") @@ -3248,6 +3254,8 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set fill value") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Pset_fill_value() */ @@ -3269,8 +3277,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/, - hid_t dxpl_id) +H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/) { H5O_fill_t fill; /* Fill value to retrieve */ H5T_path_t *tpath; /*type conversion info */ @@ -3302,7 +3309,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/, /* * Can we convert between the source and destination datatypes? */ - if(NULL == (tpath = H5T_path_find(fill.type, type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(fill.type, type))) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes") if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill.type, H5T_COPY_TRANSIENT), FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy/register datatype") @@ -3328,7 +3335,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/, /* Do the conversion */ if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(type, H5T_COPY_TRANSIENT), FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy/register datatype") - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "datatype conversion failed") if(buf != value) HDmemcpy(value, buf, H5T_get_size(type)); @@ -3368,6 +3375,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ H5T_t *type; /* Datatype */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -3382,12 +3390,18 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) /* Get the plist 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") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Get the fill value */ - if(H5P_get_fill_value(plist, type, value, H5AC_ind_read_dxpl_id) < 0) + if(H5P_get_fill_value(plist, type, value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Pget_fill_value() */ diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 3c53c15..e33e762 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -129,14 +129,6 @@ /* Definitions for cause of broken collective io property */ #define H5D_MPIO_NO_COLLECTIVE_CAUSE_SIZE sizeof(uint32_t) #define H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF H5D_MPIO_COLLECTIVE -#ifdef H5_HAVE_PARALLEL -/* Definitions for memory MPI type property */ -#define H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE sizeof(MPI_Datatype) -#define H5FD_MPI_XFER_MEM_MPI_TYPE_DEF MPI_DATATYPE_NULL -/* Definitions for file MPI type property */ -#define H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE sizeof(MPI_Datatype) -#define H5FD_MPI_XFER_FILE_MPI_TYPE_DEF MPI_DATATYPE_NULL -#endif /* H5_HAVE_PARALLEL */ /* Definitions for EDC property */ #define H5D_XFER_EDC_SIZE sizeof(H5Z_EDC_t) @@ -176,22 +168,6 @@ #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 -#define H5AC_XFER_RING_ENC H5P__encode_unsigned -#define H5AC_XFER_RING_DEC H5P__decode_unsigned -#ifdef H5_DEBUG_BUILD -/* dxpl I/O type - private property */ -#define H5FD_DXPL_TYPE_SIZE sizeof(H5FD_dxpl_type_t) -#endif /* H5_DEBUG_BUILD */ -#ifdef H5_HAVE_PARALLEL -/* Definition for reading metadata collectively */ -#define H5D_XFER_COLL_MD_READ_SIZE sizeof(H5P_coll_md_read_flag_t) -#define H5D_XFER_COLL_MD_READ_DEF H5P_USER_FALSE -#define H5D_XFER_COLL_MD_READ_ENC H5P__encode_coll_md_read_flag_t -#define H5D_XFER_COLL_MD_READ_DEC H5P__decode_coll_md_read_flag_t -#endif /* H5_HAVE_PARALLEL */ /******************/ @@ -278,7 +254,6 @@ static const void *H5D_def_vlen_alloc_info_g = H5D_XFER_VLEN_ALLOC_INFO_DEF; / static const H5MM_free_t H5D_def_vlen_free_g = H5D_XFER_VLEN_FREE_DEF; /* Default value for vlen free function */ static const void *H5D_def_vlen_free_info_g = H5D_XFER_VLEN_FREE_INFO_DEF; /* Default value for vlen free information */ static const size_t H5D_def_hyp_vec_size_g = H5D_XFER_HYPER_VECTOR_SIZE_DEF; /* Default value for vector size */ -static const haddr_t H5D_def_tag_g = H5AC_TAG_DEF; /* Default value for cache entry tag */ static const H5FD_mpio_xfer_t H5D_def_io_xfer_mode_g = H5D_XFER_IO_XFER_MODE_DEF; /* Default value for I/O transfer mode */ static const H5FD_mpio_chunk_opt_t H5D_def_mpio_chunk_opt_mode_g = H5D_XFER_MPIO_CHUNK_OPT_HARD_DEF; static const H5FD_mpio_collective_opt_t H5D_def_mpio_collective_opt_mode_g = H5D_XFER_MPIO_COLLECTIVE_OPT_DEF; @@ -287,11 +262,6 @@ static const unsigned H5D_def_mpio_chunk_opt_ratio_g = H5D_XFER_MPIO_CHUNK_OPT_R static const H5D_mpio_actual_chunk_opt_mode_t H5D_def_mpio_actual_chunk_opt_mode_g = H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_DEF; static const H5D_mpio_actual_io_mode_t H5D_def_mpio_actual_io_mode_g = H5D_MPIO_ACTUAL_IO_MODE_DEF; static const H5D_mpio_no_collective_cause_t H5D_def_mpio_no_collective_cause_g = H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF; -#ifdef H5_HAVE_PARALLEL -static const MPI_Datatype H5D_def_btype_g = H5FD_MPI_XFER_MEM_MPI_TYPE_DEF; /* Default value for MPI buffer type */ -static const MPI_Datatype H5D_def_ftype_g = H5FD_MPI_XFER_FILE_MPI_TYPE_DEF; /* Default value for MPI file type */ -static const H5P_coll_md_read_flag_t H5D_def_coll_md_read_g = H5D_XFER_COLL_MD_READ_DEF; /* Default setting for the collective metedata read flag */ -#endif /* H5_HAVE_PARALLEL */ static const H5Z_EDC_t H5D_def_enable_edc_g = H5D_XFER_EDC_DEF; /* Default value for EDC property */ static const H5Z_cb_t H5D_def_filter_cb_g = H5D_XFER_FILTER_CB_DEF; /* Default value for filter callback */ static const H5T_conv_cb_t H5D_def_conv_cb_g = H5D_XFER_CONV_CB_DEF; /* Default value for datatype conversion callback */ @@ -303,10 +273,6 @@ static const uint32_t H5D_def_direct_chunk_datasize_g = H5D_XFER_DIRECT_CHUNK_WR 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 */ -#endif /* H5_DEBUG_BUILD */ /*------------------------------------------------------------------------- @@ -333,11 +299,6 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the cache tag property */ - if(H5P_register_real(pclass, H5AC_TAG_NAME, H5AC_TAG_SIZE, &H5D_def_tag_g, - 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 type conversion buffer property */ /* (Note: this property should not have an encode/decode callback -QAK) */ if(H5P_register_real(pclass, H5D_XFER_TCONV_BUF_NAME, H5D_XFER_TCONV_BUF_SIZE, &H5D_def_tconv_buf_g, @@ -438,27 +399,6 @@ 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") -#ifdef H5_HAVE_PARALLEL - /* Register the MPI memory type property */ - /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE, &H5D_def_btype_g, - 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 MPI file type property */ - /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE, &H5D_def_ftype_g, - 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 metadata collective read flag */ - if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5D_XFER_COLL_MD_READ_SIZE, - &H5D_def_coll_md_read_g, - NULL, NULL, NULL, H5D_XFER_COLL_MD_READ_ENC, H5D_XFER_COLL_MD_READ_DEC, - NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") -#endif /* H5_HAVE_PARALLEL */ - /* Register the EDC property */ if(H5P_register_real(pclass, H5D_XFER_EDC_NAME, H5D_XFER_EDC_SIZE, &H5D_def_enable_edc_g, NULL, NULL, NULL, H5D_XFER_EDC_ENC, H5D_XFER_EDC_DEC, @@ -525,19 +465,6 @@ 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 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, - NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - -#ifdef H5_DEBUG_BUILD - /* Register the dxpl IO type property */ - if(H5P_register_real(pclass, H5FD_DXPL_TYPE_NAME, H5FD_DXPL_TYPE_SIZE, &H5D_dxpl_type_g, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") -#endif /* H5_DEBUG_BUILD */ - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dxfr_reg_prop() */ diff --git a/src/H5Pint.c b/src/H5Pint.c index fe17a19..0e78463 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -273,16 +273,15 @@ const H5P_libclass_t H5P_CLS_TACC[1] = {{ /* Library property list classes defined in other code modules */ +/* (And not present in src/H5Pprivate.h) */ H5_DLLVAR const H5P_libclass_t H5P_CLS_OCRT[1]; /* Object creation */ H5_DLLVAR const H5P_libclass_t H5P_CLS_STRCRT[1]; /* String create */ H5_DLLVAR const H5P_libclass_t H5P_CLS_GCRT[1]; /* Group create */ -H5_DLLVAR const H5P_libclass_t H5P_CLS_OCPY[1]; /* Object copy */ H5_DLLVAR const H5P_libclass_t H5P_CLS_FCRT[1]; /* File creation */ H5_DLLVAR const H5P_libclass_t H5P_CLS_DCRT[1]; /* Dataset creation */ H5_DLLVAR const H5P_libclass_t H5P_CLS_DXFR[1]; /* Data transfer */ H5_DLLVAR const H5P_libclass_t H5P_CLS_FMNT[1]; /* File mount */ H5_DLLVAR const H5P_libclass_t H5P_CLS_ACRT[1]; /* Attribute creation */ -H5_DLLVAR const H5P_libclass_t H5P_CLS_LCRT[1]; /* Link creation */ /*****************************/ @@ -2858,6 +2857,7 @@ H5P__set_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, { H5P_prop_set_ud_t *udata = (H5P_prop_set_ud_t *)_udata; /* User data for callback */ void *tmp_value = NULL; /* Temporary value for property */ + const void *prp_value = NULL; /* Property value */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2881,10 +2881,13 @@ H5P__set_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, /* Call user's callback */ if((*(prop->set))(plist->plist_id, name, prop->size, tmp_value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set property value") + + /* Set the pointer for copying */ + prp_value = tmp_value; } /* end if */ /* No 'set' callback, just copy value */ else - tmp_value = (void *)udata->value; /* Casting away const OK -QAK */ + prp_value = udata->value; /* Free any previous value for the property */ if(NULL != prop->del) { @@ -2894,11 +2897,11 @@ H5P__set_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, } /* end if */ /* Copy new [possibly unchanged] value into property value */ - HDmemcpy(prop->value, tmp_value, prop->size); + HDmemcpy(prop->value, prp_value, prop->size); done: /* Free the temporary value buffer */ - if(tmp_value != NULL && tmp_value != udata->value) + if(tmp_value != NULL) H5MM_xfree(tmp_value); FUNC_LEAVE_NOAPI(ret_value) @@ -2933,6 +2936,7 @@ H5P__set_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, H5P_prop_set_ud_t *udata = (H5P_prop_set_ud_t *)_udata; /* User data for callback */ H5P_genprop_t *pcopy = NULL; /* Copy of property to insert into skip list */ void *tmp_value = NULL; /* Temporary value for property */ + const void *prp_value = NULL; /* Property value */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2957,16 +2961,19 @@ H5P__set_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, /* Call user's callback */ if((*(prop->set))(plist->plist_id, name, prop->size, tmp_value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set property value") + + /* Set the pointer for copying */ + prp_value = tmp_value; } /* end if */ /* No 'set' callback, just copy value */ else - tmp_value = (void *)udata->value; /* Casting away const OK -QAK */ + prp_value = udata->value; /* Make a copy of the class's property */ if(NULL == (pcopy = H5P_dup_prop(prop, H5P_PROP_WITHIN_LIST))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "Can't copy property") - HDmemcpy(pcopy->value, tmp_value, pcopy->size); + HDmemcpy(pcopy->value, prp_value, pcopy->size); /* Insert the changed property into the property list */ if(H5P_add_prop(plist->props, pcopy) < 0) @@ -2974,7 +2981,7 @@ H5P__set_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, done: /* Free the temporary value buffer */ - if(tmp_value != NULL && tmp_value != udata->value) + if(tmp_value != NULL) H5MM_xfree(tmp_value); /* Cleanup on failure */ @@ -5435,90 +5442,30 @@ H5P_get_class(const H5P_genplist_t *plist) /*------------------------------------------------------------------------- - * Function: H5P_verify_apl_and_dxpl + * Function: H5P_get_default * - * Purpose: Validate access property list and/or switch from generic - * property list to default of correct type. + * Purpose: Get the default property list ID, for a property class. * - * Also, if using internal DXPL and collective flag is set, - * switch to internal collective DXPL. - * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative ID of property list. + * Failure: negative. * - * Programmer: Mohamad Chaarawi - * Sunday, June 21, 2015 + * Programmer: Quincey Koziol + * December 29, 2017 * *------------------------------------------------------------------------- */ -herr_t -H5P_verify_apl_and_dxpl(hid_t *acspl_id, const H5P_libclass_t *libclass, hid_t *dxpl_id, - hid_t -#ifndef H5_HAVE_PARALLEL - H5_ATTR_UNUSED -#endif /* H5_HAVE_PARALLEL */ - loc_id, hbool_t -#ifndef H5_HAVE_PARALLEL - H5_ATTR_UNUSED -#endif /* H5_HAVE_PARALLEL */ - is_collective) +hid_t +H5P_get_default(const H5P_libclass_t *libclass) { - herr_t ret_value = SUCCEED; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(H5I_INVALID_HID) - /* Sanity check */ - HDassert(acspl_id); HDassert(libclass); - HDassert(dxpl_id); -#ifdef H5_HAVE_PARALLEL - /* If parallel is enabled and the file driver used in the MPI-IO - VFD, issue an MPI barrier for easier debugging if the API function - calling this is supposed to be called collectively. Note that this - happens only when the environment variable H5_COLL_BARRIER is set - to non 0. */ - if(is_collective && H5_coll_api_sanity_check_g) { - MPI_Comm mpi_comm; /* file communicator */ - - /* retrieve the MPI communicator from the loc_id or the fapl_id */ - if(H5F_mpi_retrieve_comm(loc_id, *acspl_id, &mpi_comm) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") - - /* issue the barrier */ - if(mpi_comm != MPI_COMM_NULL) - MPI_Barrier(mpi_comm); - } -#endif /* H5_HAVE_PARALLEL */ - - /* Set access plist to the default property list of the appropriate class if it's the generic default */ - if(H5P_DEFAULT == *acspl_id) - *acspl_id = *libclass->def_plist_id; - else { -#ifdef H5_HAVE_PARALLEL - H5P_coll_md_read_flag_t md_coll_read; /* Collective metadata read flag */ - H5P_genplist_t *plist; /* Property list pointer */ -#endif /* H5_HAVE_PARALLEL */ - - /* Sanity check the access property list class */ - if(TRUE != H5P_isa_class(*acspl_id, *libclass->class_id)) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not the required access property list") - -#ifdef H5_HAVE_PARALLEL - /* Get the plist structure for the access property list */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(*acspl_id))) - HGOTO_ERROR(H5E_PLIST, H5E_BADATOM, FAIL, "can't find object for ID") - - /* Get the collective metadata read flag */ - if(H5P_peek(plist, H5_COLL_MD_READ_FLAG_NAME, &md_coll_read) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get core collective metadata read flag") - - /* If collective metadata read requested and using internal DXPL, switch to internal collective DXPL */ - if(H5P_USER_TRUE == md_coll_read) - *dxpl_id = H5AC_coll_read_dxpl_id; -#endif /* H5_HAVE_PARALLEL */ - } /* end else */ + ret_value = *libclass->def_plist_id; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_verify_apl_and_dxpl() */ +} /* end H5P_get_default() */ diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index a468464..efd6cde 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -134,12 +134,14 @@ H5_DLLVAR H5P_genclass_t *H5P_CLS_LINK_ACCESS_g; H5_DLLVAR H5P_genclass_t *H5P_CLS_STRING_CREATE_g; /* Internal property list classes */ +H5_DLLVAR const struct H5P_libclass_t H5P_CLS_LCRT[1]; /* Link creation */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_LACC[1]; /* Link access */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_AACC[1]; /* Attribute access */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_DACC[1]; /* Dataset access */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_GACC[1]; /* Group access */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_TACC[1]; /* Named datatype access */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_FACC[1]; /* File access */ +H5_DLLVAR const struct H5P_libclass_t H5P_CLS_OCPY[1]; /* Object copy */ /******************************/ /* Library Private Prototypes */ @@ -186,8 +188,7 @@ H5_DLL herr_t H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config); H5_DLL htri_t H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id); -H5_DLL herr_t H5P_verify_apl_and_dxpl(hid_t *acspl_id, const H5P_libclass_t *libclass, - hid_t *dxpl_id, hid_t loc_id, hbool_t is_collective); +H5_DLL hid_t H5P_get_default(const H5P_libclass_t *pclass); /* Query internal fields of the property list struct */ H5_DLL hid_t H5P_get_plist_id(const H5P_genplist_t *plist); @@ -201,7 +202,7 @@ H5_DLL H5P_genplist_t *H5P_object_verify(hid_t plist_id, hid_t pclass_id); H5_DLL herr_t H5P_fill_value_defined(H5P_genplist_t *plist, H5D_fill_value_t *status); H5_DLL herr_t H5P_get_fill_value(H5P_genplist_t *plist, const struct H5T_t *type, - void *value, hid_t dxpl_id); + void *value); #endif /* _H5Pprivate_H */ diff --git a/src/H5R.c b/src/H5R.c index 8b42b35..86a94bf 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -23,6 +23,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ @@ -92,6 +93,7 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t { H5G_loc_t loc; /* File location */ H5S_t *space = NULL; /* Pointer to dataspace containing region */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -113,11 +115,21 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t if (space_id != (-1) && (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Create reference */ - if ((ret_value = H5R_create(ref, &loc, name, ref_type, space, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to create reference") + if((ret_value = H5R__create(ref, &loc, name, ref_type, space)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create reference") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rcreate() */ @@ -154,34 +166,40 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r { H5G_loc_t loc; /* Group location */ H5F_t *file = NULL; /* File object */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - hid_t ret_value; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE4("i", "iiRt*x", obj_id, oapl_id, ref_type, _ref); /* Check args */ if (H5G_loc(obj_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if (oapl_id < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list") if (ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference type") if (_ref == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") - /* Verify access property list and get correct dxpl */ - if (H5P_verify_apl_and_dxpl(&oapl_id, H5P_CLS_DACC, &dxpl_id, obj_id, FALSE) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&oapl_id, H5P_CLS_DACC, obj_id, FALSE) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the file pointer from the entry */ file = loc.oloc->file; /* Create reference */ - if ((ret_value = H5R_dereference(file, oapl_id, dxpl_id, ref_type, _ref, TRUE)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to dereference object") + if((ret_value = H5R__dereference(file, oapl_id, ref_type, _ref)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to dereference object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rdereference2() */ @@ -214,28 +232,36 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) { H5G_loc_t loc; /* Object's group location */ H5S_t *space = NULL; /* Dataspace object */ - hid_t ret_value; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "iRt*x", id, ref_type, ref); /* Check args */ if (H5G_loc(id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if (ref_type != H5R_DATASET_REGION) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference type") if (ref == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; /* Get the dataspace with the correct region selected */ - if ((space = H5R_get_region(loc.oloc->file, H5AC_ind_read_dxpl_id, ref)) == NULL) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create dataspace") + if(NULL == (space = H5R__get_region(loc.oloc->file, ref))) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "unable to retrieve dataspace") /* Atomize */ if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_region() */ @@ -268,6 +294,7 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj_type) { H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -281,11 +308,18 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object information */ - if (H5R_get_obj_type(loc.oloc->file, H5AC_ind_read_dxpl_id, ref_type, ref, obj_type) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to determine object type") + if(H5R__get_obj_type(loc.oloc->file, ref_type, ref, obj_type) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object type") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_obj_type2() */ @@ -329,6 +363,7 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, { H5G_loc_t loc; /* Group location */ H5F_t *file; /* File object */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -342,14 +377,21 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, if (_ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the file pointer from the entry */ file = loc.oloc->file; /* Get name */ - if ((ret_value = H5R_get_name(file, H5P_DEFAULT, H5AC_ind_read_dxpl_id, id, ref_type, _ref, name, size)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to determine object path") + if((ret_value = H5R__get_name(file, id, ref_type, _ref, name, size)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object path") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_name() */ diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 699f8df..ccb4798 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -37,11 +37,12 @@ #include "H5Ppublic.h" /* Property lists */ /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Oprivate.h" /* Object headers */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Oprivate.h" /* Object headers */ #include "H5Rpkg.h" /* References */ @@ -103,6 +104,7 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) { H5G_loc_t loc; /* Object location */ H5O_type_t obj_type; /* Object type */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ H5G_obj_t ret_value; /* Return value */ FUNC_ENTER_API(H5G_UNKNOWN) @@ -116,14 +118,21 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5G_UNKNOWN, "invalid reference pointer") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5G_UNKNOWN, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object information */ - if (H5R_get_obj_type(loc.oloc->file, H5AC_ind_read_dxpl_id, ref_type, ref, &obj_type) < 0) + if(H5R__get_obj_type(loc.oloc->file, ref_type, ref, &obj_type) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type") /* Set return value */ ret_value = H5G_map_obj_type(obj_type); done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5G_UNKNOWN, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_obj_type1() */ @@ -149,27 +158,35 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) { H5G_loc_t loc; /* Group location */ H5F_t *file = NULL; /* File object */ - hid_t ret_value; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "iRt*x", obj_id, ref_type, _ref); /* Check args */ if (H5G_loc(obj_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if (ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference type") if (_ref == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; /* Get the file pointer from the entry */ file = loc.oloc->file; /* Create reference */ - if ((ret_value = H5R_dereference(file, H5P_DATASET_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id, ref_type, _ref, TRUE)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable dereference object") + if((ret_value = H5R__dereference(file, H5P_DATASET_ACCESS_DEFAULT, ref_type, _ref)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5I_INVALID_HID, "unable dereference object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rdereference1() */ diff --git a/src/H5Rint.c b/src/H5Rint.c index 716a573..02f7778 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -195,11 +195,11 @@ H5R_term_package(void) /*-------------------------------------------------------------------------- NAME - H5R_create + H5R__create PURPOSE Creates a particular kind of reference for the user USAGE - herr_t H5R_create(ref, loc, name, ref_type, space) + herr_t H5R__create(ref, loc, name, ref_type, space) void *ref; OUT: Reference created H5G_loc_t *loc; IN: File location used to locate object pointed to const char *name; IN: Name of object at location LOC_ID of object @@ -221,7 +221,8 @@ H5R_term_package(void) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id) +H5R__create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, + H5S_t *space) { H5G_loc_t obj_loc; /* Group hier. location of object */ H5G_name_t path; /* Object group hier. path */ @@ -229,7 +230,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5 hbool_t obj_found = FALSE; /* Object location found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL HDassert(_ref); HDassert(loc); @@ -242,7 +243,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5 H5G_loc_reset(&obj_loc); /* Find the object */ - if (H5G_loc_find(loc, name, &obj_loc, H5P_DEFAULT, dxpl_id) < 0) + if(H5G_loc_find(loc, name, &obj_loc) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_NOTFOUND, FAIL, "object not found") obj_found = TRUE; @@ -310,7 +311,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5 /* Save the serialized buffer for later */ H5_CHECK_OVERFLOW(buf_size, hssize_t, size_t); - if (H5HG_insert(loc->oloc->file, dxpl_id, (size_t)buf_size, buf, &hobjid) < 0) + if(H5HG_insert(loc->oloc->file, (size_t)buf_size, buf, &hobjid) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to serialize selection") /* Serialize the heap ID and index for storage in the file */ @@ -334,19 +335,20 @@ done: if (obj_found) H5G_loc_free(&obj_loc); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_create() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5R__create() */ /*-------------------------------------------------------------------------- NAME - H5R_dereference + H5R__dereference PURPOSE Opens the HDF5 object referenced. USAGE - hid_t H5R_dereference(ref) + hid_t H5R__dereference(ref, oapl_id, ref_type, ref) H5F_t *file; IN: File the object being dereferenced is within - H5R_type_t ref_type; IN: Type of reference + hid_t oapl_id; IN: Object access property list ID + H5R_type_t ref_type; IN: Type of reference void *ref; IN: Reference to open. RETURNS @@ -369,7 +371,8 @@ done: Added a check for undefined reference pointer. --------------------------------------------------------------------------*/ hid_t -H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref, hbool_t app_ref) +H5R__dereference(H5F_t *file, hid_t oapl_id, H5R_type_t ref_type, + const void *_ref) { H5O_loc_t oloc; /* Object location */ H5G_name_t path; /* Path of object */ @@ -378,7 +381,7 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, H5O_type_t obj_type; /* Type of object */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL HDassert(_ref); HDassert(ref_type > H5R_BADTYPE && ref_type < H5R_MAXTYPE); @@ -393,7 +396,7 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, { oloc.addr = *(const hobj_ref_t *)_ref; /* Only object references currently supported */ if (!H5F_addr_defined(oloc.addr) || oloc.addr == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "Undefined reference pointer") break; } @@ -409,11 +412,11 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, UINT32DECODE(p, hobjid.idx); if (!H5F_addr_defined(hobjid.addr) || hobjid.addr == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "Undefined reference pointer") /* Get the dataset region from the heap (allocate inside routine) */ - if (NULL == (buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL))) - HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") + if(NULL == (buf = (uint8_t *)H5HG_read(oloc.file, &hobjid, NULL, NULL))) + HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, H5I_INVALID_HID, "Unable to read dataset region information") /* Get the object oid for the dataset */ p = buf; @@ -428,15 +431,15 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, case H5R_MAXTYPE: default: HDassert("unknown reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, H5I_INVALID_HID, "internal error (unknown reference type)") } /* end switch */ /* Get the # of links for object, and its type * (To check to make certain that this object hasn't been deleted * since the reference was created) */ - if (H5O_get_rc_and_type(&oloc, dxpl_id, &rc, &obj_type) < 0 || 0 == rc) - HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object") + if(H5O_get_rc_and_type(&oloc, &rc, &obj_type) < 0 || 0 == rc) + HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, H5I_INVALID_HID, "dereferencing deleted object") /* Construct a group location for opening the object */ H5G_name_reset(&path); @@ -449,14 +452,14 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, { H5G_t *group; /* Pointer to group to open */ - if (NULL == (group = H5G_open(&loc, dxpl_id))) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "not found") + if(NULL == (group = H5G_open(&loc))) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5I_INVALID_HID, "not found") /* Create an atom for the group */ - if ((ret_value = H5I_register(H5I_GROUP, group, app_ref)) < 0) { + if((ret_value = H5I_register(H5I_GROUP, group, TRUE)) < 0) { H5G_close(group); - HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, FAIL, "can't register group") - } + HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register group") + } /* end if */ break; } @@ -465,14 +468,14 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, { H5T_t *type; /* Pointer to datatype to open */ - if (NULL == (type = H5T_open(&loc, dxpl_id))) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found") + if(NULL == (type = H5T_open(&loc))) + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, H5I_INVALID_HID, "not found") /* Create an atom for the datatype */ - if ((ret_value = H5I_register(H5I_DATATYPE, type, app_ref)) < 0) { + if((ret_value = H5I_register(H5I_DATATYPE, type, TRUE)) < 0) { H5T_close(type); - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "can't register datatype") - } + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register datatype") + } /* end if */ break; } @@ -482,14 +485,14 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, H5D_t *dset; /* Pointer to dataset to open */ /* Open the dataset */ - if (NULL == (dset = H5D_open(&loc, oapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") + if(NULL == (dset = H5D_open(&loc, oapl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, H5I_INVALID_HID, "not found") /* Create an atom for the dataset */ - if ((ret_value = H5I_register(H5I_DATASET, dset, app_ref)) < 0) { + if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) { H5D_close(dset); - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register dataset") - } + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register dataset") + } /* end if */ break; } @@ -497,21 +500,21 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: default: - HGOTO_ERROR(H5E_REFERENCE, H5E_BADTYPE, FAIL, "can't identify type of object referenced") + HGOTO_ERROR(H5E_REFERENCE, H5E_BADTYPE, H5I_INVALID_HID, "can't identify type of object referenced") } /* end switch */ done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_dereference() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5R__dereference() */ /*-------------------------------------------------------------------------- NAME - H5R_get_region + H5R__get_region PURPOSE Retrieves a dataspace with the region pointed to selected. USAGE - H5S_t *H5R_get_region(file, ref_type, ref) + H5S_t *H5R__get_region(file, ref) H5F_t *file; IN: File the object being dereferenced is within void *ref; IN: Reference to open. @@ -527,15 +530,15 @@ done: REVISION LOG --------------------------------------------------------------------------*/ H5S_t * -H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) +H5R__get_region(H5F_t *file, const void *_ref) { H5O_loc_t oloc; /* Object location */ const uint8_t *p; /* Pointer to OID to store */ H5HG_t hobjid; /* Heap object ID */ uint8_t *buf = NULL; /* Buffer to store serialized selection in */ - H5S_t *ret_value; + H5S_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL HDassert(_ref); HDassert(file); @@ -550,7 +553,7 @@ H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ - if ((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) + if(NULL == (buf = (uint8_t *)H5HG_read(oloc.file, &hobjid, NULL, NULL))) HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, NULL, "Unable to read dataset region information") /* Get the object oid for the dataset */ @@ -558,36 +561,36 @@ H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) H5F_addr_decode(oloc.file, &p, &(oloc.addr)); /* Open and copy the dataset's dataspace */ - if ((ret_value = H5S_read(&oloc, dxpl_id)) == NULL) + if(NULL == (ret_value = H5S_read(&oloc))) HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, NULL, "not found") /* Unserialize the selection */ - if (H5S_SELECT_DESERIALIZE(&ret_value, &p) < 0) + if(H5S_SELECT_DESERIALIZE(&ret_value, &p) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, NULL, "can't deserialize selection") done: /* Free the buffer allocated in H5HG_read() */ - if (buf) + if(buf) H5MM_xfree(buf); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_get_region() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5R__get_region() */ /*-------------------------------------------------------------------------- NAME - H5R_get_obj_type + H5R__get_obj_type PURPOSE Retrieves the type of object that an object reference points to USAGE - H5O_type_t H5R_get_obj_type(file, ref_type, ref) + H5O_type_t H5R__get_obj_type(file, ref_type, ref) H5F_t *file; IN: File the object being dereferenced is within H5R_type_t ref_type; IN: Type of reference to query void *ref; IN: Reference to query. + H5O_type_t *obj_type; OUT: The type of the object, set on success RETURNS - Success: An object type defined in H5Gpublic.h - Failure: H5G_UNKNOWN + Non-negative on success/Negative on failure DESCRIPTION Given a reference to some object, this function returns the type of object pointed to. @@ -597,14 +600,14 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, - const void *_ref, H5O_type_t *obj_type) +H5R__get_obj_type(H5F_t *file, H5R_type_t ref_type, const void *_ref, + H5O_type_t *obj_type) { H5O_loc_t oloc; /* Object location */ unsigned rc; /* Reference count of object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL HDassert(file); HDassert(_ref); @@ -633,7 +636,7 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ - if ((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) + if(NULL == (buf = (uint8_t *)H5HG_read(oloc.file, &hobjid, NULL, NULL))) HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") /* Get the object oid for the dataset */ @@ -655,25 +658,24 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, /* Get the # of links for object, and its type */ /* (To check to make certain that this object hasn't been deleted since the reference was created) */ - if (H5O_get_rc_and_type(&oloc, dxpl_id, &rc, obj_type) < 0 || 0 == rc) + if(H5O_get_rc_and_type(&oloc, &rc, obj_type) < 0 || 0 == rc) HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_get_obj_type() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5R__get_obj_type() */ /*-------------------------------------------------------------------------- NAME - H5R_get_name + H5R__get_name PURPOSE Internal routine to determine a name for the object referenced USAGE - ssize_t H5R_get_name(f, dxpl_id, ref_type, ref, name, size) + ssize_t H5R__get_name(f, ref_type, ref, name, size) H5F_t *f; IN: Pointer to the file that the reference is pointing into hid_t lapl_id; IN: LAPL to use for operation - hid_t dxpl_id; IN: DXPL to use for operation hid_t id; IN: Location ID given for reference H5R_type_t ref_type; IN: Type of reference void *ref; IN: Reference to query. @@ -692,14 +694,14 @@ done: REVISION LOG --------------------------------------------------------------------------*/ ssize_t -H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_type, - const void *_ref, char *name, size_t size) +H5R__get_name(H5F_t *f, hid_t id, H5R_type_t ref_type, const void *_ref, + char *name, size_t size) { hid_t file_id = H5I_INVALID_HID; /* ID for file that the reference is in */ H5O_loc_t oloc; /* Object location describing object for reference */ ssize_t ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Check args */ HDassert(f); @@ -729,7 +731,7 @@ H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_ty UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ - if ((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) + if ((buf = (uint8_t *)H5HG_read(oloc.file, &hobjid, NULL, NULL)) == NULL) HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") /* Get the object oid for the dataset */ @@ -754,7 +756,7 @@ H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_ty HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't retrieve file ID") /* Get name, length, etc. */ - if ((ret_value = H5G_get_name_by_addr(file_id, lapl_id, dxpl_id, &oloc, name, size)) < 0) + if ((ret_value = H5G_get_name_by_addr(file_id, &oloc, name, size)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't determine name") done: @@ -762,6 +764,6 @@ done: if (file_id > 0 && H5I_dec_ref(file_id) < 0) HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "can't decrement ref count of temp ID") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_get_name() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5R__get_name() */ diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h index 129f944..49261eb 100644 --- a/src/H5Rpkg.h +++ b/src/H5Rpkg.h @@ -45,6 +45,15 @@ /******************************/ /* Package Private Prototypes */ /******************************/ +H5_DLL herr_t H5R__create(void *ref, H5G_loc_t *loc, const char *name, + H5R_type_t ref_type, H5S_t *space); +H5_DLL hid_t H5R__dereference(H5F_t *file, hid_t dapl_id, H5R_type_t ref_type, + const void *_ref); +H5_DLL H5S_t *H5R__get_region(H5F_t *file, const void *_ref); +H5_DLL herr_t H5R__get_obj_type(H5F_t *file, H5R_type_t ref_type, + const void *_ref, H5O_type_t *obj_type); +H5_DLL ssize_t H5R__get_name(H5F_t *file, hid_t id, H5R_type_t ref_type, + const void *_ref, char *name, size_t size); #endif /* _H5Rpkg_H */ diff --git a/src/H5Rprivate.h b/src/H5Rprivate.h index 35e63d2..8c0ba8f 100644 --- a/src/H5Rprivate.h +++ b/src/H5Rprivate.h @@ -45,15 +45,6 @@ /* Library Private Prototypes */ /******************************/ -H5_DLL herr_t H5R_create(void *ref, H5G_loc_t *loc, const char *name, - H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id); -H5_DLL H5S_t * H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref); -H5_DLL ssize_t H5R_get_name(H5F_t *file, hid_t lapl_id, hid_t dxpl_id, hid_t id, - H5R_type_t ref_type, const void *_ref, char *name, size_t size); -H5_DLL herr_t H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, - const void *_ref, H5O_type_t *obj_type); -H5_DLL hid_t H5R_dereference(H5F_t *file, hid_t dapl_id, hid_t dxpl_id, H5R_type_t ref_type, - const void *_ref, hbool_t app_ref); #endif /* _H5Rprivate_H */ diff --git a/src/H5S.c b/src/H5S.c index 9ac40a7..1694fd2 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1067,7 +1067,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_write(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned update_flags, H5S_t *ds) +H5S_write(H5F_t *f, H5O_t *oh, unsigned update_flags, H5S_t *ds) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1079,7 +1079,7 @@ H5S_write(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned update_flags, H5S_t *ds) HDassert(H5S_GET_EXTENT_TYPE(ds) >= 0); /* Write the current dataspace extent to the dataspace message */ - if(H5O_msg_write_oh(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, update_flags, &(ds->extent)) < 0) + if(H5O_msg_write_oh(f, oh, H5O_SDSPACE_ID, 0, update_flags, &(ds->extent)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple dataspace message") done: @@ -1108,7 +1108,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_append(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5S_t *ds) +H5S_append(H5F_t *f, H5O_t *oh, H5S_t *ds) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1120,7 +1120,7 @@ H5S_append(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5S_t *ds) HDassert(H5S_GET_EXTENT_TYPE(ds) >= 0); /* Add the dataspace message to the object header */ - if(H5O_msg_append_oh(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent)) < 0) + if(H5O_msg_append_oh(f, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't add simple dataspace message") done: @@ -1143,7 +1143,7 @@ done: *------------------------------------------------------------------------- */ H5S_t * -H5S_read(const H5O_loc_t *loc, hid_t dxpl_id) +H5S_read(const H5O_loc_t *loc) { H5S_t *ds = NULL; /* Dataspace to return */ H5S_t *ret_value = NULL; /* Return value */ @@ -1156,7 +1156,7 @@ H5S_read(const H5O_loc_t *loc, hid_t dxpl_id) if(NULL == (ds = H5FL_CALLOC(H5S_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - if(H5O_msg_read(loc, H5O_SDSPACE_ID, &(ds->extent), dxpl_id) == NULL) + if(NULL == H5O_msg_read(loc, H5O_SDSPACE_ID, &(ds->extent))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to load dataspace info from dataset header") /* Default to entire dataspace being selected */ @@ -1723,7 +1723,7 @@ H5S_decode(const unsigned char **p) /* Decode the extent part of dataspace */ /* (pass mostly bogus file pointer and bogus DXPL) */ - if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, NULL, H5O_SDSPACE_ID, pp))==NULL) + if(NULL == (extent = (H5S_extent_t *)H5O_msg_decode(f, NULL, H5O_SDSPACE_ID, pp))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object") pp += extent_size; @@ -2192,68 +2192,3 @@ H5S_set_latest_version(H5S_t *ds) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S_set_latest_version() */ -#ifndef H5_NO_DEPRECATED_SYMBOLS - -/*------------------------------------------------------------------------- - * Function: H5S_extend - * - * Purpose: Extend the dimensions of a dataspace. - * - * Return: Success: Number of dimensions whose size increased. - * - * Failure: Negative - * - * Programmer: Robb Matzke - * Friday, January 30, 1998 - * - *------------------------------------------------------------------------- - */ -int -H5S_extend(H5S_t *space, const hsize_t *size) -{ - unsigned u; - int ret_value = 0; - - FUNC_ENTER_NOAPI(FAIL) - - /* Check args */ - HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); - HDassert(size); - - /* Check through all the dimensions to see if modifying the dataspace is allowed */ - for(u = 0; u < space->extent.rank; u++) - if(space->extent.size[u] < size[u]) { - if(space->extent.max && H5S_UNLIMITED != space->extent.max[u] && - space->extent.max[u] < size[u]) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dimension cannot be increased") - ret_value++; - } /* end if */ - - /* Update */ - if(ret_value) { - hsize_t nelem; /* Number of elements in extent */ - - /* Change the dataspace size & re-compute the number of elements in the extent */ - for(u = 0, nelem = 1; u < space->extent.rank; u++) { - if(space->extent.size[u] < size[u]) - space->extent.size[u] = size[u]; - - nelem *= space->extent.size[u]; - } /* end for */ - space->extent.nelem = nelem; - - /* If the selection is 'all', update the number of elements selected */ - if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL) - if(H5S_select_all(space, FALSE) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") - - /* Mark the dataspace as no longer shared if it was before */ - if(H5O_msg_reset_share(H5O_SDSPACE_ID, space) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S_extend() */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - diff --git a/src/H5SM.c b/src/H5SM.c index d5ede7e..22ea227 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -41,7 +41,7 @@ /* Local Typedefs */ /******************/ -/* Udata struct for calls to H5SM_read_iter_op */ +/* Udata struct for calls to H5SM__read_iter_op */ typedef struct H5SM_read_udata_t { H5F_t *file; /* File in which sharing is happening (in) */ H5O_msg_crt_idx_t idx; /* Creation index of this message (in) */ @@ -53,31 +53,27 @@ typedef struct H5SM_read_udata_t { /********************/ /* Local Prototypes */ /********************/ -static herr_t H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, - hid_t dxpl_id); -static herr_t H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, - hid_t dxpl_id, hbool_t delete_heap); -static haddr_t H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id); +static herr_t H5SM__create_index(H5F_t *f, H5SM_index_header_t *header); +static herr_t H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, + hbool_t delete_heap); +static haddr_t H5SM__create_list(H5F_t *f, H5SM_index_header_t *header); static herr_t H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, - size_t *empty_pos, size_t *list_pos); -static herr_t H5SM_convert_list_to_btree(H5F_t * f, H5SM_index_header_t * header, - H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh, hid_t dxpl_id); -static herr_t H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_id); -static herr_t H5SM_incr_ref(void *record, void *_op_data, hbool_t *changed); -static herr_t H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5SM_index_header_t *header, hbool_t defer, unsigned type_id, void *mesg, - unsigned *cache_flags_ptr); -static herr_t H5SM_decr_ref(void *record, void *op_data, hbool_t *changed); -static herr_t H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5SM_index_header_t *header, const H5O_shared_t * mesg, - unsigned *cache_flags, void ** /*out*/ encoded_mesg); -static herr_t H5SM_type_to_flag(unsigned type_id, unsigned *type_flag); -static herr_t H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, + size_t *empty_pos, size_t *list_pos); +static herr_t H5SM__convert_list_to_btree(H5F_t * f, H5SM_index_header_t * header, + H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh); +static herr_t H5SM__convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header); +static herr_t H5SM__incr_ref(void *record, void *_op_data, hbool_t *changed); +static herr_t H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, + hbool_t defer, unsigned type_id, void *mesg, unsigned *cache_flags_ptr); +static herr_t H5SM__decr_ref(void *record, void *op_data, hbool_t *changed); +static herr_t H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, + const H5O_shared_t * mesg, unsigned *cache_flags, void ** /*out*/ encoded_mesg); +static herr_t H5SM__type_to_flag(unsigned type_id, unsigned *type_flag); +static herr_t H5SM__read_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, unsigned *oh_modified, void *_udata); -static herr_t H5SM_read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata); -static herr_t H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, - H5O_t * open_oh, hid_t dxpl_id, size_t *encoding_size /*out*/, - void ** encoded_mesg /*out*/); +static herr_t H5SM__read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata); +static herr_t H5SM__read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, + H5O_t * open_oh, size_t *encoding_size /*out*/, void ** encoded_mesg /*out*/); /*********************/ @@ -121,12 +117,11 @@ H5FL_ARR_DEFINE(H5SM_sohm_t, H5O_SHMESG_MAX_LIST_SIZE); *------------------------------------------------------------------------- */ herr_t -H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t dxpl_id) +H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc) { H5O_shmesg_table_t sohm_table; /* SOHM message for superblock extension */ H5SM_master_table_t *table = NULL; /* SOHM master table for file */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t ring, orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ haddr_t table_addr = HADDR_UNDEF; /* Address of SOHM master table in file */ unsigned list_max, btree_min; /* Phase change limits for SOHM indices */ unsigned index_type_flags[H5O_SHMESG_MAX_NINDEXES]; /* Messages types stored in each index */ @@ -135,15 +130,14 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d unsigned x; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) HDassert(f); /* File should not already have a SOHM table */ HDassert(!H5F_addr_defined(H5F_SOHM_ADDR(f))); /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_USER, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set ring value") + H5AC_set_ring(H5AC_RING_USER, &orig_ring); /* Initialize master table */ if(NULL == (table = H5FL_CALLOC(H5SM_master_table_t))) @@ -213,11 +207,11 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d } /* end for */ /* Allocate space for the table on disk */ - if(HADDR_UNDEF == (table_addr = H5MF_alloc(f, H5FD_MEM_SOHM_TABLE, dxpl_id, (hsize_t)table->table_size))) + if(HADDR_UNDEF == (table_addr = H5MF_alloc(f, H5FD_MEM_SOHM_TABLE, (hsize_t)table->table_size))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "file allocation failed for SOHM table") /* Cache the new table */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINS, FAIL, "can't add SOHM table to cache") /* Record the address of the master table in the file */ @@ -230,35 +224,33 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d H5F_SET_STORE_MSG_CRT_IDX(f, TRUE); /* Set the ring type to superblock extension */ - ring = H5AC_RING_SBE; - if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set property value") + H5AC_set_ring(H5AC_RING_SBE, NULL); /* Write shared message information to the superblock extension */ sohm_table.addr = H5F_SOHM_ADDR(f); sohm_table.version = H5F_SOHM_VERS(f); sohm_table.nindexes = H5F_SOHM_NINDEXES(f); - if(H5O_msg_create(ext_loc, H5O_SHMESG_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &sohm_table, dxpl_id) < 0) + if(H5O_msg_create(ext_loc, H5O_SHMESG_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &sohm_table) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to update SOHM header message") done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); if(ret_value < 0) { if(table_addr != HADDR_UNDEF) - H5MF_xfree(f, H5FD_MEM_SOHM_TABLE, dxpl_id, table_addr, (hsize_t)table->table_size); + H5MF_xfree(f, H5FD_MEM_SOHM_TABLE, table_addr, (hsize_t)table->table_size); if(table != NULL) table = H5FL_FREE(H5SM_master_table_t, table); } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_init() */ /*------------------------------------------------------------------------- - * Function: H5SM_type_to_flag + * Function: H5SM__type_to_flag * * Purpose: Get the shared message flag for a given message type. * @@ -270,11 +262,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_type_to_flag(unsigned type_id, unsigned *type_flag) +H5SM__type_to_flag(unsigned type_id, unsigned *type_flag) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Translate the H5O type_id into an H5SM type flag */ switch(type_id) { @@ -296,7 +288,7 @@ H5SM_type_to_flag(unsigned type_id, unsigned *type_flag) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_type_to_flag() */ +} /* end H5SM__type_to_flag() */ /*------------------------------------------------------------------------- @@ -325,7 +317,7 @@ H5SM_get_index(const H5SM_master_table_t *table, unsigned type_id) FUNC_ENTER_NOAPI_NOINIT /* Translate the H5O type_id into an H5SM type flag */ - if(H5SM_type_to_flag(type_id, &type_flag) < 0) + if(H5SM__type_to_flag(type_id, &type_flag) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't map message type to flag") /* Search the indexes until we find one that matches this flag or we've @@ -356,17 +348,17 @@ done: *------------------------------------------------------------------------- */ htri_t -H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) +H5SM_type_shared(H5F_t *f, unsigned type_id) { H5SM_master_table_t *table = NULL; /* Shared object master table */ unsigned type_flag; /* Flag corresponding to message type */ size_t u; /* Local index variable */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(H5AC__SOHM_TAG) /* Translate the H5O type_id into an H5SM type flag */ - if(H5SM_type_to_flag(type_id, &type_flag) < 0) + if(H5SM__type_to_flag(type_id, &type_flag) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't map message type to flag") /* Look up the master SOHM table */ @@ -376,7 +368,7 @@ H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) /* Set up user data for callback */ cache_udata.f = f; - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ else @@ -392,10 +384,10 @@ H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) done: /* Release the master SOHM table */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_type_shared() */ @@ -413,14 +405,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_addr) +H5SM_get_fheap_addr(H5F_t *f, unsigned type_id, haddr_t *fheap_addr) { H5SM_master_table_t *table = NULL; /* Shared object master table */ H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ ssize_t index_num; /* Which index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* Sanity checks */ HDassert(f); @@ -430,7 +422,7 @@ H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_ad cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Look up index for message type */ @@ -442,15 +434,15 @@ H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_ad done: /* Release the master SOHM table */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_get_fheap_addr() */ /*------------------------------------------------------------------------- - * Function: H5SM_create_index + * Function: H5SM__create_index * * Purpose: Allocates storage for an index, populating the HEADER struct. * @@ -462,14 +454,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) +H5SM__create_index(H5F_t *f, H5SM_index_header_t *header) { H5HF_create_t fheap_cparam; /* Fractal heap creation parameters */ H5HF_t *fheap = NULL; /* Fractal heap handle */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(header); @@ -481,7 +473,7 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) haddr_t list_addr = HADDR_UNDEF; /* Address of SOHM list */ /* Create the list index */ - if((list_addr = H5SM_create_list(f, header, dxpl_id)) == HADDR_UNDEF) + if(HADDR_UNDEF == (list_addr = H5SM__create_list(f, header))) HGOTO_ERROR(H5E_SOHM, H5E_CANTCREATE, FAIL, "list creation failed for SOHM index") /* Set the index type & address */ @@ -499,7 +491,7 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) bt2_cparam.rrec_size = (uint32_t)H5SM_SOHM_ENTRY_SIZE(f); bt2_cparam.split_percent = H5SM_B2_SPLIT_PERCENT; bt2_cparam.merge_percent = H5SM_B2_MERGE_PERCENT; - if(NULL == (bt2 = H5B2_create(f, dxpl_id, &bt2_cparam, f))) + if(NULL == (bt2 = H5B2_create(f, &bt2_cparam, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTCREATE, FAIL, "B-tree creation failed for SOHM index") /* Retrieve the v2 B-tree's address in the file */ @@ -521,7 +513,7 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) fheap_cparam.checksum_dblocks = H5O_FHEAP_CHECKSUM_DBLOCKS; fheap_cparam.id_len = 0; fheap_cparam.max_man_size = H5O_FHEAP_MAX_MAN_SIZE; - if(NULL == (fheap = H5HF_create(f, dxpl_id, &fheap_cparam))) + if(NULL == (fheap = H5HF_create(f, &fheap_cparam))) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to create fractal heap") if(H5HF_get_heap_addr(fheap, &(header->heap_addr)) < 0) @@ -540,17 +532,17 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_create_index */ +} /* end H5SM__create_index */ /*------------------------------------------------------------------------- - * Function: H5SM_delete_index + * Function: H5SM__delete_index * * Purpose: De-allocates storage for an index whose header is HEADER. * @@ -569,12 +561,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id, - hbool_t delete_heap) +H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, hbool_t delete_heap) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Determine whether index is a list or a B-tree. */ if(header->index_type == H5SM_LIST) { @@ -591,7 +582,7 @@ H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id, HDassert(!(index_status & H5AC_ES__IS_PROTECTED)); /* Evict the index list from the metadata cache */ - if(H5AC_expunge_entry(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(H5AC_expunge_entry(f, H5AC_SOHM_LIST, header->index_addr, H5AC__FREE_FILE_SPACE_FLAG) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTREMOVE, FAIL, "unable to remove list index from cache") } /* end if */ } /* end if */ @@ -599,7 +590,7 @@ H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id, HDassert(header->index_type == H5SM_BTREE); /* Delete the B-tree. */ - if(H5B2_delete(f, dxpl_id, header->index_addr, f, NULL, NULL) < 0) + if(H5B2_delete(f, header->index_addr, f, NULL, NULL) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete B-tree") /* Revert to list unless B-trees can have zero records */ @@ -609,7 +600,7 @@ H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id, /* Free the index's heap if requested. */ if(delete_heap == TRUE) { - if(H5HF_delete(f, dxpl_id, header->heap_addr) < 0) + if(H5HF_delete(f, header->heap_addr) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete fractal heap") header->heap_addr = HADDR_UNDEF; } /* end if */ @@ -620,11 +611,11 @@ H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_delete_index */ +} /* end H5SM__delete_index */ /*------------------------------------------------------------------------- - * Function: H5SM_create_list + * Function: H5SM__create_list * * Purpose: Creates a list of SOHM messages. * @@ -639,7 +630,7 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) +H5SM__create_list(H5F_t *f, H5SM_index_header_t *header) { H5SM_list_t *list = NULL; /* List of messages */ hsize_t x; /* Counter variable */ @@ -647,7 +638,7 @@ H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) haddr_t addr = HADDR_UNDEF; /* Address of the list on disk */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, HADDR_UNDEF) + FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) HDassert(f); HDassert(header); @@ -668,11 +659,11 @@ H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) list->header = header; /* Allocate space for the list on disk */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_SOHM_INDEX, dxpl_id, (hsize_t)header->list_size))) + if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_SOHM_INDEX, (hsize_t)header->list_size))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for SOHM list") /* Put the list into the cache */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_SOHM_LIST, addr, list, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_SOHM_LIST, addr, list, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINS, HADDR_UNDEF, "can't add SOHM list to cache") /* Set return value */ @@ -686,15 +677,15 @@ done: list = H5FL_FREE(H5SM_list_t, list); } /* end if */ if(addr != HADDR_UNDEF) - H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, dxpl_id, addr, (hsize_t)header->list_size); + H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, addr, (hsize_t)header->list_size); } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, HADDR_UNDEF) -} /* end H5SM_create_list */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__create_list */ /*------------------------------------------------------------------------- - * Function: H5SM_convert_list_to_btree + * Function: H5SM__convert_list_to_btree * * Purpose: Given a list index, turns it into a B-tree index. This is * done when too many messages are added to the list. @@ -715,8 +706,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, - H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh, hid_t dxpl_id) +H5SM__convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, + H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh) { H5SM_list_t *list; /* Pointer to the existing message list */ H5SM_mesg_key_t key; /* Key for inserting records in v2 B-tree */ @@ -728,7 +719,7 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, void * encoding_buf = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(_list && *_list); HDassert(header); @@ -742,7 +733,7 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, bt2_cparam.rrec_size = (uint32_t)H5SM_SOHM_ENTRY_SIZE(f); bt2_cparam.split_percent = H5SM_B2_SPLIT_PERCENT; bt2_cparam.merge_percent = H5SM_B2_MERGE_PERCENT; - if(NULL == (bt2 = H5B2_create(f, dxpl_id, &bt2_cparam, f))) + if(NULL == (bt2 = H5B2_create(f, &bt2_cparam, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTCREATE, FAIL, "B-tree creation failed for SOHM index") /* Retrieve the v2 B-tree's address in the file */ @@ -753,7 +744,6 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, * are in the heap, they have a heap ID and no encoding or type_id. */ key.file = f; - key.dxpl_id = dxpl_id; key.fheap = fheap; key.encoding_size = 0; key.encoding = NULL; @@ -765,23 +755,23 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, key.message = list->messages[x]; /* Get the encoded message */ - if(H5SM_read_mesg(f, &(key.message), fheap, open_oh, dxpl_id, &key.encoding_size, &encoding_buf) < 0) + if(H5SM__read_mesg(f, &(key.message), fheap, open_oh, &key.encoding_size, &encoding_buf) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, FAIL, "Couldn't read SOHM message in list") key.encoding = encoding_buf; /* Insert the message into the B-tree */ - if(H5B2_insert(bt2, dxpl_id, &key) < 0) + if(H5B2_insert(bt2, &key) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "couldn't add SOHM to B-tree") - /* Free buffer from H5SM_read_mesg */ + /* Free buffer from H5SM__read_mesg */ if(encoding_buf) encoding_buf = H5MM_xfree(encoding_buf); } /* end if */ } /* end for */ /* Unprotect list in cache and release heap */ - if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to release SOHM list") *_list = list = NULL; @@ -789,7 +779,7 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, * still using!) */ num_messages = header->num_messages; /* preserve this across the index deletion */ - if(H5SM_delete_index(f, header, dxpl_id, FALSE) < 0) + if(H5SM__delete_index(f, header, FALSE) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "can't free list index") /* Set/restore header info */ @@ -799,17 +789,17 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, done: /* Release resources */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") if(encoding_buf) encoding_buf = H5MM_xfree(encoding_buf); FUNC_LEAVE_NOAPI(ret_value) -} /* H5SM_convert_list_to_btree() */ +} /* H5SM__convert_list_to_btree() */ /*------------------------------------------------------------------------- - * Function: H5SM_convert_btree_to_list + * Function: H5SM__convert_btree_to_list * * Purpose: Given a B-tree index, turns it into a list index. This is * done when too many messages are deleted from the B-tree. @@ -823,14 +813,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_id) +H5SM__convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header) { H5SM_list_t *list = NULL; H5SM_list_cache_ud_t cache_udata; /* User-data for metadata cache callback */ haddr_t btree_addr; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) /* Remember the address of the old B-tree, but change the header over to be * a list.. @@ -841,7 +831,7 @@ H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_i header->index_type = H5SM_LIST; /* Create a new list index */ - if(HADDR_UNDEF == (header->index_addr = H5SM_create_list(f, header, dxpl_id))) + if(HADDR_UNDEF == (header->index_addr = H5SM__create_list(f, header))) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to create shared message list") /* Set up user data for metadata cache callback */ @@ -849,22 +839,22 @@ H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_i cache_udata.header = header; /* Protect the SOHM list */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM list index") /* Delete the B-tree and have messages copy themselves to the * list as they're deleted */ - if(H5B2_delete(f, dxpl_id, btree_addr, f, H5SM_bt2_convert_to_list_op, list) < 0) + if(H5B2_delete(f, btree_addr, f, H5SM_bt2_convert_to_list_op, list) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete B-tree") done: /* Release the SOHM list from the cache */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to unprotect SOHM index") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5SM_convert_btree_to_list() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__convert_btree_to_list() */ /*------------------------------------------------------------------------- @@ -930,7 +920,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, +H5SM_can_share(H5F_t *f, H5SM_master_table_t *table, ssize_t *sohm_index_num, unsigned type_id, const void *mesg) { size_t mesg_size; @@ -939,7 +929,7 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, htri_t tri_ret; htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* "trivial" sharing checks */ if((tri_ret = H5SM_can_share_common(f, type_id, mesg)) < 0) @@ -957,7 +947,7 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, /* Set up user data for callback */ cache_udata.f = f; - if(NULL == (my_table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (my_table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ @@ -981,10 +971,10 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, done: /* Release the master SOHM table, if we protected it */ - if(my_table && my_table != table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), my_table, H5AC__NO_FLAGS_SET) < 0) + if(my_table && my_table != table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), my_table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_can_share() */ @@ -1049,7 +1039,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, +H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, unsigned type_id, void *mesg, unsigned *mesg_flags) { H5SM_master_table_t *table = NULL; @@ -1062,7 +1052,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, #endif htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* If we previously deferred this operation, the saved message type should * be the same as the one we get here. In debug mode, we make sure this @@ -1089,11 +1079,11 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* "complex" sharing checks */ - if((tri_ret = H5SM_can_share(f, dxpl_id, table, &index_num, type_id, mesg)) < 0) + if((tri_ret = H5SM_can_share(f, table, &index_num, type_id, mesg)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADTYPE, FAIL, "'complex' sharing checks returned error") if(tri_ret == FALSE) HGOTO_DONE(FALSE) @@ -1102,7 +1092,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, /* If the index hasn't been allocated yet, create it */ if(table->indexes[index_num].index_addr == HADDR_UNDEF) { - if(H5SM_create_index(f, &(table->indexes[index_num]), dxpl_id) < 0) + if(H5SM__create_index(f, &(table->indexes[index_num])) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to create SOHM index") cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ @@ -1110,7 +1100,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, /* Write the message as a shared message. This may or may not cause the * message to become shared (if it is unique, it will not be shared). */ - if(H5SM_write_mesg(f, dxpl_id, open_oh, &(table->indexes[index_num]), + if(H5SM__write_mesg(f, open_oh, &(table->indexes[index_num]), (defer_flags & H5SM_DEFER) != 0, type_id, mesg, &cache_flags) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "can't write shared message") @@ -1138,15 +1128,15 @@ done: #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) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_try_share() */ /*------------------------------------------------------------------------- - * Function: H5SM_incr_ref + * Function: H5SM__incr_ref * * Purpose: Increment the reference count for a SOHM message and return * the message's heap ID. @@ -1163,13 +1153,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_incr_ref(void *record, void *_op_data, hbool_t *changed) +H5SM__incr_ref(void *record, void *_op_data, hbool_t *changed) { H5SM_sohm_t *message = (H5SM_sohm_t *) record; H5SM_incr_ref_opdata *op_data = (H5SM_incr_ref_opdata *) _op_data; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(record); HDassert(op_data); @@ -1182,7 +1172,7 @@ H5SM_incr_ref(void *record, void *_op_data, hbool_t *changed) HDassert(op_data->key && op_data->key->fheap); /* Put the message in the heap and record its new heap ID */ - if(H5HF_insert(op_data->key->fheap, op_data->dxpl_id, op_data->key->encoding_size, op_data->key->encoding, &message->u.heap_loc.fheap_id) < 0) + if(H5HF_insert(op_data->key->fheap, op_data->key->encoding_size, op_data->key->encoding, &message->u.heap_loc.fheap_id) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to insert message into fractal heap") message->location = H5SM_IN_HEAP; @@ -1203,11 +1193,11 @@ H5SM_incr_ref(void *record, void *_op_data, hbool_t *changed) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_incr_ref() */ +} /* end H5SM__incr_ref() */ /*------------------------------------------------------------------------- - * Function: H5SM_write_mesg + * Function: H5SM__write_mesg * * Purpose: This routine adds a shareable message to an index. * The behavior is controlled by the DEFER parameter: @@ -1217,7 +1207,7 @@ done: * be with DEFER set the FALSE and updates the shared message * info, but does not actually add the message to a heap, list, * or b-tree. Assumes that an open object header will be - * available when H5SM_write_mesg is called with DEFER set to + * available when H5SM__write_mesg is called with DEFER set to * FALSE. * * If DEFER is FALSE, this routine adds a shareable message to @@ -1239,9 +1229,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5SM_index_header_t *header, hbool_t defer, unsigned type_id, void *mesg, - unsigned *cache_flags_ptr) +H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, + hbool_t defer, unsigned type_id, void *mesg, unsigned *cache_flags_ptr) { H5SM_list_t *list = NULL; /* List index */ H5SM_mesg_key_t key; /* Key used to search the index */ @@ -1255,7 +1244,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, size_t empty_pos = UFAIL; /* Empty entry in list */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) /* Sanity check */ HDassert(header); @@ -1271,11 +1260,10 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, HGOTO_ERROR(H5E_SOHM, H5E_CANTENCODE, FAIL, "can't encode message to be shared") /* Open the fractal heap for this index */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, header->heap_addr))) + if(NULL == (fheap = H5HF_open(f, header->heap_addr))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Set up a key for the message to be written */ - key.dxpl_id = dxpl_id; key.file = f; key.fheap = fheap; key.encoding = encoding_buf; @@ -1295,7 +1283,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, cache_udata.header = header; /* The index is a list; get it from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, defer ? H5AC__READ_ONLY_FLAG : H5AC__NO_FLAGS_SET))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, H5AC_SOHM_LIST, header->index_addr, &cache_udata, defer ? H5AC__READ_ONLY_FLAG : H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* See if the message is already in the index and get its location. @@ -1316,7 +1304,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, */ if(list->messages[list_pos].location == H5SM_IN_OH) { /* Put the message in the heap and record its new heap ID */ - if(H5HF_insert(fheap, dxpl_id, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) + if(H5HF_insert(fheap, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to insert message into fractal heap") list->messages[list_pos].location = H5SM_IN_HEAP; @@ -1340,7 +1328,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, HDassert(header->index_type == H5SM_BTREE); /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, header->index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") if(defer) { @@ -1351,7 +1339,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, * return a heap ID, since a message with a reference count greater * than 1 is always shared in the heap. */ - if((bt2_find = H5B2_find(bt2, dxpl_id, &key, NULL, NULL)) < 0) + if((bt2_find = H5B2_find(bt2, &key, NULL, NULL)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "can't search for message in index") found = (hbool_t)bt2_find; } /* end if */ @@ -1360,14 +1348,13 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Set up callback info */ op_data.key = &key; - op_data.dxpl_id = dxpl_id; /* If this returns failure, it means that the message wasn't found. */ /* If it succeeds, set the heap_id in the shared struct. It will * return a heap ID, since a message with a reference count greater * than 1 is always shared in the heap. */ - if(H5B2_modify(bt2, dxpl_id, &key, H5SM_incr_ref, &op_data) >= 0) { + if(H5B2_modify(bt2, &key, H5SM__incr_ref, &op_data) >= 0) { shared.u.heap_id = op_data.fheap_id; found = TRUE; } /* end if */ @@ -1444,7 +1431,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, if(!defer) { /* Put the message in the heap and record its new heap ID */ - if(H5HF_insert(fheap, dxpl_id, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) + if(H5HF_insert(fheap, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to insert message into fractal heap") key.message.location = H5SM_IN_HEAP; @@ -1459,7 +1446,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Check whether the list has grown enough that it needs to become a B-tree */ if(header->index_type == H5SM_LIST && header->num_messages >= header->list_max) - if(H5SM_convert_list_to_btree(f, header, &list, fheap, open_oh, dxpl_id) < 0) + if(H5SM__convert_list_to_btree(f, header, &list, fheap, open_oh) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to convert list to B-tree") /* Insert the new message into the SOHM index */ @@ -1485,11 +1472,11 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Open the index v2 B-tree, if it isn't already */ if(NULL == bt2) { - if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, header->index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") } /* end if */ - if(H5B2_insert(bt2, dxpl_id, &key) < 0) + if(H5B2_insert(bt2, &key) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "couldn't add SOHM to B-tree") } /* end else */ @@ -1508,20 +1495,20 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, done: /* Release the fractal heap & v2 B-tree if we opened them */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") /* If we got a list out of the cache, release it (it is always dirty after writing a message) */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, defer ? H5AC__NO_FLAGS_SET : H5AC__DIRTIED_FLAG) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, defer ? H5AC__NO_FLAGS_SET : H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") if(encoding_buf) encoding_buf = H5MM_xfree(encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5SM_write_mesg() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__write_mesg() */ /*------------------------------------------------------------------------- @@ -1543,7 +1530,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) +H5SM_delete(H5F_t *f, H5O_t *open_oh, H5O_shared_t *sh_mesg) { H5SM_master_table_t *table = NULL; unsigned cache_flags = H5AC__NO_FLAGS_SET; @@ -1554,7 +1541,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) unsigned type_id; /* Message type ID to operate on */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) HDassert(f); HDassert(H5F_addr_defined(H5F_SOHM_ADDR(f))); @@ -1567,7 +1554,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and try to delete from it */ @@ -1578,11 +1565,11 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) * zero and any file space it uses needs to be freed. mesg_buf holds the * serialized form of the message. */ - if(H5SM_delete_from_index(f, dxpl_id, open_oh, &(table->indexes[index_num]), sh_mesg, &cache_flags, &mesg_buf) < 0) + if(H5SM__delete_from_index(f, open_oh, &(table->indexes[index_num]), sh_mesg, &cache_flags, &mesg_buf) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete mesage from SOHM index") /* Release the master SOHM table */ - if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") table = NULL; @@ -1591,16 +1578,16 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) * master table needs to be unprotected when we do this. */ if(mesg_buf) { - if(NULL == (native_mesg = H5O_msg_decode(f, dxpl_id, open_oh, type_id, (const unsigned char *)mesg_buf))) + if(NULL == (native_mesg = H5O_msg_decode(f, open_oh, type_id, (const unsigned char *)mesg_buf))) HGOTO_ERROR(H5E_SOHM, H5E_CANTDECODE, FAIL, "can't decode shared message.") - if(H5O_msg_delete(f, dxpl_id, open_oh, type_id, native_mesg) < 0) + if(H5O_msg_delete(f, open_oh, type_id, native_mesg) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTFREE, FAIL, "can't delete shared message.") } /* end if */ done: /* Release the master SOHM table (should only happen on error) */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") /* Release any native message we decoded */ @@ -1611,7 +1598,7 @@ done: if(mesg_buf) mesg_buf = H5MM_xfree(mesg_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_delete() */ @@ -1713,7 +1700,7 @@ H5SM_get_hash_fh_cb(const void *obj, size_t obj_len, void *_udata) /*------------------------------------------------------------------------- - * Function: H5SM_decr_ref + * Function: H5SM__decr_ref * * Purpose: Decrement the reference count for a SOHM message. Doesn't * remove the record from the B-tree even if the refcount @@ -1732,11 +1719,11 @@ H5SM_get_hash_fh_cb(const void *obj, size_t obj_len, void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5SM_decr_ref(void *record, void *op_data, hbool_t *changed) +H5SM__decr_ref(void *record, void *op_data, hbool_t *changed) { H5SM_sohm_t *message = (H5SM_sohm_t *) record; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(record); HDassert(op_data); @@ -1755,11 +1742,11 @@ H5SM_decr_ref(void *record, void *op_data, hbool_t *changed) *(H5SM_sohm_t *)op_data = *message; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_decr_ref() */ +} /* end H5SM__decr_ref() */ /*------------------------------------------------------------------------- - * Function: H5SM_delete_from_index + * Function: H5SM__delete_from_index * * Purpose: Decrement the reference count for a particular message in this * index. If the reference count reaches zero, allocate a buffer @@ -1776,9 +1763,8 @@ H5SM_decr_ref(void *record, void *op_data, hbool_t *changed) *------------------------------------------------------------------------- */ static herr_t -H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5SM_index_header_t *header, const H5O_shared_t *mesg, - unsigned *cache_flags, void ** /*out*/ encoded_mesg) +H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, + const H5O_shared_t *mesg, unsigned *cache_flags, void ** /*out*/ encoded_mesg) { H5SM_list_t *list = NULL; H5SM_mesg_key_t key; @@ -1791,7 +1777,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id; /* Message type to operate on */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) /* Sanity check */ HDassert(f); @@ -1804,7 +1790,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, type_id = mesg->msg_type_id; /* Open the heap for this type of message. */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, header->heap_addr))) + if(NULL == (fheap = H5HF_open(f, header->heap_addr))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Get the message size and encoded message for the message to be deleted, @@ -1823,12 +1809,11 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, } /* end else */ /* Get the encoded message */ - if(H5SM_read_mesg(f, &key.message, fheap, open_oh, dxpl_id, &buf_size, &encoding_buf) < 0) + if(H5SM__read_mesg(f, &key.message, fheap, open_oh, &buf_size, &encoding_buf) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Set up key for message to be deleted. */ key.file = f; - key.dxpl_id = dxpl_id; key.fheap = fheap; key.encoding = encoding_buf; key.encoding_size = buf_size; @@ -1844,7 +1829,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, cache_udata.header = header; /* If the index is stored as a list, get it from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* Find the message in the list */ @@ -1864,13 +1849,13 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, HDassert(header->index_type == H5SM_BTREE); /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, header->index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") /* If this returns failure, it means that the message wasn't found. * If it succeeds, a copy of the modified message will be returned. */ - if(H5B2_modify(bt2, dxpl_id, &key, H5SM_decr_ref, &message) < 0) + if(H5B2_modify(bt2, &key, H5SM__decr_ref, &message) < 0) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index") /* Point to the message */ @@ -1894,17 +1879,17 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, else { /* Open the index v2 B-tree, if it isn't already */ if(NULL == bt2) { - if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, header->index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") } /* end if */ - if(H5B2_remove(bt2, dxpl_id, &key, NULL, NULL) < 0) + if(H5B2_remove(bt2, &key, NULL, NULL) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTREMOVE, FAIL, "unable to delete message from index") } /* end else */ /* Remove the message from the heap if it was stored in the heap*/ if(old_loc == H5SM_IN_HEAP) - if(H5HF_remove(fheap, dxpl_id, &(message_ptr->u.heap_loc.fheap_id)) < 0) + if(H5HF_remove(fheap, &(message_ptr->u.heap_loc.fheap_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTREMOVE, FAIL, "unable to remove message from heap") @@ -1915,37 +1900,37 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, if(header->num_messages == 0) { /* Unprotect cache and release heap */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to release SOHM list") list = NULL; HDassert(fheap); - if(H5HF_close(fheap, dxpl_id) < 0) + if(H5HF_close(fheap) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") fheap = NULL; /* Delete the index and its heap */ - if(H5SM_delete_index(f, header, dxpl_id, TRUE) < 0) + if(H5SM__delete_index(f, header, TRUE) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "can't delete empty index") } /* end if */ else if(header->index_type == H5SM_BTREE && header->num_messages < header->btree_min) { /* Otherwise, if we've just passed the btree-to-list cutoff, convert * this B-tree into a list */ - if(H5SM_convert_btree_to_list(f, header, dxpl_id) < 0) + if(H5SM__convert_btree_to_list(f, header) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to convert btree to list") } /* end if */ } /* end if */ done: /* Release the SOHM list */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") /* Release the fractal heap & v2 B-tree if we opened them */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") /* Free the message encoding, if we're not returning it in encoded_mesg @@ -1954,8 +1939,8 @@ done: if(encoding_buf && (NULL == *encoded_mesg || ret_value < 0)) encoding_buf = H5MM_xfree(encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5SM_delete_from_index() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__delete_from_index() */ /*------------------------------------------------------------------------- @@ -1971,18 +1956,17 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) +H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist) { H5F_t *f = ext_loc->file; /* File pointer (convenience variable) */ H5O_shmesg_table_t sohm_table; /* SOHM message from superblock extension */ H5SM_master_table_t *table = NULL; /* SOHM master table */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ unsigned tmp_sohm_nindexes; /* Number of shared messages indexes in the table */ htri_t status; /* Status for message existing */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* Sanity check */ HDassert(ext_loc); @@ -1990,7 +1974,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) HDassert(fc_plist); /* Check for the extension having a 'shared message info' message */ - if((status = H5O_msg_exists(ext_loc, H5O_SHMESG_ID, dxpl_id)) < 0) + if((status = H5O_msg_exists(ext_loc, H5O_SHMESG_ID)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "unable to read object header") if(status) { H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ @@ -2001,7 +1985,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) unsigned u; /* Local index variable */ /* Retrieve the 'shared message info' structure */ - if(NULL == H5O_msg_read(ext_loc, H5O_SHMESG_ID, &sohm_table, dxpl_id)) + if(NULL == H5O_msg_read(ext_loc, H5O_SHMESG_ID, &sohm_table)) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "shared message info message not present") /* Portably initialize the arrays */ @@ -2019,11 +2003,10 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) cache_udata.f = f; /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_USER, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set ring value") + H5AC_set_ring(H5AC_RING_USER, &orig_ring); /* Read the rest of the SOHM table information from the cache */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get index conversion limits */ @@ -2073,15 +2056,15 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) } /* end else */ done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Release the master SOHM table if we took it out of the cache */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_get_info() */ @@ -2163,8 +2146,8 @@ H5SM_get_refcount_bt2_cb(const void *_record, void *_op_data) *------------------------------------------------------------------------- */ herr_t -H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, - const H5O_shared_t *sh_mesg, hsize_t *ref_count) +H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, + hsize_t *ref_count) { H5HF_t *fheap = NULL; /* Fractal heap that contains shared messages */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ @@ -2179,7 +2162,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, void * encoding_buf = NULL; /* Buffer for encoded message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(H5AC__SOHM_TAG) /* Sanity check */ HDassert(f); @@ -2190,7 +2173,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, tbl_cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &tbl_cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &tbl_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and find the message in it */ @@ -2199,7 +2182,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, header = &(table->indexes[index_num]); /* Open the heap for this message type */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, header->heap_addr))) + if(NULL == (fheap = H5HF_open(f, header->heap_addr))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Set up a SOHM message to correspond to the shared message passed in */ @@ -2208,12 +2191,11 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, key.message.u.heap_loc.ref_count = 0; /* Ref count isn't needed to find message */ /* Get the encoded message */ - if(H5SM_read_mesg(f, &key.message, fheap, NULL, dxpl_id, &buf_size, &encoding_buf) < 0) + if(H5SM__read_mesg(f, &key.message, fheap, NULL, &buf_size, &encoding_buf) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Set up key for message to locate */ key.file = f; - key.dxpl_id = dxpl_id; key.fheap = fheap; key.encoding = encoding_buf; key.encoding_size = buf_size; @@ -2229,7 +2211,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, lst_cache_udata.header = header; /* If the index is stored as a list, get it from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &lst_cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, H5AC_SOHM_LIST, header->index_addr, &lst_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* Find the message in the list */ @@ -2248,11 +2230,11 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, HDassert(header->index_type == H5SM_BTREE); /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, header->index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") /* Look up the message in the v2 B-tree */ - if((msg_exists = H5B2_find(bt2, dxpl_id, &key, H5SM_get_refcount_bt2_cb, &message)) < 0) + if((msg_exists = H5B2_find(bt2, &key, H5SM_get_refcount_bt2_cb, &message)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "error finding message in index") if(!msg_exists) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index") @@ -2264,23 +2246,23 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, done: /* Release resources */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__NO_FLAGS_SET) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") if(encoding_buf) encoding_buf = H5MM_xfree(encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_get_refcount() */ /*------------------------------------------------------------------------- - * Function: H5SM_read_iter_op + * Function: H5SM__read_iter_op * * Purpose: OH iteration callback to get the encoded version of a message * by index. @@ -2298,13 +2280,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, +H5SM__read_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5SM_read_udata_t *udata = (H5SM_read_udata_t *) _udata; herr_t ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2338,13 +2320,13 @@ H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_read_iter_op() */ +} /* end H5SM__read_iter_op() */ /*------------------------------------------------------------------------- - * Function: H5SM_read_mesg_fh_cb + * Function: H5SM__read_mesg_fh_cb * - * Purpose: Callback for H5HF_op, used in H5SM_read_mesg below. + * Purpose: Callback for H5HF_op, used in H5SM__read_mesg below. * Makes a copy of the message in the heap data, returned in the * UDATA struct. * @@ -2356,12 +2338,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5SM__read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5SM_read_udata_t *udata = (H5SM_read_udata_t *)_udata; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate a buffer to hold the message */ if(NULL == (udata->encoding_buf = H5MM_malloc(obj_len))) @@ -2373,11 +2355,11 @@ H5SM_read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_read_mesg_fh_cb() */ +} /* end H5SM__read_mesg_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5SM_read_mesg + * Function: H5SM__read_mesg * * Purpose: Given an H5SM_sohm_t sohm, encodes the message into a buffer. * This buffer should then be freed. @@ -2390,16 +2372,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, - H5O_t *open_oh, hid_t dxpl_id, size_t *encoding_size /*out*/, - void ** encoded_mesg /*out*/) +H5SM__read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, + H5O_t *open_oh, size_t *encoding_size /*out*/, void ** encoded_mesg /*out*/) { H5SM_read_udata_t udata; /* User data for callbacks */ H5O_loc_t oloc; /* Object location for message in object header */ H5O_t *oh = NULL; /* Object header for message in object header */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) HDassert(f); HDassert(mesg); @@ -2434,7 +2415,7 @@ H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, FAIL, "unable to open object header") /* Load the object header from the cache */ - if(NULL == (oh = H5O_protect(&oloc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load object header") } /* end if */ else @@ -2442,15 +2423,15 @@ H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, /* Use the "real" iterate routine so it doesn't try to protect the OH */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5SM_read_iter_op; - if((ret_value = H5O_msg_iterate_real(f, oh, type, &op, &udata, dxpl_id)) < 0) + op.u.lib_op = H5SM__read_iter_op; + if((ret_value = H5O__msg_iterate_real(f, oh, type, &op, &udata)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADITER, FAIL, "unable to iterate over object header messages") } /* end if */ else { HDassert(mesg->location == H5SM_IN_HEAP); /* Copy the message from the heap */ - if(H5HF_op(fheap, dxpl_id, &(mesg->u.heap_loc.fheap_id), H5SM_read_mesg_fh_cb, &udata) < 0) + if(H5HF_op(fheap, &(mesg->u.heap_loc.fheap_id), H5SM__read_mesg_fh_cb, &udata) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, FAIL, "can't read message from fractal heap.") } /* end else */ HDassert(udata.encoding_buf); @@ -2463,7 +2444,7 @@ H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, done: /* Close the object header if we opened one and had an error */ if(oh && oh != open_oh) { - if(oh && H5O_unprotect(&oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(&oloc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to release object header") if(H5O_close(&oloc, NULL) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "unable to close object header") @@ -2473,8 +2454,8 @@ done: if(ret_value < 0 && udata.encoding_buf) udata.encoding_buf = H5MM_xfree(udata.encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5SM_read_mesg */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__read_mesg */ /*------------------------------------------------------------------------- @@ -2550,16 +2531,15 @@ H5SM_list_free(H5SM_list_t *list) *------------------------------------------------------------------------- */ herr_t -H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, - FILE *stream, int indent, int fwidth, - unsigned table_vers, unsigned num_indexes) +H5SM_table_debug(H5F_t *f, haddr_t table_addr, FILE *stream, int indent, + int fwidth, unsigned table_vers, unsigned num_indexes) { H5SM_master_table_t *table = NULL; /* SOHM master table */ H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ unsigned x; /* Counter variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) HDassert(f); HDassert(table_addr != HADDR_UNDEF); @@ -2589,7 +2569,7 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, table_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") HDfprintf(stream, "%*sShared Message Master Table...\n", indent, ""); @@ -2617,10 +2597,10 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, } /* end for */ done: - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_table_debug() */ @@ -2639,8 +2619,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, - int indent, int fwidth, haddr_t table_addr) +H5SM_list_debug(H5F_t *f, haddr_t list_addr, FILE *stream, int indent, + int fwidth, haddr_t table_addr) { H5SM_master_table_t *table = NULL; /* SOHM master table */ H5SM_list_t *list = NULL; /* SOHM index list for message type (if in list form) */ @@ -2651,7 +2631,7 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, unsigned x; /* Counter variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) HDassert(f); HDassert(list_addr != HADDR_UNDEF); @@ -2663,7 +2643,7 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, tbl_cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, &tbl_cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, table_addr, &tbl_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Determine which index the list is part of */ @@ -2682,12 +2662,12 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, lst_cache_udata.header = &(table->indexes[index_num]); /* Get the list from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, &lst_cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, H5AC_SOHM_LIST, list_addr, &lst_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* Open the heap, if one exists */ if(H5F_addr_defined(table->indexes[index_num].heap_addr)) - if(NULL == (fh = H5HF_open(f, dxpl_id, table->indexes[index_num].heap_addr))) + if(NULL == (fh = H5HF_open(f, table->indexes[index_num].heap_addr))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open SOHM heap") HDfprintf(stream, "%*sShared Message List Index...\n", indent, ""); @@ -2721,14 +2701,14 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, } /* end for */ done: - if(fh && H5HF_close(fh, dxpl_id) < 0) + if(fh && H5HF_close(fh) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "unable to close SOHM heap") - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, list, H5AC__NO_FLAGS_SET) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, list_addr, list, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_list_debug() */ @@ -2749,7 +2729,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) +H5SM_ih_size(H5F_t *f, hsize_t *hdr_size, H5_ih_info_t *ih_info) { H5SM_master_table_t *table = NULL; /* SOHM master table */ H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ @@ -2758,7 +2738,7 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* Sanity check */ HDassert(f); @@ -2770,7 +2750,7 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get SOHM header size */ @@ -2782,14 +2762,14 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) if(table->indexes[u].index_type == H5SM_BTREE) { if(H5F_addr_defined(table->indexes[u].index_addr)) { /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, table->indexes[u].index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, table->indexes[u].index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") - if(H5B2_size(bt2, dxpl_id, &(ih_info->index_size)) < 0) + if(H5B2_size(bt2, &(ih_info->index_size)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl_id) < 0) + if(H5B2_close(bt2) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") bt2 = NULL; } /* end if */ @@ -2802,15 +2782,15 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) /* Check for heap for this index */ if(H5F_addr_defined(table->indexes[u].heap_addr)) { /* Open the fractal heap for this index */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, table->indexes[u].heap_addr))) + if(NULL == (fheap = H5HF_open(f, table->indexes[u].heap_addr))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Get heap storage size */ - if(H5HF_size(fheap, dxpl_id, &(ih_info->heap_size)) < 0) + if(H5HF_size(fheap, &(ih_info->heap_size)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't retrieve fractal heap storage info") /* Close the fractal heap */ - if(H5HF_close(fheap, dxpl_id) < 0) + if(H5HF_close(fheap) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") fheap = NULL; } /* end if */ @@ -2818,13 +2798,13 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_ih_size() */ diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c index 7df9f8f..ad84b24 100644 --- a/src/H5SMmessage.c +++ b/src/H5SMmessage.c @@ -236,7 +236,7 @@ H5SM__message_compare(const void *rec1, const void *rec2, int *result) */ if(mesg->location == H5SM_IN_HEAP) { /* Call heap op routine with comparison callback */ - if(H5HF_op(key->fheap, key->dxpl_id, &(mesg->u.heap_loc.fheap_id), H5SM_compare_cb, &udata) < 0) + if(H5HF_op(key->fheap, &(mesg->u.heap_loc.fheap_id), H5SM_compare_cb, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ else { @@ -261,7 +261,7 @@ H5SM__message_compare(const void *rec1, const void *rec2, int *result) /* Locate the right message and compare with it */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5SM_compare_iter_op; - if(H5O_msg_iterate(&oloc, mesg->msg_type_id, &op, &udata, key->dxpl_id) < 0) + if(H5O_msg_iterate(&oloc, mesg->msg_type_id, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over links") } /* end else */ diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 6dea7ae..a9a4fd9 100644 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -199,7 +199,6 @@ struct H5SM_master_table_t { /* Typedef for searching an index (list or B-tree) */ typedef struct { H5F_t *file; /* File in which sharing is happening */ - hid_t dxpl_id; /* DXPL for sharing messages in heap */ H5HF_t *fheap; /* The heap for this message type, open. */ void *encoding; /* The message encoded, or NULL */ size_t encoding_size; /* Size of the encoding, or 0 */ @@ -224,7 +223,6 @@ typedef struct { typedef struct { H5SM_mesg_key_t *key; /* IN: key for message being incremented */ H5O_fheap_id_t fheap_id; /* OUT: fheap ID of record */ - hid_t dxpl_id; } H5SM_incr_ref_opdata; /* v2 B-tree client callback context */ @@ -280,8 +278,7 @@ herr_t H5SM_list_free(H5SM_list_t *list); /* Testing functions */ #ifdef H5SM_TESTING -H5_DLL herr_t H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, - size_t *mesg_count); +H5_DLL herr_t H5SM__get_mesg_count_test(H5F_t *f, unsigned type_id, size_t *mesg_count); #endif /* H5SM_TESTING */ #endif /* _H5SMpkg_H */ diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h index 8f9f533..e6776f3 100644 --- a/src/H5SMprivate.h +++ b/src/H5SMprivate.h @@ -47,32 +47,27 @@ typedef struct H5SM_master_table_t H5SM_master_table_t; /******************************/ /* Generally useful shared message routines */ -H5_DLL herr_t H5SM_init(H5F_t *f, H5P_genplist_t *fc_plist, - const H5O_loc_t *ext_loc, hid_t dxpl_id); -H5_DLL htri_t H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, +H5_DLL herr_t H5SM_init(H5F_t *f, H5P_genplist_t *fc_plist, const H5O_loc_t *ext_loc); +H5_DLL htri_t H5SM_can_share(H5F_t *f, H5SM_master_table_t *table, ssize_t *sohm_index_num, unsigned type_id, const void *mesg); -H5_DLL htri_t H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned defer_flags, unsigned type_id, void *mesg, unsigned *mesg_flags); -H5_DLL herr_t H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5O_shared_t *sh_mesg); -H5_DLL herr_t H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, - hid_t dxpl_id); -H5_DLL htri_t H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id); -H5_DLL herr_t H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, - haddr_t *fheap_addr); +H5_DLL htri_t H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, + unsigned type_id, void *mesg, unsigned *mesg_flags); +H5_DLL herr_t H5SM_delete(H5F_t *f, H5O_t *open_oh, H5O_shared_t *sh_mesg); +H5_DLL herr_t H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist); +H5_DLL htri_t H5SM_type_shared(H5F_t *f, unsigned type_id); +H5_DLL herr_t H5SM_get_fheap_addr(H5F_t *f, unsigned type_id, haddr_t *fheap_addr); H5_DLL herr_t H5SM_reconstitute(H5O_shared_t *sh_mesg, H5F_t *f, unsigned msg_type_id, H5O_fheap_id_t heap_id); -H5_DLL herr_t H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, +H5_DLL herr_t H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, hsize_t *ref_count); -H5_DLL herr_t H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info); +H5_DLL herr_t H5SM_ih_size(H5F_t *f, hsize_t *hdr_size, H5_ih_info_t *ih_info); /* Debugging routines */ -H5_DLL herr_t H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, - FILE *stream, int indent, int fwidth, unsigned table_vers, - unsigned num_indexes); -H5_DLL herr_t H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, - FILE *stream, int indent, int fwidth, haddr_t table_addr); +H5_DLL herr_t H5SM_table_debug(H5F_t *f, haddr_t table_addr, FILE *stream, + int indent, int fwidth, unsigned table_vers, unsigned num_indexes); +H5_DLL herr_t H5SM_list_debug(H5F_t *f, haddr_t list_addr, FILE *stream, + int indent, int fwidth, haddr_t table_addr); #endif /*_H5SMprivate_H*/ diff --git a/src/H5SMtest.c b/src/H5SMtest.c index 6a4b63a..490265c 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -62,7 +62,7 @@ /*------------------------------------------------------------------------- - * Function: H5SM_get_mesg_count_test + * Function: H5SM__get_mesg_count_test * * Purpose: Retrieve the number of messages tracked of a certain type * @@ -74,13 +74,12 @@ *------------------------------------------------------------------------- */ herr_t -H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, - size_t *mesg_count) +H5SM__get_mesg_count_test(H5F_t *f, unsigned type_id, size_t *mesg_count) { H5SM_master_table_t *table = NULL; /* SOHM master table */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__SOHM_TAG) /* Sanity check */ HDassert(f); @@ -96,7 +95,7 @@ H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index for this message type */ @@ -113,9 +112,9 @@ H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, done: /* Release resources */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5SM_get_mesg_count_test() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__get_mesg_count_test() */ diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c index c9103f7..f3b8f4b 100644 --- a/src/H5Sdbg.c +++ b/src/H5Sdbg.c @@ -86,8 +86,7 @@ *------------------------------------------------------------------------- */ herr_t -H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, - int fwidth) +H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5S_t *mesg = (const H5S_t*)_mesg; @@ -107,8 +106,7 @@ H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, case H5S_SIMPLE: fprintf(stream, "%*s%-*s H5S_SIMPLE\n", indent, "", fwidth, "Space class:"); - H5O_debug_id(H5O_SDSPACE_ID, f, dxpl_id, &(mesg->extent), stream, - indent + 3, MAX(0, fwidth - 3)); + H5O_debug_id(H5O_SDSPACE_ID, f, &(mesg->extent), stream, indent + 3, MAX(0, fwidth - 3)); break; case H5S_NO_CLASS: diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index f125035..d62a1b6 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -208,10 +208,9 @@ H5_DLL hbool_t H5S_has_extent(const H5S_t *ds); H5_DLL int H5S_get_simple_extent_ndims(const H5S_t *ds); H5_DLL int H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[]/*out*/, hsize_t max_dims[]/*out*/); -H5_DLL herr_t H5S_write(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned update_flags, - H5S_t *ds); -H5_DLL herr_t H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, H5S_t *ds); -H5_DLL H5S_t *H5S_read(const struct H5O_loc_t *loc, hid_t dxpl_id); +H5_DLL herr_t H5S_write(H5F_t *f, H5O_t *oh, unsigned update_flags, H5S_t *ds); +H5_DLL herr_t H5S_append(H5F_t *f, struct H5O_t *oh, H5S_t *ds); +H5_DLL H5S_t *H5S_read(const struct H5O_loc_t *loc); H5_DLL htri_t H5S_set_extent(H5S_t *space, const hsize_t *size); H5_DLL herr_t H5S_set_extent_real(H5S_t *space, const hsize_t *size); H5_DLL herr_t H5S_set_extent_simple(H5S_t *space, unsigned rank, @@ -222,11 +221,8 @@ H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], H5_DLL herr_t H5S_set_latest_version(H5S_t *ds); H5_DLL herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc); H5_DLL H5S_t *H5S_decode(const unsigned char **p); -H5_DLL herr_t H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); -#ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL int H5S_extend(H5S_t *space, const hsize_t *size); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +H5_DLL herr_t H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, + int fwidth); /* Operations on dataspace extents */ H5_DLL hsize_t H5S_extent_nelem(const H5S_extent_t *ext); diff --git a/src/H5T.c b/src/H5T.c index a525cd5..d4d67f1 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -30,6 +30,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ @@ -291,12 +292,17 @@ /********************/ /* 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); -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); -static htri_t H5T_compiler_conv(H5T_t *src, H5T_t *dst); -static herr_t H5T_set_size(H5T_t *dt, size_t size); +static herr_t H5T__register_int(H5T_pers_t pers, const char *name, H5T_t *src, + H5T_t *dst, H5T_lib_conv_t func); +static herr_t H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, + H5T_t *dst, H5T_conv_func_t *conv); +static herr_t H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, + H5T_t *dst, H5T_conv_t func); +static htri_t H5T__compiler_conv(H5T_t *src, H5T_t *dst); +static herr_t H5T__set_size(H5T_t *dt, size_t size); +static herr_t H5T__close_cb(H5T_t *dt); +static H5T_path_t *H5T__path_find_real(const H5T_t *src, const H5T_t *dst, + const char *name, H5T_conv_func_t *conv); /*****************************/ @@ -533,10 +539,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_cb /* Callback routine for closing objects of this class */ }}; /* Flag indicating "top" of interface has been initialized */ @@ -732,7 +738,7 @@ H5T__init_package(void) H5T_t *objref=NULL; /* Datatype structure for object reference objects */ hsize_t dim[1]={1}; /* Dimension info for array datatype */ herr_t status; - unsigned copied_dtype=1; /* Flag to indicate whether datatype was copied or allocated (for error cleanup) */ + hbool_t copied_dtype = TRUE; /* Flag to indicate whether datatype was copied or allocated (for error cleanup) */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1004,24 +1010,24 @@ H5T__init_package(void) 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); - status |= H5T_register(H5T_PERS_SOFT, "i_f", fixedpt, floatpt, H5T__conv_i_f, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "f_f", floatpt, floatpt, H5T__conv_f_f, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "f_i", floatpt, fixedpt, H5T__conv_f_i, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "s_s", string, string, H5T__conv_s_s, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "b_b", bitfield, bitfield, H5T__conv_b_b, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "ibo", fixedpt, fixedpt, H5T__conv_order, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "ibo(opt)", fixedpt, fixedpt, H5T__conv_order_opt, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "fbo", floatpt, floatpt, H5T__conv_order, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "fbo(opt)", floatpt, floatpt, H5T__conv_order_opt, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "struct(no-opt)", compound, compound, H5T__conv_struct, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "struct(opt)", compound, compound, H5T__conv_struct_opt, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "enum", enum_type, enum_type, H5T__conv_enum, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "enum_i", enum_type, fixedpt, H5T__conv_enum_numeric, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "enum_f", enum_type, floatpt, H5T__conv_enum_numeric, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "vlen", vlen, vlen, H5T__conv_vlen, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "array", array, array, H5T__conv_array, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "objref", objref, objref, H5T__conv_order_opt, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_SOFT, "i_i", fixedpt, fixedpt, H5T__conv_i_i); + status |= H5T__register_int(H5T_PERS_SOFT, "i_f", fixedpt, floatpt, H5T__conv_i_f); + status |= H5T__register_int(H5T_PERS_SOFT, "f_f", floatpt, floatpt, H5T__conv_f_f); + status |= H5T__register_int(H5T_PERS_SOFT, "f_i", floatpt, fixedpt, H5T__conv_f_i); + status |= H5T__register_int(H5T_PERS_SOFT, "s_s", string, string, H5T__conv_s_s); + status |= H5T__register_int(H5T_PERS_SOFT, "b_b", bitfield, bitfield, H5T__conv_b_b); + status |= H5T__register_int(H5T_PERS_SOFT, "ibo", fixedpt, fixedpt, H5T__conv_order); + status |= H5T__register_int(H5T_PERS_SOFT, "ibo(opt)", fixedpt, fixedpt, H5T__conv_order_opt); + status |= H5T__register_int(H5T_PERS_SOFT, "fbo", floatpt, floatpt, H5T__conv_order); + status |= H5T__register_int(H5T_PERS_SOFT, "fbo(opt)", floatpt, floatpt, H5T__conv_order_opt); + status |= H5T__register_int(H5T_PERS_SOFT, "struct(no-opt)", compound, compound, H5T__conv_struct); + status |= H5T__register_int(H5T_PERS_SOFT, "struct(opt)", compound, compound, H5T__conv_struct_opt); + status |= H5T__register_int(H5T_PERS_SOFT, "enum", enum_type, enum_type, H5T__conv_enum); + status |= H5T__register_int(H5T_PERS_SOFT, "enum_i", enum_type, fixedpt, H5T__conv_enum_numeric); + status |= H5T__register_int(H5T_PERS_SOFT, "enum_f", enum_type, floatpt, H5T__conv_enum_numeric); + status |= H5T__register_int(H5T_PERS_SOFT, "vlen", vlen, vlen, H5T__conv_vlen); + status |= H5T__register_int(H5T_PERS_SOFT, "array", array, array, H5T__conv_array); + status |= H5T__register_int(H5T_PERS_SOFT, "objref", objref, objref, H5T__conv_order_opt); /* * Native conversions should be listed last since we can use hardware to @@ -1032,221 +1038,221 @@ H5T__init_package(void) */ /* floating point */ - status |= H5T_register(H5T_PERS_HARD, "flt_dbl", native_float, native_double, H5T__conv_float_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_flt", native_double, native_float, H5T__conv_double_float, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_dbl", native_float, native_double, H5T__conv_float_double); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_flt", native_double, native_float, H5T__conv_double_float); #if H5_SIZEOF_LONG_DOUBLE != 0 - status |= H5T_register(H5T_PERS_HARD, "flt_ldbl", native_float, native_ldouble, H5T__conv_float_ldouble, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ldbl", native_double, native_ldouble, H5T__conv_double_ldouble, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_flt", native_ldouble, native_float, H5T__conv_ldouble_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T__conv_ldouble_double, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_ldbl", native_float, native_ldouble, H5T__conv_float_ldouble); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_ldbl", native_double, native_ldouble, H5T__conv_double_ldouble); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_flt", native_ldouble, native_float, H5T__conv_ldouble_float); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T__conv_ldouble_double); #endif /* H5_SIZEOF_LONG_DOUBLE != 0 */ /* from long long */ - status |= H5T_register(H5T_PERS_HARD, "llong_ullong", native_llong, native_ullong, H5T__conv_llong_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_llong", native_ullong, native_llong, H5T__conv_ullong_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_long", native_llong, native_long, H5T__conv_llong_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_ulong", native_llong, native_ulong, H5T__conv_llong_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_long", native_ullong, native_long, H5T__conv_ullong_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_ulong", native_ullong, native_ulong, H5T__conv_ullong_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_short", native_llong, native_short, H5T__conv_llong_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_ushort", native_llong, native_ushort, H5T__conv_llong_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_short", native_ullong, native_short, H5T__conv_ullong_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_ushort", native_ullong, native_ushort, H5T__conv_ullong_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_int", native_llong, native_int, H5T__conv_llong_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_uint", native_llong, native_uint, H5T__conv_llong_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_int", native_ullong, native_int, H5T__conv_ullong_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_uint", native_ullong, native_uint, H5T__conv_ullong_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_schar", native_llong, native_schar, H5T__conv_llong_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_uchar", native_llong, native_uchar, H5T__conv_llong_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_schar", native_ullong, native_schar, H5T__conv_ullong_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_uchar", native_ullong, native_uchar, H5T__conv_ullong_uchar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "llong_ullong", native_llong, native_ullong, H5T__conv_llong_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_llong", native_ullong, native_llong, H5T__conv_ullong_llong); + status |= H5T__register_int(H5T_PERS_HARD, "llong_long", native_llong, native_long, H5T__conv_llong_long); + status |= H5T__register_int(H5T_PERS_HARD, "llong_ulong", native_llong, native_ulong, H5T__conv_llong_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_long", native_ullong, native_long, H5T__conv_ullong_long); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_ulong", native_ullong, native_ulong, H5T__conv_ullong_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "llong_short", native_llong, native_short, H5T__conv_llong_short); + status |= H5T__register_int(H5T_PERS_HARD, "llong_ushort", native_llong, native_ushort, H5T__conv_llong_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_short", native_ullong, native_short, H5T__conv_ullong_short); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_ushort", native_ullong, native_ushort, H5T__conv_ullong_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "llong_int", native_llong, native_int, H5T__conv_llong_int); + status |= H5T__register_int(H5T_PERS_HARD, "llong_uint", native_llong, native_uint, H5T__conv_llong_uint); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_int", native_ullong, native_int, H5T__conv_ullong_int); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_uint", native_ullong, native_uint, H5T__conv_ullong_uint); + status |= H5T__register_int(H5T_PERS_HARD, "llong_schar", native_llong, native_schar, H5T__conv_llong_schar); + status |= H5T__register_int(H5T_PERS_HARD, "llong_uchar", native_llong, native_uchar, H5T__conv_llong_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_schar", native_ullong, native_schar, H5T__conv_ullong_schar); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_uchar", native_ullong, native_uchar, H5T__conv_ullong_uchar); /* From long */ - status |= H5T_register(H5T_PERS_HARD, "long_llong", native_long, native_llong, H5T__conv_long_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ullong", native_long, native_ullong, H5T__conv_long_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_llong", native_ulong, native_llong, H5T__conv_ulong_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_ullong", native_ulong, native_ullong, H5T__conv_ulong_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ulong", native_long, native_ulong, H5T__conv_long_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_long", native_ulong, native_long, H5T__conv_ulong_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_short", native_long, native_short, H5T__conv_long_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ushort", native_long, native_ushort, H5T__conv_long_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_short", native_ulong, native_short, H5T__conv_ulong_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_ushort", native_ulong, native_ushort, H5T__conv_ulong_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_int", native_long, native_int, H5T__conv_long_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_uint", native_long, native_uint, H5T__conv_long_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_int", native_ulong, native_int, H5T__conv_ulong_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_uint", native_ulong, native_uint, H5T__conv_ulong_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_schar", native_long, native_schar, H5T__conv_long_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_uchar", native_long, native_uchar, H5T__conv_long_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_schar", native_ulong, native_schar, H5T__conv_ulong_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_uchar", native_ulong, native_uchar, H5T__conv_ulong_uchar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "long_llong", native_long, native_llong, H5T__conv_long_llong); + status |= H5T__register_int(H5T_PERS_HARD, "long_ullong", native_long, native_ullong, H5T__conv_long_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_llong", native_ulong, native_llong, H5T__conv_ulong_llong); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_ullong", native_ulong, native_ullong, H5T__conv_ulong_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "long_ulong", native_long, native_ulong, H5T__conv_long_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_long", native_ulong, native_long, H5T__conv_ulong_long); + status |= H5T__register_int(H5T_PERS_HARD, "long_short", native_long, native_short, H5T__conv_long_short); + status |= H5T__register_int(H5T_PERS_HARD, "long_ushort", native_long, native_ushort, H5T__conv_long_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_short", native_ulong, native_short, H5T__conv_ulong_short); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_ushort", native_ulong, native_ushort, H5T__conv_ulong_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "long_int", native_long, native_int, H5T__conv_long_int); + status |= H5T__register_int(H5T_PERS_HARD, "long_uint", native_long, native_uint, H5T__conv_long_uint); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_int", native_ulong, native_int, H5T__conv_ulong_int); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_uint", native_ulong, native_uint, H5T__conv_ulong_uint); + status |= H5T__register_int(H5T_PERS_HARD, "long_schar", native_long, native_schar, H5T__conv_long_schar); + status |= H5T__register_int(H5T_PERS_HARD, "long_uchar", native_long, native_uchar, H5T__conv_long_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_schar", native_ulong, native_schar, H5T__conv_ulong_schar); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_uchar", native_ulong, native_uchar, H5T__conv_ulong_uchar); /* From short */ - status |= H5T_register(H5T_PERS_HARD, "short_llong", native_short, native_llong, H5T__conv_short_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ullong", native_short, native_ullong, H5T__conv_short_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_llong", native_ushort, native_llong, H5T__conv_ushort_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_ullong", native_ushort, native_ullong, H5T__conv_ushort_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_long", native_short, native_long, H5T__conv_short_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ulong", native_short, native_ulong, H5T__conv_short_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_long", native_ushort, native_long, H5T__conv_ushort_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_ulong", native_ushort, native_ulong, H5T__conv_ushort_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ushort", native_short, native_ushort, H5T__conv_short_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_short", native_ushort, native_short, H5T__conv_ushort_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_int", native_short, native_int, H5T__conv_short_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_uint", native_short, native_uint, H5T__conv_short_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_int", native_ushort, native_int, H5T__conv_ushort_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_uint", native_ushort, native_uint, H5T__conv_ushort_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_schar", native_short, native_schar, H5T__conv_short_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_uchar", native_short, native_uchar, H5T__conv_short_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_schar", native_ushort, native_schar, H5T__conv_ushort_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_uchar", native_ushort, native_uchar, H5T__conv_ushort_uchar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "short_llong", native_short, native_llong, H5T__conv_short_llong); + status |= H5T__register_int(H5T_PERS_HARD, "short_ullong", native_short, native_ullong, H5T__conv_short_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_llong", native_ushort, native_llong, H5T__conv_ushort_llong); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_ullong", native_ushort, native_ullong, H5T__conv_ushort_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "short_long", native_short, native_long, H5T__conv_short_long); + status |= H5T__register_int(H5T_PERS_HARD, "short_ulong", native_short, native_ulong, H5T__conv_short_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_long", native_ushort, native_long, H5T__conv_ushort_long); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_ulong", native_ushort, native_ulong, H5T__conv_ushort_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "short_ushort", native_short, native_ushort, H5T__conv_short_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_short", native_ushort, native_short, H5T__conv_ushort_short); + status |= H5T__register_int(H5T_PERS_HARD, "short_int", native_short, native_int, H5T__conv_short_int); + status |= H5T__register_int(H5T_PERS_HARD, "short_uint", native_short, native_uint, H5T__conv_short_uint); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_int", native_ushort, native_int, H5T__conv_ushort_int); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_uint", native_ushort, native_uint, H5T__conv_ushort_uint); + status |= H5T__register_int(H5T_PERS_HARD, "short_schar", native_short, native_schar, H5T__conv_short_schar); + status |= H5T__register_int(H5T_PERS_HARD, "short_uchar", native_short, native_uchar, H5T__conv_short_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_schar", native_ushort, native_schar, H5T__conv_ushort_schar); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_uchar", native_ushort, native_uchar, H5T__conv_ushort_uchar); /* From int */ - status |= H5T_register(H5T_PERS_HARD, "int_llong", native_int, native_llong, H5T__conv_int_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ullong", native_int, native_ullong, H5T__conv_int_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_llong", native_uint, native_llong, H5T__conv_uint_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ullong", native_uint, native_ullong, H5T__conv_uint_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_long", native_int, native_long, H5T__conv_int_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ulong", native_int, native_ulong, H5T__conv_int_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_long", native_uint, native_long, H5T__conv_uint_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ulong", native_uint, native_ulong, H5T__conv_uint_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_short", native_int, native_short, H5T__conv_int_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ushort", native_int, native_ushort, H5T__conv_int_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_short", native_uint, native_short, H5T__conv_uint_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ushort", native_uint, native_ushort, H5T__conv_uint_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_uint", native_int, native_uint, H5T__conv_int_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_int", native_uint, native_int, H5T__conv_uint_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_schar", native_int, native_schar, H5T__conv_int_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_uchar", native_int, native_uchar, H5T__conv_int_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_schar", native_uint, native_schar, H5T__conv_uint_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_uchar", native_uint, native_uchar, H5T__conv_uint_uchar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "int_llong", native_int, native_llong, H5T__conv_int_llong); + status |= H5T__register_int(H5T_PERS_HARD, "int_ullong", native_int, native_ullong, H5T__conv_int_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "uint_llong", native_uint, native_llong, H5T__conv_uint_llong); + status |= H5T__register_int(H5T_PERS_HARD, "uint_ullong", native_uint, native_ullong, H5T__conv_uint_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "int_long", native_int, native_long, H5T__conv_int_long); + status |= H5T__register_int(H5T_PERS_HARD, "int_ulong", native_int, native_ulong, H5T__conv_int_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "uint_long", native_uint, native_long, H5T__conv_uint_long); + status |= H5T__register_int(H5T_PERS_HARD, "uint_ulong", native_uint, native_ulong, H5T__conv_uint_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "int_short", native_int, native_short, H5T__conv_int_short); + status |= H5T__register_int(H5T_PERS_HARD, "int_ushort", native_int, native_ushort, H5T__conv_int_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "uint_short", native_uint, native_short, H5T__conv_uint_short); + status |= H5T__register_int(H5T_PERS_HARD, "uint_ushort", native_uint, native_ushort, H5T__conv_uint_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "int_uint", native_int, native_uint, H5T__conv_int_uint); + status |= H5T__register_int(H5T_PERS_HARD, "uint_int", native_uint, native_int, H5T__conv_uint_int); + status |= H5T__register_int(H5T_PERS_HARD, "int_schar", native_int, native_schar, H5T__conv_int_schar); + status |= H5T__register_int(H5T_PERS_HARD, "int_uchar", native_int, native_uchar, H5T__conv_int_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "uint_schar", native_uint, native_schar, H5T__conv_uint_schar); + status |= H5T__register_int(H5T_PERS_HARD, "uint_uchar", native_uint, native_uchar, H5T__conv_uint_uchar); /* From char */ - status |= H5T_register(H5T_PERS_HARD, "schar_llong", native_schar, native_llong, H5T__conv_schar_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ullong", native_schar, native_ullong, H5T__conv_schar_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_llong", native_uchar, native_llong, H5T__conv_uchar_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ullong", native_uchar, native_ullong, H5T__conv_uchar_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_long", native_schar, native_long, H5T__conv_schar_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ulong", native_schar, native_ulong, H5T__conv_schar_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_long", native_uchar, native_long, H5T__conv_uchar_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ulong", native_uchar, native_ulong, H5T__conv_uchar_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_short", native_schar, native_short, H5T__conv_schar_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ushort", native_schar, native_ushort, H5T__conv_schar_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_short", native_uchar, native_short, H5T__conv_uchar_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ushort", native_uchar, native_ushort, H5T__conv_uchar_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_int", native_schar, native_int, H5T__conv_schar_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_uint", native_schar, native_uint, H5T__conv_schar_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_int", native_uchar, native_int, H5T__conv_uchar_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_uint", native_uchar, native_uint, H5T__conv_uchar_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_uchar", native_schar, native_uchar, H5T__conv_schar_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_schar", native_uchar, native_schar, H5T__conv_uchar_schar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "schar_llong", native_schar, native_llong, H5T__conv_schar_llong); + status |= H5T__register_int(H5T_PERS_HARD, "schar_ullong", native_schar, native_ullong, H5T__conv_schar_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_llong", native_uchar, native_llong, H5T__conv_uchar_llong); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_ullong", native_uchar, native_ullong, H5T__conv_uchar_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "schar_long", native_schar, native_long, H5T__conv_schar_long); + status |= H5T__register_int(H5T_PERS_HARD, "schar_ulong", native_schar, native_ulong, H5T__conv_schar_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_long", native_uchar, native_long, H5T__conv_uchar_long); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_ulong", native_uchar, native_ulong, H5T__conv_uchar_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "schar_short", native_schar, native_short, H5T__conv_schar_short); + status |= H5T__register_int(H5T_PERS_HARD, "schar_ushort", native_schar, native_ushort, H5T__conv_schar_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_short", native_uchar, native_short, H5T__conv_uchar_short); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_ushort", native_uchar, native_ushort, H5T__conv_uchar_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "schar_int", native_schar, native_int, H5T__conv_schar_int); + status |= H5T__register_int(H5T_PERS_HARD, "schar_uint", native_schar, native_uint, H5T__conv_schar_uint); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_int", native_uchar, native_int, H5T__conv_uchar_int); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_uint", native_uchar, native_uint, H5T__conv_uchar_uint); + status |= H5T__register_int(H5T_PERS_HARD, "schar_uchar", native_schar, native_uchar, H5T__conv_schar_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_schar", native_uchar, native_schar, H5T__conv_uchar_schar); /* From char to floats */ - status |= H5T_register(H5T_PERS_HARD, "schar_flt", native_schar, native_float, H5T__conv_schar_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_dbl", native_schar, native_double, H5T__conv_schar_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ldbl", native_schar, native_ldouble, H5T__conv_schar_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "schar_flt", native_schar, native_float, H5T__conv_schar_float); + status |= H5T__register_int(H5T_PERS_HARD, "schar_dbl", native_schar, native_double, H5T__conv_schar_double); + status |= H5T__register_int(H5T_PERS_HARD, "schar_ldbl", native_schar, native_ldouble, H5T__conv_schar_ldouble); /* From unsigned char to floats */ - status |= H5T_register(H5T_PERS_HARD, "uchar_flt", native_uchar, native_float, H5T__conv_uchar_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_dbl", native_uchar, native_double, H5T__conv_uchar_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ldbl", native_uchar, native_ldouble, H5T__conv_uchar_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_flt", native_uchar, native_float, H5T__conv_uchar_float); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_dbl", native_uchar, native_double, H5T__conv_uchar_double); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_ldbl", native_uchar, native_ldouble, H5T__conv_uchar_ldouble); /* From short to floats */ - status |= H5T_register(H5T_PERS_HARD, "short_flt", native_short, native_float, H5T__conv_short_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_dbl", native_short, native_double, H5T__conv_short_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ldbl", native_short, native_ldouble, H5T__conv_short_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "short_flt", native_short, native_float, H5T__conv_short_float); + status |= H5T__register_int(H5T_PERS_HARD, "short_dbl", native_short, native_double, H5T__conv_short_double); + status |= H5T__register_int(H5T_PERS_HARD, "short_ldbl", native_short, native_ldouble, H5T__conv_short_ldouble); /* From unsigned short to floats */ - status |= H5T_register(H5T_PERS_HARD, "ushort_flt", native_ushort, native_float, H5T__conv_ushort_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_dbl", native_ushort, native_double, H5T__conv_ushort_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_ldbl", native_ushort, native_ldouble, H5T__conv_ushort_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_flt", native_ushort, native_float, H5T__conv_ushort_float); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_dbl", native_ushort, native_double, H5T__conv_ushort_double); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_ldbl", native_ushort, native_ldouble, H5T__conv_ushort_ldouble); /* From int to floats */ - status |= H5T_register(H5T_PERS_HARD, "int_flt", native_int, native_float, H5T__conv_int_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_dbl", native_int, native_double, H5T__conv_int_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ldbl", native_int, native_ldouble, H5T__conv_int_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "int_flt", native_int, native_float, H5T__conv_int_float); + status |= H5T__register_int(H5T_PERS_HARD, "int_dbl", native_int, native_double, H5T__conv_int_double); + status |= H5T__register_int(H5T_PERS_HARD, "int_ldbl", native_int, native_ldouble, H5T__conv_int_ldouble); /* From unsigned int to floats */ - status |= H5T_register(H5T_PERS_HARD, "uint_flt", native_uint, native_float, H5T__conv_uint_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_dbl", native_uint, native_double, H5T__conv_uint_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ldbl", native_uint, native_ldouble, H5T__conv_uint_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "uint_flt", native_uint, native_float, H5T__conv_uint_float); + status |= H5T__register_int(H5T_PERS_HARD, "uint_dbl", native_uint, native_double, H5T__conv_uint_double); + status |= H5T__register_int(H5T_PERS_HARD, "uint_ldbl", native_uint, native_ldouble, H5T__conv_uint_ldouble); /* From long to floats */ - status |= H5T_register(H5T_PERS_HARD, "long_flt", native_long, native_float, H5T__conv_long_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_dbl", native_long, native_double, H5T__conv_long_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ldbl", native_long, native_ldouble, H5T__conv_long_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "long_flt", native_long, native_float, H5T__conv_long_float); + status |= H5T__register_int(H5T_PERS_HARD, "long_dbl", native_long, native_double, H5T__conv_long_double); + status |= H5T__register_int(H5T_PERS_HARD, "long_ldbl", native_long, native_ldouble, H5T__conv_long_ldouble); /* From unsigned long to floats */ - status |= H5T_register(H5T_PERS_HARD, "ulong_flt", native_ulong, native_float, H5T__conv_ulong_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_dbl", native_ulong, native_double, H5T__conv_ulong_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_ldbl", native_ulong, native_ldouble, H5T__conv_ulong_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_flt", native_ulong, native_float, H5T__conv_ulong_float); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_dbl", native_ulong, native_double, H5T__conv_ulong_double); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_ldbl", native_ulong, native_ldouble, H5T__conv_ulong_ldouble); /* From long long to floats */ - status |= H5T_register(H5T_PERS_HARD, "llong_flt", native_llong, native_float, H5T__conv_llong_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_dbl", native_llong, native_double, H5T__conv_llong_double, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "llong_flt", native_llong, native_float, H5T__conv_llong_float); + status |= H5T__register_int(H5T_PERS_HARD, "llong_dbl", native_llong, native_double, H5T__conv_llong_double); #ifdef H5T_CONV_INTERNAL_LLONG_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T__conv_llong_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T__conv_llong_ldouble); #endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */ /* From unsigned long long to floats */ - status |= H5T_register(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T__conv_ullong_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T__conv_ullong_double, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T__conv_ullong_float); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T__conv_ullong_double); #ifdef H5T_CONV_INTERNAL_ULLONG_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T__conv_ullong_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T__conv_ullong_ldouble); #endif /* H5T_CONV_INTERNAL_ULLONG_LDOUBLE */ /* From floats to char */ - status |= H5T_register(H5T_PERS_HARD, "flt_schar", native_float, native_schar, H5T__conv_float_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_schar", native_double, native_schar, H5T__conv_double_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_schar", native_ldouble, native_schar, H5T__conv_ldouble_schar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_schar", native_float, native_schar, H5T__conv_float_schar); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_schar", native_double, native_schar, H5T__conv_double_schar); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_schar", native_ldouble, native_schar, H5T__conv_ldouble_schar); /* From floats to unsigned char */ - status |= H5T_register(H5T_PERS_HARD, "flt_uchar", native_float, native_uchar, H5T__conv_float_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_uchar", native_double, native_uchar, H5T__conv_double_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T__conv_ldouble_uchar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_uchar", native_float, native_uchar, H5T__conv_float_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_uchar", native_double, native_uchar, H5T__conv_double_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T__conv_ldouble_uchar); /* From floats to short */ - status |= H5T_register(H5T_PERS_HARD, "flt_short", native_float, native_short, H5T__conv_float_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T__conv_double_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_short", native_ldouble, native_short, H5T__conv_ldouble_short, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_short", native_float, native_short, H5T__conv_float_short); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T__conv_double_short); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_short", native_ldouble, native_short, H5T__conv_ldouble_short); /* From floats to unsigned short */ - status |= H5T_register(H5T_PERS_HARD, "flt_ushort", native_float, native_ushort, H5T__conv_float_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ushort", native_double, native_ushort, H5T__conv_double_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T__conv_ldouble_ushort, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_ushort", native_float, native_ushort, H5T__conv_float_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_ushort", native_double, native_ushort, H5T__conv_double_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T__conv_ldouble_ushort); /* From floats to int */ - status |= H5T_register(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T__conv_float_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T__conv_double_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_int", native_ldouble, native_int, H5T__conv_ldouble_int, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T__conv_float_int); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T__conv_double_int); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_int", native_ldouble, native_int, H5T__conv_ldouble_int); /* From floats to unsigned int */ - status |= H5T_register(H5T_PERS_HARD, "flt_uint", native_float, native_uint, H5T__conv_float_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_uint", native_double, native_uint, H5T__conv_double_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_uint", native_ldouble, native_uint, H5T__conv_ldouble_uint, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_uint", native_float, native_uint, H5T__conv_float_uint); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_uint", native_double, native_uint, H5T__conv_double_uint); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_uint", native_ldouble, native_uint, H5T__conv_ldouble_uint); /* From floats to long */ - status |= H5T_register(H5T_PERS_HARD, "flt_long", native_float, native_long, H5T__conv_float_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_long", native_double, native_long, H5T__conv_double_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_long", native_ldouble, native_long, H5T__conv_ldouble_long, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_long", native_float, native_long, H5T__conv_float_long); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_long", native_double, native_long, H5T__conv_double_long); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_long", native_ldouble, native_long, H5T__conv_ldouble_long); /* From floats to unsigned long */ - status |= H5T_register(H5T_PERS_HARD, "flt_ulong", native_float, native_ulong, H5T__conv_float_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ulong", native_double, native_ulong, H5T__conv_double_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T__conv_ldouble_ulong, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_ulong", native_float, native_ulong, H5T__conv_float_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_ulong", native_double, native_ulong, H5T__conv_double_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T__conv_ldouble_ulong); /* From floats to long long */ - status |= H5T_register(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T__conv_float_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T__conv_double_llong, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T__conv_float_llong); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T__conv_double_llong); #ifdef H5T_CONV_INTERNAL_LDOUBLE_LLONG - status |= H5T_register(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T__conv_ldouble_llong, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T__conv_ldouble_llong); #endif /* H5T_CONV_INTERNAL_LDOUBLE_LLONG */ /* From floats to unsigned long long */ - status |= H5T_register(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T__conv_float_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T__conv_double_ullong, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T__conv_float_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T__conv_double_ullong); #if H5T_CONV_INTERNAL_LDOUBLE_ULLONG - status |= H5T_register(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T__conv_ldouble_ullong, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T__conv_ldouble_ullong); #endif /* H5T_CONV_INTERNAL_LDOUBLE_ULLONG */ /* @@ -1254,7 +1260,7 @@ H5T__init_package(void) * data types we use are not important as long as the source and * destination are equal. */ - status |= H5T_register(H5T_PERS_HARD, "no-op", native_int, native_int, H5T__conv_noop, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "no-op", native_int, native_int, H5T__conv_noop); /* Initialize the +/- Infinity values for floating-point types */ status |= H5T__init_inf(); @@ -1282,20 +1288,20 @@ H5T__init_package(void) done: /* General cleanup */ if(compound != NULL) - H5T_close(compound); + (void)H5T_close_real(compound); if(enum_type != NULL) - H5T_close(enum_type); + (void)H5T_close_real(enum_type); if(vlen != NULL) - H5T_close(vlen); + (void)H5T_close_real(vlen); if(array != NULL) - H5T_close(array); + (void)H5T_close_real(array); /* Error cleanup */ if(ret_value < 0) { if(dt) { - /* Check if we should call H5T_close or H5FL_FREE */ + /* Check if we should call H5T_close_real or H5FL_FREE */ if(copied_dtype) - H5T_close(dt); + (void)H5T_close_real(dt); else { dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); dt = H5FL_FREE(H5T_t, dt); @@ -1371,27 +1377,41 @@ H5T_top_term_package(void) path = H5T_g.path[i]; HDassert(path); - if(path->func) { + if(path->conv.u.app_func) { H5T__print_stats(path, &nprint/*in,out*/); path->cdata.command = H5T_CONV_FREE; - if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, - (size_t)0, (size_t)0, NULL, NULL,H5AC_noio_dxpl_id) < 0) { + if(path->conv.is_app) { + if((path->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 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)(path->func), path->name); - } /* end if */ + if (H5DEBUG(T)) { + fprintf(H5DEBUG(T), "H5T: conversion function " + "0x%08lx failed to free private data for " + "%s (ignored)\n", + (unsigned long)(path->conv.u.app_func), path->name); + } /* end if */ #endif - H5E_clear_stack(NULL); /*ignore the error*/ + H5E_clear_stack(NULL); /*ignore the error*/ + } /* end if */ } /* end if */ + else { + if((path->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 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)(path->conv.u.lib_func), path->name); + } /* end if */ +#endif + H5E_clear_stack(NULL); /*ignore the error*/ + } /* end if */ + } /* end else */ } /* end if */ if(path->src) - H5T_close(path->src); + (void)H5T_close_real(path->src); if(path->dst) - H5T_close(path->dst); + (void)H5T_close_real(path->dst); path = H5FL_FREE(H5T_path_t, path); H5T_g.path[i] = NULL; } /* end for */ @@ -1645,14 +1665,14 @@ H5Tcopy(hid_t type_id) H5T_t *new_dt = NULL; hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", type_id); switch(H5I_get_type(type_id)) { case H5I_DATATYPE: /* The argument is a datatype handle */ if(NULL == (dt = (H5T_t *)H5I_object(type_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype") break; case H5I_DATASET: @@ -1661,9 +1681,9 @@ H5Tcopy(hid_t type_id) /* The argument is a dataset handle */ if(NULL == (dset = (H5D_t *)H5I_object(type_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a dataset") if(NULL == (dt = H5D_typeof(dset))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get the dataset datatype") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to get the dataset datatype") } break; @@ -1682,21 +1702,21 @@ H5Tcopy(hid_t type_id) case H5I_ERROR_STACK: case H5I_NTYPES: default: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype or dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype or dataset") } /* end switch */ /* 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, H5I_INVALID_HID, "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, H5I_INVALID_HID, "unable to register datatype atom") done: if(ret_value < 0) - if(new_dt && H5T_close(new_dt) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "unable to release datatype info") + if(new_dt && H5T_close_real(new_dt) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID, "unable to release datatype info") FUNC_LEAVE_API(ret_value) } /* end H5Tcopy() */ @@ -1717,6 +1737,7 @@ herr_t H5Tclose(hid_t type_id) { H5T_t *dt; /* Pointer to datatype to close */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1727,12 +1748,18 @@ H5Tclose(hid_t type_id) 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") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* 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") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tclose() */ @@ -1777,8 +1804,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Tlock * - * Purpose: Locks a type, making it read only and non-destructable. This - * is normally done by the library for predefined datatypes so + * 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. * @@ -2159,7 +2186,7 @@ H5Tset_size(hid_t type_id, size_t size) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for this datatype") /* Modify the datatype */ - if(H5T_set_size(dt, size) < 0) + if(H5T__set_size(dt, size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set size for datatype") done: @@ -2188,20 +2215,20 @@ H5Tget_super(hid_t type) H5T_t *super = NULL; /* Supertype */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) 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, H5I_INVALID_HID, "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, H5I_INVALID_HID, "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, H5I_INVALID_HID, "unable to register parent datatype") done: if(ret_value < 0) - if(super && H5T_close(super) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "unable to release super datatype info") + if(super && H5T_close_real(super) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID, "unable to release super datatype info") FUNC_LEAVE_API(ret_value) } /* end H5Tget_super() */ @@ -2242,7 +2269,47 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_register + * Function: H5T__register_int + * + * Purpose: Register a library internal datatype conversion routine. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Wednesday, March 7, 1998 + *------------------------------------------------------------------------- + */ +static herr_t +H5T__register_int(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, + H5T_lib_conv_t func) +{ + H5T_conv_func_t conv_func; /* Conversion function wrapper */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Check args */ + HDassert(H5T_PERS_HARD==pers || H5T_PERS_SOFT==pers); + HDassert(name && *name); + HDassert(src); + HDassert(dst); + HDassert(func); + + /* Set up conversion function wrapper */ + conv_func.is_app = FALSE; + conv_func.u.lib_func = func; + + /* Register conversion */ + if(H5T__register(pers, name, src, dst, &conv_func) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register internal datatype conversion routine") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T__register_int() */ + + +/*------------------------------------------------------------------------- + * 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 @@ -2260,8 +2327,8 @@ done: *------------------------------------------------------------------------- */ 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__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, + H5T_conv_func_t *conv) { hid_t tmp_sid = -1, tmp_did = -1; /*temporary data type IDs */ H5T_path_t *old_path = NULL; /*existing conversion path */ @@ -2271,12 +2338,12 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, int i; /*counter */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(src); HDassert(dst); - HDassert(func); + HDassert(conv); HDassert(H5T_PERS_HARD==pers || H5T_PERS_SOFT==pers); HDassert(name && *name); @@ -2284,7 +2351,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Only bother to register the path if it's not a no-op path (for this machine) */ if(H5T_cmp(src, dst, FALSE)) { /* Locate or create a new conversion path */ - if(NULL == (new_path = H5T_path_find(src, dst, name, func, dxpl_id, api_call))) + if(NULL == (new_path = H5T__path_find_real(src, dst, name, conv))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to locate/allocate conversion path") /* @@ -2314,7 +2381,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_g.soft[H5T_g.nsoft].name[H5T_NAMELEN - 1] = '\0'; H5T_g.soft[H5T_g.nsoft].src = src->shared->type; H5T_g.soft[H5T_g.nsoft].dst = dst->shared->type; - H5T_g.soft[H5T_g.nsoft].func = func; + H5T_g.soft[H5T_g.nsoft].conv = *conv; H5T_g.nsoft++; /* @@ -2322,29 +2389,38 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, * conversion function applies should be replaced by a new path that * uses this function. */ - for (i=1; iis_hard || - old_path->src->shared->type!=src->shared->type || - old_path->dst->shared->type!=dst->shared->type) { + if(old_path->is_hard || + old_path->src->shared->type != src->shared->type || + old_path->dst->shared->type != dst->shared->type) continue; - } + if((tmp_sid = H5I_register(H5I_DATATYPE, H5T_copy(old_path->src, H5T_COPY_ALL), FALSE)) < 0 || (tmp_did = H5I_register(H5I_DATATYPE, H5T_copy(old_path->dst, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data types for conv query") HDmemset(&cdata, 0, sizeof cdata); cdata.command = H5T_CONV_INIT; - if((func)(tmp_sid, tmp_did, &cdata, (size_t)0, (size_t)0, (size_t)0, - NULL, NULL, dxpl_id) < 0) { - H5I_dec_ref(tmp_sid); - H5I_dec_ref(tmp_did); - tmp_sid = tmp_did = -1; - H5E_clear_stack(NULL); - continue; + if(conv->is_app) { + if((conv->u.app_func)(tmp_sid, tmp_did, &cdata, (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { + H5I_dec_ref(tmp_sid); + H5I_dec_ref(tmp_did); + tmp_sid = tmp_did = -1; + H5E_clear_stack(NULL); + continue; + } /* end if */ } /* end if */ + else + if((conv->u.lib_func)(tmp_sid, tmp_did, &cdata, (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { + H5I_dec_ref(tmp_sid); + H5I_dec_ref(tmp_did); + tmp_sid = tmp_did = -1; + H5E_clear_stack(NULL); + continue; + } /* end if */ /* Create a new conversion path */ if(NULL == (new_path = H5FL_CALLOC(H5T_path_t))) @@ -2354,7 +2430,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, if(NULL == (new_path->src = H5T_copy(old_path->src, H5T_COPY_ALL)) || NULL == (new_path->dst=H5T_copy(old_path->dst, H5T_COPY_ALL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy data types") - new_path->func = func; + new_path->conv = *conv; new_path->is_hard = FALSE; new_path->cdata = cdata; @@ -2365,18 +2441,27 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Free old path */ H5T__print_stats(old_path, &nprint); old_path->cdata.command = H5T_CONV_FREE; - 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) { + if(old_path->conv.is_app) { + if((old_path->conv.u.app_func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 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->conv.u.app_func), old_path->name); #endif + } /* end if */ } /* end if */ - H5T_close(old_path->src); - H5T_close(old_path->dst); + else + if((old_path->conv.u.lib_func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 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->conv.u.lib_func), old_path->name); +#endif + } /* end if */ + (void)H5T_close_real(old_path->src); + (void)H5T_close_real(old_path->dst); old_path = H5FL_FREE(H5T_path_t, old_path); /* Release temporary atoms */ @@ -2393,9 +2478,9 @@ done: if(ret_value < 0) { if(new_path) { if(new_path->src) - H5T_close(new_path->src); + (void)H5T_close_real(new_path->src); if(new_path->dst) - H5T_close(new_path->dst); + (void)H5T_close_real(new_path->dst); new_path = H5FL_FREE(H5T_path_t, new_path); } /* end if */ if(tmp_sid >= 0) @@ -2405,7 +2490,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_register() */ +} /* end H5T__register() */ /*------------------------------------------------------------------------- @@ -2429,10 +2514,12 @@ done: */ 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 */ + H5T_conv_func_t conv_func; /* Conversion function wrapper */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_API(FAIL) @@ -2449,45 +2536,51 @@ H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if(!func) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Set up conversion function wrapper */ + conv_func.is_app = TRUE; + conv_func.u.app_func = func; /* Go register the function */ - if(H5T_register(pers, name, src, dst, func, H5AC_noio_dxpl_id, TRUE) < 0) + if(H5T__register(pers, name, src, dst, &conv_func) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register conversion function") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tregister() */ /*------------------------------------------------------------------------- - * 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. * * Return: Succeess: non-negative - * * Failure: negative * * Programmer: Robb Matzke * Tuesday, January 13, 1998 * - * Modifications: - * Adapted to non-API function - QAK, 11/17/99 - * *------------------------------------------------------------------------- */ 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__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, + H5T_conv_t func) { 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 + FUNC_ENTER_STATIC_NOERR /* Remove matching entries from the soft list */ if(H5T_PERS_DONTCARE == pers || H5T_PERS_SOFT == pers) { @@ -2500,7 +2593,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, continue; if(dst && dst->shared->type != soft->dst) continue; - if(func && func != soft->func) + if(func && func != soft->conv.u.app_func) continue; HDmemmove(H5T_g.soft + i, H5T_g.soft + i + 1, (size_t)(H5T_g.nsoft - (i + 1)) * sizeof(H5T_soft_t)); @@ -2519,7 +2612,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, (name && *name && HDstrcmp(name, path->name)) || (src && H5T_cmp(src, path->src, FALSE)) || (dst && H5T_cmp(dst, path->dst, FALSE)) || - (func && func!=path->func)) { + (func && func != path->conv.u.app_func)) { /* * Notify all other functions to recalculate private data since some * functions might cache a list of conversion functions. For @@ -2537,25 +2630,34 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Shut down path */ H5T__print_stats(path, &nprint); path->cdata.command = H5T_CONV_FREE; - if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), - (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + if(path->conv.is_app) { + if((path->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 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)(path->func), path->name); - } + if(H5DEBUG(T)) + fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx failed " + "to free private data for %s (ignored)\n", + (unsigned long)(path->conv.u.app_func), path->name); #endif - } - H5T_close(path->src); - H5T_close(path->dst); + } /* end if */ + } /* end if */ + else + if((path->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 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)(path->conv.u.lib_func), path->name); +#endif + } /* end if */ + (void)H5T_close_real(path->src); + (void)H5T_close_real(path->dst); path = H5FL_FREE(H5T_path_t, path); H5E_clear_stack(NULL); /*ignore all shutdown errors*/ } /* end else */ } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5T_unregister() */ +} /* end H5T__unregister() */ /*------------------------------------------------------------------------- @@ -2576,9 +2678,10 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, */ 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 */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2589,11 +2692,17 @@ H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "src is not a data type") if(dst_id > 0 && (NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dst is not a data type") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; - if(H5T_unregister(pers, name, src, dst, func, H5AC_noio_dxpl_id) < 0) + if(H5T__unregister(pers, name, src, dst, func) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "internal unregister function failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tunregister() */ @@ -2634,14 +2743,14 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) 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))) + if(NULL == (path = H5T_path_find(src, dst))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "conversion function not found") if(pcdata) *pcdata = &(path->cdata); /* Set return value */ - ret_value = path->func; + ret_value = path->conv.u.app_func; done: FUNC_LEAVE_API(ret_value) @@ -2680,7 +2789,7 @@ H5Tcompiler_conv(hid_t src_id, hid_t dst_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") /* Find it */ - if((ret_value = H5T_compiler_conv(src, dst)) < 0) + if((ret_value = H5T__compiler_conv(src, dst)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") done: @@ -2717,6 +2826,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, { H5T_path_t *tpath; /* type conversion info */ H5T_t *src, *dst; /* unatomized types */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2731,15 +2841,23 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Find the conversion function */ - if(NULL == (tpath = H5T_path_find(src, dst, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(src, dst))) 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) + if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, buf, background) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tconvert() */ @@ -2925,7 +3043,7 @@ H5T_decode(const unsigned char *buf) 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))) + if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, NULL, H5O_DTYPE_ID, buf))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object") /* Mark datatype as being in memory now */ @@ -2985,7 +3103,7 @@ H5T__create(H5T_class_t type, size_t size) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy"); /* Modify the datatype */ - if(H5T_set_size(dt, size) < 0) + if(H5T__set_size(dt, size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to set size for string type") } break; @@ -3476,7 +3594,7 @@ done: * * 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). + * be done in H5T_close / H5T_close_real). * * Return: Non-negative on success/Negative on failure * @@ -3495,25 +3613,6 @@ H5T__free(H5T_t *dt) HDassert(dt && dt->shared); - /* - * If a named type is being closed then close the object header and - * remove from the list of open objects in the file. - */ - if(H5T_STATE_OPEN == dt->shared->state) { - HDassert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); - HDassert(H5F_addr_defined(dt->sh_loc.u.loc.oh_addr)); - HDassert(H5F_addr_defined(dt->oloc.addr)); - - /* Remove the datatype from the list of opened objects in the file */ - if(H5FO_top_decr(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't decrement count for object") - if(H5FO_delete(dt->sh_loc.file, H5AC_ind_read_dxpl_id, dt->sh_loc.u.loc.oh_addr) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't remove datatype from list of open objects") - if(H5O_close(&dt->oloc, NULL) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to close data type object header") - dt->shared->state = H5T_STATE_NAMED; - } /* end if */ - /* Free the ID to name info */ H5G_name_free(&(dt->path)); @@ -3528,7 +3627,7 @@ H5T__free(H5T_t *dt) case H5T_COMPOUND: for(i = 0; i < dt->shared->u.compnd.nmembs; i++) { dt->shared->u.compnd.memb[i].name = (char *)H5MM_xfree(dt->shared->u.compnd.memb[i].name); - H5T_close(dt->shared->u.compnd.memb[i].type); + (void)H5T_close_real(dt->shared->u.compnd.memb[i].type); } /* end for */ dt->shared->u.compnd.memb = (H5T_cmemb_t *)H5MM_xfree(dt->shared->u.compnd.memb); dt->shared->u.compnd.nmembs = 0; @@ -3563,7 +3662,7 @@ H5T__free(H5T_t *dt) /* Close the parent */ HDassert(dt->shared->parent != dt); - if(dt->shared->parent && H5T_close(dt->shared->parent) < 0) + if(dt->shared->parent && H5T_close_real(dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close parent data type") dt->shared->parent = NULL; @@ -3573,15 +3672,87 @@ done: /*------------------------------------------------------------------------- + * Function: H5T_close_real + * + * Purpose: Frees a datatype and all associated memory. + * + * Hote: Does _not_ deal with open hamed datatypes, etc. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Monday, February 12, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5T_close_real(H5T_t *dt) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dt && dt->shared); + + /* Clean up resources, depending on shared state */ + if(dt->shared->state != H5T_STATE_OPEN) { + if(H5T__free(dt) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype"); + + dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); + } /* end if */ + else + /* Free the group hier. path since we're not calling H5T__free() */ + H5G_name_free(&(dt->path)); + + /* Free the 'top' datatype struct */ + dt = H5FL_FREE(H5T_t, dt); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T_close_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5T__close_cb + * + * Purpose: Callback routine for closing a datatype ID. Closes the datatype + * object that was attached to the ID. + * + * Return: Non-negative on success/Negative on failure + * + *------------------------------------------------------------------------- + */ +static herr_t +H5T__close_cb(H5T_t *dt) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* check args */ + HDassert(dt && dt->shared); + + /* Call actual datatype close routine */ + if(H5T_close(dt) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close datatype"); + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5T__close_cb() */ + + +/*------------------------------------------------------------------------- * 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. Deals with + * open named datatypes appropriately. * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Monday, December 8, 1997 + * Programmer: Robb Matzke + * Monday, December 8, 1997 * *------------------------------------------------------------------------- */ @@ -3592,40 +3763,49 @@ H5T_close(H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) + /* Sanity check */ HDassert(dt && dt->shared); - if(dt->shared->state == H5T_STATE_OPEN) + /* Named datatype cleanups */ + if(dt->shared->state == H5T_STATE_OPEN) { + /* Decrement refcount count on open named datatype */ 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 */ + /* Sanity checks */ + HDassert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); + HDassert(H5F_addr_defined(dt->sh_loc.u.loc.oh_addr)); + HDassert(H5F_addr_defined(dt->oloc.addr)); + + /* + * If a named type is being closed then close the object header and + * remove from the list of open objects in the file. + */ + + /* Decrement the ref. count for this object in the top file */ + if(H5FO_top_decr(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't decrement count for object") + /* Close things down if this is the last reference to the open named datatype */ + if(0 == dt->shared->fo_count) { + hbool_t corked; /* Whether the named datatype is corked or not */ + + /* Uncork cache entries with object address tag for named datatype */ 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"); - - dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); - } /* end if */ - else { - /* - * If a named type is being closed then close the object header and - * remove from the list of open objects in the file. - */ - if(H5T_STATE_OPEN == dt->shared->state) { - HDassert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); - /* Decrement the ref. count for this object in the top file */ - if(H5FO_top_decr(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't decrement count for object") + /* Remove the datatype from the list of opened objects in the file */ + if(H5FO_delete(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't remove datatype from list of open objects") + if(H5O_close(&dt->oloc, NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to close data type object header") + /* Mark named datatype closed now */ + dt->shared->state = H5T_STATE_NAMED; + } /* end if */ + else { /* Check reference count for this object in the top file */ if(H5FO_top_count(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) == 0) { /* Close object location for named datatype */ @@ -3633,18 +3813,15 @@ H5T_close(H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to close") } /* end if */ else - /* Free object location (i.e. "unhold" the file if appropriate) - */ + /* Free object location (i.e. "unhold" the file if appropriate) */ if(H5O_loc_free(&(dt->oloc)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "problem attempting to free location") - } /* end if */ - - /* Free the group hier. path since we're not calling H5T__free() */ - H5G_name_free(&(dt->path)); - } /* end else */ + } /* end else */ + } /* end if */ - /* Free the datatype struct */ - dt = H5FL_FREE(H5T_t, dt); + /* Clean up resources */ + if(H5T_close_real(dt) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "unable to free datatype"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -3652,7 +3829,7 @@ 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 @@ -3675,19 +3852,15 @@ done: * Programmer: Robb Matzke * Tuesday, December 22, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived data types. - * *------------------------------------------------------------------------- */ static herr_t -H5T_set_size(H5T_t *dt, size_t size) +H5T__set_size(H5T_t *dt, size_t size) { size_t prec, offset; - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(dt); @@ -3695,8 +3868,8 @@ H5T_set_size(H5T_t *dt, size_t size) HDassert(H5T_REFERENCE!=dt->shared->type); HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); - if (dt->shared->parent) { - if (H5T_set_size(dt->shared->parent, size)<0) + if(dt->shared->parent) { + if(H5T__set_size(dt->shared->parent, size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set size for parent data type"); /* Adjust size of datatype appropriately */ @@ -3704,7 +3877,7 @@ 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; - } + } /* end if */ else { if (H5T_IS_ATOMIC(dt->shared)) { offset = dt->shared->u.atomic.offset; @@ -3718,12 +3891,11 @@ H5T_set_size(H5T_t *dt, size_t size) offset = 8 * size - prec; if (prec > 8*size) prec = 8 * size; - } - else { + } /* end if */ + else prec = offset = 0; - } - switch (dt->shared->type) { + switch(dt->shared->type) { case H5T_INTEGER: case H5T_TIME: case H5T_BITFIELD: @@ -3748,20 +3920,20 @@ H5T_set_size(H5T_t *dt, size_t size) if(memb_offset > max_offset) { max_offset = memb_offset; max_index = i; - } - } + } /* end if */ + } /* end for */ 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 "); - } + } /* end if */ /* Compound must not have been packed previously */ /* We will check if resizing changed the packed state of * this type at the end of this function */ HDassert(!dt->shared->u.compnd.packed); - } + } /* end if */ break; @@ -3801,8 +3973,7 @@ H5T_set_size(H5T_t *dt, size_t size) /* Set up VL information */ if (H5T_set_loc(dt, NULL, H5T_LOC_MEMORY)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location"); - - } + } /* end if */ else { prec = 8 * size; offset = 0; @@ -3814,11 +3985,11 @@ H5T_set_size(H5T_t *dt, size_t size) * The sign, mantissa, and exponent fields should be adjusted * first when decreasing the size of a floating point type. */ - if (dt->shared->u.atomic.u.f.sign >= prec+offset || + if(dt->shared->u.atomic.u.f.sign >= prec+offset || dt->shared->u.atomic.u.f.epos + dt->shared->u.atomic.u.f.esize > prec+offset || dt->shared->u.atomic.u.f.mpos + dt->shared->u.atomic.u.f.msize > prec+offset) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "adjust sign, mantissa, and exponent fields first"); - } + } /* end if */ break; case H5T_ENUM: @@ -3827,14 +3998,16 @@ H5T_set_size(H5T_t *dt, size_t size) case H5T_REFERENCE: HDassert("can't happen" && 0); break; + case H5T_NO_CLASS: case H5T_NCLASSES: HDassert("invalid type" && 0); break; + default: HDassert("not implemented yet" && 0); break; - } + } /* end switch */ /* Commit (if we didn't convert this type to a VL string) */ if(dt->shared->type != H5T_VLEN) { @@ -3842,17 +4015,17 @@ H5T_set_size(H5T_t *dt, size_t size) if (H5T_IS_ATOMIC(dt->shared)) { dt->shared->u.atomic.offset = offset; dt->shared->u.atomic.prec = prec; - } + } /* end if */ } /* end if */ /* Check if the new compound type is packed */ if(dt->shared->type == H5T_COMPOUND) H5T__update_packed(dt); - } + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T__set_size() */ /*------------------------------------------------------------------------- @@ -4348,6 +4521,53 @@ done: /*------------------------------------------------------------------------- * Function: H5T_path_find * + * Purpose: Library-internal wrapper to find the path which converts type + * SRC_ID to type DST_ID. + * + * If SRC and DST are both null pointers then the special no-op + * conversion path is used. + * + * 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. + * + * Programmer: Quincey Koziol + * Monday, March 5, 2018 + * + *------------------------------------------------------------------------- + */ +H5T_path_t * +H5T_path_find(const H5T_t *src, const H5T_t *dst) +{ + H5T_conv_func_t conv_func; /* Conversion function wrapper */ + H5T_path_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + + /* Sanity check */ + HDassert(src); + HDassert(src->shared); + HDassert(dst); + HDassert(dst->shared); + + /* Set up conversion function wrapper */ + conv_func.is_app = FALSE; + conv_func.u.lib_func = NULL; + + /* Call the internal routine, with additional parameters */ + if(NULL == (ret_value = H5T__path_find_real(src, dst, NULL, &conv_func))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, NULL, "can't find datatype conversion path") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T_path_find() */ + + +/*------------------------------------------------------------------------- + * Function: H5T__path_find_real + * * 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 @@ -4361,30 +4581,19 @@ done: * first path in the path table. * * Return: Success: Pointer to the path, valid until the path - * database is modified. + * database is modified. * * Failure: NULL if the path does not exist and no - * function can be found to apply to the new - * path. + * function can be found to apply to the new path. * - * Programmer: Robb Matzke - * Tuesday, January 13, 1998 - * - * Modifications: - * Added a parameter IS_API to indicate whether to an API - * function issued a call to this function. If a API - * function like H5Tregister() is calling this function to - * register a new hard conversion function, IS_API is TRUE - * and the old path is replaced. If a private function like - * H5T__init_package() is trying to register hard conversions, - * IS_API is FALSE and the old hard path is not replaced. - * Tuesday, Sept 13, 2005 + * Programmer: Robb Matzke + * Tuesday, January 13, 1998 * *------------------------------------------------------------------------- */ -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) +static H5T_path_t * +H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, + H5T_conv_func_t *conv) { int lt, rt; /* left and right edges */ int md; /* middle */ @@ -4397,7 +4606,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, int nprint = 0; /* lines of output printed */ H5T_path_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(src); @@ -4415,12 +4624,13 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, 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]->conv.is_app = FALSE; + H5T_g.path[0]->conv.u.lib_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) { + 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) < 0) { #ifdef H5T_DEBUG if(H5DEBUG(T)) - fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); + fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); #endif H5E_clear_stack(NULL); /*ignore the error*/ } /* end if */ @@ -4474,7 +4684,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * specifying a new hard conversion and the path is a soft conversion, then * 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(!table || (table && conv->is_app && conv->u.app_func) || (table && !table->is_hard && !conv->is_app && conv->u.lib_func)) { 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) { @@ -4497,22 +4707,27 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * the existing path is a soft function, then add the new conversion to the path * and initialize its conversion data. */ - if(func && (!table || (table && is_api) || (table && !table->is_hard && !is_api))) { + if(conv->u.app_func && (!table || (table && conv->is_app) || (table && !table->is_hard && !conv->is_app))) { HDassert(path != table); - HDassert(NULL == path->func); + HDassert(NULL == path->conv.u.app_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(conv->is_app) { + if((conv->u.app_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function") + } /* end if */ + else + if((conv->u.lib_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 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) H5I_dec_ref(dst_id); src_id = dst_id = -1; - path->func = func; + path->conv = *conv; path->is_hard = TRUE; } /* end if */ @@ -4522,8 +4737,10 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * for an applicable function and add it to the path. This can't happen * for the no-op conversion path. */ - HDassert(path->func || (src && dst)); - for(i = H5T_g.nsoft - 1; i >= 0 && !path->func; --i) { + HDassert(path->conv.u.app_func || (src && dst)); + for(i = H5T_g.nsoft - 1; i >= 0 && !path->conv.u.app_func; --i) { + hbool_t path_init_error = FALSE; + 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) @@ -4531,21 +4748,32 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, 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*/ + if(H5T_g.soft[i].conv.is_app) { + if((H5T_g.soft[i].conv.u.app_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { + HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); + H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ + path_init_error = TRUE; + } /* end if */ } /* end if */ - else { + else + if((H5T_g.soft[i].conv.u.lib_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { + HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); + H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ + path_init_error = TRUE; + } /* end if */ + + /* Finish operation, if no error */ + if(!path_init_error) { 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->conv = H5T_g.soft[i].conv; 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) + if(!path->conv.u.app_func) 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 @@ -4576,24 +4804,33 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, 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) { + if(table->conv.is_app) { + if((table->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 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->conv.u.app_func), path->name); #endif - H5E_clear_stack(NULL); /*ignore the failure*/ + H5E_clear_stack(NULL); /*ignore the failure*/ + } /* end if */ } /* end if */ + else + if((table->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { +#ifdef H5T_DEBUG + if(H5DEBUG(T)) + fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free failed for %s (ignored)\n", + (unsigned long)(path->conv.u.lib_func), path->name); +#endif + H5E_clear_stack(NULL); /*ignore the failure*/ + } /* end if */ if(table->src) - H5T_close(table->src); + (void)H5T_close_real(table->src); if(table->dst) - H5T_close(table->dst); + (void)H5T_close_real(table->dst); table = H5FL_FREE(H5T_path_t, table); table = path; H5T_g.path[md] = path; - } + } /* end if */ else if(path != table) { HDassert(cmp); if((size_t)H5T_g.npaths >= H5T_g.apaths) { @@ -4624,9 +4861,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) - H5T_close(path->src); + (void)H5T_close_real(path->src); if(path->dst) - H5T_close(path->dst); + (void)H5T_close_real(path->dst); path = H5FL_FREE(H5T_path_t, path); } /* end if */ if(src_id >= 0) @@ -4635,7 +4872,7 @@ done: H5I_dec_ref(dst_id); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_path_find() */ +} /* end H5T__path_find_real() */ /*------------------------------------------------------------------------- @@ -4730,7 +4967,7 @@ H5T_path_bkg(const H5T_path_t *p) /*------------------------------------------------------------------------- - * Function: H5T_compiler_conv + * Function: H5T__compiler_conv * * Purpose: Private function for H5Tcompiler_conv. Finds out whether the * library's conversion function from type SRC to type DST @@ -4745,22 +4982,22 @@ H5T_path_bkg(const H5T_path_t *p) *------------------------------------------------------------------------- */ static htri_t -H5T_compiler_conv(H5T_t *src, H5T_t *dst) +H5T__compiler_conv(H5T_t *src, H5T_t *dst) { H5T_path_t *path; htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Find it */ - if (NULL==(path=H5T_path_find(src, dst, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) + if(NULL == (path = H5T_path_find(src, dst))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") ret_value = (htri_t)path->is_hard; done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T__compiler_conv() */ /*------------------------------------------------------------------------- @@ -4776,64 +5013,42 @@ done: * 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 - * 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 - * datatype allocation function to be passed down to VL - * conversion routine. - * - * Robb Matzke, 2000-05-17 - * Added the BKG_STRIDE argument which gets passed to all the - * conversion functions. If BUF_STRIDE is non-zero then each - * data element is at a multiple of BUF_STRIDE bytes in BUF - * (on both input and output). If BKG_STRIDE is also set then - * the BKG buffer is used in such a way that temporary space - * for each element is aligned on a BKG_STRIDE byte boundary. - * If either BUF_STRIDE or BKG_STRIDE are zero then the BKG - * buffer will be accessed as though it were a packed array - * of destination datatype. *------------------------------------------------------------------------- */ 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, - hid_t dset_xfer_plist) + size_t buf_stride, size_t bkg_stride, void *buf, void *bkg) { #ifdef H5T_DEBUG H5_timer_t timer; #endif - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) #ifdef H5T_DEBUG - if (H5DEBUG(T)) H5_timer_begin(&timer); + if(H5DEBUG(T)) + H5_timer_begin(&timer); #endif 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"); + if(tpath->conv.is_app) { + if((tpath->conv.u.app_func)(src_id, dst_id, &(tpath->cdata), nelmts, buf_stride, bkg_stride, buf, bkg, H5CX_get_dxpl()) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed") + } /* end if */ + else + if((tpath->conv.u.lib_func)(src_id, dst_id, &(tpath->cdata), nelmts, buf_stride, bkg_stride, buf, bkg) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed") #ifdef H5T_DEBUG - if (H5DEBUG(T)) { + if(H5DEBUG(T)) { H5_timer_end(&(tpath->stats.timer), &timer); tpath->stats.ncalls++; tpath->stats.nelmts += nelmts; - } + } /* end if */ #endif done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T_convert() */ /*------------------------------------------------------------------------- @@ -5013,7 +5228,7 @@ H5T_convert_committed_datatype(H5T_t *dt, H5F_t *f) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to reset path") dt->shared->state = H5T_STATE_TRANSIENT; - } + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -5497,75 +5712,3 @@ H5T_patch_vlen_file(H5T_t *dt, H5F_t *f) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5T_patch_vlen_file() */ - -/*------------------------------------------------------------------------- - * Function: H5Tflush - * - * Purpose: Flushes all buffers associated with a named datatype to disk. - * - * Return: Non-negative on success, negative on failure - * - * Programmer: Mike McGreevy - * May 19, 2010 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Tflush(hid_t type_id) -{ - H5T_t *dt; /* Datatype for this operation */ - herr_t ret_value = SUCCEED; /* return value */ - - 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") - if(!H5T_is_named(dt)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") - - /* To flush metadata and invoke flush callback if there is */ - if(H5O_flush_common(&dt->oloc, type_id, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype and object flush callback") - -done: - FUNC_LEAVE_API(ret_value) -} /* H5Tflush */ - - -/*------------------------------------------------------------------------- - * Function: H5Trefresh - * - * Purpose: Refreshes all buffers associated with a named datatype. - * - * Return: Non-negative on success, negative on failure - * - * Programmer: Mike McGreevy - * July 21, 2010 - * - *------------------------------------------------------------------------- - */ -herr_t -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); - - /* Check args */ - if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - if(!H5T_is_named(dt)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") - - /* Call private function to refresh datatype object */ - if ((H5O_refresh_metadata(type_id, dt->oloc, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype") - -done: - FUNC_LEAVE_API(ret_value) -} /* H5Trefresh */ - diff --git a/src/H5TS.c b/src/H5TS.c index a0ca134..69fdbeb 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -34,6 +34,7 @@ H5TS_once_t H5TS_first_init_g = PTHREAD_ONCE_INIT; #endif /* H5_HAVE_WIN_THREADS */ H5TS_key_t H5TS_errstk_key_g; H5TS_key_t H5TS_funcstk_key_g; +H5TS_key_t H5TS_apictx_key_g; H5TS_key_t H5TS_cancel_key_g; @@ -109,6 +110,9 @@ H5TS_pthread_first_thread_init(void) /* initialize key for thread-specific function stacks */ pthread_key_create(&H5TS_funcstk_key_g, H5TS_key_destructor); + /* initialize key for thread-specific API contexts */ + pthread_key_create(&H5TS_apictx_key_g, H5TS_key_destructor); + /* initialize key for thread cancellability mechanism */ pthread_key_create(&H5TS_cancel_key_g, H5TS_key_destructor); } @@ -356,6 +360,10 @@ H5TS_win32_process_enter(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex) ret_value = FALSE; #endif /* H5_HAVE_CODESTACK */ + /* Set up thread local storage */ + if(TLS_OUT_OF_INDEXES == (H5TS_apictx_key_g = TlsAlloc())) + ret_value = FALSE; + return ret_value; } /* H5TS_win32_process_enter() */ #endif /* H5_HAVE_WIN_THREADS */ @@ -426,6 +434,9 @@ H5TS_win32_process_exit(void) TlsFree(H5TS_funcstk_key_g); #endif /* H5_HAVE_CODESTACK */ + /* Clean up per-process thread local storage */ + TlsFree(H5TS_apictx_key_g); + return; } /* H5TS_win32_process_exit() */ #endif /* H5_HAVE_WIN_THREADS */ @@ -469,6 +480,11 @@ H5TS_win32_thread_exit(void) LocalFree((HLOCAL)lpvData); #endif /* H5_HAVE_CODESTACK */ + /* Clean up per-thread thread local storage */ + lpvData = TlsGetValue(H5TS_apictx_key_g); + if(lpvData) + LocalFree((HLOCAL)lpvData); + return ret_value; } /* H5TS_win32_thread_exit() */ #endif /* H5_HAVE_WIN_THREADS */ diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h index e5c41af..8d74676 100644 --- a/src/H5TSprivate.h +++ b/src/H5TSprivate.h @@ -109,6 +109,7 @@ typedef pthread_once_t H5TS_once_t; extern H5TS_once_t H5TS_first_init_g; extern H5TS_key_t H5TS_errstk_key_g; extern H5TS_key_t H5TS_funcstk_key_g; +extern H5TS_key_t H5TS_apictx_key_g; #if defined c_plusplus || defined __cplusplus extern "C" diff --git a/src/H5Tarray.c b/src/H5Tarray.c index beccfdb..60b3d43 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -100,33 +100,32 @@ H5Tarray_create2(hid_t base_id, unsigned ndims, const hsize_t dim[/* ndims */]) unsigned u; /* local index variable */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "iIu*h", base_id, ndims, dim); /* Check args */ if(ndims < 1 || ndims > H5S_MAX_RANK) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dimensionality") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid dimensionality") if(!dim) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no dimensions specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no dimensions specified") for(u = 0; u < ndims; u++) if(!(dim[u] > 0)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "zero-sized dimension specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "zero-sized dimension specified") if(NULL == (base = (H5T_t *)H5I_object_verify(base_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an valid base datatype") /* Create the array datatype */ if(NULL == (dt = H5T__array_create(base, ndims, dim))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to create datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to create datatype") /* Atomize the type */ if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype") done: - if(ret_value < 0) { - if(dt && H5T_close(dt) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't release datatype") - } /* end if */ + if(ret_value < 0) + if(dt && H5T_close_real(dt) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID, "can't release datatype") FUNC_LEAVE_API(ret_value) } /* end H5Tarray_create2() */ @@ -356,33 +355,32 @@ H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], unsigned u; /* local index variable */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE4("i", "iIs*h*Is", base_id, ndims, dim, perm); /* Check args */ if(ndims < 1 || ndims > H5S_MAX_RANK) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dimensionality") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid dimensionality") if(!dim) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no dimensions specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no dimensions specified") for(u = 0; u < (unsigned)ndims; u++) if(!(dim[u] > 0)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "zero-sized dimension specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "zero-sized dimension specified") if(NULL == (base = (H5T_t *)H5I_object_verify(base_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an valid base datatype") /* Create the array datatype */ if(NULL == (dt = H5T__array_create(base, (unsigned)ndims, dim))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to create datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to create datatype") /* Atomize the type */ if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype") done: - if(ret_value < 0) { - if(dt && H5T_close(dt) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't release datatype") - } /* end if */ + if(ret_value < 0) + if(dt && H5T_close_real(dt) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID, "can't release datatype") FUNC_LEAVE_API(ret_value) } /* end H5Tarray_create1() */ diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 30fbeeb..57e6271 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -28,6 +28,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FOprivate.h" /* File objects */ #include "H5Iprivate.h" /* IDs */ @@ -55,7 +56,11 @@ /********************/ /* Local Prototypes */ /********************/ -static H5T_t *H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id); +static herr_t H5T__commit_anon(H5F_t *file, H5T_t *type, hid_t tcpl_id); +static hid_t H5T__get_create_plist(const H5T_t *type); +static H5T_t *H5T__open_oid(const H5G_loc_t *loc); +static herr_t H5T__flush(H5T_t *dt, hid_t type_id); +static herr_t H5T__refresh(H5T_t *dt, hid_t type_id); /*********************/ @@ -98,7 +103,7 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, { H5G_loc_t loc; /* Location to create datatype */ H5T_t *type; /* Datatype for ID */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -126,15 +131,21 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Commit the type */ - if(H5T__commit_named(&loc, name, type, lcpl_id, tcpl_id, tapl_id, dxpl_id) < 0) + if(H5T__commit_named(&loc, name, type, lcpl_id, tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tcommit2() */ @@ -154,14 +165,14 @@ done: */ herr_t H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, - hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id) + hid_t lcpl_id, hid_t tcpl_id) { H5O_obj_create_t ocrt_info; /* Information for object creation */ H5T_obj_create_t tcrt_info; /* Information for named datatype creation */ H5T_state_t old_state; /* The state of the datatype before H5T__commit. */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL /* Sanity checks */ HDassert(loc); @@ -169,8 +180,6 @@ H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, HDassert(dt); HDassert(lcpl_id != H5P_DEFAULT); HDassert(tcpl_id != H5P_DEFAULT); - HDassert(tapl_id != H5P_DEFAULT); - HDassert(dxpl_id != H5P_DEFAULT); /* Record the type's state so that we can revert to it if linking fails */ old_state = dt->shared->state; @@ -185,7 +194,7 @@ H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, ocrt_info.new_obj = NULL; /* Create the new named datatype and link it to its parent group */ - if(H5L_link_object(loc, name, &ocrt_info, lcpl_id, tapl_id, dxpl_id) < 0) + if(H5L_link_object(loc, name, &ocrt_info, lcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create and link to named datatype") HDassert(ocrt_info.new_obj); @@ -198,7 +207,7 @@ done: /* Remove the datatype from the list of opened objects in the file */ if(H5FO_top_decr(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't decrement count for object") - if(H5FO_delete(dt->sh_loc.file, dxpl_id, dt->sh_loc.u.loc.oh_addr) < 0) + if(H5FO_delete(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't remove dataset from list of open objects") /* Close the datatype object */ @@ -206,7 +215,7 @@ done: HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header") /* Remove the datatype's object header from the file */ - if(H5O_delete(dt->sh_loc.file, dxpl_id, dt->sh_loc.u.loc.oh_addr) < 0) + if(H5O_delete(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header") /* Mark datatype as being back in memory */ @@ -217,7 +226,7 @@ done: } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5T__commit_named() */ @@ -245,7 +254,7 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) { H5G_loc_t loc; /* Group location for location */ H5T_t *type = NULL; /* Datatype created */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -264,30 +273,67 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Commit the type */ + if(H5T__commit_anon(loc.oloc->file, type, tcpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") + +done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) +} /* end H5Tcommit_anon() */ + + +/*------------------------------------------------------------------------- + * Function: H5T__commit_anon + * + * Purpose: Create an anonymous committed datatype. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Tuesday, December 12, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5T__commit_anon(H5F_t *file, H5T_t *type, hid_t tcpl_id) +{ + H5O_loc_t *oloc; /* Object location for datatype */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Sanity checks */ + HDassert(file); + HDassert(type); + HDassert(tcpl_id != H5P_DEFAULT); /* Commit the type */ - if(H5T__commit(loc.oloc->file, type, tcpl_id, dxpl_id) < 0) + if(H5T__commit(file, type, tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") /* Release the datatype's object header */ - { - H5O_loc_t *oloc; /* Object location for datatype */ - /* Get the new committed datatype's object location */ - if(NULL == (oloc = H5T_oloc(type))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get object location of committed datatype") + /* Get the new committed datatype's object location */ + if(NULL == (oloc = H5T_oloc(type))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get object location of committed datatype") - /* Decrement refcount on committed datatype's object header in memory */ - if(H5O_dec_rc_by_loc(oloc, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") - } /* end if */ + /* Decrement refcount on committed datatype's object header in memory */ + if(H5O_dec_rc_by_loc(oloc) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") done: - FUNC_LEAVE_API(ret_value) -} /* end H5Tcommit_anon() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5T__commit_anon() */ /*------------------------------------------------------------------------- @@ -304,7 +350,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) +H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id) { H5O_loc_t temp_oloc; /* Temporary object header location */ H5G_name_t temp_path; /* Temporary path */ @@ -362,9 +408,9 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) * Create the object header and open it for write access. Insert the data * type message and then give the object header a name. */ - if(H5O_create(file, dxpl_id, dtype_size, (size_t)1, tcpl_id, &temp_oloc) < 0) + if(H5O_create(file, dtype_size, (size_t)1, tcpl_id, &temp_oloc) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header") - if(H5O_msg_create(&temp_oloc, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, type, dxpl_id) < 0) + if(H5O_msg_create(&temp_oloc, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, type) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message") /* Copy the new object header's location into the datatype, taking ownership of it */ @@ -398,11 +444,11 @@ done: H5G_name_free(&temp_path); } /* end if */ if((type->shared->state == H5T_STATE_TRANSIENT || type->shared->state == H5T_STATE_RDONLY) && (type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED)) { - if(H5O_dec_rc_by_loc(&(type->oloc), dxpl_id) < 0) + if(H5O_dec_rc_by_loc(&(type->oloc)) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") if(H5O_close(&(type->oloc), NULL) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header") - if(H5O_delete(file, dxpl_id, type->sh_loc.u.loc.oh_addr) < 0) + if(H5O_delete(file, type->sh_loc.u.loc.oh_addr) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header") type->sh_loc.type = H5O_SHARE_TYPE_UNSHARED; } /* end if */ @@ -486,7 +532,7 @@ H5T_committed(const H5T_t *type) *------------------------------------------------------------------------- */ int -H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id) +H5T_link(const H5T_t *type, int adjust) { int ret_value = -1; /* Return value */ @@ -496,7 +542,7 @@ H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id) HDassert(type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); /* Adjust the link count on the named datatype */ - if((ret_value = H5O_link(&type->oloc, adjust, dxpl_id)) < 0) + if((ret_value = H5O_link(&type->oloc, adjust)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_LINKCOUNT, FAIL, "unable to adjust named datatype link count") done: @@ -521,66 +567,44 @@ done: hid_t H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id) { - H5T_t *type = NULL; /* Datatype opened in file */ + H5T_t *type = NULL; /* Datatype opened in file */ H5G_loc_t loc; /* Group location of object to open */ - H5G_name_t path; /* Datatype group hier. path */ - H5O_loc_t oloc; /* Datatype object location */ - H5O_type_t obj_type; /* Type of object at location */ - H5G_loc_t type_loc; /* Group object for datatype */ - hbool_t obj_found = FALSE; /* Object at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl to use to open datatype */ - hid_t ret_value = FAIL; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "i*si", loc_id, name, tapl_id); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up datatype location to fill in */ - type_loc.oloc = &oloc; - type_loc.path = &path; - H5G_loc_reset(&type_loc); - - /* - * Find the named datatype object header and read the datatype message - * from it. - */ - if(H5G_loc_find(&loc, name, &type_loc/*out*/, tapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found") - obj_found = TRUE; - - /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_NAMED_DATATYPE) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a named datatype") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Open it */ - if(NULL == (type = H5T_open(&type_loc, dxpl_id))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype") + if(NULL == (type = H5T__open_name(&loc, name))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype") /* Register the type and return the ID */ if((ret_value = H5I_register(H5I_DATATYPE, type, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register named datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype") done: - if(ret_value < 0) { + /* Cleanup on error */ + if(ret_value < 0) if(type != NULL) - H5T_close(type); - else { - if(obj_found && H5F_addr_defined(type_loc.oloc->addr)) - H5G_loc_free(&type_loc); - } /* end else */ - } /* end if */ + (void)H5T_close(type); +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Topen2() */ @@ -590,6 +614,9 @@ done: * * Purpose: Returns a copy of the datatype creation property list. * + * Note: There are no datatype creation properties currently, just + * object creation ones. + * * Return: Success: ID for a copy of the datatype creation * property list. The property list ID should be * released by calling H5Pclose(). @@ -604,11 +631,10 @@ done: hid_t H5Tget_create_plist(hid_t dtype_id) { - H5T_t *type; /* Datatype object for ID */ - H5P_genplist_t *tcpl_plist; /* Existing datatype creation propertty list */ - hid_t new_tcpl_id = FAIL; /* New datatype creation property list */ - herr_t status; /* Generic status value */ - hid_t ret_value; /* Return value */ + H5T_t *type; /* Datatype object for ID */ + herr_t status; /* Generic status value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dtype_id); @@ -617,29 +643,169 @@ H5Tget_create_plist(hid_t dtype_id) if(NULL == (type = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - /* Copy the default datatype creation property list */ - if(NULL == (tcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_DATATYPE_CREATE_ID_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default creation property list") - if((new_tcpl_id = H5P_copy_plist(tcpl_plist, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to copy the creation property list") - /* Check if the datatype is committed */ if((status = H5T_committed(type)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't check whether datatype is committed") /* Retrieve further information, if the datatype is committed */ if(status > 0) { - H5P_genplist_t *new_plist; /* New datatype creation property list */ - - /* Get property list object for new TCPL */ - if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_tcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; - /* Retrieve any object creation properties */ - if(H5O_get_create_plist(&type->oloc, H5AC_ind_read_dxpl_id, new_plist) < 0) + /* Retrieve datatype creation properties */ + if((ret_value = H5T__get_create_plist(type)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info") } /* end if */ +done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") + FUNC_LEAVE_API(ret_value) +} /* end H5Tget_create_plist() */ + + +/*------------------------------------------------------------------------- + * Function: H5Tflush + * + * Purpose: Flushes all buffers associated with a named datatype to disk. + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Mike McGreevy + * May 19, 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Tflush(hid_t type_id) +{ + H5T_t *dt; /* Datatype for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ + + 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") + if(!H5T_is_named(dt)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(type_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Flush metadata for named datatype */ + if(H5T__flush(dt, type_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype") + +done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) +} /* H5Tflush */ + + +/*------------------------------------------------------------------------- + * Function: H5Trefresh + * + * Purpose: Refreshes all buffers associated with a named datatype. + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Mike McGreevy + * July 21, 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Trefresh(hid_t type_id) +{ + H5T_t *dt; /* Datatype for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ + + 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") + if(!H5T_is_named(dt)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(type_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Call private function to refresh datatype object */ + if((H5T__refresh(dt, type_id)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype") + +done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) +} /* H5Trefresh */ + + +/*------------------------------------------------------------------------- + * Function: H5T__get_create_plist + * + * Purpose: Returns a copy of the datatype creation property list. + * + * Note: There are no datatype creation properties currently, just + * object creation ones. + * + * Return: Success: ID for a copy of the datatype creation + * property list. The property list ID should be + * released by calling H5Pclose(). + * + * Failure: FAIL + * + * Programmer: Quincey Koziol + * Wednesday, December 13, 2017 + * + *------------------------------------------------------------------------- + */ +static hid_t +H5T__get_create_plist(const H5T_t *type) +{ + H5P_genplist_t *tcpl_plist; /* Existing datatype creation propertty list */ + H5P_genplist_t *new_plist; /* New datatype creation property list */ + hid_t new_tcpl_id = FAIL; /* New datatype creation property list */ + hid_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Sanity check */ + HDassert(type); + + /* Copy the default datatype creation property list */ + if(NULL == (tcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_DATATYPE_CREATE_ID_g))) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "can't get default creation property list") + if((new_tcpl_id = H5P_copy_plist(tcpl_plist, TRUE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to copy the creation property list") + + /* Get property list object for new TCPL */ + if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_tcpl_id))) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "can't get property list") + + /* Retrieve any object creation properties */ + if(H5O_get_create_plist(&type->oloc, new_plist) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info") + /* Set the return value */ ret_value = new_tcpl_id; @@ -649,8 +815,74 @@ done: if(H5I_dec_app_ref(new_tcpl_id) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to close temporary object") - FUNC_LEAVE_API(ret_value) -} /* end H5Tget_create_plist() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5T__get_create_plist() */ + + +/*------------------------------------------------------------------------- + * Function: H5T__open_name + * + * Purpose: Open a named datatype. + * + * Return: Success: Ptr to a new datatype. + * Failure: NULL + * + * Programmer: Quincey Koziol + * Wednesday, December 13, 2017 + * + *------------------------------------------------------------------------- + */ +H5T_t * +H5T__open_name(const H5G_loc_t *loc, const char *name) +{ + H5T_t *dt = NULL; /* Datatype opened in file */ + H5G_name_t path; /* Datatype group hier. path */ + H5O_loc_t oloc; /* Datatype object location */ + H5G_loc_t type_loc; /* Group object for datatype */ + H5O_type_t obj_type; /* Type of object at location */ + hbool_t obj_found = FALSE; /* Object at 'name' found */ + H5T_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(loc); + HDassert(name); + + /* Set up datatype location to fill in */ + type_loc.oloc = &oloc; + type_loc.path = &path; + H5G_loc_reset(&type_loc); + + /* + * Find the named datatype object header and read the datatype message + * from it. + */ + if(H5G_loc_find(loc, name, &type_loc/*out*/) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found") + obj_found = TRUE; + + /* Check that the object found is the correct type */ + if(H5O_obj_type(&oloc, &obj_type) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, NULL, "can't get object type") + if(obj_type != H5O_TYPE_NAMED_DATATYPE) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "not a named datatype") + + /* Open it */ + if(NULL == (dt = H5T_open(&type_loc))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open named datatype") + + ret_value = dt; + +done: + /* Error cleanup */ + if(NULL == ret_value) + if(obj_found && H5F_addr_defined(type_loc.oloc->addr)) + if(H5G_loc_free(&type_loc) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, NULL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5T__open_name() */ /*------------------------------------------------------------------------- @@ -668,7 +900,7 @@ done: *------------------------------------------------------------------------- */ H5T_t * -H5T_open(const H5G_loc_t *loc, hid_t dxpl_id) +H5T_open(const H5G_loc_t *loc) { H5T_shared_t *shared_fo = NULL; H5T_t *dt = NULL; @@ -684,7 +916,7 @@ H5T_open(const H5G_loc_t *loc, hid_t dxpl_id) H5E_clear_stack(NULL); /* Open the datatype object */ - if(NULL == (dt = H5T_open_oid(loc, dxpl_id))) + if(NULL == (dt = H5T__open_oid(loc))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found") /* Add the datatype to the list of opened objects in the file */ @@ -771,7 +1003,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_open_oid + * Function: H5T__open_oid * * Purpose: Open a named datatype. * @@ -785,12 +1017,12 @@ done: *------------------------------------------------------------------------- */ static H5T_t * -H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id) +H5T__open_oid(const H5G_loc_t *loc) { H5T_t *dt = NULL; /* Datatype from the file */ H5T_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_TAG(loc->oloc->addr) HDassert(loc); @@ -799,7 +1031,7 @@ H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open named datatype") /* Deserialize the datatype message into a datatype in memory */ - if(NULL == (dt = (H5T_t *)H5O_msg_read(loc->oloc, H5O_DTYPE_ID, NULL, dxpl_id))) + if(NULL == (dt = (H5T_t *)H5O_msg_read(loc->oloc, H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to load type message from object header") /* Mark the type as named and open */ @@ -824,8 +1056,8 @@ done: if(dt == NULL) H5O_close(loc->oloc, NULL); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_open_oid() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5T__open_oid() */ /*------------------------------------------------------------------------- @@ -853,3 +1085,73 @@ H5T_update_shared(H5T_t *dt) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5T_update_shared() */ + +/*------------------------------------------------------------------------- + * Function: H5T__flush + * + * Purpose: Internal routine to flushes a named datatype to disk. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5T__flush(H5T_t *dt, hid_t type_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Sanity check */ + HDassert(dt); + + /* To flush metadata and invoke flush callback if there is */ + if(H5O_flush_common(&dt->oloc, type_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype and object flush callback") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5T__flush */ + + +/*------------------------------------------------------------------------- + * Function: H5T__refresh + * + * Purpose: Internal routine to refresh a named datatype. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5T__refresh(H5T_t *dt, hid_t type_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Sanity check */ + HDassert(dt); + + /* Call private function to refresh datatype object */ + if((H5O_refresh_metadata(type_id, dt->oloc)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5T__refresh */ + diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index 169c146..3daf365 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -27,6 +27,7 @@ /* Headers */ /***********/ #include "H5private.h" /*generic functions */ +#include "H5CXprivate.h" /*API Contexts */ #include "H5Eprivate.h" /*error handling */ #include "H5Iprivate.h" /*ID functions */ #include "H5MMprivate.h" /*memory management */ @@ -213,25 +214,37 @@ H5Tget_member_type(hid_t type_id, unsigned membno) { H5T_t *dt; /* Datatype to query */ H5T_t *memb_dt = NULL; /* Member datatype */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE2("i", "iIu", type_id, membno); /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)) || H5T_COMPOUND != dt->shared->type) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a compound datatype") if(membno >= dt->shared->u.compnd.nmembs) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid member number") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid member number") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + /* Retrieve the datatype for the member */ if(NULL == (memb_dt = H5T_get_member_type(dt, membno, H5T_COPY_REOPEN))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to retrieve member type") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to retrieve member type") + + /* Get an ID for the datatype */ if((ret_value = H5I_register(H5I_DATATYPE, memb_dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable register datatype atom") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable register datatype atom") done: if(ret_value < 0) if(memb_dt && H5T_close(memb_dt) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close datatype") + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, H5I_INVALID_HID, "can't close datatype") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tget_member_type() */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 3f4b489..f3af9e1 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -26,6 +26,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -677,7 +678,6 @@ hbool_t s_mv, d_mv; /*move data to align it? */ \ ssize_t s_stride, d_stride; /*src and dst strides */ \ size_t safe; /*how many elements are safe to process in each pass */ \ - H5P_genplist_t *plist; /*Property list pointer */ \ H5T_conv_cb_t cb_struct; /*conversion callback structure */ \ \ switch (cdata->command) { \ @@ -722,13 +722,9 @@ CI_INC_SRC(s_mv) \ CI_INC_DST(d_mv) \ \ - /* Get the plist structure */ \ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) \ - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") \ - \ /* Get conversion exception callback property */ \ - if(H5P_get(plist, H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) \ - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") \ + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) \ + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") \ \ /* Get source and destination datatypes */ \ if(NULL == (st = (H5T_t *)H5I_object(src_id)) || NULL == (dt = (H5T_t *)H5I_object(dst_id))) \ @@ -1039,9 +1035,9 @@ H5FL_BLK_DEFINE_STATIC(array_seq); */ herr_t H5T__conv_noop(hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, H5T_cdata_t *cdata, - size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *buf, - void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id) + size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *buf, + void H5_ATTR_UNUSED *background) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1082,15 +1078,13 @@ done: * Programmer: Robb Matzke * Friday, January 25, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id) + void H5_ATTR_UNUSED *background) { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL; @@ -1496,20 +1490,12 @@ done: * Programmer: Robb Matzke * Tuesday, January 13, 1998 * - * Modifications: - * Robb Matzke, 1999-06-16 - * Added the `stride' argument. If its value is non-zero then we - * stride through memory converting one value at each location; - * otherwise we assume that the values should be packed. - * - * Robb Matzke, 1999-06-16 - * Added support for bitfields. *------------------------------------------------------------------------- */ herr_t H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id) + void H5_ATTR_UNUSED *background) { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL; @@ -1603,18 +1589,12 @@ done: * Programmer: Robb Matzke * Thursday, May 20, 1999 * - * Modifications: - * 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. *------------------------------------------------------------------------- */ herr_t H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *background, hid_t dxpl_id) + void H5_ATTR_UNUSED *background) { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */ @@ -1627,7 +1607,6 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t msb_pad_offset; /*offset for dest MSB padding */ size_t i; uint8_t *src_rev=NULL; /*order-reversed source buffer */ - H5P_genplist_t *plist; /*property list pointer */ H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ @@ -1683,13 +1662,9 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist, H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t *)H5MM_calloc(src->shared->size); @@ -1857,8 +1832,6 @@ done: * Programmer: Neil Fortner * Wednesday, October 1, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5T_conv_struct_t * @@ -1908,16 +1881,9 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv) * source member doesn't have a corresponding destination member * then the src2dst[i]=-1. * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Monday, January 26, 1998 - * - * Modifications: - * Raymond Lu, 3 May 2007 - * Added the detection for a special optimization case when the - * source and destination members are a subset of each other, and - * the order is the same, and no conversion is needed. For example: + * Special optimization case when the source and destination + * members are a subset of each other, 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; @@ -1936,10 +1902,15 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv) * The optimization is simply moving data to the appropriate * places in the buffer. * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Monday, January 26, 1998 + * *------------------------------------------------------------------------- */ static herr_t -H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id) +H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) { H5T_conv_struct_t *priv = (H5T_conv_struct_t*)(cdata->priv); int *src2dst = NULL; @@ -2024,7 +1995,7 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id) for(i = 0; i < src_nmembs; i++) { if(src2dst[i] >= 0) { - H5T_path_t *tpath = H5T_path_find(src->shared->u.compnd.memb[i].type, dst->shared->u.compnd.memb[src2dst[i]].type, NULL, NULL, dxpl_id, FALSE); + H5T_path_t *tpath = H5T_path_find(src->shared->u.compnd.memb[i].type, dst->shared->u.compnd.memb[src2dst[i]].type); if(NULL == (priv->memb_path[i] = tpath)) { cdata->priv = H5T_conv_struct_free(priv); @@ -2151,7 +2122,7 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata) */ herr_t H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg, hid_t dxpl_id) + size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg) { uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */ uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */ @@ -2187,7 +2158,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_COMPOUND != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") - if(H5T_conv_struct_init(src, dst, cdata, dxpl_id) < 0) + if(H5T_conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") break; @@ -2207,7 +2178,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HDassert(priv); HDassert(bkg && cdata->need_bkg); - if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata, dxpl_id) < 0) + if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") /* @@ -2261,8 +2232,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_convert(priv->memb_path[u], priv->src_memb_id[u], priv->dst_memb_id[src2dst[u]], (size_t)1, (size_t)0, (size_t)0, /*no striding (packed array)*/ - xbuf + src_memb->offset, xbkg + dst_memb->offset, - dxpl_id) < 0) + xbuf + src_memb->offset, xbkg + dst_memb->offset) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert compound datatype member") HDmemmove(xbuf + offset, xbuf + src_memb->offset, dst_memb->size); offset += dst_memb->size; @@ -2293,8 +2263,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_convert(priv->memb_path[i], priv->src_memb_id[i], priv->dst_memb_id[src2dst[i]], (size_t)1, (size_t)0, (size_t)0, /*no striding (packed array)*/ - xbuf + offset, xbkg + dst_memb->offset, - dxpl_id) < 0) + xbuf + offset, xbkg + dst_memb->offset) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert compound datatype member") } /* end if */ else @@ -2358,37 +2327,7 @@ done: * * Copy BKG to BUF for all elements * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Thursday, January 22, 1998 - * - * Modifications: - * 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 - * If the source and destination data structs are the same size - * then we can convert on a field-by-field basis instead of an - * element by element basis. In other words, for all struct - * elements being converted by this function call, first convert - * all of the field1's, then all field2's, etc. This can - * drastically reduce the number of calls to H5T_convert() and - * thereby eliminate most of the conversion constant overhead. - * - * Robb Matzke, 2000-05-17 - * Added the BKG_STRIDE argument to fix a design bug. If - * BUF_STRIDE and BKG_STRIDE are both non-zero then each - * data element converted will be placed temporarily at a - * multiple of BKG_STRIDE in the BKG buffer; otherwise the - * BKG buffer is assumed to be a packed array of destination - * datatype. - * - * Raymond Lu, 3 May 2007 - * Optimize a special case when the source and destination members + * Special case when the source and destination members * are a subset of each other, and the order is the same, and no * conversion is needed. For example: * struct source { struct destination { @@ -2401,12 +2340,16 @@ done: * The optimization is simply moving data to the appropriate * places in the buffer. * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, January 22, 1998 + * *------------------------------------------------------------------------- */ herr_t H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, - void *_bkg, hid_t dxpl_id) + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg) { uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */ uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */ @@ -2444,7 +2387,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") /* Initialize data which is relatively constant */ - if(H5T_conv_struct_init(src, dst, cdata, dxpl_id) < 0) + if(H5T_conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") priv = (H5T_conv_struct_t *)(cdata->priv); src2dst = priv->src2dst; @@ -2500,7 +2443,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Update cached data if necessary */ - if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata, dxpl_id)<0) + if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") priv = (H5T_conv_struct_t *)(cdata->priv); HDassert(priv); @@ -2565,7 +2508,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, xbkg = bkg + dst_memb->offset; if(H5T_convert(priv->memb_path[u], priv->src_memb_id[u], priv->dst_memb_id[src2dst[u]], nelmts, - buf_stride, bkg_stride, xbuf, xbkg, dxpl_id) < 0) + buf_stride, bkg_stride, xbuf, xbkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert compound datatype member") for(elmtno = 0; elmtno < nelmts; elmtno++) { HDmemmove(xbkg, xbuf, dst_memb->size); @@ -2601,7 +2544,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, xbkg = bkg + dst_memb->offset; if(H5T_convert(priv->memb_path[i], priv->src_memb_id[i], priv->dst_memb_id[src2dst[i]], nelmts, - buf_stride, bkg_stride, xbuf, xbkg, dxpl_id) < 0) + buf_stride, bkg_stride, xbuf, xbkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert compound datatype member") for(elmtno = 0; elmtno < nelmts; elmtno++) { HDmemmove(xbkg, xbuf, dst_memb->size); @@ -2645,8 +2588,6 @@ done: * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -2792,8 +2733,8 @@ done: */ herr_t H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, + void H5_ATTR_UNUSED *bkg) { uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */ H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */ @@ -2801,7 +2742,6 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, ssize_t src_delta, dst_delta; /*conversion strides */ int n; /*src value cast as native int */ H5T_enum_struct_t *priv = (H5T_enum_struct_t*)(cdata->priv); - H5P_genplist_t *plist; /*property list pointer */ H5T_conv_cb_t cb_struct; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ size_t i; /*counters */ @@ -2879,13 +2819,9 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, d = buf + (nelmts - 1) * dst->shared->size; } - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist, H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") for(i = 0; i < nelmts; i++, s += src_delta, d += dst_delta) { if(priv->length) { @@ -2990,7 +2926,7 @@ done: herr_t H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t H5_ATTR_UNUSED buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + void H5_ATTR_UNUSED *bkg) { H5T_t *src, *dst; /*src and dst datatypes */ H5T_t *src_parent; /*parent type for src */ @@ -3025,14 +2961,14 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne src_parent = src->shared->parent; - if(NULL == (tpath = H5T_path_find(src_parent, dst, NULL, NULL, dxpl_id, FALSE))) { + if(NULL == (tpath = H5T_path_find(src_parent, dst))) { HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") } else if(!H5T_path_noop(tpath)) { if((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") /* Convert the data */ - if(H5T_convert(tpath, src_parent_id, dst_id, nelmts, buf_stride, bkg_stride, _buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath, src_parent_id, dst_id, nelmts, buf_stride, bkg_stride, _buf, bkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") } break; @@ -3073,30 +3009,13 @@ done: * Programmer: Quincey Koziol * Wednesday, May 26, 1999 * - * Modifications: - * - * Quincey Koziol, 2 July, 1999 - * Enabled 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. - * - * Raymond Lu, 26 June, 2002 - * Background buffer is used for freeing heap objects storing - * old data. At this moment, it only frees the first level of - * VL datatype. It doesn't handle nested VL datatypes. - * - * Raymond Lu, 8 November 2011 - * I put a condition check to prevent the conversion of VL strings - * between ASCII and UTF8. *------------------------------------------------------------------------- */ herr_t H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dxpl_id) + size_t buf_stride, size_t bkg_stride, void *buf, void *bkg) { - H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ - H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ + H5T_vlen_alloc_info_t vl_alloc_info;/* VL allocation info */ H5T_path_t *tpath = NULL; /* Type conversion path */ hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */ hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */ @@ -3187,7 +3106,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dst_base_size = H5T_get_size(dst->shared->parent); /* Set up conversion path for base elements */ - if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent))) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatypes") else if(!H5T_path_noop(tpath)) { if((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->shared->parent, H5T_COPY_ALL), FALSE)) < 0 || @@ -3208,7 +3127,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ /* Get the allocation info */ - if(H5T_vlen_get_alloc_info(dxpl_id, &vl_alloc_info) < 0) + if(H5CX_get_vlen_alloc_info(&vl_alloc_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") /* Set flags to indicate we are writing to or reading from the file */ @@ -3263,7 +3182,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Check for "nil" source sequence */ if((*(src->shared->u.vlen.isnull))(src->shared->u.vlen.f, s)) { /* Write "nil" sequence to destination location */ - if((*(dst->shared->u.vlen.setnull))(dst->shared->u.vlen.f, dxpl_id, d, b) < 0) + if((*(dst->shared->u.vlen.setnull))(dst->shared->u.vlen.f, d, b) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't set VL data to 'nil'") } /* end if */ else { @@ -3304,7 +3223,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ /* Read in VL sequence */ - if((*(src->shared->u.vlen.read))(src->shared->u.vlen.f, dxpl_id, s, conv_buf, src_size) < 0) + if((*(src->shared->u.vlen.read))(src->shared->u.vlen.f, s, conv_buf, src_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "can't read VL data") } /* end else */ @@ -3334,7 +3253,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(bg_hobjid.addr)); UINT32DECODE(tmp, bg_hobjid.idx); - if(NULL == H5HG_read(dst->shared->u.vlen.f, dxpl_id, &bg_hobjid, tmp_buf, NULL)) + if(NULL == H5HG_read(dst->shared->u.vlen.f, &bg_hobjid, tmp_buf, NULL)) HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "can't read VL sequence into background buffer") } /* end if */ @@ -3344,12 +3263,12 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ /* Convert VL sequence */ - if(H5T_convert(tpath, tsrc_id, tdst_id, seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0) + if(H5T_convert(tpath, tsrc_id, tdst_id, seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") } /* end if */ /* Write sequence to destination location */ - if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, seq_len, dst_base_size) < 0) + if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, &vl_alloc_info, d, conv_buf, b, seq_len, dst_base_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't write VL data") if(!noop_conv) { @@ -3366,7 +3285,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(parent_seq_len > 0) { H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(parent_hobjid.addr)); UINT32DECODE(tmp, parent_hobjid.idx); - if(H5HG_remove(dst->shared->u.vlen.f, dxpl_id, &parent_hobjid) < 0) + if(H5HG_remove(dst->shared->u.vlen.f, &parent_hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") } /* end if */ } /* end for */ @@ -3421,14 +3340,11 @@ done: * Programmer: Quincey Koziol * Monday, November 6, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *_buf, - void H5_ATTR_UNUSED *_bkg, hid_t dxpl_id) + size_t buf_stride, size_t bkg_stride, void *_buf, void H5_ATTR_UNUSED *_bkg) { H5T_path_t *tpath; /* Type conversion path */ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */ @@ -3507,7 +3423,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); /* Set up conversion path for base elements */ - if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent, NULL, NULL, dxpl_id, FALSE))) { + if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent))) { HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatypes") } else if (!H5T_path_noop(tpath)) { if((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->shared->parent, H5T_COPY_ALL), FALSE)) < 0 || @@ -3531,7 +3447,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HDmemmove(dp, sp, src->shared->size); /* Convert array */ - if(H5T_convert(tpath, tsrc_id, tdst_id, src->shared->u.array.nelem, (size_t)0, bkg_stride, dp, bkg_buf, dxpl_id) < 0) + if(H5T_convert(tpath, tsrc_id, tdst_id, src->shared->u.array.nelem, (size_t)0, bkg_stride, dp, bkg_buf) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Advance the source & destination pointers */ @@ -3571,26 +3487,11 @@ done: * Programmer: Robb Matzke * Wednesday, June 10, 1998 * - * Modifications: - * Robb Matzke, 7 Jul 1998 - * Added overflow handling. - * - * 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. - * - * Raymond Lu - * Wednesday, April 21, 2004 - * There is a new design for exception handling like overflow, - * which is passed in as a transfer property. *------------------------------------------------------------------------- */ herr_t H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ @@ -3605,7 +3506,6 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t first; ssize_t sfirst; /*a signed version of `first' */ size_t i; /*Local index variables */ - H5P_genplist_t *plist; /*property list pointer */ H5T_conv_cb_t cb_struct={NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ @@ -3668,13 +3568,9 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist,H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t*)H5MM_calloc(src->shared->size); @@ -3982,29 +3878,11 @@ done: * Programmer: Robb Matzke * Tuesday, June 23, 1998 * - * Modifications: - * Robb Matzke, 7 Jul 1998 - * Added overflow handling. - * - * 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, 2001-02-02 - * Oops, forgot to increment the exponent when rounding the - * significand resulted in a carry. Thanks to Guillaume Colin - * de Verdiere for finding this one! - * - * Raymond Lu, 2006-03-13 - * Added support for VAX floating-point types. *------------------------------------------------------------------------- */ herr_t H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { /* Traversal-related variables */ H5T_t *src_p; /*source datatype */ @@ -4034,7 +3912,6 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t i; /*miscellaneous counters */ size_t implied; /*destination implied bits */ hbool_t denormalized = FALSE; /*is either source or destination denormalized?*/ - H5P_genplist_t *plist; /*property list pointer */ H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ @@ -4105,13 +3982,9 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src_p->shared->size); dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst_p->shared->size); - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist,H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t*)H5MM_calloc(src_p->shared->size); @@ -4590,22 +4463,12 @@ done: * Programmer: Robb Matzke * Friday, August 7, 1998 * - * Modifications: - * 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. - * - * Raymond Lu, 8 November 2011 - * I put a condition check to prevent the conversion of strings - * between ASCII and UTF8. *------------------------------------------------------------------------- */ herr_t H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, - void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_t *src=NULL; /*source datatype */ H5T_t *dst=NULL; /*destination datatype */ @@ -4834,15 +4697,12 @@ done: * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(SCHAR, UCHAR, signed char, unsigned char, -, -); } @@ -4860,15 +4720,12 @@ H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(UCHAR, SCHAR, unsigned char, signed char, -, SCHAR_MAX); } @@ -4886,15 +4743,12 @@ H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, SHORT, signed char, short, -, -); } @@ -4912,15 +4766,12 @@ H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SCHAR, USHORT, signed char, unsigned short, -, -); } @@ -4938,15 +4789,12 @@ H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, SHORT, unsigned char, short, -, SHRT_MAX); } @@ -4964,15 +4812,12 @@ H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UCHAR, USHORT, unsigned char, unsigned short, -, -); } @@ -4990,14 +4835,12 @@ H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, INT, signed char, int, -, -); } @@ -5015,14 +4858,12 @@ H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SCHAR, UINT, signed char, unsigned, -, -); } @@ -5040,14 +4881,12 @@ H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, INT, unsigned char, int, -, INT_MAX); } @@ -5065,14 +4904,12 @@ H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UCHAR, UINT, unsigned char, unsigned, -, -); } @@ -5090,14 +4927,12 @@ H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, LONG, signed char, long, -, -); } @@ -5115,15 +4950,12 @@ H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SCHAR, ULONG, signed char, unsigned long, -, -); } @@ -5141,14 +4973,12 @@ H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, LONG, unsigned char, long, -, LONG_MAX); } @@ -5166,15 +4996,12 @@ H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UCHAR, ULONG, unsigned char, unsigned long, -, -); } @@ -5192,15 +5019,12 @@ H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, LLONG, signed char, long long, -, -); } @@ -5218,15 +5042,12 @@ H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SCHAR, ULLONG, signed char, unsigned long long, -, -); } @@ -5244,15 +5065,12 @@ H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, LLONG, unsigned char, long long, -, LLONG_MAX); } @@ -5270,15 +5088,12 @@ H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UCHAR, ULLONG, unsigned char, unsigned long long, -, -); } @@ -5296,15 +5111,12 @@ H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(SHORT, SCHAR, short, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -5322,15 +5134,12 @@ H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(SHORT, UCHAR, short, unsigned char, -, UCHAR_MAX); } @@ -5348,15 +5157,12 @@ H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(USHORT, SCHAR, unsigned short, signed char, -, SCHAR_MAX); } @@ -5374,15 +5180,12 @@ H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(USHORT, UCHAR, unsigned short, unsigned char, -, UCHAR_MAX); } @@ -5400,15 +5203,12 @@ H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(SHORT, USHORT, short, unsigned short, -, -); } @@ -5426,15 +5226,12 @@ H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(USHORT, SHORT, unsigned short, short, -, SHRT_MAX); } @@ -5452,15 +5249,12 @@ H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SHORT, INT, short, int, -, -); } @@ -5478,15 +5272,12 @@ H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SHORT, UINT, short, unsigned, -, -); } @@ -5504,15 +5295,12 @@ H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(USHORT, INT, unsigned short, int, -, INT_MAX); } @@ -5530,15 +5318,12 @@ H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(USHORT, UINT, unsigned short, unsigned, -, -); } @@ -5556,15 +5341,12 @@ H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SHORT, LONG, short, long, -, -); } @@ -5582,15 +5364,12 @@ H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SHORT, ULONG, short, unsigned long, -, -); } @@ -5608,15 +5387,12 @@ H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(USHORT, LONG, unsigned short, long, -, LONG_MAX); } @@ -5634,15 +5410,12 @@ H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(USHORT, ULONG, unsigned short, unsigned long, -, -); } @@ -5660,15 +5433,12 @@ H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SHORT, LLONG, short, long long, -, -); } @@ -5686,15 +5456,12 @@ H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SHORT, ULLONG, short, unsigned long long, -, -); } @@ -5712,15 +5479,12 @@ H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(USHORT, LLONG, unsigned short, long long, -, LLONG_MAX); } @@ -5738,15 +5502,12 @@ H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(USHORT, ULLONG, unsigned short, unsigned long long, -, -); } @@ -5764,15 +5525,12 @@ H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(INT, SCHAR, int, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -5790,15 +5548,12 @@ H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(INT, UCHAR, int, unsigned char, -, UCHAR_MAX); } @@ -5816,15 +5571,12 @@ H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(UINT, SCHAR, unsigned, signed char, -, SCHAR_MAX); } @@ -5842,15 +5594,12 @@ H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(UINT, UCHAR, unsigned, unsigned char, -, UCHAR_MAX); } @@ -5868,15 +5617,12 @@ H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(INT, SHORT, int, short, SHRT_MIN, SHRT_MAX); } @@ -5894,15 +5640,12 @@ H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(INT, USHORT, int, unsigned short, -, USHRT_MAX); } @@ -5920,15 +5663,12 @@ H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(UINT, SHORT, unsigned, short, -, SHRT_MAX); } @@ -5946,15 +5686,12 @@ H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(UINT, USHORT, unsigned, unsigned short, -, USHRT_MAX); } @@ -5972,14 +5709,12 @@ H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(INT, UINT, int, unsigned, -, -); } @@ -5997,14 +5732,12 @@ H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(UINT, INT, unsigned, int, -, INT_MAX); } @@ -6022,14 +5755,12 @@ H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(INT, LONG, int, long, -, -); } @@ -6047,14 +5778,12 @@ H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(INT, LONG, int, unsigned long, -, -); } @@ -6072,14 +5801,12 @@ H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UINT, LONG, unsigned, long, -, LONG_MAX); } @@ -6097,14 +5824,12 @@ H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UINT, ULONG, unsigned, unsigned long, -, -); } @@ -6122,14 +5847,12 @@ H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(INT, LLONG, int, long long, -, -); } @@ -6147,14 +5870,12 @@ H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(INT, ULLONG, int, unsigned long long, -, -); } @@ -6172,14 +5893,12 @@ H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UINT, LLONG, unsigned, long long, -, LLONG_MAX); } @@ -6197,15 +5916,12 @@ H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UINT, ULLONG, unsigned, unsigned long long, -, -); } @@ -6223,14 +5939,12 @@ H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LONG, SCHAR, long, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -6248,14 +5962,12 @@ H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LONG, UCHAR, long, unsigned char, -, UCHAR_MAX); } @@ -6273,15 +5985,12 @@ H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULONG, SCHAR, unsigned long, signed char, -, SCHAR_MAX); } @@ -6299,15 +6008,12 @@ H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULONG, UCHAR, unsigned long, unsigned char, -, UCHAR_MAX); } @@ -6325,14 +6031,12 @@ H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LONG, SHORT, long, short, SHRT_MIN, SHRT_MAX); } @@ -6350,15 +6054,12 @@ H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LONG, USHORT, long, unsigned short, -, USHRT_MAX); } @@ -6376,14 +6077,12 @@ H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULONG, SHORT, unsigned long, short, -, SHRT_MAX); } @@ -6401,15 +6100,12 @@ H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULONG, USHORT, unsigned long, unsigned short, -, USHRT_MAX); } @@ -6427,14 +6123,12 @@ H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LONG, INT, long, int, INT_MIN, INT_MAX); } @@ -6452,14 +6146,12 @@ H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LONG, UINT, long, unsigned, -, UINT_MAX); } @@ -6477,14 +6169,12 @@ H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULONG, INT, unsigned long, int, -, INT_MAX); } @@ -6502,14 +6192,12 @@ H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULONG, UINT, unsigned long, unsigned, -, UINT_MAX); } @@ -6527,14 +6215,12 @@ H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(LONG, ULONG, long, unsigned long, -, -); } @@ -6552,14 +6238,12 @@ H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(ULONG, LONG, unsigned long, long, -, LONG_MAX); } @@ -6577,14 +6261,12 @@ H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(LONG, LLONG, long, long long, -, -); } @@ -6602,15 +6284,12 @@ H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(LONG, ULLONG, long, unsigned long long, -, -); } @@ -6628,15 +6307,12 @@ H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(ULONG, LLONG, unsigned long, long long, -, LLONG_MAX); } @@ -6654,15 +6330,12 @@ H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(ULONG, ULLONG, unsigned long, unsigned long long, -, -); } @@ -6680,15 +6353,12 @@ H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, SCHAR, long long, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -6706,15 +6376,12 @@ H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LLONG, UCHAR, long long, unsigned char, -, UCHAR_MAX); } @@ -6732,15 +6399,12 @@ H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULLONG, SCHAR, unsigned long long, signed char, -, SCHAR_MAX); } @@ -6758,15 +6422,12 @@ H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULLONG, UCHAR, unsigned long long, unsigned char, -, UCHAR_MAX); } @@ -6784,15 +6445,12 @@ H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, SHORT, long long, short, SHRT_MIN, SHRT_MAX); } @@ -6810,15 +6468,12 @@ H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LLONG, USHORT, long long, unsigned short, -, USHRT_MAX); } @@ -6836,15 +6491,12 @@ H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULLONG, SHORT, unsigned long long, short, -, SHRT_MAX); } @@ -6862,15 +6514,12 @@ H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULLONG, USHORT, unsigned long long, unsigned short, -, USHRT_MAX); } @@ -6888,14 +6537,12 @@ H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, INT, long long, int, INT_MIN, INT_MAX); } @@ -6913,14 +6560,12 @@ H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LLONG, UINT, long long, unsigned, -, UINT_MAX); } @@ -6938,14 +6583,12 @@ H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULLONG, INT, unsigned long long, int, -, INT_MAX); } @@ -6963,15 +6606,12 @@ H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULLONG, UINT, unsigned long long, unsigned, -, UINT_MAX); } @@ -6989,14 +6629,12 @@ H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, LONG, long long, long, LONG_MIN, LONG_MAX); } @@ -7014,15 +6652,12 @@ H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LLONG, ULONG, long long, unsigned long, -, ULONG_MAX); } @@ -7040,15 +6675,12 @@ H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULLONG, LONG, unsigned long long, long, -, LONG_MAX); } @@ -7066,15 +6698,12 @@ H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULLONG, ULONG, unsigned long long, unsigned long, -, ULONG_MAX); } @@ -7092,15 +6721,12 @@ H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(LLONG, ULLONG, long long, unsigned long long, -, -); } @@ -7118,15 +6744,12 @@ H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(ULLONG, LLONG, unsigned long long, long long, -, LLONG_MAX); } @@ -7143,19 +6766,12 @@ H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Tuesday, June 23, 1998 * - * Modifications: - * 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. *------------------------------------------------------------------------- */ herr_t H5T__conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_fF(FLOAT, DOUBLE, float, double, -, -); } @@ -7172,16 +6788,13 @@ H5T__conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, Feb 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE != 0 herr_t H5T__conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_fF(FLOAT, LDOUBLE, float, long double, -, -); } @@ -7199,22 +6812,12 @@ H5T__conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Tuesday, June 23, 1998 * - * Modifications: - * Robb Matzke, 7 Jul 1998 - * Added overflow handling. - * - * 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. *------------------------------------------------------------------------- */ herr_t H5T__conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ff(DOUBLE, FLOAT, double, float, -FLT_MAX, FLT_MAX); } @@ -7231,16 +6834,13 @@ H5T__conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, Feb 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE != 0 herr_t H5T__conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_fF(DOUBLE, LDOUBLE, double, long double, -, -); } @@ -7258,16 +6858,13 @@ H5T__conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, Feb 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE != 0 herr_t H5T__conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ff(LDOUBLE, FLOAT, long double, float, -FLT_MAX, FLT_MAX); } @@ -7285,16 +6882,13 @@ H5T__conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, Feb 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE != 0 herr_t H5T__conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ff(LDOUBLE, DOUBLE, long double, double, -DBL_MAX, DBL_MAX); } @@ -7312,15 +6906,12 @@ H5T__conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SCHAR, FLOAT, signed char, float, -, -); } @@ -7337,15 +6928,12 @@ H5T__conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SCHAR, DOUBLE, signed char, double, -, -); } @@ -7362,15 +6950,12 @@ H5T__conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SCHAR, LDOUBLE, signed char, long double, -, -); } @@ -7387,15 +6972,12 @@ H5T__conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UCHAR, FLOAT, unsigned char, float, -, -); } @@ -7412,15 +6994,12 @@ H5T__conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UCHAR, DOUBLE, unsigned char, double, -, -); } @@ -7437,15 +7016,12 @@ H5T__conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UCHAR, LDOUBLE, unsigned char, long double, -, -); } @@ -7462,15 +7038,12 @@ H5T__conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SHORT, FLOAT, short, float, -, -); } @@ -7487,15 +7060,12 @@ H5T__conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SHORT, DOUBLE, short, double, -, -); } @@ -7512,15 +7082,12 @@ H5T__conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SHORT, LDOUBLE, short, long double, -, -); } @@ -7537,15 +7104,12 @@ H5T__conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(USHORT, FLOAT, unsigned short, float, -, -); } @@ -7562,15 +7126,12 @@ H5T__conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(USHORT, DOUBLE, unsigned short, double, -, -); } @@ -7587,15 +7148,12 @@ H5T__conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(USHORT, LDOUBLE, unsigned short, long double, -, -); } @@ -7612,15 +7170,12 @@ H5T__conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(INT, FLOAT, int, float, -, -); } @@ -7637,15 +7192,12 @@ H5T__conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(INT, DOUBLE, int, double, -, -); } @@ -7662,15 +7214,12 @@ H5T__conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(INT, LDOUBLE, int, long double, -, -); } @@ -7687,15 +7236,12 @@ H5T__conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UINT, FLOAT, unsigned int, float, -, -); } @@ -7712,15 +7258,12 @@ H5T__conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UINT, DOUBLE, unsigned int, double, -, -); } @@ -7737,15 +7280,12 @@ H5T__conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UINT, LDOUBLE, unsigned int, long double, -, -); } @@ -7762,15 +7302,12 @@ H5T__conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LONG, FLOAT, long, float, -, -); } @@ -7787,15 +7324,12 @@ H5T__conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LONG, DOUBLE, long, double, -, -); } @@ -7812,15 +7346,12 @@ H5T__conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LONG, LDOUBLE, long, long double, -, -); } @@ -7837,15 +7368,12 @@ H5T__conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULONG, FLOAT, unsigned long, float, -, -); } @@ -7862,15 +7390,12 @@ H5T__conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULONG, DOUBLE, unsigned long, double, -, -); } @@ -7887,15 +7412,12 @@ H5T__conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULONG, LDOUBLE, unsigned long, long double, -, -); } @@ -7912,15 +7434,12 @@ H5T__conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LLONG, FLOAT, long long, float, -, -); } @@ -7937,15 +7456,12 @@ H5T__conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LLONG, DOUBLE, long long, double, -, -); } @@ -7962,16 +7478,13 @@ H5T__conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5T_CONV_INTERNAL_LLONG_LDOUBLE herr_t H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LLONG, LDOUBLE, long long, long double, -, -); } @@ -7989,15 +7502,12 @@ H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULLONG, FLOAT, unsigned long long, float, -, -); } @@ -8014,15 +7524,12 @@ H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULLONG, DOUBLE, unsigned long long, double, -, -); } @@ -8039,16 +7546,13 @@ H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5T_CONV_INTERNAL_ULLONG_LDOUBLE herr_t H5T__conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULLONG, LDOUBLE, unsigned long long, long double, -, -); } @@ -8066,15 +7570,12 @@ H5T__conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8093,15 +7594,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX); @@ -8120,15 +7618,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8147,15 +7642,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX); @@ -8174,15 +7666,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8201,15 +7690,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX); @@ -8228,15 +7714,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX); @@ -8255,15 +7738,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX); @@ -8282,15 +7762,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX); @@ -8309,15 +7786,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX); @@ -8336,15 +7810,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX); @@ -8363,15 +7834,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX); @@ -8390,15 +7858,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX); @@ -8417,15 +7882,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX); @@ -8444,15 +7906,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX); @@ -8471,15 +7930,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX); @@ -8498,15 +7954,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX); @@ -8525,15 +7978,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX); @@ -8552,15 +8002,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX); @@ -8579,15 +8026,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX); @@ -8606,15 +8050,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX); @@ -8633,15 +8074,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX); @@ -8660,15 +8098,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX); @@ -8687,15 +8122,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX); @@ -8714,15 +8146,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX); @@ -8741,15 +8170,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long long, 0, ULLONG_MAX); @@ -8768,15 +8194,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX); @@ -8795,15 +8218,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long long, 0, ULLONG_MAX); @@ -8822,16 +8242,13 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5T_CONV_INTERNAL_LDOUBLE_LLONG herr_t H5T__conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX); @@ -8851,16 +8268,13 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5T_CONV_INTERNAL_LDOUBLE_ULLONG herr_t H5T__conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long long, 0, ULLONG_MAX); @@ -8881,8 +8295,6 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Wednesday, Jan 21, 2004 * - * Modifications: - * * Raymond Lu * Wednesday, April 21, 2004 * There is a new design for exception handling like overflow, @@ -8895,8 +8307,7 @@ H5_GCC_DIAG_ON(float-equal) */ herr_t H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { /* Traversal-related variables */ H5T_t *src_p; /*source datatype */ @@ -8921,7 +8332,6 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t i; /*miscellaneous counters */ size_t first; /*first bit(MSB) in an integer */ ssize_t sfirst; /*a signed version of `first' */ - H5P_genplist_t *plist; /*Property list pointer */ H5T_conv_cb_t cb_struct={NULL, NULL}; /*conversion callback structure */ hbool_t truncated; /*if fraction value is dropped */ hbool_t reverse; /*if reverse order of destination at the end */ @@ -8985,13 +8395,9 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, buf_size = (size_t) (HDpow((double)2.0f, (double)src.u.f.esize) / 8 + 1); int_buf = (uint8_t*)H5MM_calloc(buf_size); - /* Get the plist structure. Do I need to close it? */ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist, H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t*)H5MM_calloc(src_p->shared->size); @@ -9467,22 +8873,11 @@ done: * Programmer: Raymond Lu * Friday, Feb 6, 2004 * - * Modifications: - * - * Raymond Lu - * Wednesday, April 21, 2004 - * There is a new design for exception handling like overflow, - * which is passed in as a transfer property. - * - * Raymond Lu - * Monday, March 13, 2006 - * Added support for VAX floating-point types. *------------------------------------------------------------------------- */ herr_t H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { /* Traversal-related variables */ H5T_t *src_p; /*source datatype */ @@ -9510,7 +8905,6 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t i; /*miscellaneous counters */ size_t first; /*first bit(MSB) in an integer */ ssize_t sfirst; /*a signed version of `first' */ - H5P_genplist_t *plist; /*Property list pointer */ H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ @@ -9573,13 +8967,9 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, buf_size = (src.prec > dst.u.f.msize ? src.prec : dst.u.f.msize)/8 + 1; int_buf = (uint8_t*)H5MM_calloc(buf_size); - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist,H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t*)H5MM_calloc(src_p->shared->size); @@ -9898,11 +9288,6 @@ done: * Programmer: Raymond Lu * April 26, 2004 * - * Modifications: - * - * Raymond Lu - * March 13, 2006 - * Add support for VAX floating-point types. *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index c506ec1..5a273f5 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -37,6 +37,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FOprivate.h" /* File objects */ #include "H5Iprivate.h" /* IDs */ @@ -101,6 +102,7 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) { H5G_loc_t loc; /* Location to create datatype */ H5T_t *type; /* Datatype for ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -114,12 +116,21 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Commit the datatype to the file, using default property list values */ - if(H5T__commit_named(&loc, name, type, H5P_LINK_CREATE_DEFAULT, - H5P_DATATYPE_CREATE_DEFAULT, H5P_DATATYPE_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id) < 0) + if(H5T__commit_named(&loc, name, type, H5P_LINK_CREATE_DEFAULT, H5P_DATATYPE_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tcommit1() */ @@ -144,60 +155,39 @@ hid_t H5Topen1(hid_t loc_id, const char *name) { H5T_t *type = NULL; - H5G_loc_t loc; - H5G_name_t path; /* Datatype group hier. path */ - H5O_loc_t oloc; /* Datatype object location */ - H5O_type_t obj_type; /* Type of object at location */ - H5G_loc_t type_loc; /* Group object for datatype */ - hbool_t obj_found = FALSE; /* Object at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl to use to open datatype */ - hid_t ret_value = FAIL; + H5G_loc_t loc; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE2("i", "i*s", loc_id, name); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - - /* Set up datatype location to fill in */ - type_loc.oloc = &oloc; - type_loc.path = &path; - H5G_loc_reset(&type_loc); - - /* - * Find the named datatype object header and read the datatype message - * from it. - */ - if(H5G_loc_find(&loc, name, &type_loc/*out*/, H5P_DEFAULT, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found") - obj_found = TRUE; - - /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_NAMED_DATATYPE) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a named datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; /* Open it */ - if((type = H5T_open(&type_loc, dxpl_id)) == NULL) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype") + if(NULL == (type = H5T__open_name(&loc, name))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype") /* Register the type and return the ID */ if((ret_value = H5I_register(H5I_DATATYPE, type, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register named datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype") done: - if(ret_value < 0) { - if(type != NULL) - H5T_close(type); - else { - if(obj_found && H5F_addr_defined(type_loc.oloc->addr)) - H5G_loc_free(&type_loc); - } /* end else */ - } /* end if */ + /* Cleanup on error */ + if(ret_value < 0) + if(type && H5T_close(type) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, H5I_INVALID_HID, "can't close datatype") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Topen1() */ diff --git a/src/H5Tenum.c b/src/H5Tenum.c index f5263ed..ade7d08 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -57,23 +57,24 @@ H5Tenum_create(hid_t parent_id) H5T_t *dt = NULL; /*new enumeration data type */ hid_t ret_value; /*return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", parent_id); /* Check args */ if(NULL == (parent = (H5T_t *)H5I_object_verify(parent_id, H5I_DATATYPE)) || H5T_INTEGER != parent->shared->type) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an integer data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an integer data type") /* Build new type */ if(NULL == (dt = H5T__enum_create(parent))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot create enum type") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_INVALID_HID, "cannot create enum type") + /* Atomize the type */ if ((ret_value=H5I_register(H5I_DATATYPE, dt, TRUE))<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type atom") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register data type atom") done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Tenum_create() */ /*------------------------------------------------------------------------- @@ -446,7 +447,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t si done: if(copied_dt) - if(H5T_close(copied_dt) < 0) + if(H5T_close_real(copied_dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close data type"); if(!ret_value && alloc_name) H5MM_free(name); @@ -574,7 +575,7 @@ H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) done: if(copied_dt) - if(H5T_close(copied_dt) < 0) + if(H5T_close_real(copied_dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close data type") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 6304500..546b487 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -20,6 +20,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Pprivate.h" /* Property lists */ @@ -27,16 +28,17 @@ #include "H5Tpkg.h" /* Datatypes */ /* Static local functions */ -static H5T_t *H5T_get_native_type(H5T_t *dt, H5T_direction_t direction, - size_t *struct_align, size_t *offset, size_t *comp_size); -static H5T_t *H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, - size_t *struct_align, size_t *offset, size_t *comp_size); -static H5T_t *H5T_get_native_float(size_t size, H5T_direction_t direction, - size_t *struct_align, size_t *offset, size_t *comp_size); -static H5T_t* H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, - size_t *struct_align, size_t *offset, size_t *comp_size); -static herr_t H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, - size_t nelems, size_t align, size_t *struct_align); +static H5T_t *H5T__get_native_type(H5T_t *dt, H5T_direction_t direction, + size_t *struct_align, size_t *offset, size_t *comp_size); +static H5T_t *H5T__get_native_integer(size_t prec, H5T_sign_t sign, + H5T_direction_t direction, size_t *struct_align, size_t *offset, + size_t *comp_size); +static H5T_t *H5T__get_native_float(size_t size, H5T_direction_t direction, + size_t *struct_align, size_t *offset, size_t *comp_size); +static H5T_t* H5T__get_native_bitfield(size_t prec, H5T_direction_t direction, + size_t *struct_align, size_t *offset, size_t *comp_size); +static herr_t H5T__cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, + size_t nelems, size_t align, size_t *struct_align); @@ -74,41 +76,47 @@ hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction) { H5T_t *dt; /* Datatype to create native datatype from */ - H5T_t *new_dt=NULL; /* Datatype for native datatype created */ - size_t comp_size=0; /* Compound datatype's size */ + H5T_t *new_dt = NULL; /* Datatype for native datatype created */ + size_t comp_size = 0; /* Compound datatype's size */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE2("i", "iTd", type_id, direction); - /* check argument */ - if(NULL==(dt=(H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") - - if(direction!=H5T_DIR_DEFAULT && direction!=H5T_DIR_ASCEND - && direction!=H5T_DIR_DESCEND) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not valid direction value") - - if((new_dt = H5T_get_native_type(dt, direction, NULL, NULL, &comp_size))==NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "cannot retrieve native type") - - if((ret_value=H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type") + /* Check arguments */ + if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a data type") + if(direction != H5T_DIR_DEFAULT && direction != H5T_DIR_ASCEND + && direction != H5T_DIR_DESCEND) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not valid direction value") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + /* Get the native type */ + if(NULL == (new_dt = H5T__get_native_type(dt, direction, NULL, NULL, &comp_size))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "cannot retrieve native type") + + /* Get an ID for the new type */ + if((ret_value = H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register data type") done: /* Error cleanup */ - if(ret_value<0) { - if(new_dt) - if(H5T_close(new_dt)<0) - HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release datatype") - } /* end if */ + if(ret_value < 0) + if(new_dt && H5T_close_real(new_dt) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release datatype") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) -} +} /* end H5Tget_native_type() */ /*------------------------------------------------------------------------- - * Function: H5T_get_native_type + * Function: H5T__get_native_type * * Purpose: Returns the native type of a datatype. * @@ -122,7 +130,8 @@ done: *------------------------------------------------------------------------- */ static H5T_t * -H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size) +H5T__get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_align, + size_t *offset, size_t *comp_size) { H5T_t *dt; /* Datatype to make native */ H5T_t *super_type; /* Super type of VL, array and enum datatypes */ @@ -144,7 +153,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig unsigned u; /* Local index variable */ H5T_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC HDassert(dtype); @@ -164,13 +173,13 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig prec = dtype->shared->u.atomic.prec; - if(NULL == (ret_value = H5T_get_native_integer(prec, sign, direction, struct_align, offset, comp_size))) + if(NULL == (ret_value = H5T__get_native_integer(prec, sign, direction, struct_align, offset, comp_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve integer type") } /* end case */ break; case H5T_FLOAT: - if(NULL == (ret_value = H5T_get_native_float(size, direction, struct_align, offset, comp_size))) + if(NULL == (ret_value = H5T__get_native_float(size, direction, struct_align, offset, comp_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") break; @@ -181,12 +190,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if(H5T_IS_VL_STRING(dtype->shared)) { /* Update size, offset and compound alignment for parent. */ - if(H5T_cmp_offset(comp_size, offset, sizeof(char *), (size_t)1, H5T_POINTER_COMP_ALIGN_g, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, sizeof(char *), (size_t)1, H5T_POINTER_COMP_ALIGN_g, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") } /* end if */ else { /* Update size, offset and compound alignment for parent. */ - if(H5T_cmp_offset(comp_size, offset, sizeof(char), size, H5T_NATIVE_SCHAR_COMP_ALIGN_g, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, sizeof(char), size, H5T_NATIVE_SCHAR_COMP_ALIGN_g, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") } /* end else */ break; @@ -200,7 +209,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig { prec = dtype->shared->u.atomic.prec; - if(NULL == (ret_value = H5T_get_native_bitfield(prec, direction, struct_align, offset, comp_size))) + if(NULL == (ret_value = H5T__get_native_bitfield(prec, direction, struct_align, offset, comp_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve integer for bitfield type") } /* end case */ break; @@ -210,7 +219,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") /* Update size, offset and compound alignment for parent. */ - if(H5T_cmp_offset(comp_size, offset, sizeof(char), size, H5T_NATIVE_SCHAR_COMP_ALIGN_g, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, sizeof(char), size, H5T_NATIVE_SCHAR_COMP_ALIGN_g, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") break; @@ -238,7 +247,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig ref_size = sizeof(hdset_reg_ref_t); } /* end else */ - if(H5T_cmp_offset(comp_size, offset, ref_size, (size_t)1, align, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, ref_size, (size_t)1, align, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") } /* end case */ break; @@ -267,10 +276,10 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if(NULL == (comp_mname[u] = H5T__get_member_name(dtype, u))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member type retrieval failed") - if(NULL == (memb_list[u] = H5T_get_native_type(memb_type, direction, &children_st_align, &(memb_offset[u]), &children_size))) + if(NULL == (memb_list[u] = H5T__get_native_type(memb_type, direction, &children_st_align, &(memb_offset[u]), &children_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member identifier retrieval failed") - if(H5T_close(memb_type) < 0) + if(H5T_close_real(memb_type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") } /* end for */ @@ -305,13 +314,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig * The alignment for ST in S1 is the biggest structure alignment of all the * members of S2, which is probably the LL2 of 'long long'. -SLU 2010/4/28 */ - if(H5T_cmp_offset(comp_size, offset, children_size, (size_t)1, children_st_align, - struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, children_size, (size_t)1, children_st_align, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") /* Close member data type */ for(u = 0; u < nmemb; u++) { - if(H5T_close(memb_list[u]) < 0) + if(H5T_close_real(memb_list[u]) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") /* Free member names in list */ @@ -337,7 +345,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Retrieve base type for enumerated type */ if(NULL == (super_type = H5T_get_super(dtype))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get base type for enumerate type") - if(NULL == (nat_super_type = H5T_get_native_type(super_type, direction, struct_align, offset, comp_size))) + if(NULL == (nat_super_type = H5T__get_native_type(super_type, direction, struct_align, offset, comp_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "base native type retrieval failed") if((super_type_id = H5I_register(H5I_DATATYPE, super_type, FALSE)) < 0) @@ -356,7 +364,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create enum type") /* Find the conversion function */ - if(NULL == (tpath = H5T_path_find(super_type, nat_super_type, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(super_type, nat_super_type))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to convert between src and dst data types") /* Retrieve member info and insert members into new enum type */ @@ -370,7 +378,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") HDmemcpy(memb_value, tmp_memb_value, H5T_get_size(super_type)); - if(H5T_convert(tpath, super_type_id, nat_super_type_id, (size_t)1, (size_t)0, (size_t)0, memb_value, NULL, H5AC_noio_dxpl_id) < 0) + if(H5T_convert(tpath, super_type_id, nat_super_type_id, (size_t)1, (size_t)0, (size_t)0, memb_value, NULL) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") if(H5T__enum_insert(new_type, memb_name, memb_value) < 0) @@ -412,12 +420,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Retrieve base type for array type */ if(NULL == (super_type = H5T_get_super(dtype))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for array type") - if(NULL == (nat_super_type = H5T_get_native_type(super_type, direction, &super_align, + if(NULL == (nat_super_type = H5T__get_native_type(super_type, direction, &super_align, &super_offset, &super_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed") /* Close super type */ - if(H5T_close(super_type) < 0) + if(H5T_close_real(super_type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") /* Create a new array type based on native type */ @@ -425,13 +433,13 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create array type") /* Close base type */ - if(H5T_close(nat_super_type) < 0) + if(H5T_close_real(nat_super_type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") for(u = 0; u < array_rank; u++) nelems *= dims[u]; H5_CHECK_OVERFLOW(nelems, hsize_t, size_t); - if(H5T_cmp_offset(comp_size, offset, super_size, (size_t)nelems, super_align, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, super_size, (size_t)nelems, super_align, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") dims = (hsize_t *)H5MM_xfree(dims); @@ -451,11 +459,11 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for VL type") /* Don't need alignment, offset information if this VL isn't a field of compound type. If it * is, go to a few steps below to compute the information directly. */ - if(NULL == (nat_super_type = H5T_get_native_type(super_type, direction, NULL, NULL, &super_size))) + if(NULL == (nat_super_type = H5T__get_native_type(super_type, direction, NULL, NULL, &super_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed") /* Close super type */ - if(H5T_close(super_type) < 0) + if(H5T_close_real(super_type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") /* Create a new array type based on native type */ @@ -463,14 +471,14 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create VL type") /* Close base type */ - if(H5T_close(nat_super_type) < 0) + if(H5T_close_real(nat_super_type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") /* Update size, offset and compound alignment for parent compound type directly. */ vl_align = H5T_HVL_COMP_ALIGN_g; vl_size = sizeof(hvl_t); - if(H5T_cmp_offset(comp_size, offset, vl_size, (size_t)1, vl_align, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, vl_size, (size_t)1, vl_align, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") ret_value = new_type; @@ -487,13 +495,13 @@ done: /* Error cleanup */ if(NULL == ret_value) { if(new_type) - if(H5T_close(new_type) < 0) + if(H5T_close_real(new_type) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, NULL, "unable to release datatype") /* Free lists for members */ if(memb_list) { for(u = 0; u < nmemb; u++) - if(memb_list[u] && H5T_close(memb_list[u]) < 0) + if(memb_list[u] && H5T_close_real(memb_list[u]) < 0) HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") memb_list = (H5T_t **)H5MM_xfree(memb_list); @@ -512,11 +520,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_get_native_type() */ +} /* end H5T__get_native_type() */ /*------------------------------------------------------------------------- - * Function: H5T_get_native_integer + * Function: H5T__get_native_integer * * Purpose: Returns the native integer type of a datatype. * @@ -530,8 +538,8 @@ done: *------------------------------------------------------------------------- */ static H5T_t * -H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, - size_t *struct_align, size_t *offset, size_t *comp_size) +H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, + size_t *struct_align, size_t *offset, size_t *comp_size) { H5T_t *dt; /* Appropriate native datatype to copy */ hid_t tid = (-1); /* Datatype ID of appropriate native datatype */ @@ -547,7 +555,7 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, } match = H5T_NATIVE_INT_MATCH_UNKNOWN; H5T_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) { @@ -648,16 +656,16 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot copy type") /* compute size and offset of compound type member. */ - if(H5T_cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_get_native_integer() */ +} /* end H5T__get_native_integer() */ /*------------------------------------------------------------------------- - * Function: H5T_get_native_float + * Function: H5T__get_native_float * * Purpose: Returns the native floatt type of a datatype. * @@ -671,7 +679,8 @@ done: *------------------------------------------------------------------------- */ static H5T_t* -H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size) +H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_align, + size_t *offset, size_t *comp_size) { H5T_t *dt=NULL; /* Appropriate native datatype to copy */ hid_t tid=(-1); /* Datatype ID of appropriate native datatype */ @@ -687,7 +696,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig } match=H5T_NATIVE_FLOAT_MATCH_UNKNOWN; H5T_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC HDassert(size>0); @@ -772,16 +781,16 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") /* compute offset of compound type member. */ - if(H5T_cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align)<0) + if(H5T__cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T__get_native_float() */ /*------------------------------------------------------------------------- - * Function: H5T_get_native_bitfield + * Function: H5T__get_native_bitfield * * Purpose: Returns the native bitfield type of a datatype. Bitfield * is similar to unsigned integer. @@ -796,8 +805,8 @@ done: *------------------------------------------------------------------------- */ static H5T_t* -H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_align, - size_t *offset, size_t *comp_size) +H5T__get_native_bitfield(size_t prec, H5T_direction_t direction, + size_t *struct_align, size_t *offset, size_t *comp_size) { H5T_t *dt; /* Appropriate native datatype to copy */ hid_t tid=(-1); /* Datatype ID of appropriate native datatype */ @@ -805,7 +814,7 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a size_t native_size=0; /* Datatype size of the native type */ H5T_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B8_g))) { @@ -858,16 +867,16 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot copy type") /* compute size and offset of compound type member. */ - if(H5T_cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align)<0) + if(H5T__cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T__get_native_bitfield() */ /*------------------------------------------------------------------------- - * Function: H5T_cmp_offset + * Function: H5T__cmp_offset * * Purpose: This function is only for convenience. It computes the * compound type size, offset of the member being considered @@ -883,29 +892,27 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, - size_t nelems, size_t align, size_t *struct_align) +H5T__cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, + size_t nelems, size_t align, size_t *struct_align) { - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC_NOERR if(offset && comp_size) { - if(align>1 && *comp_size%align) { + if(align > 1 && *comp_size % align) { /* Add alignment value */ - *offset = *comp_size + (align - *comp_size%align); - *comp_size += (align - *comp_size%align); - } else + *offset = *comp_size + (align - *comp_size % align); + *comp_size += (align - *comp_size % align); + } /* end if */ + else *offset = *comp_size; /* compute size of compound type member. */ - *comp_size += nelems*elem_size; - } + *comp_size += nelems* elem_size; + } /* end if */ if(struct_align && *struct_align < align) *struct_align = align; -done: - FUNC_LEAVE_NOAPI(ret_value) -} + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5T__cmp_offset() */ diff --git a/src/H5Toh.c b/src/H5Toh.c index 01cefe1..c0139fe 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -43,12 +43,10 @@ /* Local Prototypes */ /********************/ -static htri_t H5O_dtype_isa(H5O_t *loc); -static hid_t H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t lapl_id, - hid_t dxpl_id, hbool_t app_ref); -static void *H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, - hid_t dxpl_id); -static H5O_loc_t *H5O_dtype_get_oloc(hid_t obj_id); +static htri_t H5O__dtype_isa(const H5O_t *loc); +static hid_t H5O__dtype_open(const H5G_loc_t *obj_loc, hbool_t app_ref); +static void *H5O__dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc); +static H5O_loc_t *H5O__dtype_get_oloc(hid_t obj_id); /*********************/ @@ -71,17 +69,17 @@ const H5O_obj_class_t H5O_OBJ_DATATYPE[1] = {{ "named datatype", /* object name, for debugging */ NULL, /* get 'copy file' user data */ NULL, /* free 'copy file' user data */ - H5O_dtype_isa, /* "isa" */ - H5O_dtype_open, /* open an object of this class */ - H5O_dtype_create, /* create an object of this class */ - H5O_dtype_get_oloc, /* get an object header location for an object */ + H5O__dtype_isa, /* "isa" */ + H5O__dtype_open, /* open an object of this class */ + H5O__dtype_create, /* create an object of this class */ + H5O__dtype_get_oloc, /* get an object header location for an object */ NULL, /* get the index & heap info for an object */ NULL /* flush an opened object of this class */ }}; /*------------------------------------------------------------------------- - * Function: H5O_dtype_isa + * Function: H5O__dtype_isa * * Purpose: Determines if an object has the requisite messages for being * a datatype. @@ -98,11 +96,11 @@ const H5O_obj_class_t H5O_OBJ_DATATYPE[1] = {{ *------------------------------------------------------------------------- */ static htri_t -H5O_dtype_isa(struct H5O_t *oh) +H5O__dtype_isa(const H5O_t *oh) { htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(oh); @@ -111,11 +109,11 @@ H5O_dtype_isa(struct H5O_t *oh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_isa() */ +} /* end H5O__dtype_isa() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_open + * Function: H5O__dtype_open * * Purpose: Open a datatype at a particular location * @@ -128,17 +126,17 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t H5_ATTR_UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O__dtype_open(const H5G_loc_t *obj_loc, hbool_t app_ref) { H5T_t *type = NULL; /* Datatype opened */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(obj_loc); /* Open the datatype */ - if(NULL == (type = H5T_open(obj_loc, dxpl_id))) + if(NULL == (type = H5T_open(obj_loc))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open datatype") /* Register an ID for the datatype */ @@ -151,11 +149,11 @@ done: HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release datatype") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_open() */ +} /* end H5O__dtype_open() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_create + * Function: H5O__dtype_create * * Purpose: Create a named datatype in a file * @@ -168,12 +166,12 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O__dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) { H5T_obj_create_t *crt_info = (H5T_obj_create_t *)_crt_info; /* Named datatype creation parameters */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); @@ -181,7 +179,7 @@ H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) HDassert(obj_loc); /* Commit the type to the file */ - if(H5T__commit(f, crt_info->dt, crt_info->tcpl_id, dxpl_id) < 0) + if(H5T__commit(f, crt_info->dt, crt_info->tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to commit datatype") /* Set up the new named datatype's location */ @@ -195,11 +193,11 @@ H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_create() */ +} /* end H5O__dtype_create() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_get_oloc + * Function: H5O__dtype_get_oloc * * Purpose: Retrieve the object header location for an open object * @@ -212,12 +210,12 @@ done: *------------------------------------------------------------------------- */ static H5O_loc_t * -H5O_dtype_get_oloc(hid_t obj_id) +H5O__dtype_get_oloc(hid_t obj_id) { H5T_t *type; /* Datatype opened */ H5O_loc_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the datatype */ if(NULL == (type = (H5T_t *)H5I_object(obj_id))) @@ -229,5 +227,5 @@ H5O_dtype_get_oloc(hid_t obj_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_get_oloc() */ +} /* end H5O__dtype_get_oloc() */ diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index d075127..85db68f 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -149,12 +149,25 @@ struct H5T_stats_t { H5_timer_t timer; /*total time for conversion */ }; +/* Library internal datatype conversion functions are... */ +typedef herr_t (*H5T_lib_conv_t) (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg); + +/* Conversion callbacks (library internal ones don't need DXPL) */ +typedef struct H5T_conv_func_t { + hbool_t is_app; /* Whether conversion function is registered from application */ + union { + H5T_conv_t app_func; /* Application data conversion function */ + H5T_lib_conv_t lib_func; /* Library internal data conversion function */ + } u; +} H5T_conv_func_t; + /* The datatype conversion database */ struct H5T_path_t { char name[H5T_NAMELEN]; /*name for debugging only */ H5T_t *src; /*source datatype */ H5T_t *dst; /*destination datatype */ - H5T_conv_t func; /*data conversion function */ + H5T_conv_func_t conv; /* Conversion funcion */ hbool_t is_hard; /*is it a hard function? */ hbool_t is_noop; /*is it the noop conversion? */ hbool_t are_compounds; /*are source and dest both compounds?*/ @@ -234,9 +247,9 @@ typedef struct H5T_enum_t { typedef ssize_t (*H5T_vlen_getlenfunc_t)(const void *vl_addr); typedef void * (*H5T_vlen_getptrfunc_t)(void *vl_addr); typedef htri_t (*H5T_vlen_isnullfunc_t)(const H5F_t *f, void *vl_addr); -typedef herr_t (*H5T_vlen_readfunc_t)(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t len); -typedef herr_t (*H5T_vlen_writefunc_t)(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size); -typedef herr_t (*H5T_vlen_setnullfunc_t)(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg); +typedef herr_t (*H5T_vlen_readfunc_t)(H5F_t *f, void *_vl, void *buf, size_t len); +typedef herr_t (*H5T_vlen_writefunc_t)(H5F_t *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size); +typedef herr_t (*H5T_vlen_setnullfunc_t)(H5F_t *f, void *_vl, void *_bg); /* VL types */ typedef enum { @@ -314,7 +327,7 @@ typedef struct H5T_soft_t { char name[H5T_NAMELEN]; /*name for debugging only */ H5T_class_t src; /*source datatype class */ H5T_class_t dst; /*destination datatype class */ - H5T_conv_t func; /*the conversion function */ + H5T_conv_func_t conv; /*the conversion function */ } H5T_soft_t; /* Bit search direction */ @@ -424,856 +437,687 @@ H5FL_EXTERN(H5T_shared_t); /* Common functions */ H5_DLL herr_t H5T__init_native(void); H5_DLL H5T_t *H5T__create(H5T_class_t type, size_t size); -H5_DLL herr_t H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id); -H5_DLL herr_t H5T__commit_named(const H5G_loc_t *loc, const char *name, - H5T_t *dt, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id); H5_DLL H5T_t *H5T__alloc(void); H5_DLL herr_t H5T__free(H5T_t *dt); H5_DLL herr_t H5T__visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value); H5_DLL herr_t H5T__upgrade_version(H5T_t *dt, unsigned new_version); +/* Committed / named datatype routines */ +H5_DLL herr_t H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id); +H5_DLL herr_t H5T__commit_named(const H5G_loc_t *loc, const char *name, + H5T_t *dt, hid_t lcpl_id, hid_t tcpl_id); +H5_DLL H5T_t *H5T__open_name(const H5G_loc_t *loc, const char *name); + /* Conversion functions */ H5_DLL herr_t H5T__conv_noop(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); /* Bit twiddling functions */ H5_DLL void H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 9171e1e..eb120eb 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -108,6 +108,7 @@ H5_DLL herr_t H5T_init(void); H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method); H5_DLL herr_t H5T_lock(H5T_t *dt, hbool_t immutable); H5_DLL herr_t H5T_close(H5T_t *dt); +H5_DLL herr_t H5T_close_real(H5T_t *dt); H5_DLL H5T_t *H5T_get_super(const H5T_t *dt); H5_DLL H5T_class_t H5T_get_class(const H5T_t *dt, htri_t internal); H5_DLL htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api); @@ -122,17 +123,14 @@ H5_DLL htri_t H5T_is_immutable(const H5T_t *dt); H5_DLL htri_t H5T_is_named(const H5T_t *dt); H5_DLL herr_t H5T_convert_committed_datatype(H5T_t *dt, H5F_t *f); H5_DLL htri_t H5T_is_relocatable(const H5T_t *dt); -H5_DLL 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); +H5_DLL H5T_path_t *H5T_path_find(const H5T_t *src, const H5T_t *dst); H5_DLL hbool_t H5T_path_noop(const H5T_path_t *p); H5_DLL H5T_bkg_t H5T_path_bkg(const H5T_path_t *p); H5_DLL H5T_subset_info_t *H5T_path_compound_subset(const H5T_path_t *p); H5_DLL 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, - hid_t dset_xfer_plist); + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *_op_data); -H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt, hid_t dxpl_id); -H5_DLL herr_t H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_alloc_info); +H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt); H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc); H5_DLL htri_t H5T_is_sensible(const H5T_t *dt); H5_DLL uint32_t H5T_hash(H5F_t * file, const H5T_t *dt); @@ -145,9 +143,9 @@ H5_DLL htri_t H5T_is_variable_str(const H5T_t *dt); H5_DLL H5R_type_t H5T_get_ref_type(const H5T_t *dt); /* Operations on named datatypes */ -H5_DLL H5T_t *H5T_open(const H5G_loc_t *loc, hid_t dxpl_id); +H5_DLL H5T_t *H5T_open(const H5G_loc_t *loc); H5_DLL htri_t H5T_committed(const H5T_t *type); -H5_DLL int H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id); +H5_DLL int H5T_link(const H5T_t *type, int adjust); H5_DLL herr_t H5T_update_shared(H5T_t *type); /* Field functions (for both compound & enumerated types) */ diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 00e61e5..ba31cd1 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -20,6 +20,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5HGprivate.h" /* Global Heaps */ @@ -33,32 +34,24 @@ static herr_t H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t static ssize_t H5T_vlen_seq_mem_getlen(const void *_vl); static void * H5T_vlen_seq_mem_getptr(void *_vl); static htri_t H5T_vlen_seq_mem_isnull(const H5F_t *f, void *_vl); -static herr_t H5T_vlen_seq_mem_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len); -static herr_t H5T_vlen_seq_mem_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); -static herr_t H5T_vlen_seq_mem_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg); +static herr_t H5T_vlen_seq_mem_read(H5F_t *f, void *_vl, void *_buf, size_t len); +static herr_t H5T_vlen_seq_mem_write(H5F_t *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); +static herr_t H5T_vlen_seq_mem_setnull(H5F_t *f, void *_vl, void *_bg); static ssize_t H5T_vlen_str_mem_getlen(const void *_vl); static void * H5T_vlen_str_mem_getptr(void *_vl); static htri_t H5T_vlen_str_mem_isnull(const H5F_t *f, void *_vl); -static herr_t H5T_vlen_str_mem_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len); -static herr_t H5T_vlen_str_mem_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); -static herr_t H5T_vlen_str_mem_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg); +static herr_t H5T_vlen_str_mem_read(H5F_t *f, void *_vl, void *_buf, size_t len); +static herr_t H5T_vlen_str_mem_write(H5F_t *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); +static herr_t H5T_vlen_str_mem_setnull(H5F_t *f, void *_vl, void *_bg); static ssize_t H5T_vlen_disk_getlen(const void *_vl); static void * H5T_vlen_disk_getptr(void *_vl); static htri_t H5T_vlen_disk_isnull(const H5F_t *f, void *_vl); -static herr_t H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len); -static herr_t H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); -static herr_t H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg); +static herr_t H5T_vlen_disk_read(H5F_t *f, void *_vl, void *_buf, size_t len); +static herr_t H5T_vlen_disk_write(H5F_t *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); +static herr_t H5T_vlen_disk_setnull(H5F_t *f, void *_vl, void *_bg); /* Local variables */ -/* Default settings for variable-length allocation routines */ -static H5T_vlen_alloc_info_t H5T_vlen_def_vl_alloc_info ={ - H5D_VLEN_ALLOC, - H5D_VLEN_ALLOC_INFO, - H5D_VLEN_FREE, - H5D_VLEN_FREE_INFO -}; - /*------------------------------------------------------------------------- @@ -157,7 +150,7 @@ H5T__vlen_create(const H5T_t *base) done: if(!ret_value) - if(dt && H5T_close(dt) < 0) + if(dt && H5T_close_real(dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, NULL, "unable to release datatype info") FUNC_LEAVE_NOAPI(ret_value) @@ -211,7 +204,8 @@ H5T__vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) dt->shared->u.vlen.read = H5T_vlen_seq_mem_read; dt->shared->u.vlen.write = H5T_vlen_seq_mem_write; dt->shared->u.vlen.setnull = H5T_vlen_seq_mem_setnull; - } else if(dt->shared->u.vlen.type == H5T_VLEN_STRING) { + } /* end if */ + else if(dt->shared->u.vlen.type == H5T_VLEN_STRING) { /* size in memory, disk size is different */ dt->shared->size = sizeof(char *); @@ -222,9 +216,9 @@ H5T__vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) dt->shared->u.vlen.read = H5T_vlen_str_mem_read; dt->shared->u.vlen.write = H5T_vlen_str_mem_write; dt->shared->u.vlen.setnull = H5T_vlen_str_mem_setnull; - } else { + } /* end else-if */ + else HDassert(0 && "Invalid VL type"); - } /* Reset file ID (since this VL is in memory) */ dt->shared->u.vlen.f = NULL; @@ -401,7 +395,7 @@ H5T_vlen_seq_mem_isnull(const H5F_t H5_ATTR_UNUSED *f, void *_vl) *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_seq_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void *buf, size_t len) +H5T_vlen_seq_mem_read(H5F_t H5_ATTR_UNUSED *f, void *_vl, void *buf, size_t len) { #ifdef H5_NO_ALIGNMENT_RESTRICTIONS const hvl_t *vl=(const hvl_t *)_vl; /* Pointer to the user's hvl_t information */ @@ -442,7 +436,7 @@ H5T_vlen_seq_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, voi *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_seq_mem_write(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void H5_ATTR_UNUSED *_bg, size_t seq_len, size_t base_size) +H5T_vlen_seq_mem_write(H5F_t H5_ATTR_UNUSED *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void H5_ATTR_UNUSED *_bg, size_t seq_len, size_t base_size) { hvl_t vl; /* Temporary hvl_t to use during operation */ size_t len; @@ -498,7 +492,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_seq_mem_setnull(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void H5_ATTR_UNUSED *_bg) +H5T_vlen_seq_mem_setnull(H5F_t H5_ATTR_UNUSED *f, void *_vl, void H5_ATTR_UNUSED *_bg) { hvl_t vl; /* Temporary hvl_t to use during operation */ @@ -632,7 +626,7 @@ H5T_vlen_str_mem_isnull(const H5F_t H5_ATTR_UNUSED *f, void *_vl) *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_str_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void *buf, size_t len) +H5T_vlen_str_mem_read(H5F_t H5_ATTR_UNUSED *f, void *_vl, void *buf, size_t len) { #ifdef H5_NO_ALIGNMENT_RESTRICTIONS char *s=*(char **)_vl; /* Pointer to the user's string information */ @@ -672,7 +666,9 @@ H5T_vlen_str_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, voi *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_str_mem_write(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void H5_ATTR_UNUSED *_bg, size_t seq_len, size_t base_size) +H5T_vlen_str_mem_write(H5F_t H5_ATTR_UNUSED *f, const H5T_vlen_alloc_info_t *vl_alloc_info, + void *_vl, void *buf, void H5_ATTR_UNUSED *_bg, size_t seq_len, + size_t base_size) { char *t; /* Pointer to temporary buffer allocated */ size_t len; /* Maximum length of the string to copy */ @@ -718,7 +714,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_str_mem_setnull(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void H5_ATTR_UNUSED *_bg) +H5T_vlen_str_mem_setnull(H5F_t H5_ATTR_UNUSED *f, void *_vl, void H5_ATTR_UNUSED *_bg) { char *t=NULL; /* Pointer to temporary buffer allocated */ @@ -830,7 +826,7 @@ H5T_vlen_disk_isnull(const H5F_t *f, void *_vl) *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t H5_ATTR_UNUSED len) +H5T_vlen_disk_read(H5F_t *f, void *_vl, void *buf, size_t H5_ATTR_UNUSED len) { uint8_t *vl=(uint8_t *)_vl; /* Pointer to the user's hvl_t information */ H5HG_t hobjid; @@ -847,15 +843,14 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t H5_ATTR vl += 4; /* Get the heap information */ - H5F_addr_decode(f,(const uint8_t **)&vl,&(hobjid.addr)); - UINT32DECODE(vl,hobjid.idx); + H5F_addr_decode(f, (const uint8_t **)&vl, &(hobjid.addr)); + UINT32DECODE(vl, hobjid.idx); /* Check if this sequence actually has any data */ - if(hobjid.addr>0) { + if(hobjid.addr > 0) /* Read the VL information from disk */ - if(H5HG_read(f,dxpl_id,&hobjid,buf, NULL)==NULL) + if(NULL == H5HG_read(f, &hobjid, buf, NULL)) HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "Unable to read VL information") - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -875,7 +870,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t H5_ATTR_UNUSED *vl_alloc_info, +H5T_vlen_disk_write(H5F_t *f, const H5T_vlen_alloc_info_t H5_ATTR_UNUSED *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size) { uint8_t *vl = (uint8_t *)_vl; /*Pointer to the user's hvl_t information*/ @@ -903,11 +898,10 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t H5_ATTR UINT32DECODE(bg, bg_hobjid.idx); /* Free heap object for old data */ - if(bg_hobjid.addr > 0) { + if(bg_hobjid.addr > 0) /* Free heap object */ - if(H5HG_remove(f, dxpl_id, &bg_hobjid) < 0) + if(H5HG_remove(f, &bg_hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") - } /* end if */ } /* end if */ /* Set the length of the sequence */ @@ -915,7 +909,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t H5_ATTR /* Write the VL information to disk (allocates space also) */ len = (seq_len*base_size); - if(H5HG_insert(f, dxpl_id, len, buf, &hobjid) < 0) + if(H5HG_insert(f, len, buf, &hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to write VL information") /* Encode the heap information */ @@ -940,7 +934,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) +H5T_vlen_disk_setnull(H5F_t *f, void *_vl, void *_bg) { uint8_t *vl = (uint8_t *)_vl; /*Pointer to the user's hvl_t information*/ uint8_t *bg = (uint8_t *)_bg; /*Pointer to the old data hvl_t */ @@ -967,7 +961,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) /* Free heap object for old data */ if(bg_hobjid.addr > 0) { /* Free heap object */ - if(H5HG_remove(f, dxpl_id, &bg_hobjid) < 0) + if(H5HG_remove(f, &bg_hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") } /* end if */ } /* end if */ @@ -990,7 +984,7 @@ done: PURPOSE Internal recursive routine to free VL datatypes USAGE - herr_t H5T_vlen_reclaim(elem,dt) + herr_t H5T_vlen_reclaim_recurse(elem,dt) void *elem; IN/OUT: Pointer to the dataset element H5T_t *dt; IN: Datatype of dataset element @@ -1134,7 +1128,8 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned H5_ATTR_UNUSED ndim, const hsize_t H5_ATTR_UNUSED *point, void *op_data) +H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned H5_ATTR_UNUSED ndim, + const hsize_t H5_ATTR_UNUSED *point, void *op_data) { H5T_vlen_alloc_info_t *vl_alloc_info = (H5T_vlen_alloc_info_t *)op_data; /* VL allocation info from iterator */ H5T_t *dt; @@ -1159,73 +1154,11 @@ done: } /* end H5T_vlen_reclaim() */ -/*-------------------------------------------------------------------------- - NAME - H5T_vlen_get_alloc_info - PURPOSE - Retrieve allocation info for VL datatypes - USAGE - herr_t H5T_vlen_get_alloc_info(dxpl_id,vl_alloc_info) - hid_t dxpl_id; IN: Data transfer property list to query - H5T_vlen_alloc_info_t *vl_alloc_info; IN/OUT: Pointer to VL allocation information to fill - - RETURNS - SUCCEED/FAIL - DESCRIPTION - Retrieve the VL allocation functions and information from a dataset - transfer property list. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - The VL_ALLOC_INFO pointer should point at already allocated memory to place - non-default property list info. If a default property list is used, the - VL_ALLOC_INFO pointer will be changed to point at the default information. - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -herr_t -H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_alloc_info) -{ - H5P_genplist_t *plist; /* DX property list */ - herr_t ret_value=SUCCEED; - - FUNC_ENTER_NOAPI(FAIL) - - HDassert(H5I_GENPROP_LST == H5I_get_type(dxpl_id)); - HDassert(vl_alloc_info); - - /* Check for the default DXPL */ - if(dxpl_id==H5P_DATASET_XFER_DEFAULT) - *vl_alloc_info=&H5T_vlen_def_vl_alloc_info; - else { - /* Check args */ - if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Get the allocation functions & information */ - if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_NAME,&(*vl_alloc_info)->alloc_func) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") - if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_INFO_NAME,&(*vl_alloc_info)->alloc_info) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") - if (H5P_get(plist,H5D_XFER_VLEN_FREE_NAME,&(*vl_alloc_info)->free_func) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") - if (H5P_get(plist,H5D_XFER_VLEN_FREE_INFO_NAME,&(*vl_alloc_info)->free_info) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_vlen_get_alloc_info() */ - - /*------------------------------------------------------------------------- * Function: H5T_vlen_reclaim_elmt * * Purpose: Alternative method to reclaim any VL data for a buffer element. * - * Use this function when the datatype is already available, but - * the allocation info is needed from the dxpl_id before jumping - * into recursion. - * * Return: Non-negative on success/Negative on failure * * Programmer: Mike McGreevy @@ -1234,11 +1167,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt, hid_t dxpl_id) +H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt) { - H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ - H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ - herr_t ret_value = SUCCEED; /* return value */ + H5T_vlen_alloc_info_t vl_alloc_info; /* VL allocation info */ + herr_t ret_value = SUCCEED; /* return value */ HDassert(dt); HDassert(elem); @@ -1246,11 +1178,11 @@ H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt, hid_t dxpl_id) FUNC_ENTER_NOAPI(FAIL) /* Get VL allocation info */ - if(H5T_vlen_get_alloc_info(dxpl_id, &vl_alloc_info) < 0) + if(H5CX_get_vlen_alloc_info(&vl_alloc_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") /* Recurse on buffer to free dynamic fields */ - if(H5T_vlen_reclaim_recurse(elem, dt, vl_alloc_info->free_func, vl_alloc_info->free_info) < 0) + if(H5T_vlen_reclaim_recurse(elem, dt, vl_alloc_info.free_func, vl_alloc_info.free_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim vlen elements") done: diff --git a/src/H5Z.c b/src/H5Z.c index 6f173b2..047277f 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -15,6 +15,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File */ @@ -43,7 +44,10 @@ typedef struct H5Z_stats_t { typedef struct H5Z_object_t { H5Z_filter_t filter_id; /* ID of the filter we're looking for */ - htri_t found; /* Whether we find an object using the filter */ + htri_t found; /* Whether we find an object using the filter */ +#ifdef H5_HAVE_PARALLEL + hbool_t sanity_checked; /* Whether the sanity check for collectively calling H5Zunregister has been done */ +#endif /* H5_HAVE_PARALLEL */ } H5Z_object_t; /* Enumerated type for dataset creation prelude callbacks */ @@ -358,7 +362,7 @@ H5Zunregister(H5Z_filter_t id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") /* Do it */ - if (H5Z_unregister(id) < 0) + if(H5Z__unregister(id) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") done: @@ -367,7 +371,7 @@ 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 =0 && filter_id<=H5Z_FILTER_MAX); @@ -399,6 +403,9 @@ H5Z_unregister(H5Z_filter_t filter_id) /* Initialize the structure object for iteration */ object.filter_id = filter_id; object.found = FALSE; +#ifdef H5_HAVE_PARALLEL + object.sanity_checked = FALSE; +#endif /* H5_HAVE_PARALLEL */ /* Iterate through all opened datasets, returns a failure if any of them uses the filter */ if (H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) @@ -415,7 +422,7 @@ H5Z_unregister(H5Z_filter_t filter_id) HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a group is still using it") /* Iterate through all opened files and flush them */ - if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) + if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, &object, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") /* Remove filter from table */ @@ -427,8 +434,8 @@ H5Z_unregister(H5Z_filter_t filter_id) H5Z_table_used_g--; done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_unregister() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5Z__unregister() */ /*------------------------------------------------------------------------- @@ -464,7 +471,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__check_unregister_group_cb * - * Purpose: The callback function for H5Z_unregister. It iterates + * 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. @@ -486,7 +493,7 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void HDassert(obj_ptr); /* Get the group creation property */ - if ((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) + if((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") /* Check if the filter is in the group creation property list */ @@ -494,7 +501,7 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and - * let H5Z_unregister return failure. + * let H5Z__unregister return failure. */ if (filter_in_pline) { object->found = TRUE; @@ -513,7 +520,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__check_unregister_dset_cb * - * Purpose: The callback function for H5Z_unregister. It iterates + * 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. @@ -543,7 +550,7 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and - * let H5Z_unregister return failure. + * let H5Z__unregister return failure. */ if (filter_in_pline) { object->found = TRUE; @@ -562,7 +569,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__flush_file_cb * - * Purpose: The callback function for H5Z_unregister. It iterates + * Purpose: The callback function for H5Z__unregister. It iterates * through all opened files and flush them. * * Return: FALSE if finishes flushing and moves on @@ -570,22 +577,74 @@ done: *------------------------------------------------------------------------- */ static int -H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUSED *key) +H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key) { + H5F_t *f = (H5F_t *)obj_ptr; /* File object for operations */ + H5Z_object_t *object = (H5Z_object_t *)key; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value = FALSE; /* Return value */ FUNC_ENTER_STATIC - HDassert(obj_ptr); + /* Sanity checks */ + HDassert(f); + HDassert(object); + + /* Do a global flush if the file is opened for write */ + if(H5F_ACC_RDWR & H5F_INTENT(f)) { + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + +/* When parallel HDF5 is defined, check for collective metadata reads on this + * file and set the flag for metadata I/O in the API context. -QAK, 2018/02/14 + */ +#ifdef H5_HAVE_PARALLEL + /* Check if MPIO driver is used */ + if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { + H5P_coll_md_read_flag_t coll_md_read; /* Do all metadata reads collectively */ + + /* Sanity check for collectively calling H5Zunregister, if requested */ + /* (Sanity check assumes that a barrier on one file's comm + * is sufficient (i.e. that there aren't different comms for + * different files). -QAK, 2018/02/14 + */ + if(H5_coll_api_sanity_check_g && !object->sanity_checked) { + MPI_Comm mpi_comm; /* File's communicator */ + + /* Retrieve the file communicator */ + if(MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(f))) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get MPI communicator") - /* 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) + /* Issue the barrier */ + if(mpi_comm != MPI_COMM_NULL) + MPI_Barrier(mpi_comm); + + /* Set the "sanity checked" flag */ + object->sanity_checked = TRUE; + } /* end if */ + + /* Check whether to use the collective metadata read DXPL */ + coll_md_read = H5F_COLL_MD_READ(f); + if(H5P_USER_TRUE == coll_md_read) + H5CX_set_coll_metadata_read(TRUE); + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + + /* Call the flush routine for mounted file hierarchies */ + if(H5F_flush_mounts((H5F_t *)obj_ptr) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + +if(api_ctx_pushed && H5CX_pop() < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTRESET, FAIL, "can't reset API context") +api_ctx_pushed = FALSE; } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_PLINE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__flush_file_cb() */ @@ -1448,7 +1507,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_all_filters_avail() */ - /*------------------------------------------------------------------------- * Function: H5Z_delete @@ -1479,7 +1537,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) if (H5Z_FILTER_ALL == filter) { if (H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFREE, FAIL, "can't release pipeline info") - } + } /* end if */ /* Delete filter */ else { size_t idx; /* Index of filter in pipeline */ diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 373eb37..bad4cf2 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -286,7 +286,7 @@ H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) done: if(dtype_base) - if(H5T_close(dtype_base) < 0) + if(H5T_close_real(dtype_base) < 0) HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype") FUNC_LEAVE_NOAPI(ret_value) @@ -385,14 +385,14 @@ H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) } /* end switch */ /* Close member datatype */ - if(H5T_close(dtype_member) < 0) + if(H5T_close_real(dtype_member) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close member datatype") dtype_member = NULL; } /* end for */ done: if(dtype_member) - if(H5T_close(dtype_member) < 0) + if(H5T_close_real(dtype_member) < 0) HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close member datatype") FUNC_LEAVE_NOAPI(ret_value) @@ -633,7 +633,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, done: if(dtype_base) - if(H5T_close(dtype_base) < 0) + if(H5T_close_real(dtype_base) < 0) HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype") FUNC_LEAVE_NOAPI(ret_value) @@ -774,14 +774,14 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, } /* end switch */ /* Close member datatype */ - if(H5T_close(dtype_member) < 0) + if(H5T_close_real(dtype_member) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close member datatype") dtype_member = NULL; } /* end for */ done: if(dtype_member) - if(H5T_close(dtype_member) < 0) + if(H5T_close_real(dtype_member) < 0) HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close member datatype") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Zpkg.h b/src/H5Zpkg.h index 2aa17f2..55fca27 100644 --- a/src/H5Zpkg.h +++ b/src/H5Zpkg.h @@ -51,5 +51,8 @@ H5_DLLVAR const H5Z_class2_t H5Z_DEFLATE[1]; H5_DLLVAR H5Z_class2_t H5Z_SZIP[1]; #endif /* H5_HAVE_FILTER_SZIP */ +/* Package internal routines */ +H5_DLL herr_t H5Z__unregister(H5Z_filter_t filter_id); + #endif /* _H5Zpkg_H */ diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 26e35a7..fbc6fc4 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -93,7 +93,6 @@ H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_filter_in_pline(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_all_filters_avail(const struct H5O_pline_t *pline); -H5_DLL herr_t H5Z_unregister(H5Z_filter_t filter_id); H5_DLL htri_t H5Z_filter_avail(H5Z_filter_t id); H5_DLL herr_t H5Z_delete(struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL herr_t H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags); diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index b86d785..161febc 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -41,7 +41,7 @@ static enum H5Z_scaleoffset_t H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign); static herr_t H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type, unsigned cd_values[], - int need_convert, hid_t dxpl_id); + int need_convert); static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); static size_t H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); @@ -183,12 +183,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ } /* Set the fill value parameter in cd_values[] for unsigned integer type */ -#define H5Z_scaleoffset_set_filval_1(type, dcpl_plist, dt, cd_values, need_convert, dxpl_id)\ +#define H5Z_scaleoffset_set_filval_1(type, dcpl_plist, dt, cd_values, need_convert) \ { \ type fill_val; \ \ /* Get dataset fill value */ \ - if(H5P_get_fill_value(dcpl_plist, dt, &fill_val, dxpl_id) < 0) \ + if(H5P_get_fill_value(dcpl_plist, dt, &fill_val) < 0) \ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ @@ -198,12 +198,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ } /* Set the fill value parameter in cd_values[] for signed integer type */ -#define H5Z_scaleoffset_set_filval_2(type, dcpl_plist, dt, cd_values, need_convert, dxpl_id)\ +#define H5Z_scaleoffset_set_filval_2(type, dcpl_plist, dt, cd_values, need_convert) \ { \ type fill_val; \ \ /* Get dataset fill value */ \ - if(H5P_get_fill_value(dcpl_plist, dt, &fill_val, dxpl_id) < 0) \ + if(H5P_get_fill_value(dcpl_plist, dt, &fill_val) < 0) \ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ @@ -213,12 +213,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ } /* Set the fill value parameter in cd_values[] for character integer type */ -#define H5Z_scaleoffset_set_filval_3(type, dcpl_plist, dt, cd_values, need_convert, dxpl_id)\ +#define H5Z_scaleoffset_set_filval_3(type, dcpl_plist, dt, cd_values, need_convert) \ { \ type fill_val; \ \ /* Get dataset fill value */ \ - if(H5P_get_fill_value(dcpl_plist, dt, &fill_val, dxpl_id) < 0) \ + if(H5P_get_fill_value(dcpl_plist, dt, &fill_val) < 0) \ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ /* Store the fill value as the last entry in cd_values[] */ \ @@ -226,12 +226,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ } /* Set the fill value parameter in cd_values[] for floating-point type */ -#define H5Z_scaleoffset_set_filval_4(type, dcpl_plist, dt, cd_values, need_convert, dxpl_id)\ +#define H5Z_scaleoffset_set_filval_4(type, dcpl_plist, dt, cd_values, need_convert) \ { \ type fill_val; \ \ /* Get dataset fill value */ \ - if(H5P_get_fill_value(dcpl_plist, dt, &fill_val, dxpl_id) < 0) \ + if(H5P_get_fill_value(dcpl_plist, dt, &fill_val) < 0) \ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ @@ -801,36 +801,36 @@ done: static herr_t H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type, - unsigned cd_values[], int need_convert, hid_t dxpl_id) + unsigned cd_values[], int need_convert) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT if(scale_type == t_uchar) - H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_ushort) - H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_uint) - H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_ulong) - H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_ulong_long) - H5Z_scaleoffset_set_filval_1(unsigned long long, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_1(unsigned long long, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_schar) - H5Z_scaleoffset_set_filval_3(signed char, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_3(signed char, dcpl_plist, type, cd_values, need_convertd) else if(scale_type == t_short) - H5Z_scaleoffset_set_filval_2(short, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_2(short, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_int) - H5Z_scaleoffset_set_filval_2(int, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_2(int, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_long) - H5Z_scaleoffset_set_filval_2(long, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_2(long, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_long_long) - H5Z_scaleoffset_set_filval_2(long long, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_2(long long, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_float) - H5Z_scaleoffset_set_filval_4(float, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_4(float, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_double) - H5Z_scaleoffset_set_filval_4(double, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_4(double, dcpl_plist, type, cd_values, need_convert) done: FUNC_LEAVE_NOAPI(ret_value) @@ -1002,7 +1002,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot use C integer datatype for cast") /* Get dataset fill value and store in cd_values[] */ - if(H5Z_scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert, H5AC_noio_dxpl_id) < 0) + if(H5Z_scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "unable to set fill value") } /* end else */ diff --git a/src/H5err.txt b/src/H5err.txt index d771956..19374cd 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -76,6 +76,7 @@ MAJOR, H5E_EARRAY, Extensible Array MAJOR, H5E_FARRAY, Fixed Array MAJOR, H5E_PLUGIN, Plugin for dynamically loaded library MAJOR, H5E_PAGEBUF, Page Buffering +MAJOR, H5E_CONTEXT, API Context MAJOR, H5E_NONE_MAJOR, No error # Sections (for grouping minor errors) diff --git a/src/H5private.h b/src/H5private.h index 2f33cff..b68b886 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2168,23 +2168,19 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ /* Use the following two macros as replacements for the FUNC_ENTER_NOAPI * and FUNC_ENTER_NOAPI_NOINIT macros when the function needs to set * up a metadata tag. */ -#define FUNC_ENTER_NOAPI_TAG(dxpl_id, tag, err) { \ +#define FUNC_ENTER_NOAPI_TAG(tag, err) { \ haddr_t prev_tag = HADDR_UNDEF; \ - hid_t tag_dxpl_id = dxpl_id; \ \ FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ - if(H5AC_tag(tag_dxpl_id, tag, &prev_tag)<0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5AC_tag(tag, &prev_tag); \ FUNC_ENTER_NOAPI_INIT(err) \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { -#define FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, tag, err) { \ +#define FUNC_ENTER_NOAPI_NOINIT_TAG(tag) { \ haddr_t prev_tag = HADDR_UNDEF; \ - hid_t tag_dxpl_id = dxpl_id; \ \ FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ - if(H5AC_tag(tag_dxpl_id, tag, &prev_tag)<0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5AC_tag(tag, &prev_tag); \ H5_PUSH_FUNC \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2194,6 +2190,12 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ H5_PUSH_FUNC \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { +/* Use this macro for all package-level functions that are VOL entry-points */ +#define FUNC_ENTER_PACKAGE_VOL { \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + H5_PUSH_FUNC \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + /* Use this macro for package-level functions which propgate errors, but don't issue them */ #define FUNC_ENTER_PACKAGE_NOERR { \ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ @@ -2202,13 +2204,22 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ /* Use the following macro as replacement for the FUNC_ENTER_PACKAGE * macro when the function needs to set up a metadata tag. */ -#define FUNC_ENTER_PACKAGE_TAG(dxpl_id, tag, err) { \ +#define FUNC_ENTER_PACKAGE_TAG(tag) { \ + haddr_t prev_tag = HADDR_UNDEF; \ + \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + H5AC_tag(tag, &prev_tag); \ + H5_PUSH_FUNC \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +/* Use the following macro as replacement for the FUNC_ENTER_PACKAGE + * macro when the function needs to set up a metadata tag and is also a + * VOL entry-point. */ +#define FUNC_ENTER_PACKAGE_VOL_TAG(tag) { \ haddr_t prev_tag = HADDR_UNDEF; \ - hid_t tag_dxpl_id = dxpl_id; \ \ FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ - if(H5AC_tag(tag_dxpl_id, tag, &prev_tag) < 0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5AC_tag(tag, &prev_tag); \ H5_PUSH_FUNC \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2218,6 +2229,12 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ H5_PUSH_FUNC \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { +/* Use this macro for all "normal" staticly-scoped functions that are VOL entry-points */ +#define FUNC_ENTER_STATIC_VOL { \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + H5_PUSH_FUNC \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + /* Use this macro for staticly-scoped functions which propgate errors, but don't issue them */ #define FUNC_ENTER_STATIC_NOERR { \ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ @@ -2232,13 +2249,22 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ /* Use the following macro as replacement for the FUNC_ENTER_STATIC * macro when the function needs to set up a metadata tag. */ -#define FUNC_ENTER_STATIC_TAG(dxpl_id, tag, err) { \ +#define FUNC_ENTER_STATIC_TAG(tag) { \ haddr_t prev_tag = HADDR_UNDEF; \ - hid_t tag_dxpl_id = dxpl_id; \ \ FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ - if(H5AC_tag(tag_dxpl_id, tag, &prev_tag) < 0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5AC_tag(tag, &prev_tag); \ + H5_PUSH_FUNC \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +/* Use the following macro as replacement for the FUNC_ENTER_STATIC + * macro when the function needs to set up a metadata tag and is a VOL + * entry-point. */ +#define FUNC_ENTER_STATIC_VOL_TAG(tag) { \ + haddr_t prev_tag = HADDR_UNDEF; \ + \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + H5AC_tag(tag, &prev_tag); \ H5_PUSH_FUNC \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2285,6 +2311,13 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ return(ret_value); \ } /*end scope from beginning of FUNC_ENTER*/ +#define FUNC_LEAVE_NOAPI_VOL(ret_value) \ + ; \ + } /*end scope from end of FUNC_ENTER*/ \ + H5_POP_FUNC \ + return(ret_value); \ +} /*end scope from beginning of FUNC_ENTER*/ + #define FUNC_LEAVE_NOAPI_VOID \ ; \ } /*end scope from end of FUNC_ENTER*/ \ @@ -2304,11 +2337,19 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ } /*end scope from beginning of FUNC_ENTER*/ /* Use this macro when exiting a function that set up a metadata tag */ -#define FUNC_LEAVE_NOAPI_TAG(ret_value, err) \ +#define FUNC_LEAVE_NOAPI_TAG(ret_value) \ + ; \ + } /*end scope from end of FUNC_ENTER*/ \ + H5AC_tag(prev_tag, NULL); \ + H5_POP_FUNC \ + return(ret_value); \ +} /*end scope from beginning of FUNC_ENTER*/ + +/* Use this macro when exiting a VOL entry-point function that set up a metadata tag */ +#define FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) \ ; \ } /*end scope from end of FUNC_ENTER*/ \ - if(H5AC_tag(tag_dxpl_id, prev_tag, NULL) < 0) \ - HDONE_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5AC_tag(prev_tag, NULL); \ H5_POP_FUNC \ return(ret_value); \ } /*end scope from beginning of FUNC_ENTER*/ @@ -2566,15 +2607,12 @@ func_init_failed: \ /* Macro to begin/end tagging (when FUNC_ENTER_*TAG macros are insufficient). * Make sure to use HGOTO_ERROR_TAG and HGOTO_DONE_TAG between these macros! */ -#define H5_BEGIN_TAG(dxpl, tag, err) { \ - haddr_t prv_tag = HADDR_UNDEF; \ - hid_t my_dxpl_id = dxpl; \ - if(H5AC_tag(my_dxpl_id, tag, &prv_tag) < 0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") - -#define H5_END_TAG(err) \ - if(H5AC_tag(my_dxpl_id, prv_tag, NULL) <0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ +#define H5_BEGIN_TAG(tag) { \ + haddr_t prv_tag = HADDR_UNDEF; \ + H5AC_tag(tag, &prv_tag); \ + +#define H5_END_TAG \ + H5AC_tag(prv_tag, NULL); \ } /* Compile-time "assert" macro */ @@ -2592,6 +2630,7 @@ H5_DLL void H5_term_library(void); H5_DLL int H5A_term_package(void); H5_DLL int H5A_top_term_package(void); H5_DLL int H5AC_term_package(void); +H5_DLL int H5CX_term_package(void); H5_DLL int H5D_term_package(void); H5_DLL int H5D_top_term_package(void); H5_DLL int H5E_term_package(void); diff --git a/src/Makefile.am b/src/Makefile.am index d8d2cc2..79423f9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5C.c H5Cdbg.c H5Cepoch.c H5Cimage.c H5Clog.c H5Cprefetched.c \ H5Cquery.c H5Ctag.c H5Ctest.c \ H5CS.c \ + H5CX.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 \ H5Dio.c H5Dlayout.c H5Dnone.c \ @@ -55,8 +56,8 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5E.c H5Edeprec.c H5Eint.c \ H5EA.c H5EAcache.c H5EAdbg.c H5EAdblkpage.c H5EAdblock.c H5EAhdr.c \ H5EAiblock.c H5EAint.c H5EAsblock.c H5EAstat.c H5EAtest.c \ - H5F.c H5Fint.c H5Faccum.c H5Fcwfs.c \ - H5Fdbg.c H5Fdeprec.c H5Fefc.c H5Ffake.c H5Fio.c \ + H5F.c H5Faccum.c H5Fcwfs.c \ + H5Fdbg.c H5Fdeprec.c H5Fefc.c H5Ffake.c H5Fint.c H5Fio.c \ H5Fmount.c H5Fquery.c \ H5Fsfile.c H5Fspace.c H5Fsuper.c H5Fsuper_cache.c H5Ftest.c \ H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \ @@ -98,7 +99,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ H5PB.c \ H5PL.c H5PLint.c H5PLpath.c H5PLplugin_cache.c \ - H5R.c H5Rint.c H5Rdeprec.c \ + H5R.c H5Rdeprec.c H5Rint.c \ H5UC.c \ H5RS.c \ H5S.c H5Sall.c H5Sdbg.c H5Shyper.c H5Snone.c H5Spoint.c \ diff --git a/test/accum.c b/test/accum.c index d76c866..76e7656 100644 --- a/test/accum.c +++ b/test/accum.c @@ -20,6 +20,8 @@ #define H5FD_TESTING #include "H5Fpkg.h" #include "H5FDpkg.h" + +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" /* Filename */ @@ -39,33 +41,30 @@ #define RAND_SEG_LEN (1024) #define RANDOM_BASE_OFF (1024 * 1024) -/* Make file global to all tests */ -H5F_t * f = NULL; - /* Function Prototypes */ -unsigned test_write_read(const H5F_io_info2_t *fio_info); -unsigned test_write_read_nonacc_front(const H5F_io_info2_t *fio_info); -unsigned test_write_read_nonacc_end(const H5F_io_info2_t *fio_info); -unsigned test_accum_overlap(const H5F_io_info2_t *fio_info); -unsigned test_accum_overlap_clean(const H5F_io_info2_t *fio_info); -unsigned test_accum_overlap_size(const H5F_io_info2_t *fio_info); -unsigned test_accum_non_overlap_size(const H5F_io_info2_t *fio_info); -unsigned test_accum_adjust(const H5F_io_info2_t *fio_info); -unsigned test_read_after(const H5F_io_info2_t *fio_info); -unsigned test_free(const H5F_io_info2_t *fio_info); -unsigned test_big(const H5F_io_info2_t *fio_info); -unsigned test_random_write(const H5F_io_info2_t *fio_info); +unsigned test_write_read(H5F_t *f); +unsigned test_write_read_nonacc_front(H5F_t *f); +unsigned test_write_read_nonacc_end(H5F_t *f); +unsigned test_accum_overlap(H5F_t *f); +unsigned test_accum_overlap_clean(H5F_t *f); +unsigned test_accum_overlap_size(H5F_t *f); +unsigned test_accum_non_overlap_size(H5F_t *f); +unsigned test_accum_adjust(H5F_t *f); +unsigned test_read_after(H5F_t *f); +unsigned test_free(H5F_t *f); +unsigned test_big(H5F_t *f); +unsigned test_random_write(H5F_t *f); unsigned test_swmr_write_big(hbool_t newest_format); /* Helper Function Prototypes */ -void accum_printf(void); +void accum_printf(const H5F_t *f); /* Private Test H5Faccum Function Wrappers */ -#define accum_write(a,s,b) H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), H5AC_ind_read_dxpl_id, (b)) -#define accum_read(a,s,b) H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), H5AC_ind_read_dxpl_id, (b)) -#define accum_free(fio_info,a,s) H5F__accum_free(fio_info, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s)) -#define accum_flush(fio_info) H5F__accum_flush(fio_info) -#define accum_reset(fio_info) H5F__accum_reset(fio_info, TRUE) +#define accum_write(a,s,b) H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), (b)) +#define accum_read(a,s,b) H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), (b)) +#define accum_free(f,a,s) H5F__accum_free(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s)) +#define accum_flush(f) H5F__accum_flush(f) +#define accum_reset(f) H5F__accum_reset(f, TRUE) /* ================= */ /* Main Test Routine */ @@ -88,15 +87,19 @@ void accum_printf(void); int main(void) { - H5F_io_info2_t fio_info; /* I/O info for operation */ unsigned nerrors = 0; /* track errors */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t fid = -1; + H5F_t * f = NULL; /* File for all tests */ + /* Test Setup */ puts("Testing the metadata accumulator"); /* Create a test file */ if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ if(NULL == (f = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR @@ -105,27 +108,24 @@ main(void) file a ways. 10MB should do. */ if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_DEFAULT, (haddr_t)(1024*1024*10)) < 0) FAIL_STACK_ERROR - /* Set up I/O info for operation */ - fio_info.f = f; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) FAIL_STACK_ERROR - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) FAIL_STACK_ERROR - /* Reset metadata accumulator for the file */ - if(accum_reset(&fio_info) < 0) FAIL_STACK_ERROR + if(accum_reset(f) < 0) FAIL_STACK_ERROR /* Test Functions */ - nerrors += test_write_read(&fio_info); - nerrors += test_write_read_nonacc_front(&fio_info); - nerrors += test_write_read_nonacc_end(&fio_info); - nerrors += test_accum_overlap(&fio_info); - nerrors += test_accum_overlap_clean(&fio_info); - nerrors += test_accum_overlap_size(&fio_info); - nerrors += test_accum_non_overlap_size(&fio_info); - nerrors += test_accum_adjust(&fio_info); - nerrors += test_read_after(&fio_info); - nerrors += test_free(&fio_info); - nerrors += test_big(&fio_info); - nerrors += test_random_write(&fio_info); + nerrors += test_write_read(f); + nerrors += test_write_read_nonacc_front(f); + nerrors += test_write_read_nonacc_end(f); + nerrors += test_accum_overlap(f); + nerrors += test_accum_overlap_clean(f); + nerrors += test_accum_overlap_size(f); + nerrors += test_accum_non_overlap_size(f); + nerrors += test_accum_adjust(f); + nerrors += test_read_after(f); + nerrors += test_free(f); + nerrors += test_big(f); + nerrors += test_random_write(f); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; /* End of test code, close and delete file */ if(H5Fclose(fid) < 0) TEST_ERROR @@ -142,6 +142,7 @@ main(void) return 0; error: +if(api_ctx_pushed) H5CX_pop(); puts("*** TESTS FAILED ***"); return 1; } /* end main() */ @@ -165,7 +166,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_write_read(const H5F_io_info2_t *fio_info) +test_write_read(H5F_t *f) { int i = 0; int *write_buf, *read_buf; @@ -188,7 +189,7 @@ test_write_read(const H5F_io_info2_t *fio_info) if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -221,7 +222,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_write_read_nonacc_front(const H5F_io_info2_t *fio_info) +test_write_read_nonacc_front(H5F_t *f) { int i = 0; int *write_buf, *read_buf; @@ -241,13 +242,13 @@ test_write_read_nonacc_front(const H5F_io_info2_t *fio_info) /* Do a simple write/read/verify of data */ /* Write 1KB at Address 0 */ if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR; - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; if(accum_write(1024, 1024, write_buf) < 0) FAIL_STACK_ERROR; if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -280,7 +281,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_write_read_nonacc_end(const H5F_io_info2_t *fio_info) +test_write_read_nonacc_end(H5F_t *f) { int i = 0; int *write_buf, *read_buf; @@ -300,13 +301,13 @@ test_write_read_nonacc_end(const H5F_io_info2_t *fio_info) /* Do a simple write/read/verify of data */ /* Write 1KB at Address 0 */ if(accum_write(1024, 1024, write_buf) < 0) FAIL_STACK_ERROR; - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR; if(accum_read(1024, 1024, read_buf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -339,7 +340,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_free(const H5F_io_info2_t *fio_info) +test_free(H5F_t *f) { int i = 0; int32_t *wbuf = NULL; @@ -362,38 +363,38 @@ test_free(const H5F_io_info2_t *fio_info) if(accum_write(0, 256 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; - if(accum_free(fio_info, 0, 256 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 0, 256 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Free an empty accumulator */ - if(accum_free(fio_info, 0, 256 * 1024 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 0, 256 * 1024 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Write second quarter of the accumulator */ if(accum_write(64 * sizeof(int32_t), 64 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; /* Free the second quarter of the accumulator, the requested area * is bigger than the data region on the right side. */ - if(accum_free(fio_info, 64 * sizeof(int32_t), 65 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 64 * sizeof(int32_t), 65 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Write half of the accumulator. */ if(accum_write(0, 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; /* Free the first block of 4B */ - if(accum_free(fio_info, 0, sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 0, sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(1 * sizeof(int32_t), 127 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf + 1, rbuf, 127 * sizeof(int32_t)) != 0) TEST_ERROR; /* Free the block of 4B at 127*4B */ - if(accum_free(fio_info, 127 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 127 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(1 * sizeof(int32_t), 126 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf + 1, rbuf, 126 * sizeof(int32_t)) != 0) TEST_ERROR; /* Free the block of 4B at 2*4B */ - if(accum_free(fio_info, 2 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 2 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(1 * sizeof(int32_t), 1 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -406,10 +407,10 @@ test_free(const H5F_io_info2_t *fio_info) * entirely before dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(68 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 68, wbuf, 4 * sizeof(int32_t)); - if(accum_free(fio_info, 62 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 62 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(66 * sizeof(int32_t), 126 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -420,10 +421,10 @@ test_free(const H5F_io_info2_t *fio_info) * completely contains dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(68 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 68, wbuf, 4 * sizeof(int32_t)); - if(accum_free(fio_info, 62 * sizeof(int32_t), 16 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 62 * sizeof(int32_t), 16 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(78 * sizeof(int32_t), 114 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -434,10 +435,10 @@ test_free(const H5F_io_info2_t *fio_info) * before dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t)); - if(accum_free(fio_info, 66 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 66 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(70 * sizeof(int32_t), 122 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -448,10 +449,10 @@ test_free(const H5F_io_info2_t *fio_info) * dirty section, and ends in dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t)); - if(accum_free(fio_info, 70 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 70 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(74 * sizeof(int32_t), 118 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -462,10 +463,10 @@ test_free(const H5F_io_info2_t *fio_info) * contains dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t)); - if(accum_free(fio_info, 70 * sizeof(int32_t), 8 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 70 * sizeof(int32_t), 8 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(78 * sizeof(int32_t), 114 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -476,10 +477,10 @@ test_free(const H5F_io_info2_t *fio_info) * of dirty section, and ends in dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 8 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 8 * sizeof(int32_t)); - if(accum_free(fio_info, 72 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 72 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(76 * sizeof(int32_t), 116 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -492,7 +493,7 @@ test_free(const H5F_io_info2_t *fio_info) HDfree(expect); expect = NULL; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -526,7 +527,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_overlap(const H5F_io_info2_t *fio_info) +test_accum_overlap(H5F_t *f) { int i = 0; int32_t *wbuf, *rbuf; @@ -662,7 +663,7 @@ test_accum_overlap(const H5F_io_info2_t *fio_info) if(accum_read(112, 6 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 6 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -698,7 +699,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_overlap_clean(const H5F_io_info2_t *fio_info) +test_accum_overlap_clean(H5F_t *f) { int i = 0; int32_t *wbuf, *rbuf; @@ -724,7 +725,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) /* Case 2: End of new piece aligns with start of clean accumulated data */ /* Write 5 2's at address 20 */ /* @0:| 222221111111111| */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; for(i = 0; i < 5; i++) wbuf[i] = 2; if(accum_write(20, 5 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -764,7 +765,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) /* Case 6: New piece completely within clean accumulated data */ /* Write 3 6's at address 44 */ /* @0:| 333334666511111| */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; for(i = 0; i < 3; i++) wbuf[i] = 6; if(accum_write(44, 3 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -774,7 +775,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) /* Case 7: New piece overlaps start of clean accumulated data */ /* Write 2 7's at address 16 */ /* @0:| 7733334666511111| */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; for(i = 0; i < 2; i++) wbuf[i] = 7; if(accum_write(16, 2 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -794,7 +795,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) /* Case 9: Start of new piece aligns with end of clean accumulated data */ /* Write 3 9's at address 80 */ /* @0:| 88883334666511111999| */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; for(i = 0; i < 3; i++) wbuf[i] = 9; if(accum_write(80, 3 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -804,7 +805,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) /* Case 10: New piece overlaps end of clean accumulated data */ /* Write 3 2's at address 88 */ /* @0:| 888833346665111119922| */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; for(i = 0; i < 2; i++) wbuf[i] = 2; if(accum_write(88, 2 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -842,7 +843,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) if(accum_read(12, 22 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 22 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -877,7 +878,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_non_overlap_size(const H5F_io_info2_t *fio_info) +test_accum_non_overlap_size(H5F_t *f) { int i = 0; int32_t *wbuf, *rbuf; @@ -909,7 +910,7 @@ test_accum_non_overlap_size(const H5F_io_info2_t *fio_info) if(accum_read(0, 20 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 20 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -944,7 +945,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_overlap_size(const H5F_io_info2_t *fio_info) +test_accum_overlap_size(H5F_t *f) { int i = 0; int32_t *wbuf, *rbuf; @@ -976,7 +977,7 @@ test_accum_overlap_size(const H5F_io_info2_t *fio_info) if(accum_read(60, 72 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 72 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1022,7 +1023,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_adjust(const H5F_io_info2_t *fio_info) +test_accum_adjust(H5F_t *f) { int i = 0; int s = 1048576; /* size of buffer */ @@ -1068,7 +1069,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* ================================================================ */ /* Case 2: Prepending large block to large, fully dirty accumulator */ @@ -1097,7 +1098,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf, rbuf, (size_t)1048571) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* ========================================================= */ /* Case 3: Appending small block to large, clean accumulator */ @@ -1111,7 +1112,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) /* Flush the accumulator -- we want to test the case when accumulator contains clean data */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR + if(accum_flush(f) < 0) FAIL_STACK_ERROR /* Write a small (1KB) block to the end of the accumulator */ /* ==> Accumulator will need more buffer space */ @@ -1132,7 +1133,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* ==================================================================== */ /* Case 4: Appending small block to large, partially dirty accumulator, */ @@ -1146,7 +1147,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(accum_write(0, (1024 * 1024) - 5, wbuf) < 0) FAIL_STACK_ERROR; /* Flush the accumulator to clean it */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR + if(accum_flush(f) < 0) FAIL_STACK_ERROR /* write to part of the accumulator so just the start of it is dirty */ if(accum_write(0, 5, wbuf) < 0) FAIL_STACK_ERROR; @@ -1172,7 +1173,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* ==================================================================== */ /* Case 5: Appending small block to large, partially dirty accumulator, */ @@ -1183,7 +1184,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(accum_write(0, (1024 * 1024) - 5, wbuf) < 0) FAIL_STACK_ERROR; /* Flush the accumulator to clean it */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR + if(accum_flush(f) < 0) FAIL_STACK_ERROR /* write to part of the accumulator so it's dirty, but not entirely dirty */ /* (just the begging few bytes will be clean) */ @@ -1209,7 +1210,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf, rbuf, (size_t)10) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* ================================================================= */ /* Case 6: Appending small block to large, fully dirty accumulator */ @@ -1240,7 +1241,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1278,7 +1279,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_read_after(const H5F_io_info2_t *fio_info) +test_read_after(H5F_t *f) { int i = 0; int s = 128; /* size of buffer */ @@ -1323,7 +1324,7 @@ test_read_after(const H5F_io_info2_t *fio_info) if(accum_read(512, 512, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)128) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1357,7 +1358,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_big(const H5F_io_info2_t *fio_info) +test_big(H5F_t *f) { uint8_t *wbuf, *wbuf2, *rbuf, *zbuf; /* Buffers for reading & writing, etc */ unsigned u; /* Local index variable */ @@ -1393,7 +1394,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to middle of accumulator */ @@ -1412,7 +1413,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(1024, 1024, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to overlap with end of "big" region */ @@ -1430,7 +1431,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(BIG_BUF_SIZE - 512, 1024, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to overlap with beginning of "big" region */ @@ -1448,7 +1449,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, 1024, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to middle of accumulator */ @@ -1470,7 +1471,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to overlap with end of "big" region */ @@ -1493,7 +1494,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 512, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512)); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to be past "big" region */ @@ -1521,7 +1522,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1024)); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to be past "big" region */ @@ -1549,7 +1550,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(1536, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536)); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section before "big" region */ @@ -1576,7 +1577,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(512, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512)); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section before "big" region */ @@ -1604,7 +1605,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536)); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section before "big" region */ @@ -1628,7 +1629,7 @@ test_big(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf2, rbuf + 512, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1665,7 +1666,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_random_write(const H5F_io_info2_t *fio_info) +test_random_write(H5F_t *f) { uint8_t *wbuf, *rbuf; /* Buffers for reading & writing */ unsigned seed = 0; /* Random # seed */ @@ -1765,7 +1766,7 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed); /* Verify data read back in */ if(HDmemcmp(wbuf, rbuf, (size_t)RANDOM_BUF_SIZE) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1819,15 +1820,14 @@ test_swmr_write_big(hbool_t newest_format) pid_t pid; /* Process ID */ #endif /* H5_HAVE_UNISTD_H */ int status; /* Status returned from child process */ - H5F_io_info2_t fio_info; /* I/O info for operation */ char *new_argv[] = {NULL}; char *driver = NULL; /* VFD string (from env variable) */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - if(newest_format) { - TESTING("SWMR write of large metadata: with latest format"); - } else { - TESTING("SWMR write of large metadata: with non-latest-format"); - } /* end if */ + if(newest_format) + TESTING("SWMR write of large metadata: with latest format") + else + TESTING("SWMR write of large metadata: with non-latest-format") #if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) @@ -1870,17 +1870,12 @@ test_swmr_write_big(hbool_t newest_format) /* Open the file with SWMR_WRITE */ if((fid = H5Fopen(SWMR_FILENAME, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ if(NULL == (rf = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR - /* Set up I/O info for operation */ - fio_info.f = rf; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - FAIL_STACK_ERROR - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - FAIL_STACK_ERROR - /* We'll be writing lots of garbage data, so extend the file a ways. 10MB should do. */ if(H5FD_set_eoa(rf->shared->lf, H5FD_MEM_DEFAULT, (haddr_t)(1024*1024*10)) < 0) @@ -1890,7 +1885,7 @@ test_swmr_write_big(hbool_t newest_format) FAIL_STACK_ERROR; /* Reset metadata accumulator for the file */ - if(accum_reset(&fio_info) < 0) + if(accum_reset(rf) < 0) FAIL_STACK_ERROR; /* Allocate space for the write & read buffers */ @@ -1904,16 +1899,16 @@ test_swmr_write_big(hbool_t newest_format) wbuf[u] = (uint8_t)u; /* Write [1024, 1024] bytes with wbuf */ - if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, wbuf) < 0) + if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, wbuf) < 0) FAIL_STACK_ERROR; /* Read the data */ - if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, rbuf) < 0) + if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* Flush the data to disk */ - if(accum_reset(&fio_info) < 0) + if(accum_reset(rf) < 0) FAIL_STACK_ERROR; /* Initialize wbuf with all 1s */ @@ -1925,10 +1920,10 @@ test_swmr_write_big(hbool_t newest_format) wbuf2[u] = (uint8_t)(u + 1); /* Write [1024,1024] with wbuf--all 1s */ - if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, wbuf) < 0) + if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, wbuf) < 0) FAIL_STACK_ERROR; /* Read the data */ - if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, rbuf) < 0) + if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) @@ -1936,10 +1931,10 @@ test_swmr_write_big(hbool_t newest_format) /* The data stays in the accumulator */ /* Write a large piece of metadata [2048, BIG_BUF_SIZE] with wbuf2 */ - if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, H5AC_ind_read_dxpl_id, wbuf2) < 0) + if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, wbuf2) < 0) FAIL_STACK_ERROR; /* Read the data */ - if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, H5AC_ind_read_dxpl_id, rbuf) < 0) + if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ if(HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0) @@ -1950,9 +1945,9 @@ test_swmr_write_big(hbool_t newest_format) HDperror("fork"); FAIL_STACK_ERROR; } else if(0 == pid) { /* Child process */ - /* Run the reader */ - status = HDexecv(SWMR_READER, new_argv); - printf("errno from execv = %s\n", strerror(errno)); + /* Run the reader */ + status = HDexecv(SWMR_READER, new_argv); + printf("errno from execv = %s\n", strerror(errno)); FAIL_STACK_ERROR; } /* end if */ @@ -1963,8 +1958,8 @@ test_swmr_write_big(hbool_t newest_format) /* Check if child process terminates normally and its return value */ if(WIFEXITED(status) && !WEXITSTATUS(status)) { /* Flush the accumulator */ - if(accum_reset(&fio_info) < 0) - FAIL_STACK_ERROR; + if(accum_reset(rf) < 0) + FAIL_STACK_ERROR; /* Close the property list */ if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; @@ -1972,6 +1967,8 @@ test_swmr_write_big(hbool_t newest_format) /* Close and remove the file */ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; HDremove(SWMR_FILENAME); /* Release memory */ @@ -1987,6 +1984,7 @@ error: /* Closing and remove the file */ H5Pclose(fapl); H5Fclose(fid); +if(api_ctx_pushed) H5CX_pop(); HDremove(SWMR_FILENAME); /* Release memory */ if(wbuf2) @@ -2015,7 +2013,7 @@ error: *------------------------------------------------------------------------- */ void -accum_printf(void) +accum_printf(const H5F_t *f) { H5F_meta_accum_t * accum = &f->shared->accum; diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c index c1a238d..9005b99 100644 --- a/test/accum_swmr_reader.c +++ b/test/accum_swmr_reader.c @@ -17,6 +17,8 @@ #include "H5Fpkg.h" #include "H5FDpkg.h" + +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" /* Filename: this is the same as the define in accum.c used by test_swmr_write_big() */ @@ -48,6 +50,7 @@ main(void) uint8_t rbuf[1024]; /* Buffer for reading */ uint8_t buf[1024]; /* Buffer for holding the expected data */ char *driver = NULL; /* VFD string (from env variable) */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. @@ -69,13 +72,15 @@ main(void) /* Open the file with SWMR_READ */ if((fid = H5Fopen(SWMR_FILENAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ if(NULL == (f = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR /* Should read in [1024, 2024] with buf data */ - if(H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, rbuf) < 0) + if(H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ @@ -87,11 +92,14 @@ main(void) FAIL_STACK_ERROR; if(H5Fclose(fid) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; return EXIT_SUCCESS; error: H5Fclose(fid); +if(api_ctx_pushed) H5CX_pop(); return EXIT_FAILURE; } /* end main() */ diff --git a/test/btree2.c b/test/btree2.c index 4c820b3..fb0156c 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -25,6 +25,7 @@ #include "H5B2pkg.h" /* Other private headers that this test requires */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" const char *FILENAME[] = { @@ -145,11 +146,11 @@ error: *------------------------------------------------------------------------- */ static int -create_btree(H5F_t *f, hid_t dxpl, const H5B2_create_t *cparam, +create_btree(H5F_t *f, const H5B2_create_t *cparam, H5B2_t **bt2, haddr_t *bt2_addr) { /* Create the v2 B-tree & get its address */ - if(NULL == (*bt2 = H5B2_create(f, dxpl, cparam, f))) + if(NULL == (*bt2 = H5B2_create(f, cparam, f))) FAIL_STACK_ERROR if(H5B2_get_addr(*bt2, bt2_addr/*out*/) < 0) FAIL_STACK_ERROR @@ -219,17 +220,17 @@ error: *------------------------------------------------------------------------- */ static int -reopen_btree(H5F_t *f, hid_t dxpl, H5B2_t **bt2, haddr_t bt2_addr, +reopen_btree(H5F_t *f, H5B2_t **bt2, haddr_t bt2_addr, const bt2_test_param_t *tparam) { /* Check for closing & re-opening the B-tree */ if(tparam->reopen_btree) { /* Close (empty) v2 B-tree */ - if(H5B2_close(*bt2, dxpl) < 0) + if(H5B2_close(*bt2) < 0) FAIL_STACK_ERROR /* Re-open v2 B-tree */ - if(NULL == (*bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (*bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR } /* end if */ @@ -289,11 +290,11 @@ error: *------------------------------------------------------------------------- */ static int -check_node_depth(H5B2_t *bt2, hid_t dxpl, void *record, unsigned depth) +check_node_depth(H5B2_t *bt2, void *record, unsigned depth) { int rec_depth; /* Depth of record in B-tree */ - if((rec_depth = H5B2_get_node_depth_test(bt2, dxpl, record)) < 0) + if((rec_depth = H5B2__get_node_depth_test(bt2, record)) < 0) FAIL_STACK_ERROR if((unsigned)rec_depth != depth) TEST_ERROR @@ -320,12 +321,12 @@ error: *------------------------------------------------------------------------- */ static int -check_node_info(H5B2_t *bt2, hid_t dxpl, hsize_t record, +check_node_info(H5B2_t *bt2, hsize_t record, H5B2_node_info_test_t *ninfo) { H5B2_node_info_test_t rec_ninfo; /* Node info for record in B-tree */ - if(H5B2_get_node_info_test(bt2, dxpl, &record, &rec_ninfo) < 0) + if(H5B2__get_node_info_test(bt2, &record, &rec_ninfo) < 0) FAIL_STACK_ERROR if(rec_ninfo.depth != ninfo->depth) TEST_ERROR @@ -655,7 +656,6 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -672,7 +672,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR PASSED(); @@ -683,12 +683,12 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree iteration: empty B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to iterate over a B-tree with no records */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index hasn't changed */ if(idx != 0) @@ -696,13 +696,13 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find record in B-tree with no records */ idx = 0; - if(H5B2_find(bt2, dxpl, &idx, find_cb, NULL) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, NULL) != FALSE) TEST_ERROR /* Attempt to index record in B-tree with no records */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -716,37 +716,37 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: first record"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 42; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in B-tree with 1 record */ /* (Should not be found, but not fail) */ idx = 41; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Try again with NULL 'op' */ /* (Should not be found, but not fail) */ - if(H5B2_find(bt2, dxpl, &idx, NULL, NULL) != FALSE) + if(H5B2_find(bt2, &idx, NULL, NULL) != FALSE) TEST_ERROR /* Attempt to find existant record in B-tree with 1 record */ idx = 42; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) TEST_ERROR /* Try again with NULL 'op' */ - if(H5B2_find(bt2, dxpl, &idx, NULL, NULL) != TRUE) + if(H5B2_find(bt2, &idx, NULL, NULL) != TRUE) TEST_ERROR /* Attempt to index non-existant record in B-tree with 1 record */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -754,7 +754,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with 1 record */ idx = 42; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) TEST_ERROR PASSED(); @@ -765,45 +765,45 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: several records"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* * Test inserting second record into v2 B-tree, before all other records */ record = 34; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* * Test inserting third record into v2 B-tree, after all other records */ record = 56; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* * Test inserting fourth record into v2 B-tree, in the middle of other records */ record = 38; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in level-0 B-tree with several records */ /* (Should not be found, but not fail) */ idx = 41; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in level-0 B-tree with several record */ idx = 56; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) TEST_ERROR /* Attempt to index non-existant record in B-tree with several records */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)4, find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -811,20 +811,20 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with several records */ idx = 34; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) TEST_ERROR idx = 38; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, &idx) < 0) TEST_ERROR idx = 42; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, find_cb, &idx) < 0) TEST_ERROR idx = 56; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, find_cb, &idx) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -840,7 +840,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return(1); @@ -869,7 +869,6 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -888,13 +887,13 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records to fill root leaf node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC - 1); u++) { record = u + 2; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -904,16 +903,16 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to split root leaf node */ record = INSERT_SPLIT_ROOT_NREC + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -922,20 +921,20 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert a couple more records, on the left side of the B-tree */ record = 0; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -944,17 +943,17 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -964,23 +963,23 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find non-existant record in level-1 B-tree */ /* (Should not be found, but not fail) */ idx = INSERT_SPLIT_ROOT_NREC + 10; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in root of level-1 B-tree */ idx = 33; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Attempt to find existant record in leaf of level-1 B-tree */ idx = 56; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Attempt to index non-existant record in level-1 B-tree */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -988,21 +987,21 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-1 B-tree */ idx = 33; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)33, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)33, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in left leaf of level-1 B-tree */ idx = 0; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in right leaf of level-1 B-tree */ idx = 50; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)50, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)50, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1016,7 +1015,7 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1046,7 +1045,6 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1063,13 +1061,13 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + (INSERT_SPLIT_ROOT_NREC/2) + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1079,18 +1077,18 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)INSERT_SPLIT_ROOT_NREC; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force redistribution from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1100,11 +1098,11 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1116,13 +1114,13 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: redistribute 2 leaves in level 1 B-tree (r->l)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1132,17 +1130,17 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)(INSERT_SPLIT_ROOT_NREC / 2); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force redistribution from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1152,11 +1150,11 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1171,7 +1169,7 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1201,7 +1199,6 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1218,13 +1215,13 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1234,17 +1231,17 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force left node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1254,14 +1251,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 31; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 63; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1273,13 +1270,13 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: split side leaf into 2 leaves in level 1 B-tree (r->l)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1289,17 +1286,17 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (INSERT_SPLIT_ROOT_NREC / 2); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force right node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1309,14 +1306,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 62; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1331,7 +1328,7 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1363,7 +1360,6 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1381,13 +1377,13 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1397,17 +1393,17 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (2 * INSERT_SPLIT_ROOT_NREC); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force left node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1417,20 +1413,20 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (INSERT_SPLIT_ROOT_NREC / 2); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert records to force middle node to redistribute */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1440,19 +1436,19 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 52; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 105; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1460,7 +1456,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1475,7 +1471,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1506,7 +1502,6 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1524,13 +1519,13 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 2); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1540,17 +1535,17 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (2 * INSERT_SPLIT_ROOT_NREC) + (INSERT_SPLIT_ROOT_NREC / 2); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force split from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1560,22 +1555,22 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 62; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 126; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1583,7 +1578,7 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1598,7 +1593,7 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1625,7 +1620,6 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1644,18 +1638,18 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 9); u++) { record = u + 2; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + 1); u++) { record = u + 4; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1665,37 +1659,37 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 948; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Add some extra records to left-most leaf */ record = 0; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Add some extra records to middle leaf */ record = (INSERT_SPLIT_ROOT_NREC * 9) + 2; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = (INSERT_SPLIT_ROOT_NREC * 9) + 3; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1705,43 +1699,43 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find non-existant record in level-2 B-tree */ /* (Should not be found, but not fail) */ idx = INSERT_SPLIT_ROOT_NREC * 30; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in root of level-2 B-tree */ idx = 948; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ record = 948; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Attempt to find existant record in internal node of level-2 B-tree */ idx = 505; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ record = 505; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Attempt to find existant record in leaf of level-2 B-tree */ idx = 555; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ record = 555; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Attempt to index non-existant record in level-2 B-tree */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -1749,21 +1743,21 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-2 B-tree */ idx = 948; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)948, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)948, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in internal node of level-2 B-tree */ idx = 505; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)505, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)505, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in leaf of level-2 B-tree */ idx = 555; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1778,7 +1772,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1807,7 +1801,6 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1825,19 +1818,19 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ /* And fill rightmost leaf */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) { record = u + (INSERT_SPLIT_ROOT_NREC / 2) + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) { record = u + INSERT_SPLIT_ROOT_NREC + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1847,22 +1840,22 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1859; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1921; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to force redistribution of rightmost leaf */ record = u + INSERT_SPLIT_ROOT_NREC + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -1871,13 +1864,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1875; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1922; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -1885,7 +1878,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: redistrib left-most leaf in level 2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -1894,13 +1887,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 94; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 32; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Add more records to left-most leaf, to force a 2->1 split and then a @@ -1908,7 +1901,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1918,13 +1911,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 47; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 0; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -1932,7 +1925,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: redistrib middle leaf in level 2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -1941,22 +1934,22 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) /* Record in root node */ + if(check_node_depth(bt2, &record, (unsigned)2) < 0) /* Record in root node */ TEST_ERROR record = 535; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */ + if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */ TEST_ERROR record = 630; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */ + if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */ TEST_ERROR record = 568; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */ + if(check_node_depth(bt2, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */ TEST_ERROR /* Add more records to middle leaf, to force a split and a 3 node redistribution on middle leaf */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 8) + (INSERT_SPLIT_ROOT_NREC / 2) + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1966,25 +1959,25 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) /* Record in root node */ + if(check_node_depth(bt2, &record, (unsigned)2) < 0) /* Record in root node */ TEST_ERROR record = 524; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */ + if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */ TEST_ERROR record = 577; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */ + if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */ TEST_ERROR record = 568; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */ + if(check_node_depth(bt2, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */ TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1992,7 +1985,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2007,7 +2000,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2036,7 +2029,6 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2054,18 +2046,18 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) { record = u + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) { record = u + 2; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2075,23 +2067,23 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1797; /* Right-most record in right internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1859; /* Right-most record in right-most leaf */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert enough records to force right-most leaf to split */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2) + 2; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2101,16 +2093,16 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1828; /* Next-to-right-most record in right-most internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1860; /* Right-most record in right-most internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1891; /* Right-most record in right-most leaf */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -2118,7 +2110,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: split left-most leaf in level 2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -2127,18 +2119,18 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 63; /* Left-most record in left-most internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1; /* Left-most record in left-most leaf */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Add another record to left-most leaf, to force a 1->2 node split on left leaf */ record = 0; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2147,16 +2139,16 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 63; /* Left-most record in left-most internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 32; /* Left-most record in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 0; /* Left-most record in left-most leaf */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -2164,7 +2156,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: split middle leaf in level 2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -2173,21 +2165,21 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 504; /* Record in internal node just before insertion point */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 568; /* Record in internal node just after insertion point */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 506; /* Record in leaf node just after insertion point */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Add another record to middle leaf, to force a node split on middle leaf */ record = (INSERT_SPLIT_ROOT_NREC * 8) + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2196,28 +2188,28 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 504; /* Left-most record of split in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 537; /* Middle record of split in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 568; /* Right-most record of split in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 506; /* Record in leaf node just after insertion point */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2225,7 +2217,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2240,7 +2232,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2270,7 +2262,6 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2288,14 +2279,14 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ /* And fill up right internal node, to just before to redistribute it */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 44); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2305,22 +2296,22 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1318; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3114; /* Right-most record in right internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3145; /* Right-most record in right leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to redistribute right-most internal node */ record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2329,13 +2320,13 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1822; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3114; /* Right-most record in right internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3146; /* Right-most record in right leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -2343,7 +2334,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: redist. 2 internal (l->r) in level 2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -2352,19 +2343,19 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1822; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 436; /* Left-most record in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 374; /* Left-most record in left leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Force left-most internal node to redistribute */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 6) - 4); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2374,22 +2365,22 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1570; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 61; /* Left-most record in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 0; /* Left-most record in left leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2397,7 +2388,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2412,7 +2403,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2442,7 +2433,6 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2460,14 +2450,14 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ /* (And fill up two child internal nodes) */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 59); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2477,22 +2467,22 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 2759; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 4555; /* Right-most record in right internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 4586; /* Right-most record in right leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to split right-most internal node */ record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2501,16 +2491,16 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 2759; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3704; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 4555; /* Right-most record in right internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 4387; /* Right-most record in right leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -2518,7 +2508,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: split side internal node to 2 in level 2 B-tree (l->2)"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -2527,19 +2517,19 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 2759; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 932; /* Left-most record in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 870; /* Left-most record in left leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Force left-most internal node to split */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2549,25 +2539,25 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 870; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1814; /* Next-to-left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 61; /* Left-most record in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 0; /* Left-most record in left leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2575,7 +2565,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2590,7 +2580,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2621,7 +2611,6 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2639,18 +2628,18 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 3 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 36); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2660,29 +2649,29 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3703; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 2267; /* Record to left of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3199; /* Record to right of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3137; /* Record just above insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert records to fill up middle internal node */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 36); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2692,28 +2681,28 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3703; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3104; /* Record to left of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3137; /* Record to right of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3135; /* Record just above insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert another record, forcing the middle internal node to redistribute */ record = u + (INSERT_SPLIT_ROOT_NREC * 36); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2722,30 +2711,30 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1574; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3104; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR #ifdef NONE record = 2862; /* Record to left of insertion point in right internal node (now) */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR #endif /* NONE */ record = 3137; /* Record to right of insertion point in right internal node (now) */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3135; /* Record just above insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2753,7 +2742,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2768,7 +2757,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2799,7 +2788,6 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2817,24 +2805,24 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 3 internal nodes */ /* (and fill right internal node) */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 31); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < (INSERT_SPLIT_ROOT_NREC * 74); u++) { record = u + ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -2843,25 +2831,25 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3703; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1952; /* Record to left of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 2884; /* Record to right of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 2822; /* Record just after insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Insert records to fill up middle internal node */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 31); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2871,28 +2859,28 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3703; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 2789; /* Record to left of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 2822; /* Record to right of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 2823; /* Record just above insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to split middle internal node */ record = u + (INSERT_SPLIT_ROOT_NREC * 31); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2901,33 +2889,33 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 2789; /* Middle record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3703; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR #ifdef NONE record = 3049; /* Record to left of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR #endif /* NONE */ record = 2822; /* Record to right of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 2823; /* Record just above insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2935,7 +2923,7 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2950,7 +2938,7 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2979,7 +2967,6 @@ test_insert_lots(hid_t fapl, const H5B2_create_t *cparam, hid_t file = -1; /* File ID */ char filename[1024]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -3038,13 +3025,13 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert random records */ for(u = 0; u < INSERT_MANY; u++) { record = records[u]; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3055,7 +3042,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3076,7 +3063,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); STACK_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Check up on B-tree after re-open */ @@ -3087,7 +3074,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -3097,7 +3084,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Attempt to find non-existant record in level-4 B-tree */ /* (Should not be found, but not fail) */ idx = INSERT_MANY * 2; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Find random records */ @@ -3106,19 +3093,19 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); idx = (hsize_t)(HDrandom()%INSERT_MANY); /* Attempt to find existant record in root of level-4 B-tree */ - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR } /* end for */ /* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3131,12 +3118,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Attempt to find existant record in root of level-4 B-tree */ /* (in increasing order) */ - if(H5B2_index(bt2, dxpl, H5_ITER_INC, idx, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, idx, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to find existant record in root of level-4 B-tree */ /* (in decreasing order) */ - if(H5B2_index(bt2, dxpl, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3145,12 +3132,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TESTING("B-tree insert: attempt duplicate record in level 4 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = INSERT_MANY / 2; H5E_BEGIN_TRY { - ret = H5B2_insert(bt2, dxpl, &record); + ret = H5B2_insert(bt2, &record); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3165,7 +3152,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3182,7 +3169,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; HDfree(records); @@ -3209,7 +3196,6 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -3222,7 +3208,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* @@ -3231,47 +3217,47 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: inserting first record in empty B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record.key = 42; record.val = 72; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in B-tree with 1 record */ /* (Should not be found, but not fail) */ find.key = 10; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Try again with NULL 'op' */ /* (Should not be found, but not fail) */ - if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != FALSE) + if(H5B2_find(bt2, &find, NULL, NULL) != FALSE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to find existant record in B-tree with 1 record */ find.key = 42; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != 72) TEST_ERROR /* Try again with NULL 'op' */ find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != TRUE) + if(H5B2_find(bt2, &find, NULL, NULL) != TRUE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to index non-existant record in B-tree with 1 record */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3279,7 +3265,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with 1 record */ find.key = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 42) TEST_ERROR @@ -3295,47 +3281,47 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: update only record in B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR modify.key = 42; modify.val = 43; - if(H5B2_update(bt2, dxpl, &modify, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &modify, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in B-tree with 1 record */ /* (Should not be found, but not fail) */ find.key = 10; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Try again with NULL 'op' */ /* (Should not be found, but not fail) */ - if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != FALSE) + if(H5B2_find(bt2, &find, NULL, NULL) != FALSE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to find modified record in B-tree with 1 record */ find.key = 42; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != 43) TEST_ERROR /* Try again with NULL 'op' */ find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != TRUE) + if(H5B2_find(bt2, &find, NULL, NULL) != TRUE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to index non-existant record in B-tree with 1 record */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3344,7 +3330,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with 1 record */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 42) TEST_ERROR @@ -3360,7 +3346,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: insert several records"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* @@ -3368,7 +3354,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, */ record.key = 34; record.val = 11; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* @@ -3376,7 +3362,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, */ record.key = 56; record.val = 12; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* @@ -3384,28 +3370,28 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, */ record.key = 38; record.val = 13; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in level-0 B-tree with several records */ /* (Should not be found, but not fail) */ find.key = 10; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to find existant record in level-0 B-tree with several records */ find.key = 56; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) TEST_ERROR if(find.val != 12) TEST_ERROR /* Attempt to index non-existant record in B-tree with several records */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3414,7 +3400,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with several records */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 34) TEST_ERROR @@ -3422,7 +3408,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 38) TEST_ERROR @@ -3430,7 +3416,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 42) TEST_ERROR @@ -3438,7 +3424,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 56) TEST_ERROR @@ -3456,43 +3442,43 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, record.key = 34; modify.key = 34; modify.val = 21; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR record.key = 38; modify.key = 38; modify.val = 23; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR record.key = 42; modify.key = 42; modify.val = 24; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR record.key = 56; modify.key = 56; modify.val = 22; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in level-0 B-tree with several records */ /* (Should not be found, but not fail) */ find.key = 41; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to find existant record in level-0 B-tree with several record */ find.key = 56; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) TEST_ERROR if(find.val != 22) TEST_ERROR /* Attempt to index non-existant record in B-tree with several records */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3501,7 +3487,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with several records */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 34) TEST_ERROR @@ -3509,7 +3495,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 38) TEST_ERROR @@ -3517,7 +3503,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 42) TEST_ERROR @@ -3525,7 +3511,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 56) TEST_ERROR @@ -3533,7 +3519,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3550,7 +3536,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3579,7 +3565,6 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -3600,14 +3585,14 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records to fill root leaf node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC - 1); u++) { record.key = u + 2; record.val = u * 2 + 4; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3617,17 +3602,17 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to split root leaf node */ record.key = INSERT_SPLIT_ROOT_NREC_REC + 1; record.val = (INSERT_SPLIT_ROOT_NREC_REC - 1) * 2 + 4; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -3636,13 +3621,13 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 2; idx.val = 4; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -3650,7 +3635,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Modify all records */ @@ -3658,7 +3643,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, record.key = u + 2; modify.key = u + 2; modify.val = u * 2 + 5; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3668,13 +3653,13 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 2; idx.val = 5; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -3683,17 +3668,17 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert a couple more records, on the left side of the B-tree */ record.key = 0; record.val = 1; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = 1; record.val = 3; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -3702,18 +3687,18 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 1; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -3724,7 +3709,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* (Should not be found, but not fail) */ find.key = 800; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR @@ -3732,7 +3717,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in root of level-1 B-tree */ find.key = 33; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.key != 33) TEST_ERROR @@ -3742,7 +3727,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in leaf of level-1 B-tree */ find.key = 56; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.key != 56) TEST_ERROR @@ -3751,7 +3736,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in level-1 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3760,7 +3745,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-1 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)33, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)33, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 33) TEST_ERROR @@ -3770,7 +3755,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in left leaf of level-1 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 0) TEST_ERROR @@ -3780,7 +3765,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in right leaf of level-1 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)50, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)50, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 50) TEST_ERROR @@ -3788,7 +3773,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3802,7 +3787,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -3832,7 +3817,6 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -3849,14 +3833,14 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; record.val = u + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 10; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3866,11 +3850,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = INSERT_SPLIT_ROOT_NREC_REC; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR @@ -3878,7 +3862,7 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; u++) { record.key = u; record.val = u + 9; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3888,11 +3872,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) + (INSERT_SPLIT_ROOT_NREC_REC / 4); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3904,14 +3888,14 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: redistribute 2 leaves in level 1 B-tree (r->l)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u; record.val = u + 9; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3921,18 +3905,18 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force redistribution from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; u++) { record.key = u + INSERT_SPLIT_ROOT_NREC_REC; record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 9; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3942,11 +3926,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) + (INSERT_SPLIT_ROOT_NREC_REC / 4) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3961,7 +3945,7 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -3991,7 +3975,6 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4008,14 +3991,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u + INSERT_SPLIT_ROOT_NREC_REC; record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 10; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4025,18 +4008,18 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force left node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u; record.val = u + 10; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4046,14 +4029,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 31; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = 64; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4065,14 +4048,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: split side leaf into 2 leaves in level 1 B-tree (r->l)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u; record.val = u + 10; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4082,18 +4065,18 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force right node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u + INSERT_SPLIT_ROOT_NREC_REC; record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 10; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4103,14 +4086,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 63; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = 95; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4125,7 +4108,7 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -4157,7 +4140,6 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4175,14 +4157,14 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u + (INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1); record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4192,18 +4174,18 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (2 * INSERT_SPLIT_ROOT_NREC_REC); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force left node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4213,21 +4195,21 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert records to force middle node to redistribute */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC_REC / 2) + 1); u++) { record.key = u + INSERT_SPLIT_ROOT_NREC_REC; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4237,20 +4219,20 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 52; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = 107; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -4258,7 +4240,7 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4273,7 +4255,7 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -4304,7 +4286,6 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4322,14 +4303,14 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u + (INSERT_SPLIT_ROOT_NREC_REC * 2); record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4339,18 +4320,18 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (2 * INSERT_SPLIT_ROOT_NREC_REC) + (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force split from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 2); u++) { record.key = u; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4360,23 +4341,23 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 63; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = 95; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = 128; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -4384,7 +4365,7 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4399,7 +4380,7 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -4426,7 +4407,6 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4446,20 +4426,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) { record.key = u + 2; /* Leave a gap for later insertion */ record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) { record.key = u + 4; /* Leave a gap for later insertion */ record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4469,42 +4449,42 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 1347; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Add some extra records to left-most leaf */ record.key = 0; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = 1; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Add some extra records to middle leaf */ record.key = (INSERT_SPLIT_ROOT_NREC_REC * 9) + 2; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC * 9) + 3; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -4515,7 +4495,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* (Should not be found, but not fail) */ find.key = INSERT_SPLIT_ROOT_NREC_REC * 42; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR @@ -4523,45 +4503,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in root of level-2 B-tree */ find.key = 1347; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (1347 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 1347; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Attempt to find existant record in internal node of level-2 B-tree */ find.key = 513; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (513 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 513; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Attempt to find existant record in leaf of level-2 B-tree */ find.key = 555; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (555 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 555; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Attempt to index non-existant record in level-2 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -4570,7 +4550,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1347, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1347, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 1347) TEST_ERROR @@ -4580,7 +4560,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in internal node of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 513) TEST_ERROR @@ -4590,7 +4570,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in leaf of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 555) TEST_ERROR @@ -4598,7 +4578,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4611,20 +4591,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: make level 2 B-tree (r->l)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) { record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 1) - u; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) { record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 1) - (u +2); /* Leave a gap for later insertion */ record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4634,42 +4614,42 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 1344; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Add some extra records to right-most leaf */ record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 2; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 3; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Add some extra records to middle leaf */ record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)); record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 1; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -4680,7 +4660,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* (Should not be found, but not fail) */ find.key = INSERT_SPLIT_ROOT_NREC_REC * 42; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR @@ -4688,45 +4668,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in root of level-2 B-tree */ find.key = 1344; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (1344 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 1344; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Attempt to find existant record in internal node of level-2 B-tree */ find.key = 512; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (512 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 512; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Attempt to find existant record in leaf of level-2 B-tree */ find.key = 555; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (555 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 555; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Attempt to index non-existant record in level-2 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -4735,7 +4715,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1344, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1344, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 1344) TEST_ERROR @@ -4745,7 +4725,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in internal node of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)512, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)512, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 512) TEST_ERROR @@ -4755,7 +4735,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in leaf of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 555) TEST_ERROR @@ -4763,7 +4743,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4776,20 +4756,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: make level 2 B-tree (l+r->middle)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) { record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 3) - u; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) { record.key = u - ((INSERT_SPLIT_ROOT_NREC_REC * 9) - 2); /* Leave a gap for later insertion */ record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4799,52 +4779,52 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 1345; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Add some extra records to right-most leaf */ record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 4; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 5; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Add some extra records to middle leaf */ record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 2; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 3; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Add some extra records to left-most leaf */ record.key = 0; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = 1; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -4855,7 +4835,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* (Should not be found, but not fail) */ find.key = INSERT_SPLIT_ROOT_NREC_REC * 42; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR @@ -4863,45 +4843,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in root of level-2 B-tree */ find.key = 1345; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (1345 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 1345; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Attempt to find existant record in internal node of level-2 B-tree */ find.key = 513; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (513 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 513; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Attempt to find existant record in leaf of level-2 B-tree */ find.key = 555; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (555 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 555; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Attempt to index non-existant record in level-2 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -4910,7 +4890,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1345, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1345, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 1345) TEST_ERROR @@ -4920,7 +4900,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in internal node of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 513) TEST_ERROR @@ -4930,7 +4910,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in leaf of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 555) TEST_ERROR @@ -4938,7 +4918,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4953,7 +4933,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -4980,7 +4960,6 @@ test_update_lots(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ time_t curr_time; /* Current time, for seeding random number generator */ @@ -5033,13 +5012,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert random records */ for(u = 0; u < INSERT_MANY_REC; u++) { record = records[u]; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -5050,7 +5029,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -5064,7 +5043,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Check up on B-tree after re-open */ @@ -5076,7 +5055,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); /* Iterate over B-tree to check records have been inserted correctly */ iter.key = 0; iter.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &iter) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &iter) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -5087,7 +5066,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); /* (Should not be found, but not fail) */ find.key = INSERT_MANY_REC * 2; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR @@ -5099,7 +5078,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); find.val = (hsize_t)-1; /* Attempt to find existant record in level-4 B-tree */ - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (find.key * 2)) TEST_ERROR @@ -5107,13 +5086,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); /* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5132,7 +5111,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); /* Attempt to find existant record in level-4 B-tree */ /* (in increasing order) */ - if(H5B2_index(bt2, dxpl, H5_ITER_INC, idx, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, idx, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != idx) TEST_ERROR @@ -5145,7 +5124,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); /* Attempt to find existant record in level-4 B-tree */ /* (in decreasing order) */ - if(H5B2_index(bt2, dxpl, H5_ITER_DEC, idx, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_DEC, idx, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != (INSERT_MANY_REC - (idx + 1))) TEST_ERROR @@ -5158,13 +5137,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TESTING("B-tree update: update record in level 4 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record.key = INSERT_MANY_REC / 2; modify.key = INSERT_MANY_REC / 2; modify.val = record.key * 3; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR /* Query the number of records in the B-tree */ @@ -5176,7 +5155,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -5194,7 +5173,7 @@ error: HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; HDfree(records); @@ -5222,7 +5201,6 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -5239,7 +5217,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -5253,7 +5231,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove a record from a B-tree with no records */ record = 0; H5E_BEGIN_TRY { - ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5264,12 +5242,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: non-existant record from 1 record B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert one record into B-tree */ record = 42; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Query the number of records in the B-tree */ @@ -5291,7 +5269,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove a non-existant record from a B-tree with 1 record */ record = 0; H5E_BEGIN_TRY { - ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5303,12 +5281,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: existant record from 1 record B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 42; rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5337,21 +5315,21 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: adding records to B-tree after removal"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert several records into B-tree again */ record = 42; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = 34; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = 56; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = 38; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Query the number of records in the B-tree */ @@ -5368,12 +5346,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: non-existant record from level-0 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 0; H5E_BEGIN_TRY { - ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5385,12 +5363,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: mult. existant records from level-0 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 42; rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5415,7 +5393,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 34; rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5440,7 +5418,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 56; rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5465,7 +5443,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 38; rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5489,7 +5467,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -5504,7 +5482,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -5530,7 +5508,6 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -5548,13 +5525,13 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -5577,7 +5554,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove a non-existant record from a B-tree with 1 record */ record = (INSERT_SPLIT_ROOT_NREC * 2) + 1; H5E_BEGIN_TRY { - ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5597,22 +5574,22 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: record from right leaf of level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = (INSERT_SPLIT_ROOT_NREC * 2) - 2; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5621,10 +5598,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, /* Make certain that the leaf nodes didn't redistribute */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -5641,16 +5618,16 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: record from left leaf of level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ record = 0; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR rrecord = 1; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5659,10 +5636,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, /* Make certain that the leaf nodes didn't redistribute */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -5679,16 +5656,16 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: record from middle leaf of level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ record = INSERT_SPLIT_ROOT_NREC; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5697,10 +5674,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, /* Make certain that the leaf nodes didn't redistribute */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -5712,7 +5689,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -5727,7 +5704,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -5753,7 +5730,6 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -5770,22 +5746,22 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -5805,14 +5781,14 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove enough records from right leaf of a level-1 B-tree to force redistribution */ for(u = 0; u < 8; u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5830,10 +5806,10 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 90; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR PASSED(); @@ -5842,13 +5818,13 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: redistribute 2 leaves in level-1 B-tree (l->r)"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR for(u = 0; u < 39; u++) { record = u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5866,10 +5842,10 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 64; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 90; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR PASSED(); @@ -5878,13 +5854,13 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: redistribute 3 leaves in level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR for(u = 0; u < 2; u++) { record = INSERT_SPLIT_ROOT_NREC + 2 + u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5902,14 +5878,14 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 64; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 91; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -5924,7 +5900,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -5950,7 +5926,6 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -5967,24 +5942,24 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6004,14 +5979,14 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove enough records from right leaf of a level-1 B-tree to force redistribution */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6031,7 +6006,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 62; /* Left record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR PASSED(); @@ -6040,31 +6015,31 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: merge 2 leaves to 1 in level-1 B-tree (l->r)"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Fill B-tree back up */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Remove records */ for(u = 0; u < ((3 * INSERT_SPLIT_ROOT_NREC) / 4) - 1; u++) { record = u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6084,11 +6059,11 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 94; /* Left record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6103,7 +6078,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6129,7 +6104,6 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6146,24 +6120,24 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6183,14 +6157,14 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove enough records from middle leaf of a level-1 B-tree to force merge */ for(u = 0; u < ((5 * INSERT_SPLIT_ROOT_NREC) / 6) - 1; u++) { record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6210,11 +6184,11 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 37; /* Only record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6229,7 +6203,7 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6255,7 +6229,6 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6272,30 +6245,30 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 5 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 4); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 125; /* Center-Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 188; /* Center-Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 4; record = 220; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6315,13 +6288,13 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */ record = 220; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6330,18 +6303,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 125; /* Center-Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 188; /* Center-Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 4; record = 221; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6362,12 +6335,12 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: promote from left leaf of level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 62; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6376,18 +6349,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 63; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 125; /* Center-Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 188; /* Center-Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 4; record = 221; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6404,12 +6377,12 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: promote from middle leaf of level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 125; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6418,18 +6391,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 63; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 126; /* Center-Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 188; /* Center-Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 4; record = 221; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6441,7 +6414,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6456,7 +6429,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6482,7 +6455,6 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6499,24 +6471,24 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6536,7 +6508,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */ @@ -6545,7 +6517,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar for(u = 0; u < 7; u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6563,7 +6535,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar record = 94; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6572,12 +6544,12 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 90; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6589,7 +6561,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6604,7 +6576,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6630,7 +6602,6 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6647,24 +6618,24 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6684,7 +6655,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */ @@ -6693,7 +6664,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar for(u = 0; u < 7; u++) { record = 63 + u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6711,7 +6682,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar record = 62; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6720,12 +6691,12 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar /* Check record values in root of B-tree */ record = 39; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 86; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6737,7 +6708,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6752,7 +6723,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6778,7 +6749,6 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6795,24 +6765,24 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6832,7 +6802,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */ @@ -6841,7 +6811,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < 14; u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6859,7 +6829,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, record = 87; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6870,7 +6840,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 62; /* Middle record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6882,7 +6852,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6897,7 +6867,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6923,7 +6893,6 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6940,24 +6909,24 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6977,7 +6946,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */ @@ -6986,7 +6955,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < 50; u++) { record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7004,7 +6973,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, record = 25; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7015,7 +6984,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 37; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7027,7 +6996,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7042,7 +7011,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7068,7 +7037,6 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7085,13 +7053,13 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -7099,7 +7067,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 31; /* Middle record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7119,14 +7087,14 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove records from B-tree to force a single leaf for the B-tree */ for(u = 0; u < 14; u++) { record = INSERT_SPLIT_ROOT_NREC - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7146,7 +7114,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 0; ninfo.nrec = (uint16_t)(INSERT_SPLIT_ROOT_NREC - u); record = 31; /* Middle record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7166,7 +7134,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7181,7 +7149,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7207,7 +7175,6 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7224,24 +7191,24 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7261,20 +7228,20 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in right internal node */ ninfo.depth = 1; ninfo.nrec = 14; record = 2960; /* Record in right internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion */ record = 2960; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7285,7 +7252,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 14; record = 2961; /* Record in right internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7302,19 +7269,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: promote from left internal of level-2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in left internal node */ ninfo.depth = 1; ninfo.nrec = 29; record = 1133; /* Record in left internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR record = 1133; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7325,7 +7292,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 29; record = 1134; /* Record in left internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7342,19 +7309,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: promote from middle internal of level-2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in middle internal node */ ninfo.depth = 1; ninfo.nrec = 14; record = 2267; /* Record in middle internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR record = 2267; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7365,7 +7332,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 14; record = 2268; /* Record in middle internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7382,19 +7349,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: promote record from root of level-2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in root node */ ninfo.depth = 2; ninfo.nrec = 2; record = 1889; /* Left record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR record = 1889; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7405,7 +7372,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 2; ninfo.nrec = 2; record = 1890; /* Left record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7417,19 +7384,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in root node */ ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR record = 2834; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7440,7 +7407,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 2; ninfo.nrec = 2; record = 2835; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7452,7 +7419,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7467,7 +7434,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7493,7 +7460,6 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7510,24 +7476,24 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7547,21 +7513,21 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check status of B-tree */ ninfo.depth = 1; ninfo.nrec = 14; record = 3685; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */ for(u = 0; u < 8; u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7579,7 +7545,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * record = 3685; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7590,7 +7556,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * ninfo.depth = 1; ninfo.nrec = 14; record = 3681; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7602,7 +7568,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7617,7 +7583,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7643,7 +7609,6 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7660,24 +7625,24 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7697,21 +7662,21 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check status of B-tree */ ninfo.depth = 1; ninfo.nrec = 29; record = 62; /* Left-most record in left node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to remove record from left internal node of a level-2 B-tree to force promotion w/redistribution */ for(u = 0; u < 38; u++) { record = 63 + u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7729,7 +7694,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * record = 62; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7740,7 +7705,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * ninfo.depth = 1; ninfo.nrec = 29; record = 49; /* Left-most record in left node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7752,7 +7717,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7767,7 +7732,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7793,7 +7758,6 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7810,24 +7774,24 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7847,21 +7811,21 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in right internal node */ ninfo.depth = 1; ninfo.nrec = 14; record = 3685; /* Right-most record in right internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */ for(u = 0; u < 15; u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7880,7 +7844,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar /* Force merge by promoting current right-most record */ record = 3678; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7891,7 +7855,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar ninfo.depth = 1; ninfo.nrec = 13; record = 3653; /* Right-most record in right internal node (now) */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7903,7 +7867,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7918,7 +7882,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7944,7 +7908,6 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7961,24 +7924,24 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7998,21 +7961,21 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in left internal node */ ninfo.depth = 1; ninfo.nrec = 29; record = 62; /* Left-most record in left internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to remove record from left internal node of a level-2 B-tree to force promotion w/redistribution */ for(u = 0; u < 112; u++) { record = 48 + u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8031,7 +7994,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar /* Force merge of left-most internal nodes by promotion */ record = 25; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8042,7 +8005,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar ninfo.depth = 1; ninfo.nrec = 28; record = 37; /* Left-most record in left internal node (now) */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -8054,7 +8017,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8069,7 +8032,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -8095,7 +8058,6 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8112,24 +8074,24 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -8149,14 +8111,14 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 21) + 15); u++) { record = u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8176,11 +8138,11 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 2; ninfo.nrec = 1; record = 2834; /* Middle record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8195,7 +8157,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -8221,7 +8183,6 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8238,24 +8199,24 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -8275,14 +8236,14 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 5) + 17); u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8302,11 +8263,11 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam ninfo.depth = 2; ninfo.nrec = 1; record = 1889; /* Middle record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8321,7 +8282,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -8347,7 +8308,6 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8364,24 +8324,24 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -8401,14 +8361,14 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from middle internal node of a level-2 B-tree to force promotion w/redistribution */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 23) + 15); u++) { record = (INSERT_SPLIT_ROOT_NREC * 20) + u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8428,11 +8388,11 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 2; ninfo.nrec = 1; record = 1196; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8447,7 +8407,7 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -8473,7 +8433,6 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8491,24 +8450,24 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -8528,14 +8487,14 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove records from a level-2 B-tree to force back to level-1 */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 34) + 17; u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8558,7 +8517,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8573,7 +8532,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -8599,7 +8558,6 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ hsize_t record; /* Record to insert into tree */ unsigned u; /* Local index variable */ @@ -8618,13 +8576,13 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, bt2_addr) < 0) TEST_ERROR /* Insert random records */ for(u = 0; u < INSERT_MANY; u++) { record = records[u]; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -8635,7 +8593,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8648,7 +8606,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; @@ -8680,7 +8638,6 @@ test_remove_lots(const char *env_h5_drvr, hid_t fapl, const H5B2_create_t *cpara int fd = -1; /* File descriptor */ h5_stat_t sb; /* Stat buffer for file */ void *file_data = NULL; /* Copy of file data */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8784,14 +8741,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); } /* end for */ /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Remove all records */ for(u = 0; u < INSERT_MANY; u++) { record = records[u]; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8816,7 +8773,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8868,7 +8825,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); STACK_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Remove all records */ @@ -8878,7 +8835,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); rrecord = HSIZET_MAX; /* Remove random record */ - if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_INC, (hsize_t)rem_idx, remove_cb, &rrecord) < 0) + if(H5B2_remove_by_idx(bt2, H5_ITER_INC, (hsize_t)rem_idx, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8903,7 +8860,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8956,14 +8913,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); STACK_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Remove all records */ for(u = 0; u < INSERT_MANY; u++) { /* Remove first record */ rrecord = HSIZET_MAX; - if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_INC, (hsize_t)0, remove_cb, &rrecord) < 0) + if(H5B2_remove_by_idx(bt2, H5_ITER_INC, (hsize_t)0, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8988,7 +8945,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -9041,14 +8998,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); STACK_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Remove all records */ for(u = 0; u < INSERT_MANY; u++) { /* Remove last record */ rrecord = HSIZET_MAX; - if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_DEC, (hsize_t)0, remove_cb, &rrecord) < 0) + if(H5B2_remove_by_idx(bt2, H5_ITER_DEC, (hsize_t)0, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -9073,7 +9030,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -9093,7 +9050,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; @@ -9128,7 +9085,6 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -9156,45 +9112,45 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records */ for(u = 0; u < FIND_NEIGHBOR; u++) { record = records[u]; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Attempt to find record B-tree less than a value */ search = 0; H5E_BEGIN_TRY { - ret = H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record); + ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR search = 1; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 0) TEST_ERROR search = 2; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 0) TEST_ERROR search = 3; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR search = 4; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR @@ -9203,12 +9159,12 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 14; record = 250; /* Record in left internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Neighbor is in internal node */ search = 251; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 250) TEST_ERROR @@ -9217,18 +9173,18 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 2; ninfo.nrec = 1; record = 1888; /* Record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Neighbor is in root node */ search = 1889; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 1888) TEST_ERROR search = (FIND_NEIGHBOR * 2) + 1; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != ((FIND_NEIGHBOR - 1) * 2)) TEST_ERROR @@ -9241,38 +9197,38 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree find: nearest neighbor greater than a value"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to find record B-tree less than a value */ search = (FIND_NEIGHBOR * 2) + 1; H5E_BEGIN_TRY { - ret = H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record); + ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR search = 0; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR search = 1; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR search = 2; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 4) TEST_ERROR search = 3; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 4) TEST_ERROR @@ -9281,31 +9237,31 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 16; record = 2896; /* Record in right internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Neighbor is in internal node */ search = 2895; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2896) TEST_ERROR /* Neighbor is in root node */ search = 1887; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 1888) TEST_ERROR search = ((FIND_NEIGHBOR - 1) * 2) - 1; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != ((FIND_NEIGHBOR - 1) * 2)) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -9322,7 +9278,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; HDfree(records); @@ -9352,7 +9308,6 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size; /* Size of an empty file */ h5_stat_size_t file_size; /* Size of each file created */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -9391,18 +9346,18 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; /* * Delete v2 B-tree */ - if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0) + if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -9435,13 +9390,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records */ for(u = 0; u < DELETE_SMALL; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -9452,14 +9407,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; /* * Delete v2 B-tree */ - if(H5B2_delete(f, H5AC_ind_read_dxpl_id, bt2_addr, f, NULL, NULL) < 0) + if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0) FAIL_STACK_ERROR /* Close file */ @@ -9492,13 +9447,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records */ for(u = 0; u < DELETE_MEDIUM; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -9509,14 +9464,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; /* * Delete v2 B-tree */ - if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0) + if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0) FAIL_STACK_ERROR /* Close file */ @@ -9549,13 +9504,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records */ for(u = 0; u < DELETE_LARGE; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -9566,14 +9521,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; /* * Delete v2 B-tree */ - if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0) + if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0) FAIL_STACK_ERROR /* Close file */ @@ -9595,7 +9550,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -9622,7 +9577,6 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -9643,13 +9597,13 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u * 5; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -9663,7 +9617,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 3; modify = 4; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9674,33 +9628,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree modify: modify record in leaf node"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check status of B-tree */ ninfo.depth = 0; ninfo.nrec = 62; record = 4330; /* Record in leaf node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to modify a record in a leaf node */ record = 4330; modify = 4331; - if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0) + if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0) FAIL_STACK_ERROR /* Check status of B-tree */ ninfo.depth = 0; ninfo.nrec = 62; record = 4331; /* Record in leaf node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to find modified record */ record = 4331; found = 4331; - if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE) + if(H5B2_find(bt2, &record, find_cb, &found) != TRUE) FAIL_STACK_ERROR if(found != 4331) TEST_ERROR @@ -9709,7 +9663,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 4330; found = HSIZET_MAX; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9720,33 +9674,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree modify: modify record in internal node"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check status of B-tree */ ninfo.depth = 1; ninfo.nrec = 29; record = 5350; /* Record in internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to modify a record in an internal node */ record = 5350; modify = 5352; - if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0) + if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0) FAIL_STACK_ERROR /* Check status of B-tree */ ninfo.depth = 1; ninfo.nrec = 29; record = 5352; /* Record in internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to find modified record */ record = 5352; found = 5352; - if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE) + if(H5B2_find(bt2, &record, find_cb, &found) != TRUE) STACK_ERROR if(found != 5352) TEST_ERROR @@ -9755,7 +9709,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 5350; found = 5350; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9766,33 +9720,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree modify: modify record in root node"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check status of B-tree */ ninfo.depth = 2; ninfo.nrec = 2; record = 9445; /* Record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to modify a record in a root node */ record = 9445; modify = 9448; - if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0) + if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0) FAIL_STACK_ERROR /* Check status of B-tree */ ninfo.depth = 2; ninfo.nrec = 2; record = 9448; /* Record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to find modified record */ record = 9448; found = 9448; - if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE) + if(H5B2_find(bt2, &record, find_cb, &found) != TRUE) STACK_ERROR if(found != 9448) TEST_ERROR @@ -9801,14 +9755,14 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 9445; found = 9445; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -9823,7 +9777,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -9856,7 +9810,6 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) hid_t file00 = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ H5F_t *f2 = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ H5B2_t *bt2_2 = NULL; /* Second v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ @@ -9881,15 +9834,15 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) FAIL_STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2_2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2_2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Close the second v2 B-tree wrapper */ - if(H5B2_close(bt2_2, dxpl) < 0) + if(H5B2_close(bt2_2) < 0) FAIL_STACK_ERROR bt2_2 = NULL; @@ -9901,7 +9854,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) FAIL_STACK_ERROR /* Close the first v2 B-tree wrapper */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -9931,7 +9884,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) FAIL_STACK_ERROR /* Open the B-tree through the second file handle */ - if(NULL == (bt2_2 = H5B2_open(f2, dxpl, bt2_addr, f2))) + if(NULL == (bt2_2 = H5B2_open(f2, bt2_addr, f2))) FAIL_STACK_ERROR /* Close the extra file handles */ @@ -9941,7 +9894,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) FAIL_STACK_ERROR /* Close the second v2 B-tree */ - if(H5B2_close(bt2_2, dxpl) < 0) + if(H5B2_close(bt2_2) < 0) FAIL_STACK_ERROR bt2_2 = NULL; @@ -9958,9 +9911,9 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); if(bt2) - H5B2_close(bt2_2, dxpl); + H5B2_close(bt2_2); H5Fclose(file); H5Fclose(file2); H5Fclose(file0); @@ -9994,6 +9947,7 @@ main(void) unsigned reopen; /* Whether to reopen B-tree during tests */ int ExpressMode; const char *envval = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ envval = HDgetenv("HDF5_DRIVER"); if(envval == NULL) @@ -10008,6 +9962,8 @@ main(void) /* Initialize v2 B-tree creation parameters */ init_cparam(&cparam, &cparam2); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Loop over re-opening B-tree during tests */ for(reopen = FALSE; reopen <= TRUE; reopen++) { @@ -10096,6 +10052,8 @@ main(void) /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; diff --git a/test/cache.c b/test/cache.c index 97a1b91..d5e3c6c 100644 --- a/test/cache.c +++ b/test/cache.c @@ -3309,7 +3309,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) { @@ -3320,7 +3320,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -3331,7 +3331,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_CLEAR_ONLY_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG); if(result < 0) { @@ -3343,7 +3343,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_MARKED_ENTRIES_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_MARKED_ENTRIES_FLAG); if(result < 0) { @@ -5014,7 +5014,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags); + result = H5C_flush_cache(file_ptr, flush_flags); if(result < 0) { @@ -5088,7 +5088,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -5245,7 +5245,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags); + result = H5C_flush_cache(file_ptr, flush_flags); if(result < 0) { @@ -5319,7 +5319,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -9322,7 +9322,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags); + result = H5C_flush_cache(file_ptr, flush_flags); if(result < 0) { @@ -9514,7 +9514,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -10793,7 +10793,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -12522,7 +12522,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags); + result = H5C_flush_cache(file_ptr, flush_flags); if(result < 0) { @@ -12581,7 +12581,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -12714,7 +12714,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags); + result = H5C_flush_cache(file_ptr, flush_flags); if(result < 0) { @@ -12789,7 +12789,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -14351,7 +14351,7 @@ check_resize_entry(unsigned paged) } else { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result < 0) { @@ -14436,7 +14436,7 @@ check_resize_entry(unsigned paged) } else { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result < 0) { @@ -14796,7 +14796,7 @@ check_resize_entry(unsigned paged) } else { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result < 0) { @@ -14883,7 +14883,7 @@ check_resize_entry(unsigned paged) } else { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result < 0) { @@ -15956,7 +15956,7 @@ check_flush_protected_err(unsigned paged) protect_entry(file_ptr, 0, 0); - if(H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET) >= 0) { + if(H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET) >= 0) { pass = FALSE; failure_mssg = "flush succeeded on cache with protected entry.\n"; @@ -15965,7 +15965,7 @@ check_flush_protected_err(unsigned paged) unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); - if(H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET) < 0) { + if(H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET) < 0) { pass = FALSE; failure_mssg = "flush failed after unprotect.\n"; @@ -16032,19 +16032,19 @@ check_destroy_pinned_err(unsigned paged) 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) < 0) { pass = FALSE; failure_mssg = "unexpected failure of prep for file close.\n"; } /* end if */ - if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) >= 0) { + if(H5C_dest(file_ptr) >= 0) { pass = FALSE; failure_mssg = "destroy succeeded on cache with pinned entry.\n"; } /* end if */ else { unpin_entry(0, 0); - if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) < 0) { + if(H5C_dest(file_ptr) < 0) { pass = FALSE; failure_mssg = "destroy failed after unpin.\n"; } /* end if */ @@ -16122,20 +16122,20 @@ check_destroy_protected_err(unsigned paged) * 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) < 0) { pass = FALSE; failure_mssg = "unexpected failure of prep for file close.\n"; } /* end if */ protect_entry(file_ptr, 0, 0); - if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) >= 0) { + if(H5C_dest(file_ptr) >= 0) { pass = FALSE; failure_mssg = "destroy succeeded on cache with protected entry.\n"; } /* end if */ else { unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); - if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) < 0) { + if(H5C_dest(file_ptr) < 0) { pass = FALSE; failure_mssg = "destroy failed after unprotect.\n"; } /* end if */ @@ -16215,7 +16215,7 @@ check_duplicate_insert_err(unsigned paged) base_addr = entries[0]; entry_ptr = &(base_addr[0]); - result = H5C_insert_entry(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_insert_entry(file_ptr, types[0], entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET); @@ -16301,7 +16301,7 @@ check_double_pin_err(unsigned paged) if(pass) { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__PIN_ENTRY_FLAG); if(result > 0) { @@ -16387,7 +16387,7 @@ check_double_unpin_err(unsigned paged) if(pass) { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__UNPIN_ENTRY_FLAG); if(result > 0) { @@ -16591,7 +16591,7 @@ check_double_protect_err(unsigned paged) if(pass) { - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[0], entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); @@ -16673,7 +16673,7 @@ check_double_unprotect_err(unsigned paged) if(pass) { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16841,7 +16841,7 @@ check_expunge_entry_errs(unsigned paged) if(pass) { - result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_expunge_entry(file_ptr, types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16859,7 +16859,7 @@ check_expunge_entry_errs(unsigned paged) if(pass) { - result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_expunge_entry(file_ptr, types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16877,7 +16877,7 @@ check_expunge_entry_errs(unsigned paged) if(pass) { - result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_expunge_entry(file_ptr, types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result < 0) { @@ -17174,7 +17174,7 @@ check_unprotect_ro_dirty_err(unsigned paged) if(pass) { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result >= 0) { @@ -17216,7 +17216,7 @@ check_unprotect_ro_dirty_err(unsigned paged) if(pass) { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result > 0) { @@ -17303,7 +17303,7 @@ check_protect_ro_rw_err(unsigned paged) if(pass) { - thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, + thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[0], entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); @@ -17398,7 +17398,7 @@ check_protect_retries(unsigned paged) entry_ptr->max_verify_ct = 3; entry_ptr->verify_ct = 0; - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); if((cache_entry_ptr != (void *)entry_ptr) || @@ -17443,7 +17443,7 @@ check_protect_retries(unsigned paged) entry_ptr->max_verify_ct = 11; entry_ptr->verify_ct = 0; - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); /* H5C_protect() should fail after all retries fail */ @@ -31018,7 +31018,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31124,7 +31124,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31236,7 +31236,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31355,7 +31355,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31531,7 +31531,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31741,7 +31741,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31899,7 +31899,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -32033,7 +32033,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -32226,7 +32226,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -32465,7 +32465,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -32722,7 +32722,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -33009,7 +33009,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -33325,7 +33325,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -34663,7 +34663,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -35015,7 +35015,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -35451,7 +35451,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -35838,7 +35838,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -36311,7 +36311,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { diff --git a/test/cache_common.c b/test/cache_common.c index cadccec..78e2253 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -17,6 +17,7 @@ * This file contains common code for tests of the cache * implemented in H5C.c */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5MFprivate.h" #include "H5MMprivate.h" #include "cache_common.h" @@ -129,37 +130,37 @@ static herr_t monster_image_len(const void *thing, size_t *image_len_ptr); static herr_t variable_image_len(const void *thing, size_t *image_len_ptr); static herr_t notify_image_len(const void *thing, size_t *image_len_ptr); -static herr_t pico_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t pico_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t nano_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t nano_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t micro_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t micro_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t tiny_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t tiny_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t small_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t small_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t medium_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t medium_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t large_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t large_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t huge_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t huge_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t monster_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t monster_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t variable_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t variable_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t notify_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t notify_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); @@ -212,7 +213,7 @@ static herr_t get_final_load_size(const void *image, size_t image_len, static void *deserialize(const void *image_ptr, size_t len, void *udata_ptr, hbool_t *dirty_ptr, int32_t entry_type); static herr_t image_len(const void *thing, size_t *image_len_ptr, int32_t entry_type); -static herr_t pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t serialize(const H5F_t *f, void *image_ptr, size_t len, @@ -1123,7 +1124,6 @@ notify_image_len(const void *thing, size_t *image_length) */ herr_t pre_serialize(H5F_t *f, - hid_t H5_ATTR_UNUSED dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1208,7 +1208,6 @@ pre_serialize(H5F_t *f, herr_t pico_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1216,13 +1215,12 @@ pico_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t nano_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1230,13 +1228,12 @@ nano_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t micro_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1244,13 +1241,12 @@ micro_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t tiny_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1258,13 +1254,12 @@ tiny_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t small_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1272,13 +1267,12 @@ small_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t medium_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1286,13 +1280,12 @@ medium_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t large_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1300,13 +1293,12 @@ large_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t huge_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1314,13 +1306,12 @@ huge_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t monster_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1328,13 +1319,12 @@ monster_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t variable_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1342,13 +1332,12 @@ variable_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t notify_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1356,7 +1345,7 @@ notify_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -3278,6 +3267,7 @@ setup_cache(size_t max_cache_size, HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC); } /* end if */ } /* end if */ +H5CX_push(); if(show_progress) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -3379,8 +3369,7 @@ setup_cache(size_t max_cache_size, FUNC, mile_stone++, (int)pass); if(pass) { /* allocate space for test entries */ - actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5AC_ind_read_dxpl_id, - (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); + actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); if(actual_base_addr == HADDR_UNDEF) { pass = FALSE; @@ -3455,7 +3444,7 @@ takedown_cache(H5F_t * file_ptr, H5C_stats(cache_ptr, "test cache", dump_detailed_stats); } - if ( H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { + if ( H5C_prep_for_file_close(file_ptr) < 0 ) { pass = FALSE; failure_mssg = "unexpected failure of prep for file close.\n"; @@ -3463,7 +3452,7 @@ takedown_cache(H5F_t * file_ptr, flush_cache(file_ptr, TRUE, FALSE, FALSE); - H5C_dest(file_ptr, H5AC_ind_read_dxpl_id); + H5C_dest(file_ptr); if ( saved_cache != NULL ) { @@ -3493,7 +3482,7 @@ takedown_cache(H5F_t * file_ptr, HDassert ( file_ptr ); } - H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, H5AC_ind_read_dxpl_id, saved_actual_base_addr, + H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, saved_actual_base_addr, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); saved_actual_base_addr = HADDR_UNDEF; } @@ -3508,6 +3497,7 @@ takedown_cache(H5F_t * file_ptr, saved_fid = -1; } +H5CX_pop(); if ( ( ! try_core_file_driver ) || ( core_file_driver_failed ) ) { @@ -3582,8 +3572,7 @@ expunge_entry(H5F_t * file_ptr, HDassert( ! ( entry_ptr->header.is_pinned ) ); 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); + result = H5C_expunge_entry(file_ptr, types[type], entry_ptr->addr, H5C__NO_FLAGS_SET); if ( result < 0 ) { @@ -3634,12 +3623,10 @@ flush_cache(H5F_t * file_ptr, cache_ptr = file_ptr->shared->cache; if(destroy_entries) - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); else - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, - H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(dump_stats) H5C_stats(cache_ptr, "test cache", dump_detailed_stats); @@ -3767,7 +3754,6 @@ insert_entry(H5F_t * file_ptr, { H5C_t * cache_ptr; herr_t result; - hid_t xfer = H5AC_ind_read_dxpl_id; hbool_t insert_pinned; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3798,13 +3784,9 @@ insert_entry(H5F_t * file_ptr, /* Set the base address of the entry type into the property list as tag */ /* Use to cork entries for the object */ - if(H5AC_tag(xfer, baddrs, NULL) < 0) { - pass = FALSE; - failure_mssg = "error in H5P_set()."; - } + H5AC_tag(baddrs, NULL); - result = H5C_insert_entry(file_ptr, xfer, - types[type], entry_ptr->addr, (void *)entry_ptr, flags); + result = H5C_insert_entry(file_ptr, types[type], entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( entry_ptr->header.is_protected ) || @@ -4050,7 +4032,6 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) test_entry_t * base_addr; test_entry_t * entry_ptr; haddr_t baddrs; - hid_t xfer = H5AC_ind_read_dxpl_id; H5C_cache_entry_t * cache_entry_ptr; if(pass) { @@ -4071,12 +4052,9 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) /* Set the base address of the entry type into the property list as tag */ /* Use to cork entries for the object */ - if(H5AC_tag(xfer, baddrs, NULL) < 0) { - pass = FALSE; - failure_mssg = "error in H5P_set()."; - } /* end if */ + H5AC_tag(baddrs, NULL); - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, xfer, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); @@ -4180,7 +4158,7 @@ protect_entry_ro(H5F_t * file_ptr, ( ( entry_ptr->is_read_only ) && ( entry_ptr->ro_ref_count > 0 ) ) ); - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); if ( ( cache_entry_ptr != (void *)entry_ptr ) || @@ -4396,8 +4374,7 @@ unprotect_entry(H5F_t * file_ptr, mark_flush_dep_dirty(entry_ptr); } /* end if */ - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, - entry_ptr->addr, (void *)entry_ptr, flags); + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( ( entry_ptr->header.is_protected ) && diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 9c79968..15ce6c2 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -22,6 +22,7 @@ #include "testhdf5.h" #include "cache_common.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5HLprivate.h" /* ============ */ @@ -349,7 +350,7 @@ evict_entries(hid_t fid) /* Evict all we can from the cache to examine full tag creation tree */ /* This function will likely return failure since the root group * is still protected. Thus, don't check its return value. */ - H5C_flush_cache(f, H5P_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); + H5C_flush_cache(f, H5C__FLUSH_INVALIDATE_FLAG); return 0; @@ -3635,9 +3636,9 @@ check_invalid_tag_application(void) /* Variables */ H5F_t * f = NULL; hid_t fid = -1; - hid_t dxpl_id = -1; haddr_t addr; H5HL_t * lheap = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ #endif /* H5C_DO_TAGGING_SANITY_CHECKS */ /* Testing Macro */ @@ -3646,38 +3647,39 @@ check_invalid_tag_application(void) #if H5C_DO_TAGGING_SANITY_CHECKS /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; +if(H5CX_push() < 0) TEST_ERROR +api_ctx_pushed = TRUE; /* Get internal file pointer*/ if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; - /* Create dxpl */ - if ( (dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; - /* Call H5HL_create, an internal function that calls H5AC_insert_entry without setting up a tag */ /* Ensure this returns FAILURE, as a tag has not been set up. */ - if ( H5HL_create(f, H5AC_ind_read_dxpl_id, (size_t)1024, &addr) >= 0) TEST_ERROR; + if ( H5HL_create(f, (size_t)1024, &addr) >= 0) TEST_ERROR; - /* Now set up a tag in the dxpl */ - if ( H5AC_tag(H5AC_ind_read_dxpl_id, (haddr_t)25, NULL) < 0) TEST_ERROR; + /* Now set up a tag in the API context */ + H5AC_tag((haddr_t)25, NULL); /* Verify the same call to H5HL_create now works as intended, with a tag set up. */ - if ( H5HL_create(f, H5AC_ind_read_dxpl_id, (size_t)1024, &addr) < 0) TEST_ERROR; + if ( H5HL_create(f, (size_t)1024, &addr) < 0) TEST_ERROR; - /* Reset dxpl to use invalid tag. */ - if ( H5AC_tag(H5AC_ind_read_dxpl_id, H5AC__INVALID_TAG, NULL) < 0) TEST_ERROR; + /* Reset API context to use invalid tag. */ + H5AC_tag(H5AC__INVALID_TAG, NULL); /* Call H5HL_protect to protect the local heap created above. */ /* This should fail as no tag is set up during the protect call */ - if (( lheap = H5HL_protect(f, H5AC_ind_read_dxpl_id, addr, H5AC__NO_FLAGS_SET)) != NULL ) TEST_ERROR; + if (( lheap = H5HL_protect(f, addr, H5AC__NO_FLAGS_SET)) != NULL ) TEST_ERROR; /* Again, set up a valid tag in the DXPL */ - if ( H5AC_tag(H5AC_ind_read_dxpl_id, (haddr_t)25, NULL) < 0) TEST_ERROR; + H5AC_tag((haddr_t)25, NULL); /* Call H5HL_protect again to protect the local heap. This should succeed. */ - if (( lheap = H5HL_protect(f, H5AC_ind_read_dxpl_id, addr, H5AC__NO_FLAGS_SET)) == NULL ) TEST_ERROR; + if (( lheap = H5HL_protect(f, addr, H5AC__NO_FLAGS_SET)) == NULL ) TEST_ERROR; /* Now unprotect the heap, as we're done with the test. */ if ( H5HL_unprotect(lheap) < 0 ) TEST_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) TEST_ERROR +api_ctx_pushed = FALSE; /* Close open objects and file */ if ( H5Fclose(fid) < 0 ) TEST_ERROR; @@ -3692,6 +3694,10 @@ check_invalid_tag_application(void) return 0; error: +#if H5C_DO_TAGGING_SANITY_CHECKS +if(api_ctx_pushed) H5CX_pop(); +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ + return 1; } /* check_invalid_tag_application */ diff --git a/test/dsets.c b/test/dsets.c index 0fff2d1..472c588 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -1915,6 +1915,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(H5Dclose (dataset) < 0) goto error; if(H5Sclose (sid) < 0) goto error; if(H5Pclose (dxpl) < 0) goto error; + if(H5Pclose (write_dxpl) < 0) goto error; HDfree (tconv_buf); return(0); @@ -2423,8 +2424,9 @@ test_missing_filter(hid_t file) goto error; } /* end if */ - /* Unregister deflate filter (use internal function) */ - if(H5Z_unregister(H5Z_FILTER_DEFLATE) < 0) { + /* Unregister deflate filter */ + /* (Use private routine, to avoid range checking on filter ID) */ + if(H5Z__unregister(H5Z_FILTER_DEFLATE) < 0) { H5_FAILED(); printf(" Line %d: Can't unregister deflate filter\n",__LINE__); goto error; diff --git a/test/earray.c b/test/earray.c index 1058565..0605605 100644 --- a/test/earray.c +++ b/test/earray.c @@ -25,6 +25,7 @@ #include "H5EApkg.h" /* Extensible Arrays */ /* Other private headers that this test requires */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" /* IDs */ #include "H5VMprivate.h" /* Vectors and arrays */ @@ -406,7 +407,7 @@ error: *------------------------------------------------------------------------- */ static int -reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, +reopen_file(hid_t *file, H5F_t **f, hid_t fapl, H5EA_t **ea, haddr_t ea_addr, const earray_test_param_t *tparam) { /* Check for closing & re-opening the array */ @@ -414,7 +415,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, if(tparam->reopen_array) { /* Close array, if given */ if(ea && *ea) { - if(H5EA_close(*ea, dxpl) < 0) + if(H5EA_close(*ea) < 0) FAIL_STACK_ERROR *ea = NULL; } /* end if */ @@ -441,7 +442,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, /* Re-open array, if given */ if(ea) - if(NULL == (*ea = H5EA_open(*f, dxpl, ea_addr, NULL))) + if(NULL == (*ea = H5EA_open(*f, ea_addr, NULL))) FAIL_STACK_ERROR } /* end if */ @@ -467,14 +468,14 @@ error: *------------------------------------------------------------------------- */ static int -create_array(H5F_t *f, hid_t dxpl, const H5EA_create_t *cparam, +create_array(H5F_t *f, const H5EA_create_t *cparam, H5EA_t **ea, haddr_t *ea_addr, H5EA__ctx_cb_t *cb) { hsize_t nelmts; /* Number of elements in array */ earray_state_t state; /* State of extensible array */ /* Create array */ - if(NULL == (*ea = H5EA_create(f, dxpl, cparam, cb))) + if(NULL == (*ea = H5EA_create(f, cparam, cb))) FAIL_STACK_ERROR /* Check status of array */ @@ -555,7 +556,7 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5EA_t *ea, haddr_t ea_addr) h5_stat_size_t file_size; /* File size, after deleting array */ /* Close the extensible array */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR #ifdef QAK @@ -565,7 +566,7 @@ HDsystem("cp earray.h5 earray.h5.save"); #endif /* QAK */ /* Delete array */ - if(H5EA_delete(f, H5AC_ind_read_dxpl_id, ea_addr, NULL) < 0) + if(H5EA_delete(f, ea_addr, NULL) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -627,11 +628,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.raw_elmt_size = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -642,11 +643,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_nelmts_bits = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -656,11 +657,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_nelmts_bits = 65; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -671,11 +672,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.sup_blk_min_data_ptrs = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -684,11 +685,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.sup_blk_min_data_ptrs = 1; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -697,11 +698,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.sup_blk_min_data_ptrs = 6; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -712,11 +713,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.data_blk_min_elmts = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -728,11 +729,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -742,11 +743,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_dblk_page_nelmts_bits = 4; /* corresponds to 16 elements in data block page, which is less than the 64 elements for the default settings */ H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -755,11 +756,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(test_cparam.max_nelmts_bits + 1); H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -779,7 +780,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE TESTING("extensible array creation"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR PASSED() @@ -803,7 +804,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); H5Fclose(file); } H5E_END_TRY; @@ -842,19 +843,19 @@ test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TESTING("create, close & reopen extensible array"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Close the extensible array */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0) + if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0) TEST_ERROR /* Re-open the array */ - if(NULL == (ea = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -873,7 +874,7 @@ test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); H5Fclose(file); } H5E_END_TRY; @@ -915,11 +916,11 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TESTING("open extensible array twice"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Open the array again, through the first file handle */ - if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -929,12 +930,12 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* Close the second extensible array wrapper */ - if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea2) < 0) FAIL_STACK_ERROR ea2 = NULL; /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Re-open the file */ @@ -946,7 +947,7 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) FAIL_STACK_ERROR /* Open the extensible array through the second file handle */ - if(NULL == (ea2 = H5EA_open(f2, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f2, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -954,7 +955,7 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* Close the first extensible array wrapper */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR ea = NULL; @@ -977,9 +978,9 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); if(ea2) - H5EA_close(ea2, H5AC_ind_read_dxpl_id); + H5EA_close(ea2); H5Fclose(file); H5Fclose(file2); } H5E_END_TRY; @@ -1027,11 +1028,11 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa TESTING("open extensible array twice, through different file handles"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Open the array again, through the first file handle */ - if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -1041,7 +1042,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa TEST_ERROR /* Close the second extensible array wrapper */ - if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea2) < 0) FAIL_STACK_ERROR ea2 = NULL; @@ -1053,7 +1054,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa FAIL_STACK_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -1061,7 +1062,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa TEST_ERROR /* Close the first extensible array wrapper */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR ea = NULL; @@ -1092,7 +1093,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa FAIL_STACK_ERROR /* Open the extensible array through the second file handle */ - if(NULL == (ea2 = H5EA_open(f2, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f2, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -1117,9 +1118,9 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); if(ea2) - H5EA_close(ea2, H5AC_ind_read_dxpl_id); + H5EA_close(ea2); H5Fclose(file); H5Fclose(file2); H5Fclose(file0); @@ -1163,15 +1164,15 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TESTING("deleting open extensible array"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Open the array again */ - if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Request that the array be deleted */ - if(H5EA_delete(f, H5AC_ind_read_dxpl_id, ea_addr, NULL) < 0) + if(H5EA_delete(f, ea_addr, NULL) < 0) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -1181,38 +1182,38 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* Close the second extensible array wrapper */ - if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea2) < 0) FAIL_STACK_ERROR ea2 = NULL; /* Try re-opening the array again (should fail, as array will be deleted) */ H5E_BEGIN_TRY { - ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL); + ea2 = H5EA_open(f, ea_addr, NULL); } H5E_END_TRY; if(ea2) { /* Close opened array */ - H5EA_close(ea2, H5AC_ind_read_dxpl_id); + H5EA_close(ea2); /* Indicate error */ TEST_ERROR } /* end if */ /* Close the first extensible array wrapper */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR ea = NULL; /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0) + if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0) TEST_ERROR /* Try re-opening the array again (should fail, as array is now deleted) */ H5E_BEGIN_TRY { - ea = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL); + ea = H5EA_open(f, ea_addr, NULL); } H5E_END_TRY; if(ea) { /* Close opened array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); /* Indicate error */ TEST_ERROR @@ -1238,9 +1239,9 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); if(ea2) - H5EA_close(ea2, H5AC_ind_read_dxpl_id); + H5EA_close(ea2); H5Fclose(file); } H5E_END_TRY; @@ -2111,7 +2112,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -2119,7 +2120,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Verify high-water # of elements written */ @@ -2150,7 +2151,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2178,7 +2179,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2187,7 +2188,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Set element of array */ welmt = (uint64_t)7 + idx; - if(H5EA_set(ea, H5AC_ind_read_dxpl_id, idx, &welmt) < 0) + if(H5EA_set(ea, idx, &welmt) < 0) FAIL_STACK_ERROR /* Get the max. array index */ @@ -2215,7 +2216,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (set now) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is value written */ @@ -2239,7 +2240,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); H5Fclose(file); } H5E_END_TRY; @@ -2285,7 +2286,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -2293,7 +2294,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Verify high-water # of elements written */ @@ -2314,7 +2315,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2323,7 +2324,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Set element of array */ welmt = (uint64_t)7 + idx; - if(H5EA_set(ea, H5AC_ind_read_dxpl_id, idx, &welmt) < 0) + if(H5EA_set(ea, idx, &welmt) < 0) FAIL_STACK_ERROR /* Verify high-water # of elements written */ @@ -2365,7 +2366,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (set now) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is value written */ @@ -2376,7 +2377,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, for(cnt = 0; cnt < skip_elmts; cnt++) { /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, cnt, &relmt) < 0) + if(H5EA_get(ea, cnt, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2396,7 +2397,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); H5Fclose(file); } H5E_END_TRY; @@ -2428,6 +2429,7 @@ main(void) unsigned nerrors = 0; /* Cumulative error count */ time_t curr_time; /* Current time, for seeding random number generator */ int ExpressMode; /* Test express value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Reset library */ h5_reset(); @@ -2438,6 +2440,8 @@ main(void) /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g)); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Seed random #'s */ curr_time = HDtime(NULL); @@ -2584,6 +2588,8 @@ main(void) /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; diff --git a/test/efc.c b/test/efc.c index bd008c8..a9ed3e5 100644 --- a/test/efc.c +++ b/test/efc.c @@ -18,6 +18,7 @@ #define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "H5Fpkg.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" const char *FILENAME[] = { @@ -37,7 +38,6 @@ static char filename[6][1024]; * internal functions */ hid_t fcpl_id = -1; hid_t fapl_id = -1; -hid_t dxpl_id = -1; /*------------------------------------------------------------------------- @@ -75,8 +75,7 @@ test_single(void) /* Open parent file */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR /* Disable EFC for child files */ @@ -88,17 +87,15 @@ test_single(void) * count = 2, release EFC, verify ref count = 1. Verifies a file can be * held open by the EFC. */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR @@ -110,14 +107,12 @@ test_single(void) * level file pointer. Open file 1 through EFC, close, open again, verify * file pointers are the same. */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR ftmp1 = f1; if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1 != ftmp1) TEST_ERROR @@ -125,7 +120,7 @@ test_single(void) TEST_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR @@ -134,25 +129,21 @@ test_single(void) * order. Open each file normally after closing through EFC the first time * to track ref counts. */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 2) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR - if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 2) TEST_ERROR @@ -160,13 +151,11 @@ test_single(void) TEST_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 2) TEST_ERROR @@ -176,13 +165,11 @@ test_single(void) TEST_ERROR if(NULL == (f4 = H5F_efc_open(f0, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f4) < 0) FAIL_STACK_ERROR - if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -193,8 +180,7 @@ test_single(void) if(f4->shared->nrefs != 2) TEST_ERROR - if(NULL == (ftmp3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (ftmp3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp3) < 0) FAIL_STACK_ERROR @@ -207,8 +193,7 @@ test_single(void) if(f4->shared->nrefs != 2) TEST_ERROR - if(NULL == (ftmp2 = H5F_efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (ftmp2 = H5F_efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp2) < 0) FAIL_STACK_ERROR @@ -221,8 +206,7 @@ test_single(void) if(f4->shared->nrefs != 2) TEST_ERROR - if(NULL == (ftmp1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (ftmp1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp1) < 0) FAIL_STACK_ERROR @@ -235,8 +219,7 @@ test_single(void) if(f4->shared->nrefs != 1) TEST_ERROR - if(NULL == (ftmp4 = H5F_efc_open(f0, filename[4], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (ftmp4 = H5F_efc_open(f0, filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp4) < 0) FAIL_STACK_ERROR @@ -249,7 +232,7 @@ test_single(void) if(f4->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -270,17 +253,15 @@ test_single(void) /* Test 4: Verify that files kept open through the EFC are not evicted by - * H5F_efc_release(). */ + * H5F__efc_release(). */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR @@ -288,7 +269,7 @@ test_single(void) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR @@ -301,11 +282,9 @@ test_single(void) * that the second file is evicted. Close the first file, reopen the * second, and verify that the first file is evicted. */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared != f1->shared) TEST_ERROR @@ -313,20 +292,17 @@ test_single(void) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 2) TEST_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR @@ -334,8 +310,7 @@ test_single(void) TEST_ERROR if(NULL == (f4 = H5F_efc_open(f0, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f4) < 0) FAIL_STACK_ERROR @@ -349,7 +324,7 @@ test_single(void) if(ftmp1->shared->nrefs != 2) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR @@ -358,7 +333,7 @@ test_single(void) if(ftmp2->shared->nrefs != 2) TEST_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR @@ -367,7 +342,7 @@ test_single(void) if(ftmp2->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR @@ -384,11 +359,9 @@ test_single(void) * through the EFC, then open the fourth and verify that it was not added to * the EFC. */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared != f1->shared) TEST_ERROR @@ -396,11 +369,9 @@ test_single(void) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared != f2->shared) TEST_ERROR @@ -408,11 +379,9 @@ test_single(void) TEST_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp3->shared != f3->shared) TEST_ERROR @@ -420,13 +389,11 @@ test_single(void) TEST_ERROR if(NULL == (f4 = H5F_efc_open(f0, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f4) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp4->shared->nrefs != 1) TEST_ERROR @@ -443,7 +410,7 @@ test_single(void) TEST_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR @@ -464,23 +431,20 @@ test_single(void) /* Test 7: Test multiple file opens. Open a file twice, close it once, then - * verify that it is not evicted by H5F_efc_release(). */ + * verify that it is not evicted by H5F__efc_release(). */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR @@ -488,7 +452,7 @@ test_single(void) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR @@ -550,27 +514,23 @@ test_graph_nocycle(void) * ref count reduced (implying file 1 was closed). Do the same with the * opening order reversed. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR @@ -580,19 +540,16 @@ test_graph_nocycle(void) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(ftmp1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR @@ -600,12 +557,11 @@ test_graph_nocycle(void) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR @@ -619,47 +575,40 @@ test_graph_nocycle(void) * has their own child file. Verifies that releasing the parent's EFC * closes all 4 children. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 2) TEST_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f3, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, f4) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp4->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR @@ -679,23 +628,19 @@ test_graph_nocycle(void) * parent, then reopen through that parent and release the other, then * re-release the first parent. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR @@ -703,28 +648,27 @@ test_graph_nocycle(void) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp2) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f1->shared->efc) < 0) + if(H5F__efc_release(f1->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 1) TEST_ERROR @@ -741,25 +685,21 @@ test_graph_nocycle(void) * shared the same child. Verify that releasing the parent file closes all * files. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f3) < 0) FAIL_STACK_ERROR @@ -767,13 +707,12 @@ test_graph_nocycle(void) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 3) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 1) TEST_ERROR @@ -788,34 +727,29 @@ test_graph_nocycle(void) * each cache f3 and f4. f3 caches f4. Verify that releasing f0 closes all * files. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f0, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f4) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f1, filename[4], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f4) < 0) FAIL_STACK_ERROR @@ -824,44 +758,40 @@ test_graph_nocycle(void) if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f2, filename[4], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f4) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f3, filename[4], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, f4) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp4->shared->nrefs != 5) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp4->shared->nrefs != 1) TEST_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 1) TEST_ERROR @@ -927,23 +857,21 @@ test_graph_cycle(void) /* Test 1: File caches itself. Verify that closing the file causes it to be * actually closed, and there is no other unexpected behavior. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp0) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp0) < 0) FAIL_STACK_ERROR @@ -952,8 +880,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -965,15 +892,13 @@ test_graph_cycle(void) /* Test 2: Indirectly referenced file caches itself. Same as above except * the file is part of another file's EFC. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp1) < 0) FAIL_STACK_ERROR @@ -981,11 +906,10 @@ test_graph_cycle(void) TEST_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -993,11 +917,10 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp1) < 0) FAIL_STACK_ERROR @@ -1008,8 +931,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -1019,15 +941,13 @@ test_graph_cycle(void) /* Test 3: Simple 2 file cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR @@ -1035,17 +955,16 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR @@ -1056,8 +975,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1067,19 +985,16 @@ test_graph_cycle(void) /* Test 4: Simple 2 file cycle (indirectly referenced) */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR @@ -1092,8 +1007,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -1103,26 +1017,23 @@ test_graph_cycle(void) /* Test 5: Parallel double cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR @@ -1133,8 +1044,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1144,26 +1054,23 @@ test_graph_cycle(void) /* Test 6: Parallel double cycle with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR @@ -1171,7 +1078,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 3) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1181,33 +1088,29 @@ test_graph_cycle(void) /* Test 7: Chained parallel double cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR @@ -1222,8 +1125,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1233,33 +1135,29 @@ test_graph_cycle(void) /* Test 8: Chained parallel double cycle with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR @@ -1271,7 +1169,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1281,18 +1179,15 @@ test_graph_cycle(void) /* Test 9: Simple 2 file cycle, extra ID on root */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp1) < 0) FAIL_STACK_ERROR @@ -1309,8 +1204,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1320,18 +1214,15 @@ test_graph_cycle(void) /* Test 10: Simple 2 file cycle, extra ID on second file */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR @@ -1346,8 +1237,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -1357,16 +1247,14 @@ test_graph_cycle(void) if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -1376,29 +1264,25 @@ test_graph_cycle(void) /* Test 11: Parallel double cycle, extra ID on a child file */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR @@ -1413,8 +1297,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 2) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 3) TEST_ERROR @@ -1424,24 +1307,21 @@ test_graph_cycle(void) if(H5F_try_close(ftmp2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR @@ -1451,29 +1331,25 @@ test_graph_cycle(void) /* Test 12: Parallel double cycle, extra ID on a child file, with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR @@ -1484,14 +1360,14 @@ test_graph_cycle(void) if(ftmp2->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR - if(H5F_efc_release(ftmp2->shared->efc) < 0) + if(H5F__efc_release(ftmp2->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1505,36 +1381,31 @@ test_graph_cycle(void) /* Test 13: Chained parallel double cycle, extra ID on a child file */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR @@ -1553,8 +1424,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -1564,32 +1434,28 @@ test_graph_cycle(void) if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -1600,36 +1466,31 @@ test_graph_cycle(void) /* Test 14: Chained parallel double cycle, extra ID on a child file, with * release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR @@ -1644,14 +1505,14 @@ test_graph_cycle(void) if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(ftmp3->shared->efc) < 0) + if(H5F__efc_release(ftmp3->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1665,30 +1526,26 @@ test_graph_cycle(void) /* Test 15: One local and one remote cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR @@ -1702,32 +1559,28 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -1737,30 +1590,26 @@ test_graph_cycle(void) /* Test 16: One local and one remote cycle, with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR @@ -1771,31 +1620,28 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -1805,33 +1651,28 @@ test_graph_cycle(void) /* Test 17: One local and one remote cycle, remote cycle held open */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR @@ -1845,8 +1686,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1858,24 +1698,21 @@ test_graph_cycle(void) if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -1886,33 +1723,28 @@ test_graph_cycle(void) /* Test 18: One local and one remote cycle, remote cycle held open, with * release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR @@ -1923,34 +1755,31 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 2) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(ftmp3->shared->efc) < 0) + if(H5F__efc_release(ftmp3->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 1) TEST_ERROR - if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR @@ -1966,55 +1795,49 @@ test_graph_cycle(void) /* Test 19: "Diamond" shape with links moving from bottom (root) to top. * Also cycle between bottom (root) and top and cycles on the sides. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f1, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f4, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f4) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_efc_open(f2, filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f5, ftmp2) < 0) FAIL_STACK_ERROR @@ -2030,48 +1853,42 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_open(filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f4->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_open(filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f5->shared->nrefs != 1) TEST_ERROR @@ -2083,55 +1900,49 @@ test_graph_cycle(void) * Also cycle between bottom (root) and top, cycles on the sides, and * release the files instead of closing. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f1, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f4, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f4) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_efc_open(f2, filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f5, ftmp2) < 0) FAIL_STACK_ERROR @@ -2144,47 +1955,42 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_open(filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f4->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_open(filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f5->shared->nrefs != 1) TEST_ERROR @@ -2195,65 +2001,57 @@ test_graph_cycle(void) /* Test 21: "Diamond" shape with links moving from bottom (root) to top. * Also cycle between bottom (root) and top, cycles on sides held open. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f1, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f4, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f4) < 0) FAIL_STACK_ERROR - if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f5 = H5F_efc_open(f2, filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f5, ftmp2) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f2, f5) < 0) FAIL_STACK_ERROR - if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR @@ -2272,8 +2070,7 @@ test_graph_cycle(void) TEST_ERROR if(f5->shared->nrefs != 2) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2289,8 +2086,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f5->shared->nrefs != 2) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2301,48 +2097,42 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_open(filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f4->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_open(filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f5->shared->nrefs != 1) TEST_ERROR @@ -2354,65 +2144,57 @@ test_graph_cycle(void) * Also cycle between bottom (root) and top, cycles on sides held open. * Also release the files instead of closing. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f1, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f4, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f4) < 0) FAIL_STACK_ERROR - if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f5 = H5F_efc_open(f2, filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f5, ftmp2) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f2, f5) < 0) FAIL_STACK_ERROR - if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR @@ -2425,7 +2207,7 @@ test_graph_cycle(void) if(f5->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2433,15 +2215,14 @@ test_graph_cycle(void) TEST_ERROR if(f5->shared->nrefs != 2) TEST_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 3) TEST_ERROR if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f4->shared->efc) < 0) + if(H5F__efc_release(f4->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2449,15 +2230,14 @@ test_graph_cycle(void) TEST_ERROR if(f5->shared->nrefs != 2) TEST_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 2) TEST_ERROR if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f5->shared->efc) < 0) + if(H5F__efc_release(f5->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -2465,8 +2245,7 @@ test_graph_cycle(void) TEST_ERROR if(f5->shared->nrefs != 1) TEST_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -2484,86 +2263,82 @@ test_graph_cycle(void) /* Test 23: Dense "ball" of files. 4 files each cache all files (including * itself). */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp3) < 0) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f2, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp3) < 0) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f3, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp3) < 0) FAIL_STACK_ERROR @@ -2578,32 +2353,28 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -2614,86 +2385,82 @@ test_graph_cycle(void) /* Test 24: Dense "ball" of files. 4 files each cache all files (including * itself). Release the files instead of closing. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp3) < 0) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f2, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp3) < 0) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f3, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp3) < 0) FAIL_STACK_ERROR @@ -2705,31 +2472,28 @@ test_graph_cycle(void) if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -2739,15 +2503,13 @@ test_graph_cycle(void) /* Test 25: File held open by EFC client interrupts cycle, with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR @@ -2756,7 +2518,7 @@ test_graph_cycle(void) if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2767,7 +2529,7 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -2777,30 +2539,27 @@ test_graph_cycle(void) /* Test 26: File held open by EFC does not interrupt cycle, with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -2817,30 +2576,26 @@ test_graph_cycle(void) /* Test 27: File held open by EFC client through non-parent file does not * interrupt cycle, but parent file does (no valid way around it) */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2859,8 +2614,7 @@ test_graph_cycle(void) TEST_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2873,15 +2627,13 @@ test_graph_cycle(void) TEST_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 2) TEST_ERROR @@ -2892,22 +2644,19 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 3) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 2) TEST_ERROR @@ -2916,29 +2665,25 @@ test_graph_cycle(void) if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -2950,30 +2695,26 @@ test_graph_cycle(void) * interrupt cycle, but parent file does (no valid way around it), with * release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2984,7 +2725,7 @@ test_graph_cycle(void) if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2995,7 +2736,7 @@ test_graph_cycle(void) if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_efc_release(f2->shared->efc) < 0) + if(H5F__efc_release(f2->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -3010,21 +2751,19 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(H5F_efc_close(f2, f1) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f2->shared->efc) < 0) + if(H5F__efc_release(f2->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -3039,19 +2778,17 @@ test_graph_cycle(void) /* Test 29: File without EFC interrupts cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5Pset_elink_file_cache_size(fapl_id, 0) < 0) TEST_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5Pset_elink_file_cache_size(fapl_id, 8) < 0) TEST_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -3066,15 +2803,13 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -3084,15 +2819,13 @@ test_graph_cycle(void) /* Test 30: File without EFC does not interrupt cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR @@ -3101,8 +2834,7 @@ test_graph_cycle(void) if(H5Pset_elink_file_cache_size(fapl_id, 0) < 0) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5Pset_elink_file_cache_size(fapl_id, 8) < 0) TEST_ERROR @@ -3113,22 +2845,19 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR @@ -3162,6 +2891,7 @@ int main(void) { unsigned nerrors = 0; /* track errors */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Test Setup */ puts("Testing the external file cache"); @@ -3169,7 +2899,6 @@ main(void) /* Create property lists */ fcpl_id = H5Pcreate(H5P_FILE_CREATE); fapl_id = h5_fileaccess(); - dxpl_id = H5AC_ind_read_dxpl_id; /* Patch filenames */ h5_fixname(FILENAME[0], fapl_id, filename[0], sizeof(filename[0])); @@ -3178,6 +2907,8 @@ main(void) h5_fixname(FILENAME[3], fapl_id, filename[3], sizeof(filename[3])); h5_fixname(FILENAME[4], fapl_id, filename[4], sizeof(filename[4])); h5_fixname(FILENAME[5], fapl_id, filename[5], sizeof(filename[5])); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Test Functions */ nerrors += test_single(); @@ -3190,6 +2921,8 @@ main(void) /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; diff --git a/test/farray.c b/test/farray.c index f9f97bf..5ff950e 100644 --- a/test/farray.c +++ b/test/farray.c @@ -25,8 +25,9 @@ #include "H5FApkg.h" /* Fixed Arrays */ /* Other private headers that this test requires */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" /* IDs */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* Local macros */ @@ -265,7 +266,7 @@ set_fa_state(const H5FA_create_t *cparam, farray_state_t *state) *------------------------------------------------------------------------- */ static int -reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, +reopen_file(hid_t *file, H5F_t **f, hid_t fapl, H5FA_t **fa, haddr_t fa_addr, const farray_test_param_t *tparam) { /* Check for closing & re-opening the array */ @@ -273,7 +274,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, if(tparam->reopen_array) { /* Close array, if given */ if(fa && *fa) { - if(H5FA_close(*fa, dxpl) < 0) + if(H5FA_close(*fa) < 0) FAIL_STACK_ERROR *fa = NULL; } /* end if */ @@ -300,7 +301,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, /* Re-open array, if given */ if(fa) - if(NULL == (*fa = H5FA_open(*f, dxpl, fa_addr, NULL))) + if(NULL == (*fa = H5FA_open(*f, fa_addr, NULL))) FAIL_STACK_ERROR } /* end if */ @@ -323,13 +324,13 @@ error: *------------------------------------------------------------------------- */ static int -create_array(H5F_t *f, hid_t dxpl, const H5FA_create_t *cparam, +create_array(H5F_t *f, const H5FA_create_t *cparam, H5FA_t **fa, haddr_t *fa_addr) { farray_state_t state; /* State of extensible array */ /* Create array */ - if(NULL == (*fa = H5FA_create(f, dxpl, cparam, NULL))) + if(NULL == (*fa = H5FA_create(f, cparam, NULL))) FAIL_STACK_ERROR /* Check status of array */ @@ -400,11 +401,11 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5FA_t *fa, haddr_t fa_addr) h5_stat_size_t file_size; /* File size, after deleting array */ /* Close the fixed array */ - if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa) < 0) FAIL_STACK_ERROR /* Delete array */ - if(H5FA_delete(f, H5AC_ind_read_dxpl_id, fa_addr, NULL) < 0) + if(H5FA_delete(f, fa_addr, NULL) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -462,11 +463,11 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.raw_elmt_size = 0; H5E_BEGIN_TRY { - fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + fa = H5FA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(fa) { /* Close opened fixed array */ - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); fa = NULL; /* Indicate error */ @@ -477,11 +478,11 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_dblk_page_nelmts_bits = 0; H5E_BEGIN_TRY { - fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + fa = H5FA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(fa) { /* Close opened fixed array */ - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); fa = NULL; /* Indicate error */ @@ -492,11 +493,11 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.nelmts = 0; H5E_BEGIN_TRY { - fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + fa = H5FA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(fa) { /* Close opened fixed array */ - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); fa = NULL; /* Indicate error */ @@ -516,7 +517,7 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE TESTING("fixed array creation"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR PASSED() @@ -540,7 +541,7 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); H5Fclose(file); } H5E_END_TRY; @@ -576,19 +577,19 @@ test_reopen(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TESTING("create, close & reopen fixed array"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Close the fixed array */ - if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0) + if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0) TEST_ERROR /* Re-open the array */ - if(NULL == (fa = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa = H5FA_open(f, fa_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -607,7 +608,7 @@ test_reopen(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); H5Fclose(file); } H5E_END_TRY; @@ -646,11 +647,11 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TESTING("open fixed array twice"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Open the array again, through the first file handle */ - if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -660,12 +661,12 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TEST_ERROR /* Close the second fixed array wrapper */ - if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa2) < 0) FAIL_STACK_ERROR fa2 = NULL; /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0) TEST_ERROR /* Re-open the file */ @@ -677,7 +678,7 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) FAIL_STACK_ERROR /* Open the fixed array through the second file handle */ - if(NULL == (fa2 = H5FA_open(f2, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa2 = H5FA_open(f2, fa_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -685,7 +686,7 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TEST_ERROR /* Close the first extensible array wrapper */ - if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa) < 0) FAIL_STACK_ERROR fa = NULL; @@ -708,9 +709,9 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); if(fa2) - H5FA_close(fa2, H5AC_ind_read_dxpl_id); + H5FA_close(fa2); H5Fclose(file); H5Fclose(file2); } H5E_END_TRY; @@ -758,11 +759,11 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Open the array again, through the first file handle */ - if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -772,7 +773,7 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa TEST_ERROR /* Close the second fixed array wrapper */ - if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa2) < 0) FAIL_STACK_ERROR fa2 = NULL; @@ -784,11 +785,11 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa FAIL_STACK_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0) TEST_ERROR /* Close the first fixed array wrapper */ - if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa) < 0) FAIL_STACK_ERROR fa = NULL; @@ -819,7 +820,7 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa FAIL_STACK_ERROR /* Open the fixed array through the second file handle */ - if(NULL == (fa2 = H5FA_open(f2, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa2 = H5FA_open(f2, fa_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -844,9 +845,9 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); if(fa2) - H5FA_close(fa2, H5AC_ind_read_dxpl_id); + H5FA_close(fa2); H5Fclose(file); H5Fclose(file2); H5Fclose(file0); @@ -887,15 +888,15 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TESTING("deleting open fixed array"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Open the array again */ - if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL))) FAIL_STACK_ERROR /* Request that the array be deleted */ - if(H5FA_delete(f, H5AC_ind_read_dxpl_id, fa_addr, NULL) < 0) + if(H5FA_delete(f, fa_addr, NULL) < 0) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -905,38 +906,38 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TEST_ERROR /* Close the second fixed array wrapper */ - if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa2) < 0) FAIL_STACK_ERROR fa2 = NULL; /* Try re-opening the array again (should fail, as array will be deleted) */ H5E_BEGIN_TRY { - fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL); + fa2 = H5FA_open(f, fa_addr, NULL); } H5E_END_TRY; if(fa2) { /* Close opened array */ - H5FA_close(fa2, H5AC_ind_read_dxpl_id); + H5FA_close(fa2); /* Indicate error */ TEST_ERROR } /* end if */ /* Close the first fixed array wrapper */ - if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa) < 0) FAIL_STACK_ERROR fa = NULL; /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0) + if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0) TEST_ERROR /* Try re-opening the array again (should fail, as array is now deleted) */ H5E_BEGIN_TRY { - fa = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL); + fa = H5FA_open(f, fa_addr, NULL); } H5E_END_TRY; if(fa) { /* Close opened array */ - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); /* Indicate error */ TEST_ERROR @@ -962,9 +963,9 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); if(fa2) - H5FA_close(fa2, H5AC_ind_read_dxpl_id); + H5FA_close(fa2); H5Fclose(file); } H5E_END_TRY; @@ -1391,7 +1392,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -1399,7 +1400,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, TEST_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0) TEST_ERROR if(H5FA_get_nelmts(fa, &fa_nelmts) < 0) @@ -1431,7 +1432,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5FA_get(fa, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved is correct */ @@ -1458,7 +1459,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, idx = (hsize_t)sidx; relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5FA_get(fa, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved element is correct */ @@ -1467,12 +1468,12 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, /* Set element of array */ welmt = (uint64_t)7 + idx; - if(H5FA_set(fa, H5AC_ind_read_dxpl_id, idx, &welmt) < 0) + if(H5FA_set(fa, idx, &welmt) < 0) FAIL_STACK_ERROR /* Retrieve element of array (set now) */ relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5FA_get(fa, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved element is correct */ @@ -1502,7 +1503,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); H5Fclose(file); } H5E_END_TRY; @@ -1546,7 +1547,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -1554,7 +1555,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, TEST_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0) TEST_ERROR if(H5FA_get_nelmts(fa, &fa_nelmts) < 0) @@ -1576,7 +1577,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5FA_get(fa, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved is correct */ @@ -1585,7 +1586,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, /* Set element of array */ welmt = (uint64_t)7 + idx; - if(H5FA_set(fa, H5AC_ind_read_dxpl_id, idx, &welmt) < 0) + if(H5FA_set(fa, idx, &welmt) < 0) FAIL_STACK_ERROR /* Verify array state */ @@ -1596,7 +1597,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, /* Retrieve element of array (set now) */ relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5FA_get(fa, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved is correct */ @@ -1608,7 +1609,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, for(cnt = 0; cnt < skip_elmts; cnt++) { /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, cnt, &relmt) < 0) + if(H5FA_get(fa, cnt, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved is correct */ @@ -1629,7 +1630,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); H5Fclose(file); } H5E_END_TRY; @@ -1658,6 +1659,7 @@ main(void) unsigned nerrors = 0; /* Cumulative error count */ time_t curr_time; /* Current time, for seeding random number generator */ int ExpressMode; /* Test express value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Reset library */ h5_reset(); @@ -1668,6 +1670,8 @@ main(void) /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g)); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Seed random #'s */ curr_time = HDtime(NULL); @@ -1787,6 +1791,8 @@ main(void) /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; diff --git a/test/fheap.c b/test/fheap.c index 6c3a8ac..00a372e 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -29,9 +29,10 @@ #include "H5Fpkg.h" /* Other private headers that this test requires */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* Max. testfile name length */ #define FHEAP_FILENAME_LEN 1024 @@ -169,7 +170,7 @@ size_t shared_alloc_ids_g = 0; /* # of shared heap IDs allocated in array */ static int init_small_cparam(H5HF_create_t *cparam); static int init_large_cparam(H5HF_create_t *cparam); static int check_stats(const H5HF_t *fh, const fheap_heap_state_t *state); -static int del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam, +static int del_objs(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids); @@ -359,7 +360,7 @@ op_memcpy(const void *obj, size_t obj_len, void *op_data) *------------------------------------------------------------------------- */ static int -add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off, +add_obj(H5HF_t *fh, size_t obj_off, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned char heap_id[MAX_HEAP_ID_LEN]; /* Heap ID for object inserted */ @@ -381,7 +382,7 @@ add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off, /* Insert object */ HDmemset(heap_id, 0, id_len); - if(H5HF_insert(fh, dxpl, obj_size, obj, heap_id) < 0) + if(H5HF_insert(fh, obj_size, obj, heap_id) < 0) FAIL_STACK_ERROR /* Check for tracking the heap's state */ @@ -409,11 +410,11 @@ add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off, } /* end if */ /* Read in object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(obj, shared_robj_g, obj_size)) TEST_ERROR @@ -582,14 +583,14 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, *------------------------------------------------------------------------- */ static int -reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, hid_t dxpl, +reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, H5HF_t **fh, haddr_t fh_addr, const fheap_test_param_t *tparam) { /* Check for closing & re-opening the heap */ /* (actually will close & re-open the file as well) */ if(tparam->reopen_heap) { /* Close heap */ - if(H5HF_close(*fh, dxpl) < 0) + if(H5HF_close(*fh) < 0) FAIL_STACK_ERROR *fh = NULL; @@ -612,7 +613,7 @@ reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, hid_t dxpl FAIL_STACK_ERROR /* Re-open heap */ - if(NULL == (*fh = H5HF_open(*f, dxpl, fh_addr))) + if(NULL == (*fh = H5HF_open(*f, fh_addr))) FAIL_STACK_ERROR } /* end if */ @@ -639,7 +640,7 @@ error: *------------------------------------------------------------------------- */ static int -open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, +open_heap(char *filename, hid_t fapl, const H5HF_create_t *cparam, const fheap_test_param_t *tparam, hid_t *file, H5F_t **f, H5HF_t **fh, haddr_t *fh_addr, fheap_heap_state_t *state, h5_stat_size_t *empty_size) { @@ -663,7 +664,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, FAIL_STACK_ERROR /* Create absolute heap */ - if(NULL == (*fh = H5HF_create(*f, dxpl, cparam))) + if(NULL == (*fh = H5HF_create(*f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(*fh, &id_len) < 0) FAIL_STACK_ERROR @@ -680,7 +681,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(*fh, dxpl) < 0) + if(H5HF_close(*fh) < 0) FAIL_STACK_ERROR } /* end if */ @@ -707,7 +708,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Create absolute heap */ - if(NULL == (*fh = H5HF_create(*f, dxpl, cparam))) + if(NULL == (*fh = H5HF_create(*f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(*fh, &id_len) < 0) FAIL_STACK_ERROR @@ -723,7 +724,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, } /* end if */ else { /* Re-open heap */ - if(NULL == (*fh = H5HF_open(*f, dxpl, *fh_addr))) + if(NULL == (*fh = H5HF_open(*f, *fh_addr))) FAIL_STACK_ERROR } /* end else */ @@ -750,17 +751,17 @@ error: *------------------------------------------------------------------------- */ static int -reopen_heap(H5F_t *f, hid_t dxpl, H5HF_t **fh, haddr_t fh_addr, +reopen_heap(H5F_t *f, H5HF_t **fh, haddr_t fh_addr, const fheap_test_param_t *tparam) { /* Check for closing & re-opening the heap */ if(tparam->reopen_heap) { /* Close (empty) heap */ - if(H5HF_close(*fh, dxpl) < 0) + if(H5HF_close(*fh) < 0) FAIL_STACK_ERROR /* Re-open heap */ - if(NULL == (*fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (*fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR } /* end if */ @@ -786,7 +787,7 @@ error: *------------------------------------------------------------------------- */ static int -close_heap(char *filename, hid_t fapl, hid_t dxpl, fheap_test_param_t *tparam, +close_heap(char *filename, hid_t fapl, fheap_test_param_t *tparam, hid_t file, H5F_t *f, H5HF_t **fh, haddr_t fh_addr, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids, h5_stat_size_t empty_size) @@ -794,7 +795,7 @@ close_heap(char *filename, hid_t fapl, hid_t dxpl, fheap_test_param_t *tparam, h5_stat_size_t file_size; /* Size of file currently */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0) + if(reopen_heap(f, fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -804,19 +805,19 @@ close_heap(char *filename, hid_t fapl, hid_t dxpl, fheap_test_param_t *tparam, /* Check for deleting the objects in the heap */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Delete objects inserted (either forward or reverse order) */ - if(del_objs(f, dxpl, fh, tparam, state, keep_ids)) + if(del_objs(f, fh, tparam, state, keep_ids)) FAIL_STACK_ERROR } /* end if */ /* Close the fractal heap */ - if(H5HF_close(*fh, dxpl) < 0) + if(H5HF_close(*fh) < 0) FAIL_STACK_ERROR *fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -855,7 +856,7 @@ error: *------------------------------------------------------------------------- */ static int -del_objs_half_refill(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam, +del_objs_half_refill(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam, fheap_heap_ids_t *keep_ids) { unsigned char *wobj; /* Buffer for object to insert */ @@ -890,11 +891,11 @@ del_objs_half_refill(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tpar half_nobjs = keep_ids->num_ids / 2; for(u = 0; u < half_nobjs; u++) { /* Remove object from heap */ - if(H5HF_remove(*fh, dxpl, &keep_ids->ids[id_len * obj_idx]) < 0) + if(H5HF_remove(*fh, &keep_ids->ids[id_len * obj_idx]) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0) + if(reopen_heap(f, fh, fh_addr, tparam) < 0) TEST_ERROR /* Adjust index of object to delete next */ @@ -912,11 +913,11 @@ del_objs_half_refill(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tpar for(u = 0; u < half_nobjs; u++) { /* Re-insert object */ wobj = &shared_wobj_g[keep_ids->offs[obj_idx]]; - if(H5HF_insert(*fh, dxpl, keep_ids->lens[obj_idx], wobj, &keep_ids->ids[id_len * obj_idx]) < 0) + if(H5HF_insert(*fh, keep_ids->lens[obj_idx], wobj, &keep_ids->ids[id_len * obj_idx]) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0) + if(reopen_heap(f, fh, fh_addr, tparam) < 0) TEST_ERROR /* Adjust index of object to delete next */ @@ -949,7 +950,7 @@ error: *------------------------------------------------------------------------- */ static int -del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam, +del_objs(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { haddr_t fh_addr = HADDR_UNDEF; /* Address of fractal heap */ @@ -965,7 +966,7 @@ del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam, /* Check for first deleting half of objects & then re-inserting them */ if(tparam->drain_half == FHEAP_DEL_DRAIN_HALF) - if(del_objs_half_refill(f, dxpl, fh, tparam, keep_ids)) + if(del_objs_half_refill(f, fh, tparam, keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ @@ -987,11 +988,11 @@ del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam, obj_idx = keep_ids->num_ids - 1; for(u = 0; u < keep_ids->num_ids; u++) { /* Remove object from heap */ - if(H5HF_remove(*fh, dxpl, &keep_ids->ids[id_len * obj_idx]) < 0) + if(H5HF_remove(*fh, &keep_ids->ids[id_len * obj_idx]) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0) + if(reopen_heap(f, fh, fh_addr, tparam) < 0) TEST_ERROR /* Adjust index of object to delete next */ @@ -1041,7 +1042,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size, +fill_heap(H5HF_t *fh, unsigned block_row, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned char *wobj; /* Buffer for object to insert */ @@ -1098,7 +1099,7 @@ fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size, } /* end if */ /* Insert object */ - if(H5HF_insert(fh, dxpl, obj_size, wobj, curr_id_ptr) < 0) + if(H5HF_insert(fh, obj_size, wobj, curr_id_ptr) < 0) FAIL_STACK_ERROR *curr_len_ptr = obj_size; *curr_off_ptr = obj_off; @@ -1149,7 +1150,7 @@ fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size, } /* end if */ /* Insert last object into the heap, using the remaining free space */ - if(H5HF_insert(fh, dxpl, last_obj_len, wobj, curr_id_ptr) < 0) + if(H5HF_insert(fh, last_obj_len, wobj, curr_id_ptr) < 0) FAIL_STACK_ERROR *curr_len_ptr = last_obj_len; *curr_off_ptr = obj_off; @@ -1174,7 +1175,7 @@ fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size, curr_off_ptr = shared_offs_g; for(u = 0; u < num_ids; u++) { /* Read in object */ - if(H5HF_read(fh, dxpl, curr_id_ptr, shared_robj_g) < 0) + if(H5HF_read(fh, curr_id_ptr, shared_robj_g) < 0) FAIL_STACK_ERROR /* Check that object is correct */ @@ -1233,7 +1234,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_root_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size, +fill_root_row(H5HF_t *fh, unsigned row, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { hsize_t first_free_space; /* Size of free space in heap after the first block */ @@ -1303,7 +1304,7 @@ fill_root_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size, state->man_alloc_size += block_size; /* Fill a direct heap block up */ - if(fill_heap(fh, dxpl, row, obj_size, state, keep_ids)) + if(fill_heap(fh, row, obj_size, state, keep_ids)) TEST_ERROR } /* end for */ @@ -1330,7 +1331,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_partial_row(H5HF_t *fh, hid_t dxpl, unsigned row, unsigned width, +fill_partial_row(H5HF_t *fh, unsigned row, unsigned width, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { size_t block_size; /* Size of direct block in this row */ @@ -1349,7 +1350,7 @@ fill_partial_row(H5HF_t *fh, hid_t dxpl, unsigned row, unsigned width, state->man_alloc_size += block_size; /* Fill a direct heap block up */ - if(fill_heap(fh, dxpl, row, obj_size, state, keep_ids)) + if(fill_heap(fh, row, obj_size, state, keep_ids)) TEST_ERROR } /* end for */ @@ -1376,7 +1377,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size, +fill_row(H5HF_t *fh, unsigned row, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { /* Sanity check */ @@ -1384,7 +1385,7 @@ fill_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size, HDassert(state); /* Fill the entire row (with the partial row fill routine) */ - if(fill_partial_row(fh, dxpl, row, DTABLE_WIDTH(fh), obj_size, state, keep_ids)) + if(fill_partial_row(fh, row, DTABLE_WIDTH(fh), obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1413,7 +1414,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_root_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size, +fill_root_direct(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned max_dblock_rows; /* Max. # of direct block rows in indirect block */ @@ -1425,7 +1426,7 @@ fill_root_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size, /* Loop over rows */ for(row = 0; row < max_dblock_rows; row++) - if(fill_root_row(fh, dxpl, row, obj_size, state, keep_ids)) + if(fill_root_row(fh, row, obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1453,7 +1454,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_2nd_indirect(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, +fill_2nd_indirect(H5HF_t *fh, unsigned pos, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned max_dblock_rows; /* Max. # of direct block rows in indirect block */ @@ -1465,7 +1466,7 @@ fill_2nd_indirect(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, /* Loop over rows */ for(row = 0; row < max_dblock_rows; row++) - if(fill_row(fh, dxpl, row, obj_size, state, keep_ids)) + if(fill_row(fh, row, obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1492,7 +1493,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_all_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size, +fill_all_direct(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned max_dblock_rows; /* Max. # of direct block rows in indirect block */ @@ -1504,7 +1505,7 @@ fill_all_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size, /* Loop over rows */ for(row = 0; row < max_dblock_rows; row++) - if(fill_row(fh, dxpl, row, obj_size, state, keep_ids)) + if(fill_row(fh, row, obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1532,7 +1533,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_2nd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, +fill_2nd_indirect_row(H5HF_t *fh, unsigned pos, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1543,7 +1544,7 @@ fill_2nd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, /* Loop over row of indirect blocks */ for(u = 0; u < width; u++) - if(fill_2nd_indirect(fh, dxpl, pos, obj_size, state, keep_ids)) + if(fill_2nd_indirect(fh, pos, obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1571,7 +1572,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_all_2nd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, +fill_all_2nd_indirect_rows(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1582,7 +1583,7 @@ fill_all_2nd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, /* Loop over rows of 2nd level deep indirect blocks */ for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) - if(fill_2nd_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids)) + if(fill_2nd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1610,18 +1611,18 @@ error: *------------------------------------------------------------------------- */ static int -fill_3rd_indirect(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, +fill_3rd_indirect(H5HF_t *fh, unsigned pos, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned u; /* Local index variable */ /* Fill all direct block rows in third level indirect block */ - if(fill_all_direct(fh, dxpl, obj_size, state, keep_ids)) + if(fill_all_direct(fh, obj_size, state, keep_ids)) TEST_ERROR /* Fill rows of recursive indirect blocks in third level indirect block */ for(u = 0; u < pos; u++) - if(fill_2nd_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids)) + if(fill_2nd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1649,7 +1650,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_3rd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, +fill_3rd_indirect_row(H5HF_t *fh, unsigned pos, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1661,7 +1662,7 @@ fill_3rd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, /* Loop over row of 3rd level indirect blocks */ for(u = 0; u < width; u++) /* Fill third level indirect block */ - if(fill_3rd_indirect(fh, dxpl, pos, obj_size, state, keep_ids)) + if(fill_3rd_indirect(fh, pos, obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1689,7 +1690,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_all_3rd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, +fill_all_3rd_indirect_rows(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1701,7 +1702,7 @@ fill_all_3rd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, /* Loop over rows of 3rd level deep indirect blocks */ for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) /* Fill row of 3rd level indirect blocks */ - if(fill_3rd_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids)) + if(fill_3rd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1729,7 +1730,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_4th_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, +fill_4th_indirect_row(H5HF_t *fh, unsigned pos, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1741,16 +1742,16 @@ fill_4th_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, /* Loop over row of 4th level indirect blocks */ for(u = 0; u < width; u++) { /* Fill all direct block rows in fourth level indirect block */ - if(fill_all_direct(fh, dxpl, obj_size, state, keep_ids)) + if(fill_all_direct(fh, obj_size, state, keep_ids)) TEST_ERROR /* Fill all rows of 2nd level deep indirect blocks in fourth level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, obj_size, state, keep_ids)) + if(fill_all_2nd_indirect_rows(fh, obj_size, state, keep_ids)) TEST_ERROR /* Fill rows of third level indirect blocks in fourth level indirect block */ for(v = 0; v < pos; v++) - if(fill_3rd_indirect_row(fh, dxpl, (v + 1), obj_size, state, keep_ids)) + if(fill_3rd_indirect_row(fh, (v + 1), obj_size, state, keep_ids)) TEST_ERROR } /* end for */ @@ -1779,7 +1780,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_all_4th_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, +fill_all_4th_indirect_rows(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1791,7 +1792,7 @@ fill_all_4th_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, /* Loop over rows of 4th level deep indirect blocks */ for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) { /* Fill row of 4th level indirect blocks */ - if(fill_4th_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids)) + if(fill_4th_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR /* Account for root indirect block doubling # of rows again */ @@ -1879,7 +1880,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) */ TESTING("fractal heap creation"); - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -1903,11 +1904,11 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Delete heap */ - if(H5HF_delete(f, H5AC_ind_read_dxpl_id, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -1930,7 +1931,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, H5AC_ind_read_dxpl_id); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -2002,7 +2003,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TESTING("create, close & reopen fractal heap"); /* Create heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -2017,7 +2018,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the file */ @@ -2041,7 +2042,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) } /* end if */ /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Query the creation parameters */ @@ -2052,12 +2053,12 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Delete heap */ - if(H5HF_delete(f, H5AC_ind_read_dxpl_id, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -2081,7 +2082,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, H5AC_ind_read_dxpl_id); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -2155,7 +2156,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TESTING("open fractal heap twice"); /* Create heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -2170,7 +2171,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Open the heap again, through the first file handle */ - if(NULL == (fh2 = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh2 = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -2181,12 +2182,12 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the second fractal heap wrapper */ - if(H5HF_close(fh2, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh2) < 0) FAIL_STACK_ERROR fh2 = NULL; /* Check for closing & re-opening the heap & file */ - if(reopen_file(&file, &f, filename, fapl, H5AC_ind_read_dxpl_id, &fh, fh_addr, tparam) < 0) + if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Re-open the file */ @@ -2202,7 +2203,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Open the fractal heap through the second file handle */ - if(NULL == (fh2 = H5HF_open(f2, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh2 = H5HF_open(f2, fh_addr))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -2213,7 +2214,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the first fractal heap wrapper */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2225,12 +2226,12 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Close the second fractal heap wrapper */ - if(H5HF_close(fh2, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh2) < 0) FAIL_STACK_ERROR fh2 = NULL; /* Delete heap */ - if(H5HF_delete(f2, H5AC_ind_read_dxpl_id, fh_addr) < 0) + if(H5HF_delete(f2, fh_addr) < 0) FAIL_STACK_ERROR /* Close the second file */ @@ -2254,9 +2255,9 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, H5AC_ind_read_dxpl_id); + H5HF_close(fh); if(fh2) - H5HF_close(fh2, H5AC_ind_read_dxpl_id); + H5HF_close(fh2); H5Fclose(file); H5Fclose(file2); } H5E_END_TRY; @@ -2324,7 +2325,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TESTING("deleting open fractal heap"); /* Create heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -2339,11 +2340,11 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Open the heap again */ - if(NULL == (fh2 = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh2 = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Request that the heap be deleted */ - if(H5HF_delete(f, H5AC_ind_read_dxpl_id, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -2354,24 +2355,24 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the second fractal heap wrapper */ - if(H5HF_close(fh2, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh2) < 0) FAIL_STACK_ERROR fh2 = NULL; /* Try re-opening the heap again (should fail, as heap will be deleted) */ H5E_BEGIN_TRY { - fh2 = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr); + fh2 = H5HF_open(f, fh_addr); } H5E_END_TRY; if(fh2) { /* Close opened heap */ - H5HF_close(fh2, H5AC_ind_read_dxpl_id); + H5HF_close(fh2); /* Indicate error */ TEST_ERROR } /* end if */ /* Close the first fractal heap wrapper */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2397,11 +2398,11 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) /* Try re-opening the heap again (should fail, as heap is now deleted) */ H5E_BEGIN_TRY { - fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr); + fh = H5HF_open(f, fh_addr); } H5E_END_TRY; if(fh) { /* Close opened heap */ - H5HF_close(fh, H5AC_ind_read_dxpl_id); + H5HF_close(fh); /* Indicate error */ TEST_ERROR @@ -2427,9 +2428,9 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, H5AC_ind_read_dxpl_id); + H5HF_close(fh); if(fh2) - H5HF_close(fh2, H5AC_ind_read_dxpl_id); + H5HF_close(fh2); H5Fclose(file); } H5E_END_TRY; return(1); @@ -2453,7 +2454,6 @@ static unsigned test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -2490,7 +2490,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 0; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2510,7 +2510,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2520,7 +2520,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 1; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2540,7 +2540,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2555,7 +2555,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2575,7 +2575,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2588,7 +2588,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) /* Create absolute heap */ H5E_BEGIN_TRY { - fh = H5HF_create(f, dxpl, &tmp_cparam); + fh = H5HF_create(f, &tmp_cparam); } H5E_END_TRY; if(NULL != fh) FAIL_STACK_ERROR @@ -2600,7 +2600,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 8; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2620,7 +2620,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2631,7 +2631,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 17; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2651,7 +2651,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2662,7 +2662,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 18; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2682,7 +2682,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2693,7 +2693,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 19; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2713,7 +2713,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2724,7 +2724,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 45; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2744,7 +2744,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2756,7 +2756,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) /* Create absolute heap */ H5E_BEGIN_TRY { - fh = H5HF_create(f, dxpl, &tmp_cparam); + fh = H5HF_create(f, &tmp_cparam); } H5E_END_TRY; if(NULL != fh) FAIL_STACK_ERROR @@ -2774,7 +2774,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -2798,7 +2798,6 @@ static unsigned test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -2835,7 +2834,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Get heap's address */ @@ -2845,7 +2844,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2866,7 +2865,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Query the heap creation parameters */ @@ -2877,7 +2876,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR @@ -2897,7 +2896,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -2921,7 +2920,6 @@ static unsigned test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -2950,7 +2948,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR /* Get heap's address */ @@ -2961,24 +2959,24 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) /* Get an empty heap's size */ empty_heap_size = 0; - if(H5HF_size(fh, dxpl, &empty_heap_size) < 0) + if(H5HF_size(fh, &empty_heap_size) < 0) FAIL_STACK_ERROR if(empty_heap_size == 0) TEST_ERROR /* Insert an object */ - if(add_obj(fh, dxpl, (size_t)0, (size_t)10, NULL, NULL) < 0) + if(add_obj(fh, (size_t)0, (size_t)10, NULL, NULL) < 0) TEST_ERROR /* Get the heap's size after inserting one object */ one_heap_size = 0; - if(H5HF_size(fh, dxpl, &one_heap_size) < 0) + if(H5HF_size(fh, &one_heap_size) < 0) FAIL_STACK_ERROR if(one_heap_size <= empty_heap_size) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -3000,29 +2998,29 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check the heap's size */ heap_size = 0; - if(H5HF_size(fh, dxpl, &heap_size) < 0) + if(H5HF_size(fh, &heap_size) < 0) FAIL_STACK_ERROR if(heap_size != one_heap_size) TEST_ERROR /* Insert another object */ - if(add_obj(fh, dxpl, (size_t)1, (size_t)10, NULL, NULL) < 0) + if(add_obj(fh, (size_t)1, (size_t)10, NULL, NULL) < 0) TEST_ERROR /* Check the heap's size */ heap_size = 0; - if(H5HF_size(fh, dxpl, &heap_size) < 0) + if(H5HF_size(fh, &heap_size) < 0) FAIL_STACK_ERROR if(heap_size != one_heap_size) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR @@ -3038,7 +3036,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3066,7 +3064,6 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { hid_t file1 = -1; /* File ID */ hid_t file2 = -2; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3093,7 +3090,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR /* Get heap's address */ @@ -3103,11 +3100,11 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Insert an object */ - if(add_obj(fh, dxpl, (size_t)0, (size_t)10, NULL, NULL) < 0) + if(add_obj(fh, (size_t)0, (size_t)10, NULL, NULL) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -3133,11 +3130,11 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Open the heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Close the heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -3151,16 +3148,16 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Reopen the heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check the heap's size */ heap_size = 0; - if(H5HF_size(fh, dxpl, &heap_size) < 0) + if(H5HF_size(fh, &heap_size) < 0) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR @@ -3176,7 +3173,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file1); H5Fclose(file2); } H5E_END_TRY; @@ -3202,7 +3199,6 @@ static unsigned test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3228,7 +3224,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3243,7 +3239,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* @@ -3253,18 +3249,18 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa /* Attempt to insert 0-sized object into heap */ H5E_BEGIN_TRY { - ret = H5HF_insert(fh, dxpl, (size_t)0, shared_wobj_g, heap_id); + ret = H5HF_insert(fh, (size_t)0, shared_wobj_g, heap_id); } H5E_END_TRY; if(ret >= 0) TEST_ERROR H5Eclear2(H5E_DEFAULT); /* Insert a 1-sized object into heap (should be a 'tiny' object) */ - if(add_obj(fh, dxpl, (size_t)10, (size_t)1, &state, NULL)) + if(add_obj(fh, (size_t)10, (size_t)1, &state, NULL)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check for correctly sized heap */ @@ -3272,7 +3268,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -3288,7 +3284,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3314,7 +3310,6 @@ static unsigned test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3338,7 +3333,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3353,7 +3348,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* @@ -3363,11 +3358,11 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check for correctly sized heap */ @@ -3375,7 +3370,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3390,7 +3385,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3415,7 +3410,6 @@ static unsigned test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3439,7 +3433,7 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3458,19 +3452,19 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert second object */ - if(add_obj(fh, dxpl, (size_t)20, SMALL_OBJ_SIZE2, &state, NULL)) + if(add_obj(fh, (size_t)20, SMALL_OBJ_SIZE2, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3485,7 +3479,7 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3511,7 +3505,6 @@ static unsigned test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3536,7 +3529,7 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3560,15 +3553,15 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3583,7 +3576,7 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3610,7 +3603,6 @@ static unsigned test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3635,7 +3627,7 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3659,22 +3651,22 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force root indirect block creation */ state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); state.man_alloc_size += DBLOCK_SIZE(fh, 0); state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3689,7 +3681,7 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3716,7 +3708,6 @@ static unsigned test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3741,7 +3732,7 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3765,22 +3756,22 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill the second direct block heap up (also creates initial root indirect block) */ state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); state.man_alloc_size += DBLOCK_SIZE(fh, 0); state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3795,7 +3786,7 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3823,7 +3814,6 @@ static unsigned test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3848,7 +3838,7 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3872,27 +3862,27 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill the second direct block heap up (also creates initial root indirect block) */ state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); state.man_alloc_size += DBLOCK_SIZE(fh, 0); state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of third direct block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3907,7 +3897,7 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3934,7 +3924,6 @@ static unsigned test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3959,7 +3948,7 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3980,15 +3969,15 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t fill_size = get_fill_size(tparam); /* Fill first row of [root] indirect block */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_root_row(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4003,7 +3992,7 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4030,7 +4019,6 @@ static unsigned test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4055,7 +4043,7 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4076,22 +4064,22 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t fill_size = get_fill_size(tparam); /* Fill first root indirect row */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_root_row(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force expanding root indirect block to two rows */ state.man_size += cparam->managed.width * DBLOCK_SIZE(fh, 1); state.man_alloc_size += DBLOCK_SIZE(fh, 1); state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 1); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4106,7 +4094,7 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4133,7 +4121,6 @@ static unsigned test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4158,7 +4145,7 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4179,19 +4166,19 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * fill_size = get_fill_size(tparam); /* Fill first root indirect row */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_root_row(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill second root indirect row */ - if(fill_root_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_root_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4206,7 +4193,7 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4234,7 +4221,6 @@ static unsigned test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4259,7 +4245,7 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4280,15 +4266,15 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * fill_size = get_fill_size(tparam); /* Fill first root indirect row */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_root_row(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill second root indirect row */ - if(fill_root_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_root_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force expanding root indirect block to four rows */ @@ -4298,11 +4284,11 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * state.man_alloc_size += DBLOCK_SIZE(fh, 2); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4317,7 +4303,7 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4344,7 +4330,6 @@ static unsigned test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4370,7 +4355,7 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4392,15 +4377,15 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * /* Loop over rows */ for(u = 0; u < 4; u++) - if(fill_root_row(fh, dxpl, u, fill_size, &state, NULL)) + if(fill_root_row(fh, u, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4415,7 +4400,7 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4442,7 +4427,6 @@ static unsigned test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4467,7 +4451,7 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4488,15 +4472,15 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para fill_size = get_fill_size(tparam); /* Fill all direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4511,7 +4495,7 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4538,7 +4522,6 @@ static unsigned test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4563,7 +4546,7 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_ STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4584,20 +4567,20 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_ fill_size = get_fill_size(tparam); /* Fill direct blocks up */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of first recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4612,7 +4595,7 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_ error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4640,7 +4623,6 @@ static unsigned test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4665,7 +4647,7 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4687,27 +4669,27 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe fill_size = get_fill_size(tparam); /* Fill direct blocks up */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill the first direct block in the recursive indirect block up */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of second direct block in * first recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4722,7 +4704,7 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4750,7 +4732,6 @@ static unsigned test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4775,7 +4756,7 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_ STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4797,19 +4778,19 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_ fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first recursive indirect block */ - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4824,7 +4805,7 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_ error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4853,7 +4834,6 @@ static unsigned test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4878,7 +4858,7 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4900,26 +4880,26 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill first recursive indirect block */ - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of second * recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4934,7 +4914,7 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4964,7 +4944,6 @@ static unsigned test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4989,7 +4968,7 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5011,23 +4990,23 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill first recursive indirect block */ - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill 2nd recursive indirect block */ - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5042,7 +5021,7 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5072,7 +5051,6 @@ static unsigned test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5093,7 +5071,7 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5115,19 +5093,19 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te fill_size = get_fill_size(tparam); /* Fill direct blocks in root indirect block up */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill row of recursive indirect blocks */ - if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5142,7 +5120,7 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5170,7 +5148,6 @@ static unsigned test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5195,7 +5172,7 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5217,26 +5194,26 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t fill_size = get_fill_size(tparam); /* Fill direct blocks in root indirect block up */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill row of recursive indirect blocks */ - if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of second * recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5251,7 +5228,7 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5279,7 +5256,6 @@ static unsigned test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5304,7 +5280,7 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5326,19 +5302,19 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5353,7 +5329,7 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5382,7 +5358,6 @@ static unsigned test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5407,7 +5382,7 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5429,26 +5404,26 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of third level deep * recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5463,7 +5438,7 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5492,7 +5467,6 @@ static unsigned test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5517,7 +5491,7 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5539,27 +5513,27 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all direct block rows in third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill row of recursive indirect blocks in third level indirect block */ - if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5574,7 +5548,7 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5603,7 +5577,6 @@ static unsigned test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5628,7 +5601,7 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5650,23 +5623,23 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill 1st row of 3rd level indirect blocks */ - if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_3rd_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5681,7 +5654,7 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5710,7 +5683,6 @@ static unsigned test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5735,7 +5707,7 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5757,23 +5729,23 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5788,7 +5760,7 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5818,7 +5790,6 @@ static unsigned test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5843,7 +5814,7 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5865,30 +5836,30 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of four level deep * recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5903,7 +5874,7 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5933,7 +5904,6 @@ static unsigned test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5958,7 +5928,7 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5980,35 +5950,35 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill direct block rows in fourth level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level deep indirect blocks in fourth level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row of 3rd level deep indirect blocks in fourth level indirect block */ - if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_3rd_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6023,7 +5993,7 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6053,7 +6023,6 @@ static unsigned test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6078,7 +6047,7 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6100,27 +6069,27 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill 1st row of 4th level indirect blocks */ - if(fill_4th_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_4th_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6135,7 +6104,7 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6165,7 +6134,6 @@ static unsigned test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6190,7 +6158,7 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6212,27 +6180,27 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 4th level indirect blocks */ - if(fill_all_4th_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_4th_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6247,7 +6215,7 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6280,7 +6248,6 @@ static unsigned test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6305,7 +6272,7 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6328,46 +6295,46 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap & file */ - if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap & file */ - if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap & file */ - if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 4th level indirect blocks */ - if(fill_all_4th_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_4th_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap & file */ - if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of five level deep * recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6382,7 +6349,7 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6409,7 +6376,6 @@ static unsigned test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6439,7 +6405,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6454,7 +6420,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* @@ -6480,13 +6446,13 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); /* Try removing bogus heap ID from empty heap */ H5E_BEGIN_TRY { - ret = H5HF_remove(fh, dxpl, heap_id); + ret = H5HF_remove(fh, heap_id); } H5E_END_TRY; if(ret >= 0) FAIL_STACK_ERROR /* Fill root direct blocks */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Get offset of random heap ID */ @@ -6507,7 +6473,7 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); /* Try removing bogus heap ID from heap w/objects */ H5E_BEGIN_TRY { - ret = H5HF_remove(fh, dxpl, heap_id); + ret = H5HF_remove(fh, heap_id); } H5E_END_TRY; if(ret >= 0) TEST_ERROR @@ -6515,14 +6481,14 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); /* Try reading bogus heap ID from heap w/objects */ H5E_BEGIN_TRY { - ret = H5HF_read(fh, dxpl, heap_id, shared_robj_g); + ret = H5HF_read(fh, heap_id, shared_robj_g); } H5E_END_TRY; if(ret >= 0) TEST_ERROR H5Eclear2(H5E_DEFAULT); /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6538,7 +6504,7 @@ error: HDfprintf(stderr, "Random # seed was: %lu\n", seed); H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6563,7 +6529,6 @@ static unsigned test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6592,7 +6557,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6609,7 +6574,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close file */ @@ -6633,7 +6598,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara STACK_ERROR /* Re-open heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* @@ -6646,11 +6611,11 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara obj[u] = (unsigned char)u; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, sizeof(obj), obj, &heap_id) < 0) + if(H5HF_insert(fh, sizeof(obj), obj, &heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6662,11 +6627,11 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6678,7 +6643,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6701,7 +6666,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6726,7 +6691,6 @@ static unsigned test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6756,7 +6720,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6773,7 +6737,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close file */ @@ -6797,7 +6761,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara STACK_ERROR /* Re-open heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* @@ -6810,11 +6774,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara obj[u] = (unsigned char)u; /* Insert first object into heap */ - if(H5HF_insert(fh, dxpl, sizeof(obj), obj, &heap_id1) < 0) + if(H5HF_insert(fh, sizeof(obj), obj, &heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6826,11 +6790,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Insert second object into heap */ - if(H5HF_insert(fh, dxpl, sizeof(obj), obj, &heap_id2) < 0) + if(H5HF_insert(fh, sizeof(obj), obj, &heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6840,11 +6804,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6854,11 +6818,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6870,7 +6834,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6893,7 +6857,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6919,7 +6883,6 @@ static unsigned test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6949,7 +6912,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6966,7 +6929,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close file */ @@ -6990,7 +6953,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Re-open heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* @@ -7003,11 +6966,11 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7022,11 +6985,11 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7038,7 +7001,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -7061,7 +7024,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7087,7 +7050,6 @@ static unsigned test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7118,7 +7080,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -7135,7 +7097,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close file */ @@ -7159,7 +7121,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Re-open heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* @@ -7175,11 +7137,11 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id1) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7198,11 +7160,11 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id2) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7220,11 +7182,11 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Remove objects in different orders */ if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7235,16 +7197,16 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR } /* end if */ else { /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7260,12 +7222,12 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR } /* end else */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7277,7 +7239,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -7304,7 +7266,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7330,7 +7292,6 @@ static unsigned test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7362,7 +7323,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -7379,7 +7340,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close file */ @@ -7403,7 +7364,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param STACK_ERROR /* Re-open heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* @@ -7419,11 +7380,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id1) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7442,11 +7403,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id2) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7466,11 +7427,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id3) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7488,11 +7449,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param /* Remove objects in different orders */ if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7503,11 +7464,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7518,16 +7479,16 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Remove third object from heap */ - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR } /* end if */ else { /* Remove third object from heap */ - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7543,11 +7504,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7563,12 +7524,12 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR } /* end else */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7580,7 +7541,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -7607,7 +7568,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7631,7 +7592,6 @@ static unsigned test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7661,7 +7621,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -7686,24 +7646,24 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ for(j = 0; j < i; j++) { HDsprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j); - if(H5HF_remove(fh, dxpl, heap_id[j]) < 0) + if(H5HF_remove(fh, heap_id[j]) < 0) FAIL_STACK_ERROR - if(H5HF_insert(fh, dxpl, (sizeof(obj2)), &obj2, heap_id[j]) < 0) + if(H5HF_insert(fh, (sizeof(obj2)), &obj2, heap_id[j]) < 0) FAIL_STACK_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object */ HDmemset(heap_id[i], 0, id_len); - if(H5HF_insert(fh, dxpl, (sizeof(obj1)), &obj1, heap_id[i]) < 0) + if(H5HF_insert(fh, (sizeof(obj1)), &obj1, heap_id[i]) < 0) FAIL_STACK_ERROR } /* end for */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -7718,7 +7678,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7746,7 +7706,6 @@ static unsigned test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7762,7 +7721,7 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -7770,12 +7729,12 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7794,7 +7753,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7820,7 +7779,6 @@ static unsigned test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7836,7 +7794,7 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -7844,11 +7802,11 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7859,12 +7817,12 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); state.man_alloc_size += DBLOCK_SIZE(fh, 0); state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7883,7 +7841,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7909,7 +7867,6 @@ static unsigned test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7925,17 +7882,17 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill first row of direct blocks */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7954,7 +7911,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7980,7 +7937,6 @@ static unsigned test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7996,19 +7952,19 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill first two rows of direct blocks */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_root_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8027,7 +7983,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8053,7 +8009,6 @@ static unsigned test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8069,23 +8024,23 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill first two rows of direct blocks */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_root_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_root_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_root_row(fh, dxpl, 3, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 3, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8104,7 +8059,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8130,7 +8085,6 @@ static unsigned test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8146,17 +8100,17 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8175,7 +8129,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8201,7 +8155,6 @@ static unsigned test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8217,21 +8170,21 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8250,7 +8203,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8276,7 +8229,6 @@ static unsigned test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8292,25 +8244,25 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8329,7 +8281,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8360,7 +8312,6 @@ static unsigned test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8376,7 +8327,7 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1; @@ -8387,12 +8338,12 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 0); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8411,7 +8362,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8438,7 +8389,6 @@ static unsigned test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8454,7 +8404,7 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -8467,30 +8417,30 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 0); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the heap block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 2) - obj_size; - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert second "real" object, which should go in earlier direct block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8509,7 +8459,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8537,7 +8487,6 @@ static unsigned test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8554,7 +8503,7 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -8567,40 +8516,40 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 0); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the heap block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 2) - obj_size; - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add rows of blocks to "backfill" direct blocks that were skipped */ - if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert another object, which should extend direct blocks, instead of backfill */ state.man_alloc_size += DBLOCK_SIZE(fh, 2); - if(add_obj(fh, dxpl, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8619,7 +8568,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8647,7 +8596,6 @@ static unsigned test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8663,7 +8611,7 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -8671,11 +8619,11 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -8689,12 +8637,12 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t state.man_free_space += (cparam->managed.width - 1 )* DBLOCK_FREE(fh, 0); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8713,7 +8661,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8744,7 +8692,6 @@ static unsigned test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8762,7 +8709,7 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -8770,11 +8717,11 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -8788,29 +8735,29 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes state.man_free_space += (cparam->managed.width - 1 )* DBLOCK_FREE(fh, 0); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (smaller) heap block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 0) - SMALL_OBJ_SIZE1; - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill remainder of 2 * start size block */ obj_size = (size_t)DBLOCK_FREE(fh, 2) - ((size_t)DBLOCK_SIZE(fh, 0) + 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining rows of the starting block size */ @@ -8818,26 +8765,26 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes /* Fill remainder of first row of direct heap blocks up */ for(v = 0; v < (cparam->managed.width - 1); v++) { state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Fill second row of direct blocks */ - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to create new 2 * start size direct block */ state.man_alloc_size += DBLOCK_SIZE(fh, 2); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8856,7 +8803,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8889,7 +8836,6 @@ static unsigned test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8907,7 +8853,7 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -8915,22 +8861,22 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert small object, to create root indirect block */ state.man_size += (cparam->managed.width - 1) * DBLOCK_SIZE(fh, 0); state.man_alloc_size += DBLOCK_SIZE(fh, 0); state.man_free_space += (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -8944,67 +8890,67 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (smaller) heap block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 0) - SMALL_OBJ_SIZE1; - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill remainder of 4 * start size block */ obj_size = (size_t)DBLOCK_FREE(fh, 3) - ((size_t)DBLOCK_SIZE(fh, 2) + 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining heaps in first row */ for(u = 0; u < (cparam->managed.width - 2); u++) { /* Fill a direct heap block up */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining heaps in second row */ - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining heaps in third row */ - if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to create new 4 * start size direct block */ state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9023,7 +8969,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9055,7 +9001,6 @@ static unsigned test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9072,16 +9017,16 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill first row of direct blocks */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9095,46 +9040,46 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 3); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill remainder of 4 * start size block */ obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining heaps in second row */ - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining heaps in third row */ - if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to create new 4 * start size direct block */ state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9153,7 +9098,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9182,7 +9127,6 @@ static unsigned test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9201,7 +9145,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -9220,7 +9164,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ */ obj_size = (size_t)DBLOCK_SIZE(fh, row - 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, row - 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Compute heap size & free space when all direct blocks allocated */ @@ -9237,12 +9181,12 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ obj_size = (size_t)DBLOCK_SIZE(fh, num_direct_rows - 2) + 1; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, num_direct_rows - 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Compute heap size & free space when root indirect block doubles again */ @@ -9257,12 +9201,12 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ */ obj_size = (size_t)DBLOCK_SIZE(fh, num_direct_rows - 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, num_direct_rows - 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9281,7 +9225,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9309,7 +9253,6 @@ static unsigned test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9326,16 +9269,16 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9343,49 +9286,49 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea */ obj_size = (size_t)DBLOCK_SIZE(fh, 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add rows of blocks to "backfill" direct blocks that were skipped */ - if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (biggest) heap block created */ obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill direct block heaps with 2 * initial block size in nested indirect block */ - if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to create new 4 * start size direct block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9404,7 +9347,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9433,7 +9376,6 @@ static unsigned test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9453,7 +9395,7 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -9461,11 +9403,11 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9474,46 +9416,46 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of direct blocks that are smaller than large object's block size */ for(row = 0; row < num_first_indirect_rows; row++) { /* Fill rows of direct blocks in skipped indirect blocks */ for(u = 0; u < cparam->managed.width; u++) - if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids)) + if(fill_row(fh, row, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill row of direct blocks in largest (i.e. non-skipped) indirect block */ - if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids)) + if(fill_row(fh, row, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9532,7 +9474,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9562,7 +9504,6 @@ static unsigned test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9581,7 +9522,7 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -9589,21 +9530,21 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row (except one) of 2nd level indirect blocks */ for(u = 0; u < cparam->managed.width - 1; u++) /* Fill all rows of 2nd level indirect blocks in root block */ - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9615,20 +9556,20 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in 2nd level indirect block's direct blocks @@ -9636,27 +9577,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); */ for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in skipped 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in current 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9675,7 +9616,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9708,7 +9649,6 @@ static unsigned test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9728,7 +9668,7 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -9736,11 +9676,11 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9752,20 +9692,20 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object too large for initial block size in skipped indirect blocks */ @@ -9774,11 +9714,11 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, 4); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (medium) block just created */ @@ -9786,52 +9726,52 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #ifdef QAK HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Finish off blocks in row of medium block size (just to make row filling easier below) */ obj_size = (size_t)DBLOCK_FREE(fh, 4); for(u = 1; u < cparam->managed.width; u++) { state.man_alloc_size += DBLOCK_SIZE(fh, 4); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of direct blocks that are smaller than large object's block size */ for(row = 0; row < num_first_indirect_rows; row++) { /* Fill rows of direct blocks in skipped indirect blocks */ for(u = 0; u < cparam->managed.width; u++) - if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids)) + if(fill_row(fh, row, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill row of direct blocks in largest (i.e. non-skipped) indirect block */ /* (Skip the row of blocks filled above) */ if(row != 4) - if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids)) + if(fill_row(fh, row, fill_size, &state, &keep_ids)) TEST_ERROR } /* end while */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9850,7 +9790,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9878,7 +9818,6 @@ static unsigned test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9898,7 +9837,7 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -9907,11 +9846,11 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ max_dblock_rows = DTABLE_MAX_DROWS(fh); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9919,71 +9858,71 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ */ obj_size = (size_t)DBLOCK_SIZE(fh, max_dblock_rows - 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (biggest) heap block created */ obj_size = (size_t)DBLOCK_FREE(fh, max_dblock_rows - 1) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in indirect block's direct blocks */ for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in first row of skipped 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block rows in second row of skipped 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in used 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows in second row of skipped 2nd level indirect blocks (and used 2nd level block) */ /* Direct block rows in skipped 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids)) + if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Direct block row in used 2nd level indirect block */ - if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids)) + if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10002,7 +9941,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10032,7 +9971,6 @@ static unsigned test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10052,7 +9990,7 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -10061,11 +9999,11 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t max_dblock_rows = DTABLE_MAX_DROWS(fh); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of two rows of indirect blocks and @@ -10073,20 +10011,20 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t */ obj_size = (size_t)DBLOCK_SIZE(fh, max_dblock_rows - 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (biggest) heap block created */ obj_size = (size_t)DBLOCK_FREE(fh, max_dblock_rows - 1) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object that can't fit in first row of indirect blocks @@ -10095,76 +10033,76 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t */ obj_size = (size_t)DBLOCK_SIZE(fh, max_dblock_rows - 3) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 2); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (2nd biggest) heap block created */ obj_size = (size_t)DBLOCK_FREE(fh, max_dblock_rows - 2) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in indirect block's direct blocks */ for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in first row of skipped 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block rows in second row of skipped 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in used 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows in second row of skipped 2nd level indirect blocks (and used 2nd level block) */ /* Finish blocks in partially used 2nd level indirect block */ - if(fill_partial_row(fh, dxpl, num_first_indirect_rows, cparam->managed.width - 1, fill_size, &state, &keep_ids)) + if(fill_partial_row(fh, num_first_indirect_rows, cparam->managed.width - 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block rows in skipped 2nd level indirect blocks */ /* (less the one indirect block already used) */ for(v = 0; v < cparam->managed.width - 1; v++) - if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids)) + if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Direct block row in used 3rd row 2nd level indirect block */ - if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids)) + if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10183,7 +10121,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10212,7 +10150,6 @@ static unsigned test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10229,24 +10166,24 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -10255,43 +10192,43 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t */ obj_size = (size_t)DBLOCK_SIZE(fh, 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in 3rd level indirect block's direct blocks */ - if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10310,7 +10247,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10341,7 +10278,6 @@ static unsigned test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10358,32 +10294,32 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -10392,45 +10328,45 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H */ obj_size = (size_t)DBLOCK_SIZE(fh, 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (3rd level indirect block's) 2nd level * indirect block's direct blocks */ - if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10449,7 +10385,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10479,7 +10415,6 @@ static unsigned test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10498,7 +10433,7 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -10506,27 +10441,27 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -10538,20 +10473,20 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (first 3rd level indirect block's) 2nd level @@ -10561,27 +10496,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 3rd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10600,7 +10535,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10631,7 +10566,6 @@ static unsigned test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10650,7 +10584,7 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -10661,27 +10595,27 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); #endif /* QAK */ /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -10693,11 +10627,11 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows + 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ @@ -10705,11 +10639,11 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #ifdef QAK HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (first 3rd level indirect block's) 2nd level @@ -10719,31 +10653,31 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 3rd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Fill row of direct blocks in second 3rd level indirect block */ - if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids)) + if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows + 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10762,7 +10696,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10794,7 +10728,6 @@ static unsigned test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10813,7 +10746,7 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -10821,37 +10754,37 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in root indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row (except one) of 3rd level indirect blocks */ for(u = 0; u < cparam->managed.width - 1; u++) /* Fill 3rd level indirect block */ - if(fill_3rd_indirect(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_3rd_indirect(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in last third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -10863,20 +10796,20 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in 2nd level indirect block's direct blocks @@ -10885,27 +10818,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in current 3rd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10924,7 +10857,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10957,7 +10890,6 @@ static unsigned test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10976,7 +10908,7 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -10984,44 +10916,44 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in 4th level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row of 3rd level indirect blocks */ - if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_3rd_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 2nd row third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row (except one) of 2nd level indirect blocks */ for(u = 0; u < cparam->managed.width - 1; u++) - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -11033,20 +10965,20 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in 2nd level indirect block's direct blocks @@ -11054,27 +10986,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); */ for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in skipped 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in current 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11093,7 +11025,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -11124,7 +11056,6 @@ static unsigned test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11143,7 +11074,7 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -11151,35 +11082,35 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in fourth level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -11191,20 +11122,20 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (first 4th level indirect block's) 2nd level @@ -11214,27 +11145,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11253,7 +11184,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -11286,7 +11217,6 @@ static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11305,7 +11235,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -11313,51 +11243,51 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in fourth level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in fourth level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in fourth level indirect block's 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -11369,20 +11299,20 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (first 4th level indirect block's first 3rd @@ -11392,27 +11322,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 3rd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11431,7 +11361,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -11466,7 +11396,6 @@ static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11485,7 +11414,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -11493,31 +11422,31 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row of 4th level indirect blocks */ - if(fill_4th_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_4th_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Account for root indirect block doubling # of rows again */ @@ -11538,39 +11467,39 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ } /* end if */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 2nd row 4th level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in 2nd row 4th level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row of 3rd level indirect blocks in 2nd row 4th level indirect block */ - if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_3rd_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 4th level indirect block's 2nd row of 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -11582,20 +11511,20 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (first block in 2nd row 4th level indirect @@ -11605,27 +11534,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 3rd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11644,7 +11573,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -11681,7 +11610,6 @@ static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11700,7 +11628,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -11708,66 +11636,66 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 4th level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in 4th level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row (except one) of 3rd level indirect blocks in 4th level indirect block */ for(u = 0; u < cparam->managed.width - 1; u++) { /* Fill all direct block rows in 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill row of 2nd level indirect blocks in 3rd level indirect block */ - if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_2nd_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 4th level indirect block's last 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -11779,20 +11707,20 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (4th level indirect block's first 3rd level @@ -11802,27 +11730,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 4th level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11841,7 +11769,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -11878,7 +11806,6 @@ static unsigned test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11897,7 +11824,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -11905,81 +11832,81 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row (except one) of 4th level indirect blocks */ for(u = 0; u < cparam->managed.width - 1; u++) { /* Fill all direct block rows in 4th level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in 4th level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill row of 3rd level indirect blocks in 4th level indirect block */ - if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_3rd_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 4th level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in 4th level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill row (except one) of 3rd level indirect blocks in 4th level indirect block */ for(u = 0; u < cparam->managed.width - 1; u++) { /* Fill all direct block rows in 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill row of 2nd level indirect blocks in 3rd level indirect block */ - if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_2nd_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 4th level indirect block's last 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Account for root indirect block doubling # of rows again */ @@ -12000,7 +11927,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ } /* end if */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -12012,20 +11939,20 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (4th level indirect block's first 3rd level @@ -12035,27 +11962,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 4th level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12074,7 +12001,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12106,7 +12033,6 @@ static unsigned test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12123,7 +12049,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -12136,7 +12062,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar state.man_free_space = DBLOCK_FREE(fh, 0); for(u = 0; u < cparam->managed.width; u++) { state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR if(u == 0) { state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); @@ -12147,12 +12073,12 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar state.man_free_space += DBLOCK_FREE(fh, 1) * cparam->managed.width; for(u = 0; u < cparam->managed.width; u++) { state.man_alloc_size += DBLOCK_SIZE(fh, 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* (Account for doubling root indirect block for rows 3-4 */ @@ -12163,34 +12089,34 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Add one more object, to create a 2 * start_block_size block */ state.man_alloc_size += DBLOCK_SIZE(fh, 2); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Go back and fill in direct blocks of initial block size (which have large free space in them) */ obj_size = (size_t)DBLOCK_FREE(fh, 0) - obj_size; for(u = 0; u < cparam->managed.width; u++) - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR for(u = 0; u < cparam->managed.width; u++) - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill in 2 * start_block_size block */ obj_size = (size_t)DBLOCK_FREE(fh, 2) - ((size_t)DBLOCK_SIZE(fh, 0) / 2); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12209,7 +12135,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12238,7 +12164,6 @@ static unsigned test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12256,7 +12181,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -12272,7 +12197,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* First row */ for(u = 0; u < cparam->managed.width; u++) { state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR if(u == 0) { state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); @@ -12284,12 +12209,12 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Second row */ for(u = 0; u < cparam->managed.width; u++) { state.man_alloc_size += DBLOCK_SIZE(fh, 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* (Account for doubling root indirect block for rows 3-4 */ @@ -12303,13 +12228,13 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar obj_size = (size_t)DBLOCK_SIZE(fh, u + 2) / 2; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, u + 2); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* (Account for doubling root indirect block for rows 5-8 */ @@ -12323,13 +12248,13 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar obj_size = (size_t)DBLOCK_SIZE(fh, u + 4) / 2; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, u + 4); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* (Account for doubling root indirect block for rows 9-16 */ @@ -12342,25 +12267,25 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar obj_size = (size_t)DBLOCK_SIZE(fh, 8) / 2; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, 8); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Go back and backfill all root block's direct blocks */ for(u = 0; u < root_direct_rows; u++) { obj_size = (size_t)DBLOCK_FREE(fh, u) - ((size_t)DBLOCK_SIZE(fh, u) / 2); for(v = 0; v < cparam->managed.width; v++) - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12379,7 +12304,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12410,7 +12335,6 @@ static unsigned test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12429,7 +12353,7 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -12440,11 +12364,11 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); #endif /* QAK */ /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects small enough to fit into each direct block, but not to @@ -12454,26 +12378,26 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); obj_size = (size_t)DBLOCK_SIZE(fh, u) / 2; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, u); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Go back and backfill all 2nd level indirect block's direct blocks */ for(u = 0; u < num_first_indirect_rows; u++) { obj_size = (size_t)DBLOCK_FREE(fh, u) - ((size_t)DBLOCK_SIZE(fh, u) / 2); for(v = 0; v < cparam->managed.width; v++) - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12492,7 +12416,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12524,7 +12448,6 @@ static unsigned test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12543,7 +12466,7 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -12551,19 +12474,19 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * root_direct_rows = DTABLE_MAX_DROWS(fh); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in root indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects small enough to fit into each direct block, but not to @@ -12573,26 +12496,26 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * obj_size = (size_t)DBLOCK_SIZE(fh, u) / 2; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, u); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Go back and backfill all 3rd level indirect block's direct blocks */ for(u = 0; u < root_direct_rows; u++) { obj_size = (size_t)DBLOCK_FREE(fh, u) - ((size_t)DBLOCK_SIZE(fh, u) / 2); for(v = 0; v < cparam->managed.width; v++) - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12611,7 +12534,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12639,7 +12562,6 @@ static unsigned test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12660,7 +12582,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -12675,7 +12597,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -12683,7 +12605,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12693,12 +12615,12 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -12706,11 +12628,11 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Delete individual objects, if we won't be deleting the entire heap later */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12722,14 +12644,14 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -12766,7 +12688,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12792,7 +12714,6 @@ static unsigned test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12814,7 +12735,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -12831,7 +12752,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -12839,7 +12760,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12849,19 +12770,19 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert second object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -12869,7 +12790,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12879,12 +12800,12 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in second huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -12893,11 +12814,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12907,11 +12828,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12922,11 +12843,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar } /* end if */ else { /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12936,11 +12857,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12953,14 +12874,14 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -12999,7 +12920,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -13025,7 +12946,6 @@ static unsigned test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13048,7 +12968,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -13067,7 +12987,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp /* Insert first object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -13075,7 +12995,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13085,19 +13005,19 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Read in first huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert second object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -13105,7 +13025,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13115,19 +13035,19 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Read in second huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert third object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 3; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id3) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id3) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id3, &obj_type) < 0) FAIL_STACK_ERROR @@ -13135,7 +13055,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13145,12 +13065,12 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Read in third huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id3, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -13159,13 +13079,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13175,13 +13095,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13191,13 +13111,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13208,13 +13128,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp } /* end if */ else { /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13224,13 +13144,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13240,13 +13160,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Remove first object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13259,14 +13179,14 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -13307,7 +13227,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -13333,7 +13253,6 @@ static unsigned test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13358,7 +13277,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -13381,7 +13300,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert first object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -13389,7 +13308,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13399,19 +13318,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in first huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert second object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -13419,7 +13338,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13429,19 +13348,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in second huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert third object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 3; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id3) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id3) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id3, &obj_type) < 0) FAIL_STACK_ERROR @@ -13449,7 +13368,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13459,19 +13378,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in third huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id3, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert fourth object small enough to fit into 'normal' heap blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id4) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id4) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id4, &obj_type) < 0) FAIL_STACK_ERROR @@ -13479,7 +13398,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13496,19 +13415,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in fourth ('normal') object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id4, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id4, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id4, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id4, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert fifth object small enough to fit into 'normal' heap blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 3) + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id5) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id5) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id5, &obj_type) < 0) FAIL_STACK_ERROR @@ -13516,7 +13435,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13534,12 +13453,12 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in fifth ('normal') object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id5, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id5, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id5, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id5, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -13548,13 +13467,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13564,13 +13483,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13580,13 +13499,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13596,36 +13515,36 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove fourth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id4) < 0) + if(H5HF_remove(fh, heap_id4) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Remove fifth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id5) < 0) + if(H5HF_remove(fh, heap_id5) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end if */ else { /* Remove fifth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id5) < 0) + if(H5HF_remove(fh, heap_id5) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Remove fourth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id4) < 0) + if(H5HF_remove(fh, heap_id4) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Reset 'managed' object statistics after they are all removed */ @@ -13635,13 +13554,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar state.man_free_space = 0; /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13651,13 +13570,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13667,11 +13586,11 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end else */ @@ -13683,14 +13602,14 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -13735,7 +13654,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -13759,7 +13678,6 @@ static unsigned test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13794,7 +13712,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam } /* end if */ /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Perform common test initialization operations */ @@ -13829,7 +13747,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam /* Insert object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -13837,13 +13755,13 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* QAK */ #ifdef QAK /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -13864,7 +13782,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR #endif /* QAK */ /* QAK */ @@ -13876,12 +13794,12 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam TEST_ERROR /* Read in huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -13889,11 +13807,11 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam /* Delete individual objects, if we won't be deleting the entire heap later */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13904,14 +13822,14 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam } /* end if */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -13947,7 +13865,7 @@ error: H5E_BEGIN_TRY { H5MM_xfree(heap_id); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -13975,7 +13893,6 @@ static unsigned test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13996,7 +13913,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -14011,7 +13928,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert object small enough to encode in heap ID */ obj_size = tparam->actual_id_len - 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -14019,7 +13936,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14029,12 +13946,12 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in tiny object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -14042,11 +13959,11 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Delete individual objects, if we won't be deleting the entire heap later */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14058,14 +13975,14 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -14102,7 +14019,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -14128,7 +14045,6 @@ static unsigned test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -14150,7 +14066,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -14167,7 +14083,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert object small enough to encode in heap ID */ obj_size = tparam->actual_id_len - 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -14175,7 +14091,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14185,19 +14101,19 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in tiny object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert second object small enough to encode in heap ID */ obj_size = tparam->actual_id_len - 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -14205,7 +14121,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14215,12 +14131,12 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in second tiny object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -14229,11 +14145,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14243,11 +14159,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14258,11 +14174,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar } /* end if */ else { /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14272,11 +14188,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14289,14 +14205,14 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -14335,7 +14251,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -14362,7 +14278,6 @@ static unsigned test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -14389,7 +14304,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -14416,7 +14331,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert first object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -14424,7 +14339,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14434,26 +14349,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in first huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on first huge object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert second object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -14461,7 +14376,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14471,26 +14386,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in second huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on second huge object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id2, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id2, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert third object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 3; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id3) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id3) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id3, &obj_type) < 0) FAIL_STACK_ERROR @@ -14498,7 +14413,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14508,26 +14423,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in third huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id3, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on third huge object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id3, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id3, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert fourth object small enough to fit into 'normal' heap blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id4) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id4) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id4, &obj_type) < 0) FAIL_STACK_ERROR @@ -14535,7 +14450,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14552,26 +14467,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in fourth ('normal') object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id4, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id4, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id4, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id4, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on fourth ('normal') object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id4, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id4, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert fifth object small enough to fit into 'normal' heap blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 3) + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id5) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id5) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id5, &obj_type) < 0) FAIL_STACK_ERROR @@ -14579,7 +14494,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14597,19 +14512,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in fifth ('normal') object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id5, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id5, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id5, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id5, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on fifth ('normal') object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id5, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id5, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -14617,7 +14532,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert sixth object small enough to encode in heap ID */ obj_size = tparam->actual_id_len - 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id6) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id6) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id6, &obj_type) < 0) FAIL_STACK_ERROR @@ -14625,7 +14540,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14635,26 +14550,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in tiny object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id6, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id6, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id6, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id6, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on sixth ('tiny') object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id6, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id6, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert seventh object small enough to encode in heap ID */ obj_size = tparam->actual_id_len - 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id7) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id7) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id7, &obj_type) < 0) FAIL_STACK_ERROR @@ -14662,7 +14577,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14672,19 +14587,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in tiny object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id7, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id7, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id7, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id7, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on seventh ('tiny') object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id7, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id7, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -14693,13 +14608,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14709,13 +14624,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14725,13 +14640,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14741,19 +14656,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove fourth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id4) < 0) + if(H5HF_remove(fh, heap_id4) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Remove fifth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id5) < 0) + if(H5HF_remove(fh, heap_id5) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Reset 'managed' object statistics after they are all removed */ @@ -14763,13 +14678,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar state.man_free_space = 0; /* Remove sixth object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id6, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id6, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id6) < 0) + if(H5HF_remove(fh, heap_id6) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14779,22 +14694,22 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove seventh object from heap */ - if(H5HF_remove(fh, dxpl, heap_id7) < 0) + if(H5HF_remove(fh, heap_id7) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end if */ else { /* Remove seventh object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id7, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id7, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id7) < 0) + if(H5HF_remove(fh, heap_id7) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14804,13 +14719,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove sixth object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id6, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id6, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id6) < 0) + if(H5HF_remove(fh, heap_id6) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14820,19 +14735,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove fifth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id5) < 0) + if(H5HF_remove(fh, heap_id5) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Remove fourth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id4) < 0) + if(H5HF_remove(fh, heap_id4) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Reset 'managed' object statistics after they are all removed */ @@ -14842,13 +14757,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar state.man_free_space = 0; /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14858,13 +14773,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14874,11 +14789,11 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end else */ @@ -14890,14 +14805,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -14946,7 +14861,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -14973,7 +14888,6 @@ static unsigned test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15001,7 +14915,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para FAIL_STACK_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Perform common test initialization operations */ @@ -15011,7 +14925,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para /* Insert object small enough to fit into direct heap block */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) / 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -15019,11 +14933,11 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15044,7 +14958,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15056,12 +14970,12 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para TEST_ERROR /* Read in ('normal') object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -15069,13 +14983,13 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para /* Delete individual objects, if we won't be deleting the entire heap later */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Remove object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -15085,14 +14999,14 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para } /* end if */ /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -15125,7 +15039,7 @@ HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_si error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -15149,7 +15063,6 @@ static unsigned test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15178,7 +15091,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Perform common test initialization operations */ @@ -15188,7 +15101,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Insert object #1, small enough to fit into direct heap block */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) / 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id1) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id1) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id1, &obj_type) < 0) FAIL_STACK_ERROR @@ -15196,12 +15109,12 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object #2, small enough to fit into direct heap block */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) / 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -15209,7 +15122,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15230,7 +15143,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15242,23 +15155,23 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Read in ('normal') object #1 */ - if(H5HF_get_obj_len(fh, dxpl, heap_id1, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id1, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id1, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id1, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Read in ('normal') object #2 */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -15267,13 +15180,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove object #1 from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id1, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id1, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15294,13 +15207,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Remove object #2 from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15309,7 +15222,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15330,7 +15243,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15340,13 +15253,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa } /* end if */ else { /* Remove object #2 from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15367,13 +15280,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Remove object #1 from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id1, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id1, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15382,7 +15295,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15403,7 +15316,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15414,14 +15327,14 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa } /* end if */ /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -15454,7 +15367,7 @@ HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_si error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -15484,7 +15397,6 @@ static unsigned test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15518,7 +15430,7 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa } /* end if */ /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Get information about heap ID lengths */ @@ -15559,11 +15471,11 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); obj_loc = (tmp_cparam.max_man_size + 255) - obj_size; /* Insert object */ - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Increment the amount of objects added */ @@ -15598,11 +15510,11 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % /* Delete objects inserted */ for(u = 0; u < keep_ids.num_ids; u++) { /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, &keep_ids.ids[id_len * u]) < 0) + if(H5HF_remove(fh, &keep_ids.ids[id_len * u]) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end for */ @@ -15612,14 +15524,14 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % } /* end if */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -15659,7 +15571,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -15688,7 +15600,6 @@ static unsigned test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15722,7 +15633,7 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te } /* end if */ /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Get information about heap ID lengths */ @@ -15775,11 +15686,11 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); obj_loc = (tmp_cparam.max_man_size + 255) - obj_size; /* Insert object */ - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Increment the amount of objects added */ @@ -15814,11 +15725,11 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % /* Delete objects inserted */ for(u = 0; u < keep_ids.num_ids; u++) { /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, &keep_ids.ids[id_len * u]) < 0) + if(H5HF_remove(fh, &keep_ids.ids[id_len * u]) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end for */ @@ -15828,14 +15739,14 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % } /* end if */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -15876,7 +15787,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -15914,7 +15825,6 @@ static unsigned test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15973,7 +15883,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) } /* end if */ /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Get information about heap ID lengths */ @@ -15985,16 +15895,16 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) /* Create 'tiny' and 'huge' objects */ obj_size = id_len / 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, tiny_heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, tiny_heap_id) < 0) FAIL_STACK_ERROR obj_size = tmp_cparam.max_man_size + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, huge_heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, huge_heap_id) < 0) FAIL_STACK_ERROR /* Verify that writing to 'huge' objects works for un-filtered heaps */ H5E_BEGIN_TRY { - ret = H5HF_write(fh, dxpl, huge_heap_id, &id_changed, shared_wobj_g); + ret = H5HF_write(fh, huge_heap_id, &id_changed, shared_wobj_g); } H5E_END_TRY; HDassert(!id_changed); if(tparam->comp == FHEAP_TEST_COMPRESS) { @@ -16008,14 +15918,14 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) /* Verify that writing to 'tiny' objects return failure (for now) */ H5E_BEGIN_TRY { - ret = H5HF_write(fh, dxpl, tiny_heap_id, &id_changed, shared_wobj_g); + ret = H5HF_write(fh, tiny_heap_id, &id_changed, shared_wobj_g); } H5E_END_TRY; HDassert(!id_changed); if(ret >= 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16044,7 +15954,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Initialize data to overwrite with */ @@ -16056,20 +15966,20 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) obj_size = 20; for(u = 0; u < 40; u++) { obj_loc = u; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Overwrite data just written */ - if(H5HF_write(fh, dxpl, &keep_ids.ids[id_len * u], &id_changed, rewrite_obj) < 0) + if(H5HF_write(fh, &keep_ids.ids[id_len * u], &id_changed, rewrite_obj) < 0) FAIL_STACK_ERROR HDassert(!id_changed); /* Read data back in */ - if(H5HF_read(fh, dxpl, &keep_ids.ids[id_len * u], shared_robj_g) < 0) + if(H5HF_read(fh, &keep_ids.ids[id_len * u], shared_robj_g) < 0) FAIL_STACK_ERROR /* Compare data read in */ @@ -16084,7 +15994,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) } /* end for */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16111,14 +16021,14 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Verify changed objects */ obj_size = 20; for(u = 0; u < 40; u++) { /* Read data back in */ - if(H5HF_read(fh, dxpl, &keep_ids.ids[id_len * u], shared_robj_g) < 0) + if(H5HF_read(fh, &keep_ids.ids[id_len * u], shared_robj_g) < 0) FAIL_STACK_ERROR /* Compare data read in */ @@ -16133,7 +16043,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) } /* end for */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16163,7 +16073,7 @@ error: H5MM_xfree(keep_ids.offs); H5MM_xfree(rewrite_obj); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -16191,7 +16101,6 @@ static unsigned test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -16212,7 +16121,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t)); /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Get information about heap ID lengths */ @@ -16224,36 +16133,36 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) /* Insert objects */ obj_size = 44; obj_loc = 1; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR obj_size = 484; obj_loc = 2; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR obj_size = 168; obj_loc = 3; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR obj_size = 96; obj_loc = 4; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR obj_size = 568; obj_loc = 5; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR obj_size = 568; obj_loc = 6; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16276,15 +16185,15 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Remove one of the objects */ - if(H5HF_remove(fh, dxpl, &keep_ids.ids[id_len * 4]) < 0) + if(H5HF_remove(fh, &keep_ids.ids[id_len * 4]) < 0) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16306,17 +16215,17 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Insert another object */ obj_size = 208; obj_loc = 6; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16341,7 +16250,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -16379,6 +16288,7 @@ main(void) int ExpressMode; /* Express testing level */ const char *envval; /* Environment variable */ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Don't run this test using certain file drivers */ envval = HDgetenv("HDF5_DRIVER"); @@ -16417,6 +16327,8 @@ main(void) /* Initialize heap creation parameters */ init_small_cparam(&small_cparam); init_large_cparam(&large_cparam); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Allocate space for the shared objects */ shared_obj_size_g = large_cparam.max_man_size + 256; @@ -16838,6 +16750,8 @@ main(void) /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; @@ -16854,11 +16768,7 @@ main(void) if(H5Pclose(pb_fapl) < 0) TEST_ERROR /* Clean up file used */ -#ifndef QAK h5_cleanup(FILENAME, def_fapl); -#else /* QAK */ -HDfprintf(stderr, "Uncomment cleanup!\n"); -#endif /* QAK */ return 0; diff --git a/test/freespace.c b/test/freespace.c index 39c5688..ebc7840 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -23,6 +23,8 @@ /* Other private headers that this test requires */ #define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "H5Fpkg.h" + +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" #include "H5VMprivate.h" @@ -446,7 +448,6 @@ static unsigned test_fs_create(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -456,6 +457,7 @@ test_fs_create(hid_t fapl) H5FS_create_t cparam, test_cparam; /* creation parameters */ uint16_t nclasses; unsigned init_flags=0; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("the creation/close/reopen/deletion of the free-space manager"); @@ -477,6 +479,8 @@ test_fs_create(hid_t fapl) /* Re-open the file */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -486,13 +490,10 @@ test_fs_create(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -512,12 +513,12 @@ test_fs_create(hid_t fapl) FAIL_STACK_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* reopen the free-space manager */ - if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, + if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses, test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -527,12 +528,12 @@ test_fs_create(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -547,10 +548,8 @@ test_fs_create(hid_t fapl) /* Verify the file is the correct size */ if(file_size != empty_size) TEST_ERROR - - /* Close the dxpl */ - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -559,9 +558,9 @@ test_fs_create(hid_t fapl) error: H5E_BEGIN_TRY { if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_create() */ @@ -595,7 +594,6 @@ static unsigned test_fs_sect_add(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl_id (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -608,6 +606,7 @@ test_fs_sect_add(hid_t fapl) unsigned init_flags=0; h5_stat_size_t file_size=0, tmp_file_size=0, fr_meta_size=0; unsigned can_shrink=FALSE; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("adding a section via H5FS_sect_add() to free-space: test 1"); @@ -628,6 +627,8 @@ test_fs_sect_add(hid_t fapl) /* Re-open the file */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -636,13 +637,10 @@ test_fs_sect_add(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -654,7 +652,7 @@ test_fs_sect_add(hid_t fapl) init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -669,7 +667,7 @@ test_fs_sect_add(hid_t fapl) fr_meta_size = H5FS_HEADER_SIZE(f) + H5FS_SINFO_PREFIX_SIZE(f); /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; @@ -704,7 +702,7 @@ test_fs_sect_add(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = H5FS_CLS_GHOST_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -717,7 +715,7 @@ test_fs_sect_add(hid_t fapl) init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, 0, NULL) < 0) FAIL_STACK_ERROR @@ -732,7 +730,7 @@ test_fs_sect_add(hid_t fapl) fr_meta_size = H5FS_HEADER_SIZE(f); /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -776,7 +774,7 @@ test_fs_sect_add(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = 0; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -791,7 +789,7 @@ test_fs_sect_add(hid_t fapl) */ init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -802,12 +800,12 @@ test_fs_sect_add(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -845,7 +843,7 @@ test_fs_sect_add(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = 0; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -860,7 +858,7 @@ test_fs_sect_add(hid_t fapl) */ init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_DESERIALIZING, &can_shrink) < 0) FAIL_STACK_ERROR @@ -872,7 +870,7 @@ test_fs_sect_add(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -881,20 +879,20 @@ test_fs_sect_add(hid_t fapl) sect_node = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -905,9 +903,9 @@ error: if(sect_node) TEST_sect_free((H5FS_section_info_t *)sect_node); if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_add() */ @@ -937,7 +935,6 @@ static unsigned test_fs_sect_find(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -950,6 +947,7 @@ test_fs_sect_find(hid_t fapl) TEST_free_section_t *node; htri_t node_found = FALSE; unsigned init_flags=0; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("H5FS_sect_find(): free-space is empty"); @@ -959,6 +957,8 @@ test_fs_sect_find(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -967,13 +967,10 @@ test_fs_sect_find(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -985,7 +982,7 @@ test_fs_sect_find(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -995,7 +992,7 @@ test_fs_sect_find(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; @@ -1004,7 +1001,7 @@ test_fs_sect_find(hid_t fapl) TESTING("H5FS_sect_find() a section equal to requested-size from free-space"); /* reopen the free-space manager */ - if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses, + if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses, test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1021,7 +1018,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1042,7 +1039,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node3, (haddr_t)(TEST_SECT_ADDR200), (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1061,7 +1058,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1080,7 +1077,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR300, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1091,7 +1088,7 @@ test_fs_sect_find(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1104,11 +1101,11 @@ test_fs_sect_find(hid_t fapl) TEST_ERROR /* remove sections A, C and D */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0) FAIL_STACK_ERROR - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node3) < 0) FAIL_STACK_ERROR - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node4) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -1123,7 +1120,7 @@ test_fs_sect_find(hid_t fapl) sect_node4 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; @@ -1132,7 +1129,7 @@ test_fs_sect_find(hid_t fapl) TESTING("H5FS_sect_find() a section greater than requested-size from free-space"); /* reopen the free-space manager */ - if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses, + if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses, test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1149,7 +1146,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1169,7 +1166,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1180,7 +1177,7 @@ test_fs_sect_find(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1194,7 +1191,7 @@ test_fs_sect_find(hid_t fapl) node = NULL; /* remove sections A */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -1203,7 +1200,7 @@ test_fs_sect_find(hid_t fapl) sect_node1 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; @@ -1212,7 +1209,7 @@ test_fs_sect_find(hid_t fapl) TESTING("H5FS_sect_find(): cannot find a section with requested-size from free-space"); /* reopen the free-space manager */ - if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses, + if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses, test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1229,7 +1226,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1241,14 +1238,14 @@ test_fs_sect_find(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if (node_found) TEST_ERROR /* remove sections A */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -1257,20 +1254,20 @@ test_fs_sect_find(hid_t fapl) sect_node1 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -1285,9 +1282,9 @@ error: if(sect_node4) TEST_sect_free((H5FS_section_info_t *)sect_node4); if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_find() */ @@ -1329,7 +1326,6 @@ static unsigned test_fs_sect_merge(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -1342,6 +1338,7 @@ test_fs_sect_merge(hid_t fapl) unsigned init_flags=0; htri_t node_found = FALSE; TEST_free_section_t *node; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("the merge of sections when H5FS_sect_add() to free-space: test 1"); @@ -1354,6 +1351,8 @@ test_fs_sect_merge(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -1362,13 +1361,10 @@ test_fs_sect_merge(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1383,7 +1379,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1403,7 +1399,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1421,7 +1417,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1439,7 +1435,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1451,7 +1447,7 @@ test_fs_sect_merge(hid_t fapl) /* should be able to find the merged section of A, B, C & D */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1464,12 +1460,12 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -1496,7 +1492,7 @@ test_fs_sect_merge(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = H5FS_CLS_SEPAR_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1511,7 +1507,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1531,7 +1527,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1544,17 +1540,17 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* should not be able to find the merged section of A & B */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if (node_found) TEST_ERROR /* remove section A from free-space */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0) FAIL_STACK_ERROR /* remove section B from free-space */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node2) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -1566,12 +1562,12 @@ test_fs_sect_merge(hid_t fapl) sect_node2 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -1598,7 +1594,7 @@ test_fs_sect_merge(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = 0; /* reset */ - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1613,7 +1609,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1633,7 +1629,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1653,7 +1649,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1671,7 +1667,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1687,14 +1683,14 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* should not be able to find a merged section of A, B, C & D */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if (node_found) TEST_ERROR /* should be able to find the merged section of B & C */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1708,7 +1704,7 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* should be able to find section A */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE10), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1721,7 +1717,7 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* should be able to find section D */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1734,20 +1730,20 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; - /* Close the file and dxpl */ + /* Close the file */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -1760,9 +1756,9 @@ error: if(sect_node2) TEST_sect_free((H5FS_section_info_t *)sect_node2); if(frsp) - H5FS_close(f, dxpl_id, frsp); - H5Pclose(dxpl_id); + H5FS_close(f, frsp); H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_merge() */ @@ -1805,7 +1801,6 @@ static unsigned test_fs_sect_shrink(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -1819,6 +1814,7 @@ test_fs_sect_shrink(hid_t fapl) unsigned can_shrink=FALSE; htri_t node_found = FALSE; TEST_free_section_t *node; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("shrinking of sections when H5FS_sect_add() to free-space: test 1"); @@ -1828,6 +1824,8 @@ test_fs_sect_shrink(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -1838,13 +1836,10 @@ test_fs_sect_shrink(hid_t fapl) TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */ - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1860,7 +1855,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); can_shrink = FALSE; - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -1873,7 +1868,7 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* section A should still be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1894,7 +1889,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); can_shrink = FALSE; - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -1905,19 +1900,19 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* section A should not be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if (node_found) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -1945,7 +1940,7 @@ test_fs_sect_shrink(hid_t fapl) /* does not allow merging */ init_flags = H5FS_CLS_SEPAR_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1960,7 +1955,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -1980,7 +1975,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -1989,7 +1984,7 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* section B should not be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -2001,7 +1996,7 @@ test_fs_sect_shrink(hid_t fapl) /* section A should still be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE20), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -2014,12 +2009,12 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2045,7 +2040,7 @@ test_fs_sect_shrink(hid_t fapl) TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */ init_flags = 0; /* reset */ - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2060,7 +2055,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -2080,7 +2075,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -2090,7 +2085,7 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* section B should not be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -2098,27 +2093,27 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* section A should not be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE30), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if (node_found) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -2127,9 +2122,9 @@ test_fs_sect_shrink(hid_t fapl) error: H5E_BEGIN_TRY { if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_sect_shrink() */ @@ -2155,7 +2150,6 @@ static unsigned test_fs_sect_change_class(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -2167,6 +2161,7 @@ test_fs_sect_change_class(hid_t fapl) TEST_free_section_t *sect_node1=NULL, *sect_node2=NULL, *sect_node3=NULL; unsigned init_flags=0; TEST_free_section_t *node; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("the change of section class via H5FS_sect_change_class() in free-space: Test 1"); @@ -2176,6 +2171,8 @@ test_fs_sect_change_class(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -2184,14 +2181,11 @@ test_fs_sect_change_class(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); init_flags = H5FS_CLS_GHOST_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2206,7 +2200,7 @@ test_fs_sect_change_class(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2226,7 +2220,7 @@ test_fs_sect_change_class(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2237,7 +2231,7 @@ test_fs_sect_change_class(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node1, TEST_FSPACE_SECT_TYPE_NONE) < 0) TEST_ERROR @@ -2246,7 +2240,7 @@ test_fs_sect_change_class(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if(H5FS_sect_find(f, dxpl_id, frsp, + if(H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node) < 0) FAIL_STACK_ERROR @@ -2256,7 +2250,7 @@ test_fs_sect_change_class(hid_t fapl) if(TEST_sect_free((H5FS_section_info_t *)node) < 0) TEST_ERROR - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node2) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -2265,12 +2259,12 @@ test_fs_sect_change_class(hid_t fapl) sect_node2 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2297,7 +2291,7 @@ test_fs_sect_change_class(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = H5FS_CLS_SEPAR_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2312,7 +2306,7 @@ test_fs_sect_change_class(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2324,7 +2318,7 @@ test_fs_sect_change_class(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2336,17 +2330,17 @@ test_fs_sect_change_class(hid_t fapl) init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR /* change the class of B to A's class */ - if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node2, TEST_FSPACE_SECT_TYPE) < 0) TEST_ERROR /* change the class of C to A's class */ - if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3, + if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node3, TEST_FSPACE_SECT_TYPE) < 0) TEST_ERROR @@ -2356,7 +2350,7 @@ test_fs_sect_change_class(hid_t fapl) TEST_ERROR /* verify that section B has changed class */ - if(H5FS_sect_find(f, dxpl_id, frsp, + if(H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node) < 0) FAIL_STACK_ERROR @@ -2367,7 +2361,7 @@ test_fs_sect_change_class(hid_t fapl) TEST_ERROR /* verify that section C has changed class */ - if(H5FS_sect_find(f, dxpl_id, frsp, + if(H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node) < 0) FAIL_STACK_ERROR @@ -2378,7 +2372,7 @@ test_fs_sect_change_class(hid_t fapl) TEST_ERROR /* remove section A from free-space */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -2387,20 +2381,20 @@ test_fs_sect_change_class(hid_t fapl) sect_node1 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -2413,9 +2407,9 @@ error: if(sect_node2) TEST_sect_free((H5FS_section_info_t *)sect_node2); if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_sect_change_class() */ @@ -2455,7 +2449,6 @@ static unsigned test_fs_sect_extend(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -2466,6 +2459,7 @@ test_fs_sect_extend(hid_t fapl) TEST_free_section_t *sect_node1=NULL, *sect_node2=NULL; unsigned init_flags=0; htri_t status; /* Status of 'try' calls */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("a block's extension by requested-size which is = adjoining free section's size: Test 1"); @@ -2474,16 +2468,15 @@ test_fs_sect_extend(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); /* * TEST 1 @@ -2491,7 +2484,7 @@ test_fs_sect_extend(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2506,7 +2499,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2526,7 +2519,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2538,7 +2531,7 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Extend a block by requested-size */ - if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_SIZE80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0) + if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_SIZE80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0) FAIL_STACK_ERROR if(FALSE == status) TEST_ERROR @@ -2551,12 +2544,12 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2567,7 +2560,7 @@ test_fs_sect_extend(hid_t fapl) */ TESTING("a block's extension by requested-size which is > adjoining free section's size: Test 2"); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2582,7 +2575,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2602,7 +2595,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2614,7 +2607,7 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Extend the block by requested-size */ - if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE50, 0, NULL)) < 0) + if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE50, 0, NULL)) < 0) FAIL_STACK_ERROR if(TRUE == status) TEST_ERROR @@ -2624,12 +2617,12 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2640,7 +2633,7 @@ test_fs_sect_extend(hid_t fapl) */ TESTING("a block's extension by requested-size which is < adjoining free section's size: Test 3"); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2655,7 +2648,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2675,7 +2668,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2687,7 +2680,7 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Extend the block by requested-size */ - if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE30, 0, NULL)) < 0) + if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE30, 0, NULL)) < 0) TEST_ERROR if(FALSE == status) TEST_ERROR @@ -2698,12 +2691,12 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2714,7 +2707,7 @@ test_fs_sect_extend(hid_t fapl) */ TESTING("a block's extension by requested-size which does not adjoin any free section: Test 4"); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2729,7 +2722,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2749,7 +2742,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2761,7 +2754,7 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Extend the block by requested-size */ - if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE15, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0) + if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE15, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0) TEST_ERROR if(TRUE == status) TEST_ERROR @@ -2771,12 +2764,12 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2785,17 +2778,17 @@ test_fs_sect_extend(hid_t fapl) /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; return 0; error: H5E_BEGIN_TRY { if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_sect_extend() */ @@ -2813,7 +2806,6 @@ static unsigned test_fs_sect_iterate(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -2826,6 +2818,7 @@ test_fs_sect_iterate(hid_t fapl) TEST_iter_ud_t udata; int i; hsize_t tot_space, nsects; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("iteration of sections in the free-space manager"); @@ -2835,6 +2828,8 @@ test_fs_sect_iterate(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -2845,14 +2840,11 @@ test_fs_sect_iterate(hid_t fapl) udata.tot_size = 0; udata.tot_sect_count = 0; - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); init_flags = H5FS_CLS_SEPAR_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2866,12 +2858,12 @@ test_fs_sect_iterate(hid_t fapl) sect_size = (unsigned)((i-1) % 9) + 1; init_sect_node(sect_node, (haddr_t)i*10, (hsize_t)sect_size, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR } /* end for */ - if(H5FS_sect_iterate(f, dxpl_id, frsp, TEST_sects_cb, &udata) < 0) + if(H5FS_sect_iterate(f, frsp, TEST_sects_cb, &udata) < 0) TEST_ERROR H5FS_sect_stats(frsp, &tot_space, &nsects); @@ -2882,20 +2874,20 @@ test_fs_sect_iterate(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -2904,9 +2896,9 @@ test_fs_sect_iterate(hid_t fapl) error: H5E_BEGIN_TRY { if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_iterate() */ diff --git a/test/gheap.c b/test/gheap.c index 7564afa..01ea385 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -22,6 +22,7 @@ #include "h5test.h" #include "H5private.h" #include "H5ACprivate.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" #include "H5Fprivate.h" #include "H5Gprivate.h" @@ -87,6 +88,7 @@ test_1 (hid_t fapl) herr_t status; int nerrors = 0; char filename[1024]; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("monotonically increasing lengths"); @@ -98,6 +100,8 @@ test_1 (hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -113,7 +117,7 @@ test_1 (hid_t fapl) size = u + 1; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u); + status = H5HG_insert(f, size, out, obj + u); if(status < 0) { H5_FAILED(); puts(" Unable to insert object into global heap"); @@ -132,7 +136,7 @@ test_1 (hid_t fapl) size = u + 1; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { + if(NULL == H5HG_read(f, obj + u, in, NULL)) { H5_FAILED(); puts(" Unable to read object"); nerrors++; @@ -148,6 +152,8 @@ test_1 (hid_t fapl) obj = NULL; if(H5Fclose(file) < 0) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; PASSED(); @@ -156,6 +162,7 @@ test_1 (hid_t fapl) error: H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -192,6 +199,7 @@ test_2 (hid_t fapl) size_t size; int nerrors = 0; char filename[1024]; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("monotonically decreasing lengths"); @@ -203,6 +211,8 @@ test_2 (hid_t fapl) h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -216,7 +226,7 @@ test_2 (hid_t fapl) size = GHEAP_TEST_NOBJS - u; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) { + if (H5HG_insert (f, size, out, obj + u) < 0) { H5_FAILED(); puts(" Unable to insert object into global heap"); nerrors++; @@ -230,7 +240,7 @@ test_2 (hid_t fapl) size = GHEAP_TEST_NOBJS - u; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { + if (NULL==H5HG_read (f, obj + u, in, NULL)) { H5_FAILED(); puts(" Unable to read object"); nerrors++; @@ -246,6 +256,8 @@ test_2 (hid_t fapl) obj = NULL; if (H5Fclose(file)<0) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if (nerrors) goto error; PASSED(); @@ -254,6 +266,7 @@ test_2 (hid_t fapl) error: H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -290,6 +303,7 @@ test_3 (hid_t fapl) herr_t status; int nerrors = 0; char filename[1024]; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("complete object removal"); @@ -301,6 +315,8 @@ test_3 (hid_t fapl) h5_fixname(FILENAME[2], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -312,7 +328,7 @@ test_3 (hid_t fapl) size = u % 30 + 100; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); + status = H5HG_insert (f, size, out, obj + u); if (status<0) { H5_FAILED(); puts(" Unable to insert object into global heap"); @@ -322,7 +338,7 @@ test_3 (hid_t fapl) /* Remove everything */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u); + status = H5HG_remove (f, obj + u); if (status<0) { H5_FAILED(); puts(" Unable to remove object"); @@ -335,6 +351,8 @@ test_3 (hid_t fapl) obj = NULL; if (H5Fclose(file)<0) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if (nerrors) goto error; PASSED(); @@ -343,6 +361,7 @@ test_3 (hid_t fapl) error: H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -380,6 +399,7 @@ test_4 (hid_t fapl) herr_t status; int nerrors = 0; char filename[1024]; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("partial object removal"); @@ -391,6 +411,8 @@ test_4 (hid_t fapl) h5_fixname(FILENAME[3], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -402,7 +424,7 @@ test_4 (hid_t fapl) size = u % 30 + 100; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); + status = H5HG_insert (f, size, out, obj + u); if (status<0) { H5_FAILED(); puts(" Unable to insert object into global heap"); @@ -416,7 +438,7 @@ test_4 (hid_t fapl) */ if(1 == (u % 3)) { H5Eclear2(H5E_DEFAULT); - status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1); + status = H5HG_remove (f, obj + u - 1); if (status<0) { H5_FAILED(); puts(" Unable to remove object"); @@ -431,6 +453,8 @@ test_4 (hid_t fapl) obj = NULL; if (H5Fclose(file)<0) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if (nerrors) goto error; PASSED(); @@ -439,6 +463,7 @@ test_4 (hid_t fapl) error: H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -475,6 +500,7 @@ test_ooo_indices(hid_t fapl) herr_t status; int nerrors=0; char filename[1024]; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("out of order indices"); @@ -485,6 +511,8 @@ test_ooo_indices(hid_t fapl) h5_fixname(FILENAME[4], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -499,7 +527,7 @@ test_ooo_indices(hid_t fapl) * can be deleted. */ for(j=1000*((~i&1)); j<1000*((~i&1)+1); j++) { H5Eclear2(H5E_DEFAULT); - status = H5HG_insert(f, H5AC_ind_read_dxpl_id, sizeof(j), &j, &obj[j]); + status = H5HG_insert(f, sizeof(j), &j, &obj[j]); if (status<0) GHEAP_REPEATED_ERR(" Unable to insert object into global heap") @@ -512,7 +540,7 @@ test_ooo_indices(hid_t fapl) if(i>0) for(j=1000*(i&1); j<1000*((i&1)+1); j++) { H5Eclear2(H5E_DEFAULT); - status = H5HG_remove(f, H5AC_ind_read_dxpl_id, &obj[j]); + status = H5HG_remove(f, &obj[j]); if (status<0) GHEAP_REPEATED_ERR(" Unable to remove object from global heap"); } /* end for */ @@ -534,7 +562,7 @@ test_ooo_indices(hid_t fapl) /* Read the objects to make sure the heap is still readable */ for(i=0; i<1000; i++) { - if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, &obj[i], &j, NULL)) + if(NULL == H5HG_read(f, &obj[i], &j, NULL)) goto error; if(i != j) { H5_FAILED(); @@ -544,15 +572,20 @@ test_ooo_indices(hid_t fapl) } /* end for */ if (H5Fclose(file)<0) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if (nerrors) goto error; + HDfree(obj); obj = NULL; + PASSED(); return 0; error: H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); diff --git a/test/lheap.c b/test/lheap.c index f5b7f77..dd8110e 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -20,6 +20,7 @@ #include "h5test.h" #include "H5srcdir.h" #include "H5ACprivate.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5HLprivate.h" #include "H5Iprivate.h" @@ -62,6 +63,7 @@ main(void) int i, j; /* miscellaneous counters */ char buf[1024]; /* the value to store */ const char *s; /* value to read */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Reset library */ h5_reset(); @@ -75,6 +77,8 @@ main(void) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if(FAIL == (file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); @@ -85,12 +89,12 @@ main(void) H5Eprint2(H5E_DEFAULT, stdout); goto error; } - if(FAIL == H5HL_create(f, H5AC_ind_read_dxpl_id, (size_t)0, &heap_addr/*out*/)) { + if(FAIL == H5HL_create(f, (size_t)0, &heap_addr/*out*/)) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; } - if (NULL == (heap = H5HL_protect(f, H5AC_ind_read_dxpl_id, heap_addr, H5AC__NO_FLAGS_SET))) { + if (NULL == (heap = H5HL_protect(f, heap_addr, H5AC__NO_FLAGS_SET))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; @@ -102,7 +106,7 @@ main(void) if(j > 4) buf[j] = '\0'; - if(UFAIL == (obj[i] = H5HL_insert(f, H5AC_ind_read_dxpl_id, heap, strlen(buf) + 1, buf))) { + if(UFAIL == (obj[i] = H5HL_insert(f, heap, strlen(buf) + 1, buf))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; @@ -115,6 +119,8 @@ main(void) } if (FAIL == H5Fclose(file)) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED(); /* @@ -125,6 +131,8 @@ main(void) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if(FAIL == (file = H5Fopen(filename, H5F_ACC_RDONLY, fapl))) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); @@ -142,7 +150,7 @@ main(void) if(j > 4) buf[j] = '\0'; - if (NULL == (heap = H5HL_protect(f, H5AC_ind_read_dxpl_id, heap_addr, H5AC__READ_ONLY_FLAG))) { + if (NULL == (heap = H5HL_protect(f, heap_addr, H5AC__READ_ONLY_FLAG))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; @@ -171,6 +179,8 @@ main(void) if (FAIL == H5Fclose(file)) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED(); /* Check opening existing file non-default sizes of lengths and addresses */ @@ -179,6 +189,8 @@ main(void) const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */ hid_t dset = -1; file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(file >= 0){ if((dset = H5Dopen2(file, "/Dataset1", H5P_DEFAULT)) < 0) TEST_ERROR @@ -194,6 +206,8 @@ main(void) goto error; } /* end else */ } +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED(); /* Verify symbol table messages are cached */ @@ -208,6 +222,7 @@ main(void) HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } diff --git a/test/links.c b/test/links.c index 7b3e37d..4e88af5 100644 --- a/test/links.c +++ b/test/links.c @@ -3521,7 +3521,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) hid_t lapl_idA=-1, lapl_idB=-1; H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl[H5FD_MEM_NTYPES]; - char sv[H5FD_MEM_NTYPES][500]; + char sv[H5FD_MEM_NTYPES][64]; const char *memb_name[H5FD_MEM_NTYPES]; haddr_t memb_addr[H5FD_MEM_NTYPES]; @@ -7762,7 +7762,8 @@ done: /* Traverse a hard link by opening the object */ static hid_t UD_hard_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t H5_ATTR_UNUSED lapl_id) + const void *udata, size_t udata_size, hid_t H5_ATTR_UNUSED lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { haddr_t addr; hid_t ret_value = -1; @@ -7998,7 +7999,8 @@ ud_hard_links(hid_t fapl) */ static hid_t UD_rereg_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group, - const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id) + const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { hid_t ret_value; @@ -8201,7 +8203,7 @@ error: static hid_t UD_cb_traverse(const char * link_name, hid_t cur_group, const void *udata, - size_t udata_size, hid_t lapl_id) + size_t udata_size, hid_t lapl_id, hid_t H5_ATTR_UNUSED dxpl_id) { const char *target = (const char *)udata; hid_t ret_value; @@ -8437,7 +8439,8 @@ error: */ static hid_t UD_plist_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group, - const void H5_ATTR_UNUSED *udata, size_t udata_size, hid_t lapl_id) + const void H5_ATTR_UNUSED *udata, size_t udata_size, hid_t lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { char target[NAME_BUF_SIZE]; hid_t ret_value; @@ -8587,7 +8590,8 @@ UD_cbsucc_create(const char H5_ATTR_UNUSED * link_name, hid_t H5_ATTR_UNUSED loc static hid_t UD_cbsucc_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, - const void *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id) + const void *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { const char *target = (const char *)udata; hid_t ret_value; diff --git a/test/mf.c b/test/mf.c index fea5ee2..d9ef8cf 100644 --- a/test/mf.c +++ b/test/mf.c @@ -33,6 +33,7 @@ #define H5F_TESTING #include "H5Fpkg.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5FLprivate.h" #include "H5Iprivate.h" #include "H5VMprivate.h" @@ -260,7 +261,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* nothing should be changed in meta_aggr */ H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); @@ -270,7 +271,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) if (addr1 < (haddr_t)file_size) TEST_ERROR - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* nothing should be changed in meta_aggr */ H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); @@ -299,8 +300,8 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -405,7 +406,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if (addr < (haddr_t)file_size) TEST_ERROR @@ -437,7 +438,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should succeed */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30) <= 0) + if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30) <= 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -481,13 +482,13 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if (addr < (haddr_t)file_size) TEST_ERROR /* should not succeed in shrinking */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30 - 10) > 0) + if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30 - 10) > 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -531,7 +532,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should not succeed in shrinking */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30 + 10) > 0) + if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30 + 10) > 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -574,7 +575,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should succeed in shrinking */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr+10, (hsize_t)(TBLOCK_SIZE30 - 10)) <= 0) + if(H5MF_try_shrink(f, type, addr+10, (hsize_t)(TBLOCK_SIZE30 - 10)) <= 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -686,7 +687,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if (addr < (haddr_t)file_size) TEST_ERROR @@ -715,7 +716,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* should succeed */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, type, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); if(was_extended <= 0) TEST_ERROR @@ -764,7 +765,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if(addr < (haddr_t)file_size) TEST_ERROR @@ -774,7 +775,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) if(new_ma_addr != ma_addr) TEST_ERROR - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)addr, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)(TBLOCK_SIZE50)); /* should not succeed */ if(was_extended > 0) @@ -917,19 +918,19 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Reading & writing with a temporary address value should fail */ H5E_BEGIN_TRY { - status = H5F_block_read(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), H5AC_ind_read_dxpl_id, &buf); + status = H5F_block_read(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf); } H5E_END_TRY; if(status >= 0) TEST_ERROR H5E_BEGIN_TRY { - status = H5F_block_write(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), H5AC_ind_read_dxpl_id, &buf); + status = H5F_block_write(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf); } H5E_END_TRY; if(status >= 0) TEST_ERROR /* Freeing a temporary address value should fail */ H5E_BEGIN_TRY { - status = H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, tmp_addr, (hsize_t)TBLOCK_SIZE30); + status = H5MF_xfree(f, H5FD_MEM_SUPER, tmp_addr, (hsize_t)TBLOCK_SIZE30); } H5E_END_TRY; if(status >= 0) TEST_ERROR @@ -962,7 +963,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Allocate 1/3 of the file as normal address space */ - if(HADDR_UNDEF == (norm_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)(maxaddr / 3)))) + if(HADDR_UNDEF == (norm_addr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)(maxaddr / 3)))) FAIL_STACK_ERROR if(H5F_IS_TMP_ADDR(f, norm_addr)) TEST_ERROR @@ -976,13 +977,13 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Test that pushing normal space allocation into temporary space fails */ H5E_BEGIN_TRY { - check_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)(maxaddr / 3)); + check_addr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)(maxaddr / 3)); } H5E_END_TRY; if(H5F_addr_defined(check_addr)) TEST_ERROR /* Free the normal block (so the file doesn't blow up to a huge size) */ - if(H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, norm_addr, (hsize_t)(maxaddr / 3)) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, norm_addr, (hsize_t)(maxaddr / 3)) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -1032,7 +1033,7 @@ test_mf_fs_start(hid_t fapl) H5FS_stat_t state; - TESTING("H5MF_create_fstype()/H5MF_open_fstype() of free-space manager"); + TESTING("H5MF_create_fstype()/H5MF__open_fstype() of free-space manager"); /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -1064,7 +1065,7 @@ test_mf_fs_start(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1176,7 +1177,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1188,7 +1189,7 @@ test_mf_fs_alloc_free(hid_t fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1200,7 +1201,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space */ if(addr != TBLOCK_ADDR70) @@ -1214,7 +1215,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Free the block to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); state.tot_space += TBLOCK_SIZE30; state.tot_sect_count += 1; @@ -1223,7 +1224,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != TBLOCK_ADDR70) @@ -1253,7 +1254,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1265,7 +1266,7 @@ test_mf_fs_alloc_free(hid_t fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1277,7 +1278,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Allocate a block of 20 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE20)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE20)); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1290,7 +1291,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Free the block to free-space manager */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE20)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE20)); /* Still 1 section in free-space because of merging */ state.tot_space += TBLOCK_SIZE20; @@ -1298,7 +1299,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != TBLOCK_ADDR70) @@ -1328,7 +1329,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1340,7 +1341,7 @@ test_mf_fs_alloc_free(hid_t fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1356,7 +1357,7 @@ test_mf_fs_alloc_free(hid_t fapl) * Since free-space manager cannot fulfull the request, * the block is obtained from file allocation */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE40)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE40)); /* Verify that the allocated block is not section A in free-space */ if(addr == TBLOCK_ADDR70) @@ -1367,7 +1368,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR /* Verify that the block is section A in free-space */ @@ -1379,7 +1380,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Free the block of size 40 to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE40)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE40)); /* * Free-space info is the same. @@ -1501,7 +1502,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1513,7 +1514,7 @@ test_mf_fs_extend(hid_t fapl) sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1525,7 +1526,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1542,7 +1543,7 @@ test_mf_fs_extend(hid_t fapl) sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1553,7 +1554,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); /* should succeed */ if(was_extended <= 0) @@ -1568,7 +1569,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Free the extended block to free-space manager */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); /* Verify that the extended block is back into free-space */ state.tot_space += (TBLOCK_SIZE30+TBLOCK_SIZE50); @@ -1579,7 +1580,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the extended block */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != TBLOCK_ADDR70) @@ -1609,7 +1610,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1621,7 +1622,7 @@ test_mf_fs_extend(hid_t fapl) sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1633,7 +1634,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1650,7 +1651,7 @@ test_mf_fs_extend(hid_t fapl) sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1661,7 +1662,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE50+10)); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE50+10)); /* Should not be able to extend the allocated block */ if(was_extended) @@ -1672,7 +1673,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Free the allocated block A to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); /* the returned section A is merged with section B in free-space */ /* rest of the info remains the same */ @@ -1682,7 +1683,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the merged sections A & B from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != addr) TEST_ERROR @@ -1711,7 +1712,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1723,7 +1724,7 @@ test_mf_fs_extend(hid_t fapl) sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1735,7 +1736,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1752,7 +1753,7 @@ test_mf_fs_extend(hid_t fapl) sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1763,7 +1764,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE40)); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE40)); /* Should succeed in extending the allocated block */ if(was_extended <=0) @@ -1775,7 +1776,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Free the extended block */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE40)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE40)); /* rest info is same, the extended section returned is merged with the section in free-space */ state.tot_space += (TBLOCK_SIZE30+TBLOCK_SIZE40); @@ -1784,7 +1785,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the merged sections A & B from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != addr) TEST_ERROR @@ -1813,7 +1814,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1825,7 +1826,7 @@ test_mf_fs_extend(hid_t fapl) sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10)); /* Add section A of size=20 to free-space */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1837,7 +1838,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of size=20 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30-10)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30-10)); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1854,7 +1855,7 @@ test_mf_fs_extend(hid_t fapl) sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1865,7 +1866,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)TBLOCK_SIZE50); /* Should not succeed in extending the allocated block */ if(was_extended) @@ -1876,7 +1877,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Free the allocated block */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30-10)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30-10)); state.tot_space += (TBLOCK_SIZE30-10); state.tot_sect_count += 1; @@ -1886,13 +1887,13 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove section A from free-space manger */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30-10), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30-10), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != addr) TEST_ERROR /* Remove section B from free-space manager */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(H5Fclose(file) < 0) @@ -1984,9 +1985,9 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR - /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) - FAIL_STACK_ERROR + /* Start up H5FD_MEM_SUPER free-space manager */ + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) TEST_ERROR @@ -1994,7 +1995,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a section from meta_aggr */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2002,11 +2003,11 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)(ma_addr+ma_size), (hsize_t)TBLOCK_SIZE2048); /* Add a section to free-space that adjoins end of the aggregator */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR /* Verify that the section did absorb the aggregator */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(ma_addr+ma_size), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(ma_addr+ma_size), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != ma_addr) TEST_ERROR @@ -2016,7 +2017,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.size = ma_size; /* Remove section from meta_aggr */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2041,7 +2042,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -2050,21 +2051,21 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a section from meta_aggr */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* Allocate a section from sdata_aggr */ - saddr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Add a section to free-space that adjoins the beginning of meta_aggr */ sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30); /* When adding, meta_aggr is absorbed onto the end of the section */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR /* Verify that the section did absorb the aggregator */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(ma_size+TBLOCK_SIZE30), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(ma_size+TBLOCK_SIZE30), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if((tmp + TBLOCK_SIZE30) != ma_addr) @@ -2075,9 +2076,9 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.size = ma_size; /* Remove section from meta_aggr */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); /* Remove section from sdata_aggr */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2168,7 +2169,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - if((addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30)) == HADDR_UNDEF) + if((addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30)) == HADDR_UNDEF) TEST_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2176,7 +2177,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate second block from meta_aggr */ - if((addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50)) == HADDR_UNDEF) + if((addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50)) == HADDR_UNDEF) TEST_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2205,9 +2206,9 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free the two blocks: order matters because of H5F_FSPACE_STRATEGY_AGGR strategy */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50) < 0) + if(H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50) < 0) TEST_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30) < 0) TEST_ERROR if(H5Fclose(file) < 0) @@ -2308,13 +2309,13 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2+TBLOCK_SIZE50) != ma_addr) @@ -2323,7 +2324,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) if (ma_size != (TBLOCK_SIZE2048 - (TBLOCK_SIZE30 + TBLOCK_SIZE50))) TEST_ERROR - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2353,7 +2354,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30+TBLOCK_SIZE50+TBLOCK_SIZE2058); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30+TBLOCK_SIZE50+TBLOCK_SIZE2058); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2465,14 +2466,14 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2483,14 +2484,14 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR if(sdata_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE30)) TEST_ERROR /* Allocate third block, which is from file allocation not from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE2058)); + addr3 = H5MF_alloc(f, type, (hsize_t)(TBLOCK_SIZE2058)); H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); @@ -2500,7 +2501,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) if((new_ma_addr != ma_addr) || (new_ma_size != ma_size)) TEST_ERROR /* Allocate fourth block, which should be from meta_aggr */ - addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr4+TBLOCK_SIZE50) != ma_addr) @@ -2509,11 +2510,11 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE2058); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE2058); + H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2628,7 +2629,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2639,19 +2640,19 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR /* Allocate second block from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); + saddr2 = H5MF_alloc(f, stype, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if(saddr2+(TBLOCK_SIZE2048 - TBLOCK_SIZE30) != sdata_addr) TEST_ERROR /* Allocate third block from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr3+TBLOCK_SIZE50) != sdata_addr) @@ -2660,7 +2661,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate second block of 2058, which is from file allocation, not from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); if(addr2 != sdata_addr) TEST_ERROR @@ -2676,11 +2677,11 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE2058); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE2058); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr2, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2776,14 +2777,14 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if(addr2+TBLOCK_SIZE50 != ma_addr) @@ -2792,7 +2793,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate third block from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if(addr3 != ma_addr) TEST_ERROR @@ -2801,9 +2802,9 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2911,14 +2912,14 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) type = H5FD_MEM_SUPER; /* Allocate first block from meta_aggr */ - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if(addr2+TBLOCK_SIZE50 != ma_addr) @@ -2928,14 +2929,14 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR if(sdata_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE30)) TEST_ERROR /* Allocate third block from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); @@ -2956,10 +2957,10 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3077,13 +3078,13 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) /* Allocate the first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate the second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if (addr2+TBLOCK_SIZE50 != ma_addr) @@ -3093,13 +3094,13 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) /* Allocate the first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if ((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR /* Allocate the second block from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if ((saddr2+(TBLOCK_SIZE2048 - TBLOCK_SIZE30)) != sdata_addr) @@ -3107,7 +3108,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) if (sdata_size != 0) TEST_ERROR /* Allocate the third block from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if ((saddr3+TBLOCK_SIZE50) != sdata_addr) @@ -3116,7 +3117,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate the third block from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if (addr3 != sdata_addr) TEST_ERROR @@ -3138,12 +3139,12 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr2, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); + H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3240,7 +3241,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) /* Allocate the first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr+TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -3252,7 +3253,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) new_addr = addr - 10; /* Try to extend the block by an amount < (% * aggr->alloc_size) */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); /* should succeed */ if(!was_extended) @@ -3265,10 +3266,10 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if(new_ma_size != (f->shared->meta_aggr.alloc_size - TBLOCK_SIZE50)) TEST_ERROR /* Free the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE50); /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount < aggr->alloc_size */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE700)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE700)); /* should succeed */ if(!was_extended) @@ -3281,10 +3282,10 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if(new_ma_size != (f->shared->meta_aggr.alloc_size * 2 - TBLOCK_SIZE700)) TEST_ERROR /* Free the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE700); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE700); /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount > aggr->alloc_size */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE2058)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE2058)); /* should succeed */ if(!was_extended) @@ -3297,7 +3298,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if (new_ma_size != f->shared->meta_aggr.size) TEST_ERROR /* Free the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE2058); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE2058); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3331,14 +3332,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) /* Allocate the first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate the first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr+TBLOCK_SIZE50) != sdata_addr) TEST_ERROR @@ -3350,7 +3351,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) new_addr = addr - 10; /* should be able to fulfill request from the aggreqator itself */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); if(!was_extended) TEST_ERROR @@ -3366,8 +3367,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.addr = ma_addr; f->shared->meta_aggr.size = ma_size; - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3401,14 +3402,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr+TBLOCK_SIZE50) != sdata_addr) TEST_ERROR @@ -3420,7 +3421,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) new_addr = addr - 10; /* unable to fulfill request from the aggreqator itself */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); if(was_extended) TEST_ERROR @@ -3434,8 +3435,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.addr = ma_addr; f->shared->meta_aggr.size = ma_size; - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3531,7 +3532,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) /* Allocate block A from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); ma_addr = new_ma_addr - TBLOCK_SIZE30; @@ -3539,7 +3540,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* should succeed */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30) <= 0) + if(H5MF_try_shrink(f, type, addr1, (hsize_t)TBLOCK_SIZE30) <= 0) TEST_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); @@ -3578,7 +3579,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) /* Allocate block A from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -3586,12 +3587,12 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) /* Allocate block B from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->sdata_aggr), NULL, &sdata_size); /* should succeed */ - if(H5MF_try_shrink(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50) <= 0) + if(H5MF_try_shrink(f, stype, saddr1, (hsize_t)TBLOCK_SIZE50) <= 0) TEST_ERROR H5MF_aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size); @@ -3603,7 +3604,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) if (new_ma_addr != ma_addr) TEST_ERROR if (new_ma_size != (ma_size)) TEST_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3637,35 +3638,35 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) /* Allocate block A from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate block B from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2+TBLOCK_SIZE50) != ma_addr) TEST_ERROR /* Allocate block C from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); + addr3 = H5MF_alloc(f, type, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr3+TBLOCK_SIZE30+TBLOCK_SIZE50) != ma_addr) TEST_ERROR /* should not succeed */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50) > 0) + if(H5MF_try_shrink(f, type, addr2, (hsize_t)TBLOCK_SIZE50) > 0) TEST_ERROR /* aggregator info should be the same as before */ H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if(new_ma_addr != ma_addr) TEST_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3792,7 +3793,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from file allocation */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -3816,7 +3817,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; accum += (mis_align + TBLOCK_SIZE50); - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if (addr2 % alignment) TEST_ERROR @@ -3833,8 +3834,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR } - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3868,7 +3869,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* allocate a block of 50 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* address should be aligned */ if (addr1 % alignment) TEST_ERROR @@ -3889,7 +3890,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* shrink the block */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE50) <= 0) + if(H5MF_try_shrink(f, type, addr1, (hsize_t)TBLOCK_SIZE50) <= 0) TEST_ERROR if(H5Fclose(file) < 0) @@ -3923,7 +3924,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* allocate a block of 50 */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* address should be aligned */ if(addr1 % alignment) TEST_ERROR @@ -3944,7 +3945,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* try to extend the block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE50, (hsize_t)TBLOCK_SIZE30); + was_extended = H5MF_try_extend(f, type, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE50, (hsize_t)TBLOCK_SIZE30); if(was_extended <=0) TEST_ERROR @@ -4044,7 +4045,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -4056,7 +4057,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)alignment, (hsize_t)TBLOCK_SIZE50); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -4068,7 +4069,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Allocate a block of 50 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is section A in free-space */ if(addr != (haddr_t)alignment) TEST_ERROR @@ -4082,7 +4083,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Free the block to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE50); state.tot_space += TBLOCK_SIZE50; state.tot_sect_count += 1; @@ -4107,7 +4108,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -4119,7 +4120,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE8000); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -4131,7 +4132,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Allocate a block of 600 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE600); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE600); /* Verify that the allocated block is aligned */ if (addr % alignment) TEST_ERROR @@ -4145,7 +4146,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* try to extend the block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)addr, (hsize_t)TBLOCK_SIZE600, (hsize_t)TBLOCK_SIZE200); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)addr, (hsize_t)TBLOCK_SIZE600, (hsize_t)TBLOCK_SIZE200); if(was_extended <=0) TEST_ERROR @@ -4156,7 +4157,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Free the block to free-space manager */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE600+TBLOCK_SIZE200)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE600+TBLOCK_SIZE200)); /* only 1 section in free-space because of merging */ state.tot_space += (TBLOCK_SIZE600+TBLOCK_SIZE200); @@ -4190,7 +4191,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -4202,7 +4203,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE700); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -4217,7 +4218,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) * Since free-space manager cannot fulfull the request because of alignment, * the block is obtained from file allocation */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE40)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE40)); /* Verify that the allocated block is aligned */ if(addr % alignment) @@ -4415,7 +4416,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -4439,7 +4440,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -4461,7 +4462,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if ((tmp = ma_addr % alignment)) mis_align = alignment - tmp; - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if(addr3 % alignment) TEST_ERROR @@ -4484,7 +4485,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 1970 from meta_aggr */ - addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); + addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); /* Verify that the allocated block is aligned */ if(addr4 % alignment) TEST_ERROR @@ -4505,10 +4506,10 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(check_stats(f, f->shared->fs_man[type], &state)) TEST_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE80); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE80); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -4671,7 +4672,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -4694,7 +4695,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if((tmp = ma_addr % alignment)) mis_align = alignment - tmp; - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -4730,7 +4731,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* fragment for alignment of block 30 for sdata_aggr is freed to free-space */ if(mis_align) { @@ -4763,7 +4764,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 80 from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if (addr3 % alignment) TEST_ERROR @@ -4791,10 +4792,10 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR } - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE80); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE80); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -5010,7 +5011,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -5033,7 +5034,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -5068,7 +5069,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(saddr1 % alignment) TEST_ERROR @@ -5089,7 +5090,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(saddr2 % alignment) TEST_ERROR @@ -5110,7 +5111,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 80 from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if(saddr3 % alignment) TEST_ERROR @@ -5132,7 +5133,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 1034 for meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1034); /* Verify that the allocated block is aligned */ if(addr3 % alignment) TEST_ERROR @@ -5315,7 +5316,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -5338,7 +5339,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 2058 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -5363,7 +5364,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 5 from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5); /* fragment for alignment of block 5 is freed to free-space */ if(mis_align) { @@ -5526,7 +5527,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -5550,7 +5551,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(saddr1 % alignment) TEST_ERROR @@ -5571,7 +5572,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 2058 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); /* Verify that the allocated block is aligned */ if (addr2 % alignment) TEST_ERROR @@ -5790,7 +5791,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if (addr1 % alignment) TEST_ERROR @@ -5814,7 +5815,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if (saddr1 % alignment) TEST_ERROR @@ -5835,7 +5836,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if (saddr2 % alignment) TEST_ERROR @@ -5856,7 +5857,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 80 from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if (saddr3 % alignment) TEST_ERROR @@ -5878,7 +5879,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 2058 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); /* Verify that the allocated block is aligned */ if (addr2 % alignment) TEST_ERROR @@ -6034,7 +6035,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) * aggregator that extends to the end of the file, with * block_size / 2 bytes remaining, and the end of the file aligned */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, align); + addr1 = H5MF_alloc(f, type, align); /* Verify that the allocated block is aligned */ if(addr1 % align) TEST_ERROR @@ -6043,7 +6044,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) * aggregator to extend to the end of the file, with 0 bytes remaining, and * the end of the file aligned */ type = H5FD_MEM_SUPER; - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, align); + addr2 = H5MF_alloc(f, type, align); /* Verify that the allocated block is aligned */ if(addr2 % align) TEST_ERROR @@ -6055,7 +6056,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) * force the aggregator to extend to the end of the file, with 0 bytes * remaining, and the end of the file unaligned */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, block_size + (hsize_t)1); + addr1 = H5MF_alloc(f, type, block_size + (hsize_t)1); /* Verify that the allocated block is aligned */ if(addr1 % align) TEST_ERROR @@ -6067,7 +6068,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) /* Allocate a block of size 1. This should extend the aggregator from * the previous allocation, and align the new block */ type = H5FD_MEM_SUPER; - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)1); + addr2 = H5MF_alloc(f, type, (hsize_t)1); /* Verify that the allocated block is aligned */ if(addr2 % align) TEST_ERROR @@ -6160,36 +6161,36 @@ test_mf_fs_persist_split(void) /* Allocate 4 blocks of type H5FD_MEM_SUPER */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_DRAW */ stype = H5FD_MEM_DRAW; - if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_DRAW free-space manager */ - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6208,7 +6209,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6222,7 +6223,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Retrieve block #1 from H5FD_MEM_SUPER free-space manager; block #3 still in free-space */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != addr1) TEST_ERROR @@ -6233,7 +6234,7 @@ test_mf_fs_persist_split(void) /* Start up H5FD_MEM_DRAW free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)stype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)stype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6247,13 +6248,13 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Retrieve blocks #1 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != saddr1) TEST_ERROR /* Retrieve blocks #3 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != saddr3) TEST_ERROR @@ -6262,19 +6263,19 @@ test_mf_fs_persist_split(void) /* Allocate 4 blocks of type H5FD_MEM_BTREE */ btype = H5FD_MEM_BTREE; - if(HADDR_UNDEF == (baddr5 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (baddr5 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr6 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (baddr6 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr7 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE7))) + if(HADDR_UNDEF == (baddr7 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE7))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr8 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8))) + if(HADDR_UNDEF == (baddr8 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE8))) FAIL_STACK_ERROR /* Put block #5 & #7 into H5FD_MEM_BTREE free-space manager */ - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, btype, baddr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr7, (hsize_t)TBLOCK_SIZE7) < 0) + if(H5MF_xfree(f, btype, baddr7, (hsize_t)TBLOCK_SIZE7) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6297,7 +6298,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6309,13 +6310,13 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != addr3) TEST_ERROR /* Retrieve block #7 from H5FD_MEM_BTREE free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE7))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE7))) FAIL_STACK_ERROR if(tmp_addr != baddr7) TEST_ERROR @@ -6337,7 +6338,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6477,36 +6478,36 @@ test_mf_fs_persist_multi(void) /* Allocate 4 blocks of type H5FD_MEM_SUPER */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_DRAW */ stype = H5FD_MEM_DRAW; - if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_DRAW free-space manager */ - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6525,7 +6526,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6539,7 +6540,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Retrieve block #1 from H5FD_MEM_SUPER free-space manager; block #3 still in free-space */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != addr1) TEST_ERROR @@ -6549,7 +6550,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_DRAW free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)stype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)stype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6563,32 +6564,32 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Retrieve blocks #1 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != saddr1) TEST_ERROR /* Retrieve blocks #3 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != saddr3) TEST_ERROR /* Allocate 4 blocks of type H5FD_MEM_BTREE */ btype = H5FD_MEM_BTREE; - if(HADDR_UNDEF == (baddr1 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (baddr1 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr2 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (baddr2 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr3 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (baddr3 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr4 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (baddr4 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1 & #3 into H5FD_MEM_BTREE free-space manager */ - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, btype, baddr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, btype, baddr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6607,7 +6608,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6619,7 +6620,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != addr3) TEST_ERROR @@ -6633,7 +6634,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_BTREE free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)btype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)btype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6648,13 +6649,13 @@ test_mf_fs_persist_multi(void) /* Allocate 2 blocks of type H5FD_MEM_GHEAP */ gtype = H5FD_MEM_GHEAP; - if(HADDR_UNDEF == (gaddr2 = H5MF_alloc(f, gtype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (gaddr2 = H5MF_alloc(f, gtype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (gaddr1 = H5MF_alloc(f, gtype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (gaddr1 = H5MF_alloc(f, gtype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR /* Put block #2 into H5FD_MEM_GHEAP free-space manager */ - if(H5MF_xfree(f, gtype, H5AC_ind_read_dxpl_id, gaddr2, (hsize_t)TBLOCK_SIZE2) < 0) + if(H5MF_xfree(f, gtype, gaddr2, (hsize_t)TBLOCK_SIZE2) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6671,15 +6672,15 @@ test_mf_fs_persist_multi(void) /* If H5FD_MEM_SUPER is there, should not find block #1 & #3 */ if(H5F_addr_defined(f->shared->fs_addr[type])) { /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR - if((node_found = H5FS_sect_find(f, H5AC_ind_read_dxpl_id, f->shared->fs_man[type], + if((node_found = H5FS_sect_find(f, f->shared->fs_man[type], (hsize_t)TBLOCK_SIZE1, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if(node_found) TEST_ERROR - if((node_found = H5FS_sect_find(f, H5AC_ind_read_dxpl_id, f->shared->fs_man[type], + if((node_found = H5FS_sect_find(f, f->shared->fs_man[type], (hsize_t)TBLOCK_SIZE3, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if(node_found) TEST_ERROR @@ -6690,7 +6691,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_GHEAP free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)gtype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)gtype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6782,25 +6783,25 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Allocate 6 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR /* Put block #1, #3, #5 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6827,12 +6828,12 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) */ if((f->shared->first_alloc_dealloc) && (SUCCEED != - H5MF_tidy_self_referential_fsm_hack(f, H5AC_ind_read_dxpl_id))) + H5MF_tidy_self_referential_fsm_hack(f))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ if(!(f->shared->fs_man[tt])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)tt) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)tt) < 0) FAIL_STACK_ERROR /* Get info for free-space manager */ @@ -6847,13 +6848,13 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != addr3) TEST_ERROR /* Retrieve block #1 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != addr1) TEST_ERROR @@ -6874,7 +6875,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Retrieve block #5 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR if(tmp_addr != addr5) TEST_ERROR @@ -6962,25 +6963,25 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Allocate 4 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR /* Retrieve block #1, #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -7001,7 +7002,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Put block #3 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -7025,14 +7026,14 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) * assertion failures on the first file space alloc / dealloc. */ if(f->shared->first_alloc_dealloc){ - if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f,H5AC_ind_read_dxpl_id)) + if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f)) FAIL_STACK_ERROR ran_H5MF_tidy_self_referential_fsm_hack = TRUE; } /* Start up H5FD_MEM_SUPER free-space manager */ if(!(f->shared->fs_man[fs_type])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)fs_type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)fs_type) < 0) FAIL_STACK_ERROR /* Get info for H5FD_MEM_SUPER free-space manager */ @@ -7051,7 +7052,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Put block #4 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE4) < 0) + if(H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE4) < 0) FAIL_STACK_ERROR /* The H5FD_MEM_SUPER free-space manager will go away at H5MF_close() */ @@ -7167,25 +7168,25 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for /* Allocate 6 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR /* Put block #1, #3, #5 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR @@ -7339,17 +7340,17 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format /* Allocate 6 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR H5MF_alloc_to_fs_type(f, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); @@ -7361,9 +7362,9 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format } /* Put block #3, #5 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR fs_state.tot_space += TBLOCK_SIZE3 + TBLOCK_SIZE5; @@ -7374,17 +7375,17 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format TEST_ERROR /* section #2 is less than threshold but is merged into section #3 */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE2) < 0) + if(H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE2) < 0) FAIL_STACK_ERROR fs_state.tot_space += TBLOCK_SIZE2; if(check_stats(f, f->shared->fs_man[tt], &fs_state)) TEST_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE4) < 0) + if(H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE4) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr6, (hsize_t)TBLOCK_SIZE6) < 0) + if(H5MF_xfree(f, type, addr6, (hsize_t)TBLOCK_SIZE6) < 0) FAIL_STACK_ERROR /* For paged aggregation, the sections in the page at EOF for small meta fs are merged but are not shrunk away */ @@ -7398,7 +7399,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format TEST_ERROR /* section #1 is less than threshold but is shrunk away */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR /* For paged aggregation, the section in the page at EOF for small meta fs is not shrunk away */ @@ -7496,29 +7497,29 @@ test_dichotomy(hid_t fapl) /* Allocate the first block of type H5FD_MEM_SUPER */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Allocate the second block of type H5FD_MEM_SUPER */ - H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Allocate the first block of type H5FD_MEM_DRAW */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Free the first block of type H5FD_MEM_SUPER */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); /* Allocate the second block of type H5FD_MEM_DRAW */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that saddr1 is not addr1 */ if(saddr2 == addr1) TEST_ERROR /* Free the first block of type H5FD_MEM_DRAW */ - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); /* Allocate the third block of type H5FD_MEM_SUPER */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that addr3 is not saddr1 */ if(addr3 == saddr1) TEST_ERROR @@ -7655,52 +7656,52 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 3 small meta data blocks: addr1, addr2, addr3 */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034); - addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30); + addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034); + addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); /* Free the block with addr2 */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE1034); + H5MF_xfree(f, H5FD_MEM_OHDR, addr2, (hsize_t)TBLOCK_SIZE1034); if(!fs_persist) { H5MF_alloc_to_fs_type(f, H5FD_MEM_OHDR, TBLOCK_SIZE1034, (H5F_mem_page_t *)&fs_type); /* Verify that the freed block with addr2 is found from the small meta data manager */ - if(H5MF_find_sect(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034, f->shared->fs_man[fs_type], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034, f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != addr2) TEST_ERROR } /* end if */ /* Allocate 2 small raw data blocks: saddr1, saddr2 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); + H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE1034); /* Free the block with saddr1 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE30); if(!fs_persist) { /* Verify that the freed block with saddr1 is found from the small raw data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) TEST_ERROR if(found_addr != saddr1) TEST_ERROR } /* end if */ /* Allocate 2 large data blocks: gaddr1, gaddr2 */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); - H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); + H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Free the block with gaddr1 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE5000); if(!fs_persist) { H5MF_alloc_to_fs_type(f, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); /* Verify that the freed block with gaddr1 is found from the large data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != gaddr1) TEST_ERROR @@ -7739,17 +7740,17 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) * assertion failures on the first file space alloc / dealloc. */ if(f->shared->first_alloc_dealloc){ - if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f,H5AC_ind_read_dxpl_id)) + if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f)) FAIL_STACK_ERROR } /* Set up to use the small meta data manager */ if(!(f->shared->fs_man[fs_type])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, fs_type) < 0) + if(H5MF__open_fstype(f, fs_type) < 0) TEST_ERROR /* Verify that the freed block with addr2 is found from the small meta data manager */ - if(H5MF_find_sect(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)(f->shared->fs_page_size-(addr3+TBLOCK_SIZE50)), f->shared->fs_man[fs_type], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)(f->shared->fs_page_size-(addr3+TBLOCK_SIZE50)), f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != (addr3+TBLOCK_SIZE50)) @@ -7761,11 +7762,11 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) /* Set up to use the small raw data manager */ if(!(f->shared->fs_man[H5F_MEM_PAGE_DRAW])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, H5F_MEM_PAGE_DRAW) < 0) + if(H5MF__open_fstype(f, H5F_MEM_PAGE_DRAW) < 0) TEST_ERROR /* Verify that the freed block with saddr1 is found from the small raw data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) TEST_ERROR if(found_addr != saddr1) TEST_ERROR @@ -7774,11 +7775,11 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) if(!(f->shared->fs_man[fs_type])) /* Set up to use the large data manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, fs_type) < 0) + if(H5MF__open_fstype(f, fs_type) < 0) TEST_ERROR /* Verify that the freed block with gaddr1 is found from the large data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != gaddr1) TEST_ERROR @@ -7866,40 +7867,40 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Allocate a small meta data block with addr1 */ - addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); /* Try to shrink the block with addr1 */ - if((status = H5MF_try_shrink(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE50)) < 0) + if((status = H5MF_try_shrink(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE50)) < 0) FAIL_STACK_ERROR /* Couldn't shrink due to the section (remaining space in the page) is in the small meta data free-space manager */ if(status == TRUE) TEST_ERROR /* Allocate a small raw data block with saddr1 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Try to shrink the block with saddr1 */ - if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50)) < 0) + if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE50)) < 0) FAIL_STACK_ERROR /* Couldn't shrink due to the section (remaining space in the page) is in the small raw data free-space manager */ if(status == TRUE) TEST_ERROR /* Allocate a large data block with gaddr1 */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Try to shrink the block with gaddr1 */ - if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000)) < 0) + if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE5000)) < 0) FAIL_STACK_ERROR /* Couldn't shrink due to the section (remaining space in the page) is in the large-sized free-space manager */ if(status == TRUE) TEST_ERROR /* Free the block with saddr1--merge to become 1 page, then return to the large manager */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE50); /* Merge all 3 sections and shrunk */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000); + H5MF_xfree(f, H5FD_MEM_OHDR, gaddr1, (hsize_t)TBLOCK_SIZE5000); if(H5Fclose(fid) < 0) FAIL_STACK_ERROR @@ -7987,16 +7988,16 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Allocate a small meta data block with addr1 */ - addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE98); + addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE98); /* Try extending the block with addr1 at EOF not crossing page boundary */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE98, (hsize_t)3100); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE98, (hsize_t)3100); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Allocate 2 small meta data blocks with addr2 and addr3--will be on another meta data page */ - addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE100); - addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE150); + addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE100); + addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE150); /* The block with addr2 should be page aligned */ /* The block with addr3 resides right next to the block with addr2 */ @@ -8006,60 +8007,60 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free the block with addr2 */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE100); + H5MF_xfree(f, H5FD_MEM_OHDR, addr2, (hsize_t)TBLOCK_SIZE100); /* Try extending the block with addr1 that will cross to the next page where the freed block with addr2 resides */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE100); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE100); /* Shouldn't succeed--should not cross page boundary */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block with addr1 into the free-space section that is big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE50); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Free the block with addr1 */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE3248); + H5MF_xfree(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE3248); /* Allocate a new meta data block with addr1 */ /* There is a page end threshold of size H5F_FILE_SPACE_PGEND_META_THRES at the end of the block */ /* The block is right next to the threshold */ - addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3286); + addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3286); /* Try extending the block into the threshold with size > H5F_FILE_SPACE_PGEND_META_THRES */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE11); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE11); /* Shouldn't succeed */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block into the threshold with size < H5F_FILE_SPACE_PGEND_META_THRES */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE2); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE2); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Free the block with addr3--will merge with the remaining sections to become a page and then free the page */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE150); + H5MF_xfree(f, H5FD_MEM_OHDR, addr3, (hsize_t)TBLOCK_SIZE150); /* Allocate a small raw data block with saddr1 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4086); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE4086); /* Try extending the block crossing the page boundary */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE11); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE11); /* Shouldn't succeed */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block not crossing page boundary */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE10); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE10); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* The extended block is now "large" in size */ /* Try extending the block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4096, (hsize_t)TBLOCK_SIZE10); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4096, (hsize_t)TBLOCK_SIZE10); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Try extending the large-sized block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4106, (hsize_t)TBLOCK_SIZE5000); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4106, (hsize_t)TBLOCK_SIZE5000); /* Should not succeed because the mis-aligned fragment in the page is in the large-sized free-space manager */ if(was_extended == TRUE) TEST_ERROR @@ -8141,66 +8142,66 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Allocate a large data block with gaddr1 */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)6000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)6000); /* Should be page aligned */ if(gaddr1 % TBLOCK_SIZE4096) TEST_ERROR /* Extending the block with gaddr1 at EOF to become 2 pages */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE6000, (hsize_t)TBLOCK_SIZE2192); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE6000, (hsize_t)TBLOCK_SIZE2192); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Allocate a large data block with gaddr2 */ - gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be page aligned */ if(gaddr2 % TBLOCK_SIZE4096) TEST_ERROR /* Try extending the block with gaddr1 */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE8192, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE8192, (hsize_t)TBLOCK_SIZE50); /* Should not succeed */ if(was_extended == TRUE) TEST_ERROR /* Allocate a large data block with gaddr3 */ - gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be page aligned */ if(gaddr3 % TBLOCK_SIZE4096) TEST_ERROR /* Try extending the block with gaddr2--there is a free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8000, (hsize_t)TBLOCK_SIZE100); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8000, (hsize_t)TBLOCK_SIZE100); /* Should succeed */ if(was_extended == FALSE) TEST_ERROR /* Try extending the block with gaddr2--there is no free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE100); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE100); /* Should not succeed */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block with gaddr2--there is a free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE90); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE90); /* Should succeed */ if(was_extended == FALSE) TEST_ERROR /* Try extending the block with gaddr2 */ /* There is no free-space section big enough to fulfill the request (request is < H5F_FILE_SPACE_PGEND_META_THRES) */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); /* Should not succeed */ if(was_extended == TRUE) TEST_ERROR /* Allocate a large data block with gaddr4 */ - gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Should be page aligned */ if(gaddr4 % TBLOCK_SIZE4096) TEST_ERROR /* Free the block with gaddr3--will merge with remaining free space to become 2 pages + section (size 2) in previous page */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr3, (hsize_t)TBLOCK_SIZE8000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr3, (hsize_t)TBLOCK_SIZE8000); /* Try extending the block with gaddr2 crossing page boundary--there is free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); /* Should succeed */ if(was_extended == FALSE) TEST_ERROR @@ -8284,7 +8285,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) /* Allocate a large data block with gaddr1 */ /* 1 page + 1904 bytes; 2192 bytes in free-space manager */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE6000); /* Should be page aligned */ if(gaddr1 % TBLOCK_SIZE4096) @@ -8292,20 +8293,20 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) /* Allocate a large data block with gaddr2--should be on another page */ /* Allocate 1 page + 3904 bytes; 192 bytes in free-space manager */ - gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be page aligned */ if(gaddr2 % TBLOCK_SIZE4096) TEST_ERROR /* Allocate a large data block with gaddr3--should be on another page */ /* Allocate 2 pages + 3808 bytes; 288 bytes in free-space manager */ - gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE12000); + gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE12000); if(!H5F_addr_defined(gaddr3)) TEST_ERROR /* Free the block with gaddr2 */ /* Merged sections: 2192 + 8000 + 192 = 10384 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr2, (hsize_t)TBLOCK_SIZE8000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr2, (hsize_t)TBLOCK_SIZE8000); /* Get free-space info */ if(H5FS_stat_info(f, f->shared->fs_man[H5F_MEM_PAGE_GENERIC], &fs_stat) < 0) @@ -8319,7 +8320,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) /* Allocate a large data block with gaddr4--there is a free-space section able to fulfill the request */ /* Free-space sections: 2192 + 3192 + 288 = 5672 bytes */ - gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Should be page aligned */ if(gaddr4 % TBLOCK_SIZE4096) @@ -8337,8 +8338,8 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free the two blocks with gaddr1 and gaddr4 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE6000); - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr4, (hsize_t)TBLOCK_SIZE5000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE6000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr4, (hsize_t)TBLOCK_SIZE5000); /* Get free-space info */ if(H5FS_stat_info(f, f->shared->fs_man[H5F_MEM_PAGE_GENERIC], &fs_stat) < 0) @@ -8439,17 +8440,17 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Allocate 2 small meta data blocks: addr1, addr2 */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30); + addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); /* Allocate a small raw data block with saddr1 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); /* Should be on the second page and page aligned */ if(saddr1 % TBLOCK_SIZE4096) TEST_ERROR /* Allocate a small raw data block with saddr2 */ - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Should not be page aligned */ if(!(saddr2 % TBLOCK_SIZE4096)) TEST_ERROR @@ -8458,13 +8459,13 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a small meta data block with addr3--there is no free-space section big enough to fulfill the request */ - addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4020); + addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE4020); /* Should be on the third page and page aligned */ if(addr3 % TBLOCK_SIZE4096) TEST_ERROR /* Allocate a small meta data block with addr4--there is a free-space section big enough to fulfill the request */ - addr4 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + addr4 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80); /* Should not be page aligned */ if(!(addr4 % TBLOCK_SIZE4096)) TEST_ERROR @@ -8473,7 +8474,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a small meta data block with addr5--there is a free-space section big enough to fulfill the request */ - addr5 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE40); + addr5 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE40); /* Should not be page aligned */ if(!(addr5 % TBLOCK_SIZE4096)) TEST_ERROR @@ -8484,20 +8485,20 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) /* Allocate a small meta data block with addr6--taking up the remaining space in the first page */ if(family) - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3080); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3080); else - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3088); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3088); /* Allocate a small meta data block with addr7--taking up the remaining space in the third page */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE36); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE36); /* Allocate 2 small meta data blocks: addr8, addr9--there is no free-space to fulfill the request */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); - addr9 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); + addr9 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80); /* Free the block with saddr1 and saddr2--merge with remaining section to become a page which will be returned to the large manager */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr2, (hsize_t)TBLOCK_SIZE50); /* Verify that the large manager does contain a section with file space page size (default is 4096) */ if(!f->shared->fs_man[H5F_MEM_PAGE_GENERIC]) @@ -8508,14 +8509,14 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a small meta data block with addr10--there is a free-space section big enough to fulfill the request */ - addr10 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3900); + addr10 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3900); /* The block should be next to the block with addr9 */ if(addr10 != (addr9 + TBLOCK_SIZE80)) TEST_ERROR /* Allocate a small meta data block with addr11 */ /* The current free-space section is unable to fulfill the request; obtain a page from the large manager */ - addr11 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + addr11 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80); /* The address of the block should be the same the freed block with saddr1 */ if(addr11 != saddr1) TEST_ERROR @@ -8683,8 +8684,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 small raw data blocks */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Should be on the second page and page aligned on 4096 (default file space page size) */ if(saddr1 % TBLOCK_SIZE4096) @@ -8695,8 +8696,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 large raw data blocks */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); - gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); + gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be on the 3rd page and page aligned */ if(gaddr1 % TBLOCK_SIZE4096) @@ -8735,8 +8736,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 small meta data blocks */ - addr1 = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - addr2 = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr1 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); + addr2 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50); /* Should be aligned on 16 */ if(addr1 % TEST_ALIGN16 || addr2 % TEST_ALIGN16) @@ -8748,8 +8749,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 small raw data blocks */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE100); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE80); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE100); /* Should be aligned on 16 */ if(saddr1 % TEST_ALIGN16 || saddr2 % TEST_ALIGN16) @@ -8796,8 +8797,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 small raw data blocks */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Should be aligned on 16 */ if(saddr1 % TEST_ALIGN16) @@ -8811,7 +8812,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a large raw data block */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Should be aligned on 16 */ if(gaddr1 % TEST_ALIGN16) @@ -8861,6 +8862,7 @@ main(void) unsigned nerrors = 0; /* Cumulative error count */ test_type_t curr_test; /* Current test being worked on */ const char *env_h5_drvr; /* File Driver value from environment */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Get the VFD to use */ env_h5_drvr = HDgetenv("HDF5_DRIVER"); @@ -8870,6 +8872,8 @@ main(void) h5_reset(); fapl = h5_fileaccess(); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Make a copy of the FAPL before adjusting the alignment */ if((new_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR @@ -8983,6 +8987,8 @@ main(void) if(H5Pclose(new_fapl) < 0) FAIL_STACK_ERROR h5_cleanup(FILENAME, fapl); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; @@ -8995,6 +9001,7 @@ error: H5E_BEGIN_TRY { H5Pclose(fapl); H5Pclose(new_fapl); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return(1); } /* main() */ diff --git a/test/ohdr.c b/test/ohdr.c index 3915b38..f924058 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -31,6 +31,8 @@ #define H5G_FRIEND /*suppress error about including H5Gpkg */ #include "H5Gpkg.h" +#include "H5CXprivate.h" /* API Contexts */ + const char *FILENAME[] = { "ohdr", NULL @@ -67,6 +69,7 @@ test_cont(char *filename, hid_t fapl) const char *short_name = "T"; const char *long_name = "This is the message"; size_t nchunks; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("object header continuation block"); @@ -76,6 +79,8 @@ test_cont(char *filename, hid_t fapl) /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR if (H5AC_ignore_tags(f) < 0) { @@ -84,51 +89,51 @@ test_cont(char *filename, hid_t fapl) goto error; } /* end if */ - if(H5O_create(f, H5AC_ind_read_dxpl_id, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locA/*out*/) < 0) + if(H5O_create(f, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locA/*out*/) < 0) FAIL_STACK_ERROR - if(H5O_create(f, H5AC_ind_read_dxpl_id, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locB/*out*/) < 0) + if(H5O_create(f, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locB/*out*/) < 0) FAIL_STACK_ERROR time_new = 11111111; - if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &long_name, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &long_name) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locA, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locA, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &short_name, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &short_name) < 0) FAIL_STACK_ERROR - if(1 != H5O_link(&oh_locA, 1, H5AC_ind_read_dxpl_id)) + if(1 != H5O_link(&oh_locA, 1)) FAIL_STACK_ERROR - if(1 != H5O_link(&oh_locB, 1, H5AC_ind_read_dxpl_id)) + if(1 != H5O_link(&oh_locB, 1)) FAIL_STACK_ERROR - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5O_expunge_chunks_test(&oh_locA, H5AC_ind_read_dxpl_id) < 0) + if(H5O_expunge_chunks_test(&oh_locA) < 0) FAIL_STACK_ERROR - if(H5O_get_hdr_info(&oh_locA, H5AC_ind_read_dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&oh_locA, &hdr_info) < 0) FAIL_STACK_ERROR nchunks = hdr_info.nchunks; /* remove the 1st H5O_NAME_ID message */ - if(H5O_msg_remove(&oh_locA, H5O_NAME_ID, 0, FALSE, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_remove(&oh_locA, H5O_NAME_ID, 0, FALSE) < 0) FAIL_STACK_ERROR - if(H5O_get_hdr_info(&oh_locA, H5AC_ind_read_dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&oh_locA, &hdr_info) < 0) FAIL_STACK_ERROR if(hdr_info.nchunks >= nchunks) @@ -140,6 +145,7 @@ test_cont(char *filename, hid_t fapl) FAIL_STACK_ERROR if(H5Fclose(file) < 0) FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR PASSED(); @@ -151,6 +157,7 @@ error: H5O_close(&oh_locA, NULL); H5O_close(&oh_locB, NULL); H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return FAIL; @@ -169,7 +176,6 @@ test_ohdr_cache(char *filename, hid_t fapl) { hid_t file = -1; /* File ID */ hid_t my_fapl; /* FAPL ID */ - hid_t my_dxpl; /* DXPL ID */ H5AC_cache_config_t mdc_config; /* Metadata cache configuration info */ H5F_t *f = NULL; /* File handle */ H5HL_t *lheap, *lheap2, *lheap3; /* Pointer to local heaps */ @@ -195,10 +201,6 @@ test_ohdr_cache(char *filename, hid_t fapl) if(H5Pset_mdc_config(my_fapl, &mdc_config) < 0) FAIL_STACK_ERROR - /* Make a copy of the default DXPL */ - if((my_dxpl = H5Pcopy(H5AC_ind_read_dxpl_id)) < 0) - FAIL_STACK_ERROR - /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) FAIL_STACK_ERROR @@ -210,31 +212,31 @@ test_ohdr_cache(char *filename, hid_t fapl) FAIL_STACK_ERROR /* Create object (local heap) that occupies most of cache */ - if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr) < 0) + if(H5HL_create(f, (31 * 1024), &lheap_addr) < 0) FAIL_STACK_ERROR /* Protect local heap (which actually pins it in the cache) */ - if(NULL == (lheap = H5HL_protect(f, my_dxpl, lheap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (lheap = H5HL_protect(f, lheap_addr, H5AC__READ_ONLY_FLAG))) FAIL_STACK_ERROR /* Create an object header */ HDmemset(&oh_loc, 0, sizeof(oh_loc)); - if(H5O_create(f, my_dxpl, (size_t)2048, (size_t)1, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0) + if(H5O_create(f, (size_t)2048, (size_t)1, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0) FAIL_STACK_ERROR /* Query object header information */ rc = 0; - if(H5O_get_rc(&oh_loc, my_dxpl, &rc) < 0) + if(H5O_get_rc(&oh_loc, &rc) < 0) FAIL_STACK_ERROR if(0 != rc) TEST_ERROR /* Create object (local heap) that occupies most of cache */ - if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr2) < 0) + if(H5HL_create(f, (31 * 1024), &lheap_addr2) < 0) FAIL_STACK_ERROR /* Protect local heap (which actually pins it in the cache) */ - if(NULL == (lheap2 = H5HL_protect(f, my_dxpl, lheap_addr2, H5AC__READ_ONLY_FLAG))) + if(NULL == (lheap2 = H5HL_protect(f, lheap_addr2, H5AC__READ_ONLY_FLAG))) FAIL_STACK_ERROR /* Unprotect local heap (which actually unpins it from the cache) */ @@ -243,15 +245,15 @@ test_ohdr_cache(char *filename, hid_t fapl) /* Create object header message in new object header */ time_new = 11111111; - if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, my_dxpl) < 0) + if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR /* Create object (local heap) that occupies most of cache */ - if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr3) < 0) + if(H5HL_create(f, (31 * 1024), &lheap_addr3) < 0) FAIL_STACK_ERROR /* Protect local heap (which actually pins it in the cache) */ - if(NULL == (lheap3 = H5HL_protect(f, my_dxpl, lheap_addr3, H5AC__READ_ONLY_FLAG))) + if(NULL == (lheap3 = H5HL_protect(f, lheap_addr3, H5AC__READ_ONLY_FLAG))) FAIL_STACK_ERROR /* Unprotect local heap (which actually unpins it from the cache) */ @@ -265,13 +267,13 @@ test_ohdr_cache(char *filename, hid_t fapl) * a non-invasive way -QAK) */ rc = 0; - if(H5O_get_rc(&oh_loc, my_dxpl, &rc) < 0) + if(H5O_get_rc(&oh_loc, &rc) < 0) FAIL_STACK_ERROR if(0 != rc) TEST_ERROR /* Decrement reference count o object header */ - if(H5O_dec_rc_by_loc(&oh_loc, my_dxpl) < 0) + if(H5O_dec_rc_by_loc(&oh_loc) < 0) FAIL_STACK_ERROR /* Close object header created */ @@ -282,8 +284,6 @@ test_ohdr_cache(char *filename, hid_t fapl) if(H5HL_unprotect(lheap) < 0) FAIL_STACK_ERROR - if(H5Pclose(my_dxpl) < 0) - FAIL_STACK_ERROR if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -763,6 +763,7 @@ main(void) time_t time_new, ro; int i; /* Local index variable */ unsigned b; /* Index for "new format" loop */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret; /* Generic return value */ /* Reset library */ @@ -789,6 +790,8 @@ main(void) /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR if(H5AC_ignore_tags(f) < 0) { @@ -803,22 +806,22 @@ main(void) */ TESTING("object header creation"); HDmemset(&oh_loc, 0, sizeof(oh_loc)); - if(H5O_create(f, H5AC_ind_read_dxpl_id, (size_t)64, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0) + if(H5O_create(f, (size_t)64, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0) FAIL_STACK_ERROR PASSED(); /* create a new message */ TESTING("message creation"); time_new = 11111111; - if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(1 != H5O_link(&oh_loc, 1, H5AC_ind_read_dxpl_id)) + if(1 != H5O_link(&oh_loc, 1)) FAIL_STACK_ERROR - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR - if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id)) + if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro)) FAIL_STACK_ERROR if(ro != time_new) TEST_ERROR @@ -829,19 +832,19 @@ main(void) */ TESTING("message modification"); time_new = 33333333; - if(H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR - if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id)) + if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro)) FAIL_STACK_ERROR if(ro != time_new) TEST_ERROR /* Make certain that chunk #0 in the object header can be encoded with a 1-byte size */ - if(H5O_get_hdr_info(&oh_loc, H5AC_ind_read_dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&oh_loc, &hdr_info) < 0) FAIL_STACK_ERROR if(hdr_info.space.total >=256) TEST_ERROR @@ -859,16 +862,16 @@ main(void) TESTING("object header overflow in memory"); for(i = 0; i < 40; i++) { time_new = (i + 1) * 1000 + 1000000; - if(H5O_msg_create(&oh_loc, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_loc, H5O_MTIME_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR } /* end for */ - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR /* Make certain that chunk #0 in the object header will be encoded with a 2-byte size */ - if(H5O_get_hdr_info(&oh_loc, H5AC_ind_read_dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&oh_loc, &hdr_info) < 0) FAIL_STACK_ERROR if(hdr_info.space.total < 256) TEST_ERROR @@ -903,11 +906,11 @@ main(void) TESTING("object header overflow on disk"); for(i = 0; i < 10; i++) { time_new = (i + 1) * 1000 + 10; - if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR } /* end for */ PASSED(); @@ -916,13 +919,13 @@ main(void) * Delete all time messages. */ TESTING("message deletion"); - if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE) < 0) FAIL_STACK_ERROR - if(H5O_msg_remove(&oh_loc, H5O_MTIME_ID, H5O_ALL, TRUE, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_remove(&oh_loc, H5O_MTIME_ID, H5O_ALL, TRUE) < 0) FAIL_STACK_ERROR - if(H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id)) + if(H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro)) FAIL_STACK_ERROR - if(H5O_msg_read(&oh_loc, H5O_MTIME_ID, &ro, H5AC_ind_read_dxpl_id)) + if(H5O_msg_read(&oh_loc, H5O_MTIME_ID, &ro)) FAIL_STACK_ERROR PASSED(); @@ -933,23 +936,23 @@ main(void) */ TESTING("constant message handling"); time_new = 22222222; - if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR - if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id)) + if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro)) FAIL_STACK_ERROR if(ro != time_new) TEST_ERROR time_new = 33333333; H5E_BEGIN_TRY { - ret = H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id); + ret = H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new); } H5E_END_TRY; if(ret >= 0) TEST_ERROR - if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE) < 0) FAIL_STACK_ERROR PASSED(); @@ -977,6 +980,7 @@ main(void) /* Test object header creation metadata cache issues */ if(test_ohdr_cache(filename, fapl) < 0) TEST_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR } /* end for */ /* Verify symbol table messages are cached */ @@ -994,6 +998,7 @@ error: puts("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; diff --git a/test/page_buffer.c b/test/page_buffer.c index 853ef93..9901304 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -21,9 +21,6 @@ #include "h5test.h" -#include "H5PBprivate.h" -#include "H5Iprivate.h" - /* * This file needs to access private information from the H5F package. */ @@ -34,6 +31,10 @@ #define H5F_TESTING #include "H5Fpkg.h" +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Iprivate.h" +#include "H5PBprivate.h" + #define FILENAME_LEN 1024 #define NUM_DSETS 5 @@ -570,15 +571,13 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) hid_t file_id = -1; /* File ID */ hid_t fcpl = -1; hid_t fapl = -1; - H5FD_io_info_t fdio_info; - H5P_genplist_t *meta_plist = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id); - H5P_genplist_t *raw_plist = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id); size_t base_page_cnt; size_t page_count = 0; int i, num_elements = 2000; haddr_t addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("Raw Data Handling"); @@ -604,6 +603,8 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) @@ -618,13 +619,13 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* allocate space for a 2000 elements */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; /* intialize all the elements to have a value of -1 */ for(i=0 ; ishared->page_buf->slist_ptr) != page_count + base_page_cnt) @@ -656,7 +657,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) existing pages in the page buffer. */ for(i=0 ; i<200 ; i++) data[i] = i+100; - if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*100), sizeof(int)*200, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*100), sizeof(int)*200, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) FAIL_STACK_ERROR; @@ -665,7 +666,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* Changes: 450 - 600; 150 */ for(i=0 ; i<150 ; i++) data[i] = i+450; - if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*450), sizeof(int)*150, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*450), sizeof(int)*150, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) FAIL_STACK_ERROR; @@ -673,13 +674,13 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* Do a full page write to block 600-800 - should bypass the PB */ for(i=0 ; i<200 ; i++) data[i] = i+600; - if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*600), sizeof(int)*200, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*600), sizeof(int)*200, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) FAIL_STACK_ERROR; /* read elements 800 - 1200, this should not affect the PB, and should read -1s */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*800), sizeof(int)*400, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*800), sizeof(int)*400, data) < 0) FAIL_STACK_ERROR; for (i=0; i < 400; i++) { if(data[i] != -1) { @@ -693,7 +694,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 1200 - 1201, this should read -1 and bring in an * entire page of addr 1200 */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, data) < 0) FAIL_STACK_ERROR; for (i=0; i < 1; i++) { if(data[i] != -1) { @@ -708,7 +709,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 175 - 225, this should use the PB existing pages */ /* Changes: 350 - 450 */ /* read elements 175 - 225, this should use the PB existing pages */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; for (i=0; i < 100; i++) { if(data[i] != i+350) { @@ -721,10 +722,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 0 - 800 using the VFD.. this should result in -1s except for the writes that went through the PB (100-300 & 600-800) */ - fdio_info.file = f->shared->lf; - fdio_info.meta_dxpl = meta_plist; - fdio_info.raw_dxpl = raw_plist; - if(H5FD_read(&fdio_info, H5FD_MEM_DRAW, addr, sizeof(int)*800, data) < 0) + if(H5FD_read(f->shared->lf, H5FD_MEM_DRAW, addr, sizeof(int)*800, data) < 0) FAIL_STACK_ERROR; i = 0; while (i < 800) { @@ -746,7 +744,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 0 - 800 using the PB.. this should result in all * what we have written so far and should get the updates from the PB */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*800, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*800, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) TEST_ERROR; @@ -763,7 +761,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) */ for(i=0 ; i<1000 ; i++) data[i] = 0; - if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, data) < 0) FAIL_STACK_ERROR; page_count -= 2; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) @@ -772,7 +770,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 0 - 1000.. this should go to disk then update the * buffer result 200-400 with existing pages */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*1000, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*1000, data) < 0) FAIL_STACK_ERROR; i=0; while (i < 1000) { @@ -799,6 +797,8 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; HDfree(data); PASSED() @@ -809,6 +809,7 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); +if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; @@ -861,6 +862,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) haddr_t search_addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("LRU Processing"); @@ -894,6 +896,8 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) FAIL_STACK_ERROR; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* opening the file inserts one or more pages into the page buffer. * Get the number of pages inserted, and verify that it is the @@ -904,14 +908,14 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* allocate space for a 2000 elements */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; /* intialize all the elements to have a value of -1 */ for(i=0 ; ishared->page_buf->slist_ptr) != page_count) FAIL_STACK_ERROR; @@ -972,7 +976,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 600 - 601, this should read -1 and bring in an entire page of addr 600, and evict page 200 */ /* Changes: 1200 - 1201; 1200, 400 */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, data) < 0) FAIL_STACK_ERROR; for (i=0; i < 1; i++) { if(data[i] != -1) { @@ -999,7 +1003,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; /* read elements 175 - 225, this should move 100 to the top, evict 600 and bring in 200 */ /* Changes: 350 - 450; 200, 1200, 400 */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; for (i=0; i < 100; i++) { if(data[i] != i+350) { @@ -1030,7 +1034,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) /* Changes: 400 - 1400; 400 */ for(i=0 ; i<1000 ; i++) data[i] = 0; - if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, data) < 0) FAIL_STACK_ERROR; page_count -= 1; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1052,6 +1056,8 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; HDfree(data); PASSED() @@ -1062,6 +1068,7 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); +if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; @@ -1117,6 +1124,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) haddr_t raw_addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("Minimum Metadata threshold Processing"); HDprintf("\n"); @@ -1149,6 +1157,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* create the file */ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) @@ -1178,10 +1188,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(page_buf->min_raw_count != 0) TEST_ERROR; - if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; /* write all raw data, this would end up in page buffer since there @@ -1192,19 +1202,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) for(i=0 ; i<100 ; i++) data[i] = i; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; page_count += 5; @@ -1216,19 +1226,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* write all meta data, this would end up in page buffer */ - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1244,19 +1254,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) * page buffer since the minimum metadata is actually the entire * page buffer */ - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1312,10 +1322,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(page_buf->min_raw_count != 5) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) TEST_ERROR; /* write all meta data, this would end up in page buffer since there @@ -1324,19 +1334,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) for(i=0 ; i<100 ; i++) data[i] = i; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; page_count += 5; @@ -1347,19 +1357,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* write/read all raw data, this would end up in page buffer */ - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1375,19 +1385,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) * page buffer since the minimum metadata is actually the entire * page buffer */ - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*350), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*350), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*750), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*750), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*900), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*900), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1439,39 +1449,39 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(page_buf->min_raw_count != 2) TEST_ERROR; - if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; /* intialize all the elements to have a value of -1 */ for(i=0 ; ishared->page_buf->slist_ptr) != page_count) @@ -1504,10 +1514,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* adding more meta entires should replace meta entries since raw data * is at its minimum */ - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(f->shared->page_buf->meta_count != 3) @@ -1517,13 +1527,13 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* bring existing raw entires up the LRU */ - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; /* adding 2 raw entries (even with 1 call) should only evict 1 meta * entry and another raw entry */ - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(f->shared->page_buf->meta_count != 2) @@ -1533,10 +1543,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* adding 2 meta entries should replace 2 entires at the bottom of the LRU */ - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*98), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*98), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*242), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*242), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(f->shared->page_buf->meta_count != 2) @@ -1566,39 +1576,39 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(page_buf->min_raw_count != 0) TEST_ERROR; - if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; /* intialize all the elements to have a value of -1 */ for(i=0 ; ishared->page_buf->slist_ptr) != page_count) @@ -1623,17 +1633,17 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* bring the rest of the raw entries up the LRU */ - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*700), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*700), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; /* write one more raw entry which replace one meta entry */ - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1648,7 +1658,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* write one more raw entry which should replace another raw entry * keeping min threshold of meta entries */ - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*300), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*300), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1663,7 +1673,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* write a metadata entry that should replace the metadata entry * at the bottom of the LRU */ - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1683,6 +1693,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; HDfree(data); @@ -1696,6 +1708,7 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); +if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; @@ -1750,6 +1763,7 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) haddr_t raw_addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("Statistics Collection"); @@ -1779,6 +1793,8 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) @@ -1805,10 +1821,10 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) if(H5Freset_page_buffering_stats(file_id) < 0) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; @@ -1816,88 +1832,88 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) for(i=0 ; ishared->page_buf->accesses[0] != 8) @@ -1989,6 +2005,8 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; HDfree(data); @@ -2000,6 +2018,7 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); +if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; diff --git a/test/stab.c b/test/stab.c index 97abc16..331c68d 100644 --- a/test/stab.c +++ b/test/stab.c @@ -1141,7 +1141,7 @@ error: } H5E_END_TRY; return 1; -} /* end old_api() */ +} /* end corrupt_stab_msg() */ /*------------------------------------------------------------------------- diff --git a/test/tattr.c b/test/tattr.c index 2d333e9..04bafc4 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -8163,8 +8163,8 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -8177,13 +8177,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -8191,9 +8191,9 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8215,8 +8215,8 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -8229,13 +8229,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -8243,9 +8243,9 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8494,8 +8494,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -8508,13 +8508,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -8522,9 +8522,9 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8546,8 +8546,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -8560,13 +8560,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -8574,9 +8574,9 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8607,18 +8607,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8631,18 +8631,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8663,18 +8663,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8687,18 +8687,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8940,8 +8940,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -8954,13 +8954,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -8968,9 +8968,9 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8992,8 +8992,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -9006,13 +9006,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -9020,8 +9020,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); } /* end else */ @@ -9056,18 +9056,18 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -9309,8 +9309,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -9323,13 +9323,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* ChecFk that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -9337,9 +9337,9 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -9361,8 +9361,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -9375,13 +9375,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -9389,9 +9389,9 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -9435,18 +9435,18 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1 index 5b68002..b0b5085 100644 --- a/test/testfiles/error_test_1 +++ b/test/testfiles/error_test_1 @@ -48,7 +48,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Low-level I/O minor: Read failed #003: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed - major: Data filters + major: Dataset minor: Filter operation failed #004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered major: Data filters diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index 889d64b..f88e77d 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -89,7 +89,7 @@ void tts_error(void) expected[2].maj_num = H5E_LINK; expected[2].min_num = H5E_CANTINIT; - expected[3].maj_num = H5E_SYM; + expected[3].maj_num = H5E_LINK; expected[3].min_num = H5E_CANTINSERT; expected[4].maj_num = H5E_SYM; @@ -98,7 +98,7 @@ void tts_error(void) expected[5].maj_num = H5E_SYM; expected[5].min_num = H5E_CALLBACK; - expected[6].maj_num = H5E_SYM; + expected[6].maj_num = H5E_LINK; expected[6].min_num = H5E_EXISTS; /* set up mutex for global count of errors */ diff --git a/test/unregister.c b/test/unregister.c index a4bf24e..4d7c902 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -16,6 +16,7 @@ * Purpose: Tests H5Zunregister function */ #include "h5test.h" +#include "H5CXprivate.h" /* API Contexts */ const char *FILENAME[] = { "unregister_filter_1", @@ -230,10 +231,13 @@ main(void) { hid_t fapl; int nerrors = 0; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Testing setup */ h5_reset(); fapl = h5_fileaccess(); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Test unregistering filter in its own file */ nerrors += (test_unregister_filters(fapl) < 0 ? 1 : 0); @@ -242,6 +246,8 @@ main(void) goto error; printf("All filter unregistration tests passed.\n"); h5_cleanup(FILENAME, fapl); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; return 0; @@ -249,6 +255,7 @@ error: nerrors = MAX(1, nerrors); printf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); +if(api_ctx_pushed) H5CX_pop(); return 1; } diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 700e993..0a19167 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -3061,7 +3061,7 @@ expunge_entry(H5F_t * file_ptr, if ( nerrors == 0 ) { - result = H5AC_expunge_entry(file_ptr, (hid_t)-1, &(types[0]), + result = H5AC_expunge_entry(file_ptr, &(types[0]), entry_ptr->header.addr, H5AC__NO_FLAGS_SET); if ( result < 0 ) { @@ -3148,7 +3148,7 @@ insert_entry(H5C_t * cache_ptr, (entry_ptr->ver)++; entry_ptr->dirty = TRUE; - result = H5AC_insert_entry(file_ptr, H5AC_ind_read_dxpl_id, &(types[0]), + result = H5AC_insert_entry(file_ptr, &(types[0]), entry_ptr->base_addr, (void *)(&(entry_ptr->header)), flags); if ( ( result < 0 ) || @@ -3547,7 +3547,6 @@ lock_entry(H5F_t * file_ptr, HDassert( ! (entry_ptr->locked) ); cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, - H5AC_ind_read_dxpl_id, &(types[0]), entry_ptr->base_addr, &entry_ptr->base_addr, H5AC__NO_FLAGS_SET); @@ -3844,7 +3843,7 @@ move_entry(H5F_t * file_ptr, new_entry_ptr->local_len = tmp_len; } /* end if */ - result = H5AC_move_entry(file_ptr, &(types[0]), old_addr, new_addr, H5AC_ind_read_dxpl_id); + result = H5AC_move_entry(file_ptr, &(types[0]), old_addr, new_addr); if ( ( result < 0 ) || ( old_entry_ptr->header.addr != new_addr ) ) { @@ -4227,7 +4226,7 @@ setup_cache_for_test(hid_t * fid_ptr, */ if ( success ) { /* allocate space for test entries */ - actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5AC_ind_read_dxpl_id, + actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, (hsize_t)(max_addr + BASE_ADDR)); if ( actual_base_addr == HADDR_UNDEF ) { @@ -5047,7 +5046,7 @@ unlock_entry(H5F_t * file_ptr, entry_ptr->dirty = TRUE; } - result = H5AC_unprotect(file_ptr, H5AC_ind_read_dxpl_id, &(types[0]), + result = H5AC_unprotect(file_ptr, &(types[0]), entry_ptr->base_addr, (void *)(&(entry_ptr->header)), flags); if ( ( result < 0 ) || diff --git a/testpar/t_file.c b/testpar/t_file.c index 1b6978f..f8bf7b3 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -17,21 +17,22 @@ #include "testphdf5.h" -#include "H5PBprivate.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" +#include "H5PBprivate.h" /* * This file needs to access private information from the H5F package. */ -#define H5C_FRIEND /*suppress error about including H5Cpkg */ -#include "H5Cpkg.h" #define H5AC_FRIEND /*suppress error about including H5ACpkg */ #include "H5ACpkg.h" -#define H5MF_FRIEND /*suppress error about including H5MFpkg */ -#include "H5MFpkg.h" +#define H5C_FRIEND /*suppress error about including H5Cpkg */ +#include "H5Cpkg.h" #define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING #include "H5Fpkg.h" +#define H5MF_FRIEND /*suppress error about including H5MFpkg */ +#include "H5MFpkg.h" #define NUM_DSETS 5 @@ -120,7 +121,6 @@ test_page_buffer_access(void) { hid_t file_id = -1; /* File ID */ hid_t fcpl, fapl, fapl_self; - hid_t dxpl_id = H5P_DATASET_XFER_DEFAULT; size_t page_count = 0; int i, num_elements = 200; haddr_t raw_addr, meta_addr; @@ -128,6 +128,7 @@ test_page_buffer_access(void) H5F_t *f = NULL; herr_t ret; /* generic return value */ const char *filename; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); @@ -193,6 +194,9 @@ test_page_buffer_access(void) file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl_self); VRFY((file_id >= 0), ""); +ret = H5CX_push(); +VRFY((ret == 0), "H5CX_push()"); +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ f = (H5F_t *)H5I_object(file_id); @@ -200,19 +204,19 @@ test_page_buffer_access(void) VRFY((f->shared->page_buf != NULL), "Page Buffer created with 1 process"); /* allocate space for 200 raw elements */ - raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements); + raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements); VRFY((raw_addr != HADDR_UNDEF), ""); /* allocate space for 200 metadata elements */ - meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements); + meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements); VRFY((meta_addr != HADDR_UNDEF), ""); page_count = 0; - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data); - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); @@ -220,10 +224,10 @@ test_page_buffer_access(void) /* update the first 50 elements */ for(i=0 ; i<50 ; i++) data[i] = i; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); H5Eprint2(H5E_DEFAULT, stderr); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); page_count += 2; VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); @@ -231,43 +235,43 @@ test_page_buffer_access(void) /* update the second 50 elements */ for(i=0 ; i<50 ; i++) data[i] = i+50; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); /* update 100 - 200 */ for(i=0 ; i<100 ; i++) data[i] = i+100; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); - ret = H5PB_flush(f, dxpl_id, FALSE); + ret = H5PB_flush(f, FALSE); VRFY((ret == 0), ""); /* read elements 0 - 200 */ - ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 200; i++) VRFY((data[i] == i), "Read different values than written"); - ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 200; i++) VRFY((data[i] == i), "Read different values than written"); /* read elements 0 - 50 */ - ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 50; i++) VRFY((data[i] == i), "Read different values than written"); - ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 50; i++) @@ -278,6 +282,7 @@ test_page_buffer_access(void) VRFY((ret >= 0), "H5Fclose succeeded"); ret = H5Pclose(fapl_self); VRFY((ret>=0), "H5Pclose succeeded"); +if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } } #endif @@ -292,6 +297,9 @@ test_page_buffer_access(void) file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); VRFY((file_id >= 0), ""); +ret = H5CX_push(); +VRFY((ret == 0), "H5CX_push()"); +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ f = (H5F_t *)H5I_object(file_id); @@ -299,17 +307,17 @@ test_page_buffer_access(void) VRFY((f->shared->page_buf != NULL), "Page Buffer created with 1 process"); /* allocate space for 200 raw elements */ - raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements); + raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements); VRFY((raw_addr != HADDR_UNDEF), ""); /* allocate space for 200 metadata elements */ - meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements); + meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements); VRFY((meta_addr != HADDR_UNDEF), ""); page_count = 0; - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); @@ -317,27 +325,27 @@ test_page_buffer_access(void) /* update the first 50 elements */ for(i=0 ; i<50 ; i++) data[i] = i; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); /* update the second 50 elements */ for(i=0 ; i<50 ; i++) data[i] = i+50; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); /* update 100 - 200 */ for(i=0 ; i<100 ; i++) data[i] = i+100; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); @@ -345,24 +353,24 @@ test_page_buffer_access(void) VRFY((ret == 0), ""); /* read elements 0 - 200 */ - ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 200; i++) VRFY((data[i] == i), "Read different values than written"); - ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 200; i++) VRFY((data[i] == i), "Read different values than written"); /* read elements 0 - 50 */ - ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 50; i++) VRFY((data[i] == i), "Read different values than written"); - ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); page_count += 1; VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); @@ -373,20 +381,20 @@ test_page_buffer_access(void) /* reset the first 50 elements to -1*/ for(i=0 ; i<50 ; i++) data[i] = -1; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); /* read elements 0 - 50 */ - ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 50; i++) VRFY((data[i] == -1), "Read different values than written"); - ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 50; i++) @@ -401,6 +409,7 @@ test_page_buffer_access(void) VRFY((ret>=0), "H5Pclose succeeded"); ret = H5Pclose(fcpl); VRFY((ret>=0), "H5Pclose succeeded"); +if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } HDfree(data); data = NULL; @@ -424,6 +433,7 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str H5F_t *f = NULL; H5C_t *cache_ptr = NULL; H5AC_cache_config_t config; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret; file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); @@ -431,6 +441,9 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VRFY((ret == 0), ""); +ret = H5CX_push(); +VRFY((ret == 0), "H5CX_push()"); +api_ctx_pushed = TRUE; f = (H5F_t *)H5I_object(file_id); VRFY((f != NULL), ""); @@ -548,6 +561,7 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str VRFY((ret == 0), ""); ret = H5Sclose(mem_dataspace); VRFY((ret == 0), ""); +if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } MPI_Barrier(MPI_COMM_WORLD); HDfree(data_array); @@ -572,6 +586,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, H5F_t *f = NULL; H5C_t *cache_ptr = NULL; H5AC_cache_config_t config; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret; config.version = H5AC__CURR_CACHE_CONFIG_VERSION; @@ -586,6 +601,9 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl); H5Eprint2(H5E_DEFAULT, stderr); VRFY((file_id >= 0), ""); +ret = H5CX_push(); +VRFY((ret == 0), "H5CX_push()"); +api_ctx_pushed = TRUE; ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VRFY((ret == 0), ""); @@ -677,7 +695,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, HDassert(entry_ptr->is_dirty == FALSE); if(!entry_ptr->is_pinned && !entry_ptr->is_protected) { - ret = H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, entry_ptr->type, entry_ptr->addr, 0); + ret = H5AC_expunge_entry(f, entry_ptr->type, entry_ptr->addr, 0); VRFY((ret == 0), ""); } @@ -699,6 +717,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, VRFY((ret == 0), ""); ret = H5Sclose(mem_dataspace); VRFY((ret == 0), ""); +if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } HDfree(data_array); return nerrors; diff --git a/testpar/t_pread.c b/testpar/t_pread.c index a527503..5b75d6c 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -102,7 +102,7 @@ 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; - char *group_filename = NULL; + const char *group_filename = NULL; char data_filename[FILENAME_BUF_SIZE]; char reloc_data_filename[FILENAME_BUF_SIZE]; char prolog_filename[FILENAME_BUF_SIZE]; diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 1052a69..9913225 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -24,8 +24,8 @@ #include "hdf5.h" #include "H5private.h" -#include "testphdf5.h" #include "H5Spkg.h" /* Dataspaces */ +#include "testphdf5.h" /* On Lustre (and perhaps other parallel file systems?), we have severe diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index a42df95..8fe1c8d 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -32,8 +32,14 @@ */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ + +/* Define this macro to indicate that the testing APIs should be available */ +#define H5S_TESTING + #include "hdf5.h" #include "H5private.h" +#include "H5Spkg.h" /* Dataspaces */ #include "testphdf5.h" diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index 72f826e..7e00b4f 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -38,6 +38,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5B2pkg.h" /* v2 B-trees */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ @@ -247,13 +248,14 @@ get_H5FA_class(const uint8_t *sig) int main(int argc, char *argv[]) { - hid_t fid, fapl, dxpl; + hid_t fid, fapl; H5F_t *f; haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0; uint8_t sig[H5F_SIGNATURE_LEN]; size_t u; H5E_auto2_t func; void *edata; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t status = SUCCEED; if(argc == 1) { @@ -274,7 +276,6 @@ main(int argc, char *argv[]) /* * Open the file and get the file descriptor. */ - dxpl = H5AC_ind_read_dxpl_id; if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { HDfprintf(stderr, "cannot create file access property list\n"); HDexit(1); @@ -288,6 +289,11 @@ main(int argc, char *argv[]) HDfprintf(stderr, "cannot open file\n"); HDexit(1); } /* end if */ +if(H5CX_push() < 0) { + HDfprintf(stderr, "cannot set API context\n"); + HDexit(1); +} +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(fid))) { HDfprintf(stderr, "cannot obtain H5F_t pointer\n"); HDexit(2); @@ -317,7 +323,7 @@ main(int argc, char *argv[]) * Read the signature at the specified file position. */ HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr); - if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), dxpl, sig) < 0) { + if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), sig) < 0) { HDfprintf(stderr, "cannot read signature\n"); HDexit(3); } @@ -331,13 +337,13 @@ main(int argc, char *argv[]) /* * Debug a local heap. */ - status = H5HL_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5HL_debug(f, addr, stdout, 0, VCOL); } else if(!HDmemcmp (sig, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a global heap collection. */ - status = H5HG_debug (f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5HG_debug (f, addr, stdout, 0, VCOL); } else if(!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -351,7 +357,7 @@ main(int argc, char *argv[]) HDfprintf(stderr, "\th5debug
\n\n"); } /* end if */ - status = H5G_node_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, extra); + status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra); } else if(!HDmemcmp(sig, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -373,7 +379,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5G_node_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, extra); + status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra); break; case H5B_CHUNK_ID: @@ -411,7 +417,7 @@ main(int argc, char *argv[]) /* Set the last dimension (the element size) to zero */ dim[ndims] = 0; - status = H5D_btree_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, ndims, dim); + status = H5D_btree_debug(f, addr, stdout, 0, VCOL, ndims, dim); break; case H5B_NUM_BTREE_ID: @@ -434,7 +440,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5B2__hdr_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, (haddr_t)extra); + status = H5B2__hdr_debug(f, addr, stdout, 0, VCOL, cls, (haddr_t)extra); } else if(!HDmemcmp(sig, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -461,7 +467,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5B2__int_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (unsigned)extra3, (haddr_t)extra4); + status = H5B2__int_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (unsigned)extra3, (haddr_t)extra4); } else if(!HDmemcmp(sig, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -486,13 +492,13 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5B2__leaf_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (haddr_t)extra3); + status = H5B2__leaf_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (haddr_t)extra3); } else if(!HDmemcmp(sig, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a fractal heap header. */ - status = H5HF_hdr_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5HF_hdr_debug(f, addr, stdout, 0, VCOL); } else if(!HDmemcmp(sig, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -507,7 +513,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5HF_dblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, extra, (size_t)extra2); + status = H5HF_dblock_debug(f, addr, stdout, 0, VCOL, extra, (size_t)extra2); } else if(!HDmemcmp(sig, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -522,14 +528,14 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5HF_iblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, extra, (unsigned)extra2); + status = H5HF_iblock_debug(f, addr, stdout, 0, VCOL, extra, (unsigned)extra2); } else if(!HDmemcmp(sig, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a free space header. */ - status = H5FS_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5FS_debug(f, addr, stdout, 0, VCOL); } else if(!HDmemcmp(sig, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -544,14 +550,14 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5FS_sects_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, extra, extra2); + status = H5FS_sects_debug(f, addr, stdout, 0, VCOL, extra, extra2); } else if(!HDmemcmp(sig, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug shared message master table. */ - status = H5SM_table_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, (unsigned) UFAIL, (unsigned) UFAIL); + status = H5SM_table_debug(f, addr, stdout, 0, VCOL, (unsigned) UFAIL, (unsigned) UFAIL); } else if(!HDmemcmp(sig, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -566,7 +572,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5SM_list_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, (haddr_t)extra); + status = H5SM_list_debug(f, addr, stdout, 0, VCOL, (haddr_t)extra); } else if(!HDmemcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -583,7 +589,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5EA__hdr_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra); + status = H5EA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra); } else if(!HDmemcmp(sig, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -600,7 +606,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5EA__iblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, extra2); + status = H5EA__iblock_debug(f, addr, stdout, 0, VCOL, cls, extra, extra2); } else if(!HDmemcmp(sig, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -617,7 +623,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5EA__sblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, extra3); + status = H5EA__sblock_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, extra3); } else if(!HDmemcmp(sig, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -634,7 +640,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5EA__dblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, (size_t)extra2, extra3); + status = H5EA__dblock_debug(f, addr, stdout, 0, VCOL, cls, extra, (size_t)extra2, extra3); } else if(!HDmemcmp(sig, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -651,7 +657,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5FA__hdr_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra); + status = H5FA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra); } else if(!HDmemcmp(sig, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -668,21 +674,21 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5FA__dblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, extra2); + status = H5FA__dblock_debug(f, addr, stdout, 0, VCOL, cls, extra, extra2); } else if(!HDmemcmp(sig, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug v2 object header (which have signatures). */ - status = H5O_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5O_debug(f, addr, stdout, 0, VCOL); } else if(sig[0] == H5O_VERSION_1) { /* * This could be a v1 object header. Since they don't have a signature * it's a somewhat "ify" detection. */ - status = H5O_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5O_debug(f, addr, stdout, 0, VCOL); } else { /* @@ -713,6 +719,7 @@ main(int argc, char *argv[]) H5Pclose(fapl); H5Fclose(fid); +if(api_ctx_pushed) H5CX_pop(); H5Eset_auto2(H5E_DEFAULT, func, edata); diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 459a37e..163d4e1 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -110,11 +110,14 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define SPACE1_DIM2 0 /* 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, - H5_ATTR_UNUSED const void * udata, H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id) +static hid_t +UD_traverse(H5_ATTR_UNUSED const char * link_name, H5_ATTR_UNUSED hid_t cur_group, + H5_ATTR_UNUSED const void * udata, H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id, + H5_ATTR_UNUSED hid_t dxpl_id) { return -1; } + const H5L_class_t UD_link_class[1] = {{ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ (H5L_type_t)MY_LINKCLASS, /* Link type id number */ diff --git a/tools/test/h5dump/errfiles/filter_fail.err b/tools/test/h5dump/errfiles/filter_fail.err index 5276ab0..a785ea7 100644 --- a/tools/test/h5dump/errfiles/filter_fail.err +++ b/tools/test/h5dump/errfiles/filter_fail.err @@ -9,7 +9,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Low-level I/O minor: Read failed #003: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed - major: Data filters + major: Dataset minor: Filter operation failed #004: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered major: Data filters diff --git a/tools/test/h5dump/errfiles/tall-1.err b/tools/test/h5dump/errfiles/tall-1.err index ab9dbe3..2f9ef71 100644 --- a/tools/test/h5dump/errfiles/tall-1.err +++ b/tools/test/h5dump/errfiles/tall-1.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2A.err b/tools/test/h5dump/errfiles/tall-2A.err index ab9dbe3..2f9ef71 100644 --- a/tools/test/h5dump/errfiles/tall-2A.err +++ b/tools/test/h5dump/errfiles/tall-2A.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2A0.err b/tools/test/h5dump/errfiles/tall-2A0.err index ab9dbe3..2f9ef71 100644 --- a/tools/test/h5dump/errfiles/tall-2A0.err +++ b/tools/test/h5dump/errfiles/tall-2A0.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2B.err b/tools/test/h5dump/errfiles/tall-2B.err index ab9dbe3..2f9ef71 100644 --- a/tools/test/h5dump/errfiles/tall-2B.err +++ b/tools/test/h5dump/errfiles/tall-2B.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tarray1_big.err b/tools/test/h5dump/errfiles/tarray1_big.err index 7a0fd7b..be77711 100644 --- a/tools/test/h5dump/errfiles/tarray1_big.err +++ b/tools/test/h5dump/errfiles/tarray1_big.err @@ -1,22 +1,22 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): diff --git a/tools/test/h5dump/errfiles/tattr-3.err b/tools/test/h5dump/errfiles/tattr-3.err index ce8ddda..3a34314 100644 --- a/tools/test/h5dump/errfiles/tattr-3.err +++ b/tools/test/h5dump/errfiles/tattr-3.err @@ -1,8 +1,11 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Aopen(): unable to load attribute info from object header for attribute: 'attr' major: Attribute - minor: Unable to initialize object - #001: (file name) line (number) in H5O_attr_open_by_name(): can't locate attribute: 'attr' + minor: Can't open object + #001: (file name) line (number) in H5A__open(): unable to load attribute info from object header for attribute: 'attr' + major: Attribute + minor: Can't open object + #002: (file name) line (number) in H5O__attr_open_by_name(): can't locate attribute: 'attr' major: Attribute minor: Object not found h5dump error: unable to open attribute "attr" diff --git a/tools/test/h5dump/errfiles/tattrregR.err b/tools/test/h5dump/errfiles/tattrregR.err index 9449a6d..d84d5ec 100644 --- a/tools/test/h5dump/errfiles/tattrregR.err +++ b/tools/test/h5dump/errfiles/tattrregR.err @@ -1,15 +1,15 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): diff --git a/tools/test/h5dump/errfiles/tcomp-3.err b/tools/test/h5dump/errfiles/tcomp-3.err index ee47ee5..e41e97a 100644 --- a/tools/test/h5dump/errfiles/tcomp-3.err +++ b/tools/test/h5dump/errfiles/tcomp-3.err @@ -1,16 +1,19 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Topen2(): not found + #000: (file name) line (number) in H5Topen2(): unable to open named datatype + major: Datatype + minor: Can't open object + #001: (file name) line (number) in H5T__open_name(): not found major: Datatype minor: Object not found - #001: (file name) line (number) in H5G_loc_find(): can't find object + #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #004: (file name) line (number) in H5G_loc_find_cb(): object '#6632' doesn't exist + #005: (file name) line (number) in H5G__loc_find_cb(): object '#6632' doesn't exist major: Symbol table minor: Object not found diff --git a/tools/test/h5dump/errfiles/tdataregR.err b/tools/test/h5dump/errfiles/tdataregR.err index 9449a6d..d84d5ec 100644 --- a/tools/test/h5dump/errfiles/tdataregR.err +++ b/tools/test/h5dump/errfiles/tdataregR.err @@ -1,15 +1,15 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): diff --git a/tools/test/h5dump/errfiles/tdset-2.err b/tools/test/h5dump/errfiles/tdset-2.err index e594c1b..d00a92b 100644 --- a/tools/test/h5dump/errfiles/tdset-2.err +++ b/tools/test/h5dump/errfiles/tdset-2.err @@ -11,26 +11,29 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #005: (file name) line (number) in H5G_loc_find_cb(): object 'dset3' doesn't exist + #005: (file name) line (number) in H5G__loc_find_cb(): object 'dset3' doesn't exist major: Symbol table minor: Object not found HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Lget_info(): unable to get link info major: Links - minor: Object not found - #001: (file name) line (number) in H5L_get_info(): name doesn't exist - major: Symbol table + minor: Can't get value + #001: (file name) line (number) in H5L__get_info(): unable to get link info for: 'dset3' + major: Links + minor: Can't get value + #002: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Links minor: Object already exists - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist - major: Symbol table + #005: (file name) line (number) in H5L__get_info_cb(): name doesn't exist + major: Links minor: Object not found h5dump error: unable to get link info from "dset3" diff --git a/tools/test/h5dump/errfiles/textlink.err b/tools/test/h5dump/errfiles/textlink.err index 95556db..665517d 100644 --- a/tools/test/h5dump/errfiles/textlink.err +++ b/tools/test/h5dump/errfiles/textlink.err @@ -2,49 +2,55 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'filename', temp_file_name = 'filename' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'filename', temp_file_name = 'filename' major: Links minor: Unable to open file HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'anotherfile', temp_file_name = 'anotherfile' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'anotherfile', temp_file_name = 'anotherfile' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/textlinkfar.err b/tools/test/h5dump/errfiles/textlinkfar.err index 5aa7f87..a888ba9 100644 --- a/tools/test/h5dump/errfiles/textlinkfar.err +++ b/tools/test/h5dump/errfiles/textlinkfar.err @@ -2,49 +2,52 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #008: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object - #008: (file name) line (number) in H5O_open_name(): object not found + #009: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #009: (file name) line (number) in H5G_loc_find(): can't find object + #010: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #010: (file name) line (number) in H5G_traverse(): internal path traversal failed + #011: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #011: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #012: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #012: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed + #013: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed major: Links minor: Link traversal failure - #013: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + #014: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link major: Symbol table minor: Object not found - #014: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #015: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #015: (file name) line (number) in H5G_traverse_slink_cb(): component not found + #016: (file name) line (number) in H5G__traverse_slink_cb(): component not found major: Symbol table minor: Object not found HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): @@ -54,17 +57,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #001: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #002: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #005: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #005: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -75,17 +78,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #008: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #009: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #012: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #012: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -96,17 +99,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #015: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #016: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #019: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #019: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -117,17 +120,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #022: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #023: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #026: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #026: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -138,7 +141,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #029: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #030: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #031: (file name) line (number) in H5G__traverse_special(): too many links @@ -151,17 +154,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #001: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #002: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #005: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #005: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -172,17 +175,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #008: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #009: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #012: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #012: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -193,17 +196,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #015: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #016: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #019: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #019: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -214,17 +217,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #022: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #023: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #026: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #026: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -235,7 +238,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #029: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #030: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #031: (file name) line (number) in H5G__traverse_special(): too many links diff --git a/tools/test/h5dump/errfiles/textlinksrc.err b/tools/test/h5dump/errfiles/textlinksrc.err index 5aa7f87..a888ba9 100644 --- a/tools/test/h5dump/errfiles/textlinksrc.err +++ b/tools/test/h5dump/errfiles/textlinksrc.err @@ -2,49 +2,52 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #008: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object - #008: (file name) line (number) in H5O_open_name(): object not found + #009: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #009: (file name) line (number) in H5G_loc_find(): can't find object + #010: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #010: (file name) line (number) in H5G_traverse(): internal path traversal failed + #011: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #011: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #012: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #012: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed + #013: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed major: Links minor: Link traversal failure - #013: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + #014: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link major: Symbol table minor: Object not found - #014: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #015: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #015: (file name) line (number) in H5G_traverse_slink_cb(): component not found + #016: (file name) line (number) in H5G__traverse_slink_cb(): component not found major: Symbol table minor: Object not found HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): @@ -54,17 +57,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #001: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #002: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #005: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #005: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -75,17 +78,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #008: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #009: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #012: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #012: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -96,17 +99,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #015: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #016: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #019: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #019: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -117,17 +120,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #022: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #023: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #026: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #026: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -138,7 +141,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #029: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #030: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #031: (file name) line (number) in H5G__traverse_special(): too many links @@ -151,17 +154,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #001: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #002: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #005: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #005: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -172,17 +175,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #008: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #009: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #012: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #012: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -193,17 +196,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #015: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #016: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #019: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #019: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -214,17 +217,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #022: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #023: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #026: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #026: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -235,7 +238,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #029: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #030: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #031: (file name) line (number) in H5G__traverse_special(): too many links diff --git a/tools/test/h5dump/errfiles/tgroup-2.err b/tools/test/h5dump/errfiles/tgroup-2.err index 3659b5c..715f2d2 100644 --- a/tools/test/h5dump/errfiles/tgroup-2.err +++ b/tools/test/h5dump/errfiles/tgroup-2.err @@ -11,10 +11,10 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #005: (file name) line (number) in H5G_loc_find_cb(): object 'y' doesn't exist + #005: (file name) line (number) in H5G__loc_find_cb(): object 'y' doesn't exist major: Symbol table minor: Object not found h5dump error: unable to open group "/y" diff --git a/tools/test/h5dump/errfiles/torderlinks1.err b/tools/test/h5dump/errfiles/torderlinks1.err index e665f03..fba8822 100644 --- a/tools/test/h5dump/errfiles/torderlinks1.err +++ b/tools/test/h5dump/errfiles/torderlinks1.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/torderlinks2.err b/tools/test/h5dump/errfiles/torderlinks2.err index e665f03..fba8822 100644 --- a/tools/test/h5dump/errfiles/torderlinks2.err +++ b/tools/test/h5dump/errfiles/torderlinks2.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tperror.err b/tools/test/h5dump/errfiles/tperror.err index b469029..55aeb4a 100644 --- a/tools/test/h5dump/errfiles/tperror.err +++ b/tools/test/h5dump/errfiles/tperror.err @@ -11,26 +11,29 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #005: (file name) line (number) in H5G_loc_find_cb(): object 'bogus' doesn't exist + #005: (file name) line (number) in H5G__loc_find_cb(): object 'bogus' doesn't exist major: Symbol table minor: Object not found HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Lget_info(): unable to get link info major: Links - minor: Object not found - #001: (file name) line (number) in H5L_get_info(): name doesn't exist - major: Symbol table + minor: Can't get value + #001: (file name) line (number) in H5L__get_info(): unable to get link info for: 'bogus' + major: Links + minor: Can't get value + #002: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Links minor: Object already exists - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist - major: Symbol table + #005: (file name) line (number) in H5L__get_info_cb(): name doesn't exist + major: Links minor: Object not found h5dump error: unable to get link info from "bogus" diff --git a/tools/test/h5dump/errfiles/tslink-D.err b/tools/test/h5dump/errfiles/tslink-D.err index 924e9cf..de0705e 100644 --- a/tools/test/h5dump/errfiles/tslink-D.err +++ b/tools/test/h5dump/errfiles/tslink-D.err @@ -11,18 +11,18 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #005: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + #006: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link major: Symbol table minor: Object not found - #007: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #007: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #008: (file name) line (number) in H5G_traverse_slink_cb(): component not found + #008: (file name) line (number) in H5G__traverse_slink_cb(): component not found major: Symbol table minor: Object not found diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 0eaa2d0..9358fbb 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -172,7 +172,8 @@ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ /* 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, - H5_ATTR_UNUSED const void * udata, H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id) + H5_ATTR_UNUSED const void * udata, H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id, + H5_ATTR_UNUSED hid_t dxpl_id) { return -1; } diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index 9f3d000..bd07fb4 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -87,7 +87,8 @@ typedef struct s1_t { /* A UD link traversal function. Shouldn't actually be called. */ static hid_t UD_traverse(const char H5_ATTR_UNUSED * link_name, hid_t H5_ATTR_UNUSED cur_group, - const void H5_ATTR_UNUSED * udata, size_t H5_ATTR_UNUSED udata_size, hid_t H5_ATTR_UNUSED lapl_id) + const void H5_ATTR_UNUSED * udata, size_t H5_ATTR_UNUSED udata_size, hid_t H5_ATTR_UNUSED lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { return -1; } diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst index 95cc4c6..069fb3b 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst @@ -8,17 +8,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #002: (file name) line (number) in H5L_link_object(): unable to create new link to object major: Links minor: Unable to initialize object - #003: (file name) line (number) in H5L_create_real(): can't insert link - major: Symbol table + #003: (file name) line (number) in H5L__create_real(): can't insert link + major: Links minor: Unable to insert object #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #005: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #005: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #006: (file name) line (number) in H5L_link_cb(): unable to create object - major: Object header + #006: (file name) line (number) in H5L__link_cb(): unable to create object + major: Links minor: Unable to initialize object #007: (file name) line (number) in H5O_obj_create(): unable to open object major: Object header -- cgit v0.12 From a32178ba9408ceffbb1656489703885d69fb5ed0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 16 Mar 2018 09:03:08 -0500 Subject: Fix memory leak simply by capturing allocation in var --- test/ohdr.c | 112 ++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 59 insertions(+), 53 deletions(-) diff --git a/test/ohdr.c b/test/ohdr.c index e886bf9..ab50a5f5 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -21,14 +21,14 @@ * This file needs to access private datatypes from the H5O package. * This file also needs to access the object header testing code. */ -#define H5O_FRIEND /*suppress error about including H5Opkg */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ #define H5O_TESTING #include "H5Opkg.h" /* * This file needs to access private datatypes from the H5G package. */ -#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #include "H5Gpkg.h" const char *FILENAME[] = { @@ -49,24 +49,24 @@ const char *FILENAME[] = { /* * Verify that messages are moved forward into a "continuation message": - * Create an object header with several continuation chunks - * Remove a message in the last chunk - * The remaining message(s) in the last chunk should be moved forward into the continuation message - * The process will repeat when the continuation message is big enough to hold all the - * messages in the last chunk. - * Result: the number of chunks should be reduced + * Create an object header with several continuation chunks + * Remove a message in the last chunk + * The remaining message(s) in the last chunk should be moved forward into the continuation message + * The process will repeat when the continuation message is big enough to hold all the + * messages in the last chunk. + * Result: the number of chunks should be reduced */ static herr_t test_cont(char *filename, hid_t fapl) { - hid_t file=-1; - H5F_t *f = NULL; + hid_t file=-1; + H5F_t *f = NULL; H5O_hdr_info_t hdr_info; - H5O_loc_t oh_locA, oh_locB; - time_t time_new; - const char *short_name = "T"; - const char *long_name = "This is the message"; - size_t nchunks; + H5O_loc_t oh_locA, oh_locB; + time_t time_new; + const char *short_name = "T"; + const char *long_name = "This is the message"; + size_t nchunks; TESTING("object header continuation block"); @@ -167,15 +167,15 @@ error: static herr_t test_ohdr_cache(char *filename, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = -1; /* File ID */ hid_t my_fapl; /* FAPL ID */ hid_t my_dxpl; /* DXPL ID */ H5AC_cache_config_t mdc_config; /* Metadata cache configuration info */ - H5F_t *f = NULL; /* File handle */ + H5F_t *f = NULL; /* File handle */ H5HL_t *lheap, *lheap2, *lheap3; /* Pointer to local heaps */ haddr_t lheap_addr, lheap_addr2, lheap_addr3; /* Local heap addresses */ - H5O_loc_t oh_loc; /* Object header location */ - time_t time_new; /* Time value for modification time message */ + H5O_loc_t oh_loc; /* Object header location */ + time_t time_new; /* Time value for modification time message */ unsigned rc; /* Refcount for object */ TESTING("object header creation in cache"); @@ -309,17 +309,17 @@ error: static herr_t test_ohdr_swmr(hbool_t new_format) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list */ - hid_t did = -1; /* Dataset ID */ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list */ + hid_t did = -1; /* Dataset ID */ hid_t sid = -1; /* Dataspace ID */ - hid_t plist = -1; /* Dataset creation property list */ - size_t compact_size = 1024; /* The size of compact dataset */ - int *wbuf = NULL; /* Buffer for writing */ - hsize_t dims[1]; /* Dimension sizes */ - size_t u; /* Iterator */ + hid_t plist = -1; /* Dataset creation property list */ + size_t compact_size = 1024; /* The size of compact dataset */ + int *wbuf = NULL; /* Buffer for writing */ + hsize_t dims[1]; /* Dimension sizes */ + size_t u; /* Iterator */ int n; /* Data variable */ - H5O_info_t obj_info; /* Information for the object */ + H5O_info_t obj_info; /* Information for the object */ if(new_format) { TESTING("exercise the coding for the re-read of the object header for SWMR access: latest-format"); @@ -355,7 +355,7 @@ test_ohdr_swmr(hbool_t new_format) dims[0] = (hsize_t)compact_size; if((sid = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR - + /* Create property list for compact dataset creation */ if((plist = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR @@ -448,10 +448,10 @@ error: /* * To test objects with unknown messages in a file with: - * a) H5O_BOGUS_VALID_ID: - * --the bogus_id is within the range of H5O_msg_class_g[] - * b) H5O_BOGUS_INVALID_ID: - * --the bogus_id is outside the range of H5O_msg_class_g[] + * a) H5O_BOGUS_VALID_ID: + * --the bogus_id is within the range of H5O_msg_class_g[] + * b) H5O_BOGUS_INVALID_ID: + * --the bogus_id is outside the range of H5O_msg_class_g[] * * The test file is FILE_BOGUS: "tbogus.h5" generated with gen_bogus.c * --objects that have unknown header messages with H5O_BOGUS_VALID_ID in "/" @@ -462,15 +462,15 @@ error: static herr_t test_unknown(unsigned bogus_id, char *filename, hid_t fapl) { - hid_t fid = -1; /* file ID */ - hid_t gid = -1; /* group ID */ - hid_t did = -1; /* Dataset ID */ + hid_t fid = -1; /* file ID */ + hid_t gid = -1; /* group ID */ + hid_t did = -1; /* Dataset ID */ hid_t sid = -1; /* Dataspace ID */ hid_t aid = -1; /* Attribute ID */ - hid_t loc = -1; /* location: file or group ID */ - hid_t fid_bogus = -1; /* bogus file ID */ - hid_t gid_bogus = -1; /* bogus group ID */ - hid_t loc_bogus = -1; /* location: bogus file or group ID */ + hid_t loc = -1; /* location: file or group ID */ + hid_t fid_bogus = -1; /* bogus file ID */ + hid_t gid_bogus = -1; /* bogus group ID */ + hid_t loc_bogus = -1; /* location: bogus file or group ID */ char testfile[256]; /* create a different name for a local copy of the data file to be @@ -497,7 +497,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Set up location ID depending on bogus_id */ if(bogus_id == H5O_BOGUS_INVALID_ID) { /* Open "group" in FILE_BOGUS */ - if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) + if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR loc_bogus = gid_bogus; @@ -562,7 +562,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Set up location ID depending on bogus_id */ if(bogus_id == H5O_BOGUS_INVALID_ID) { /* Open "group" in filename */ - if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR loc = gid; } else @@ -596,7 +596,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Set up location ID depending on bogus_id */ if(bogus_id == H5O_BOGUS_INVALID_ID) { /* Open "group" in filename */ - if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR loc = gid; } else @@ -642,7 +642,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Set up location ID depending on bogus_id */ if(bogus_id == H5O_BOGUS_INVALID_ID) { /* Open "group" in filename */ - if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR loc = gid; } else @@ -660,7 +660,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) if(H5Dclose(did) < 0) FAIL_STACK_ERROR - /* Closing: filename */ + /* Closing: filename */ if(bogus_id == H5O_BOGUS_INVALID_ID) if(H5Gclose(gid) < 0) FAIL_STACK_ERROR @@ -685,7 +685,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Set up location ID */ if(bogus_id == H5O_BOGUS_INVALID_ID) { /* Open "group" in FILE_BOGUS */ - if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) + if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR loc_bogus = gid_bogus; } else @@ -716,7 +716,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Closing: FILE_BOGUS */ if(bogus_id == H5O_BOGUS_INVALID_ID) if(H5Gclose(gid_bogus) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Fclose(fid_bogus) < 0) FAIL_STACK_ERROR @@ -772,21 +772,21 @@ char *version_string(H5F_libver_t libver) sprintf(str, "%ld", (long)libver); break; } /* end switch */ - + /* Return the formed version bound string */ return(str); } /* end of version_string */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: Exercise private object header behavior and routines * * Return: Success: 0 * Failure: 1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 * * Modification: @@ -819,6 +819,8 @@ main(void) /* Loop through all the combinations of low/high library format bounds */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + char *low_string = NULL; + char *high_string = NULL; /* Set version bounds before opening the file */ H5E_BEGIN_TRY { @@ -829,9 +831,13 @@ main(void) continue; /* Display info about testing */ - sprintf(msg, "Using file format version: (%s, %s)", version_string(low), - version_string(high)); + low_string = version_string(low); + high_string = version_string(high); + sprintf(msg, "Using file format version: (%s, %s)", low_string, + high_string); HDputs(msg); + HDfree(high_string); + HDfree(low_string); /* test on object continuation block */ if(test_cont(filename, fapl) < 0) -- cgit v0.12 From dda1e103a527eeb747ce6fba9aefe14c11d799c5 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 16 Mar 2018 10:42:33 -0500 Subject: Fixed HDFFV-10151 Description: Added a document to the HDF5 C++ API Reference Manual to show the mapping from a C API to C++ wrappers. --- release_docs/RELEASE.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e6fd8d3..caf53fc 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -231,6 +231,12 @@ New Features (BMR - 2018/03/11, HDFFV-10149) + - A document is added to the HDF5 C++ API Reference Manual to show the + mapping from a C API to C++ wrappers. It can be found from the main + page of the C++ API Reference Manual. + + (BMR - 2017/10/17, HDFFV-10151) + Java Library: ---------------- -- cgit v0.12 From 6fac268a7e1ee5b6d5314f40ac45630d9c67d873 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sat, 17 Mar 2018 10:19:22 -0500 Subject: Updated RELEASE.txt Description: Wrappers for H5Tencode and H5Tdecode No code change. --- release_docs/RELEASE.txt | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index caf53fc..e18b43a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -174,8 +174,7 @@ New Features C++ Library: ------------ - - The following wrappers are added: - + - The following C++ API wrappers have been added to the C++ Library: + H5Lcreate_soft: // Creates a soft link from link_name to target_name. void link(const char *target_name, const char *link_name,...) @@ -219,15 +218,37 @@ New Features void unlink(const H5std_string& link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) - - Added class LinkCreatPropList + Note: additional parameter is added to previous H5Location::unlink. + + + H5Tencode and H5Tdecode: + // Creates a binary object description of this datatype. + void DataType::encode() - C API H5Tencode() + + // Returns the decoded type from the binary object description. + DataType::decode() - C API H5Tdecode() + ArrayType::decode() - C API H5Tdecode() + CompType::decode() - C API H5Tdecode() + DataType::decode() - C API H5Tdecode() + EnumType::decode() - C API H5Tdecode() + FloatType::decode() - C API H5Tdecode() + IntType::decode() - C API H5Tdecode() + StrType::decode() - C API H5Tdecode() + VarLenType::decode() - C API H5Tdecode() + + + H5Lget_info: + // Returns the information of the named link. + H5L_info_t getLinkInfo(const H5std_string& link_name,...) + + (BMR - 2018/03/11, HDFFV-10149) + + - Added class LinkCreatPropList for link create property list. + + (BMR - 2018/03/11, HDFFV-10149) - Added overloaded functions H5Location::createGroup to take a link creation property list Group createGroup(const char* name, const LinkCreatPropList& lcpl) Group createGroup(const H5std_string& name, const LinkCreatPropList& lcpl) - - Added wrapper for H5Lget_info() to H5Location - // Returns the information of the named link. - H5L_info_t getLinkInfo(const H5std_string& link_name,...) (BMR - 2018/03/11, HDFFV-10149) -- cgit v0.12 From d812c6fe60fec2451d8d78b8fb51547628307a6c Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 18 Mar 2018 22:51:19 -0500 Subject: Cleanup API context function usage. --- src/H5A.c | 246 +++++++++-------------------------------------- src/H5Adeprec.c | 45 +-------- src/H5Atest.c | 15 +-- src/H5D.c | 46 ++++----- src/H5Ddbg.c | 7 -- src/H5Ddeprec.c | 34 ++----- src/H5Dfill.c | 6 -- src/H5Dio.c | 24 +---- src/H5Dscatgath.c | 14 --- src/H5F.c | 136 ++++---------------------- src/H5FD.c | 70 +++----------- src/H5Fdeprec.c | 8 -- src/H5Fmount.c | 28 ++---- src/H5Ftest.c | 30 +++--- src/H5G.c | 114 ++++------------------ src/H5Gdeprec.c | 165 ++++++------------------------- src/H5Gtest.c | 98 +++++++++---------- src/H5I.c | 15 --- src/H5Itest.c | 14 +-- src/H5L.c | 215 +++++++++-------------------------------- src/H5Lexternal.c | 13 +-- src/H5O.c | 195 +++++++------------------------------ src/H5Ocopy.c | 13 +-- src/H5Oflush.c | 26 ++--- src/H5Otest.c | 84 ++++++++-------- src/H5P.c | 14 --- src/H5Pdcpl.c | 14 --- src/H5R.c | 50 ++-------- src/H5Rdeprec.c | 16 --- src/H5T.c | 33 +------ src/H5Tcommit.c | 76 +++------------ src/H5Tcompound.c | 8 -- src/H5Tdeprec.c | 21 +--- src/H5Tnative.c | 7 -- src/H5Z.c | 12 --- test/accum.c | 59 +++++++----- test/accum_swmr_reader.c | 18 ++-- test/btree2.c | 16 ++- test/cache_common.c | 8 +- test/cache_tagging.c | 16 +-- test/dsets.c | 12 +++ test/earray.c | 16 ++- test/efc.c | 16 ++- test/farray.c | 16 ++- test/fheap.c | 17 +++- test/freespace.c | 60 +++--------- test/gheap.c | 48 +++------ test/lheap.c | 25 +++-- test/mf.c | 18 ++-- test/ohdr.c | 23 +++-- test/page_buffer.c | 37 +++---- test/unregister.c | 19 ++-- testpar/t_file.c | 55 +++++++---- tools/src/misc/h5debug.c | 19 ++-- 54 files changed, 687 insertions(+), 1723 deletions(-) diff --git a/src/H5A.c b/src/H5A.c index 1b42106..513d4fe 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -251,7 +251,6 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, H5G_loc_t loc; /* Object location */ H5T_t *type; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -271,13 +270,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Go do the real work for attaching the attribute to the object */ if(NULL == (attr = H5A__create(&loc, attr_name, type, space, acpl_id))) @@ -291,8 +286,6 @@ done: /* Cleanup on failure */ if(ret_value < 0 && attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Acreate2() */ @@ -337,7 +330,6 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5G_loc_t loc; /* Object location */ H5T_t *type; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -360,13 +352,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") if(H5P_DEFAULT != lapl_id) { if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) @@ -386,8 +374,6 @@ done: /* Cleanup on failure */ if(ret_value < 0 && attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Acreate_by_name() */ @@ -417,7 +403,6 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -431,13 +416,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Read in attribute from object header */ if(NULL == (attr = H5A__open(&loc, attr_name))) @@ -452,8 +433,6 @@ done: if(ret_value < 0) if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen() */ @@ -486,7 +465,6 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -502,13 +480,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") if(H5P_DEFAULT != lapl_id) { if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) @@ -529,8 +503,6 @@ done: if(ret_value < 0) if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_by_name() */ @@ -566,7 +538,6 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5A_t *attr = NULL; /* Attribute opened */ H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -585,13 +556,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") if(H5P_DEFAULT != lapl_id) { if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) @@ -612,8 +579,6 @@ done: if(ret_value < 0) if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_by_idx() */ @@ -640,7 +605,6 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) { H5A_t *attr; /* Attribute object for ID */ H5T_t *mem_type; /* Memory datatype */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -654,21 +618,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(attr_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(attr_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") /* Go write the actual data to the attribute */ if((ret_value = H5A__write(attr, mem_type, buf)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Awrite() */ @@ -694,7 +652,6 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) { H5A_t *attr; /* Attribute object for ID */ H5T_t *mem_type; /* Memory datatype */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -708,18 +665,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Go write the actual data to the attribute */ if((ret_value = H5A__read(attr, mem_type, buf)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aread() */ @@ -780,7 +730,6 @@ hid_t H5Aget_type(hid_t attr_id) { H5A_t *attr; /* Attribute object for ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -790,17 +739,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - if((ret_value = H5A__get_type(attr)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aget_type() */ @@ -916,7 +858,6 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -935,13 +876,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ if(NULL == (attr = H5A__open_by_idx(&loc, obj_name, idx_type, order, n))) @@ -961,8 +898,6 @@ done: /* Release resources */ if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_name_by_idx() */ @@ -1060,7 +995,6 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1078,13 +1012,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == ainfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ if(NULL == (attr = H5A__open_by_name(&loc, obj_name, attr_name))) @@ -1098,8 +1028,6 @@ done: /* Release resources */ if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_info_by_name() */ @@ -1125,7 +1053,6 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1146,13 +1073,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == ainfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ if(NULL == (attr = H5A__open_by_idx(&loc, obj_name, idx_type, order, n))) @@ -1166,8 +1089,6 @@ done: /* Release resources */ if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_info_by_idx() */ @@ -1189,7 +1110,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Arename(hid_t loc_id, const char *old_name, const char *new_name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1208,13 +1128,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") /* Call private attribute rename routine */ if(H5A__rename(&loc, old_name, new_name) < 0) @@ -1222,8 +1138,6 @@ if(H5CX_set_loc(loc_id, TRUE) < 0) } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Arename() */ @@ -1245,7 +1159,6 @@ herr_t H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, const char *new_attr_name, hid_t lapl_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1266,13 +1179,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(HDstrcmp(old_attr_name, new_attr_name)) { H5G_loc_t loc; /* Object location */ -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") @@ -1283,8 +1192,6 @@ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Arename_by_name() */ @@ -1334,7 +1241,6 @@ herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1348,18 +1254,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call attribute iteration routine */ if((ret_value = H5A__iterate(loc_id, idx_type, order, idx, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate2() */ @@ -1413,7 +1312,6 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1432,21 +1330,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Call attribute iteration by name routine */ if((ret_value = H5A__iterate_by_name(&loc, obj_name, idx_type, order, idx, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate_by_name() */ @@ -1469,7 +1361,6 @@ herr_t H5Adelete(hid_t loc_id, const char *name) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1483,21 +1374,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") /* Delete the attribute from the location */ if(H5A__delete(&loc, name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete() */ @@ -1523,7 +1408,6 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1539,21 +1423,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Delete the attribute from the location */ if(H5A__delete_by_name(&loc, obj_name, attr_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete_by_name() */ @@ -1587,7 +1465,6 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1605,21 +1482,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Delete the attribute from the location */ if(H5A__delete_by_idx(&loc, obj_name, idx_type, order, n) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete_by_idx() */ @@ -1642,7 +1513,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Aclose(hid_t attr_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1651,17 +1521,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* check arguments */ if(NULL == H5I_object_verify(attr_id, H5I_ATTR)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Decrement references to that atom (and close it) */ if(H5I_dec_app_ref(attr_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "can't close attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aclose() */ @@ -1684,7 +1549,6 @@ htri_t H5Aexists(hid_t obj_id, const char *attr_name) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1698,18 +1562,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Check if the attribute exists */ if((ret_value = H5A__exists(&loc, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aexists() */ @@ -1732,7 +1589,6 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1748,20 +1604,14 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") if ((ret_value = H5A__exists_by_name(loc, obj_name, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aexists_by_name() */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 1e031f7..84ab491 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -117,7 +117,6 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, H5G_loc_t loc; /* Object location */ H5T_t *type; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -137,13 +136,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read") /* Go do the real work for attaching the attribute to the dataset */ if(NULL == (attr = H5A__create(&loc, name, type, space, acpl_id))) @@ -157,8 +152,6 @@ done: /* Cleanup on failure */ if(ret_value < 0 && attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Acreate1() */ @@ -191,7 +184,6 @@ H5Aopen_name(hid_t loc_id, const char *name) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -205,11 +197,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open the attribute on the object header */ if(NULL == (attr = H5A__open_by_name(&loc, ".", name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute: '%s'", name) @@ -223,8 +210,6 @@ done: if(ret_value < 0) if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_name() */ @@ -257,7 +242,6 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -269,11 +253,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open the attribute in the object header */ if(NULL == (attr = H5A__open_by_idx(&loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)idx))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute") @@ -287,8 +266,6 @@ done: if(ret_value < 0) if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_idx() */ @@ -317,7 +294,6 @@ H5Aget_num_attrs(hid_t loc_id) { H5O_loc_t *loc; /* Object location for attribute */ void *obj; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value; FUNC_ENTER_API(FAIL) @@ -363,18 +339,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "inappropriate attribute target") } /*lint !e788 All appropriate cases are covered */ -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Look up the # of attributes for the object */ if((ret_value = H5A__get_num_attrs(loc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "can't get attribute count for object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aget_num_attrs() */ @@ -419,7 +388,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -429,18 +397,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5I_ATTR == H5I_get_type(loc_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call attribute iteration routine */ if((ret_value = H5A__iterate_old(loc_id, attr_num, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate1() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Atest.c b/src/H5Atest.c index f7b7fd3..31fbe8e 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -127,7 +127,7 @@ herr_t H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) { H5A_t *attr; /* Attribute object for ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -135,9 +135,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check arguments */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Sanity check */ HDassert(H5O_msg_is_shared(H5O_ATTR_ID, attr)); @@ -147,8 +149,9 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__get_shared_rc_test() */ diff --git a/src/H5D.c b/src/H5D.c index ca37811..258bac1 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -136,9 +136,9 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Create the new dataset & get its ID */ if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, lcpl_id, dcpl_id, dapl_id))) @@ -215,9 +215,9 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* build and open the new dataset */ if(NULL == (dset = H5D__create_anon(loc.oloc->file, type_id, space, dcpl_id, dapl_id))) @@ -283,9 +283,9 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the dataset */ if(NULL == (dset = H5D__open_name(&loc, name, dapl_id))) @@ -753,8 +753,8 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Call internal routine */ ret_value = H5D_vlen_reclaim(type_id, space, buf); @@ -897,9 +897,9 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[]) if(!size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dset_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Private function */ if(H5D__set_extent(dset, size) < 0) @@ -935,9 +935,9 @@ H5Dflush(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dset_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Flush dataset information cached in memory */ if(H5D__flush(dset, dset_id) < 0) @@ -973,9 +973,9 @@ H5Drefresh(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dset_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call private function to refresh the dataset object */ if((H5D__refresh(dset_id, dset)) < 0) @@ -1015,9 +1015,9 @@ H5Dformat_convert(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dset_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") switch(dset->shared->layout.type) { case H5D_CHUNKED: diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index 656fa91..347e34c 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -78,7 +78,6 @@ herr_t H5Ddebug(hid_t dset_id) { H5D_t *dset; /* Dataset to debug */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -87,10 +86,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Print B-tree information */ if(H5D_CHUNKED == dset->shared->layout.type) @@ -99,8 +94,6 @@ api_ctx_pushed = TRUE; HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.storage.u.contig.addr); done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ddebug() */ diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 51ebeba..318680c 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -116,7 +116,6 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, H5D_t *dset = NULL; /* New dataset's info */ const H5S_t *space; /* Dataspace for dataset */ hid_t dapl_id = H5P_DEFAULT; /* DAPL used by library */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -137,13 +136,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Build and open the new dataset */ if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, H5P_LINK_CREATE_DEFAULT, dcpl_id, dapl_id))) @@ -157,8 +152,6 @@ done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dcreate1() */ @@ -186,7 +179,6 @@ H5Dopen1(hid_t loc_id, const char *name) { H5D_t *dset = NULL; H5G_loc_t loc; /* Object location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -198,11 +190,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open the dataset */ if(NULL == (dset = H5D__open_name(&loc, name, H5P_DATASET_ACCESS_DEFAULT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") @@ -215,8 +202,6 @@ done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dopen1() */ @@ -244,7 +229,6 @@ H5Dextend(hid_t dset_id, const hsize_t size[]) H5D_t *dset; /* Pointer to dataset to modify */ hsize_t dset_dims[H5S_MAX_RANK]; /* Current dataset dimensions */ unsigned u; /* Local index variable */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -264,21 +248,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(size[u] > dset_dims[u]) dset_dims[u] = size[u]; -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dset_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Increase size */ if(H5D__set_extent(dset, dset_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dextend() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 668ecc3..e42e551 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -120,7 +120,6 @@ H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_ H5S_t *space; /* Dataspace */ H5T_t *fill_type; /* Fill-value datatype */ H5T_t *buf_type; /* Buffer datatype */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -135,17 +134,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") if(NULL == (buf_type = (H5T_t *)H5I_object_verify(buf_type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Fill the selection in the memory buffer */ if(H5D__fill(fill, fill_type, buf, buf_type, space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dfill() */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 5b5bb5e..334f18f 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -118,7 +118,6 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; hbool_t direct_read = FALSE; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -159,12 +158,8 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Retrieve the 'direct read' flag */ if(H5CX_get_dcr_flag(&direct_read) < 0) @@ -216,9 +211,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") - FUNC_LEAVE_API(ret_value) } /* end H5Dread() */ @@ -262,7 +254,6 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; hbool_t direct_write = FALSE; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -282,12 +273,8 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Retrieve the 'direct write' flag */ if(H5CX_get_dcw_flag(&direct_write) < 0) @@ -320,9 +307,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't prepare for writing data") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") - FUNC_LEAVE_API(ret_value) } /* end H5Dwrite() */ diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index f636eb7..5856ede 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -955,7 +955,6 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, size_t type_size; /* Datatype element size */ hssize_t nelmts; /* Number of remaining elements in selection */ size_t nelmts_scatter = 0; /* Number of elements to scatter to dst_buf */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -970,10 +969,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") if(dst_buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Get datatype element size */ if(0 == (type_size = H5T_GET_SIZE(type))) @@ -1024,8 +1019,6 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") if(iter) iter = H5FL_FREE(H5S_sel_iter_t, iter); -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dscatter() */ @@ -1059,7 +1052,6 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, hssize_t nelmts; /* Number of remaining elements in selection */ size_t dst_buf_nelmts; /* Number of elements that can fit in dst_buf */ size_t nelmts_gathered; /* Number of elements gathered from src_buf */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1077,10 +1069,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer size is 0") if(dst_buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Get datatype element size */ if(0 == (type_size = H5T_GET_SIZE(type))) @@ -1130,8 +1118,6 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") if(iter) iter = H5FL_FREE(H5S_sel_iter_t, iter); -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dgather() */ diff --git a/src/H5F.c b/src/H5F.c index 877d504..0a1da54 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -355,7 +355,6 @@ done: htri_t H5Fis_hdf5(const char *name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -364,10 +363,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check args and all the boring stuff. */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* call the private is_HDF5 function */ /* (Should not trigger raw data I/O - QAK, 2018/01/03) */ @@ -375,8 +370,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable open file") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fis_hdf5() */ @@ -408,7 +401,6 @@ hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { H5F_t *new_file = NULL; /* file struct for new file */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -435,13 +427,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (TRUE != H5P_isa_class(fcpl_id, H5P_FILE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not file create property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Adjust bit flags by turning on the creation bit and making sure that * the EXCL or TRUNC bit is set. All newly-created files are opened for @@ -465,8 +453,6 @@ if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) done: if(ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, H5I_INVALID_HID, "problems closing file") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fcreate() */ @@ -495,7 +481,6 @@ hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { H5F_t *new_file = NULL; /* file struct for new file */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -515,13 +500,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if((flags & H5F_ACC_SWMR_READ) && (flags & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "SWMR read access on a file open for read-write access is not allowed") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the file */ if(NULL == (new_file = H5F__open(filename, flags, H5P_FILE_CREATE_DEFAULT, fapl_id))) @@ -538,8 +519,6 @@ done: if(ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, H5I_INVALID_HID, "problems closing file") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fopen() */ @@ -559,7 +538,6 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) { H5F_t *f = NULL; /* File to flush */ H5O_loc_t *oloc = NULL; /* Object location for ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -645,13 +623,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5F_ACC_RDWR & H5F_INTENT(f)) { hid_t fapl_id = H5P_DEFAULT; /* FAPL to use */ -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, object_id, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, object_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access property list info") /* Flush the file */ if(H5F__flush(f, scope) < 0) @@ -659,8 +633,6 @@ if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, object_id, TRUE) < 0) } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fflush() */ @@ -682,7 +654,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Fclose(hid_t file_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -692,18 +663,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5I_FILE != H5I_get_type(file_id)) HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a file ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Close the file */ if(H5F__close(file_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "closing file ID failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fclose() */ @@ -823,7 +787,6 @@ H5Fget_freespace(hid_t file_id) { H5F_t *file; /* File object for file ID */ hsize_t tot_space; /* Amount of free space in the file */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -833,11 +796,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the free space in the file */ if(H5F__get_freespace(file, &tot_space) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") @@ -845,8 +803,6 @@ api_ctx_pushed = TRUE; ret_value = (hssize_t)tot_space; done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_freespace() */ @@ -932,7 +888,6 @@ ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) { H5F_t *file; /* File object for file ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -942,19 +897,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* call private get_file_image function */ /* (Should not trigger raw data I/O - QAK, 2018/01/03) */ if((ret_value = H5F__get_file_image(file, buf_ptr, buf_len)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file image") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Fget_file_image() */ @@ -1225,7 +1173,6 @@ herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) { H5F_t *f; /* Top file in mount hierarchy */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1253,18 +1200,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ } /* end else */ HDassert(f->shared); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the file info */ if(H5F__get_info(f, finfo) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_info2() */ @@ -1380,7 +1320,6 @@ H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/) { H5F_t *file; /* Top file in mount hierarchy */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1392,18 +1331,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(sect_info && nsects == 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "nsects must be > 0") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the free-space section information in the file */ if((ret_value = H5F__get_free_sections(file, type, nsects, sect_info)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_free_sections() */ @@ -1423,7 +1355,6 @@ herr_t H5Fclear_elink_file_cache(hid_t file_id) { H5F_t *file; /* File */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1434,20 +1365,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* See if there's an EFC */ - if(file->shared->efc) { -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - + if(file->shared->efc) /* Release the EFC */ if(H5F__efc_release(file->shared->efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") - } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fclear_elink_file_cache() */ @@ -1488,7 +1411,6 @@ H5Fstart_swmr_write(hid_t file_id) H5F_t *file; /* File info */ hbool_t ci_load = FALSE; /* whether MDC ci load requested */ hbool_t ci_write = FALSE; /* whether MDC CI write requested */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1519,21 +1441,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(ci_load || ci_write ) HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and MDC cache image") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(file_id, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(file_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call the internal routine */ if(H5F__start_swmr_write(file) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "unable to convert file format") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fstart_swmr_write() */ @@ -1649,7 +1565,6 @@ herr_t H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high) { H5F_t *f; /* File */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1659,21 +1574,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(file_id, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(file_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal set_libver_bounds function */ if(H5F__set_libver_bounds(f, low, high) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fset_libver_bounds() */ @@ -1692,7 +1601,6 @@ herr_t H5Fformat_convert(hid_t fid) { H5F_t *f; /* File to flush */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1705,21 +1613,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (f = (H5F_t *)H5I_object(fid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(fid, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(fid, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call the internal routine */ if(H5F__format_convert(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "unable to convert file format") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fformat_convert() */ diff --git a/src/H5FD.c b/src/H5FD.c index 41111f5..d74ea31 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -1024,7 +1024,6 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_API(HADDR_UNDEF) @@ -1042,12 +1041,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a data transfer property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, HADDR_UNDEF, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Do the real work */ if(HADDR_UNDEF == (ret_value = H5FD__alloc_real(file, type, size, NULL, NULL))) @@ -1057,8 +1053,6 @@ H5CX_set_dxpl(dxpl_id); ret_value += file->base_addr; done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, HADDR_UNDEF, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDalloc() */ @@ -1082,7 +1076,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1098,12 +1091,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Do the real work */ /* (Note compensating for base address addition in internal routine) */ @@ -1111,8 +1101,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "file deallocation request failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDfree() */ @@ -1378,7 +1366,6 @@ herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1397,12 +1384,8 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null result buffer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Do the real work */ /* (Note compensating for base address addition in internal routine) */ @@ -1410,8 +1393,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "file read request failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDread() */ @@ -1434,7 +1415,6 @@ herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1452,12 +1432,8 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null buffer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* The real work */ /* (Note compensating for base address addition in internal routine) */ @@ -1465,8 +1441,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "file write request failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDwrite() */ @@ -1489,7 +1463,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1503,20 +1476,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Do the real work */ if(H5FD_flush(file, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "file flush request failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDflush() */ @@ -1562,7 +1530,6 @@ done: herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1576,20 +1543,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Do the real work */ if(H5FD_truncate(file, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "file flush request failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDtruncate() */ diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 74507f0..6417956 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -102,7 +102,6 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) { H5F_t *f; /* Top file in mount hierarchy */ H5F_info2_t finfo2; /* Current file info struct */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -130,11 +129,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ } /* end else */ HDassert(f->shared); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the current file info */ if(H5F__get_info(f, &finfo2) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info") @@ -145,8 +139,6 @@ api_ctx_pushed = TRUE; finfo->sohm.msgs_info = finfo2.sohm.msgs_info; done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_info1() */ diff --git a/src/H5Fmount.c b/src/H5Fmount.c index a8228d8..eede84c 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -443,7 +443,6 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) { H5G_loc_t loc; H5F_t *child = NULL; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -462,22 +461,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(plist_id, H5P_FILE_MOUNT)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Do the mount */ if(H5F__mount(&loc, name, child, plist_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") - FUNC_LEAVE_API(ret_value) } /* end H5Fmount() */ @@ -505,7 +497,6 @@ herr_t H5Funmount(hid_t loc_id, const char *name) { H5G_loc_t loc; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -517,22 +508,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Unmount */ if(H5F__unmount(&loc, name) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") - FUNC_LEAVE_API(ret_value) } /* end H5Funmount() */ diff --git a/src/H5Ftest.c b/src/H5Ftest.c index df062ff..bdecad2 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -99,7 +99,7 @@ H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, size_t *mesg_count) { H5F_t *file; /* File info */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -107,17 +107,20 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check arguments */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Retrieve count for message type */ if(H5SM__get_mesg_count_test(file, type_id, mesg_count) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve shared message count") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_sohm_mesg_count_test() */ @@ -142,7 +145,7 @@ herr_t H5F_check_cached_stab_test(hid_t file_id) { H5F_t *file; /* File info */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -150,17 +153,20 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check arguments */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Verify the cached stab info */ if(H5G__verify_cached_stab_test(H5G_oloc(file->shared->root_grp), file->shared->sblock->root_ent) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to verify cached symbol table info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_check_cached_stab_test() */ diff --git a/src/H5G.c b/src/H5G.c index 4ba43c0..c95a855 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -289,7 +289,6 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, { H5G_loc_t loc; /* Location to create group */ H5G_t *grp = NULL; /* New group created */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -315,13 +314,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not group create property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Create the new group & get its ID */ if(NULL == (grp = H5G__create_named(&loc, name, lcpl_id, gcpl_id))) @@ -334,8 +329,6 @@ done: if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate2() */ @@ -381,7 +374,6 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) H5G_loc_t loc; H5G_t *grp = NULL; H5G_obj_create_t gcrt_info; /* Information for group creation */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(H5I_INVALID_HID) @@ -398,13 +390,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not group create property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Set up group creation info */ gcrt_info.gcpl_id = gcpl_id; @@ -436,8 +424,6 @@ done: if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate_anon() */ @@ -464,7 +450,6 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id) { H5G_t *grp = NULL; /* Group opened */ H5G_loc_t loc; /* Location of parent for group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -476,13 +461,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the group */ if(NULL == (grp = H5G__open_name(&loc, name))) @@ -497,8 +478,6 @@ done: if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gopen2() */ @@ -523,7 +502,6 @@ hid_t H5Gget_create_plist(hid_t group_id) { H5G_t *group = NULL; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -533,17 +511,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (group = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - if((ret_value = H5G__get_create_plist(group)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "can't get group's creation property list") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_create_plist() */ @@ -566,7 +537,6 @@ H5Gget_info(hid_t grp_id, H5G_info_t *grp_info) { H5I_type_t id_type; /* Type of ID */ H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -583,18 +553,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(grp_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Retrieve the group's information */ if(H5G__get_info(&loc, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info() */ @@ -617,7 +580,6 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -631,21 +593,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the group's information */ if(H5G__get_info_by_name(&loc, name, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info_by_name() */ @@ -669,7 +625,6 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *grp_info, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -688,21 +643,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the group's information */ if(H5G__get_info_by_idx(&loc, group_name, idx_type, order, n, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info_by_idx() */ @@ -723,7 +672,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Gclose(hid_t group_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -732,10 +680,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check args */ if(NULL == H5I_object_verify(group_id,H5I_GROUP)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* * Decrement the counter on the group atom. It will be freed if the count @@ -745,8 +689,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gclose() */ @@ -767,7 +709,6 @@ herr_t H5Gflush(hid_t group_id) { H5G_t *grp; /* Group for this operation */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -777,21 +718,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(group_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(group_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Flush group's metadata to file */ if(H5G__flush(grp, group_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTFLUSH, FAIL, "unable to flush group") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Gflush */ @@ -812,7 +747,6 @@ herr_t H5Grefresh(hid_t group_id) { H5G_t *grp; /* Group for this operation */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -822,21 +756,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(group_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(group_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call private function to refresh group object */ if((H5G__refresh(grp, group_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to refresh group") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Grefresh */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 5835e06..8d1441f 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -190,7 +190,6 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) H5G_loc_t loc; /* Location to create group */ H5G_t *grp = NULL; /* New group created */ hid_t tmp_gcpl = (-1); /* Temporary group creation property list */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -231,13 +230,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else tmp_gcpl = H5P_GROUP_CREATE_DEFAULT; -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Create the new group & get its ID */ if(NULL == (grp = H5G__create_named(&loc, name, H5P_LINK_CREATE_DEFAULT, tmp_gcpl))) @@ -253,8 +248,6 @@ done: if(ret_value < 0) if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate1() */ @@ -282,7 +275,6 @@ H5Gopen1(hid_t loc_id, const char *name) { H5G_t *grp = NULL; /* Group opened */ H5G_loc_t loc; /* Location of parent for group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -294,11 +286,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open the group */ if(NULL == (grp = H5G__open_name(&loc, name))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") @@ -311,8 +298,6 @@ done: if(ret_value < 0) if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gopen1() */ @@ -329,7 +314,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new_name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -341,21 +325,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!new_name || !*new_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(cur_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine to create link */ if(H5G__link(cur_loc_id, cur_name, type, H5L_SAME_LOC, new_name, H5P_LINK_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "couldn't create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Glink() */ @@ -372,7 +350,6 @@ herr_t H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_id, const char *new_name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -384,21 +361,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!new_name || !*new_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(cur_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine to create link */ if(H5G__link(cur_loc_id, cur_name, type, new_loc_id, new_name, H5P_LINK_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "couldn't create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Glink2() */ @@ -484,27 +455,20 @@ done: herr_t H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*s", src_loc_id, src_name, dst_name); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(src_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(src_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call common routine to move the link */ if(H5G__move(src_loc_id, src_name, H5L_SAME_LOC, dst_name, H5P_LINK_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTMOVE, FAIL, "couldn't move link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gmove() */ @@ -520,7 +484,6 @@ herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -530,21 +493,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(src_loc_id == H5L_SAME_LOC && dst_loc_id == H5L_SAME_LOC) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "source and destination should not both be H5L_SAME_LOC") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dst_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dst_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call common routine to move the link */ if(H5G__move(src_loc_id, src_name, dst_loc_id, dst_name, H5P_LINK_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTMOVE, FAIL, "couldn't move link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gmove2() */ @@ -614,7 +571,6 @@ herr_t H5Gunlink(hid_t loc_id, const char *name) { H5G_loc_t loc; /* Group's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -626,21 +582,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ if(H5G__unlink(&loc, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "couldn't delete link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gunlink() */ @@ -688,7 +638,6 @@ herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) { H5G_loc_t loc; /* Group's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -700,21 +649,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ if(H5G__get_linkval(&loc, name, size, buf) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "couldn't delete link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_linkval() */ @@ -772,7 +715,6 @@ herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment) { H5G_loc_t loc; /* Group's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -783,21 +725,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ if(H5G__set_comment(&loc, name, comment) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "unable to set comment value") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gset_comment() */ @@ -860,7 +796,6 @@ int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) { H5G_loc_t loc; /* Group's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -873,21 +808,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(bufsize > 0 && !buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no buffer specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ if((ret_value = H5G__get_comment(&loc, name, buf, bufsize)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get comment value") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_comment() */ @@ -955,7 +884,6 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, H5G_link_iterate_t lnk_op; /* Link operator */ hsize_t last_obj; /* Index of last object looked at */ hsize_t idx; /* Internal location to hold index */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -977,11 +905,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ lnk_op.op_type = H5G_LINK_OP_OLD; lnk_op.op_func.op_old = op; -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call private function. */ if((ret_value = H5G__iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed") @@ -991,8 +914,6 @@ api_ctx_pushed = TRUE; *idx_p = (int)last_obj; done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Giterate() */ @@ -1051,7 +972,6 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) { H5G_loc_t loc; /* Location of object */ H5G_info_t grp_info; /* Group information */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -1063,11 +983,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!num_objs) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "bad pointer to # of objects") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call the internal routine */ if(H5G__get_num_objs(loc.oloc, &grp_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't determine") @@ -1076,8 +991,6 @@ api_ctx_pushed = TRUE; *num_objs = grp_info.nlinks; done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_num_objs() */ @@ -1142,7 +1055,6 @@ H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t *statbuf/*out*/) { H5G_loc_t loc; /* Group's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1154,18 +1066,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get info */ if(H5G__get_objinfo(&loc, name, follow_link, statbuf) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "cannot stat object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objinfo() */ @@ -1346,7 +1251,6 @@ ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; FUNC_ENTER_API(FAIL) @@ -1356,18 +1260,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call internal function */ if((ret_value = H5G__get_objname_by_idx(loc.oloc, H5_INDEX_NAME, H5_ITER_INC, idx, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "can't get object name") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objname_by_idx() */ @@ -1430,7 +1327,6 @@ H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ H5G_obj_t ret_value; FUNC_ENTER_API(H5G_UNKNOWN) @@ -1440,18 +1336,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "not a location ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5G_UNKNOWN, "can't set API context") -api_ctx_pushed = TRUE; - /* Call internal function*/ if(H5G_UNKNOWN == (ret_value = H5G__obj_get_type_by_idx(loc.oloc, idx))) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "can't get object type") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5G_UNKNOWN, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objtype_by_idx() */ diff --git a/src/H5Gtest.c b/src/H5Gtest.c index eaee737..f2f3e3a 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -96,7 +96,7 @@ H5G__is_empty_test(hid_t gid) H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = FALSE; /* Indicate that a header message is present */ htri_t linfo_exists = FALSE;/* Indicate that the 'link info' message is present */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -105,10 +105,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* "New format" checks */ @@ -185,8 +185,8 @@ api_ctx_pushed = TRUE; } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__is_empty_test() */ @@ -216,7 +216,7 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -225,10 +225,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Check if the group has any link messages */ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) @@ -253,8 +253,8 @@ api_ctx_pushed = TRUE; } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__has_links_test() */ @@ -283,7 +283,7 @@ H5G__has_stab_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -292,10 +292,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Check if the group has a symbol table message */ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) @@ -310,8 +310,8 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__has_stab_test() */ @@ -342,7 +342,7 @@ H5G__is_new_dense_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -351,10 +351,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Check if the group has a symbol table message */ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) @@ -386,8 +386,8 @@ api_ctx_pushed = TRUE; } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__is_new_dense_test() */ @@ -421,7 +421,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ H5O_linfo_t linfo; /* Link info message */ H5G_t *grp = NULL; /* Pointer to group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -430,10 +430,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Set metadata tag in API context */ H5_BEGIN_TAG(grp->oloc.addr); @@ -478,8 +478,8 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__new_dense_info_test() */ @@ -509,7 +509,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) { H5G_t *grp = NULL; /* Pointer to group */ H5O_stab_t stab; /* Symbol table message */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -518,10 +518,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Make certain the group has a symbol table message */ if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab)) @@ -532,8 +532,8 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't query local heap size") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__lheap_size_test() */ @@ -566,7 +566,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign { void *obj_ptr; /* Pointer to object for ID */ H5G_name_t *obj_path; /* Pointer to group hier. path for obj */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -579,10 +579,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (obj_ptr = H5I_object(obj_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get object for ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the symbol table entry */ switch(H5I_get_type(obj_id)) { @@ -640,8 +640,8 @@ api_ctx_pushed = TRUE; } /* end else */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__user_path_test() */ diff --git a/src/H5I.c b/src/H5I.c index 915c13c..5117394 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -1201,7 +1201,6 @@ done: int H5Idec_ref(hid_t id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value = 0; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1210,18 +1209,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check arguments */ if(id < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Do actual decrement operation */ if((ret_value = H5I_dec_app_ref(id)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Idec_ref() */ @@ -2025,7 +2018,6 @@ ssize_t H5Iget_name(hid_t id, char *name/*out*/, size_t size) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2035,18 +2027,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(id, &loc) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call internal routine to retrieve object's name */ if((ret_value = H5I__get_name(&loc, name, size)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Iget_name() */ diff --git a/src/H5Itest.c b/src/H5Itest.c index 87aa7b9..426c026 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -79,7 +79,7 @@ ssize_t H5I_get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -88,18 +88,18 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(id, &loc) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Call internal group routine to retrieve object's name */ if((ret_value = H5G_get_name(&loc, name, size, cached)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_name_test() */ diff --git a/src/H5L.c b/src/H5L.c index fe2cad1..b26a8c4 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -304,7 +304,6 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, { H5G_loc_t src_loc, *src_loc_p; H5G_loc_t dst_loc, *dst_loc_p; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -325,14 +324,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, - ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -347,8 +342,6 @@ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lmove() */ @@ -373,7 +366,6 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, { H5G_loc_t src_loc, *src_loc_p; H5G_loc_t dst_loc, *dst_loc_p; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -394,14 +386,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, - ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -416,8 +404,6 @@ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcopy() */ @@ -445,7 +431,6 @@ H5Lcreate_soft(const char *link_target, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id) { H5G_loc_t link_loc; /* Group location for new link */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -461,21 +446,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Create the link */ if(H5L__create_soft(link_target, &link_loc, link_name, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_soft() */ @@ -502,7 +481,6 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, { H5G_loc_t cur_loc, *cur_loc_p; H5G_loc_t new_loc, *new_loc_p; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -523,13 +501,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up current & new location pointers */ cur_loc_p = &cur_loc; @@ -546,8 +520,6 @@ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_hard() */ @@ -581,7 +553,6 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, const void *udata, size_t udata_size, hid_t lcpl_id, hid_t lapl_id) { H5G_loc_t link_loc; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -596,21 +567,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(link_type < H5L_TYPE_UD_MIN || link_type > H5L_TYPE_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link class") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Create external link */ if(H5L__create_ud(&link_loc, link_name, udata, udata_size, link_type, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_ud() */ @@ -636,7 +601,6 @@ herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; /* Group's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -648,21 +612,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Unlink */ if(H5L__delete(&loc, name) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ldelete() */ @@ -691,7 +649,6 @@ H5Ldelete_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { H5G_loc_t loc; /* Group's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -707,21 +664,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Delete the link */ if(H5L__delete_by_idx(&loc, group_name, idx_type, order, n) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ldelete_by_idx() */ @@ -750,7 +701,6 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, hid_t lapl_id) { H5G_loc_t loc; /* Group location for location to query */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -762,21 +712,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link value */ if(H5L__get_val(&loc, name, buf, size) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for '%s'", name) done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_val() */ @@ -805,7 +749,6 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, hid_t lapl_id) { H5G_loc_t loc; /* Group location for location to query */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -822,21 +765,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link value */ if(H5L__get_val_by_idx(&loc, group_name, idx_type, order, n, buf, size) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_val_by_idx() */ @@ -858,7 +795,6 @@ htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -870,21 +806,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Check for the existence of the link */ if((ret_value = H5L__exists(&loc, name)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lexists() */ @@ -908,7 +838,6 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, hid_t lapl_id) { H5G_loc_t loc; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -920,21 +849,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link information */ if(H5L__get_info(&loc, name, linfo) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_info() */ @@ -959,7 +882,6 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, H5L_info_t *linfo /*out*/, hid_t lapl_id) { H5G_loc_t loc; /* Group location for group to query */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -976,21 +898,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link information */ if(H5L__get_info_by_idx(&loc, group_name, idx_type, order, n, linfo) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_info_by_idx() */ @@ -1149,7 +1065,6 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, char *name /*out*/, size_t size, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1166,21 +1081,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link information */ if((ret_value = H5L__get_name_by_idx(&loc, group_name, idx_type, order, n, name, size)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link name") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_name_by_idx() */ @@ -1208,7 +1117,6 @@ H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data) { H5I_type_t id_type; /* Type of ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1225,18 +1133,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Iterate over the links */ if((ret_value = H5L__iterate(grp_id, ".", idx_type, order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Literate() */ @@ -1268,7 +1169,6 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data, hid_t lapl_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1285,21 +1185,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Iterate over the links */ if((ret_value = H5L__iterate(loc_id, group_name, idx_type, order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Literate_by_name() */ @@ -1337,7 +1231,6 @@ H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data) { H5I_type_t id_type; /* Type of ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1354,18 +1247,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call internal routine */ if((ret_value = H5L__visit(grp_id, ".", idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lvisit() */ @@ -1402,7 +1288,6 @@ herr_t H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1419,21 +1304,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal routine */ if((ret_value = H5L__visit(loc_id, group_name, idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lvisit_by_name() */ diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 73ca17c..7c32309 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -340,7 +340,6 @@ H5Lcreate_external(const char *file_name, const char *obj_name, size_t file_name_len; /* Length of file name string */ size_t norm_obj_name_len; /* Length of normalized object name string */ uint8_t *p; /* Pointer into external link buffer */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -375,13 +374,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ p += file_name_len; HDstrncpy((char *)p, norm_obj_name, buf_size - (file_name_len + 1)); /* External link's object */ -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Create an external link */ if(H5L__create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id) < 0) @@ -391,8 +386,6 @@ done: H5MM_xfree(ext_link_buf); H5MM_xfree(norm_obj_name); -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_external() */ diff --git a/src/H5O.c b/src/H5O.c index 1eb0332..49e13ce 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -100,7 +100,6 @@ hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -112,21 +111,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the object */ if((ret_value = H5O__open_name(&loc, name)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen() */ @@ -159,7 +152,6 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -175,21 +167,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the object */ if((ret_value = H5O__open_by_idx(&loc, group_name, idx_type, order, n)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_idx() */ @@ -233,7 +219,6 @@ hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr) { H5G_loc_t loc; /* Location within file */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(FAIL) @@ -245,18 +230,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!H5F_addr_defined(addr)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no address supplied") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open the object */ if((ret_value = H5O__open_by_addr(&loc, addr)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_addr() */ @@ -288,7 +266,6 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, { H5G_loc_t new_loc; /* Location of group to link from */ H5G_loc_t obj_loc; /* Location of object to link to */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -311,21 +288,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, obj_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Create a link to the object */ if(H5O__create_link(&new_loc, new_name, &obj_loc, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Olink() */ @@ -354,7 +325,6 @@ herr_t H5Oincr_refcount(hid_t object_id) { H5O_loc_t *oloc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -364,21 +334,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if((oloc = H5O_get_loc(object_id)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(object_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(object_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Change the object's refcount */ if(H5O__link(oloc, 1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5O_incr_refcount() */ @@ -407,7 +371,6 @@ herr_t H5Odecr_refcount(hid_t object_id) { H5O_loc_t *oloc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -417,21 +380,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if((oloc = H5O_get_loc(object_id)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(object_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(object_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Change the object's refcount */ if(H5O__link(oloc, -1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Odecr_refcount() */ @@ -453,7 +410,6 @@ htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; /* Location info */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) @@ -465,21 +421,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Check if the object exists */ if((ret_value = H5O__exists_by_name(&loc, name)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists", name) done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oexists_by_name() */ @@ -501,7 +451,6 @@ herr_t H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -513,18 +462,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Retrieve the object's information */ if(H5O__get_info_by_name(&loc, ".", oinfo/*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info() */ @@ -546,7 +488,6 @@ herr_t H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -560,21 +501,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's information */ if(H5O__get_info_by_name(&loc, name, oinfo/*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object: '%s'", name) done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info_by_name() */ @@ -598,7 +533,6 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -617,21 +551,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's information */ if(H5O__get_info_by_idx(&loc, group_name, idx_type, order, n, oinfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info_by_idx() */ @@ -657,7 +585,6 @@ herr_t H5Oset_comment(hid_t obj_id, const char *comment) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -667,21 +594,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(obj_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* (Re)set the object's comment */ if(H5O__set_comment_by_name(&loc, ".", comment) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oset_comment() */ @@ -708,7 +629,6 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -720,21 +640,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* (Re)set the object's comment */ if(H5O__set_comment_by_name(&loc, name, comment) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object: '%s'", name) done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oset_comment_by_name() */ @@ -759,7 +673,6 @@ ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -769,18 +682,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Retrieve the object's comment */ if((ret_value = H5O__get_comment_by_name(&loc, ".", comment/*out*/, bufsize)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment() */ @@ -806,7 +712,6 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -818,21 +723,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's comment */ if((ret_value = H5O__get_comment_by_name(&loc, name, comment/*out*/, bufsize)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object: '%s'", name) done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment_by_name() */ @@ -873,7 +772,6 @@ herr_t H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -887,18 +785,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call internal object visitation routine */ if((ret_value = H5O__visit(obj_id, ".", idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ovisit() */ @@ -939,7 +830,6 @@ herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -956,21 +846,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal object visitation routine */ if((ret_value = H5O__visit(loc_id, obj_name, idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ovisit_by_name() */ @@ -996,7 +880,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Oclose(hid_t object_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -1009,10 +892,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ case H5I_DATASET: if(H5I_object(object_id) == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid object") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; if(H5I_dec_app_ref(object_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close object") break; @@ -1036,8 +915,6 @@ api_ctx_pushed = TRUE; } /* end switch */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oclose() */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 3ca5540..b5a3bdf 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -208,7 +208,6 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, { H5G_loc_t loc; /* Source group group location */ H5G_loc_t dst_loc; /* Destination group location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -225,21 +224,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!dst_name || !*dst_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(src_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(src_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine to copy object */ if(H5O__copy(&loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ocopy() */ diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 31ef9b9..65cb2ae 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -73,27 +73,20 @@ static herr_t H5O__refresh(hid_t obj_id); herr_t H5Oflush(hid_t obj_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", obj_id); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(obj_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal routine */ if(H5O__flush(obj_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oflush() */ @@ -242,27 +235,20 @@ done: herr_t H5Orefresh(hid_t oid) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", oid); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(oid, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(oid, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal routine */ if(H5O__refresh(oid) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Orefresh() */ diff --git a/src/H5Otest.c b/src/H5Otest.c index c978d10..32b31f2 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -98,7 +98,7 @@ H5O_is_attr_dense_test(hid_t oid) H5O_t *oh = NULL; /* Object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -107,10 +107,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the object header */ if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -137,8 +137,8 @@ api_ctx_pushed = TRUE; done: if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_is_attr_dense_test() */ @@ -171,7 +171,7 @@ H5O_is_attr_empty_test(hid_t oid) htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ H5O_loc_t *loc; /* Pointer to object's location */ hsize_t nattrs; /* Number of attributes */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -180,10 +180,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the object header */ if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -238,8 +238,8 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_is_attr_empty_test() */ @@ -272,7 +272,7 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ hsize_t obj_nattrs; /* Number of attributes */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -281,10 +281,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the object header */ if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -336,8 +336,8 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_num_attrs_test() */ @@ -372,7 +372,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -381,10 +381,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Set metadata tag in API context */ H5_BEGIN_TAG(loc->addr); @@ -439,8 +439,8 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_attr_dense_info_test() */ @@ -642,7 +642,7 @@ H5O_msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) H5O_loc_t *loc; /* Pointer to object's location */ H5O_mesg_t *idx_msg; /* Pointer to message */ unsigned idx; /* Index of message */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -651,10 +651,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the object header */ if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -677,8 +677,8 @@ api_ctx_pushed = TRUE; done: if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_msg_get_chunkno_test() */ @@ -710,7 +710,7 @@ H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) H5O_loc_t *loc; /* Pointer to object's location */ H5O_mesg_t *curr_msg; /* Pointer to current message */ unsigned idx; /* Index of message */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -719,10 +719,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the object header */ if(NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) @@ -785,8 +785,8 @@ api_ctx_pushed = TRUE; done: if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_msg_get_chunkno_test() */ diff --git a/src/H5P.c b/src/H5P.c index 9243d41..f163e9e 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -97,7 +97,6 @@ hid_t H5Pcopy(hid_t id) { void *obj; /* Property object to copy */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value=FALSE; /* return value */ FUNC_ENTER_API(FAIL) @@ -111,10 +110,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property object"); if(NULL == (obj = H5I_object(id))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property object doesn't exist"); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Compare property lists */ if(H5I_GENPROP_LST == H5I_get_type(id)) { @@ -137,8 +132,6 @@ api_ctx_pushed = TRUE; } /* end else */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Pcopy() */ @@ -1509,7 +1502,6 @@ done: herr_t H5Pclose(hid_t plist_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -1520,10 +1512,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check arguments. */ if(H5I_GENPROP_LST != H5I_get_type(plist_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Close the property list */ if(H5I_dec_app_ref(plist_id) < 0) @@ -1531,8 +1519,6 @@ api_ctx_pushed = TRUE; } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Pclose() */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 2629aa7..e2c92cd 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -3185,7 +3185,6 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) { H5P_genplist_t *plist; /* Property list pointer */ H5O_fill_t fill; /* Fill value to modify */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -3194,10 +3193,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Get the plist 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") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Get the current fill value */ if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) @@ -3254,8 +3249,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set fill value") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Pset_fill_value() */ @@ -3375,7 +3368,6 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ H5T_t *type; /* Datatype */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -3390,18 +3382,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Get the plist 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") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Get the fill value */ if(H5P_get_fill_value(plist, type, value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Pget_fill_value() */ diff --git a/src/H5R.c b/src/H5R.c index 86a94bf..11ac32e 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -93,7 +93,6 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t { H5G_loc_t loc; /* File location */ H5S_t *space = NULL; /* Pointer to dataspace containing region */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -115,21 +114,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (space_id != (-1) && (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") /* Create reference */ if((ret_value = H5R__create(ref, &loc, name, ref_type, space)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create reference") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rcreate() */ @@ -166,7 +159,6 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r { H5G_loc_t loc; /* Group location */ H5F_t *file = NULL; /* File object */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -182,13 +174,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (_ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&oapl_id, H5P_CLS_DACC, obj_id, FALSE) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&oapl_id, H5P_CLS_DACC, obj_id, FALSE) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the file pointer from the entry */ file = loc.oloc->file; @@ -198,8 +186,6 @@ if(H5CX_set_apl(&oapl_id, H5P_CLS_DACC, obj_id, FALSE) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to dereference object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rdereference2() */ @@ -232,7 +218,6 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) { H5G_loc_t loc; /* Object's group location */ H5S_t *space = NULL; /* Dataspace object */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -246,11 +231,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the dataspace with the correct region selected */ if(NULL == (space = H5R__get_region(loc.oloc->file, ref))) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "unable to retrieve dataspace") @@ -260,8 +240,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_region() */ @@ -294,7 +272,6 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj_type) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -308,18 +285,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the object information */ if(H5R__get_obj_type(loc.oloc->file, ref_type, ref, obj_type) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object type") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_obj_type2() */ @@ -363,7 +333,6 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, { H5G_loc_t loc; /* Group location */ H5F_t *file; /* File object */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -377,11 +346,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (_ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the file pointer from the entry */ file = loc.oloc->file; @@ -390,8 +354,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object path") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_name() */ diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index ccb4798..2f41f7d 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -104,7 +104,6 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) { H5G_loc_t loc; /* Object location */ H5O_type_t obj_type; /* Object type */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ H5G_obj_t ret_value; /* Return value */ FUNC_ENTER_API(H5G_UNKNOWN) @@ -118,11 +117,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5G_UNKNOWN, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5G_UNKNOWN, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the object information */ if(H5R__get_obj_type(loc.oloc->file, ref_type, ref, &obj_type) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type") @@ -131,8 +125,6 @@ api_ctx_pushed = TRUE; ret_value = H5G_map_obj_type(obj_type); done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5G_UNKNOWN, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_obj_type1() */ @@ -158,7 +150,6 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) { H5G_loc_t loc; /* Group location */ H5F_t *file = NULL; /* File object */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -172,11 +163,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (_ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the file pointer from the entry */ file = loc.oloc->file; @@ -185,8 +171,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5I_INVALID_HID, "unable dereference object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rdereference1() */ diff --git a/src/H5T.c b/src/H5T.c index bb046fa..c220890 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1744,7 +1744,6 @@ herr_t H5Tclose(hid_t type_id) { H5T_t *dt; /* Pointer to datatype to close */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1755,18 +1754,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ 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") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* 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") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tclose() */ @@ -2526,7 +2519,6 @@ H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_t *src; /*source data type descriptor */ H5T_t *dst; /*destination data type desc */ H5T_conv_func_t conv_func; /* Conversion function wrapper */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_API(FAIL) @@ -2543,10 +2535,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if(!func) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Set up conversion function wrapper */ conv_func.is_app = TRUE; @@ -2557,8 +2545,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register conversion function") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tregister() */ @@ -2688,7 +2674,6 @@ H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func) { H5T_t *src = NULL, *dst = NULL; /* Datatype descriptors */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2699,17 +2684,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "src is not a data type") if(dst_id > 0 && (NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dst is not a data type") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; if(H5T__unregister(pers, name, src, dst, func) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "internal unregister function failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tunregister() */ @@ -2833,7 +2812,6 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, { H5T_path_t *tpath; /* type conversion info */ H5T_t *src, *dst; /* unatomized types */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2848,12 +2826,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset transfer property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Find the conversion function */ if(NULL == (tpath = H5T_path_find(src, dst))) @@ -2863,8 +2838,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tconvert() */ diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 91a0f1c..12492fd 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -103,7 +103,6 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, { H5G_loc_t loc; /* Location to create datatype */ H5T_t *type; /* Datatype for ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -131,21 +130,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Commit the type */ if(H5T__commit_named(&loc, name, type, lcpl_id, tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tcommit2() */ @@ -254,7 +247,6 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) { H5G_loc_t loc; /* Group location for location */ H5T_t *type = NULL; /* Datatype created */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -273,21 +265,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Commit the type */ if(H5T__commit_anon(loc.oloc->file, type, tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tcommit_anon() */ @@ -568,7 +554,6 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id) { H5T_t *type = NULL; /* Datatype opened in file */ H5G_loc_t loc; /* Group location of object to open */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -580,13 +565,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Open it */ if(NULL == (type = H5T__open_name(&loc, name))) @@ -602,8 +583,6 @@ done: if(type != NULL) (void)H5T_close(type); -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Topen2() */ @@ -632,7 +611,6 @@ H5Tget_create_plist(hid_t dtype_id) { H5T_t *type; /* Datatype object for ID */ herr_t status; /* Generic status value */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) @@ -647,20 +625,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't check whether datatype is committed") /* Retrieve further information, if the datatype is committed */ - if(status > 0) { -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - + if(status > 0) /* Retrieve datatype creation properties */ if((ret_value = H5T__get_create_plist(type)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info") - } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tget_create_plist() */ @@ -681,7 +651,6 @@ herr_t H5Tflush(hid_t type_id) { H5T_t *dt; /* Datatype for this operation */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -693,21 +662,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!H5T_is_named(dt)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(type_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(type_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Flush metadata for named datatype */ if(H5T__flush(dt, type_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Tflush */ @@ -728,7 +691,6 @@ herr_t H5Trefresh(hid_t type_id) { H5T_t *dt; /* Datatype for this operation */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -740,21 +702,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!H5T_is_named(dt)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(type_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(type_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Call private function to refresh datatype object */ if((H5T__refresh(dt, type_id)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Trefresh */ diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index 3daf365..feece57 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -214,7 +214,6 @@ H5Tget_member_type(hid_t type_id, unsigned membno) { H5T_t *dt; /* Datatype to query */ H5T_t *memb_dt = NULL; /* Member datatype */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -226,11 +225,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(membno >= dt->shared->u.compnd.nmembs) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid member number") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Retrieve the datatype for the member */ if(NULL == (memb_dt = H5T_get_member_type(dt, membno, H5T_COPY_REOPEN))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to retrieve member type") @@ -243,8 +237,6 @@ done: if(ret_value < 0) if(memb_dt && H5T_close(memb_dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, H5I_INVALID_HID, "can't close datatype") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tget_member_type() */ diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 5a273f5..e4224f5 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -102,7 +102,6 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) { H5G_loc_t loc; /* Location to create datatype */ H5T_t *type; /* Datatype for ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -116,21 +115,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Commit the datatype to the file, using default property list values */ if(H5T__commit_named(&loc, name, type, H5P_LINK_CREATE_DEFAULT, H5P_DATATYPE_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tcommit1() */ @@ -156,7 +149,6 @@ H5Topen1(hid_t loc_id, const char *name) { H5T_t *type = NULL; H5G_loc_t loc; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; FUNC_ENTER_API(H5I_INVALID_HID) @@ -168,11 +160,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open it */ if(NULL == (type = H5T__open_name(&loc, name))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype") @@ -186,8 +173,6 @@ done: if(ret_value < 0) if(type && H5T_close(type) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, H5I_INVALID_HID, "can't close datatype") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Topen1() */ diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 546b487..c9ad01a 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -78,7 +78,6 @@ H5Tget_native_type(hid_t type_id, H5T_direction_t direction) H5T_t *dt; /* Datatype to create native datatype from */ H5T_t *new_dt = NULL; /* Datatype for native datatype created */ size_t comp_size = 0; /* Compound datatype's size */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -90,10 +89,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(direction != H5T_DIR_DEFAULT && direction != H5T_DIR_ASCEND && direction != H5T_DIR_DESCEND) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not valid direction value") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; /* Get the native type */ if(NULL == (new_dt = H5T__get_native_type(dt, direction, NULL, NULL, &comp_size))) @@ -108,8 +103,6 @@ done: if(ret_value < 0) if(new_dt && H5T_close_real(new_dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release datatype") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tget_native_type() */ diff --git a/src/H5Z.c b/src/H5Z.c index 047277f..be7f261 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -581,7 +581,6 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key) { H5F_t *f = (H5F_t *)obj_ptr; /* File object for operations */ H5Z_object_t *object = (H5Z_object_t *)key; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value = FALSE; /* Return value */ FUNC_ENTER_STATIC @@ -593,11 +592,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Do a global flush if the file is opened for write */ if(H5F_ACC_RDWR & H5F_INTENT(f)) { -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* When parallel HDF5 is defined, check for collective metadata reads on this * file and set the flag for metadata I/O in the API context. -QAK, 2018/02/14 */ @@ -636,15 +630,9 @@ api_ctx_pushed = TRUE; /* Call the flush routine for mounted file hierarchies */ if(H5F_flush_mounts((H5F_t *)obj_ptr) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") - -if(api_ctx_pushed && H5CX_pop() < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTRESET, FAIL, "can't reset API context") -api_ctx_pushed = FALSE; } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_PLINE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__flush_file_cb() */ diff --git a/test/accum.c b/test/accum.c index 76e7656..19006b6 100644 --- a/test/accum.c +++ b/test/accum.c @@ -88,7 +88,7 @@ int main(void) { unsigned nerrors = 0; /* track errors */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t fid = -1; H5F_t * f = NULL; /* File for all tests */ @@ -98,8 +98,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Create a test file */ if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ if(NULL == (f = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR @@ -124,8 +126,10 @@ api_ctx_pushed = TRUE; nerrors += test_free(f); nerrors += test_big(f); nerrors += test_random_write(f); -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; + + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; /* End of test code, close and delete file */ if(H5Fclose(fid) < 0) TEST_ERROR @@ -142,7 +146,8 @@ api_ctx_pushed = FALSE; return 0; error: -if(api_ctx_pushed) H5CX_pop(); + if(api_ctx_pushed) H5CX_pop(); + puts("*** TESTS FAILED ***"); return 1; } /* end main() */ @@ -1822,7 +1827,7 @@ test_swmr_write_big(hbool_t newest_format) int status; /* Status returned from child process */ char *new_argv[] = {NULL}; char *driver = NULL; /* VFD string (from env variable) */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(newest_format) TESTING("SWMR write of large metadata: with latest format") @@ -1870,8 +1875,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Open the file with SWMR_WRITE */ if((fid = H5Fopen(SWMR_FILENAME, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ if(NULL == (rf = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR @@ -1957,19 +1964,22 @@ api_ctx_pushed = TRUE; /* Check if child process terminates normally and its return value */ if(WIFEXITED(status) && !WEXITSTATUS(status)) { - /* Flush the accumulator */ - if(accum_reset(rf) < 0) - FAIL_STACK_ERROR; - /* Close the property list */ - if(H5Pclose(fapl) < 0) - FAIL_STACK_ERROR; - - /* Close and remove the file */ - if(H5Fclose(fid) < 0) - FAIL_STACK_ERROR; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; - HDremove(SWMR_FILENAME); + /* Flush the accumulator */ + if(accum_reset(rf) < 0) + FAIL_STACK_ERROR; + /* Close the property list */ + if(H5Pclose(fapl) < 0) + FAIL_STACK_ERROR; + + /* Close and remove the file */ + if(H5Fclose(fid) < 0) + FAIL_STACK_ERROR; + + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; + + HDremove(SWMR_FILENAME); /* Release memory */ if(wbuf2) @@ -1984,8 +1994,11 @@ error: /* Closing and remove the file */ H5Pclose(fapl); H5Fclose(fid); -if(api_ctx_pushed) H5CX_pop(); + + if(api_ctx_pushed) H5CX_pop(); + HDremove(SWMR_FILENAME); + /* Release memory */ if(wbuf2) HDfree(wbuf2); diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c index 9005b99..5bda46a 100644 --- a/test/accum_swmr_reader.c +++ b/test/accum_swmr_reader.c @@ -50,7 +50,7 @@ main(void) uint8_t rbuf[1024]; /* Buffer for reading */ uint8_t buf[1024]; /* Buffer for holding the expected data */ char *driver = NULL; /* VFD string (from env variable) */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. @@ -72,8 +72,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Open the file with SWMR_READ */ if((fid = H5Fopen(SWMR_FILENAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ if(NULL == (f = (H5F_t *)H5I_object(fid))) @@ -92,14 +94,18 @@ api_ctx_pushed = TRUE; FAIL_STACK_ERROR; if(H5Fclose(fid) < 0) FAIL_STACK_ERROR; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; + + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; return EXIT_SUCCESS; error: H5Fclose(fid); -if(api_ctx_pushed) H5CX_pop(); + + if(api_ctx_pushed) H5CX_pop(); + return EXIT_FAILURE; } /* end main() */ diff --git a/test/btree2.c b/test/btree2.c index fb0156c..e2874b7 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -9947,7 +9947,7 @@ main(void) unsigned reopen; /* Whether to reopen B-tree during tests */ int ExpressMode; const char *envval = NULL; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ envval = HDgetenv("HDF5_DRIVER"); if(envval == NULL) @@ -9962,8 +9962,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Initialize v2 B-tree creation parameters */ init_cparam(&cparam, &cparam2); -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; /* Loop over re-opening B-tree during tests */ for(reopen = FALSE; reopen <= TRUE; reopen++) { @@ -10052,8 +10054,10 @@ api_ctx_pushed = TRUE; /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; + + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; if(nerrors) goto error; @@ -10071,6 +10075,8 @@ error: H5Pclose(fapl); } H5E_END_TRY; + if(api_ctx_pushed) H5CX_pop(); + return 1; } /* end main() */ diff --git a/test/cache_common.c b/test/cache_common.c index 78e2253..5596601 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -3267,7 +3267,9 @@ setup_cache(size_t max_cache_size, HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC); } /* end if */ } /* end if */ -H5CX_push(); + + /* Push API context */ + H5CX_push(); if(show_progress) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -3497,7 +3499,9 @@ takedown_cache(H5F_t * file_ptr, saved_fid = -1; } -H5CX_pop(); + + /* Pop API context */ + H5CX_pop(); if ( ( ! try_core_file_driver ) || ( core_file_driver_failed ) ) { diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 15ce6c2..7a2bb49 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -3638,7 +3638,7 @@ check_invalid_tag_application(void) hid_t fid = -1; haddr_t addr; H5HL_t * lheap = NULL; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ #endif /* H5C_DO_TAGGING_SANITY_CHECKS */ /* Testing Macro */ @@ -3647,8 +3647,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ #if H5C_DO_TAGGING_SANITY_CHECKS /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; -if(H5CX_push() < 0) TEST_ERROR -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) TEST_ERROR + api_ctx_pushed = TRUE; /* Get internal file pointer*/ if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; @@ -3678,8 +3680,10 @@ api_ctx_pushed = TRUE; /* Now unprotect the heap, as we're done with the test. */ if ( H5HL_unprotect(lheap) < 0 ) TEST_ERROR; -if(api_ctx_pushed && H5CX_pop() < 0) TEST_ERROR -api_ctx_pushed = FALSE; + + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) TEST_ERROR + api_ctx_pushed = FALSE; /* Close open objects and file */ if ( H5Fclose(fid) < 0 ) TEST_ERROR; @@ -3695,7 +3699,7 @@ api_ctx_pushed = FALSE; error: #if H5C_DO_TAGGING_SANITY_CHECKS -if(api_ctx_pushed) H5CX_pop(); + if(api_ctx_pushed) H5CX_pop(); #endif /* H5C_DO_TAGGING_SANITY_CHECKS */ return 1; diff --git a/test/dsets.c b/test/dsets.c index 0e0b9d9..ca1e3d5 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -28,6 +28,7 @@ #include "H5srcdir.h" #include "H5Bprivate.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" #include "H5Pprivate.h" @@ -2533,6 +2534,7 @@ test_missing_filter(hid_t file) size_t i,j; /* Local index variables */ herr_t ret; /* Generic return value */ const char *testfile = H5_get_srcdir_filename(FILE_DEFLATE_NAME); /* Corrected test file name */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("dataset access with missing filter"); @@ -2545,6 +2547,10 @@ test_missing_filter(hid_t file) goto error; } /* end if */ + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; + /* Unregister deflate filter */ /* (Use private routine, to avoid range checking on filter ID) */ if(H5Z__unregister(H5Z_FILTER_DEFLATE) < 0) { @@ -2740,10 +2746,16 @@ test_missing_filter(hid_t file) } /* end if */ #endif /* H5_HAVE_FILTER_DEFLATE */ + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; + PASSED(); return 0; error: + if(api_ctx_pushed) H5CX_pop(); + return -1; } diff --git a/test/earray.c b/test/earray.c index 0605605..d72b3f5 100644 --- a/test/earray.c +++ b/test/earray.c @@ -2429,7 +2429,7 @@ main(void) unsigned nerrors = 0; /* Cumulative error count */ time_t curr_time; /* Current time, for seeding random number generator */ int ExpressMode; /* Test express value */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Reset library */ h5_reset(); @@ -2440,8 +2440,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g)); -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; /* Seed random #'s */ curr_time = HDtime(NULL); @@ -2588,8 +2590,10 @@ api_ctx_pushed = TRUE; /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; + + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; if(nerrors) goto error; @@ -2607,6 +2611,8 @@ error: H5Pclose(fapl); } H5E_END_TRY; + if(api_ctx_pushed) H5CX_pop(); + return 1; } /* end main() */ diff --git a/test/efc.c b/test/efc.c index 30ecdb5..d40d4a2 100644 --- a/test/efc.c +++ b/test/efc.c @@ -2891,7 +2891,7 @@ int main(void) { unsigned nerrors = 0; /* track errors */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Test Setup */ puts("Testing the external file cache"); @@ -2907,8 +2907,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ h5_fixname(FILENAME[3], fapl_id, filename[3], sizeof(filename[3])); h5_fixname(FILENAME[4], fapl_id, filename[4], sizeof(filename[4])); h5_fixname(FILENAME[5], fapl_id, filename[5], sizeof(filename[5])); -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; /* Test Functions */ nerrors += test_single(); @@ -2921,8 +2923,10 @@ api_ctx_pushed = TRUE; /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0); -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; + + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; if(nerrors) goto error; @@ -2940,6 +2944,8 @@ error: H5Pclose(fapl_id); } H5E_END_TRY + if(api_ctx_pushed) H5CX_pop(); + return 1; } /* end main() */ diff --git a/test/farray.c b/test/farray.c index 5ff950e..383cb32 100644 --- a/test/farray.c +++ b/test/farray.c @@ -1659,7 +1659,7 @@ main(void) unsigned nerrors = 0; /* Cumulative error count */ time_t curr_time; /* Current time, for seeding random number generator */ int ExpressMode; /* Test express value */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Reset library */ h5_reset(); @@ -1670,8 +1670,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g)); -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; /* Seed random #'s */ curr_time = HDtime(NULL); @@ -1791,8 +1793,10 @@ api_ctx_pushed = TRUE; /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; + + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; if(nerrors) goto error; @@ -1810,6 +1814,8 @@ error: H5Pclose(fapl); } H5E_END_TRY; + if(api_ctx_pushed) H5CX_pop(); + return 1; } /* end main() */ diff --git a/test/fheap.c b/test/fheap.c index 3a4fea3..e38d263 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -16288,7 +16288,7 @@ main(void) int ExpressMode; /* Express testing level */ const char *envval; /* Environment variable */ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Don't run this test using certain file drivers */ envval = HDgetenv("HDF5_DRIVER"); @@ -16327,8 +16327,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Initialize heap creation parameters */ init_small_cparam(&small_cparam); init_large_cparam(&large_cparam); -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; /* Allocate space for the shared objects */ shared_obj_size_g = large_cparam.max_man_size + 256; @@ -16777,8 +16779,6 @@ api_ctx_pushed = TRUE; /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; if(nerrors) goto error; @@ -16794,6 +16794,10 @@ api_ctx_pushed = FALSE; if(H5Pclose(def_fcpl) < 0) TEST_ERROR if(H5Pclose(pb_fapl) < 0) TEST_ERROR + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; + /* Clean up file used */ h5_cleanup(FILENAME, def_fapl); @@ -16812,6 +16816,9 @@ error: H5Pclose(def_fcpl); H5Pclose(fcpl); } H5E_END_TRY; + + if(api_ctx_pushed) H5CX_pop(); + return 1; } /* end main() */ diff --git a/test/freespace.c b/test/freespace.c index ebc7840..33a6f89 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -457,7 +457,6 @@ test_fs_create(hid_t fapl) H5FS_create_t cparam, test_cparam; /* creation parameters */ uint16_t nclasses; unsigned init_flags=0; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("the creation/close/reopen/deletion of the free-space manager"); @@ -479,8 +478,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Re-open the file */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -548,8 +545,6 @@ api_ctx_pushed = TRUE; /* Verify the file is the correct size */ if(file_size != empty_size) TEST_ERROR -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; PASSED() @@ -560,7 +555,6 @@ error: if(frsp) H5FS_close(f, frsp); H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_create() */ @@ -606,7 +600,6 @@ test_fs_sect_add(hid_t fapl) unsigned init_flags=0; h5_stat_size_t file_size=0, tmp_file_size=0, fr_meta_size=0; unsigned can_shrink=FALSE; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("adding a section via H5FS_sect_add() to free-space: test 1"); @@ -627,8 +620,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Re-open the file */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -891,8 +882,6 @@ api_ctx_pushed = TRUE; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; PASSED() @@ -905,7 +894,6 @@ error: if(frsp) H5FS_close(f, frsp); H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_add() */ @@ -947,7 +935,6 @@ test_fs_sect_find(hid_t fapl) TEST_free_section_t *node; htri_t node_found = FALSE; unsigned init_flags=0; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("H5FS_sect_find(): free-space is empty"); @@ -957,8 +944,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -1266,8 +1251,6 @@ api_ctx_pushed = TRUE; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; PASSED() @@ -1284,7 +1267,6 @@ error: if(frsp) H5FS_close(f, frsp); H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_find() */ @@ -1338,7 +1320,6 @@ test_fs_sect_merge(hid_t fapl) unsigned init_flags=0; htri_t node_found = FALSE; TEST_free_section_t *node; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("the merge of sections when H5FS_sect_add() to free-space: test 1"); @@ -1351,8 +1332,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -1742,8 +1721,6 @@ api_ctx_pushed = TRUE; /* Close the file */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; PASSED() @@ -1758,7 +1735,6 @@ error: if(frsp) H5FS_close(f, frsp); H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_merge() */ @@ -1814,7 +1790,6 @@ test_fs_sect_shrink(hid_t fapl) unsigned can_shrink=FALSE; htri_t node_found = FALSE; TEST_free_section_t *node; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("shrinking of sections when H5FS_sect_add() to free-space: test 1"); @@ -1824,8 +1799,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -2112,8 +2085,6 @@ api_ctx_pushed = TRUE; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; PASSED() @@ -2124,7 +2095,6 @@ error: if(frsp) H5FS_close(f, frsp); H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_sect_shrink() */ @@ -2161,7 +2131,6 @@ test_fs_sect_change_class(hid_t fapl) TEST_free_section_t *sect_node1=NULL, *sect_node2=NULL, *sect_node3=NULL; unsigned init_flags=0; TEST_free_section_t *node; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("the change of section class via H5FS_sect_change_class() in free-space: Test 1"); @@ -2171,8 +2140,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -2393,8 +2360,6 @@ api_ctx_pushed = TRUE; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; PASSED() @@ -2409,7 +2374,6 @@ error: if(frsp) H5FS_close(f, frsp); H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_sect_change_class() */ @@ -2459,7 +2423,6 @@ test_fs_sect_extend(hid_t fapl) TEST_free_section_t *sect_node1=NULL, *sect_node2=NULL; unsigned init_flags=0; htri_t status; /* Status of 'try' calls */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("a block's extension by requested-size which is = adjoining free section's size: Test 1"); @@ -2468,8 +2431,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -2778,8 +2739,6 @@ api_ctx_pushed = TRUE; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; return 0; @@ -2788,7 +2747,6 @@ error: if(frsp) H5FS_close(f, frsp); H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_sect_extend() */ @@ -2818,7 +2776,6 @@ test_fs_sect_iterate(hid_t fapl) TEST_iter_ud_t udata; int i; hsize_t tot_space, nsects; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("iteration of sections in the free-space manager"); @@ -2828,8 +2785,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -2886,8 +2841,6 @@ api_ctx_pushed = TRUE; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; PASSED() @@ -2898,7 +2851,6 @@ error: if(frsp) H5FS_close(f, frsp); H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_iterate() */ @@ -2910,6 +2862,7 @@ main(void) hid_t fapl = -1; /* File access property list for data files */ unsigned nerrors = 0; /* Cumulative error count */ const char *env_h5_drvr = NULL; /* File Driver value from environment */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Get the VFD to use */ env_h5_drvr = HDgetenv("HDF5_DRIVER"); @@ -2923,6 +2876,10 @@ main(void) PUTS_ERROR("Can't get VFD-dependent fapl") } /* end if */ + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; + /* make sure alignment is not set for tests to succeed */ if(H5Pset_alignment(fapl, (hsize_t)1, (hsize_t)1) < 0) { nerrors++; @@ -2945,6 +2902,10 @@ main(void) goto error; HDputs("All free-space tests passed."); + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; + h5_cleanup(FILENAME, fapl); HDexit(EXIT_SUCCESS); @@ -2953,6 +2914,9 @@ error: H5E_BEGIN_TRY { H5Pclose(fapl); } H5E_END_TRY; + + if(api_ctx_pushed) H5CX_pop(); + HDexit(EXIT_FAILURE); } /* main() */ diff --git a/test/gheap.c b/test/gheap.c index 716c34a..bf0f18a 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -87,7 +87,6 @@ test_1 (hid_t fapl) herr_t status; int nerrors = 0; char filename[1024]; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("monotonically increasing lengths"); @@ -99,8 +98,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -151,8 +148,6 @@ api_ctx_pushed = TRUE; obj = NULL; if(H5Fclose(file) < 0) goto error; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; if(nerrors) goto error; PASSED(); @@ -161,7 +156,6 @@ api_ctx_pushed = FALSE; error: H5E_BEGIN_TRY { H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -198,7 +192,6 @@ test_2 (hid_t fapl) size_t size; int nerrors = 0; char filename[1024]; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("monotonically decreasing lengths"); @@ -210,8 +203,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -255,8 +246,6 @@ api_ctx_pushed = TRUE; obj = NULL; if (H5Fclose(file)<0) goto error; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; if (nerrors) goto error; PASSED(); @@ -265,7 +254,6 @@ api_ctx_pushed = FALSE; error: H5E_BEGIN_TRY { H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -302,7 +290,6 @@ test_3 (hid_t fapl) herr_t status; int nerrors = 0; char filename[1024]; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("complete object removal"); @@ -314,8 +301,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ h5_fixname(FILENAME[2], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -350,8 +335,6 @@ api_ctx_pushed = TRUE; obj = NULL; if (H5Fclose(file)<0) goto error; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; if (nerrors) goto error; PASSED(); @@ -360,7 +343,6 @@ api_ctx_pushed = FALSE; error: H5E_BEGIN_TRY { H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -398,7 +380,6 @@ test_4 (hid_t fapl) herr_t status; int nerrors = 0; char filename[1024]; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("partial object removal"); @@ -410,8 +391,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ h5_fixname(FILENAME[3], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -452,8 +431,6 @@ api_ctx_pushed = TRUE; obj = NULL; if (H5Fclose(file)<0) goto error; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; if (nerrors) goto error; PASSED(); @@ -462,7 +439,6 @@ api_ctx_pushed = FALSE; error: H5E_BEGIN_TRY { H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -499,7 +475,6 @@ test_ooo_indices(hid_t fapl) herr_t status; int nerrors=0; char filename[1024]; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("out of order indices"); @@ -510,8 +485,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ h5_fixname(FILENAME[4], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -571,8 +544,6 @@ api_ctx_pushed = TRUE; } /* end for */ if (H5Fclose(file)<0) goto error; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; if (nerrors) goto error; HDfree(obj); @@ -584,7 +555,6 @@ api_ctx_pushed = FALSE; error: H5E_BEGIN_TRY { H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -613,10 +583,15 @@ main (void) { int nerrors=0; hid_t fapl; + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ h5_reset(); fapl = h5_fileaccess(); + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; + nerrors += test_1(fapl); nerrors += test_2(fapl); nerrors += test_3(fapl); @@ -626,13 +601,22 @@ main (void) /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); - if (nerrors) goto error; - + if (nerrors) + goto error; puts("All global heap tests passed."); + + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; + h5_cleanup(FILENAME, fapl); return 0; error: puts("*** TESTS FAILED ***"); + + if(api_ctx_pushed) H5CX_pop(); + return 1; } + diff --git a/test/lheap.c b/test/lheap.c index dd8110e..4f09b6e 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -63,12 +63,15 @@ main(void) int i, j; /* miscellaneous counters */ char buf[1024]; /* the value to store */ const char *s; /* value to read */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Reset library */ h5_reset(); fapl = h5_fileaccess(); + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; /* * Test writing to the heap... @@ -77,8 +80,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if(FAIL == (file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))) goto error; -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); @@ -119,8 +120,6 @@ api_ctx_pushed = TRUE; } if (FAIL == H5Fclose(file)) goto error; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; PASSED(); /* @@ -131,8 +130,6 @@ api_ctx_pushed = FALSE; h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if(FAIL == (file = H5Fopen(filename, H5F_ACC_RDONLY, fapl))) goto error; -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); @@ -179,8 +176,6 @@ api_ctx_pushed = TRUE; if (FAIL == H5Fclose(file)) goto error; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; PASSED(); /* Check opening existing file non-default sizes of lengths and addresses */ @@ -189,8 +184,6 @@ api_ctx_pushed = FALSE; const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */ hid_t dset = -1; file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT); -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; if(file >= 0){ if((dset = H5Dopen2(file, "/Dataset1", H5P_DEFAULT)) < 0) TEST_ERROR @@ -206,13 +199,15 @@ api_ctx_pushed = TRUE; goto error; } /* end else */ } -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; PASSED(); /* Verify symbol table messages are cached */ if(h5_verify_cached_stabs(FILENAME, fapl) < 0) TEST_ERROR + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; + HDputs("All local heap tests passed."); h5_cleanup(FILENAME, fapl); @@ -222,8 +217,10 @@ api_ctx_pushed = FALSE; HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; + + if(api_ctx_pushed) H5CX_pop(); + return 1; } diff --git a/test/mf.c b/test/mf.c index 846cf90..a537679 100644 --- a/test/mf.c +++ b/test/mf.c @@ -8868,7 +8868,7 @@ main(void) unsigned nerrors = 0; /* Cumulative error count */ test_type_t curr_test; /* Current test being worked on */ const char *env_h5_drvr; /* File Driver value from environment */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Get the VFD to use */ env_h5_drvr = HDgetenv("HDF5_DRIVER"); @@ -8878,8 +8878,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ h5_reset(); fapl = h5_fileaccess(); -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; /* Make a copy of the FAPL before adjusting the alignment */ if((new_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR @@ -8993,8 +8995,10 @@ api_ctx_pushed = TRUE; if(H5Pclose(new_fapl) < 0) FAIL_STACK_ERROR h5_cleanup(FILENAME, fapl); -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; + + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; if(nerrors) goto error; @@ -9007,8 +9011,10 @@ error: H5E_BEGIN_TRY { H5Pclose(fapl); H5Pclose(new_fapl); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; + + if(api_ctx_pushed) H5CX_pop(); + return(1); } /* main() */ diff --git a/test/ohdr.c b/test/ohdr.c index 5821357..d0f6966 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -69,7 +69,6 @@ test_cont(char *filename, hid_t fapl) const char *short_name = "T"; const char *long_name = "This is the message"; size_t nchunks; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("object header continuation block"); @@ -79,8 +78,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR if (H5AC_ignore_tags(f) < 0) { @@ -145,11 +142,9 @@ api_ctx_pushed = TRUE; FAIL_STACK_ERROR if(H5Fclose(file) < 0) FAIL_STACK_ERROR -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR PASSED(); - return SUCCEED; error: @@ -157,7 +152,6 @@ error: H5O_close(&oh_locA, NULL); H5O_close(&oh_locB, NULL); H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return FAIL; @@ -808,7 +802,7 @@ main(void) time_t time_new, ro; char msg[80]; /* Message for file format version */ int i; /* Local index variable */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret; /* Generic return value */ /* Reset library */ @@ -816,6 +810,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ fapl = h5_fileaccess(); h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; + /* Loop through all the combinations of low/high library format bounds */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { @@ -846,8 +844,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR if(H5AC_ignore_tags(f) < 0) { @@ -1037,8 +1033,6 @@ api_ctx_pushed = TRUE; if(test_ohdr_cache(filename, fapl) < 0) TEST_ERROR -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; } /* high */ } /* low */ @@ -1049,6 +1043,10 @@ api_ctx_pushed = FALSE; if(test_ohdr_swmr(TRUE) < 0) TEST_ERROR if(test_ohdr_swmr(FALSE) < 0) TEST_ERROR + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; + HDputs("All object header tests passed."); h5_cleanup(FILENAME, fapl); return 0; @@ -1057,9 +1055,10 @@ error: puts("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5Fclose(file); -if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; + if(api_ctx_pushed) H5CX_pop(); + return 1; } /* end main() */ diff --git a/test/page_buffer.c b/test/page_buffer.c index 9901304..a6e85ee 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -577,7 +577,6 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) haddr_t addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("Raw Data Handling"); @@ -603,8 +602,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR; -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) @@ -797,8 +794,6 @@ api_ctx_pushed = TRUE; FAIL_STACK_ERROR; if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; HDfree(data); PASSED() @@ -809,7 +804,6 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); -if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; @@ -862,7 +856,6 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) haddr_t search_addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("LRU Processing"); @@ -896,8 +889,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) FAIL_STACK_ERROR; -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* opening the file inserts one or more pages into the page buffer. * Get the number of pages inserted, and verify that it is the @@ -1056,8 +1047,6 @@ api_ctx_pushed = TRUE; FAIL_STACK_ERROR; if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; HDfree(data); PASSED() @@ -1068,7 +1057,6 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); -if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; @@ -1124,7 +1112,6 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) haddr_t raw_addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("Minimum Metadata threshold Processing"); HDprintf("\n"); @@ -1157,8 +1144,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* create the file */ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR; -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) @@ -1693,8 +1678,6 @@ api_ctx_pushed = TRUE; if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; HDfree(data); @@ -1708,7 +1691,6 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); -if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; @@ -1763,7 +1745,6 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) haddr_t raw_addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("Statistics Collection"); @@ -1793,8 +1774,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR; -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) @@ -2005,8 +1984,6 @@ api_ctx_pushed = TRUE; FAIL_STACK_ERROR; if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; HDfree(data); @@ -2018,7 +1995,6 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); -if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; @@ -2161,6 +2137,7 @@ main(void) hid_t fapl = -1; /* File access property list for data files */ unsigned nerrors = 0; /* Cumulative error count */ const char *env_h5_drvr = NULL; /* File Driver value from environment */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ h5_reset(); @@ -2186,6 +2163,10 @@ main(void) PUTS_ERROR("Can't get VFD-dependent fapl") } /* end if */ + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; + #ifdef H5_HAVE_PARALLEL HDputs("Page Buffering is disabled for parallel."); @@ -2206,12 +2187,15 @@ main(void) if(nerrors) goto error; + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; + HDputs("All Page Buffering tests passed."); HDexit(EXIT_SUCCESS); error: - HDprintf("***** %d Page Buffering TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : ""); @@ -2219,7 +2203,8 @@ error: H5Pclose(fapl); } H5E_END_TRY; - HDexit(EXIT_FAILURE); + if(api_ctx_pushed) H5CX_pop(); + HDexit(EXIT_FAILURE); } /* main() */ diff --git a/test/unregister.c b/test/unregister.c index 4d7c902..dbf6293 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -231,13 +231,15 @@ main(void) { hid_t fapl; int nerrors = 0; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Testing setup */ h5_reset(); fapl = h5_fileaccess(); -if(H5CX_push() < 0) FAIL_STACK_ERROR -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; /* Test unregistering filter in its own file */ nerrors += (test_unregister_filters(fapl) < 0 ? 1 : 0); @@ -245,9 +247,12 @@ api_ctx_pushed = TRUE; if(nerrors) goto error; printf("All filter unregistration tests passed.\n"); + + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; + h5_cleanup(FILENAME, fapl); -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; return 0; @@ -255,7 +260,9 @@ error: nerrors = MAX(1, nerrors); printf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); -if(api_ctx_pushed) H5CX_pop(); + + if(api_ctx_pushed) H5CX_pop(); + return 1; } diff --git a/testpar/t_file.c b/testpar/t_file.c index f8bf7b3..f670034 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -128,7 +128,7 @@ test_page_buffer_access(void) H5F_t *f = NULL; herr_t ret; /* generic return value */ const char *filename; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); @@ -194,9 +194,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl_self); VRFY((file_id >= 0), ""); -ret = H5CX_push(); -VRFY((ret == 0), "H5CX_push()"); -api_ctx_pushed = TRUE; + + /* Push API context */ + ret = H5CX_push(); + VRFY((ret == 0), "H5CX_push()"); + api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ f = (H5F_t *)H5I_object(file_id); @@ -282,7 +284,9 @@ api_ctx_pushed = TRUE; VRFY((ret >= 0), "H5Fclose succeeded"); ret = H5Pclose(fapl_self); VRFY((ret>=0), "H5Pclose succeeded"); -if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } + + /* Pop API context */ + if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } } #endif @@ -297,9 +301,11 @@ if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_p file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); VRFY((file_id >= 0), ""); -ret = H5CX_push(); -VRFY((ret == 0), "H5CX_push()"); -api_ctx_pushed = TRUE; + + /* Push API context */ + ret = H5CX_push(); + VRFY((ret == 0), "H5CX_push()"); + api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ f = (H5F_t *)H5I_object(file_id); @@ -409,7 +415,9 @@ api_ctx_pushed = TRUE; VRFY((ret>=0), "H5Pclose succeeded"); ret = H5Pclose(fcpl); VRFY((ret>=0), "H5Pclose succeeded"); -if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } + + /* Pop API context */ + if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } HDfree(data); data = NULL; @@ -433,7 +441,7 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str H5F_t *f = NULL; H5C_t *cache_ptr = NULL; H5AC_cache_config_t config; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret; file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); @@ -441,9 +449,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VRFY((ret == 0), ""); -ret = H5CX_push(); -VRFY((ret == 0), "H5CX_push()"); -api_ctx_pushed = TRUE; + + /* Push API context */ + ret = H5CX_push(); + VRFY((ret == 0), "H5CX_push()"); + api_ctx_pushed = TRUE; f = (H5F_t *)H5I_object(file_id); VRFY((f != NULL), ""); @@ -561,7 +571,9 @@ api_ctx_pushed = TRUE; VRFY((ret == 0), ""); ret = H5Sclose(mem_dataspace); VRFY((ret == 0), ""); -if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } + + /* Pop API context */ + if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } MPI_Barrier(MPI_COMM_WORLD); HDfree(data_array); @@ -586,7 +598,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, H5F_t *f = NULL; H5C_t *cache_ptr = NULL; H5AC_cache_config_t config; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret; config.version = H5AC__CURR_CACHE_CONFIG_VERSION; @@ -601,9 +613,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl); H5Eprint2(H5E_DEFAULT, stderr); VRFY((file_id >= 0), ""); -ret = H5CX_push(); -VRFY((ret == 0), "H5CX_push()"); -api_ctx_pushed = TRUE; + + /* Push API context */ + ret = H5CX_push(); + VRFY((ret == 0), "H5CX_push()"); + api_ctx_pushed = TRUE; ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VRFY((ret == 0), ""); @@ -717,7 +731,10 @@ api_ctx_pushed = TRUE; VRFY((ret == 0), ""); ret = H5Sclose(mem_dataspace); VRFY((ret == 0), ""); -if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } + + /* Pop API context */ + if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } + HDfree(data_array); return nerrors; diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index 7e00b4f..b66e7ce 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -255,7 +255,7 @@ main(int argc, char *argv[]) size_t u; H5E_auto2_t func; void *edata; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t status = SUCCEED; if(argc == 1) { @@ -289,11 +289,14 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HDfprintf(stderr, "cannot open file\n"); HDexit(1); } /* end if */ -if(H5CX_push() < 0) { - HDfprintf(stderr, "cannot set API context\n"); - HDexit(1); -} -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) { + HDfprintf(stderr, "cannot set API context\n"); + HDexit(1); + } + api_ctx_pushed = TRUE; + if(NULL == (f = (H5F_t *)H5I_object(fid))) { HDfprintf(stderr, "cannot obtain H5F_t pointer\n"); HDexit(2); @@ -719,7 +722,9 @@ api_ctx_pushed = TRUE; H5Pclose(fapl); H5Fclose(fid); -if(api_ctx_pushed) H5CX_pop(); + + /* Pop API context */ + if(api_ctx_pushed) H5CX_pop(); H5Eset_auto2(H5E_DEFAULT, func, edata); -- cgit v0.12 From abf8d53395b30c77370cc4899b1a26bf0ecd4407 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 19 Mar 2018 15:30:09 -0500 Subject: Add release info for H5DOread_chunk. --- release_docs/RELEASE.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e18b43a..8ae10ec 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -319,6 +319,16 @@ Bug Fixes since HDF5-1.10.1 release Library ------- + - Add public routine H5DOread_chunk to the high-level C library + + As we have H5DOwrite_chunk() to write an entire chunk to the file + directly, the customer requested to add this public routine to + read an entire chunk from the file directly. + + This public routine was added based on a patch from GE Healthcare. + + (VC - 2018/03/18, HDFFV-9934) + - Freeing of object header in H5Ocache.c It was discovered that the object header was not released properly -- cgit v0.12 From 1d0ad712e9f33ac30f42b88f0c523470a25c9545 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 19 Mar 2018 15:49:21 -0500 Subject: Correct the date in RELEASE.txt for H5DOread_chunk. --- 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 8ae10ec..e208004 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -327,7 +327,7 @@ Bug Fixes since HDF5-1.10.1 release This public routine was added based on a patch from GE Healthcare. - (VC - 2018/03/18, HDFFV-9934) + (VC - 2018/05/19, HDFFV-9934) - Freeing of object header in H5Ocache.c -- cgit v0.12 From 85183a9fbb863b57edf404dc6bd92cd8b89c990e Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 19 Mar 2018 16:25:02 -0500 Subject: Fix date. --- 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 e208004..c978942 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -327,7 +327,7 @@ Bug Fixes since HDF5-1.10.1 release This public routine was added based on a patch from GE Healthcare. - (VC - 2018/05/19, HDFFV-9934) + (VC - 2017/05/19, HDFFV-9934) - Freeing of object header in H5Ocache.c -- cgit v0.12 From 91244f1d27af6cd0958c0fd04d5a51cf3f049428 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 20 Mar 2018 09:43:18 -0500 Subject: Refactor H5CX code to reduce duplication. --- src/H5CX.c | 800 +++++++++---------------------------------------------------- 1 file changed, 116 insertions(+), 684 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index 406481a..7884506 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -64,6 +64,83 @@ #define H5CX_get_my_context() (H5CX_head_g) #endif /* H5_HAVE_THREADSAFE */ +/* Common macro for the duplicated code to retrieve properties from a property list */ +#define H5CX_RETRIEVE_PROP_COMMON(PL, DEF_PL, PROP_NAME, PROP_FIELD) \ + /* Check for default property list */ \ + if((*head)->ctx.H5_GLUE(PL,_id) == (DEF_PL)) \ + HDmemcpy(&(*head)->ctx.PROP_FIELD, &H5_GLUE3(H5CX_def_,PL,_cache).PROP_FIELD, sizeof(H5_GLUE3(H5CX_def_,PL,_cache).PROP_FIELD)); \ + else { \ + /* Check if the property list is already available */ \ + if(NULL == (*head)->ctx.PL) \ + /* Get the dataset transfer property list pointer */ \ + if(NULL == ((*head)->ctx.PL = (H5P_genplist_t *)H5I_object((*head)->ctx.H5_GLUE(PL,_id)))) \ + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") \ + \ + /* Get the property */ \ + if(H5P_get((*head)->ctx.PL, (PROP_NAME), &(*head)->ctx.PROP_FIELD) < 0) \ + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't retrieve value from API context") \ + } /* end else */ \ + \ + /* Mark the field as valid */ \ + (*head)->ctx.H5_GLUE(PROP_FIELD,_valid) = TRUE; + +/* Macro for the duplicated code to retrieve properties from a property list */ +#define H5CX_RETRIEVE_PROP_VALID(PL, DEF_PL, PROP_NAME, PROP_FIELD) \ + /* Check if the value has been retrieved already */ \ + if(!(*head)->ctx.H5_GLUE(PROP_FIELD,_valid)) { \ + H5CX_RETRIEVE_PROP_COMMON(PL, DEF_PL, PROP_NAME, PROP_FIELD) \ + } /* end if */ + +#ifdef H5_HAVE_PARALLEL +/* Macro for the duplicated code to retrieve possibly set properties from a property list */ +#define H5CX_RETRIEVE_PROP_VALID_SET(PL, DEF_PL, PROP_NAME, PROP_FIELD) \ + /* Check if the value has been retrieved already */ \ + if(!((*head)->ctx.H5_GLUE(PROP_FIELD,_valid) || (*head)->ctx.H5_GLUE(PROP_FIELD,_set))) { \ + H5CX_RETRIEVE_PROP_COMMON(PL, DEF_PL, PROP_NAME, PROP_FIELD) \ + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + +#ifdef H5_HAVE_PARALLEL +/* Macro for the duplicated code to test and set properties for a property list */ +#define H5CX_TEST_SET_PROP(PROP_NAME, PROP_FIELD) \ +{ \ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ \ + \ + /* Check if property exists in DXPL */ \ + if(!(*head)->ctx.H5_GLUE(PROP_FIELD,_set)) { \ + /* Check if the property list is already available */ \ + if(NULL == (*head)->ctx.dxpl) \ + /* Get the dataset transfer property list pointer */ \ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) \ + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") \ + \ + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, PROP_NAME)) < 0) \ + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") \ + } /* end if */ \ + \ + /* If property was already set or exists (for first set), update it */ \ + if((*head)->ctx.H5_GLUE(PROP_FIELD,_set) || check_prop > 0) { \ + /* Cache the value for later, marking it to set in DXPL when context popped */ \ + (*head)->ctx.PROP_FIELD = PROP_FIELD; \ + (*head)->ctx.H5_GLUE(PROP_FIELD,_set) = TRUE; \ + } /* end if */ \ +} +#endif /* H5_HAVE_PARALLEL */ + +/* Macro for the duplicated code to test and set properties for a property list */ +#define H5CX_SET_PROP(PROP_NAME, PROP_FIELD) \ + if((*head)->ctx.H5_GLUE(PROP_FIELD,_set)) { \ + /* Check if the property list is already available */ \ + if(NULL == (*head)->ctx.dxpl) \ + /* Get the dataset transfer property list pointer */ \ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) \ + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") \ + \ + /* Set the chunk filter mask property */ \ + if(H5P_set((*head)->ctx.dxpl, PROP_NAME, &(*head)->ctx.PROP_FIELD) < 0) \ + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting filter mask xfer property") \ + } /* end if */ + /******************/ /* Local Typedefs */ @@ -1053,26 +1130,7 @@ H5CX_get_btree_split_ratios(double split_ratio[3]) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.btree_split_ratio_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - HDmemcpy((*head)->ctx.btree_split_ratio, &H5CX_def_dxpl_cache.btree_split_ratio, sizeof(H5CX_def_dxpl_cache.btree_split_ratio)); - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get B-tree split ratios */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_BTREE_SPLIT_RATIO_NAME, (*head)->ctx.btree_split_ratio) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't retrieve B-tree split ratios") - } /* end else */ - - /* Mark the B-tree split ratio values as valid */ - (*head)->ctx.btree_split_ratio_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_BTREE_SPLIT_RATIO_NAME, btree_split_ratio) /* Get the B-tree split ratio values */ HDmemcpy(split_ratio, &(*head)->ctx.btree_split_ratio, sizeof((*head)->ctx.btree_split_ratio)); @@ -1107,26 +1165,7 @@ H5CX_get_max_temp_buf(size_t *max_temp_buf) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.max_temp_buf_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.max_temp_buf = H5CX_def_dxpl_cache.max_temp_buf; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get maximum temporary buffer size value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MAX_TEMP_BUF_NAME, &(*head)->ctx.max_temp_buf) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve maximum temporary buffer size") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.max_temp_buf_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MAX_TEMP_BUF_NAME, max_temp_buf) /* Get the value */ *max_temp_buf = (*head)->ctx.max_temp_buf; @@ -1161,26 +1200,7 @@ H5CX_get_tconv_buf(void **tconv_buf) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.tconv_buf_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.tconv_buf = H5CX_def_dxpl_cache.tconv_buf; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get temporary conversion buffer pointer value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_TCONV_BUF_NAME, &(*head)->ctx.tconv_buf) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve temporary buffer pointer") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.tconv_buf_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_TCONV_BUF_NAME, tconv_buf) /* Get the value */ *tconv_buf = (*head)->ctx.tconv_buf; @@ -1215,26 +1235,7 @@ H5CX_get_bkgr_buf(void **bkgr_buf) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.bkgr_buf_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.bkgr_buf = H5CX_def_dxpl_cache.bkgr_buf; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get background conversion buffer pointer value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_BKGR_BUF_NAME, &(*head)->ctx.bkgr_buf) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve background buffer pointer") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.bkgr_buf_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_BKGR_BUF_NAME, bkgr_buf) /* Get the value */ *bkgr_buf = (*head)->ctx.bkgr_buf; @@ -1269,26 +1270,7 @@ H5CX_get_bkgr_buf_type(H5T_bkg_t *bkgr_buf_type) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.bkgr_buf_type_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.bkgr_buf_type = H5CX_def_dxpl_cache.bkgr_buf_type; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get background buffer type value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_BKGR_BUF_TYPE_NAME, &(*head)->ctx.bkgr_buf_type) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve background buffer type") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.bkgr_buf_type_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_BKGR_BUF_TYPE_NAME, bkgr_buf_type) /* Get the value */ *bkgr_buf_type = (*head)->ctx.bkgr_buf_type; @@ -1323,26 +1305,7 @@ H5CX_get_vec_size(size_t *vec_size) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.vec_size_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.vec_size = H5CX_def_dxpl_cache.vec_size; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get hyperslab vector size value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &(*head)->ctx.vec_size) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve I/O vector size") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.vec_size_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_HYPER_VECTOR_SIZE_NAME, vec_size) /* Get the value */ *vec_size = (*head)->ctx.vec_size; @@ -1378,26 +1341,7 @@ H5CX_get_io_xfer_mode(H5FD_mpio_xfer_t *io_xfer_mode) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.io_xfer_mode_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.io_xfer_mode = H5CX_def_dxpl_cache.io_xfer_mode; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get parallel transfer mode value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_IO_XFER_MODE_NAME, &(*head)->ctx.io_xfer_mode) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve parallel transfer method") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.io_xfer_mode_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_IO_XFER_MODE_NAME, io_xfer_mode) /* Get the value */ *io_xfer_mode = (*head)->ctx.io_xfer_mode; @@ -1432,26 +1376,7 @@ H5CX_get_mpio_coll_opt(H5FD_mpio_collective_opt_t *mpio_coll_opt) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.mpio_coll_opt_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.mpio_coll_opt = H5CX_def_dxpl_cache.mpio_coll_opt; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get collective I/O option value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &(*head)->ctx.mpio_coll_opt) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve collective transfer option") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.mpio_coll_opt_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, mpio_coll_opt) /* Get the value */ *mpio_coll_opt = (*head)->ctx.mpio_coll_opt; @@ -1486,26 +1411,7 @@ H5CX_get_mpio_local_no_coll_cause(uint32_t *mpio_local_no_coll_cause) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved or set already */ - if(!((*head)->ctx.mpio_local_no_coll_cause_valid || (*head)->ctx.mpio_local_no_coll_cause_set)) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.mpio_local_no_coll_cause = H5CX_def_dxpl_cache.mpio_local_no_coll_cause; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get the value */ - if(H5P_get((*head)->ctx.dxpl, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_local_no_coll_cause) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve local cause for breaking collective I/O") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.mpio_local_no_coll_cause_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID_SET(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) /* Get the value */ *mpio_local_no_coll_cause = (*head)->ctx.mpio_local_no_coll_cause; @@ -1540,26 +1446,7 @@ H5CX_get_mpio_global_no_coll_cause(uint32_t *mpio_global_no_coll_cause) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved or set already */ - if(!((*head)->ctx.mpio_global_no_coll_cause_valid || (*head)->ctx.mpio_global_no_coll_cause_set)) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.mpio_global_no_coll_cause = H5CX_def_dxpl_cache.mpio_global_no_coll_cause; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get the value */ - if(H5P_get((*head)->ctx.dxpl, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_global_no_coll_cause) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve global cause for breaking collective I/O") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.mpio_global_no_coll_cause_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID_SET(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) /* Get the value */ *mpio_global_no_coll_cause = (*head)->ctx.mpio_global_no_coll_cause; @@ -1594,26 +1481,7 @@ H5CX_get_mpio_chunk_opt_mode(H5FD_mpio_chunk_opt_t *mpio_chunk_opt_mode) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved or set already */ - if(!(*head)->ctx.mpio_chunk_opt_mode_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.mpio_chunk_opt_mode = H5CX_def_dxpl_cache.mpio_chunk_opt_mode; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get the value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, &(*head)->ctx.mpio_chunk_opt_mode) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization option") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.mpio_chunk_opt_mode_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, mpio_chunk_opt_mode) /* Get the value */ *mpio_chunk_opt_mode = (*head)->ctx.mpio_chunk_opt_mode; @@ -1648,26 +1516,7 @@ H5CX_get_mpio_chunk_opt_num(unsigned *mpio_chunk_opt_num) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved or set already */ - if(!(*head)->ctx.mpio_chunk_opt_num_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.mpio_chunk_opt_num = H5CX_def_dxpl_cache.mpio_chunk_opt_num; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get the value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, &(*head)->ctx.mpio_chunk_opt_num) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization threshold") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.mpio_chunk_opt_num_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, mpio_chunk_opt_num) /* Get the value */ *mpio_chunk_opt_num = (*head)->ctx.mpio_chunk_opt_num; @@ -1702,26 +1551,7 @@ H5CX_get_mpio_chunk_opt_ratio(unsigned *mpio_chunk_opt_ratio) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved or set already */ - if(!(*head)->ctx.mpio_chunk_opt_ratio_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.mpio_chunk_opt_ratio = H5CX_def_dxpl_cache.mpio_chunk_opt_ratio; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get the value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, &(*head)->ctx.mpio_chunk_opt_ratio) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization ratio") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.mpio_chunk_opt_ratio_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, mpio_chunk_opt_ratio) /* Get the value */ *mpio_chunk_opt_ratio = (*head)->ctx.mpio_chunk_opt_ratio; @@ -1757,26 +1587,7 @@ H5CX_get_err_detect(H5Z_EDC_t *err_detect) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.err_detect_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.err_detect = H5CX_def_dxpl_cache.err_detect; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get error detection info value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_EDC_NAME, &(*head)->ctx.err_detect) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve error detection info") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.err_detect_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_EDC_NAME, err_detect) /* Get the value */ *err_detect = (*head)->ctx.err_detect; @@ -1811,26 +1622,7 @@ H5CX_get_filter_cb(H5Z_cb_t *filter_cb) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.filter_cb_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.filter_cb = H5CX_def_dxpl_cache.filter_cb; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get I/O filter callback function value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_FILTER_CB_NAME, &(*head)->ctx.filter_cb) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve filter callback function") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.filter_cb_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_FILTER_CB_NAME, filter_cb) /* Get the value */ *filter_cb = (*head)->ctx.filter_cb; @@ -1982,26 +1774,7 @@ H5CX_get_dcr_flag(hbool_t *dcr_flag) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.dcr_flag_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.dcr_flag = H5CX_def_dxpl_cache.dcr_flag; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get direct chunk read flag */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &(*head)->ctx.dcr_flag) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk read flag") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.dcr_flag_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, dcr_flag) /* Get the value */ *dcr_flag = (*head)->ctx.dcr_flag; @@ -2036,26 +1809,7 @@ H5CX_get_dcr_offset(hsize_t **dcr_offset) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.dcr_offset_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.dcr_offset = H5CX_def_dxpl_cache.dcr_offset; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get direct chunk read offset */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, &(*head)->ctx.dcr_offset) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk read offset") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.dcr_offset_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, dcr_offset) /* Get the value */ *dcr_offset = (*head)->ctx.dcr_offset; @@ -2090,26 +1844,7 @@ H5CX_get_dcw_flag(hbool_t *dcw_flag) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.dcw_flag_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.dcw_flag = H5CX_def_dxpl_cache.dcw_flag; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get direct chunk write flag */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &(*head)->ctx.dcw_flag) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write flag") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.dcw_flag_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, dcw_flag) /* Get the value */ *dcw_flag = (*head)->ctx.dcw_flag; @@ -2144,26 +1879,7 @@ H5CX_get_dcw_filters(uint32_t *dcw_filters) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.dcw_filters_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.dcw_filters = H5CX_def_dxpl_cache.dcw_filters; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get direct chunk write filter mask */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &(*head)->ctx.dcw_filters) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write filters") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.dcw_filters_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, dcw_filters) /* Get the value */ *dcw_filters = (*head)->ctx.dcw_filters; @@ -2198,26 +1914,7 @@ H5CX_get_dcw_offset(hsize_t **dcw_offset) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.dcw_offset_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.dcw_offset = H5CX_def_dxpl_cache.dcw_offset; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get direct chunk write offset */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &(*head)->ctx.dcw_offset) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write offset") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.dcw_offset_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, dcw_offset) /* Get the value */ *dcw_offset = (*head)->ctx.dcw_offset; @@ -2252,26 +1949,7 @@ H5CX_get_dcw_datasize(uint32_t *dcw_datasize) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.dcw_datasize_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.dcw_datasize = H5CX_def_dxpl_cache.dcw_datasize; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get direct chunk write data size */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &(*head)->ctx.dcw_datasize) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write datasize") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.dcw_datasize_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, dcw_datasize) /* Get the value */ *dcw_datasize = (*head)->ctx.dcw_datasize; @@ -2306,26 +1984,7 @@ H5CX_get_dt_conv_cb(H5T_conv_cb_t *dt_conv_cb) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.dt_conv_cb_valid) { - /* Check for default DXPL */ - if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) - (*head)->ctx.dt_conv_cb = H5CX_def_dxpl_cache.dt_conv_cb; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - /* Get value */ - if(H5P_get((*head)->ctx.dxpl, H5D_XFER_CONV_CB_NAME, &(*head)->ctx.dt_conv_cb) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve datatype conversion exception callback") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.dt_conv_cb_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_CONV_CB_NAME, dt_conv_cb) /* Get the value */ *dt_conv_cb = (*head)->ctx.dt_conv_cb; @@ -2360,26 +2019,7 @@ H5CX_get_nlinks(size_t *nlinks) HDassert(head && *head); HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* Check if the value has been retrieved already */ - if(!(*head)->ctx.nlinks_valid) { - /* Check for default LAPL */ - if((*head)->ctx.lapl_id == H5P_LINK_ACCESS_DEFAULT) - (*head)->ctx.nlinks = H5CX_def_lapl_cache.nlinks; - else { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.lapl) - /* Get the link access property list pointer */ - if(NULL == ((*head)->ctx.lapl = (H5P_genplist_t *)H5I_object((*head)->ctx.lapl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default link access property list") - - /* Get value */ - if(H5P_get((*head)->ctx.lapl, H5L_ACS_NLINKS_NAME, &(*head)->ctx.nlinks) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve number of soft / UD links to traverse") - } /* end else */ - - /* Mark the value as valid */ - (*head)->ctx.nlinks_valid = TRUE; - } /* end if */ + H5CX_RETRIEVE_PROP_VALID(lapl, H5P_LINK_ACCESS_DEFAULT, H5L_ACS_NLINKS_NAME, nlinks) /* Get the value */ *nlinks = (*head)->ctx.nlinks; @@ -2857,7 +2497,6 @@ herr_t H5CX_test_set_mpio_coll_chunk_link_hard(int mpio_coll_chunk_link_hard) { H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2867,24 +2506,7 @@ H5CX_test_set_mpio_coll_chunk_link_hard(int mpio_coll_chunk_link_hard) HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); - /* Check if property exists in DXPL */ - if(!(*head)->ctx.mpio_coll_chunk_link_hard_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME)) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") - } /* end if */ - - /* If property was already set or exists (for first set), update it */ - if((*head)->ctx.mpio_coll_chunk_link_hard_set || check_prop > 0) { - /* Cache the value for later, marking it to set in DXPL when context popped */ - (*head)->ctx.mpio_coll_chunk_link_hard = mpio_coll_chunk_link_hard; - (*head)->ctx.mpio_coll_chunk_link_hard_set = TRUE; - } /* end if */ + H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) done: FUNC_LEAVE_NOAPI(ret_value) @@ -2909,7 +2531,6 @@ herr_t H5CX_test_set_mpio_coll_chunk_multi_hard(int mpio_coll_chunk_multi_hard) { H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2919,24 +2540,7 @@ H5CX_test_set_mpio_coll_chunk_multi_hard(int mpio_coll_chunk_multi_hard) HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); - /* Check if property exists in DXPL */ - if(!(*head)->ctx.mpio_coll_chunk_multi_hard_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME)) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") - } /* end if */ - - /* If property was already set or exists (for first set), update it */ - if((*head)->ctx.mpio_coll_chunk_multi_hard_set || check_prop > 0) { - /* Cache the value for later, marking it to set in DXPL when context popped */ - (*head)->ctx.mpio_coll_chunk_multi_hard = mpio_coll_chunk_multi_hard; - (*head)->ctx.mpio_coll_chunk_multi_hard_set = TRUE; - } /* end if */ + H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) done: FUNC_LEAVE_NOAPI(ret_value) @@ -2961,7 +2565,6 @@ herr_t H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_link_num_true) { H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2971,24 +2574,7 @@ H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_link_num_true) HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); - /* Check if property exists in DXPL */ - if(!(*head)->ctx.mpio_coll_chunk_link_num_true_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME)) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") - } /* end if */ - - /* If property was already set or exists (for first set), update it */ - if((*head)->ctx.mpio_coll_chunk_link_num_true_set || check_prop > 0) { - /* Cache the value for later, marking it to set in DXPL when context popped */ - (*head)->ctx.mpio_coll_chunk_link_num_true = mpio_coll_chunk_link_num_true; - (*head)->ctx.mpio_coll_chunk_link_num_true_set = TRUE; - } /* end if */ + H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) done: FUNC_LEAVE_NOAPI(ret_value) @@ -3013,7 +2599,6 @@ herr_t H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false) { H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -3023,24 +2608,7 @@ H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false) HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); - /* Check if property exists in DXPL */ - if(!(*head)->ctx.mpio_coll_chunk_link_num_false_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME)) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") - } /* end if */ - - /* If property was already set or exists (for first set), update it */ - if((*head)->ctx.mpio_coll_chunk_link_num_false_set || check_prop > 0) { - /* Cache the value for later, marking it to set in DXPL when context popped */ - (*head)->ctx.mpio_coll_chunk_link_num_false = mpio_coll_chunk_link_num_false; - (*head)->ctx.mpio_coll_chunk_link_num_false_set = TRUE; - } /* end if */ + H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) done: FUNC_LEAVE_NOAPI(ret_value) @@ -3065,7 +2633,6 @@ herr_t H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_coll) { H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -3075,24 +2642,7 @@ H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_c HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); - /* Check if property exists in DXPL */ - if(!(*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME)) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") - } /* end if */ - - /* If property was already set or exists (for first set), update it */ - if((*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set || check_prop > 0) { - /* Cache the value for later, marking it to set in DXPL when context popped */ - (*head)->ctx.mpio_coll_chunk_multi_ratio_coll = mpio_coll_chunk_multi_ratio_coll; - (*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set = TRUE; - } /* end if */ + H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) done: FUNC_LEAVE_NOAPI(ret_value) @@ -3117,7 +2667,6 @@ herr_t H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_ind) { H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -3127,24 +2676,7 @@ H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_in HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); - /* Check if property exists in DXPL */ - if(!(*head)->ctx.mpio_coll_chunk_multi_ratio_ind_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") - - if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME)) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") - } /* end if */ - - /* If property was already set or exists (for first set), update it */ - if((*head)->ctx.mpio_coll_chunk_multi_ratio_ind_set || check_prop > 0) { - /* Cache the value for later, marking it to set in DXPL when context popped */ - (*head)->ctx.mpio_coll_chunk_multi_ratio_ind = mpio_coll_chunk_multi_ratio_ind; - (*head)->ctx.mpio_coll_chunk_multi_ratio_ind_set = TRUE; - } /* end if */ + H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) done: FUNC_LEAVE_NOAPI(ret_value) @@ -3176,117 +2708,17 @@ H5CX__pop_common(void) HDassert(head && *head); /* Check for cached DXPL properties to return to application */ - if((*head)->ctx.dcr_filters_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") - - /* Set the chunk filter mask property */ - if(H5P_set((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, &(*head)->ctx.dcr_filters) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting filter mask xfer property") - } /* end if */ + H5CX_SET_PROP(H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, dcr_filters) #ifdef H5_HAVE_PARALLEL - if((*head)->ctx.mpio_actual_chunk_opt_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") - - /* Set the actual chunk optimization mode for parallel I/O */ - if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &(*head)->ctx.mpio_actual_chunk_opt) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting actual chunk optimization mode for parallel I/O") - } /* end if */ - if((*head)->ctx.mpio_actual_io_mode_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") - - /* Set the actual chunk optimization mode for parallel I/O */ - if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_ACTUAL_IO_MODE_NAME, &(*head)->ctx.mpio_actual_io_mode) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting actual I/O mode for parallel I/O") - } /* end if */ - if((*head)->ctx.mpio_local_no_coll_cause_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") - - /* Set the local reason for breaking collective I/O */ - if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_local_no_coll_cause) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting local reason for breaking collective I/O") - } /* end if */ - if((*head)->ctx.mpio_global_no_coll_cause_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") - - /* Set the global reason for breaking collective I/O */ - if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_global_no_coll_cause) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting global reason for breaking collective I/O") - } /* end if */ - if((*head)->ctx.mpio_coll_chunk_link_hard_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") - - /* Set the instrumented "collective chunk link hard" value */ - if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &(*head)->ctx.mpio_coll_chunk_link_hard) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk link hard value") - } /* end if */ - if((*head)->ctx.mpio_coll_chunk_multi_hard_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") - - /* Set the instrumented "collective chunk multi hard" value */ - if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &(*head)->ctx.mpio_coll_chunk_multi_hard) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk multi hard value") - } /* end if */ - if((*head)->ctx.mpio_coll_chunk_link_num_true_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") - - /* Set the instrumented "collective chunk multi hard" value */ - if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &(*head)->ctx.mpio_coll_chunk_link_num_true) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk link num true value") - } /* end if */ - if((*head)->ctx.mpio_coll_chunk_link_num_false_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") - - /* Set the instrumented "collective chunk multi hard" value */ - if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &(*head)->ctx.mpio_coll_chunk_link_num_false) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk link num false value") - } /* end if */ - if((*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set) { - /* Check if the property list is already available */ - if(NULL == (*head)->ctx.dxpl) - /* Get the dataset transfer property list pointer */ - if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) - HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") - - /* Set the instrumented "collective chunk multi ratio coll" value */ - if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, &(*head)->ctx.mpio_coll_chunk_multi_ratio_coll) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk multi ratio coll value") - } /* end if */ + H5CX_SET_PROP(H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, mpio_actual_chunk_opt) + H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode) + H5CX_SET_PROP(H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) + H5CX_SET_PROP(H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) #endif /* H5_HAVE_PARALLEL */ /* Pop the top context node from the stack */ -- cgit v0.12 From bdaacfd58b0b0e6082358d14cea7bb1f886c85f8 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 20 Mar 2018 13:39:01 -0500 Subject: Fix for HDFFV-10425 test failure with H5DOwrite_chunk and latest format --- src/H5Dchunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index be3b678..b350006 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -486,7 +486,7 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, /* Set the chunk's filter mask to the new settings */ udata.filter_mask = filters; - if((layout->storage.u.chunk.ops->insert)(&idx_info, &udata, NULL) < 0) + if((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") } /* end if */ -- cgit v0.12 From ea52eabc3d5c3386df80c55e60128ef4c3ee322e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 20 Mar 2018 13:49:30 -0500 Subject: Correct typo for error checking malloc return value. --- src/H5CX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5CX.c b/src/H5CX.c index 7884506..ad84bd9 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -349,7 +349,7 @@ H5CX__init_package(void) #ifndef H5_HAVE_THREADSAFE /* Allocate the context stack head pointer */ - if(NULL = (H5CX_head_g = (H5CX_node_t **)HDmalloc(sizeof(H5CX_node_t *)))) + if(NULL == (H5CX_head_g = (H5CX_node_t **)HDmalloc(sizeof(H5CX_node_t *)))) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTALLOC, FAIL, "can't allocate pointer to head of context stack") *H5CX_head_g = NULL; #endif /* H5_HAVE_THREADSAFE */ -- cgit v0.12 From c135db33656a94bdebb8b8c52275356208e4f3dd Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 20 Mar 2018 13:52:04 -0500 Subject: Update encoded DXPLs to reflect changes in properties. --- 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/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 8 files changed, 0 insertions(+), 0 deletions(-) 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/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 -- cgit v0.12 From c5db36c7df19f27d65b29364596e81f7d5c8434d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 20 Mar 2018 17:30:33 -0500 Subject: Update handling of reporting for breaking collective I/O when the default DXPL is used. --- src/H5CX.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index ad84bd9..0f98a15 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -2436,12 +2436,14 @@ H5CX_set_mpio_local_no_coll_cause(uint32_t mpio_local_no_coll_cause) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || - (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + HDassert((*head)->ctx.dxpl_id != H5P_DEFAULT); - /* Cache the value for later, marking it to set in DXPL when context popped */ - (*head)->ctx.mpio_local_no_coll_cause = mpio_local_no_coll_cause; - (*head)->ctx.mpio_local_no_coll_cause_set = TRUE; + /* If we're using the default DXPL, don't modify it */ + if((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_local_no_coll_cause = mpio_local_no_coll_cause; + (*head)->ctx.mpio_local_no_coll_cause_set = TRUE; + } /* end if */ FUNC_LEAVE_NOAPI_VOID } /* end H5CX_set_mpio_local_no_coll_cause() */ @@ -2468,12 +2470,14 @@ H5CX_set_mpio_global_no_coll_cause(uint32_t mpio_global_no_coll_cause) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || - (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + HDassert((*head)->ctx.dxpl_id != H5P_DEFAULT); - /* Cache the value for later, marking it to set in DXPL when context popped */ - (*head)->ctx.mpio_global_no_coll_cause = mpio_global_no_coll_cause; - (*head)->ctx.mpio_global_no_coll_cause_set = TRUE; + /* If we're using the default DXPL, don't modify it */ + if((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_global_no_coll_cause = mpio_global_no_coll_cause; + (*head)->ctx.mpio_global_no_coll_cause_set = TRUE; + } /* end if */ FUNC_LEAVE_NOAPI_VOID } /* end H5CX_set_mpio_global_no_coll_cause() */ -- cgit v0.12 From 4766d282ff21bf7dad3852696b33869beff12415 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 21 Mar 2018 00:09:16 -0500 Subject: Corrections for parallel I/O & tests. --- src/H5CX.c | 1 + src/H5Dio.c | 9 ++++---- src/H5Dmpio.c | 69 +++++++++++++++++++------------------------------------ testpar/t_cache.c | 6 +++++ testpar/t_dset.c | 48 +++++++++++++++++++------------------- 5 files changed, 58 insertions(+), 75 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index 0f98a15..dd1d74f 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -2723,6 +2723,7 @@ H5CX__pop_common(void) H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) #endif /* H5_HAVE_PARALLEL */ /* Pop the top context node from the stack */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 334f18f..cd6b627 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -57,8 +57,7 @@ static herr_t H5D__typeinfo_init(const H5D_t *dset, hid_t mem_type_id, hbool_t do_write, H5D_type_info_t *type_info); #ifdef H5_HAVE_PARALLEL static herr_t H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, - const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info, - const H5D_chunk_map_t *fm); + const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info); #endif /* H5_HAVE_PARALLEL */ static herr_t H5D__typeinfo_term(const H5D_type_info_t *type_info); @@ -562,7 +561,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Adjust I/O info for any parallel I/O */ - if(H5D__ioinfo_adjust(&io_info, dataset, file_space, mem_space, &type_info, fm) < 0) + if(H5D__ioinfo_adjust(&io_info, dataset, file_space, mem_space, &type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") #endif /*H5_HAVE_PARALLEL*/ @@ -789,7 +788,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Adjust I/O info for any parallel I/O */ - if(H5D__ioinfo_adjust(&io_info, dataset, file_space, mem_space, &type_info, fm) < 0) + if(H5D__ioinfo_adjust(&io_info, dataset, file_space, mem_space, &type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") #endif /*H5_HAVE_PARALLEL*/ @@ -1091,7 +1090,7 @@ done: static herr_t H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, const H5S_t *file_space, const H5S_t *mem_space, - const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm) + const H5D_type_info_t *type_info) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 669da68..eb7aad9 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -37,12 +37,13 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ +#include "H5FDmpi.h" /* MPI-based file drivers */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ #include "H5Sprivate.h" /* Dataspaces */ -#include "H5VMprivate.h" /* Vector */ +#include "H5VMprivate.h" /* Vector */ #ifdef H5_HAVE_PARALLEL @@ -77,13 +78,11 @@ */ /* Macros to represent different IO modes(NONE, Independent or collective)for multiple chunk IO case */ -#define H5D_CHUNK_IO_MODE_IND 0 #define H5D_CHUNK_IO_MODE_COL 1 /* Macros to represent the regularity of the selection for multiple chunk IO case. */ #define H5D_CHUNK_SELECT_REG 1 -#define H5D_CHUNK_SELECT_IRREG 2 -#define H5D_CHUNK_SELECT_NONE 0 + /******************/ /* Local Typedefs */ @@ -225,8 +224,6 @@ static herr_t H5D__sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, H5D_chunk_addr_info_t chunk_addr_info_array[], int many_chunk_opt); static herr_t H5D__obtain_mpio_mode(H5D_io_info_t *io_info, H5D_chunk_map_t *fm, uint8_t assign_io_mode[], haddr_t chunk_addr[]); -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, @@ -280,8 +277,8 @@ 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) { H5FD_mpio_xfer_t io_xfer_mode; /* MPI I/O transfer mode */ - int local_cause = 0; /* Local reason(s) for breaking collective mode */ - int global_cause = 0; /* Global reason(s) for breaking collective mode */ + unsigned local_cause = 0; /* Local reason(s) for breaking collective mode */ + unsigned global_cause = 0; /* Global reason(s) for breaking collective mode */ htri_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -342,7 +339,7 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, /* Form consensus opinion among all processes about whether to perform * collective I/O */ - if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&local_cause, &global_cause, 1, MPI_INT, MPI_BOR, io_info->comm))) + if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&local_cause, &global_cause, 1, MPI_UNSIGNED, MPI_BOR, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) } /* end else */ @@ -525,41 +522,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__mpio_get_min_chunk - * - * Purpose: Routine for obtaining minimum number of chunks to cover - * hyperslab selection selected by all processors. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Muqun Yang - * Monday, Feb. 13th, 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D__mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, - int *min_chunkf) -{ - int num_chunkf; /* Number of chunks to iterate over */ - int mpi_code; /* MPI return code */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_STATIC - - /* Get the number of chunks to perform I/O on */ - 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))) - HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__mpio_get_min_chunk() */ - - -/*------------------------------------------------------------------------- * Function: H5D__mpio_get_sum_chunk * * Purpose: Routine for obtaining total number of chunks to cover @@ -3070,19 +3032,34 @@ 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) { + H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request */ + chunk_entry->chunk_states.new_chunk.length = chunk_entry->chunk_states.chunk_current.length; /* 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 */ + + /* Get the original state of parallel I/O transfer mode */ + if(H5CX_get_io_xfer_mode(&xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + + /* Change the xfer_mode to independent for handling the I/O */ + if(H5CX_set_io_xfer_mode(H5FD_MPIO_INDEPENDENT) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") + 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, chunk_entry->buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to read raw data chunk") + + /* Return to the original I/O transfer mode setting */ + if(H5CX_set_io_xfer_mode(xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") if(H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, err_detect, filter_cb, (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") + HGOTO_ERROR(H5E_DATASET, H5E_CANTFILTER, FAIL, "couldn't unfilter chunk for modifying") } /* end if */ else { chunk_entry->chunk_states.new_chunk.length = true_chunk_size; diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 63b6ac7..caa578e 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -4075,6 +4075,9 @@ setup_cache_for_test(hid_t * fid_ptr, fid = H5Fcreate(filenames[0], H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + /* Push API context */ + H5CX_push(); + if ( fid < 0 ) { nerrors++; if ( verbose ) { @@ -4556,6 +4559,9 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr) } + /* Pop API context */ + H5CX_pop(); + if ( success ) { if ( world_mpi_rank == world_server_mpi_rank ) { diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 65d1bb4..b315772 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -679,8 +679,8 @@ dataset_writeAll(void) 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 = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } @@ -748,8 +748,8 @@ dataset_writeAll(void) 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"); + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } @@ -819,8 +819,8 @@ dataset_writeAll(void) 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"); + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } @@ -884,8 +884,8 @@ dataset_writeAll(void) 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"); + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } /* write data collectively */ @@ -1184,8 +1184,8 @@ dataset_readAll(void) 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"); + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } @@ -1252,8 +1252,8 @@ dataset_readAll(void) 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"); + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } @@ -1335,8 +1335,8 @@ dataset_readAll(void) 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"); + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } /* read data collectively */ @@ -2200,8 +2200,8 @@ extend_writeAll(void) 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 = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } @@ -2240,8 +2240,8 @@ extend_writeAll(void) 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 = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } @@ -2414,8 +2414,8 @@ extend_readAll(void) 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 = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } @@ -2461,8 +2461,8 @@ extend_readAll(void) 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 = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } @@ -2634,8 +2634,8 @@ compress_readAll(void) 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 = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); } -- cgit v0.12 From aa9e1aeea18a0eff050feac19596be6cad9a7c65 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 21 Mar 2018 11:44:24 -0500 Subject: Add test and release info for the fix to HDFFV-10425 test failure with H5DOwrite_chunk. --- hl/test/test_dset_opt.c | 143 +++++++++++++++++++++++++++++++++++++++++++++++ release_docs/RELEASE.txt | 16 ++++++ 2 files changed, 159 insertions(+) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index 383a87a..fe2b2f3 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -62,6 +62,14 @@ #define OVERWRITE_CHUNK_NY 2 #define OVERWRITE_VALUE 42 +/* Defines used in test_single_chunk_latest() */ +#define FILE "single_latest.h5" +#define DATASET "dataset" +#define DIM0 4 +#define DIM1 32 +#define CHUNK0 DIM0 +#define CHUNK1 DIM1 + /* 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); @@ -1969,6 +1977,139 @@ error: } /* test_read_unallocated_chunk() */ /*------------------------------------------------------------------------- + * Function: test_single_chunk_latest + * + * Purpose: This is to verify the fix for jira issue HDFFV-10425. + * The problem was due to a bug in the internal ilbrary routine + * H5D__chunk_direct_write() which passed a null dataset + * pointer to the insert callback for the chunk index type. + * Currently, the single chunk index is the only one that + * used the dataset pointer in the insert callback. + * + * This routine is based on the test program attached to + * this jira issue: + * Create a file with the latest format and a chunked dataset + * with one single chunk. The library will use single chunk + * index for the dataset. + * Verify that the data read is the same as the written data. + * + * Return: Success: 0 + * Failure: 1 + * + *------------------------------------------------------------------------- + */ +static int +test_single_chunk_latest(void) +{ + hid_t fid; /* File ID */ + hid_t fapl; /* File access property list ID */ + hid_t sid; /* Dataspace ID */ + hid_t did; /* Dataset ID */ + hid_t dcpl; /* Dataset creation property list */ + hsize_t dims[2] = {DIM0, DIM1}; /* Dimension sizes */ + hsize_t chunk[2] = {CHUNK0, CHUNK1}; /* Chunk dimension sizes */ + hsize_t offset[2] = {0,0}; /* Offset for writing */ + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int i, j; /* Local index variable */ + + TESTING("H5DOwrite_chunk with single chunk and latest format"); + + /* Initialize data */ + for (i=0; i Date: Wed, 21 Mar 2018 14:12:14 -0500 Subject: Add API context source files to CMake configuration file. --- src/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c506ebb..60e2600 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -113,6 +113,14 @@ set (H5CS_HDRS IDE_GENERATED_PROPERTIES ("H5CS" "${H5CS_HDRS}" "${H5CS_SOURCES}" ) +set (H5CX_SOURCES + ${HDF5_SRC_DIR}/H5CX.c +) +set (H5CX_HDRS +) +IDE_GENERATED_PROPERTIES ("H5CX" "${H5CX_HDRS}" "${H5CX_SOURCES}" ) + + set (H5D_SOURCES ${HDF5_SRC_DIR}/H5D.c ${HDF5_SRC_DIR}/H5Dbtree.c @@ -694,6 +702,7 @@ set (common_SRCS ${H5B2_SOURCES} ${H5C_SOURCES} ${H5CS_SOURCES} + ${H5CX_SOURCES} ${H5D_SOURCES} ${H5E_SOURCES} ${H5EA_SOURCES} @@ -773,6 +782,7 @@ set (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5Bprivate.h ${HDF5_SRC_DIR}/H5Cprivate.h ${HDF5_SRC_DIR}/H5CSprivate.h + ${HDF5_SRC_DIR}/H5CXprivate.h ${HDF5_SRC_DIR}/H5Dprivate.h ${HDF5_SRC_DIR}/H5Eprivate.h ${HDF5_SRC_DIR}/H5EAprivate.h @@ -844,7 +854,7 @@ if (HDF5_GENERATE_HEADERS) endif () #----------------------------------------------------------------------------- -# Setup the H5Detect utility which generates H5Tinit with platform +# Setup the H5detect utility which generates H5Tinit with platform # specific type checks inside #----------------------------------------------------------------------------- add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) @@ -881,7 +891,7 @@ add_custom_command ( ) #----------------------------------------------------------------------------- -# Add H5Tinit source to build - generated by H5Detect/CMake at configure time +# Add H5Tinit source to build - generated by H5detect/CMake at configure time #----------------------------------------------------------------------------- set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) -- cgit v0.12 From 1aaed1ba3af8eeeeaddb0da2bfea843bab981deb Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 21 Mar 2018 14:12:30 -0500 Subject: Couple fixes to the test routine for HDFFV-10425. --- hl/test/test_dset_opt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index fe2b2f3..ef4cf13 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -2040,7 +2040,7 @@ test_single_chunk_latest(void) goto error; /* Create the dataset */ - if((did = H5Dcreate(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write the data directly to the dataset */ @@ -2064,7 +2064,7 @@ test_single_chunk_latest(void) /* Open the file and dataset with default properties */ if((fid = H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) goto error; - if((did = H5Dopen(fid, DATASET, H5P_DEFAULT)) < 0) + if((did = H5Dopen2(fid, DATASET, H5P_DEFAULT)) < 0) goto error; /* Retrieve dataset creation property list */ -- cgit v0.12 From 60eafb9f6c1cab6ce4349dc9ada5e42a1a546e00 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 22 Mar 2018 13:06:41 -0500 Subject: Correct VS version for readme --- config/cmake_ext_mod/HDFMacros.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index bdc52b9..850001d 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -291,9 +291,10 @@ macro (HDF_README_PROPERTIES target_fortran) 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") + if (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.0.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") + else () + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017") else () set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") endif () -- cgit v0.12 From ef3e20d9880c7daf0d2ec68d261b94a6a6dbb642 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 22 Mar 2018 13:08:04 -0500 Subject: Correct if block typo --- config/cmake_ext_mod/HDFMacros.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 850001d..04d60e1 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -295,6 +295,7 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") else () set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017") + endif () else () set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") endif () -- cgit v0.12 From dae5e63cfbd57bff60f1ead8c4ac67d975f5bad1 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 23 Mar 2018 12:43:57 -0500 Subject: Revert some tangential code cleanups. --- fortran/src/H5Lf.c | 166 +++++++++++++++++++++++++ fortran/src/H5Lff.F90 | 286 +++++++++++++++++++++++++++++++++++++++++++ java/src/hdf/hdf5lib/H5.java | 16 +++ src/Makefile.am | 2 +- 4 files changed, 469 insertions(+), 1 deletion(-) diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index 4776e77..31fedfd 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -746,6 +746,172 @@ done: } +/* /\****if* H5Lf/h5lget_val_c */ +/* * NAME */ +/* * h5lget_val_c */ +/* * PURPOSE */ +/* * Call H5Lget_val */ +/* * INPUTS */ +/* * */ +/* * link_loc_id - File or group identifier. */ +/* * link_name - Name of the link for which valrmation is being sought */ +/* * link_namelen - Name length */ +/* * size - Maximum number of characters of link value to be returned. */ +/* * lapl_id - Link access property list */ +/* * OUTPUTS */ +/* * */ +/* * linkval_buff - The buffer to hold the returned link value. */ +/* * */ +/* * RETURNS */ +/* * 0 on success, -1 on failure */ +/* * AUTHOR */ +/* * M. Scot Breitenfeld */ +/* * March 3, 2008 */ +/* * HISTORY */ +/* * N/A */ +/* * SOURCE */ +/* *\/ */ +/* int_f */ +/* h5lget_val_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, */ +/* size_t_f *size, _fcd linkval_buff, */ +/* hid_t_f *lapl_id) */ +/* { */ +/* char *c_link_name = NULL; /\* Buffer to hold C string *\/ */ +/* int_f ret_value = 0; /\* Return value *\/ */ +/* void *c_linkval_buff = NULL; */ + +/* /\* */ +/* * Convert FORTRAN name to C name */ +/* *\/ */ +/* if((c_link_name = HD5f2cstring(link_name, (size_t)*link_namelen)) == NULL) */ +/* HGOTO_DONE(FAIL); */ +/* /\* */ +/* * Call H5Lval function. */ +/* *\/ */ +/* if(H5Lget_val((hid_t)*link_loc_id, c_link_name, &linkval_buff, (size_t)*size, (hid_t)*lapl_id) < 0) */ +/* HGOTO_DONE(FAIL); */ +/* /\* */ +/* * Convert C name to FORTRAN */ +/* *\/ */ +/* HD5packFstring(c_buf, _fcdtocp(buf), c_bufsize-1); */ + + +/* done: */ +/* return ret_value; */ +/* } */ + + +/* /\****if* H5Lf/ */ +/* * NAME */ +/* * H5Lregistered_c */ +/* * PURPOSE */ +/* * Call H5Lregistered */ +/* * INPUTS */ +/* * */ +/* * */ +/* * INPUTS */ +/* * */ +/* * version - Version number of this struct */ +/* * class_id - Link class identifier */ +/* * comment - Comment for debugging */ +/* * comment_len - Comment for debugging */ +/* * create_func - Callback during link creation */ +/* * create_func_len - length */ +/* * move_func - Callback after moving link */ +/* * move_func_len - length */ +/* * copy_func - Callback after copying link */ +/* * copy_func_len - length */ +/* * trav_func - The main traversal function */ +/* * trav_func_len - length */ +/* * del_func - Callback for link deletion */ +/* * del_func_len - length */ +/* * query_func - Callback for queries */ +/* * query_func_len - length */ +/* * */ +/* * RETURNS */ +/* * 0 on success, -1 on failure */ +/* * AUTHOR */ +/* * M. Scot Breitenfeld */ +/* * February 3, 2008 */ +/* * HISTORY */ +/* * */ +/* * SOURCE */ +/* *\/ */ + +/* int_f */ + +/* h5lregistered_c(int_f *version, int_f *class_id, */ +/* _fcd comment, size_t_f *comment_len, */ +/* _fcd create_func, size_t_f *create_func_len, */ +/* _fcd move_func, size_t_f *move_func_len, */ +/* _fcd copy_func, size_t_f *copy_func_len, */ +/* _fcd trav_func, size_t_f *trav_func_len, */ +/* _fcd del_func , size_t_f *del_func_len, */ +/* _fcd query_func, size_t_f *query_func_len) */ +/* { */ +/* char *c_comment = NULL; */ +/* char *c_create_func = NULL; */ +/* char *c_move_func = NULL; */ +/* char *c_copy_func = NULL; */ +/* char *c_trav_func = NULL; */ +/* char *c_del_func = NULL; */ +/* char *c_query_func = NULL; */ + +/* H5L_class_t class_t; */ + +/* int_f ret_value = 0; */ + +/* /\* */ +/* * Convert FORTRAN name to C name */ +/* *\/ */ +/* if((c_comment = HD5f2cstring(c_comment, (size_t)*sc_comment_len)) == NULL) */ +/* HGOTO_DONE(FAIL); */ +/* if((c_create_func = HD5f2cstring(c_create_func, (size_t)*c_create_func_len)) == NULL) */ +/* HGOTO_DONE(FAIL); */ +/* if((c_move_func = HD5f2cstring(c_move_func, (size_t)*sc_move_func_len)) == NULL) */ +/* HGOTO_DONE(FAIL); */ +/* if((c_copy_func = HD5f2cstring(c_copy_func, (size_t)*c_copy_func_len)) == NULL) */ +/* HGOTO_DONE(FAIL); */ +/* if((c_trav_func = HD5f2cstring(c_trav_func, (size_t)*sc_trav_func_len)) == NULL) */ +/* HGOTO_DONE(FAIL); */ +/* if((c_del_func = HD5f2cstring(c_del_func, (size_t)*c_del_func_len)) == NULL) */ +/* HGOTO_DONE(FAIL); */ +/* if((c_query_func = HD5f2cstring(c_query_func, (size_t)*c_query_func_len)) == NULL) */ +/* HGOTO_DONE(FAIL); */ +/* /\* */ +/* * Pack into C struct H5L_class_t */ +/* *\/ */ +/* int version; /\* Version number of this struct *\/ */ +/* H5L_type_t class_id; /\* Link class identifier *\/ */ +/* const char *comment; /\* Comment for debugging *\/ */ +/* H5L_create_func_t create_func; /\* Callback during link creation *\/ */ +/* H5L_move_func_t move_func; /\* Callback after moving link *\/ */ +/* H5L_copy_func_t copy_func; /\* Callback after copying link *\/ */ +/* H5L_traverse_func_t trav_func; /\* The main traversal function *\/ */ +/* H5L_delete_func_t del_func; /\* Callback for link deletion *\/ */ +/* H5L_query_func_t query_func; /\* Callback for queries *\/ */ + +/* class_t.version = (int)*version; */ +/* class_t.class_id = (H5L_type_t)*class_id; */ +/* class_t.comment = c_comment; */ +/* class_t. */ + +/* /\* */ +/* * Call H5Lcopy function. */ +/* *\/ */ +/* if( H5Lcopy( (hid_t)*src_loc_id, c_src_name, (hid_t) *dest_loc_id, */ +/* c_dest_name, (hid_t)*lcpl_id, (hid_t)*lapl_id ) < 0) */ +/* HGOTO_DONE(FAIL); */ + +/* done: */ +/* if(c_src_name) */ +/* HDfree(c_src_name); */ +/* if(c_dest_name) */ +/* HDfree(c_dest_name); */ + +/* return ret_value; */ +/* } */ + /****if* H5Lf/h5lget_val_c * NAME * h5lget_val_c diff --git a/fortran/src/H5Lff.F90 b/fortran/src/H5Lff.F90 index 9775a7d..d5bb1d1 100644 --- a/fortran/src/H5Lff.F90 +++ b/fortran/src/H5Lff.F90 @@ -1020,6 +1020,292 @@ CONTAINS END SUBROUTINE h5lget_name_by_idx_f +! HAS PROBLEM WITH void pointer in C +!!$! +!!$!****s* H5L/ +!!$! +!!$! NAME +!!$! h5lget_val_by_idx_f +!!$! +!!$! PURPOSE +!!$! Returns the link value of a link, according to the order of +!!$! an index. For symbolic links, this is the path to which the +!!$! link points, including the null terminator. For user-defined +!!$! links, it is the link buffer. +!!$! INPUTS +!!$! loc_id - File or group identifier specifying location of subject group +!!$! group_name - Name of subject group +!!$! index_field - Index or field which determines the order +!!$! order - Order within field or index +!!$! n - Link for which to retrieve information +!!$! size - Maximum number of characters of link value to be returned. +!!$! +!!$! OUTPUTS NOTE: In C these are defined as a structure: H5L_info_t +!!$! corder_valid - indicates whether the creation order data is valid for this attribute +!!$! corder - is a positive integer containing the creation order of the attribute +!!$! cset - indicates the character set used for the attribute’s name +!!$! data_size - indicates the size, in the number of characters, of the attribute +!!$! hdferr - error code +!!$! Success: 0 +!!$! Failure: -1 +!!$! OPTIONAL PARAMETERS +!!$! lapl_id - List access property list identifier. +!!$! +!!$! AUTHOR +!!$! M. Scot Breitenfeld +!!$! March 3, 2008 +!!$! +!!$! HISTORY N/A +!!$! +!!$! +!!$! SOURCE +!!$ SUBROUTINE h5lget_val_by_idx_f(loc_id, group_name, index_field, order, n, & +!!$ f_corder_valid, corder, cset, data_size, hdferr, lapl_id) +!!$ IMPLICIT NONE +!!$ INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group +!!$ CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group +!!$ INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order +!!$ ! H5_INDEX_UNKNOWN_F - Unknown index type +!!$ ! H5_INDEX_NAME_F - Index on names +!!$ ! H5_INDEX_CRT_ORDER_F - Index on creation order +!!$ ! H5_INDEX_N_F - Number of indices defined +!!$ INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: +!!$ ! H5_ITER_UNKNOWN_F - Unknown order +!!$ ! H5_ITER_INC_F - Increasing order +!!$ ! H5_ITER_DEC_F - Decreasing order +!!$ ! H5_ITER_NATIVE_F - No particular order, whatever is fastest +!!$ INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index +!!$ LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute +!!$ INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute +!!$ INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name +!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute +!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: +!!$ ! 0 on success and -1 on failure +!!$ INTEGER :: corder_valid +!!$ INTEGER(SIZE_T) :: group_namelen +!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!!$ INTEGER(HID_T) :: lapl_id_default +!!$ +!!$ INTERFACE +!!$ INTEGER FUNCTION h5lget_val_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & +!!$ corder_valid, corder, cset, data_size, lapl_id_default) +!!$ USE H5GLOBAL +!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) +!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_BY_IDX_C'::h5lget_val_by_idx_c +!!$ !DEC$ENDIF +!!$ INTEGER(HID_T), INTENT(IN) :: loc_id +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name +!!$ INTEGER(SIZE_T) :: group_namelen +!!$ INTEGER, INTENT(IN) :: index_field +!!$ INTEGER, INTENT(IN) :: order +!!$ INTEGER(HSIZE_T), INTENT(IN) :: n +!!$ INTEGER :: corder_valid +!!$ INTEGER, INTENT(OUT) :: corder +!!$ INTEGER, INTENT(OUT) :: cset +!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size +!!$ INTEGER(HID_T) :: lapl_id_default +!!$ END FUNCTION h5lget_val_by_idx_c +!!$ END INTERFACE +!!$ +!!$ group_namelen = LEN(group_name) +!!$ +!!$ lapl_id_default = H5P_DEFAULT_F +!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id +!!$ +!!$ hdferr = h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & +!!$ corder_valid, corder, cset, data_size, lapl_id_default) +!!$ +!!$ f_corder_valid =.FALSE. +!!$ IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. +!!$ +!!$ END SUBROUTINE h5lget_val_by_idx_f + +!!$! +!!$!****s* H5L/h5lget_val_f +!!$! +!!$! NAME +!!$! h5lget_val_f +!!$! +!!$! PURPOSE +!!$! Returns the value of a symbolic link. +!!$! +!!$! INPUTS +!!$! link_loc_id - File or group identifier. +!!$! link_name - Link whose value is to be returned. +!!$! size - Maximum number of characters of link value to be returned. +!!$! +!!$! OUTPUTS +!!$! linkval_buff - The buffer to hold the returned link value. +!!$! hdferr - error code +!!$! Success: 0 +!!$! Failure: -1 +!!$! OPTIONAL PARAMETERS +!!$! lapl_id - List access property list identifier. +!!$! +!!$! AUTHOR +!!$! M. Scot Breitenfeld +!!$! March 3, 2008 +!!$! SOURCE +!!$ SUBROUTINE h5lget_val_f(link_loc_id, link_name, size, linkval_buff, & +!!$ hdferr, lapl_id) +!!$ IMPLICIT NONE +!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. +!!$ CHARACTER(LEN=*), INTENT(IN) :: link_name ! Link whose value is to be returned. +!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. +!!$ +!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. +!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: +!!$ ! 0 on success and -1 on failure +!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!!$ +!!$ INTEGER :: link_namelen +!!$ INTEGER(HID_T) :: lapl_id_default +!!$ INTEGER :: corder_valid +!!$ +!!$ INTEGER :: link_namelen +!!$ INTEGER(HID_T) :: lapl_id_default +!!$ +!!$! MS FORTRAN needs explicit interface for C functions called here. +!!$! +!!$ INTERFACE +!!$ INTEGER FUNCTION h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & +!!$ lapl_id_default) +!!$ USE H5GLOBAL +!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) +!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_C'::h5lget_val_c +!!$ !DEC$ENDIF +!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: link_name ! Link whose value is to be returned. +!!$ INTEGER :: link_namelen +!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. +!!$ +!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. +!!$ +!!$ INTEGER :: link_namelen +!!$ INTEGER(HID_T) :: lapl_id_default +!!$ +!!$ END FUNCTION h5lget_val_c +!!$ END INTERFACE +!!$ +!!$ link_namelen = LEN(link_name) +!!$ +!!$ lapl_id_default = H5P_DEFAULT_F +!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id +!!$ +!!$ hdferr = h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & +!!$ lapl_id_default) +!!$ +!!$ END SUBROUTINE h5lget_val_f + +!!$! +!!$!****s* H5L/H5Lregistered_f +!!$! +!!$! NAME +!!$! H5Lregistered_f +!!$! +!!$! PURPOSE +!!$! Registers user-defined link class or changes behavior of existing class. +!!$! +!!$! INPUTS NOTE: In C the following represents struct H5L_class_t: +!!$! version - Version number of this struct +!!$! class_id - Link class identifier +!!$! comment - Comment for debugging +!!$! create_func - Callback during link creation +!!$! move_func - Callback after moving link +!!$! copy_func - Callback after copying link +!!$! trav_func - The main traversal function +!!$! del_func - Callback for link deletion +!!$! query_func - Callback for queries +!!$! +!!$! OUTPUTS +!!$! hdferr - Error code +!!$! Success: 0 +!!$! Failure: -1 +!!$! OPTIONAL PARAMETERS +!!$! None +!!$! +!!$! AUTHOR +!!$! M. Scot Breitenfeld +!!$! February 29, 2008 +!!$! +!!$! HISTORY N/A +!!$! +!!$! +!!$! SOURCE +!!$ SUBROUTINE H5Lregistered_f(version, class_id, comment, create_func, & +!!$ move_func, copy_func, trav_func, del_func, query_func, hdferr) +!!$ IMPLICIT NONE +!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct +!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier +!!$ CHARACTER(LEN=*), INTENT(IN) :: comment ! Comment for debugging +!!$ CHARACTER(LEN=*), INTENT(IN) :: create_func ! Callback during link creation +!!$ CHARACTER(LEN=*), INTENT(IN) :: move_func ! Callback after moving link +!!$ CHARACTER(LEN=*), INTENT(IN) :: copy_func ! Callback after copying link +!!$ CHARACTER(LEN=*), INTENT(IN) :: trav_func ! The main traversal function +!!$ CHARACTER(LEN=*), INTENT(IN) :: del_func ! Callback for link deletion +!!$ CHARACTER(LEN=*), INTENT(IN) :: query_func ! Callback for queries +!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: +!!$ ! 0 on success and -1 on failure +!!$ INTEGER :: comment_len +!!$ INTEGER :: create_func_len +!!$ INTEGER :: move_func_len +!!$ INTEGER :: copy_func_len +!!$ INTEGER :: trav_func_len +!!$ INTEGER :: del_func_len +!!$ INTEGER :: query_func_len +!!$ +!!$ INTERFACE +!!$ INTEGER FUNCTION H5Lregistered_c(version, class_id, comment, & +!!$ create_func, create_func_len, & +!!$ move_func, move_func_len, & +!!$ copy_func, copy_func_len, & +!!$ trav_func, trav_func_len, & +!!$ del_func, del_func_len, & +!!$ query_func,query_func_len) +!!$ USE H5GLOBAL +!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) +!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LREGISTERED_C'::H5Lregistered_c +!!$ !DEC$ENDIF +!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct +!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: comment ! Comment for debugging +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: create_func ! Callback during link creation +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: move_func ! Callback after moving link +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: copy_func ! Callback after copying link +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: trav_func ! The main traversal function +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: del_func ! Callback for link deletion +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: query_func ! Callback for queries +!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: +!!$ ! 0 on success and -1 on failure +!!$ INTEGER :: comment_len +!!$ INTEGER :: create_func_len +!!$ INTEGER :: move_func_len +!!$ INTEGER :: copy_func_len +!!$ INTEGER :: trav_func_len +!!$ INTEGER :: del_func_len +!!$ INTEGER :: query_func_len +!!$ +!!$ END FUNCTION H5Lregistered_c +!!$ END INTERFACE +!!$ +!!$ comment_len = LEN(comment) +!!$ create_func_len = LEN(create_func) +!!$ move_func_len = LEN(move_func) +!!$ copy_func_len = LEN(copy_func) +!!$ trav_func_len = LEN(trav_func) +!!$ del_func_len = LEN(del_func) +!!$ query_func_len = LEN(query_func) +!!$ +!!$ hdferr = H5Lregistered_c(version, class_id, comment, & +!!$ create_func, create_func_len, & +!!$ move_func, move_func_len, & +!!$ copy_func, copy_func_len, & +!!$ trav_func, trav_func_len, & +!!$ del_func, del_func_len, & +!!$ query_func, query_func_len) +!!$ +!!$ END SUBROUTINE H5Lregistered_f + !****s* H5L (F03)/h5literate_f ! ! NAME diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 58a5703..9d1aed1 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -4018,6 +4018,22 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Lunregister(int link_cls_id) throws HDF5LibraryException; + // /////// unimplemented //////// + // herr_t H5Lcreate_ud(hid_t link_loc_id, const char *link_name, + // H5L_type_t link_type, const void *udata, size_t udata_size, hid_t lcpl_id, + // hid_t lapl_id); + + // herr_t H5Lregister(const H5L_class_t *cls); + + // herr_t H5Lunpack_elink_val(const void *ext_linkval/*in*/, size_t link_size, + // unsigned *flags, const char **filename/*out*/, const char **obj_path /*out*/); + // herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, + // size_t size, hid_t lapl_id); + // herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name, + // H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + // void *buf/*out*/, size_t size, hid_t lapl_id); + + // //////////////////////////////////////////////////////////// // // // H5O: HDF5 1.8 Object Interface API Functions // diff --git a/src/Makefile.am b/src/Makefile.am index 79423f9..21f3966 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -99,7 +99,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ H5PB.c \ H5PL.c H5PLint.c H5PLpath.c H5PLplugin_cache.c \ - H5R.c H5Rdeprec.c H5Rint.c \ + H5R.c H5Rint.c H5Rdeprec.c \ H5UC.c \ H5RS.c \ H5S.c H5Sall.c H5Sdbg.c H5Shyper.c H5Snone.c H5Spoint.c \ -- cgit v0.12 From 539b6d4456fbe8c53a4cf97e03fd68b8938db956 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 26 Mar 2018 11:08:41 -0500 Subject: Update unimplemented lists --- java/src/hdf/hdf5lib/H5.java | 158 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 141 insertions(+), 17 deletions(-) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 9d1aed1..62cfb6d 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -1276,6 +1276,38 @@ public class H5 implements java.io.Serializable { // //////////////////////////////////////////////////////////// // // + // H5AC: Cache Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // + // H5B: B-link-tree Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // + // H5B2: v2 B-tree Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // + // H5C: Cache Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // // H5D: Datasets Interface Functions // // // // //////////////////////////////////////////////////////////// @@ -2109,6 +2141,10 @@ public class H5 implements java.io.Serializable { // /////// unimplemented //////// // H5_DLL herr_t H5Ddebug(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 herr_t H5Dformat_convert(hid_t dset_id); + // H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type); + // herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, // size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data); // herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id, void *dst_buf); @@ -2912,12 +2948,22 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Fget_mdc_logging_status(long file_id, boolean[] mdc_logging_status) throws HDF5LibraryException, NullPointerException; - - // /////// unimplemented //////// + // H5_DLL herr_t H5Fget_eoa(hid_t file_id, haddr_t *eoa); + // H5_DLL herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment); // ssize_t H5Fget_file_image(hid_t file_id, void * buf_ptr, size_t buf_len); // herr_t H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info); // 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 H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high); + // H5_DLL herr_t H5Fformat_convert(hid_t fid); + // H5_DLL herr_t H5Freset_page_buffering_stats(hid_t file_id); + // H5_DLL herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], + // unsigned hits[2], unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]); + // H5_DLL herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_size); + // #ifdef H5_HAVE_PARALLEL + // H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag); + // H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag); + // #endif /* H5_HAVE_PARALLEL */ // /** // * H5Fget_vfd_handle returns a pointer to the file handle from the @@ -2971,6 +3017,41 @@ public class H5 implements java.io.Serializable { // //////////////////////////////////////////////////////////// // // + // H5FD: File Driver Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // /////// unimplemented //////// + // H5_DLL hid_t H5FDregister(const H5FD_class_t *cls); + // H5_DLL herr_t H5FDunregister(hid_t driver_id); + // H5_DLL H5FD_t *H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); + // H5_DLL herr_t H5FDclose(H5FD_t *file); + // H5_DLL int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2); + // H5_DLL int H5FDquery(const H5FD_t *f, unsigned long *flags); + // H5_DLL haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); + // H5_DLL herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); + // H5_DLL haddr_t H5FDget_eoa(H5FD_t *file, H5FD_mem_t type); + // H5_DLL herr_t H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t eoa); + // H5_DLL haddr_t H5FDget_eof(H5FD_t *file, H5FD_mem_t type); + // H5_DLL herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void**file_handle); + // H5_DLL herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/); + // H5_DLL herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf); + // H5_DLL herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing); + // 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); + // H5_DLL herr_t H5FDdriver_query(hid_t driver_id, unsigned long *flags/*out*/); + + // //////////////////////////////////////////////////////////// + // // + // H5FS: File Free Space Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // // H5G: Group Interface Functions // // // // //////////////////////////////////////////////////////////// @@ -3408,6 +3489,30 @@ public class H5 implements java.io.Serializable { // //////////////////////////////////////////////////////////// // // + // H5HF: Fractal Heap Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // + // H5HG: Global Heap Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // + // H5HL: Local Heap Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // // H5I: HDF5 1.8 Identifier Interface API Functions // // // // //////////////////////////////////////////////////////////// @@ -4033,6 +4138,15 @@ public class H5 implements java.io.Serializable { // H5_index_t idx_type, H5_iter_order_t order, hsize_t n, // void *buf/*out*/, size_t size, hid_t lapl_id); + // //////////////////////////////////////////////////////////// + // // + // H5MM: Memory Management Interface API Functions // + // // + // //////////////////////////////////////////////////////////// + + // /////// unimplemented //////// + // typedef void *(*H5MM_allocate_t)(size_t size, void *alloc_info); + // typedef void (*H5MM_free_t)(void *mem, void *free_info); // //////////////////////////////////////////////////////////// // // @@ -4450,6 +4564,9 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException; // /////// unimplemented //////// + // H5_DLL herr_t H5Odisable_mdc_flushes(hid_t object_id); + // H5_DLL herr_t H5Oenable_mdc_flushes(hid_t object_id); + // H5_DLL herr_t H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled); // //////////////////////////////////////////////////////////// // // @@ -7273,9 +7390,15 @@ public class H5 implements java.io.Serializable { // herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size); // herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size); + // #ifdef H5_HAVE_PARALLEL // herr_t H5Pset_all_coll_metadata_ops(hid_t accpl_id, hbool_t is_collective); + // H5_DLL herr_t H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective); // herr_t H5Pset_coll_metadata_write(hid_t fapl_id, hbool_t is_collective); // herr_t H5Pget_coll_metadata_write(hid_t fapl_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*/); + // H5_DLL herr_t H5Pset_page_buffer_size(hid_t plist_id, size_t buf_size, unsigned min_meta_per, unsigned min_raw_per); // herr_t H5Pget_page_buffer_size(hid_t fapl_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc); // herr_t H5Pset_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t func, void *user_data); // herr_t H5Pget_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t *func, void **user_data); @@ -7297,6 +7420,11 @@ public class H5 implements java.io.Serializable { // *free_info ) // herr_t H5Pget_type_conv_cb(hid_t plist, H5T_conv_except_func_t *func, void **op_data) // herr_t H5Pset_type_conv_cb( hid_t plist, H5T_conv_except_func_t func, void *op_data) + // #ifdef H5_HAVE_PARALLEL + // H5_DLL herr_t H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode); + // H5_DLL herr_t H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode); + // H5_DLL herr_t H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause, uint32_t *global_no_collective_cause); + // #endif /* H5_HAVE_PARALLEL */ // Link creation property list (LCPL) routines // @@ -7314,21 +7442,6 @@ public class H5 implements java.io.Serializable { // herr_t H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data); // herr_t H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, void *op_data); - - // Other/Older property list routines // - // herr_t H5Pget_fapl_mpio( int fapl_id, MPI_Comm *comm, MPI_Info *info ) - // herr_t H5Pset_fapl_mpio( int fapl_id, MPI_Comm comm, MPI_Info info ) - - // herr_t H5Pget_fapl_mpiposix( int fapl_id, MPI_Comm *comm, hbool_t *use_gpfs_hints ) - // herr_t H5Pset_fapl_mpiposix( int fapl_id, MPI_Comm comm, hbool_t use_gpfs_hints ) - - // herr_t H5Pget_dxpl_mpio( hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode ) - // herr_t H5Pset_dxpl_mpio( hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode ) - // herr_t H5Pset_dxpl_mpio_chunk_opt (hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode) - // herr_t H5Pset_dxpl_mpio_chunk_opt_num (hid_t dxpl_id, unsigned num_chunk_per_proc) - // herr_t H5Pset_dxpl_mpio_chunk_opt_ratio (hid_t dxpl_id, unsigned percent_proc_per_chunk) - // herr_t H5Pset_dxpl_mpio_collective_opt (hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mode) - // //////////////////////////////////////////////////////////// // // // H5PL: HDF5 1.8 Plugin API Functions // @@ -8252,6 +8365,17 @@ public class H5 implements java.io.Serializable { public synchronized static native boolean H5Sis_regular_hyperslab(long space_id) throws HDF5LibraryException; // /////// unimplemented //////// + // #ifdef NEW_HYPERSLAB_API + // H5_DLL hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, + // const hsize_t start[], + // const hsize_t _stride[], + // const hsize_t count[], + // const hsize_t _block[]); + // H5_DLL herr_t H5Sselect_select(hid_t space1_id, H5S_seloper_t op, + // hid_t space2_id); + // H5_DLL hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op, + // hid_t space2_id); + // #endif /* NEW_HYPERSLAB_API */ -- cgit v0.12 From fb20d376addcb646d130181e003f237b8437d399 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 26 Mar 2018 21:44:02 -0500 Subject: Correct typo in comment. --- src/H5CX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5CX.c b/src/H5CX.c index dd1d74f..8fc20cf 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -146,7 +146,7 @@ /* Local Typedefs */ /******************/ -/* Context stored for each I/O-related API call */ +/* Context stored for each API call */ typedef struct H5CX_t { /* DXPL */ hid_t dxpl_id; /* DXPL ID for API operation */ -- cgit v0.12 From eecf997bf579d9e9591b1ee3797f499319bbdfe5 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 26 Mar 2018 23:19:08 -0500 Subject: Remove redundant 'is_collective' parameter from H5CX_set_loc. --- src/H5A.c | 6 +++--- src/H5Adeprec.c | 2 +- src/H5CX.c | 48 ++++++++++++++++++++++-------------------------- src/H5CXprivate.h | 2 +- src/H5D.c | 8 ++++---- src/H5Ddeprec.c | 2 +- src/H5F.c | 6 +++--- src/H5Fmount.c | 4 ++-- src/H5G.c | 4 ++-- src/H5Gdeprec.c | 18 +++++++++--------- src/H5O.c | 6 +++--- src/H5Ocopy.c | 2 +- src/H5Oflush.c | 4 ++-- src/H5R.c | 2 +- src/H5Tcommit.c | 4 ++-- src/H5Tdeprec.c | 2 +- 16 files changed, 58 insertions(+), 62 deletions(-) diff --git a/src/H5A.c b/src/H5A.c index 513d4fe..a8eeabf 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -619,7 +619,7 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(attr_id, TRUE) < 0) + if(H5CX_set_loc(attr_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") /* Go write the actual data to the attribute */ @@ -1129,7 +1129,7 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") /* Call private attribute rename routine */ @@ -1375,7 +1375,7 @@ H5Adelete(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") /* Delete the attribute from the location */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 84ab491..9903da1 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -137,7 +137,7 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read") /* Go do the real work for attaching the attribute to the dataset */ diff --git a/src/H5CX.c b/src/H5CX.c index 8fc20cf..3a2fae3 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -852,7 +852,10 @@ done: /*------------------------------------------------------------------------- * Function: H5CX_set_loc * - * Purpose: Sanity checks and sets up collective operations. + * Purpose: Sanity checks and sets up collective operations. + * + * Note: Should be called for all API routines that modify file + * file metadata but don't pass in an access property list. * * Return: Non-negative on success / Negative on failure * @@ -866,11 +869,7 @@ H5CX_set_loc(hid_t #ifndef H5_HAVE_PARALLEL H5_ATTR_UNUSED #endif /* H5_HAVE_PARALLEL */ - loc_id, hbool_t -#ifndef H5_HAVE_PARALLEL - H5_ATTR_UNUSED -#endif /* H5_HAVE_PARALLEL */ - is_collective) + loc_id) { H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ herr_t ret_value = SUCCEED; /* Return value */ @@ -881,28 +880,25 @@ H5CX_set_loc(hid_t HDassert(head && *head); #ifdef H5_HAVE_PARALLEL - /* Check for collective operation */ - if(is_collective) { - /* Set collective metadata read flag */ - (*head)->ctx.coll_metadata_read = TRUE; - - /* If parallel is enabled and the file driver used is the MPI-IO - * VFD, issue an MPI barrier for easier debugging if the API function - * calling this is supposed to be called collectively. Note that this - * happens only when the environment variable H5_COLL_BARRIER is set - * to non 0. - */ - if(H5_coll_api_sanity_check_g) { - MPI_Comm mpi_comm; /* File communicator */ + /* Set collective metadata read flag */ + (*head)->ctx.coll_metadata_read = TRUE; + + /* If parallel is enabled and the file driver used is the MPI-IO + * VFD, issue an MPI barrier for easier debugging if the API function + * calling this is supposed to be called collectively. Note that this + * happens only when the environment variable H5_COLL_BARRIER is set + * to non 0. + */ + if(H5_coll_api_sanity_check_g) { + MPI_Comm mpi_comm; /* File communicator */ - /* Retrieve the MPI communicator from the loc_id or the fapl_id */ - if(H5F_mpi_retrieve_comm(loc_id, H5P_DEFAULT, &mpi_comm) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") + /* Retrieve the MPI communicator from the loc_id or the fapl_id */ + if(H5F_mpi_retrieve_comm(loc_id, H5P_DEFAULT, &mpi_comm) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") - /* issue the barrier */ - if(mpi_comm != MPI_COMM_NULL) - MPI_Barrier(mpi_comm); - } /* end if */ + /* issue the barrier */ + if(mpi_comm != MPI_COMM_NULL) + MPI_Barrier(mpi_comm); } /* end if */ #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index 405dc7a..151f555 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -63,7 +63,7 @@ H5_DLL void H5CX_set_dxpl(hid_t dxpl_id); H5_DLL void H5CX_set_lapl(hid_t lapl_id); H5_DLL herr_t H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, hid_t loc_id, hbool_t is_collective); -H5_DLL herr_t H5CX_set_loc(hid_t loc_id, hbool_t is_collective); +H5_DLL herr_t H5CX_set_loc(hid_t loc_id); /* "Getter" routines for API context info */ H5_DLL hid_t H5CX_get_dxpl(void); diff --git a/src/H5D.c b/src/H5D.c index 258bac1..61ccb5a 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -898,7 +898,7 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[]) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(dset_id, TRUE) < 0) + if(H5CX_set_loc(dset_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Private function */ @@ -936,7 +936,7 @@ H5Dflush(hid_t dset_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(dset_id, TRUE) < 0) + if(H5CX_set_loc(dset_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Flush dataset information cached in memory */ @@ -974,7 +974,7 @@ H5Drefresh(hid_t dset_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(dset_id, TRUE) < 0) + if(H5CX_set_loc(dset_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call private function to refresh the dataset object */ @@ -1016,7 +1016,7 @@ H5Dformat_convert(hid_t dset_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(dset_id, TRUE) < 0) + if(H5CX_set_loc(dset_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") switch(dset->shared->layout.type) { diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 318680c..6dd3754 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -249,7 +249,7 @@ H5Dextend(hid_t dset_id, const hsize_t size[]) dset_dims[u] = size[u]; /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(dset_id, TRUE) < 0) + if(H5CX_set_loc(dset_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Increase size */ diff --git a/src/H5F.c b/src/H5F.c index 0a1da54..4f7d597 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1442,7 +1442,7 @@ H5Fstart_swmr_write(hid_t file_id) HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and MDC cache image") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(file_id, TRUE) < 0) + if(H5CX_set_loc(file_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call the internal routine */ @@ -1575,7 +1575,7 @@ H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(file_id, TRUE) < 0) + if(H5CX_set_loc(file_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal set_libver_bounds function */ @@ -1614,7 +1614,7 @@ H5Fformat_convert(hid_t fid) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(fid, TRUE) < 0) + if(H5CX_set_loc(fid) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call the internal routine */ diff --git a/src/H5Fmount.c b/src/H5Fmount.c index eede84c..e3a92fd 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -462,7 +462,7 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property list") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Do the mount */ @@ -509,7 +509,7 @@ H5Funmount(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Unmount */ diff --git a/src/H5G.c b/src/H5G.c index c95a855..fa065fa 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -719,7 +719,7 @@ H5Gflush(hid_t group_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(group_id, TRUE) < 0) + if(H5CX_set_loc(group_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Flush group's metadata to file */ @@ -757,7 +757,7 @@ H5Grefresh(hid_t group_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(group_id, TRUE) < 0) + if(H5CX_set_loc(group_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call private function to refresh group object */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 8d1441f..fc346f8 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -231,7 +231,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) tmp_gcpl = H5P_GROUP_CREATE_DEFAULT; /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Create the new group & get its ID */ @@ -326,7 +326,7 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(cur_loc_id, TRUE) < 0) + if(H5CX_set_loc(cur_loc_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine to create link */ @@ -362,7 +362,7 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(cur_loc_id, TRUE) < 0) + if(H5CX_set_loc(cur_loc_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine to create link */ @@ -461,7 +461,7 @@ H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name) H5TRACE3("e", "i*s*s", src_loc_id, src_name, dst_name); /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(src_loc_id, TRUE) < 0) + if(H5CX_set_loc(src_loc_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call common routine to move the link */ @@ -494,7 +494,7 @@ H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "source and destination should not both be H5L_SAME_LOC") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(dst_loc_id, TRUE) < 0) + if(H5CX_set_loc(dst_loc_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call common routine to move the link */ @@ -583,7 +583,7 @@ H5Gunlink(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no name") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ @@ -650,7 +650,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ @@ -726,7 +726,7 @@ H5Gset_comment(hid_t loc_id, const char *name, const char *comment) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ @@ -809,7 +809,7 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no buffer specified") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ diff --git a/src/H5O.c b/src/H5O.c index 49e13ce..f700ac9 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -335,7 +335,7 @@ H5Oincr_refcount(hid_t object_id) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(object_id, TRUE) < 0) + if(H5CX_set_loc(object_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Change the object's refcount */ @@ -381,7 +381,7 @@ H5Odecr_refcount(hid_t object_id) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(object_id, TRUE) < 0) + if(H5CX_set_loc(object_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Change the object's refcount */ @@ -595,7 +595,7 @@ H5Oset_comment(hid_t obj_id, const char *comment) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(obj_id, TRUE) < 0) + if(H5CX_set_loc(obj_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* (Re)set the object's comment */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index b5a3bdf..e6865f1 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -225,7 +225,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(src_loc_id, TRUE) < 0) + if(H5CX_set_loc(src_loc_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine to copy object */ diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 65cb2ae..e8e077e 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -79,7 +79,7 @@ H5Oflush(hid_t obj_id) H5TRACE1("e", "i", obj_id); /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(obj_id, TRUE) < 0) + if(H5CX_set_loc(obj_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal routine */ @@ -241,7 +241,7 @@ H5Orefresh(hid_t oid) H5TRACE1("e", "i", oid); /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(oid, TRUE) < 0) + if(H5CX_set_loc(oid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal routine */ diff --git a/src/H5R.c b/src/H5R.c index 11ac32e..ab73b59 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -115,7 +115,7 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") /* Create reference */ diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 12492fd..4e4a551 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -663,7 +663,7 @@ H5Tflush(hid_t type_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(type_id, TRUE) < 0) + if(H5CX_set_loc(type_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Flush metadata for named datatype */ @@ -703,7 +703,7 @@ H5Trefresh(hid_t type_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(type_id, TRUE) < 0) + if(H5CX_set_loc(type_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Call private function to refresh datatype object */ diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index e4224f5..13d2f5f 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -116,7 +116,7 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Set up collective metadata if appropriate */ - if(H5CX_set_loc(loc_id, TRUE) < 0) + if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Commit the datatype to the file, using default property list values */ -- cgit v0.12 From 49829b91174f8e6dcfa26400254013dce7eac531 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 27 Mar 2018 08:41:22 -0500 Subject: Remove incorrect line --- release_docs/INSTALL_CMake.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index f30c1b3..d0ff70b 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_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) -- cgit v0.12 From e1f937f14bbc38651bf72470d1c9f729437357e9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 27 Mar 2018 08:41:54 -0500 Subject: Add missing test which is in autotools --- tools/test/h5stat/CMakeTests.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index 8d796ad..4811c61 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -157,6 +157,10 @@ ADD_H5_TEST (h5stat_newgrat 0 h5stat_newgrat.h5) ADD_H5_TEST (h5stat_newgrat-UG 0 -G h5stat_newgrat.h5) ADD_H5_TEST (h5stat_newgrat-UA 0 -A h5stat_newgrat.h5) +# h5stat_idx.h5 is generated by h5stat_gentest.c + if (HDF5_BUILD_GENERATORS) + ADD_H5_TEST (h5stat_idx 0 h5stat_idx.h5) + endif () # # Tests for -l (--links) option on h5stat_threshold.h5: # -l 0 (incorrect threshold value) -- cgit v0.12 From 711ac55f9648d21b0cfbdda24366773de5199af5 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 27 Mar 2018 14:20:32 -0500 Subject: Add comments for internal structs. --- src/H5CX.c | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index 3a2fae3..f335e38 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -146,7 +146,35 @@ /* Local Typedefs */ /******************/ -/* Context stored for each API call */ +/* Typedef for context about each API call, as it proceeds */ +/* Fields in this struct are of several types: + * - The DXPL & LAPL ID are either library default ones (from the API context + * initialization) or passed in from the application via an API call + * parameter. The corresponding H5P_genplist_t* is just the underlying + * property list struct for the ID, to optimize retrieving properties + * from the list multiple times. + * + * - Internal fields, used and set only within the library, for managing the + * operation under way. These do not correspond to properties in the + * DXPL or LAPL. + * + * - Cached properties, which are not returned to the application, for managing + * the operation under way. These correspond to properties in the DXPL + * or LAPL, and are retrieved either from the (global) cache for a + * default property list, or from the corresponding property in the + * application's (non-default) property list. Getting / setting these + * properties within the library does _not_ affect the application's + * property list. Note that the naming of these fields, and + * _valid, is important for the macros to work properly. + * + * - "Set" properties that are returned to the application, mainly for sending + * out "introspection" information ("Why did collective I/O get broken?", + * "Which filters are set on the chunk I just directly read in?", etc) + * Setting these values will cause the corresponding property in the + * property list to be set when the API context is popped, when + * returning from the API routine. Note that the naming of these fields, + * and _set, is important for the macros to work properly. + */ typedef struct H5CX_t { /* DXPL */ hid_t dxpl_id; /* DXPL ID for API operation */ @@ -156,14 +184,14 @@ typedef struct H5CX_t { hid_t lapl_id; /* LAPL ID for API operation */ H5P_genplist_t *lapl; /* Link Access Property List */ - /* Object tagging info */ + /* Internal: Object tagging info */ haddr_t tag; /* Current object's tag (ohdr chunk #0 address) */ - /* Metadata cache info */ + /* Internal: Metadata cache info */ H5AC_ring_t ring; /* Current metadata cache ring for entries */ #ifdef H5_HAVE_PARALLEL - /* Parallel I/O settings */ + /* Internal: Parallel I/O settings */ hbool_t coll_metadata_read; /* Whether to use collective I/O for metadata read */ MPI_Datatype btype; /* MPI datatype for buffer, when using collective I/O */ MPI_Datatype ftype; /* MPI datatype for file, when using collective I/O */ @@ -252,12 +280,23 @@ typedef struct H5CX_t { } H5CX_t; /* Typedef for nodes on the API context stack */ +/* Each entry into the library through an API routine invokes H5CX_push() + * in a FUNC_ENTER_API* macro, which pushes an H5CX_node_t on the API + * context [thread-local] stack, after initializing it with default values + * in H5CX__push_common(). + */ typedef struct H5CX_node_t { H5CX_t ctx; /* Context for current API call */ struct H5CX_node_t *next; /* Pointer to previous context, on stack */ } H5CX_node_t; /* Typedef for cached default dataset transfer property list information */ +/* This is initialized to the values in the default DXPL during package + * initialization and then remains constant for the rest of the library's + * operation. When a field in H5CX_t is retrieved from an API context that + * uses a default DXPL, this value is copied instead of spending time looking + * up the property in the DXPL. + */ typedef struct H5CX_dxpl_cache_t { size_t max_temp_buf; /* Maximum temporary buffer size (H5D_XFER_MAX_TEMP_BUF_NAME) */ void *tconv_buf; /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */ @@ -288,6 +327,7 @@ typedef struct H5CX_dxpl_cache_t { } H5CX_dxpl_cache_t; /* Typedef for cached default link access property list information */ +/* (Same as the cached DXPL struct, above, except for the default LAPL) */ typedef struct H5CX_lapl_cache_t { size_t nlinks; /* Number of soft / UD links to traverse (H5L_ACS_NLINKS_NAME) */ } H5CX_lapl_cache_t; -- cgit v0.12 From c975f49984d5da0ba5a9cd4fb3f8918bb49b595c Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 27 Mar 2018 14:20:50 -0500 Subject: Add an assert to verify that we don't write when between MPI_Barrier() calls during a flush. --- src/H5FDmpio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index a898786..ee3277d 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1730,6 +1730,9 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, HDassert(H5FD_MPIO==file->pub.driver_id); HDassert(buf); + /* Verify that no data is written when between MPI_Barrier()s during file flush */ + HDassert(!H5CX_get_mpi_file_flushing()); + /* Portably initialize MPI status variable */ HDmemset(&mpi_stat, 0, sizeof(MPI_Status)); -- cgit v0.12 From 8bfa1b6fc530a71a8b0bb00beb36e7a09b2ff5a7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Mar 2018 08:17:27 -0500 Subject: Add missing test file --- tools/test/h5stat/CMakeTests.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index 4811c61..69bab20 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -37,6 +37,7 @@ h5stat_newgrat-UG h5stat_newgrat-UA h5stat_err1_links + h5stat_idx h5stat_links1 h5stat_links2 h5stat_links3 @@ -54,6 +55,7 @@ ) set (HDF5_REFERENCE_TEST_FILES h5stat_filters.h5 + h5stat_idx.h5 h5stat_tsohm.h5 h5stat_newgrat.h5 h5stat_threshold.h5 -- cgit v0.12 From adfffd04b1fa01fa4e1e78c489dfb8c2c3d30ce6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Mar 2018 12:25:42 -0500 Subject: Correct name of h5 hl compile script --- hl/src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 0daa86e..8ee775b 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -124,11 +124,11 @@ if (NOT WIN32) set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in - ${HDF5_BINARY_DIR}/CMakeFiles/h5chl + ${HDF5_BINARY_DIR}/CMakeFiles/h5hlcc @ONLY ) install ( - FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5chl + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5hlcc DESTINATION ${HDF5_INSTALL_BIN_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE COMPONENT hllibraries -- cgit v0.12 From 174439c95b82b2ec94fca61344a9ef6b78c03b85 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 28 Mar 2018 21:36:21 -0500 Subject: Expanded comments abuot H5CX_t fields. --- src/H5CX.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index f335e38..135451c 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -156,24 +156,26 @@ * * - Internal fields, used and set only within the library, for managing the * operation under way. These do not correspond to properties in the - * DXPL or LAPL. + * DXPL or LAPL and can have any name. * - * - Cached properties, which are not returned to the application, for managing + * - Cached fields, which are not returned to the application, for managing * the operation under way. These correspond to properties in the DXPL * or LAPL, and are retrieved either from the (global) cache for a * default property list, or from the corresponding property in the * application's (non-default) property list. Getting / setting these * properties within the library does _not_ affect the application's * property list. Note that the naming of these fields, and - * _valid, is important for the macros to work properly. - * - * - "Set" properties that are returned to the application, mainly for sending - * out "introspection" information ("Why did collective I/O get broken?", - * "Which filters are set on the chunk I just directly read in?", etc) - * Setting these values will cause the corresponding property in the - * property list to be set when the API context is popped, when - * returning from the API routine. Note that the naming of these fields, - * and _set, is important for the macros to work properly. + * _valid, is important for the H5CX_RETRIEVE_PROP_VALID ahd + * H5CX_RETRIEVE_PROP_VALID_SET macros to work properly. + * + * - "Return-only"" properties that are returned to the application, mainly + * for sending out "introspection" information ("Why did collective I/O + * get broken for this operation?", "Which filters are set on the chunk I + * just directly read in?", etc) Setting these fields will cause the + * corresponding property in the property list to be set when the API + * context is popped, when returning from the API routine. Note that the + * naming of these fields, and _set, is important for the +* H5CX_TEST_SET_PROP and H5CX_SET_PROP macros to work properly. */ typedef struct H5CX_t { /* DXPL */ @@ -246,7 +248,7 @@ typedef struct H5CX_t { H5T_conv_cb_t dt_conv_cb; /* Datatype conversion struct (H5D_XFER_CONV_CB_NAME) */ hbool_t dt_conv_cb_valid; /* Whether datatype conversion struct is valid */ - /* Set DXPL properties to return to application */ + /* Return-only DXPL properties to return to application */ uint32_t dcr_filters; /* Direct chunk read filter flags (H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME) */ hbool_t dcr_filters_set; /* Whether direct chunk read filter flags are set */ #ifdef H5_HAVE_PARALLEL -- cgit v0.12 From af2f32293749f26c0dc4c477d5c23239e0b4af53 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2018 11:06:14 -0500 Subject: Update section on using CMake source package --- release_docs/INSTALL_CMake.txt | 56 ++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index d0ff70b..8dcc4dd 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -51,9 +51,9 @@ 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 + CMake-hdf5-1.10.X.zip or CMake-hdf5-1.10.X.tar.gz -Individual files +Individual files included in the above mentioned compressed files ----------------------------------------------- CMake build script: CTestScript.cmake @@ -62,37 +62,44 @@ External compression szip and zlib libraries: SZip.tar.gz ZLib.tar.gz -Platform configuration files: - HDF518config.cmake +Examples Source package: + HDF5Examples-1.10.x-Source.tar.gz + +Configuration files: + HDF5config.cmake + HDF5options.cmake + +Build scripts for windows or linux ----------------------------------------------- To build HDF5 with the SZIP and ZLIB external libraries you will need to: 1. Change to the development directory "myhdfstuff". - 2. Download the SZip.tar.gz and ZLib.tar.gz to "myhdfstuff". - Do not uncompress the files. + 2. Download the CMake-hdf5-1.10.X.zip(.tar.gz) file to "myhdfstuff". + Uncompress the file. - 3. Download the CTestScript.cmake file to "myhdfstuff". + 3. Change to the source directory "hdf5-1.10.x". CTestScript.cmake file should not be modified. - 4. Download the platform configuration file, HDF518config.cmake, - to "myhdfstuff". Do not modify the file unless you want to change - default build environment. (See http://www.hdfgroup.org/HDF5/release/chgcmkbuild.html) + 4. Edit the platform configuration file, HDF5options.cmake, if you want to change + the default build environment. + (See http://www.hdfgroup.org/HDF5/release/chgcmkbuild.html) 5. From the "myhdfstuff" directory execute the CTest Script with the following options: - On 32-bit Windows with Visual Studio 2012, execute: - ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2012 -C Release -VV -O hdf5.log - On 64-bit Windows with Visual Studio 2012, execute: - ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf5.log + On 32-bit Windows with Visual Studio 2015, execute: + ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2015 -C Release -VV -O hdf5.log + On 64-bit Windows with Visual Studio 2015, execute: + ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201564 -C Release -VV -O hdf5.log On 32-bit Windows with Visual Studio 2013, execute: ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2013 -C Release -VV -O hdf5.log On 64-bit Windows with Visual Studio 2013, execute: ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201364 -C Release -VV -O hdf5.log On Linux and Mac, execute: ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix -C Release -VV -O hdf5.log + The supplied build scripts are versions of the above. The command above will configure, build, test, and create an install package in the myhdfstuff folder. It will have the format: @@ -103,19 +110,20 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: installer on your system, you will also see a similar file that ends in either .exe (NSIS) or .msi (WiX). - The -S option uses the script version of ctest. + Notes on the command line options. + The -S option uses the script version of ctest. - The value for the -C option (as shown above, "-C Release") must - match the setting for CTEST_CONFIGURATION_TYPE in the platform - configuration file. + The value for the -C option (as shown above, "-C Release") must + match the setting for CTEST_CONFIGURATION_TYPE in the platform + configuration file. - The -VV option is for most verbose; use -V for less verbose. + The -VV option is for most verbose; use -V for less verbose. - The "-O hdf5.log" option saves the output to a log file hdf5.log. + The "-O hdf5.log" option saves the output to a log file hdf5.log. 6. To install, "X" is the current release version - On Windows, execute: + On Windows (with WiX installed), execute: HDF5-1.10."X"-win32.msi or HDF5-1.10."X"-win64.msi By default this program will install the hdf5 library into the "C:\Program Files" directory and will create the following @@ -202,7 +210,7 @@ Notes: This short set of instructions is written for users who want to cpack -C Release CPackConfig.cmake 9. To install - On Windows, execute: + On Windows (with WiX installed), execute: HDF5-1.10."X"-win32.msi or HDF5-1.10."X"-win64.msi By default this program will install the hdf5 library into the "C:\Program Files" directory and will create the following @@ -250,7 +258,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.10. 2. If you plan to use Zlib or Szip: A. Download the binary packages and install them in a central location. @@ -416,7 +424,7 @@ These five steps are described in detail below. 2.1 Visual CMake users, click the Configure button. If this is the first time you are running cmake-gui in this directory, you will be prompted for the - generator you wish to use (for example on Windows, Visual Studio 11). + generator you wish to use (for example on Windows, Visual Studio 12). CMake will read in the CMakeLists.txt files from the source directory and display options for the HDF5 project. After the first configure you can adjust the cache settings and/or specify the locations of other programs. -- cgit v0.12 From 0a469016e03e6a7d9d59a34ace5a97479b8f9a61 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2018 11:19:30 -0500 Subject: Update URLs --- release_docs/INSTALL_CMake.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 8dcc4dd..35e2c08 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -24,7 +24,7 @@ Obtaining HDF5 source code 1. Create a directory for your development; for example, "myhdfstuff". 2. Obtain compressed (*.tar or *.zip) HDF5 source from - http://www.hdfgroup.org/ftp/HDF5/current/src/ + https://portal.hdfgroup.org/display/support/Building+HDF5+with+CMake and put it in "myhdfstuff". Uncompress the file. There should be a hdf5-1.10."X" folder. @@ -48,7 +48,7 @@ the config/cmake/cacheinit.cmake file. HDF Group recommends using the ctest script mode to build HDF5. The following files referenced below are available at the HDF web site: - http://www.hdfgroup.org/HDF5/release/cmakebuild.html + https://portal.hdfgroup.org/display/support/Building+HDF5+with+CMake Single compressed file with all the files needed, including source: CMake-hdf5-1.10.X.zip or CMake-hdf5-1.10.X.tar.gz @@ -84,7 +84,7 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: 4. Edit the platform configuration file, HDF5options.cmake, if you want to change the default build environment. - (See http://www.hdfgroup.org/HDF5/release/chgcmkbuild.html) + (See https://portal.hdfgroup.org/display/support/How+to+Change+HDF5+CMake+Build+Options) 5. From the "myhdfstuff" directory execute the CTest Script with the following options: -- cgit v0.12 From f977c619d3e2df9c76a8460a0d6682f4134ab009 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2018 11:22:00 -0500 Subject: Update CMake reference and check CDash reference --- release_docs/INSTALL_CMake.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 35e2c08..3181d72 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.10, where "X" is the current HDF5 release version. Note: @@ -325,7 +325,7 @@ Notes: CMake and HDF5 3. Build and test results can be submitted to our CDash server, please read the HDF and CDash document at: - www.hdfgroup.org/CDash/HowToSubmit. +?? www.hdfgroup.org/CDash/HowToSubmit. 4. See the appendix at the bottom of this file for examples of using a ctest script for building and testing. Using a ctest script is -- cgit v0.12 From ae48e4337f9342e02eaf2a060c1b4337b898330f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2018 11:35:48 -0500 Subject: Update CDash info --- CTestConfig.cmake | 2 +- release_docs/INSTALL_CMake.txt | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 8a20eb4..6bad67e 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -24,7 +24,7 @@ if (CDASH_LOCAL) set (CTEST_DROP_LOCATION "/submit.php?project=HDF5Trunk") else () set (CTEST_DROP_SITE "cdash.hdfgroup.org") - set (CTEST_DROP_LOCATION "/submit.php?project=HDF5+Trunk") + set (CTEST_DROP_LOCATION "/submit.php?project=HDF5") endif () set (CTEST_DROP_SITE_CDASH TRUE) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 3181d72..a234561 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -323,9 +323,21 @@ Notes: CMake and HDF5 how CMake support can be improved on any system. Visit the KitWare site for more information about CMake. - 3. Build and test results can be submitted to our CDash server, - please read the HDF and CDash document at: -?? www.hdfgroup.org/CDash/HowToSubmit. + 3. Build and test results can be submitted to our CDash server: + The CDash server for community submissions of hdf5 1.8 is at + https://cdash.hdfgroup.org. + + Submitters are requested to register their name and contact info and + maintain their test sites. After your first submission, login and go + to your "My CDash" link and claim your site. + + We ask that all submissions include the configuration information and + contact information in the CTest Notes Files upload step. See the + current reports on CDash for examples. + + Please follow the convention that "NIGHTLY" submissions maintain the same + configuration every time. "EXPERIMENTAL" submissions can be expected to + be different for each submission. 4. See the appendix at the bottom of this file for examples of using a ctest script for building and testing. Using a ctest script is -- cgit v0.12 From 464c22c1f1e673cccb274434dd0f9aa40872c2a5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2018 11:56:44 -0500 Subject: Correct hdf5 reference --- release_docs/INSTALL_CMake.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index a234561..a2d209a 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -324,7 +324,7 @@ Notes: CMake and HDF5 KitWare site for more information about CMake. 3. Build and test results can be submitted to our CDash server: - The CDash server for community submissions of hdf5 1.8 is at + The CDash server for community submissions of hdf5 is at https://cdash.hdfgroup.org. Submitters are requested to register their name and contact info and -- cgit v0.12 From b3c9bcf92fdb9f9029e97c0d515e17928007c0da Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2018 12:16:28 -0500 Subject: Update URLs --- release_docs/USING_HDF5_CMake.txt | 4 ++-- release_docs/USING_HDF5_VS.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index b516056..29c28a8 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -216,7 +216,7 @@ adjust the forward slash to double backslashes, except for the HDF_DIR environment variable. NOTE: this file is available at the HDF web site: - http://www.hdfgroup.org/HDF5/release/cmakebuild.html + https://portal.hdfgroup.org/display/support/Building+HDF5+with+CMake HDF5_Examples.cmake HDF5_Examples_options.cmake @@ -290,7 +290,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDN #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) -# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.5-Source") +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.7-Source") #endif() ############################################################################################################### diff --git a/release_docs/USING_HDF5_VS.txt b/release_docs/USING_HDF5_VS.txt index 3aaa56d..3019631 100644 --- a/release_docs/USING_HDF5_VS.txt +++ b/release_docs/USING_HDF5_VS.txt @@ -81,11 +81,11 @@ Using Visual Studio 2008 with HDF5 Libraries built with Visual Studio 2008 Many other common questions and hints are located online and being updated in the HDF5 FAQ. For Windows-specific questions, please see: - http://www.hdfgroup.org/HDF5/faq/windows.html + https://support.hdfgroup.org/HDF5/faq/windows.html For all other general questions, you can look in the general FAQ: - http://hdfgroup.org/HDF5-FAQ.html + https://support.hdfgroup.org/HDF5/HDF5-FAQ.html ************************************************************************ Please send email to help@hdfgroup.org for further assistance. -- cgit v0.12 From 8bfa19a8b53e7bf63605efc4c1fdb8aeff97ebce Mon Sep 17 00:00:00 2001 From: L Kurz Date: Thu, 29 Mar 2018 12:58:03 -0500 Subject: update email address --- release_docs/USING_HDF5_CMake.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index b516056..34ab1b4 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -313,7 +313,7 @@ endif() set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### -# For any comments please contact cdashhelp@hdfgroup.org +# For any comments please contact help@hdfgroup.org # ############################################################################################################### -- cgit v0.12 From ba043154e989fce8737df0f2e8999d32bf38e303 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2018 12:58:25 -0500 Subject: Correct email --- release_docs/USING_HDF5_CMake.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 29c28a8..169a06f 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -313,7 +313,7 @@ endif() set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### -# For any comments please contact cdashhelp@hdfgroup.org +# For any comments please contact help@hdfgroup.org # ############################################################################################################### -- cgit v0.12 From b8f56d22dfd754715d10accc5997fe923bdb7593 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 30 Mar 2018 01:11:19 -0700 Subject: Created internal functions for a couple of H5F calls. --- src/H5F.c | 262 +++------------------------------------------ src/H5Fint.c | 318 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5Fprivate.h | 2 + 3 files changed, 334 insertions(+), 248 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index 2cd65cb..ce5664a 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1260,82 +1260,23 @@ done: herr_t H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info) { - H5F_t *file; /* File object for file ID */ - unsigned i, j; /* Local index variable */ - size_t tot_size; /* Size of each retries[i] */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file; /* File object for file ID */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", file_id, info); /* Check args */ - if(!info) + if (!info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") /* Get the file pointer */ - if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + if (NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - /* Copy the # of bins for "retries" array */ - info->nbins = file->shared->retries_nbins; - - /* Initialize the array of "retries" */ - HDmemset(info->retries, 0, sizeof(info->retries)); - - /* Return if there are no bins -- no retries */ - if(!info->nbins) - HGOTO_DONE(SUCCEED); - - /* Calculate size for each retries[i] */ - tot_size = info->nbins * sizeof(uint32_t); - - /* Map and copy information to info's retries for metadata items with tracking for read retries */ - j = 0; - for(i = 0; i < H5AC_NTYPES; i++) { - switch(i) { - case H5AC_OHDR_ID: - case H5AC_OHDR_CHK_ID: - case H5AC_BT2_HDR_ID: - case H5AC_BT2_INT_ID: - case H5AC_BT2_LEAF_ID: - case H5AC_FHEAP_HDR_ID: - case H5AC_FHEAP_DBLOCK_ID: - case H5AC_FHEAP_IBLOCK_ID: - case H5AC_FSPACE_HDR_ID: - case H5AC_FSPACE_SINFO_ID: - case H5AC_SOHM_TABLE_ID: - case H5AC_SOHM_LIST_ID: - case H5AC_EARRAY_HDR_ID: - case H5AC_EARRAY_IBLOCK_ID: - case H5AC_EARRAY_SBLOCK_ID: - case H5AC_EARRAY_DBLOCK_ID: - case H5AC_EARRAY_DBLK_PAGE_ID: - case H5AC_FARRAY_HDR_ID: - case H5AC_FARRAY_DBLOCK_ID: - case H5AC_FARRAY_DBLK_PAGE_ID: - case H5AC_SUPERBLOCK_ID: - HDassert(j < H5F_NUM_METADATA_READ_RETRY_TYPES); - if(file->shared->retries[i] != NULL) { - /* Allocate memory for retries[i] - * - * This memory should be released by the user with - * the H5free_memory() call. - */ - if(NULL == (info->retries[j] = (uint32_t *)H5MM_malloc(tot_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Copy the information */ - HDmemcpy(info->retries[j], file->shared->retries[i], tot_size); - } /* end if */ - - /* Increment location in info->retries[] array */ - j++; - break; - - default: - break; - } /* end switch */ - } /* end for */ + /* Get the retry info */ + if (H5F_get_metadata_read_retry_info(file, info) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't get metadata read retry info") done: FUNC_LEAVE_API(ret_value) @@ -1446,196 +1387,21 @@ 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 */ - hid_t *obj_ids=NULL; /* List of ids */ - H5G_loc_t *obj_glocs=NULL; /* Group location of the object */ - H5O_loc_t *obj_olocs=NULL; /* Object location */ - H5G_name_t *obj_paths=NULL; /* Group hierarchy path */ - size_t u; /* Local index variable */ - hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ - H5F_io_info2_t fio_info; /* I/O info for operation */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file = NULL; /* File info */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); /* check args */ - if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") - - /* Should have write permission */ - if((H5F_INTENT(file) & H5F_ACC_RDWR) == 0) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "no write intent on file") - - 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->low_bound == H5F_LIBVER_V110) && (file->shared->high_bound == H5F_LIBVER_V110)); - - /* Should not be marked for SWMR writing mode already */ - if(file->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file already in SWMR writing mode") - - 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 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, FAIL, "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") - - /* Get the # of opened named datatypes and attributes */ - if(H5F_get_obj_count(file, H5F_OBJ_DATATYPE|H5F_OBJ_ATTR, FALSE, &nt_attr_count) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") - if(nt_attr_count) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "named datatypes and/or attributes opened in the file") - - /* Get the # of opened datasets and groups */ - if(H5F_get_obj_count(file, H5F_OBJ_GROUP|H5F_OBJ_DATASET, FALSE, &grp_dset_count) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") - - if(grp_dset_count) { - /* Allocate space for group and object locations */ - if((obj_ids = (hid_t *) H5MM_malloc(grp_dset_count * sizeof(hid_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for hid_t") - if((obj_glocs = (H5G_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_loc_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_loc_t") - if((obj_olocs = (H5O_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5O_loc_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5O_loc_t") - if((obj_paths = (H5G_name_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_name_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_name_t") - - /* Get the list of opened object ids (groups & datasets) */ - if(H5F_get_obj_ids(file, H5F_OBJ_GROUP|H5F_OBJ_DATASET, grp_dset_count, obj_ids, FALSE, &grp_dset_count) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "H5F_get_obj_ids failed") - - /* Refresh opened objects (groups, datasets) in the file */ - for(u = 0; u < grp_dset_count; u++) { - H5O_loc_t *oloc; /* object location */ - H5G_loc_t tmp_loc; - - /* Set up the id's group location */ - obj_glocs[u].oloc = &obj_olocs[u]; - obj_glocs[u].path = &obj_paths[u]; - H5G_loc_reset(&obj_glocs[u]); - - /* get the id's object location */ - if((oloc = H5O_get_loc(obj_ids[u])) == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") - - /* Make deep local copy of object's location information */ - H5G_loc(obj_ids[u], &tmp_loc); - H5G_loc_copy(&obj_glocs[u], &tmp_loc, H5_COPY_DEEP); - - /* Close the object */ - if(H5I_dec_ref(obj_ids[u]) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEOBJ, FAIL, "decrementing object ID failed") - } /* end for */ - } /* end if */ - - /* Set up I/O info for operation */ - fio_info.f = file; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - - /* Flush and reset the accumulator */ - if(H5F__accum_reset(&fio_info, TRUE) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") - - /* Turn on SWMR write in shared file open flags */ - file->shared->flags |= H5F_ACC_SWMR_WRITE; - - /* Mark the file in SWMR writing mode */ - file->shared->sblock->status_flags |= H5F_SUPER_SWMR_WRITE_ACCESS; - - /* Set up metadata read attempts */ - file->shared->read_attempts = H5F_SWMR_METADATA_READ_ATTEMPTS; - - /* Initialize "retries" and "retries_nbins" */ - if(H5F_set_retries(file) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") - - /* Turn off usage of accumulator */ - file->shared->feature_flags &= ~(unsigned)H5FD_FEAT_ACCUMULATE_METADATA; - if(H5FD_set_feature_flags(file->shared->lf, file->shared->feature_flags) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") - - setup = TRUE; - - /* Mark superblock as dirty */ - if(H5F_super_dirty(file) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") - - /* Flush the superblock */ - if(H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") - - /* Evict all flushed entries in the cache except the pinned superblock */ - if(H5F__evict_cache_entries(file, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to evict file's cached information") - - /* Refresh (reopen) the objects (groups & datasets) in the file */ - for(u = 0; u < grp_dset_count; u++) - if(H5O_refresh_metadata_reopen(obj_ids[u], &obj_glocs[u], H5AC_ind_read_dxpl_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't refresh-close object") + if (NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hid_t identifier is not a file ID") - /* Unlock the file */ - if(H5FD_unlock(file->shared->lf) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to unlock the file") + /* start SWMR writing */ + if (H5F_start_swmr_write(file) < 0) + HGOTO_ERROR(H5E_FILE, H5E_SYSTEM, FAIL, "unable to start SWMR writing") done: - if(ret_value < 0 && setup) { - HDassert(file); - - /* Re-enable accumulator */ - file->shared->feature_flags |= (unsigned)H5FD_FEAT_ACCUMULATE_METADATA; - if(H5FD_set_feature_flags(file->shared->lf, file->shared->feature_flags) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") - - /* Reset the # of read attempts */ - file->shared->read_attempts = H5F_METADATA_READ_ATTEMPTS; - if(H5F_set_retries(file) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") - - /* Un-set H5F_ACC_SWMR_WRITE in shared open flags */ - file->shared->flags &= ~H5F_ACC_SWMR_WRITE; - - /* Unmark the file: not in SWMR writing mode */ - file->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_SWMR_WRITE_ACCESS); - - /* Mark superblock as dirty */ - if(H5F_super_dirty(file) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") - - /* Flush the superblock */ - if(H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG, H5AC_ind_read_dxpl_id) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") - } /* end if */ - - /* Free memory */ - if(obj_ids) - H5MM_xfree(obj_ids); - if(obj_glocs) - H5MM_xfree(obj_glocs); - if(obj_olocs) - H5MM_xfree(obj_olocs); - if(obj_paths) - H5MM_xfree(obj_paths); - FUNC_LEAVE_API(ret_value) } /* end H5Fstart_swmr_write() */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 24844a4..1d14ec6 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -2981,3 +2981,321 @@ H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t cmr) FUNC_LEAVE_NOAPI_VOID } /* H5F_set_coll_md_read() */ #endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * Function: H5F_get_metadata_read_retry_info + * + * Purpose: Private function to retrieve the collection of read retries + * for metadata items with checksum. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_get_metadata_read_retry_info(H5F_t *file, H5F_retry_info_t *info) +{ + unsigned i, j; /* Local index variable */ + size_t tot_size; /* Size of each retries[i] */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + HDassert(file); + HDassert(info); + + /* Copy the # of bins for "retries" array */ + info->nbins = file->shared->retries_nbins; + + /* Initialize the array of "retries" */ + HDmemset(info->retries, 0, sizeof(info->retries)); + + /* Return if there are no bins -- no retries */ + if (!info->nbins) + HGOTO_DONE(SUCCEED); + + /* Calculate size for each retries[i] */ + tot_size = info->nbins * sizeof(uint32_t); + + /* Map and copy information to info's retries for metadata items with tracking for read retries */ + j = 0; + for (i = 0; i < H5AC_NTYPES; i++) { + switch (i) { + case H5AC_OHDR_ID: + case H5AC_OHDR_CHK_ID: + case H5AC_BT2_HDR_ID: + case H5AC_BT2_INT_ID: + case H5AC_BT2_LEAF_ID: + case H5AC_FHEAP_HDR_ID: + case H5AC_FHEAP_DBLOCK_ID: + case H5AC_FHEAP_IBLOCK_ID: + case H5AC_FSPACE_HDR_ID: + case H5AC_FSPACE_SINFO_ID: + case H5AC_SOHM_TABLE_ID: + case H5AC_SOHM_LIST_ID: + case H5AC_EARRAY_HDR_ID: + case H5AC_EARRAY_IBLOCK_ID: + case H5AC_EARRAY_SBLOCK_ID: + case H5AC_EARRAY_DBLOCK_ID: + case H5AC_EARRAY_DBLK_PAGE_ID: + case H5AC_FARRAY_HDR_ID: + case H5AC_FARRAY_DBLOCK_ID: + case H5AC_FARRAY_DBLK_PAGE_ID: + case H5AC_SUPERBLOCK_ID: + HDassert(j < H5F_NUM_METADATA_READ_RETRY_TYPES); + if (file->shared->retries[i] != NULL) { + /* Allocate memory for retries[i] + * + * This memory should be released by the user with + * the H5free_memory() call. + */ + if (NULL == (info->retries[j] = (uint32_t *)H5MM_malloc(tot_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Copy the information */ + HDmemcpy(info->retries[j], file->shared->retries[i], tot_size); + } + + /* Increment location in info->retries[] array */ + j++; + break; + + default: + break; + } + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_get_metadata_read_retry_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_start_swmr_write + * + * Purpose: To enable SWMR writing mode for the file + * + * 1) Refresh opened objects: part 1 + * 2) Flush & reset accumulator + * 3) Mark the file in SWMR writing mode + * 4) Set metadata read attempts and retries info + * 5) Disable accumulator + * 6) Evict all cache entries except the superblock + * 7) Refresh opened objects (part 2) + * 8) Unlock the file + * + * Pre-conditions: + * + * 1) The file being opened has v3 superblock + * 2) The file is opened with H5F_ACC_RDWR + * 3) The file is not already marked for SWMR writing + * 4) Current implementaion for opened objects: + * --only allow datasets and groups without attributes + * --disallow named datatype with/without attributes + * --disallow opened attributes attached to objects + * + * NOTE: Currently, only opened groups and datasets are allowed + * when enabling SWMR via H5Fstart_swmr_write(). + * Will later implement a different approach-- + * set up flush dependency/proxy even for file opened without + * SWMR to resolve issues with opened objects. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_start_swmr_write(H5F_t *file) +{ + hbool_t ci_load = FALSE; /* whether MDC ci load requested */ + hbool_t ci_write = FALSE; /* whether MDC CI write requested */ + size_t grp_dset_count=0; /* # of open objects: groups & datasets */ + size_t nt_attr_count=0; /* # of opened named datatypes + opened attributes */ + hid_t *obj_ids = NULL; /* List of ids */ + H5G_loc_t *obj_glocs = NULL; /* Group location of the object */ + H5O_loc_t *obj_olocs = NULL; /* Object location */ + H5G_name_t *obj_paths = NULL; /* Group hierarchy path */ + size_t u; /* Local index variable */ + hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ + H5F_io_info2_t fio_info; /* I/O info for operation */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check args */ + HDassert(file); + + /* Should have write permission */ + if ((H5F_INTENT(file) & H5F_ACC_RDWR) == 0) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "no write intent on file") + + /* Check superblock version */ + 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") + + /* Check for correct file format version */ + if ((file->shared->low_bound != H5F_LIBVER_V110) || (file->shared->high_bound != H5F_LIBVER_V110)) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file format version does not support SWMR - needs to be 1.10 or greater") + + /* Should not be marked for SWMR writing mode already */ + if (file->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file already in SWMR writing mode") + + /* 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 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, FAIL, "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") + + /* Get the # of opened named datatypes and attributes */ + if (H5F_get_obj_count(file, H5F_OBJ_DATATYPE|H5F_OBJ_ATTR, FALSE, &nt_attr_count) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") + if (nt_attr_count) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "named datatypes and/or attributes opened in the file") + + /* Get the # of opened datasets and groups */ + if (H5F_get_obj_count(file, H5F_OBJ_GROUP|H5F_OBJ_DATASET, FALSE, &grp_dset_count) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") + + if (grp_dset_count) { + /* Allocate space for group and object locations */ + if ((obj_ids = (hid_t *) H5MM_malloc(grp_dset_count * sizeof(hid_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for hid_t") + if ((obj_glocs = (H5G_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_loc_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_loc_t") + if ((obj_olocs = (H5O_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5O_loc_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5O_loc_t") + if ((obj_paths = (H5G_name_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_name_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_name_t") + + /* Get the list of opened object ids (groups & datasets) */ + if (H5F_get_obj_ids(file, H5F_OBJ_GROUP|H5F_OBJ_DATASET, grp_dset_count, obj_ids, FALSE, &grp_dset_count) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "H5F_get_obj_ids failed") + + /* Refresh opened objects (groups, datasets) in the file */ + for (u = 0; u < grp_dset_count; u++) { + H5O_loc_t *oloc; /* object location */ + H5G_loc_t tmp_loc; + + /* Set up the id's group location */ + obj_glocs[u].oloc = &obj_olocs[u]; + obj_glocs[u].path = &obj_paths[u]; + H5G_loc_reset(&obj_glocs[u]); + + /* get the id's object location */ + if ((oloc = H5O_get_loc(obj_ids[u])) == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") + + /* Make deep local copy of object's location information */ + H5G_loc(obj_ids[u], &tmp_loc); + H5G_loc_copy(&obj_glocs[u], &tmp_loc, H5_COPY_DEEP); + + /* Close the object */ + if (H5I_dec_ref(obj_ids[u]) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEOBJ, FAIL, "decrementing object ID failed") + } + } + + /* Set up I/O info for operation */ + fio_info.f = file; + if (NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + if (NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + + /* Flush and reset the accumulator */ + if (H5F__accum_reset(&fio_info, TRUE) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") + + /* Turn on SWMR write in shared file open flags */ + file->shared->flags |= H5F_ACC_SWMR_WRITE; + + /* Mark the file in SWMR writing mode */ + file->shared->sblock->status_flags |= H5F_SUPER_SWMR_WRITE_ACCESS; + + /* Set up metadata read attempts */ + file->shared->read_attempts = H5F_SWMR_METADATA_READ_ATTEMPTS; + + /* Initialize "retries" and "retries_nbins" */ + if (H5F_set_retries(file) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") + + /* Turn off usage of accumulator */ + file->shared->feature_flags &= ~(unsigned)H5FD_FEAT_ACCUMULATE_METADATA; + if (H5FD_set_feature_flags(file->shared->lf, file->shared->feature_flags) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") + + setup = TRUE; + + /* Mark superblock as dirty */ + if (H5F_super_dirty(file) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") + + /* Flush the superblock */ + if (H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG, H5AC_ind_read_dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") + + /* Evict all flushed entries in the cache except the pinned superblock */ + if (H5F__evict_cache_entries(file, H5AC_ind_read_dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to evict file's cached information") + + /* Refresh (reopen) the objects (groups & datasets) in the file */ + for (u = 0; u < grp_dset_count; u++) + if (H5O_refresh_metadata_reopen(obj_ids[u], &obj_glocs[u], H5AC_ind_read_dxpl_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't refresh-close object") + + /* Unlock the file */ + if (H5FD_unlock(file->shared->lf) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to unlock the file") + +done: + if(ret_value < 0 && setup) { + + /* Re-enable accumulator */ + file->shared->feature_flags |= (unsigned)H5FD_FEAT_ACCUMULATE_METADATA; + if (H5FD_set_feature_flags(file->shared->lf, file->shared->feature_flags) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") + + /* Reset the # of read attempts */ + file->shared->read_attempts = H5F_METADATA_READ_ATTEMPTS; + if (H5F_set_retries(file) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") + + /* Un-set H5F_ACC_SWMR_WRITE in shared open flags */ + file->shared->flags &= ~H5F_ACC_SWMR_WRITE; + + /* Unmark the file: not in SWMR writing mode */ + file->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_SWMR_WRITE_ACCESS); + + /* Mark superblock as dirty */ + if (H5F_super_dirty(file) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") + + /* Flush the superblock */ + if (H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG, H5AC_ind_read_dxpl_id) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") + } + + /* Free memory */ + if (obj_ids) + H5MM_xfree(obj_ids); + if (obj_glocs) + H5MM_xfree(obj_glocs); + if (obj_olocs) + H5MM_xfree(obj_olocs); + if (obj_paths) + H5MM_xfree(obj_paths); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_start_swmr_write() */ + diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 28ebbd2..a53ca24 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -723,6 +723,7 @@ typedef enum H5F_mem_page_t { H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); H5_DLL herr_t H5F_try_close(H5F_t *f, hbool_t *was_closed/*out*/); +H5_DLL herr_t H5F_start_swmr_write(H5F_t *file); /* Functions that retrieve values from the file struct */ H5_DLL H5F_libver_t H5F_get_low_bound(const H5F_t *f); @@ -817,6 +818,7 @@ H5_DLL herr_t H5F_get_checksums(const uint8_t *buf, size_t chk_size, uint32_t *s /* Routine to track the # of retries */ H5_DLL herr_t H5F_track_metadata_read_retries(H5F_t *f, unsigned actype, unsigned retries); H5_DLL herr_t H5F_set_retries(H5F_t *f); +H5_DLL herr_t H5F_get_metadata_read_retry_info(H5F_t *file, H5F_retry_info_t *info); /* Routine to invoke callback function upon object flush */ H5_DLL herr_t H5F_object_flush_cb(H5F_t *f, hid_t obj_id); -- cgit v0.12 From be51656400c4b809f144844629e1cef7d2d7356c Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 1 Apr 2018 13:04:37 -0500 Subject: Add comment for the file flush when the file low / high bounds are changed after a file is open. --- src/H5Fint.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/H5Fint.c b/src/H5Fint.c index c5d281d..49538f4 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -2788,6 +2788,25 @@ H5F__set_libver_bounds(H5F_t *f, H5F_libver_t low, H5F_libver_t high) /* Set the bounds only if the existing setting is different from the inputs */ if(f->shared->low_bound != low || f->shared->high_bound != high) { /* Call the flush routine, for this file */ + /* Note: This is done in case the binary format for representing a + * metadata entry class changes when the file format low / high + * bounds are changed and an unwritten entry of that class is + * sitting in the metadata cache. + * + * If that happens, it's possible that the entry's size could + * become larger, potentially corrupting the file (if the larger + * entry is fully written, overwriting data outside its allocated + * space), or corrupting the entry (if the entry is truncated to + * fit into the allocated space). + * + * Although I'm not aware of any metadata with this behavior + * currently, it would be very difficult to guard against and / or + * detect, but if we flush everything here, the format version + * for metadata entries in the cache will be finalized and these + * sorts of problems can be avoided. + * + * QAK - April, 2018 + */ if(H5F__flush_real(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") -- cgit v0.12 From fb3cfc0a79b60ab29f6a5fff9c7d5c68b50d1144 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 2 Apr 2018 16:33:57 -0500 Subject: Revert using H5MF_sect_small_can_shrink and H5MF_sect_small_shrink for the file's free space manager (and add a comment about them). --- src/H5MFsection.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 4c021b2..fe140a7 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -144,8 +144,8 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{ 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 */ + 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 */ @@ -694,6 +694,12 @@ done: * * Note: A small section is allowed to shrink only at closing. * + * Note: This is unused currently, to maintain the invariant that the + * file size is always a multiple of the page size. + * + * (This function should probably be deleted, or the invariant + * relaxed) + * * Return: Success: non-negative (TRUE/FALSE) * Failure: negative * @@ -746,6 +752,12 @@ done: * * Purpose: Shrink container with section * + * Note: This is unused currently, to maintain the invariant that the + * file size is always a multiple of the page size. + * + * (This function should probably be deleted, or the invariant + * relaxed) + * * Return: Success: non-negative * Failure: negative * -- cgit v0.12 From 8c9661ce4d42090fb12c26bedc01af9ecc10b8e2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 3 Apr 2018 10:40:35 -0500 Subject: Update java error stack tests --- java/test/JUnit-interface.txt | 38 ++++++++++++++++++++++---------------- java/test/TestH5E.java | 22 +++++++++++----------- java/test/TestH5Edefault.java | 32 ++++++++++++++++---------------- 3 files changed, 49 insertions(+), 43 deletions(-) diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index 91ea286..53d3a62 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -650,22 +650,28 @@ Time: XXXX OK (645 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 + #000: (file name) line (number) in H5Fopen(): unable to open file major: File accessibilty - minor: Can't set value - #001: (file name) line (number) in H5P_verify_apl_and_dxpl(): not the required access property list - major: Property lists - minor: Inappropriate type - #002: (file name) line (number) in H5P_isa_class(): not a property list - major: Invalid arguments to routine - minor: Inappropriate type + minor: Unable to open file + #001: (file name) line (number) in H5F__open(): unable to open file + major: File accessibilty + minor: Unable to open file + #002: (file name) line (number) in H5F_open(): unable to retrieve VFL class + major: File accessibilty + minor: Can't get value + #003: (file name) line (number) in H5FD_get_class(): can't find object for ID + major: Object atom + minor: Unable to find atom information (already closed?) 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 + #000: (file name) line (number) in H5Fopen(): unable to open file + major: File accessibilty + minor: Unable to open file + #001: (file name) line (number) in H5F__open(): unable to open file + major: File accessibilty + minor: Unable to open file + #002: (file name) line (number) in H5F_open(): unable to retrieve VFL class major: File accessibilty - minor: Can't set value - #001: (file name) line (number) in H5P_verify_apl_and_dxpl(): not the required access property list - major: Property lists - minor: Inappropriate type - #002: (file name) line (number) in H5P_isa_class(): not a property list - major: Invalid arguments to routine - minor: Inappropriate type + minor: Can't get value + #003: (file name) line (number) in H5FD_get_class(): can't find object for ID + major: Object atom + minor: Unable to find atom information (already closed?) diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index 9a36365..f3c6c91 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -187,7 +187,7 @@ public class TestH5E { fail("H5.H5Eget_msg: " + err); } assertNotNull("H5.H5Eget_msg: " + msg, msg); - assertEquals("H5.H5Eget_msg: ", "Invalid arguments to routine", + assertEquals("H5.H5Eget_msg: ", "Object atom", msg); assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, error_msg_type[0]); @@ -215,7 +215,7 @@ public class TestH5E { fail("H5.H5Eget_msg: " + err); } assertNotNull("H5.H5Eget_msg: " + msg, msg); - assertEquals("H5.H5Eget_msg: ", "Inappropriate type", msg); + assertEquals("H5.H5Eget_msg: ", "Unable to find atom information (already closed?)", msg); assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR, error_msg_type[0]); } @@ -289,7 +289,7 @@ public class TestH5E { fail("H5.H5Epop: " + err); } - assertTrue("H5.H5Epop #:" + num_msg, num_msg == 3); + assertTrue("H5.H5Epop #:" + num_msg, num_msg == 4); try { H5.H5Epop(current_stackid, 1); @@ -307,7 +307,7 @@ public class TestH5E { fail("H5.H5Epop: " + err); } - assertTrue("H5.H5Epop", num_msg == 2); + assertTrue("H5.H5Epop", num_msg == 3); } @Test @@ -530,7 +530,7 @@ public class TestH5E { err.printStackTrace(); fail("testH5Ewalk:H5Eget_num " + err); } - assertTrue("testH5Ewalk #:" + num_msg, num_msg == 3); + assertTrue("testH5Ewalk #:" + num_msg, num_msg == 4); try { H5.H5Ewalk2(current_stackid, HDF5Constants.H5E_WALK_UPWARD, walk_cb, walk_data); @@ -540,12 +540,12 @@ public class TestH5E { fail("testH5Ewalk:H5Ewalk2 " + err); } 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==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); + assertTrue("testH5Ewalk:H5Ewalk2 "+((H5E_walk_data)walk_data).walkdata.size(),((H5E_walk_data)walk_data).walkdata.size()==4); + assertTrue("testH5Ewalk:H5Ewalk2 "+((wdata)((H5E_walk_data)walk_data).walkdata.get(0)).line,((wdata)((H5E_walk_data)walk_data).walkdata.get(0)).line==378); + assertTrue("testH5Ewalk:H5Ewalk2 "+((wdata)((H5E_walk_data)walk_data).walkdata.get(1)).line,((wdata)((H5E_walk_data)walk_data).walkdata.get(1)).line==1512); + assertTrue("testH5Ewalk:H5Ewalk2 "+((wdata)((H5E_walk_data)walk_data).walkdata.get(2)).func_name,((wdata)((H5E_walk_data)walk_data).walkdata.get(2)).func_name.compareToIgnoreCase("H5F__open")==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("can't find object for ID")==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("unable to retrieve VFL class")==0); } } diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java index 835ccba..79f75c8 100644 --- a/java/test/TestH5Edefault.java +++ b/java/test/TestH5Edefault.java @@ -92,7 +92,7 @@ public class TestH5Edefault { fail("H5.H5Eget_current_stack: " + err); } assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 3); + num_msg_default == 4); //Save a copy of the current stack and clears the current stack try { @@ -127,7 +127,7 @@ public class TestH5Edefault { fail("H5.H5Eget_current_stack: " + err); } assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, - num_msg == 3); + num_msg == 4); try { H5.H5Eclose_stack(stack_id); @@ -159,7 +159,7 @@ public class TestH5Edefault { fail("H5.H5Eget_current_stack: " + err); } assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 3); + num_msg_default == 4); //Save a copy of the current stack and clears the current stack try { @@ -194,7 +194,7 @@ public class TestH5Edefault { fail("H5.H5Eget_current_stack: " + err); } assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, - num_msg == 3); + num_msg == 4); //Generate errors on default stack try { @@ -213,7 +213,7 @@ public class TestH5Edefault { fail("H5.H5Eget_current_stack: " + err); } assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 3); + num_msg_default == 4); //Remove one message from the current stack try { @@ -225,7 +225,7 @@ public class TestH5Edefault { fail("H5.H5Eget_current_stack: " + err); } assertTrue("H5.H5Eget_current_stack: pop #:" + num_msg_default, - num_msg_default == 2); + num_msg_default == 3); //Verify the copy still has the correct number of messages try { @@ -236,7 +236,7 @@ public class TestH5Edefault { fail("H5.H5Eget_current_stack: " + err); } assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, - num_msg == 3); + num_msg == 4); } @Test(expected = IllegalArgumentException.class) @@ -307,7 +307,7 @@ public class TestH5Edefault { fail("H5.H5Eset_current_stack: " + err); } assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 3); + num_msg == 4); //Save a copy of the current stack try { @@ -331,7 +331,7 @@ public class TestH5Edefault { fail("H5.H5Eset_current_stack: " + err); } assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 3); + num_msg == 4); //Generate errors on default stack try { @@ -350,7 +350,7 @@ public class TestH5Edefault { fail("H5.H5Eget_current_stack: " + err); } assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 3); + num_msg == 4); //Remove one message from the current stack try { @@ -362,7 +362,7 @@ public class TestH5Edefault { fail("H5.H5Eset_current_stack: " + err); } assertTrue("H5.H5Eset_current_stack: pop #:" + num_msg, - num_msg == 2); + num_msg == 3); //Verify the copy still has the correct number of messages try { @@ -373,7 +373,7 @@ public class TestH5Edefault { fail("H5.H5Eset_current_stack: " + err); } assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 3); + num_msg == 4); try { H5.H5Eset_current_stack(stack_id); @@ -384,7 +384,7 @@ public class TestH5Edefault { fail("H5.H5Eset_current_stack: " + err); } assertTrue("H5.H5Eset_current_stack: get_num - " + num_msg, - num_msg == 3); + num_msg == 4); } @Test(expected = IllegalArgumentException.class) @@ -407,7 +407,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Epop: " + err); } - assertTrue("H5.H5Epop before #:" + num_msg, num_msg == 3); + assertTrue("H5.H5Epop before #:" + num_msg, num_msg == 4); try { H5.H5Epop(HDF5Constants.H5E_DEFAULT, 1); num_msg = H5.H5Eget_num(HDF5Constants.H5E_DEFAULT); @@ -416,7 +416,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Epop: " + err); } - assertTrue("H5.H5Epop after #:" + num_msg, num_msg == 2); + assertTrue("H5.H5Epop after #:" + num_msg, num_msg == 3); } @Test(expected = IllegalArgumentException.class) @@ -493,7 +493,7 @@ public class TestH5Edefault { fail("H5.H5Eclear2_with_msg: " + err); } assertTrue("H5.H5Eclear2_with_msg before #:" + num_msg, - num_msg == 3); + num_msg == 4); try { H5.H5Eclear2(HDF5Constants.H5E_DEFAULT); num_msg = H5.H5Eget_num(HDF5Constants.H5E_DEFAULT); -- cgit v0.12 From fa0d7aec1030567f3daa5bd433c86f4dc326cb89 Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 3 Apr 2018 16:57:26 -0500 Subject: Update RELEASE.txt, HISTORY-1_10.txt and INSTALL files with changes from HDF5-1.10.2 release. --- README.txt | 90 ++- release_docs/HISTORY-1_10.txt | 1257 +++++++++++++++++++++++++++++++++++++++++ release_docs/INSTALL | 335 +++-------- release_docs/INSTALL_parallel | 16 +- release_docs/RELEASE.txt | 735 ++---------------------- 5 files changed, 1452 insertions(+), 981 deletions(-) diff --git a/README.txt b/README.txt index 759e412..07c231e 100644 --- a/README.txt +++ b/README.txt @@ -1,38 +1,80 @@ HDF5 version 1.11.2 currently under development + +------------------------------------------------------------------------------ Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ +THE HDF GROUP +--------------- + +The HDF Group is the developer of HDF5®, a high-performance software library and +data format that has been adopted across multiple industries and has become a +de facto standard in scientific and research communities. + +More information about The HDF Group, the HDF5 Community and the HDF5 software +project, tools and services can be found at the Group's website. + + https://www.hdfgroup.org/ + + +DOCUMENTATION +------------- This release is fully functional for the API described in the documentation. -See the RELEASE.txt file in the release_docs/ directory for information -specific to this release of the library. Several INSTALL* files can also be -found in the release_docs/ directory: INSTALL contains instructions for -compiling and installing the library; INSTALL_parallel contains instructions -for installing the parallel version of the library; similarly-named files -contain instructions for several environments on MS Windows systems. + https://portal.hdfgroup.org/display/HDF5/The+HDF5+API + +Full Documentation and Programming Resources for this release can be found at + https://portal.hdfgroup.org/display/HDF5 + +See the RELEASE.txt file in the release_docs/ directory for information specific +to the features and updates included in this release of the library. + +Several more files are located within the release_docs/ directory with specific +details for several common platforms and configurations. + + INSTALL - Start Here. General instructions for compiling and installing the library + INSTALL_CMAKE - instructions for building with CMake (Kitware.com) + INSTALL_parallel - instructions for building and configuring Parallel HDF5 + INSTALL_Windows and INSTALL_Cygwin - MS Windows installations. + + + +HELP AND SUPPORT +---------------- +Information regarding Help Desk and Support services is available at + + https://portal.hdfgroup.org/display/support/The+HDF+Help+Desk + + -Documentation for this release can be found at the following URL: - http://www.hdfgroup.org/HDF5/doc/. +FORUM and NEWS +-------------- +The following public forums are provided for public announcements and discussions +of interest to the general HDF5 Community. -The following mailing lists are currently set up for HDF5 Library users: + Homepage of the Forum + https://forum.hdfgroup.org - news - For announcements of HDF5 related developments, - not a discussion list. + News and Announcement + https://forum.hdfgroup.org/c/news-and-announcements-from-the-hdf-group - hdf-forum - For general discussion of the HDF5 library with - other users. + HDF5 and HDF4 Topics + https://forum.hdfgroup.org/c/hdf5 + +These forums are provided as an open and public service for searching and reading. +Posting requires completing a simple registration and allows one to join in the +conversation. Please read the following instructions pertaining to the Forum's +use and configuration + https://forum.hdfgroup.org/t/quickstart-guide-welcome-to-the-new-hdf-forum -To subscribe to a list, send mail to "-subscribe@lists.hdfgroup.org". -where is the name of the list. For example, send a request -to subscribe to the 'news' mail list to the following address: - news-subscribe@lists.hdfgroup.org -Messages sent to the list should be addressed to "@lists.hdfgroup.org". +SNAPSHOTS, PREVIOUS RELEASES AND SOURCE CODE +-------------------------------------------- +Periodically development code snapshots are provided at the following URL: + https://gamma.hdfgroup.org/ftp/pub/outgoing/hdf5/snapshots/ -Periodic code snapshots are provided at the following URL: - ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/hdf5/snapshots -Please read the README.txt file in that directory before working with a -library snapshot. +Source packages for current and previous releases are located at: + https://portal.hdfgroup.org/display/support/Downloads -The HDF5 website is located at http://hdfgroup.org/HDF5/ +Development code is available at our BitBucket Server: + https://bitbucket.hdfgroup.org/projects/HDFFV/repos/hdf5/browse -Bugs should be reported to help@hdfgroup.org. diff --git a/release_docs/HISTORY-1_10.txt b/release_docs/HISTORY-1_10.txt index 52eb273..9887a54 100644 --- a/release_docs/HISTORY-1_10.txt +++ b/release_docs/HISTORY-1_10.txt @@ -3,12 +3,1269 @@ HDF5 History This file contains development history of the HDF5 1.10 branch +04. Release Information for hdf5-1.10.2 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.2%%%% + +HDF5 version 1.10.2 released on 2018-03-29 +================================================================================ + + +INTRODUCTION + +This document describes the differences between this release and the previous +HDF5 release. It contains information on the platforms tested and known +problems in this release. For more details check the HISTORY*.txt files in the +HDF5 source. + +Note that documentation in the links below will be updated at the time of each +final release. + +Links to HDF5 documentation can be found on The HDF5 web page: + + https://portal.hdfgroup.org/display/HDF5/HDF5 + +The official HDF5 releases can be obtained from: + + https://www.hdfgroup.org/downloads/hdf5/ + +Changes from Release to Release and New Features in the HDF5-1.10.x release series +can be found at: + + https://portal.hdfgroup.org/display/HDF5/HDF5+Application+Developer%27s+Guide + +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.10.1 +- Supported Platforms +- Tested Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration and Build Systems: + -------------------------------- + - CMake builds + -------------- + + - Changed minimum CMake required version to 3.10. + + This change removed the need to support a copy of the FindMPI.cmake module, + which has been removed, along with its subfolder in the config/cmake_ext_mod + location. + + (ADB - 2018/03/09) + + - Added pkg-config file generation + + Added pkg-config file generation for the C, C++, HL, and HL C++ libraries. + In addition, builds on Linux will create h5cc, h5c++, h5hlcc, and h5hlc++ scripts in the bin + directory that use the pkg-config files. The scripts can be used to build HDF5 C and C++ + applications (i.e, similar to the compiler scripts produced by the Autotools builds). + + (ADB - 2018/03/08, HDFFV-4359) + + - Refactored use of CMAKE_BUILD_TYPE for new variable, which understands + the type of generator in use. + + Added new configuration macros to use new HDF_BUILD_TYPE variable. This + variable is set correctly for the type of generator being used for the build. + + (ADB - 2018/01/08, HDFFV-10385, HDFFV-10296) + + - Autotools builds + ------------------ + + - Removed version-specific gcc/gfortran flags for version 4.0 (inclusive) + and earlier. + + The config/gnu-flags file, which is sourced as a part of the configure + process, adds version-specific flags for use when building HDF5. Most of + these flags control warnings and do not affect the final product. + + Flags for older versions of the compiler were consolidated into the + common flags section. Moving these flags simplifies maintenance of + the file. + + The upshot of this is that building with ancient versions of gcc + (<= 4.0) will possibly no longer work without hand-hacking the file + to remove the flags not understood by that version of the compiler. + Nothing should change when building with gcc >= 4.1. + + (DER - 2017/05/31, HDFFV-9937) + + - -fno-omit-frame-pointer was added when building with debugging symbols + enabled. + + Debugging symbols can be enabled independently of the overall build + mode in both the autotools and CMake. This allows (limited) debugging + of optimized code. Since many debuggers rely on the frame pointer, + we've disabled this optimization when debugging symbols are requested + (e.g.: via building with --enable-symbols). + + (DER - 2017/05/31, HDFFV-10226) + + + Library: + -------- + - Added an enumerated value to H5F_libver_t for H5Pset_libver_bounds(). + + Currently, the library defines two values for H5F_libver_t and supports + only two pairs of (low, high) combinations as derived from these values. + Thus the bounds setting via H5Pset_libver_bounds() is rather restricted. + + Added an enumerated value (H5F_LIBVER_V18) to H5F_libver_t and + H5Pset_libver_bounds() now supports five pairs of (low, high) combinations + as derived from these values. This addition provides the user more + flexibility in setting bounds for object creation. + + (VC - 2018/03/14) + + - Added prefix option to VDS files. + + Currently, VDS source files must be in the active directory to be + found by the virtual file. Adding the option of a prefix to be set + on the virtual file, using a data access property list (DAPL), + allows the source files to locate at an absolute or relative path + to the virtual file. + Private utility functions in H5D and H5L packages merged into single + function in H5F package. + + New public APIs: + herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); + ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); + The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. + + (ADB - 2017/12/12, HDFFV-9724, HDFFV-10361) + + - H5FDdriver_query() API call added to the C library. + + This new library call allows the user to query a virtual file driver + (VFD) for the feature flags it supports (listed in H5FDpublic.h). + This can be useful to determine if a VFD supports SWMR, for example. + + Note that some VFDs have feature flags that may only be present + after a file has been created or opened (e.g.: the core VFD will + have the H5FD_FEAT_POSIX_COMPAT_HANDLE flag set if the backing + store is switched on). Since the new API call queries a generic VFD + unassociated with a file, these flags will never be returned. + + (DER - 2017/05/31, HDFFV-10215) + + - H5FD_FEAT_DEFAULT_VFD_COMPATIBLE VFD feature flag added to the C library. + + This new feature flag indicates that the VFD is compatible with the + default VFD. VFDs that set this flag create single files that follow + the canonical HDF5 file format. + + (DER - 2017/05/31, HDFFV-10214) + + - The H5I_REFERENCE value in the H5I_type_t enum (defined in H5Ipublic.h) + has been marked as deprecated. + + This ID type value is not used in the C library. i.e.: There are no + hid_t values that are of ID type H5I_REFERENCE. + + This enum value will be removed in a future major version of the library. + The code will remain unchanged in the HDF5 1.10.x releases and branches. + + (DER - 2017/04/05, HDFFV-10252) + + + Parallel Library: + ----------------- + - Enabled compression for parallel applications. + + With this release parallel applications can create and write compressed + datasets (or the datasets with the filters such as Fletcher32 applied). + + (EIP - 2018/03/29) + + - Addressed slow file close on some Lustre file systems. + + Slow file close has been reported on some Lustre file systems. + While the ultimate cause is not understood fully, the proximate + cause appears to be long delays in MPI_File_set_size() calls at + file close and flush. + + To minimize this problem pending a definitive diagnosis and fix, + PHDF5 has been modified to avoid MPI_File_set_size() calls when + possible. This is done by comparing the library's EOA (End of + Allocation) with the file systems EOF, and skipping the + MPI_File_set_size() call if the two match. + + (JRM - 2018/03/29) + + - Optimized parallel open/location of the HDF5 super-block. + + 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 + 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) + + - Added large (>2GB) 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/09/10, HDFFV-8839) + + + C++ Library: + ------------ + - The following C++ API wrappers have been added to the C++ Library: + + H5Lcreate_soft: + // Creates a soft link from link_name to target_name. + void link(const char *target_name, const char *link_name,...) + void link(const H5std_string& target_name,...) + + + H5Lcreate_hard: + // Creates a hard link from new_name to curr_name. + void link(const char *curr_name, const Group& new_loc,...) + void link(const H5std_string& curr_name, const Group& new_loc,...) + + // Creates a hard link from new_name to curr_name in same location. + void link(const char *curr_name, const hid_t same_loc,...) + void link(const H5std_string& curr_name, const hid_t same_loc,...) + + Note: previous version of H5Location::link will be deprecated. + + + H5Lcopy: + // Copy an object from a group of file to another. + void copyLink(const char *src_name, const Group& dst,...) + void copyLink(const H5std_string& src_name, const Group& dst,...) + + // Copy an object from a group of file to the same location. + void copyLink(const char *src_name, const char *dst_name,...) + void copyLink(const H5std_string& src_name,...) + + + H5Lmove: + // Rename an object in a group or file to a new location. + void moveLink(const char* src_name, const Group& dst,...) + void moveLink(const H5std_string& src_name, const Group& dst,...) + + // Rename an object in a group or file to the same location. + void moveLink(const char* src_name, const char* dst_name,...) + void moveLink(const H5std_string& src_name,...) + + Note: previous version H5Location::move will be deprecated. + + + H5Ldelete: + // Removes the specified link from this location. + void unlink(const char *link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) + void unlink(const H5std_string& link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) + + Note: additional parameter is added to previous H5Location::unlink. + + + H5Tencode and H5Tdecode: + // Creates a binary object description of this datatype. + void DataType::encode() - C API H5Tencode() + + // Returns the decoded type from the binary object description. + DataType::decode() - C API H5Tdecode() + ArrayType::decode() - C API H5Tdecode() + CompType::decode() - C API H5Tdecode() + DataType::decode() - C API H5Tdecode() + EnumType::decode() - C API H5Tdecode() + FloatType::decode() - C API H5Tdecode() + IntType::decode() - C API H5Tdecode() + StrType::decode() - C API H5Tdecode() + VarLenType::decode() - C API H5Tdecode() + + + H5Lget_info: + // Returns the information of the named link. + H5L_info_t getLinkInfo(const H5std_string& link_name,...) + + (BMR - 2018/03/11, HDFFV-10149) + + - Added class LinkCreatPropList for link create property list. + + (BMR - 2018/03/11, HDFFV-10149) + + - Added overloaded functions H5Location::createGroup to take a link + creation property list. + Group createGroup(const char* name, const LinkCreatPropList& lcpl) + Group createGroup(const H5std_string& name, const LinkCreatPropList& lcpl) + + (BMR - 2018/03/11, HDFFV-10149) + + - A document is added to the HDF5 C++ API Reference Manual to show the + mapping from a C API to C++ wrappers. It can be found from the main + page of the C++ API Reference Manual. + + (BMR - 2017/10/17, HDFFV-10151) + + + Java Library: + ---------------- + - Wrapper added for enabling the error stack. + + H5error_off would disable the error stack reporting. In order + to re-enable the reporting, the error stack info needs to be + saved so that H5error_on can revert state. + + (ADB - 2018/03/13, HDFFV-10412) + + - Wrappers were added for the following C APIs: + H5Pset_evict_on_close + H5Pget_evict_on_close + H5Pset_chunk_opts + H5Pget_chunk_opts + H5Pset_efile_prefix + H5Pget_efile_prefix + H5Pset_virtual_prefix + H5Pget_virtual_prefix + + (ADB - 2017/12/20) + + - The H5I_REFERENCE value in the H5I_type_t enum (defined in H5Ipublic.h) + has been marked as deprectated. + + JNI code which refers to this value will be removed in a future + major version of the library. The code will remain unchanged in the + 1.10.x releases and branches. + + See the C library section, above, for further information. + + (HDFFV-10252, DER, 2017/04/05) + + + Tools: + ------ + - h5diff has a new option to display 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) + + +Support for new platforms, languages and compilers. +======================================= + - None + +Bug Fixes since HDF5-1.10.1 release +================================== + + Library + ------- + - The data read after a direct chunk write to a chunked dataset with + one chunk was incorrect. + + The problem was due to the passing of a null dataset pointer to + the insert callback for the chunk index in the routine + H5D__chunk_direct_write() in H5Dchunk.c + The dataset was a single-chunked dataset which will use the + single chunk index when latest format was enabled on file creation. + The single chunk index was the only index that used this pointer + in the insert callback. + + Passed the dataset pointer to the insert callback for the chunk + index in H5D__chunk_direct_write(). + + (VC - 2018/03/20, HDFFV-10425) + + - Added public routine H5DOread_chunk to the high-level C library. + + The patch for H5DOwrite_chunk() to write an entire chunk to the file + directly was contributed by GE Healthcare and integrated by The HDF Group + developers. + + (VC - 2017/05/19, HDFFV-9934) + + - Freeing of object header after failed checksum verification. + + It was discovered that the object header (in H5Ocache.c) was not released properly + when the checksum verification failed and a re-load of the object + header was needed. + + Freed the object header that failed the chksum verification only + after the new object header is reloaded, deserialized and set up. + + (VC - 2018/03/14, HDFFV-10209) + + - Updated H5Pset_evict_on_close in H5Pfapl.c + + Changed the minor error number from H5E_CANTSET to H5E_UNSUPPORTED for + parallel library. + + (ADB - 2018/03/06, HDFFV-10414) + + - Fixed the problems with the utility function that could not handle lowercase + Windows drive letters. + + Added call to upper function for drive letter. + + (ADB - 2017/12/18, HDFFV-10307) + + - Fixed H5Sencode() bug when the number of elements selected was > 2^32. + + H5Sencode() incorrectly encodes dataspace selection with number of + elements exceeding 2^32. When decoding such selection via H5Sdecode(), + the number of elements in the decoded dataspace is not the same as + what is encoded. This problem exists for H5S_SEL_HYPER and + H5S_SEL_POINTS encoding. + + The cause of the problem is due to the fact that the library uses 32 bits to + encode counts and block offsets for the selection. + The solution is to use the original 32 bit encodings if possible, + but use a different way to encode selection if more that 32 bits is needed. + See details in the RFC: H5Sencode/H5Sdecode Format Change i + https://bitbucket.hdfgroup.org/projects/HDFFV/repos/hdf5doc/browse/RFCs/HDF5_Library/H5SencodeFormatChange. + + (VC - 2017/11/28, HDFFV-9947) + + - Fixed filter plugin handling in H5PL.c and H5Z.c to not require i availability of + dependent libraries (e.g., szip or zlib). + + It was discovered that the dynamic loading process used by + filter plugins had issues with library dependencies. + + CMake build process changed to use LINK INTERFACE keywords, which + allowed HDF5 C library to make dependent libraries private. The + filter plugin libraries no longer require dependent libraries + (such as szip or zlib) to be available. + + (ADB - 2017/11/16, HDFFV-10328) + + - Fixed rare object header corruption bug. + + In certain cases, such as when converting large attributes to dense + storage, an error could occur which would either fail an assertion or + cause file corruption. Fixed and added test. + + (NAF - 2017/11/14, HDFFV-10274) + + - Updated 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, HDFFV-10319) + + - h5dump produced SEGFAULT when dumping corrypted file. + + The behavior was due to the error in the internal function H5HL_offset_into(). + + (1) Fixed H5HL_offset_into() to return error when offset exceeds heap data + block size. + (2) Fixed other places in the library that call this routine to detect + error routine. + + (VC - 2017/08/30, HDFFV-10216) + + - Fixes for paged aggregation feature. + + Skip test in test/fheap.c when: + (1) multi/split drivers and + (2) persisting free-space or using paged aggregation strategy + + (VC, 2017/07/10) + + Changes made based on RFC review comments: + (1) Added maximum value for file space page size + (2) Dropped check for page end metadata threshold + (3) Removed "can_shrink" and "shrink" callbacks for small section class + + (VC - 2017/06/09) + + - Fixed for 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. + + (VC - 2017/07/10, HDFFV-10217) + + - Fixed for 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. + + (VC - 2017/07/05, HDFFV-7853) + + - An uninitialized struct could cause a memory access error when using + variable-length or reference types in a compressed, chunked dataset. + + A struct containing a callback function pointer and a pointer to some + associated data was used before initialization. This could cause a + memory access error and system crash. This could only occur under + unusual conditions when using variable-lenth and reference types in + a compressed, chunked dataset. + + On recent versions of Visual Studio, when built in debug mode, the + debug heap will complain and cause a crash if the code in question + is executed (this will cause the objcopy test to fail). + + (DER - 2017/11/21, HDFFV-10330) + + - Fixed collective metadata writes on file close. + + It was discovered that metadata was being written twice as part of + the parallel file close behavior, once independently and once + collectively. + + A fix for this error was included as part of the parallel compression + feature but remained undocumented here. + + (RAW - 2017/12/01, HDFFV-10272) + + - If an HDF5 file contains a filter pipeline message with a 'number of + filters' field that exceeds the maximum number of allowed filters, + the error handling code will attempt to dereference a NULL pointer. + + This issue was reported to The HDF Group as issue #CVE-2017-17505. + https://security-tracker.debian.org/tracker/CVE-2017-17505 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2017-17505 + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + This problem arose because the error handling code assumed that + the 'number of filters' field implied that a dynamic array of that + size had already been created and that the cleanup code should + iterate over that array and clean up each element's resources. If + an error occurred before the array has been allocated, this will + not be true. + + This has been changed so that the number of filters is set to + zero on errors. Additionally, the filter array traversal in the + error handling code now requires that the filter array not be NULL. + + (DER - 2018/02/06, HDFFV-10354) + + - If an HDF5 file contains a filter pipeline message which contains + a 'number of filters' field that exceeds the actual number of + filters in the message, the HDF5 C library will read off the end of + the read buffer. + + This issue was reported to The HDF Group as issue #CVE-2017-17506. + https://security-tracker.debian.org/tracker/CVE-2017-17506 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2017-17506 + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + The problem was fixed by passing the buffer size with the buffer + and ensuring that the pointer cannot be incremented off the end + of the buffer. A mismatch between the number of filters declared + and the actual number of filters will now invoke normal HDF5 + error handling. + + (DER - 2018/02/26, HDFFV-10355) + + - If an HDF5 file contains a malformed compound datatype with a + suitably large offset, the type conversion code can run off + the end of the type conversion buffer, causing a segmentation + fault. + + This issue was reported to The HDF Group as issue #CVE-2017-17507. + https://security-tracker.debian.org/tracker/CVE-2017-17506 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2017-17506 + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + THE HDF GROUP WILL NOT FIX THIS BUG AT THIS TIME + + Fixing this problem would involve updating the publicly visible + H5T_conv_t function pointer typedef and versioning the API calls + which use it. We normally only modify the public API during + major releases, so this bug will not be fixed at this time. + + (DER - 2018/02/26, HDFFV-10356) + + - If an HDF5 file contains a malformed compound type which contains + a member of size zero, a division by zero error will occur while + processing the type. + + This issue was reported to The HDF Group as issue #CVE-2017-17508. + https://security-tracker.debian.org/tracker/CVE-2017-17508 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2017-17508 + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + Checking for zero before dividing fixes the problem. Instead of the + division by zero, the normal HDF5 error handling is invoked. + + (DER - 2018/02/26, HDFFV-10357) + + - If an HDF5 file contains a malformed symbol table node that declares + it contains more symbols than it actually contains, the library + can run off the end of the metadata cache buffer while processing + the symbol table node. + + This issue was reported to The HDF Group as issue #CVE-2017-17509. + https://security-tracker.debian.org/tracker/CVE-2017-17509 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2017-17509 + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + Performing bounds checks on the buffer while processing fixes the + problem. Instead of the segmentation fault, the normal HDF5 error + handling is invoked. + + (DER - 2018/03/12, HDFFV-10358) + + - Fixed permissions passed to open(2) on file create. + + On Windows, the POSIX permissions passed to open(2) when creating files + were only incidentally correct. They are now set to the correct value of + (_S_IREAD | _S_IWRITE). + + On other platforms, the permissions were set to a mix of 666, 644, and + 000. They are now set uniformly to 666. + + (DER - 2017/04/28, HDFFV-9877) + + - The H5FD_FEAT_POSIX_COMPAT_HANDLE flag is no longer used to determine + if a virtual file driver (VFD) is compatible with SWMR. + + Use of this VFD feature flag was not in line with the documentation in + the public H5FDpublic.h file. In particular, it was being used as a + proxy for determining if SWMR I/O is allowed. This is unecessary as we + already have a feature flag for this (H5FD_SUPPORTS_SWMR_IO). + + (DER - 2017/05/31, HDFFV-10214) + + + Configuration + ------------- + - CMake changes + + - Updated CMake commands configuration. + + A number of improvements were made to the CMake commands. Most + changes simplify usage or eliminate unused constructs. Also, + some changes support better cross-platform support. + + (ADB - 2018/02/01, HDFFV-10398) + + - Corrected usage of CMAKE_BUILD_TYPE variable. + + The use of the CMAKE_BUILD_TYPE is incorrect for multi-config + generators (Visual Studio and XCode) and is optional for single + config generators. Created a new macro to check + GLOBAL PROPERTY -> GENERATOR_IS_MULTI_CONFIG + Created two new HDF variable, HDF_BUILD_TYPE and HDF_CFG_BUILD_TYPE. + Defaults for these variables is "Release". + + (ADB - 2018/01/10, HDFFV-10385) + + - Added replacement of fortran flags if using static CRT. + + Added TARGET_STATIC_CRT_FLAGS call to HDFUseFortran.cmake file in + config/cmake_ext_mod folder. + + (ADB - 2018/01/08, HDFFV-10334) + + + - The hdf5 library used shared szip and zlib, which needlessly required + applications to link with the same szip and zlib libraries. + + Changed the target_link_libraries commands to use the static libs. + Removed improper link duplication of szip and zlib. + Adjusted the link dependencies and the link interface values of + the target_link_libraries commands. + + (ADB - 2017/11/14, HDFFV-10329) + + - CMake MPI + + CMake implementation for MPI was problematic and would create incorrect + MPI library references in the hdf5 libraries. + + Reworked the CMake MPI code to properly create CMake targets. Also merged + the latest CMake FindMPI.cmake changes to the local copy. This is necessary + until HDF changes the CMake minimum to 3.9 or greater. + + (ADB - 2017/11/02, HDFFV-10321) + + - Corrected FORTRAN_HAVE_C_LONG_DOUBLE processing in the autotools. + + A bug in the autotools Fortran processing code always set the + FORTRAN_HAVE_C_LONG_DOUBLE variable to be true regardless of + whether or not a C long double type was present. + + This would cause compilation failures on platforms where a C + long double type was not available and the Fortran wrappers + were being built. + + (DER - 2017/07/05, HDFFV-10247) + + - The deprecated --enable-production and --enable-debug configure options + failed to emit errors when passed an empty string + (e.g.: --enable-debug=""). + + Due to the way we checked for these options being set, it was possible + to avoid the error message and continue configuration if an empty string + was passed to the option. + + Any use of --enable-production or --enable-debug will now halt the + configuration step and emit a helpful error message + (use --enable-build-mode=debug|production instead). + + (DER - 2017/07/05, HDFFV-10248) + + - CMake + + 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 + use of the HDFTEST_COPY_FILE macro. + + (ADB - 2017/07/12, HDFFV-10254) + + - CMake test execution environment + + The parallel HDF5 test: 't_pread' assumed the use of autotools + and the directory structure associated with that testing approach. + Modified the test code to check whether the 'h5jam' utility can be + found in the same directory as the test executable (which is + preferred directory structure utilized by cmake) and if found + will invoke the tool directly rather than utilizing a relative path. + + (RAW - 2017/11/03, HDFFV-10318) + + - Fortran compilation fails for xlf and CMake builds. + + Fixed CMake shared library build for H5match_types and modules + + (MSB - 2017/12/19, HDFFV-10363) + + - Shared libraries fail test on OSX with Fortran enabled with CMake. + + Fixed by removing the F77 use of EQUIVALENCE and COMMON, replaced + using MODULES. Updated CMake. + + (MSB - 2017/12/07, HDFFV-10223) + + - The bin/trace script now emits an error code on problems and autogen.sh + will fail if bin/trace fails. + + The bin/trace script adds tracing functionality to public HDF5 API calls. + It is only of interest to developers who modify the HDF5 source code. + Previously, bin/trace just wrote an error message to stdout when it + encountered problems, so autogen.sh processing did not halt and a broken + version of the library could be built. The script will now return an + error code when it encounters problems, and autogen.sh will fail. + + This only affects users who run autogen.sh to rebuild the Autotools files, + which is not necessary to build HDF5 from source in official releases of the + library. CMake users are unaffected as bin/trace is not run via CMake + at this time. + + (DER - 2017/04/25, HDFFV-10178) + + - FC_BASENAME was changed from gfortran40 to gfortran in a few places. + + In the autotools, FC_BASENAME was set to gfortran40 in a few locations + (config/gnu-fflags and config/freebsd). This was probably a historical + artifact and did not seem to affect many users. + + The value is now correctly set to gfortran. + + (DER - 2017/05/26, HDFFV-10249) + + - The ar flags were changed to -cr (was: -cru) + + The autotools set the flags for ar to -cru by default. The -u flag, + which allows selective replacement of only the members which have + changed, raises warnings on some platforms, so the flags are now set to + -cr via AR_FLAGS in configure.ac. This causes the static library to + always be completely recreated from the object files on each build. + + (DER - 2017/11/15, HDFFV-10428) + + + Fortran + -------- + - Fixed compilation errors when using Intel 18 Fortran compilers + (MSB - 2017/11/3, HDFFV-10322) + + Tools + ----- + - h5clear + + An enhancement to the tool in setting a file's stored EOA. + + It was discovered that a crashed file's stored EOA in the superblock + was smaller than the actual file's EOF. When the file was reopened + and closed, the library truncated the file to the stored EOA. + + Added an option to the tool in setting the file's stored EOA in the + superblock to the maximum of (EOA, EOF) + increment. + An option was also added to print the file's EOA and EOF. + + (VC - 2018/03/14, HDFFV-10360) + + - h5repack + + h5repack changes the chunk parameters when a change of layout is not + specified and a filter is applied. + + HDFFV-10297, HDFFV-10319 reworked code for h5repack and h5diff code + in the tools library. The check for an existing layout was incorrectly + placed into an if block and not executed. The check was moved into + the normal path of the function. + + (ADB - 2018/02/21, HDFFV-10412) + + - h5dump + + The tools library will hide the error stack during file open. + + While this is preferable almost always, there are reasons to enable + display of the error stack when a tool will not open a file. Adding an + optional argument to the --enable-error-stack will provide this use case. + As an optional argument it will not affect the operation of the + --enable-error-stack. h5dump is the only tool to implement this change. + + (ADB - 2018/02/15, HDFFV-10384) + + - h5dump + + h5dump would output an indented blank line in the filters section. + + h5dump overused the h5tools_simple_prefix function, which is a + function intended to account for the data index (x,y,z) option. + Removed the function call for header information. + + (ADB - 2018/01/25, HDFFV-10396) + + - h5repack + + h5repack incorrectly searched internal object table for name. + + h5repack would search the table of objects for a name, if the + name did not match it tried to determine if the name without a + leading slash would match. The logic was flawed! The table + stored names(paths) without a leading slash and did a strstr + of the table path to the name. + The assumption was that if there was a difference of one then + it was a match, however "pressure" would match "/pressure" as + well as "/pressure1", "/pressure2", etc. Changed logic to remove + any leading slash and then do a full compare of the name. + + (ADB - 2018/01/18, HDFFV-10393) + + - h5repack + + h5repack failed to handle command line parameters for customer filters. + + User defined filter parameter conversions would fail when integers were + represented on the command line with character string + larger then 9 characters. Increased local variable array for storing + the current command line parameter to prevent buffer overflows. + + (ADB - 2018/01/17, HDFFV-10392) + + - h5diff + + h5diff seg faulted if comparing VL strings against fixed strings. + + Reworked solution for HDFFV-8625 and HDFFV-8639. Implemented the check + for string objects of same type in the diff_can_type function by + adding an if(tclass1 == H5T_STRING) block. This "if block" moves the + same check that was added for attributes to this function, which is + used by all object types. This function handles complex type structures. + Also added a new test file in h5diffgenttest for testing this issue + and removed the temporary files used in the test scripts. + + (ADB - 2018/01/04, HDFFV-8745) + + - h5repack + + h5repack failed to copy a dataset with existing filter. + + Reworked code for h5repack and h5diff code in the 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. + Note, h5repack output display has changed to clarify the individual + steps of the repack process. The output indicates if an operation + applies to all objects. Lines with notation and no information + have been removed. + + (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) + + - 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-10269) + + - 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) + + - h5repack + + Added tests to h5repack.sh.in to verify options added for paged + aggregation work as expected. + + (VC - 2017/08/03) + + - 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. + + 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. + + 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/15, HDFFV-10219) + + - h5repack + + h5repack did not maintain the creation order flag of the root + group. + + 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 applies to the traversing of the + original file, on the command line. + + (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: + ------ + - H5DOwrite_chunk() problems when overwriting an existing chunk with + no filters enabled. + + When overwriting chunks and no filters were being used, the library would + fail (when asserts are enabled, e.g. debug builds) or incorrectly + insert additional chunks instead of overwriting (when asserts are not + enabled, e.g. production builds). + + This has been fixed and a test was added to the hl/test_dset_opt test. + + (DER - 2017/05/11, HDFFV-10187) + + C++ APIs + -------- + - Removal of memory leaks. + + A private function was inadvertently called, causing memory leaks. This + is now fixed. + + (BMR - 2018/03/12 - User's reported in email) + + Testing + ------- + - Memory for three variables in testphdf5's coll_write_test was malloced + but not freed, leaking memory when running the test. + + The variables' memory is now freed. + + (LRK - 2018/03/12, HDFFV-10397) + + - Refactored the testpar/t_bigio.c test to include ALARM macros + + Changed the test to include the ALARM_ON and ALARM_OFF macros which + are intended to prevent nightly test hangs that have been observed + with this particular parallel test example. The code was also modified to + simplify status reporting (only from MPI rank 0) and additional + status checking added. + + (RAW - 2017/11/08, HDFFV-10301) + + +Supported Platforms +=================== + + Linux 2.6.32-696.16.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + 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 17.0.0.098 Build 20160721 + 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/ 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) + + 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.0 from Xcode 7.3 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2 + + Mac OS Sierra 10.12.6 Apple LLVM version 8.1.0 (clang/clang++-802.0.42) + 64-bit gfortran GNU Fortran (GCC) 7.1.0 + (swallow/kite) Intel icc/icpc/ifort version 17.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.9.3, 5.3.0, 6.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 17.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.4.196 Build 20170411 + 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) + GCC Version 7.1.0 + OpenMPI 3.0.0-GCC-7.2.0-2.29 + Intel(R) C (icc) and C++ (icpc) compilers + Version 17.0.0.098 Build 20160721 + with NAG Fortran Compiler Release 6.1(Tozai) + + Linux 3.10.0-327.10.1.el7 MPICH 3.2 compiled with GCC 5.3.0 + #1 SMP x86_64 GNU/Linux + (moohan) + + 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. + + Three tests fail with OpenMPI 3.0.0/GCC-7.2.0-2.29: + testphdf5 (ecdsetw, selnone, cchunk1, cchunk3, cchunk4, and actualio) + t_shapesame (sscontig2) + t_pflush1/fails on exit + The first two tests fail attempting collective writes. + + 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.1%%%% HDF5 version 1.10.1 released on 2017-04-27 diff --git a/release_docs/INSTALL b/release_docs/INSTALL index 3709a58..baad559 100644 --- a/release_docs/INSTALL +++ b/release_docs/INSTALL @@ -3,10 +3,11 @@ Instructions for the Installation of HDF5 Software ================================================== This file provides instructions for installing the HDF5 software. -If you have any problems with the installation, please see The HDF Group's -support page at the following location: - http://www.hdfgroup.org/services/support.html +For help with installing, questions can be posted to the HDF Forum or sent to the HDF Helpdesk: + + HDF Forum: https://forum.hdfgroup.org/ + HDF Helpdesk: https://portal.hdfgroup.org/display/support/The+HDF+Help+Desk CONTENTS -------- @@ -31,59 +32,34 @@ CONTENTS 4.3. Configuring 4.3.1. Specifying the installation directories 4.3.2. Using an alternate C compiler - 4.3.3. Configuring for 64-bit support - 4.3.4. Additional compilation flags - 4.3.5. Compiling HDF5 wrapper libraries - 4.3.6. Specifying other programs - 4.3.7. Specifying other libraries and headers - 4.3.8. Static versus shared linking - 4.3.9. Optimization versus symbolic debugging - 4.3.10. Parallel versus serial library - 4.3.11. Threadsafe capability - 4.3.12. Backward compatibility + 4.3.3. Additional compilation flags + 4.3.4. Compiling HDF5 wrapper libraries + 4.3.5. Specifying other programs + 4.3.6. Specifying other libraries and headers + 4.3.7. Static versus shared linking + 4.3.8. Optimization versus symbolic debugging + 4.3.9. Parallel versus serial library + 4.3.10. Threadsafe capability + 4.3.11. Backward compatibility 4.4. Building 4.5. Testing 4.6. Installing HDF5 5. Using the Library - 6. Support - - A. Warnings about compilers - A.1. GNU (Intel platforms) - A.2. DEC - A.3. SGI (Irix64 6.2) - A.4. Windows/NT - - B. Large (>2GB) versus small (<2GB) file capability - - C. Building and testing with other compilers - C.1. Building and testing with Intel compilers - C.2. Building and testing with PGI compilers ***************************************************************************** 1. Obtaining HDF5 The latest supported public release of HDF5 is available from - ftp://ftp.hdfgroup.org/HDF5/current/src. For Unix and UNIX-like + https://www.hdfgroup.org/downloads/hdf5/. For Unix and UNIX-like platforms, it is available in tar format compressed with gzip. For Microsoft Windows, it is in ZIP format. - The HDF team also makes snapshots of the source code available on - a regular basis. These snapshots are unsupported (that is, the - HDF team will not release a bug-fix on a particular snapshot; - rather any bug fixes will be rolled into the next snapshot). - Furthermore, the snapshots have only been tested on a few - machines and may not test correctly for parallel applications. - Snapshots, in a limited number of formats, can be found on THG's - development FTP server: - - ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/hdf5/snapshots - 2. Quick installation For those who don't like to read ;-) the following steps can be used - to configure, build, test, and install the HDF5 Library, header files, + to configure, build, test, and install the HDF5 library, header files, and support programs. For example, to install HDF5 version X.Y.Z at location /usr/local/hdf5, use the following steps. @@ -125,28 +101,30 @@ CONTENTS 3. HDF5 dependencies 3.1. Zlib - The HDF5 Library includes a predefined compression filter that + The HDF5 library includes a predefined compression filter that uses the "deflate" method for chunked datasets. If zlib-1.1.2 or later is found, HDF5 will use it. Otherwise, HDF5's predefined compression method will degenerate to a no-op; the compression filter will succeed but the data will not be compressed. 3.2. Szip (optional) - The HDF5 Library includes a predefined compression filter that + The HDF5 library includes a predefined compression filter that uses the extended-Rice lossless compression algorithm for chunked - datasets. For more information about Szip compression and license - terms, see http://hdfgroup.org/doc_resource/SZIP/. + datasets. For information on Szip compression, license terms, + and obtaining the Szip source code, see: + + https://portal.hdfgroup.org/display/HDF5/Szip+Compression+in+HDF+Products - The Szip source code can be obtained from the HDF5 Download page - http://www.hdfgroup.org/HDF5/release/obtain5.html#extlibs. Building - instructions are available with the Szip source code. + Building instructions are available with the Szip source code. The HDF Group does not distribute separate Szip precompiled libraries, - but the HDF5 binaries available from - http://www.hdfgroup.org/HDF5/release/obtain5.html include - the Szip encoder enabled binary for the corresponding platform. + but the HDF5 pre-built binaries provided on The HDF Group download page + include the Szip library with the encoder enabled. These can be found + here: - To configure the HDF5 Library with the Szip compression filter, use + https://www.hdfgroup.org/downloads/hdf5/ + + To configure the HDF5 library with the Szip compression filter, use the '--with-szlib=/PATH_TO_SZIP' flag. For more information, see section 4.3.7, "Specifying other libraries and headers." @@ -204,20 +182,6 @@ CONTENTS $ cd build-fortran $ ../hdf5-X.Y.Z/configure --enable-fortran ... - Unfortunately, this does not work on recent Irix platforms (6.5? - and later) because that `make' does not understand the VPATH variable. - However, HDF5 also supports Irix `pmake' which has a .PATH target - which serves a similar purpose. Here's what the Irix man pages say - about VPATH, the facility used by HDF5 makefiles for this feature: - - The VPATH facility is a derivation of the undocumented - VPATH feature in the System V Release 3 version of make. - System V Release 4 has a new VPATH implementation, much - like the pmake(1) .PATH feature. This new feature is also - undocumented in the standard System V Release 4 manual - pages. For this reason it is not available in the IRIX - version of make. The VPATH facility should not be used - with the new parallel make option. 4.3. Configuring HDF5 uses the GNU autoconf system for configuration, which @@ -243,7 +207,7 @@ CONTENTS 4.3.1. Specifying the installation directories The default installation location is the HDF5 directory created in the build directory. Typing `make install' will install the HDF5 - Library, header files, examples, and support programs in hdf5/lib, + library, header files, examples, and support programs in hdf5/lib, hdf5/include, hdf5/doc/hdf5/examples, and hdf5/bin. To use a path other than hdf5, specify the path with the `--prefix=PATH' switch: @@ -275,45 +239,24 @@ CONTENTS $ CC=/usr/local/mpi/bin/mpicc ./configure -4.3.3. Configuring for 64-bit support - Several machine architectures support 32-bit or 64-bit binaries. - The options below describe how to enable support for different options. - - On Irix64, the default compiler is `cc'. To use an alternate compiler, - specify it with the CC variable: - - $ CC='cc -n32' ./configure - - Similarly, users compiling on a Solaris machine and desiring to - build the distribution with 64-bit support should specify the - correct flags with the CC variable: - - $ CC='cc -m64' ./configure - - To configure AIX 64-bit support including the Fortran and C++ APIs, - (Note: need to set $AR to 'ar -X 64'.) - Serial: - $ CFLAGS=-q64 FCFLAGS=-q64 CXXFLAGS=-q64 AR='ar -X 64'\ - ./configure --enable-fortran - Parallel: (C++ not supported with parallel) - $ CFLAGS=-q64 FCFLAGS=-q64 AR='ar -X 64'\ - ./configure --enable-fortran -4.3.4. Additional compilation flags - If addtional flags must be passed to the compilation commands, +4.3.3. Additional compilation flags + If additional flags must be passed to the compilation commands, specify those flags with the CFLAGS variable. For instance, to enable symbolic debugging of a production version of HDF5, one might say: $ CFLAGS=-g ./configure --enable-build-mode=production -4.3.5. Compiling HDF5 wrapper libraries - One can optionally build the Fortran and/or C++ interfaces to the - HDF5 C library. By default, both options are disabled. To build - them, specify `--enable-fortran' and `--enable-cxx', respectively. +4.3.4. Compiling HDF5 wrapper libraries + One can optionally build the Fortran, C++, and Java interfaces to + the HDF5 C library. By default, these options are disabled. To build + them, specify '--enable-fortran', '--enable-cxx', or '--enable-java', + respectively. $ ./configure --enable-fortran $ ./configure --enable-cxx + $ ./configure --enable-java Configuration will halt if a working Fortran 90 or 95 compiler or C++ compiler is not found. Currently, the Fortran configure tests @@ -322,15 +265,8 @@ CONTENTS $ FC=/usr/local/bin/g95 ./configure --enable-fortran - Note: The Fortran and C++ interfaces are not supported on all the - platforms the main HDF5 Library supports. Also, the Fortran - interface supports parallel HDF5 while the C++ interface does - not. - Note: See sections 4.7 and 4.8 for building the Fortran library with - Intel or PGI compilers. - -4.3.6. Specifying other programs +4.3.5. Specifying other programs The build system has been tuned for use with GNU make but also works with other versions of make. If the `make' command runs a non-GNU version but a GNU version is available under a different @@ -346,7 +282,7 @@ CONTENTS the `ar' and `ranlib' (or `:') commands to override values detected by configure. - The HDF5 Library, include files, and utilities are installed + The HDF5 library, include files, and utilities are installed during `make install' (described below) with a BSD-compatible install program detected automatically by configure. If none is found, the shell script bin/install-sh is used. Configure does not @@ -364,7 +300,7 @@ CONTENTS because the HDF5 makefiles also use the install program to change file ownership and/or access permissions. -4.3.7. Specifying other libraries and headers +4.3.6. Specifying other libraries and headers Configure searches the standard places (those places known by the systems compiler) for include files and header files. However, additional directories can be specified by using the CPPFLAGS @@ -389,12 +325,12 @@ CONTENTS ./configure HDF5 includes Szip as a predefined compression method (see 3.2). - To enable Szip compression, the HDF5 Library must be configured - and built using the Szip Library: + To enable Szip compression, the HDF5 library must be configured + and built using the Szip library: $ ./configure --with-szlib=/Szip_Install_Directory -4.3.8. Static versus shared linking +4.3.7. Static versus shared linking The build process will create static libraries on all systems and shared libraries on systems that support dynamic linking to a sufficient degree. Either form of the library may be suppressed by @@ -410,7 +346,7 @@ CONTENTS $ ./configure --enable-static-exec -4.3.9. Optimization versus symbolic debugging +4.3.8. Optimization versus symbolic debugging The library can be compiled to provide symbolic debugging support so it can be debugged with gdb, dbx, ddd, etc., or it can be compiled with various optimizations. To compile for symbolic @@ -430,9 +366,7 @@ CONTENTS (such as type conversion execution times and extensive invariant condition checking). To enable this debugging, supply a comma-separated list of package names to the `--enable-internal-debug' - switch. See "Debugging HDF5 Applications" for a list of package names: - - http://www.hdfgroup.org/HDF5/doc/H5.user/Debugging.html + switch. Debugging can be disabled by saying `--disable-internal-debug'. The default debugging level for snapshots is a subset of the @@ -448,39 +382,39 @@ CONTENTS arguments, and the return values. To enable or disable the ability to trace the API say `--enable-trace' (the default for snapthots) or `--disable-trace' (the default for public releases). - The tracing must also be enabled at runtime to see any output - (see "Debugging HDF5 Applications," reference above). + The tracing must also be enabled at runtime to see any output. -4.3.10. Parallel versus serial library - The HDF5 Library can be configured to use MPI and MPI-IO for +4.3.9. Parallel versus serial library + The HDF5 library can be configured to use MPI and MPI-IO for parallelism on a distributed multi-processor system. Read the - file INSTALL_parallel for detailed explanations. + file INSTALL_parallel for detailed information. -4.3.11. Threadsafe capability - The HDF5 Library can be configured to be thread-safe (on a very +4.3.10. Threadsafe capability + The HDF5 library can be configured to be thread-safe (on a very large scale) with the `--enable-threadsafe' flag to the configure script. Some platforms may also require the '-with-pthread=INC,LIB' (or '--with-pthread=DIR') flag to the configure script. - For further details, see "HDF5 Thread Safe Library": + For further information, see: + + https://portal.hdfgroup.org/display/knowledge/Questions+about+thread-safety+and+concurrent+access - http://www.hdfgroup.org/HDF5/doc/TechNotes/ThreadSafeLibrary.html -4.3.12. Backward compatibility - The 1.10 version of the HDF5 Library can be configured to operate +4.3.11. Backward compatibility + The 1.10 version of the HDF5 library can be configured to operate identically to the v1.8 library with the --with-default-api-version=v18 configure flag, or identically to the v1.6 library with the --with-default-api-version=v16 configure flag. This allows existing code to be compiled with the v1.10 library without requiring immediate changes to the application - source code. For addtional configuration options and other details, - see "API Compatibility Macros in HDF5": + source code. For additional configuration options and other details, + see "API Compatibility Macros": - https://support.hdfgroup.org/HDF5/doc/RM/APICompatMacros.html + https://portal.hdfgroup.org/display/HDF5/API+Compatibility+Macros 4.4. Building The library, confidence tests, and programs can be built by - saying just: + specifying: $ make @@ -497,7 +431,7 @@ CONTENTS 4.5. Testing HDF5 comes with various test suites, all of which can be run by - saying + specifying: $ make check @@ -526,13 +460,13 @@ CONTENTS longer test, set HDF5TestExpress to 0. 1 is the default. 4.6. Installing HDF5 - The HDF5 Library, include files, and support programs can be - installed in a (semi-)public place by saying `make install'. The - files are installed under the directory specified with - `--prefix=DIR' (default is 'hdf5') in directories named `lib', - `include', and `bin'. The directories, if not existing, will be - created automatically, provided the mkdir command supports the -p - option. + The HDF5 library, include files, and support programs can be + installed by specifying `make install'. The files are installed under the + directory specified with `--prefix=DIR' (or if not specified, in 'hdf5' + in the top directory of the HDF5 source code). They will be + placed in directories named `lib', `include', and `bin'. The directories, + if not existing, will be created automatically, provided the mkdir command + supports the -p option. If `make install' fails because the install command at your site somehow fails, you may use the install-sh that comes with the @@ -589,134 +523,15 @@ CONTENTS 5. Using the Library - Please see the "HDF5 User's Guide" and the "HDF5 Reference Manual": - - http://www.hdfgroup.org/HDF5/doc/ - - Most programs will include and link with -lhdf5. - Additional libraries may also be necessary depending on whether - support for compression, etc., was compiled into the HDF5 Library. - - A summary of the HDF5 installation can be found in the - libhdf5.settings file in the same directory as the static and/or - shared HDF5 Libraries. - - -6. Support - Support is described in the README file. - - -***************************************************************************** - APPENDIX -***************************************************************************** - -A. Warnings about compilers - Output from the following compilers should be extremely suspected - when used to compile the HDF5 Library, especially if optimizations are - enabled. In all cases, HDF5 attempts to work around the compiler bugs. - -A.1. GNU (Intel platforms) - Versions before 2.8.1 have serious problems allocating registers - when functions contain operations on `long long' datatypes. - -A.2. COMPAQ/DEC - The V5.2-038 compiler (and possibly others) occasionally - generates incorrect code for memcpy() calls when optimizations - are enabled, resulting in unaligned access faults. HDF5 works - around the problem by casting the second argument to `char *'. - The Fortran module (5.4.1a) fails in compiling some Fortran - programs. Use 5.5.0 or higher. - -A.3. SGI (Irix64 6.2) - The Mongoose 7.00 compiler has serious optimization bugs and - should be upgraded to MIPSpro 7.2.1.2m. Patches are available - from SGI. - -A.4. Windows/NT - The Microsoft Win32 5.0 compiler is unable to cast unsigned long - long values to doubles. HDF5 works around this bug by first - casting to signed long long and then to double. - - A link warning: defaultlib "LIBC" conflicts with use of other libs - appears for debug version of VC++ 6.0. This warning will not affect - building and testing HDF5 Libraries. - - -B. Large (>2GB) versus small (<2GB) file capability - In order to read or write files that could potentially be larger - than 2GB, it is necessary to use the non-ANSI `long long' data - type on some platforms. However, some compilers (e.g., GNU gcc - versions before 2.8.1 on Intel platforms) are unable to produce - correct machine code for this datatype. - - -C. Building and testing with other compilers -C.1. Building and testing with Intel compilers - When Intel compilers are used (icc or ecc), you will need to modify - the generated "libtool" program after configuration is finished. - On or around line 104 of the libtool file, there are lines which - look like: - - # How to pass a linker flag through the compiler. - wl="" - - Change these lines to this: - - # How to pass a linker flag through the compiler. - wl="-Wl," - - UPDATE: This is now done automatically by the configure script. - However, if you still experience a problem, you may want to check this - line in the libtool file and make sure that it has the correct value. - - * To build the Fortran library using Intel compiler on Linux 2.4, - one has to perform the following steps: - x Use the -fpp -DDEC$=DEC_ -DMS$=MS_ compiler flags to disable - DEC and MS compiler directives in source files in the fortran/src, - fortran/test, and fortran/examples directories. - E.g., setenv F9X 'ifc -fpp -DDEC$=DEC_ -DMS$=MS_' - Do not use double quotes since $ is interpreted in them. - - x If Version 6.0 of Fortran compiler is used, the build fails in - the fortran/test directory and then in the fortran/examples - directory. To proceed, edit the work.pcl files in those - directories to contain two lines: - - work.pc - ../src/work.pc - - x Do the same in the fortran/examples directory. - - x A problem with work.pc files was resolved for the newest version - of the compiler (7.0). - - * To build the Fortran library on IA32, follow the steps described - above, except that the DEC and MS compiler directives should be - removed manually or use a patch from HDF FTP server: - - ftp://ftp.hdfgroup.org/HDF5/current/ - - -C.2. Building and testing with PGI compilers - When PGI C and C++ compilers are used (pgcc or pgCC), you will need to - modify the generated "libtool" program after configuration is finished. - On or around line 104 of the libtool file, there are lines which - look like this: - - # How to pass a linker flag through the compiler. - wl="" + + For information on using HDF5 see the documentation, tutorials and examples + found here: - Change these lines to this: + https://portal.hdfgroup.org/display/HDF5/HDF5 - # How to pass a linker flag through the compiler. - wl="-Wl," + A summary of the features included in the built HDF5 installation can be found + in the libhdf5.settings file in the same directory as the static and/or + shared HDF5 libraries. - UPDATE: This is now done automatically by the configure script. However, - if you still experience a problem, you may want to check this line in - the libtool file and make sure that it has the correct value. - To build the HDF5 C++ Library with pgCC (version 4.0 and later), set - the environment variable CXX to "pgCC -tlocal" - setenv CXX "pgCC -tlocal" - before running the configure script. diff --git a/release_docs/INSTALL_parallel b/release_docs/INSTALL_parallel index 5a8b603..f32fffc 100644 --- a/release_docs/INSTALL_parallel +++ b/release_docs/INSTALL_parallel @@ -40,9 +40,11 @@ and the parallel file system. 1.2. Further Help ----------------- -If you still have difficulties installing PHDF5 in your system, please send -mail to - help@hdfgroup.org + +For help with installing, questions can be posted to the HDF Forum or sent to the HDF Helpdesk: + + HDF Forum: https://forum.hdfgroup.org/ + HDF Helpdesk: https://portal.hdfgroup.org/display/support/The+HDF+Help+Desk In your mail, please include the output of "uname -a". If you have run the "configure" command, attach the output of the command and the content of @@ -87,12 +89,8 @@ The following steps are for building HDF5 for the Hopper compute nodes. They would probably work for other Cray systems but have not been verified. -Obtain a copy from the HDF ftp server: -http://www.hdfgroup.org/ftp/HDF5/current/src/ -(link might change, so always double check the HDF group website). - -$ wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-x.x.x.tar.gz -unpack the tarball +Obtain the HDF5 source code: + https://portal.hdfgroup.org/display/support/Downloads The entire build process should be done on a MOM node in an interactive allocation and on a file system accessible by all compute nodes. Request an interactive allocation with qsub: diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4fa3af2..d90aad4 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -4,45 +4,37 @@ HDF5 version 1.11.2 currently under development INTRODUCTION -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. +This document describes the differences between this release and the previous +HDF5 release. It contains information on the platforms tested and known +problems in this release. For more details check the HISTORY*.txt files in the +HDF5 source. +Note that documentation in the links below will be updated at the time of each +final release. -Links to HDF5 1.10.1 source code, documentation, and additional materials can be found on The HDF5 web page at: +Links to HDF5 documentation can be found on The HDF5 web page: - https://support.hdfgroup.org/HDF5/ + https://portal.hdfgroup.org/display/HDF5/HDF5 -The HDF5 1.10.1 release can be obtained from: +The official HDF5 releases can be obtained from: - https://support.hdfgroup.org/HDF5/release/obtain5.html + https://www.hdfgroup.org/downloads/hdf5/ -User documentation for the snapshot can be accessed directly at this location: +Changes from Release to Release and New Features in the HDF5-1.10.x release series +can be found at: - 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 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 1.10.1 (current -release) versus Release 1.10.0 - - https://support.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + https://portal.hdfgroup.org/display/HDF5/HDF5+Application+Developer%27s+Guide If you have any questions or comments, please send them to the HDF Help Desk: - help@hdfgroup.org + help@hdfgroup.org CONTENTS - New Features - Support for new platforms and languages -- Bug Fixes since HDF5-1.10.1 +- Bug Fixes since HDF5-1.10.2 - Supported Platforms - Tested Configuration Features Summary - More Tested Platforms @@ -54,119 +46,16 @@ New Features Configuration: ------------- - - CMake - - Change minimum version to 3.10. - - This change removes the need to support a copy of the FindMPI.cmake module, - which has been removed, along with its subfolder in the config/cmake_ext_mod - location. - - (ADB - 2018/03/09) - - - CMake - - Add pkg-config file generation - - Added pkg-config file generation for the C, C++, HL, and HL C++ libraries. - In addition, builds on linux will create h5cXXX scripts that use the pkg-config - files. This is a limited implementation of a script like autotools h5cc. - - (ADB - 2018/03/08, HDFFV-4359) - - - CMake - - Refactor use of CMAKE_BUILD_TYPE for new variable, which understands - the type of generator in use. - - Added new configuration macros to use new HDF_BUILD_TYPE variable. This - variable is set correctly for the type of generator being used for the build. - - (ADB - 2018/01/08, HDFFV-10385, HDFFV-10296) + - Library: -------- - - Add an enumerated value to H5F_libver_t for H5Pset_libver_bounds(). - - Currently, the library defines two values for H5F_libver_t and supports - only two pairs of (low, high) combinations as derived from these values. - Thus the bounds setting via H5Pset_libver_bounds() is rather restricted. - - Add an enumerated value (H5F_LIBVER_V18) to H5F_libver_t and - H5Pset_libver_bounds() now supports five pairs of (low, high) combinations - as derived from these values. This addition provides the user more - flexibility in setting bounds for object creation. - - (VC - 2018/03/14) - - - Add prefix option to VDS files. - - Currently, VDS source files must be in the active directory to be - found by the virtual file. Adding the option of a prefix to be set - on the virtual file, using a data access property list (DAPL), - allows the source files to located at an absolute or relative path - to the virtual file. - Private utility functions in H5D and H5L packages merged into single - function in H5F package. - - New public APIs: - herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); - ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); - The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. - - (ADB - 2017/12/12, HDFFV-9724, HDFFV-10361) + - Parallel Library: ----------------- - - Optimize parallel open/location of the HDF5 super-block - - 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 - 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 - 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: ---------------- @@ -174,125 +63,15 @@ New Features C++ Library: ------------ - - The following C++ API wrappers have been added to the C++ Library: - + H5Lcreate_soft: - // Creates a soft link from link_name to target_name. - void link(const char *target_name, const char *link_name,...) - void link(const H5std_string& target_name,...) - - + H5Lcreate_hard: - // Creates a hard link from new_name to curr_name. - void link(const char *curr_name, const Group& new_loc,...) - void link(const H5std_string& curr_name, const Group& new_loc,...) - - // Creates a hard link from new_name to curr_name in same location. - void link(const char *curr_name, const hid_t same_loc,...) - void link(const H5std_string& curr_name, const hid_t same_loc,...) - - Note: previous version of H5Location::link will be deprecated. - - + H5Lcopy: - // Copy an object from a group of file to another. - void copyLink(const char *src_name, const Group& dst,...) - void copyLink(const H5std_string& src_name, const Group& dst,...) - - // Copy an object from a group of file to the same location. - void copyLink(const char *src_name, const char *dst_name,...) - void copyLink(const H5std_string& src_name,...) - - + H5Lmove: - // Rename an object in a group or file to a new location. - void moveLink(const char* src_name, const Group& dst,...) - void moveLink(const H5std_string& src_name, const Group& dst,...) - - // Rename an object in a group or file to the same location. - void moveLink(const char* src_name, const char* dst_name,...) - void moveLink(const H5std_string& src_name,...) - - Note: previous version H5Location::move will be deprecated. - - + H5Ldelete: - // Removes the specified link from this location. - void unlink(const char *link_name, - const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) - void unlink(const H5std_string& link_name, - const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) - - Note: additional parameter is added to previous H5Location::unlink. - - + H5Tencode and H5Tdecode: - // Creates a binary object description of this datatype. - void DataType::encode() - C API H5Tencode() - - // Returns the decoded type from the binary object description. - DataType::decode() - C API H5Tdecode() - ArrayType::decode() - C API H5Tdecode() - CompType::decode() - C API H5Tdecode() - DataType::decode() - C API H5Tdecode() - EnumType::decode() - C API H5Tdecode() - FloatType::decode() - C API H5Tdecode() - IntType::decode() - C API H5Tdecode() - StrType::decode() - C API H5Tdecode() - VarLenType::decode() - C API H5Tdecode() - - + H5Lget_info: - // Returns the information of the named link. - H5L_info_t getLinkInfo(const H5std_string& link_name,...) - - (BMR - 2018/03/11, HDFFV-10149) - - - Added class LinkCreatPropList for link create property list. - - (BMR - 2018/03/11, HDFFV-10149) - - - Added overloaded functions H5Location::createGroup to take a link - creation property list - Group createGroup(const char* name, const LinkCreatPropList& lcpl) - Group createGroup(const H5std_string& name, const LinkCreatPropList& lcpl) - - (BMR - 2018/03/11, HDFFV-10149) - - - A document is added to the HDF5 C++ API Reference Manual to show the - mapping from a C API to C++ wrappers. It can be found from the main - page of the C++ API Reference Manual. - - (BMR - 2017/10/17, HDFFV-10151) - + - Java Library: ---------------- - - Wrapper added for enabling the error stack. - - H5error_off would disable the error stack reporting. In order - to re-enable the reporting, the error stack info needs to be - saved so that H5error_on can revert state. - - (ADB - 2018/03/13, HDFFV-10412) - - - Wrappers added for the following APIs: - H5Pset_evict_on_close - H5Pget_evict_on_close - H5Pset_chunk_opts - H5Pget_chunk_opts - H5Pset_efile_prefix - H5Pget_efile_prefix - H5Pset_virtual_prefix - H5Pget_virtual_prefix - - (ADB - 2017/12/20) + - 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: --------------- @@ -314,139 +93,11 @@ Support for new platforms, languages and compilers. ======================================= - -Bug Fixes since HDF5-1.10.1 release +Bug Fixes since HDF5-1.10.2 release ================================== Library ------- - - The data read after a direct chunk write to a chunked dataset - was incorrect. - - The problem was due to the passing of a null dataset pointer to - the insert callback for the chunk index in the routine - H5D__chunk_direct_write() in H5Dchunk.c - The dataset was a single-chunked dataset which will use the - single chunk index when latest format was enabled on file creation. - The single chunk index was the only index that used this pointer - in the insert callback. - - Pass the dataset pointer to the insert callback for the chunk - index in H5D__chunk_direct_write(). - - (VC - 2018/03/20, HDFFV-10425) - - - Add public routine H5DOread_chunk to the high-level C library - - As we have H5DOwrite_chunk() to write an entire chunk to the file - directly, the customer requested to add this public routine to - read an entire chunk from the file directly. - - This public routine was added based on a patch from GE Healthcare. - - (VC - 2017/05/19, HDFFV-9934) - - - Freeing of object header in H5Ocache.c - - It was discovered that the object header was not released properly - when the checksum verification failed and a re-load of the object - header was needed. - - Free the object header that failed the chksum verification only - after the new object header is reloaded, deserialized and set up. - - (VC - 2018/03/14, HDFFV-10209) - - - H5Pset_evict_on_close in H5Pfapl.c - - Changed the minor error number from H5E_CANTSET to H5E_UNSUPPORTED for - parallel library. - (ADB - 2018/03/6, HDFFV-10414) - - - Utility function can not handle lowercase Windows drive letters - - Added call to toupper function for drive letter. - - (ADB - 2017/12/18, HDFFV-10307) - - - filter plugin handling in H5PL.c and H5Z.c - - It was discovered that the dynamic loading process used by - filter plugins had issues with library dependencies. - - CMake build process changed to use LINK INTERFACE keywords, which - allowed HDF5 C library to make dependent libraries private. The - filter plugin libraries no longer require dependent libraries - (such as szip or zlib) to be available. - (ADB - 2017/11/16, HDFFV-10328) - - - 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, HDFFV-10319) - - - An uninitialized struct could cause a memory access error when using - variable-length or reference types in a compressed, chunked dataset. - - A struct containing a callback function pointer and a pointer to some - associated data was used before initialization. This could cause a - memory access error and system crash. This could only occur under - unusual conditions when using variable-lenth and reference types in - a compressed, chunked dataset. - - On recent versions of Visual Studio, when built in debug mode, the - debug heap will complain and cause a crash if the code in question - is executed (this will cause the objcopy test to fail). - - (DER - 2017/11/21, HDFFV-10330) - - - If an HDF5 file contains a filter pipeline message with a 'number of - filters' field that exceeds the maximum number of allowed filters, - the error handling code will attempt to dereference a NULL pointer. - - This issue was reported to The HDF Group as issue #CVE-2017-17505. - - NOTE: The HDF5 C library cannot produce such a file. This condition - should only occur in a corrupt (or deliberately altered) file - or a file created by third-party software. - - This problem arose because the error handling code assumed that - the 'number of filters' field implied that a dynamic array of that - size had already been created and that the cleanup code should - iterate over that array and clean up each element's resources. If - an error occurred before the array has been allocated, this will - not be true. - - This has been changed so that the number of filters is set to - zero on errors. Additionally, the filter array traversal in the - error handling code now requires that the filter array not be NULL. - - (DER - 2018/02/06, HDFFV-10354) - - - If an HDF5 file contains a filter pipeline message which contains - a 'number of filters' field that exceeds the actual number of - filters in the message, the HDF5 C library will read off the end of - the read buffer. - - This issue was reported to The HDF Group as issue #CVE-2017-17506. - - NOTE: The HDF5 C library cannot produce such a file. This condition - should only occur in a corrupt (or deliberately altered) file - or a file created by third-party software. - - The problem was fixed by passing the buffer size with the buffer - and ensuring that the pointer cannot be incremented off the end - of the buffer. A mismatch between the number of filters declared - and the actual number of filters will now invoke normal HDF5 - error handling. - - (DER - 2018/02/26, HDFFV-10355) - - If an HDF5 file contains a malformed compound datatype with a suitably large offset, the type conversion code can run off the end of the type conversion buffer, causing a segmentation @@ -467,104 +118,10 @@ Bug Fixes since HDF5-1.10.1 release (DER - 2018/02/26, HDFFV-10356) - - If an HDF5 file contains a malformed compound type which contains - a member of size zero, a division by zero error will occur while - processing the type. - - This issue was reported to The HDF Group as issue #CVE-2017-17508. - - NOTE: The HDF5 C library cannot produce such a file. This condition - should only occur in a corrupt (or deliberately altered) file - or a file created by third-party software. - - Checking for zero before dividing fixes the problem. Instead of the - division by zero, the normal HDF5 error handling is invoked. - - (DER - 2018/02/26, HDFFV-10357) - - - If an HDF5 file contains a malformed symbol table node that declares - it contains more symbols than it actually contains, the library - can run off the end of the metadata cache buffer while processing - the symbol table node. - - This issue was reported to The HDF Group as issue #CVE-2017-17509. - - NOTE: The HDF5 C library cannot produce such a file. This condition - should only occur in a corrupt (or deliberately altered) file - or a file created by third-party software. - - Performing bounds checks on the buffer while processing fixes the - problem. Instead of the segmentation fault, the normal HDF5 error - handling is invoked. - - (DER - 2018/03/12, HDFFV-10358) Configuration ------------- - - CMake - - Update CMake commands configuration. - - A number of improvements were made to the CMake commands. Most - changes simplify usage or eliminate unused constructs. Also, - some changes support better cross-platform support. - - (ADB - 2018/02/01, HDFFV-10398) - - - CMake - - Correct usage of CMAKE_BUILD_TYPE variable. - - The use of the CMAKE_BUILD_TYPE is incorrect for multi-config - generators (Visual Studio and XCode) and is optional for single - config generators. Created a new macro to check - GLOBAL PROPERTY -> GENERATOR_IS_MULTI_CONFIG - Created two new HDF variable, HDF_BUILD_TYPE and HDF_CFG_BUILD_TYPE. - Defaults for these variables is "Release". - - (ADB - 2018/01/10, HDFFV-10385) - - - CMake - - Add replacement of fortran flags if using static CRT. - - Added TARGET_STATIC_CRT_FLAGS call to HDFUseFortran.cmake file in - config/cmake_ext_mod folder. - - (ADB - 2018/01/08, HDFFV-10334) - - - CMake - - The hdf5 library used shared szip and zlib, which needlessly required - applications to link with the same szip and zlib libraries. - - Changed the target_link_libraries commands to use the static libs. - Removed improper link duplication of szip and zlib. - Adjusted the link dependencies and the link interface values of - the target_link_libraries commands. - - (ADB - 2017/11/14, HDFFV-10329) - - - CMake MPI - - CMake implementation for MPI was problematic and would create incorrect - MPI library references in the hdf5 libraries. - - Reworked the CMake MPI code to properly create CMake targets. Also merged - the latest CMake FindMPI.cmake changes to the local copy. This is necessary - until HDF changes the CMake minimum to 3.9 or greater. - - (ADB - 2017/11/02, HDFFV-10321) - - - CMake - - 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 - use of the HDFTEST_COPY_FILE macro. - - (ADB - 2017/07/12, HDFFV-10254) + - Performance ------------- @@ -572,189 +129,11 @@ Bug Fixes since HDF5-1.10.1 release Fortran -------- - - Fixed compilation errors when using Intel 18 Fortran compilers - (MSB - 2017/11/3, HDFFV-10322) + - Tools ----- - - h5clear - - An enhancement to the tool in setting a file's stored EOA. - - It was discovered that a crashed file's stored EOA in the superblock - was smaller than the actual file's EOF. When the file was reopened - and closed, the library truncated the file to the stored EOA. - - Add an option to the tool in setting the file's stored EOA in the - superblock to the maximum of (EOA, EOF) + increment. - Another option is also added to print the file's EOA and EOF. - - (VC - 2018/03/14, HDFFV-10360) - - - h5repack - - h5repack changes the chunk parameters when a change of layout is not - specified and a filter is applied. - - HDFFV-10297, HDFFV-10319 reworked code for h5repack and h5diff code - in the tools library. The check for an existing layout was incorrectly - placed into an if block and not executed. The check was moved into - the normal path of the function. - - (ADB - 2018/02/21, HDFFV-10412) - - - h5dump - - the tools library will hide the error stack during file open. - - While this is preferable almost always, there are reasons to enable - display of the error stack when a tool will not open a file. Adding an - optional argument to the --enable-error-stack will provide this use case. - As an optional argument it will not affect the operation of the - --enable-error-stack. h5dump is the only tool to implement this change. - - (ADB - 2018/02/15, HDFFV-10384) - - - h5dump - - h5dump would output an indented blank line in the filters section. - - h5dump overused the h5tools_simple_prefix function, which is a - function intended to account for the data index (x,y,z) option. - Removed the function call for header information. - - (ADB - 2018/01/25, HDFFV-10396) - - - h5repack - - h5repack incorrectly searched internal object table for name. - - h5repack would search the table of objects for a name, if the - name did not match it tried to determine if the name without a - leading slash would match. The logic was flawed! The table - stored names(paths) without a leading slash and did a strstr - of the table path to the name. - The assumption was that if there was a difference of one then - it was a match, however "pressure" would match "/pressure" as - well as "/pressure1", "/pressure2", etc. Changed logic to remove - any leading slash and then do a full compare of the name. - - (ADB - 2018/01/18, HDFFV-10393) - - - h5repack - - h5repack failed to handle more then 9 chars for int conversion. - - User defined filter parameter conversions would fail for integers - larger then 9 characters. Increased local variable array for storing - the current command line parameter to prevent buffer overflows. - - (ADB - 2018/01/17, HDFFV-10392) - - - h5diff - - h5diff seg faulted if comparing VL strings against fixed strings. - - Reworked solution for HDFFV-8625 and HDFFV-8639. Implemented the check - for string objects of same type in the diff_can_type function by - adding an if(tclass1 == H5T_STRING) block. This if block moves the - same check that was added for attributes to this function, which is - used by all object types. This function also handles complex type - structures. - Also added a new test file in h5diffgenttest for testing this issue - and removed the temporary files used in the test scripts. - - (ADB - 2018/01/04, HDFFV-8745) - - - 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. - Note, h5repack output display has changed to clarify the individual - steps of the repack process. The output indicates if an operation - applies to all objects. Lines with notation and no information - have been removed. - - (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) - - - 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-10269) - - - 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. - - 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. - - 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. - - 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/15, HDFFV-10219) - - - h5repack - - h5repack did not maintain the creation order flag of the root - group. - - 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 applies to the traversing of the - original file, on the command line. - - (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: ------ @@ -774,49 +153,27 @@ Bug Fixes since HDF5-1.10.1 release C++ APIs -------- - - Removal of memory leaks - - A private function was inadvertently called, causing memory leaks. This - is now fixed. - - (BMR - 2018/03/12 - User's reported in email) + - Testing ------- - - Memory for three variables in testphdf5's coll_write_test was malloced - but not freed, leaking memory when running the test. The variables' - memory is now freed. - - (LRK - 2018/03/12, HDFFV-10397) Supported Platforms =================== - 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 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) + Linux 2.6.32-696.16.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) 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 + (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 + Version 17.0.0.098 Build 20160721 MPICH 3.1.4 compiled with GCC 4.9.3 SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc @@ -843,21 +200,17 @@ Supported Platforms 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.0 from Xcode 7.3 64-bit gfortran GNU Fortran (GCC) 5.2.0 - (osx1010dev/osx1010test) Intel icc/icpc/ifort version 16.0.2 + (osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2 + + Mac OS Sierra 10.12.6 Apple LLVM version 8.1.0 (clang/clang++-802.0.42) + 64-bit gfortran GNU Fortran (GCC) 7.1.0 + (swallow/kite) Intel icc/icpc/ifort version 17.0.2 Tested Configuration Features Summary @@ -927,22 +280,28 @@ 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 + Version 4.9.3, 5.3.0, 6.2.0 PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 16.10-0 + Version 17.10-0 Intel(R) C (icc), C++ (icpc), Fortran (icc) compilers: - Version 15.0.3.187 (Build 20150407) + Version 17.0.4.196 Build 20170411 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) + GCC Version 7.1.0 + OpenMPI 3.0.0-GCC-7.2.0-2.29 Intel(R) C (icc) and C++ (icpc) compilers - Version 15.0.3.187 (Build 20150407) + Version 17.0.0.098 Build 20160721 with NAG Fortran Compiler Release 6.1(Tozai) + Linux 3.10.0-327.10.1.el7 MPICH 3.2 compiled with GCC 5.3.0 + #1 SMP x86_64 GNU/Linux + (moohan) + 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 -- cgit v0.12 From f6a5236e43ab8d461d472ecda9d70297fb7a53b5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 5 Apr 2018 08:16:13 -0500 Subject: Use var instead of absolute number --- test/CMakeTests.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 221b857..04cc41f 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -657,7 +657,7 @@ if (NOT CYGWIN) endif () set_tests_properties (H5TEST-cache PROPERTIES DEPENDS H5TEST-clear-cache-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=3" + 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) @@ -675,7 +675,7 @@ add_test ( 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;HDF5TestExpress=3" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -- cgit v0.12 From b51f8e2acdea1ab9baa727ed0f184a3fc727b1d0 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 5 Apr 2018 13:44:02 -0500 Subject: Correct errors with non-"instrumented library" builds (production & parallel, generally speaking). --- src/H5CX.c | 6 ++++++ src/H5CXprivate.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/H5CX.c b/src/H5CX.c index 135451c..9427e05 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -262,6 +262,7 @@ typedef struct H5CX_t { uint32_t mpio_global_no_coll_cause; /* Global reason for breaking collective I/O (H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME) */ hbool_t mpio_global_no_coll_cause_set; /* Whether global reason for breaking collective I/O is set */ hbool_t mpio_global_no_coll_cause_valid; /* Whether global reason for breaking collective I/O is valid */ +#ifdef H5_HAVE_INSTRUMENTED_LIBRARY int mpio_coll_chunk_link_hard; /* Instrumented "collective chunk link hard" value (H5D_XFER_COLL_CHUNK_LINK_HARD_NAME) */ hbool_t mpio_coll_chunk_link_hard_set; /* Whether instrumented "collective chunk link hard" value is set */ int mpio_coll_chunk_multi_hard; /* Instrumented "collective chunk multi hard" value (H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME) */ @@ -274,6 +275,7 @@ typedef struct H5CX_t { hbool_t mpio_coll_chunk_multi_ratio_coll_set; /* Whether instrumented "collective chunk multi ratio coll" value is set */ int mpio_coll_chunk_multi_ratio_ind; /* Instrumented "collective chunk multi ratio ind" value (H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME) */ hbool_t mpio_coll_chunk_multi_ratio_ind_set; /* Whether instrumented "collective chunk multi ratio ind" value is set */ +#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ #endif /* H5_HAVE_PARALLEL */ /* Cached LAPL properties */ @@ -2520,6 +2522,7 @@ H5CX_set_mpio_global_no_coll_cause(uint32_t mpio_global_no_coll_cause) FUNC_LEAVE_NOAPI_VOID } /* end H5CX_set_mpio_global_no_coll_cause() */ +#ifdef H5_HAVE_INSTRUMENTED_LIBRARY /*------------------------------------------------------------------------- * Function: H5CX_test_set_mpio_coll_chunk_link_hard @@ -2723,6 +2726,7 @@ H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_in done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_test_set_mpio_coll_chunk_multi_ratio_ind() */ +#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ #endif /* H5_HAVE_PARALLEL */ @@ -2756,12 +2760,14 @@ H5CX__pop_common(void) H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode) H5CX_SET_PROP(H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) H5CX_SET_PROP(H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) +#ifdef H5_HAVE_INSTRUMENTED_LIBRARY H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) +#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ #endif /* H5_HAVE_PARALLEL */ /* Pop the top context node from the stack */ diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index 151f555..78f4793 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -134,12 +134,14 @@ H5_DLL void H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t chun H5_DLL void H5CX_set_mpio_actual_io_mode(H5D_mpio_actual_io_mode_t actual_io_mode); H5_DLL void H5CX_set_mpio_local_no_coll_cause(uint32_t mpio_local_no_coll_cause); H5_DLL void H5CX_set_mpio_global_no_coll_cause(uint32_t mpio_global_no_coll_cause); +#ifdef H5_HAVE_INSTRUMENTED_LIBRARY H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_link_hard(int mpio_coll_chunk_link_hard); H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_multi_hard(int mpio_coll_chunk_multi_hard); H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_link_num_true); H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false); H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_coll); H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_ind); +#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ #endif /* H5_HAVE_PARALLEL */ #endif /* _H5CXprivate_H */ -- cgit v0.12 From 02039e0a91cf1baae46d52a77c521fc6357b7c90 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 6 Apr 2018 00:11:18 -0700 Subject: Minor warning cleanup while working on VOL issues. --- src/H5B2dbg.c | 4 ++-- src/H5F.c | 2 +- test/objcopy.c | 1 - test/ohdr.c | 20 ++++++++++---------- test/tfile.c | 6 ++---- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index dc079f1..c4f56e5 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -218,7 +218,7 @@ H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, */ H5_CHECK_OVERFLOW(depth, unsigned, uint16_t); node_ptr.addr = addr; - H5_CHECKED_ASSIGN(node_ptr.node_nrec, unsigned, nrec, uint16_t) + H5_CHECKED_ASSIGN(node_ptr.node_nrec, uint16_t, nrec, unsigned) if(NULL == (internal = H5B2__protect_internal(hdr, NULL, &node_ptr, (uint16_t)depth, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node") @@ -330,7 +330,7 @@ H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, */ H5_CHECK_OVERFLOW(nrec, unsigned, uint16_t); node_ptr.addr = addr; - H5_CHECKED_ASSIGN(node_ptr.node_nrec, unsigned, nrec, uint16_t) + H5_CHECKED_ASSIGN(node_ptr.node_nrec, uint16_t, nrec, unsigned) if(NULL == (leaf = H5B2__protect_leaf(hdr, NULL, &node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") diff --git a/src/H5F.c b/src/H5F.c index 8023a04..6d62c08 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1344,7 +1344,7 @@ H5Fstart_swmr_write(hid_t file_id) /* Call the internal routine */ if(H5F__start_swmr_write(file) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "unable to convert file format") + HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "unable to convert file format") done: FUNC_LEAVE_API(ret_value) diff --git a/test/objcopy.c b/test/objcopy.c index e88d508..3fbb7b8 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -145,7 +145,6 @@ const char *FILENAME[] = { #define NAME_LINK_EXTERN_DANGLE "/g_links/external_link_to_nowhere" #define NAME_LINK_EXTERN_DANGLE2 "/g_links2/external_link_to_nowhere" #define NAME_OLD_FORMAT "/dset1" -#define NAME_DSET_NULL "DSET_NULL" #define NAME_BUF_SIZE 1024 #define ATTR_NAME_LEN 80 diff --git a/test/ohdr.c b/test/ohdr.c index d0f6966..e91c6a8 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -735,40 +735,40 @@ error: #define STR_EARLIEST "earliest" #define STR_V18 "v18" #define STR_LATEST "latest" -static char *version_string(H5F_libver_t libver) +static char * +version_string(H5F_libver_t libver) { char *str = NULL; str = (char *) HDmalloc(20); - if (str == NULL) - { - fprintf(stderr, "Allocation failed\n"); - exit(1); + if (str == NULL) { + HDfprintf(stderr, "Allocation failed\n"); + HDexit(1); } switch(libver) { case H5F_LIBVER_EARLIEST: - strcpy(str, STR_EARLIEST); + HDstrcpy(str, STR_EARLIEST); break; case H5F_LIBVER_V18: - strcpy(str, STR_V18); + HDstrcpy(str, STR_V18); break; case H5F_LIBVER_V110: HDassert(H5F_LIBVER_LATEST == H5F_LIBVER_V110); - strcpy(str, STR_LATEST); + HDstrcpy(str, STR_LATEST); break; case H5F_LIBVER_ERROR: case H5F_LIBVER_NBOUNDS: default: - sprintf(str, "%ld", (long)libver); + HDsprintf(str, "%ld", (long)libver); break; } /* end switch */ /* Return the formed version bound string */ - return(str); + return str; } /* end of version_string */ diff --git a/test/tfile.c b/test/tfile.c index 80c1e11..677fd06 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -181,8 +181,6 @@ static void test_libver_bounds_datatype(hid_t fapl); static void test_libver_bounds_datatype_check(hid_t fapl, hid_t tid); static void test_libver_bounds_attributes(hid_t fapl); -#define FILE8 "tfile8.h5" /* Test file */ - #define DSET_NULL "DSET_NULL" #define DSET "DSET" #define DSETA "DSETA" @@ -6935,7 +6933,7 @@ test_libver_macros2(void) ** ****************************************************************/ static void -test_incr_filesize(const char *env_h5_drvr) +test_incr_filesize(void) { hid_t fid; /* File opened with read-write permission */ h5_stat_size_t filesize; /* Size of file when empty */ @@ -7337,7 +7335,7 @@ test_file(void) test_libver_bounds_low_high(); test_libver_macros(); /* Test the macros for library version comparison */ test_libver_macros2(); /* Test the macros for library version comparison */ - test_incr_filesize(env_h5_drvr); /* Test H5Fincrement_filesize() and H5Fget_eoa() */ + test_incr_filesize(); /* Test H5Fincrement_filesize() and H5Fget_eoa() */ #ifndef H5_NO_DEPRECATED_SYMBOLS test_deprec(); /* Test deprecated routines */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ -- cgit v0.12 From 62b4200f580e9ea0b95cbc218bfae50ae38ef25d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 6 Apr 2018 17:19:29 -0500 Subject: Remove vestiges of H5_DEBUG_BUILD macro, switching it to the more standard H5CX_DEBUG form. --- configure.ac | 2 +- src/H5CX.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 98c97cc..c68caab 100644 --- a/configure.ac +++ b/configure.ac @@ -2243,7 +2243,7 @@ AC_SUBST([INTERNAL_DEBUG_OUTPUT]) ## are not listed in the "all" packages list. ## ## all_packages="AC,B,B2,D,F,FA,FL,FS,HL,I,O,S,ST,T,Z" -all_packages="AC,B2,D,F,HL,I,O,S,ST,T,Z" +all_packages="AC,B2,CX,D,F,HL,I,O,S,ST,T,Z" case "X-$INTERNAL_DEBUG_OUTPUT" in X-yes|X-all) diff --git a/src/H5CX.c b/src/H5CX.c index 9427e05..af2619b 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -826,11 +826,11 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, else { htri_t is_lapl; /* Whether the access property list is (or is derived from) a link access property list */ -#ifdef H5_DEBUG_BUILD +#ifdef H5CX_DEBUG /* Sanity check the access property list class */ if(TRUE != H5P_isa_class(*acspl_id, *libclass->class_id)) HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not the required access property list") -#endif /* H5_DEBUG_BUILD */ +#endif /* H5CX_DEBUG*/ /* Check for link access property and set API context if so */ if((is_lapl = H5P_class_isa(*libclass->pclass, *H5P_CLS_LACC->pclass)) < 0) -- cgit v0.12 From 057a4e7fd635bbd1c9ce1f04692cd9f4b827dc86 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 9 Apr 2018 15:07:29 -0500 Subject: Fix Java test for DEBUG_APIS --- .gitattributes | 2 + MANIFEST | 2 + java/test/CMakeLists.txt | 105 ++++++-- java/test/JUnit-unit.txt | 614 +++++++++++++++++++++++++++++++++++++++++++ java/test/Makefile.am | 9 +- java/test/TestH5E.java | 268 ------------------- java/test/TestH5Eparams.java | 343 ++++++++++++++++++++++++ java/test/TestUnit.java | 36 +++ java/test/junit.sh.in | 8 +- 9 files changed, 1080 insertions(+), 307 deletions(-) create mode 100644 java/test/JUnit-unit.txt create mode 100644 java/test/TestH5Eparams.java create mode 100644 java/test/TestUnit.java diff --git a/.gitattributes b/.gitattributes index 3c7dae1..de68733 100644 --- a/.gitattributes +++ b/.gitattributes @@ -321,6 +321,7 @@ java/test/TestH5Dparams.java -text java/test/TestH5Dplist.java -text java/test/TestH5E.java -text java/test/TestH5Edefault.java -text +java/test/TestH5Eparams.java -text java/test/TestH5Eregister.java -text java/test/TestH5F.java -text java/test/TestH5Fbasic.java -text @@ -347,6 +348,7 @@ java/test/TestH5Sbasic.java -text java/test/TestH5T.java -text java/test/TestH5Tbasic.java -text java/test/TestH5Tparams.java -text +java/test/TestUnit.java -text java/test/TestH5Z.java -text java/test/h5ex_g_iterate.orig -text svneol=unset#application/x-hdf java/test/junit.sh.in -text diff --git a/MANIFEST b/MANIFEST index 4b32587..1cccdf2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3057,6 +3057,7 @@ ./java/test/TestH5Dplist.java ./java/test/TestH5E.java ./java/test/TestH5Edefault.java +./java/test/TestH5Eparams.java ./java/test/TestH5Eregister.java ./java/test/TestH5Fparams.java ./java/test/TestH5Fbasic.java @@ -3086,6 +3087,7 @@ ./java/test/TestH5T.java ./java/test/TestH5Z.java ./java/test/TestAll.java +./java/test/TestUnit.java ./java/lib/hamcrest-core.jar ./java/lib/junit.jar diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 6158055..10a38b0 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -10,16 +10,13 @@ INCLUDE_DIRECTORIES ( set (HDF5_JAVA_TEST_SOURCES TestH5.java - TestH5E.java - TestH5Edefault.java - TestH5Eregister.java + TestH5Eparams.java TestH5Fparams.java TestH5Fbasic.java TestH5F.java TestH5Fswmr.java TestH5Gbasic.java TestH5G.java - TestH5Giterate.java TestH5Sbasic.java TestH5S.java TestH5Tparams.java @@ -44,13 +41,33 @@ set (HDF5_JAVA_TEST_SOURCES TestH5Ocopy.java TestH5PL.java TestH5Z.java - TestAll.java ) -file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt -"Main-Class: test.TestAll +if (HDF5_ENABLE_DEBUG_APIS) + set (HDF5_JAVA_TEST_SOURCES + ${HDF5_JAVA_TEST_SOURCES} + TestUnit.java + ) + + file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt + "Main-Class: test.TestUnit " -) + ) +else () + set (HDF5_JAVA_TEST_SOURCES + ${HDF5_JAVA_TEST_SOURCES} + TestH5E.java + TestH5Edefault.java + TestH5Eregister.java + TestH5Giterate.java + TestAll.java + ) + + file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt + "Main-Class: test.TestAll +" + ) +endif () set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_LIB_DIR}/junit.jar;${HDF5_JAVA_LIB_DIR}/hamcrest-core.jar;${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_SIMPLE_JAR}") @@ -63,10 +80,19 @@ get_target_property (${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE ${HDF5_JAVA_TEST_LIB_ add_dependencies (${HDF5_JAVA_TEST_LIB_TARGET} ${HDF5_JAVA_HDF5_LIB_TARGET}) set_target_properties (${HDF5_JAVA_TEST_LIB_TARGET} PROPERTIES FOLDER test/java) -set (HDF_JAVA_TEST_FILES +if (HDF5_ENABLE_DEBUG_APIS) + set (HDF_JAVA_TEST_FILES + JUnit-unit.txt + JUnit-interface.ert + ) + set (testfilter "OK (608 tests)") +else () + set (HDF_JAVA_TEST_FILES JUnit-interface.txt JUnit-interface.ert -) + ) + set (testfilter "OK (645 tests)") +endif () 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") @@ -86,7 +112,6 @@ foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${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)") set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$:_DEBUG>>;") add_test ( @@ -97,24 +122,46 @@ add_test ( JUnit-interface.out.err ) -add_test ( - NAME JUnit-interface - COMMAND "${CMAKE_COMMAND}" - -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}" - -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}" - -D "TEST_ARGS:STRING=${CMD_ARGS}-ea;org.junit.runner.JUnitCore" - -D "TEST_PROGRAM=test.TestAll" - -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" - -D "TEST_FOLDER=${HDF5_BINARY_DIR}/java/test" - -D "TEST_OUTPUT=JUnit-interface.out" -# -D "TEST_LOG_LEVEL=trace" - -D "TEST_EXPECT=0" - -D "SKIP_APPEND=1" - -D "TEST_MASK_ERROR=TRUE" - -D "TEST_FILTER:STRING=${testfilter}" - -D "TEST_REFERENCE=JUnit-interface.txt" - -P "${HDF_RESOURCES_DIR}/jrunTest.cmake" -) +if (HDF5_ENABLE_DEBUG_APIS) + add_test ( + NAME JUnit-interface + COMMAND "${CMAKE_COMMAND}" + -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}" + -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}" + -D "TEST_ARGS:STRING=${CMD_ARGS}-ea;org.junit.runner.JUnitCore" + -D "TEST_PROGRAM=test.TestUnit" + -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" + -D "TEST_FOLDER=${HDF5_BINARY_DIR}/java/test" + -D "TEST_OUTPUT=JUnit-interface.out" +# -D "TEST_LOG_LEVEL=trace" + -D "TEST_EXPECT=0" + -D "SKIP_APPEND=1" + -D "TEST_MASK_ERROR=TRUE" + -D "TEST_FILTER:STRING=${testfilter}" + -D "TEST_REFERENCE=JUnit-unit.txt" + -P "${HDF_RESOURCES_DIR}/jrunTest.cmake" + ) +else () + add_test ( + NAME JUnit-interface + COMMAND "${CMAKE_COMMAND}" + -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}" + -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}" + -D "TEST_ARGS:STRING=${CMD_ARGS}-ea;org.junit.runner.JUnitCore" + -D "TEST_PROGRAM=test.TestAll" + -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" + -D "TEST_FOLDER=${HDF5_BINARY_DIR}/java/test" + -D "TEST_OUTPUT=JUnit-interface.out" +# -D "TEST_LOG_LEVEL=trace" + -D "TEST_EXPECT=0" + -D "SKIP_APPEND=1" + -D "TEST_MASK_ERROR=TRUE" + -D "TEST_FILTER:STRING=${testfilter}" + -D "TEST_REFERENCE=JUnit-interface.txt" + -P "${HDF_RESOURCES_DIR}/jrunTest.cmake" + ) +endif () + set_tests_properties (JUnit-interface PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir2" DEPENDS "JUnit-interface-clearall-objects" diff --git a/java/test/JUnit-unit.txt b/java/test/JUnit-unit.txt new file mode 100644 index 0000000..fa33165 --- /dev/null +++ b/java/test/JUnit-unit.txt @@ -0,0 +1,614 @@ +JUnit version 4.11 +.testJ2C +.testIsSerializable +.testH5garbage_collect +.testH5error_off +.serializeToDisk +.testH5open +.testH5check_version +.testH5get_libversion +.testH5set_free_list_limits +.testH5EprintInt +.testH5Eget_msg_major +.testH5Eget_msg_minor +.testH5Eget_msg +.testH5Eget_num +.testH5Eget_class_name +.testH5Eget_num_with_msg +.testH5Eclear2 +.testH5Eprint2 +.testH5Ecreate_msg_major +.testH5Ecreate_msg_minor +.testH5Ecreate_stack +.testH5Ecreate_msg_name_null +.testH5Eauto_is_v2 +.testH5EclearInt +.testH5Fcreate_null +.testH5Fflush_local +.testH5Fget_info +.testH5Fmount_null +.testH5Fcreate +.testH5Fflush_global +.testH5Funmount_null +.testH5Fclose_negative +.testH5Fopen_null +.testH5Fis_hdf5_null +.testH5Fis_hdf5_text +.testH5Fget_mdc_size +.testH5Fget_mdc_hit_rate +.testH5Fis_hdf5 +.testH5Fget_freespace +.testH5Fclose +.testH5Fget_filesize +.testH5Fcreate_EXCL +.testH5Freopen_closed +.testH5Freset_mdc_hit_rate_stats +.testH5Fget_name +.testH5Fcreate +.testH5Fclear_elink_file_cache +.testH5Fclose_twice +.testH5Freopen +.testH5Fopen_read_only +.testH5Fget_access_plist +.testH5Fget_obj_ids +.testH5Fget_intent_rdwr +.testH5Fget_access_plist_closed +.testH5Fget_create_plist_closed +.testH5Fget_intent_rdonly +.testH5Fget_create_plist +.testH5Fget_obj_count +.testH5Fstart_swmr_write +.testH5Fswmr_read_attempts +.testH5Gget_info_by_name_not_exists +.testH5Gget_info_by_idx_not_exists +.testH5Gget_info_by_name +.testH5Gget_create_plist +.testH5Gopen +.testH5Gget_info_by_idx_null +.testH5Gopen_not_exists +.testH5Gclose +.testH5Gcreate_anon +.testH5Gcreate_null +.testH5Gget_info_by_idx_fileid +.testH5Gclose_invalid +.testH5Gflush_invalid +.testH5Gopen_invalid +.testH5Grefresh_invalid +.testH5Gget_info_invalid +.testH5Gcreate_invalid +.testH5Gcreate_exists +.testH5Gget_info_by_name_null +.testH5Gget_info_by_name_invalid +.testH5Gget_create_plist_invalid +.testH5Gcreate +.testH5Gget_info_by_name_fileid +.testH5Gget_info_by_idx_invalid +.testH5Gopen_null +.testH5Gget_info_by_idx +.testH5Gget_info +.testH5Gget_info_by_name +.testH5Gget_create_plist +.testH5Gopen +.testH5Gget_obj_info_all_gid2 +.testH5Gget_obj_info_all_byIndexType +.testH5Gget_obj_info_max_limit +.testH5Gget_obj_info_all +.testH5Gget_obj_info_max +.testH5Gget_obj_info_all_gid +.testH5Gget_info_by_idx +.testH5Gget_info +.testH5Sclose_invalid +.testH5Screate_simple_max_default +.testH5Screate_simple_dims_null +.testH5Sdecode_null +.testH5Screate_simple_dims_exceed +.testH5Screate_simple_unlimted_1d +.testH5Screate_simple_dims_invalid +.testH5Screate_scalar +.testH5Screate_simple +.testH5Screate_simple_rank_invalid +.testH5Sget_simple_extent_type_invalid +.testH5Sencode_invalid +.testH5Screate_null +.testH5Screate_simple_extent +.testH5Screate_invalid +.testH5Screate_simple_unlimted +.testH5Sget_select_npoints +.testH5Sget_select_type +.testH5Sset_extent_simple +.testH5Sget_select_hyper +.testH5Sget_select_valid +.testH5Sget_select_elem_pointlist +.testH5Sset_extent_none +.testH5Sencode_decode_scalar_dataspace +.testH5Soffset_simple +.testH5Scopy +.testH5Sget_simple_extent_ndims +.testH5Sextent_equal +.testH5Sget_simple_extent_dims +.testH5Sget_simple_extent_type +.testH5Shyper_regular +.testH5Sget_select_bounds +.testH5Sget_select_elem_pointlist_invalid +.testH5Sget_simple_extent_npoints +.testH5Sextent_copy +.testH5Sencode_decode_null_dataspace +.testH5Sis_simple +.testH5Sget_simple_extent_dims_null +.testH5Sselect_none +.testH5Tget_member_type_invalid +.testH5Tenum_insert_null +.testH5Tget_offset_invalid +.testH5Tset_precision_invalid +.testH5Tget_inpad_invalid +.testH5Tenum_nameof_invalid +.testH5Tget_member_value_invalid +.testH5Tenum_nameof_value_null +.testH5Tcreate_invalid +.testH5Tget_strpad_invalid +.testH5Tenum_valueof_invalid +.testH5Tget_fields_null +.testH5Topen_null +.testH5Tpack_invalid +.testH5Tcommit_null +.testH5Tinsert_invalid +.testH5Tenum_valueof_null +.testH5Tset_norm_invalid +.testH5Tlock_invalid +.testH5Tarray_create_invalid +.testH5Tget_member_value_null +.testH5Tset_offset_invalid +.testH5Tget_fields_invalid +.testH5Tequal_invalid +.testH5Tget_ebias_long_invalid +.testH5Tget_cset_invalid +.testH5Tget_size_invalid +.testH5Tset_strpad_invalid +.testH5Tset_ebias_invalid +.testH5Tget_sign_invalid +.testH5Tget_member_index_invalid +.testH5Tget_precision_invalid +.testH5Tset_fields_invalid +.testH5Tcopy_invalid +.testH5Tget_pad_invalid +.testH5Tset_order_invalid +.testH5Tget_member_class_invalid +.testH5Tget_super_invalid +.testH5Tget_class_invalid +.testH5Topen_invalid +.testH5Tget_precision_long_invalid +.testH5Tget_ebias_invalid +.testH5Tget_native_type_invalid +.testH5Tget_fields_length_invalid +.testH5Tget_norm_invalid +.testH5Tenum_nameof_invalid_size +.testH5Tset_pad_invalid +.testH5Tget_pad_null +.testH5Tset_tag_null +.testH5Tget_order_invalid +.testH5Tcommit_invalid +.testH5Tget_array_ndims_invalid +.testH5Tset_tag_invalid +.testH5Tvlen_create_invalid +.testH5Tenum_create_invalid +.testH5Tinsert_null +.testH5Tset_inpad_invalid +.testH5Tenum_valueof_name_null +.testH5Tset_cset_invalid +.testH5Tclose_invalid +.testH5Tget_nmembers_invalid +.testH5Tarray_create_value_null +.testH5Tset_size_invalid +.testH5Tflush_invalid +.testH5Tenum_insert_invalid +.testH5Tget_array_dims_null +.testH5Tget_member_index_null +.testH5Trefresh_invalid +.testH5Tset_sign_invalid +.testH5Tenum_insert_name_null +.testH5Tequal_not +.testH5Tcopy +.testH5Tequal +.testH5Torder_size +.testH5Tconvert +.testH5Tvlen_create +.testH5Tenum_create_functions +.testH5Tenum_functions +.testH5Tget_class +.testH5Tget_array_ndims +.testH5Tequal_type_error +.testH5Tget_array_dims +.testH5Tset_size +.testH5Tis_variable_str +.testH5Tcompound_functions +.testH5Tget_size +.testH5Tarray_create +.testH5Topaque_functions +.testH5Dget_space_status_invalid +.testH5Dget_access_plist_invalid +.testH5Dget_type_invalid +.testH5Dget_create_plist_invalid +.testH5Dget_offset_invalid +.testH5Dvlen_get_buf_size_invalid +.testH5Dcreate_null +.testH5Dset_extent_status_null +.testH5Dvlen_reclaim_null +.testH5Dcreate_invalid +.testH5Dcreate_anon_invalid +.testH5Dset_extent_status_invalid +.testH5Dvlen_reclaim_invalid +.testH5Dopen_invalid +.testH5Dclose_invalid +.testH5Dflush_invalid +.testH5Drefresh_invalid +.testH5Dget_storage_size_invalid +.testH5Dget_space_invalid +.testH5Dopen_null +.testH5Dget_storage_size +.testH5Diterate_write +.testH5Dcreate +.testH5Dget_offset +.testH5Dget_type +.testH5Dfill +.testH5Dopen +.testH5Dcreate_anon +.testH5Dfill_null +.testH5Dget_storage_size_empty +.testH5Diterate +.testH5Dget_access_plist +.testH5Dvlen_read_invalid_buffer +.testH5Dvlen_get_buf_size +.testH5Dget_space_closed +.testH5Dget_space_status +.testH5Dvlen_write_read +.testH5Dget_space +.testH5Dget_type_closed +.testH5Dset_extent +.testH5Lcopy_invalid +.testH5Lget_value_by_idx_null +.testH5Lcreate_external_invalid +.testH5Lexists_null +.testH5Lget_info_invalid +.testH5Lget_name_by_idx_invalid +.testH5Lmove_null_current +.testH5Literate_by_name_nullname +.testH5Lvisit_by_name_nullname +.testH5Lvisit_null +.testH5Lget_name_by_idx_null +.testH5Lcreate_hard_null_dest +.testH5Lget_value_null +.testH5Lcreate_external_null_dest +.testH5Lcreate_external_null_file +.testH5Lcreate_external_null_current +.testH5Ldelete_null +.testH5Lexists_invalid +.testH5Lmove_invalid +.testH5Lcreate_hard_invalid +.testH5Lcopy_null_dest +.testH5Lcreate_soft_null_current +.testH5Lcopy_null_current +.testH5Lget_info_by_idx_null +.testH5Literate_null +.testH5Ldelete_invalid +.testH5Lvisit_by_name_null +.testH5Ldelete_by_idx_invalid +.testH5Lget_info_by_idx_invalid +.testH5Ldelete_by_idx_null +.testH5Lcreate_soft_invalid +.testH5Lcreate_hard_null_current +.testH5Lget_value_by_idx_invalid +.testH5Lmove_null_dest +.testH5Lget_info_null +.testH5Literate_by_name_null +.testH5Lcreate_soft_null_dest +.testH5Lget_value_invalid +.testH5Lget_info_by_idx_not_exist_name +.testH5Lget_name_by_idx_not_exist +.testH5Lvisit +.testH5Lget_name_by_idx_n0 +.testH5Lget_name_by_idx_n3 +.testH5Lvisit_by_name +.testH5Literate_by_name +.testH5Lget_info_hardlink +.testH5Literate +.testH5Lget_info_by_idx_n0 +.testH5Lget_info_by_idx_n3 +.testH5Lget_info_by_idx_name_not_exist_create +.testH5Lexists +.testH5Lget_info_by_idx_name_not_exist_name +.testH5Lget_info_by_idx_not_exist_create +.testH5Lget_info_not_exist +.testH5Lget_info_dataset +.testH5Lget_info_by_idx_n0_create +.testH5Ldelete_soft_link_dangle +.testH5Lget_value_by_idx_external_create +.testH5Ldelete_by_idx_not_exist_create +.testH5Lvisit_create +.testH5Lmove_dst_link_exists +.testH5Lcreate_soft_dangle +.testH5Literate_create +.testH5Lcopy_cur_not_exists +.testH5Lcopy +.testH5Lmove +.testH5Lget_value_by_idx_n2_create +.testH5Lget_value_soft +.testH5Ldelete_by_idx_n2_name +.testH5Lget_info_by_idx_n1_create +.testH5Lcreate_external +.testH5Lget_value_dangle +.testH5Lcreate_hard_dst_link_exists +.testH5Lget_value_by_idx_n2_name +.testH5Lcreate_soft_dst_link_exists +.testH5Lcreate_hard +.testH5Lcreate_soft +.testH5Lmove_cur_not_exists +.testH5Lcreate_hard_cur_not_exists +.testH5Lget_info_softlink_dangle +.testH5Ldelete_by_idx_n2_create +.testH5Ldelete_soft_link +.testH5Lget_info_externallink +.testH5Lcopy_dst_link_exists +.testH5Lget_value_by_idx_external_name +.testH5Ldelete_by_idx_not_exist_name +.testH5Lget_info_softlink +.testH5Lget_value_external +.testH5Lget_value_by_idx_not_exist_create +.testH5Lget_value_by_idx_not_exist_name +.testH5Ldelete_hard_link +.testH5Rgetregion_Nullreference +.testH5Rget_obj_type2_Invalidreftype +.testH5Rdereference +.testH5Rget_name +.testH5Rcreate_Invalidreftype +.testH5Rget_name_NULLreference +.testH5Rget_region +.testH5Rdereference_Nullreference +.testH5Rcreate_refobj +.testH5Rcreate_Invalidspace_id +.testH5Rdereference_Invalidreference +.testH5Rgetregion_Badreferencetype +.testH5Rcreate_regionrefobj +.testH5Rget_name_Invalidreftype +.testH5Rgetregion_Invalidreftype +.testH5Rget_obj_type2 +.testH5Rcreate_InvalidObjectName +.testH5Pset_nbit +.testH5Pset_shared_mesg_index_InvalidFlag +.testH5Pset_shared_mesg_phase_change +.testH5PH5Pset_shared_mesg_phase_change_HighMaxlistValue +.testH5P_layout +.testH5Pget_link_creation_order +.testH5Pget_efile_prefix +.testH5Pset_shared_mesg_nindexes_InvalidHIGHnindexes +.testH5P_file_space_page_size +.testH5Pget_shared_mesg_index_Invalid_indexnum +.testH5Pset_data_transform_NullExpression +.testH5Pset_elink_prefix_null +.testH5Pget_elink_prefix +.testH5Pget_nlinks +.testH5Pset_libver_bounds_invalidhigh +.testH5Pget_char_encoding +.testH5P_istore_k +.testH5Pget_link_phase_change +.testH5Pset_link_phase_change_max_compactLESSTHANmin_dense +.testH5Pget_shared_mesg_phase_change_EqualsSET +.testH5Pset_scaleoffset_Invalidscale_type +.testH5Pget_istore_k_null +.testH5Pset_libver_bounds_invalidlow +.testH5Pset_est_link_info +.testH5Pget_link_phase_change_Null +.testH5P_fill_time +.testH5Pget_userblock_null +.testH5Pset_link_creation_order_tracked +.testH5Pset_shared_mesg_index +.testH5Pset_copy_object +.testH5Pset_link_creation_order_trackedPLUSindexed +.testH5P_file_space_strategy +.testH5Pset_copy_object_invalidobject +.testH5Pset_est_link_info_InvalidValues +.testH5Pset_local_heap_size_hint +.testH5Pget_est_link_info +.testH5Pset_efile_prefix_null +.testH5Pset_scaleoffset +.testH5Pset_create_intermediate_group_invalidobject +.testH5PH5Pset_shared_mesg_phase_change_HighMinbtreeValue +.testH5Pset_create_intermediate_group +.testH5P_alloc_time +.testH5Pset_elink_acc_flags +.testH5Pset_link_phase_change_Highmax_Compact +.testH5P_chunk +.testH5P_sizes +.testH5Pset_link_creation_order_invalidvalue +.testH5P_sym_k +.testH5PH5Pset_shared_mesg_phase_change_MinbtreeGreaterThanMaxlist +.testH5Pget_version_null +.testH5Pset_scaleoffset_Invalidscale_factor +.testH5Pget_elink_prefix_null +.testH5Pget_data_transform_IllegalSize +.testH5Pget_create_intermediate_group +.testH5Pset_shared_mesg_nindexes +.testH5Pset_attr_creation_order_trackedPLUSindexed +.testH5Pget_sym_k_null +.testH5Pset_nlinks +.testH5P_obj_track_times +.testH5Pset_efile_prefix +.testH5P_userblock +.testH5Pget_local_heap_size_hint +.testH5Pset_shared_mesg_index_Invalid_indexnum +.testH5Pset_data_transform_InvalidExpression1 +.testH5Pset_data_transform_InvalidExpression2 +.testH5Pget_attr_phase_change +.testH5Pget_data_transform +.testH5Pget_create_intermediate_group_notcreated +.testH5Pset_elink_prefix +.testH5Pget_attr_creation_order +.testH5Pset_attr_creation_order_invalidvalue +.testH5Pget_shared_mesg_phase_change +.testH5Pget_shared_mesg_index +.testH5Pset_link_phase_change +.testH5Pget_shared_mesg_nindexes +.testH5Pget_version +.testH5Pset_elink_acc_flags_InvalidFlag1 +.testH5Pset_elink_acc_flags_InvalidFlag2 +.testH5Pget_link_phase_change_EqualsSet +.testH5Pget_elink_acc_flags +.testH5Pget_data_transform_ExpressionNotSet +.testH5P_fill_value +.testH5Pget_sizes_null +.testH5Pset_data_transform +.testH5Pset_attr_creation_order_tracked +.testH5P_buffer +.testH5Pdata_transform +.testH5P_elink_fapl +.testH5P_fapl_direct +.testH5P_alignment +.testH5P_fapl_family +.testH5P_chunk_cache +.testH5P_meta_block_size +.testH5Fmdc_logging +.testH5Pget_elink_fapl +.testH5Pset_mdc_config +.testH5P_small_data_block_size +.testH5Pset_fapl_log +.testH5P_evict_on_close +.testH5Pset_libver_bounds +.testH5P_sieve_buf_size +.testH5P_elink_file_cache_size +.testH5P_cache +.testH5Pget_mdc_config +.testH5P_fapl_muti_defaults +.testH5Pget_libver_bounds +.testH5P_btree_ratios +.testH5P_fapl_muti_nulls +.testH5Pset_fapl_sec2 +.testH5Pmulti_transform +.testH5Pset_elink_fapl_NegativeID +.testH5Pset_fapl_stdio +.testH5P_edc_check +.testH5Pset_elink_fapl +.testH5P_hyper_vector_size +.testH5P_gc_references +.testH5P_family_offset +.testH5P_fapl_core +.testH5P_fapl_muti +.testH5P_fapl_split +.testH5Pset_fapl_windows +.testH5P_fclose_degree +.testH5Pget_source_datasetname +.testH5Pvirtual_storage +.testH5Pget_selection_source_dataset +.testH5Pget_virtual_prefix +.testH5Pget_source_filename +.testH5Pset_get_virtual_printf_gap +.testH5Pget_virtual_count +.testH5Pset_virtual_prefix +.testH5Pset_get_virtual_view +.testH5Pget_mapping_parameters +.testH5Pset_virtual_prefix_null +.testH5P_genprop_basic_class +.testH5P_genprop_class_iter +.testH5P_genprop_basic_class_prop +.testH5P_genprop_basic_list_prop +.testH5Acreate2_nullname +.testH5Acreate_by_name +.testH5Aget_name_by_idx +.testH5Aget_storage_size +.testH5Aiterate +.testH5Aopen_by_idx +.testH5Aopen_invalidname +.testH5Aopen +.testH5Aget_info_by_name +.testH5Aget_create_plist +.testH5Adelete_by_name +.testH5Aopen_by_name +.testH5Aget_info +.testH5Aget_name +.testH5Aexists +.testH5Aget_info_by_idx +.testH5Arename +.testH5Adelete_by_idx_name1 +.testH5Adelete_by_idx_name2 +.testH5Adelete_by_idx_order +.testH5Arename_by_name +.testH5Acreate2_invalidobject +.testH5Acreate2 +.testH5Aiterate_by_name +.testH5Adelete_by_idx_null +.testH5Adelete_by_idx_invalidobject +.testH5Awrite_readVL +.testH5Aget_info1 +.testH5Oget_comment_by_name_null +.testH5Ovisit_by_name_nullname +.testH5Oget_info_invalid +.testH5Ovisit_by_name_null +.testH5Oget_comment_invalid +.testH5Oset_comment_by_name_invalid +.testH5Oopen_null +.testH5Oclose_invalid +.testH5Oflush_invalid +.testH5Oget_comment_by_name_invalid +.testH5Orefresh_invalid +.testH5Ocopy_null_dest +.testH5Olink_invalid +.testH5Oget_info_by_idx_invalid +.testH5Oget_info_by_idx_null +.testH5Olink_null_dest +.testH5Oget_info_by_name_invalid +.testH5Oget_info_by_name_null +.testH5Ocopy_invalid +.testH5Oset_comment_by_name_null +.testH5Ocopy_null_current +.testH5Oset_comment_invalid +.testH5Oopen_invalid +.testH5Ovisit_null +.testH5Oexists_by_name +.testH5Oget_info_by_idx_n0 +.testH5Oget_info_by_idx_n3 +.testH5Oget_info_by_name_not_exist_name +.testH5Ovisit_by_name +.testH5Oget_info_by_idx_name_not_exist_name +.testH5Oget_info_datatype +.testH5Oget_info_by_idx_not_exist_name +.testH5Oopen_by_idx_n0 +.testH5Oopen_by_idx_n3 +.testH5Oopen_not_exists +.testH5Ovisit +.testH5Oget_info_by_idx_not_exist_create +.testH5Oget_info_by_name_hardlink +.testH5Oget_info_by_name_group +.testH5Oopen_by_addr +.testH5Oget_info_by_name_not_exists +.testH5Oget_info_by_name_dataset +.testH5Oget_info_group +.testH5Oget_info_by_name_datatype +.testH5Oget_info_hardlink +.testH5Oget_info_by_idx_name_not_exist_create +.testH5Oget_info_dataset +.testH5OcopyRefsDatasettosameFile +.testH5OcopyRefsDatasettodiffFile +.testH5OcopyRefsAttr +.testH5Oget_info_by_idx_n0_create +.testH5Oget_info_softlink_dangle +.testH5Oget_info_softlink +.testH5Oget_info_externallink +.testH5Ocopy +.testH5Olink +.testH5Ocomment_by_name +.testH5Oget_info_by_idx_n1_create +.testH5Ocomment +.testH5Oinc_dec_count +.testH5Ocomment_by_name_clear +.testH5Ovisit_create +.testH5Ocopy_dst_link_exists +.testH5Ocomment_clear +.testH5Ocopy_cur_not_exists +.TestH5PLplugins +.TestH5PLpaths +.testH5Zfilter_avail +.testH5Zunregister_predefined +.testH5Zget_filter_info + +Time: XXXX + +OK (608 tests) + diff --git a/java/test/Makefile.am b/java/test/Makefile.am index b7409cf..9ed8517 100644 --- a/java/test/Makefile.am +++ b/java/test/Makefile.am @@ -35,16 +35,13 @@ AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation noinst_JAVA = \ TestH5.java \ - TestH5E.java \ - TestH5Edefault.java \ - TestH5Eregister.java \ + TestH5Eparams.java \ TestH5Fparams.java \ TestH5Fbasic.java \ TestH5F.java \ TestH5Fswmr.java \ TestH5Gbasic.java \ TestH5G.java \ - TestH5Giterate.java \ TestH5Sbasic.java \ TestH5S.java \ TestH5Tparams.java \ @@ -69,7 +66,7 @@ noinst_JAVA = \ TestH5Ocopy.java \ TestH5PL.java \ TestH5Z.java \ - TestAll.java + TestUnit.java $(jarfile): classnoinst.stamp classes $(JAR) cvf $@ -C $(JAVAROOT)/ $(pkgpath) @@ -91,7 +88,7 @@ TESTS_JUNIT = AllJunitTests AllJunitTests : echo "#! /bin/sh" > $@ - echo "exec @JUNIT@ test.TestAll" >> $@ + echo "exec @JUNIT@ test.TestUnit" >> $@ chmod +x $@ clean: diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index f3c6c91..1eb1914 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -73,179 +73,6 @@ public class TestH5E { } @Test - public void testH5Eget_class_name() { - try { - String class_name = H5.H5Eget_class_name(hdf_java_classid); - assertNotNull("H5.H5Eget_class_name: " + class_name, class_name); - assertEquals("H5.H5Eget_class_name: ", "HDF-Java-Error", class_name); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_class_name: " + err); - } - } - - @Test - public void testH5Eprint2() { - try { - assertFalse(current_stackid < 0); - H5.H5Eprint2(current_stackid, null); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eprint2: " + err); - } - } - - @Ignore("Tested with create_msg_major[minor]") - public void testH5Eclose_msg() { - fail("Not yet implemented"); - } - - @Test(expected = NullPointerException.class) - public void testH5Ecreate_msg_name_null() throws Throwable { - H5.H5Ecreate_msg(hdf_java_classid, HDF5Constants.H5E_MAJOR, null); - } - - @Test - public void testH5Ecreate_msg_major() { - try { - long err_id = H5.H5Ecreate_msg(hdf_java_classid, - HDF5Constants.H5E_MAJOR, "Error in Test"); - assertFalse("H5.H5Ecreate_msg_major: " + err_id, err_id < 0); - H5.H5Eclose_msg(err_id); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Ecreate_msg_major: " + err); - } - } - - @Test - public void testH5Ecreate_msg_minor() { - try { - long err_id = H5.H5Ecreate_msg(hdf_java_classid, - HDF5Constants.H5E_MINOR, "Error in Test Function"); - assertFalse("H5.H5Ecreate_msg_minor: " + err_id, err_id < 0); - H5.H5Eclose_msg(err_id); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Ecreate_msg_minor: " + err); - } - } - - @Test - public void testH5Eget_msg() { - int[] error_msg_type = { HDF5Constants.H5E_MINOR }; - long err_id = -1; - String msg = null; - try { - err_id = H5.H5Ecreate_msg(hdf_java_classid, - HDF5Constants.H5E_MAJOR, "Error in Test"); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); - } - assertFalse("H5.H5Eget_msg: H5Ecreate_msg - " + err_id, err_id < 0); - try { - msg = H5.H5Eget_msg(err_id, error_msg_type); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); - } - assertNotNull("H5.H5Eget_msg: " + msg, msg); - assertEquals("H5.H5Eget_msg: ", "Error in Test", msg); - assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, - error_msg_type[0]); - try { - H5.H5Eclose_msg(err_id); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); - } - } - - @Test - public void testH5Eget_msg_major() { - - try { - H5.H5Fopen("test", 0, 1); - } - catch (HDF5LibraryException hdferr) { - int[] error_msg_type = { HDF5Constants.H5E_MAJOR }; - String msg = null; - try { - msg = H5.H5Eget_msg(hdferr.getMajorErrorNumber(), - error_msg_type); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); - } - assertNotNull("H5.H5Eget_msg: " + msg, msg); - assertEquals("H5.H5Eget_msg: ", "Object atom", - msg); - assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, - error_msg_type[0]); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); - } - } - - @Test - public void testH5Eget_msg_minor() { - try { - H5.H5Fopen("test", 0, 1); - } - catch (HDF5LibraryException hdferr) { - int[] error_msg_type = { HDF5Constants.H5E_MINOR }; - String msg = null; - try { - msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(), - error_msg_type); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); - } - assertNotNull("H5.H5Eget_msg: " + msg, msg); - assertEquals("H5.H5Eget_msg: ", "Unable to find atom information (already closed?)", msg); - assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR, - error_msg_type[0]); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); - } - } - - @Test - public void testH5Ecreate_stack() { - long stk_id = -1; - try { - stk_id = H5.H5Ecreate_stack(); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Ecreate_stack: " + err); - } - assertFalse("H5.H5Ecreate_stack: " + stk_id, stk_id < 0); - try { - H5.H5Eclose_stack(stk_id); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Ecreate_stack: " + err); - } - } - - @Test public void testH5Epop() { try { H5.H5Eset_current_stack(current_stackid); @@ -381,101 +208,6 @@ public class TestH5E { } /* end test_create() */ @Test - public void testH5EprintInt() { - assertFalse(current_stackid < 0); - try { - H5.H5Eprint2(current_stackid, null); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5EprintInt: " + err); - } - } - - @Test - public void testH5EclearInt() { - try { - H5.H5Eclear(current_stackid); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5EclearInt: " + err); - } - } - - @Test - public void testH5Eclear2() { - try { - H5.H5Eclear2(current_stackid); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eclear2: " + err); - } - } - - @Test - public void testH5Eauto_is_v2() { - boolean is_v2 = false; - try { - is_v2 = H5.H5Eauto_is_v2(current_stackid); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eauto_is_v2: " + err); - } - assertTrue("H5.H5Eauto_is_v2: ", is_v2); - } - - @Test - public void testH5Eget_num() { - long num_msg = -1; - try { - num_msg = H5.H5Eget_num(current_stackid); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_num: " + err); - } - assertTrue("H5.H5Eget_num", num_msg == 0); - } - - @Test - public void testH5Eget_num_with_msg() { - try { - H5.H5Eset_current_stack(current_stackid); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Epop: " + err); - } - try { - H5.H5Fopen("test", 0, 1); - } - catch (Throwable err) { - } - - // save current stack contents - try { - current_stackid = H5.H5Eget_current_stack(); - } - catch (HDF5LibraryException err) { - err.printStackTrace(); - fail("H5.H5Epop: " + err); - } - - long num_msg = -1; - try { - num_msg = H5.H5Eget_num(current_stackid); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Epop: " + err); - } - assertTrue("H5.H5Eget_num_with_msg #:" + num_msg, num_msg > 0); - } - - @Test public void testH5Ewalk() { class wdata { public String err_desc = null; diff --git a/java/test/TestH5Eparams.java b/java/test/TestH5Eparams.java new file mode 100644 index 0000000..fa9d776 --- /dev/null +++ b/java/test/TestH5Eparams.java @@ -0,0 +1,343 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +package test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.util.ArrayList; + +import hdf.hdf5lib.H5; +import hdf.hdf5lib.HDF5Constants; +import hdf.hdf5lib.exceptions.HDF5LibraryException; +import hdf.hdf5lib.callbacks.H5E_walk_cb; +import hdf.hdf5lib.callbacks.H5E_walk_t; +import hdf.hdf5lib.structs.H5E_error2_t; + +import org.junit.After; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; + +public class TestH5Eparams { + @Rule public TestName testname = new TestName(); + long hdf_java_classid = -1; + long current_stackid = -1; + + @Before + public void H5Eget_stack_class() { + assertTrue("H5 open ids is 0",H5.getOpenIDCount()==0); + System.out.print(testname.getMethodName()); + + hdf_java_classid = -1; + try { + hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", + "hdf-java", "2.5"); + current_stackid = H5.H5Eget_current_stack(); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_stack_class: " + err); + } + } + + @After + public void H5Erestore_stack_class() { + try { + H5.H5Eunregister_class(hdf_java_classid); + hdf_java_classid = -1; + H5.H5Eclose_stack(current_stackid); + current_stackid = -1; + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Erestore_stack_class: " + err); + } + System.out.println(); + } + + @Test + public void testH5Eget_class_name() { + try { + String class_name = H5.H5Eget_class_name(hdf_java_classid); + assertNotNull("H5.H5Eget_class_name: " + class_name, class_name); + assertEquals("H5.H5Eget_class_name: ", "HDF-Java-Error", class_name); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_class_name: " + err); + } + } + + @Test + public void testH5Eprint2() { + try { + assertFalse(current_stackid < 0); + H5.H5Eprint2(current_stackid, null); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eprint2: " + err); + } + } + + @Ignore("Tested with create_msg_major[minor]") + public void testH5Eclose_msg() { + fail("Not yet implemented"); + } + + @Test(expected = NullPointerException.class) + public void testH5Ecreate_msg_name_null() throws Throwable { + H5.H5Ecreate_msg(hdf_java_classid, HDF5Constants.H5E_MAJOR, null); + } + + @Test + public void testH5Ecreate_msg_major() { + try { + long err_id = H5.H5Ecreate_msg(hdf_java_classid, + HDF5Constants.H5E_MAJOR, "Error in Test"); + assertFalse("H5.H5Ecreate_msg_major: " + err_id, err_id < 0); + H5.H5Eclose_msg(err_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Ecreate_msg_major: " + err); + } + } + + @Test + public void testH5Ecreate_msg_minor() { + try { + long err_id = H5.H5Ecreate_msg(hdf_java_classid, + HDF5Constants.H5E_MINOR, "Error in Test Function"); + assertFalse("H5.H5Ecreate_msg_minor: " + err_id, err_id < 0); + H5.H5Eclose_msg(err_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Ecreate_msg_minor: " + err); + } + } + + @Test + public void testH5Eget_msg() { + int[] error_msg_type = { HDF5Constants.H5E_MINOR }; + long err_id = -1; + String msg = null; + try { + err_id = H5.H5Ecreate_msg(hdf_java_classid, + HDF5Constants.H5E_MAJOR, "Error in Test"); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + assertFalse("H5.H5Eget_msg: H5Ecreate_msg - " + err_id, err_id < 0); + try { + msg = H5.H5Eget_msg(err_id, error_msg_type); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + assertNotNull("H5.H5Eget_msg: " + msg, msg); + assertEquals("H5.H5Eget_msg: ", "Error in Test", msg); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, + error_msg_type[0]); + try { + H5.H5Eclose_msg(err_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + } + + @Test + public void testH5Eget_msg_major() { + + try { + H5.H5Fopen("test", 0, 1); + } + catch (HDF5LibraryException hdferr) { + int[] error_msg_type = { HDF5Constants.H5E_MAJOR }; + String msg = null; + try { + msg = H5.H5Eget_msg(hdferr.getMajorErrorNumber(), + error_msg_type); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + assertNotNull("H5.H5Eget_msg: " + msg, msg); + assertEquals("H5.H5Eget_msg: ", "Object atom", + msg); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, + error_msg_type[0]); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + } + + @Test + public void testH5Eget_msg_minor() { + try { + H5.H5Fopen("test", 0, 1); + } + catch (HDF5LibraryException hdferr) { + int[] error_msg_type = { HDF5Constants.H5E_MINOR }; + String msg = null; + try { + msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(), + error_msg_type); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + assertNotNull("H5.H5Eget_msg: " + msg, msg); + assertEquals("H5.H5Eget_msg: ", "Unable to find atom information (already closed?)", msg); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR, + error_msg_type[0]); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + } + + @Test + public void testH5Ecreate_stack() { + long stk_id = -1; + try { + stk_id = H5.H5Ecreate_stack(); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Ecreate_stack: " + err); + } + assertFalse("H5.H5Ecreate_stack: " + stk_id, stk_id < 0); + try { + H5.H5Eclose_stack(stk_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Ecreate_stack: " + err); + } + } + + @Test + public void testH5EprintInt() { + assertFalse(current_stackid < 0); + try { + H5.H5Eprint2(current_stackid, null); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5EprintInt: " + err); + } + } + + @Test + public void testH5EclearInt() { + try { + H5.H5Eclear(current_stackid); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5EclearInt: " + err); + } + } + + @Test + public void testH5Eclear2() { + try { + H5.H5Eclear2(current_stackid); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eclear2: " + err); + } + } + + @Test + public void testH5Eauto_is_v2() { + boolean is_v2 = false; + try { + is_v2 = H5.H5Eauto_is_v2(current_stackid); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eauto_is_v2: " + err); + } + assertTrue("H5.H5Eauto_is_v2: ", is_v2); + } + + @Test + public void testH5Eget_num() { + long num_msg = -1; + try { + num_msg = H5.H5Eget_num(current_stackid); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_num: " + err); + } + assertTrue("H5.H5Eget_num", num_msg == 0); + } + + @Test + public void testH5Eget_num_with_msg() { + try { + H5.H5Eset_current_stack(current_stackid); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Epop: " + err); + } + try { + H5.H5Fopen("test", 0, 1); + } + catch (Throwable err) { + } + + // save current stack contents + try { + current_stackid = H5.H5Eget_current_stack(); + } + catch (HDF5LibraryException err) { + err.printStackTrace(); + fail("H5.H5Epop: " + err); + } + + long num_msg = -1; + try { + num_msg = H5.H5Eget_num(current_stackid); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Epop: " + err); + } + assertTrue("H5.H5Eget_num_with_msg #:" + num_msg, num_msg > 0); + } + +} diff --git a/java/test/TestUnit.java b/java/test/TestUnit.java new file mode 100644 index 0000000..b55e415 --- /dev/null +++ b/java/test/TestUnit.java @@ -0,0 +1,36 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +package test; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses( { TestH5.class, + TestH5Eparams.class, + TestH5Fparams.class, TestH5Fbasic.class, TestH5F.class, TestH5Fswmr.class, + TestH5Gbasic.class, TestH5G.class, + TestH5Sbasic.class, TestH5S.class, + TestH5Tparams.class, TestH5Tbasic.class, TestH5T.class, + TestH5Dparams.class, TestH5D.class, TestH5Dplist.class, + TestH5Lparams.class, TestH5Lbasic.class, TestH5Lcreate.class, + TestH5R.class, + TestH5P.class, TestH5PData.class, TestH5Pfapl.class, TestH5Pvirtual.class, TestH5Plist.class, + TestH5A.class, + TestH5Oparams.class, TestH5Obasic.class, TestH5Ocopy.class, TestH5Ocreate.class, + TestH5PL.class, TestH5Z.class +}) + +public class TestUnit { +} diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index 77379d0..ca3790d 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -64,11 +64,11 @@ $HDFLIB_HOME/ext/slf4j-simple-1.7.5.jar $top_builddir/java/src/$JARFILE " LIST_DATA_FILES=" -$HDFTEST_HOME/JUnit-interface.txt +$HDFTEST_HOME/JUnit-unit.txt $HDFTEST_HOME/JUnit-interface.ert " -expect="JUnit-interface.txt" +expect="JUnit-unit.txt" actual="JUnit-interface.out" actual_err="JUnit-interface.err" actual_ext="JUnit-interface.ext" @@ -257,11 +257,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" +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestUnit" # 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 + $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestUnit ) >$actual_ext 2>$actual_err # Extract file name, line number, version and thread IDs because they may be different -- cgit v0.12 From db3d744f250974ca8739269928fa194a84fca5c6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 10 Apr 2018 08:55:17 -0500 Subject: HDFFV-10444 fix soversion numbers for libraries --- CMakeLists.txt | 43 +++++++++++++++++++++++++------------- c++/src/CMakeLists.txt | 4 ++-- config/cmake/HDF5Macros.cmake | 10 +++------ fortran/src/CMakeLists.txt | 8 +++---- fortran/test/CMakeLists.txt | 8 +++---- hl/c++/src/CMakeLists.txt | 4 ++-- hl/fortran/src/CMakeLists.txt | 8 +++---- hl/src/CMakeLists.txt | 4 ++-- java/src/jni/CMakeLists.txt | 2 +- src/CMakeLists.txt | 4 ++-- test/CMakeLists.txt | 8 +++---- tools/lib/CMakeLists.txt | 4 ++-- tools/test/h5copy/CMakeLists.txt | 2 +- tools/test/h5diff/CMakeLists.txt | 2 +- tools/test/h5dump/CMakeLists.txt | 2 +- tools/test/h5ls/CMakeLists.txt | 2 +- tools/test/h5repack/CMakeLists.txt | 4 ++-- 17 files changed, 65 insertions(+), 54 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ac4c60..0da475a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,13 +218,13 @@ string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._]*) #----------------------------------------------------------------------------- file (READ ${HDF5_SOURCE_DIR}/config/lt_vers.am _lt_vers_am_contents) string (REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" - "\\1" H5_SOVERS_INTERFACE ${_lt_vers_am_contents}) + "\\1" H5_LIB_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" - "\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents}) + "\\1" H5_LIB_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}) -message (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") + "\\1" H5_LIB_SOVERS_RELEASE ${_lt_vers_am_contents}) +math (EXPR H5_LIB_SOVERS_MAJOR ${H5_LIB_SOVERS_INTERFACE}-${H5_LIB_SOVERS_RELEASE}) +message (STATUS "SOVERSION: ${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_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) string (REGEX REPLACE ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" @@ -316,41 +316,56 @@ if (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") else () set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") endif () -set (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") +set (HDF5_LIB_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") +set (HDF5_LIB_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") if (H5_TOOLS_SOVERS_EXISTS) set (HDF5_TOOLS_PACKAGE_SOVERSION "${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") + set (HDF5_TOOLS_PACKAGE_SOVERSION_MAJOR "${H5_TOOLS_SOVERS_MAJOR}") else () - set (HDF5_TOOLS_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") + set (HDF5_TOOLS_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") + set (HDF5_TOOLS_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") endif () if (H5_CXX_SOVERS_EXISTS) set (HDF5_CXX_PACKAGE_SOVERSION "${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") + set (HDF5_CXX_PACKAGE_SOVERSION_MAJOR "${H5_CXX_SOVERS_MAJOR}") else () - set (HDF5_CXX_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") + set (HDF5_CXX_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") + set (HDF5_CXX_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") endif () if (H5_F_SOVERS_EXISTS) set (HDF5_F_PACKAGE_SOVERSION "${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") + set (HDF5_F_PACKAGE_SOVERSION_MAJOR "${H5_F_SOVERS_MAJOR}") else () - set (HDF5_F_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") + set (HDF5_F_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") + set (HDF5_F_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") endif () if (H5_HL_SOVERS_EXISTS) set (HDF5_HL_PACKAGE_SOVERSION "${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") + set (HDF5_HL_PACKAGE_SOVERSION_MAJOR "${H5_HL_SOVERS_MAJOR}") else () - set (HDF5_HL_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") + set (HDF5_HL_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") + set (HDF5_HL_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") 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}") + set (HDF5_HL_CXX_PACKAGE_SOVERSION_MAJOR "${H5_HL_CXX_SOVERS_MAJOR}") else () - set (HDF5_HL_CXX_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") + set (HDF5_HL_CXX_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") + set (HDF5_HL_CXX_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") 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}") + set (HDF5_HL_F_PACKAGE_SOVERSION_MAJOR "${H5_HL_F_SOVERS_MAJOR}") else () - set (HDF5_HL_F_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") + set (HDF5_HL_F_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") + set (HDF5_HL_F_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") endif () if (H5_JAVA_SOVERS_EXISTS) - set (HDF5_PACKAGE_SOVERSION "${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}") + set (HDF5_JAVA_PACKAGE_SOVERSION "${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}") + set (HDF5_JAVA_PACKAGE_SOVERSION_MAJOR "${H5_JAVA_SOVERS_MAJOR}") else () - set (HDF5_JAVA_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") + set (HDF5_JAVA_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") + set (HDF5_JAVA_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") endif () set (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") set (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 1136d6a..35e7590 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -86,7 +86,7 @@ add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS}) TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") -H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC) +H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC 0) set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp INTERFACE_INCLUDE_DIRECTORIES "$/include>" @@ -98,7 +98,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_CPP_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_CPP_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIBSH_TARGET}") - H5_SET_LIB_OPTIONS (${HDF5_CPP_LIBSH_TARGET} ${HDF5_CPP_LIB_NAME} SHARED ${HDF5_CXX_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_CPP_LIBSH_TARGET} ${HDF5_CPP_LIB_NAME} SHARED "CXX") set_target_properties (${HDF5_CPP_LIBSH_TARGET} PROPERTIES FOLDER libraries/cpp COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB" diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index c3dea9a..e472a67 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -10,19 +10,15 @@ # help@hdfgroup.org. # #------------------------------------------------------------------------------- -macro (H5_SET_LIB_OPTIONS libtarget libname libtype) +macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) set (LIB_OUT_NAME "${libname}") # SOVERSION passed in ARGN when shared if (${libtype} MATCHES "SHARED") - if (ARGN) - set (PACKAGE_SOVERSION ${ARGN}) - else () - set (PACKAGE_SOVERSION ${H5_SOVERS_MAJOR}) - endif () + set (PACKAGE_SOVERSION ${HDF5_${libpackage}_PACKAGE_SOVERSION}) if (WIN32) set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) else () - set (LIBHDF_VERSION ${HDF5_PACKAGE_SOVERSION}) + set (LIBHDF_VERSION ${HDF5_${libpackage}_PACKAGE_SOVERSION_MAJOR}) endif () set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) if (WIN32) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 3abab4e..03c12ac 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -136,7 +136,7 @@ target_include_directories(${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") -H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} STATIC) +H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} STATIC 0) set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/fortran LINKER_LANGUAGE C @@ -150,7 +150,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}") - H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_F90_C_LIB_NAME} SHARED ${HDF5_F_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_F90_C_LIB_NAME} SHARED "F") set_target_properties (${HDF5_F90_C_LIBSH_TARGET} PROPERTIES FOLDER libraries/fortran LINKER_LANGUAGE C @@ -255,7 +255,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) 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) +H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} STATIC 0) set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES FOLDER libraries/fortran LINKER_LANGUAGE Fortran @@ -284,7 +284,7 @@ if (BUILD_SHARED_LIBS) target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) 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}) + H5_SET_LIB_OPTIONS (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_LIB_NAME} SHARED "F") set_target_properties (${HDF5_F90_LIBSH_TARGET} PROPERTIES FOLDER libraries/fortran LINKER_LANGUAGE Fortran diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index b71a8eb..a5f5464 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -50,7 +50,7 @@ target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) -H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} STATIC) +H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} STATIC 0) set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran LINKER_LANGUAGE C @@ -64,7 +64,7 @@ if (BUILD_SHARED_LIBS) ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ) - H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} SHARED "F") set_target_properties (${HDF5_F90_C_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test/fortran LINKER_LANGUAGE C @@ -126,7 +126,7 @@ target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} STATIC) +H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} STATIC 0) target_include_directories (${HDF5_F90_TEST_LIB_TARGET} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran @@ -153,7 +153,7 @@ if (BUILD_SHARED_LIBS) ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ) - H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_TEST_LIB_NAME} SHARED "F") target_include_directories (${HDF5_F90_TEST_LIBSH_TARGET} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (${HDF5_F90_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test/fortran diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index c0cc09e..bfafe7f 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -14,7 +14,7 @@ add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES}) TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_CPP_LIB_TARGET} PUBLIC ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") -H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} STATIC) +H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} STATIC 0) set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl INTERFACE_INCLUDE_DIRECTORIES "$/include>" @@ -26,7 +26,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_CPP_LIBSH_TARGET} PUBLIC ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIBSH_TARGET}") - H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_HL_CPP_LIB_NAME} SHARED ${HDF5_HL_CXX_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_HL_CPP_LIB_NAME} SHARED "HL_CXX") set_target_properties (${HDF5_HL_CPP_LIBSH_TARGET} PROPERTIES FOLDER libraries/hl COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB" diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 6dd94fe..f1e0c3a 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -74,7 +74,7 @@ target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_ TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") -H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} STATIC) +H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} STATIC 0) set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran LINKER_LANGUAGE C @@ -88,7 +88,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}") - H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_HL_F90_C_LIB_NAME} SHARED ${HDF5_HL_F_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_HL_F90_C_LIB_NAME} SHARED "HL_F") set_target_properties (${HDF5_HL_F90_C_LIBSH_TARGET} PROPERTIES FOLDER libraries/hl/fortran LINKER_LANGUAGE C @@ -170,7 +170,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") -H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC) +H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC 0) set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran LINKER_LANGUAGE Fortran @@ -199,7 +199,7 @@ if (BUILD_SHARED_LIBS) target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIBSH_TARGET}") - H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_LIB_NAME} SHARED ${HDF5_HL_F_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_LIB_NAME} SHARED "HL_F") set_target_properties (${HDF5_HL_F90_LIBSH_TARGET} PROPERTIES FOLDER libraries/hl/fortran LINKER_LANGUAGE Fortran diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 8ee775b..7204b13 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -32,7 +32,7 @@ set (HL_HEADERS add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) -H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC) +H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC 0) set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl INTERFACE_INCLUDE_DIRECTORIES "$/include>" @@ -44,7 +44,7 @@ if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SOURCES} ${HL_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_HL_LIBSH_TARGET} ${HDF5_HL_LIB_NAME} SHARED ${HDF5_HL_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_HL_LIBSH_TARGET} ${HDF5_HL_LIB_NAME} SHARED "HL") set_target_properties (${HDF5_HL_LIBSH_TARGET} PROPERTIES FOLDER libraries/hl COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB" diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 96e7035..21e9d22 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -54,7 +54,7 @@ TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED " " " ") target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_JAVA_JNI_LIB_TARGET}") -H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED ${HDF5_JAVA_PACKAGE_SOVERSION}) +H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED "JAVA") if (WIN32) get_filename_component (HDF5_JAVA_JNI_DLL_NAME ${HDF5_JAVA_JNI_LIB_TARGET} NAME_WE) set (HDF5_JAVA_JNI_DLL_NAME "${HDF5_JAVA_JNI_DLL_NAME}$<$:_D>") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 60e2600..1e8a897 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -902,7 +902,7 @@ if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) -H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) +H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC 0) set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries INTERFACE_INCLUDE_DIRECTORIES "$/include>" @@ -941,7 +941,7 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS}) 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}) + H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED "LIB") set_target_properties (${HDF5_LIBSH_TARGET} PROPERTIES FOLDER libraries COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b3b6f5c..ec560f2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -39,7 +39,7 @@ if (MINGW) endif () target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${LINK_LIBS}) target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) -H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) +H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC 0) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test INTERFACE_INCLUDE_DIRECTORIES "$/include>" @@ -56,7 +56,7 @@ if (BUILD_SHARED_LIBS) endif () target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${LINK_LIBS}) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED "LIB") set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB" @@ -100,7 +100,7 @@ endif () add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB") set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- @@ -126,7 +126,7 @@ endif () add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB") set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index db06b9a..e5a6439 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -44,7 +44,7 @@ if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PRIVATE ${MPI_C_LIBRARIES}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") -H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC) +H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC 0) set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools INTERFACE_INCLUDE_DIRECTORIES "$/include>" @@ -60,7 +60,7 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIBSH_TARGET}") - H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TOOLS_LIB_NAME} SHARED ${HDF5_TOOLS_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TOOLS_LIB_NAME} SHARED "TOOLS") set_target_properties (${HDF5_TOOLS_LIBSH_TARGET} PROPERTIES FOLDER libraries/tools COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB" diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 1f817fb..9a171ba 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -32,7 +32,7 @@ if (BUILD_SHARED_LIBS) 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}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index aae6327..dd7da66 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -31,7 +31,7 @@ if (BUILD_SHARED_LIBS) 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}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 6a12f5e..4ea1738 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -18,7 +18,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) 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}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index 8549046..5e7d2e2 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -18,7 +18,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) 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}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index 50eb0af..dbe80f7 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -45,12 +45,12 @@ set_target_properties (h5repacktest PROPERTIES FOLDER tools) add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.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}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") add_library (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c) TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED " " " ") target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TOOL_PLUGIN_LIB_VNAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB") # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") -- cgit v0.12 From f015c89c5e6b2482178fb0288f670be510cd0d23 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 10 Apr 2018 10:27:03 -0500 Subject: Reorder of tests for debug APIs option --- java/test/JUnit-interface.txt | 30 +++++++++++++++--------------- java/test/TestAll.java | 4 +--- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index 53d3a62..5d73768 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -8,6 +8,21 @@ JUnit version 4.11 .testH5check_version .testH5get_libversion .testH5set_free_list_limits +.testH5EprintInt +.testH5Eget_msg_major +.testH5Eget_msg_minor +.testH5Eget_msg +.testH5Eget_num +.testH5Eget_class_name +.testH5Eget_num_with_msg +.testH5Eclear2 +.testH5Eprint2 +.testH5Ecreate_msg_major +.testH5Ecreate_msg_minor +.testH5Ecreate_stack +.testH5Ecreate_msg_name_null +.testH5Eauto_is_v2 +.testH5EclearInt .testH5Eregister_class_lib_name_null .testH5Eregister_class_version_null .testH5Eunregister_class_invalid_classid @@ -41,23 +56,8 @@ JUnit version 4.11 .testH5Ecreate_msg_invalid_errid .testH5Eclear2_invalid_stkid .testH5Eprint2_invalid_classid -.testH5EprintInt -.testH5Eget_msg_major -.testH5Eget_msg_minor -.testH5Eget_msg -.testH5Eget_num .testH5Epush .testH5Ewalk -.testH5Eget_class_name -.testH5Eget_num_with_msg -.testH5Eclear2 -.testH5Eprint2 -.testH5Ecreate_msg_major -.testH5Ecreate_msg_minor -.testH5Ecreate_stack -.testH5Ecreate_msg_name_null -.testH5Eauto_is_v2 -.testH5EclearInt .testH5Epop .testH5Fcreate_null .testH5Fflush_local diff --git a/java/test/TestAll.java b/java/test/TestAll.java index de5d333..13cb597 100644 --- a/java/test/TestAll.java +++ b/java/test/TestAll.java @@ -18,9 +18,7 @@ import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses( { TestH5.class, - TestH5Eregister.class, - TestH5Edefault.class, - TestH5E.class, + TestH5Eparams.class, TestH5Eregister.class, TestH5Edefault.class, TestH5E.class, TestH5Fparams.class, TestH5Fbasic.class, TestH5F.class, TestH5Fswmr.class, TestH5Gbasic.class, TestH5G.class, TestH5Giterate.class, TestH5Sbasic.class, TestH5S.class, -- cgit v0.12 From 05ef85b02dc88ebd738d1332476ae1765a25b191 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 10 Apr 2018 10:54:31 -0500 Subject: fixed return integer type of C function --- fortran/src/H5Pff.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 178aa80..afb9136 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -7769,8 +7769,8 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) INTEGER, INTENT(OUT) :: hdferr !***** INTERFACE - INTEGER(HID_T) FUNCTION h5pget_virtual_count(dcpl_id, count) BIND(C,NAME='H5Pget_virtual_count') - IMPORT :: HID_T, SIZE_T + INTEGER(C_INT) FUNCTION h5pget_virtual_count(dcpl_id, count) BIND(C,NAME='H5Pget_virtual_count') + IMPORT :: HID_T, SIZE_T, C_INT IMPLICIT NONE INTEGER(HID_T) , INTENT(IN), VALUE :: dcpl_id INTEGER(SIZE_T), INTENT(OUT) :: count -- cgit v0.12 From a9662ba9fbe29c53d86f7bd2d1ec0547b2a154ac Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 10 Apr 2018 12:43:43 -0500 Subject: Move two more functions from unit tests --- java/test/JUnit-interface.txt | 4 ++-- java/test/JUnit-unit.txt | 4 +--- java/test/TestH5E.java | 56 +++++++++++++++++++++++++++++++++++++++++++ java/test/TestH5Eparams.java | 56 ------------------------------------------- 4 files changed, 59 insertions(+), 61 deletions(-) diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index 5d73768..4b35c0b 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -9,8 +9,6 @@ JUnit version 4.11 .testH5get_libversion .testH5set_free_list_limits .testH5EprintInt -.testH5Eget_msg_major -.testH5Eget_msg_minor .testH5Eget_msg .testH5Eget_num .testH5Eget_class_name @@ -56,6 +54,8 @@ JUnit version 4.11 .testH5Ecreate_msg_invalid_errid .testH5Eclear2_invalid_stkid .testH5Eprint2_invalid_classid +.testH5Eget_msg_major +.testH5Eget_msg_minor .testH5Epush .testH5Ewalk .testH5Epop diff --git a/java/test/JUnit-unit.txt b/java/test/JUnit-unit.txt index fa33165..3e139cbe 100644 --- a/java/test/JUnit-unit.txt +++ b/java/test/JUnit-unit.txt @@ -9,8 +9,6 @@ JUnit version 4.11 .testH5get_libversion .testH5set_free_list_limits .testH5EprintInt -.testH5Eget_msg_major -.testH5Eget_msg_minor .testH5Eget_msg .testH5Eget_num .testH5Eget_class_name @@ -610,5 +608,5 @@ JUnit version 4.11 Time: XXXX -OK (608 tests) +OK (606 tests) diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index 1eb1914..aefddfa 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -73,6 +73,62 @@ public class TestH5E { } @Test + public void testH5Eget_msg_major() { + + try { + H5.H5Fopen("test", 0, 1); + } + catch (HDF5LibraryException hdferr) { + int[] error_msg_type = { HDF5Constants.H5E_MAJOR }; + String msg = null; + try { + msg = H5.H5Eget_msg(hdferr.getMajorErrorNumber(), + error_msg_type); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + assertNotNull("H5.H5Eget_msg: " + msg, msg); + assertEquals("H5.H5Eget_msg: ", "Object atom", + msg); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, + error_msg_type[0]); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + } + + @Test + public void testH5Eget_msg_minor() { + try { + H5.H5Fopen("test", 0, 1); + } + catch (HDF5LibraryException hdferr) { + int[] error_msg_type = { HDF5Constants.H5E_MINOR }; + String msg = null; + try { + msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(), + error_msg_type); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + assertNotNull("H5.H5Eget_msg: " + msg, msg); + assertEquals("H5.H5Eget_msg: ", "Unable to find atom information (already closed?)", msg); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR, + error_msg_type[0]); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + } + + @Test public void testH5Epop() { try { H5.H5Eset_current_stack(current_stackid); diff --git a/java/test/TestH5Eparams.java b/java/test/TestH5Eparams.java index fa9d776..e3c8b0e 100644 --- a/java/test/TestH5Eparams.java +++ b/java/test/TestH5Eparams.java @@ -170,62 +170,6 @@ public class TestH5Eparams { } @Test - public void testH5Eget_msg_major() { - - try { - H5.H5Fopen("test", 0, 1); - } - catch (HDF5LibraryException hdferr) { - int[] error_msg_type = { HDF5Constants.H5E_MAJOR }; - String msg = null; - try { - msg = H5.H5Eget_msg(hdferr.getMajorErrorNumber(), - error_msg_type); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); - } - assertNotNull("H5.H5Eget_msg: " + msg, msg); - assertEquals("H5.H5Eget_msg: ", "Object atom", - msg); - assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, - error_msg_type[0]); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); - } - } - - @Test - public void testH5Eget_msg_minor() { - try { - H5.H5Fopen("test", 0, 1); - } - catch (HDF5LibraryException hdferr) { - int[] error_msg_type = { HDF5Constants.H5E_MINOR }; - String msg = null; - try { - msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(), - error_msg_type); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); - } - assertNotNull("H5.H5Eget_msg: " + msg, msg); - assertEquals("H5.H5Eget_msg: ", "Unable to find atom information (already closed?)", msg); - assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR, - error_msg_type[0]); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); - } - } - - @Test public void testH5Ecreate_stack() { long stk_id = -1; try { -- cgit v0.12 From c4ff69d26b77989f795651384a33e3647a1086d3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 10 Apr 2018 13:01:49 -0500 Subject: Whitespace and test reclassify --- java/test/CMakeLists.txt | 2 +- java/test/JUnit-unit.txt | 7 ++++- java/test/Makefile.am | 1 + java/test/TestH5E.java | 18 ++++-------- java/test/TestH5Edefault.java | 62 ++++++++++++++---------------------------- java/test/TestH5Eparams.java | 15 ++++------ java/test/TestH5Eregister.java | 3 +- java/test/TestUnit.java | 2 +- 8 files changed, 42 insertions(+), 68 deletions(-) diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 10a38b0..c48cf01 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES ( set (HDF5_JAVA_TEST_SOURCES TestH5.java TestH5Eparams.java + TestH5Eregister.java TestH5Fparams.java TestH5Fbasic.java TestH5F.java @@ -58,7 +59,6 @@ else () ${HDF5_JAVA_TEST_SOURCES} TestH5E.java TestH5Edefault.java - TestH5Eregister.java TestH5Giterate.java TestAll.java ) diff --git a/java/test/JUnit-unit.txt b/java/test/JUnit-unit.txt index 3e139cbe..7efc915 100644 --- a/java/test/JUnit-unit.txt +++ b/java/test/JUnit-unit.txt @@ -21,6 +21,11 @@ JUnit version 4.11 .testH5Ecreate_msg_name_null .testH5Eauto_is_v2 .testH5EclearInt +.testH5Eregister_class_lib_name_null +.testH5Eregister_class_version_null +.testH5Eunregister_class_invalid_classid +.testH5Eregister_class +.testH5Eregister_class_cls_name_null .testH5Fcreate_null .testH5Fflush_local .testH5Fget_info @@ -608,5 +613,5 @@ JUnit version 4.11 Time: XXXX -OK (606 tests) +OK (611 tests) diff --git a/java/test/Makefile.am b/java/test/Makefile.am index 9ed8517..f9db7ed 100644 --- a/java/test/Makefile.am +++ b/java/test/Makefile.am @@ -36,6 +36,7 @@ AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation noinst_JAVA = \ TestH5.java \ TestH5Eparams.java \ + TestH5Eregister.java \ TestH5Fparams.java \ TestH5Fbasic.java \ TestH5F.java \ diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index aefddfa..dfa2064 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -47,8 +47,7 @@ public class TestH5E { hdf_java_classid = -1; try { - hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", - "hdf-java", "2.5"); + hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", "hdf-java", "2.5"); current_stackid = H5.H5Eget_current_stack(); } catch (Throwable err) { @@ -82,18 +81,15 @@ public class TestH5E { int[] error_msg_type = { HDF5Constants.H5E_MAJOR }; String msg = null; try { - msg = H5.H5Eget_msg(hdferr.getMajorErrorNumber(), - error_msg_type); + msg = H5.H5Eget_msg(hdferr.getMajorErrorNumber(), error_msg_type); } catch (Throwable err) { err.printStackTrace(); fail("H5.H5Eget_msg: " + err); } assertNotNull("H5.H5Eget_msg: " + msg, msg); - assertEquals("H5.H5Eget_msg: ", "Object atom", - msg); - assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, - error_msg_type[0]); + assertEquals("H5.H5Eget_msg: ", "Object atom", msg); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, error_msg_type[0]); } catch (Throwable err) { err.printStackTrace(); @@ -110,8 +106,7 @@ public class TestH5E { int[] error_msg_type = { HDF5Constants.H5E_MINOR }; String msg = null; try { - msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(), - error_msg_type); + msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(), error_msg_type); } catch (Throwable err) { err.printStackTrace(); @@ -119,8 +114,7 @@ public class TestH5E { } assertNotNull("H5.H5Eget_msg: " + msg, msg); assertEquals("H5.H5Eget_msg: ", "Unable to find atom information (already closed?)", msg); - assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR, - error_msg_type[0]); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR, error_msg_type[0]); } catch (Throwable err) { err.printStackTrace(); diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java index 79f75c8..50367b9 100644 --- a/java/test/TestH5Edefault.java +++ b/java/test/TestH5Edefault.java @@ -91,8 +91,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 4); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4); //Save a copy of the current stack and clears the current stack try { @@ -102,10 +101,8 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertFalse("H5.H5Eget_current_stack: get_current_stack - " - + stack_id, stack_id < 0); - assertFalse("H5.H5Eget_current_stack: get_current_stack - " - + stack_id, stack_id == stack_id_default); + assertFalse("H5.H5Eget_current_stack: get_current_stack - " + stack_id, stack_id < 0); + assertFalse("H5.H5Eget_current_stack: get_current_stack - " + stack_id, stack_id == stack_id_default); // Verify we have the correct number of messages try { @@ -115,8 +112,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 0); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 0); //Verify the copy has the correct number of messages try { @@ -158,8 +154,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 4); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4); //Save a copy of the current stack and clears the current stack try { @@ -169,10 +164,8 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertFalse("H5.H5Eget_current_stack: get_current_stack - " - + stack_id, stack_id < 0); - assertFalse("H5.H5Eget_current_stack: get_current_stack - " - + stack_id, stack_id == HDF5Constants.H5E_DEFAULT); + assertFalse("H5.H5Eget_current_stack: get_current_stack - " + stack_id, stack_id < 0); + assertFalse("H5.H5Eget_current_stack: get_current_stack - " + stack_id, stack_id == HDF5Constants.H5E_DEFAULT); // Verify we have the correct number of messages try { @@ -182,8 +175,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 0); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 0); //Verify the copy has the correct number of messages try { @@ -193,8 +185,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 4); //Generate errors on default stack try { @@ -212,8 +203,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 4); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4); //Remove one message from the current stack try { @@ -224,8 +214,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: pop #:" + num_msg_default, - num_msg_default == 3); + assertTrue("H5.H5Eget_current_stack: pop #:" + num_msg_default, num_msg_default == 3); //Verify the copy still has the correct number of messages try { @@ -235,8 +224,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 4); } @Test(expected = IllegalArgumentException.class) @@ -306,8 +294,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4); //Save a copy of the current stack try { @@ -317,10 +304,8 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertFalse("H5.H5Eset_current_stack: get_current_stack - " - + stack_id, stack_id < 0); - assertFalse("H5.H5Eset_current_stack: get_current_stack - " - + stack_id, stack_id == HDF5Constants.H5E_DEFAULT); + assertFalse("H5.H5Eset_current_stack: get_current_stack - " + stack_id, stack_id < 0); + assertFalse("H5.H5Eset_current_stack: get_current_stack - " + stack_id, stack_id == HDF5Constants.H5E_DEFAULT); //Verify the copy has the correct number of messages try { @@ -330,8 +315,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4); //Generate errors on default stack try { @@ -349,8 +333,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4); //Remove one message from the current stack try { @@ -361,8 +344,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: pop #:" + num_msg, - num_msg == 3); + assertTrue("H5.H5Eset_current_stack: pop #:" + num_msg, num_msg == 3); //Verify the copy still has the correct number of messages try { @@ -372,8 +354,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4); try { H5.H5Eset_current_stack(stack_id); @@ -492,8 +473,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eclear2_with_msg: " + err); } - assertTrue("H5.H5Eclear2_with_msg before #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eclear2_with_msg before #:" + num_msg, num_msg == 4); try { H5.H5Eclear2(HDF5Constants.H5E_DEFAULT); num_msg = H5.H5Eget_num(HDF5Constants.H5E_DEFAULT); @@ -502,7 +482,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eclear2_with_msg: " + err); } - assertTrue("H5.H5Eclear2_with_msg after #:" + num_msg, num_msg == 0); + assertTrue("H5.H5Eclear2_with_msg after #:" + num_msg, num_msg == 0); } @Test(expected = IllegalArgumentException.class) diff --git a/java/test/TestH5Eparams.java b/java/test/TestH5Eparams.java index e3c8b0e..0c55577 100644 --- a/java/test/TestH5Eparams.java +++ b/java/test/TestH5Eparams.java @@ -47,8 +47,7 @@ public class TestH5Eparams { hdf_java_classid = -1; try { - hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", - "hdf-java", "2.5"); + hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", "hdf-java", "2.5"); current_stackid = H5.H5Eget_current_stack(); } catch (Throwable err) { @@ -110,8 +109,7 @@ public class TestH5Eparams { @Test public void testH5Ecreate_msg_major() { try { - long err_id = H5.H5Ecreate_msg(hdf_java_classid, - HDF5Constants.H5E_MAJOR, "Error in Test"); + long err_id = H5.H5Ecreate_msg(hdf_java_classid, HDF5Constants.H5E_MAJOR, "Error in Test"); assertFalse("H5.H5Ecreate_msg_major: " + err_id, err_id < 0); H5.H5Eclose_msg(err_id); } @@ -124,8 +122,7 @@ public class TestH5Eparams { @Test public void testH5Ecreate_msg_minor() { try { - long err_id = H5.H5Ecreate_msg(hdf_java_classid, - HDF5Constants.H5E_MINOR, "Error in Test Function"); + long err_id = H5.H5Ecreate_msg(hdf_java_classid, HDF5Constants.H5E_MINOR, "Error in Test Function"); assertFalse("H5.H5Ecreate_msg_minor: " + err_id, err_id < 0); H5.H5Eclose_msg(err_id); } @@ -141,8 +138,7 @@ public class TestH5Eparams { long err_id = -1; String msg = null; try { - err_id = H5.H5Ecreate_msg(hdf_java_classid, - HDF5Constants.H5E_MAJOR, "Error in Test"); + err_id = H5.H5Ecreate_msg(hdf_java_classid, HDF5Constants.H5E_MAJOR, "Error in Test"); } catch (Throwable err) { err.printStackTrace(); @@ -158,8 +154,7 @@ public class TestH5Eparams { } assertNotNull("H5.H5Eget_msg: " + msg, msg); assertEquals("H5.H5Eget_msg: ", "Error in Test", msg); - assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, - error_msg_type[0]); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, error_msg_type[0]); try { H5.H5Eclose_msg(err_id); } diff --git a/java/test/TestH5Eregister.java b/java/test/TestH5Eregister.java index 742b47f..1b87699 100644 --- a/java/test/TestH5Eregister.java +++ b/java/test/TestH5Eregister.java @@ -60,8 +60,7 @@ public class TestH5Eregister { public void testH5Eregister_class() { long hdf_java_classid = -1; try { - hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", - "hdf-java", "2.5"); + hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", "hdf-java", "2.5"); } catch (Throwable err) { fail("H5.H5Eregister_class: " + err); diff --git a/java/test/TestUnit.java b/java/test/TestUnit.java index b55e415..e98fd4f 100644 --- a/java/test/TestUnit.java +++ b/java/test/TestUnit.java @@ -18,7 +18,7 @@ import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses( { TestH5.class, - TestH5Eparams.class, + TestH5Eparams.class, TestH5Eregister.class, TestH5Fparams.class, TestH5Fbasic.class, TestH5F.class, TestH5Fswmr.class, TestH5Gbasic.class, TestH5G.class, TestH5Sbasic.class, TestH5S.class, -- cgit v0.12 From 34e3e3ef17f29b721780941866a3ad4c261b7c05 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 10 Apr 2018 13:06:29 -0500 Subject: Whitespace changes --- java/test/TestH5Edefault.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java index 50367b9..5324d3a 100644 --- a/java/test/TestH5Edefault.java +++ b/java/test/TestH5Edefault.java @@ -122,8 +122,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 4); try { H5.H5Eclose_stack(stack_id); @@ -364,8 +363,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num - " + num_msg, - num_msg == 4); + assertTrue("H5.H5Eset_current_stack: get_num - " + num_msg, num_msg == 4); } @Test(expected = IllegalArgumentException.class) -- cgit v0.12 From 9a8e1e1a7cad7674de2b183ba530affc0f13c615 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 12 Apr 2018 09:10:28 -0500 Subject: Add missing file --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index 1cccdf2..01edd91 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3048,6 +3048,7 @@ ./java/test/CMakeLists.txt ./java/test/junit.sh.in ./java/test/JUnit-interface.txt +./java/test/JUnit-unit.txt ./java/test/JUnit-interface.ert ./java/test/h5ex_g_iterate.orig ./java/test/TestH5.java -- cgit v0.12 From 0bd3634dc5747d88582a966050896bad57acb892 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 17 Apr 2018 12:01:26 -0500 Subject: Close memory leak of last API context when shutting library down. --- src/H5.c | 4 ++-- src/H5CX.c | 35 +++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/H5.c b/src/H5.c index f3e56d0..1467ddf 100644 --- a/src/H5.c +++ b/src/H5.c @@ -415,8 +415,8 @@ H5_term_library(void) /* Mark library as closed */ H5_INIT_GLOBAL = FALSE; - /* Don't pop the API context, since it's been shut down already */ - /* H5CX_pop_special(); */ + /* Pop the API context (without checking for errors) */ + H5CX_pop_special(); done: #ifdef H5_HAVE_THREADSAFE diff --git a/src/H5CX.c b/src/H5CX.c index af2619b..5c907bc 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -342,7 +342,7 @@ typedef struct H5CX_lapl_cache_t { /********************/ static H5CX_node_t **H5CX__get_context(void); static void H5CX__push_common(H5CX_node_t *cnode); -static H5CX_node_t *H5CX__pop_common(void); +static H5CX_node_t *H5CX__pop_common(hbool_t update_dxpl); /*********************/ @@ -2743,7 +2743,7 @@ done: *------------------------------------------------------------------------- */ static H5CX_node_t * -H5CX__pop_common(void) +H5CX__pop_common(hbool_t update_dxpl) { H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ H5CX_node_t *ret_value = NULL; /* Return value */ @@ -2753,22 +2753,25 @@ H5CX__pop_common(void) /* Sanity check */ HDassert(head && *head); - /* Check for cached DXPL properties to return to application */ - H5CX_SET_PROP(H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, dcr_filters) + /* Update DXPL properties, if requested */ + if(update_dxpl) { + /* Check for cached DXPL properties to return to application */ + H5CX_SET_PROP(H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, dcr_filters) #ifdef H5_HAVE_PARALLEL - H5CX_SET_PROP(H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, mpio_actual_chunk_opt) - H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode) - H5CX_SET_PROP(H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) - H5CX_SET_PROP(H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) + H5CX_SET_PROP(H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, mpio_actual_chunk_opt) + H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode) + H5CX_SET_PROP(H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) + H5CX_SET_PROP(H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ #endif /* H5_HAVE_PARALLEL */ + } /* end if */ /* Pop the top context node from the stack */ ret_value = (*head); @@ -2800,7 +2803,7 @@ H5CX_pop(void) FUNC_ENTER_NOAPI(FAIL) /* Perform common operations and get top context from stack */ - if(NULL == (cnode = H5CX__pop_common())) + if(NULL == (cnode = H5CX__pop_common(TRUE))) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error getting API context node") /* Free the context node */ @@ -2833,7 +2836,7 @@ H5CX_pop_special(void) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Perform common operations and get top context from stack */ - cnode = H5CX__pop_common(); + cnode = H5CX__pop_common(FALSE); HDassert(cnode); /* Free the context node */ -- cgit v0.12 From 46f2a2a432c4077d94c4a3f2126ee0694fd9f0af Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 17 Apr 2018 15:57:51 -0500 Subject: TRILABS-19 Initial conversion of include_directories to targets --- CMakeInstallation.cmake | 10 ---- CMakeLists.txt | 5 -- c++/CMakeLists.txt | 6 --- c++/examples/CMakeLists.txt | 2 + c++/src/CMakeLists.txt | 2 + c++/test/CMakeLists.txt | 1 + config/cmake/ConfigureChecks.cmake | 15 ------ examples/CMakeLists.txt | 4 ++ fortran/examples/CMakeLists.txt | 3 +- fortran/src/CMakeLists.txt | 15 +++--- fortran/test/CMakeLists.txt | 19 ++++--- hl/CMakeLists.txt | 2 - hl/c++/examples/CMakeLists.txt | 7 +-- hl/c++/src/CMakeLists.txt | 4 +- hl/c++/test/CMakeLists.txt | 15 +----- hl/examples/CMakeLists.txt | 1 + hl/fortran/examples/CMakeLists.txt | 9 +--- hl/fortran/src/CMakeLists.txt | 26 ++++------ hl/fortran/test/CMakeLists.txt | 2 +- hl/src/CMakeLists.txt | 2 + hl/test/CMakeLists.txt | 8 +-- hl/tools/gif2h5/CMakeLists.txt | 6 +-- hl/tools/h5watch/CMakeLists.txt | 2 + java/CMakeLists.txt | 4 +- java/examples/datasets/CMakeLists.txt | 5 -- java/examples/datatypes/CMakeLists.txt | 5 -- java/examples/groups/CMakeLists.txt | 5 -- java/examples/intro/CMakeLists.txt | 5 -- java/src/hdf/hdf5lib/CMakeLists.txt | 7 +-- java/src/jni/CMakeLists.txt | 3 +- java/test/CMakeLists.txt | 5 +- release_docs/USING_HDF5_CMake.txt | 2 +- src/CMakeLists.txt | 11 +++- test/CMakeLists.txt | 28 +++++++--- test/CMakeTests.cmake | 1 + testpar/CMakeLists.txt | 4 +- tools/CMakeLists.txt | 5 -- tools/lib/CMakeLists.txt | 4 ++ tools/src/CMakeLists.txt | 5 -- tools/src/h5copy/CMakeLists.txt | 7 +-- tools/src/h5diff/CMakeLists.txt | 8 ++- tools/src/h5dump/CMakeLists.txt | 7 +-- tools/src/h5format_convert/CMakeLists.txt | 6 +-- tools/src/h5import/CMakeLists.txt | 6 +-- tools/src/h5jam/CMakeLists.txt | 7 +-- tools/src/h5ls/CMakeLists.txt | 7 +-- tools/src/h5repack/CMakeLists.txt | 8 +-- tools/src/h5stat/CMakeLists.txt | 7 +-- tools/src/misc/CMakeLists.txt | 9 ++-- tools/test/CMakeLists.txt | 5 -- tools/test/h5copy/CMakeLists.txt | 10 +--- tools/test/h5diff/CMakeLists.txt | 29 +++++------ tools/test/h5dump/CMakeLists.txt | 79 +++++++++++++--------------- tools/test/h5format_convert/CMakeLists.txt | 37 ++++++------- tools/test/h5import/CMakeLists.txt | 22 ++++---- tools/test/h5jam/CMakeLists.txt | 30 +++++------ tools/test/h5ls/CMakeLists.txt | 54 +++++++++---------- tools/test/h5repack/CMakeLists.txt | 83 ++++++++++++++---------------- tools/test/h5stat/CMakeLists.txt | 28 +++++----- tools/test/misc/CMakeLists.txt | 75 +++++++++++++-------------- tools/test/misc/vds/CMakeLists.txt | 6 +-- tools/test/perform/CMakeLists.txt | 38 +++++++------- 62 files changed, 344 insertions(+), 489 deletions(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 4a09d2d..622f0cf 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -23,16 +23,6 @@ if (WIN32) find_program (WIX_EXECUTABLE candle PATHS "${CPACK_WIX_ROOT}/bin") endif () -#----------------------------------------------------------------------------- -# Add file(s) to CMake Install -#----------------------------------------------------------------------------- -if (NOT HDF5_INSTALL_NO_DEVELOPMENT) - install ( - FILES ${PROJECT_BINARY_DIR}/H5pubconf.h - DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} - COMPONENT headers - ) -endif () #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects diff --git a/CMakeLists.txt b/CMakeLists.txt index 0da475a..b88463c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -555,11 +555,6 @@ endif () include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake) #----------------------------------------------------------------------------- -# All libs/tests/examples need the main include directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - -#----------------------------------------------------------------------------- # Option to Enable MPI Parallel #----------------------------------------------------------------------------- set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${HDF_RESOURCES_EXT_DIR} ${CMAKE_MODULE_PATH}) diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 2c161f1..635c6fe 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -14,12 +14,6 @@ configure_file (${HDF_RESOURCES_DIR}/H5cxx_config.h.in ) #----------------------------------------------------------------------------- -# Setup Include directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_CPP_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR}) - -#----------------------------------------------------------------------------- # Parallel/MPI, prevent spurious cpp/cxx warnings #----------------------------------------------------------------------------- if (H5_HAVE_PARALLEL) diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 22ecb19..653f72a 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -34,6 +34,7 @@ set (tutr_examples foreach (example ${examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) + set_property(TARGET cpp_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) @@ -41,6 +42,7 @@ endforeach () foreach (example ${tutr_examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) + set_property(TARGET cpp_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 35e7590..52acc0b 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -83,6 +83,7 @@ set (CPP_HDRS ) add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS}) +set_property(TARGET ${HDF5_CPP_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") @@ -95,6 +96,7 @@ set (install_targets ${HDF5_CPP_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SOURCES} ${CPP_HDRS}) + set_property(TARGET ${HDF5_CPP_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_CPP_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_CPP_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIBSH_TARGET}") diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index b4fb0fc..83ca337 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -37,6 +37,7 @@ set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ) +set_property(TARGET cpp_testhdf5 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR}") TARGET_C_PROPERTIES (cpp_testhdf5 STATIC " " " ") target_link_libraries (cpp_testhdf5 ${HDF5_CPP_LIB_TARGET} diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 7d73c09..f61953d 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -254,18 +254,3 @@ H5ConversionTests (H5_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting # Check if pointer alignments are enforced # H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") - -# ----------------------------------------------------------------------- -# wrapper script variables -# -set (prefix ${CMAKE_INSTALL_PREFIX}) -set (exec_prefix "\${prefix}") -set (libdir "${exec_prefix}/lib") -set (includedir "\${prefix}/include") -set (host_os ${CMAKE_HOST_SYSTEM_NAME}) -set (CC ${CMAKE_C_COMPILER}) -set (CXX ${CMAKE_CXX_COMPILER}) -set (FC ${CMAKE_Fortran_COMPILER}) -foreach (LINK_LIB ${LINK_LIBS}) - set (LIBS "${LIBS} -l${LINK_LIB}") -endforeach () diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 4da8405..601370b 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -46,11 +46,13 @@ set (examples foreach (example ${examples}) add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) + set_property(TARGET ${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${example} STATIC " " " ") target_link_libraries (${example} ${HDF5_LIB_TARGET}) set_target_properties (${example} PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (${example}-shared ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) + set_property(TARGET ${example}-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${example}-shared SHARED " " " ") target_link_libraries (${example}-shared ${HDF5_LIBSH_TARGET}) set_target_properties (${example}-shared PROPERTIES FOLDER examples) @@ -59,11 +61,13 @@ endforeach () if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) + set_property(TARGET ph5example APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ph5example STATIC " " " ") target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) + set_property(TARGET ph5example-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 8b7333a..fd98944 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -8,7 +8,8 @@ PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) + +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src") #----------------------------------------------------------------------------- # Define Sources diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 03c12ac..4efd5fb 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -32,7 +32,7 @@ if (HAVE_FLOAT128) set (CMAKE_H5_HAVE_FLOAT128 1) 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}/H5config_f.inc.cmake ${HDF5_F90_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) set (Fortran_COMPILER_ID CMAKE_Fortran_COMPILER_ID) @@ -46,7 +46,7 @@ set (Fortran_COMPILER_ID CMAKE_Fortran_COMPILER_ID) add_executable (H5_buildiface ${HDF5_F90_SRC_SOURCE_DIR}/H5_buildiface.F90 ) - +target_include_directories(H5_buildiface PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}") if (WIN32 AND MSVC) if (BUILD_SHARED_LIBS) set_target_properties (H5_buildiface @@ -71,13 +71,12 @@ endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) -INCLUDE_DIRECTORIES (${HDF5_F90_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) - #----------------------------------------------------------------------------- add_executable (H5match_types ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c ) +target_include_directories(H5match_types PRIVATE "${HDF5_BINARY_DIR};${HDF5_SRC_DIR};${HDF5_F90_BINARY_DIR}") add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 @@ -132,7 +131,7 @@ set (f90CStub_C_SHHDRS ) add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) -target_include_directories(${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) +set_property(TARGET ${HDF5_F90_C_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") @@ -146,7 +145,7 @@ set (install_targets ${HDF5_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS}) - target_include_directories(${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) + set_property(TARGET ${HDF5_F90_C_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}") @@ -250,7 +249,7 @@ set (SHARED_LINK_FLAGS " ") TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET}) target_link_libraries (${HDF5_F90_LIB_TARGET} PRIVATE ${LINK_Fortran_LIBS}) -target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR}") if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () @@ -279,7 +278,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET}) target_link_libraries (${HDF5_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS}) - target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR}") if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index a5f5464..345f642 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -2,11 +2,6 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_FORTRAN_TESTS_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) - -#----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities # H5_test_buildiface.F90 used to generate various KIND test interfaces #----------------------------------------------------------------------------- @@ -14,7 +9,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_FORTRAN_TESTS_SOUR add_executable (H5_test_buildiface ${HDF5_F90_SRC_DIR}/test/H5_test_buildiface.F90 ) - +target_include_directories(H5_test_buildiface PRIVATE ${HDF5_BINARY_DIR} ${HDF5_F90_BINARY_DIR}) if (WIN32 AND MSVC) if (BUILD_SHARED_LIBS) set_target_properties (H5_test_buildiface @@ -44,7 +39,7 @@ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE #----------------------------------------------------------------------------- add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c) set_source_files_properties (t.c PROPERTIES LANGUAGE C) -target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) +set_property(TARGET ${HDF5_F90_C_TEST_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} @@ -58,7 +53,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES ) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) - target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) + set_property(TARGET ${HDF5_F90_C_TEST_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} @@ -128,6 +123,7 @@ target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} ) H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} STATIC 0) target_include_directories (${HDF5_F90_TEST_LIB_TARGET} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran LINKER_LANGUAGE Fortran @@ -155,6 +151,7 @@ if (BUILD_SHARED_LIBS) ) H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_TEST_LIB_NAME} SHARED "F") target_include_directories (${HDF5_F90_TEST_LIBSH_TARGET} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (${HDF5_F90_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test/fortran LINKER_LANGUAGE Fortran @@ -203,6 +200,7 @@ if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran "ws2_32.lib") endif () target_include_directories (testhdf5_fortran PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET testhdf5_fortran APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -238,6 +236,7 @@ if (BUILD_SHARED_LIBS) target_link_libraries (testhdf5_fortran-shared "ws2_32.lib") endif () target_include_directories (testhdf5_fortran-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET testhdf5_fortran-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (testhdf5_fortran-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -265,6 +264,7 @@ if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran_1_8 "ws2_32.lib") endif () target_include_directories (testhdf5_fortran_1_8 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -291,6 +291,7 @@ if (BUILD_SHARED_LIBS) target_link_libraries (testhdf5_fortran_1_8-shared "ws2_32.lib") endif () target_include_directories (testhdf5_fortran_1_8-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET testhdf5_fortran_1_8-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (testhdf5_fortran_1_8-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -320,6 +321,7 @@ if (WIN32 AND MSVC) target_link_libraries (fortranlib_test_F03 "ws2_32.lib") endif () target_include_directories (fortranlib_test_F03 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET fortranlib_test_F03 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -349,6 +351,7 @@ if (BUILD_SHARED_LIBS) endif () target_include_directories (fortranlib_test_F03-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET fortranlib_test_F03-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (fortranlib_test_F03-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index 54d5976..3f5f633 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -6,11 +6,9 @@ PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- add_definitions (${HDF_EXTRA_C_FLAGS}) - #----------------------------------------------------------------------------- # List Source files #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src ) add_subdirectory (src) diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 25158f2..7f0d422 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,16 +1,11 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_CPP_EXAMPLES) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) -INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_DIR}/src) - # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- add_executable (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) +set_property(TARGET ptExampleFL APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ptExampleFL STATIC " " " ") target_link_libraries ( ptExampleFL diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index bfafe7f..53194d0 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -4,13 +4,12 @@ PROJECT (HDF5_HL_CPP_SRC) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) -INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_SOURCE_DIR}) set (HDF5_HL_CPP_SOURCES ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES}) +set_property(TARGET ${HDF5_HL_CPP_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_CPP_LIB_TARGET} PUBLIC ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") @@ -23,6 +22,7 @@ set (install_targets ${HDF5_HL_CPP_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_CPP_LIBSH_TARGET} SHARED ${HDF5_HL_CPP_SOURCES}) + set_property(TARGET ${HDF5_HL_CPP_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_CPP_LIBSH_TARGET} PUBLIC ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIBSH_TARGET}") diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index b48d147..aab3049 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,21 +1,8 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_CPP_TEST) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/c++/src) - -# -------------------------------------------------------------------- -# Add in the unit tests for the packet table c++ wrapper -# -------------------------------------------------------------------- - -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/test) -INCLUDE_DIRECTORIES (${HDF5_CPP_SRC_DIR}/src) - add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) +set_property(TARGET hl_ptableTest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_HL_SRC_DIR}/test;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_ptableTest STATIC " " " ") target_link_libraries ( hl_ptableTest diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 79dfee1..4c3d790 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -28,6 +28,7 @@ set (examples foreach (example ${examples}) add_executable (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) + set_property(TARGET hl_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 411ceea..eae3de5 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,14 +1,6 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES ( - ${HDF5_F90_BINARY_DIR} - ${HDF5_F90_SRC_DIR}/src -) - set (examples exlite ex_ds1 @@ -23,6 +15,7 @@ foreach (example ${examples}) ${HDF5_LIB_TARGET} ) target_include_directories (hl_f90_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index f1e0c3a..e3fae79 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -18,7 +18,7 @@ endif () add_executable (H5HL_buildiface ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5HL_buildiface.F90 ) - +target_include_directories(H5HL_buildiface PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}") if (WIN32 AND MSVC) if (BUILD_SHARED_LIBS) set_target_properties (H5HL_buildiface @@ -44,18 +44,6 @@ file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES ( - ${HDF5_HL_SRC_DIR}/src - ${HDF5_F90_SRC_DIR}/src - ${HDF5_HL_F90_SRC_SOURCE_DIR} - ${HDF5_F90_BINARY_DIR} - ${CMAKE_Fortran_MODULE_DIRECTORY} - ${MOD_BUILD_DIR} -) - -#----------------------------------------------------------------------------- # hl_f90CStub lib #----------------------------------------------------------------------------- set (HDF5_HL_F90_C_SOURCES @@ -70,7 +58,8 @@ set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C) set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) -target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) +target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} PUBLIC "${HDF5_F90_BINARY_DIR}/static") +set_property(TARGET ${HDF5_HL_F90_C_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") @@ -84,7 +73,8 @@ set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) - target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) + target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC "${HDF5_F90_BINARY_DIR}/shared") + set_property(TARGET ${HDF5_HL_F90_C_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}") @@ -165,10 +155,11 @@ endif () add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES}) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -target_include_directories (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +target_include_directories (${HDF5_HL_F90_LIB_TARGET} PUBLIC "${CMAKE_Fortran_MODULE_DIRECTORY}/static") if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () +set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR}") set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC 0) set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES @@ -194,7 +185,8 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS}) - target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC "${CMAKE_Fortran_MODULE_DIRECTORY}/shared") + set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR}") if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 5c83d03..1ac16d9 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- # Add Tests #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${CMAKE_Fortran_MODULE_DIRECTORY};${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") #-- Adding test for hl_f90_tstds add_executable (hl_f90_tstds tstds.F90) diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 7204b13..ccfb061 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -30,6 +30,7 @@ set (HL_HEADERS ) add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS}) +set_property(TARGET ${HDF5_HL_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC 0) @@ -42,6 +43,7 @@ set (install_targets ${HDF5_HL_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SOURCES} ${HL_HEADERS}) + set_property(TARGET ${HDF5_HL_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIBSH_TARGET} ${HDF5_HL_LIB_NAME} SHARED "HL") diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 6b3c764..21259fa 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -14,14 +14,12 @@ PROJECT (HDF5_HL_TEST) set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -include_directories (${CMAKE_CURRENT_BINARY_DIR}) -include_directories (${HDF5_TEST_SRC_DIR}) - # -------------------------------------------------------------------- # Macro used to add a unit test # -------------------------------------------------------------------- MACRO (HL_ADD_EXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) + set_property(TARGET hl_${hl_name} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_${hl_name} STATIC " " " ") target_link_libraries (hl_${hl_name} ${HDF5_HL_LIB_TARGET} @@ -33,6 +31,7 @@ ENDMACRO () MACRO (HL_ADD_SHEXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) + set_property(TARGET hl_${hl_name} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_${hl_name} SHARED " " " ") target_link_libraries (hl_${hl_name} ${HDF5_HL_LIBSH_TARGET} @@ -53,6 +52,7 @@ HL_ADD_EXE (test_dset_append) # test_packet has two source files add_executable (hl_test_packet test_packet.c test_packet_vlen.c) +set_property(TARGET hl_test_packet APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_test_packet STATIC " " " ") target_link_libraries (hl_test_packet ${HDF5_HL_LIB_TARGET} @@ -67,6 +67,7 @@ set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (hl_gen_test_ds gen_test_ds.c) + set_property(TARGET hl_gen_test_ds APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_gen_test_ds STATIC " " " ") target_link_libraries (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} @@ -76,6 +77,7 @@ if (HDF5_BUILD_GENERATORS) set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) add_executable (hl_gen_test_ld gen_test_ld.c) + set_property(TARGET hl_gen_test_ld APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_gen_test_ld STATIC " " " ") target_link_libraries (hl_gen_test_ld ${HDF5_HL_LIB_TARGET} diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 2697dfd..03ee7c2 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -14,10 +14,8 @@ set (GIF2H5_SOURCES ) #-- Add gif2hdf5 program -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}) - add_executable (gif2h5 ${GIF2H5_SOURCES}) +set_property(TARGET gif2h5 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (gif2h5 STATIC " " " ") target_link_libraries (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (gif2h5 PROPERTIES FOLDER tools/hl) @@ -29,6 +27,7 @@ set (hdf2gif_SOURCES ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdfgifwr.c ) add_executable (h52gif ${hdf2gif_SOURCES}) +set_property(TARGET h52gif APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h52gif STATIC " " " ") target_link_libraries (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h52gif PROPERTIES FOLDER tools/hl) @@ -42,6 +41,7 @@ if (BUILD_TESTING) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (hl_h52gifgentest ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/h52gifgentst.c) + set_property(TARGET hl_h52gifgentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_h52gifgentest STATIC " " " ") target_link_libraries (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index 5de655e..165c8ec 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_TOOLS_H5WATCH) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index fc057f7..4684827 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -13,7 +13,6 @@ find_package (JNI) message ("JNI_LIBRARIES=${JNI_LIBRARIES}") message ("JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}") -INCLUDE_DIRECTORIES ( ${JNI_INCLUDE_DIRS} ) if (WIN32) set (HDF_JRE_DIRECTORY "C:/Program Files/Java/jre8") @@ -25,11 +24,12 @@ endif () # Include the main src and config directories #----------------------------------------------------------------------------- set (HDF5_JAVA_INCLUDE_DIRECTORIES + ${JNI_INCLUDE_DIRS} ${HDF5_JAVA_JNI_SRC_DIR} ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} ) -INCLUDE_DIRECTORIES (${HDF5_JAVA_INCLUDE_DIRECTORIES}) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_JAVA_INCLUDE_DIRECTORIES}") set (CMAKE_JAVA_INCLUDE_PATH "") diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 6a90cd1..8b86a54 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -3,11 +3,6 @@ PROJECT (HDFJAVA_EXAMPLES_DATASETS Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_JNI_BINARY_DIR} - ${HDF5_JAVA_HDF5_LIB_DIR} -) - set (HDF_JAVA_EXAMPLES H5Ex_D_Alloc H5Ex_D_Checksum diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 73111ed..47baedd 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -3,11 +3,6 @@ PROJECT (HDFJAVA_EXAMPLES_DATATYPES Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_JNI_BINARY_DIR} - ${HDF5_JAVA_HDF5_LIB_DIR} -) - set (HDF_JAVA_EXAMPLES H5Ex_T_Array H5Ex_T_ArrayAttribute diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 6b55359..3fb977d 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -3,11 +3,6 @@ PROJECT (HDFJAVA_EXAMPLES_GROUPS Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_JNI_BINARY_DIR} - ${HDF5_JAVA_HDF5_LIB_DIR} -) - set (HDF_JAVA_EXAMPLES H5Ex_G_Create H5Ex_G_Iterate diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 65db3fe..da753bb 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -3,11 +3,6 @@ PROJECT (HDFJAVA_EXAMPLES_INTRO Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_JNI_BINARY_DIR} - ${HDF5_JAVA_HDF5_LIB_DIR} -) - set (HDF_JAVA_EXAMPLES H5_CreateAttribute H5_CreateDataset diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt index 9506fc1..bf64de3 100644 --- a/java/src/hdf/hdf5lib/CMakeLists.txt +++ b/java/src/hdf/hdf5lib/CMakeLists.txt @@ -3,12 +3,7 @@ PROJECT (HDF5_JAVA_HDF_HDF5 Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_HDF_HDF5_SOURCE_DIR} - ${HDF5_JAVA_HDF_HDF5_BINARY_DIR} - ${HDF5_JAVA_LIB_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${HDF5_JAVA_HDF5_LIB_CORENAME}.dir/hdf/hdf5lib -) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_JAVA_HDF_HDF5_SOURCE_DIR};${HDF5_JAVA_HDF_HDF5_BINARY_DIR};${HDF5_JAVA_LIB_DIR};${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${HDF5_JAVA_HDF5_LIB_CORENAME}.dir/hdf/hdf5lib") SET_GLOBAL_VARIABLE (HDF5_JAVA_SOURCE_PACKAGES "${HDF5_JAVA_SOURCE_PACKAGES};hdf.hdf5lib.callbacks;hdf.hdf5lib.exceptions;hdf.hdf5lib.structs;hdf.hdf5lib" diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 21e9d22..b3517cc 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -44,12 +44,11 @@ set (HDF5_JAVA_JNI_CHDRS ${HDF5_JAVA_JNI_SOURCE_DIR}/nativeData.h ) -INCLUDE_DIRECTORIES( ${HDF5_JAVA_JNI_SOURCE_DIR} ) - set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) ########### JNI libraries always must be built shared ############### add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JAVA_JNI_CHDRS}) +target_include_directories(${HDF5_JAVA_JNI_LIB_TARGET} PRIVATE ${HDF5_BINARY_DIR} ${HDF5_JAVA_JNI_SOURCE_DIR}) TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED " " " ") target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni) diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index c48cf01..31da30e 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -3,10 +3,7 @@ PROJECT (HDF5_JAVA_TEST Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_JNI_BINARY_DIR} - ${HDF5_JAVA_HDF5_LIB_DIR} -) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_JAVA_JNI_BINARY_DIR};${HDF5_JAVA_HDF5_LIB_DIR}") set (HDF5_JAVA_TEST_SOURCES TestH5.java diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 169a06f..1c38c84 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -188,7 +188,7 @@ string(TOLOWER ${LIB_TYPE} SEARCH_TYPE) find_package (HDF5 NAMES hdf5 COMPONENTS C ${SEARCH_TYPE}) # find_package (HDF5) # Find non-cmake built HDF5 -INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR}) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIR}") set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_${LIB_TYPE}_LIBRARY}) set (example hdf_example) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1e8a897..2fd8a24 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -858,6 +858,7 @@ endif () # specific type checks inside #----------------------------------------------------------------------------- add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) +target_include_directories(H5detect PRIVATE ${HDF5_BINARY_DIR}) TARGET_C_PROPERTIES (H5detect STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") @@ -874,6 +875,7 @@ add_custom_command ( ) add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) +target_include_directories(H5make_libsettings PRIVATE ${HDF5_BINARY_DIR}) TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") @@ -896,6 +898,7 @@ add_custom_command ( set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) +target_include_directories(${HDF5_LIB_TARGET} PUBLIC "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) @@ -905,14 +908,16 @@ set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC 0) set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries - INTERFACE_INCLUDE_DIRECTORIES "$/include>" + INTERFACE_INCLUDE_DIRECTORIES $/include> ) +## all_packages="AC,B,B2,D,F,FA,FL,FS,HL,I,O,S,ST,T,Z" +#all_packages="AC,B2,CX,D,F,HL,I,O,S,ST,T,Z" option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF) if (HDF5_ENABLE_DEBUG_APIS) set_target_properties (${HDF5_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS - "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG" + "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5CX_DEBUG;H5B2_DEBUG;H5AC_DEBUG" ) endif () set (install_targets ${HDF5_LIB_TARGET}) @@ -935,6 +940,7 @@ if (BUILD_SHARED_LIBS) ) set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) + target_include_directories(${HDF5_LIBSH_TARGET} PUBLIC "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) @@ -973,6 +979,7 @@ if (NOT HDF5_INSTALL_NO_DEVELOPMENT) FILES ${H5_PUBLIC_HEADERS} ${H5_GENERATED_HEADERS} + ${HDF5_BINARY_DIR}/H5pubconf.h DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ec560f2..6f2d0fd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,9 +9,8 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +set (srcdir ${HDF5_TEST_SOURCE_DIR}) configure_file (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) ################################################################################# # Define Test Library Sources @@ -30,6 +29,7 @@ set (TEST_LIB_HEADERS ) add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) +set_property(TARGET ${HDF5_TEST_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "ws2_32.lib") @@ -47,6 +47,7 @@ set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES if (BUILD_SHARED_LIBS) add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) + set_property(TARGET ${HDF5_TEST_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "ws2_32.lib") @@ -94,10 +95,9 @@ endif () set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}") set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}") set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) + set_property(TARGET ${HDF5_TEST_PLUGIN_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB") @@ -120,10 +120,9 @@ endif () set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}") set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}") set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) + set_property(TARGET ${HDF5_TEST_PLUGIN_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB") @@ -251,11 +250,13 @@ set (H5_TESTS macro (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) + set_property(TARGET ${file} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR}") TARGET_C_PROPERTIES (${file} STATIC " " " ") target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET}) set_target_properties (${file} PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) + set_property(TARGET ${file}-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR}") TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (${file}-shared PROPERTIES FOLDER test) @@ -280,11 +281,13 @@ endforeach () #-- Adding test for testhdf5 add_executable (testhdf5 ${testhdf5_SOURCES}) +set_property(TARGET testhdf5 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET}) set_target_properties (testhdf5 PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (testhdf5-shared ${testhdf5_SOURCES}) + set_property(TARGET testhdf5-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (testhdf5-shared PROPERTIES FOLDER test) @@ -292,11 +295,13 @@ endif () #-- Adding test for cache_image add_executable (cache_image ${cache_image_SOURCES}) +set_property(TARGET cache_image APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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 ${cache_image_SOURCES}) + set_property(TARGET cache_image-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) @@ -304,11 +309,13 @@ endif () #-- Adding test for ttsafe add_executable (ttsafe ${ttsafe_SOURCES}) +set_property(TARGET ttsafe APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ttsafe STATIC " " " ") target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (ttsafe PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (ttsafe-shared ${ttsafe_SOURCES}) + set_property(TARGET ttsafe-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ttsafe-shared SHARED " " " ") target_link_libraries (ttsafe-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (ttsafe-shared PROPERTIES FOLDER test) @@ -387,6 +394,7 @@ endforeach () # This has to be copied to the test directory for execve() to find it # and it can't be renamed (i.e., no -shared). add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c) +set_property(TARGET accum_swmr_reader APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (accum_swmr_reader STATIC " " " ") target_link_libraries (accum_swmr_reader ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (accum_swmr_reader PROPERTIES FOLDER test) @@ -402,11 +410,13 @@ endif () ############################################################################## if (BUILD_SHARED_LIBS) add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) + set_property(TARGET filter_plugin APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (filter_plugin SHARED " " " ") target_link_libraries (filter_plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (filter_plugin PROPERTIES FOLDER test) else () add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) + set_property(TARGET filter_plugin APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (filter_plugin STATIC " " " ") target_link_libraries (filter_plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (filter_plugin PROPERTIES FOLDER test) @@ -417,11 +427,13 @@ endif () ############################################################################## 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}) +set_property(TARGET use_append_chunk APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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}) + set_property(TARGET use_append_chunk-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) @@ -429,11 +441,13 @@ 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}) +set_property(TARGET use_append_mchunks APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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}) + set_property(TARGET use_append_mchunks-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) @@ -441,11 +455,13 @@ 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}) +set_property(TARGET use_disable_mdc_flushes APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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}) + set_property(TARGET use_disable_mdc_flushes-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 04cc41f..7b93311 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1008,6 +1008,7 @@ endif () if (HDF5_BUILD_GENERATORS) macro (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) + set_property(TARGET ${genfile} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/test) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index b1b9ce1..478626e 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -6,8 +6,6 @@ PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- add_definitions (${HDF_EXTRA_C_FLAGS}) -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib ) #----------------------------------------------------------------------------- # Define Tests #----------------------------------------------------------------------------- @@ -28,6 +26,7 @@ set (testphdf5_SOURCES #-- Adding test for testhdf5 add_executable (testphdf5 ${testphdf5_SOURCES}) +set_property(TARGET testphdf5 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (testphdf5 STATIC " " " ") target_link_libraries (testphdf5 PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) @@ -37,6 +36,7 @@ set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) + set_property(TARGET ${file} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${file} STATIC " " " ") target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 5576f5c..e8744af 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -11,11 +11,6 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) # -------------------------------------------------------------------- add_subdirectory (lib) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) - #-- Add the test sources add_subdirectory (src) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index e5a6439..e8c16ae 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -38,6 +38,8 @@ set (H5_TOOLS_LIB_HDRS ) add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) +target_include_directories(${HDF5_TOOLS_LIB_TARGET} INTERFACE "${HDF5_TOOLS_LIB_SOURCE_DIR}") +set_property(TARGET ${HDF5_TOOLS_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) @@ -54,6 +56,8 @@ set (install_targets ${HDF5_TOOLS_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) + target_include_directories(${HDF5_TOOLS_LIBSH_TARGET} INTERFACE "${HDF5_TOOLS_LIB_SOURCE_DIR}") + set_property(TARGET ${HDF5_TOOLS_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TOOLS_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt index 9364658..ddf9438 100644 --- a/tools/src/CMakeLists.txt +++ b/tools/src/CMakeLists.txt @@ -1,11 +1,6 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC) -#----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -add_definitions (${HDF_EXTRA_C_FLAGS}) - #-- Add the h5diff and test executables add_subdirectory (h5diff) diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 8423e5a..c392250 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -1,15 +1,11 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5COPY) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - # -------------------------------------------------------------------- # Add the h5copy and test executables # -------------------------------------------------------------------- add_executable (h5copy ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) +set_property(TARGET h5copy APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5copy STATIC " " " ") target_link_libraries (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5copy PROPERTIES FOLDER tools) @@ -19,6 +15,7 @@ set (H5_DEP_EXECUTABLES h5copy) if (BUILD_SHARED_LIBS) add_executable (h5copy-shared ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) + set_property(TARGET h5copy-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 9e9f1ea..01c5521 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -1,11 +1,6 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5DIFF) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - # -------------------------------------------------------------------- # Add the h5diff executables # -------------------------------------------------------------------- @@ -13,6 +8,7 @@ add_executable (h5diff ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c ) +set_property(TARGET h5diff APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5diff STATIC " " " ") target_link_libraries (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5diff PROPERTIES FOLDER tools) @@ -25,6 +21,7 @@ if (BUILD_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c ) + set_property(TARGET h5diff-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) @@ -38,6 +35,7 @@ if (H5_HAVE_PARALLEL) ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) + set_property(TARGET ph5diff APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ph5diff STATIC " " " ") target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (ph5diff PROPERTIES FOLDER tools) diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index 1133218..9cb93b1 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -1,11 +1,6 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5DUMP) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - # -------------------------------------------------------------------- # Add the h5dump executables # -------------------------------------------------------------------- @@ -14,6 +9,7 @@ add_executable (h5dump ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) +set_property(TARGET h5dump APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5dump STATIC " " " ") target_link_libraries (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5dump PROPERTIES FOLDER tools) @@ -27,6 +23,7 @@ if (BUILD_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) + set_property(TARGET h5dump-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 4acc999..473b69e 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -1,15 +1,11 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5FC) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - # -------------------------------------------------------------------- # Add the h5format_convert executables # -------------------------------------------------------------------- add_executable (h5format_convert ${HDF5_TOOLS_SRC_H5FC_SOURCE_DIR}/h5format_convert.c) +set_property(TARGET h5format_convert APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5format_convert STATIC " " " ") target_link_libraries (h5format_convert ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5format_convert PROPERTIES FOLDER tools) diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index d628c9b..375ed82 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -1,15 +1,11 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5IMPORT) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - # -------------------------------------------------------------------- # Add the h5import executables # -------------------------------------------------------------------- add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c) +set_property(TARGET h5import APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5import STATIC " " " ") target_link_libraries (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) #set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index 59caf44..80a6fcb 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -1,21 +1,18 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5JAM) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - # -------------------------------------------------------------------- # Add the h5jam executables # -------------------------------------------------------------------- add_executable (h5jam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5jam.c) +set_property(TARGET h5jam APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5jam STATIC " " " ") target_link_libraries (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5jam PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5jam") add_executable (h5unjam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5unjam.c) +set_property(TARGET h5unjam APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5unjam STATIC " " " ") target_link_libraries (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5unjam PROPERTIES FOLDER tools) diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index e9ecd44..ffe3afc 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -2,14 +2,10 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5LS) #----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - -#----------------------------------------------------------------------------- # Add the h5ls executable #----------------------------------------------------------------------------- add_executable (h5ls ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) +set_property(TARGET h5ls APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5ls STATIC " " " ") target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5ls PROPERTIES FOLDER tools) @@ -19,6 +15,7 @@ set (H5_DEP_EXECUTABLES h5ls) if (BUILD_SHARED_LIBS) add_executable (h5ls-shared ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) + set_property(TARGET h5ls-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index 211c947..accc7ea 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -1,12 +1,6 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5REPACK) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) - # -------------------------------------------------------------------- # Add h5Repack executables # -------------------------------------------------------------------- @@ -21,6 +15,7 @@ set (REPACK_COMMON_SOURCES ) add_executable (h5repack ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) +set_property(TARGET h5repack APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5repack STATIC " " " ") target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5repack PROPERTIES FOLDER tools) @@ -30,6 +25,7 @@ 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) + set_property(TARGET h5repack-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index 7842aa8..17eb330 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -1,15 +1,11 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5STAT) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - # -------------------------------------------------------------------- # Add the h5stat executables # -------------------------------------------------------------------- add_executable (h5stat ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) +set_property(TARGET h5stat APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5stat STATIC " " " ") target_link_libraries (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5stat PROPERTIES FOLDER tools) @@ -19,6 +15,7 @@ set (H5_DEP_EXECUTABLES h5stat) if (BUILD_SHARED_LIBS) add_executable (h5stat-shared ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) + set_property(TARGET h5stat-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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) diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 948c6d4..7126025 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -1,34 +1,33 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_MISC) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - # -------------------------------------------------------------------- # Add the misc executables # -------------------------------------------------------------------- #-- Misc Executables add_executable (h5debug ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5debug.c) +set_property(TARGET h5debug APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5debug STATIC " " " ") target_link_libraries (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5debug PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5debug") add_executable (h5repart ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5repart.c) +set_property(TARGET h5repart APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5repart STATIC " " " ") target_link_libraries (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repart") add_executable (h5mkgrp ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5mkgrp.c) +set_property(TARGET h5mkgrp APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5mkgrp STATIC " " " ") target_link_libraries (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5mkgrp PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5mkgrp") add_executable (h5clear ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5clear.c) +set_property(TARGET h5clear APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5clear STATIC " " " ") target_link_libraries (h5clear ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5clear PROPERTIES FOLDER tools) diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index f194d7a..ae9b4c3 100644 --- a/tools/test/CMakeLists.txt +++ b/tools/test/CMakeLists.txt @@ -1,11 +1,6 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST) -#----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -add_definitions (${HDF_EXTRA_C_FLAGS}) - #-- Add the h5diff tests add_subdirectory (h5diff) diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 9a171ba..adf8d7a 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -1,17 +1,12 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5COPY) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -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) + set_property(TARGET h5copygentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5copygentest STATIC " " " ") target_link_libraries (h5copygentest ${HDF5_LIB_TARGET}) set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) @@ -26,10 +21,9 @@ 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) + set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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 "LIB") diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index dd7da66..dfec8d1 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -1,22 +1,18 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5DIFF) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +# -------------------------------------------------------------------- +# Add the h5diff and test executables +# -------------------------------------------------------------------- +if (HDF5_BUILD_GENERATORS) + add_executable (h5diffgentest ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/h5diffgentest.c) + set_property(TARGET h5diffgentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (h5diffgentest STATIC " " " ") + target_link_libraries (h5diffgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) - # -------------------------------------------------------------------- - # Add the h5diff and test executables - # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) - add_executable (h5diffgentest ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/h5diffgentest.c) - TARGET_C_PROPERTIES (h5diffgentest STATIC " " " ") - target_link_libraries (h5diffgentest ${HDF5_LIB_TARGET}) - set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) - - #add_test (NAME h5diffgentest COMMAND $) - endif () + #add_test (NAME h5diffgentest COMMAND $) +endif () #----------------------------------------------------------------------------- # If plugin library tests can be tested @@ -25,10 +21,9 @@ 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}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c) + set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") 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 "LIB") diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 4ea1738..bfc60a5 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -2,54 +2,49 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5DUMP) #----------------------------------------------------------------------------- -# Setup include Directories +# If plugin library tests can be tested #----------------------------------------------------------------------------- -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 "LIB") - - # 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 +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_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c) +set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +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 "LIB") + +# 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 - # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) - add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) - TARGET_C_PROPERTIES (h5dumpgentest STATIC " " " ") - target_link_libraries (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) +# -------------------------------------------------------------------- +# Add the h5dump test executable +# -------------------------------------------------------------------- +if (HDF5_BUILD_GENERATORS) + add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) + set_property(TARGET h5dumpgentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (h5dumpgentest STATIC " " " ") + target_link_libraries (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) - #add_test (NAME h5dumpgentest COMMAND $) - endif () + #add_test (NAME h5dumpgentest COMMAND $) +endif () - include (CMakeTests.cmake) +include (CMakeTests.cmake) - include (CMakeTestsPBITS.cmake) +include (CMakeTestsPBITS.cmake) - include (CMakeTestsVDS.cmake) +include (CMakeTestsVDS.cmake) - include (CMakeTestsXML.cmake) +include (CMakeTestsXML.cmake) diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index a27c78a..ae06859 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -1,26 +1,23 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5FC) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +# -------------------------------------------------------------------- +# Add the h5format_convert test executables +# -------------------------------------------------------------------- +add_executable (h5fc_chk_idx ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_chk_idx.c) +set_property(TARGET h5fc_chk_idx APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (h5fc_chk_idx STATIC " " " ") +target_link_libraries (h5fc_chk_idx ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5fc_chk_idx PROPERTIES FOLDER tools) - # -------------------------------------------------------------------- - # Add the h5format_convert test executables - # -------------------------------------------------------------------- - add_executable (h5fc_chk_idx ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_chk_idx.c) - TARGET_C_PROPERTIES (h5fc_chk_idx STATIC " " " ") - target_link_libraries (h5fc_chk_idx ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5fc_chk_idx PROPERTIES FOLDER tools) +if (HDF5_BUILD_GENERATORS) + add_executable (h5fc_gentest ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_gentest.c) + set_property(TARGET h5fc_gentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (h5fc_gentest STATIC " " " ") + target_link_libraries (h5fc_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools) - if (HDF5_BUILD_GENERATORS) - add_executable (h5fc_gentest ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_gentest.c) - TARGET_C_PROPERTIES (h5fc_gentest STATIC " " " ") - target_link_libraries (h5fc_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools) + #add_test (NAME h5fc_gentest COMMAND $) +endif () - #add_test (NAME h5fc_gentest COMMAND $) - endif () - - include (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 2cb212a..9d7af99 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -1,17 +1,13 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5IMPORT) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +# -------------------------------------------------------------------- +# Add the h5import executables +# -------------------------------------------------------------------- +add_executable (h5importtest ${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/h5importtest.c) +set_property(TARGET h5importtest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (h5importtest STATIC " " " ") +target_link_libraries (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5importtest PROPERTIES FOLDER tools) - # -------------------------------------------------------------------- - # Add the h5import executables - # -------------------------------------------------------------------- - add_executable (h5importtest ${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/h5importtest.c) - TARGET_C_PROPERTIES (h5importtest STATIC " " " ") - target_link_libraries (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5importtest PROPERTIES FOLDER tools) - - include (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index b623860..b3a5677 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -1,31 +1,29 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5JAM) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +# -------------------------------------------------------------------- +# Add the h5jam test executables +# -------------------------------------------------------------------- +if (HDF5_BUILD_GENERATORS) + add_executable (h5jamgentest ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/h5jamgentest.c) + set_property(TARGET h5jamgentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") + target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) - # -------------------------------------------------------------------- - # Add the h5jam test executables - # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) - add_executable (h5jamgentest ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/h5jamgentest.c) - TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") - target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) - set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) - - #add_test (NAME h5jamgentest COMMAND $) - endif () + #add_test (NAME h5jamgentest COMMAND $) +endif () add_executable (getub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/getub.c) +set_property(TARGET getub APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (getub STATIC " " " ") target_link_libraries (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (getub PROPERTIES FOLDER tools) add_executable (tellub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/tellub.c) +set_property(TARGET tellub APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (tellub STATIC " " " ") target_link_libraries (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (tellub PROPERTIES FOLDER tools) - include (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index 5e7d2e2..d5650a5 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -2,38 +2,32 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5LS) #----------------------------------------------------------------------------- -# Setup include Directories +# If plugin library tests can be tested #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +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}) - #----------------------------------------------------------------------------- - # 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) +set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +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 "LIB") - 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 "LIB") - - # 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/$" - ) +# 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 (CMakeTests.cmake) - include (CMakeTestsVDS.cmake) +include (CMakeTestsVDS.cmake) diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index dbe80f7..db84554 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -1,17 +1,11 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5REPACK) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/src/h5repack) -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) - # -------------------------------------------------------------------- # Add h5Repack test executables # -------------------------------------------------------------------- add_executable (testh5repack_detect_szip ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) +set_property(TARGET testh5repack_detect_szip APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC " " " ") target_link_libraries (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools) @@ -26,52 +20,53 @@ set (REPACK_COMMON_SOURCES ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.c ) add_executable (h5repacktest ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repacktst.c) +set_property(TARGET h5repacktest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5repacktest STATIC " " " ") target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5repacktest PROPERTIES FOLDER tools) - #----------------------------------------------------------------------------- - # If plugin library tests can be tested - #----------------------------------------------------------------------------- - set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") - 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}) - set (HDF5_TOOL_PLUGIN_LIB_VCORENAME "dynlibvers") - set (HDF5_TOOL_PLUGIN_LIB_VNAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_VCORENAME}") - set (HDF5_TOOL_PLUGIN_LIB_VTARGET ${HDF5_TOOL_PLUGIN_LIB_VCORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) +#----------------------------------------------------------------------------- +# If plugin library tests can be tested +#----------------------------------------------------------------------------- +set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") +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}) +set (HDF5_TOOL_PLUGIN_LIB_VCORENAME "dynlibvers") +set (HDF5_TOOL_PLUGIN_LIB_VNAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_VCORENAME}") +set (HDF5_TOOL_PLUGIN_LIB_VTARGET ${HDF5_TOOL_PLUGIN_LIB_VCORENAME}) - add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.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 "LIB") +add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c) +set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +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 "LIB") - add_library (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c) - TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB") +add_library (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c) +set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_VTARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED " " " ") +target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TEST_LIB_TARGET}) +H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB") - # 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 +# 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_custom_command ( - TARGET ${HDF5_TOOL_PLUGIN_LIB_VTARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different +) +add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_VTARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "$" "${CMAKE_BINARY_DIR}/plugins/$" - ) +) - include (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index 5f645097..9d5ff5c 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -1,21 +1,17 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5STAT) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +# -------------------------------------------------------------------- +# Add the h5stat test executables +# -------------------------------------------------------------------- +if (HDF5_BUILD_GENERATORS) + add_executable (h5stat_gentest ${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/h5stat_gentest.c) + set_property(TARGET h5stat_gentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (h5stat_gentest STATIC " " " ") + target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET}) + set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) - # -------------------------------------------------------------------- - # Add the h5stat test executables - # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) - add_executable (h5stat_gentest ${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/h5stat_gentest.c) - TARGET_C_PROPERTIES (h5stat_gentest STATIC " " " ") - target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET}) - set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) + #add_test (NAME h5stat_gentest COMMAND $) +endif () - #add_test (NAME h5stat_gentest COMMAND $) - endif () - - include (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 084751a..4a44ddb 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -1,41 +1,40 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_MISC) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - - # -------------------------------------------------------------------- - # Add the misc test executables - # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) - add_executable (h5repart_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5repart_gentest.c) - TARGET_C_PROPERTIES (h5repart_gentest STATIC " " " ") - target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - 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_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 (vds) - - endif () - - add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c) - TARGET_C_PROPERTIES (h5repart_test STATIC " " " ") - target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5repart_test PROPERTIES FOLDER tools) - - add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c) - TARGET_C_PROPERTIES (clear_open_chk STATIC " " " ") - target_link_libraries (clear_open_chk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (clear_open_chk PROPERTIES FOLDER tools) - - include (CMakeTestsRepart.cmake) - include (CMakeTestsClear.cmake) - include (CMakeTestsMkgrp.cmake) +# -------------------------------------------------------------------- +# Add the misc test executables +# -------------------------------------------------------------------- +if (HDF5_BUILD_GENERATORS) + add_executable (h5repart_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5repart_gentest.c) + set_property(TARGET h5repart_gentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (h5repart_gentest STATIC " " " ") + target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + 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) + set_property(TARGET h5clear_gentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + 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 (vds) + +endif () + +add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c) +set_property(TARGET h5repart_test APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (h5repart_test STATIC " " " ") +target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5repart_test PROPERTIES FOLDER tools) + +add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c) +set_property(TARGET clear_open_chk APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (clear_open_chk STATIC " " " ") +target_link_libraries (clear_open_chk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (clear_open_chk PROPERTIES FOLDER tools) + +include (CMakeTestsRepart.cmake) +include (CMakeTestsClear.cmake) +include (CMakeTestsMkgrp.cmake) diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index 50aade4..04c1223 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -1,13 +1,9 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_MISC_VDS) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - MACRO (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TOOLS_TEST_MISC_VDS_SOURCE_DIR}/${genfile}.c) + set_property(TARGET ${genfile} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/tools) diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index 5104b90..f20d9ce 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -1,17 +1,6 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_PERFORM ) -#----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -add_definitions (${HDF_EXTRA_C_FLAGS}) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib ) - # -------------------------------------------------------------------- # Add the executables # -------------------------------------------------------------------- @@ -21,6 +10,7 @@ set (h5perf_serial_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c ) add_executable (h5perf_serial ${h5perf_serial_SOURCES}) +set_property(TARGET h5perf_serial APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5perf_serial STATIC " " " ") target_link_libraries (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5perf_serial PROPERTIES FOLDER perform) @@ -32,6 +22,7 @@ if (HDF5_BUILD_PERFORM_STANDALONE) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c ) add_executable (h5perf_serial_alone ${h5perf_serial_alone_SOURCES}) + set_property(TARGET h5perf_serial_alone APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5perf_serial_alone STATIC " " " ") target_link_libraries (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform) @@ -44,9 +35,10 @@ endif () set (chunk_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/chunk.c ) -ADD_EXECUTABLE(chunk ${chunk_SOURCES}) +add_executable(chunk ${chunk_SOURCES}) +set_property(TARGET chunk APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (chunk STATIC " " " ") -TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +target_link_libraries(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (chunk PROPERTIES FOLDER perform) #-- Adding test for iopipe @@ -54,6 +46,7 @@ set (iopipe_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/iopipe.c ) add_executable (iopipe ${iopipe_SOURCES}) +set_property(TARGET iopipe APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (iopipe STATIC " " " ") target_link_libraries (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (iopipe PROPERTIES FOLDER perform) @@ -63,24 +56,27 @@ set (overhead_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/overhead.c ) add_executable (overhead ${overhead_SOURCES}) +set_property(TARGET overhead APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (overhead STATIC " " " ") target_link_libraries (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (overhead PROPERTIES FOLDER perform) #-- Adding test for perf_meta - set (perf_meta_SOURCES - ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf_meta.c - ) - add_executable (perf_meta ${perf_meta_SOURCES}) - TARGET_C_PROPERTIES (perf_meta STATIC " " " ") - target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - set_target_properties (perf_meta PROPERTIES FOLDER perform) +set (perf_meta_SOURCES + ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf_meta.c +) +add_executable (perf_meta ${perf_meta_SOURCES}) +set_property(TARGET perf_meta APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (perf_meta STATIC " " " ") +target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (perf_meta PROPERTIES FOLDER perform) #-- Adding test for zip_perf set (zip_perf_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/zip_perf.c ) add_executable (zip_perf ${zip_perf_SOURCES}) +set_property(TARGET zip_perf APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (zip_perf STATIC " " " ") target_link_libraries (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (zip_perf PROPERTIES FOLDER perform) @@ -92,6 +88,7 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c ) add_executable (h5perf ${h5perf_SOURCES}) + set_property(TARGET h5perf APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5perf STATIC " " " ") target_link_libraries (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf PROPERTIES FOLDER perform) @@ -103,6 +100,7 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c ) add_executable (h5perf_alone ${h5perf_alone_SOURCES}) + set_property(TARGET h5perf_alone APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5perf_alone STATIC " " " ") target_link_libraries (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf_alone PROPERTIES FOLDER perform) -- cgit v0.12 From 03e579f2010a79ac72e5f62a9e4531cabc33813e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 17 Apr 2018 22:29:57 -0500 Subject: TRILABS-19 All c code INCLUDE_DIRECTORIES converted --- fortran/examples/CMakeLists.txt | 12 ++++++------ hl/fortran/test/CMakeLists.txt | 9 ++++++++- hl/tools/h5watch/CMakeLists.txt | 14 +++++--------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index fd98944..200a999 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -6,12 +6,6 @@ PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- #----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- - -set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src") - -#----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- set (examples @@ -47,6 +41,7 @@ foreach (example ${examples}) ${HDF5_LIB_TARGET} ) target_include_directories (f90_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_property(TARGET f90_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran @@ -60,6 +55,7 @@ foreach (example ${examples}) ${HDF5_LIBSH_TARGET} ) target_include_directories (f90_ex_${example}-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET f90_ex_${example}-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (f90_ex_${example}-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran @@ -76,6 +72,7 @@ foreach (example ${F2003_examples}) ${HDF5_LIB_TARGET} ) target_include_directories (f03_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_property(TARGET f03_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran03 @@ -89,6 +86,7 @@ foreach (example ${F2003_examples}) ${HDF5_LIBSH_TARGET} ) target_include_directories (f03_ex_${example}-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET f03_ex_${example}-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (f03_ex_${example}-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran03 @@ -105,6 +103,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ${HDF5_LIB_TARGET} ) target_include_directories (f90_ex_ph5example PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_property(TARGET f90_ex_ph5example APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran @@ -118,6 +117,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ${HDF5_LIBSH_TARGET} ) target_include_directories (f90_ex_ph5example-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET f90_ex_ph5example-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (f90_ex_ph5example-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 1ac16d9..7e7740d 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -4,13 +4,13 @@ PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- # Add Tests #----------------------------------------------------------------------------- -set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${CMAKE_Fortran_MODULE_DIRECTORY};${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") #-- Adding test for hl_f90_tstds add_executable (hl_f90_tstds tstds.F90) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds STATIC " " " ") target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) target_include_directories (hl_f90_tstds PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET hl_f90_tstds APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) @@ -18,6 +18,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds-shared SHARED " " " ") target_link_libraries (hl_f90_tstds-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) target_include_directories (hl_f90_tstds-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET hl_f90_tstds-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstds-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran @@ -30,6 +31,7 @@ add_executable (hl_f90_tstlite tstlite.F90) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite STATIC " " " ") target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}) target_include_directories (hl_f90_tstlite PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET hl_f90_tstlite APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) @@ -37,6 +39,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite-shared SHARED " " " ") target_link_libraries (hl_f90_tstlite-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}) target_include_directories (hl_f90_tstlite-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET hl_f90_tstlite-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstlite-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran @@ -49,6 +52,7 @@ add_executable (hl_f90_tstimage tstimage.F90) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage STATIC " " " ") target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) target_include_directories (hl_f90_tstimage PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET hl_f90_tstimage APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) @@ -56,6 +60,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage-shared SHARED " " " ") target_link_libraries (hl_f90_tstimage-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) target_include_directories (hl_f90_tstimage-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET hl_f90_tstimage-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstimage-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran @@ -68,6 +73,7 @@ add_executable (hl_f90_tsttable tsttable.F90) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable STATIC " " " ") target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}) target_include_directories (hl_f90_tsttable PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET hl_f90_tsttable APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) @@ -75,6 +81,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable-shared SHARED " " " ") target_link_libraries (hl_f90_tsttable-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}) target_include_directories (hl_f90_tsttable-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET hl_f90_tsttable-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tsttable-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index 165c8ec..fdcf887 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_TOOLS_H5WATCH) -set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") - #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- @@ -11,25 +9,21 @@ set (H5WATCH_SOURCES ) #-- Add h5watch program -include_directories (${HDF5_TOOLS_DIR}/lib) -include_directories (${HDF5_HL_TOOLS_DIR}/src) -include_directories (${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}) - add_executable (h5watch ${H5WATCH_SOURCES}) +set_property(TARGET h5watch APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5watch STATIC " " " ") target_link_libraries (h5watch ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5watch PROPERTIES FOLDER tools/hl) if (BUILD_TESTING) - include_directories (${HDF5_TEST_SRC_DIR}) - include_directories(${HDF5_HL_SRC_DIR}/test) #-- Add swmr_check_compat_vfd program set (hl_swmr_check_compat_vfd_SOURCES ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/swmr_check_compat_vfd.c ) add_executable (hl_swmr_check_compat_vfd ${hl_swmr_check_compat_vfd_SOURCES}) + set_property(TARGET hl_swmr_check_compat_vfd APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_swmr_check_compat_vfd STATIC " " " ") - target_link_libraries (hl_swmr_check_compat_vfd ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + target_link_libraries (hl_swmr_check_compat_vfd ${HDF5_LIB_TARGET}) set_target_properties (hl_swmr_check_compat_vfd PROPERTIES FOLDER tools/hl) #-- Add extend_dset program @@ -37,11 +31,13 @@ if (BUILD_TESTING) ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/extend_dset.c ) add_executable (extend_dset ${extend_dset_SOURCES}) + set_property(TARGET extend_dset APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_HL_SRC_DIR}/test;${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (extend_dset STATIC " " " ") target_link_libraries (extend_dset ${HDF5_HL_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (extend_dset PROPERTIES FOLDER tools/hl) add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c) + set_property(TARGET h5watchgentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5watchgentest STATIC " " " ") target_link_libraries (h5watchgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5watchgentest PROPERTIES FOLDER generator/tools/hl) -- cgit v0.12 From 188539f65e5de800ab63e68093c8e453e8c451c4 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 17 Apr 2018 22:39:20 -0500 Subject: Revert "Close memory leak of last API context when shutting library down." This reverts commit 0bd3634dc5747d88582a966050896bad57acb892. --- src/H5.c | 4 ++-- src/H5CX.c | 35 ++++++++++++++++------------------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/H5.c b/src/H5.c index 1467ddf..f3e56d0 100644 --- a/src/H5.c +++ b/src/H5.c @@ -415,8 +415,8 @@ H5_term_library(void) /* Mark library as closed */ H5_INIT_GLOBAL = FALSE; - /* Pop the API context (without checking for errors) */ - H5CX_pop_special(); + /* Don't pop the API context, since it's been shut down already */ + /* H5CX_pop_special(); */ done: #ifdef H5_HAVE_THREADSAFE diff --git a/src/H5CX.c b/src/H5CX.c index 5c907bc..af2619b 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -342,7 +342,7 @@ typedef struct H5CX_lapl_cache_t { /********************/ static H5CX_node_t **H5CX__get_context(void); static void H5CX__push_common(H5CX_node_t *cnode); -static H5CX_node_t *H5CX__pop_common(hbool_t update_dxpl); +static H5CX_node_t *H5CX__pop_common(void); /*********************/ @@ -2743,7 +2743,7 @@ done: *------------------------------------------------------------------------- */ static H5CX_node_t * -H5CX__pop_common(hbool_t update_dxpl) +H5CX__pop_common(void) { H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ H5CX_node_t *ret_value = NULL; /* Return value */ @@ -2753,25 +2753,22 @@ H5CX__pop_common(hbool_t update_dxpl) /* Sanity check */ HDassert(head && *head); - /* Update DXPL properties, if requested */ - if(update_dxpl) { - /* Check for cached DXPL properties to return to application */ - H5CX_SET_PROP(H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, dcr_filters) + /* Check for cached DXPL properties to return to application */ + H5CX_SET_PROP(H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, dcr_filters) #ifdef H5_HAVE_PARALLEL - H5CX_SET_PROP(H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, mpio_actual_chunk_opt) - H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode) - H5CX_SET_PROP(H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) - H5CX_SET_PROP(H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) + H5CX_SET_PROP(H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, mpio_actual_chunk_opt) + H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode) + H5CX_SET_PROP(H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) + H5CX_SET_PROP(H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ #endif /* H5_HAVE_PARALLEL */ - } /* end if */ /* Pop the top context node from the stack */ ret_value = (*head); @@ -2803,7 +2800,7 @@ H5CX_pop(void) FUNC_ENTER_NOAPI(FAIL) /* Perform common operations and get top context from stack */ - if(NULL == (cnode = H5CX__pop_common(TRUE))) + if(NULL == (cnode = H5CX__pop_common())) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error getting API context node") /* Free the context node */ @@ -2836,7 +2833,7 @@ H5CX_pop_special(void) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Perform common operations and get top context from stack */ - cnode = H5CX__pop_common(FALSE); + cnode = H5CX__pop_common(); HDassert(cnode); /* Free the context node */ -- cgit v0.12 From bcab84db9f291920ed0fe321116405f73eaddfa5 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 17 Apr 2018 22:55:45 -0500 Subject: Resolve memory leak of last API context, by freeing it in H5CX terminate routine. --- src/H5.c | 3 +-- src/H5CX.c | 42 ++++++++++-------------------------------- src/H5CXprivate.h | 1 - 3 files changed, 11 insertions(+), 35 deletions(-) diff --git a/src/H5.c b/src/H5.c index f3e56d0..552330d 100644 --- a/src/H5.c +++ b/src/H5.c @@ -415,8 +415,7 @@ H5_term_library(void) /* Mark library as closed */ H5_INIT_GLOBAL = FALSE; - /* Don't pop the API context, since it's been shut down already */ - /* H5CX_pop_special(); */ + /* Don't pop the API context (i.e. H5CX_pop), since it's been shut down already */ done: #ifdef H5_HAVE_THREADSAFE diff --git a/src/H5CX.c b/src/H5CX.c index af2619b..c81a0f4 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -535,6 +535,16 @@ H5CX_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_PKG_INIT_VAR) { + H5CX_node_t *cnode; /* Context node */ + + /* Pop the top context node from the stack */ + /* (Can't check for errors, as rest of library is shut down) */ + cnode = H5CX__pop_common(); + + /* Free the context node */ + /* (Allocated with HDmalloc() in H5CX_push_special() ) */ + HDfree(cnode); + #ifndef H5_HAVE_THREADSAFE /* Release pointer to head of API context stack */ HDfree(H5CX_head_g); @@ -2810,35 +2820,3 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_pop() */ - -/*------------------------------------------------------------------------- - * Function: H5CX_pop_special - * - * Purpose: Pops the context for an API call, without using library routines. - * - * Note: This should only be called in special circumstances, like H5close. - * - * Return: - * - * Programmer: Quincey Koziol - * Februrary 22, 2018 - * - *------------------------------------------------------------------------- - */ -void -H5CX_pop_special(void) -{ - H5CX_node_t *cnode; /* Context node */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Perform common operations and get top context from stack */ - cnode = H5CX__pop_common(); - HDassert(cnode); - - /* Free the context node */ - HDfree(cnode); - - FUNC_LEAVE_NOAPI_VOID -} /* end H5CX_pop_special() */ - diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index 78f4793..3566f11 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -56,7 +56,6 @@ H5_DLL herr_t H5CX_pop(void); #endif /* _H5private_H */ H5_DLL void H5CX_push_special(void); H5_DLL hbool_t H5CX_is_def_dxpl(void); -H5_DLL void H5CX_pop_special(void); /* "Setter" routines for API context info */ H5_DLL void H5CX_set_dxpl(hid_t dxpl_id); -- cgit v0.12 From 76cab1f5cb48af8398e1c09c15a974b1f8347da4 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 18 Apr 2018 22:33:57 -0500 Subject: Fix non-threadsafe API context head pointer handling. --- src/H5CX.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index c81a0f4..deaf1a1 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -61,7 +61,7 @@ /* * The current API context. */ -#define H5CX_get_my_context() (H5CX_head_g) +#define H5CX_get_my_context() (&H5CX_head_g) #endif /* H5_HAVE_THREADSAFE */ /* Common macro for the duplicated code to retrieve properties from a property list */ @@ -358,7 +358,7 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /*******************/ #ifndef H5_HAVE_THREADSAFE -static H5CX_node_t **H5CX_head_g = NULL; /* Pointer to head of context stack */ +static H5CX_node_t *H5CX_head_g = NULL; /* Pointer to head of context stack */ #endif /* H5_HAVE_THREADSAFE */ /* Define a "default" dataset transfer property list cache structure to use for default DXPLs */ @@ -391,13 +391,6 @@ H5CX__init_package(void) FUNC_ENTER_STATIC -#ifndef H5_HAVE_THREADSAFE - /* Allocate the context stack head pointer */ - if(NULL == (H5CX_head_g = (H5CX_node_t **)HDmalloc(sizeof(H5CX_node_t *)))) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTALLOC, FAIL, "can't allocate pointer to head of context stack") - *H5CX_head_g = NULL; -#endif /* H5_HAVE_THREADSAFE */ - /* Reset the "default DXPL cache" information */ HDmemset(&H5CX_def_dxpl_cache, 0, sizeof(H5CX_dxpl_cache_t)); @@ -546,8 +539,6 @@ H5CX_term_package(void) HDfree(cnode); #ifndef H5_HAVE_THREADSAFE - /* Release pointer to head of API context stack */ - HDfree(H5CX_head_g); H5CX_head_g = NULL; #endif /* H5_HAVE_THREADSAFE */ -- cgit v0.12 From 6c82c49dd5e5ee187ab1da9f54311a1ecab45bb8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 20 Apr 2018 10:11:55 -0500 Subject: TRILABS-20 set a compiler name on all project commands --- CMakeLists.txt | 2 +- c++/CMakeLists.txt | 22 +------------- c++/examples/CMakeLists.txt | 2 +- c++/src/CMakeLists.txt | 15 +++++++++- c++/test/CMakeLists.txt | 16 ++++++++++- config/cmake/HDFCompilerFlags.cmake | 46 ++++++++++++++++++++---------- config/cmake_ext_mod/ConfigureChecks.cmake | 2 +- examples/CMakeLists.txt | 2 +- fortran/CMakeLists.txt | 2 +- fortran/examples/CMakeLists.txt | 2 +- fortran/src/CMakeLists.txt | 2 +- fortran/test/CMakeLists.txt | 2 +- fortran/testpar/CMakeLists.txt | 2 +- hl/CMakeLists.txt | 7 +---- hl/c++/CMakeLists.txt | 2 +- hl/c++/examples/CMakeLists.txt | 2 +- hl/c++/src/CMakeLists.txt | 2 +- hl/c++/test/CMakeLists.txt | 2 +- hl/examples/CMakeLists.txt | 2 +- hl/fortran/CMakeLists.txt | 2 +- hl/fortran/examples/CMakeLists.txt | 2 +- hl/fortran/src/CMakeLists.txt | 2 +- hl/fortran/test/CMakeLists.txt | 2 +- hl/src/CMakeLists.txt | 2 +- hl/test/CMakeLists.txt | 2 +- hl/tools/CMakeLists.txt | 2 +- hl/tools/gif2h5/CMakeLists.txt | 2 +- hl/tools/h5watch/CMakeLists.txt | 2 +- java/CMakeLists.txt | 5 ++-- java/examples/CMakeLists.txt | 2 +- java/examples/datasets/CMakeLists.txt | 2 +- java/examples/datatypes/CMakeLists.txt | 2 +- java/examples/groups/CMakeLists.txt | 2 +- java/examples/intro/CMakeLists.txt | 2 +- java/src/CMakeLists.txt | 2 +- java/src/hdf/CMakeLists.txt | 2 +- java/src/hdf/hdf5lib/CMakeLists.txt | 2 +- java/src/jni/CMakeLists.txt | 2 +- java/test/CMakeLists.txt | 2 +- src/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- testpar/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 2 +- tools/lib/CMakeLists.txt | 2 +- tools/src/CMakeLists.txt | 2 +- tools/src/h5copy/CMakeLists.txt | 2 +- tools/src/h5diff/CMakeLists.txt | 2 +- tools/src/h5dump/CMakeLists.txt | 2 +- tools/src/h5format_convert/CMakeLists.txt | 2 +- tools/src/h5import/CMakeLists.txt | 2 +- tools/src/h5jam/CMakeLists.txt | 2 +- tools/src/h5ls/CMakeLists.txt | 2 +- tools/src/h5repack/CMakeLists.txt | 2 +- tools/src/h5stat/CMakeLists.txt | 2 +- tools/src/misc/CMakeLists.txt | 2 +- tools/test/CMakeLists.txt | 2 +- tools/test/h5copy/CMakeLists.txt | 2 +- tools/test/h5diff/CMakeLists.txt | 2 +- tools/test/h5dump/CMakeLists.txt | 2 +- tools/test/h5format_convert/CMakeLists.txt | 2 +- tools/test/h5import/CMakeLists.txt | 2 +- tools/test/h5jam/CMakeLists.txt | 2 +- tools/test/h5ls/CMakeLists.txt | 2 +- tools/test/h5repack/CMakeLists.txt | 2 +- tools/test/h5stat/CMakeLists.txt | 2 +- tools/test/misc/CMakeLists.txt | 2 +- tools/test/misc/vds/CMakeLists.txt | 2 +- tools/test/perform/CMakeLists.txt | 2 +- 68 files changed, 127 insertions(+), 108 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b88463c..d3afc41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5 C CXX) +project (HDF5 C) #----------------------------------------------------------------------------- # Instructions for use : Normal Build diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 635c6fe..80bd810 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -1,25 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_CPP) - -#----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -add_definitions (${HDF_EXTRA_C_FLAGS}) - -#----------------------------------------------------------------------------- -# Generate configure file -#----------------------------------------------------------------------------- -configure_file (${HDF_RESOURCES_DIR}/H5cxx_config.h.in - ${HDF5_BINARY_DIR}/H5cxx_pubconf.h -) - -#----------------------------------------------------------------------------- -# Parallel/MPI, prevent spurious cpp/cxx warnings -#----------------------------------------------------------------------------- -if (H5_HAVE_PARALLEL) - add_definitions ("-DMPICH_SKIP_MPICXX") - add_definitions ("-DMPICH_IGNORE_CXX_SEEK") -endif () +project (HDF5_CPP CXX) add_subdirectory (src) diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 653f72a..e05d6f0 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_CPP_EXAMPLES) +project (HDF5_CPP_EXAMPLES CXX) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 52acc0b..eae86a3 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -1,5 +1,18 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_CPP_SRC) +project (HDF5_CPP_SRC CXX) + +#----------------------------------------------------------------------------- +# Parallel/MPI, prevent spurious cpp/cxx warnings +#----------------------------------------------------------------------------- +if (H5_HAVE_PARALLEL) + add_definitions ("-DMPICH_SKIP_MPICXX") + add_definitions ("-DMPICH_IGNORE_CXX_SEEK") +endif () + +#----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +add_definitions (${HDF_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Generate configure file diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 83ca337..abc7952 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -1,5 +1,19 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_CPP_TEST) +project (HDF5_CPP_TEST CXX) + +#----------------------------------------------------------------------------- +# Parallel/MPI, prevent spurious cpp/cxx warnings +#----------------------------------------------------------------------------- +if (H5_HAVE_PARALLEL) + add_definitions ("-DMPICH_SKIP_MPICXX") + add_definitions ("-DMPICH_IGNORE_CXX_SEEK") +endif () + +#----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +add_definitions (${HDF_EXTRA_C_FLAGS}) + # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed # with "cpp_". This allows for easier filtering of the test suite when diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 56277fa..1ba090c 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -50,8 +50,10 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) set (HDF5_WARNINGS_BLOCKED 1) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") + endif () endif () if (WIN32) add_definitions (-D_CRT_SECURE_NO_WARNINGS) @@ -65,7 +67,9 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) # 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") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + endif () endif () endif () @@ -212,13 +216,17 @@ if (HDF5_ENABLE_ALL_WARNINGS) 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") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /wd4668") + endif () 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") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + endif () endif () else () if (CMAKE_COMPILER_IS_GNUCC) @@ -235,8 +243,10 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") 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") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + endif () else () if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") @@ -252,8 +262,10 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") 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") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + endif () else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") endif () @@ -267,8 +279,10 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS) if (MSVC) 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") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + endif () else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") endif () @@ -282,8 +296,10 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") 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") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + endif () else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") endif () diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 3797768..0153254 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -14,7 +14,6 @@ #----------------------------------------------------------------------------- include (CheckFunctionExists) include (CheckIncludeFile) -include (CheckIncludeFileCXX) include (CheckIncludeFiles) include (CheckLibraryExists) include (CheckSymbolExists) @@ -23,6 +22,7 @@ include (CheckVariableExists) include (CheckFortranFunctionExists) include (TestBigEndian) if (CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER_LOADED) + include (CheckIncludeFileCXX) include (TestForSTDNamespace) endif () diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 601370b..05646d8 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_EXAMPLES) +project (HDF5_EXAMPLES C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 8c7b8f6..31edad2 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_F90 C CXX Fortran) +project (HDF5_F90 C Fortran) if (H5_HAVE_PARALLEL) if (MPI_Fortran_LINK_FLAGS) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 200a999..187acc1 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) +project (HDF5_F90_EXAMPLES C Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed # with "f90_ex_". This allows for easier filtering of the examples. diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 4efd5fb..71b7d41 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -project (HDF5_F90_SRC C CXX Fortran) +project (HDF5_F90_SRC C Fortran) #----------------------------------------------------------------------------- # configure def file for shared libs on windows diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 345f642..7f538f1 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) +project (HDF5_FORTRAN_TESTS C Fortran) #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 979d305..fe5827d 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) +project (HDF5_FORTRAN_TESTPAR C Fortran) #----------------------------------------------------------------------------- # Setup include Directories diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index 3f5f633..2a71b47 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -1,10 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL C CXX) - -#----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -add_definitions (${HDF_EXTRA_C_FLAGS}) +project (HDF5_HL C) #----------------------------------------------------------------------------- # List Source files diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 71e5bb3..a62d9d4 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_CPP) +project (HDF5_HL_CPP CXX) #----------------------------------------------------------------------------- # Main HL lib is in /src diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 7f0d422..1760d71 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_CPP_EXAMPLES) +project (HDF5_HL_CPP_EXAMPLES CXX) # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 53194d0..10a0c1e 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_CPP_SRC) +project (HDF5_HL_CPP_SRC CXX) #----------------------------------------------------------------------------- # Define Sources diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index aab3049..710e218 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_CPP_TEST) +project (HDF5_HL_CPP_TEST CXX) add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) set_property(TARGET hl_ptableTest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_HL_SRC_DIR}/test;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 4c3d790..79250e6 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_EXAMPLES ) +project (HDF5_HL_EXAMPLES C) #----------------------------------------------------------------------------- # Define Sources diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 7955de2..3c82574 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_F90 C CXX Fortran) +project (HDF5_HL_F90 C Fortran) #----------------------------------------------------------------------------- # List Source files diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index eae3de5..af92efc 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) +project (HDF5_HL_F90_EXAMPLES C Fortran) set (examples exlite diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index e3fae79..41adb6e 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -project (HDF5_HL_F90_SRC C CXX Fortran) +project (HDF5_HL_F90_SRC C Fortran) #----------------------------------------------------------------------------- # configure def file for shared libs on windows diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 7e7740d..e82bb2b 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) +project (HDF5_HL_FORTRAN_TESTS C Fortran) #----------------------------------------------------------------------------- # Add Tests diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index ccfb061..bec40ec 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_SRC) +project (HDF5_HL_SRC C) #----------------------------------------------------------------------------- # List Source files diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 21259fa..0acb2f4 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_TEST) +project (HDF5_HL_TEST C) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed # with "hl_". This allows for easier filtering of the test suite when diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 67e0ccb..c2889c3 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_TOOLS C CXX) +project (HDF5_HL_TOOLS C) add_subdirectory (gif2h5) diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 03ee7c2..977d78c 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_TOOLS_GIF2H5) +project (HDF5_HL_TOOLS_GIF2H5 C) #----------------------------------------------------------------------------- # Define Sources diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index fdcf887..b3bd856 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_TOOLS_H5WATCH) +project (HDF5_HL_TOOLS_H5WATCH C) #----------------------------------------------------------------------------- # Define Sources diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 4684827..ffc3b94 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -1,8 +1,9 @@ cmake_minimum_required (VERSION 3.10) -PROJECT ( HDF5_JAVA C Java ) +project (HDF5_JAVA C Java) set (CMAKE_MODULE_PATH "${HDF_RESOURCES_DIR};${HDF_RESOURCES_EXT_DIR}") find_package (Java) + #----------------------------------------------------------------------------- # Include some macros for reusable code #----------------------------------------------------------------------------- @@ -30,8 +31,8 @@ set (HDF5_JAVA_INCLUDE_DIRECTORIES ${JAVA_INCLUDE_PATH2} ) set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_JAVA_INCLUDE_DIRECTORIES}") -set (CMAKE_JAVA_INCLUDE_PATH "") +set (CMAKE_JAVA_INCLUDE_PATH "") #----------------------------------------------------------------------------- # Traverse source subdirectory diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt index 3d1e30e..828b96a 100644 --- a/java/examples/CMakeLists.txt +++ b/java/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDFJAVA_EXAMPLES) +project (HDFJAVA_EXAMPLES Java) add_subdirectory (datasets) add_subdirectory (datatypes) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 8b86a54..5ac241a 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDFJAVA_EXAMPLES_DATASETS Java) +project (HDFJAVA_EXAMPLES_DATASETS Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 47baedd..4a8b2a4 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDFJAVA_EXAMPLES_DATATYPES Java) +project (HDFJAVA_EXAMPLES_DATATYPES Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 3fb977d..2c5d33b 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDFJAVA_EXAMPLES_GROUPS Java) +project (HDFJAVA_EXAMPLES_GROUPS Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index da753bb..8d56b86 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDFJAVA_EXAMPLES_INTRO Java) +project (HDFJAVA_EXAMPLES_INTRO Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index 0c00923..3f80d8f 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT ( HDF5_JAVA_SRC C Java ) +project (HDF5_JAVA_SRC C) #----------------------------------------------------------------------------- # Traverse source subdirectory diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt index ecff984..161ddf1 100644 --- a/java/src/hdf/CMakeLists.txt +++ b/java/src/hdf/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_JAVA_HDF) +project (HDF5_JAVA_HDF C) add_subdirectory (hdf5lib) diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt index bf64de3..c171ea8 100644 --- a/java/src/hdf/hdf5lib/CMakeLists.txt +++ b/java/src/hdf/hdf5lib/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_JAVA_HDF_HDF5 Java) +project (HDF5_JAVA_HDF_HDF5 Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index b3517cc..dc9cc01 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_JAVA_JNI C CXX) +project (HDF5_JAVA_JNI C) set (HDF5_JAVA_JNI_CSRCS ${HDF5_JAVA_JNI_SOURCE_DIR}/exceptionImp.c diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 31da30e..5cded3b 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_JAVA_TEST Java) +project (HDF5_JAVA_TEST Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2fd8a24..435fe9a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_SRC C CXX) +project (HDF5_SRC C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6f2d0fd..3756dc0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TEST) +project (HDF5_TEST C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 478626e..326c34f 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TEST_PAR) +project (HDF5_TEST_PAR C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index e8744af..1047138 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS) +project (HDF5_TOOLS C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index e8c16ae..090c8a4 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_LIB) +project (HDF5_TOOLS_LIB C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt index ddf9438..757c9cd 100644 --- a/tools/src/CMakeLists.txt +++ b/tools/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC) +project (HDF5_TOOLS_SRC C) #-- Add the h5diff and test executables add_subdirectory (h5diff) diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index c392250..9fe6a5f 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5COPY) +project (HDF5_TOOLS_SRC_H5COPY C) # -------------------------------------------------------------------- # Add the h5copy and test executables diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 01c5521..fd8ede3 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5DIFF) +project (HDF5_TOOLS_SRC_H5DIFF C) # -------------------------------------------------------------------- # Add the h5diff executables diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index 9cb93b1..6f74ac6 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5DUMP) +project (HDF5_TOOLS_SRC_H5DUMP C) # -------------------------------------------------------------------- # Add the h5dump executables diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 473b69e..beebeac 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5FC) +project (HDF5_TOOLS_SRC_H5FC C) # -------------------------------------------------------------------- # Add the h5format_convert executables diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index 375ed82..d79c4f8 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5IMPORT) +project (HDF5_TOOLS_SRC_H5IMPORT C) # -------------------------------------------------------------------- # Add the h5import executables diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index 80a6fcb..c40405b 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5JAM) +project (HDF5_TOOLS_SRC_H5JAM C) # -------------------------------------------------------------------- # Add the h5jam executables diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index ffe3afc..af3a552 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5LS) +project (HDF5_TOOLS_SRC_H5LS C) #----------------------------------------------------------------------------- # Add the h5ls executable diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index accc7ea..631b426 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5REPACK) +project (HDF5_TOOLS_SRC_H5REPACK C) # -------------------------------------------------------------------- # Add h5Repack executables diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index 17eb330..2f7e957 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5STAT) +project (HDF5_TOOLS_SRC_H5STAT C) # -------------------------------------------------------------------- # Add the h5stat executables diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 7126025..021912e 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_MISC) +project (HDF5_TOOLS_SRC_MISC C) # -------------------------------------------------------------------- # Add the misc executables diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index ae9b4c3..f4106fc 100644 --- a/tools/test/CMakeLists.txt +++ b/tools/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST) +project (HDF5_TOOLS_TEST C) #-- Add the h5diff tests add_subdirectory (h5diff) diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index adf8d7a..583f808 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5COPY) +project (HDF5_TOOLS_TEST_H5COPY C) # -------------------------------------------------------------------- # Add the h5copy test executables diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index dfec8d1..edab48b 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5DIFF) +project (HDF5_TOOLS_TEST_H5DIFF C) # -------------------------------------------------------------------- # Add the h5diff and test executables diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index bfc60a5..b9f110f 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5DUMP) +project (HDF5_TOOLS_TEST_H5DUMP C) #----------------------------------------------------------------------------- # If plugin library tests can be tested diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index ae06859..37449f2 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5FC) +project (HDF5_TOOLS_TEST_H5FC C) # -------------------------------------------------------------------- # Add the h5format_convert test executables diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 9d7af99..37029c4 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5IMPORT) +project (HDF5_TOOLS_TEST_H5IMPORT C) # -------------------------------------------------------------------- # Add the h5import executables diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index b3a5677..2f01aa3 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5JAM) +project (HDF5_TOOLS_TEST_H5JAM C) # -------------------------------------------------------------------- # Add the h5jam test executables diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index d5650a5..8da3f4d 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5LS) +project (HDF5_TOOLS_TEST_H5LS C) #----------------------------------------------------------------------------- # If plugin library tests can be tested diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index db84554..1381fd7 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5REPACK) +project (HDF5_TOOLS_TEST_H5REPACK C) # -------------------------------------------------------------------- # Add h5Repack test executables diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index 9d5ff5c..3d171fc 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5STAT) +project (HDF5_TOOLS_TEST_H5STAT C) # -------------------------------------------------------------------- # Add the h5stat test executables diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 4a44ddb..baf1dea 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_MISC) +project (HDF5_TOOLS_TEST_MISC C) # -------------------------------------------------------------------- # Add the misc test executables diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index 04c1223..586be6c 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_MISC_VDS) +project (HDF5_TOOLS_TEST_MISC_VDS C) MACRO (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TOOLS_TEST_MISC_VDS_SOURCE_DIR}/${genfile}.c) diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index f20d9ce..b7c9263 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_PERFORM ) +project (HDF5_TOOLS_TEST_PERFORM C) # -------------------------------------------------------------------- # Add the executables -- cgit v0.12